@agent-team-foundation/first-tree-hub 0.9.2 → 0.9.4
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/{bootstrap-CWcBzk6C.mjs → bootstrap-DWifXj9b.mjs} +5 -5
- package/dist/cli/index.mjs +193 -171
- package/dist/{core-Y7M3d2aZ.mjs → core-USyOOh7y.mjs} +641 -2969
- package/dist/index.mjs +4 -4
- package/dist/{logger-core-2yeIU1fc-B-__AsQO.mjs → logger-core-BTmvdflj-DhdipBkV.mjs} +40 -5
- package/dist/{observability-CJzDFY_G-CmvgUuzc.mjs → observability-DV_fQKqV-CuLWzBxQ.mjs} +8 -3
- package/dist/{observability-Xi-sEZI7.mjs → observability-hDEdrmMS.mjs} +2 -2
- package/dist/web/assets/index-DEbM78Bl.css +1 -0
- package/dist/web/assets/index-os2Tqmer.js +361 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CDv9Rfc_.js +0 -361
- package/dist/web/assets/index-DlK6gHQF.css +0 -1
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
var Qb=e=>{throw TypeError(e)};var um=(e,t,r)=>t.has(e)||Qb("Cannot "+r);var L=(e,t,r)=>(um(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>t.has(e)?Qb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ge=(e,t,r,a)=>(um(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r),Pe=(e,t,r)=>(um(e,t,"access private method"),r);var Mc=(e,t,r,a)=>({set _(l){ge(e,t,l,r)},get _(){return L(e,t,a)}});function u_(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[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"]'))a(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"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(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 a(l){if(l.ep)return;l.ep=!0;const o=r(l);fetch(l.href,o)}})();function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cm={exports:{}},Oo={};/**
|
|
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 Gb;function c_(){if(Gb)return Oo;Gb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,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:a,key:u,ref:l!==void 0?l:null,props:o}}return Oo.Fragment=t,Oo.jsx=r,Oo.jsxs=r,Oo}var Kb;function d_(){return Kb||(Kb=1,cm.exports=c_()),cm.exports}var d=d_(),dm={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 Yb;function f_(){if(Yb)return Le;Yb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=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"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function b(U){return U===null||typeof U!="object"?null:(U=x&&U[x]||U["@@iterator"],typeof U=="function"?U:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,N={};function E(U,T,C){this.props=U,this.context=T,this.refs=N,this.updater=C||k}E.prototype.isReactComponent={},E.prototype.setState=function(U,T){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,T,"setState")},E.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function R(){}R.prototype=E.prototype;function A(U,T,C){this.props=U,this.context=T,this.refs=N,this.updater=C||k}var I=A.prototype=new R;I.constructor=A,j(I,E.prototype),I.isPureReactComponent=!0;var F=Array.isArray;function O(){}var $={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function J(U,T,C){var X=C.ref;return{$$typeof:e,type:U,key:T,ref:X!==void 0?X:null,props:C}}function q(U,T){return J(U.type,T,U.props)}function re(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function ae(U){var T={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(C){return T[C]})}var me=/\/+/g;function ce(U,T){return typeof U=="object"&&U!==null&&U.key!=null?ae(""+U.key):T.toString(36)}function ee(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(O,O):(U.status="pending",U.then(function(T){U.status==="pending"&&(U.status="fulfilled",U.value=T)},function(T){U.status==="pending"&&(U.status="rejected",U.reason=T)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function P(U,T,C,X,H){var oe=typeof U;(oe==="undefined"||oe==="boolean")&&(U=null);var ye=!1;if(U===null)ye=!0;else switch(oe){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(U.$$typeof){case e:case t:ye=!0;break;case v:return ye=U._init,P(ye(U._payload),T,C,X,H)}}if(ye)return H=H(U),ye=X===""?"."+ce(U,0):X,F(H)?(C="",ye!=null&&(C=ye.replace(me,"$&/")+"/"),P(H,T,C,"",function(jt){return jt})):H!=null&&(re(H)&&(H=q(H,C+(H.key==null||U&&U.key===H.key?"":(""+H.key).replace(me,"$&/")+"/")+ye)),T.push(H)),1;ye=0;var De=X===""?".":X+":";if(F(U))for(var ve=0;ve<U.length;ve++)X=U[ve],oe=De+ce(X,ve),ye+=P(X,T,C,oe,H);else if(ve=b(U),typeof ve=="function")for(U=ve.call(U),ve=0;!(X=U.next()).done;)X=X.value,oe=De+ce(X,ve++),ye+=P(X,T,C,oe,H);else if(oe==="object"){if(typeof U.then=="function")return P(ee(U),T,C,X,H);throw T=String(U),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return ye}function W(U,T,C){if(U==null)return U;var X=[],H=0;return P(U,X,"","",function(oe){return T.call(C,oe,H++)}),X}function pe(U){if(U._status===-1){var T=U._result;T=T(),T.then(function(C){(U._status===0||U._status===-1)&&(U._status=1,U._result=C)},function(C){(U._status===0||U._status===-1)&&(U._status=2,U._result=C)}),U._status===-1&&(U._status=0,U._result=T)}if(U._status===1)return U._result.default;throw U._result}var Ce=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},z={map:W,forEach:function(U,T,C){W(U,function(){T.apply(this,arguments)},C)},count:function(U){var T=0;return W(U,function(){T++}),T},toArray:function(U){return W(U,function(T){return T})||[]},only:function(U){if(!re(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Le.Activity=y,Le.Children=z,Le.Component=E,Le.Fragment=r,Le.Profiler=l,Le.PureComponent=A,Le.StrictMode=a,Le.Suspense=m,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Le.__COMPILER_RUNTIME={__proto__:null,c:function(U){return $.H.useMemoCache(U)}},Le.cache=function(U){return function(){return U.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(U,T,C){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var X=j({},U.props),H=U.key;if(T!=null)for(oe in T.key!==void 0&&(H=""+T.key),T)!V.call(T,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&T.ref===void 0||(X[oe]=T[oe]);var oe=arguments.length-2;if(oe===1)X.children=C;else if(1<oe){for(var ye=Array(oe),De=0;De<oe;De++)ye[De]=arguments[De+2];X.children=ye}return J(U.type,H,X)},Le.createContext=function(U){return U={$$typeof:u,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},Le.createElement=function(U,T,C){var X,H={},oe=null;if(T!=null)for(X in T.key!==void 0&&(oe=""+T.key),T)V.call(T,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(H[X]=T[X]);var ye=arguments.length-2;if(ye===1)H.children=C;else if(1<ye){for(var De=Array(ye),ve=0;ve<ye;ve++)De[ve]=arguments[ve+2];H.children=De}if(U&&U.defaultProps)for(X in ye=U.defaultProps,ye)H[X]===void 0&&(H[X]=ye[X]);return J(U,oe,H)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(U){return{$$typeof:f,render:U}},Le.isValidElement=re,Le.lazy=function(U){return{$$typeof:v,_payload:{_status:-1,_result:U},_init:pe}},Le.memo=function(U,T){return{$$typeof:h,type:U,compare:T===void 0?null:T}},Le.startTransition=function(U){var T=$.T,C={};$.T=C;try{var X=U(),H=$.S;H!==null&&H(C,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(O,Ce)}catch(oe){Ce(oe)}finally{T!==null&&C.types!==null&&(T.types=C.types),$.T=T}},Le.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Le.use=function(U){return $.H.use(U)},Le.useActionState=function(U,T,C){return $.H.useActionState(U,T,C)},Le.useCallback=function(U,T){return $.H.useCallback(U,T)},Le.useContext=function(U){return $.H.useContext(U)},Le.useDebugValue=function(){},Le.useDeferredValue=function(U,T){return $.H.useDeferredValue(U,T)},Le.useEffect=function(U,T){return $.H.useEffect(U,T)},Le.useEffectEvent=function(U){return $.H.useEffectEvent(U)},Le.useId=function(){return $.H.useId()},Le.useImperativeHandle=function(U,T,C){return $.H.useImperativeHandle(U,T,C)},Le.useInsertionEffect=function(U,T){return $.H.useInsertionEffect(U,T)},Le.useLayoutEffect=function(U,T){return $.H.useLayoutEffect(U,T)},Le.useMemo=function(U,T){return $.H.useMemo(U,T)},Le.useOptimistic=function(U,T){return $.H.useOptimistic(U,T)},Le.useReducer=function(U,T,C){return $.H.useReducer(U,T,C)},Le.useRef=function(U){return $.H.useRef(U)},Le.useState=function(U){return $.H.useState(U)},Le.useSyncExternalStore=function(U,T,C){return $.H.useSyncExternalStore(U,T,C)},Le.useTransition=function(){return $.H.useTransition()},Le.version="19.2.4",Le}var Xb;function Gp(){return Xb||(Xb=1,dm.exports=f_()),dm.exports}var S=Gp();const h_=kd(S),Kp=u_({__proto__:null,default:h_},[S]);var fm={exports:{}},Do={},hm={exports:{}},mm={};/**
|
|
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 Jb;function m_(){return Jb||(Jb=1,(function(e){function t(P,W){var pe=P.length;P.push(W);e:for(;0<pe;){var Ce=pe-1>>>1,z=P[Ce];if(0<l(z,W))P[Ce]=W,P[pe]=z,pe=Ce;else break e}}function r(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var W=P[0],pe=P.pop();if(pe!==W){P[0]=pe;e:for(var Ce=0,z=P.length,U=z>>>1;Ce<U;){var T=2*(Ce+1)-1,C=P[T],X=T+1,H=P[X];if(0>l(C,pe))X<z&&0>l(H,C)?(P[Ce]=H,P[X]=pe,Ce=X):(P[Ce]=C,P[T]=pe,Ce=T);else if(X<z&&0>l(H,pe))P[Ce]=H,P[X]=pe,Ce=X;else break e}}return W}function l(P,W){var pe=P.sortIndex-W.sortIndex;return pe!==0?pe:P.id-W.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=[],v=1,y=null,x=3,b=!1,k=!1,j=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function I(P){for(var W=r(h);W!==null;){if(W.callback===null)a(h);else if(W.startTime<=P)a(h),W.sortIndex=W.expirationTime,t(m,W);else break;W=r(h)}}function F(P){if(j=!1,I(P),!k)if(r(m)!==null)k=!0,O||(O=!0,ae());else{var W=r(h);W!==null&&ee(F,W.startTime-P)}}var O=!1,$=-1,V=5,J=-1;function q(){return N?!0:!(e.unstable_now()-J<V)}function re(){if(N=!1,O){var P=e.unstable_now();J=P;var W=!0;try{e:{k=!1,j&&(j=!1,R($),$=-1),b=!0;var pe=x;try{t:{for(I(P),y=r(m);y!==null&&!(y.expirationTime>P&&q());){var Ce=y.callback;if(typeof Ce=="function"){y.callback=null,x=y.priorityLevel;var z=Ce(y.expirationTime<=P);if(P=e.unstable_now(),typeof z=="function"){y.callback=z,I(P),W=!0;break t}y===r(m)&&a(m),I(P)}else a(m);y=r(m)}if(y!==null)W=!0;else{var U=r(h);U!==null&&ee(F,U.startTime-P),W=!1}}break e}finally{y=null,x=pe,b=!1}W=void 0}}finally{W?ae():O=!1}}}var ae;if(typeof A=="function")ae=function(){A(re)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ce=me.port2;me.port1.onmessage=re,ae=function(){ce.postMessage(null)}}else ae=function(){E(re,0)};function ee(P,W){$=E(function(){P(e.unstable_now())},W)}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"):V=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(P){switch(x){case 1:case 2:case 3:var W=3;break;default:W=x}var pe=x;x=W;try{return P()}finally{x=pe}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(P,W){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var pe=x;x=P;try{return W()}finally{x=pe}},e.unstable_scheduleCallback=function(P,W,pe){var Ce=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?Ce+pe:Ce):pe=Ce,P){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=pe+z,P={id:v++,callback:W,priorityLevel:P,startTime:pe,expirationTime:z,sortIndex:-1},pe>Ce?(P.sortIndex=pe,t(h,P),r(m)===null&&P===r(h)&&(j?(R($),$=-1):j=!0,ee(F,pe-Ce))):(P.sortIndex=z,t(m,P),k||b||(k=!0,O||(O=!0,ae()))),P},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(P){var W=x;return function(){var pe=x;x=W;try{return P.apply(this,arguments)}finally{x=pe}}}})(mm)),mm}var Wb;function p_(){return Wb||(Wb=1,hm.exports=m_()),hm.exports}var pm={exports:{}},cn={};/**
|
|
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 e0;function g_(){if(e0)return cn;e0=1;var e=Gp();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}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 r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:m,containerInfo:h,implementation:v}}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 cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,cn.createPortal=function(m,h){var v=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,v)},cn.flushSync=function(m){var h=u.T,v=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=v,a.d.f()}},cn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},cn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},cn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var v=h.as,y=f(v,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:b}):v==="script"&&a.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},cn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},cn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=f(v,h.crossOrigin);a.d.L(m,v,{crossOrigin:y,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})}},cn.preloadModule=function(m,h){if(typeof m=="string")if(h){var v=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},cn.requestFormReset=function(m){a.d.r(m)},cn.unstable_batchedUpdates=function(m,h){return m(h)},cn.useFormState=function(m,h,v){return u.H.useFormState(m,h,v)},cn.useFormStatus=function(){return u.H.useHostTransitionStatus()},cn.version="19.2.4",cn}var t0;function RS(){if(t0)return pm.exports;t0=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(),pm.exports=g_(),pm.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 n0;function y_(){if(n0)return Do;n0=1;var e=p_(),t=Gp(),r=RS();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function o(n){var i=n,s=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(s=i.return),n=i.return;while(n)}return i.tag===3?s:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function m(n){if(o(n)!==n)throw Error(a(188))}function h(n){var i=n.alternate;if(!i){if(i=o(n),i===null)throw Error(a(188));return i!==n?null:n}for(var s=n,c=i;;){var p=s.return;if(p===null)break;var g=p.alternate;if(g===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===s)return m(p),n;if(g===c)return m(p),i;g=g.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=g;else{for(var w=!1,_=p.child;_;){if(_===s){w=!0,s=p,c=g;break}if(_===c){w=!0,c=p,s=g;break}_=_.sibling}if(!w){for(_=g.child;_;){if(_===s){w=!0,s=g,c=p;break}if(_===c){w=!0,c=g,s=p;break}_=_.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==c)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),A=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function ae(n){return n===null||typeof n!="object"?null:(n=re&&n[re]||n["@@iterator"],typeof n=="function"?n:null)}var me=Symbol.for("react.client.reference");function ce(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===me?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case j:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case F:return"Suspense";case O:return"SuspenseList";case J:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case k:return"Portal";case A:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case I:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case $:return i=n.displayName||null,i!==null?i:ce(n.type)||"Memo";case V:i=n._payload,n=n._init;try{return ce(n(i))}catch{}}return null}var ee=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},Ce=[],z=-1;function U(n){return{current:n}}function T(n){0>z||(n.current=Ce[z],Ce[z]=null,z--)}function C(n,i){z++,Ce[z]=n.current,n.current=i}var X=U(null),H=U(null),oe=U(null),ye=U(null);function De(n,i){switch(C(oe,i),C(H,n),C(X,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?gb(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=gb(i),n=yb(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}T(X),C(X,n)}function ve(){T(X),T(H),T(oe)}function jt(n){n.memoizedState!==null&&C(ye,n);var i=X.current,s=yb(i,n.type);i!==s&&(C(H,n),C(X,s))}function Wt(n){H.current===n&&(T(X),T(H)),ye.current===n&&(T(ye),Ao._currentValue=pe)}var wn,xr;function en(n){if(wn===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);wn=i&&i[1]||"",xr=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+wn+n+xr}var Gr=!1;function _r(n,i){if(!n||Gr)return"";Gr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){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(Y){var K=Y}Reflect.construct(n,[],se)}else{try{se.call()}catch(Y){K=Y}n.call(se.prototype)}}else{try{throw Error()}catch(Y){K=Y}(se=n())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Y){if(Y&&K&&typeof Y.stack=="string")return[Y.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 g=c.DetermineComponentFrameRoot(),w=g[0],_=g[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 n.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",n.displayName)),te}while(1<=c&&0<=p);break}}}finally{Gr=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?en(s):""}function Et(n,i){switch(n.tag){case 26:case 27:case 5:return en(n.type);case 16:return en("Lazy");case 13:return n.child!==i&&i!==null?en("Suspense Fallback"):en("Suspense");case 19:return en("SuspenseList");case 0:case 15:return _r(n.type,!1);case 11:return _r(n.type.render,!1);case 1:return _r(n.type,!0);case 31:return en("Activity");default:return""}}function Kt(n){try{var i="",s=null;do i+=Et(n,s),s=n,n=n.return;while(n);return i}catch(c){return`
|
|
47
|
-
Error generating stack: `+c.message+`
|
|
48
|
-
`+c.stack}}var kn=Object.prototype.hasOwnProperty,Kr=e.unstable_scheduleCallback,Ni=e.unstable_cancelCallback,$s=e.unstable_shouldYield,yl=e.unstable_requestPaint,tn=e.unstable_now,Fs=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,nt=e.unstable_IdlePriority,mn=e.log,br=e.unstable_setDisableYieldValue,nn=null,Mt=null;function un(n){if(typeof mn=="function"&&br(n),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(nn,n)}catch{}}var ct=Math.clz32?Math.clz32:bu,Ar=Math.log,jn=Math.LN2;function bu(n){return n>>>=0,n===0?32:31-(Ar(n)/jn|0)|0}var Ca=256,Na=262144,_a=4194304;function Tr(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Aa(n,i,s){var c=n.pendingLanes;if(c===0)return 0;var p=0,g=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var _=c&134217727;return _!==0?(c=_&~g,c!==0?p=Tr(c):(w&=_,w!==0?p=Tr(w):s||(s=_&~n,s!==0&&(p=Tr(s))))):(_=c&~g,_!==0?p=Tr(_):w!==0?p=Tr(w):s||(s=c&~n,s!==0&&(p=Tr(s)))),p===0?0:i!==0&&i!==p&&(i&g)===0&&(g=p&-p,s=i&-i,g>=s||g===32&&(s&4194048)!==0)?i:p}function _i(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function Su(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ue(){var n=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),n}function Qe(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function pn(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function wu(n,i,s,c,p,g){var w=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var _=n.entanglements,M=n.expirationTimes,G=n.hiddenUpdates;for(s=w&~s;0<s;){var te=31-ct(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 Y=K[te];Y!==null&&(Y.lane&=-536870913)}s&=~se}c!==0&&Yd(n,c,0),g!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=g&~(w&~i))}function Yd(n,i,s){n.pendingLanes|=i,n.suspendedLanes&=~i;var c=31-ct(i);n.entangledLanes|=i,n.entanglements[c]=n.entanglements[c]|1073741824|s&261930}function Wg(n,i){var s=n.entangledLanes|=i;for(n=n.entanglements;s;){var c=31-ct(s),p=1<<c;p&i|n[c]&i&&(n[c]|=i),s&=~p}}function ey(n,i){var s=i&-i;return s=(s&42)!==0?1:Xd(s),(s&(n.suspendedLanes|i))!==0?0:s}function Xd(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Jd(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ty(){var n=W.p;return n!==0?n:(n=window.event,n===void 0?32:Bb(n.type))}function ny(n,i){var s=W.p;try{return W.p=n,i()}finally{W.p=s}}var Ai=Math.random().toString(36).slice(2),rn="__reactFiber$"+Ai,En="__reactProps$"+Ai,vl="__reactContainer$"+Ai,Wd="__reactEvents$"+Ai,JE="__reactListeners$"+Ai,WE="__reactHandles$"+Ai,ry="__reactResources$"+Ai,qs="__reactMarker$"+Ai;function ef(n){delete n[rn],delete n[En],delete n[Wd],delete n[JE],delete n[WE]}function xl(n){var i=n[rn];if(i)return i;for(var s=n.parentNode;s;){if(i=s[vl]||s[rn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(n=jb(n);n!==null;){if(s=n[rn])return s;n=jb(n)}return i}n=s,s=n.parentNode}return null}function bl(n){if(n=n[rn]||n[vl]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function Hs(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Sl(n){var i=n[ry];return i||(i=n[ry]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Yt(n){n[qs]=!0}var iy=new Set,ay={};function Ta(n,i){wl(n,i),wl(n+"Capture",i)}function wl(n,i){for(ay[n]=i,n=0;n<i.length;n++)iy.add(i[n])}var eC=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]*$"),ly={},sy={};function tC(n){return kn.call(sy,n)?!0:kn.call(ly,n)?!1:eC.test(n)?sy[n]=!0:(ly[n]=!0,!1)}function ku(n,i,s){if(tC(i))if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+s)}}function ju(n,i,s){if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+s)}}function Yr(n,i,s,c){if(c===null)n.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(i,s,""+c)}}function nr(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function oy(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function nC(n,i,s){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,g=c.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,g.call(this,w)}}),Object.defineProperty(n,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function tf(n){if(!n._valueTracker){var i=oy(n)?"checked":"value";n._valueTracker=nC(n,i,""+n[i])}}function uy(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return n&&(c=oy(n)?n.checked?"true":"false":n.value),n=c,n!==s?(i.setValue(n),!0):!1}function Eu(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var rC=/[\n"\\]/g;function rr(n){return n.replace(rC,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function nf(n,i,s,c,p,g,w,_){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),i!=null?w==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+nr(i)):n.value!==""+nr(i)&&(n.value=""+nr(i)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),i!=null?rf(n,w,nr(i)):s!=null?rf(n,w,nr(s)):c!=null&&n.removeAttribute("value"),p==null&&g!=null&&(n.defaultChecked=!!g),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+nr(_):n.removeAttribute("name")}function cy(n,i,s,c,p,g,w,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){tf(n);return}s=s!=null?""+nr(s):"",i=i!=null?""+nr(i):s,_||i===n.value||(n.value=i),n.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=_?n.checked:!!c,n.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),tf(n)}function rf(n,i,s){i==="number"&&Eu(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function kl(n,i,s,c){if(n=n.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<n.length;s++)p=i.hasOwnProperty("$"+n[s].value),n[s].selected!==p&&(n[s].selected=p),p&&c&&(n[s].defaultSelected=!0)}else{for(s=""+nr(s),i=null,p=0;p<n.length;p++){if(n[p].value===s){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}i!==null||n[p].disabled||(i=n[p])}i!==null&&(i.selected=!0)}}function dy(n,i,s){if(i!=null&&(i=""+nr(i),i!==n.value&&(n.value=i),s==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=s!=null?""+nr(s):""}function fy(n,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(ee(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=nr(i),n.defaultValue=s,c=n.textContent,c===s&&c!==""&&c!==null&&(n.value=c),tf(n)}function jl(n,i){if(i){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=i;return}}n.textContent=i}var iC=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 hy(n,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":c?n.setProperty(i,s):typeof s!="number"||s===0||iC.has(i)?i==="float"?n.cssFloat=s:n[i]=(""+s).trim():n[i]=s+"px"}function my(n,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&hy(n,p,c)}else for(var g in i)i.hasOwnProperty(g)&&hy(n,g,i[g])}function af(n){if(n.indexOf("-")===-1)return!1;switch(n){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 aC=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"]]),lC=/^[\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 Cu(n){return lC.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Xr(){}var lf=null;function sf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var El=null,Cl=null;function py(n){var i=bl(n);if(i&&(n=i.stateNode)){var s=n[En]||null;e:switch(n=i.stateNode,i.type){case"input":if(nf(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+rr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==n&&c.form===n.form){var p=c[En]||null;if(!p)throw Error(a(90));nf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===n.form&&uy(c)}break e;case"textarea":dy(n,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&kl(n,!!s.multiple,i,!1)}}}var of=!1;function gy(n,i,s){if(of)return n(i,s);of=!0;try{var c=n(i);return c}finally{if(of=!1,(El!==null||Cl!==null)&&(hc(),El&&(i=El,n=Cl,Cl=El=null,py(i),n)))for(i=0;i<n.length;i++)py(n[i])}}function Zs(n,i){var s=n.stateNode;if(s===null)return null;var c=s[En]||null;if(c===null)return null;s=c[i];e:switch(i){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)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uf=!1;if(Jr)try{var Vs={};Object.defineProperty(Vs,"passive",{get:function(){uf=!0}}),window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{uf=!1}var Ti=null,cf=null,Nu=null;function yy(){if(Nu)return Nu;var n,i=cf,s=i.length,c,p="value"in Ti?Ti.value:Ti.textContent,g=p.length;for(n=0;n<s&&i[n]===p[n];n++);var w=s-n;for(c=1;c<=w&&i[s-c]===p[g-c];c++);return Nu=p.slice(n,1<c?1-c:void 0)}function _u(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Au(){return!0}function vy(){return!1}function Cn(n){function i(s,c,p,g,w){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(s=n[_],this[_]=s?s(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Au:vy,this.isPropagationStopped=vy,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),i}var za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tu=Cn(za),Qs=y({},za,{view:0,detail:0}),sC=Cn(Qs),df,ff,Gs,zu=y({},Qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Gs&&(Gs&&n.type==="mousemove"?(df=n.screenX-Gs.screenX,ff=n.screenY-Gs.screenY):ff=df=0,Gs=n),df)},movementY:function(n){return"movementY"in n?n.movementY:ff}}),xy=Cn(zu),oC=y({},zu,{dataTransfer:0}),uC=Cn(oC),cC=y({},Qs,{relatedTarget:0}),hf=Cn(cC),dC=y({},za,{animationName:0,elapsedTime:0,pseudoElement:0}),fC=Cn(dC),hC=y({},za,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),mC=Cn(hC),pC=y({},za,{data:0}),by=Cn(pC),gC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yC={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"},vC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xC(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=vC[n])?!!i[n]:!1}function mf(){return xC}var bC=y({},Qs,{key:function(n){if(n.key){var i=gC[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=_u(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?yC[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mf,charCode:function(n){return n.type==="keypress"?_u(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_u(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),SC=Cn(bC),wC=y({},zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sy=Cn(wC),kC=y({},Qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mf}),jC=Cn(kC),EC=y({},za,{propertyName:0,elapsedTime:0,pseudoElement:0}),CC=Cn(EC),NC=y({},zu,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),_C=Cn(NC),AC=y({},za,{newState:0,oldState:0}),TC=Cn(AC),zC=[9,13,27,32],pf=Jr&&"CompositionEvent"in window,Ks=null;Jr&&"documentMode"in document&&(Ks=document.documentMode);var RC=Jr&&"TextEvent"in window&&!Ks,wy=Jr&&(!pf||Ks&&8<Ks&&11>=Ks),ky=" ",jy=!1;function Ey(n,i){switch(n){case"keyup":return zC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cy(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Nl=!1;function OC(n,i){switch(n){case"compositionend":return Cy(i);case"keypress":return i.which!==32?null:(jy=!0,ky);case"textInput":return n=i.data,n===ky&&jy?null:n;default:return null}}function DC(n,i){if(Nl)return n==="compositionend"||!pf&&Ey(n,i)?(n=yy(),Nu=cf=Ti=null,Nl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return wy&&i.locale!=="ko"?null:i.data;default:return null}}var MC={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 Ny(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!MC[n.type]:i==="textarea"}function _y(n,i,s,c){El?Cl?Cl.push(c):Cl=[c]:El=c,i=bc(i,"onChange"),0<i.length&&(s=new Tu("onChange","change",null,s,c),n.push({event:s,listeners:i}))}var Ys=null,Xs=null;function LC(n){cb(n,0)}function Ru(n){var i=Hs(n);if(uy(i))return n}function Ay(n,i){if(n==="change")return i}var Ty=!1;if(Jr){var gf;if(Jr){var yf="oninput"in document;if(!yf){var zy=document.createElement("div");zy.setAttribute("oninput","return;"),yf=typeof zy.oninput=="function"}gf=yf}else gf=!1;Ty=gf&&(!document.documentMode||9<document.documentMode)}function Ry(){Ys&&(Ys.detachEvent("onpropertychange",Oy),Xs=Ys=null)}function Oy(n){if(n.propertyName==="value"&&Ru(Xs)){var i=[];_y(i,Xs,n,sf(n)),gy(LC,i)}}function UC(n,i,s){n==="focusin"?(Ry(),Ys=i,Xs=s,Ys.attachEvent("onpropertychange",Oy)):n==="focusout"&&Ry()}function IC(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ru(Xs)}function PC(n,i){if(n==="click")return Ru(i)}function BC(n,i){if(n==="input"||n==="change")return Ru(i)}function $C(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Fn=typeof Object.is=="function"?Object.is:$C;function Js(n,i){if(Fn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var s=Object.keys(n),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!kn.call(i,p)||!Fn(n[p],i[p]))return!1}return!0}function Dy(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function My(n,i){var s=Dy(n);n=0;for(var c;s;){if(s.nodeType===3){if(c=n+s.textContent.length,n<=i&&c>=i)return{node:s,offset:i-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Dy(s)}}function Ly(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Ly(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Uy(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Eu(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=Eu(n.document)}return i}function vf(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var FC=Jr&&"documentMode"in document&&11>=document.documentMode,_l=null,xf=null,Ws=null,bf=!1;function Iy(n,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;bf||_l==null||_l!==Eu(c)||(c=_l,"selectionStart"in c&&vf(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}),Ws&&Js(Ws,c)||(Ws=c,c=bc(xf,"onSelect"),0<c.length&&(i=new Tu("onSelect","select",null,i,s),n.push({event:i,listeners:c}),i.target=_l)))}function Ra(n,i){var s={};return s[n.toLowerCase()]=i.toLowerCase(),s["Webkit"+n]="webkit"+i,s["Moz"+n]="moz"+i,s}var Al={animationend:Ra("Animation","AnimationEnd"),animationiteration:Ra("Animation","AnimationIteration"),animationstart:Ra("Animation","AnimationStart"),transitionrun:Ra("Transition","TransitionRun"),transitionstart:Ra("Transition","TransitionStart"),transitioncancel:Ra("Transition","TransitionCancel"),transitionend:Ra("Transition","TransitionEnd")},Sf={},Py={};Jr&&(Py=document.createElement("div").style,"AnimationEvent"in window||(delete Al.animationend.animation,delete Al.animationiteration.animation,delete Al.animationstart.animation),"TransitionEvent"in window||delete Al.transitionend.transition);function Oa(n){if(Sf[n])return Sf[n];if(!Al[n])return n;var i=Al[n],s;for(s in i)if(i.hasOwnProperty(s)&&s in Py)return Sf[n]=i[s];return n}var By=Oa("animationend"),$y=Oa("animationiteration"),Fy=Oa("animationstart"),qC=Oa("transitionrun"),HC=Oa("transitionstart"),ZC=Oa("transitioncancel"),qy=Oa("transitionend"),Hy=new Map,wf="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(" ");wf.push("scrollEnd");function Sr(n,i){Hy.set(n,i),Ta(i,[n])}var Ou=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},ir=[],Tl=0,kf=0;function Du(){for(var n=Tl,i=kf=Tl=0;i<n;){var s=ir[i];ir[i++]=null;var c=ir[i];ir[i++]=null;var p=ir[i];ir[i++]=null;var g=ir[i];if(ir[i++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}g!==0&&Zy(s,p,g)}}function Mu(n,i,s,c){ir[Tl++]=n,ir[Tl++]=i,ir[Tl++]=s,ir[Tl++]=c,kf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function jf(n,i,s,c){return Mu(n,i,s,c),Lu(n)}function Da(n,i){return Mu(n,null,null,i),Lu(n)}function Zy(n,i,s){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s);for(var p=!1,g=n.return;g!==null;)g.childLanes|=s,c=g.alternate,c!==null&&(c.childLanes|=s),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(p=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,p&&i!==null&&(p=31-ct(s),n=g.hiddenUpdates,c=n[p],c===null?n[p]=[i]:c.push(i),i.lane=s|536870912),g):null}function Lu(n){if(50<wo)throw wo=0,Oh=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var zl={};function VC(n,i,s,c){this.tag=n,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=i,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 qn(n,i,s,c){return new VC(n,i,s,c)}function Ef(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Wr(n,i){var s=n.alternate;return s===null?(s=qn(n.tag,i,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=i,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,i=n.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function Vy(n,i){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,i=s.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Uu(n,i,s,c,p,g){var w=0;if(c=n,typeof n=="function")Ef(n)&&(w=1);else if(typeof n=="string")w=XN(n,s,X.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case J:return n=qn(31,s,i,p),n.elementType=J,n.lanes=g,n;case j:return Ma(s.children,p,g,i);case N:w=8,p|=24;break;case E:return n=qn(12,s,i,p|2),n.elementType=E,n.lanes=g,n;case F:return n=qn(13,s,i,p),n.elementType=F,n.lanes=g,n;case O:return n=qn(19,s,i,p),n.elementType=O,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case A:w=10;break e;case R:w=9;break e;case I:w=11;break e;case $:w=14;break e;case V:w=16,c=null;break e}w=29,s=Error(a(130,n===null?"null":typeof n,"")),c=null}return i=qn(w,s,i,p),i.elementType=n,i.type=c,i.lanes=g,i}function Ma(n,i,s,c){return n=qn(7,n,c,i),n.lanes=s,n}function Cf(n,i,s){return n=qn(6,n,null,i),n.lanes=s,n}function Qy(n){var i=qn(18,null,null,0);return i.stateNode=n,i}function Nf(n,i,s){return i=qn(4,n.children!==null?n.children:[],n.key,i),i.lanes=s,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Gy=new WeakMap;function ar(n,i){if(typeof n=="object"&&n!==null){var s=Gy.get(n);return s!==void 0?s:(i={value:n,source:i,stack:Kt(i)},Gy.set(n,i),i)}return{value:n,source:i,stack:Kt(i)}}var Rl=[],Ol=0,Iu=null,eo=0,lr=[],sr=0,zi=null,zr=1,Rr="";function ei(n,i){Rl[Ol++]=eo,Rl[Ol++]=Iu,Iu=n,eo=i}function Ky(n,i,s){lr[sr++]=zr,lr[sr++]=Rr,lr[sr++]=zi,zi=n;var c=zr;n=Rr;var p=32-ct(c)-1;c&=~(1<<p),s+=1;var g=32-ct(i)+p;if(30<g){var w=p-p%5;g=(c&(1<<w)-1).toString(32),c>>=w,p-=w,zr=1<<32-ct(i)+p|s<<p|c,Rr=g+n}else zr=1<<g|s<<p|c,Rr=n}function _f(n){n.return!==null&&(ei(n,1),Ky(n,1,0))}function Af(n){for(;n===Iu;)Iu=Rl[--Ol],Rl[Ol]=null,eo=Rl[--Ol],Rl[Ol]=null;for(;n===zi;)zi=lr[--sr],lr[sr]=null,Rr=lr[--sr],lr[sr]=null,zr=lr[--sr],lr[sr]=null}function Yy(n,i){lr[sr++]=zr,lr[sr++]=Rr,lr[sr++]=zi,zr=i.id,Rr=i.overflow,zi=n}var an=null,wt=null,Xe=!1,Ri=null,or=!1,Tf=Error(a(519));function Oi(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw to(ar(i,n)),Tf}function Xy(n){var i=n.stateNode,s=n.type,c=n.memoizedProps;switch(i[rn]=n,i[En]=c,s){case"dialog":Ze("cancel",i),Ze("close",i);break;case"iframe":case"object":case"embed":Ze("load",i);break;case"video":case"audio":for(s=0;s<jo.length;s++)Ze(jo[s],i);break;case"source":Ze("error",i);break;case"img":case"image":case"link":Ze("error",i),Ze("load",i);break;case"details":Ze("toggle",i);break;case"input":Ze("invalid",i),cy(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ze("invalid",i);break;case"textarea":Ze("invalid",i),fy(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||mb(i.textContent,s)?(c.popover!=null&&(Ze("beforetoggle",i),Ze("toggle",i)),c.onScroll!=null&&Ze("scroll",i),c.onScrollEnd!=null&&Ze("scrollend",i),c.onClick!=null&&(i.onclick=Xr),i=!0):i=!1,i||Oi(n,!0)}function Jy(n){for(an=n.return;an;)switch(an.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:an=an.return}}function Dl(n){if(n!==an)return!1;if(!Xe)return Jy(n),Xe=!0,!1;var i=n.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Gh(n.type,n.memoizedProps)),s=!s),s&&wt&&Oi(n),Jy(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));wt=kb(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));wt=kb(n)}else i===27?(i=wt,Qi(n.type)?(n=Wh,Wh=null,wt=n):wt=i):wt=an?cr(n.stateNode.nextSibling):null;return!0}function La(){wt=an=null,Xe=!1}function zf(){var n=Ri;return n!==null&&(Tn===null?Tn=n:Tn.push.apply(Tn,n),Ri=null),n}function to(n){Ri===null?Ri=[n]:Ri.push(n)}var Rf=U(null),Ua=null,ti=null;function Di(n,i,s){C(Rf,i._currentValue),i._currentValue=s}function ni(n){n._currentValue=Rf.current,T(Rf)}function Of(n,i,s){for(;n!==null;){var c=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),n===s)break;n=n.return}}function Df(n,i,s,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var g=p.dependencies;if(g!==null){var w=p.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=p;for(var M=0;M<i.length;M++)if(_.context===i[M]){g.lanes|=s,_=g.alternate,_!==null&&(_.lanes|=s),Of(g.return,s,n),c||(w=null);break e}g=_.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,g=w.alternate,g!==null&&(g.lanes|=s),Of(w,s,n),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===n){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Ml(n,i,s,c){n=null;for(var p=i,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var _=p.type;Fn(p.pendingProps.value,w.value)||(n!==null?n.push(_):n=[_])}}else if(p===ye.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Ao):n=[Ao])}p=p.return}n!==null&&Df(i,n,s,c),i.flags|=262144}function Pu(n){for(n=n.firstContext;n!==null;){if(!Fn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ia(n){Ua=n,ti=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function ln(n){return Wy(Ua,n)}function Bu(n,i){return Ua===null&&Ia(n),Wy(n,i)}function Wy(n,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ti===null){if(n===null)throw Error(a(308));ti=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else ti=ti.next=i;return s}var QC=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(s,c){n.push(c)}};this.abort=function(){i.aborted=!0,n.forEach(function(s){return s()})}},GC=e.unstable_scheduleCallback,KC=e.unstable_NormalPriority,It={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mf(){return{controller:new QC,data:new Map,refCount:0}}function no(n){n.refCount--,n.refCount===0&&GC(KC,function(){n.controller.abort()})}var ro=null,Lf=0,Ll=0,Ul=null;function YC(n,i){if(ro===null){var s=ro=[];Lf=0,Ll=Ph(),Ul={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Lf++,i.then(ev,ev),i}function ev(){if(--Lf===0&&ro!==null){Ul!==null&&(Ul.status="fulfilled");var n=ro;ro=null,Ll=0,Ul=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function XC(n,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return n.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var tv=P.S;P.S=function(n,i){Ix=tn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&YC(n,i),tv!==null&&tv(n,i)};var Pa=U(null);function Uf(){var n=Pa.current;return n!==null?n:yt.pooledCache}function $u(n,i){i===null?C(Pa,Pa.current):C(Pa,i.pool)}function nv(){var n=Uf();return n===null?null:{parent:It._currentValue,pool:n}}var Il=Error(a(460)),If=Error(a(474)),Fu=Error(a(542)),qu={then:function(){}};function rv(n){return n=n.status,n==="fulfilled"||n==="rejected"}function iv(n,i,s){switch(s=n[s],s===void 0?n.push(i):s!==i&&(i.then(Xr,Xr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,lv(n),n;default:if(typeof i.status=="string")i.then(Xr,Xr);else{if(n=yt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,lv(n),n}throw $a=i,Il}}function Ba(n){try{var i=n._init;return i(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?($a=s,Il):s}}var $a=null;function av(){if($a===null)throw Error(a(459));var n=$a;return $a=null,n}function lv(n){if(n===Il||n===Fu)throw Error(a(483))}var Pl=null,io=0;function Hu(n){var i=io;return io+=1,Pl===null&&(Pl=[]),iv(Pl,n,i)}function ao(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Zu(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function sv(n){function i(Z,B){if(n){var Q=Z.deletions;Q===null?(Z.deletions=[B],Z.flags|=16):Q.push(B)}}function s(Z,B){if(!n)return null;for(;B!==null;)i(Z,B),B=B.sibling;return null}function c(Z){for(var B=new Map;Z!==null;)Z.key!==null?B.set(Z.key,Z):B.set(Z.index,Z),Z=Z.sibling;return B}function p(Z,B){return Z=Wr(Z,B),Z.index=0,Z.sibling=null,Z}function g(Z,B,Q){return Z.index=Q,n?(Q=Z.alternate,Q!==null?(Q=Q.index,Q<B?(Z.flags|=67108866,B):Q):(Z.flags|=67108866,B)):(Z.flags|=1048576,B)}function w(Z){return n&&Z.alternate===null&&(Z.flags|=67108866),Z}function _(Z,B,Q,le){return B===null||B.tag!==6?(B=Cf(Q,Z.mode,le),B.return=Z,B):(B=p(B,Q),B.return=Z,B)}function M(Z,B,Q,le){var Ae=Q.type;return Ae===j?te(Z,B,Q.props.children,le,Q.key):B!==null&&(B.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&Ba(Ae)===B.type)?(B=p(B,Q.props),ao(B,Q),B.return=Z,B):(B=Uu(Q.type,Q.key,Q.props,null,Z.mode,le),ao(B,Q),B.return=Z,B)}function G(Z,B,Q,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==Q.containerInfo||B.stateNode.implementation!==Q.implementation?(B=Nf(Q,Z.mode,le),B.return=Z,B):(B=p(B,Q.children||[]),B.return=Z,B)}function te(Z,B,Q,le,Ae){return B===null||B.tag!==7?(B=Ma(Q,Z.mode,le,Ae),B.return=Z,B):(B=p(B,Q),B.return=Z,B)}function se(Z,B,Q){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Cf(""+B,Z.mode,Q),B.return=Z,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return Q=Uu(B.type,B.key,B.props,null,Z.mode,Q),ao(Q,B),Q.return=Z,Q;case k:return B=Nf(B,Z.mode,Q),B.return=Z,B;case V:return B=Ba(B),se(Z,B,Q)}if(ee(B)||ae(B))return B=Ma(B,Z.mode,Q,null),B.return=Z,B;if(typeof B.then=="function")return se(Z,Hu(B),Q);if(B.$$typeof===A)return se(Z,Bu(Z,B),Q);Zu(Z,B)}return null}function K(Z,B,Q,le){var Ae=B!==null?B.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ae!==null?null:_(Z,B,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return Q.key===Ae?M(Z,B,Q,le):null;case k:return Q.key===Ae?G(Z,B,Q,le):null;case V:return Q=Ba(Q),K(Z,B,Q,le)}if(ee(Q)||ae(Q))return Ae!==null?null:te(Z,B,Q,le,null);if(typeof Q.then=="function")return K(Z,B,Hu(Q),le);if(Q.$$typeof===A)return K(Z,B,Bu(Z,Q),le);Zu(Z,Q)}return null}function Y(Z,B,Q,le,Ae){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Z=Z.get(Q)||null,_(B,Z,""+le,Ae);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return Z=Z.get(le.key===null?Q:le.key)||null,M(B,Z,le,Ae);case k:return Z=Z.get(le.key===null?Q:le.key)||null,G(B,Z,le,Ae);case V:return le=Ba(le),Y(Z,B,Q,le,Ae)}if(ee(le)||ae(le))return Z=Z.get(Q)||null,te(B,Z,le,Ae,null);if(typeof le.then=="function")return Y(Z,B,Q,Hu(le),Ae);if(le.$$typeof===A)return Y(Z,B,Q,Bu(B,le),Ae);Zu(B,le)}return null}function Se(Z,B,Q,le){for(var Ae=null,rt=null,je=B,Ie=B=0,Ke=null;je!==null&&Ie<Q.length;Ie++){je.index>Ie?(Ke=je,je=null):Ke=je.sibling;var it=K(Z,je,Q[Ie],le);if(it===null){je===null&&(je=Ke);break}n&&je&&it.alternate===null&&i(Z,je),B=g(it,B,Ie),rt===null?Ae=it:rt.sibling=it,rt=it,je=Ke}if(Ie===Q.length)return s(Z,je),Xe&&ei(Z,Ie),Ae;if(je===null){for(;Ie<Q.length;Ie++)je=se(Z,Q[Ie],le),je!==null&&(B=g(je,B,Ie),rt===null?Ae=je:rt.sibling=je,rt=je);return Xe&&ei(Z,Ie),Ae}for(je=c(je);Ie<Q.length;Ie++)Ke=Y(je,Z,Ie,Q[Ie],le),Ke!==null&&(n&&Ke.alternate!==null&&je.delete(Ke.key===null?Ie:Ke.key),B=g(Ke,B,Ie),rt===null?Ae=Ke:rt.sibling=Ke,rt=Ke);return n&&je.forEach(function(Ji){return i(Z,Ji)}),Xe&&ei(Z,Ie),Ae}function ze(Z,B,Q,le){if(Q==null)throw Error(a(151));for(var Ae=null,rt=null,je=B,Ie=B=0,Ke=null,it=Q.next();je!==null&&!it.done;Ie++,it=Q.next()){je.index>Ie?(Ke=je,je=null):Ke=je.sibling;var Ji=K(Z,je,it.value,le);if(Ji===null){je===null&&(je=Ke);break}n&&je&&Ji.alternate===null&&i(Z,je),B=g(Ji,B,Ie),rt===null?Ae=Ji:rt.sibling=Ji,rt=Ji,je=Ke}if(it.done)return s(Z,je),Xe&&ei(Z,Ie),Ae;if(je===null){for(;!it.done;Ie++,it=Q.next())it=se(Z,it.value,le),it!==null&&(B=g(it,B,Ie),rt===null?Ae=it:rt.sibling=it,rt=it);return Xe&&ei(Z,Ie),Ae}for(je=c(je);!it.done;Ie++,it=Q.next())it=Y(je,Z,Ie,it.value,le),it!==null&&(n&&it.alternate!==null&&je.delete(it.key===null?Ie:it.key),B=g(it,B,Ie),rt===null?Ae=it:rt.sibling=it,rt=it);return n&&je.forEach(function(o_){return i(Z,o_)}),Xe&&ei(Z,Ie),Ae}function pt(Z,B,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 b:e:{for(var Ae=Q.key;B!==null;){if(B.key===Ae){if(Ae=Q.type,Ae===j){if(B.tag===7){s(Z,B.sibling),le=p(B,Q.props.children),le.return=Z,Z=le;break e}}else if(B.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&Ba(Ae)===B.type){s(Z,B.sibling),le=p(B,Q.props),ao(le,Q),le.return=Z,Z=le;break e}s(Z,B);break}else i(Z,B);B=B.sibling}Q.type===j?(le=Ma(Q.props.children,Z.mode,le,Q.key),le.return=Z,Z=le):(le=Uu(Q.type,Q.key,Q.props,null,Z.mode,le),ao(le,Q),le.return=Z,Z=le)}return w(Z);case k:e:{for(Ae=Q.key;B!==null;){if(B.key===Ae)if(B.tag===4&&B.stateNode.containerInfo===Q.containerInfo&&B.stateNode.implementation===Q.implementation){s(Z,B.sibling),le=p(B,Q.children||[]),le.return=Z,Z=le;break e}else{s(Z,B);break}else i(Z,B);B=B.sibling}le=Nf(Q,Z.mode,le),le.return=Z,Z=le}return w(Z);case V:return Q=Ba(Q),pt(Z,B,Q,le)}if(ee(Q))return Se(Z,B,Q,le);if(ae(Q)){if(Ae=ae(Q),typeof Ae!="function")throw Error(a(150));return Q=Ae.call(Q),ze(Z,B,Q,le)}if(typeof Q.then=="function")return pt(Z,B,Hu(Q),le);if(Q.$$typeof===A)return pt(Z,B,Bu(Z,Q),le);Zu(Z,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,B!==null&&B.tag===6?(s(Z,B.sibling),le=p(B,Q),le.return=Z,Z=le):(s(Z,B),le=Cf(Q,Z.mode,le),le.return=Z,Z=le),w(Z)):s(Z,B)}return function(Z,B,Q,le){try{io=0;var Ae=pt(Z,B,Q,le);return Pl=null,Ae}catch(je){if(je===Il||je===Fu)throw je;var rt=qn(29,je,null,Z.mode);return rt.lanes=le,rt.return=Z,rt}finally{}}}var Fa=sv(!0),ov=sv(!1),Mi=!1;function Pf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bf(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Li(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ui(n,i,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(lt&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=Lu(n),Zy(n,null,s),i}return Mu(n,c,i,s),Lu(n)}function lo(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,Wg(n,s)}}function $f(n,i){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?p=g=w:g=g.next=w,s=s.next}while(s!==null);g===null?p=g=i:g=g.next=i}else p=g=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var Ff=!1;function so(){if(Ff){var n=Ul;if(n!==null)throw n}}function oo(n,i,s,c){Ff=!1;var p=n.updateQueue;Mi=!1;var g=p.firstBaseUpdate,w=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var M=_,G=M.next;M.next=null,w===null?g=G:w.next=G,w=M;var te=n.alternate;te!==null&&(te=te.updateQueue,_=te.lastBaseUpdate,_!==w&&(_===null?te.firstBaseUpdate=G:_.next=G,te.lastBaseUpdate=M))}if(g!==null){var se=p.baseState;w=0,te=G=M=null,_=g;do{var K=_.lane&-536870913,Y=K!==_.lane;if(Y?(Ge&K)===K:(c&K)===K){K!==0&&K===Ll&&(Ff=!0),te!==null&&(te=te.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Se=n,ze=_;K=i;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=y({},se,K);break e;case 2:Mi=!0}}K=_.callback,K!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=p.callbacks,Y===null?p.callbacks=[K]:Y.push(K))}else Y={lane:K,tag:_.tag,payload:_.payload,callback:_.callback,next:null},te===null?(G=te=Y,M=se):te=te.next=Y,w|=K;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,p.lastBaseUpdate=Y,p.shared.pending=null}}while(!0);te===null&&(M=se),p.baseState=M,p.firstBaseUpdate=G,p.lastBaseUpdate=te,g===null&&(p.shared.lanes=0),Fi|=w,n.lanes=w,n.memoizedState=se}}function uv(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function cv(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)uv(s[n],i)}var Bl=U(null),Vu=U(0);function dv(n,i){n=di,C(Vu,n),C(Bl,i),di=n|i.baseLanes}function qf(){C(Vu,di),C(Bl,Bl.current)}function Hf(){di=Vu.current,T(Bl),T(Vu)}var Hn=U(null),ur=null;function Ii(n){var i=n.alternate;C(Lt,Lt.current&1),C(Hn,n),ur===null&&(i===null||Bl.current!==null||i.memoizedState!==null)&&(ur=n)}function Zf(n){C(Lt,Lt.current),C(Hn,n),ur===null&&(ur=n)}function fv(n){n.tag===22?(C(Lt,Lt.current),C(Hn,n),ur===null&&(ur=n)):Pi()}function Pi(){C(Lt,Lt.current),C(Hn,Hn.current)}function Zn(n){T(Hn),ur===n&&(ur=null),T(Lt)}var Lt=U(0);function Qu(n){for(var i=n;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Xh(s)||Jh(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ri=0,Ue=null,ht=null,Pt=null,Gu=!1,$l=!1,qa=!1,Ku=0,uo=0,Fl=null,JC=0;function Rt(){throw Error(a(321))}function Vf(n,i){if(i===null)return!1;for(var s=0;s<i.length&&s<n.length;s++)if(!Fn(n[s],i[s]))return!1;return!0}function Qf(n,i,s,c,p,g){return ri=g,Ue=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=n===null||n.memoizedState===null?Kv:oh,qa=!1,g=s(c,p),qa=!1,$l&&(g=mv(i,s,c,p)),hv(n),g}function hv(n){P.H=ho;var i=ht!==null&&ht.next!==null;if(ri=0,Pt=ht=Ue=null,Gu=!1,uo=0,Fl=null,i)throw Error(a(300));n===null||Bt||(n=n.dependencies,n!==null&&Pu(n)&&(Bt=!0))}function mv(n,i,s,c){Ue=n;var p=0;do{if($l&&(Fl=null),uo=0,$l=!1,25<=p)throw Error(a(301));if(p+=1,Pt=ht=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}P.H=Yv,g=i(s,c)}while($l);return g}function WC(){var n=P.H,i=n.useState()[0];return i=typeof i.then=="function"?co(i):i,n=n.useState()[0],(ht!==null?ht.memoizedState:null)!==n&&(Ue.flags|=1024),i}function Gf(){var n=Ku!==0;return Ku=0,n}function Kf(n,i,s){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~s}function Yf(n){if(Gu){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Gu=!1}ri=0,Pt=ht=Ue=null,$l=!1,uo=Ku=0,Fl=null}function gn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Ue.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function Ut(){if(ht===null){var n=Ue.alternate;n=n!==null?n.memoizedState:null}else n=ht.next;var i=Pt===null?Ue.memoizedState:Pt.next;if(i!==null)Pt=i,ht=n;else{if(n===null)throw Ue.alternate===null?Error(a(467)):Error(a(310));ht=n,n={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Pt===null?Ue.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function Yu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function co(n){var i=uo;return uo+=1,Fl===null&&(Fl=[]),n=iv(Fl,n,i),i=Ue,(Pt===null?i.memoizedState:Pt.next)===null&&(i=i.alternate,P.H=i===null||i.memoizedState===null?Kv:oh),n}function Xu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return co(n);if(n.$$typeof===A)return ln(n)}throw Error(a(438,String(n)))}function Xf(n){var i=null,s=Ue.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Ue.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Yu(),Ue.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(n),c=0;c<n;c++)s[c]=q;return i.index++,s}function ii(n,i){return typeof i=="function"?i(n):i}function Ju(n){var i=Ut();return Jf(i,ht,n)}function Jf(n,i,s){var c=n.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=n.baseQueue,g=c.pending;if(g!==null){if(p!==null){var w=p.next;p.next=g.next,g.next=w}i.baseQueue=p=g,c.pending=null}if(g=n.baseState,p===null)n.memoizedState=g;else{i=p.next;var _=w=null,M=null,G=i,te=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(Ge&se)===se:(ri&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===Ll&&(te=!0);else if((ri&K)===K){G=G.next,K===Ll&&(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=g):M=M.next=se,Ue.lanes|=K,Fi|=K;se=G.action,qa&&s(g,se),g=G.hasEagerState?G.eagerState:s(g,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=g):M=M.next=K,Ue.lanes|=se,Fi|=se;G=G.next}while(G!==null&&G!==i);if(M===null?w=g:M.next=_,!Fn(g,n.memoizedState)&&(Bt=!0,te&&(s=Ul,s!==null)))throw s;n.memoizedState=g,n.baseState=w,n.baseQueue=M,c.lastRenderedState=g}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Wf(n){var i=Ut(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=n;var c=s.dispatch,p=s.pending,g=i.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do g=n(g,w.action),w=w.next;while(w!==p);Fn(g,i.memoizedState)||(Bt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),s.lastRenderedState=g}return[g,c]}function pv(n,i,s){var c=Ue,p=Ut(),g=Xe;if(g){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Fn((ht||p).memoizedState,s);if(w&&(p.memoizedState=s,Bt=!0),p=p.queue,nh(vv.bind(null,c,p,n),[n]),p.getSnapshot!==i||w||Pt!==null&&Pt.memoizedState.tag&1){if(c.flags|=2048,ql(9,{destroy:void 0},yv.bind(null,c,p,s,i),null),yt===null)throw Error(a(349));g||(ri&127)!==0||gv(c,i,s)}return s}function gv(n,i,s){n.flags|=16384,n={getSnapshot:i,value:s},i=Ue.updateQueue,i===null?(i=Yu(),Ue.updateQueue=i,i.stores=[n]):(s=i.stores,s===null?i.stores=[n]:s.push(n))}function yv(n,i,s,c){i.value=s,i.getSnapshot=c,xv(i)&&bv(n)}function vv(n,i,s){return s(function(){xv(i)&&bv(n)})}function xv(n){var i=n.getSnapshot;n=n.value;try{var s=i();return!Fn(n,s)}catch{return!0}}function bv(n){var i=Da(n,2);i!==null&&zn(i,n,2)}function eh(n){var i=gn();if(typeof n=="function"){var s=n;if(n=s(),qa){un(!0);try{s()}finally{un(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:n},i}function Sv(n,i,s,c){return n.baseState=s,Jf(n,ht,typeof c=="function"?c:ii)}function eN(n,i,s,c,p){if(tc(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){g.listeners.push(w)}};P.T!==null?s(!0):g.isTransition=!1,c(g),s=i.pending,s===null?(g.next=i.pending=g,wv(i,g)):(g.next=s.next,i.pending=s.next=g)}}function wv(n,i){var s=i.action,c=i.payload,p=n.state;if(i.isTransition){var g=P.T,w={};P.T=w;try{var _=s(p,c),M=P.S;M!==null&&M(w,_),kv(n,i,_)}catch(G){th(n,i,G)}finally{g!==null&&w.types!==null&&(g.types=w.types),P.T=g}}else try{g=s(p,c),kv(n,i,g)}catch(G){th(n,i,G)}}function kv(n,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){jv(n,i,c)},function(c){return th(n,i,c)}):jv(n,i,s)}function jv(n,i,s){i.status="fulfilled",i.value=s,Ev(i),n.state=s,i=n.pending,i!==null&&(s=i.next,s===i?n.pending=null:(s=s.next,i.next=s,wv(n,s)))}function th(n,i,s){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,Ev(i),i=i.next;while(i!==c)}n.action=null}function Ev(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Cv(n,i){return i}function Nv(n,i){if(Xe){var s=yt.formState;if(s!==null){e:{var c=Ue;if(Xe){if(wt){t:{for(var p=wt,g=or;p.nodeType!==8;){if(!g){p=null;break t}if(p=cr(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){wt=cr(p.nextSibling),c=p.data==="F!";break e}}Oi(c)}c=!1}c&&(i=s[0])}}return s=gn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cv,lastRenderedState:i},s.queue=c,s=Vv.bind(null,Ue,c),c.dispatch=s,c=eh(!1),g=sh.bind(null,Ue,!1,c.queue),c=gn(),p={state:i,dispatch:null,action:n,pending:null},c.queue=p,s=eN.bind(null,Ue,p,g,s),p.dispatch=s,c.memoizedState=n,[i,s,!1]}function _v(n){var i=Ut();return Av(i,ht,n)}function Av(n,i,s){if(i=Jf(n,i,Cv)[0],n=Ju(ii)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=co(i)}catch(w){throw w===Il?Fu:w}else c=i;i=Ut();var p=i.queue,g=p.dispatch;return s!==i.memoizedState&&(Ue.flags|=2048,ql(9,{destroy:void 0},tN.bind(null,p,s),null)),[c,g,n]}function tN(n,i){n.action=i}function Tv(n){var i=Ut(),s=ht;if(s!==null)return Av(i,s,n);Ut(),i=i.memoizedState,s=Ut();var c=s.queue.dispatch;return s.memoizedState=n,[i,c,!1]}function ql(n,i,s,c){return n={tag:n,create:s,deps:c,inst:i,next:null},i=Ue.updateQueue,i===null&&(i=Yu(),Ue.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=n.next=n:(c=s.next,s.next=n,n.next=c,i.lastEffect=n),n}function zv(){return Ut().memoizedState}function Wu(n,i,s,c){var p=gn();Ue.flags|=n,p.memoizedState=ql(1|i,{destroy:void 0},s,c===void 0?null:c)}function ec(n,i,s,c){var p=Ut();c=c===void 0?null:c;var g=p.memoizedState.inst;ht!==null&&c!==null&&Vf(c,ht.memoizedState.deps)?p.memoizedState=ql(i,g,s,c):(Ue.flags|=n,p.memoizedState=ql(1|i,g,s,c))}function Rv(n,i){Wu(8390656,8,n,i)}function nh(n,i){ec(2048,8,n,i)}function nN(n){Ue.flags|=4;var i=Ue.updateQueue;if(i===null)i=Yu(),Ue.updateQueue=i,i.events=[n];else{var s=i.events;s===null?i.events=[n]:s.push(n)}}function Ov(n){var i=Ut().memoizedState;return nN({ref:i,nextImpl:n}),function(){if((lt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Dv(n,i){return ec(4,2,n,i)}function Mv(n,i){return ec(4,4,n,i)}function Lv(n,i){if(typeof i=="function"){n=n();var s=i(n);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Uv(n,i,s){s=s!=null?s.concat([n]):null,ec(4,4,Lv.bind(null,i,n),s)}function rh(){}function Iv(n,i){var s=Ut();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&Vf(i,c[1])?c[0]:(s.memoizedState=[n,i],n)}function Pv(n,i){var s=Ut();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&Vf(i,c[1]))return c[0];if(c=n(),qa){un(!0);try{n()}finally{un(!1)}}return s.memoizedState=[c,i],c}function ih(n,i,s){return s===void 0||(ri&1073741824)!==0&&(Ge&261930)===0?n.memoizedState=i:(n.memoizedState=s,n=Bx(),Ue.lanes|=n,Fi|=n,s)}function Bv(n,i,s,c){return Fn(s,i)?s:Bl.current!==null?(n=ih(n,s,c),Fn(n,i)||(Bt=!0),n):(ri&42)===0||(ri&1073741824)!==0&&(Ge&261930)===0?(Bt=!0,n.memoizedState=s):(n=Bx(),Ue.lanes|=n,Fi|=n,i)}function $v(n,i,s,c,p){var g=W.p;W.p=g!==0&&8>g?g:8;var w=P.T,_={};P.T=_,sh(n,!1,i,s);try{var M=p(),G=P.S;if(G!==null&&G(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var te=XC(M,c);fo(n,i,te,Gn(n))}else fo(n,i,c,Gn(n))}catch(se){fo(n,i,{then:function(){},status:"rejected",reason:se},Gn())}finally{W.p=g,w!==null&&_.types!==null&&(w.types=_.types),P.T=w}}function rN(){}function ah(n,i,s,c){if(n.tag!==5)throw Error(a(476));var p=Fv(n).queue;$v(n,p,i,pe,s===null?rN:function(){return qv(n),s(c)})}function Fv(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:pe},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function qv(n){var i=Fv(n);i.next===null&&(i=n.alternate.memoizedState),fo(n,i.next.queue,{},Gn())}function lh(){return ln(Ao)}function Hv(){return Ut().memoizedState}function Zv(){return Ut().memoizedState}function iN(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=Gn();n=Li(s);var c=Ui(i,n,s);c!==null&&(zn(c,i,s),lo(c,i,s)),i={cache:Mf()},n.payload=i;return}i=i.return}}function aN(n,i,s){var c=Gn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},tc(n)?Qv(i,s):(s=jf(n,i,s,c),s!==null&&(zn(s,n,c),Gv(s,i,c)))}function Vv(n,i,s){var c=Gn();fo(n,i,s,c)}function fo(n,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(tc(n))Qv(i,p);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var w=i.lastRenderedState,_=g(w,s);if(p.hasEagerState=!0,p.eagerState=_,Fn(_,w))return Mu(n,i,p,0),yt===null&&Du(),!1}catch{}finally{}if(s=jf(n,i,p,c),s!==null)return zn(s,n,c),Gv(s,i,c),!0}return!1}function sh(n,i,s,c){if(c={lane:2,revertLane:Ph(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},tc(n)){if(i)throw Error(a(479))}else i=jf(n,s,c,2),i!==null&&zn(i,n,2)}function tc(n){var i=n.alternate;return n===Ue||i!==null&&i===Ue}function Qv(n,i){$l=Gu=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function Gv(n,i,s){if((s&4194048)!==0){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,Wg(n,s)}}var ho={readContext:ln,use:Xu,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};ho.useEffectEvent=Rt;var Kv={readContext:ln,use:Xu,useCallback:function(n,i){return gn().memoizedState=[n,i===void 0?null:i],n},useContext:ln,useEffect:Rv,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,Wu(4194308,4,Lv.bind(null,i,n),s)},useLayoutEffect:function(n,i){return Wu(4194308,4,n,i)},useInsertionEffect:function(n,i){Wu(4,2,n,i)},useMemo:function(n,i){var s=gn();i=i===void 0?null:i;var c=n();if(qa){un(!0);try{n()}finally{un(!1)}}return s.memoizedState=[c,i],c},useReducer:function(n,i,s){var c=gn();if(s!==void 0){var p=s(i);if(qa){un(!0);try{s(i)}finally{un(!1)}}}else p=i;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=aN.bind(null,Ue,n),[c.memoizedState,n]},useRef:function(n){var i=gn();return n={current:n},i.memoizedState=n},useState:function(n){n=eh(n);var i=n.queue,s=Vv.bind(null,Ue,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:rh,useDeferredValue:function(n,i){var s=gn();return ih(s,n,i)},useTransition:function(){var n=eh(!1);return n=$v.bind(null,Ue,n.queue,!0,!1),gn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var c=Ue,p=gn();if(Xe){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),yt===null)throw Error(a(349));(Ge&127)!==0||gv(c,i,s)}p.memoizedState=s;var g={value:s,getSnapshot:i};return p.queue=g,Rv(vv.bind(null,c,g,n),[n]),c.flags|=2048,ql(9,{destroy:void 0},yv.bind(null,c,g,s,i),null),s},useId:function(){var n=gn(),i=yt.identifierPrefix;if(Xe){var s=Rr,c=zr;s=(c&~(1<<32-ct(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ku++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=JC++,i="_"+i+"r_"+s.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:lh,useFormState:Nv,useActionState:Nv,useOptimistic:function(n){var i=gn();i.memoizedState=i.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=sh.bind(null,Ue,!0,s),s.dispatch=i,[n,i]},useMemoCache:Xf,useCacheRefresh:function(){return gn().memoizedState=iN.bind(null,Ue)},useEffectEvent:function(n){var i=gn(),s={impl:n};return i.memoizedState=s,function(){if((lt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},oh={readContext:ln,use:Xu,useCallback:Iv,useContext:ln,useEffect:nh,useImperativeHandle:Uv,useInsertionEffect:Dv,useLayoutEffect:Mv,useMemo:Pv,useReducer:Ju,useRef:zv,useState:function(){return Ju(ii)},useDebugValue:rh,useDeferredValue:function(n,i){var s=Ut();return Bv(s,ht.memoizedState,n,i)},useTransition:function(){var n=Ju(ii)[0],i=Ut().memoizedState;return[typeof n=="boolean"?n:co(n),i]},useSyncExternalStore:pv,useId:Hv,useHostTransitionStatus:lh,useFormState:_v,useActionState:_v,useOptimistic:function(n,i){var s=Ut();return Sv(s,ht,n,i)},useMemoCache:Xf,useCacheRefresh:Zv};oh.useEffectEvent=Ov;var Yv={readContext:ln,use:Xu,useCallback:Iv,useContext:ln,useEffect:nh,useImperativeHandle:Uv,useInsertionEffect:Dv,useLayoutEffect:Mv,useMemo:Pv,useReducer:Wf,useRef:zv,useState:function(){return Wf(ii)},useDebugValue:rh,useDeferredValue:function(n,i){var s=Ut();return ht===null?ih(s,n,i):Bv(s,ht.memoizedState,n,i)},useTransition:function(){var n=Wf(ii)[0],i=Ut().memoizedState;return[typeof n=="boolean"?n:co(n),i]},useSyncExternalStore:pv,useId:Hv,useHostTransitionStatus:lh,useFormState:Tv,useActionState:Tv,useOptimistic:function(n,i){var s=Ut();return ht!==null?Sv(s,ht,n,i):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:Xf,useCacheRefresh:Zv};Yv.useEffectEvent=Ov;function uh(n,i,s,c){i=n.memoizedState,s=s(c,i),s=s==null?i:y({},i,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var ch={enqueueSetState:function(n,i,s){n=n._reactInternals;var c=Gn(),p=Li(c);p.payload=i,s!=null&&(p.callback=s),i=Ui(n,p,c),i!==null&&(zn(i,n,c),lo(i,n,c))},enqueueReplaceState:function(n,i,s){n=n._reactInternals;var c=Gn(),p=Li(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Ui(n,p,c),i!==null&&(zn(i,n,c),lo(i,n,c))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var s=Gn(),c=Li(s);c.tag=2,i!=null&&(c.callback=i),i=Ui(n,c,s),i!==null&&(zn(i,n,s),lo(i,n,s))}};function Xv(n,i,s,c,p,g,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,g,w):i.prototype&&i.prototype.isPureReactComponent?!Js(s,c)||!Js(p,g):!0}function Jv(n,i,s,c){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==n&&ch.enqueueReplaceState(i,i.state,null)}function Ha(n,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}if(n=n.defaultProps){s===i&&(s=y({},s));for(var p in n)s[p]===void 0&&(s[p]=n[p])}return s}function Wv(n){Ou(n)}function ex(n){console.error(n)}function tx(n){Ou(n)}function nc(n,i){try{var s=n.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function nx(n,i,s){try{var c=n.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function dh(n,i,s){return s=Li(s),s.tag=3,s.payload={element:null},s.callback=function(){nc(n,i)},s}function rx(n){return n=Li(n),n.tag=3,n}function ix(n,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var g=c.value;n.payload=function(){return p(g)},n.callback=function(){nx(i,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){nx(i,s,c),typeof p!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function lN(n,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Ml(i,s,p,!0),s=Hn.current,s!==null){switch(s.tag){case 31:case 13:return ur===null?mc():s.alternate===null&&Ot===0&&(Ot=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===qu?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),Lh(n,c,p)),!1;case 22:return s.flags|=65536,c===qu?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),Lh(n,c,p)),!1}throw Error(a(435,s.tag))}return Lh(n,c,p),mc(),!1}if(Xe)return i=Hn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==Tf&&(n=Error(a(422),{cause:c}),to(ar(n,s)))):(c!==Tf&&(i=Error(a(423),{cause:c}),to(ar(i,s))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=ar(c,s),p=dh(n.stateNode,c,p),$f(n,p),Ot!==4&&(Ot=2)),!1;var g=Error(a(520),{cause:c});if(g=ar(g,s),So===null?So=[g]:So.push(g),Ot!==4&&(Ot=2),i===null)return!0;c=ar(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,n=p&-p,s.lanes|=n,n=dh(s.stateNode,c,n),$f(s,n),!1;case 1:if(i=s.type,g=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(qi===null||!qi.has(g))))return s.flags|=65536,p&=-p,s.lanes|=p,p=rx(p),ix(p,n,s,c),$f(s,p),!1}s=s.return}while(s!==null);return!1}var fh=Error(a(461)),Bt=!1;function sn(n,i,s,c){i.child=n===null?ov(i,null,s,c):Fa(i,n.child,s,c)}function ax(n,i,s,c,p){s=s.render;var g=i.ref;if("ref"in c){var w={};for(var _ in c)_!=="ref"&&(w[_]=c[_])}else w=c;return Ia(i),c=Qf(n,i,s,w,g,p),_=Gf(),n!==null&&!Bt?(Kf(n,i,p),ai(n,i,p)):(Xe&&_&&_f(i),i.flags|=1,sn(n,i,c,p),i.child)}function lx(n,i,s,c,p){if(n===null){var g=s.type;return typeof g=="function"&&!Ef(g)&&g.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=g,sx(n,i,g,c,p)):(n=Uu(s.type,null,c,i,i.mode,p),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!bh(n,p)){var w=g.memoizedProps;if(s=s.compare,s=s!==null?s:Js,s(w,c)&&n.ref===i.ref)return ai(n,i,p)}return i.flags|=1,n=Wr(g,c),n.ref=i.ref,n.return=i,i.child=n}function sx(n,i,s,c,p){if(n!==null){var g=n.memoizedProps;if(Js(g,c)&&n.ref===i.ref)if(Bt=!1,i.pendingProps=c=g,bh(n,p))(n.flags&131072)!==0&&(Bt=!0);else return i.lanes=n.lanes,ai(n,i,p)}return hh(n,i,s,c,p)}function ox(n,i,s,c){var p=c.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|s:s,n!==null){for(c=i.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~g}else c=0,i.child=null;return ux(n,i,g,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&$u(i,g!==null?g.cachePool:null),g!==null?dv(i,g):qf(),fv(i);else return c=i.lanes=536870912,ux(n,i,g!==null?g.baseLanes|s:s,s,c)}else g!==null?($u(i,g.cachePool),dv(i,g),Pi(),i.memoizedState=null):(n!==null&&$u(i,null),qf(),Pi());return sn(n,i,p,s),i.child}function mo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ux(n,i,s,c,p){var g=Uf();return g=g===null?null:{parent:It._currentValue,pool:g},i.memoizedState={baseLanes:s,cachePool:g},n!==null&&$u(i,null),qf(),fv(i),n!==null&&Ml(n,i,c,!0),i.childLanes=p,null}function rc(n,i){return i=ac({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function cx(n,i,s){return Fa(i,n.child,null,s),n=rc(i,i.pendingProps),n.flags|=2,Zn(i),i.memoizedState=null,n}function sN(n,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Xe){if(c.mode==="hidden")return n=rc(i,c),i.lanes=536870912,mo(null,n);if(Zf(i),(n=wt)?(n=wb(n,or),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:zi!==null?{id:zr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},s=Qy(n),s.return=i,i.child=s,an=i,wt=null)):n=null,n===null)throw Oi(i);return i.lanes=536870912,null}return rc(i,c)}var g=n.memoizedState;if(g!==null){var w=g.dehydrated;if(Zf(i),p)if(i.flags&256)i.flags&=-257,i=cx(n,i,s);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Bt||Ml(n,i,s,!1),p=(s&n.childLanes)!==0,Bt||p){if(c=yt,c!==null&&(w=ey(c,s),w!==0&&w!==g.retryLane))throw g.retryLane=w,Da(n,w),zn(c,n,w),fh;mc(),i=cx(n,i,s)}else n=g.treeContext,wt=cr(w.nextSibling),an=i,Xe=!0,Ri=null,or=!1,n!==null&&Yy(i,n),i=rc(i,c),i.flags|=4096;return i}return n=Wr(n.child,{mode:c.mode,children:c.children}),n.ref=i.ref,i.child=n,n.return=i,n}function ic(n,i){var s=i.ref;if(s===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(n===null||n.ref!==s)&&(i.flags|=4194816)}}function hh(n,i,s,c,p){return Ia(i),s=Qf(n,i,s,c,void 0,p),c=Gf(),n!==null&&!Bt?(Kf(n,i,p),ai(n,i,p)):(Xe&&c&&_f(i),i.flags|=1,sn(n,i,s,p),i.child)}function dx(n,i,s,c,p,g){return Ia(i),i.updateQueue=null,s=mv(i,c,s,p),hv(n),c=Gf(),n!==null&&!Bt?(Kf(n,i,g),ai(n,i,g)):(Xe&&c&&_f(i),i.flags|=1,sn(n,i,s,g),i.child)}function fx(n,i,s,c,p){if(Ia(i),i.stateNode===null){var g=zl,w=s.contextType;typeof w=="object"&&w!==null&&(g=ln(w)),g=new s(c,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=ch,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=c,g.state=i.memoizedState,g.refs={},Pf(i),w=s.contextType,g.context=typeof w=="object"&&w!==null?ln(w):zl,g.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(uh(i,s,w,c),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&ch.enqueueReplaceState(g,g.state,null),oo(i,c,g,p),so(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,M=Ha(s,_);g.props=M;var G=g.context,te=s.contextType;w=zl,typeof te=="object"&&te!==null&&(w=ln(te));var se=s.getDerivedStateFromProps;te=typeof se=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,te||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||G!==w)&&Jv(i,g,c,w),Mi=!1;var K=i.memoizedState;g.state=K,oo(i,c,g,p),so(),G=i.memoizedState,_||K!==G||Mi?(typeof se=="function"&&(uh(i,s,se,c),G=i.memoizedState),(M=Mi||Xv(i,s,M,c,K,G,w))?(te||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=G),g.props=c,g.state=G,g.context=w,c=M):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{g=i.stateNode,Bf(n,i),w=i.memoizedProps,te=Ha(s,w),g.props=te,se=i.pendingProps,K=g.context,G=s.contextType,M=zl,typeof G=="object"&&G!==null&&(M=ln(G)),_=s.getDerivedStateFromProps,(G=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==se||K!==M)&&Jv(i,g,c,M),Mi=!1,K=i.memoizedState,g.state=K,oo(i,c,g,p),so();var Y=i.memoizedState;w!==se||K!==Y||Mi||n!==null&&n.dependencies!==null&&Pu(n.dependencies)?(typeof _=="function"&&(uh(i,s,_,c),Y=i.memoizedState),(te=Mi||Xv(i,s,te,c,K,Y,M)||n!==null&&n.dependencies!==null&&Pu(n.dependencies))?(G||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,Y,M),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,Y,M)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=Y),g.props=c,g.state=Y,g.context=M,c=te):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=1024),c=!1)}return g=c,ic(n,i),c=(i.flags&128)!==0,g||c?(g=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&c?(i.child=Fa(i,n.child,null,p),i.child=Fa(i,null,s,p)):sn(n,i,s,p),i.memoizedState=g.state,n=i.child):n=ai(n,i,p),n}function hx(n,i,s,c){return La(),i.flags|=256,sn(n,i,s,c),i.child}var mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ph(n){return{baseLanes:n,cachePool:nv()}}function gh(n,i,s){return n=n!==null?n.childLanes&~s:0,i&&(n|=Qn),n}function mx(n,i,s){var c=i.pendingProps,p=!1,g=(i.flags&128)!==0,w;if((w=g)||(w=n!==null&&n.memoizedState===null?!1:(Lt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,n===null){if(Xe){if(p?Ii(i):Pi(),(n=wt)?(n=wb(n,or),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:zi!==null?{id:zr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},s=Qy(n),s.return=i,i.child=s,an=i,wt=null)):n=null,n===null)throw Oi(i);return Jh(n)?i.lanes=32:i.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(Pi(),p=i.mode,_=ac({mode:"hidden",children:_},p),c=Ma(c,p,s,null),_.return=i,c.return=i,_.sibling=c,i.child=_,c=i.child,c.memoizedState=ph(s),c.childLanes=gh(n,w,s),i.memoizedState=mh,mo(null,c)):(Ii(i),yh(i,_))}var M=n.memoizedState;if(M!==null&&(_=M.dehydrated,_!==null)){if(g)i.flags&256?(Ii(i),i.flags&=-257,i=vh(n,i,s)):i.memoizedState!==null?(Pi(),i.child=n.child,i.flags|=128,i=null):(Pi(),_=c.fallback,p=i.mode,c=ac({mode:"visible",children:c.children},p),_=Ma(_,p,s,null),_.flags|=2,c.return=i,_.return=i,c.sibling=_,i.child=c,Fa(i,n.child,null,s),c=i.child,c.memoizedState=ph(s),c.childLanes=gh(n,w,s),i.memoizedState=mh,i=mo(null,c));else if(Ii(i),Jh(_)){if(w=_.nextSibling&&_.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(a(419)),c.stack="",c.digest=w,to({value:c,source:null,stack:null}),i=vh(n,i,s)}else if(Bt||Ml(n,i,s,!1),w=(s&n.childLanes)!==0,Bt||w){if(w=yt,w!==null&&(c=ey(w,s),c!==0&&c!==M.retryLane))throw M.retryLane=c,Da(n,c),zn(w,n,c),fh;Xh(_)||mc(),i=vh(n,i,s)}else Xh(_)?(i.flags|=192,i.child=n.child,i=null):(n=M.treeContext,wt=cr(_.nextSibling),an=i,Xe=!0,Ri=null,or=!1,n!==null&&Yy(i,n),i=yh(i,c.children),i.flags|=4096);return i}return p?(Pi(),_=c.fallback,p=i.mode,M=n.child,G=M.sibling,c=Wr(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,G!==null?_=Wr(G,_):(_=Ma(_,p,s,null),_.flags|=2),_.return=i,c.return=i,c.sibling=_,i.child=c,mo(null,c),c=i.child,_=n.child.memoizedState,_===null?_=ph(s):(p=_.cachePool,p!==null?(M=It._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=nv(),_={baseLanes:_.baseLanes|s,cachePool:p}),c.memoizedState=_,c.childLanes=gh(n,w,s),i.memoizedState=mh,mo(n.child,c)):(Ii(i),s=n.child,n=s.sibling,s=Wr(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,n!==null&&(w=i.deletions,w===null?(i.deletions=[n],i.flags|=16):w.push(n)),i.child=s,i.memoizedState=null,s)}function yh(n,i){return i=ac({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function ac(n,i){return n=qn(22,n,null,i),n.lanes=0,n}function vh(n,i,s){return Fa(i,n.child,null,s),n=yh(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function px(n,i,s){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i),Of(n.return,i,s)}function xh(n,i,s,c,p,g){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:g}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=g)}function gx(n,i,s){var c=i.pendingProps,p=c.revealOrder,g=c.tail;c=c.children;var w=Lt.current,_=(w&2)!==0;if(_?(w=w&1|2,i.flags|=128):w&=1,C(Lt,w),sn(n,i,c,s),c=Xe?eo:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&px(n,s,i);else if(n.tag===19)px(n,s,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)n=s.alternate,n!==null&&Qu(n)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),xh(i,!1,p,s,g,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(n=p.alternate,n!==null&&Qu(n)===null){i.child=p;break}n=p.sibling,p.sibling=s,s=p,p=n}xh(i,!0,s,null,g,c);break;case"together":xh(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function ai(n,i,s){if(n!==null&&(i.dependencies=n.dependencies),Fi|=i.lanes,(s&i.childLanes)===0)if(n!==null){if(Ml(n,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,s=Wr(n,n.pendingProps),i.child=s,s.return=i;n.sibling!==null;)n=n.sibling,s=s.sibling=Wr(n,n.pendingProps),s.return=i;s.sibling=null}return i.child}function bh(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Pu(n)))}function oN(n,i,s){switch(i.tag){case 3:De(i,i.stateNode.containerInfo),Di(i,It,n.memoizedState.cache),La();break;case 27:case 5:jt(i);break;case 4:De(i,i.stateNode.containerInfo);break;case 10:Di(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Zf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Ii(i),i.flags|=128,null):(s&i.child.childLanes)!==0?mx(n,i,s):(Ii(i),n=ai(n,i,s),n!==null?n.sibling:null);Ii(i);break;case 19:var p=(n.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Ml(n,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return gx(n,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),C(Lt,Lt.current),c)break;return null;case 22:return i.lanes=0,ox(n,i,s,i.pendingProps);case 24:Di(i,It,n.memoizedState.cache)}return ai(n,i,s)}function yx(n,i,s){if(n!==null)if(n.memoizedProps!==i.pendingProps)Bt=!0;else{if(!bh(n,s)&&(i.flags&128)===0)return Bt=!1,oN(n,i,s);Bt=(n.flags&131072)!==0}else Bt=!1,Xe&&(i.flags&1048576)!==0&&Ky(i,eo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(n=Ba(i.elementType),i.type=n,typeof n=="function")Ef(n)?(c=Ha(n,c),i.tag=1,i=fx(null,i,n,c,s)):(i.tag=0,i=hh(null,i,n,c,s));else{if(n!=null){var p=n.$$typeof;if(p===I){i.tag=11,i=ax(null,i,n,c,s);break e}else if(p===$){i.tag=14,i=lx(null,i,n,c,s);break e}}throw i=ce(n)||n,Error(a(306,i,""))}}return i;case 0:return hh(n,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=Ha(c,i.pendingProps),fx(n,i,c,p,s);case 3:e:{if(De(i,i.stateNode.containerInfo),n===null)throw Error(a(387));c=i.pendingProps;var g=i.memoizedState;p=g.element,Bf(n,i),oo(i,c,null,s);var w=i.memoizedState;if(c=w.cache,Di(i,It,c),c!==g.cache&&Df(i,[It],s,!0),so(),c=w.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=hx(n,i,c,s);break e}else if(c!==p){p=ar(Error(a(424)),i),to(p),i=hx(n,i,c,s);break e}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(wt=cr(n.firstChild),an=i,Xe=!0,Ri=null,or=!0,s=ov(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(La(),c===p){i=ai(n,i,s);break e}sn(n,i,c,s)}i=i.child}return i;case 26:return ic(n,i),n===null?(s=_b(i.type,null,i.pendingProps,null))?i.memoizedState=s:Xe||(s=i.type,n=i.pendingProps,c=Sc(oe.current).createElement(s),c[rn]=i,c[En]=n,on(c,s,n),Yt(c),i.stateNode=c):i.memoizedState=_b(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return jt(i),n===null&&Xe&&(c=i.stateNode=Eb(i.type,i.pendingProps,oe.current),an=i,or=!0,p=wt,Qi(i.type)?(Wh=p,wt=cr(c.firstChild)):wt=p),sn(n,i,i.pendingProps.children,s),ic(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Xe&&((p=c=wt)&&(c=IN(c,i.type,i.pendingProps,or),c!==null?(i.stateNode=c,an=i,wt=cr(c.firstChild),or=!1,p=!0):p=!1),p||Oi(i)),jt(i),p=i.type,g=i.pendingProps,w=n!==null?n.memoizedProps:null,c=g.children,Gh(p,g)?c=null:w!==null&&Gh(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=Qf(n,i,WC,null,null,s),Ao._currentValue=p),ic(n,i),sn(n,i,c,s),i.child;case 6:return n===null&&Xe&&((n=s=wt)&&(s=PN(s,i.pendingProps,or),s!==null?(i.stateNode=s,an=i,wt=null,n=!0):n=!1),n||Oi(i)),null;case 13:return mx(n,i,s);case 4:return De(i,i.stateNode.containerInfo),c=i.pendingProps,n===null?i.child=Fa(i,null,c,s):sn(n,i,c,s),i.child;case 11:return ax(n,i,i.type,i.pendingProps,s);case 7:return sn(n,i,i.pendingProps,s),i.child;case 8:return sn(n,i,i.pendingProps.children,s),i.child;case 12:return sn(n,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,Di(i,i.type,c.value),sn(n,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,Ia(i),p=ln(p),c=c(p),i.flags|=1,sn(n,i,c,s),i.child;case 14:return lx(n,i,i.type,i.pendingProps,s);case 15:return sx(n,i,i.type,i.pendingProps,s);case 19:return gx(n,i,s);case 31:return sN(n,i,s);case 22:return ox(n,i,s,i.pendingProps);case 24:return Ia(i),c=ln(It),n===null?(p=Uf(),p===null&&(p=yt,g=Mf(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=s),p=g),i.memoizedState={parent:c,cache:p},Pf(i),Di(i,It,p)):((n.lanes&s)!==0&&(Bf(n,i),oo(i,null,null,s),so()),p=n.memoizedState,g=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Di(i,It,c)):(c=g.cache,Di(i,It,c),c!==p.cache&&Df(i,[It],s,!0))),sn(n,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function li(n){n.flags|=4}function Sh(n,i,s,c,p){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(Hx())n.flags|=8192;else throw $a=qu,If}else n.flags&=-16777217}function vx(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Ob(i))if(Hx())n.flags|=8192;else throw $a=qu,If}function lc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?ue():536870912,n.lanes|=i,Ql|=i)}function po(n,i){if(!Xe)switch(n.tailMode){case"hidden":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function kt(n){var i=n.alternate!==null&&n.alternate.child===n.child,s=0,c=0;if(i)for(var p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=s,i}function uN(n,i,s){var c=i.pendingProps;switch(Af(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return s=i.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),ni(It),ve(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Dl(i)?li(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,zf())),kt(i),null;case 26:var p=i.type,g=i.memoizedState;return n===null?(li(i),g!==null?(kt(i),vx(i,g)):(kt(i),Sh(i,p,null,c,s))):g?g!==n.memoizedState?(li(i),kt(i),vx(i,g)):(kt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==c&&li(i),kt(i),Sh(i,p,n,c,s)),null;case 27:if(Wt(i),s=oe.current,p=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&li(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return kt(i),null}n=X.current,Dl(i)?Xy(i):(n=Eb(p,c,s),i.stateNode=n,li(i))}return kt(i),null;case 5:if(Wt(i),p=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&li(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return kt(i),null}if(g=X.current,Dl(i))Xy(i);else{var w=Sc(oe.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}g[rn]=i,g[En]=c;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=g;e:switch(on(g,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&&li(i)}}return kt(i),Sh(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==c&&li(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(n=oe.current,Dl(i)){if(n=i.stateNode,s=i.memoizedProps,c=null,p=an,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[rn]=i,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||mb(n.nodeValue,s)),n||Oi(i,!0)}else n=Sc(n).createTextNode(c),n[rn]=i,i.stateNode=n}return kt(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(c=Dl(i),s!==null){if(n===null){if(!c)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[rn]=i}else La(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),n=!1}else s=zf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(Zn(i),i):(Zn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return kt(i),null;case 13:if(c=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Dl(i),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[rn]=i}else La(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),p=!1}else p=zf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Zn(i),i):(Zn(i),null)}return Zn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,n=n!==null&&n.memoizedState!==null,s&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&(c.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),lc(i,i.updateQueue),kt(i),null);case 4:return ve(),n===null&&qh(i.stateNode.containerInfo),kt(i),null;case 10:return ni(i.type),kt(i),null;case 19:if(T(Lt),c=i.memoizedState,c===null)return kt(i),null;if(p=(i.flags&128)!==0,g=c.rendering,g===null)if(p)po(c,!1);else{if(Ot!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Qu(n),g!==null){for(i.flags|=128,po(c,!1),n=g.updateQueue,i.updateQueue=n,lc(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)Vy(s,n),s=s.sibling;return C(Lt,Lt.current&1|2),Xe&&ei(i,c.treeForkCount),i.child}n=n.sibling}c.tail!==null&&tn()>dc&&(i.flags|=128,p=!0,po(c,!1),i.lanes=4194304)}else{if(!p)if(n=Qu(g),n!==null){if(i.flags|=128,p=!0,n=n.updateQueue,i.updateQueue=n,lc(i,n),po(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Xe)return kt(i),null}else 2*tn()-c.renderingStartTime>dc&&s!==536870912&&(i.flags|=128,p=!0,po(c,!1),i.lanes=4194304);c.isBackwards?(g.sibling=i.child,i.child=g):(n=c.last,n!==null?n.sibling=g:i.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=tn(),n.sibling=null,s=Lt.current,C(Lt,p?s&1|2:s&1),Xe&&ei(i,c.treeForkCount),n):(kt(i),null);case 22:case 23:return Zn(i),Hf(),c=i.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),s=i.updateQueue,s!==null&&lc(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),n!==null&&T(Pa),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ni(It),kt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function cN(n,i){switch(Af(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return ni(It),ve(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Wt(i),null;case 31:if(i.memoizedState!==null){if(Zn(i),i.alternate===null)throw Error(a(340));La()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(Zn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));La()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return T(Lt),null;case 4:return ve(),null;case 10:return ni(i.type),null;case 22:case 23:return Zn(i),Hf(),n!==null&&T(Pa),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return ni(It),null;case 25:return null;default:return null}}function xx(n,i){switch(Af(i),i.tag){case 3:ni(It),ve();break;case 26:case 27:case 5:Wt(i);break;case 4:ve();break;case 31:i.memoizedState!==null&&Zn(i);break;case 13:Zn(i);break;case 19:T(Lt);break;case 10:ni(i.type);break;case 22:case 23:Zn(i),Hf(),n!==null&&T(Pa);break;case 24:ni(It)}}function go(n,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&n)===n){c=void 0;var g=s.create,w=s.inst;c=g(),w.destroy=c}s=s.next}while(s!==p)}}catch(_){ft(i,i.return,_)}}function Bi(n,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&n)===n){var w=c.inst,_=w.destroy;if(_!==void 0){w.destroy=void 0,p=i;var M=s,G=_;try{G()}catch(te){ft(p,M,te)}}}c=c.next}while(c!==g)}}catch(te){ft(i,i.return,te)}}function bx(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{cv(i,s)}catch(c){ft(n,n.return,c)}}}function Sx(n,i,s){s.props=Ha(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){ft(n,i,c)}}function yo(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(p){ft(n,i,p)}}function Or(n,i){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){ft(n,i,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){ft(n,i,p)}else s.current=null}function wx(n){var i=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(i){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){ft(n,n.return,p)}}function wh(n,i,s){try{var c=n.stateNode;RN(c,n.type,s,i),c[En]=i}catch(p){ft(n,n.return,p)}}function kx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Qi(n.type)||n.tag===4}function kh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||kx(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Qi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function jh(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Xr));else if(c!==4&&(c===27&&Qi(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(jh(n,i,s),n=n.sibling;n!==null;)jh(n,i,s),n=n.sibling}function sc(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(c!==4&&(c===27&&Qi(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(sc(n,i,s),n=n.sibling;n!==null;)sc(n,i,s),n=n.sibling}function jx(n){var i=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);on(i,c,s),i[rn]=n,i[En]=s}catch(g){ft(n,n.return,g)}}var si=!1,$t=!1,Eh=!1,Ex=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function dN(n,i){if(n=n.containerInfo,Vh=_c,n=Uy(n),vf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var w=0,_=-1,M=-1,G=0,te=0,se=n,K=null;t:for(;;){for(var Y;se!==s||p!==0&&se.nodeType!==3||(_=w+p),se!==g||c!==0&&se.nodeType!==3||(M=w+c),se.nodeType===3&&(w+=se.nodeValue.length),(Y=se.firstChild)!==null;)K=se,se=Y;for(;;){if(se===n)break t;if(K===s&&++G===p&&(_=w),K===g&&++te===c&&(M=w),(Y=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=Y}s=_===-1||M===-1?null:{start:_,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(Qh={focusedElem:n,selectionRange:s},_c=!1,Xt=i;Xt!==null;)if(i=Xt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Xt=n;else for(;Xt!==null;){switch(i=Xt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)p=n[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,s=i,p=g.memoizedProps,g=g.memoizedState,c=s.stateNode;try{var Se=Ha(s.type,p);n=c.getSnapshotBeforeUpdate(Se,g),c.__reactInternalSnapshotBeforeUpdate=n}catch(ze){ft(s,s.return,ze)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,s=n.nodeType,s===9)Yh(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Yh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Xt=n;break}Xt=i.return}}function Cx(n,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:ui(n,s),c&4&&go(5,s);break;case 1:if(ui(n,s),c&4)if(n=s.stateNode,i===null)try{n.componentDidMount()}catch(w){ft(s,s.return,w)}else{var p=Ha(s.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(p,i,n.__reactInternalSnapshotBeforeUpdate)}catch(w){ft(s,s.return,w)}}c&64&&bx(s),c&512&&yo(s,s.return);break;case 3:if(ui(n,s),c&64&&(n=s.updateQueue,n!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{cv(n,i)}catch(w){ft(s,s.return,w)}}break;case 27:i===null&&c&4&&jx(s);case 26:case 5:ui(n,s),i===null&&c&4&&wx(s),c&512&&yo(s,s.return);break;case 12:ui(n,s);break;case 31:ui(n,s),c&4&&Ax(n,s);break;case 13:ui(n,s),c&4&&Tx(n,s),c&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=bN.bind(null,s),BN(n,s))));break;case 22:if(c=s.memoizedState!==null||si,!c){i=i!==null&&i.memoizedState!==null||$t,p=si;var g=$t;si=c,($t=i)&&!g?ci(n,s,(s.subtreeFlags&8772)!==0):ui(n,s),si=p,$t=g}break;case 30:break;default:ui(n,s)}}function Nx(n){var i=n.alternate;i!==null&&(n.alternate=null,Nx(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&ef(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ct=null,Nn=!1;function oi(n,i,s){for(s=s.child;s!==null;)_x(n,i,s),s=s.sibling}function _x(n,i,s){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(nn,s)}catch{}switch(s.tag){case 26:$t||Or(s,i),oi(n,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:$t||Or(s,i);var c=Ct,p=Nn;Qi(s.type)&&(Ct=s.stateNode,Nn=!1),oi(n,i,s),Co(s.stateNode),Ct=c,Nn=p;break;case 5:$t||Or(s,i);case 6:if(c=Ct,p=Nn,Ct=null,oi(n,i,s),Ct=c,Nn=p,Ct!==null)if(Nn)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(s.stateNode)}catch(g){ft(s,i,g)}else try{Ct.removeChild(s.stateNode)}catch(g){ft(s,i,g)}break;case 18:Ct!==null&&(Nn?(n=Ct,bb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),ts(n)):bb(Ct,s.stateNode));break;case 4:c=Ct,p=Nn,Ct=s.stateNode.containerInfo,Nn=!0,oi(n,i,s),Ct=c,Nn=p;break;case 0:case 11:case 14:case 15:Bi(2,s,i),$t||Bi(4,s,i),oi(n,i,s);break;case 1:$t||(Or(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Sx(s,i,c)),oi(n,i,s);break;case 21:oi(n,i,s);break;case 22:$t=(c=$t)||s.memoizedState!==null,oi(n,i,s),$t=c;break;default:oi(n,i,s)}}function Ax(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ts(n)}catch(s){ft(i,i.return,s)}}}function Tx(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ts(n)}catch(s){ft(i,i.return,s)}}function fN(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new Ex),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new Ex),i;default:throw Error(a(435,n.tag))}}function oc(n,i){var s=fN(n);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=SN.bind(null,n,c);c.then(p,p)}})}function _n(n,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],g=n,w=i,_=w;e:for(;_!==null;){switch(_.tag){case 27:if(Qi(_.type)){Ct=_.stateNode,Nn=!1;break e}break;case 5:Ct=_.stateNode,Nn=!1;break e;case 3:case 4:Ct=_.stateNode.containerInfo,Nn=!0;break e}_=_.return}if(Ct===null)throw Error(a(160));_x(g,w,p),Ct=null,Nn=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)zx(i,n),i=i.sibling}var wr=null;function zx(n,i){var s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:_n(i,n),An(n),c&4&&(Bi(3,n,n.return),go(3,n),Bi(5,n,n.return));break;case 1:_n(i,n),An(n),c&512&&($t||s===null||Or(s,s.return)),c&64&&si&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=wr;if(_n(i,n),An(n),c&512&&($t||s===null||Or(s,s.return)),c&4){var g=s!==null?s.memoizedState:null;if(c=n.memoizedState,s===null)if(c===null)if(n.stateNode===null){e:{c=n.type,s=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":g=p.getElementsByTagName("title")[0],(!g||g[qs]||g[rn]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(c),p.head.insertBefore(g,p.querySelector("head > title"))),on(g,c,s),g[rn]=n,Yt(g),c=g;break e;case"link":var w=zb("link","href",p).get(c+(s.href||""));if(w){for(var _=0;_<w.length;_++)if(g=w[_],g.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&g.getAttribute("rel")===(s.rel==null?null:s.rel)&&g.getAttribute("title")===(s.title==null?null:s.title)&&g.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(_,1);break t}}g=p.createElement(c),on(g,c,s),p.head.appendChild(g);break;case"meta":if(w=zb("meta","content",p).get(c+(s.content||""))){for(_=0;_<w.length;_++)if(g=w[_],g.getAttribute("content")===(s.content==null?null:""+s.content)&&g.getAttribute("name")===(s.name==null?null:s.name)&&g.getAttribute("property")===(s.property==null?null:s.property)&&g.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&g.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(_,1);break t}}g=p.createElement(c),on(g,c,s),p.head.appendChild(g);break;default:throw Error(a(468,c))}g[rn]=n,Yt(g),c=g}n.stateNode=c}else Rb(p,n.type,n.stateNode);else n.stateNode=Tb(p,c,n.memoizedProps);else g!==c?(g===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):g.count--,c===null?Rb(p,n.type,n.stateNode):Tb(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&wh(n,n.memoizedProps,s.memoizedProps)}break;case 27:_n(i,n),An(n),c&512&&($t||s===null||Or(s,s.return)),s!==null&&c&4&&wh(n,n.memoizedProps,s.memoizedProps);break;case 5:if(_n(i,n),An(n),c&512&&($t||s===null||Or(s,s.return)),n.flags&32){p=n.stateNode;try{jl(p,"")}catch(Se){ft(n,n.return,Se)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,wh(n,p,s!==null?s.memoizedProps:p)),c&1024&&(Eh=!0);break;case 6:if(_n(i,n),An(n),c&4){if(n.stateNode===null)throw Error(a(162));c=n.memoizedProps,s=n.stateNode;try{s.nodeValue=c}catch(Se){ft(n,n.return,Se)}}break;case 3:if(jc=null,p=wr,wr=wc(i.containerInfo),_n(i,n),wr=p,An(n),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ts(i.containerInfo)}catch(Se){ft(n,n.return,Se)}Eh&&(Eh=!1,Rx(n));break;case 4:c=wr,wr=wc(n.stateNode.containerInfo),_n(i,n),An(n),wr=c;break;case 12:_n(i,n),An(n);break;case 31:_n(i,n),An(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,oc(n,c)));break;case 13:_n(i,n),An(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(cc=tn()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,oc(n,c)));break;case 22:p=n.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,G=si,te=$t;if(si=G||p,$t=te||M,_n(i,n),$t=te,si=G,An(n),c&8192)e:for(i=n.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||M||si||$t||Za(n)),s=null,i=n;;){if(i.tag===5||i.tag===26){if(s===null){M=s=i;try{if(g=M.stateNode,p)w=g.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){ft(M,M.return,Se)}}}else if(i.tag===6){if(s===null){M=i;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(Se){ft(M,M.return,Se)}}}else if(i.tag===18){if(s===null){M=i;try{var Y=M.stateNode;p?Sb(Y,!0):Sb(M.stateNode,!1)}catch(Se){ft(M,M.return,Se)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=n.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,oc(n,s))));break;case 19:_n(i,n),An(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,oc(n,c)));break;case 30:break;case 21:break;default:_n(i,n),An(n)}}function An(n){var i=n.flags;if(i&2){try{for(var s,c=n.return;c!==null;){if(kx(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,g=kh(n);sc(n,g,p);break;case 5:var w=s.stateNode;s.flags&32&&(jl(w,""),s.flags&=-33);var _=kh(n);sc(n,_,w);break;case 3:case 4:var M=s.stateNode.containerInfo,G=kh(n);jh(n,G,M);break;default:throw Error(a(161))}}catch(te){ft(n,n.return,te)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function Rx(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;Rx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function ui(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Cx(n,i.alternate,i),i=i.sibling}function Za(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:Bi(4,i,i.return),Za(i);break;case 1:Or(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Sx(i,i.return,s),Za(i);break;case 27:Co(i.stateNode);case 26:case 5:Or(i,i.return),Za(i);break;case 22:i.memoizedState===null&&Za(i);break;case 30:Za(i);break;default:Za(i)}n=n.sibling}}function ci(n,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=n,g=i,w=g.flags;switch(g.tag){case 0:case 11:case 15:ci(p,g,s),go(4,g);break;case 1:if(ci(p,g,s),c=g,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){ft(c,c.return,G)}if(c=g,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++)uv(M[p],_)}catch(G){ft(c,c.return,G)}}s&&w&64&&bx(g),yo(g,g.return);break;case 27:jx(g);case 26:case 5:ci(p,g,s),s&&c===null&&w&4&&wx(g),yo(g,g.return);break;case 12:ci(p,g,s);break;case 31:ci(p,g,s),s&&w&4&&Ax(p,g);break;case 13:ci(p,g,s),s&&w&4&&Tx(p,g);break;case 22:g.memoizedState===null&&ci(p,g,s),yo(g,g.return);break;case 30:break;default:ci(p,g,s)}i=i.sibling}}function Ch(n,i){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&no(s))}function Nh(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&no(n))}function kr(n,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ox(n,i,s,c),i=i.sibling}function Ox(n,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:kr(n,i,s,c),p&2048&&go(9,i);break;case 1:kr(n,i,s,c);break;case 3:kr(n,i,s,c),p&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&no(n)));break;case 12:if(p&2048){kr(n,i,s,c),n=i.stateNode;try{var g=i.memoizedProps,w=g.id,_=g.onPostCommit;typeof _=="function"&&_(w,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(M){ft(i,i.return,M)}}else kr(n,i,s,c);break;case 31:kr(n,i,s,c);break;case 13:kr(n,i,s,c);break;case 23:break;case 22:g=i.stateNode,w=i.alternate,i.memoizedState!==null?g._visibility&2?kr(n,i,s,c):vo(n,i):g._visibility&2?kr(n,i,s,c):(g._visibility|=2,Hl(n,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Ch(w,i);break;case 24:kr(n,i,s,c),p&2048&&Nh(i.alternate,i);break;default:kr(n,i,s,c)}}function Hl(n,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,w=i,_=s,M=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:Hl(g,w,_,M,p),go(8,w);break;case 23:break;case 22:var te=w.stateNode;w.memoizedState!==null?te._visibility&2?Hl(g,w,_,M,p):vo(g,w):(te._visibility|=2,Hl(g,w,_,M,p)),p&&G&2048&&Ch(w.alternate,w);break;case 24:Hl(g,w,_,M,p),p&&G&2048&&Nh(w.alternate,w);break;default:Hl(g,w,_,M,p)}i=i.sibling}}function vo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=n,c=i,p=c.flags;switch(c.tag){case 22:vo(s,c),p&2048&&Ch(c.alternate,c);break;case 24:vo(s,c),p&2048&&Nh(c.alternate,c);break;default:vo(s,c)}i=i.sibling}}var xo=8192;function Zl(n,i,s){if(n.subtreeFlags&xo)for(n=n.child;n!==null;)Dx(n,i,s),n=n.sibling}function Dx(n,i,s){switch(n.tag){case 26:Zl(n,i,s),n.flags&xo&&n.memoizedState!==null&&JN(s,wr,n.memoizedState,n.memoizedProps);break;case 5:Zl(n,i,s);break;case 3:case 4:var c=wr;wr=wc(n.stateNode.containerInfo),Zl(n,i,s),wr=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=xo,xo=16777216,Zl(n,i,s),xo=c):Zl(n,i,s));break;default:Zl(n,i,s)}}function Mx(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function bo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Xt=c,Ux(c,n)}Mx(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Lx(n),n=n.sibling}function Lx(n){switch(n.tag){case 0:case 11:case 15:bo(n),n.flags&2048&&Bi(9,n,n.return);break;case 3:bo(n);break;case 12:bo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,uc(n)):bo(n);break;default:bo(n)}}function uc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Xt=c,Ux(c,n)}Mx(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:Bi(8,i,i.return),uc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,uc(i));break;default:uc(i)}n=n.sibling}}function Ux(n,i){for(;Xt!==null;){var s=Xt;switch(s.tag){case 0:case 11:case 15:Bi(8,s,i);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:no(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Xt=c;else e:for(s=n;Xt!==null;){c=Xt;var p=c.sibling,g=c.return;if(Nx(c),c===s){Xt=null;break e}if(p!==null){p.return=g,Xt=p;break e}Xt=g}}}var hN={getCacheForType:function(n){var i=ln(It),s=i.data.get(n);return s===void 0&&(s=n(),i.data.set(n,s)),s},cacheSignal:function(){return ln(It).controller.signal}},mN=typeof WeakMap=="function"?WeakMap:Map,lt=0,yt=null,He=null,Ge=0,dt=0,Vn=null,$i=!1,Vl=!1,_h=!1,di=0,Ot=0,Fi=0,Va=0,Ah=0,Qn=0,Ql=0,So=null,Tn=null,Th=!1,cc=0,Ix=0,dc=1/0,fc=null,qi=null,Zt=0,Hi=null,Gl=null,fi=0,zh=0,Rh=null,Px=null,wo=0,Oh=null;function Gn(){return(lt&2)!==0&&Ge!==0?Ge&-Ge:P.T!==null?Ph():ty()}function Bx(){if(Qn===0)if((Ge&536870912)===0||Xe){var n=Na;Na<<=1,(Na&3932160)===0&&(Na=262144),Qn=n}else Qn=536870912;return n=Hn.current,n!==null&&(n.flags|=32),Qn}function zn(n,i,s){(n===yt&&(dt===2||dt===9)||n.cancelPendingCommit!==null)&&(Kl(n,0),Zi(n,Ge,Qn,!1)),pn(n,s),((lt&2)===0||n!==yt)&&(n===yt&&((lt&2)===0&&(Va|=s),Ot===4&&Zi(n,Ge,Qn,!1)),Dr(n))}function $x(n,i,s){if((lt&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&n.expiredLanes)===0||_i(n,i),p=c?yN(n,i):Mh(n,i,!0),g=c;do{if(p===0){Vl&&!c&&Zi(n,i,0,!1);break}else{if(s=n.current.alternate,g&&!pN(s)){p=Mh(n,i,!1),g=!1;continue}if(p===2){if(g=i,n.errorRecoveryDisabledLanes&g)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var _=n;p=So;var M=_.current.memoizedState.isDehydrated;if(M&&(Kl(_,w).flags|=256),w=Mh(_,w,!1),w!==2){if(_h&&!M){_.errorRecoveryDisabledLanes|=g,Va|=g,p=4;break e}g=Tn,Tn=p,g!==null&&(Tn===null?Tn=g:Tn.push.apply(Tn,g))}p=w}if(g=!1,p!==2)continue}}if(p===1){Kl(n,0),Zi(n,i,0,!0);break}e:{switch(c=n,g=p,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Zi(c,i,Qn,!$i);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=cc+300-tn(),10<p)){if(Zi(c,i,Qn,!$i),Aa(c,0,!0)!==0)break e;fi=i,c.timeoutHandle=vb(Fx.bind(null,c,s,Tn,fc,Th,i,Qn,Va,Ql,$i,g,"Throttled",-0,0),p);break e}Fx(c,s,Tn,fc,Th,i,Qn,Va,Ql,$i,g,null,-0,0)}}break}while(!0);Dr(n)}function Fx(n,i,s,c,p,g,w,_,M,G,te,se,K,Y){if(n.timeoutHandle=-1,se=i.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xr},Dx(i,g,se);var Se=(g&62914560)===g?cc-tn():(g&4194048)===g?Ix-tn():0;if(Se=WN(se,Se),Se!==null){fi=g,n.cancelPendingCommit=Se(Yx.bind(null,n,i,g,s,c,p,w,_,M,te,se,null,K,Y)),Zi(n,g,w,!G);return}}Yx(n,i,g,s,c,p,w,_,M)}function pN(n){for(var i=n;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],g=p.getSnapshot;p=p.value;try{if(!Fn(g(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Zi(n,i,s,c){i&=~Ah,i&=~Va,n.suspendedLanes|=i,n.pingedLanes&=~i,c&&(n.warmLanes|=i),c=n.expirationTimes;for(var p=i;0<p;){var g=31-ct(p),w=1<<g;c[g]=-1,p&=~w}s!==0&&Yd(n,s,i)}function hc(){return(lt&6)===0?(ko(0),!1):!0}function Dh(){if(He!==null){if(dt===0)var n=He.return;else n=He,ti=Ua=null,Yf(n),Pl=null,io=0,n=He;for(;n!==null;)xx(n.alternate,n),n=n.return;He=null}}function Kl(n,i){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,MN(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),fi=0,Dh(),yt=n,He=s=Wr(n.current,null),Ge=i,dt=0,Vn=null,$i=!1,Vl=_i(n,i),_h=!1,Ql=Qn=Ah=Va=Fi=Ot=0,Tn=So=null,Th=!1,(i&8)!==0&&(i|=i&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=i;0<c;){var p=31-ct(c),g=1<<p;i|=n[p],c&=~g}return di=i,Du(),s}function qx(n,i){Ue=null,P.H=ho,i===Il||i===Fu?(i=av(),dt=3):i===If?(i=av(),dt=4):dt=i===fh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Vn=i,He===null&&(Ot=1,nc(n,ar(i,n.current)))}function Hx(){var n=Hn.current;return n===null?!0:(Ge&4194048)===Ge?ur===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?n===ur:!1}function Zx(){var n=P.H;return P.H=ho,n===null?ho:n}function Vx(){var n=P.A;return P.A=hN,n}function mc(){Ot=4,$i||(Ge&4194048)!==Ge&&Hn.current!==null||(Vl=!0),(Fi&134217727)===0&&(Va&134217727)===0||yt===null||Zi(yt,Ge,Qn,!1)}function Mh(n,i,s){var c=lt;lt|=2;var p=Zx(),g=Vx();(yt!==n||Ge!==i)&&(fc=null,Kl(n,i)),i=!1;var w=Ot;e:do try{if(dt!==0&&He!==null){var _=He,M=Vn;switch(dt){case 8:Dh(),w=6;break e;case 3:case 2:case 9:case 6:Hn.current===null&&(i=!0);var G=dt;if(dt=0,Vn=null,Yl(n,_,M,G),s&&Vl){w=0;break e}break;default:G=dt,dt=0,Vn=null,Yl(n,_,M,G)}}gN(),w=Ot;break}catch(te){qx(n,te)}while(!0);return i&&n.shellSuspendCounter++,ti=Ua=null,lt=c,P.H=p,P.A=g,He===null&&(yt=null,Ge=0,Du()),w}function gN(){for(;He!==null;)Qx(He)}function yN(n,i){var s=lt;lt|=2;var c=Zx(),p=Vx();yt!==n||Ge!==i?(fc=null,dc=tn()+500,Kl(n,i)):Vl=_i(n,i);e:do try{if(dt!==0&&He!==null){i=He;var g=Vn;t:switch(dt){case 1:dt=0,Vn=null,Yl(n,i,g,1);break;case 2:case 9:if(rv(g)){dt=0,Vn=null,Gx(i);break}i=function(){dt!==2&&dt!==9||yt!==n||(dt=7),Dr(n)},g.then(i,i);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:rv(g)?(dt=0,Vn=null,Gx(i)):(dt=0,Vn=null,Yl(n,i,g,7));break;case 5:var w=null;switch(He.tag){case 26:w=He.memoizedState;case 5:case 27:var _=He;if(w?Ob(w):_.stateNode.complete){dt=0,Vn=null;var M=_.sibling;if(M!==null)He=M;else{var G=_.return;G!==null?(He=G,pc(G)):He=null}break t}}dt=0,Vn=null,Yl(n,i,g,5);break;case 6:dt=0,Vn=null,Yl(n,i,g,6);break;case 8:Dh(),Ot=6;break e;default:throw Error(a(462))}}vN();break}catch(te){qx(n,te)}while(!0);return ti=Ua=null,P.H=c,P.A=p,lt=s,He!==null?0:(yt=null,Ge=0,Du(),Ot)}function vN(){for(;He!==null&&!$s();)Qx(He)}function Qx(n){var i=yx(n.alternate,n,di);n.memoizedProps=n.pendingProps,i===null?pc(n):He=i}function Gx(n){var i=n,s=i.alternate;switch(i.tag){case 15:case 0:i=dx(s,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=dx(s,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:Yf(i);default:xx(s,i),i=He=Vy(i,di),i=yx(s,i,di)}n.memoizedProps=n.pendingProps,i===null?pc(n):He=i}function Yl(n,i,s,c){ti=Ua=null,Yf(i),Pl=null,io=0;var p=i.return;try{if(lN(n,p,i,s,Ge)){Ot=1,nc(n,ar(s,n.current)),He=null;return}}catch(g){if(p!==null)throw He=p,g;Ot=1,nc(n,ar(s,n.current)),He=null;return}i.flags&32768?(Xe||c===1?n=!0:Vl||(Ge&536870912)!==0?n=!1:($i=n=!0,(c===2||c===9||c===3||c===6)&&(c=Hn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Kx(i,n)):pc(i)}function pc(n){var i=n;do{if((i.flags&32768)!==0){Kx(i,$i);return}n=i.return;var s=uN(i.alternate,i,di);if(s!==null){He=s;return}if(i=i.sibling,i!==null){He=i;return}He=i=n}while(i!==null);Ot===0&&(Ot=5)}function Kx(n,i){do{var s=cN(n.alternate,n);if(s!==null){s.flags&=32767,He=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(n=n.sibling,n!==null)){He=n;return}He=n=s}while(n!==null);Ot=6,He=null}function Yx(n,i,s,c,p,g,w,_,M){n.cancelPendingCommit=null;do gc();while(Zt!==0);if((lt&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=kf,wu(n,s,g,w,_,M),n===yt&&(He=yt=null,Ge=0),Gl=i,Hi=n,fi=s,zh=g,Rh=p,Px=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,wN(Oe,function(){return tb(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=W.p,W.p=2,w=lt,lt|=4;try{dN(n,i,s)}finally{lt=w,W.p=p,P.T=c}}Zt=1,Xx(),Jx(),Wx()}}function Xx(){if(Zt===1){Zt=0;var n=Hi,i=Gl,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var c=W.p;W.p=2;var p=lt;lt|=4;try{zx(i,n);var g=Qh,w=Uy(n.containerInfo),_=g.focusedElem,M=g.selectionRange;if(w!==_&&_&&_.ownerDocument&&Ly(_.ownerDocument.documentElement,_)){if(M!==null&&vf(_)){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 Y=K.getSelection(),Se=_.textContent.length,ze=Math.min(M.start,Se),pt=M.end===void 0?ze:Math.min(M.end,Se);!Y.extend&&ze>pt&&(w=pt,pt=ze,ze=w);var Z=My(_,ze),B=My(_,pt);if(Z&&B&&(Y.rangeCount!==1||Y.anchorNode!==Z.node||Y.anchorOffset!==Z.offset||Y.focusNode!==B.node||Y.focusOffset!==B.offset)){var Q=se.createRange();Q.setStart(Z.node,Z.offset),Y.removeAllRanges(),ze>pt?(Y.addRange(Q),Y.extend(B.node,B.offset)):(Q.setEnd(B.node,B.offset),Y.addRange(Q))}}}}for(se=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&se.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<se.length;_++){var le=se[_];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}_c=!!Vh,Qh=Vh=null}finally{lt=p,W.p=c,P.T=s}}n.current=i,Zt=2}}function Jx(){if(Zt===2){Zt=0;var n=Hi,i=Gl,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var c=W.p;W.p=2;var p=lt;lt|=4;try{Cx(n,i.alternate,i)}finally{lt=p,W.p=c,P.T=s}}Zt=3}}function Wx(){if(Zt===4||Zt===3){Zt=0,yl();var n=Hi,i=Gl,s=fi,c=Px;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Zt=5:(Zt=0,Gl=Hi=null,eb(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(qi=null),Jd(s),i=i.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(nn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=P.T,p=W.p,W.p=2,P.T=null;try{for(var g=n.onRecoverableError,w=0;w<c.length;w++){var _=c[w];g(_.value,{componentStack:_.stack})}}finally{P.T=i,W.p=p}}(fi&3)!==0&&gc(),Dr(n),p=n.pendingLanes,(s&261930)!==0&&(p&42)!==0?n===Oh?wo++:(wo=0,Oh=n):wo=0,ko(0)}}function eb(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,no(i)))}function gc(){return Xx(),Jx(),Wx(),tb()}function tb(){if(Zt!==5)return!1;var n=Hi,i=zh;zh=0;var s=Jd(fi),c=P.T,p=W.p;try{W.p=32>s?32:s,P.T=null,s=Rh,Rh=null;var g=Hi,w=fi;if(Zt=0,Gl=Hi=null,fi=0,(lt&6)!==0)throw Error(a(331));var _=lt;if(lt|=4,Lx(g.current),Ox(g,g.current,w,s),lt=_,ko(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(nn,g)}catch{}return!0}finally{W.p=p,P.T=c,eb(n,i)}}function nb(n,i,s){i=ar(s,i),i=dh(n.stateNode,i,2),n=Ui(n,i,2),n!==null&&(pn(n,2),Dr(n))}function ft(n,i,s){if(n.tag===3)nb(n,n,s);else for(;i!==null;){if(i.tag===3){nb(i,n,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(qi===null||!qi.has(c))){n=ar(s,n),s=rx(2),c=Ui(i,s,2),c!==null&&(ix(s,c,i,n),pn(c,2),Dr(c));break}}i=i.return}}function Lh(n,i,s){var c=n.pingCache;if(c===null){c=n.pingCache=new mN;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(s)||(_h=!0,p.add(s),n=xN.bind(null,n,i,s),i.then(n,n))}function xN(n,i,s){var c=n.pingCache;c!==null&&c.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,yt===n&&(Ge&s)===s&&(Ot===4||Ot===3&&(Ge&62914560)===Ge&&300>tn()-cc?(lt&2)===0&&Kl(n,0):Ah|=s,Ql===Ge&&(Ql=0)),Dr(n)}function rb(n,i){i===0&&(i=ue()),n=Da(n,i),n!==null&&(pn(n,i),Dr(n))}function bN(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),rb(n,s)}function SN(n,i){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),rb(n,s)}function wN(n,i){return Kr(n,i)}var yc=null,Xl=null,Uh=!1,vc=!1,Ih=!1,Vi=0;function Dr(n){n!==Xl&&n.next===null&&(Xl===null?yc=Xl=n:Xl=Xl.next=n),vc=!0,Uh||(Uh=!0,jN())}function ko(n,i){if(!Ih&&vc){Ih=!0;do for(var s=!1,c=yc;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var g=0;else{var w=c.suspendedLanes,_=c.pingedLanes;g=(1<<31-ct(42|n)+1)-1,g&=p&~(w&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,sb(c,g))}else g=Ge,g=Aa(c,c===yt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||_i(c,g)||(s=!0,sb(c,g));c=c.next}while(s);Ih=!1}}function kN(){ib()}function ib(){vc=Uh=!1;var n=0;Vi!==0&&DN()&&(n=Vi);for(var i=tn(),s=null,c=yc;c!==null;){var p=c.next,g=ab(c,i);g===0?(c.next=null,s===null?yc=p:s.next=p,p===null&&(Xl=s)):(s=c,(n!==0||(g&3)!==0)&&(vc=!0)),c=p}Zt!==0&&Zt!==5||ko(n),Vi!==0&&(Vi=0)}function ab(n,i){for(var s=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var w=31-ct(g),_=1<<w,M=p[w];M===-1?((_&s)===0||(_&c)!==0)&&(p[w]=Su(_,i)):M<=i&&(n.expiredLanes|=_),g&=~_}if(i=yt,s=Ge,s=Aa(n,n===i?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,s===0||n===i&&(dt===2||dt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&Ni(c),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||_i(n,s)){if(i=s&-s,i===n.callbackPriority)return i;switch(c!==null&&Ni(c),Jd(s)){case 2:case 8:s=he;break;case 32:s=Oe;break;case 268435456:s=nt;break;default:s=Oe}return c=lb.bind(null,n),s=Kr(s,c),n.callbackPriority=i,n.callbackNode=s,i}return c!==null&&c!==null&&Ni(c),n.callbackPriority=2,n.callbackNode=null,2}function lb(n,i){if(Zt!==0&&Zt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(gc()&&n.callbackNode!==s)return null;var c=Ge;return c=Aa(n,n===yt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:($x(n,c,i),ab(n,tn()),n.callbackNode!=null&&n.callbackNode===s?lb.bind(null,n):null)}function sb(n,i){if(gc())return null;$x(n,i,!0)}function jN(){LN(function(){(lt&6)!==0?Kr(ne,kN):ib()})}function Ph(){if(Vi===0){var n=Ll;n===0&&(n=Ca,Ca<<=1,(Ca&261888)===0&&(Ca=256)),Vi=n}return Vi}function ob(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Cu(""+n)}function ub(n,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,n.id&&s.setAttribute("form",n.id),i.parentNode.insertBefore(s,i),n=new FormData(n),s.parentNode.removeChild(s),n}function EN(n,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var g=ob((p[En]||null).action),w=c.submitter;w&&(i=(i=w[En]||null)?ob(i.formAction):w.getAttribute("formAction"),i!==null&&(g=i,w=null));var _=new Tu("action","action",null,c,p);n.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Vi!==0){var M=w?ub(p,w):new FormData(p);ah(s,{pending:!0,data:M,method:p.method,action:g},null,M)}}else typeof g=="function"&&(_.preventDefault(),M=w?ub(p,w):new FormData(p),ah(s,{pending:!0,data:M,method:p.method,action:g},g,M))},currentTarget:p}]})}}for(var Bh=0;Bh<wf.length;Bh++){var $h=wf[Bh],CN=$h.toLowerCase(),NN=$h[0].toUpperCase()+$h.slice(1);Sr(CN,"on"+NN)}Sr(By,"onAnimationEnd"),Sr($y,"onAnimationIteration"),Sr(Fy,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(qC,"onTransitionRun"),Sr(HC,"onTransitionStart"),Sr(ZC,"onTransitionCancel"),Sr(qy,"onTransitionEnd"),wl("onMouseEnter",["mouseout","mouseover"]),wl("onMouseLeave",["mouseout","mouseover"]),wl("onPointerEnter",["pointerout","pointerover"]),wl("onPointerLeave",["pointerout","pointerover"]),Ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ta("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jo="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(" "),_N=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jo));function cb(n,i){i=(i&4)!==0;for(var s=0;s<n.length;s++){var c=n[s],p=c.event;c=c.listeners;e:{var g=void 0;if(i)for(var w=c.length-1;0<=w;w--){var _=c[w],M=_.instance,G=_.currentTarget;if(_=_.listener,M!==g&&p.isPropagationStopped())break e;g=_,p.currentTarget=G;try{g(p)}catch(te){Ou(te)}p.currentTarget=null,g=M}else for(w=0;w<c.length;w++){if(_=c[w],M=_.instance,G=_.currentTarget,_=_.listener,M!==g&&p.isPropagationStopped())break e;g=_,p.currentTarget=G;try{g(p)}catch(te){Ou(te)}p.currentTarget=null,g=M}}}}function Ze(n,i){var s=i[Wd];s===void 0&&(s=i[Wd]=new Set);var c=n+"__bubble";s.has(c)||(db(i,n,2,!1),s.add(c))}function Fh(n,i,s){var c=0;i&&(c|=4),db(s,n,c,i)}var xc="_reactListening"+Math.random().toString(36).slice(2);function qh(n){if(!n[xc]){n[xc]=!0,iy.forEach(function(s){s!=="selectionchange"&&(_N.has(s)||Fh(s,!1,n),Fh(s,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[xc]||(i[xc]=!0,Fh("selectionchange",!1,i))}}function db(n,i,s,c){switch(Bb(i)){case 2:var p=n_;break;case 8:p=r_;break;default:p=im}s=p.bind(null,i,s,n),p=void 0,!uf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(i,s,{capture:!0,passive:p}):n.addEventListener(i,s,!0):p!==void 0?n.addEventListener(i,s,{passive:p}):n.addEventListener(i,s,!1)}function Hh(n,i,s,c,p){var g=c;if((i&1)===0&&(i&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=xl(_),w===null)return;if(M=w.tag,M===5||M===6||M===26||M===27){c=g=w;continue e}_=_.parentNode}}c=c.return}gy(function(){var G=g,te=sf(s),se=[];e:{var K=Hy.get(n);if(K!==void 0){var Y=Tu,Se=n;switch(n){case"keypress":if(_u(s)===0)break e;case"keydown":case"keyup":Y=SC;break;case"focusin":Se="focus",Y=hf;break;case"focusout":Se="blur",Y=hf;break;case"beforeblur":case"afterblur":Y=hf;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":Y=xy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=uC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=jC;break;case By:case $y:case Fy:Y=fC;break;case qy:Y=CC;break;case"scroll":case"scrollend":Y=sC;break;case"wheel":Y=_C;break;case"copy":case"cut":case"paste":Y=mC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Sy;break;case"toggle":case"beforetoggle":Y=TC}var ze=(i&4)!==0,pt=!ze&&(n==="scroll"||n==="scrollend"),Z=ze?K!==null?K+"Capture":null:K;ze=[];for(var B=G,Q;B!==null;){var le=B;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||Z===null||(le=Zs(B,Z),le!=null&&ze.push(Eo(B,le,Q))),pt)break;B=B.return}0<ze.length&&(K=new Y(K,Se,null,s,te),se.push({event:K,listeners:ze}))}}if((i&7)===0){e:{if(K=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",K&&s!==lf&&(Se=s.relatedTarget||s.fromElement)&&(xl(Se)||Se[vl]))break e;if((Y||K)&&(K=te.window===te?te:(K=te.ownerDocument)?K.defaultView||K.parentWindow:window,Y?(Se=s.relatedTarget||s.toElement,Y=G,Se=Se?xl(Se):null,Se!==null&&(pt=o(Se),ze=Se.tag,Se!==pt||ze!==5&&ze!==27&&ze!==6)&&(Se=null)):(Y=null,Se=G),Y!==Se)){if(ze=xy,le="onMouseLeave",Z="onMouseEnter",B="mouse",(n==="pointerout"||n==="pointerover")&&(ze=Sy,le="onPointerLeave",Z="onPointerEnter",B="pointer"),pt=Y==null?K:Hs(Y),Q=Se==null?K:Hs(Se),K=new ze(le,B+"leave",Y,s,te),K.target=pt,K.relatedTarget=Q,le=null,xl(te)===G&&(ze=new ze(Z,B+"enter",Se,s,te),ze.target=Q,ze.relatedTarget=pt,le=ze),pt=le,Y&&Se)t:{for(ze=AN,Z=Y,B=Se,Q=0,le=Z;le;le=ze(le))Q++;le=0;for(var Ae=B;Ae;Ae=ze(Ae))le++;for(;0<Q-le;)Z=ze(Z),Q--;for(;0<le-Q;)B=ze(B),le--;for(;Q--;){if(Z===B||B!==null&&Z===B.alternate){ze=Z;break t}Z=ze(Z),B=ze(B)}ze=null}else ze=null;Y!==null&&fb(se,K,Y,ze,!1),Se!==null&&pt!==null&&fb(se,pt,Se,ze,!0)}}e:{if(K=G?Hs(G):window,Y=K.nodeName&&K.nodeName.toLowerCase(),Y==="select"||Y==="input"&&K.type==="file")var rt=Ay;else if(Ny(K))if(Ty)rt=BC;else{rt=IC;var je=UC}else Y=K.nodeName,!Y||Y.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?G&&af(G.elementType)&&(rt=Ay):rt=PC;if(rt&&(rt=rt(n,G))){_y(se,rt,s,te);break e}je&&je(n,K,G),n==="focusout"&&G&&K.type==="number"&&G.memoizedProps.value!=null&&rf(K,"number",K.value)}switch(je=G?Hs(G):window,n){case"focusin":(Ny(je)||je.contentEditable==="true")&&(_l=je,xf=G,Ws=null);break;case"focusout":Ws=xf=_l=null;break;case"mousedown":bf=!0;break;case"contextmenu":case"mouseup":case"dragend":bf=!1,Iy(se,s,te);break;case"selectionchange":if(FC)break;case"keydown":case"keyup":Iy(se,s,te)}var Ie;if(pf)e:{switch(n){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Nl?Ey(n,s)&&(Ke="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(Ke="onCompositionStart");Ke&&(wy&&s.locale!=="ko"&&(Nl||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Nl&&(Ie=yy()):(Ti=te,cf="value"in Ti?Ti.value:Ti.textContent,Nl=!0)),je=bc(G,Ke),0<je.length&&(Ke=new by(Ke,n,null,s,te),se.push({event:Ke,listeners:je}),Ie?Ke.data=Ie:(Ie=Cy(s),Ie!==null&&(Ke.data=Ie)))),(Ie=RC?OC(n,s):DC(n,s))&&(Ke=bc(G,"onBeforeInput"),0<Ke.length&&(je=new by("onBeforeInput","beforeinput",null,s,te),se.push({event:je,listeners:Ke}),je.data=Ie)),EN(se,n,G,s,te)}cb(se,i)})}function Eo(n,i,s){return{instance:n,listener:i,currentTarget:s}}function bc(n,i){for(var s=i+"Capture",c=[];n!==null;){var p=n,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Zs(n,s),p!=null&&c.unshift(Eo(n,p,g)),p=Zs(n,i),p!=null&&c.push(Eo(n,p,g))),n.tag===3)return c;n=n.return}return[]}function AN(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function fb(n,i,s,c,p){for(var g=i._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=Zs(s,g),G!=null&&w.unshift(Eo(s,G,M))):p||(G=Zs(s,g),G!=null&&w.push(Eo(s,G,M)))),s=s.return}w.length!==0&&n.push({event:i,listeners:w})}var TN=/\r\n?/g,zN=/\u0000|\uFFFD/g;function hb(n){return(typeof n=="string"?n:""+n).replace(TN,`
|
|
49
|
-
`).replace(zN,"")}function mb(n,i){return i=hb(i),hb(n)===i}function mt(n,i,s,c,p,g){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||jl(n,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&jl(n,""+c);break;case"className":ju(n,"class",c);break;case"tabIndex":ju(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ju(n,s,c);break;case"style":my(n,c,g);break;case"data":if(i!=="object"){ju(n,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){n.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Cu(""+c),n.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){n.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 g=="function"&&(s==="formAction"?(i!=="input"&&mt(n,i,"name",p.name,p,null),mt(n,i,"formEncType",p.formEncType,p,null),mt(n,i,"formMethod",p.formMethod,p,null),mt(n,i,"formTarget",p.formTarget,p,null)):(mt(n,i,"encType",p.encType,p,null),mt(n,i,"method",p.method,p,null),mt(n,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Cu(""+c),n.setAttribute(s,c);break;case"onClick":c!=null&&(n.onclick=Xr);break;case"onScroll":c!=null&&Ze("scroll",n);break;case"onScrollEnd":c!=null&&Ze("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.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"){n.removeAttribute("xlink:href");break}s=Cu(""+c),n.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"?n.setAttribute(s,""+c):n.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"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":c===!0?n.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,c):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(s,c):n.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(s):n.setAttribute(s,c);break;case"popover":Ze("beforetoggle",n),Ze("toggle",n),ku(n,"popover",c);break;case"xlinkActuate":Yr(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Yr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Yr(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Yr(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Yr(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Yr(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Yr(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Yr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Yr(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ku(n,"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=aC.get(s)||s,ku(n,s,c))}}function Zh(n,i,s,c,p,g){switch(s){case"style":my(n,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"children":typeof c=="string"?jl(n,c):(typeof c=="number"||typeof c=="bigint")&&jl(n,""+c);break;case"onScroll":c!=null&&Ze("scroll",n);break;case"onScrollEnd":c!=null&&Ze("scrollend",n);break;case"onClick":c!=null&&(n.onclick=Xr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ay.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),g=n[En]||null,g=g!=null?g[s]:null,typeof g=="function"&&n.removeEventListener(i,g,p),typeof c=="function")){typeof g!="function"&&g!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(i,c,p);break e}s in n?n[s]=c:c===!0?n.setAttribute(s,""):ku(n,s,c)}}}function on(n,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",n),Ze("load",n);var c=!1,p=!1,g;for(g in s)if(s.hasOwnProperty(g)){var w=s[g];if(w!=null)switch(g){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:mt(n,i,g,w,s,null)}}p&&mt(n,i,"srcSet",s.srcSet,s,null),c&&mt(n,i,"src",s.src,s,null);return;case"input":Ze("invalid",n);var _=g=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":g=te;break;case"defaultValue":_=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:mt(n,i,c,te,s,null)}}cy(n,g,_,M,G,w,p,!1);return;case"select":Ze("invalid",n),c=w=g=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":g=_;break;case"defaultValue":w=_;break;case"multiple":c=_;default:mt(n,i,p,_,s,null)}i=g,s=w,n.multiple=!!c,i!=null?kl(n,!!c,i,!1):s!=null&&kl(n,!!c,s,!0);return;case"textarea":Ze("invalid",n),g=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":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:mt(n,i,w,_,s,null)}fy(n,c,p,g);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(c=s[M],c!=null))switch(M){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:mt(n,i,M,c,s,null)}return;case"dialog":Ze("beforetoggle",n),Ze("toggle",n),Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":Ze("load",n);break;case"video":case"audio":for(c=0;c<jo.length;c++)Ze(jo[c],n);break;case"image":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"embed":case"source":case"link":Ze("error",n),Ze("load",n);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(a(137,i));default:mt(n,i,G,c,s,null)}return;default:if(af(i)){for(te in s)s.hasOwnProperty(te)&&(c=s[te],c!==void 0&&Zh(n,i,te,c,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(c=s[_],c!=null&&mt(n,i,_,c,s,null))}function RN(n,i,s,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,w=null,_=null,M=null,G=null,te=null;for(Y in s){var se=s[Y];if(s.hasOwnProperty(Y)&&se!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":M=se;default:c.hasOwnProperty(Y)||mt(n,i,Y,null,c,se)}}for(var K in c){var Y=c[K];if(se=s[K],c.hasOwnProperty(K)&&(Y!=null||se!=null))switch(K){case"type":g=Y;break;case"name":p=Y;break;case"checked":G=Y;break;case"defaultChecked":te=Y;break;case"value":w=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==se&&mt(n,i,K,Y,c,se)}}nf(n,w,_,M,G,te,g,p);return;case"select":Y=w=_=K=null;for(g in s)if(M=s[g],s.hasOwnProperty(g)&&M!=null)switch(g){case"value":break;case"multiple":Y=M;default:c.hasOwnProperty(g)||mt(n,i,g,null,c,M)}for(p in c)if(g=c[p],M=s[p],c.hasOwnProperty(p)&&(g!=null||M!=null))switch(p){case"value":K=g;break;case"defaultValue":_=g;break;case"multiple":w=g;default:g!==M&&mt(n,i,p,g,c,M)}i=_,s=w,c=Y,K!=null?kl(n,!!s,K,!1):!!c!=!!s&&(i!=null?kl(n,!!s,i,!0):kl(n,!!s,s?[]:"",!1));return;case"textarea":Y=K=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:mt(n,i,_,null,c,p)}for(w in c)if(p=c[w],g=s[w],c.hasOwnProperty(w)&&(p!=null||g!=null))switch(w){case"value":K=p;break;case"defaultValue":Y=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==g&&mt(n,i,w,p,c,g)}dy(n,K,Y);return;case"option":for(var Se in s)if(K=s[Se],s.hasOwnProperty(Se)&&K!=null&&!c.hasOwnProperty(Se))switch(Se){case"selected":n.selected=!1;break;default:mt(n,i,Se,null,c,K)}for(M in c)if(K=c[M],Y=s[M],c.hasOwnProperty(M)&&K!==Y&&(K!=null||Y!=null))switch(M){case"selected":n.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:mt(n,i,M,K,c,Y)}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(n,i,ze,null,c,K);for(G in c)if(K=c[G],Y=s[G],c.hasOwnProperty(G)&&K!==Y&&(K!=null||Y!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:mt(n,i,G,K,c,Y)}return;default:if(af(i)){for(var pt in s)K=s[pt],s.hasOwnProperty(pt)&&K!==void 0&&!c.hasOwnProperty(pt)&&Zh(n,i,pt,void 0,c,K);for(te in c)K=c[te],Y=s[te],!c.hasOwnProperty(te)||K===Y||K===void 0&&Y===void 0||Zh(n,i,te,K,c,Y);return}}for(var Z in s)K=s[Z],s.hasOwnProperty(Z)&&K!=null&&!c.hasOwnProperty(Z)&&mt(n,i,Z,null,c,K);for(se in c)K=c[se],Y=s[se],!c.hasOwnProperty(se)||K===Y||K==null&&Y==null||mt(n,i,se,K,c,Y)}function pb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ON(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],g=p.transferSize,w=p.initiatorType,_=p.duration;if(g&&_&&pb(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&&pb(se)&&(M=M.responseEnd,w+=te*(M<_?1:(_-G)/(M-G)))}if(--c,i+=8*(g+w)/(p.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Vh=null,Qh=null;function Sc(n){return n.nodeType===9?n:n.ownerDocument}function gb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yb(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function Gh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Kh=null;function DN(){var n=window.event;return n&&n.type==="popstate"?n===Kh?!1:(Kh=n,!0):(Kh=null,!1)}var vb=typeof setTimeout=="function"?setTimeout:void 0,MN=typeof clearTimeout=="function"?clearTimeout:void 0,xb=typeof Promise=="function"?Promise:void 0,LN=typeof queueMicrotask=="function"?queueMicrotask:typeof xb<"u"?function(n){return xb.resolve(null).then(n).catch(UN)}:vb;function UN(n){setTimeout(function(){throw n})}function Qi(n){return n==="head"}function bb(n,i){var s=i,c=0;do{var p=s.nextSibling;if(n.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){n.removeChild(p),ts(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Co(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,Co(s);for(var g=s.firstChild;g;){var w=g.nextSibling,_=g.nodeName;g[qs]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||s.removeChild(g),g=w}}else s==="body"&&Co(n.ownerDocument.body);s=p}while(s);ts(i)}function Sb(n,i){var s=n;n=0;do{var c=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=c}while(s)}function Yh(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Yh(s),ef(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function IN(n,i,s,c){for(;n.nodeType===1;){var p=s;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[qs])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=cr(n.nextSibling),n===null)break}return null}function PN(n,i,s){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=cr(n.nextSibling),n===null))return null;return n}function wb(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=cr(n.nextSibling),n===null))return null;return n}function Xh(n){return n.data==="$?"||n.data==="$~"}function Jh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function BN(n,i){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function cr(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var Wh=null;function kb(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(i===0)return cr(n.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}n=n.nextSibling}return null}function jb(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return n;i--}else s!=="/$"&&s!=="/&"||i++}n=n.previousSibling}return null}function Eb(n,i,s){switch(i=Sc(s),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Co(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);ef(n)}var dr=new Map,Cb=new Set;function wc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var hi=W.d;W.d={f:$N,r:FN,D:qN,C:HN,L:ZN,m:VN,X:GN,S:QN,M:KN};function $N(){var n=hi.f(),i=hc();return n||i}function FN(n){var i=bl(n);i!==null&&i.tag===5&&i.type==="form"?qv(i):hi.r(n)}var Jl=typeof document>"u"?null:document;function Nb(n,i,s){var c=Jl;if(c&&typeof i=="string"&&i){var p=rr(i);p='link[rel="'+n+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Cb.has(p)||(Cb.add(p),n={rel:n,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),on(i,"link",n),Yt(i),c.head.appendChild(i)))}}function qN(n){hi.D(n),Nb("dns-prefetch",n,null)}function HN(n,i){hi.C(n,i),Nb("preconnect",n,i)}function ZN(n,i,s){hi.L(n,i,s);var c=Jl;if(c&&n&&i){var p='link[rel="preload"][as="'+rr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+rr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+rr(s.imageSizes)+'"]')):p+='[href="'+rr(n)+'"]';var g=p;switch(i){case"style":g=Wl(n);break;case"script":g=es(n)}dr.has(g)||(n=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),dr.set(g,n),c.querySelector(p)!==null||i==="style"&&c.querySelector(No(g))||i==="script"&&c.querySelector(_o(g))||(i=c.createElement("link"),on(i,"link",n),Yt(i),c.head.appendChild(i)))}}function VN(n,i){hi.m(n,i);var s=Jl;if(s&&n){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+rr(c)+'"][href="'+rr(n)+'"]',g=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=es(n)}if(!dr.has(g)&&(n=y({rel:"modulepreload",href:n},i),dr.set(g,n),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_o(g)))return}c=s.createElement("link"),on(c,"link",n),Yt(c),s.head.appendChild(c)}}}function QN(n,i,s){hi.S(n,i,s);var c=Jl;if(c&&n){var p=Sl(c).hoistableStyles,g=Wl(n);i=i||"default";var w=p.get(g);if(!w){var _={loading:0,preload:null};if(w=c.querySelector(No(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},s),(s=dr.get(g))&&em(n,s);var M=w=c.createElement("link");Yt(M),on(M,"link",n),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,kc(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:_},p.set(g,w)}}}function GN(n,i){hi.X(n,i);var s=Jl;if(s&&n){var c=Sl(s).hoistableScripts,p=es(n),g=c.get(p);g||(g=s.querySelector(_o(p)),g||(n=y({src:n,async:!0},i),(i=dr.get(p))&&tm(n,i),g=s.createElement("script"),Yt(g),on(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function KN(n,i){hi.M(n,i);var s=Jl;if(s&&n){var c=Sl(s).hoistableScripts,p=es(n),g=c.get(p);g||(g=s.querySelector(_o(p)),g||(n=y({src:n,async:!0,type:"module"},i),(i=dr.get(p))&&tm(n,i),g=s.createElement("script"),Yt(g),on(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function _b(n,i,s,c){var p=(p=oe.current)?wc(p):null;if(!p)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Wl(s.href),s=Sl(p).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Wl(s.href);var g=Sl(p).hoistableStyles,w=g.get(n);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,w),(g=p.querySelector(No(n)))&&!g._p&&(w.instance=g,w.state.loading=5),dr.has(n)||(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(n,s),g||YN(p,n,s,w.state))),i&&c===null)throw Error(a(528,""));return w}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=es(s),s=Sl(p).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function Wl(n){return'href="'+rr(n)+'"'}function No(n){return'link[rel="stylesheet"]['+n+"]"}function Ab(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function YN(n,i,s,c){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=n.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),on(i,"link",s),Yt(i),n.head.appendChild(i))}function es(n){return'[src="'+rr(n)+'"]'}function _o(n){return"script[async]"+n}function Tb(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=n.querySelector('style[data-href~="'+rr(s.href)+'"]');if(c)return i.instance=c,Yt(c),c;var p=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Yt(c),on(c,"style",p),kc(c,s.precedence,n),i.instance=c;case"stylesheet":p=Wl(s.href);var g=n.querySelector(No(p));if(g)return i.state.loading|=4,i.instance=g,Yt(g),g;c=Ab(s),(p=dr.get(p))&&em(c,p),g=(n.ownerDocument||n).createElement("link"),Yt(g);var w=g;return w._p=new Promise(function(_,M){w.onload=_,w.onerror=M}),on(g,"link",c),i.state.loading|=4,kc(g,s.precedence,n),i.instance=g;case"script":return g=es(s.src),(p=n.querySelector(_o(g)))?(i.instance=p,Yt(p),p):(c=s,(p=dr.get(g))&&(c=y({},s),tm(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),Yt(p),on(p,"link",c),n.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,kc(c,s.precedence,n));return i.instance}function kc(n,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,g=p,w=0;w<c.length;w++){var _=c[w];if(_.dataset.precedence===i)g=_;else if(g!==p)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(n,i.firstChild))}function em(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function tm(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var jc=null;function zb(n,i,s){if(jc===null){var c=new Map,p=jc=new Map;p.set(s,c)}else p=jc,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(n))return c;for(c.set(n,null),s=s.getElementsByTagName(n),p=0;p<s.length;p++){var g=s[p];if(!(g[qs]||g[rn]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(i)||"";w=n+w;var _=c.get(w);_?_.push(g):c.set(w,[g])}}return c}function Rb(n,i,s){n=n.ownerDocument||n,n.head.insertBefore(s,i==="title"?n.querySelector("head > title"):null)}function XN(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Ob(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function JN(n,i,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=Wl(c.href),g=i.querySelector(No(p));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Ec.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=g,Yt(g);return}g=i.ownerDocument||i,c=Ab(c),(p=dr.get(p))&&em(c,p),g=g.createElement("link"),Yt(g);var w=g;w._p=new Promise(function(_,M){w.onload=_,w.onerror=M}),on(g,"link",c),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Ec.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var nm=0;function WN(n,i){return n.stylesheets&&n.count===0&&Nc(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var c=setTimeout(function(){if(n.stylesheets&&Nc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&nm===0&&(nm=62500*ON());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Nc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>nm?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ec(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Cc=null;function Nc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Cc=new Map,i.forEach(e_,n),Cc=null,Ec.call(n))}function e_(n,i){if(!(i.state.loading&4)){var s=Cc.get(n);if(s)var c=s.get(null);else{s=new Map,Cc.set(n,s);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var w=p[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}p=i.instance,w=p.getAttribute("data-precedence"),g=s.get(w)||c,g===c&&s.set(null,p),s.set(w,p),this.count++,c=Ec.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),g?g.parentNode.insertBefore(p,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),i.state.loading|=4}}var Ao={$$typeof:A,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function t_(n,i,s,c,p,g,w,_,M){this.tag=1,this.containerInfo=n,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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Db(n,i,s,c,p,g,w,_,M,G,te,se){return n=new t_(n,i,s,w,M,G,te,se,_),i=1,g===!0&&(i|=24),g=qn(3,null,null,i),n.current=g,g.stateNode=n,i=Mf(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:c,isDehydrated:s,cache:i},Pf(g),n}function Mb(n){return n?(n=zl,n):zl}function Lb(n,i,s,c,p,g){p=Mb(p),c.context===null?c.context=p:c.pendingContext=p,c=Li(i),c.payload={element:s},g=g===void 0?null:g,g!==null&&(c.callback=g),s=Ui(n,c,i),s!==null&&(zn(s,n,i),lo(s,n,i))}function Ub(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<i?s:i}}function rm(n,i){Ub(n,i),(n=n.alternate)&&Ub(n,i)}function Ib(n){if(n.tag===13||n.tag===31){var i=Da(n,67108864);i!==null&&zn(i,n,67108864),rm(n,67108864)}}function Pb(n){if(n.tag===13||n.tag===31){var i=Gn();i=Xd(i);var s=Da(n,i);s!==null&&zn(s,n,i),rm(n,i)}}var _c=!0;function n_(n,i,s,c){var p=P.T;P.T=null;var g=W.p;try{W.p=2,im(n,i,s,c)}finally{W.p=g,P.T=p}}function r_(n,i,s,c){var p=P.T;P.T=null;var g=W.p;try{W.p=8,im(n,i,s,c)}finally{W.p=g,P.T=p}}function im(n,i,s,c){if(_c){var p=am(c);if(p===null)Hh(n,i,c,Ac,s),$b(n,c);else if(a_(p,n,i,s,c))c.stopPropagation();else if($b(n,c),i&4&&-1<i_.indexOf(n)){for(;p!==null;){var g=bl(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=Tr(g.pendingLanes);if(w!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;w;){var M=1<<31-ct(w);_.entanglements[1]|=M,w&=~M}Dr(g),(lt&6)===0&&(dc=tn()+500,ko(0))}}break;case 31:case 13:_=Da(g,2),_!==null&&zn(_,g,2),hc(),rm(g,2)}if(g=am(c),g===null&&Hh(n,i,c,Ac,s),g===p)break;p=g}p!==null&&c.stopPropagation()}else Hh(n,i,c,null,s)}}function am(n){return n=sf(n),lm(n)}var Ac=null;function lm(n){if(Ac=null,n=xl(n),n!==null){var i=o(n);if(i===null)n=null;else{var s=i.tag;if(s===13){if(n=u(i),n!==null)return n;n=null}else if(s===31){if(n=f(i),n!==null)return n;n=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Ac=n,null}function Bb(n){switch(n){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(Fs()){case ne:return 2;case he:return 8;case Oe:case $e:return 32;case nt:return 268435456;default:return 32}default:return 32}}var sm=!1,Gi=null,Ki=null,Yi=null,To=new Map,zo=new Map,Xi=[],i_="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 $b(n,i){switch(n){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":Yi=null;break;case"pointerover":case"pointerout":To.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":zo.delete(i.pointerId)}}function Ro(n,i,s,c,p,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:g,targetContainers:[p]},i!==null&&(i=bl(i),i!==null&&Ib(i)),n):(n.eventSystemFlags|=c,i=n.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),n)}function a_(n,i,s,c,p){switch(i){case"focusin":return Gi=Ro(Gi,n,i,s,c,p),!0;case"dragenter":return Ki=Ro(Ki,n,i,s,c,p),!0;case"mouseover":return Yi=Ro(Yi,n,i,s,c,p),!0;case"pointerover":var g=p.pointerId;return To.set(g,Ro(To.get(g)||null,n,i,s,c,p)),!0;case"gotpointercapture":return g=p.pointerId,zo.set(g,Ro(zo.get(g)||null,n,i,s,c,p)),!0}return!1}function Fb(n){var i=xl(n.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){n.blockedOn=i,ny(n.priority,function(){Pb(s)});return}}else if(i===31){if(i=f(s),i!==null){n.blockedOn=i,ny(n.priority,function(){Pb(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Tc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var s=am(n.nativeEvent);if(s===null){s=n.nativeEvent;var c=new s.constructor(s.type,s);lf=c,s.target.dispatchEvent(c),lf=null}else return i=bl(s),i!==null&&Ib(i),n.blockedOn=s,!1;i.shift()}return!0}function qb(n,i,s){Tc(n)&&s.delete(i)}function l_(){sm=!1,Gi!==null&&Tc(Gi)&&(Gi=null),Ki!==null&&Tc(Ki)&&(Ki=null),Yi!==null&&Tc(Yi)&&(Yi=null),To.forEach(qb),zo.forEach(qb)}function zc(n,i){n.blockedOn===i&&(n.blockedOn=null,sm||(sm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l_)))}var Rc=null;function Hb(n){Rc!==n&&(Rc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rc===n&&(Rc=null);for(var i=0;i<n.length;i+=3){var s=n[i],c=n[i+1],p=n[i+2];if(typeof c!="function"){if(lm(c||s)===null)continue;break}var g=bl(s);g!==null&&(n.splice(i,3),i-=3,ah(g,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function ts(n){function i(M){return zc(M,n)}Gi!==null&&zc(Gi,n),Ki!==null&&zc(Ki,n),Yi!==null&&zc(Yi,n),To.forEach(i),zo.forEach(i);for(var s=0;s<Xi.length;s++){var c=Xi[s];c.blockedOn===n&&(c.blockedOn=null)}for(;0<Xi.length&&(s=Xi[0],s.blockedOn===null);)Fb(s),s.blockedOn===null&&Xi.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],g=s[c+1],w=p[En]||null;if(typeof g=="function")w||Hb(s);else if(w){var _=null;if(g&&g.hasAttribute("formAction")){if(p=g,w=g[En]||null)_=w.formAction;else if(lm(p)!==null)continue}else _=w.action;typeof _=="function"?s[c+1]=_:(s.splice(c,3),c-=3),Hb(s)}}}function Zb(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function om(n){this._internalRoot=n}Oc.prototype.render=om.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Gn();Lb(s,c,n,i,null,null)},Oc.prototype.unmount=om.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Lb(n.current,2,null,n,null,null),hc(),i[vl]=null}};function Oc(n){this._internalRoot=n}Oc.prototype.unstable_scheduleHydration=function(n){if(n){var i=ty();n={blockedOn:null,target:n,priority:i};for(var s=0;s<Xi.length&&i!==0&&i<Xi[s].priority;s++);Xi.splice(s,0,n),s===0&&Fb(n)}};var Vb=t.version;if(Vb!=="19.2.4")throw Error(a(527,Vb,"19.2.4"));W.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=h(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var s_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dc.isDisabled&&Dc.supportsFiber)try{nn=Dc.inject(s_),Mt=Dc}catch{}}return Do.createRoot=function(n,i){if(!l(n))throw Error(a(299));var s=!1,c="",p=Wv,g=ex,w=tx;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Db(n,1,!1,null,null,s,c,null,p,g,w,Zb),n[vl]=i.current,qh(n),new om(i)},Do.hydrateRoot=function(n,i,s){if(!l(n))throw Error(a(299));var c=!1,p="",g=Wv,w=ex,_=tx,M=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),i=Db(n,1,!0,i,s??null,c,p,M,g,w,_,Zb),i.context=Mb(null),s=i.current,c=Gn(),c=Xd(c),p=Li(c),p.callback=null,Ui(s,p,c),s=c,i.current.lanes=s,pn(i,s),Dr(i),n[vl]=i.current,qh(n),new Oc(i)},Do.version="19.2.4",Do}var r0;function v_(){if(r0)return fm.exports;r0=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(),fm.exports=y_(),fm.exports}var x_=v_(),Os=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(){}},Xa,aa,gs,SS,b_=(SS=class extends Os{constructor(){super();_e(this,Xa);_e(this,aa);_e(this,gs);ge(this,gs,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,aa)||this.setEventListener(L(this,gs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,aa))==null||t.call(this),ge(this,aa,void 0))}setEventListener(t){var r;ge(this,gs,t),(r=L(this,aa))==null||r.call(this),ge(this,aa,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){L(this,Xa)!==t&&(ge(this,Xa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,Xa)=="boolean"?L(this,Xa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Xa=new WeakMap,aa=new WeakMap,gs=new WeakMap,SS),Yp=new b_,S_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},la,Qp,wS,w_=(wS=class{constructor(){_e(this,la,S_);_e(this,Qp,!1)}setTimeoutProvider(e){ge(this,la,e)}setTimeout(e,t){return L(this,la).setTimeout(e,t)}clearTimeout(e){L(this,la).clearTimeout(e)}setInterval(e,t){return L(this,la).setInterval(e,t)}clearInterval(e){L(this,la).clearInterval(e)}},la=new WeakMap,Qp=new WeakMap,wS),Ya=new w_;function k_(e){setTimeout(e,0)}var j_=typeof window>"u"||"Deno"in globalThis;function xn(){}function E_(e,t){return typeof e=="function"?e(t):e}function rp(e){return typeof e=="number"&&e>=0&&e!==1/0}function OS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ma(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function i0(e,t){const{type:r="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==Xp(u,t.options))return!1}else if(!Yo(t.queryKey,u))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function a0(e,t){const{exact:r,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(ll(t.options.mutationKey)!==ll(o))return!1}else if(!Yo(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Xp(e,t){return((t==null?void 0:t.queryKeyHashFn)||ll)(e)}function ll(e){return JSON.stringify(e,(t,r)=>ip(r)?Object.keys(r).sort().reduce((a,l)=>(a[l]=r[l],a),{}):r)}function Yo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Yo(e[r],t[r])):!1}var C_=Object.prototype.hasOwnProperty;function DS(e,t,r=0){if(e===t)return e;if(r>500)return t;const a=l0(e)&&l0(t);if(!a&&!(ip(e)&&ip(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let v=0;v<f;v++){const y=a?v:u[v],x=e[y],b=t[y];if(x===b){m[y]=x,(a?v<o:C_.call(e,y))&&h++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[y]=b;continue}const k=DS(x,b,r+1);m[y]=k,k===x&&h++}return o===f&&h===o?e:m}function od(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function l0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ip(e){if(!s0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!s0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function s0(e){return Object.prototype.toString.call(e)==="[object Object]"}function N_(e){return new Promise(t=>{Ya.setTimeout(t,e)})}function ap(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?DS(e,t):t}function __(e,t,r=0){const a=[...e,t];return r&&a.length>r?a.slice(1):a}function A_(e,t,r=0){const a=[t,...e];return r&&a.length>r?a.slice(0,-1):a}var Jp=Symbol();function MS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Jp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wp(e,t){return typeof e=="function"?e(...t):!!e}function T_(e,t,r){let a=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),a||(a=!0,l.aborted?r():l.addEventListener("abort",r,{once:!0})),l)}),e}var Xo=(()=>{let e=()=>j_;return{isServer(){return e()},setIsServer(t){e=t}}})();function lp(){let e,t;const r=new Promise((l,o)=>{e=l,t=o});r.status="pending",r.catch(()=>{});function a(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{a({status:"fulfilled",value:l}),e(l)},r.reject=l=>{a({status:"rejected",reason:l}),t(l)},r}var z_=k_;function R_(){let e=[],t=0,r=f=>{f()},a=f=>{f()},l=z_;const o=f=>{t?e.push(f):l(()=>{r(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{r(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=>{r=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Qt=R_(),ys,sa,vs,kS,O_=(kS=class extends Os{constructor(){super();_e(this,ys,!0);_e(this,sa);_e(this,vs);ge(this,vs,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}})}onSubscribe(){L(this,sa)||this.setEventListener(L(this,vs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,sa))==null||t.call(this),ge(this,sa,void 0))}setEventListener(t){var r;ge(this,vs,t),(r=L(this,sa))==null||r.call(this),ge(this,sa,t(this.setOnline.bind(this)))}setOnline(t){L(this,ys)!==t&&(ge(this,ys,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return L(this,ys)}},ys=new WeakMap,sa=new WeakMap,vs=new WeakMap,kS),ud=new O_;function D_(e){return Math.min(1e3*2**e,3e4)}function LS(e){return(e??"online")==="online"?ud.isOnline():!0}var sp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function US(e){let t=!1,r=0,a;const l=lp(),o=()=>l.status!=="pending",u=j=>{var N;if(!o()){const E=new sp(j);x(E),(N=e.onCancel)==null||N.call(e,E)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Yp.isFocused()&&(e.networkMode==="always"||ud.isOnline())&&e.canRun(),v=()=>LS(e.networkMode)&&e.canRun(),y=j=>{o()||(a==null||a(),l.resolve(j))},x=j=>{o()||(a==null||a(),l.reject(j))},b=()=>new Promise(j=>{var N;a=E=>{(o()||h())&&j(E)},(N=e.onPause)==null||N.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const N=r===0?e.initialPromise:void 0;try{j=N??e.fn()}catch(E){j=Promise.reject(E)}Promise.resolve(j).then(y).catch(E=>{var O;if(o())return;const R=e.retry??(Xo.isServer()?0:3),A=e.retryDelay??D_,I=typeof A=="function"?A(r,E):A,F=R===!0||typeof R=="number"&&r<R||typeof R=="function"&&R(r,E);if(t||!F){x(E);return}r++,(O=e.onFail)==null||O.call(e,r,E),N_(I).then(()=>h()?void 0:b()).then(()=>{t?x(E):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?k():b().then(k),l)}}var Ja,jS,IS=(jS=class{constructor(){_e(this,Ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rp(this.gcTime)&&ge(this,Ja,Ya.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xo.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,Ja)&&(Ya.clearTimeout(L(this,Ja)),ge(this,Ja,void 0))}},Ja=new WeakMap,jS),Wa,xs,fr,el,Jt,ou,tl,Yn,PS,pi,ES,M_=(ES=class extends IS{constructor(t){super();_e(this,Yn);_e(this,Wa);_e(this,xs);_e(this,fr);_e(this,el);_e(this,Jt);_e(this,ou);_e(this,tl);ge(this,tl,!1),ge(this,ou,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,el,t.client),ge(this,fr,L(this,el).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,Wa,u0(this.options)),this.state=t.state??L(this,Wa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,Jt))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,ou),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=u0(this.options);r.data!==void 0&&(this.setState(o0(r.data,r.dataUpdatedAt)),ge(this,Wa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,fr).remove(this)}setData(t,r){const a=ap(this.state.data,t,this.options);return Pe(this,Yn,pi).call(this,{data:a,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),a}setState(t,r){Pe(this,Yn,pi).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var a,l;const r=(a=L(this,Jt))==null?void 0:a.promise;return(l=L(this,Jt))==null||l.cancel(t),r?r.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,Wa)}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===Jp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ma(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:!OS(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Jt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Jt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,Jt)&&(L(this,tl)||Pe(this,Yn,PS).call(this)?L(this,Jt).cancel({revert:!0}):L(this,Jt).cancelRetry()),this.scheduleGc()),L(this,fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pe(this,Yn,pi).call(this,{type:"invalidate"})}async fetch(t,r){var m,h,v,y,x,b,k,j,N,E,R,A;if(this.state.fetchStatus!=="idle"&&((m=L(this,Jt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,Jt))return L(this,Jt).continueRetry(),L(this,Jt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(F=>F.options.queryFn);I&&this.setOptions(I.options)}const a=new AbortController,l=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(ge(this,tl,!0),a.signal)})},o=()=>{const I=MS(this.options,r),O=(()=>{const $={client:L(this,el),queryKey:this.queryKey,meta:this.meta};return l($),$})();return ge(this,tl,!1),this.options.persister?this.options.persister(I,O,this):I(O)},f=(()=>{const I={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:L(this,el),state:this.state,fetchFn:o};return l(I),I})();(h=this.options.behavior)==null||h.onFetch(f,this),ge(this,xs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=f.fetchOptions)==null?void 0:v.meta))&&Pe(this,Yn,pi).call(this,{type:"fetch",meta:(y=f.fetchOptions)==null?void 0:y.meta}),ge(this,Jt,US({initialPromise:r==null?void 0:r.initialPromise,fn:f.fetchFn,onCancel:I=>{I instanceof sp&&I.revert&&this.setState({...L(this,xs),fetchStatus:"idle"}),a.abort()},onFail:(I,F)=>{Pe(this,Yn,pi).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{Pe(this,Yn,pi).call(this,{type:"pause"})},onContinue:()=>{Pe(this,Yn,pi).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const I=await L(this,Jt).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(b=(x=L(this,fr).config).onSuccess)==null||b.call(x,I,this),(j=(k=L(this,fr).config).onSettled)==null||j.call(k,I,this.state.error,this),I}catch(I){if(I instanceof sp){if(I.silent)return L(this,Jt).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw Pe(this,Yn,pi).call(this,{type:"error",error:I}),(E=(N=L(this,fr).config).onError)==null||E.call(N,I,this),(A=(R=L(this,fr).config).onSettled)==null||A.call(R,this.state.data,I,this),I}finally{this.scheduleGc()}}},Wa=new WeakMap,xs=new WeakMap,fr=new WeakMap,el=new WeakMap,Jt=new WeakMap,ou=new WeakMap,tl=new WeakMap,Yn=new WeakSet,PS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},pi=function(t){const r=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...BS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...o0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,xs,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=r(this.state),Qt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),L(this,fr).notify({query:this,type:"updated",action:t})})},ES);function BS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:LS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function o0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var On,Je,uu,vn,nl,bs,gi,oa,cu,Ss,ws,rl,il,ua,ks,ot,qo,op,up,cp,dp,fp,hp,mp,$S,CS,L_=(CS=class extends Os{constructor(t,r){super();_e(this,ot);_e(this,On);_e(this,Je);_e(this,uu);_e(this,vn);_e(this,nl);_e(this,bs);_e(this,gi);_e(this,oa);_e(this,cu);_e(this,Ss);_e(this,ws);_e(this,rl);_e(this,il);_e(this,ua);_e(this,ks,new Set);this.options=r,ge(this,On,t),ge(this,oa,null),ge(this,gi,lp()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Je).addObserver(this),c0(L(this,Je),this.options)?Pe(this,ot,qo).call(this):this.updateResult(),Pe(this,ot,dp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pp(L(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pp(L(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pe(this,ot,fp).call(this),Pe(this,ot,hp).call(this),L(this,Je).removeObserver(this)}setOptions(t){const r=this.options,a=L(this,Je);if(this.options=L(this,On).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,L(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pe(this,ot,mp).call(this),L(this,Je).setOptions(this.options),r._defaulted&&!od(this.options,r)&&L(this,On).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Je),observer:this});const l=this.hasListeners();l&&d0(L(this,Je),a,this.options,r)&&Pe(this,ot,qo).call(this),this.updateResult(),l&&(L(this,Je)!==a||hr(this.options.enabled,L(this,Je))!==hr(r.enabled,L(this,Je))||ma(this.options.staleTime,L(this,Je))!==ma(r.staleTime,L(this,Je)))&&Pe(this,ot,op).call(this);const o=Pe(this,ot,up).call(this);l&&(L(this,Je)!==a||hr(this.options.enabled,L(this,Je))!==hr(r.enabled,L(this,Je))||o!==L(this,ua))&&Pe(this,ot,cp).call(this,o)}getOptimisticResult(t){const r=L(this,On).getQueryCache().build(L(this,On),t),a=this.createResult(r,t);return I_(this,a)&&(ge(this,vn,a),ge(this,bs,this.options),ge(this,nl,L(this,Je).state)),a}getCurrentResult(){return L(this,vn)}trackResult(t,r){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),r==null||r(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,gi).status==="pending"&&L(this,gi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){L(this,ks).add(t)}getCurrentQuery(){return L(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,On).defaultQueryOptions(t),a=L(this,On).getQueryCache().build(L(this,On),r);return a.fetch().then(()=>this.createResult(a,r))}fetch(t){return Pe(this,ot,qo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,vn)))}createResult(t,r){var J;const a=L(this,Je),l=this.options,o=L(this,vn),u=L(this,nl),f=L(this,bs),h=t!==a?t.state:L(this,uu),{state:v}=t;let y={...v},x=!1,b;if(r._optimisticResults){const q=this.hasListeners(),re=!q&&c0(t,r),ae=q&&d0(t,a,r,l);(re||ae)&&(y={...y,...BS(v.data,t.options)}),r._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:N}=y;b=y.data;let E=!1;if(r.placeholderData!==void 0&&b===void 0&&N==="pending"){let q;o!=null&&o.isPlaceholderData&&r.placeholderData===(f==null?void 0:f.placeholderData)?(q=o.data,E=!0):q=typeof r.placeholderData=="function"?r.placeholderData((J=L(this,ws))==null?void 0:J.state.data,L(this,ws)):r.placeholderData,q!==void 0&&(N="success",b=ap(o==null?void 0:o.data,q,r),x=!0)}if(r.select&&b!==void 0&&!E)if(o&&b===(u==null?void 0:u.data)&&r.select===L(this,cu))b=L(this,Ss);else try{ge(this,cu,r.select),b=r.select(b),b=ap(o==null?void 0:o.data,b,r),ge(this,Ss,b),ge(this,oa,null)}catch(q){ge(this,oa,q)}L(this,oa)&&(k=L(this,oa),b=L(this,Ss),j=Date.now(),N="error");const R=y.fetchStatus==="fetching",A=N==="pending",I=N==="error",F=A&&R,O=b!==void 0,V={status:N,fetchStatus:y.fetchStatus,isPending:A,isSuccess:N==="success",isError:I,isInitialLoading:F,isLoading:F,data:b,dataUpdatedAt:y.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:R,isRefetching:R&&!A,isLoadingError:I&&!O,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:I&&O,isStale:eg(t,r),refetch:this.refetch,promise:L(this,gi),isEnabled:hr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=V.data!==void 0,re=V.status==="error"&&!q,ae=ee=>{re?ee.reject(V.error):q&&ee.resolve(V.data)},me=()=>{const ee=ge(this,gi,V.promise=lp());ae(ee)},ce=L(this,gi);switch(ce.status){case"pending":t.queryHash===a.queryHash&&ae(ce);break;case"fulfilled":(re||V.data!==ce.value)&&me();break;case"rejected":(!re||V.error!==ce.reason)&&me();break}}return V}updateResult(){const t=L(this,vn),r=this.createResult(L(this,Je),this.options);if(ge(this,nl,L(this,Je).state),ge(this,bs,this.options),L(this,nl).data!==void 0&&ge(this,ws,L(this,Je)),od(r,t))return;ge(this,vn,r);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!L(this,ks).size)return!0;const u=new Set(o??L(this,ks));return this.options.throwOnError&&u.add("error"),Object.keys(L(this,vn)).some(f=>{const m=f;return L(this,vn)[m]!==t[m]&&u.has(m)})};Pe(this,ot,$S).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pe(this,ot,dp).call(this)}},On=new WeakMap,Je=new WeakMap,uu=new WeakMap,vn=new WeakMap,nl=new WeakMap,bs=new WeakMap,gi=new WeakMap,oa=new WeakMap,cu=new WeakMap,Ss=new WeakMap,ws=new WeakMap,rl=new WeakMap,il=new WeakMap,ua=new WeakMap,ks=new WeakMap,ot=new WeakSet,qo=function(t){Pe(this,ot,mp).call(this);let r=L(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(xn)),r},op=function(){Pe(this,ot,fp).call(this);const t=ma(this.options.staleTime,L(this,Je));if(Xo.isServer()||L(this,vn).isStale||!rp(t))return;const a=OS(L(this,vn).dataUpdatedAt,t)+1;ge(this,rl,Ya.setTimeout(()=>{L(this,vn).isStale||this.updateResult()},a))},up=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Je)):this.options.refetchInterval)??!1},cp=function(t){Pe(this,ot,hp).call(this),ge(this,ua,t),!(Xo.isServer()||hr(this.options.enabled,L(this,Je))===!1||!rp(L(this,ua))||L(this,ua)===0)&&ge(this,il,Ya.setInterval(()=>{(this.options.refetchIntervalInBackground||Yp.isFocused())&&Pe(this,ot,qo).call(this)},L(this,ua)))},dp=function(){Pe(this,ot,op).call(this),Pe(this,ot,cp).call(this,Pe(this,ot,up).call(this))},fp=function(){L(this,rl)&&(Ya.clearTimeout(L(this,rl)),ge(this,rl,void 0))},hp=function(){L(this,il)&&(Ya.clearInterval(L(this,il)),ge(this,il,void 0))},mp=function(){const t=L(this,On).getQueryCache().build(L(this,On),this.options);if(t===L(this,Je))return;const r=L(this,Je);ge(this,Je,t),ge(this,uu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},$S=function(t){Qt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,vn))}),L(this,On).getQueryCache().notify({query:L(this,Je),type:"observerResultsUpdated"})})},CS);function U_(e,t){return hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function c0(e,t){return U_(e,t)||e.state.data!==void 0&&pp(e,t,t.refetchOnMount)}function pp(e,t,r){if(hr(t.enabled,e)!==!1&&ma(t.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&eg(e,t)}return!1}function d0(e,t,r,a){return(e!==t||hr(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&eg(e,r)}function eg(e,t){return hr(t.enabled,e)!==!1&&e.isStaleByTime(ma(t.staleTime,e))}function I_(e,t){return!od(e.getCurrentResult(),t)}function f0(e){return{onFetch:(t,r)=>{var v,y,x,b,k;const a=t.options,l=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const N=A=>{T_(A,()=>t.signal,()=>j=!0)},E=MS(t.options,t.fetchOptions),R=async(A,I,F)=>{if(j)return Promise.reject();if(I==null&&A.pages.length)return Promise.resolve(A);const $=(()=>{const re={client:t.client,queryKey:t.queryKey,pageParam:I,direction:F?"backward":"forward",meta:t.options.meta};return N(re),re})(),V=await E($),{maxPages:J}=t.options,q=F?A_:__;return{pages:q(A.pages,V,J),pageParams:q(A.pageParams,I,J)}};if(l&&o.length){const A=l==="backward",I=A?P_:h0,F={pages:o,pageParams:u},O=I(a,F);f=await R(F,O,A)}else{const A=e??o.length;do{const I=m===0?u[0]??a.initialPageParam:h0(a,f);if(m>0&&I==null)break;f=await R(f,I),m++}while(m<A)}return f};t.options.persister?t.fetchFn=()=>{var j,N;return(N=(j=t.options).persister)==null?void 0:N.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function h0(e,{pages:t,pageParams:r}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}function P_(e,{pages:t,pageParams:r}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,r[0],r):void 0}var du,Ur,dn,al,Ir,na,NS,B_=(NS=class extends IS{constructor(t){super();_e(this,Ir);_e(this,du);_e(this,Ur);_e(this,dn);_e(this,al);ge(this,du,t.client),this.mutationId=t.mutationId,ge(this,dn,t.mutationCache),ge(this,Ur,[]),this.state=t.state||FS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Ur).includes(t)||(L(this,Ur).push(t),this.clearGcTimeout(),L(this,dn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,Ur,L(this,Ur).filter(r=>r!==t)),this.scheduleGc(),L(this,dn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Ur).length||(this.state.status==="pending"?this.scheduleGc():L(this,dn).remove(this))}continue(){var t;return((t=L(this,al))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,v,y,x,b,k,j,N,E,R,A,I,F,O,$;const r=()=>{Pe(this,Ir,na).call(this,{type:"continue"})},a={client:L(this,du),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,al,US({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(V,J)=>{Pe(this,Ir,na).call(this,{type:"failed",failureCount:V,error:J})},onPause:()=>{Pe(this,Ir,na).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,dn).canRun(this)}));const l=this.state.status==="pending",o=!L(this,al).canStart();try{if(l)r();else{Pe(this,Ir,na).call(this,{type:"pending",variables:t,isPaused:o}),L(this,dn).config.onMutate&&await L(this,dn).config.onMutate(t,this,a);const J=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));J!==this.state.context&&Pe(this,Ir,na).call(this,{type:"pending",context:J,variables:t,isPaused:o})}const V=await L(this,al).start();return await((h=(m=L(this,dn).config).onSuccess)==null?void 0:h.call(m,V,t,this.state.context,this,a)),await((y=(v=this.options).onSuccess)==null?void 0:y.call(v,V,t,this.state.context,a)),await((b=(x=L(this,dn).config).onSettled)==null?void 0:b.call(x,V,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,V,null,t,this.state.context,a)),Pe(this,Ir,na).call(this,{type:"success",data:V}),V}catch(V){try{await((E=(N=L(this,dn).config).onError)==null?void 0:E.call(N,V,t,this.state.context,this,a))}catch(J){Promise.reject(J)}try{await((A=(R=this.options).onError)==null?void 0:A.call(R,V,t,this.state.context,a))}catch(J){Promise.reject(J)}try{await((F=(I=L(this,dn).config).onSettled)==null?void 0:F.call(I,void 0,V,this.state.variables,this.state.context,this,a))}catch(J){Promise.reject(J)}try{await(($=(O=this.options).onSettled)==null?void 0:$.call(O,void 0,V,t,this.state.context,a))}catch(J){Promise.reject(J)}throw Pe(this,Ir,na).call(this,{type:"error",error:V}),V}finally{L(this,dn).runNext(this)}}},du=new WeakMap,Ur=new WeakMap,dn=new WeakMap,al=new WeakMap,Ir=new WeakSet,na=function(t){const r=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,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{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Qt.batch(()=>{L(this,Ur).forEach(a=>{a.onMutationUpdate(t)}),L(this,dn).notify({mutation:this,type:"updated",action:t})})},NS);function FS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yi,jr,fu,_S,$_=(_S=class extends Os{constructor(t={}){super();_e(this,yi);_e(this,jr);_e(this,fu);this.config=t,ge(this,yi,new Set),ge(this,jr,new Map),ge(this,fu,0)}build(t,r,a){const l=new B_({client:t,mutationCache:this,mutationId:++Mc(this,fu)._,options:t.defaultMutationOptions(r),state:a});return this.add(l),l}add(t){L(this,yi).add(t);const r=Lc(t);if(typeof r=="string"){const a=L(this,jr).get(r);a?a.push(t):L(this,jr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,yi).delete(t)){const r=Lc(t);if(typeof r=="string"){const a=L(this,jr).get(r);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&L(this,jr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Lc(t);if(typeof r=="string"){const a=L(this,jr).get(r),l=a==null?void 0:a.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var a;const r=Lc(t);if(typeof r=="string"){const l=(a=L(this,jr).get(r))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Qt.batch(()=>{L(this,yi).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,yi).clear(),L(this,jr).clear()})}getAll(){return Array.from(L(this,yi))}find(t){const r={exact:!0,...t};return this.getAll().find(a=>a0(r,a))}findAll(t={}){return this.getAll().filter(r=>a0(t,r))}notify(t){Qt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Qt.batch(()=>Promise.all(t.map(r=>r.continue().catch(xn))))}},yi=new WeakMap,jr=new WeakMap,fu=new WeakMap,_S);function Lc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vi,ca,Dn,xi,wi,ed,gp,AS,F_=(AS=class extends Os{constructor(r,a){super();_e(this,wi);_e(this,vi);_e(this,ca);_e(this,Dn);_e(this,xi);ge(this,vi,r),this.setOptions(a),this.bindMethods(),Pe(this,wi,ed).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var l;const a=this.options;this.options=L(this,vi).defaultMutationOptions(r),od(this.options,a)||L(this,vi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,Dn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ll(a.mutationKey)!==ll(this.options.mutationKey)?this.reset():((l=L(this,Dn))==null?void 0:l.state.status)==="pending"&&L(this,Dn).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=L(this,Dn))==null||r.removeObserver(this)}onMutationUpdate(r){Pe(this,wi,ed).call(this),Pe(this,wi,gp).call(this,r)}getCurrentResult(){return L(this,ca)}reset(){var r;(r=L(this,Dn))==null||r.removeObserver(this),ge(this,Dn,void 0),Pe(this,wi,ed).call(this),Pe(this,wi,gp).call(this)}mutate(r,a){var l;return ge(this,xi,a),(l=L(this,Dn))==null||l.removeObserver(this),ge(this,Dn,L(this,vi).getMutationCache().build(L(this,vi),this.options)),L(this,Dn).addObserver(this),L(this,Dn).execute(r)}},vi=new WeakMap,ca=new WeakMap,Dn=new WeakMap,xi=new WeakMap,wi=new WeakSet,ed=function(){var a;const r=((a=L(this,Dn))==null?void 0:a.state)??FS();ge(this,ca,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},gp=function(r){Qt.batch(()=>{var a,l,o,u,f,m,h,v;if(L(this,xi)&&this.hasListeners()){const y=L(this,ca).variables,x=L(this,ca).context,b={client:L(this,vi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(l=(a=L(this,xi)).onSuccess)==null||l.call(a,r.data,y,x,b)}catch(k){Promise.reject(k)}try{(u=(o=L(this,xi)).onSettled)==null||u.call(o,r.data,null,y,x,b)}catch(k){Promise.reject(k)}}else if((r==null?void 0:r.type)==="error"){try{(m=(f=L(this,xi)).onError)==null||m.call(f,r.error,y,x,b)}catch(k){Promise.reject(k)}try{(v=(h=L(this,xi)).onSettled)==null||v.call(h,void 0,r.error,y,x,b)}catch(k){Promise.reject(k)}}}this.listeners.forEach(y=>{y(L(this,ca))})})},AS),Pr,TS,q_=(TS=class extends Os{constructor(t={}){super();_e(this,Pr);this.config=t,ge(this,Pr,new Map)}build(t,r,a){const l=r.queryKey,o=r.queryHash??Xp(l,r);let u=this.get(o);return u||(u=new M_({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(r),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){L(this,Pr).has(t.queryHash)||(L(this,Pr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,Pr).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,Pr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Pr).get(t)}getAll(){return[...L(this,Pr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(a=>i0(r,a))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(a=>i0(t,a)):r}notify(t){Qt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Pr=new WeakMap,TS),Dt,da,fa,js,Es,ha,Cs,Ns,zS,H_=(zS=class{constructor(e={}){_e(this,Dt);_e(this,da);_e(this,fa);_e(this,js);_e(this,Es);_e(this,ha);_e(this,Cs);_e(this,Ns);ge(this,Dt,e.queryCache||new q_),ge(this,da,e.mutationCache||new $_),ge(this,fa,e.defaultOptions||{}),ge(this,js,new Map),ge(this,Es,new Map),ge(this,ha,0)}mount(){Mc(this,ha)._++,L(this,ha)===1&&(ge(this,Cs,Yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Dt).onFocus())})),ge(this,Ns,ud.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Dt).onOnline())})))}unmount(){var e,t;Mc(this,ha)._--,L(this,ha)===0&&((e=L(this,Cs))==null||e.call(this),ge(this,Cs,void 0),(t=L(this,Ns))==null||t.call(this),ge(this,Ns,void 0))}isFetching(e){return L(this,Dt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,da).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,Dt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=L(this,Dt).build(this,t),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ma(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return L(this,Dt).findAll(e).map(({queryKey:t,state:r})=>{const a=r.data;return[t,a]})}setQueryData(e,t,r){const a=this.defaultQueryOptions({queryKey:e}),l=L(this,Dt).get(a.queryHash),o=l==null?void 0:l.state.data,u=E_(t,o);if(u!==void 0)return L(this,Dt).build(this,a).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Qt.batch(()=>L(this,Dt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,Dt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,Dt);Qt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,Dt);return Qt.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},a=Qt.batch(()=>L(this,Dt).findAll(e).map(l=>l.cancel(r)));return Promise.all(a).then(xn).catch(xn)}invalidateQueries(e,t={}){return Qt.batch(()=>(L(this,Dt).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},a=Qt.batch(()=>L(this,Dt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,r);return r.throwOnError||(o=o.catch(xn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(xn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,Dt).build(this,t);return r.isStaleByTime(ma(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xn).catch(xn)}fetchInfiniteQuery(e){return e.behavior=f0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xn).catch(xn)}ensureInfiniteQueryData(e){return e.behavior=f0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ud.isOnline()?L(this,da).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Dt)}getMutationCache(){return L(this,da)}getDefaultOptions(){return L(this,fa)}setDefaultOptions(e){ge(this,fa,e)}setQueryDefaults(e,t){L(this,js).set(ll(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,js).values()],r={};return t.forEach(a=>{Yo(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,t){L(this,Es).set(ll(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,Es).values()],r={};return t.forEach(a=>{Yo(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,fa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Xp(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===Jp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,fa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Dt).clear(),L(this,da).clear()}},Dt=new WeakMap,da=new WeakMap,fa=new WeakMap,js=new WeakMap,Es=new WeakMap,ha=new WeakMap,Cs=new WeakMap,Ns=new WeakMap,zS),qS=S.createContext(void 0),er=e=>{const t=S.useContext(qS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Z_=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(qS.Provider,{value:e,children:t})),HS=S.createContext(!1),V_=()=>S.useContext(HS);HS.Provider;function Q_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var G_=S.createContext(Q_()),K_=()=>S.useContext(G_),Y_=(e,t,r)=>{const a=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Wp(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},X_=e=>{S.useEffect(()=>{e.clearReset()},[e])},J_=({result:e,errorResetBoundary:t,throwOnError:r,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Wp(r,[e.error,a])),W_=e=>{if(e.suspense){const r=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>r(a(...l)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},e2=(e,t)=>e.isLoading&&e.isFetching&&!t,t2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,m0=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function n2(e,t,r){var x,b,k,j;const a=V_(),l=K_(),o=er(),u=o.defaultQueryOptions(e);(b=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||b.call(x,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",W_(u),Y_(u,l,f),X_(l);const m=!o.getQueryCache().get(u.queryHash),[h]=S.useState(()=>new t(o,u)),v=h.getOptimisticResult(u),y=!a&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(N=>{const E=y?h.subscribe(Qt.batchCalls(N)):xn;return h.updateResult(),E},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),S.useEffect(()=>{h.setOptions(u)},[u,h]),t2(u,v))throw m0(u,h,l);if(J_({result:v,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw v.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,v),u.experimental_prefetchInRender&&!Xo.isServer()&&e2(v,a)){const N=m?m0(u,h,l):f==null?void 0:f.promise;N==null||N.catch(xn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?v:h.trackResult(v)}function qe(e,t){return n2(e,L_)}function vt(e,t){const r=er(),[a]=S.useState(()=>new F_(r,e));S.useEffect(()=>{a.setOptions(e)},[a,e]);const l=S.useSyncExternalStore(S.useCallback(u=>a.subscribe(Qt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=S.useCallback((u,f)=>{a.mutate(u,f).catch(xn)},[a]);if(l.error&&Wp(a.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 p0="popstate";function g0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function r2(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return yp("",{pathname:u,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,l){return typeof l=="string"?l:Jo(l)}return a2(t,r,null,e)}function Nt(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 i2(){return Math.random().toString(36).substring(2,10)}function y0(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 yp(e,t,r=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ds(t):t,state:r,key:t&&t.key||a||i2(),unstable_mask:l}}function Jo({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ds(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function a2(e,t,r,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=v();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function v(){return(u.state||{idx:null}).idx}function y(){f="POP";let N=v(),E=N==null?null:N-h;h=N,m&&m({action:f,location:j.location,delta:E})}function x(N,E){f="PUSH";let R=g0(N)?N:yp(j.location,N,E);h=v()+1;let A=y0(R,h),I=j.createHref(R.unstable_mask||R);try{u.pushState(A,"",I)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;l.location.assign(I)}o&&m&&m({action:f,location:j.location,delta:1})}function b(N,E){f="REPLACE";let R=g0(N)?N:yp(j.location,N,E);h=v();let A=y0(R,h),I=j.createHref(R.unstable_mask||R);u.replaceState(A,"",I),o&&m&&m({action:f,location:j.location,delta:0})}function k(N){return l2(N)}let j={get action(){return f},get location(){return e(l,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(p0,y),m=N,()=>{l.removeEventListener(p0,y),m=null}},createHref(N){return t(l,N)},createURL:k,encodeLocation(N){let E=k(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:b,go(N){return u.go(N)}};return j}function l2(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Nt(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Jo(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function ZS(e,t,r="/"){return s2(e,t,r,!1)}function s2(e,t,r,a){let l=typeof t=="string"?Ds(t):t,o=ki(l.pathname||"/",r);if(o==null)return null;let u=VS(e);o2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=x2(o);f=y2(u[m],h,a)}return f}function VS(e,t=[],r=[],a="",l=!1){let o=(u,f,m=l,h)=>{let v={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(a)&&m)return;Nt(v.relativePath.startsWith(a),`Absolute route path "${v.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(a.length)}let y=Fr([a,v.relativePath]),x=r.concat(v);u.children&&u.children.length>0&&(Nt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),VS(u.children,t,x,y,m)),!(u.path==null&&!u.index)&&t.push({path:y,score:p2(y,u.index),routesMeta:x})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of QS(u.path))o(u,f,!0,h)}),t}function QS(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,l=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let u=QS(a.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 o2(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:g2(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var u2=/^:[\w-]+$/,c2=3,d2=2,f2=1,h2=10,m2=-2,v0=e=>e==="*";function p2(e,t){let r=e.split("/"),a=r.length;return r.some(v0)&&(a+=m2),t&&(a+=d2),r.filter(l=>!v0(l)).reduce((l,o)=>l+(u2.test(o)?c2:o===""?f2:h2),a)}function g2(e,t){return e.length===t.length&&e.slice(0,-1).every((a,l)=>a===t[l])?e[e.length-1]-t[t.length-1]:0}function y2(e,t,r=!1){let{routesMeta:a}=e,l={},o="/",u=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,v=o==="/"?t:t.slice(o.length)||"/",y=cd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},v),x=m.route;if(!y&&h&&r&&!a[a.length-1].route.index&&(y=cd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!y)return null;Object.assign(l,y.params),u.push({params:l,pathname:Fr([o,y.pathname]),pathnameBase:k2(Fr([o,y.pathnameBase])),route:x}),y.pathnameBase!=="/"&&(o=Fr([o,y.pathnameBase]))}return u}function cd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=v2(e.path,e.caseSensitive,e.end),l=t.match(r);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:v,isOptional:y},x)=>{if(v==="*"){let k=f[x]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const b=f[x];return y&&!b?h[v]=void 0:h[v]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function v2(e,t=!1,r=!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 a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,v)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let y=v.charAt(h+u.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function x2(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 ki(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var b2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function S2(e,t="/"){let{pathname:r,search:a="",hash:l=""}=typeof e=="string"?Ds(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=x0(r.substring(1),"/"):o=x0(r,t)):o=t,{pathname:o,search:j2(a),hash:E2(l)}}function x0(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function gm(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function w2(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function tg(e){let t=w2(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function jd(e,t,r,a=!1){let l;typeof e=="string"?l=Ds(e):(l={...e},Nt(!l.pathname||!l.pathname.includes("?"),gm("?","pathname","search",l)),Nt(!l.pathname||!l.pathname.includes("#"),gm("#","pathname","hash",l)),Nt(!l.search||!l.search.includes("#"),gm("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=r;else{let y=t.length-1;if(!a&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),y-=1;l.pathname=x.join("/")}f=y>=0?t[y]:"/"}let m=S2(l,f),h=u&&u!=="/"&&u.endsWith("/"),v=(o||u===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(h||v)&&(m.pathname+="/"),m}var Fr=e=>e.join("/").replace(/\/\/+/g,"/"),k2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,C2=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function N2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function _2(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var GS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function KS(e,t){let r=e;if(typeof r!="string"||!b2.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,l=!1;if(GS)try{let o=new URL(window.location.href),u=r.startsWith("//")?new URL(o.protocol+r):new URL(r),f=ki(u.pathname,t);u.origin===o.origin&&f!=null?r=f+u.search+u.hash:l=!0}catch{pr(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var YS=["POST","PUT","PATCH","DELETE"];new Set(YS);var A2=["GET",...YS];new Set(A2);var Ms=S.createContext(null);Ms.displayName="DataRouter";var Ed=S.createContext(null);Ed.displayName="DataRouterState";var T2=S.createContext(!1),XS=S.createContext({isTransitioning:!1});XS.displayName="ViewTransition";var z2=S.createContext(new Map);z2.displayName="Fetchers";var R2=S.createContext(null);R2.displayName="Await";var tr=S.createContext(null);tr.displayName="Navigation";var hu=S.createContext(null);hu.displayName="Location";var gr=S.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var ng=S.createContext(null);ng.displayName="RouteError";var JS="REACT_ROUTER_ERROR",O2="REDIRECT",D2="ROUTE_ERROR_RESPONSE";function M2(e){if(e.startsWith(`${JS}:${O2}:{`))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 L2(e){if(e.startsWith(`${JS}:${D2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new C2(t.status,t.statusText,t.data)}catch{}}function U2(e,{relative:t}={}){Nt(Ls(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=S.useContext(tr),{hash:l,pathname:o,search:u}=mu(e,{relative:t}),f=o;return r!=="/"&&(f=o==="/"?r:Fr([r,o])),a.createHref({pathname:f,search:u,hash:l})}function Ls(){return S.useContext(hu)!=null}function yr(){return Nt(Ls(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(hu).location}var WS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ew(e){S.useContext(tr).static||S.useLayoutEffect(e)}function Vr(){let{isDataRoute:e}=S.useContext(gr);return e?W2():I2()}function I2(){Nt(Ls(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Ms),{basename:t,navigator:r}=S.useContext(tr),{matches:a}=S.useContext(gr),{pathname:l}=yr(),o=JSON.stringify(tg(a)),u=S.useRef(!1);return ew(()=>{u.current=!0}),S.useCallback((m,h={})=>{if(pr(u.current,WS),!u.current)return;if(typeof m=="number"){r.go(m);return}let v=jd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Fr([t,v.pathname])),(h.replace?r.replace:r.push)(v,h.state,h)},[t,r,o,l,e])}var P2=S.createContext(null);function B2(e){let t=S.useContext(gr).outlet;return S.useMemo(()=>t&&S.createElement(P2.Provider,{value:e},t),[t,e])}function $2(){let{matches:e}=S.useContext(gr),t=e[e.length-1];return t?t.params:{}}function mu(e,{relative:t}={}){let{matches:r}=S.useContext(gr),{pathname:a}=yr(),l=JSON.stringify(tg(r));return S.useMemo(()=>jd(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function F2(e,t){return tw(e,t)}function tw(e,t,r){var N;Nt(Ls(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=S.useContext(tr),{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 E=h&&h.path||"";rw(f,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let v=yr(),y;if(t){let E=typeof t=="string"?Ds(t):t;Nt(m==="/"||((N=E.pathname)==null?void 0:N.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 "${E.pathname}" was given in the \`location\` prop.`),y=E}else y=v;let x=y.pathname||"/",b=x;if(m!=="/"){let E=m.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=ZS(e,{pathname:b});pr(h||k!=null,`No routes matched location "${y.pathname}${y.search}${y.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 "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=Q2(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:Fr([m,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Fr([m,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,r);return t&&j?S.createElement(hu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},j):j}function q2(){let e=J2(),t=N2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},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),r?S.createElement("pre",{style:l},r):null,u)}var H2=S.createElement(q2,null),nw=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 r=L2(e.digest);r&&(e=r)}let t=e!==void 0?S.createElement(gr.Provider,{value:this.props.routeContext},S.createElement(ng.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(Z2,{error:e},t):t}};nw.contextType=T2;var ym=new WeakMap;function Z2({children:e,error:t}){let{basename:r}=S.useContext(tr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=M2(t.digest);if(a){let l=ym.get(t);if(l)throw l;let o=KS(a.location,r);if(GS&&!ym.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw ym.set(t,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function V2({routeContext:e,match:t,children:r}){let a=S.useContext(Ms);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(gr.Provider,{value:e},r)}function Q2(e,t=[],r){let a=r==null?void 0:r.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let v=l.findIndex(y=>y.route.id&&(o==null?void 0:o[y.route.id])!==void 0);Nt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,v+1))}let u=!1,f=-1;if(r&&a){u=a.renderFallback;for(let v=0;v<l.length;v++){let y=l[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=v),y.route.id){let{loaderData:x,errors:b}=a,k=y.route.loader&&!x.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||k){r.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=r==null?void 0:r.onError,h=a&&m?(v,y)=>{var x,b;m(v,{location:a.location,params:((b=(x=a.matches)==null?void 0:x[0])==null?void 0:b.params)??{},unstable_pattern:_2(a.matches),errorInfo:y})}:void 0;return l.reduceRight((v,y,x)=>{let b,k=!1,j=null,N=null;a&&(b=o&&y.route.id?o[y.route.id]:void 0,j=y.route.errorElement||H2,u&&(f<0&&x===0?(rw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):f===x&&(k=!0,N=y.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,x+1)),R=()=>{let A;return b?A=j:k?A=N:y.route.Component?A=S.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=v,S.createElement(V2,{match:y,routeContext:{outlet:v,matches:E,isDataRoute:a!=null},children:A})};return a&&(y.route.ErrorBoundary||y.route.errorElement||x===0)?S.createElement(nw,{location:a.location,revalidation:a.revalidation,component:j,error:b,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):R()},null)}function rg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function G2(e){let t=S.useContext(Ms);return Nt(t,rg(e)),t}function K2(e){let t=S.useContext(Ed);return Nt(t,rg(e)),t}function Y2(e){let t=S.useContext(gr);return Nt(t,rg(e)),t}function ig(e){let t=Y2(e),r=t.matches[t.matches.length-1];return Nt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function X2(){return ig("useRouteId")}function J2(){var a;let e=S.useContext(ng),t=K2("useRouteError"),r=ig("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function W2(){let{router:e}=G2("useNavigate"),t=ig("useNavigate"),r=S.useRef(!1);return ew(()=>{r.current=!0}),S.useCallback(async(l,o={})=>{pr(r.current,WS),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var b0={};function rw(e,t,r){!t&&!b0[e]&&(b0[e]=!0,pr(!1,r))}S.memo(eA);function eA({routes:e,future:t,state:r,isStatic:a,onError:l}){return tw(e,void 0,{state:r,isStatic:a,onError:l})}function ag({to:e,replace:t,state:r,relative:a}){Nt(Ls(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=S.useContext(tr);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=Vr(),m=jd(e,tg(o),u,a==="path"),h=JSON.stringify(m);return S.useEffect(()=>{f(JSON.parse(h),{replace:t,state:r,relative:a})},[f,h,a,t,r]),null}function vp(e){return B2(e.context)}function Mr(e){Nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tA({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Nt(!Ls(),"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 r=="string"&&(r=Ds(r));let{pathname:h="/",search:v="",hash:y="",state:x=null,key:b="default",unstable_mask:k}=r,j=S.useMemo(()=>{let N=ki(h,f);return N==null?null:{location:{pathname:N,search:v,hash:y,state:x,key:b,unstable_mask:k},navigationType:a}},[f,h,v,y,x,b,a,k]);return pr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(tr.Provider,{value:m},S.createElement(hu.Provider,{children:t,value:j}))}function nA({children:e,location:t}){return F2(xp(e),t)}function xp(e,t=[]){let r=[];return S.Children.forEach(e,(a,l)=>{if(!S.isValidElement(a))return;let o=[...t,l];if(a.type===S.Fragment){r.push.apply(r,xp(a.props.children,o));return}Nt(a.type===Mr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(u.children=xp(a.props.children,o)),r.push(u)}),r}var td="get",nd="application/x-www-form-urlencoded";function Cd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function rA(e){return Cd(e)&&e.tagName.toLowerCase()==="button"}function iA(e){return Cd(e)&&e.tagName.toLowerCase()==="form"}function aA(e){return Cd(e)&&e.tagName.toLowerCase()==="input"}function lA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sA(e,t){return e.button===0&&(!t||t==="_self")&&!lA(e)}function bp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(l=>[r,l]):[[r,a]])},[]))}function oA(e,t){let r=bp(e);return t&&t.forEach((a,l)=>{r.has(l)||t.getAll(l).forEach(o=>{r.append(l,o)})}),r}var Uc=null;function uA(){if(Uc===null)try{new FormData(document.createElement("form"),0),Uc=!1}catch{Uc=!0}return Uc}var cA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vm(e){return e!=null&&!cA.has(e)?(pr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nd}"`),null):e}function dA(e,t){let r,a,l,o,u;if(iA(e)){let f=e.getAttribute("action");a=f?ki(f,t):null,r=e.getAttribute("method")||td,l=vm(e.getAttribute("enctype"))||nd,o=new FormData(e)}else if(rA(e)||aA(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(a=m?ki(m,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||td,l=vm(e.getAttribute("formenctype"))||vm(f.getAttribute("enctype"))||nd,o=new FormData(f,e),!uA()){let{name:h,type:v,value:y}=e;if(v==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,y)}}else{if(Cd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=td,a=null,l=nd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:r.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fA(e,t,r,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&ki(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function hA(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function mA(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 pA(e,t,r){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await hA(o,r);return u.links?u.links():[]}return[]}));return xA(a.flat(1).filter(mA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function S0(e,t,r,a,l,o){let u=(m,h)=>r[h]?m.route.id!==r[h].route.id:!0,f=(m,h)=>{var v;return r[h].pathname!==m.pathname||((v=r[h].route.path)==null?void 0:v.endsWith("*"))&&r[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var y;let v=a.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((y=r[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function gA(e,t,{includeHydrateFallback:r}={}){return yA(e.map(a=>{let l=t.routes[a.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function yA(e){return[...new Set(e)]}function vA(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function xA(e,t){let r=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(vA(l));return r.has(o)||(r.add(o),a.push({key:o,link:l})),a},[])}function iw(){let e=S.useContext(Ms);return lg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function bA(){let e=S.useContext(Ed);return lg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var sg=S.createContext(void 0);sg.displayName="FrameworkContext";function aw(){let e=S.useContext(sg);return lg(e,"You must render this element inside a <HydratedRouter> element"),e}function SA(e,t){let r=S.useContext(sg),[a,l]=S.useState(!1),[o,u]=S.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:v,onTouchStart:y}=t,x=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=E=>{E.forEach(R=>{u(R.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[e]),S.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let b=()=>{l(!0)},k=()=>{l(!1),u(!1)};return r?e!=="intent"?[o,x,{}]:[o,x,{onFocus:Mo(f,b),onBlur:Mo(m,k),onMouseEnter:Mo(h,b),onMouseLeave:Mo(v,k),onTouchStart:Mo(y,b)}]:[!1,x,{}]}function Mo(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function wA({page:e,...t}){let{router:r}=iw(),a=S.useMemo(()=>ZS(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?S.createElement(jA,{page:e,matches:a,...t}):null}function kA(e){let{manifest:t,routeModules:r}=aw(),[a,l]=S.useState([]);return S.useEffect(()=>{let o=!1;return pA(e,t,r).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,r]),a}function jA({page:e,matches:t,...r}){let a=yr(),{future:l,manifest:o,routeModules:u}=aw(),{basename:f}=iw(),{loaderData:m,matches:h}=bA(),v=S.useMemo(()=>S0(e,t,h,o,a,"data"),[e,t,h,o,a]),y=S.useMemo(()=>S0(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,N=!1;if(t.forEach(R=>{var I;let A=o.routes[R.route.id];!A||!A.hasLoader||(!v.some(F=>F.route.id===R.route.id)&&R.route.id in m&&((I=u[R.route.id])!=null&&I.shouldRevalidate)||A.hasClientLoader?N=!0:j.add(R.route.id))}),j.size===0)return[];let E=fA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return N&&j.size>0&&E.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,v,t,e,u]),b=S.useMemo(()=>gA(y,o),[y,o]),k=kA(y);return S.createElement(S.Fragment,null,x.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...r})),b.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...r})),k.map(({key:j,link:N})=>S.createElement("link",{key:j,nonce:r.nonce,...N,crossOrigin:N.crossOrigin??r.crossOrigin})))}function EA(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var CA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{CA&&(window.__reactRouterVersion="7.13.1")}catch{}function NA({basename:e,children:t,unstable_useTransitions:r,window:a}){let l=S.useRef();l.current==null&&(l.current=r2({window:a,v5Compat:!0}));let o=l.current,[u,f]=S.useState({action:o.action,location:o.location}),m=S.useCallback(h=>{r===!1?f(h):S.startTransition(()=>f(h))},[r]);return S.useLayoutEffect(()=>o.listen(m),[o,m]),S.createElement(tA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:r})}var lw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sw=S.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:v,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:b,...k},j){let{basename:N,navigator:E,unstable_useTransitions:R}=S.useContext(tr),A=typeof v=="string"&&lw.test(v),I=KS(v,N);v=I.to;let F=U2(v,{relative:l}),O=yr(),$=null;if(f){let ee=jd(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);N!=="/"&&(ee.pathname=ee.pathname==="/"?N:Fr([N,ee.pathname])),$=E.createHref(ee)}let[V,J,q]=SA(a,k),re=TA(v,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:y,relative:l,viewTransition:x,unstable_defaultShouldRevalidate:b,unstable_useTransitions:R});function ae(ee){t&&t(ee),ee.defaultPrevented||re(ee)}let me=!(I.isExternal||o),ce=S.createElement("a",{...k,...q,href:(me?$:void 0)||I.absoluteURL||F,onClick:me?ae:t,ref:EA(j,J),target:h,"data-discover":!A&&r==="render"?"true":void 0});return V&&!A?S.createElement(S.Fragment,null,ce,S.createElement(wA,{page:F})):ce});sw.displayName="Link";var ow=S.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},v){let y=mu(u,{relative:h.relative}),x=yr(),b=S.useContext(Ed),{navigator:k,basename:j}=S.useContext(tr),N=b!=null&&MA(y)&&f===!0,E=k.encodeLocation?k.encodeLocation(y).pathname:y.pathname,R=x.pathname,A=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(R=R.toLowerCase(),A=A?A.toLowerCase():null,E=E.toLowerCase()),A&&j&&(A=ki(A,j)||A);const I=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let F=R===E||!l&&R.startsWith(E)&&R.charAt(I)==="/",O=A!=null&&(A===E||!l&&A.startsWith(E)&&A.charAt(E.length)==="/"),$={isActive:F,isPending:O,isTransitioning:N},V=F?t:void 0,J;typeof a=="function"?J=a($):J=[a,F?"active":null,O?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o($):o;return S.createElement(sw,{...h,"aria-current":V,className:J,ref:v,style:q,to:u,viewTransition:f},typeof m=="function"?m($):m)});ow.displayName="NavLink";var _A=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:l,state:o,method:u=td,action:f,onSubmit:m,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:x,...b},k)=>{let{unstable_useTransitions:j}=S.useContext(tr),N=OA(),E=DA(f,{relative:h}),R=u.toLowerCase()==="get"?"get":"post",A=typeof f=="string"&&lw.test(f),I=F=>{if(m&&m(F),F.defaultPrevented)return;F.preventDefault();let O=F.nativeEvent.submitter,$=(O==null?void 0:O.getAttribute("formmethod"))||u,V=()=>N(O||F.currentTarget,{fetcherKey:t,method:$,navigate:r,replace:l,state:o,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:x});j&&r!==!1?S.startTransition(()=>V()):V()};return S.createElement("form",{ref:k,method:R,action:E,onSubmit:a?m:I,...b,"data-discover":!A&&e==="render"?"true":void 0})});_A.displayName="Form";function AA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uw(e){let t=S.useContext(Ms);return Nt(t,AA(e)),t}function TA(e,{target:t,replace:r,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let v=Vr(),y=yr(),x=mu(e,{relative:u});return S.useCallback(b=>{if(sA(b,t)){b.preventDefault();let k=r!==void 0?r:Jo(y)===Jo(x),j=()=>v(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?S.startTransition(()=>j()):j()}},[y,v,x,r,a,l,t,e,o,u,f,m,h])}function og(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(bp(e)),r=S.useRef(!1),a=yr(),l=S.useMemo(()=>oA(a.search,r.current?null:t.current),[a.search]),o=Vr(),u=S.useCallback((f,m)=>{const h=bp(typeof f=="function"?f(new URLSearchParams(l)):f);r.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var zA=0,RA=()=>`__${String(++zA)}__`;function OA(){let{router:e}=uw("useSubmit"),{basename:t}=S.useContext(tr),r=X2(),a=e.fetch,l=e.navigate;return S.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:v,body:y}=dA(o,t);if(u.navigate===!1){let x=u.fetcherKey||RA();await a(x,r,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:y,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:v,body:y,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:r,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,r])}function DA(e,{relative:t}={}){let{basename:r}=S.useContext(tr),a=S.useContext(gr);Nt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...mu(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(v=>v==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let v=f.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Fr([r,o.pathname])),Jo(o)}function MA(e,{relative:t}={}){let r=S.useContext(XS);Nt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=uw("useViewTransitionState"),l=mu(e,{relative:t});if(!r.isTransitioning)return!1;let o=ki(r.currentLocation.pathname,a)||r.currentLocation.pathname,u=ki(r.nextLocation.pathname,a)||r.nextLocation.pathname;return cd(l.pathname,u)!=null||cd(l.pathname,o)!=null}const LA="/api/v1";async function UA(e,t){const r=await fetch(`${LA}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!r.ok){const a=await r.text();let l;try{l=JSON.parse(a).error??a}catch{l=a}throw new Error(l)}return await r.json()}const cw="/api/v1",ug="first-tree-hub:tokens";function Nd(){const e=localStorage.getItem(ug);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function dw(e){localStorage.setItem(ug,JSON.stringify(e))}function fw(){localStorage.removeItem(ug)}class _d extends Error{constructor(t,r,a){super(r),this.status=t,this.issues=a,this.name="ApiError"}}let Lo=null;async function IA(e){return Lo||(Lo=(async()=>{try{const t=await fetch(`${cw}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const r=await t.json(),a={accessToken:r.accessToken,refreshToken:r.refreshToken??e};return dw(a),a}catch{return null}finally{Lo=null}})(),Lo)}async function Ic(e,t){const{method:r="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${cw}${e}`,{method:r,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=Nd();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await IA(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(fw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const v=JSON.parse(f);m=v.error??f,Array.isArray(v.details)&&(h=v.details.filter(y=>typeof y=="object"&&y!==null&&Array.isArray(y.path)))}catch{m=f}throw new _d(u.status,m,h)}if(u.status!==204)return await u.json()}const Me={get:e=>Ic(e),post:(e,t)=>Ic(e,{method:"POST",body:t}),patch:(e,t)=>Ic(e,{method:"PATCH",body:t}),delete:e=>Ic(e,{method:"DELETE"})},hw=S.createContext(null);function PA({children:e}){const[t,r]=S.useState(()=>!!Nd()),[a,l]=S.useState(null),[o,u]=S.useState(null),[f,m]=S.useState(null),h=S.useCallback(()=>{fw(),r(!1),l(null),u(null),m(null)},[]),v=S.useCallback(async()=>{try{const x=await Me.get("/me");l(x.member.role),u(x.member.id),m(x.member.agentId)}catch{}},[]),y=S.useCallback(async(x,b)=>{const k=await UA(x,b);dw({accessToken:k.accessToken,refreshToken:k.refreshToken}),r(!0),await Me.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return S.useEffect(()=>{t&&!a&&v()},[t,a,v]),S.useEffect(()=>{const x=()=>h();return window.addEventListener("auth:logout",x),()=>window.removeEventListener("auth:logout",x)},[h]),d.jsx(hw.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,login:y,logout:h},children:e})}function ba(){const e=S.useContext(hw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function BA(){const{isAuthenticated:e}=ba();return e?d.jsx(vp,{}):d.jsx(ag,{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 mw=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).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 $A=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 FA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.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 w0=e=>{const t=FA(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 qA={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 HA=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 ZA=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>S.createElement("svg",{ref:m,...qA,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:mw("lucide",l),...!o&&!HA(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,v])=>S.createElement(h,v)),...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 ut=(e,t)=>{const r=S.forwardRef(({className:a,...l},o)=>S.createElement(ZA,{ref:o,iconNode:t,className:mw(`lucide-${$A(w0(e))}`,`lucide-${e}`,a),...l}));return r.displayName=w0(e),r};/**
|
|
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 VA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],QA=ut("arrow-left",VA);/**
|
|
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 GA=[["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"}]],KA=ut("bell",GA);/**
|
|
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 YA=[["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"}]],XA=ut("bot",YA);/**
|
|
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 JA=[["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"}]],WA=ut("cable",JA);/**
|
|
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 eT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cg=ut("check",eT);/**
|
|
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 tT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nT=ut("chevron-down",tT);/**
|
|
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 rT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],iT=ut("chevron-right",rT);/**
|
|
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 aT=[["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"}]],dg=ut("copy",aT);/**
|
|
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 lT=[["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"}]],pw=ut("ellipsis",lT);/**
|
|
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 sT=[["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"}]],oT=ut("layout-dashboard",sT);/**
|
|
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 uT=[["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"}]],k0=ut("link-2",uT);/**
|
|
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 cT=[["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"}]],dT=ut("lock",cT);/**
|
|
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 fT=[["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"}]],hT=ut("log-out",fT);/**
|
|
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 mT=[["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"}]],gw=ut("message-square",mT);/**
|
|
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 pT=[["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"}]],gT=ut("moon",pT);/**
|
|
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 yT=[["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"}]],vT=ut("paperclip",yT);/**
|
|
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 xT=[["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"}]],bT=ut("pause",xT);/**
|
|
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 ST=[["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"}]],Ad=ut("pencil",ST);/**
|
|
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 wT=[["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"}]],kT=ut("play",wT);/**
|
|
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 jT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fl=ut("plus",jT);/**
|
|
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 ET=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fg=ut("search",ET);/**
|
|
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 CT=[["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"}]],NT=ut("send",CT);/**
|
|
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 _T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],AT=ut("square",_T);/**
|
|
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 TT=[["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"}]],zT=ut("sun",TT);/**
|
|
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 RT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],j0=ut("terminal",RT);/**
|
|
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 OT=[["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"}]],Wo=ut("trash-2",OT);/**
|
|
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 DT=[["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"}]],MT=ut("triangle-alert",DT);/**
|
|
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 LT=[["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"}]],UT=ut("undo-2",LT);/**
|
|
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 IT=[["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"}]],PT=ut("unplug",IT);/**
|
|
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 BT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sp=ut("x",BT);function yw(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=yw(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function vw(){for(var e,t,r=0,a="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=yw(e))&&(a&&(a+=" "),a+=t);return a}const $T=(e,t)=>{const r=new Array(e.length+t.length);for(let a=0;a<e.length;a++)r[a]=e[a];for(let a=0;a<t.length;a++)r[e.length+a]=t[a];return r},FT=(e,t)=>({classGroupId:e,validator:t}),xw=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),dd="-",E0=[],qT="arbitrary..",HT=e=>{const t=VT(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return ZT(u);const f=u.split(dd),m=f[0]===""&&f.length>1?1:0;return bw(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=r[u];return m?h?$T(h,m):m:h||E0}return r[u]||E0}}},bw=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const l=e[t],o=r.nextPart.get(l);if(o){const h=bw(e,t+1,o);if(h)return h}const u=r.validators;if(u===null)return;const f=t===0?e.join(dd):e.slice(t).join(dd),m=u.length;for(let h=0;h<m;h++){const v=u[h];if(v.validator(f))return v.classGroupId}},ZT=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),a=t.slice(0,r);return a?qT+a:void 0})(),VT=e=>{const{theme:t,classGroups:r}=e;return QT(r,t)},QT=(e,t)=>{const r=xw();for(const a in e){const l=e[a];hg(l,r,a,t)}return r},hg=(e,t,r,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];GT(u,t,r,a)}},GT=(e,t,r,a)=>{if(typeof e=="string"){KT(e,t,r);return}if(typeof e=="function"){YT(e,t,r,a);return}XT(e,t,r,a)},KT=(e,t,r)=>{const a=e===""?t:Sw(t,e);a.classGroupId=r},YT=(e,t,r,a)=>{if(JT(e)){hg(e(a),t,r,a);return}t.validators===null&&(t.validators=[]),t.validators.push(FT(r,e))},XT=(e,t,r,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];hg(m,Sw(t,f),r,a)}},Sw=(e,t)=>{let r=e;const a=t.split(dd),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=r.nextPart.get(u);f||(f=xw(),r.nextPart.set(u,f)),r=f}return r},JT=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,WT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),a=Object.create(null);const l=(o,u)=>{r[o]=u,t++,t>e&&(t=0,a=r,r=Object.create(null))};return{get(o){let u=r[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in r?r[o]=u:l(o,u)}}},wp="!",C0=":",ez=[],N0=(e,t,r,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:a,isExternal:l}),tz=e=>{const{prefix:t,experimentalParseClassName:r}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const v=l.length;for(let j=0;j<v;j++){const N=l[j];if(u===0&&f===0){if(N===C0){o.push(l.slice(m,j)),m=j+1;continue}if(N==="/"){h=j;continue}}N==="["?u++:N==="]"?u--:N==="("?f++:N===")"&&f--}const y=o.length===0?l:l.slice(m);let x=y,b=!1;y.endsWith(wp)?(x=y.slice(0,-1),b=!0):y.startsWith(wp)&&(x=y.slice(1),b=!0);const k=h&&h>m?h-m:void 0;return N0(o,b,x,k)};if(t){const l=t+C0,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):N0(ez,!1,u,void 0,!0)}if(r){const l=a;a=o=>r({className:o,parseClassName:l})}return a},nz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,a)=>{t.set(r,1e6+a)}),r=>{const a=[];let l=[];for(let o=0;o<r.length;o++){const u=r[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},rz=e=>({cache:WT(e.cacheSize),parseClassName:tz(e),sortModifiers:nz(e),...HT(e)}),iz=/\s+/,az=(e,t)=>{const{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(iz);let m="";for(let h=f.length-1;h>=0;h-=1){const v=f[h],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:j}=r(v);if(y){m=v+(m.length>0?" "+m:m);continue}let N=!!j,E=a(N?k.substring(0,j):k);if(!E){if(!N){m=v+(m.length>0?" "+m:m);continue}if(E=a(k),!E){m=v+(m.length>0?" "+m:m);continue}N=!1}const R=x.length===0?"":x.length===1?x[0]:o(x).join(":"),A=b?R+wp:R,I=A+E;if(u.indexOf(I)>-1)continue;u.push(I);const F=l(E,N);for(let O=0;O<F.length;++O){const $=F[O];u.push(A+$)}m=v+(m.length>0?" "+m:m)}return m},lz=(...e)=>{let t=0,r,a,l="";for(;t<e.length;)(r=e[t++])&&(a=ww(r))&&(l&&(l+=" "),l+=a);return l},ww=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=ww(e[a]))&&(r&&(r+=" "),r+=t);return r},sz=(e,...t)=>{let r,a,l,o;const u=m=>{const h=t.reduce((v,y)=>y(v),e());return r=rz(h),a=r.cache.get,l=r.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const v=az(m,r);return l(m,v),v};return o=u,(...m)=>o(lz(...m))},oz=[],Vt=e=>{const t=r=>r[e]||oz;return t.isThemeGetter=!0,t},kw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dz=/\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$/,fz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wi=e=>uz.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ea=e=>!!e&&Number.isInteger(Number(e)),xm=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),mi=e=>cz.test(e),Ew=()=>!0,pz=e=>dz.test(e)&&!fz.test(e),mg=()=>!1,gz=e=>hz.test(e),yz=e=>mz.test(e),vz=e=>!we(e)&&!ke(e),xz=e=>Sa(e,_w,mg),we=e=>kw.test(e),Qa=e=>Sa(e,Aw,pz),_0=e=>Sa(e,Nz,Fe),bz=e=>Sa(e,zw,Ew),Sz=e=>Sa(e,Tw,mg),A0=e=>Sa(e,Cw,mg),wz=e=>Sa(e,Nw,yz),Pc=e=>Sa(e,Rw,gz),ke=e=>jw.test(e),Uo=e=>hl(e,Aw),kz=e=>hl(e,Tw),T0=e=>hl(e,Cw),jz=e=>hl(e,_w),Ez=e=>hl(e,Nw),Bc=e=>hl(e,Rw,!0),Cz=e=>hl(e,zw,!0),Sa=(e,t,r)=>{const a=kw.exec(e);return a?a[1]?t(a[1]):r(a[2]):!1},hl=(e,t,r=!1)=>{const a=jw.exec(e);return a?a[1]?t(a[1]):r:!1},Cw=e=>e==="position"||e==="percentage",Nw=e=>e==="image"||e==="url",_w=e=>e==="length"||e==="size"||e==="bg-size",Aw=e=>e==="length",Nz=e=>e==="number",Tw=e=>e==="family-name",zw=e=>e==="number"||e==="weight",Rw=e=>e==="shadow",_z=()=>{const e=Vt("color"),t=Vt("font"),r=Vt("text"),a=Vt("font-weight"),l=Vt("tracking"),o=Vt("leading"),u=Vt("breakpoint"),f=Vt("container"),m=Vt("spacing"),h=Vt("radius"),v=Vt("shadow"),y=Vt("inset-shadow"),x=Vt("text-shadow"),b=Vt("drop-shadow"),k=Vt("blur"),j=Vt("perspective"),N=Vt("aspect"),E=Vt("ease"),R=Vt("animate"),A=()=>["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"],F=()=>[...I(),ke,we],O=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],V=()=>[ke,we,m],J=()=>[Wi,"full","auto",...V()],q=()=>[ea,"none","subgrid",ke,we],re=()=>["auto",{span:["full",ea,ke,we]},ea,ke,we],ae=()=>[ea,"auto",ke,we],me=()=>["auto","min","max","fr",ke,we],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...V()],W=()=>[Wi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],pe=()=>[Wi,"screen","full","dvw","lvw","svw","min","max","fit",...V()],Ce=()=>[Wi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],z=()=>[e,ke,we],U=()=>[...I(),T0,A0,{position:[ke,we]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",jz,xz,{size:[ke,we]}],X=()=>[xm,Uo,Qa],H=()=>["","none","full",h,ke,we],oe=()=>["",Fe,Uo,Qa],ye=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[Fe,xm,T0,A0],jt=()=>["","none",k,ke,we],Wt=()=>["none",Fe,ke,we],wn=()=>["none",Fe,ke,we],xr=()=>[Fe,ke,we],en=()=>[Wi,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mi],breakpoint:[mi],color:[Ew],container:[mi],"drop-shadow":[mi],ease:["in","out","in-out"],font:[vz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mi],shadow:[mi],spacing:["px",Fe],text:[mi],"text-shadow":[mi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wi,we,ke,N]}],container:["container"],columns:[{columns:[Fe,we,ke,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:F()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{"inset-s":J(),start:J()}],end:[{"inset-e":J(),end:J()}],"inset-bs":[{"inset-bs":J()}],"inset-be":[{"inset-be":J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[ea,"auto",ke,we]}],basis:[{basis:[Wi,"full","auto",f,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Wi,"auto","initial","none",we]}],grow:[{grow:["",Fe,ke,we]}],shrink:[{shrink:["",Fe,ke,we]}],order:[{order:[ea,"first","last","none",ke,we]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],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":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...Ce()]}],"min-block-size":[{"min-block":["auto",...Ce()]}],"max-block-size":[{"max-block":["none",...Ce()]}],w:[{w:[f,"screen",...W()]}],"min-w":[{"min-w":[f,"screen","none",...W()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,Uo,Qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Cz,bz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xm,we]}],"font-family":[{font:[kz,Sz,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,_0]}],leading:[{leading:[o,...V()]}],"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:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ke,Qa]}],"text-decoration-color":[{decoration:z()}],"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:V()}],"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:U()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ea,ke,we],radial:["",ke,we],conic:[ea,ke,we]},Ez,wz]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ke,we]}],"outline-w":[{outline:["",Fe,Uo,Qa]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",v,Bc,Pc]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",y,Bc,Pc]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Fe,Qa]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",x,Bc,Pc]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Fe,ke,we]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[ke,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,we]}],filter:[{filter:["","none",ke,we]}],blur:[{blur:jt()}],brightness:[{brightness:[Fe,ke,we]}],contrast:[{contrast:[Fe,ke,we]}],"drop-shadow":[{"drop-shadow":["","none",b,Bc,Pc]}],"drop-shadow-color":[{"drop-shadow":z()}],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":jt()}],"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":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"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",E,ke,we]}],delay:[{delay:[Fe,ke,we]}],animate:[{animate:["none",R,ke,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,ke,we]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:Wt()}],"rotate-x":[{"rotate-x":Wt()}],"rotate-y":[{"rotate-y":Wt()}],"rotate-z":[{"rotate-z":Wt()}],scale:[{scale:wn()}],"scale-x":[{"scale-x":wn()}],"scale-y":[{"scale-y":wn()}],"scale-z":[{"scale-z":wn()}],"scale-3d":["scale-3d"],skew:[{skew:xr()}],"skew-x":[{"skew-x":xr()}],"skew-y":[{"skew-y":xr()}],transform:[{transform:[ke,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,we]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Fe,Uo,Qa,_0]}],stroke:[{stroke:["none",...z()]}],"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"]}},Az=sz(_z);function Re(...e){return Az(vw(e))}function Cr(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 Tz(e){return Me.delete(`/clients/${encodeURIComponent(e)}`)}function Td(){return Me.get("/admin/agents/activity")}function zd(){return Me.get("/clients")}function zz(e){return Me.post(`/clients/${e}/disconnect`)}function Ow(){return Me.post("/connect-tokens")}const Dw=(e,t)=>["session",e,t],kp=e=>["agent-sessions",e];function Rz(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 Oz(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 Dz(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Us(e,t){const r=new URLSearchParams;t!=null&&t.state&&r.set("state",t.state),t!=null&&t.runtimeState&&r.set("runtimeState",t.runtimeState);const a=r.toString();return Me.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function Mz(e,t,r){const a=new URLSearchParams;a.set("limit",String(r.limit)),(r==null?void 0:r.cursor)!==void 0&&a.set("cursor",String(r.cursor)),r!=null&&r.direction&&a.set("direction",r.direction);const l=a.toString();return Me.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function Lz(e,t){return Me.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function Uz(e,t){return Me.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var z0=1,Iz=.9,Pz=.8,Bz=.17,bm=.1,Sm=.999,$z=.9999,Fz=.99,qz=/[\\\/_+.#"@\[\(\{&]/,Hz=/[\\\/_+.#"@\[\(\{&]/g,Zz=/[\s-]/,Mw=/[\s-]/g;function jp(e,t,r,a,l,o,u){if(o===t.length)return l===e.length?z0:Fz;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=r.indexOf(m,l),v=0,y,x,b,k;h>=0;)y=jp(e,t,r,a,h+1,o+1,u),y>v&&(h===l?y*=z0:qz.test(e.charAt(h-1))?(y*=Pz,b=e.slice(l,h-1).match(Hz),b&&l>0&&(y*=Math.pow(Sm,b.length))):Zz.test(e.charAt(h-1))?(y*=Iz,k=e.slice(l,h-1).match(Mw),k&&l>0&&(y*=Math.pow(Sm,k.length))):(y*=Bz,l>0&&(y*=Math.pow(Sm,h-l))),e.charAt(h)!==t.charAt(o)&&(y*=$z)),(y<bm&&r.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&r.charAt(h-1)!==a.charAt(o))&&(x=jp(e,t,r,a,h+1,o+2,u),x*bm>y&&(y=x*bm)),y>v&&(v=y),h=r.indexOf(m,h+1);return u[f]=v,v}function R0(e){return e.toLowerCase().replace(Mw," ")}function Vz(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,jp(e,t,R0(e),R0(t),0,0,{})}function pa(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e==null||e(l),r===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function O0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ga(...e){return t=>{let r=!1;const a=e.map(l=>{const o=O0(l,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let l=0;l<a.length;l++){const o=a[l];typeof o=="function"?o():O0(e[l],null)}}}}function ml(...e){return S.useCallback(ga(...e),e)}function Qz(e,t){const r=S.createContext(t),a=o=>{const{children:u,...f}=o,m=S.useMemo(()=>f,Object.values(f));return d.jsx(r.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=S.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function Gz(e,t=[]){let r=[];function a(o,u){const f=S.createContext(u),m=r.length;r=[...r,u];const h=y=>{var E;const{scope:x,children:b,...k}=y,j=((E=x==null?void 0:x[e])==null?void 0:E[m])||f,N=S.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:N,children:b})};h.displayName=o+"Provider";function v(y,x){var j;const b=((j=x==null?void 0:x[e])==null?void 0:j[m])||f,k=S.useContext(b);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${o}\``)}return[h,v]}const l=()=>{const o=r.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,[a,Kz(l,...t)]}function Kz(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const u=a.reduce((f,{useScope:m,scopeName:h})=>{const y=m(o)[`__scope${h}`];return{...f,...y}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var eu=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},Yz=Kp[" useId ".trim().toString()]||(()=>{}),Xz=0;function Si(e){const[t,r]=S.useState(Yz());return eu(()=>{r(a=>a??String(Xz++))},[e]),t?`radix-${t}`:""}var Jz=Kp[" useInsertionEffect ".trim().toString()]||eu;function Wz({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[l,o,u]=eR({defaultProp:t,onChange:r}),f=e!==void 0,m=f?e:l;{const v=S.useRef(e!==void 0);S.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"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.`),v.current=f},[f,a])}const h=S.useCallback(v=>{var y;if(f){const x=tR(v)?v(e):v;x!==e&&((y=u.current)==null||y.call(u,x))}else o(v)},[f,e,o,u]);return[m,h]}function eR({defaultProp:e,onChange:t}){const[r,a]=S.useState(e),l=S.useRef(r),o=S.useRef(t);return Jz(()=>{o.current=t},[t]),S.useEffect(()=>{var u;l.current!==r&&((u=o.current)==null||u.call(o,r),l.current=r)},[r,l]),[r,a,o]}function tR(e){return typeof e=="function"}var Lw=RS();const nR=kd(Lw);function Uw(e){const t=rR(e),r=S.forwardRef((a,l)=>{const{children:o,...u}=a,f=S.Children.toArray(o),m=f.find(aR);if(m){const h=m.props.children,v=f.map(y=>y===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:y);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,v):null})}return d.jsx(t,{...u,ref:l,children:o})});return r.displayName=`${e}.Slot`,r}function rR(e){const t=S.forwardRef((r,a)=>{const{children:l,...o}=r;if(S.isValidElement(l)){const u=sR(l),f=lR(o,l.props);return l.type!==S.Fragment&&(f.ref=a?ga(a,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iR=Symbol("radix.slottable");function aR(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iR}function lR(e,t){const r={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?r[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(r[a]=l):a==="style"?r[a]={...l,...o}:a==="className"&&(r[a]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function sR(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var oR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ji=oR.reduce((e,t)=>{const r=Uw(`Primitive.${t}`),a=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function uR(e,t){e&&Lw.flushSync(()=>e.dispatchEvent(t))}function tu(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])}function cR(e,t=globalThis==null?void 0:globalThis.document){const r=tu(e);S.useEffect(()=>{const a=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[r,t])}var dR="DismissableLayer",Ep="dismissableLayer.update",fR="dismissableLayer.pointerDownOutside",hR="dismissableLayer.focusOutside",D0,Iw=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pw=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=S.useContext(Iw),[v,y]=S.useState(null),x=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=S.useState({}),k=ml(t,$=>y($)),j=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(N),R=v?j.indexOf(v):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,I=R>=E,F=gR($=>{const V=$.target,J=[...h.branches].some(q=>q.contains(V));!I||J||(l==null||l($),u==null||u($),$.defaultPrevented||f==null||f())},x),O=yR($=>{const V=$.target;[...h.branches].some(q=>q.contains(V))||(o==null||o($),u==null||u($),$.defaultPrevented||f==null||f())},x);return cR($=>{R===h.layers.size-1&&(a==null||a($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},x),S.useEffect(()=>{if(v)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(D0=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(v)),h.layers.add(v),M0(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=D0)}},[v,x,r,h]),S.useEffect(()=>()=>{v&&(h.layers.delete(v),h.layersWithOutsidePointerEventsDisabled.delete(v),M0())},[v,h]),S.useEffect(()=>{const $=()=>b({});return document.addEventListener(Ep,$),()=>document.removeEventListener(Ep,$)},[]),d.jsx(ji.div,{...m,ref:k,style:{pointerEvents:A?I?"auto":"none":void 0,...e.style},onFocusCapture:pa(e.onFocusCapture,O.onFocusCapture),onBlurCapture:pa(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:pa(e.onPointerDownCapture,F.onPointerDownCapture)})});Pw.displayName=dR;var mR="DismissableLayerBranch",pR=S.forwardRef((e,t)=>{const r=S.useContext(Iw),a=S.useRef(null),l=ml(t,a);return S.useEffect(()=>{const o=a.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),d.jsx(ji.div,{...e,ref:l})});pR.displayName=mR;function gR(e,t=globalThis==null?void 0:globalThis.document){const r=tu(e),a=S.useRef(!1),l=S.useRef(()=>{});return S.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){Bw(fR,r,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);a.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}function yR(e,t=globalThis==null?void 0:globalThis.document){const r=tu(e),a=S.useRef(!1);return S.useEffect(()=>{const l=o=>{o.target&&!a.current&&Bw(hR,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function M0(){const e=new CustomEvent(Ep);document.dispatchEvent(e)}function Bw(e,t,r,{discrete:a}){const l=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),a?uR(l,o):l.dispatchEvent(o)}var wm="focusScope.autoFocusOnMount",km="focusScope.autoFocusOnUnmount",L0={bubbles:!1,cancelable:!0},vR="FocusScope",$w=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=S.useState(null),h=tu(l),v=tu(o),y=S.useRef(null),x=ml(t,j=>m(j)),b=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(a){let j=function(A){if(b.paused||!f)return;const I=A.target;f.contains(I)?y.current=I:ra(y.current,{select:!0})},N=function(A){if(b.paused||!f)return;const I=A.relatedTarget;I!==null&&(f.contains(I)||ra(y.current,{select:!0}))},E=function(A){if(document.activeElement===document.body)for(const F of A)F.removedNodes.length>0&&ra(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",N);const R=new MutationObserver(E);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",N),R.disconnect()}}},[a,f,b.paused]),S.useEffect(()=>{if(f){I0.add(b);const j=document.activeElement;if(!f.contains(j)){const E=new CustomEvent(wm,L0);f.addEventListener(wm,h),f.dispatchEvent(E),E.defaultPrevented||(xR(jR(Fw(f)),{select:!0}),document.activeElement===j&&ra(f))}return()=>{f.removeEventListener(wm,h),setTimeout(()=>{const E=new CustomEvent(km,L0);f.addEventListener(km,v),f.dispatchEvent(E),E.defaultPrevented||ra(j??document.body,{select:!0}),f.removeEventListener(km,v),I0.remove(b)},0)}}},[f,h,v,b]);const k=S.useCallback(j=>{if(!r&&!a||b.paused)return;const N=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(N&&E){const R=j.currentTarget,[A,I]=bR(R);A&&I?!j.shiftKey&&E===I?(j.preventDefault(),r&&ra(A,{select:!0})):j.shiftKey&&E===A&&(j.preventDefault(),r&&ra(I,{select:!0})):E===R&&j.preventDefault()}},[r,a,b.paused]);return d.jsx(ji.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})});$w.displayName=vR;function xR(e,{select:t=!1}={}){const r=document.activeElement;for(const a of e)if(ra(a,{select:t}),document.activeElement!==r)return}function bR(e){const t=Fw(e),r=U0(t,e),a=U0(t.reverse(),e);return[r,a]}function Fw(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function U0(e,t){for(const r of e)if(!SR(r,{upTo:t}))return r}function SR(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 wR(e){return e instanceof HTMLInputElement&&"select"in e}function ra(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&wR(e)&&t&&e.select()}}var I0=kR();function kR(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=P0(e,t),e.unshift(t)},remove(t){var r;e=P0(e,t),(r=e[0])==null||r.resume()}}}function P0(e,t){const r=[...e],a=r.indexOf(t);return a!==-1&&r.splice(a,1),r}function jR(e){return e.filter(t=>t.tagName!=="A")}var ER="Portal",qw=S.forwardRef((e,t)=>{var f;const{container:r,...a}=e,[l,o]=S.useState(!1);eu(()=>o(!0),[]);const u=r||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?nR.createPortal(d.jsx(ji.div,{...a,ref:t}),u):null});qw.displayName=ER;function CR(e,t){return S.useReducer((r,a)=>t[r][a]??r,e)}var Rd=e=>{const{present:t,children:r}=e,a=NR(t),l=typeof r=="function"?r({present:a.isPresent}):S.Children.only(r),o=ml(a.ref,_R(l));return typeof r=="function"||a.isPresent?S.cloneElement(l,{ref:o}):null};Rd.displayName="Presence";function NR(e){const[t,r]=S.useState(),a=S.useRef(null),l=S.useRef(e),o=S.useRef("none"),u=e?"mounted":"unmounted",[f,m]=CR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const h=$c(a.current);o.current=f==="mounted"?h:"none"},[f]),eu(()=>{const h=a.current,v=l.current;if(v!==e){const x=o.current,b=$c(h);e?m("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),eu(()=>{if(t){let h;const v=t.ownerDocument.defaultView??window,y=b=>{const j=$c(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&j&&(m("ANIMATION_END"),!l.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},x=b=>{b.target===t&&(o.current=$c(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(h=>{a.current=h?getComputedStyle(h):null,r(h)},[])}}function $c(e){return(e==null?void 0:e.animationName)||"none"}function _R(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var jm=0;function AR(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??B0()),document.body.insertAdjacentElement("beforeend",e[1]??B0()),jm++,()=>{jm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jm--}},[])}function B0(){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 r,a=1,l=arguments.length;a<l;a++){r=arguments[a];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Br.apply(this,arguments)};function Hw(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(r[a[l]]=e[a[l]]);return r}function TR(e,t,r){if(r||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var rd="right-scroll-bar-position",id="width-before-scroll-bar",zR="with-scroll-bars-hidden",RR="--removed-body-scroll-bar-size";function Em(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OR(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(a){var l=r.value;l!==a&&(r.value=a,r.callback(a,l))}}}})[0];return r.callback=t,r.facade}var DR=typeof window<"u"?S.useLayoutEffect:S.useEffect,$0=new WeakMap;function MR(e,t){var r=OR(null,function(a){return e.forEach(function(l){return Em(l,a)})});return DR(function(){var a=$0.get(r);if(a){var l=new Set(a),o=new Set(e),u=r.current;l.forEach(function(f){o.has(f)||Em(f,null)}),o.forEach(function(f){l.has(f)||Em(f,u)})}$0.set(r,e)},[e]),r}function LR(e){return e}function UR(e,t){t===void 0&&(t=LR);var r=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var u=t(o,a);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;r.length;){var u=r;r=[],u.forEach(o)}r={push:function(f){return o(f)},filter:function(){return r}}},assignMedium:function(o){a=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(o),u=r}var m=function(){var v=u;u=[],v.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),r={push:function(v){u.push(v),h()},filter:function(v){return u=u.filter(v),r}}}};return l}function IR(e){e===void 0&&(e={});var t=UR(null);return t.options=Br({async:!0,ssr:!1},e),t}var Zw=function(e){var t=e.sideCar,r=Hw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return S.createElement(a,Br({},r))};Zw.isSideCarExport=!0;function PR(e,t){return e.useMedium(t),Zw}var Vw=IR(),Cm=function(){},Od=S.forwardRef(function(e,t){var r=S.useRef(null),a=S.useState({onScrollCapture:Cm,onWheelCapture:Cm,onTouchMoveCapture:Cm}),l=a[0],o=a[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,k=e.noIsolation,j=e.inert,N=e.allowPinchZoom,E=e.as,R=E===void 0?"div":E,A=e.gapMode,I=Hw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=x,O=MR([r,t]),$=Br(Br({},I),l);return S.createElement(S.Fragment,null,v&&S.createElement(F,{sideCar:Vw,removeScrollBar:h,shards:y,noRelative:b,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!N,lockRef:r,gapMode:A}),u?S.cloneElement(S.Children.only(f),Br(Br({},$),{ref:O})):S.createElement(R,Br({},$,{className:m,ref:O}),f))});Od.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Od.classNames={fullWidth:id,zeroRight:rd};var BR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $R(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=BR();return t&&e.setAttribute("nonce",t),e}function FR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HR=function(){var e=0,t=null;return{add:function(r){e==0&&(t=$R())&&(FR(t,r),qR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZR=function(){var e=HR();return function(t,r){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Qw=function(){var e=ZR(),t=function(r){var a=r.styles,l=r.dynamic;return e(a,l),null};return t},VR={left:0,top:0,right:0,gap:0},Nm=function(e){return parseInt(e||"",10)||0},QR=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Nm(r),Nm(a),Nm(l)]},GR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return VR;var t=QR(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-r+t[2]-t[0])}},KR=Qw(),hs="data-scroll-locked",YR=function(e,t,r,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
|
|
251
|
-
.`.concat(zR,` {
|
|
252
|
-
overflow: hidden `).concat(a,`;
|
|
253
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
254
|
-
}
|
|
255
|
-
body[`).concat(hs,`] {
|
|
256
|
-
overflow: hidden `).concat(a,`;
|
|
257
|
-
overscroll-behavior: contain;
|
|
258
|
-
`).concat([t&&"position: relative ".concat(a,";"),r==="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(a,`;
|
|
265
|
-
`),r==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.`).concat(rd,` {
|
|
269
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.`).concat(id,` {
|
|
273
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.`).concat(rd," .").concat(rd,` {
|
|
277
|
-
right: 0 `).concat(a,`;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.`).concat(id," .").concat(id,` {
|
|
281
|
-
margin-right: 0 `).concat(a,`;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
body[`).concat(hs,`] {
|
|
285
|
-
`).concat(RR,": ").concat(f,`px;
|
|
286
|
-
}
|
|
287
|
-
`)},F0=function(){var e=parseInt(document.body.getAttribute(hs)||"0",10);return isFinite(e)?e:0},XR=function(){S.useEffect(function(){return document.body.setAttribute(hs,(F0()+1).toString()),function(){var e=F0()-1;e<=0?document.body.removeAttribute(hs):document.body.setAttribute(hs,e.toString())}},[])},JR=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;XR();var o=S.useMemo(function(){return GR(l)},[l]);return S.createElement(KR,{styles:YR(o,!t,l,r?"":"!important")})},Cp=!1;if(typeof window<"u")try{var Fc=Object.defineProperty({},"passive",{get:function(){return Cp=!0,!0}});window.addEventListener("test",Fc,Fc),window.removeEventListener("test",Fc,Fc)}catch{Cp=!1}var ns=Cp?{passive:!1}:!1,WR=function(e){return e.tagName==="TEXTAREA"},Gw=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!WR(e)&&r[t]==="visible")},eO=function(e){return Gw(e,"overflowY")},tO=function(e){return Gw(e,"overflowX")},q0=function(e,t){var r=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Kw(e,a);if(l){var o=Yw(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},nO=function(e){var t=e.scrollTop,r=e.scrollHeight,a=e.clientHeight;return[t,r,a]},rO=function(e){var t=e.scrollLeft,r=e.scrollWidth,a=e.clientWidth;return[t,r,a]},Kw=function(e,t){return e==="v"?eO(t):tO(t)},Yw=function(e,t){return e==="v"?nO(t):rO(t)},iO=function(e,t){return e==="h"&&t==="rtl"?-1:1},aO=function(e,t,r,a,l){var o=iO(e,window.getComputedStyle(t).direction),u=o*a,f=r.target,m=t.contains(f),h=!1,v=u>0,y=0,x=0;do{if(!f)break;var b=Yw(e,f),k=b[0],j=b[1],N=b[2],E=j-N-o*k;(k||E)&&Kw(e,f)&&(y+=E,x+=k);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(x)<1)&&(h=!0),h},qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},H0=function(e){return[e.deltaX,e.deltaY]},Z0=function(e){return e&&"current"in e?e.current:e},lO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sO=function(e){return`
|
|
288
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
289
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
290
|
-
`)},oO=0,rs=[];function uO(e){var t=S.useRef([]),r=S.useRef([0,0]),a=S.useRef(),l=S.useState(oO++)[0],o=S.useState(Qw)[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=TR([e.lockRef.current],(e.shards||[]).map(Z0),!0).filter(Boolean);return j.forEach(function(N){return N.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(j,N){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var E=qc(j),R=r.current,A="deltaX"in j?j.deltaX:R[0]-E[0],I="deltaY"in j?j.deltaY:R[1]-E[1],F,O=j.target,$=Math.abs(A)>Math.abs(I)?"h":"v";if("touches"in j&&$==="h"&&O.type==="range")return!1;var V=window.getSelection(),J=V&&V.anchorNode,q=J?J===O||J.contains(O):!1;if(q)return!1;var re=q0($,O);if(!re)return!0;if(re?F=$:(F=$==="v"?"h":"v",re=q0($,O)),!re)return!1;if(!a.current&&"changedTouches"in j&&(A||I)&&(a.current=F),!F)return!0;var ae=a.current||F;return aO(ae,N,j,ae==="h"?A:I)},[]),m=S.useCallback(function(j){var N=j;if(!(!rs.length||rs[rs.length-1]!==o)){var E="deltaY"in N?H0(N):qc(N),R=t.current.filter(function(F){return F.name===N.type&&(F.target===N.target||N.target===F.shadowParent)&&lO(F.delta,E)})[0];if(R&&R.should){N.cancelable&&N.preventDefault();return}if(!R){var A=(u.current.shards||[]).map(Z0).filter(Boolean).filter(function(F){return F.contains(N.target)}),I=A.length>0?f(N,A[0]):!u.current.noIsolation;I&&N.cancelable&&N.preventDefault()}}},[]),h=S.useCallback(function(j,N,E,R){var A={name:j,delta:N,target:E,should:R,shadowParent:cO(E)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(I){return I!==A})},1)},[]),v=S.useCallback(function(j){r.current=qc(j),a.current=void 0},[]),y=S.useCallback(function(j){h(j.type,H0(j),j.target,f(j,e.lockRef.current))},[]),x=S.useCallback(function(j){h(j.type,qc(j),j.target,f(j,e.lockRef.current))},[]);S.useEffect(function(){return rs.push(o),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",m,ns),document.addEventListener("touchmove",m,ns),document.addEventListener("touchstart",v,ns),function(){rs=rs.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ns),document.removeEventListener("touchmove",m,ns),document.removeEventListener("touchstart",v,ns)}},[]);var b=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(o,{styles:sO(l)}):null,b?S.createElement(JR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dO=PR(Vw,uO);var Xw=S.forwardRef(function(e,t){return S.createElement(Od,Br({},e,{ref:t,sideCar:dO}))});Xw.classNames=Od.classNames;var fO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},is=new WeakMap,Hc=new WeakMap,Zc={},_m=0,Jw=function(e){return e&&(e.host||Jw(e.parentNode))},hO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var a=Jw(r);return a&&e.contains(a)?a:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},mO=function(e,t,r,a){var l=hO(t,Array.isArray(e)?e:[e]);Zc[r]||(Zc[r]=new WeakMap);var o=Zc[r],u=[],f=new Set,m=new Set(l),h=function(y){!y||f.has(y)||(f.add(y),h(y.parentNode))};l.forEach(h);var v=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(x){if(f.has(x))v(x);else try{var b=x.getAttribute(a),k=b!==null&&b!=="false",j=(is.get(x)||0)+1,N=(o.get(x)||0)+1;is.set(x,j),o.set(x,N),u.push(x),j===1&&k&&Hc.set(x,!0),N===1&&x.setAttribute(r,"true"),k||x.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",x,E)}})};return v(t),f.clear(),_m++,function(){u.forEach(function(y){var x=is.get(y)-1,b=o.get(y)-1;is.set(y,x),o.set(y,b),x||(Hc.has(y)||y.removeAttribute(a),Hc.delete(y)),b||y.removeAttribute(r)}),_m--,_m||(is=new WeakMap,is=new WeakMap,Hc=new WeakMap,Zc={})}},pO=function(e,t,r){r===void 0&&(r="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=fO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),mO(a,l,r,"aria-hidden")):function(){return null}},Dd="Dialog",[Ww]=Gz(Dd),[gO,Nr]=Ww(Dd),ek=e=>{const{__scopeDialog:t,children:r,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=S.useRef(null),m=S.useRef(null),[h,v]=Wz({prop:a,defaultProp:l??!1,onChange:o,caller:Dd});return d.jsx(gO,{scope:t,triggerRef:f,contentRef:m,contentId:Si(),titleId:Si(),descriptionId:Si(),open:h,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(y=>!y),[v]),modal:u,children:r})};ek.displayName=Dd;var tk="DialogTrigger",nk=S.forwardRef((e,t)=>{const{__scopeDialog:r,...a}=e,l=Nr(tk,r),o=ml(t,l.triggerRef);return d.jsx(ji.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":yg(l.open),...a,ref:o,onClick:pa(e.onClick,l.onOpenToggle)})});nk.displayName=tk;var pg="DialogPortal",[yO,rk]=Ww(pg,{forceMount:void 0}),ik=e=>{const{__scopeDialog:t,forceMount:r,children:a,container:l}=e,o=Nr(pg,t);return d.jsx(yO,{scope:t,forceMount:r,children:S.Children.map(a,u=>d.jsx(Rd,{present:r||o.open,children:d.jsx(qw,{asChild:!0,container:l,children:u})}))})};ik.displayName=pg;var fd="DialogOverlay",ak=S.forwardRef((e,t)=>{const r=rk(fd,e.__scopeDialog),{forceMount:a=r.forceMount,...l}=e,o=Nr(fd,e.__scopeDialog);return o.modal?d.jsx(Rd,{present:a||o.open,children:d.jsx(xO,{...l,ref:t})}):null});ak.displayName=fd;var vO=Uw("DialogOverlay.RemoveScroll"),xO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...a}=e,l=Nr(fd,r);return d.jsx(Xw,{as:vO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(ji.div,{"data-state":yg(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),sl="DialogContent",lk=S.forwardRef((e,t)=>{const r=rk(sl,e.__scopeDialog),{forceMount:a=r.forceMount,...l}=e,o=Nr(sl,e.__scopeDialog);return d.jsx(Rd,{present:a||o.open,children:o.modal?d.jsx(bO,{...l,ref:t}):d.jsx(SO,{...l,ref:t})})});lk.displayName=sl;var bO=S.forwardRef((e,t)=>{const r=Nr(sl,e.__scopeDialog),a=S.useRef(null),l=ml(t,r.contentRef,a);return S.useEffect(()=>{const o=a.current;if(o)return pO(o)},[]),d.jsx(sk,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pa(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:pa(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:pa(e.onFocusOutside,o=>o.preventDefault())})}),SO=S.forwardRef((e,t)=>{const r=Nr(sl,e.__scopeDialog),a=S.useRef(!1),l=S.useRef(!1);return d.jsx(sk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),sk=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Nr(sl,r),m=S.useRef(null),h=ml(t,m);return AR(),d.jsxs(d.Fragment,{children:[d.jsx($w,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx(Pw,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":yg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(wO,{titleId:f.titleId}),d.jsx(jO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),gg="DialogTitle",ok=S.forwardRef((e,t)=>{const{__scopeDialog:r,...a}=e,l=Nr(gg,r);return d.jsx(ji.h2,{id:l.titleId,...a,ref:t})});ok.displayName=gg;var uk="DialogDescription",ck=S.forwardRef((e,t)=>{const{__scopeDialog:r,...a}=e,l=Nr(uk,r);return d.jsx(ji.p,{id:l.descriptionId,...a,ref:t})});ck.displayName=uk;var dk="DialogClose",fk=S.forwardRef((e,t)=>{const{__scopeDialog:r,...a}=e,l=Nr(dk,r);return d.jsx(ji.button,{type:"button",...a,ref:t,onClick:pa(e.onClick,()=>l.onOpenChange(!1))})});fk.displayName=dk;function yg(e){return e?"open":"closed"}var hk="DialogTitleWarning",[xF,mk]=Qz(hk,{contentName:sl,titleName:gg,docsSlug:"dialog"}),wO=({titleId:e})=>{const t=mk(hk),r=`\`${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(r))},[r,e]),null},kO="DialogDescriptionWarning",jO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${mk(kO).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(a))},[a,e,t]),null},pk=ek,EO=nk,gk=ik,yk=ak,vk=lk,CO=ok,NO=ck,_O=fk,AO=Symbol.for("react.lazy"),hd=Kp[" use ".trim().toString()];function TO(e){return typeof e=="object"&&e!==null&&"then"in e}function xk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===AO&&"_payload"in e&&TO(e._payload)}function bk(e){const t=RO(e),r=S.forwardRef((a,l)=>{let{children:o,...u}=a;xk(o)&&typeof hd=="function"&&(o=hd(o._payload));const f=S.Children.toArray(o),m=f.find(DO);if(m){const h=m.props.children,v=f.map(y=>y===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:y);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,v):null})}return d.jsx(t,{...u,ref:l,children:o})});return r.displayName=`${e}.Slot`,r}var zO=bk("Slot");function RO(e){const t=S.forwardRef((r,a)=>{let{children:l,...o}=r;if(xk(l)&&typeof hd=="function"&&(l=hd(l._payload)),S.isValidElement(l)){const u=LO(l),f=MO(o,l.props);return l.type!==S.Fragment&&(f.ref=a?ga(a,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OO=Symbol("radix.slottable");function DO(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OO}function MO(e,t){const r={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?r[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(r[a]=l):a==="style"?r[a]={...l,...o}:a==="className"&&(r[a]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function LO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var UO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ei=UO.reduce((e,t)=>{const r=bk(`Primitive.${t}`),a=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Io='[cmdk-group=""]',Am='[cmdk-group-items=""]',IO='[cmdk-group-heading=""]',Sk='[cmdk-item=""]',V0=`${Sk}:not([aria-disabled="true"])`,Np="cmdk-item-select",ss="data-value",PO=(e,t,r)=>Vz(e,t,r),wk=S.createContext(void 0),pu=()=>S.useContext(wk),kk=S.createContext(void 0),vg=()=>S.useContext(kk),jk=S.createContext(void 0),Ek=S.forwardRef((e,t)=>{let r=os(()=>{var T,C;return{search:"",value:(C=(T=e.value)!=null?T:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=os(()=>new Set),l=os(()=>new Map),o=os(()=>new Map),u=os(()=>new Set),f=Ck(e),{label:m,children:h,value:v,onValueChange:y,filter:x,shouldFilter:b,loop:k,disablePointerSelection:j=!1,vimBindings:N=!0,...E}=e,R=Si(),A=Si(),I=Si(),F=S.useRef(null),O=YO();ol(()=>{if(v!==void 0){let T=v.trim();r.current.value=T,$.emit()}},[v]),ol(()=>{O(6,me)},[]);let $=S.useMemo(()=>({subscribe:T=>(u.current.add(T),()=>u.current.delete(T)),snapshot:()=>r.current,setState:(T,C,X)=>{var H,oe,ye,De;if(!Object.is(r.current[T],C)){if(r.current[T]=C,T==="search")ae(),q(),O(1,re);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ve=document.getElementById(I);ve?ve.focus():(H=document.getElementById(R))==null||H.focus()}if(O(7,()=>{var ve;r.current.selectedItemId=(ve=ce())==null?void 0:ve.id,$.emit()}),X||O(5,me),((oe=f.current)==null?void 0:oe.value)!==void 0){let ve=C??"";(De=(ye=f.current).onValueChange)==null||De.call(ye,ve);return}}$.emit()}},emit:()=>{u.current.forEach(T=>T())}}),[]),V=S.useMemo(()=>({value:(T,C,X)=>{var H;C!==((H=o.current.get(T))==null?void 0:H.value)&&(o.current.set(T,{value:C,keywords:X}),r.current.filtered.items.set(T,J(C,X)),O(2,()=>{q(),$.emit()}))},item:(T,C)=>(a.current.add(T),C&&(l.current.has(C)?l.current.get(C).add(T):l.current.set(C,new Set([T]))),O(3,()=>{ae(),q(),r.current.value||re(),$.emit()}),()=>{o.current.delete(T),a.current.delete(T),r.current.filtered.items.delete(T);let X=ce();O(4,()=>{ae(),(X==null?void 0:X.getAttribute("id"))===T&&re(),$.emit()})}),group:T=>(l.current.has(T)||l.current.set(T,new Set),()=>{o.current.delete(T),l.current.delete(T)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:R,inputId:I,labelId:A,listInnerRef:F}),[]);function J(T,C){var X,H;let oe=(H=(X=f.current)==null?void 0:X.filter)!=null?H:PO;return T?oe(T,r.current.search,C):0}function q(){if(!r.current.search||f.current.shouldFilter===!1)return;let T=r.current.filtered.items,C=[];r.current.filtered.groups.forEach(H=>{let oe=l.current.get(H),ye=0;oe.forEach(De=>{let ve=T.get(De);ye=Math.max(ve,ye)}),C.push([H,ye])});let X=F.current;ee().sort((H,oe)=>{var ye,De;let ve=H.getAttribute("id"),jt=oe.getAttribute("id");return((ye=T.get(jt))!=null?ye:0)-((De=T.get(ve))!=null?De:0)}).forEach(H=>{let oe=H.closest(Am);oe?oe.appendChild(H.parentElement===oe?H:H.closest(`${Am} > *`)):X.appendChild(H.parentElement===X?H:H.closest(`${Am} > *`))}),C.sort((H,oe)=>oe[1]-H[1]).forEach(H=>{var oe;let ye=(oe=F.current)==null?void 0:oe.querySelector(`${Io}[${ss}="${encodeURIComponent(H[0])}"]`);ye==null||ye.parentElement.appendChild(ye)})}function re(){let T=ee().find(X=>X.getAttribute("aria-disabled")!=="true"),C=T==null?void 0:T.getAttribute(ss);$.setState("value",C||void 0)}function ae(){var T,C,X,H;if(!r.current.search||f.current.shouldFilter===!1){r.current.filtered.count=a.current.size;return}r.current.filtered.groups=new Set;let oe=0;for(let ye of a.current){let De=(C=(T=o.current.get(ye))==null?void 0:T.value)!=null?C:"",ve=(H=(X=o.current.get(ye))==null?void 0:X.keywords)!=null?H:[],jt=J(De,ve);r.current.filtered.items.set(ye,jt),jt>0&&oe++}for(let[ye,De]of l.current)for(let ve of De)if(r.current.filtered.items.get(ve)>0){r.current.filtered.groups.add(ye);break}r.current.filtered.count=oe}function me(){var T,C,X;let H=ce();H&&(((T=H.parentElement)==null?void 0:T.firstChild)===H&&((X=(C=H.closest(Io))==null?void 0:C.querySelector(IO))==null||X.scrollIntoView({block:"nearest"})),H.scrollIntoView({block:"nearest"}))}function ce(){var T;return(T=F.current)==null?void 0:T.querySelector(`${Sk}[aria-selected="true"]`)}function ee(){var T;return Array.from(((T=F.current)==null?void 0:T.querySelectorAll(V0))||[])}function P(T){let C=ee()[T];C&&$.setState("value",C.getAttribute(ss))}function W(T){var C;let X=ce(),H=ee(),oe=H.findIndex(De=>De===X),ye=H[oe+T];(C=f.current)!=null&&C.loop&&(ye=oe+T<0?H[H.length-1]:oe+T===H.length?H[0]:H[oe+T]),ye&&$.setState("value",ye.getAttribute(ss))}function pe(T){let C=ce(),X=C==null?void 0:C.closest(Io),H;for(;X&&!H;)X=T>0?GO(X,Io):KO(X,Io),H=X==null?void 0:X.querySelector(V0);H?$.setState("value",H.getAttribute(ss)):W(T)}let Ce=()=>P(ee().length-1),z=T=>{T.preventDefault(),T.metaKey?Ce():T.altKey?pe(1):W(1)},U=T=>{T.preventDefault(),T.metaKey?P(0):T.altKey?pe(-1):W(-1)};return S.createElement(Ei.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:T=>{var C;(C=E.onKeyDown)==null||C.call(E,T);let X=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||X))switch(T.key){case"n":case"j":{N&&T.ctrlKey&&z(T);break}case"ArrowDown":{z(T);break}case"p":case"k":{N&&T.ctrlKey&&U(T);break}case"ArrowUp":{U(T);break}case"Home":{T.preventDefault(),P(0);break}case"End":{T.preventDefault(),Ce();break}case"Enter":{T.preventDefault();let H=ce();if(H){let oe=new Event(Np);H.dispatchEvent(oe)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:V.inputId,id:V.labelId,style:JO},m),Md(e,T=>S.createElement(kk.Provider,{value:$},S.createElement(wk.Provider,{value:V},T))))}),BO=S.forwardRef((e,t)=>{var r,a;let l=Si(),o=S.useRef(null),u=S.useContext(jk),f=pu(),m=Ck(e),h=(a=(r=m.current)==null?void 0:r.forceMount)!=null?a:u==null?void 0:u.forceMount;ol(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let v=Nk(l,o,[e.value,e.children,o],e.keywords),y=vg(),x=ya(O=>O.value&&O.value===v.current),b=ya(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);S.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(Np,k),()=>O.removeEventListener(Np,k)},[b,e.onSelect,e.disabled]);function k(){var O,$;j(),($=(O=m.current).onSelect)==null||$.call(O,v.current)}function j(){y.setState("value",v.current,!0)}if(!b)return null;let{disabled:N,value:E,onSelect:R,forceMount:A,keywords:I,...F}=e;return S.createElement(Ei.div,{ref:ga(o,t),...F,id:l,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!x,"data-disabled":!!N,"data-selected":!!x,onPointerMove:N||f.getDisablePointerSelection()?void 0:j,onClick:N?void 0:k},e.children)}),$O=S.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:l,...o}=e,u=Si(),f=S.useRef(null),m=S.useRef(null),h=Si(),v=pu(),y=ya(b=>l||v.filter()===!1?!0:b.search?b.filtered.groups.has(u):!0);ol(()=>v.group(u),[]),Nk(u,f,[e.value,e.heading,m]);let x=S.useMemo(()=>({id:u,forceMount:l}),[l]);return S.createElement(Ei.div,{ref:ga(f,t),...o,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},r&&S.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),Md(e,b=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},S.createElement(jk.Provider,{value:x},b))))}),FO=S.forwardRef((e,t)=>{let{alwaysRender:r,...a}=e,l=S.useRef(null),o=ya(u=>!u.search);return!r&&!o?null:S.createElement(Ei.div,{ref:ga(l,t),...a,"cmdk-separator":"",role:"separator"})}),qO=S.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,l=e.value!=null,o=vg(),u=ya(h=>h.search),f=ya(h=>h.selectedItemId),m=pu();return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ei.input,{ref:t,...a,"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),r==null||r(h.target.value)}})}),HO=S.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...l}=e,o=S.useRef(null),u=S.useRef(null),f=ya(h=>h.selectedItemId),m=pu();return S.useEffect(()=>{if(u.current&&o.current){let h=u.current,v=o.current,y,x=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let b=h.offsetHeight;v.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(y),x.unobserve(h)}}},[]),S.createElement(Ei.div,{ref:ga(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Md(e,h=>S.createElement("div",{ref:ga(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),ZO=S.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return S.createElement(pk,{open:r,onOpenChange:a},S.createElement(gk,{container:u},S.createElement(yk,{"cmdk-overlay":"",className:l}),S.createElement(vk,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(Ek,{ref:t,...f}))))}),VO=S.forwardRef((e,t)=>ya(r=>r.filtered.count===0)?S.createElement(Ei.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),QO=S.forwardRef((e,t)=>{let{progress:r,children:a,label:l="Loading...",...o}=e;return S.createElement(Ei.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Md(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),Pn=Object.assign(Ek,{List:HO,Item:BO,Input:qO,Group:$O,Separator:FO,Dialog:ZO,Empty:VO,Loading:QO});function GO(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function KO(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Ck(e){let t=S.useRef(e);return ol(()=>{t.current=e}),t}var ol=typeof window>"u"?S.useEffect:S.useLayoutEffect;function os(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function ya(e){let t=vg(),r=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,r,r)}function Nk(e,t,r,a=[]){let l=S.useRef(),o=pu();return ol(()=>{var u;let f=(()=>{var h;for(let v of r){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(h=v.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(ss,f),l.current=f}),l}var YO=()=>{let[e,t]=S.useState(),r=os(()=>new Map);return ol(()=>{r.current.forEach(a=>a()),r.current=new Map},[e]),(a,l)=>{r.current.set(a,l),t({})}};function XO(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Md({asChild:e,children:t},r){return e&&S.isValidElement(t)?S.cloneElement(XO(t),{ref:t.ref},r(t.props.children)):r(t)}var JO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ln=pk,WO=EO,eD=gk,_k=S.forwardRef(({className:e,...t},r)=>d.jsx(yk,{ref:r,className:Re("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));_k.displayName="DialogOverlay";const Sn=S.forwardRef(({className:e,children:t,...r},a)=>d.jsxs(eD,{children:[d.jsx(_k,{}),d.jsxs(vk,{ref:a,className:Re("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),...r,children:[t,d.jsxs(_O,{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(Sp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sn.displayName="DialogContent";function Wn({className:e,...t}){return d.jsx("div",{className:Re("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Un({className:e,...t}){return d.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const In=S.forwardRef(({className:e,...t},r)=>d.jsx(CO,{ref:r,className:Re("text-lg font-semibold leading-none tracking-tight",e),...t}));In.displayName="DialogTitle";const tD=S.forwardRef(({className:e,...t},r)=>d.jsx(NO,{ref:r,className:Re("text-sm text-muted-foreground",e),...t}));tD.displayName="DialogDescription";const Ak=S.forwardRef(({className:e,...t},r)=>d.jsx(Pn,{ref:r,className:Re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ak.displayName=Pn.displayName;function nD({open:e,onOpenChange:t,children:r}){return d.jsx(Ln,{open:e,onOpenChange:t,children:d.jsx(Sn,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Ak,{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:r})})})}const Tk=S.forwardRef(({className:e,...t},r)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(fg,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(Pn.Input,{ref:r,className:Re("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Tk.displayName=Pn.Input.displayName;const zk=S.forwardRef(({className:e,...t},r)=>d.jsx(Pn.List,{ref:r,className:Re("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));zk.displayName=Pn.List.displayName;const Rk=S.forwardRef((e,t)=>d.jsx(Pn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Rk.displayName=Pn.Empty.displayName;const ad=S.forwardRef(({className:e,...t},r)=>d.jsx(Pn.Group,{ref:r,className:Re("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ad.displayName=Pn.Group.displayName;const _p=S.forwardRef(({className:e,...t},r)=>d.jsx(Pn.Separator,{ref:r,className:Re("-mx-1 h-px bg-border",e),...t}));_p.displayName=Pn.Separator.displayName;const ld=S.forwardRef(({className:e,...t},r)=>d.jsx(Pn.Item,{ref:r,className:Re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));ld.displayName=Pn.Item.displayName;function xg(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 r=t.toString();return Me.get(`/admin/agents${r?`?${r}`:""}`)}function rD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const r=t.toString();return Me.get(`/admin/agents/all${r?`?${r}`:""}`)}function Ok(e){return Me.get(`/admin/agents/${encodeURIComponent(e)}`)}function iD(e){return Me.post("/admin/agents",e)}function Q0(e,t){return Me.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function aD(e){return Me.delete(`/admin/agents/${encodeURIComponent(e)}`)}function lD(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function sD(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function oD(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function wa(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>xg({limit:100}),staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const r of e.items)t.set(r.uuid,r.displayName??r.name??r.uuid);return r=>r?t.get(r)??r:"—"},[e])}const uD=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function cD({open:e,onOpenChange:t}){const r=Vr(),a=wa(),{data:l}=qe({queryKey:["activity"],queryFn:Td,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 v of o)try{const y=await Us(v.agentId);for(const x of y)h.push({agentId:v.agentId,session:x})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),r(h)};return d.jsxs(nD,{open:e,onOpenChange:t,children:[d.jsx(Tk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(zk,{children:[d.jsx(Rk,{children:"No results"}),o.length>0&&d.jsx(ad,{heading:"Agents",children:o.map(h=>{const v=a(h.agentId);return d.jsxs(ld,{value:`agent ${v} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(XA,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:v}),d.jsx("span",{className:"text-xs 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(_p,{}),d.jsx(ad,{heading:"Chats",children:f.map(({agentId:h,session:v})=>{const y=a(h);return d.jsxs(ld,{value:`chat ${y} ${v.chatId}`,onSelect:()=>m(`/?a=${h}&c=${v.chatId}`),children:[d.jsx(gw,{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-xs text-muted-foreground font-mono ml-2",children:v.chatId.slice(0,8)})]},`${h}-${v.chatId}`)})})]}),d.jsx(_p,{}),d.jsx(ad,{heading:"Pages",children:uD.map(h=>d.jsxs(ld,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(oT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function Ld(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 Ap(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 r=t.toString();return Me.get(`/admin/notifications${r?`?${r}`:""}`)}function Dk(e){return Me.post(`/admin/notifications/${e}/read`)}function dD(){return Me.post("/admin/notifications/read-all")}const fD={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 hD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Mk({notification:e,onClick:t,clickable:r}){const a=(fD[e.type]??e.type).toString(),l=hD(e.severity),o=r??!0;return d.jsxs("button",{type:"button",onClick:t,className:Re("w-full text-left transition-colors",o?"cursor-pointer":"cursor-default"),style:{padding:"6px 8px",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`2px solid ${l}`,borderRadius:"0 3px 3px 0",fontSize:13},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",style:{fontSize:11,letterSpacing:.08,color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),d.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--fg-4)",whiteSpace:"nowrap"},children:Cr(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function mD(){var b;const[e,t]=S.useState(!1),[r,a]=S.useState(null),l=S.useRef(null),o=Vr(),u=er(),{data:f}=qe({queryKey:["notifications","bell"],queryFn:()=>Ap({limit:8}),refetchInterval:1e4}),{data:m}=qe({queryKey:["notifications","unread-count"],queryFn:()=>Ap({read:!1,limit:100}),refetchInterval:1e4}),h=((b=m==null?void 0:m.items)==null?void 0:b.length)??0,v=h>0,y=S.useCallback(async k=>{k.read||(Dk(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]),x=S.useCallback(async()=>{a(null);try{await dD(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(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(KA,{className:"h-4 w-4"}),v&&d.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)",fontSize:11},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:"1px solid var(--border)",borderRadius:6,boxShadow:"0 8px 24px rgba(0,0,0,0.25)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase",style:{fontSize:11,letterSpacing:.1,color:"var(--fg-4)"},children:"Notifications"}),v&&d.jsx("button",{type:"button",onClick:x,className:"hover:underline",style:{fontSize:12,color:"var(--accent)"},children:"Mark all read"})]}),r&&d.jsx("div",{style:{padding:"6px 12px",fontSize:13,color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"1px solid var(--border-faint)"},children:r}),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",style:{fontSize:13,color:"var(--fg-3)",padding:"18px 0"},children:"No notifications"}):f.items.map(k=>d.jsx(Mk,{notification:k,clickable:!!k.agentId,onClick:()=>y(k)},k.id))})]})]})]})}function pD(){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 gD(){const[e,t]=S.useState(pD);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-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?d.jsx(zT,{className:"h-4 w-4"}):d.jsx(gT,{className:"h-4 w-4"})})}const G0=[{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"}],yD={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function vD(){const{role:e,logout:t}=ba(),r=e==="admin",[a,l]=S.useState(!1),o=r?[...G0,yD]:G0,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(v=>!v))};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:40,gridTemplateColumns:"auto 1fr auto",padding:"0 12px",borderBottom:"1px solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(Ld,{width:14,height:16,style:{color:"var(--fg)"}}),d.jsxs("span",{style:{fontWeight:600,fontSize:13,letterSpacing:-.1,color:"var(--fg)"},children:["First Tree ",d.jsx("span",{style:{color:"var(--fg-3)",fontWeight:400},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(ow,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>Re("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.jsxs("span",{className:"inline-flex items-center",style:{padding:"5px 12px",fontSize:16,fontWeight:500,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",style:{gap:8,padding:"4px 8px",fontSize:11,color:"var(--fg-3)",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg-sunken)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(fg,{className:"h-3.5 w-3.5"}),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 4px"}}),d.jsx(mD,{}),d.jsx(gD,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)]",style:{padding:"4px 8px",color:"var(--fg-3)",borderRadius:4,gap:6,fontSize:11},"aria-label":"Log out",children:d.jsx(hT,{className:"h-3.5 w-3.5"})})]})]}),d.jsx(cD,{open:a,onOpenChange:l}),f?d.jsx(vp,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 max-w-5xl mx-auto",children:d.jsx(vp,{})})})]})}function ie(e,t,r){function a(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,v=Object.keys(h);for(let y=0;y<v.length;y++){const x=v[y];x in f||(f[x]=h[x].bind(f))}}const l=(r==null?void 0:r.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=r!=null&&r.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const v of h._zod.deferred)v();return h}return Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return r!=null&&r.Parent&&f instanceof r.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 ms extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lk extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Uk={};function va(e){return Uk}function Ik(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,l])=>t.indexOf(+a)===-1).map(([a,l])=>l)}function Tp(e,t){return typeof t=="bigint"?t.toString():t}function Ud(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bg(e){return e==null}function Sg(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function xD(e,t){const r=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=r>l?r:l,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const K0=Symbol("evaluating");function st(e,t,r){let a;Object.defineProperty(e,t,{get(){if(a!==K0)return a===void 0&&(a=K0,a=r()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function pl(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ka(...e){const t={};for(const r of e){const a=Object.getOwnPropertyDescriptors(r);Object.assign(t,a)}return Object.defineProperties({},t)}function Y0(e){return JSON.stringify(e)}function bD(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Pk="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const SD=Ud(()=>{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 _s(e){if(nu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(nu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Bk(e){return _s(e)?{...e}:Array.isArray(e)?[...e]:e}const wD=new Set(["string","number","symbol"]);function As(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ja(e,t,r){const a=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(a._zod.parent=e),a}function Ne(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 kD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const jD={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 ED(e,t){const r=e._zod.def,a=r.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=ka(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in r.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=r.shape[f])}return pl(this,"shape",u),u},checks:[]});return ja(e,o)}function CD(e,t){const r=e._zod.def,a=r.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=ka(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in r.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return pl(this,"shape",u),u},checks:[]});return ja(e,o)}function ND(e,t){if(!_s(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.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=ka(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return pl(this,"shape",o),o}});return ja(e,l)}function _D(e,t){if(!_s(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ka(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return pl(this,"shape",a),a}});return ja(e,r)}function AD(e,t){const r=ka(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return pl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ja(e,r)}function TD(e,t,r){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=ka(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(r)for(const h in r){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);r[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 pl(this,"shape",m),m},checks:[]});return ja(t,u)}function zD(e,t,r){const a=ka(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[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 pl(this,"shape",o),o}});return ja(t,a)}function cs(e,t=0){var r;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((r=e.issues[a])==null?void 0:r.continue)!==!0)return!0;return!1}function ds(e,t){return t.map(r=>{var a;return(a=r).path??(a.path=[]),r.path.unshift(e),r})}function Vc(e){return typeof e=="string"?e:e==null?void 0:e.message}function xa(e,t,r){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const v=Vc((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??Vc((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Vc((m=r.customError)==null?void 0:m.call(r,e))??Vc((h=r.localeError)==null?void 0:h.call(r,e))??"Invalid input";a.message=v}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function wg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ru(...e){const[t,r,a]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:a}:{...t}}const $k=(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,Tp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Fk=ie("$ZodError",$k),qk=ie("$ZodError",$k,{Parent:Error});function RD(e,t=r=>r.message){const r={},a=[];for(const l of e.issues)l.path.length>0?(r[l.path[0]]=r[l.path[0]]||[],r[l.path[0]].push(t(l))):a.push(t(l));return{formErrors:a,fieldErrors:r}}function OD(e,t=r=>r.message){const r={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(u=>a({issues:u}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let u=r,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 a(e),r}const kg=e=>(t,r,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new ms;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>xa(m,o,va())));throw Pk(f,l==null?void 0:l.callee),f}return u.value},jg=e=>async(t,r,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:r,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=>xa(m,o,va())));throw Pk(f,l==null?void 0:l.callee),f}return u.value},Id=e=>(t,r,a)=>{const l=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},l);if(o instanceof Promise)throw new ms;return o.issues.length?{success:!1,error:new(e??Fk)(o.issues.map(u=>xa(u,l,va())))}:{success:!0,data:o.value}},DD=Id(qk),Pd=e=>async(t,r,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(u=>xa(u,l,va())))}:{success:!0,data:o.value}},MD=Pd(qk),LD=e=>(t,r,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kg(e)(t,r,l)},UD=e=>(t,r,a)=>kg(e)(t,r,a),ID=e=>async(t,r,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jg(e)(t,r,l)},PD=e=>async(t,r,a)=>jg(e)(t,r,a),BD=e=>(t,r,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Id(e)(t,r,l)},$D=e=>(t,r,a)=>Id(e)(t,r,a),FD=e=>async(t,r,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Pd(e)(t,r,l)},qD=e=>async(t,r,a)=>Pd(e)(t,r,a),HD=/^[cC][^\s-]{8,}$/,ZD=/^[0-9a-z]+$/,VD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,QD=/^[0-9a-vA-V]{20}$/,GD=/^[A-Za-z0-9]{27}$/,KD=/^[a-zA-Z0-9_-]{21}$/,YD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XD=/^([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})$/,X0=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)$/,JD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function e4(){return new RegExp(WD,"u")}const t4=/^(?:(?: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])$/,n4=/^(([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}|:))$/,r4=/^((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])$/,i4=/^(([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])$/,a4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hk=/^[A-Za-z0-9_-]*$/,l4=/^\+[1-9]\d{6,14}$/,Zk="(?:(?:\\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])))",s4=new RegExp(`^${Zk}$`);function Vk(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 o4(e){return new RegExp(`^${Vk(e)}$`)}function u4(e){const t=Vk({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${r.join("|")})`;return new RegExp(`^${Zk}T(?:${a})$`)}const c4=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}$`)},d4=/^-?\d+$/,Qk=/^-?\d+(?:\.\d+)?$/,f4=/^(?:true|false)$/i,h4=/^[^A-Z]*$/,m4=/^[^a-z]*$/,Bn=ie("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Gk={number:"number",bigint:"bigint",object:"date"},Kk=ie("$ZodCheckLessThan",(e,t)=>{Bn.init(e,t);const r=Gk[typeof t.value];e._zod.onattach.push(a=>{const l=a._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=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yk=ie("$ZodCheckGreaterThan",(e,t)=>{Bn.init(e,t);const r=Gk[typeof t.value];e._zod.onattach.push(a=>{const l=a._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=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),p4=ie("$ZodCheckMultipleOf",(e,t)=>{Bn.init(e,t),e._zod.onattach.push(r=>{var a;(a=r._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):xD(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),g4=ie("$ZodCheckNumberFormat",(e,t)=>{var u;Bn.init(e,t),t.format=t.format||"float64";const r=(u=t.format)==null?void 0:u.includes("int"),a=r?"int":"number",[l,o]=jD[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,r&&(m.pattern=d4)}),e._zod.check=f=>{const m=f.value;if(r){if(!Number.isInteger(m)){f.issues.push({expected:a,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:a,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:a,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})}}),y4=ie("$ZodCheckMaxLength",(e,t)=>{var r;Bn.init(e,t),(r=e._zod.def).when??(r.when=a=>{const l=a.value;return!bg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const u=wg(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),v4=ie("$ZodCheckMinLength",(e,t)=>{var r;Bn.init(e,t),(r=e._zod.def).when??(r.when=a=>{const l=a.value;return!bg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const u=wg(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),x4=ie("$ZodCheckLengthEquals",(e,t)=>{var r;Bn.init(e,t),(r=e._zod.def).when??(r.when=a=>{const l=a.value;return!bg(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const u=wg(l),f=o>t.length;a.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Bd=ie("$ZodCheckStringFormat",(e,t)=>{var r,a;Bn.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?(r=e._zod).check??(r.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})}):(a=e._zod).check??(a.check=()=>{})}),b4=ie("$ZodCheckRegex",(e,t)=>{Bd.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),S4=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=h4),Bd.init(e,t)}),w4=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=m4),Bd.init(e,t)}),k4=ie("$ZodCheckIncludes",(e,t)=>{Bn.init(e,t);const r=As(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=a,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),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})}}),j4=ie("$ZodCheckStartsWith",(e,t)=>{Bn.init(e,t);const r=new RegExp(`^${As(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),E4=ie("$ZodCheckEndsWith",(e,t)=>{Bn.init(e,t);const r=new RegExp(`.*${As(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),C4=ie("$ZodCheckOverwrite",(e,t)=>{Bn.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class N4{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 a=t.split(`
|
|
295
|
-
`).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.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,r=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,l.join(`
|
|
296
|
-
`))}}const _4={major:4,minor:3,patch:6},At=ie("$ZodType",(e,t)=>{var l;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(e);if(a.length===0)(r=e._zod).deferred??(r.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let v=cs(f),y;for(const x of m){if(x._zod.def.when){if(!x._zod.def.when(f))continue}else if(v)continue;const b=f.issues.length,k=x._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new ms;if(y||k instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await k,f.issues.length!==b&&(v||(v=cs(f,b)))});else{if(f.issues.length===b)continue;v||(v=cs(f,b))}}return y?y.then(()=>f):f},u=(f,m,h)=>{if(cs(f))return f.aborted=!0,f;const v=o(m,a,h);if(v instanceof Promise){if(h.async===!1)throw new ms;return v.then(y=>e._zod.parse(y,h))}return e._zod.parse(v,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const v=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(y=>u(y,f,m)):u(v,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new ms;return h.then(v=>o(v,a,m))}return o(h,a,m)}}st(e,"~standard",()=>({validate:o=>{var u;try{const f=DD(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return MD(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}))}),Eg=ie("$ZodString",(e,t)=>{var r;At.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??c4(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),_t=ie("$ZodStringFormat",(e,t)=>{Bd.init(e,t),Eg.init(e,t)}),A4=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=XD),_t.init(e,t)}),T4=ie("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=X0(a))}else t.pattern??(t.pattern=X0());_t.init(e,t)}),z4=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=JD),_t.init(e,t)}),R4=ie("$ZodURL",(e,t)=>{_t.init(e,t),e._zod.check=r=>{try{const a=r.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.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)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=l.href:r.value=a;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),O4=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=e4()),_t.init(e,t)}),D4=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=KD),_t.init(e,t)}),M4=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=HD),_t.init(e,t)}),L4=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ZD),_t.init(e,t)}),U4=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=VD),_t.init(e,t)}),I4=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=QD),_t.init(e,t)}),P4=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=GD),_t.init(e,t)}),B4=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=u4(t)),_t.init(e,t)}),$4=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=s4),_t.init(e,t)}),F4=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=o4(t)),_t.init(e,t)}),q4=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=YD),_t.init(e,t)}),H4=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=t4),_t.init(e,t),e._zod.bag.format="ipv4"}),Z4=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=n4),_t.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),V4=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=r4),_t.init(e,t)}),Q4=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=i4),_t.init(e,t),e._zod.check=r=>{const a=r.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;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{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Xk(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const G4=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=a4),_t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Xk(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function K4(e){if(!Hk.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Xk(r)}const Y4=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Hk),_t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{K4(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),X4=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=l4),_t.init(e,t)});function J4(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[a]=r;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const W4=ie("$ZodJWT",(e,t)=>{_t.init(e,t),e._zod.check=r=>{J4(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Jk=ie("$ZodNumber",(e,t)=>{At.init(e,t),e._zod.pattern=e._zod.bag.pattern??Qk,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const l=r.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return r;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),r}}),eM=ie("$ZodNumberFormat",(e,t)=>{g4.init(e,t),Jk.init(e,t)}),tM=ie("$ZodBoolean",(e,t)=>{At.init(e,t),e._zod.pattern=f4,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=!!r.value}catch{}const l=r.value;return typeof l=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),r}}),nM=ie("$ZodUnknown",(e,t)=>{At.init(e,t),e._zod.parse=r=>r}),rM=ie("$ZodNever",(e,t)=>{At.init(e,t),e._zod.parse=(r,a)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function J0(e,t,r){e.issues.length&&t.issues.push(...ds(r,e.issues)),t.value[r]=e.value}const iM=ie("$ZodArray",(e,t)=>{At.init(e,t),e._zod.parse=(r,a)=>{const l=r.value;if(!Array.isArray(l))return r.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),r;r.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:[]},a);m instanceof Promise?o.push(m.then(h=>J0(h,r,u))):J0(m,r,u)}return o.length?Promise.all(o).then(()=>r):r}});function md(e,t,r,a,l){if(e.issues.length){if(l&&!(r in a))return;t.issues.push(...ds(r,e.issues))}e.value===void 0?r in a&&(t.value[r]=void 0):t.value[r]=e.value}function Wk(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[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 r=kD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function ej(e,t,r,a,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,v=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(h==="never"){u.push(y);continue}const x=m.run({value:t[y],issues:[]},a);x instanceof Promise?e.push(x.then(b=>md(b,r,y,t,v))):md(x,r,y,t,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const aM=ie("$ZodObject",(e,t)=>{At.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=Ud(()=>Wk(t));st(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const v=f[h]._zod;if(v.values){m[h]??(m[h]=new Set);for(const y of v.values)m[h].add(y)}}return m});const l=nu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=a.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 v=[],y=u.shape;for(const x of u.keys){const b=y[x],k=b._zod.optout==="optional",j=b._zod.run({value:h[x],issues:[]},m);j instanceof Promise?v.push(j.then(N=>md(N,f,x,h,k))):md(j,f,x,h,k)}return o?ej(v,h,f,m,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),lM=ie("$ZodObjectJIT",(e,t)=>{aM.init(e,t);const r=e._zod.parse,a=Ud(()=>Wk(t)),l=x=>{var A;const b=new N4(["shape","payload","ctx"]),k=a.value,j=I=>{const F=Y0(I);return`shape[${F}]._zod.run({ value: input[${F}], issues: [] }, ctx)`};b.write("const input = payload.value;");const N=Object.create(null);let E=0;for(const I of k.keys)N[I]=`key_${E++}`;b.write("const newResult = {};");for(const I of k.keys){const F=N[I],O=Y0(I),$=x[I],V=((A=$==null?void 0:$._zod)==null?void 0:A.optout)==="optional";b.write(`const ${F} = ${j(I)};`),V?b.write(`
|
|
297
|
-
if (${F}.issues.length) {
|
|
298
|
-
if (${O} in input) {
|
|
299
|
-
payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
|
|
300
|
-
...iss,
|
|
301
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
302
|
-
})));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (${F}.value === undefined) {
|
|
307
|
-
if (${O} in input) {
|
|
308
|
-
newResult[${O}] = undefined;
|
|
309
|
-
}
|
|
310
|
-
} else {
|
|
311
|
-
newResult[${O}] = ${F}.value;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
`):b.write(`
|
|
315
|
-
if (${F}.issues.length) {
|
|
316
|
-
payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
|
|
317
|
-
...iss,
|
|
318
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
319
|
-
})));
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
if (${F}.value === undefined) {
|
|
323
|
-
if (${O} in input) {
|
|
324
|
-
newResult[${O}] = undefined;
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
newResult[${O}] = ${F}.value;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const R=b.compile();return(I,F)=>R(x,I,F)};let o;const u=nu,f=!Uk.jitless,h=f&&SD.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const k=x.value;return u(k)?f&&h&&(b==null?void 0:b.async)===!1&&b.jitless!==!0?(o||(o=l(t.shape)),x=o(x,b),v?ej([],k,x,b,y,e):x):r(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),x)}});function W0(e,t,r,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!cs(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(u=>xa(u,a,va())))}),t)}const tj=ie("$ZodUnion",(e,t)=>{At.init(e,t),st(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),st(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),st(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),st(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=>Sg(o.source)).join("|")})$`)}});const r=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(r)return a(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=>W0(m,l,e,o)):W0(f,l,e,o)}}),sM=ie("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,tj.init(e,t);const r=e._zod.parse;st(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 a=Ud(()=>{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(!nu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?r(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),oM=ie("$ZodIntersection",(e,t)=>{At.init(e,t),e._zod.parse=(r,a)=>{const l=r.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>e1(r,m,h)):e1(r,o,u)}});function zp(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(_s(e)&&_s(t)){const r=Object.keys(t),a=Object.keys(e).filter(o=>r.indexOf(o)!==-1),l={...e,...t};for(const o of a){const u=zp(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 r=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],u=zp(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};r.push(u.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function e1(e,t,r){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of r.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),cs(e))return e;const u=zp(t.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const uM=ie("$ZodRecord",(e,t)=>{At.init(e,t),e._zod.parse=(r,a)=>{const l=r.value;if(!_s(l))return r.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),r;const o=[],u=t.keyType._zod.values;if(u){r.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 v=t.valueType._zod.run({value:l[h],issues:[]},a);v instanceof Promise?o.push(v.then(y=>{y.issues.length&&r.issues.push(...ds(h,y.issues)),r.value[h]=y.value})):(v.issues.length&&r.issues.push(...ds(h,v.issues)),r.value[h]=v.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{r.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Qk.test(f)&&m.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(m=y)}if(m.issues.length){t.mode==="loose"?r.value[f]=l[f]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>xa(y,a,va())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:l[f],issues:[]},a);v instanceof Promise?o.push(v.then(y=>{y.issues.length&&r.issues.push(...ds(f,y.issues)),r.value[m.value]=y.value})):(v.issues.length&&r.issues.push(...ds(f,v.issues)),r.value[m.value]=v.value)}}return o.length?Promise.all(o).then(()=>r):r}}),cM=ie("$ZodEnum",(e,t)=>{At.init(e,t);const r=Ik(t.entries),a=new Set(r);e._zod.values=a,e._zod.pattern=new RegExp(`^(${r.filter(l=>wD.has(typeof l)).map(l=>typeof l=="string"?As(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:r,input:u,inst:e}),l}}),dM=ie("$ZodLiteral",(e,t)=>{if(At.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?As(a):a?As(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return r.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),fM=ie("$ZodTransform",(e,t)=>{At.init(e,t),e._zod.parse=(r,a)=>{if(a.direction==="backward")throw new Lk(e.constructor.name);const l=t.transform(r.value,r);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(r.value=u,r));if(l instanceof Promise)throw new ms;return r.value=l,r}});function t1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const nj=ie("$ZodOptional",(e,t)=>{At.init(e,t),e._zod.optin="optional",e._zod.optout="optional",st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sg(r.source)})?$`):void 0}),e._zod.parse=(r,a)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(r,a);return l instanceof Promise?l.then(o=>t1(o,r.value)):t1(l,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,a)}}),hM=ie("$ZodExactOptional",(e,t)=>{nj.init(e,t),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,a)=>t.innerType._zod.run(r,a)}),mM=ie("$ZodNullable",(e,t)=>{At.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sg(r.source)}|null)$`):void 0}),st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,a)=>r.value===null?r:t.innerType._zod.run(r,a)}),pM=ie("$ZodDefault",(e,t)=>{At.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,a)=>{if(a.direction==="backward")return t.innerType._zod.run(r,a);if(r.value===void 0)return r.value=t.defaultValue,r;const l=t.innerType._zod.run(r,a);return l instanceof Promise?l.then(o=>n1(o,t)):n1(l,t)}});function n1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const gM=ie("$ZodPrefault",(e,t)=>{At.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,a)=>(a.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,a))}),yM=ie("$ZodNonOptional",(e,t)=>{At.init(e,t),st(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(a=>a!==void 0)):void 0}),e._zod.parse=(r,a)=>{const l=t.innerType._zod.run(r,a);return l instanceof Promise?l.then(o=>r1(o,e)):r1(l,e)}});function r1(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 vM=ie("$ZodCatch",(e,t)=>{At.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,a)=>{if(a.direction==="backward")return t.innerType._zod.run(r,a);const l=t.innerType._zod.run(r,a);return l instanceof Promise?l.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(u=>xa(u,a,va()))},input:r.value}),r.issues=[]),r)):(r.value=l.value,l.issues.length&&(r.value=t.catchValue({...r,error:{issues:l.issues.map(o=>xa(o,a,va()))},input:r.value}),r.issues=[]),r)}}),xM=ie("$ZodPipe",(e,t)=>{At.init(e,t),st(e._zod,"values",()=>t.in._zod.values),st(e._zod,"optin",()=>t.in._zod.optin),st(e._zod,"optout",()=>t.out._zod.optout),st(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(r,a);return o instanceof Promise?o.then(u=>Qc(u,t.in,a)):Qc(o,t.in,a)}const l=t.in._zod.run(r,a);return l instanceof Promise?l.then(o=>Qc(o,t.out,a)):Qc(l,t.out,a)}});function Qc(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const bM=ie("$ZodReadonly",(e,t)=>{At.init(e,t),st(e._zod,"propValues",()=>t.innerType._zod.propValues),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"optin",()=>{var r,a;return(a=(r=t.innerType)==null?void 0:r._zod)==null?void 0:a.optin}),st(e._zod,"optout",()=>{var r,a;return(a=(r=t.innerType)==null?void 0:r._zod)==null?void 0:a.optout}),e._zod.parse=(r,a)=>{if(a.direction==="backward")return t.innerType._zod.run(r,a);const l=t.innerType._zod.run(r,a);return l instanceof Promise?l.then(i1):i1(l)}});function i1(e){return e.value=Object.freeze(e.value),e}const SM=ie("$ZodCustom",(e,t)=>{Bn.init(e,t),At.init(e,t),e._zod.parse=(r,a)=>r,e._zod.check=r=>{const a=r.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>a1(o,r,a,e));a1(l,r,a,e)}});function a1(e,t,r,a){if(!e){const l={code:"custom",input:r,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(ru(l))}}var l1;class wM{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const a=r[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const a={...this.get(r)??{}};delete a.id;const l={...a,...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 kM(){return new wM}(l1=globalThis).__zod_globalRegistry??(l1.__zod_globalRegistry=kM());const Ho=globalThis.__zod_globalRegistry;function jM(e,t){return new e({type:"string",...Ne(t)})}function EM(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ne(t)})}function s1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ne(t)})}function CM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ne(t)})}function NM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ne(t)})}function _M(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ne(t)})}function AM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ne(t)})}function TM(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ne(t)})}function zM(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ne(t)})}function RM(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ne(t)})}function OM(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ne(t)})}function DM(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ne(t)})}function MM(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ne(t)})}function LM(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ne(t)})}function UM(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ne(t)})}function IM(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ne(t)})}function PM(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ne(t)})}function BM(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ne(t)})}function $M(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ne(t)})}function FM(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ne(t)})}function qM(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ne(t)})}function HM(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ne(t)})}function ZM(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ne(t)})}function VM(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ne(t)})}function QM(e,t){return new e({type:"string",format:"date",check:"string_format",...Ne(t)})}function GM(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ne(t)})}function KM(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ne(t)})}function YM(e,t){return new e({type:"number",checks:[],...Ne(t)})}function XM(e,t){return new e({type:"number",coerce:!0,checks:[],...Ne(t)})}function JM(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ne(t)})}function WM(e,t){return new e({type:"boolean",...Ne(t)})}function e3(e){return new e({type:"unknown"})}function t3(e,t){return new e({type:"never",...Ne(t)})}function o1(e,t){return new Kk({check:"less_than",...Ne(t),value:e,inclusive:!1})}function Tm(e,t){return new Kk({check:"less_than",...Ne(t),value:e,inclusive:!0})}function u1(e,t){return new Yk({check:"greater_than",...Ne(t),value:e,inclusive:!1})}function zm(e,t){return new Yk({check:"greater_than",...Ne(t),value:e,inclusive:!0})}function c1(e,t){return new p4({check:"multiple_of",...Ne(t),value:e})}function rj(e,t){return new y4({check:"max_length",...Ne(t),maximum:e})}function pd(e,t){return new v4({check:"min_length",...Ne(t),minimum:e})}function ij(e,t){return new x4({check:"length_equals",...Ne(t),length:e})}function n3(e,t){return new b4({check:"string_format",format:"regex",...Ne(t),pattern:e})}function r3(e){return new S4({check:"string_format",format:"lowercase",...Ne(e)})}function i3(e){return new w4({check:"string_format",format:"uppercase",...Ne(e)})}function a3(e,t){return new k4({check:"string_format",format:"includes",...Ne(t),includes:e})}function l3(e,t){return new j4({check:"string_format",format:"starts_with",...Ne(t),prefix:e})}function s3(e,t){return new E4({check:"string_format",format:"ends_with",...Ne(t),suffix:e})}function Is(e){return new C4({check:"overwrite",tx:e})}function o3(e){return Is(t=>t.normalize(e))}function u3(){return Is(e=>e.trim())}function c3(){return Is(e=>e.toLowerCase())}function d3(){return Is(e=>e.toUpperCase())}function f3(){return Is(e=>bD(e))}function h3(e,t,r){return new e({type:"array",element:t,...Ne(r)})}function m3(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Ne(r)})}function p3(e){const t=g3(r=>(r.addIssue=a=>{if(typeof a=="string")r.issues.push(ru(a,r.value,t._zod.def));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=r.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),r.issues.push(ru(l))}},e(r.value,r)));return t}function g3(e,t){const r=new Bn({check:"custom",...Ne(t)});return r._zod.check=e,r}function aj(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)??Ho,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 qt(e,t,r={path:[],schemaPath:[]}){var v,y;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,u);const f=(y=(v=e._zod).toJSONSchema)==null?void 0:y.call(v);if(f)u.schema=f;else{const x={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,x);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,x)}const b=e._zod.parent;b&&(u.ref||(u.ref=b),qt(b,t,x),t.seen.get(b).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&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function lj(e,t){var u,f,m,h;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const v of e.seen.entries()){const y=(u=e.metadataRegistry.get(v[0]))==null?void 0:u.id;if(y){const x=a.get(y);if(x&&x!==v[0])throw new Error(`Duplicate schema id "${y}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(y,v[0])}}const l=v=>{var j;const y=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const N=(j=e.external.registry.get(v[0]))==null?void 0:j.id,E=e.external.uri??(A=>A);if(N)return{ref:E(N)};const R=v[1].defId??v[1].schema.id??`schema${e.counter++}`;return v[1].defId=R,{defId:R,ref:`${E("__shared")}#/${y}/${R}`}}if(v[1]===r)return{ref:"#"};const b=`#/${y}/`,k=v[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:b+k}},o=v=>{if(v[1].schema.$ref)return;const y=v[1],{ref:x,defId:b}=l(v);y.def={...y.schema},b&&(y.defId=b);const k=y.schema;for(const j in k)delete k[j];k.$ref=x};if(e.cycles==="throw")for(const v of e.seen.entries()){const y=v[1];if(y.cycle)throw new Error(`Cycle detected: #/${(f=y.cycle)==null?void 0:f.join("/")}/<root>
|
|
331
|
-
|
|
332
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const v of e.seen.entries()){const y=v[1];if(t===v[0]){o(v);continue}if(e.external){const b=(m=e.external.registry.get(v[0]))==null?void 0:m.id;if(t!==v[0]&&b){o(v);continue}}if((h=e.metadataRegistry.get(v[0]))==null?void 0:h.id){o(v);continue}if(y.cycle){o(v);continue}if(y.count>1&&e.reused==="ref"){o(v);continue}}}function sj(e,t){var u,f,m;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const v=e.seen.get(h);if(v.ref===null)return;const y=v.def??v.schema,x={...y},b=v.ref;if(v.ref=null,b){a(b);const j=e.seen.get(b),N=j.schema;if(N.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(y.allOf=y.allOf??[],y.allOf.push(N)):Object.assign(y,N),Object.assign(y,x),h._zod.parent===b)for(const R in y)R==="$ref"||R==="allOf"||R in x||delete y[R];if(N.$ref&&j.def)for(const R in y)R==="$ref"||R==="allOf"||R in j.def&&JSON.stringify(y[R])===JSON.stringify(j.def[R])&&delete y[R]}const k=h._zod.parent;if(k&&k!==b){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(y.$ref=j.schema.$ref,j.def))for(const N in y)N==="$ref"||N==="allOf"||N in j.def&&JSON.stringify(y[N])===JSON.stringify(j.def[N])&&delete y[N]}e.override({zodSchema:h,jsonSchema:y,path:v.path??[]})};for(const h of[...e.seen.entries()].reverse())a(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,r.def??r.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const v=h[1];v.def&&v.defId&&(o[v.defId]=v.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:gd(t,"input",e.processors),output:gd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return yn(a.element,r);if(a.type==="set")return yn(a.valueType,r);if(a.type==="lazy")return yn(a.getter(),r);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return yn(a.innerType,r);if(a.type==="intersection")return yn(a.left,r)||yn(a.right,r);if(a.type==="record"||a.type==="map")return yn(a.keyType,r)||yn(a.valueType,r);if(a.type==="pipe")return yn(a.in,r)||yn(a.out,r);if(a.type==="object"){for(const l in a.shape)if(yn(a.shape[l],r))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(yn(l,r))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(yn(l,r))return!0;return!!(a.rest&&yn(a.rest,r))}return!1}const y3=(e,t={})=>r=>{const a=aj({...r,processors:t});return qt(e,a),lj(a,e),sj(a,e)},gd=(e,t,r={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=aj({...l??{},target:o,io:t,processors:r});return qt(e,u),lj(u,e),sj(u,e)},v3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},x3=(e,t,r,a)=>{const l=r;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=v3[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const v=[...m];v.length===1?l.pattern=v[0].source:v.length>1&&(l.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},b3=(e,t,r,a)=>{const l=r,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=v,l.exclusiveMinimum=!0):l.exclusiveMinimum=v),typeof o=="number"&&(l.minimum=o,typeof v=="number"&&t.target!=="draft-04"&&(v>=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)},S3=(e,t,r,a)=>{r.type="boolean"},w3=(e,t,r,a)=>{r.not={}},k3=(e,t,r,a)=>{},j3=(e,t,r,a)=>{const l=e._zod.def,o=Ik(l.entries);o.every(u=>typeof u=="number")&&(r.type="number"),o.every(u=>typeof u=="string")&&(r.type="string"),r.enum=o},E3=(e,t,r,a)=>{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];r.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[u]:r.const=u}else o.every(u=>typeof u=="number")&&(r.type="number"),o.every(u=>typeof u=="string")&&(r.type="string"),o.every(u=>typeof u=="boolean")&&(r.type="boolean"),o.every(u=>u===null)&&(r.type="null"),r.enum=o},C3=(e,t,r,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},N3=(e,t,r,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_3=(e,t,r,a)=>{const l=r,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=qt(o.element,t,{...a,path:[...a.path,"items"]})},A3=(e,t,r,a)=>{var h;const l=r,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const v in u)l.properties[v]=qt(u[v],t,{...a,path:[...a.path,"properties",v]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(v=>{const y=o.shape[v]._zod;return t.io==="input"?y.optin===void 0:y.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=qt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},T3=(e,t,r,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>qt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?r.oneOf=u:r.anyOf=u},z3=(e,t,r,a)=>{const l=e._zod.def,o=qt(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=qt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(u)?u.allOf:[u]];r.allOf=m},R3=(e,t,r,a)=>{const l=r,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 v=qt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const y of m)l.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=qt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=qt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const v=[...h].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(l.required=v)}},O3=(e,t,r,a)=>{const l=e._zod.def,o=qt(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},D3=(e,t,r,a)=>{const l=e._zod.def;qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},M3=(e,t,r,a)=>{const l=e._zod.def;qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,r.default=JSON.parse(JSON.stringify(l.defaultValue))},L3=(e,t,r,a)=>{const l=e._zod.def;qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},U3=(e,t,r,a)=>{const l=e._zod.def;qt(l.innerType,t,a);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")}r.default=u},I3=(e,t,r,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;qt(o,t,a);const u=t.seen.get(e);u.ref=o},P3=(e,t,r,a)=>{const l=e._zod.def;qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,r.readOnly=!0},oj=(e,t,r,a)=>{const l=e._zod.def;qt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},B3=ie("ZodISODateTime",(e,t)=>{B4.init(e,t),zt.init(e,t)});function $3(e){return VM(B3,e)}const F3=ie("ZodISODate",(e,t)=>{$4.init(e,t),zt.init(e,t)});function q3(e){return QM(F3,e)}const H3=ie("ZodISOTime",(e,t)=>{F4.init(e,t),zt.init(e,t)});function Z3(e){return GM(H3,e)}const V3=ie("ZodISODuration",(e,t)=>{q4.init(e,t),zt.init(e,t)});function Q3(e){return KM(V3,e)}const G3=(e,t)=>{Fk.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>OD(e,r)},flatten:{value:r=>RD(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Tp,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Tp,2)}},isEmpty:{get(){return e.issues.length===0}}})},vr=ie("ZodError",G3,{Parent:Error}),K3=kg(vr),Y3=jg(vr),X3=Id(vr),J3=Pd(vr),W3=LD(vr),e5=UD(vr),t5=ID(vr),n5=PD(vr),r5=BD(vr),i5=$D(vr),a5=FD(vr),l5=qD(vr),Tt=ie("ZodType",(e,t)=>(At.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:gd(e,"input"),output:gd(e,"output")}}),e.toJSONSchema=y3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ka(t,{checks:[...t.checks??[],...r.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(r,a)=>ja(e,r,a),e.brand=()=>e,e.register=((r,a)=>(r.add(e,a),e)),e.parse=(r,a)=>K3(e,r,a,{callee:e.parse}),e.safeParse=(r,a)=>X3(e,r,a),e.parseAsync=async(r,a)=>Y3(e,r,a,{callee:e.parseAsync}),e.safeParseAsync=async(r,a)=>J3(e,r,a),e.spa=e.safeParseAsync,e.encode=(r,a)=>W3(e,r,a),e.decode=(r,a)=>e5(e,r,a),e.encodeAsync=async(r,a)=>t5(e,r,a),e.decodeAsync=async(r,a)=>n5(e,r,a),e.safeEncode=(r,a)=>r5(e,r,a),e.safeDecode=(r,a)=>i5(e,r,a),e.safeEncodeAsync=async(r,a)=>a5(e,r,a),e.safeDecodeAsync=async(r,a)=>l5(e,r,a),e.refine=(r,a)=>e.check(W5(r,a)),e.superRefine=r=>e.check(e6(r)),e.overwrite=r=>e.check(Is(r)),e.optional=()=>h1(e),e.exactOptional=()=>B5(e),e.nullable=()=>m1(e),e.nullish=()=>h1(m1(e)),e.nonoptional=r=>V5(e,r),e.array=()=>Xn(e),e.or=r=>dj([e,r]),e.and=r=>D5(e,r),e.transform=r=>p1(e,I5(r)),e.default=r=>q5(e,r),e.prefault=r=>Z5(e,r),e.catch=r=>G5(e,r),e.pipe=r=>p1(e,r),e.readonly=()=>X5(e),e.describe=r=>{const a=e.clone();return Ho.add(a,{description:r}),a},Object.defineProperty(e,"description",{get(){var r;return(r=Ho.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ho.get(e);const a=e.clone();return Ho.add(a,r[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),uj=ie("_ZodString",(e,t)=>{Eg.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>x3(e,a,l);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...a)=>e.check(n3(...a)),e.includes=(...a)=>e.check(a3(...a)),e.startsWith=(...a)=>e.check(l3(...a)),e.endsWith=(...a)=>e.check(s3(...a)),e.min=(...a)=>e.check(pd(...a)),e.max=(...a)=>e.check(rj(...a)),e.length=(...a)=>e.check(ij(...a)),e.nonempty=(...a)=>e.check(pd(1,...a)),e.lowercase=a=>e.check(r3(a)),e.uppercase=a=>e.check(i3(a)),e.trim=()=>e.check(u3()),e.normalize=(...a)=>e.check(o3(...a)),e.toLowerCase=()=>e.check(c3()),e.toUpperCase=()=>e.check(d3()),e.slugify=()=>e.check(f3())}),s5=ie("ZodString",(e,t)=>{Eg.init(e,t),uj.init(e,t),e.email=r=>e.check(EM(o5,r)),e.url=r=>e.check(TM(u5,r)),e.jwt=r=>e.check(ZM(j5,r)),e.emoji=r=>e.check(zM(c5,r)),e.guid=r=>e.check(s1(d1,r)),e.uuid=r=>e.check(CM(Gc,r)),e.uuidv4=r=>e.check(NM(Gc,r)),e.uuidv6=r=>e.check(_M(Gc,r)),e.uuidv7=r=>e.check(AM(Gc,r)),e.nanoid=r=>e.check(RM(d5,r)),e.guid=r=>e.check(s1(d1,r)),e.cuid=r=>e.check(OM(f5,r)),e.cuid2=r=>e.check(DM(h5,r)),e.ulid=r=>e.check(MM(m5,r)),e.base64=r=>e.check(FM(S5,r)),e.base64url=r=>e.check(qM(w5,r)),e.xid=r=>e.check(LM(p5,r)),e.ksuid=r=>e.check(UM(g5,r)),e.ipv4=r=>e.check(IM(y5,r)),e.ipv6=r=>e.check(PM(v5,r)),e.cidrv4=r=>e.check(BM(x5,r)),e.cidrv6=r=>e.check($M(b5,r)),e.e164=r=>e.check(HM(k5,r)),e.datetime=r=>e.check($3(r)),e.date=r=>e.check(q3(r)),e.time=r=>e.check(Z3(r)),e.duration=r=>e.check(Q3(r))});function D(e){return jM(s5,e)}const zt=ie("ZodStringFormat",(e,t)=>{_t.init(e,t),uj.init(e,t)}),o5=ie("ZodEmail",(e,t)=>{z4.init(e,t),zt.init(e,t)}),d1=ie("ZodGUID",(e,t)=>{A4.init(e,t),zt.init(e,t)}),Gc=ie("ZodUUID",(e,t)=>{T4.init(e,t),zt.init(e,t)}),u5=ie("ZodURL",(e,t)=>{R4.init(e,t),zt.init(e,t)}),c5=ie("ZodEmoji",(e,t)=>{O4.init(e,t),zt.init(e,t)}),d5=ie("ZodNanoID",(e,t)=>{D4.init(e,t),zt.init(e,t)}),f5=ie("ZodCUID",(e,t)=>{M4.init(e,t),zt.init(e,t)}),h5=ie("ZodCUID2",(e,t)=>{L4.init(e,t),zt.init(e,t)}),m5=ie("ZodULID",(e,t)=>{U4.init(e,t),zt.init(e,t)}),p5=ie("ZodXID",(e,t)=>{I4.init(e,t),zt.init(e,t)}),g5=ie("ZodKSUID",(e,t)=>{P4.init(e,t),zt.init(e,t)}),y5=ie("ZodIPv4",(e,t)=>{H4.init(e,t),zt.init(e,t)}),v5=ie("ZodIPv6",(e,t)=>{Z4.init(e,t),zt.init(e,t)}),x5=ie("ZodCIDRv4",(e,t)=>{V4.init(e,t),zt.init(e,t)}),b5=ie("ZodCIDRv6",(e,t)=>{Q4.init(e,t),zt.init(e,t)}),S5=ie("ZodBase64",(e,t)=>{G4.init(e,t),zt.init(e,t)}),w5=ie("ZodBase64URL",(e,t)=>{Y4.init(e,t),zt.init(e,t)}),k5=ie("ZodE164",(e,t)=>{X4.init(e,t),zt.init(e,t)}),j5=ie("ZodJWT",(e,t)=>{W4.init(e,t),zt.init(e,t)}),Cg=ie("ZodNumber",(e,t)=>{Jk.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>b3(e,a,l),e.gt=(a,l)=>e.check(u1(a,l)),e.gte=(a,l)=>e.check(zm(a,l)),e.min=(a,l)=>e.check(zm(a,l)),e.lt=(a,l)=>e.check(o1(a,l)),e.lte=(a,l)=>e.check(Tm(a,l)),e.max=(a,l)=>e.check(Tm(a,l)),e.int=a=>e.check(f1(a)),e.safe=a=>e.check(f1(a)),e.positive=a=>e.check(u1(0,a)),e.nonnegative=a=>e.check(zm(0,a)),e.negative=a=>e.check(o1(0,a)),e.nonpositive=a=>e.check(Tm(0,a)),e.multipleOf=(a,l)=>e.check(c1(a,l)),e.step=(a,l)=>e.check(c1(a,l)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function We(e){return YM(Cg,e)}const E5=ie("ZodNumberFormat",(e,t)=>{eM.init(e,t),Cg.init(e,t)});function f1(e){return JM(E5,e)}const C5=ie("ZodBoolean",(e,t)=>{tM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>S3(e,r,a)});function gu(e){return WM(C5,e)}const N5=ie("ZodUnknown",(e,t)=>{nM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>k3()});function St(){return e3(N5)}const _5=ie("ZodNever",(e,t)=>{rM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>w3(e,r,a)});function A5(e){return t3(_5,e)}const T5=ie("ZodArray",(e,t)=>{iM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>_3(e,r,a,l),e.element=t.element,e.min=(r,a)=>e.check(pd(r,a)),e.nonempty=r=>e.check(pd(1,r)),e.max=(r,a)=>e.check(rj(r,a)),e.length=(r,a)=>e.check(ij(r,a)),e.unwrap=()=>e.element});function Xn(e,t){return h3(T5,e,t)}const z5=ie("ZodObject",(e,t)=>{lM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>A3(e,r,a,l),st(e,"shape",()=>t.shape),e.keyof=()=>tt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),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:A5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ND(e,r),e.safeExtend=r=>_D(e,r),e.merge=r=>AD(e,r),e.pick=r=>ED(e,r),e.omit=r=>CD(e,r),e.partial=(...r)=>TD(hj,e,r[0]),e.required=(...r)=>zD(mj,e,r[0])});function de(e,t){const r={type:"object",shape:e??{},...Ne(t)};return new z5(r)}const cj=ie("ZodUnion",(e,t)=>{tj.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>T3(e,r,a,l),e.options=t.options});function dj(e,t){return new cj({type:"union",options:e,...Ne(t)})}const R5=ie("ZodDiscriminatedUnion",(e,t)=>{cj.init(e,t),sM.init(e,t)});function fj(e,t,r){return new R5({type:"union",options:t,discriminator:e,...Ne(r)})}const O5=ie("ZodIntersection",(e,t)=>{oM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>z3(e,r,a,l)});function D5(e,t){return new O5({type:"intersection",left:e,right:t})}const M5=ie("ZodRecord",(e,t)=>{uM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>R3(e,r,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ht(e,t,r){return new M5({type:"record",keyType:e,valueType:t,...Ne(r)})}const Rp=ie("ZodEnum",(e,t)=>{cM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>j3(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const u of a)if(r.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Rp({...t,checks:[],...Ne(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(r.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new Rp({...t,checks:[],...Ne(l),entries:o})}});function tt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Rp({type:"enum",entries:r,...Ne(t)})}const L5=ie("ZodLiteral",(e,t)=>{dM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>E3(e,r,a),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 Mn(e,t){return new L5({type:"literal",values:Array.isArray(e)?e:[e],...Ne(t)})}const U5=ie("ZodTransform",(e,t)=>{fM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>N3(e,r),e._zod.parse=(r,a)=>{if(a.direction==="backward")throw new Lk(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(ru(o,r.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(ru(u))}};const l=t.transform(r.value,r);return l instanceof Promise?l.then(o=>(r.value=o,r)):(r.value=l,r)}});function I5(e){return new U5({type:"transform",transform:e})}const hj=ie("ZodOptional",(e,t)=>{nj.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>oj(e,r,a,l),e.unwrap=()=>e._zod.def.innerType});function h1(e){return new hj({type:"optional",innerType:e})}const P5=ie("ZodExactOptional",(e,t)=>{hM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>oj(e,r,a,l),e.unwrap=()=>e._zod.def.innerType});function B5(e){return new P5({type:"optional",innerType:e})}const $5=ie("ZodNullable",(e,t)=>{mM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>O3(e,r,a,l),e.unwrap=()=>e._zod.def.innerType});function m1(e){return new $5({type:"nullable",innerType:e})}const F5=ie("ZodDefault",(e,t)=>{pM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>M3(e,r,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function q5(e,t){return new F5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Bk(t)}})}const H5=ie("ZodPrefault",(e,t)=>{gM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>L3(e,r,a,l),e.unwrap=()=>e._zod.def.innerType});function Z5(e,t){return new H5({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Bk(t)}})}const mj=ie("ZodNonOptional",(e,t)=>{yM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>D3(e,r,a,l),e.unwrap=()=>e._zod.def.innerType});function V5(e,t){return new mj({type:"nonoptional",innerType:e,...Ne(t)})}const Q5=ie("ZodCatch",(e,t)=>{vM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>U3(e,r,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G5(e,t){return new Q5({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const K5=ie("ZodPipe",(e,t)=>{xM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>I3(e,r,a,l),e.in=t.in,e.out=t.out});function p1(e,t){return new K5({type:"pipe",in:e,out:t})}const Y5=ie("ZodReadonly",(e,t)=>{bM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>P3(e,r,a,l),e.unwrap=()=>e._zod.def.innerType});function X5(e){return new Y5({type:"readonly",innerType:e})}const J5=ie("ZodCustom",(e,t)=>{SM.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(r,a,l)=>C3(e,r)});function W5(e,t={}){return m3(J5,e,t)}function e6(e){return p3(e)}const Rm={custom:"custom"};function $d(e){return XM(Cg,e)}const t6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},pj=tt(["feishu","slack","kael"]),gj=tt(["active","inactive"]);de({platform:pj,agentId:D().min(1),credentials:Ht(D(),St()),status:gj.default("active")});de({agentId:D().min(1).optional(),credentials:Ht(D(),St()).optional(),status:gj.optional()});de({id:We(),platform:D(),agentId:D(),hasCredentials:gu(),status:D(),createdAt:D(),updatedAt:D()});const n6=tt(["code","reverse_token","oauth","manual"]);de({appId:D().min(1),appSecret:D().min(1)});de({platform:pj,externalUserId:D().min(1),agentId:D().min(1),boundVia:n6.default("manual"),displayName:D().max(200).optional()});de({id:We(),platform:D(),externalUserId:D(),agentId:D(),boundVia:D().nullable(),displayName:D().nullable(),createdAt:D()});de({feishuUserId:D().min(1),displayName:D().max(200).optional()});de({configId:We(),platform:D(),agentId:D(),appId:D(),connected:gu(),lastActiveAt:D().nullable()});const yj=tt(["online","offline"]),vj=tt(["idle","working","blocked","error"]);tt(["active","suspended","evicted"]);const r6=tt(["active","suspended"]);de({chatId:D().min(1),state:r6});de({runtimeState:vj});de({agentId:D().min(1),runtimeType:D().max(50),runtimeVersion:D().max(50).optional()});tt(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);de({agentId:D(),status:yj,connectedAt:D().nullable(),lastSeenAt:D(),clientId:D().nullable().optional(),runtimeType:D().nullable().optional(),runtimeVersion:D().nullable().optional(),runtimeState:vj.nullable().optional(),activeSessions:We().int().nullable().optional(),totalSessions:We().int().nullable().optional(),runtimeUpdatedAt:D().nullable().optional()});de({total:We().int(),running:We().int(),byState:de({idle:We().int(),working:We().int(),blocked:We().int(),error:We().int()}),clients:We().int()});const i6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Fd=tt(["human","personal_assistant","autonomous_agent"]),g1={PRIVATE:"private",ORGANIZATION:"organization"},Ng=tt(["private","organization"]),a6=tt(["admin-api","portal"]);tt(["active","suspended"]);de({name:D().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Fd,displayName:D().max(200).optional(),delegateMention:D().max(100).optional(),organizationId:D().max(100).optional(),source:a6.optional(),visibility:Ng.optional(),metadata:Ht(D(),St()).optional(),managerId:D().optional(),clientId:D().min(1).max(100).optional()});de({type:Fd.optional(),displayName:D().max(200).nullable().optional(),delegateMention:D().max(100).nullable().optional(),visibility:Ng.optional(),metadata:Ht(D(),St()).optional(),managerId:D().nullable().optional(),clientId:D().min(1).max(100).nullable().optional()});de({uuid:D(),name:D().nullable(),organizationId:D(),type:Fd,displayName:D().nullable(),delegateMention:D().nullable(),inboxId:D(),status:D(),source:D().nullable().optional(),cloudUserId:D().nullable().optional(),visibility:Ng,metadata:Ht(D(),St()),managerId:D().nullable(),clientId:D().nullable(),presenceStatus:yj.optional(),createdAt:D(),updatedAt:D()});de({repo:D().nullable(),branch:D().nullable()});de({type:Mn("agent:pinned"),agentId:D(),name:D().nullable(),displayName:D().nullable(),agentType:Fd});const l6=32e3,_g=/^[a-z0-9][a-z0-9_-]{0,63}$/i,s6=/^[A-Z][A-Z0-9_]*$/,o6=de({append:D().max(l6).default("")}),u6=de({name:D().regex(_g,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Mn("stdio"),command:D().min(1),args:Xn(D()).optional()}),c6=de({name:D().regex(_g,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Mn("http"),url:D().url(),headers:Ht(D(),D()).optional()}),d6=de({name:D().regex(_g,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Mn("sse"),url:D().url(),headers:Ht(D(),D()).optional()}),f6=fj("transport",[u6,c6,d6]),h6=de({key:D().regex(s6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:D(),sensitive:gu().default(!1)}),m6=de({url:D().min(1),ref:D().min(1).optional(),localPath:D().min(1).optional()}),Ag=de({prompt:o6.default({append:""}),model:D().default(""),mcpServers:Xn(f6).default([]),env:Xn(h6).default([]),gitRepos:Xn(m6).default([])}),p6=(e,t)=>{const r=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();r.has(f)&&t.addIssue({code:Rm.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),r.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:Rm.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??yd(o.url);f&&(l.has(f)&&t.addIssue({code:Rm.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},xj=Ag.superRefine(p6),g6=de({agentId:D(),version:We().int().positive(),payload:xj,updatedAt:D(),updatedBy:D()});de({expectedVersion:We().int().positive(),payload:Ag.partial()});de({payload:Ag.partial()});de({current:g6,next:xj,diff:Xn(de({path:D(),op:tt(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const Op="***";function yd(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:D().min(1),password:D().min(1)});de({accessToken:D(),refreshToken:D()});de({refreshToken:D().min(1)});de({token:D().min(1)});de({token:D(),expiresIn:We(),command:D()});const y6=tt(["direct","group","thread"]);de({type:y6,topic:D().max(500).optional(),participantIds:Xn(D()).min(1),metadata:Ht(D(),St()).optional()});const v6=de({agentId:D(),role:D(),mode:D(),joinedAt:D()}),x6=de({id:D(),organizationId:D(),type:D(),topic:D().nullable(),lifecyclePolicy:D().nullable().optional(),metadata:Ht(D(),St()),createdAt:D(),updatedAt:D()});x6.extend({participants:Xn(v6)});de({topic:D().trim().max(500).nullable()});de({agentId:D().min(1),mode:tt(["full","mention_only"]).default("full")});de({agentId:D().min(1)});const b6=tt(["connected","disconnected"]);de({id:D(),userId:D().nullable(),status:b6,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:Ht(D(),St()).nullable()});de({clientId:D().min(1).max(100),hostname:D().max(100).optional(),os:D().max(50).optional(),sdkVersion:D().max(50).optional()});de({limit:$d().int().min(1).max(100).default(20),cursor:D().optional()});const Tg=tt(["hub_ui","cli","feishu","github","api"]),bj=tt(["text","markdown","card","reference","file","task"]);de({format:bj.default("text"),content:St(),metadata:Ht(D(),St()).optional(),inReplyTo:D().optional(),replyToInbox:D().optional(),replyToChat:D().optional(),source:Tg.optional()});de({format:bj.default("text"),content:St(),metadata:Ht(D(),St()).optional(),replyToInbox:D().optional(),replyToChat:D().optional(),source:Tg.optional()});const S6=de({id:D(),chatId:D(),senderId:D(),format:D(),content:St(),metadata:Ht(D(),St()),replyToInbox:D().nullable(),replyToChat:D().nullable(),inReplyTo:D().nullable(),source:Tg.nullable(),createdAt:D()}),w6=S6.extend({configVersion:We().int().positive()});tt(["pending","delivered","acked","failed"]);const k6=de({id:We(),inboxId:D(),messageId:D(),chatId:D().nullable(),status:D(),retryCount:We(),createdAt:D(),deliveredAt:D().nullable(),ackedAt:D().nullable()});k6.extend({message:w6});de({limit:$d().int().min(1).max(50).default(10)});const j6={ADMIN:"admin",MEMBER:"member"},zg=tt(["admin","member"]),E6=de({id:D(),userId:D(),organizationId:D(),agentId:D(),role:zg,createdAt:D()});de({username:D().min(1).max(100),displayName:D().min(1).max(200),role:zg.default("member")});de({role:zg.optional(),displayName:D().min(1).max(200).optional()});E6.extend({username:D(),displayName:D(),password:D()});const C6=tt(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),Sj=tt(["high","medium","low"]);de({id:D(),organizationId:D(),type:C6,severity:Sj,agentId:D().nullable(),chatId:D().nullable(),message:D(),read:gu(),createdAt:D()});de({limit:$d().int().min(1).max(100).default(20),cursor:D().optional(),severity:Sj.optional(),read:tt(["true","false"]).transform(e=>e==="true").optional(),agentId:D().optional()});const wj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({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=>!wj.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:Ht(D(),St()).default({})});de({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=>!wj.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:Ht(D(),St()).optional()});de({id:D(),name:D(),displayName:D(),maxAgents:We(),maxMessagesPerMinute:We(),features:Ht(D(),St()),createdAt:D(),updatedAt:D()});const N6=de({workingCount:We().int().nonnegative(),errorMask:gu()}),_6=de({type:Mn("pulse:tick"),organizationId:D(),agents:Ht(D(),Xn(N6).length(32))}),A6=tt(["tool_call","error","assistant_text","thinking","turn_end"]),kj=de({toolUseId:D(),name:D(),args:St(),status:tt(["pending","ok","error"]),durationMs:We().int().nonnegative().optional(),resultPreview:D().max(400).optional()}),jj=de({source:tt(["sdk","runtime","tool"]),message:D().max(2e3)}),Ej=de({text:D().max(8e3)}),Cj=de({}),Nj=de({status:tt(["success","error"])}),T6=fj("kind",[de({kind:Mn("tool_call"),payload:kj}),de({kind:Mn("error"),payload:jj}),de({kind:Mn("assistant_text"),payload:Ej}),de({kind:Mn("thinking"),payload:Cj}),de({kind:Mn("turn_end"),payload:Nj})]);de({id:D(),agentId:D(),chatId:D(),seq:We().int().positive(),kind:A6,payload:dj([kj,jj,Ej,Cj,Nj]),createdAt:D()});de({agentId:D(),chatId:D(),event:T6});de({agentId:D(),chatId:D()});de({type:Mn("session:reconcile"),agentId:D().min(1),chatIds:Xn(D().min(1)).max(500)});de({type:Mn("session:reconcile:result"),agentId:D().min(1),staleChatIds:Xn(D().min(1))});const z6=de({organizationId:D(),agentCount:We(),chatCount:We(),messageCount:We()});de({totalAgents:We(),totalChats:We(),totalMessages:We(),byOrganization:Xn(z6)});de({key:D(),value:St(),updatedAt:D()});Ht(D(),St());const bi={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Om={[bi.INBOX_TIMEOUT_SECONDS]:300,[bi.MAX_RETRY_COUNT]:3,[bi.POLLING_INTERVAL_SECONDS]:5,[bi.PRESENCE_CLEANUP_SECONDS]:60},iu=tt(["pending","assigned","working","completed","failed","cancelled"]),y1=tt(["agent","admin"]),R6=tt(["assigned","status_changed","cancelled"]);de({taskId:D(),event:R6,title:D(),body:D().default(""),status:iu,fromStatus:iu.optional(),originRef:D().nullable().optional()});const O6=de({title:D().min(1).max(500),body:D().optional(),assigneeAgentId:D().optional(),originRef:D().max(500).optional(),metadata:Ht(D(),St()).optional()});O6.extend({organizationId:D().optional()});de({status:tt(["working","completed","failed"]),result:D().optional()});de({assigneeAgentId:D().nullable().optional(),status:iu.optional(),result:D().optional()});de({chatId:D().min(1)});const D6=de({id:D(),organizationId:D(),title:D(),body:D(),status:iu,assigneeAgentId:D().nullable(),createdByType:y1,createdById:D(),originRef:D().nullable(),result:D().nullable(),metadata:Ht(D(),St()),createdAt:D(),updatedAt:D(),cancelledAt:D().nullable(),cancelledByType:y1.nullable(),cancelledById:D().nullable()}),M6=de({taskId:D(),chatId:D(),linkedByAgentId:D().nullable(),linkedAt:D()});D6.extend({chats:Xn(M6)});de({status:iu.optional(),assigneeAgentId:D().optional(),originRef:D().optional(),limit:$d().int().min(1).max(100).default(20),cursor:D().optional()});const L6=tt(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:D(),signal:L6,reason:D()});const U6=tt(["active","suspended"]);de({id:D(),username:D(),displayName:D(),avatarUrl:D().nullable(),status:U6,createdAt:D(),updatedAt:D()});de({username:D().min(1).max(100),displayName:D().min(1).max(200),password:D().min(8).max(200)});de({displayName:D().min(1).max(200).optional(),password:D().min(8).max(200).optional()});de({type:Mn("auth"),token:D().min(1)});de({type:Mn("server:welcome"),serverCommandVersion:D().min(1),serverTimeMs:We().int().nonnegative()}).passthrough();const _j=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function I6(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const r of Object.values(e))for(let a=0;a<32&&a<r.length;a++){const l=r[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const P6=2e3,B6=3e4;let ia=null,vd=!1,Dm=0,Vo=null;const Dp=new Set;let Zo=null,fs=0;function $6(e){for(const t of Dp)try{t(e)}catch{}Zo&&(e.type==="notification"?Zo.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(Zo.invalidateQueries({queryKey:["activity"]}),Zo.invalidateQueries({queryKey:["sessions"]})))}function Aj(){const e=Nd();if(!(e!=null&&e.accessToken))return;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,a=new WebSocket(r);ia=a,a.onmessage=l=>{if(a===ia)try{const o=JSON.parse(l.data);$6(o)}catch{}},a.onopen=()=>{a===ia&&(Dm=0)},a.onclose=()=>{if(a!==ia||(ia=null,vd||fs===0))return;Dm++;const l=Math.min(P6*2**(Dm-1),B6);Vo=setTimeout(()=>{Vo=null,!vd&&fs>0&&Aj()},l)}}function F6(){vd=!0,Vo&&(clearTimeout(Vo),Vo=null),ia&&(ia.close(1e3,"unmount"),ia=null)}function Tj(e){const{onMessage:t,enabled:r=!0}=e??{},a=er(),l=S.useRef(t);l.current=t,S.useEffect(()=>{Zo=a},[a]),S.useEffect(()=>{if(!r)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Dp.add(o),fs++,fs===1&&(vd=!1,Aj()),()=>{Dp.delete(o),fs--,fs===0&&F6()}},[r])}const zj=S.createContext({aggregated:_j,agents:{},receivedAtMs:null,stale:!0});function q6({children:e}){const[t,r]=S.useState({aggregated:_j,agents:{},receivedAtMs:null}),[a,l]=S.useState(()=>Date.now());Tj({onMessage:u=>{const f=_6.safeParse(u);f.success&&r({aggregated:I6(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||a-t.receivedAtMs>3e4}),[t,a]);return d.jsx(zj.Provider,{value:o,children:e})}function H6(){return S.useContext(zj)}const v1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,x1=vw,Rj=(e,t)=>r=>{var a;if((t==null?void 0:t.variants)==null)return x1(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const v=r==null?void 0:r[h],y=o==null?void 0:o[h];if(v===null)return null;const x=v1(v)||v1(y);return l[h][x]}),f=r&&Object.entries(r).reduce((h,v)=>{let[y,x]=v;return x===void 0||(h[y]=x),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,v)=>{let{class:y,className:x,...b}=v;return Object.entries(b).every(k=>{let[j,N]=k;return Array.isArray(N)?N.includes({...o,...f}[j]):{...o,...f}[j]===N})?[...h,y,x]:h},[]);return x1(e,u,m,r==null?void 0:r.class,r==null?void 0:r.className)},Z6=Rj("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive/10 text-destructive",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Gt({className:e,variant:t,...r}){return d.jsx("div",{className:Re(Z6({variant:t}),e),...r})}const qr=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{ref:r,className:Re("w-full caption-bottom text-sm",e),...t})}));qr.displayName="Table";const Hr=S.forwardRef(({className:e,...t},r)=>d.jsx("thead",{ref:r,className:Re("[&_tr]:border-b",e),...t}));Hr.displayName="TableHeader";const Zr=S.forwardRef(({className:e,...t},r)=>d.jsx("tbody",{ref:r,className:Re("[&_tr:last-child]:border-0",e),...t}));Zr.displayName="TableBody";const at=S.forwardRef(({className:e,...t},r)=>d.jsx("tr",{ref:r,className:Re("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));at.displayName="TableRow";const Ee=S.forwardRef(({className:e,...t},r)=>d.jsx("th",{ref:r,className:Re("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ee.displayName="TableHead";const xe=S.forwardRef(({className:e,...t},r)=>d.jsx("td",{ref:r,className:Re("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));xe.displayName="TableCell";function Rg(){return Me.get("/members")}function V6(e){return Me.post("/members",e)}function Q6(e,t){return Me.patch(`/members/${encodeURIComponent(e)}`,t)}function G6(e){return Me.delete(`/members/${encodeURIComponent(e)}`)}function Og(){const{data:e}=qe({queryKey:["members","name-map"],queryFn:Rg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const r of e)t.set(r.id,r.displayName||r.username);return r=>r?t.get(r)??r:"—"},[e])}function K6(){const e=Vr(),t=Og(),{data:r,isLoading:a,error:l}=qe({queryKey:["admin-all-agents"],queryFn:()=>rD({limit:100})});return d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Every agent in the organization, including private agents owned by other members. Use this view to troubleshoot or reassign — the regular Agents page still hides private agents you don't manage."}),d.jsx("div",{className:"border rounded-lg",children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Name"}),d.jsx(Ee,{children:"Display Name"}),d.jsx(Ee,{children:"Type"}),d.jsx(Ee,{children:"Visibility"}),d.jsx(Ee,{children:"Owner"}),d.jsx(Ee,{children:"Status"}),d.jsx(Ee,{children:"Created"})]})}),d.jsx(Zr,{children:a?d.jsx(at,{children:d.jsx(xe,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"Loading..."})}):l?d.jsx(at,{children:d.jsxs(xe,{colSpan:7,className:"text-center py-8 text-destructive",children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]})}):!r||r.items.length===0?d.jsx(at,{children:d.jsx(xe,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"No agents"})}):r.items.map(o=>d.jsxs(at,{className:"cursor-pointer",onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(xe,{className:"font-mono text-sm",children:o.name??o.uuid.slice(0,8)}),d.jsx(xe,{children:o.displayName??"—"}),d.jsx(xe,{children:d.jsx(Gt,{variant:"secondary",children:o.type})}),d.jsx(xe,{children:d.jsx(Gt,{variant:o.visibility==="organization"?"default":"outline",children:o.visibility})}),d.jsx(xe,{className:"text-sm",children:o.managerId?t(o.managerId):"—"}),d.jsx(xe,{children:d.jsx(Gt,{variant:o.status==="active"?"default":"secondary",children:o.status})}),d.jsx(xe,{className:"text-muted-foreground text-sm",children:Cr(o.createdAt)})]},o.uuid))})]})})]})}const Y6=Rj("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm 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-white 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 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),be=S.forwardRef(({className:e,variant:t,size:r,asChild:a=!1,...l},o)=>{const u=a?zO:"button";return d.jsx(u,{className:Re(Y6({variant:t,size:r,className:e})),ref:o,...l})});be.displayName="Button";const gt=S.forwardRef(({className:e,type:t,...r},a)=>d.jsx("input",{type:t,className:Re("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));gt.displayName="Input";var X6="Label",Oj=S.forwardRef((e,t)=>d.jsx(Ei.label,{...e,ref:t,onMouseDown:r=>{var l;r.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Oj.displayName=X6;var J6=Oj;const Ye=S.forwardRef(({className:e,...t},r)=>d.jsx(J6,{ref:r,className:Re("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Ye.displayName="Label";const Dj=Object.values(j6);function W6(){const e=er(),[t,r]=S.useState(!1),[a,l]=S.useState({username:"",displayName:"",role:"member"}),[o,u]=S.useState(null),[f,m]=S.useState(null),{data:h,isLoading:v,error:y}=qe({queryKey:["members"],queryFn:Rg}),x=vt({mutationFn:()=>V6({username:a.username,displayName:a.displayName,role:a.role}),onSuccess:E=>{e.invalidateQueries({queryKey:["members"]}),u(E.password)}}),b=vt({mutationFn:G6,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function k(){r(!1),l({username:"",displayName:"",role:"member"}),u(null)}function j(E){E.preventDefault(),x.mutate()}function N(E){window.confirm("Delete this member? Their human agent will also be deactivated.")&&b.mutate(E)}return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsx("h1",{className:"text-2xl font-semibold",children:"Members"}),d.jsxs(Ln,{open:t,onOpenChange:E=>E?r(!0):k(),children:[d.jsx(WO,{asChild:!0,children:d.jsxs(be,{children:[d.jsx(fl,{className:"h-4 w-4 mr-2"}),"Add Member"]})}),d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:o?"Member Created":"Create Member"})}),o?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Member created. Share the password below — it will only be shown once."}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md border p-3 bg-muted",children:[d.jsx("code",{className:"flex-1 text-sm font-mono",children:o}),d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(o),title:"Copy password",children:d.jsx(dg,{className:"h-4 w-4"})})]}),d.jsx(Un,{children:d.jsx(be,{onClick:k,children:"Done"})})]}):d.jsxs("form",{onSubmit:j,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"member-username",children:"Username"}),d.jsx(gt,{id:"member-username",type:"text",value:a.username,onChange:E=>l({...a,username:E.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"member-name",children:"Display Name"}),d.jsx(gt,{id:"member-name",value:a.displayName,onChange:E=>l({...a,displayName:E.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:a.role,onChange:E=>l({...a,role:E.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:Dj.map(E=>d.jsx("option",{value:E,children:E},E))})]}),x.error instanceof Error&&d.jsx("div",{className:"text-sm text-destructive",children:x.error.message}),d.jsx(Un,{children:d.jsx(be,{type:"submit",disabled:x.isPending,children:x.isPending?"Creating...":"Create"})})]})]})]})]}),d.jsx(eL,{target:f,onClose:()=>m(null),onSaved:()=>{m(null),e.invalidateQueries({queryKey:["members"]})}}),d.jsx("div",{className:"border rounded-lg",children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Username"}),d.jsx(Ee,{children:"Name"}),d.jsx(Ee,{children:"Role"}),d.jsx(Ee,{children:"Created"}),d.jsx(Ee,{className:"w-16"})]})}),d.jsx(Zr,{children:v?d.jsx(at,{children:d.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"Loading..."})}):y?d.jsx(at,{children:d.jsxs(xe,{colSpan:5,className:"text-center py-8 text-destructive",children:["Failed to load members: ",y instanceof Error?y.message:"Unknown error"]})}):(h==null?void 0:h.length)===0?d.jsx(at,{children:d.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No members"})}):h==null?void 0:h.map(E=>d.jsxs(at,{children:[d.jsx(xe,{className:"font-medium",children:E.username}),d.jsx(xe,{children:E.displayName}),d.jsx(xe,{children:d.jsx(Gt,{variant:E.role==="admin"?"default":"secondary",children:E.role})}),d.jsx(xe,{className:"text-muted-foreground",children:Cr(E.createdAt)}),d.jsx(xe,{children:d.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>m({id:E.id,username:E.username,displayName:E.displayName,role:E.role}),title:"Edit",children:d.jsx(Ad,{className:"h-4 w-4"})}),d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>N(E.id),disabled:b.isPending,title:"Delete",children:d.jsx(Wo,{className:"h-4 w-4"})})]})})]},E.id))})]})})]})}function eL({target:e,onClose:t,onSaved:r}){const[a,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=vt({mutationFn:async()=>{if(!e)throw new Error("No target");const x={};return a.trim()&&a!==e.displayName&&(x.displayName=a.trim()),o!==e.role&&(x.role=o),Object.keys(x).length===0?e:Q6(e.id,x)},onSuccess:()=>{m(null),r()},onError:x=>{m(x instanceof Error?x.message:String(x))}});function v(x){x.preventDefault(),h.mutate()}const y=e!==null;return d.jsx(Ln,{open:y,onOpenChange:x=>x?void 0:t(),children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:v,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{children:"Username"}),d.jsx(gt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(gt,{id:"edit-member-display",value:a,onChange:x=>l(x.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:x=>u(x.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:Dj.map(x=>d.jsx("option",{value:x,children:x},x))}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&d.jsx("p",{className:"text-sm text-destructive",children:f}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function tL(){return Me.get("/admin/system/config")}function nL(e){return Me.patch("/admin/system/config",e)}const ul=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:Re("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));ul.displayName="Card";const Ts=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:Re("flex flex-col space-y-1.5 p-6",e),...t}));Ts.displayName="CardHeader";const zs=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:Re("font-semibold leading-none tracking-tight",e),...t}));zs.displayName="CardTitle";const Mj=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:Re("text-sm text-muted-foreground",e),...t}));Mj.displayName="CardDescription";const cl=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:Re("p-6 pt-0",e),...t}));cl.displayName="CardContent";const rL=S.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:Re("flex items-center p-6 pt-0",e),...t}));rL.displayName="CardFooter";const iL={[bi.INBOX_TIMEOUT_SECONDS]:"Inbox Timeout (seconds)",[bi.MAX_RETRY_COUNT]:"Max Retry Count",[bi.POLLING_INTERVAL_SECONDS]:"Polling Interval (seconds)",[bi.PRESENCE_CLEANUP_SECONDS]:"Presence Cleanup (seconds)"},b1=Object.values(bi);function aL(){const e=er(),{data:t,isLoading:r}=qe({queryKey:["system-config"],queryFn:tL}),[a,l]=S.useState({}),[o,u]=S.useState(!1);S.useEffect(()=>{if(!t)return;const h={};for(const v of b1){const y=t[v]??Om[v]??"";h[v]=String(y)}l(h)},[t]);const f=vt({mutationFn:()=>{const h={};for(const[v,y]of Object.entries(a)){const x=y.trim();if(x==="")h[v]=Om[v]??0;else{const b=Number(x);h[v]=Number.isNaN(b)?x:b}}return nL(h)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}}),m=h=>{h.preventDefault(),f.mutate()};return r?d.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):d.jsxs(ul,{children:[d.jsx(Ts,{children:d.jsx(zs,{children:"System Configuration"})}),d.jsx(cl,{children:d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[b1.map(h=>d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:h,children:iL[h]??h}),d.jsx(gt,{id:h,value:a[h]??"",onChange:v=>l({...a,[h]:v.target.value})}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",String(Om[h]??"—")]})]},h)),f.error instanceof Error&&d.jsx("div",{className:"text-sm text-destructive",children:f.error.message}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(be,{type:"submit",disabled:f.isPending,children:f.isPending?"Saving...":"Save Changes"}),o&&d.jsx("span",{className:"text-sm text-green-600",children:"Saved!"})]})]})})]})}const S1=[{key:"members",label:"Members"},{key:"all-agents",label:"All Agents"},{key:"settings",label:"Org Settings"}];function lL(){const{role:e}=ba(),t=yr(),r=Vr();if(e===null)return d.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading…"});if(e!=="admin")return d.jsx(ag,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=S1.some(u=>u.key===a)?a:"members",o=u=>{r({hash:u},{replace:!0})};return d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Admin"}),d.jsx("div",{className:"flex gap-1 border-b border-border mb-6",children:S1.map(u=>d.jsx("button",{type:"button",onClick:()=>o(u.key),className:Re("px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",l===u.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u.label},u.key))}),l==="members"&&d.jsx(W6,{}),l==="all-agents"&&d.jsx(K6,{}),l==="settings"&&d.jsx(aL,{})]})}function Lj(){return Me.get("/admin/adapter-mappings")}function sL(e){return Me.post("/admin/adapter-mappings",e)}function oL(e){return Me.delete(`/admin/adapter-mappings/${e}`)}function Uj(){return Me.get("/admin/adapters/status")}function Ij(){return Me.get("/admin/adapters")}function uL(e){return Me.post("/admin/adapters",e)}function cL(e,t){return Me.patch(`/admin/adapters/${e}`,t)}function dL(e){return Me.delete(`/admin/adapters/${e}`)}function fL(e){return Me.get(`/admin/agents/${e}/config`)}function hL(e,t){return Me.patch(`/admin/agents/${e}/config`,t)}function mL(e,t){return Me.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function pL(e){return Me.get(`/admin/agents/${e}/client-status`)}function gL(e){const{agent:t}=e,[r,a]=S.useState(!1),l=t.displayName||t.name||t.uuid;return d.jsxs("section",{className:"rounded-md border border-red-200 bg-red-50/40",children:[d.jsxs("header",{className:"flex items-center gap-2 border-b border-red-200 px-4 py-2",children:[d.jsx(MT,{className:"h-4 w-4 text-red-700"}),d.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Danger Zone"})]}),d.jsxs("div",{className:"divide-y divide-red-200",children:[t.status==="active"?d.jsx(Mm,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(be,{variant:"outline",size:"sm",onClick:e.onSuspend,disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx(Mm,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(be,{variant:"outline",size:"sm",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx(Mm,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(be,{variant:"destructive",size:"sm",onClick:()=>a(!0),disabled:e.deletePending,children:[d.jsx(Wo,{className:"h-3.5 w-3.5 mr-1.5"}),"Delete"]})})]}),d.jsx(yL,{open:r,onOpenChange:a,expected:l,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function Mm(e){return d.jsxs("div",{className:"flex items-start justify-between gap-4 px-4 py-3 text-sm",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium text-red-900",children:e.title}),d.jsx("p",{className:"text-xs text-red-800/80",children:e.body})]}),d.jsx("div",{children:e.action})]})}function yL({open:e,onOpenChange:t,expected:r,onDelete:a,deleting:l}){const[o,u]=S.useState("");function f(m){m.preventDefault(),o===r&&a()}return d.jsx(Ln,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsxs(In,{children:['Delete "',r,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-gray-900",children:r})," ","to confirm."]}),d.jsx(gt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:r,className:"font-mono"}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(be,{type:"submit",variant:"destructive",disabled:o!==r||l,children:l?"Deleting…":"Delete"})]})]})]})})}const vL={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-green-100 text-green-900"},modified:{label:"changed",tone:"bg-amber-100 text-amber-900"},deleted:{label:"will be removed on save",tone:"bg-red-100 text-red-900"}};function Dg({status:e,onEdit:t,onDelete:r,onUndo:a,children:l,disabled:o}){const u=vL[e],f=e==="deleted";return d.jsxs("div",{className:Re("flex items-center gap-2 rounded border px-3 py-2 text-sm",f?"bg-red-50 border-red-200 text-red-900 line-through decoration-red-300":"bg-white"),children:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:Re("text-xs rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(be,{size:"sm",variant:"ghost",onClick:a,children:[d.jsx(UT,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsx(xL,{onEdit:t,onDelete:r}))]})}function xL({onEdit:e,onDelete:t}){return d.jsxs("div",{className:"flex gap-1",children:[d.jsx(be,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),d.jsxs(be,{size:"sm",variant:"ghost",onClick:t,title:"Delete",children:[d.jsx(pw,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function bL(e){const[t,r]=S.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{className:"rounded-md border bg-white",children:[d.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[d.jsxs("h3",{className:"text-sm font-medium",children:["Environment Variables (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[d.jsx(fl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No environment variables."}):e.items.map(l=>d.jsxs(Dg,{status:l.status,onEdit:()=>r({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-xs text-muted-foreground truncate max-w-xs",children:l.value.sensitive?"••••••":l.value.value||d.jsx("em",{children:"(empty)"})}),l.value.sensitive&&d.jsx(dT,{className:"h-3 w-3 text-muted-foreground"})]},l.key))}),t&&d.jsx(SL,{open:!!t,onOpenChange:l=>!l&&r(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),r(null)}})]})}function SL({open:e,onOpenChange:t,initial:r,forbiddenKeys:a,onSubmit:l}){const[o,u]=S.useState((r==null?void 0:r.key)??""),[f,m]=S.useState(r!=null&&r.sensitive?"":(r==null?void 0:r.value)??""),[h,v]=S.useState((r==null?void 0:r.sensitive)??!1),[y,x]=S.useState(null);S.useEffect(()=>{e&&(u((r==null?void 0:r.key)??""),m(r!=null&&r.sensitive?"":(r==null?void 0:r.value)??""),v((r==null?void 0:r.sensitive)??!1),x(null))},[e,r]);function b(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){x("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){x(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(r!=null&&r.sensitive)&&!f&&(j=Op),!h&&!r&&!f){x("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(Ln,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:r?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:b,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"env-key",children:"Key"}),d.jsx(gt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!r}),r&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"env-value",children:"Value"}),d.jsx(gt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:r!=null&&r.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:k=>v(k.target.checked),className:"h-4 w-4",disabled:!!r&&r.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),y&&d.jsx("p",{className:"text-sm text-destructive",children:y}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:r?"Done":"Add"})]})]})]})})}function wL(e){const[t,r]=S.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{className:"rounded-md border bg-white",children:[d.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[d.jsxs("h3",{className:"text-sm font-medium",children:["Git Repositories (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[d.jsx(fl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??yd(l.value.url);return d.jsxs(Dg,{status:l.status,onEdit:()=>r({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-xs",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(kL,{open:!!t,onOpenChange:l=>!l&&r(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),r(null)}})]})}function kL({open:e,onOpenChange:t,initial:r,forbiddenPaths:a,onSubmit:l}){const[o,u]=S.useState((r==null?void 0:r.url)??""),[f,m]=S.useState((r==null?void 0:r.ref)??""),[h,v]=S.useState((r==null?void 0:r.localPath)??""),[y,x]=S.useState(null);S.useEffect(()=>{e&&(u((r==null?void 0:r.url)??""),m((r==null?void 0:r.ref)??""),v((r==null?void 0:r.localPath)??""),x(null))},[e,r]);function b(k){k.preventDefault();const j=o.trim();if(!j){x("URL is required.");return}const N=h.trim()||yd(j);if(N&&a.has(N)){x(`Another repo already occupies local path "${N}".`);return}const E={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(E)}return d.jsx(Ln,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:r?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:b,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"git-url",children:"URL"}),d.jsx(gt,{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(Ye,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(gt,{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(Ye,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(gt,{id:"git-path",value:h,onChange:k=>v(k.target.value),placeholder:yd(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),y&&d.jsx("p",{className:"text-sm text-destructive",children:y}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:r?"Done":"Add"})]})]})]})})}function jL({agent:e,onSave:t}){const[r,a]=S.useState(!1),l=wa(),o=Og(),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(x=>typeof x=="string"):[],v=e.managerId?o(e.managerId):null,y=e.delegateMention?l(e.delegateMention):null;return d.jsxs("section",{className:"rounded-md border bg-white",children:[d.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[d.jsx("h2",{className:"text-sm font-medium",children:"Identity"}),e.status==="active"&&d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>a(!0),children:[d.jsx(Ad,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]})]}),d.jsxs("div",{className:"px-4 py-3 text-sm 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"})}),y&&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:y})]})]})]}),d.jsxs("div",{className:"text-xs 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-gray-900",children:v??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-gray-900",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(Gt,{variant:"secondary",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(Gt,{variant:e.visibility==="organization"?"default":"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(x=>d.jsx(Gt,{variant:"outline",children:x},x))})]})]})]}),d.jsx(EL,{agent:e,open:r,onOpenChange:a,onSave:t})]})}function EL({agent:e,open:t,onOpenChange:r,onSave:a}){var I;const{memberId:l,role:o}=ba(),[u,f]=S.useState(e.displayName??""),[m,h]=S.useState(e.delegateMention??""),[v,y]=S.useState(e.visibility),[x,b]=S.useState(!1),[k,j]=S.useState(null);S.useEffect(()=>{t&&(f(e.displayName??""),h(e.delegateMention??""),y(e.visibility),j(null))},[t,e]);const N=e.type==="human",E=o==="admin"||e.managerId===l,R=qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await xg({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&N});async function A(F){F.preventDefault(),j(null),b(!0);try{const O={displayName:u||null,delegateMention:m||null};v!==e.visibility&&(O.visibility=v),await a(O),r(!1)}catch(O){j(O instanceof Error?O.message:String(O))}finally{b(!1)}}return d.jsx(Ln,{open:t,onOpenChange:r,children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:A,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{children:"Name (mention)"}),d.jsx(gt,{value:e.name??"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Name is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"id-display",children:"Display Name"}),d.jsx(gt,{id:"id-display",value:u,onChange:F=>f(F.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:v,onChange:F=>y(F.target.value),disabled:!E,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm 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:g1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:g1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:E?"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."})]}),N&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:F=>h(F.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"None"}),(I=R.data)==null?void 0:I.map(F=>d.jsx("option",{value:F.uuid,children:F.displayName?`${F.displayName} (${F.name??F.uuid})`:F.name??F.uuid},F.uuid))]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-sm text-destructive",children:k}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>r(!1),disabled:x,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:x,children:x?"Saving…":"Save"})]})]})]})})}function CL(e){const[t,r]=S.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{className:"rounded-md border bg-white",children:[d.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[d.jsxs("h3",{className:"text-sm font-medium",children:["MCP Servers (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[d.jsx(fl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>d.jsxs(Dg,{status:l.status,onEdit:()=>r({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-xs rounded bg-gray-100 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-xs text-muted-foreground truncate",children:NL(l.value)})]},l.key))}),t&&d.jsx(_L,{open:!!t,onOpenChange:l=>!l&&r(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),r(null)}})]})}function NL(e){var t;if(e.transport==="stdio"){const r=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${r}`}return e.url}function _L({open:e,onOpenChange:t,initial:r,forbiddenNames:a,onSubmit:l}){const[o,u]=S.useState((r==null?void 0:r.transport)??"stdio"),[f,m]=S.useState((r==null?void 0:r.name)??""),[h,v]=S.useState((r==null?void 0:r.transport)==="stdio"?r.command:""),[y,x]=S.useState((r==null?void 0:r.transport)==="stdio"&&r.args?r.args.join(" "):""),[b,k]=S.useState(r&&(r.transport==="http"||r.transport==="sse")?r.url:""),[j,N]=S.useState(null);S.useEffect(()=>{e&&(u((r==null?void 0:r.transport)??"stdio"),m((r==null?void 0:r.name)??""),v((r==null?void 0:r.transport)==="stdio"?r.command:""),x((r==null?void 0:r.transport)==="stdio"&&r.args?r.args.join(" "):""),k(r&&(r.transport==="http"||r.transport==="sse")?r.url:""),N(null))},[e,r]);function E(R){if(R.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){N("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){N(`Another MCP server is already named "${f}".`);return}let A;if(o==="stdio"){if(!h.trim()){N("stdio transport requires a command.");return}const I=y.trim().split(/\s+/).filter(F=>F.length>0);A={name:f,transport:"stdio",command:h.trim(),...I.length?{args:I}:{}}}else{const I=b.trim();try{new URL(I)}catch{N("URL is not valid.");return}A={name:f,transport:o,url:I}}l(A)}return d.jsx(Ln,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:r?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:R=>u(R.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm 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(Ye,{htmlFor:"mcp-name",children:"Name"}),d.jsx(gt,{id:"mcp-name",value:f,onChange:R=>m(R.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"mcp-command",children:"Command"}),d.jsx(gt,{id:"mcp-command",value:h,onChange:R=>v(R.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(gt,{id:"mcp-args",value:y,onChange:R=>x(R.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"mcp-url",children:"URL"}),d.jsx(gt,{id:"mcp-url",value:b,onChange:R=>k(R.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-sm text-destructive",children:j}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:r?"Done":"Add"})]})]})]})})}const w1=[{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 AL({value:e,baseline:t,onChange:r,onRevert:a,disabled:l}){const o=e!==t,u=!w1.some(f=>f.value===e)&&e!=="";return d.jsxs("section",{className:`rounded-md border bg-white ${o?"border-amber-300":"border-gray-200"}`,children:[d.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[d.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:["Model",o&&d.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),o&&d.jsx(be,{size:"sm",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>r(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm 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)"}),w1.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-xs text-muted-foreground",children:"Choose which Claude model powers this agent. Applies to new sessions immediately; active sessions switch on their next message."})]})]})}function TL(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const zL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OL={};function k1(e,t){return(OL.jsx?RL:zL).test(e)}const DL=/[ \t\n\f\r]/g;function ML(e){return typeof e=="object"?e.type==="text"?j1(e.value):!1:j1(e)}function j1(e){return e.replace(DL,"")===""}class yu{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}yu.prototype.normal={};yu.prototype.property={};yu.prototype.space=void 0;function Pj(e,t){const r={},a={};for(const l of e)Object.assign(r,l.property),Object.assign(a,l.normal);return new yu(r,a,t)}function Mp(e){return e.toLowerCase()}class $n{constructor(t,r){this.attribute=r,this.property=t}}$n.prototype.attribute="";$n.prototype.booleanish=!1;$n.prototype.boolean=!1;$n.prototype.commaOrSpaceSeparated=!1;$n.prototype.commaSeparated=!1;$n.prototype.defined=!1;$n.prototype.mustUseProperty=!1;$n.prototype.number=!1;$n.prototype.overloadedBoolean=!1;$n.prototype.property="";$n.prototype.spaceSeparated=!1;$n.prototype.space=void 0;let LL=0;const Be=gl(),Ft=gl(),Lp=gl(),fe=gl(),bt=gl(),ps=gl(),Kn=gl();function gl(){return 2**++LL}const Up=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Ft,commaOrSpaceSeparated:Kn,commaSeparated:ps,number:fe,overloadedBoolean:Lp,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Lm=Object.keys(Up);class Mg extends $n{constructor(t,r,a,l){let o=-1;if(super(t,r),E1(this,"space",l),typeof a=="number")for(;++o<Lm.length;){const u=Lm[o];E1(this,Lm[o],(a&Up[u])===Up[u])}}}Mg.prototype.defined=!0;function E1(e,t,r){r&&(e[t]=r)}function Ps(e){const t={},r={};for(const[a,l]of Object.entries(e.properties)){const o=new Mg(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,r[Mp(a)]=a,r[Mp(o.attribute)]=a}return new yu(t,r,e.space)}const Bj=Ps({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:bt,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:fe,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:bt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Ft,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $j(e,t){return t in e?e[t]:t}function Fj(e,t){return $j(e,t.toLowerCase())}const UL=Ps({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ps,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:bt,autoFocus:Be,autoPlay:Be,blocking:bt,capture:null,charSet:null,checked:Be,cite:null,className:bt,cols:fe,colSpan:null,content:null,contentEditable:Ft,controls:Be,controlsList:bt,coords:fe|ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Lp,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:bt,height:fe,hidden:Lp,high:fe,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:bt,itemRef:bt,itemScope:Be,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:fe,pattern:null,ping:bt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:bt,required:Be,reversed:Be,rows:fe,rowSpan:fe,sandbox:bt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Ft,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Be,disableRemotePlayback:Be,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:Fj}),IL=Ps({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:Kn,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:bt,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:ps,g2:ps,glyphName:ps,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$j}),qj=Ps({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()}}),Hj=Ps({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fj}),Zj=Ps({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),PL={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"},BL=/[A-Z]/g,C1=/-[a-z]/g,$L=/^data[-\w.:]+$/i;function FL(e,t){const r=Mp(t);let a=t,l=$n;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&$L.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(C1,HL);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!C1.test(o)){let u=o.replace(BL,qL);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Mg}return new l(a,t)}function qL(e){return"-"+e.toLowerCase()}function HL(e){return e.charAt(1).toUpperCase()}const ZL=Pj([Bj,UL,qj,Hj,Zj],"html"),Lg=Pj([Bj,IL,qj,Hj,Zj],"svg");function VL(e){return e.join(" ").trim()}var as={},Um,N1;function QL(){if(N1)return Um;N1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
333
|
-
`,h="/",v="*",y="",x="comment",b="declaration";function k(N,E){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];E=E||{};var R=1,A=1;function I(ce){var ee=ce.match(t);ee&&(R+=ee.length);var P=ce.lastIndexOf(m);A=~P?ce.length-P:A+ce.length}function F(){var ce={line:R,column:A};return function(ee){return ee.position=new O(ce),J(),ee}}function O(ce){this.start=ce,this.end={line:R,column:A},this.source=E.source}O.prototype.content=N;function $(ce){var ee=new Error(E.source+":"+R+":"+A+": "+ce);if(ee.reason=ce,ee.filename=E.source,ee.line=R,ee.column=A,ee.source=N,!E.silent)throw ee}function V(ce){var ee=ce.exec(N);if(ee){var P=ee[0];return I(P),N=N.slice(P.length),ee}}function J(){V(r)}function q(ce){var ee;for(ce=ce||[];ee=re();)ee!==!1&&ce.push(ee);return ce}function re(){var ce=F();if(!(h!=N.charAt(0)||v!=N.charAt(1))){for(var ee=2;y!=N.charAt(ee)&&(v!=N.charAt(ee)||h!=N.charAt(ee+1));)++ee;if(ee+=2,y===N.charAt(ee-1))return $("End of comment missing");var P=N.slice(2,ee-2);return A+=2,I(P),N=N.slice(ee),A+=2,ce({type:x,comment:P})}}function ae(){var ce=F(),ee=V(a);if(ee){if(re(),!V(l))return $("property missing ':'");var P=V(o),W=ce({type:b,property:j(ee[0].replace(e,y)),value:P?j(P[0].replace(e,y)):y});return V(u),W}}function me(){var ce=[];q(ce);for(var ee;ee=ae();)ee!==!1&&(ce.push(ee),q(ce));return ce}return J(),me()}function j(N){return N?N.replace(f,y):y}return Um=k,Um}var _1;function GL(){if(_1)return as;_1=1;var e=as&&as.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(as,"__esModule",{value:!0}),as.default=r;const t=e(QL());function r(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:v}=m;f?l(h,v,m):v&&(o=o||{},o[h]=v)}),o}return as}var Po={},A1;function KL(){if(A1)return Po;A1=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||r.test(h)||e.test(h)},u=function(h,v){return v.toUpperCase()},f=function(h,v){return"".concat(v,"-")},m=function(h,v){return v===void 0&&(v={}),o(h)?h:(h=h.toLowerCase(),v.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,u))};return Po.camelCase=m,Po}var Bo,T1;function YL(){if(T1)return Bo;T1=1;var e=Bo&&Bo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(GL()),r=KL();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,r.camelCase)(f,o)]=m)}),u}return a.default=a,Bo=a,Bo}var XL=YL();const JL=kd(XL),Vj=Qj("end"),Ug=Qj("start");function Qj(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function WL(e){const t=Ug(e),r=Vj(e);if(t&&r)return{start:t,end:r}}function Qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z1(e.position):"start"in e||"end"in e?z1(e):"line"in e||"column"in e?Ip(e):""}function Ip(e){return R1(e&&e.line)+":"+R1(e&&e.column)}function z1(e){return Ip(e&&e.start)+"-"+Ip(e&&e.end)}function R1(e){return e&&typeof e=="number"?e:1}class hn extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let l="",o={},u=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.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=Qo(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}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const Ig={}.hasOwnProperty,eU=new Map,tU=/[A-Z]/g,nU=new Set(["table","tbody","thead","tfoot","tr"]),rU=new Set(["td","th"]),Gj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function iU(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=fU(r,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");a=dU(r,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lg:ZL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kj(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function Kj(e,t,r){if(t.type==="element")return aU(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return lU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oU(e,t,r);if(t.type==="mdxjsEsm")return sU(e,t);if(t.type==="root")return uU(e,t,r);if(t.type==="text")return cU(e,t)}function aU(e,t,r){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Lg,e.schema=l),e.ancestors.push(t);const o=Xj(e,t.tagName,!1),u=hU(e,t);let f=Bg(e,t);return nU.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!ML(m):!0})),Yj(e,u,o,t),Pg(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,r)}function lU(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}au(e,t.position)}function sU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);au(e,t.position)}function oU(e,t,r){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Lg,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:Xj(e,t.name,!0),u=mU(e,t),f=Bg(e,t);return Yj(e,u,o,t),Pg(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,r)}function uU(e,t,r){const a={};return Pg(a,Bg(e,t)),e.create(t,e.Fragment,a,r)}function cU(e,t){return t.value}function Yj(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function Pg(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function dU(e,t,r){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?r:t;return f?h(o,u,f):h(o,u)}}function fU(e,t){return r;function r(a,l,o,u){const f=Array.isArray(o.children),m=Ug(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function hU(e,t){const r={};let a,l;for(l in t.properties)if(l!=="children"&&Ig.call(t.properties,l)){const o=pU(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&rU.has(t.tagName)?a=f:r[u]=f}}if(a){const o=r.style||(r.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function mU(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else au(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else au(e,t.position);else o=a.value===null?!0:a.value;r[l]=o}return r}function Bg(e,t){const r=[];let a=-1;const l=e.passKeys?new Map:eU;for(;++a<t.children.length;){const o=t.children[a];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=Kj(e,o,u);f!==void 0&&r.push(f)}return r}function pU(e,t,r){const a=FL(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?TL(r):VL(r)),a.property==="style"){let l=typeof r=="object"?r:gU(e,String(r));return e.stylePropertyNameCase==="css"&&(l=yU(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?PL[a.property]||a.property:a.attribute,r]}}function gU(e,t){try{return JL(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,l=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=Gj+"#cannot-parse-style-attribute",l}}function Xj(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=k1(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}a=u}else a=k1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Ig.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);au(e)}function au(e,t){const r=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Gj+"#cannot-handle-mdx-estrees-without-createevaluater",r}function yU(e){const t={};let r;for(r in e)Ig.call(e,r)&&(t[vU(r)]=e[r]);return t}function vU(e){let t=e.replace(tU,xU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function xU(e){return"-"+e.toLowerCase()}const Im={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 $g(e,t){const r=bU,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Jj(e,a,l)}function Jj(e,t,r){if(SU(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return O1(e.children,t,r)}return Array.isArray(e)?O1(e,t,r):""}function O1(e,t,r){const a=[];let l=-1;for(;++l<e.length;)a[l]=Jj(e[l],t,r);return a.join("")}function SU(e){return!!(e&&typeof e=="object")}const D1=document.createElement("i");function Fg(e){const t="&"+e+";";D1.innerHTML=t;const r=D1.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Jn(e,t,r,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,r=r>0?r:0,a.length<1e4)u=Array.from(a),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function mr(e,t){return e.length>0?(Jn(e,e.length,0,t),e):t}const M1={}.hasOwnProperty;function Wj(e){const t={};let r=-1;for(;++r<e.length;)wU(t,e[r]);return t}function wU(e,t){let r;for(r in t){const l=(M1.call(e,r)?e[r]:void 0)||(e[r]={}),o=t[r];let u;if(o)for(u in o){M1.call(l,u)||(l[u]=[]);const f=o[u];kU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function kU(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);Jn(e,0,0,a)}function eE(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Er(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=Ea(/[A-Za-z]/),fn=Ea(/[\dA-Za-z]/),jU=Ea(/[#-'*+\--9=?A-Z^-~]/);function xd(e){return e!==null&&(e<32||e===127)}const Pp=Ea(/\d/),EU=Ea(/[\dA-Fa-f]/),CU=Ea(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const qd=Ea(new RegExp("\\p{P}|\\p{S}","u")),dl=Ea(/\s/);function Ea(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Bs(e){const t=[];let r=-1,a=0,l=0;for(;++r<e.length;){const o=e.charCodeAt(r);let u="";if(o===37&&fn(e.charCodeAt(r+1))&&fn(e.charCodeAt(r+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(r+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(a,r),encodeURIComponent(u)),a=r+l+1,u=""),l&&(r+=l,l=0)}return t.join("")+e.slice(a)}function et(e,t,r,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Ve(m)?(e.enter(r),f(m)):t(m)}function f(m){return Ve(m)&&o++<l?(e.consume(m),f):(e.exit(r),t(m))}}const NU={tokenize:_U};function _U(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let r;return t;function a(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:r});return r&&(r.next=m),r=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Te(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const AU={tokenize:TU},L1={tokenize:zU};function TU(e){const t=this,r=[];let a=0,l,o,u;return f;function f(A){if(a<r.length){const I=r[a];return t.containerState=I[1],e.attempt(I[0].continuation,m,h)(A)}return h(A)}function m(A){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const I=t.events.length;let F=I,O;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){O=t.events[F][1].end;break}E(a);let $=I;for(;$<t.events.length;)t.events[$][1].end={...O},$++;return Jn(t.events,F+1,0,t.events.slice(I)),t.events.length=$,h(A)}return f(A)}function h(A){if(a===r.length){if(!l)return x(A);if(l.currentConstruct&&l.currentConstruct.concrete)return k(A);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(L1,v,y)(A)}function v(A){return l&&R(),E(a),x(A)}function y(A){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,k(A)}function x(A){return t.containerState={},e.attempt(L1,b,k)(A)}function b(A){return a++,r.push([t.currentConstruct,t.containerState]),x(A)}function k(A){if(A===null){l&&R(),E(0),e.consume(A);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(A)}function j(A){if(A===null){N(e.exit("chunkFlow"),!0),E(0),e.consume(A);return}return Te(A)?(e.consume(A),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(A),j)}function N(A,I){const F=t.sliceStream(A);if(I&&F.push(null),A.previous=o,o&&(o.next=A),o=A,l.defineSkip(A.start),l.write(F),t.parser.lazy[A.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<u&&(!l.events[O][1].end||l.events[O][1].end.offset>u))return;const $=t.events.length;let V=$,J,q;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(J){q=t.events[V][1].end;break}J=!0}for(E(a),O=$;O<t.events.length;)t.events[O][1].end={...q},O++;Jn(t.events,V+1,0,t.events.slice($)),t.events.length=O}}function E(A){let I=r.length;for(;I-- >A;){const F=r[I];t.containerState=F[1],F[0].exit.call(t,e)}r.length=A}function R(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function zU(e,t,r){return et(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rs(e){if(e===null||xt(e)||dl(e))return 1;if(qd(e))return 2}function Hd(e,t,r){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,r),a.push(o))}return t}const Bp={name:"attention",resolveAll:RU,tokenize:OU};function RU(e,t){let r=-1,a,l,o,u,f,m,h,v;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const y={...e[a][1].end},x={...e[r][1].start};U1(y,-m),U1(x,m),u={type:m>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[r][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=mr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=mr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=mr(h,Hd(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),h=mr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[r][1].end.offset-e[r][1].start.offset?(v=2,h=mr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])):v=0,Jn(e,a-1,r-a+3,h),r=a+h.length-v-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function OU(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Rs(a);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"),v=Rs(m),y=!v||v===2&&l||r.includes(m),x=!l||l===2&&v||r.includes(a);return h._open=!!(o===42?y:y&&(l||!x)),h._close=!!(o===42?x:x&&(v||!y)),t(m)}}function U1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const DU={name:"autolink",tokenize:MU};function MU(e,t,r){let a=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return bn(b)?(e.consume(b),u):b===64?r(b):h(b)}function u(b){return b===43||b===45||b===46||fn(b)?(a=1,f(b)):h(b)}function f(b){return b===58?(e.consume(b),a=0,m):(b===43||b===45||b===46||fn(b))&&a++<32?(e.consume(b),f):(a=0,h(b))}function m(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||xd(b)?r(b):(e.consume(b),m)}function h(b){return b===64?(e.consume(b),v):jU(b)?(e.consume(b),h):r(b)}function v(b){return fn(b)?y(b):r(b)}function y(b){return b===46?(e.consume(b),a=0,v):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||fn(b))&&a++<63){const k=b===45?x:y;return e.consume(b),k}return r(b)}}const vu={partial:!0,tokenize:LU};function LU(e,t,r){return a;function a(o){return Ve(o)?et(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Te(o)?t(o):r(o)}}const tE={continuation:{tokenize:IU},exit:PU,name:"blockQuote",tokenize:UU};function UU(e,t,r){const a=this;return l;function l(u){if(u===62){const f=a.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 r(u)}function o(u){return Ve(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function IU(e,t,r){const a=this;return l;function l(u){return Ve(u)?et(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(tE,t,r)(u)}}function PU(e){e.exit("blockQuote")}const nE={name:"characterEscape",tokenize:BU};function BU(e,t,r){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return CU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(o)}}const rE={name:"characterReference",tokenize:$U};function $U(e,t,r){const a=this;let l=0,o,u;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),m}function m(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=fn,v(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=EU,v):(e.enter("characterReferenceValue"),o=7,u=Pp,v(y))}function v(y){if(y===59&&l){const x=e.exit("characterReferenceValue");return u===fn&&!Fg(a.sliceSerialize(x))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(y)&&l++<o?(e.consume(y),v):r(y)}}const I1={partial:!0,tokenize:qU},P1={concrete:!0,name:"codeFenced",tokenize:FU};function FU(e,t,r){const a=this,l={partial:!0,tokenize:F};let o=0,u=0,f;return m;function m(O){return h(O)}function h(O){const $=a.events[a.events.length-1];return o=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),v(O)}function v(O){return O===f?(u++,e.consume(O),v):u<3?r(O):(e.exit("codeFencedFenceSequence"),Ve(O)?et(e,y,"whitespace")(O):y(O))}function y(O){return O===null||Te(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(I1,j,I)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||Te(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(O)):Ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,b,"whitespace")(O)):O===96&&O===f?r(O):(e.consume(O),x)}function b(O){return O===null||Te(O)?y(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||Te(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(O)):O===96&&O===f?r(O):(e.consume(O),k)}function j(O){return e.attempt(l,I,N)(O)}function N(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&Ve(O)?et(e,R,"linePrefix",o+1)(O):R(O)}function R(O){return O===null||Te(O)?e.check(I1,j,I)(O):(e.enter("codeFlowValue"),A(O))}function A(O){return O===null||Te(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),A)}function I(O){return e.exit("codeFenced"),t(O)}function F(O,$,V){let J=0;return q;function q(ee){return O.enter("lineEnding"),O.consume(ee),O.exit("lineEnding"),re}function re(ee){return O.enter("codeFencedFence"),Ve(ee)?et(O,ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):ae(ee)}function ae(ee){return ee===f?(O.enter("codeFencedFenceSequence"),me(ee)):V(ee)}function me(ee){return ee===f?(J++,O.consume(ee),me):J>=u?(O.exit("codeFencedFenceSequence"),Ve(ee)?et(O,ce,"whitespace")(ee):ce(ee)):V(ee)}function ce(ee){return ee===null||Te(ee)?(O.exit("codeFencedFence"),$(ee)):V(ee)}}}function qU(e,t,r){const a=this;return l;function l(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}const Pm={name:"codeIndented",tokenize:ZU},HU={partial:!0,tokenize:VU};function ZU(e,t,r){const a=this;return l;function l(h){return e.enter("codeIndented"),et(e,o,"linePrefix",5)(h)}function o(h){const v=a.events[a.events.length-1];return v&&v[1].type==="linePrefix"&&v[2].sliceSerialize(v[1],!0).length>=4?u(h):r(h)}function u(h){return h===null?m(h):Te(h)?e.attempt(HU,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Te(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function VU(e,t,r){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?r(u):Te(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):et(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Te(u)?l(u):r(u)}}const QU={name:"codeText",previous:KU,resolve:GU,tokenize:YU};function GU(e){let t=e.length-4,r=3,a,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function KU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function YU(e,t,r){let a=0,l,o;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),m(y))}function m(y){return y===null?r(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),m):y===96?(o=e.enter("codeTextSequence"),l=0,v(y)):Te(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||Te(y)?(e.exit("codeTextData"),m(y)):(e.consume(y),h)}function v(y){return y===96?(e.consume(y),l++,v):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(o.type="codeTextData",h(y))}}class XU{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,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const l=r||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&$o(this.left,a),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),$o(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$o(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 r=this.left.splice(t,Number.POSITIVE_INFINITY);$o(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$o(this.left,r.reverse())}}}function $o(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function iE(e){const t={};let r=-1,a,l,o,u,f,m,h;const v=new XU(e);for(;++r<v.length;){for(;r in t;)r=t[r];if(a=v.get(r),r&&a[1].type==="chunkFlow"&&v.get(r-1)[1].type==="listItemPrefix"&&(m=a[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(a[0]==="enter")a[1].contentType&&(Object.assign(t,JU(v,r)),r=t[r],h=!0);else if(a[1]._container){for(o=r,l=void 0;o--;)if(u=v.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(v.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(a[1].end={...v.get(l)[1].start},f=v.slice(l,r),f.unshift(a),v.splice(l,r-l+1,f))}}return Jn(e,0,Number.POSITIVE_INFINITY,v.slice(0)),!h}function JU(e,t){const r=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let v,y,x=-1,b=r,k=0,j=0;const N=[j];for(;b;){for(;e.get(++l)[1]!==b;);o.push(l),b._tokenizer||(v=a.sliceStream(b),b.next||v.push(null),y&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(v),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=r;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(j=x+1,N.push(j),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const E=f.slice(N[x],N[x+1]),R=o.pop();m.push([R,R+E.length-1]),e.splice(R,2,E)}for(m.reverse(),x=-1;++x<m.length;)h[k+m[x][0]]=k+m[x][1],k+=m[x][1]-m[x][0]-1;return h}const WU={resolve:tI,tokenize:nI},eI={partial:!0,tokenize:rI};function tI(e){return iE(e),e}function nI(e,t){let r;return a;function a(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Te(f)?e.check(eI,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"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function rI(e,t,r){const a=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||Te(u))return r(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function aE(e,t,r,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let v=0;return y;function y(E){return E===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(E),e.exit(o),x):E===null||E===32||E===41||xd(E)?r(E):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function x(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(f),x(E)):E===null||E===60||Te(E)?r(E):(e.consume(E),E===92?k:b)}function k(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function j(E){return!v&&(E===null||E===41||xt(E))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(E)):v<h&&E===40?(e.consume(E),v++,j):E===41?(e.consume(E),v--,j):E===null||E===32||E===40||xd(E)?r(E):(e.consume(E),E===92?N:j)}function N(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function lE(e,t,r,a,l,o){const u=this;let f=0,m;return h;function h(b){return e.enter(a),e.enter(l),e.consume(b),e.exit(l),e.enter(o),v}function v(b){return f>999||b===null||b===91||b===93&&!m||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):Te(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),v):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||Te(b)||f++>999?(e.exit("chunkString"),v(b)):(e.consume(b),m||(m=!Ve(b)),b===92?x:y)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,y):y(b)}}function sE(e,t,r,a,l,o){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(l),e.consume(x),e.exit(l),u=x===40?41:x,m):r(x)}function m(x){return x===u?(e.enter(l),e.consume(x),e.exit(l),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===u?(e.exit(o),m(u)):x===null?r(x):Te(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),et(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),v(x))}function v(x){return x===u||x===null||Te(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?y:v)}function y(x){return x===u||x===92?(e.consume(x),v):v(x)}}function Go(e,t){let r;return a;function a(l){return Te(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,a):Ve(l)?et(e,a,r?"linePrefix":"lineSuffix")(l):t(l)}}const iI={name:"definition",tokenize:lI},aI={partial:!0,tokenize:sI};function lI(e,t,r){const a=this;let l;return o;function o(b){return e.enter("definition"),u(b)}function u(b){return lE.call(a,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=Er(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),m):r(b)}function m(b){return xt(b)?Go(e,h)(b):h(b)}function h(b){return aE(e,v,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function v(b){return e.attempt(aI,y,y)(b)}function y(b){return Ve(b)?et(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Te(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):r(b)}}function sI(e,t,r){return a;function a(f){return xt(f)?Go(e,l)(f):r(f)}function l(f){return sE(e,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ve(f)?et(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Te(f)?t(f):r(f)}}const oI={name:"hardBreakEscape",tokenize:uI};function uI(e,t,r){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Te(o)?(e.exit("hardBreakEscape"),t(o)):r(o)}}const cI={name:"headingAtx",resolve:dI,tokenize:fI};function dI(e,t){let r=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},o={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},Jn(e,a,r-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function fI(e,t,r){let a=0;return l;function l(v){return e.enter("atxHeading"),o(v)}function o(v){return e.enter("atxHeadingSequence"),u(v)}function u(v){return v===35&&a++<6?(e.consume(v),u):v===null||xt(v)?(e.exit("atxHeadingSequence"),f(v)):r(v)}function f(v){return v===35?(e.enter("atxHeadingSequence"),m(v)):v===null||Te(v)?(e.exit("atxHeading"),t(v)):Ve(v)?et(e,f,"whitespace")(v):(e.enter("atxHeadingText"),h(v))}function m(v){return v===35?(e.consume(v),m):(e.exit("atxHeadingSequence"),f(v))}function h(v){return v===null||v===35||xt(v)?(e.exit("atxHeadingText"),f(v)):(e.consume(v),h)}}const hI=["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"],B1=["pre","script","style","textarea"],mI={concrete:!0,name:"htmlFlow",resolveTo:yI,tokenize:vI},pI={partial:!0,tokenize:bI},gI={partial:!0,tokenize:xI};function yI(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 vI(e,t,r){const a=this;let l,o,u,f,m;return h;function h(C){return v(C)}function v(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),y}function y(C){return C===33?(e.consume(C),x):C===47?(e.consume(C),o=!0,j):C===63?(e.consume(C),l=3,a.interrupt?t:z):bn(C)?(e.consume(C),u=String.fromCharCode(C),N):r(C)}function x(C){return C===45?(e.consume(C),l=2,b):C===91?(e.consume(C),l=5,f=0,k):bn(C)?(e.consume(C),l=4,a.interrupt?t:z):r(C)}function b(C){return C===45?(e.consume(C),a.interrupt?t:z):r(C)}function k(C){const X="CDATA[";return C===X.charCodeAt(f++)?(e.consume(C),f===X.length?a.interrupt?t:ae:k):r(C)}function j(C){return bn(C)?(e.consume(C),u=String.fromCharCode(C),N):r(C)}function N(C){if(C===null||C===47||C===62||xt(C)){const X=C===47,H=u.toLowerCase();return!X&&!o&&B1.includes(H)?(l=1,a.interrupt?t(C):ae(C)):hI.includes(u.toLowerCase())?(l=6,X?(e.consume(C),E):a.interrupt?t(C):ae(C)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(C):o?R(C):A(C))}return C===45||fn(C)?(e.consume(C),u+=String.fromCharCode(C),N):r(C)}function E(C){return C===62?(e.consume(C),a.interrupt?t:ae):r(C)}function R(C){return Ve(C)?(e.consume(C),R):q(C)}function A(C){return C===47?(e.consume(C),q):C===58||C===95||bn(C)?(e.consume(C),I):Ve(C)?(e.consume(C),A):q(C)}function I(C){return C===45||C===46||C===58||C===95||fn(C)?(e.consume(C),I):F(C)}function F(C){return C===61?(e.consume(C),O):Ve(C)?(e.consume(C),F):A(C)}function O(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),m=C,$):Ve(C)?(e.consume(C),O):V(C)}function $(C){return C===m?(e.consume(C),m=null,J):C===null||Te(C)?r(C):(e.consume(C),$)}function V(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?F(C):(e.consume(C),V)}function J(C){return C===47||C===62||Ve(C)?A(C):r(C)}function q(C){return C===62?(e.consume(C),re):r(C)}function re(C){return C===null||Te(C)?ae(C):Ve(C)?(e.consume(C),re):r(C)}function ae(C){return C===45&&l===2?(e.consume(C),P):C===60&&l===1?(e.consume(C),W):C===62&&l===4?(e.consume(C),U):C===63&&l===3?(e.consume(C),z):C===93&&l===5?(e.consume(C),Ce):Te(C)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(pI,T,me)(C)):C===null||Te(C)?(e.exit("htmlFlowData"),me(C)):(e.consume(C),ae)}function me(C){return e.check(gI,ce,T)(C)}function ce(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ee}function ee(C){return C===null||Te(C)?me(C):(e.enter("htmlFlowData"),ae(C))}function P(C){return C===45?(e.consume(C),z):ae(C)}function W(C){return C===47?(e.consume(C),u="",pe):ae(C)}function pe(C){if(C===62){const X=u.toLowerCase();return B1.includes(X)?(e.consume(C),U):ae(C)}return bn(C)&&u.length<8?(e.consume(C),u+=String.fromCharCode(C),pe):ae(C)}function Ce(C){return C===93?(e.consume(C),z):ae(C)}function z(C){return C===62?(e.consume(C),U):C===45&&l===2?(e.consume(C),z):ae(C)}function U(C){return C===null||Te(C)?(e.exit("htmlFlowData"),T(C)):(e.consume(C),U)}function T(C){return e.exit("htmlFlow"),t(C)}}function xI(e,t,r){const a=this;return l;function l(u){return Te(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):r(u)}function o(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}function bI(e,t,r){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(vu,t,r)}}const SI={name:"htmlText",tokenize:wI};function wI(e,t,r){const a=this;let l,o,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),m}function m(z){return z===33?(e.consume(z),h):z===47?(e.consume(z),F):z===63?(e.consume(z),A):bn(z)?(e.consume(z),V):r(z)}function h(z){return z===45?(e.consume(z),v):z===91?(e.consume(z),o=0,k):bn(z)?(e.consume(z),R):r(z)}function v(z){return z===45?(e.consume(z),b):r(z)}function y(z){return z===null?r(z):z===45?(e.consume(z),x):Te(z)?(u=y,W(z)):(e.consume(z),y)}function x(z){return z===45?(e.consume(z),b):y(z)}function b(z){return z===62?P(z):z===45?x(z):y(z)}function k(z){const U="CDATA[";return z===U.charCodeAt(o++)?(e.consume(z),o===U.length?j:k):r(z)}function j(z){return z===null?r(z):z===93?(e.consume(z),N):Te(z)?(u=j,W(z)):(e.consume(z),j)}function N(z){return z===93?(e.consume(z),E):j(z)}function E(z){return z===62?P(z):z===93?(e.consume(z),E):j(z)}function R(z){return z===null||z===62?P(z):Te(z)?(u=R,W(z)):(e.consume(z),R)}function A(z){return z===null?r(z):z===63?(e.consume(z),I):Te(z)?(u=A,W(z)):(e.consume(z),A)}function I(z){return z===62?P(z):A(z)}function F(z){return bn(z)?(e.consume(z),O):r(z)}function O(z){return z===45||fn(z)?(e.consume(z),O):$(z)}function $(z){return Te(z)?(u=$,W(z)):Ve(z)?(e.consume(z),$):P(z)}function V(z){return z===45||fn(z)?(e.consume(z),V):z===47||z===62||xt(z)?J(z):r(z)}function J(z){return z===47?(e.consume(z),P):z===58||z===95||bn(z)?(e.consume(z),q):Te(z)?(u=J,W(z)):Ve(z)?(e.consume(z),J):P(z)}function q(z){return z===45||z===46||z===58||z===95||fn(z)?(e.consume(z),q):re(z)}function re(z){return z===61?(e.consume(z),ae):Te(z)?(u=re,W(z)):Ve(z)?(e.consume(z),re):J(z)}function ae(z){return z===null||z===60||z===61||z===62||z===96?r(z):z===34||z===39?(e.consume(z),l=z,me):Te(z)?(u=ae,W(z)):Ve(z)?(e.consume(z),ae):(e.consume(z),ce)}function me(z){return z===l?(e.consume(z),l=void 0,ee):z===null?r(z):Te(z)?(u=me,W(z)):(e.consume(z),me)}function ce(z){return z===null||z===34||z===39||z===60||z===61||z===96?r(z):z===47||z===62||xt(z)?J(z):(e.consume(z),ce)}function ee(z){return z===47||z===62||xt(z)?J(z):r(z)}function P(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):r(z)}function W(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),pe}function pe(z){return Ve(z)?et(e,Ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Ce(z)}function Ce(z){return e.enter("htmlTextData"),u(z)}}const qg={name:"labelEnd",resolveAll:CI,resolveTo:NI,tokenize:_I},kI={tokenize:AI},jI={tokenize:TI},EI={tokenize:zI};function CI(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==r.length&&Jn(e,0,e.length,r),e}function NI(e,t){let r=e.length,a=0,l,o,u,f;for(;r--;)if(l=e[r][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=r,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(u=r);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}},v={type:"labelText",start:{...e[o+a+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+a+3)),f=mr(f,[["enter",v,t]]),f=mr(f,Hd(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=mr(f,[["exit",v,t],e[u-2],e[u-1],["exit",h,t]]),f=mr(f,e.slice(u+1)),f=mr(f,[["exit",m,t]]),Jn(e,o,e.length,f),e}function _I(e,t,r){const a=this;let l=a.events.length,o,u;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(x){return o?o._inactive?y(x):(u=a.parser.defined.includes(Er(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),m):r(x)}function m(x){return x===40?e.attempt(kI,v,u?v:y)(x):x===91?e.attempt(jI,v,u?h:y)(x):u?v(x):y(x)}function h(x){return e.attempt(EI,v,y)(x)}function v(x){return t(x)}function y(x){return o._balanced=!0,r(x)}}function AI(e,t,r){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),l}function l(y){return xt(y)?Go(e,o)(y):o(y)}function o(y){return y===41?v(y):aE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return xt(y)?Go(e,m)(y):v(y)}function f(y){return r(y)}function m(y){return y===34||y===39||y===40?sE(e,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):v(y)}function h(y){return xt(y)?Go(e,v)(y):v(y)}function v(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):r(y)}}function TI(e,t,r){const a=this;return l;function l(f){return lE.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Er(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function u(f){return r(f)}}function zI(e,t,r){return a;function a(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):r(o)}}const RI={name:"labelStartImage",resolveAll:qg.resolveAll,tokenize:OI};function OI(e,t,r){const a=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):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(f):t(f)}}const DI={name:"labelStartLink",resolveAll:qg.resolveAll,tokenize:MI};function MI(e,t,r){const a=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 a.parser.constructs?r(u):t(u)}}const Bm={name:"lineEnding",tokenize:LI};function LI(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),et(e,t,"linePrefix")}}const sd={name:"thematicBreak",tokenize:UI};function UI(e,t,r){let a=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)):a>=3&&(h===null||Te(h))?(e.exit("thematicBreak"),t(h)):r(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Ve(h)?et(e,f,"whitespace")(h):f(h))}}const Rn={continuation:{tokenize:$I},exit:qI,name:"list",tokenize:BI},II={partial:!0,tokenize:HI},PI={partial:!0,tokenize:FI};function BI(e,t,r){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return f;function f(b){const k=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Pp(b)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(sd,r,h)(b):h(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(b)}return r(b)}function m(b){return Pp(b)&&++u<10?(e.consume(b),m):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):r(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(vu,a.interrupt?r:v,e.attempt(II,x,y))}function v(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function y(b){return Ve(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):r(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function $I(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(vu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,et(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Ve(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(PI,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,et(e,e.attempt(Rn,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function FI(e,t,r){const a=this;return et(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):r(o)}}function qI(e){e.exit(this.containerState.type)}function HI(e,t,r){const a=this;return et(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Ve(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):r(o)}}const $1={name:"setextUnderline",resolveTo:ZI,tokenize:VI};function ZI(e,t){let r=e.length,a,l,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&e.splice(r,1),!o&&e[r][1].type==="definition"&&(o=r);const u={type:"setextHeading",start:{...e[a][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[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function VI(e,t,r){const a=this;let l;return o;function o(h){let v=a.events.length,y;for(;v--;)if(a.events[v][1].type!=="lineEnding"&&a.events[v][1].type!=="linePrefix"&&a.events[v][1].type!=="content"){y=a.events[v][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),l=h,u(h)):r(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Ve(h)?et(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Te(h)?(e.exit("setextHeadingLine"),t(h)):r(h)}}const QI={tokenize:GI};function GI(e){const t=this,r=e.attempt(vu,a,e.attempt(this.parser.constructs.flowInitial,l,et(e,e.attempt(this.parser.constructs.flow,l,e.attempt(WU,l)),"linePrefix")));return r;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const KI={resolveAll:uE()},YI=oE("string"),XI=oE("text");function oE(e){return{resolveAll:uE(e==="text"?JI:void 0),tokenize:t};function t(r){const a=this,l=this.parser.constructs[e],o=r.attempt(l,u,f);return u;function u(v){return h(v)?o(v):f(v)}function f(v){if(v===null){r.consume(v);return}return r.enter("data"),r.consume(v),m}function m(v){return h(v)?(r.exit("data"),o(v)):(r.consume(v),m)}function h(v){if(v===null)return!0;const y=l[v];let x=-1;if(y)for(;++x<y.length;){const b=y[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function uE(e){return t;function t(r,a){let l=-1,o;for(;++l<=r.length;)o===void 0?r[l]&&r[l][1].type==="data"&&(o=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==o+2&&(r[o][1].end=r[l-1][1].end,r.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(r,a):r}}function JI(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],l=t.sliceStream(a);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&&r===e.length&&(f=0),f){const h={type:r===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(r,0,["enter",h,t],["exit",h,t]),r+=2)}r++}return e}const WI={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:tE},e9={91:iI},t9={[-2]:Pm,[-1]:Pm,32:Pm},n9={35:cI,42:sd,45:[$1,sd],60:mI,61:$1,95:sd,96:P1,126:P1},r9={38:rE,92:nE},i9={[-5]:Bm,[-4]:Bm,[-3]:Bm,33:RI,38:rE,42:Bp,60:[DU,SI],91:DI,92:[oI,nE],93:qg,95:Bp,96:QU},a9={null:[Bp,KI]},l9={null:[42,95]},s9={null:[]},o9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:l9,contentInitial:e9,disable:s9,document:WI,flow:n9,flowInitial:t9,insideSpan:a9,string:r9,text:i9},Symbol.toStringTag,{value:"Module"}));function u9(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},o=[];let u=[],f=[];const m={attempt:$(F),check:$(O),consume:R,enter:A,exit:I,interrupt:$(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:y};let v=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function y(re){return u=mr(u,re),N(),u[u.length-1]!==null?[]:(V(t,0),h.events=Hd(o,h.events,h),h.events)}function x(re,ae){return d9(b(re),ae)}function b(re){return c9(u,re)}function k(){const{_bufferIndex:re,_index:ae,line:me,column:ce,offset:ee}=a;return{_bufferIndex:re,_index:ae,line:me,column:ce,offset:ee}}function j(re){l[re.line]=re.column,q()}function N(){let re;for(;a._index<u.length;){const ae=u[a._index];if(typeof ae=="string")for(re=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===re&&a._bufferIndex<ae.length;)E(ae.charCodeAt(a._bufferIndex));else E(ae)}}function E(re){v=v(re)}function R(re){Te(re)?(a.line++,a.column=1,a.offset+=re===-3?2:1,q()):re!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=re}function A(re,ae){const me=ae||{};return me.type=re,me.start=k(),h.events.push(["enter",me,h]),f.push(me),me}function I(re){const ae=f.pop();return ae.end=k(),h.events.push(["exit",ae,h]),ae}function F(re,ae){V(re,ae.from)}function O(re,ae){ae.restore()}function $(re,ae){return me;function me(ce,ee,P){let W,pe,Ce,z;return Array.isArray(ce)?T(ce):"tokenize"in ce?T([ce]):U(ce);function U(oe){return ye;function ye(De){const ve=De!==null&&oe[De],jt=De!==null&&oe.null,Wt=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(jt)?jt:jt?[jt]:[]];return T(Wt)(De)}}function T(oe){return W=oe,pe=0,oe.length===0?P:C(oe[pe])}function C(oe){return ye;function ye(De){return z=J(),Ce=oe,oe.partial||(h.currentConstruct=oe),oe.name&&h.parser.constructs.disable.null.includes(oe.name)?H():oe.tokenize.call(ae?Object.assign(Object.create(h),ae):h,m,X,H)(De)}}function X(oe){return re(Ce,z),ee}function H(oe){return z.restore(),++pe<W.length?C(W[pe]):P}}}function V(re,ae){re.resolveAll&&!o.includes(re)&&o.push(re),re.resolve&&Jn(h.events,ae,h.events.length-ae,re.resolve(h.events.slice(ae),h)),re.resolveTo&&(h.events=re.resolveTo(h.events,h))}function J(){const re=k(),ae=h.previous,me=h.currentConstruct,ce=h.events.length,ee=Array.from(f);return{from:ce,restore:P};function P(){a=re,h.previous=ae,h.currentConstruct=me,h.events.length=ce,f=ee,q()}}function q(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function c9(e,t){const r=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(r===l)u=[e[r].slice(a,o)];else{if(u=e.slice(r,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function d9(e,t){let r=-1;const a=[];let l;for(;++r<e.length;){const o=e[r];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,a.push(u)}return a.join("")}function f9(e){const a={constructs:Wj([o9,...(e||{}).extensions||[]]),content:l(NU),defined:[],document:l(AU),flow:l(QI),lazy:{},string:l(YI),text:l(XI)};return a;function l(o){return u;function u(f){return u9(a,o,f)}}}function h9(e){for(;!iE(e););return e}const F1=/[\0\t\n\r]/g;function m9(){let e=1,t="",r=!0,a;return l;function l(o,u,f){const m=[];let h,v,y,x,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),y=0,t="",r&&(o.charCodeAt(0)===65279&&y++,r=void 0);y<o.length;){if(F1.lastIndex=y,h=F1.exec(o),x=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(x),!h){t=o.slice(y);break}if(b===10&&y===x&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),y<x&&(m.push(o.slice(y,x)),e+=x-y),b){case 0:{m.push(65533),e++;break}case 9:{for(v=Math.ceil(e/4)*4,m.push(-2);e++<v;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}y=x+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const p9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function g9(e){return e.replace(p9,y9)}function y9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),o=l===120||l===88;return eE(r.slice(o?2:1),o?16:10)}return Fg(r)||e}const cE={}.hasOwnProperty;function v9(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),x9(r)(h9(f9(r).document().write(m9()(e,t,!0))))}function x9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(kn),autolinkProtocol:J,autolinkEmail:J,atxHeading:o(Gr),blockQuote:o(jt),characterEscape:J,characterReference:J,codeFenced:o(Wt),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Wt,u),codeText:o(wn,u),codeTextData:J,data:J,codeFlowValue:J,definition:o(xr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(en),hardBreakEscape:o(_r),hardBreakTrailing:o(_r),htmlFlow:o(Et,u),htmlFlowData:J,htmlText:o(Et,u),htmlTextData:J,image:o(Kt),label:u,link:o(kn),listItem:o(Ni),listItemValue:x,listOrdered:o(Kr,y),listUnordered:o(Kr),paragraph:o($s),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Gr),strong:o(yl),thematicBreak:o(Fs)},exit:{atxHeading:m(),atxHeadingSequence:F,autolink:m(),autolinkEmail:ve,autolinkProtocol:De,blockQuote:m(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:H,characterReferenceMarkerNumeric:H,characterReferenceValue:oe,characterReference:ye,codeFenced:m(N),codeFencedFence:j,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:m(E),codeText:m(ee),codeTextData:q,data:q,definition:m(),definitionDestinationString:I,definitionLabelString:R,definitionTitleString:A,emphasis:m(),hardBreakEscape:m(ae),hardBreakTrailing:m(ae),htmlFlow:m(me),htmlFlowData:q,htmlText:m(ce),htmlTextData:q,image:m(W),label:Ce,labelText:pe,lineEnding:re,link:m(P),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:X,resourceDestinationString:z,resourceTitleString:U,resource:T,setextHeading:m(V),setextHeadingLineSequence:$,setextHeadingText:O,strong:m(),thematicBreak:m()}};dE(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(ne){let he={type:"root",children:[]};const Oe={stack:[he],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:v,data:r},$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 mn=$e.pop();nt=l(ne,mn,nt)}for(nt=-1;++nt<ne.length;){const mn=t[ne[nt][0]];cE.call(mn,ne[nt][1].type)&&mn[ne[nt][1].type].call(Object.assign({sliceSerialize:ne[nt][2].sliceSerialize},Oe),ne[nt][1])}if(Oe.tokenStack.length>0){const mn=Oe.tokenStack[Oe.tokenStack.length-1];(mn[1]||q1).call(Oe,void 0,mn[0])}for(he.position={start:ta(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ta(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)he=t.transforms[nt](he)||he;return he}function l(ne,he,Oe){let $e=he-1,nt=-1,mn=!1,br,nn,Mt,un;for(;++$e<=Oe;){const ct=ne[$e];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?nt++:nt--,un=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(br&&!un&&!nt&&!Mt&&(Mt=$e),un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:un=void 0}if(!nt&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||nt===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(br){let Ar=$e;for(nn=void 0;Ar--;){const jn=ne[Ar];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;nn&&(ne[nn][1].type="lineEndingBlank",mn=!0),jn[1].type="lineEnding",nn=Ar}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Mt&&(!nn||Mt<nn)&&(br._spread=!0),br.end=Object.assign({},nn?ne[nn][1].start:ct[1].end),ne.splice(nn||$e,0,["exit",br,ct[2]]),$e++,Oe++}if(ct[1].type==="listItemPrefix"){const Ar={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};br=Ar,ne.splice($e,0,["enter",Ar,ct[2]]),$e++,Oe++,Mt=void 0,un=!0}}}return ne[he][1]._spread=mn,Oe}function o(ne,he){return Oe;function Oe($e){f.call(this,ne($e),$e),he&&he.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ne,he,Oe){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([he,Oe||void 0]),ne.position={start:ta(he.start),end:void 0}}function m(ne){return he;function he(Oe){ne&&ne.call(this,Oe),h.call(this,Oe)}}function h(ne,he){const Oe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ne.type&&(he?he.call(this,ne,$e[0]):($e[1]||q1).call(this,ne,$e[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Qo({start:ne.start,end:ne.end})+"): it’s not open");Oe.position.end=ta(ne.end)}function v(){return $g(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function x(ne){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.lang=ne}function k(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.meta=ne}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne.replace(/(\r?\n|\r)$/g,"")}function R(ne){const he=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=he,Oe.identifier=Er(this.sliceSerialize(ne)).toLowerCase()}function A(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.title=ne}function I(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.url=ne}function F(ne){const he=this.stack[this.stack.length-1];if(!he.depth){const Oe=this.sliceSerialize(ne).length;he.depth=Oe}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function $(ne){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function J(ne){const Oe=this.stack[this.stack.length-1].children;let $e=Oe[Oe.length-1];(!$e||$e.type!=="text")&&($e=tn(),$e.position={start:ta(ne.start),end:void 0},Oe.push($e)),this.stack.push($e)}function q(ne){const he=this.stack.pop();he.value+=this.sliceSerialize(ne),he.position.end=ta(ne.end)}function re(ne){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=he.children[he.children.length-1];Oe.position.end=ta(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(J.call(this,ne),q.call(this,ne))}function ae(){this.data.atHardBreak=!0}function me(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function ce(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function ee(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function P(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=he,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function W(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=he,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function pe(ne){const he=this.sliceSerialize(ne),Oe=this.stack[this.stack.length-2];Oe.label=g9(he),Oe.identifier=Er(he).toLowerCase()}function Ce(){const ne=this.stack[this.stack.length-1],he=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=he}function z(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.url=ne}function U(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.title=ne}function T(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function X(ne){const he=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=he,Oe.identifier=Er(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function H(ne){this.data.characterReferenceType=ne.type}function oe(ne){const he=this.sliceSerialize(ne),Oe=this.data.characterReferenceType;let $e;Oe?($e=eE(he,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Fg(he);const nt=this.stack[this.stack.length-1];nt.value+=$e}function ye(ne){const he=this.stack.pop();he.position.end=ta(ne.end)}function De(ne){q.call(this,ne);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(ne)}function ve(ne){q.call(this,ne);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(ne)}function jt(){return{type:"blockquote",children:[]}}function Wt(){return{type:"code",lang:null,meta:null,value:""}}function wn(){return{type:"inlineCode",value:""}}function xr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function en(){return{type:"emphasis",children:[]}}function Gr(){return{type:"heading",depth:0,children:[]}}function _r(){return{type:"break"}}function Et(){return{type:"html",value:""}}function Kt(){return{type:"image",title:null,url:"",alt:null}}function kn(){return{type:"link",title:null,url:"",children:[]}}function Kr(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Ni(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function $s(){return{type:"paragraph",children:[]}}function yl(){return{type:"strong",children:[]}}function tn(){return{type:"text",value:""}}function Fs(){return{type:"thematicBreak"}}}function ta(e){return{line:e.line,column:e.column,offset:e.offset}}function dE(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?dE(e,a):b9(e,a)}}function b9(e,t){let r;for(r in t)if(cE.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function q1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is still open")}function S9(e){const t=this;t.parser=r;function r(a){return v9(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function w9(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function k9(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
336
|
-
`}]}function j9(e,t){const r=t.value?t.value+`
|
|
337
|
-
`:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};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 E9(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function C9(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function N9(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Bs(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"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 _9(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function A9(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function fE(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];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+=a:l.push({type:"text",value:a}),l}function T9(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return fE(e,t);const l={src:Bs(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function z9(e,t){const r={src:Bs(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function R9(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function O9(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return fE(e,t);const l={href:Bs(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function D9(e,t){const r={href:Bs(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function M9(e,t,r){const a=e.all(t),l=r?L9(r):hE(t),o={},u=[];if(typeof t.checked=="boolean"){const v=a[0];let y;v&&v.type==="element"&&v.tagName==="p"?y=v:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.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<a.length;){const v=a[f];(l||f!==0||v.type!=="element"||v.tagName!=="p")&&u.push({type:"text",value:`
|
|
338
|
-
`}),v.type==="element"&&v.tagName==="p"&&!l?u.push(...v.children):u.push(v)}const m=a[a.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 L9(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=hE(r[a])}return t}function hE(e){const t=e.spread;return t??e.children.length>1}function U9(e,t){const r={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++l<a.length;){const u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function I9(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function P9(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function B9(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $9(e,t){const r=e.all(t),a=r.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Ug(t.children[1]),m=Vj(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 F9(e,t,r){const a=r?r.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const y=t.children[m],x={},b=u?u[m]:void 0;b&&(x.align=b);let k={type:"element",tagName:o,properties:x,children:[]};y&&(k.children=e.all(y),e.patch(y,k),k=e.applyData(y,k)),h.push(k)}const v={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,v),e.applyData(t,v)}function q9(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const H1=9,Z1=32;function H9(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),l=0;const o=[];for(;a;)o.push(V1(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=r.exec(t);return o.push(V1(t.slice(l),l>0,!1)),o.join("")}function V1(e,t,r){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===H1||o===Z1;)a++,o=e.codePointAt(a)}if(r){let o=e.codePointAt(l-1);for(;o===H1||o===Z1;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function Z9(e,t){const r={type:"text",value:H9(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function V9(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const Q9={blockquote:w9,break:k9,code:j9,delete:E9,emphasis:C9,footnoteReference:N9,heading:_9,html:A9,imageReference:T9,image:z9,inlineCode:R9,linkReference:O9,link:D9,listItem:M9,list:U9,paragraph:I9,root:P9,strong:B9,table:$9,tableCell:q9,tableRow:F9,text:Z9,thematicBreak:V9,toml:Kc,yaml:Kc,definition:Kc,footnoteDefinition:Kc};function Kc(){}const mE=-1,Zd=0,Ko=1,bd=2,Hg=3,Zg=4,Vg=5,Qg=6,pE=7,gE=8,Q1=typeof self=="object"?self:globalThis,G9=(e,t)=>{const r=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case Zd:case mE:return r(u,l);case Ko:{const f=r([],l);for(const m of u)f.push(a(m));return f}case bd:{const f=r({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case Hg:return r(new Date(u),l);case Zg:{const{source:f,flags:m}=u;return r(new RegExp(f,m),l)}case Vg:{const f=r(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case Qg:{const f=r(new Set,l);for(const m of u)f.add(a(m));return f}case pE:{const{name:f,message:m}=u;return r(new Q1[f](m),l)}case gE:return r(BigInt(u),l);case"BigInt":return r(Object(BigInt(u)),l);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new Q1[o](u),l)};return a},G1=e=>G9(new Map,e)(0),ls="",{toString:K9}={},{keys:Y9}=Object,Fo=e=>{const t=typeof e;if(t!=="object"||!e)return[Zd,t];const r=K9.call(e).slice(8,-1);switch(r){case"Array":return[Ko,ls];case"Object":return[bd,ls];case"Date":return[Hg,ls];case"RegExp":return[Zg,ls];case"Map":return[Vg,ls];case"Set":return[Qg,ls];case"DataView":return[Ko,r]}return r.includes("Array")?[Ko,r]:r.includes("Error")?[pE,r]:[bd,r]},Yc=([e,t])=>e===Zd&&(t==="function"||t==="symbol"),X9=(e,t,r,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return r.set(f,m),m},o=u=>{if(r.has(u))return r.get(u);let[f,m]=Fo(u);switch(f){case Zd:{let v=u;switch(m){case"bigint":f=gE,v=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);v=null;break;case"undefined":return l([mE],u)}return l([f,v],u)}case Ko:{if(m){let x=u;return m==="DataView"?x=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(x=new Uint8Array(u)),l([m,[...x]],u)}const v=[],y=l([f,v],u);for(const x of u)v.push(o(x));return y}case bd:{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 v=[],y=l([f,v],u);for(const x of Y9(u))(e||!Yc(Fo(u[x])))&&v.push([o(x),o(u[x])]);return y}case Hg:return l([f,u.toISOString()],u);case Zg:{const{source:v,flags:y}=u;return l([f,{source:v,flags:y}],u)}case Vg:{const v=[],y=l([f,v],u);for(const[x,b]of u)(e||!(Yc(Fo(x))||Yc(Fo(b))))&&v.push([o(x),o(b)]);return y}case Qg:{const v=[],y=l([f,v],u);for(const x of u)(e||!Yc(Fo(x)))&&v.push(o(x));return y}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},K1=(e,{json:t,lossy:r}={})=>{const a=[];return X9(!(t||r),!!t,new Map,a)(e),a},Sd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?G1(K1(e,t)):structuredClone(e):(e,t)=>G1(K1(e,t));function J9(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function W9(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function e8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||J9,a=e.options.footnoteBackLabel||W9,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 v=e.all(h),y=String(h.identifier).toUpperCase(),x=Bs(y.toLowerCase());let b=0;const k=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++b<=j;){k.length>0&&k.push({type:"text",value:" "});let R=typeof r=="string"?r:r(m,b);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const N=v[v.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const R=N.children[N.children.length-1];R&&R.type==="text"?R.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else v.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(v,!0)};e.patch(h,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Sd(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 Vd=(function(e){if(e==null)return i8;if(typeof e=="function")return Qd(e);if(typeof e=="object")return Array.isArray(e)?t8(e):n8(e);if(typeof e=="string")return r8(e);throw new Error("Expected function, string, or object as test")});function t8(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Vd(e[r]);return Qd(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function n8(e){const t=e;return Qd(r);function r(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function r8(e){return Qd(t);function t(r){return r&&r.type===e}}function Qd(e){return t;function t(r,a,l){return!!(a8(r)&&e.call(this,r,typeof a=="number"?a:void 0,l||void 0))}}function i8(){return!0}function a8(e){return e!==null&&typeof e=="object"&&"type"in e}const yE=[],l8=!0,$p=!1,s8="skip";function vE(e,t,r,a){let l;typeof t=="function"&&typeof r!="function"?(a=r,r=t):l=t;const o=Vd(l),u=a?-1:1;f(e,void 0,[])();function f(m,h,v){const y=m&&typeof m=="object"?m:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(m.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=yE,k,j,N;if((!t||o(m,h,v[v.length-1]||void 0))&&(b=o8(r(m,v)),b[0]===$p))return b;if("children"in m&&m.children){const E=m;if(E.children&&b[0]!==s8)for(j=(a?E.children.length:-1)+u,N=v.concat(E);j>-1&&j<E.children.length;){const R=E.children[j];if(k=f(R,j,N)(),k[0]===$p)return k;j=typeof k[1]=="number"?k[1]:j+u}}return b}}}function o8(e){return Array.isArray(e)?e:typeof e=="number"?[l8,e]:e==null?yE:[e]}function Gg(e,t,r,a){let l,o,u;typeof t=="function"&&typeof r!="function"?(o=void 0,u=t,l=r):(o=t,u=r,l=a),vE(e,o,f,l);function f(m,h){const v=h[h.length-1],y=v?v.children.indexOf(m):void 0;return u(m,y,v)}}const Fp={}.hasOwnProperty,u8={};function c8(e,t){const r=t||u8,a=new Map,l=new Map,o=new Map,u={...Q9,...r.handlers},f={all:h,applyData:f8,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:r,patch:d8,wrap:m8};return Gg(e,function(v){if(v.type==="definition"||v.type==="footnoteDefinition"){const y=v.type==="definition"?a:l,x=String(v.identifier).toUpperCase();y.has(x)||y.set(x,v)}}),f;function m(v,y){const x=v.type,b=f.handlers[x];if(Fp.call(f.handlers,x)&&b)return b(f,v,y);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in v){const{children:j,...N}=v,E=Sd(N);return E.children=f.all(v),E}return Sd(v)}return(f.options.unknownHandler||h8)(f,v,y)}function h(v){const y=[];if("children"in v){const x=v.children;let b=-1;for(;++b<x.length;){const k=f.one(x[b],v);if(k){if(b&&x[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Y1(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=Y1(j.value))}Array.isArray(k)?y.push(...k):y.push(k)}}}return y}}function d8(e,t){e.position&&(t.position=WL(e))}function f8(e,t){let r=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const u="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:u}}r.type==="element"&&o&&Object.assign(r.properties,Sd(o)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function h8(e,t){const r=t.data||{},a="value"in t&&!(Fp.call(r,"hProperties")||Fp.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function m8(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
|
|
342
|
-
`});++a<e.length;)a&&r.push({type:"text",value:`
|
|
343
|
-
`}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
344
|
-
`}),r}function Y1(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function X1(e,t){const r=c8(e,t),a=r.one(e,void 0),l=e8(r),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
345
|
-
`},l),o}function p8(e,t){return e&&"run"in e?async function(r,a){const l=X1(r,{file:a,...t});await e.run(l,a)}:function(r,a){return X1(r,{file:a,...e||t})}}function J1(e){if(e)throw e}var $m,W1;function g8(){if(W1)return $m;W1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=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 v=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!v&&!y)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},u=function(h,v){r&&v.name==="__proto__"?r(h,v.name,{enumerable:!0,configurable:!0,value:v.newValue,writable:!0}):h[v.name]=v.newValue},f=function(h,v){if(v==="__proto__")if(e.call(h,v)){if(a)return a(h,v).value}else return;return h[v]};return $m=function m(){var h,v,y,x,b,k,j=arguments[0],N=1,E=arguments.length,R=!1;for(typeof j=="boolean"&&(R=j,j=arguments[1]||{},N=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});N<E;++N)if(h=arguments[N],h!=null)for(v in h)y=f(j,v),x=f(h,v),j!==x&&(R&&x&&(o(x)||(b=l(x)))?(b?(b=!1,k=y&&l(y)?y:[]):k=y&&o(y)?y:{},u(j,{name:v,newValue:m(R,k,x)})):typeof x<"u"&&u(j,{name:v,newValue:x}));return j},$m}var y8=g8();const Fm=kd(y8);function qp(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 v8(){const e=[],t={run:r,use:a};return t;function r(...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 v=e[++o];let y=-1;if(m){u(m);return}for(;++y<l.length;)(h[y]===null||h[y]===void 0)&&(h[y]=l[y]);l=h,v?x8(v,f)(...h):u(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function x8(e,t){let r;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const v=h;if(f&&r)throw v;return l(v)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){r||(r=!0,t(u,...f))}function o(u){l(null,u)}}const Lr={basename:b8,dirname:S8,extname:w8,join:k8,sep:"/"};function b8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xu(e);let r=0,a=-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){r=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){r=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function S8(e){if(xu(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function w8(e){xu(e);let t=e.length,r=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||r<0||o===0||o===1&&l===r-1&&l===a+1?"":e.slice(l,r)}function k8(...e){let t=-1,r;for(;++t<e.length;)xu(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":j8(r)}function j8(e){xu(e);const t=e.codePointAt(0)===47;let r=E8(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function E8(e,t){let r="",a=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(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(m=r.lastIndexOf("/"),m!==r.length-1){m<0?(r="",a=0):(r=r.slice(0,m),a=r.length-1-r.lastIndexOf("/")),l=u,o=0;continue}}else if(r.length>0){r="",a=0,l=u,o=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(l+1,u):r=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return r}function xu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const C8={cwd:N8};function N8(){return"/"}function Hp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _8(e){if(typeof e=="string")e=new URL(e);else if(!Hp(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 A8(e)}function A8(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===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 qm=["history","path","basename","stem","extname","dirname"];class xE{constructor(t){let r;t?Hp(t)?r={path:t}:typeof t=="string"||T8(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":C8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<qm.length;){const o=qm[a];o in r&&r[o]!==void 0&&r[o]!==null&&(this[o]=o==="history"?[...r[o]]:r[o])}let l;for(l in r)qm.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?Lr.basename(this.path):void 0}set basename(t){Zm(t,"basename"),Hm(t,"basename"),this.path=Lr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Lr.dirname(this.path):void 0}set dirname(t){eS(this.basename,"dirname"),this.path=Lr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Lr.extname(this.path):void 0}set extname(t){if(Hm(t,"extname"),eS(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=Lr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Hp(t)&&(t=_8(t)),Zm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Lr.basename(this.path,this.extname):void 0}set stem(t){Zm(t,"stem"),Hm(t,"stem"),this.path=Lr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const l=this.message(t,r,a);throw l.fatal=!0,l}info(t,r,a){const l=this.message(t,r,a);return l.fatal=void 0,l}message(t,r,a){const l=new hn(t,r,a);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 Hm(e,t){if(e&&e.includes(Lr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lr.sep+"`")}function Zm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function eS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function T8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const z8=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),R8={}.hasOwnProperty;class Kg extends z8{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=v8()}copy(){const t=new Kg;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(Fm(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Gm("data",this.frozen),this.namespace[t]=r,this):R8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gm("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[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=r.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Xc(t),a=this.parser||this.Parser;return Vm("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),Vm("process",this.parser||this.Parser),Qm("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(o,u){const f=Xc(t),m=a.parse(f);a.run(m,f,function(v,y,x){if(v||!y||!x)return h(v);const b=y,k=a.stringify(b,x);M8(k)?x.value=k:x.result=k,h(v,x)});function h(v,y){v||!y?u(v):o?o(y):r(void 0,y)}}}processSync(t){let r=!1,a;return this.freeze(),Vm("processSync",this.parser||this.Parser),Qm("processSync",this.compiler||this.Compiler),this.process(t,l),nS("processSync","process",r),a;function l(o,u){r=!0,J1(o),a=u}}run(t,r,a){tS(t),this.freeze();const l=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const m=Xc(r);l.run(t,m,h);function h(v,y,x){const b=y||t;v?f(v):u?u(b):a(void 0,b,x)}}}runSync(t,r){let a=!1,l;return this.run(t,r,o),nS("runSync","run",a),l;function o(u,f){J1(u),l=f,a=!0}}stringify(t,r){this.freeze();const a=Xc(r),l=this.compiler||this.Compiler;return Qm("stringify",l),tS(t),l(t,a)}use(t,...r){const a=this.attachers,l=this.namespace;if(Gm("use",this.frozen),t!=null)if(typeof t=="function")m(t,r);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[v,...y]=h;m(v,y)}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=Fm(!0,l.settings,h.settings))}function f(h){let v=-1;if(h!=null)if(Array.isArray(h))for(;++v<h.length;){const y=h[v];o(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,v){let y=-1,x=-1;for(;++y<a.length;)if(a[y][0]===h){x=y;break}if(x===-1)a.push([h,...v]);else if(v.length>0){let[b,...k]=v;const j=a[x][1];qp(j)&&qp(b)&&(b=Fm(!0,j,b)),a[x]=[h,b,...k]}}}}const O8=new Kg().freeze();function Vm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gm(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 tS(e){if(!qp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nS(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xc(e){return D8(e)?e:new xE(e)}function D8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function M8(e){return typeof e=="string"||L8(e)}function L8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const U8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rS=[],iS={allowDangerousHtml:!0},I8=/^(https?|ircs?|mailto|xmpp)$/i,P8=[{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 B8(e){const t=$8(e),r=F8(e);return q8(t.runSync(t.parse(r),r),e)}function $8(e){const t=e.rehypePlugins||rS,r=e.remarkPlugins||rS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...iS}:iS;return O8().use(S9).use(r).use(p8,a).use(t)}function F8(e){const t=e.children||"",r=new xE;return typeof t=="string"&&(r.value=t),r}function q8(e,t){const r=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||H8;for(const v of P8)Object.hasOwn(t,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+U8+v.id,void 0);return Gg(e,h),iU(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(v,y,x){if(v.type==="raw"&&x&&typeof y=="number")return u?x.children.splice(y,1):x.children[y]={type:"text",value:v.value},y;if(v.type==="element"){let b;for(b in Im)if(Object.hasOwn(Im,b)&&Object.hasOwn(v.properties,b)){const k=v.properties[b],j=Im[b];(j===null||j.includes(v.tagName))&&(v.properties[b]=m(String(k||""),b,v))}}if(v.type==="element"){let b=r?!r.includes(v.tagName):o?o.includes(v.tagName):!1;if(!b&&a&&typeof y=="number"&&(b=!a(v,y,x)),b&&x&&typeof y=="number")return f&&v.children?x.children.splice(y,1,...v.children):x.children.splice(y,1),y}}}function H8(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||r!==-1&&t>r||a!==-1&&t>a||I8.test(e.slice(0,t))?e:""}function Z8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function bE(e,t,r){const l=Vd((r||{}).ignore||[]),o=V8(t);let u=-1;for(;++u<o.length;)vE(e,"text",f);function f(h,v){let y=-1,x;for(;++y<v.length;){const b=v[y],k=x?x.children:void 0;if(l(b,k?k.indexOf(b):void 0,x))return;x=b}if(x)return m(h,v)}function m(h,v){const y=v[v.length-1],x=o[u][0],b=o[u][1];let k=0;const N=y.children.indexOf(h);let E=!1,R=[];x.lastIndex=0;let A=x.exec(h.value);for(;A;){const I=A.index,F={index:A.index,input:A.input,stack:[...v,h]};let O=b(...A,F);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?x.lastIndex=I+1:(k!==I&&R.push({type:"text",value:h.value.slice(k,I)}),Array.isArray(O)?R.push(...O):O&&R.push(O),k=I+A[0].length,E=!0),!x.global)break;A=x.exec(h.value)}return E?(k<h.value.length&&R.push({type:"text",value:h.value.slice(k)}),y.children.splice(N,1,...R)):R=[h],N+R.length}}function V8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<r.length;){const l=r[a];t.push([Q8(l[0]),G8(l[1])])}return t}function Q8(e){return typeof e=="string"?new RegExp(Z8(e),"g"):e}function G8(e){return typeof e=="function"?e:function(){return e}}function K8(e){bE(e,[/\r?\n|\r/g,Y8])}function Y8(){return{type:"break"}}function X8(){return function(e){K8(e)}}function aS(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=r.indexOf(t);for(;l!==-1;)a++,l=r.indexOf(t,l+t.length);return a}const Km="phrasing",Ym=["autolink","link","image","label"];function J8(){return{transforms:[aP],enter:{literalAutolink:eP,literalAutolinkEmail:Xm,literalAutolinkHttp:Xm,literalAutolinkWww:Xm},exit:{literalAutolink:iP,literalAutolinkEmail:rP,literalAutolinkHttp:tP,literalAutolinkWww:nP}}}function W8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Km,notInConstruct:Ym},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Km,notInConstruct:Ym},{character:":",before:"[ps]",after:"\\/",inConstruct:Km,notInConstruct:Ym}]}}function eP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xm(e){this.config.enter.autolinkProtocol.call(this,e)}function tP(e){this.config.exit.autolinkProtocol.call(this,e)}function nP(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 rP(e){this.config.exit.autolinkEmail.call(this,e)}function iP(e){this.exit(e)}function aP(e){bE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),sP]],{ignore:["link","linkReference"]})}function lP(e,t,r,a,l){let o="";if(!SE(l)||(/^w/i.test(t)&&(r=t+r,t="",o="http://"),!oP(r)))return!1;const u=uP(r+a);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 sP(e,t,r,a){return!SE(a,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function oP(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 uP(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],a=r.indexOf(")");const l=aS(e,"(");let o=aS(e,")");for(;a!==-1&&l>o;)e+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),o++;return[e,r]}function SE(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||dl(r)||qd(r))&&(!t||r!==47)}wE.peek=vP;function cP(){this.buffer()}function dP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fP(){this.buffer()}function hP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mP(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Er(this.sliceSerialize(e)).toLowerCase(),r.label=t}function pP(e){this.exit(e)}function gP(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Er(this.sliceSerialize(e)).toLowerCase(),r.label=t}function yP(e){this.exit(e)}function vP(){return"["}function wE(e,t,r,a){const l=r.createTracker(a);let o=l.move("[^");const u=r.enter("footnoteReference"),f=r.enter("reference");return o+=l.move(r.safe(r.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function xP(){return{enter:{gfmFootnoteCallString:cP,gfmFootnoteCall:dP,gfmFootnoteDefinitionLabelString:fP,gfmFootnoteDefinition:hP},exit:{gfmFootnoteCallString:mP,gfmFootnoteCall:pP,gfmFootnoteDefinitionLabelString:gP,gfmFootnoteDefinition:yP}}}function bP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:wE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),v=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),v(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
346
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?kE:SP))),h(),m}}function SP(e,t,r){return t===0?e:kE(e,t,r)}function kE(e,t,r){return(r?"":" ")+e}const wP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];jE.peek=NP;function kP(){return{canContainEols:["delete"],enter:{strikethrough:EP},exit:{strikethrough:CP}}}function jP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wP}],handlers:{delete:jE}}}function EP(e){this.enter({type:"delete",children:[]},e)}function CP(e){this.exit(e)}function jE(e,t,r,a){const l=r.createTracker(a),o=r.enter("strikethrough");let u=l.move("~~");return u+=r.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function NP(){return"~"}function _P(e){return e.length}function AP(e,t){const r=t||{},a=(r.align||[]).concat(),l=r.stringLength||_P,o=[],u=[],f=[],m=[];let h=0,v=-1;for(;++v<e.length;){const j=[],N=[];let E=-1;for(e[v].length>h&&(h=e[v].length);++E<e[v].length;){const R=TP(e[v][E]);if(r.alignDelimiters!==!1){const A=l(R);N[E]=A,(m[E]===void 0||A>m[E])&&(m[E]=A)}j.push(R)}u[v]=j,f[v]=N}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<h;)o[y]=lS(a[y]);else{const j=lS(a);for(;++y<h;)o[y]=j}y=-1;const x=[],b=[];for(;++y<h;){const j=o[y];let N="",E="";j===99?(N=":",E=":"):j===108?N=":":j===114&&(E=":");let R=r.alignDelimiters===!1?1:Math.max(1,m[y]-N.length-E.length);const A=N+"-".repeat(R)+E;r.alignDelimiters!==!1&&(R=N.length+R+E.length,R>m[y]&&(m[y]=R),b[y]=R),x[y]=A}u.splice(1,0,x),f.splice(1,0,b),v=-1;const k=[];for(;++v<u.length;){const j=u[v],N=f[v];y=-1;const E=[];for(;++y<h;){const R=j[y]||"";let A="",I="";if(r.alignDelimiters!==!1){const F=m[y]-(N[y]||0),O=o[y];O===114?A=" ".repeat(F):O===99?F%2?(A=" ".repeat(F/2+.5),I=" ".repeat(F/2-.5)):(A=" ".repeat(F/2),I=A):I=" ".repeat(F)}r.delimiterStart!==!1&&!y&&E.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&R==="")&&(r.delimiterStart!==!1||y)&&E.push(" "),r.alignDelimiters!==!1&&E.push(A),E.push(R),r.alignDelimiters!==!1&&E.push(I),r.padding!==!1&&E.push(" "),(r.delimiterEnd!==!1||y!==h-1)&&E.push("|")}k.push(r.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
347
|
-
`)}function TP(e){return e==null?"":String(e)}function lS(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 zP(e,t,r,a){const l=r.enter("blockquote"),o=r.createTracker(a);o.move("> "),o.shift(2);const u=r.indentLines(r.containerFlow(e,o.current()),RP);return l(),u}function RP(e,t,r){return">"+(r?"":" ")+e}function OP(e,t){return sS(e,t.inConstruct,!0)&&!sS(e,t.notInConstruct,!1)}function sS(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function oS(e,t,r,a){let l=-1;for(;++l<r.unsafe.length;)if(r.unsafe[l].character===`
|
|
348
|
-
`&&OP(r.stack,r.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
349
|
-
`}function DP(e,t){const r=String(e);let a=r.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=r.indexOf(t,l);return u}function MP(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 LP(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 UP(e,t,r,a){const l=LP(r),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(MP(e,r)){const y=r.enter("codeIndented"),x=r.indentLines(o,IP);return y(),x}const f=r.createTracker(a),m=l.repeat(Math.max(DP(o,l)+1,3)),h=r.enter("codeFenced");let v=f.move(m);if(e.lang){const y=r.enter(`codeFencedLang${u}`);v+=f.move(r.safe(e.lang,{before:v,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=r.enter(`codeFencedMeta${u}`);v+=f.move(" "),v+=f.move(r.safe(e.meta,{before:v,after:`
|
|
350
|
-
`,encode:["`"],...f.current()})),y()}return v+=f.move(`
|
|
351
|
-
`),o&&(v+=f.move(o+`
|
|
352
|
-
`)),v+=f.move(m),h(),v}function IP(e,t,r){return(r?"":" ")+e}function Yg(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 PP(e,t,r,a){const l=Yg(r),o=l==='"'?"Quote":"Apostrophe",u=r.enter("definition");let f=r.enter("label");const m=r.createTracker(a);let h=m.move("[");return h+=m.move(r.safe(r.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(r.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=r.enter("destinationRaw"),h+=m.move(r.safe(e.url,{before:h,after:e.title?" ":`
|
|
353
|
-
`,...m.current()}))),f(),e.title&&(f=r.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(r.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function BP(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 lu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wd(e,t,r){const a=Rs(e),l=Rs(t);return a===void 0?l===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===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}}EE.peek=$P;function EE(e,t,r,a){const l=BP(r),o=r.enter("emphasis"),u=r.createTracker(a),f=u.move(l);let m=u.move(r.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),v=wd(a.before.charCodeAt(a.before.length-1),h,l);v.inside&&(m=lu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),x=wd(a.after.charCodeAt(0),y,l);x.inside&&(m=m.slice(0,-1)+lu(y));const b=u.move(l);return o(),r.attentionEncodeSurroundingInfo={after:x.outside,before:v.outside},f+m+b}function $P(e,t,r){return r.options.emphasis||"*"}function FP(e,t){let r=!1;return Gg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,$p}),!!((!e.depth||e.depth<3)&&$g(e)&&(t.options.setext||r))}function qP(e,t,r,a){const l=Math.max(Math.min(6,e.depth||1),1),o=r.createTracker(a);if(FP(e,r)){const v=r.enter("headingSetext"),y=r.enter("phrasing"),x=r.containerPhrasing(e,{...o.current(),before:`
|
|
354
|
-
`,after:`
|
|
355
|
-
`});return y(),v(),x+`
|
|
356
|
-
`+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
357
|
-
`))+1))}const u="#".repeat(l),f=r.enter("headingAtx"),m=r.enter("phrasing");o.move(u+" ");let h=r.containerPhrasing(e,{before:"# ",after:`
|
|
358
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=lu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,r.options.closeAtx&&(h+=" "+u),m(),f(),h}CE.peek=HP;function CE(e){return e.value||""}function HP(){return"<"}NE.peek=ZP;function NE(e,t,r,a){const l=Yg(r),o=l==='"'?"Quote":"Apostrophe",u=r.enter("image");let f=r.enter("label");const m=r.createTracker(a);let h=m.move("![");return h+=m.move(r.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(r.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=r.enter("destinationRaw"),h+=m.move(r.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=r.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(r.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),u(),h}function ZP(){return"!"}_E.peek=VP;function _E(e,t,r,a){const l=e.referenceType,o=r.enter("imageReference");let u=r.enter("label");const f=r.createTracker(a);let m=f.move("![");const h=r.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const v=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:m,after:"]",...f.current()});return u(),r.stack=v,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function VP(){return"!"}AE.peek=QP;function AE(e,t,r){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<r.unsafe.length;){const u=r.unsafe[o],f=r.compilePattern(u);let m;if(u.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function QP(){return"`"}function TE(e,t){const r=$g(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}zE.peek=GP;function zE(e,t,r,a){const l=Yg(r),o=l==='"'?"Quote":"Apostrophe",u=r.createTracker(a);let f,m;if(TE(e,r)){const v=r.stack;r.stack=[],f=r.enter("autolink");let y=u.move("<");return y+=u.move(r.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),f(),r.stack=v,y}f=r.enter("link"),m=r.enter("label");let h=u.move("[");return h+=u.move(r.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=r.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(r.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=r.enter("destinationRaw"),h+=u.move(r.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=r.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(r.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function GP(e,t,r){return TE(e,r)?"<":"["}RE.peek=KP;function RE(e,t,r,a){const l=e.referenceType,o=r.enter("linkReference");let u=r.enter("label");const f=r.createTracker(a);let m=f.move("[");const h=r.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const v=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:m,after:"]",...f.current()});return u(),r.stack=v,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function KP(){return"["}function Xg(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 YP(e){const t=Xg(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function XP(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 OE(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 JP(e,t,r,a){const l=r.enter("list"),o=r.bulletCurrent;let u=e.ordered?XP(r):Xg(r);const f=e.ordered?u==="."?")":".":YP(r);let m=t&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const v=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&v&&(!v.children||!v.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(m=!0),OE(r)===u&&v){let y=-1;for(;++y<e.children.length;){const x=e.children[y];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),r.bulletCurrent=u;const h=r.containerFlow(e,a);return r.bulletLastUsed=u,r.bulletCurrent=o,l(),h}function WP(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 eB(e,t,r,a){const l=WP(r);let o=r.bulletCurrent||Xg(r);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.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=r.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,f.current()),v);return m(),h;function v(y,x,b){return x?(b?"":" ".repeat(u))+y:(b?o:o+" ".repeat(u-o.length))+y}}function tB(e,t,r,a){const l=r.enter("paragraph"),o=r.enter("phrasing"),u=r.containerPhrasing(e,a);return o(),l(),u}const nB=Vd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rB(e,t,r,a){return(e.children.some(function(u){return nB(u)})?r.containerPhrasing:r.containerFlow).call(r,e,a)}function iB(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}DE.peek=aB;function DE(e,t,r,a){const l=iB(r),o=r.enter("strong"),u=r.createTracker(a),f=u.move(l+l);let m=u.move(r.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),v=wd(a.before.charCodeAt(a.before.length-1),h,l);v.inside&&(m=lu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),x=wd(a.after.charCodeAt(0),y,l);x.inside&&(m=m.slice(0,-1)+lu(y));const b=u.move(l+l);return o(),r.attentionEncodeSurroundingInfo={after:x.outside,before:v.outside},f+m+b}function aB(e,t,r){return r.options.strong||"*"}function lB(e,t,r,a){return r.safe(e.value,a)}function sB(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 oB(e,t,r){const a=(OE(r)+(r.options.ruleSpaces?" ":"")).repeat(sB(r));return r.options.ruleSpaces?a.slice(0,-1):a}const ME={blockquote:zP,break:oS,code:UP,definition:PP,emphasis:EE,hardBreak:oS,heading:qP,html:CE,image:NE,imageReference:_E,inlineCode:AE,link:zE,linkReference:RE,list:JP,listItem:eB,paragraph:tB,root:rB,strong:DE,text:lB,thematicBreak:oB};function uB(){return{enter:{table:cB,tableData:uS,tableHeader:uS,tableRow:fB},exit:{codeText:hB,table:dB,tableData:Jm,tableHeader:Jm,tableRow:Jm}}}function cB(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function dB(e){this.exit(e),this.data.inTable=void 0}function fB(e){this.enter({type:"tableRow",children:[]},e)}function Jm(e){this.exit(e)}function uS(e){this.enter({type:"tableCell",children:[]},e)}function hB(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,mB));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function mB(e,t){return t==="|"?t:e}function pB(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=r?" ":"|";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:x,table:u,tableCell:m,tableRow:f}};function u(b,k,j,N){return h(v(b,j,N),b.align)}function f(b,k,j,N){const E=y(b,j,N),R=h([E]);return R.slice(0,R.indexOf(`
|
|
360
|
-
`))}function m(b,k,j,N){const E=j.enter("tableCell"),R=j.enter("phrasing"),A=j.containerPhrasing(b,{...N,before:o,after:o});return R(),E(),A}function h(b,k){return AP(b,{align:k,alignDelimiters:a,padding:r,stringLength:l})}function v(b,k,j){const N=b.children;let E=-1;const R=[],A=k.enter("table");for(;++E<N.length;)R[E]=y(N[E],k,j);return A(),R}function y(b,k,j){const N=b.children;let E=-1;const R=[],A=k.enter("tableRow");for(;++E<N.length;)R[E]=m(N[E],b,k,j);return A(),R}function x(b,k,j){let N=ME.inlineCode(b,k,j);return j.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function gB(){return{exit:{taskListCheckValueChecked:cS,taskListCheckValueUnchecked:cS,paragraph:vB}}}function yB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xB}}}function cS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vB(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.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===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function xB(e,t,r,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=r.createTracker(a);o&&f.move(u);let m=ME.listItem(e,t,r,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(v){return v+u}}function bB(){return[J8(),xP(),kP(),uB(),gB()]}function SB(e){return{extensions:[W8(),bP(e),jP(),pB(e),yB()]}}const wB={tokenize:_B,partial:!0},LE={tokenize:AB,partial:!0},UE={tokenize:TB,partial:!0},IE={tokenize:zB,partial:!0},kB={tokenize:RB,partial:!0},PE={name:"wwwAutolink",tokenize:CB,previous:$E},BE={name:"protocolAutolink",tokenize:NB,previous:FE},Ci={name:"emailAutolink",tokenize:EB,previous:qE},Qr={};function jB(){return{text:Qr}}let Ga=48;for(;Ga<123;)Qr[Ga]=Ci,Ga++,Ga===58?Ga=65:Ga===91&&(Ga=97);Qr[43]=Ci;Qr[45]=Ci;Qr[46]=Ci;Qr[95]=Ci;Qr[72]=[Ci,BE];Qr[104]=[Ci,BE];Qr[87]=[Ci,PE];Qr[119]=[Ci,PE];function EB(e,t,r){const a=this;let l,o;return u;function u(y){return!Zp(y)||!qE.call(a,a.previous)||Jg(a.events)?r(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return Zp(y)?(e.consume(y),f):y===64?(e.consume(y),m):r(y)}function m(y){return y===46?e.check(kB,v,h)(y):y===45||y===95||fn(y)?(o=!0,e.consume(y),m):v(y)}function h(y){return e.consume(y),l=!0,m}function v(y){return o&&l&&bn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):r(y)}}function CB(e,t,r){const a=this;return l;function l(u){return u!==87&&u!==119||!$E.call(a,a.previous)||Jg(a.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wB,e.attempt(LE,e.attempt(UE,o),r),r)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function NB(e,t,r){const a=this;let l="",o=!1;return u;function u(y){return(y===72||y===104)&&FE.call(a,a.previous)&&!Jg(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(y),e.consume(y),f):r(y)}function f(y){if(bn(y)&&l.length<5)return l+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const x=l.toLowerCase();if(x==="http"||x==="https")return e.consume(y),m}return r(y)}function m(y){return y===47?(e.consume(y),o?h:(o=!0,m)):r(y)}function h(y){return y===null||xd(y)||xt(y)||dl(y)||qd(y)?r(y):e.attempt(LE,e.attempt(UE,v),r)(y)}function v(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function _B(e,t,r){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):r(u)}function o(u){return u===null?r(u):t(u)}}function AB(e,t,r){let a,l,o;return u;function u(h){return h===46||h===95?e.check(IE,m,f)(h):h===null||xt(h)||dl(h)||h!==45&&qd(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?r(h):t(h)}}function TB(e,t){let r=0,a=0;return l;function l(u){return u===40?(r++,e.consume(u),l):u===41&&a<r?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(IE,t,o)(u):u===null||xt(u)||dl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function zB(e,t,r){return a;function a(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),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||xt(f)||dl(f)?t(f):r(f)}function l(f){return f===null||f===40||f===91||xt(f)||dl(f)?t(f):a(f)}function o(f){return bn(f)?u(f):r(f)}function u(f){return f===59?(e.consume(f),a):bn(f)?(e.consume(f),u):r(f)}}function RB(e,t,r){return a;function a(o){return e.consume(o),l}function l(o){return fn(o)?r(o):t(o)}}function $E(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function FE(e){return!bn(e)}function qE(e){return!(e===47||Zp(e))}function Zp(e){return e===43||e===45||e===46||e===95||fn(e)}function Jg(e){let t=e.length,r=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const OB={tokenize:$B,partial:!0};function DB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:IB,continuation:{tokenize:PB},exit:BB}},text:{91:{name:"gfmFootnoteCall",tokenize:UB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MB,resolveTo:LB}}}}function MB(e,t,r){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.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 r(m);const h=Er(a.sliceSerialize({start:u.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?r(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function LB(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+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[r+1],e[r+2],["enter",a,t],e[r+3],e[r+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",a,t]];return e.splice(r,e.length-r+1,...f),e}function UB(e,t,r){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),m}function m(y){return y!==94?r(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(y){if(o>999||y===93&&!u||y===null||y===91||xt(y))return r(y);if(y===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return l.includes(Er(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(y)}return xt(y)||(u=!0),o++,e.consume(y),y===92?v:h}function v(y){return y===91||y===92||y===93?(e.consume(y),o++,h):h(y)}}function IB(e,t,r){const a=this,l=a.parser.gfmFootnotes||(a.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",v):r(k)}function v(k){if(u>999||k===93&&!f||k===null||k===91||xt(k))return r(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Er(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return xt(k)||(f=!0),u++,e.consume(k),k===92?y:v}function y(k){return k===91||k===92||k===93?(e.consume(k),u++,v):v(k)}function x(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),et(e,b,"gfmFootnoteDefinitionWhitespace")):r(k)}function b(k){return t(k)}}function PB(e,t,r){return e.check(vu,t,e.attempt(OB,t,r))}function BB(e){e.exit("gfmFootnoteDefinition")}function $B(e,t,r){const a=this;return et(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):r(o)}}function FB(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},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 v={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},y={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},x=[["enter",v,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",y,f]],b=f.parser.constructs.insideSpan.null;b&&Jn(x,x.length,0,Hd(b,u.slice(h+1,m),f)),Jn(x,x.length,0,[["exit",y,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",v,f]]),Jn(u,h-1,m-h+3,x),m=h+x.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,v=this.events;let y=0;return x;function x(k){return h===126&&v[v.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const j=Rs(h);if(k===126)return y>1?m(k):(u.consume(k),y++,b);if(y<2&&!r)return m(k);const N=u.exit("strikethroughSequenceTemporary"),E=Rs(k);return N._open=!E||E===2&&!!j,N._close=!j||j===2&&!!E,f(k)}}}class qB{constructor(){this.map=[]}add(t,r,a){HB(this,t,r,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function HB(e,t,r,a){let l=0;if(!(r===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=r,e.map[l][2].push(...a);return}l+=1}e.map.push([t,r,a])}}function ZB(e,t){let r=!1;const a=[];for(;t<e.length;){const l=e[t];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function VB(){return{flow:{null:{name:"table",tokenize:QB,resolveAll:GB}}}}function QB(e,t,r){const a=this;let l=0,o=0,u;return f;function f(q){let re=a.events.length-1;for(;re>-1;){const ce=a.events[re][1].type;if(ce==="lineEnding"||ce==="linePrefix")re--;else break}const ae=re>-1?a.events[re][1].type:null,me=ae==="tableHead"||ae==="tableRow"?O:m;return me===O&&a.parser.lazy[a.now().line]?r(q):me(q)}function m(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(u=!0,o+=1),v(q)}function v(q){return q===null?r(q):Te(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):r(q):Ve(q)?et(e,v,"whitespace")(q):(o+=1,u&&(u=!1,l+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,v):(e.enter("data"),y(q)))}function y(q){return q===null||q===124||xt(q)?(e.exit("data"),v(q)):(e.consume(q),q===92?x:y)}function x(q){return q===92||q===124?(e.consume(q),y):y(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(q):(e.enter("tableDelimiterRow"),u=!1,Ve(q)?et(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):k(q))}function k(q){return q===45||q===58?N(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),j):F(q)}function j(q){return Ve(q)?et(e,N,"whitespace")(q):N(q)}function N(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),E):q===45?(o+=1,E(q)):q===null||Te(q)?I(q):F(q)}function E(q){return q===45?(e.enter("tableDelimiterFiller"),R(q)):F(q)}function R(q){return q===45?(e.consume(q),R):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(q))}function A(q){return Ve(q)?et(e,I,"whitespace")(q):I(q)}function I(q){return q===124?k(q):q===null||Te(q)?!u||l!==o?F(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):F(q)}function F(q){return r(q)}function O(q){return e.enter("tableRow"),$(q)}function $(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),$):q===null||Te(q)?(e.exit("tableRow"),t(q)):Ve(q)?et(e,$,"whitespace")(q):(e.enter("data"),V(q))}function V(q){return q===null||q===124||xt(q)?(e.exit("data"),$(q)):(e.consume(q),q===92?J:V)}function J(q){return q===92||q===124?(e.consume(q),V):V(q)}}function GB(e,t){let r=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,v,y;const x=new qB;for(;++r<e.length;){const b=e[r],k=b[1];b[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(dS(x,t,m,h,v),v=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(r,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,y=void 0,o=[0,0,0,0],u=[0,r+1,0,0],f&&(f=!1,v={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(r,0,[["enter",v,t]])),l=k.type==="tableDelimiterRow"?2:v?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],y=Jc(x,t,o,l,void 0,y),o=[0,0,0,0]),u[2]=r)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],y=Jc(x,t,o,l,void 0,y)),o=u,u=[o[1],r,0,0])):k.type==="tableHead"?(f=!0,m=r):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=r,o[1]!==0?(u[0]=u[1],y=Jc(x,t,o,l,r,y)):u[1]!==0&&(y=Jc(x,t,u,l,r,y)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=r)}for(m!==0&&dS(x,t,m,h,v),x.consume(t.events),r=-1;++r<t.events.length;){const b=t.events[r];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=ZB(t.events,r))}return e}function Jc(e,t,r,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(o.end=Object.assign({},us(t.events,r[0])),e.add(r[0],0,[["exit",o,t]]));const m=us(t.events,r[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(r[1],0,[["enter",o,t]]),r[2]!==0){const h=us(t.events,r[2]),v=us(t.events,r[3]),y={type:f,start:Object.assign({},h),end:Object.assign({},v)};if(e.add(r[2],0,[["enter",y,t]]),a!==2){const x=t.events[r[2]],b=t.events[r[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",r[3]>r[2]+1){const k=r[2]+1,j=r[3]-r[2]-1;e.add(k,j,[])}}e.add(r[3]+1,0,[["exit",y,t]])}return l!==void 0&&(o.end=Object.assign({},us(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function dS(e,t,r,a,l){const o=[],u=us(t.events,r);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(r+1,0,o)}function us(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const KB={name:"tasklistCheck",tokenize:XB};function YB(){return{text:{91:KB}}}function XB(e,t,r){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return xt(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):r(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(m)}function f(m){return Te(m)?t(m):Ve(m)?e.check({tokenize:JB},t,r)(m):r(m)}}function JB(e,t,r){return et(e,a,"whitespace");function a(l){return l===null?r(l):t(l)}}function WB(e){return Wj([jB(),DB(),FB(e),VB(),YB()])}const e$={};function t$(e){const t=this,r=e||e$,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(WB(r)),o.push(bB()),u.push(SB(r))}function HE({children:e,className:t}){return d.jsx("div",{className:Re("prose prose-sm max-w-none","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-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(B8,{remarkPlugins:[t$,X8],children:e})})}function n$({value:e,baseline:t,onChange:r,onRevert:a,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",{className:`rounded-md border bg-white ${m?"border-amber-300":"border-gray-200"}`,children:[d.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[d.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:["System Prompt Append",m&&d.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),d.jsx("div",{className:"flex gap-2",children:!o&&!l&&d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>u(!0),children:[d.jsx(Ad,{className:"h-3.5 w-3.5 mr-1.5"})," 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=>r(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-sm 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(be,{size:"sm",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(be,{size:"sm",onClick:()=>u(!1),children:"Done"})]}),d.jsx("p",{className:"text-xs 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-sm max-h-64 overflow-auto min-h-8",children:e?d.jsx(HE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}const r$={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function i$(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage?null:d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-yellow-50/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-sm",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-white px-2 py-0.5 text-xs border hover:bg-amber-100",onClick:()=>e.onJumpTo(t),children:r$[t]},t))})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-xs text-amber-900 font-medium",children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-xs text-red-800 font-medium",children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&d.jsx(be,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(be,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(be,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?"Saving…":"Save"})]})]})})}function Ka(e){return`agent-cfg-${e}`}function a$(e){switch(e){case"danger":return"border-red-300 bg-red-50 text-red-900";case"warning":return"border-amber-300 bg-amber-50 text-amber-900";case"muted":return"border-gray-300 bg-gray-50 text-gray-700";default:return"border-gray-200 bg-white text-gray-800"}}function l$(e){switch(e){case"danger":return"bg-red-500";case"warning":return"bg-amber-500";case"muted":return"bg-gray-400";default:return"bg-green-500"}}function s$(e){const{agent:t,clientStatus:r,runtimeState:a,isHuman:l}=e;return t.status==="suspended"?{tone:"muted",symbol:"◌",label:"Suspended"}:l?{tone:"neutral",symbol:"●",label:"Active"}:r!=null&&r.offlineSince&&!r.clientId?{tone:"muted",symbol:"○",label:"Unclaimed"}:r&&!r.online?{tone:"warning",symbol:"⚠",label:"Computer offline"}:a==="error"?{tone:"danger",symbol:"●",label:"Error"}:a==="working"?{tone:"neutral",symbol:"●",label:"Working"}:a==="idle"?{tone:"neutral",symbol:"●",label:"Idle"}:{tone:"neutral",symbol:"●",label:"Online"}}function o$(e){if(!e)return"—";const t=new Date(e).getTime(),r=Date.now()-t;if(!Number.isFinite(r)||r<0)return Cr(e);const a=Math.floor(r/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const l=Math.floor(a/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function u$(e){const{agent:t,cfg:r,clientStatus:a,runtimeType:l,activeSessions:o,isHuman:u}=e,f=s$(e),m=[];!u&&l&&m.push(l),!u&&typeof o=="number"&&m.push(`${o} session${o===1?"":"s"}`),r&&m.push(`config v${r.version}`);const h=a==null?void 0:a.offlineSince,v=!u&&a&&!a.online;return d.jsxs("div",{className:Re("rounded-md border px-4 py-3 text-sm space-y-1",a$(f.tone)),children:[d.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[d.jsx("span",{className:Re("inline-block h-2 w-2 rounded-full",l$(f.tone)),"aria-hidden":!0}),d.jsx("span",{children:f.symbol==="⚠"?f.symbol:null}),d.jsx("span",{children:f.label}),m.length>0&&d.jsxs("span",{className:"text-muted-foreground font-normal",children:["· ",m.join(" · ")]})]}),!u&&d.jsx("div",{className:"text-xs text-muted-foreground",children:a!=null&&a.clientId?d.jsxs(d.Fragment,{children:["Computer ",d.jsx("span",{className:"font-mono",children:a.clientId}),a.online?null:d.jsxs(d.Fragment,{children:[" · offline since ",d.jsx("span",{children:Cr(h)})]})]}):d.jsx("span",{children:"No computer bound yet"})}),r&&d.jsxs("div",{className:"text-xs text-muted-foreground",children:["Config updated by ",d.jsx("span",{className:"font-medium",children:r.updatedBy||"—"})," · ",o$(r.updatedAt)]}),v&&d.jsx("p",{className:"mt-1 text-xs text-amber-900",children:"Changes saved here won't take effect until the computer reconnects."}),!u&&!(a!=null&&a.clientId)&&t.status==="active"&&d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Configure now; it will apply when a computer claims this agent."})]})}function c$(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 d$(e,t){let r=t.size+1;for(;t.has(`${e}-${r}`);)r++;return`${e}-${r}`}function f$(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Wm(e,t){return e.map((r,a)=>({key:`${t}-${a+1}`,value:r,baseline:r,status:"unchanged"}))}function fS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:f$(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function ep(e,t){const r=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=d$(r,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:fS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:fS(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function h$(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Wm(e.payload.mcpServers,"mcp"),env:Wm(e.payload.env,"env"),git:Wm(e.payload.gitRepos,"git")}}function m$(e){const[t,r]=S.useState(null);S.useEffect(()=>{e&&t===null&&r(h$(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",u=a.promptAppend!==l,f=a.model!==o,m=S.useMemo(()=>{const A=[],I=V=>V.reduce((J,q)=>q.status==="unchanged"?J:J+1,0),F=I(a.mcp),O=I(a.env),$=I(a.git);return u&&A.push("prompt"),f&&A.push("model"),F>0&&A.push("mcp"),O>0&&A.push("env"),$>0&&A.push("git"),{anyDirty:A.length>0,dirtySections:A,counts:{prompt:u?1:0,model:f?1:0,mcp:F,env:O,git:$}}},[a,u,f]),h=S.useCallback(A=>{r(I=>I&&A(I))},[]),v=S.useCallback(A=>h(I=>({...I,promptAppend:A})),[h]),y=S.useCallback(()=>h(A=>({...A,promptAppend:l})),[h,l]),x=S.useCallback(A=>h(I=>({...I,model:A})),[h]),b=S.useCallback(()=>h(A=>({...A,model:o})),[h,o]),k=S.useMemo(()=>ep("mcp",h),[h]),j=S.useMemo(()=>ep("env",h),[h]),N=S.useMemo(()=>ep("git",h),[h]),E=S.useCallback(()=>{r(null)},[]),R=S.useCallback(()=>{if(!t||!e)return{};const A={};u&&(A.prompt={append:t.promptAppend}),f&&(A.model=t.model);const I=m.counts.mcp>0,F=m.counts.env>0,O=m.counts.git>0;return I&&(A.mcpServers=t.mcp.filter($=>$.status!=="deleted").map($=>$.value)),F&&(A.env=t.env.filter($=>$.status!=="deleted").map($=>{const V=$.value;return V.sensitive&&V.value===Op?{key:V.key,value:Op,sensitive:!0}:V})),O&&(A.gitRepos=t.git.filter($=>$.status!=="deleted").map($=>$.value)),A},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:v,revertPrompt:y,setModel:x,revertModel:b,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:N.add,updateGit:N.update,deleteGit:N.remove,undoDeleteGit:N.undo,resetAll:E,buildPayloadPatch:R}}const p$=Object.values(t6);function g$(){var jn,bu,Ca,Na,_a,Tr,Aa,_i,Su;const t=$2().uuid??"",r=Vr(),a=er(),l=qe({queryKey:["agent",t],queryFn:()=>Ok(t),enabled:!!t}),o=qe({queryKey:["agent-config",t],queryFn:()=>fL(t),enabled:!!t&&((jn=l.data)==null?void 0:jn.type)!=="human"}),u=qe({queryKey:["agent-client-status",t],queryFn:()=>pL(t),enabled:!!t&&((bu=l.data)==null?void 0:bu.type)!=="human"}),f=qe({queryKey:["agent-sessions-active",t],queryFn:()=>Us(t,{state:"active"}),enabled:!!t&&((Ca=l.data)==null?void 0:Ca.type)!=="human"}),m=qe({queryKey:["adapters"],queryFn:Ij}),h=qe({queryKey:["adapter-mappings"],queryFn:Lj}),{data:v}=qe({queryKey:["adapter-statuses"],queryFn:Uj,refetchInterval:15e3}),y=((Na=m.data)==null?void 0:Na.filter(ue=>ue.agentId===t))??[],x=((_a=h.data)==null?void 0:_a.filter(ue=>ue.agentId===t))??[],b=m$(o.data),[k,j]=S.useState(null),[N,E]=S.useState(null),R=vt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const ue=b.buildPayloadPatch();return hL(t,{expectedVersion:o.data.version,payload:ue})},onSuccess:ue=>{a.setQueryData(["agent-config",t],ue),j(null),E(null)},onError:ue=>{if(ue instanceof _d&&ue.status===409){E("Someone else saved a newer version while you were editing."),j(null);return}j(ue instanceof Error?ue.message:String(ue))}}),A=S.useCallback(()=>{E(null),j(null),a.invalidateQueries({queryKey:["agent-config",t]}),b.resetAll()},[a,t,b]),I=S.useCallback(ue=>{const Qe=document.getElementById(Ka(ue));Qe&&Qe.scrollIntoView({behavior:"smooth",block:"start"})},[]),F=vt({mutationFn:ue=>Q0(t,ue),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),O=vt({mutationFn:()=>lD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),$=vt({mutationFn:()=>sD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),V=vt({mutationFn:()=>aD(t),onSuccess:()=>r("/agents")}),J=vt({mutationFn:()=>oD(t)}),[q,re]=S.useState(!1),ae=S.useRef(null);S.useEffect(()=>{if(!q)return;function ue(Qe){ae.current&&!ae.current.contains(Qe.target)&&re(!1)}return window.addEventListener("mousedown",ue),()=>window.removeEventListener("mousedown",ue)},[q]);const[me,ce]=S.useState(!1),[ee,P]=S.useState(""),[W,pe]=S.useState(null),Ce=qe({queryKey:["clients"],queryFn:zd,enabled:me}),z=vt({mutationFn:ue=>Q0(t,{clientId:ue}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),ce(!1),P(""),pe(null)},onError:ue=>pe(ue instanceof Error?ue.message:String(ue))}),[U,T]=S.useState(!1),[C,X]=S.useState(null),[H,oe]=S.useState(tp),[ye,De]=S.useState(""),ve=vt({mutationFn:async()=>{const ue=hS(H);if(!ue)throw new Error("Credentials are required");return uL({platform:H.platform,agentId:t,credentials:ue,status:H.status})},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),ne()}}),jt=vt({mutationFn:()=>{if(!C)throw new Error("No adapter selected");const ue={status:H.status},Qe=hS(H);return Qe&&(ue.credentials=Qe),cL(C,ue)},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),ne()}}),Wt=vt({mutationFn:dL,onSuccess:()=>a.invalidateQueries({queryKey:["adapters"]})}),wn=vt({mutationFn:()=>sL({platform:H.platform,externalUserId:H.externalUserId,agentId:t,boundVia:"manual",displayName:H.displayName||void 0}),onSuccess:()=>{a.invalidateQueries({queryKey:["adapter-mappings"]}),ne()}}),xr=vt({mutationFn:oL,onSuccess:()=>a.invalidateQueries({queryKey:["adapter-mappings"]})}),[en,Gr]=S.useState(null),_r=vt({mutationFn:()=>mL(t,b.buildPayloadPatch()),onSuccess:ue=>{const Qe=ue.diff.length?ue.diff.map(pn=>`${pn.op} ${pn.path}`).join(`
|
|
361
|
-
`):"(no changes)";Gr(Qe)},onError:ue=>Gr(`Dry run failed: ${ue instanceof Error?ue.message:String(ue)}`)});if(S.useEffect(()=>{if(!b.summary.anyDirty)return;const ue=Qe=>{Qe.preventDefault(),Qe.returnValue=""};return window.addEventListener("beforeunload",ue),()=>window.removeEventListener("beforeunload",ue)},[b.summary.anyDirty]),l.isLoading)return d.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(l.error)return d.jsxs("div",{className:"text-destructive",children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const Et=l.data;if(!Et)return d.jsx("div",{className:"text-muted-foreground",children:"Agent not found"});const Kt=Et.type==="human",kn=u.data,Kr=((Tr=f.data)==null?void 0:Tr.length)??0,Ni=!Kt&&!(kn!=null&&kn.clientId),$s=!Kt&&kn?!kn.online&&!!kn.clientId:!1,yl=Et,tn=yl.runtimeState??null,Fs=yl.runtimeType??null;function ne(){T(!1),X(null),oe(tp),De("")}function he(ue){X(ue.id),oe({...tp,platform:ue.platform,status:ue.status}),T(!0)}function Oe(ue){if(ue.preventDefault(),De(""),Kt){if(!H.externalUserId)return;wn.mutate();return}if(H.platform==="feishu"){if(!C&&(!H.feishuAppId||!H.feishuAppSecret)){De("App ID and App Secret are required");return}}else if(H.platform==="kael"){if(!C&&(!H.kaelUserId||!H.kaelProjectId)){De("User ID and Project ID are required");return}}else{const Qe=H.credentialsJson.trim();if(!C&&!Qe){De("Credentials are required");return}if(Qe)try{JSON.parse(Qe)}catch{De("Invalid JSON");return}}C?jt.mutate():ve.mutate()}const $e=ve.error??jt.error??wn.error,nt=ve.isPending||jt.isPending||wn.isPending,mn=c$({activeSessions:Kr,isUnclaimed:Ni,isOffline:$s}),br=b.draft.mcp.filter(ue=>ue.status!=="deleted"),nn=b.draft.env.filter(ue=>ue.status!=="deleted"),Mt=b.draft.git.filter(ue=>ue.status!=="deleted"),un=ue=>new Set(br.filter(Qe=>Qe.key!==ue).map(Qe=>Qe.value.name.toLowerCase())),ct=ue=>new Set(nn.filter(Qe=>Qe.key!==ue).map(Qe=>Qe.value.key)),Ar=ue=>new Set(Mt.filter(Qe=>Qe.key!==ue).map(Qe=>{const{value:pn}=Qe;return pn.localPath?pn.localPath:((pn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean));return d.jsxs("div",{className:"space-y-5 pb-24",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>r("/agents"),children:d.jsx(QA,{className:"h-4 w-4"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h1",{className:"text-2xl font-semibold truncate",children:Et.displayName??Et.name}),d.jsxs("p",{className:"text-xs text-muted-foreground font-mono truncate",children:["@",Et.name??Et.uuid," · ",Et.type]})]}),d.jsxs("div",{className:"relative",ref:ae,children:[d.jsx(be,{variant:"outline",size:"icon",onClick:()=>re(ue=>!ue),title:"More actions",children:d.jsx(pw,{className:"h-4 w-4"})}),q&&d.jsx("div",{className:"absolute right-0 mt-1 z-40 min-w-48 rounded-md border bg-white shadow-lg text-sm",children:d.jsxs("ul",{className:"py-1",children:[!Kt&&Et.status==="active"&&d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>{re(!1),J.reset(),J.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50 flex items-center gap-2",disabled:J.isPending,children:[d.jsx(kT,{className:"h-3.5 w-3.5"}),J.isPending?"Testing…":"Test connection"]})}),Et.status==="active"?d.jsx("li",{children:d.jsx("button",{type:"button",onClick:()=>{re(!1),confirm("Suspend this agent? All tokens will be revoked.")&&O.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50",children:"Suspend"})}):d.jsx("li",{children:d.jsx("button",{type:"button",onClick:()=>{re(!1),$.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50",children:"Reactivate"})}),d.jsx("li",{className:"border-t",children:d.jsx("a",{href:`#${Ka("prompt")}`,onClick:()=>re(!1),className:"block px-3 py-1.5 text-xs text-muted-foreground hover:bg-gray-50",children:"Jump to Behavior"})})]})})]})]}),(J.data||J.error)&&d.jsx(S$,{result:J.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>J.reset()}),d.jsx(u$,{agent:Et,cfg:o.data,clientStatus:kn,runtimeState:tn,runtimeType:Fs,activeSessions:Kr,isHuman:Kt}),Ni&&Et.status==="active"&&d.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-4 py-3 flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"text-sm text-amber-900",children:[d.jsx("div",{className:"font-medium",children:"No computer bound"}),d.jsx("div",{className:"text-xs text-amber-800/80",children:"Bind this agent to a computer so it can run. A computer will also claim it on first WebSocket connect."})]}),d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>ce(!0),children:[d.jsx(k0,{className:"h-4 w-4 mr-2"}),"Bind Computer"]})]}),d.jsx(jL,{agent:Et,onSave:async ue=>{await F.mutateAsync(ue)}}),!Kt&&d.jsxs(y$,{loaded:!!o.data,loading:o.isLoading,error:o.error?String(o.error):null,version:((Aa=o.data)==null?void 0:Aa.version)??null,dirty:b.summary.anyDirty,children:[d.jsx("div",{id:Ka("prompt"),children:d.jsx(n$,{value:b.draft.promptAppend,baseline:((_i=o.data)==null?void 0:_i.payload.prompt.append)??"",onChange:b.setPromptAppend,onRevert:b.revertPrompt,disabled:Et.status!=="active"})}),d.jsx("div",{id:Ka("model"),children:d.jsx(AL,{value:b.draft.model,baseline:((Su=o.data)==null?void 0:Su.payload.model)??"",onChange:b.setModel,onRevert:b.revertModel,disabled:Et.status!=="active"})}),d.jsx("div",{id:Ka("mcp"),children:d.jsx(CL,{items:b.draft.mcp,otherNames:un,onAdd:b.addMcp,onUpdate:b.updateMcp,onDelete:b.deleteMcp,onUndoDelete:b.undoDeleteMcp,disabled:Et.status!=="active"})}),d.jsx("div",{id:Ka("env"),children:d.jsx(bL,{items:b.draft.env,otherKeys:ct,onAdd:b.addEnv,onUpdate:b.updateEnv,onDelete:b.deleteEnv,onUndoDelete:b.undoDeleteEnv,disabled:Et.status!=="active"})}),d.jsx("div",{id:Ka("git"),children:d.jsx(wL,{items:b.draft.git,otherPaths:Ar,onAdd:b.addGit,onUpdate:b.updateGit,onDelete:b.deleteGit,onUndoDelete:b.undoDeleteGit,disabled:Et.status!=="active"})}),en&&d.jsx("pre",{className:"whitespace-pre-wrap rounded border bg-gray-50 p-2 text-xs",children:en})]}),d.jsxs(ul,{children:[d.jsxs(Ts,{className:"flex flex-row items-center justify-between",children:[d.jsxs(zs,{className:"flex items-center gap-2 text-base",children:[Kt?d.jsx(k0,{className:"h-4 w-4"}):d.jsx(WA,{className:"h-4 w-4"}),"Platform Bindings"]}),d.jsxs(be,{size:"sm",variant:"outline",onClick:()=>T(!0),children:[d.jsx(fl,{className:"h-4 w-4 mr-2"}),Kt?"Bind User":"Bind Bot"]})]}),d.jsx(cl,{children:Kt?d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Platform"}),d.jsx(Ee,{children:"External User ID"}),d.jsx(Ee,{children:"Display Name"}),d.jsx(Ee,{children:"Bound Via"}),d.jsx(Ee,{children:"Created"}),d.jsx(Ee,{className:"w-16"})]})}),d.jsx(Zr,{children:x.length===0?d.jsx(at,{children:d.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):x.map(ue=>d.jsxs(at,{children:[d.jsx(xe,{children:d.jsx(Gt,{variant:"secondary",children:ue.platform})}),d.jsx(xe,{className:"font-mono text-sm",children:ue.externalUserId}),d.jsx(xe,{children:ue.displayName??"—"}),d.jsx(xe,{children:d.jsx(Gt,{variant:"outline",children:ue.boundVia??"—"})}),d.jsx(xe,{className:"text-muted-foreground",children:Cr(ue.createdAt)}),d.jsx(xe,{children:d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this binding?")&&xr.mutate(ue.id)},disabled:xr.isPending,children:d.jsx(Wo,{className:"h-4 w-4"})})})]},ue.id))})]}):d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Platform"}),d.jsx(Ee,{children:"Status"}),d.jsx(Ee,{children:"Connection"}),d.jsx(Ee,{children:"Created"}),d.jsx(Ee,{className:"w-24"})]})}),d.jsx(Zr,{children:y.length===0?d.jsx(at,{children:d.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):y.map(ue=>{const Qe=v==null?void 0:v.find(wu=>wu.configId===ue.id),pn=ue.platform==="kael"?ue.status==="active":!!(Qe!=null&&Qe.connected);return d.jsxs(at,{children:[d.jsx(xe,{children:d.jsx(Gt,{variant:"secondary",children:ue.platform})}),d.jsx(xe,{children:d.jsx(Gt,{variant:ue.status==="active"?"default":"destructive",children:ue.status})}),d.jsx(xe,{children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:Re("inline-block h-2 w-2 rounded-full",pn?"bg-green-500":"bg-gray-300")}),d.jsx("span",{className:"text-xs text-muted-foreground",children:pn?"Online":"Offline"})]})}),d.jsx(xe,{className:"text-muted-foreground",children:Cr(ue.createdAt)}),d.jsx(xe,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>he(ue),title:"Edit",children:"…"}),d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this bot binding?")&&Wt.mutate(ue.id)},disabled:Wt.isPending,title:"Delete",children:d.jsx(Wo,{className:"h-4 w-4"})})]})})]},ue.id)})})]})})]}),d.jsx(gL,{agent:Et,suspendPending:O.isPending,reactivatePending:$.isPending,deletePending:V.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&O.mutate()},onReactivate:()=>$.mutate(),onDelete:()=>V.mutate()}),!Kt&&d.jsx(i$,{summary:b.summary,saveHint:mn,conflictMessage:N,errorMessage:k,saving:R.isPending,onSave:()=>R.mutate(),onDiscard:()=>{(!b.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(b.resetAll(),j(null),E(null))},onReloadRemote:A,onJumpTo:I}),!Kt&&b.summary.anyDirty&&d.jsx("div",{className:"text-xs text-muted-foreground",children:d.jsx("button",{type:"button",onClick:()=>_r.mutate(),className:"underline hover:text-gray-900",disabled:_r.isPending,children:_r.isPending?"Computing dry-run…":"Preview server-side diff"})}),d.jsx(Ln,{open:me,onOpenChange:ue=>{ce(ue),ue||(P(""),pe(null),z.reset())},children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",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."}),Ce.isLoading?d.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading computers…"}):Ce.error?d.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load computers: ",Ce.error instanceof Error?Ce.error.message:"Unknown"]}):d.jsx(v$,{clients:Ce.data??[],selected:ee,onSelect:P}),W&&d.jsx("div",{className:"text-sm text-destructive",children:W})]}),d.jsxs(Un,{children:[d.jsx(be,{variant:"outline",onClick:()=>ce(!1),children:"Cancel"}),d.jsx(be,{disabled:!ee||z.isPending,onClick:()=>{pe(null),z.mutate(ee)},children:z.isPending?"Binding…":"Bind"})]})]})}),d.jsx(Ln,{open:U,onOpenChange:ue=>ue?T(!0):ne(),children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:Kt?"Bind External User":C?"Edit Bot Binding":"Bind Bot"})}),d.jsxs("form",{onSubmit:Oe,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:H.platform,onChange:ue=>oe({...H,platform:ue.target.value}),disabled:!!C,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:p$.map(ue=>d.jsx("option",{value:ue,children:ue},ue))})]}),Kt?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"binding-ext-id",children:"External User ID"}),d.jsx(gt,{id:"binding-ext-id",value:H.externalUserId,onChange:ue=>oe({...H,externalUserId:ue.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"binding-name",children:"Display Name (optional)"}),d.jsx(gt,{id:"binding-name",value:H.displayName,onChange:ue=>oe({...H,displayName:ue.target.value})})]})]}):d.jsxs(d.Fragment,{children:[H.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Ye,{htmlFor:"feishu-app-id",children:["App ID",C?" — leave empty to keep existing":""]}),d.jsx(gt,{id:"feishu-app-id",value:H.feishuAppId,onChange:ue=>oe({...H,feishuAppId:ue.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Ye,{htmlFor:"feishu-app-secret",children:["App Secret",C?" — leave empty to keep existing":""]}),d.jsx(gt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:H.feishuAppSecret,onChange:ue=>oe({...H,feishuAppSecret:ue.target.value}),placeholder:"••••••••"})]})]}):H.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Ye,{htmlFor:"kael-user-id",children:["User ID",C?" — leave empty to keep existing":""]}),d.jsx(gt,{id:"kael-user-id",value:H.kaelUserId,onChange:ue=>oe({...H,kaelUserId:ue.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Ye,{htmlFor:"kael-project-id",children:["Project ID",C?" — leave empty to keep existing":""]}),d.jsx(gt,{id:"kael-project-id",value:H.kaelProjectId,onChange:ue=>oe({...H,kaelProjectId:ue.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!C&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Ye,{htmlFor:"binding-creds",children:["Credentials (JSON)",C?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:H.credentialsJson,onChange:ue=>oe({...H,credentialsJson:ue.target.value}),rows:4,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),ye&&d.jsx("p",{className:"text-sm text-destructive",children:ye}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:H.status,onChange:ue=>oe({...H,status:ue.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm 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"})]})]})]}),$e instanceof Error&&d.jsx("div",{className:"text-sm text-destructive",children:$e.message}),d.jsx(Un,{children:d.jsx(be,{type:"submit",disabled:nt,children:nt?"Saving...":C?"Update":"Create"})})]})]})})]})}function y$(e){return d.jsxs("section",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-base font-semibold",children:"Behavior"}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.version!=null&&d.jsxs("span",{children:["v",e.version]}),e.dirty&&d.jsx("span",{className:"ml-2 text-amber-700",children:"· draft"})]})]}),e.loading&&d.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration…"}),e.error&&d.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load configuration: ",e.error]}),e.loaded&&d.jsx("div",{className:"space-y-3",children:e.children})]})}const tp={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function hS(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 v$({clients:e,selected:t,onSelect:r}){const a=e.filter(l=>l.status==="connected");return a.length===0?d.jsxs("div",{className:"rounded border bg-muted/40 px-3 py-4 text-sm text-muted-foreground",children:["No connected computers available. Run"," ",d.jsx("code",{className:"font-mono text-xs",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):d.jsx("ul",{className:"divide-y rounded border max-h-64 overflow-y-auto",children:a.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>r(l.id),className:Re("w-full text-left px-3 py-2 flex items-center gap-3 hover:bg-gray-50",o&&"bg-blue-50"),children:[d.jsx("span",{className:Re("inline-block h-2 w-2 rounded-full",u?"bg-green-500":"bg-gray-400"),"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-sm font-medium truncate",children:l.hostname??l.id}),d.jsxs("span",{className:"block text-xs text-muted-foreground font-mono truncate",children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),d.jsx("span",{className:"text-xs text-muted-foreground",children:l.status})]})},l.id)})})}const x$={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},b$={connected:{icon:"●",color:"text-green-500",label:"Connected"},stale:{icon:"◐",color:"text-yellow-500",label:"Stale"},disconnected:{icon:"○",color:"text-gray-400",label:"Disconnected"}};function S$({result:e,onDismiss:t}){const r={success:"border-l-green-500",timeout:"border-l-yellow-500",offline:"border-l-gray-400",stale:"border-l-yellow-500",error:"border-l-red-500"}[e.status],a=e.status==="success"?"default":e.status==="timeout"||e.status==="stale"?"secondary":"destructive",l=e.connection,o=l?b$[l.health]:null;return d.jsx(ul,{className:Re("border-l-4",r),children:d.jsx(cl,{className:"pt-4",children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Gt,{variant:a,children:x$[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{className:"text-sm text-muted-foreground",children:e.message}),l&&d.jsxs("div",{className:"text-xs space-y-1 border-t pt-2 mt-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[o&&d.jsxs("span",{className:o.color,children:[o.icon," ",o.label]}),l.runtimeState&&d.jsxs("span",{className:"text-muted-foreground",children:["runtime: ",l.runtimeState]})]}),l.client?d.jsxs("div",{className:"text-muted-foreground",children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{className:"text-muted-foreground",children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{className:"text-muted-foreground",children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.jsx("p",{className:"text-sm mt-2 whitespace-pre-wrap bg-muted rounded p-2 max-h-40 overflow-auto",children:e.responseContent})]}),d.jsx(be,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})})}function su({state:e,size:t=8,className:r}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:Re("shrink-0",r),style:a,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:"1px solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?d.jsx("span",{className:Re("shrink-0",r),style:{...a,border:"1.5px 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:Re("shrink-0",r),style:{...a,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:Re("shrink-0",r),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.jsx("span",{className:Re("shrink-0",r),style:{...a,borderRadius:"50%",border:"1px solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function w$(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function k$({agent:e,open:t,onClose:r,onBound:a}){var y;const[l,o]=S.useState(!1),u=qe({queryKey:["connect-token",e.uuid],queryFn:()=>Ow(),enabled:t,staleTime:6e4}),f=qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Ok(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});S.useEffect(()=>{const x=f.data;x!=null&&x.clientId&&a(x)},[f.data,a]);const m=((y=u.data)==null?void 0:y.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${w$(e.name)} --agent-id ${e.uuid} && `+m:m;function v(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(Ln,{open:t,onOpenChange:x=>!x&&r(),children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Wn,{children:d.jsx(In,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm 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-xs font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(be,{variant:"outline",size:"icon",className:"shrink-0",onClick:v,disabled:!h,children:l?d.jsx(cg,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(dg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(su,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.jsx("p",{className:"text-xs 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(Un,{children:d.jsx(be,{variant:"outline",onClick:r,children:"Skip for now"})})]})})}const j$=/^[a-z0-9_-]+$/,Wc=100;function E$(e){if(!e||e.length===0)return{};const t={},r=["name","displayName","clientId"];for(const a of e){const l=a.path[0];if(typeof l=="string"&&r.includes(l)){const o=l;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function C$(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,100)}function N$({open:e,onOpenChange:t,onCreated:r}){const a=er(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(""),[v,y]=S.useState(!1),[x,b]=S.useState("claude-code"),[k,j]=S.useState("form"),[N,E]=S.useState([]),[R,A]=S.useState(null),[I,F]=S.useState(!1),[O,$]=S.useState({});S.useEffect(()=>{e&&(o(""),f(!1),h(""),y(!1),b("claude-code"),j("form"),E([]),A(null),F(!1),$({}))},[e]);const V=C$(l),J=vt({mutationFn:async P=>{const W=m.trim()||l.trim()||"Untitled assistant";return iD({name:V||void 0,type:"personal_assistant",displayName:W,clientId:P.clientId})},onSuccess:P=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),r(P,x)}}),re={...S.useMemo(()=>{const P=J.error;if(!P)return{};if(P instanceof _d){const W=E$(P.issues);return Object.keys(W).length>0?W: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}:{}},[J.error]),...O};function ae(){const P={};return V?V.length>Wc?P.name=`Hub ID must be at most ${Wc} characters (got ${V.length}).`:j$.test(V)||(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 me(P){var pe,Ce;P.preventDefault();const W=ae();if($(W),!(Object.keys(W).length>0)){if(x!=="claude-code"){J.mutate({clientId:void 0});return}F(!0);try{const U=(await zd()).filter(C=>C.status==="connected");if(U.length===0){J.mutate({clientId:void 0});return}if(U.length===1){J.mutate({clientId:(pe=U[0])==null?void 0:pe.id});return}const T=[...U].sort((C,X)=>X.lastSeenAt.localeCompare(C.lastSeenAt));E(T),A(((Ce=T[0])==null?void 0:Ce.id)??null),j("pick-computer")}catch{J.mutate({clientId:void 0})}finally{F(!1)}}}function ce(){R&&J.mutate({clientId:R})}const ee=l.trim().length>0&&!J.isPending&&!I;return k==="pick-computer"?d.jsx(Ln,{open:e,onOpenChange:t,children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Wn,{children:d.jsx(In,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm 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:N.map(P=>{const W=R===P.id;return d.jsxs("label",{className:W?"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:W,onChange:()=>A(P.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium truncate",children:P.hostname??P.id}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[P.os??"unknown OS"," · last seen ",new Date(P.lastSeenAt).toLocaleString()]})]})]},P.id)})}),re.clientId&&d.jsx("p",{className:"text-sm text-destructive",children:re.clientId}),re._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:re._root})]}),d.jsxs(Un,{children:[d.jsx(be,{variant:"outline",onClick:()=>j("form"),disabled:J.isPending,children:"Back"}),d.jsx(be,{onClick:ce,disabled:!R||J.isPending,children:J.isPending?"Creating…":"Create"})]})]})}):d.jsx(Ln,{open:e,onOpenChange:t,children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Wn,{children:d.jsx(In,{children:"New Agent"})}),d.jsxs("form",{onSubmit:me,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"new-agent-name",children:"Name"}),d.jsx(gt,{id:"new-agent-name",value:l,onChange:P=>{const W=P.target.value;o(W),f(!0),v||h(W),O.name&&$(pe=>({...pe,name:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Wc,"aria-invalid":re.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error"}),d.jsxs("p",{id:"new-agent-name-help",className:"text-xs text-muted-foreground",children:["Hub ID: lowercase letters, digits, hyphens (-), and underscores (_). Up to ",Wc," characters. Permanent after creation — you can't rename the agent later."]}),u&&V&&d.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID on hub: ",d.jsx("span",{className:"font-mono",children:V})]}),re.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-xs text-destructive",children:re.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(gt,{id:"new-agent-display-name",value:m,onChange:P=>{h(P.target.value),y(!0),O.displayName&&$(W=>({...W,displayName:void 0}))},placeholder:"How teammates see this agent",maxLength:200,"aria-invalid":re.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-xs text-muted-foreground",children:"Shown in chats and lists. Defaults to the Name above; you can change it anytime later."}),re.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-xs text-destructive",children:re.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:x==="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:x==="claude-code",onChange:()=>b("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-xs 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-sm font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),re._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:re._root}),d.jsx(Un,{children:d.jsx(be,{type:"submit",disabled:!ee,children:I?"Checking computers…":J.isPending?"Creating…":"Create"})})]})]})})}const _$=Object.values(i6);function mS(e){return[...e].sort((t,r)=>{const a=(t.name??t.displayName??"").toLowerCase(),l=(r.name??r.displayName??"").toLowerCase();return a.localeCompare(l)})}function A$(){const e=Vr(),{memberId:t}=ba(),[r,a]=S.useState(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(null),v=wa(),y=Og(),{data:x,isLoading:b,error:k}=qe({queryKey:["agents",r,l],queryFn:()=>xg({limit:100,cursor:r,type:l||void 0})}),{myAgents:j,teamAgents:N}=S.useMemo(()=>{if(!(x!=null&&x.items))return{myAgents:[],teamAgents:[]};const A=[],I=[];for(const F of x.items)t&&F.managerId===t?A.push(F):I.push(F);return{myAgents:mS(A),teamAgents:mS(I)}},[x,t]);function E(A,I){if(f(!1),A.clientId){e(`/?a=${A.uuid}`);return}if(I==="claude-code"){h(A);return}e(`/?a=${A.uuid}`)}function R(A){const F=A.runtimeState,O={idle:"bg-green-500",working:"bg-blue-500",error:"bg-red-500"};return d.jsxs(at,{className:"cursor-pointer",onClick:()=>e(`/agents/${A.uuid}`),children:[d.jsx(xe,{className:"font-mono text-sm",children:A.name}),d.jsx(xe,{children:A.displayName??"—"}),d.jsx(xe,{children:d.jsx(Gt,{variant:"secondary",children:A.type})}),d.jsx(xe,{className:"font-mono text-sm text-muted-foreground",children:A.delegateMention?v(A.delegateMention):"—"}),d.jsx(xe,{className:"text-sm text-muted-foreground",children:y(A.managerId)}),d.jsx(xe,{children:F?d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:Re("inline-block h-2 w-2 rounded-full",O[F]??"bg-gray-300")}),d.jsx("span",{className:"text-xs text-muted-foreground",children:F})]}):d.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-gray-300",title:"not running"})}),d.jsx(xe,{children:d.jsx(Gt,{variant:A.status==="active"?"default":"destructive",children:A.status})}),d.jsx(xe,{className:"text-muted-foreground",children:Cr(A.createdAt)})]},A.uuid)}return d.jsxs("div",{className:"space-y-8",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("h1",{className:"text-2xl font-semibold",children:"Agents"}),d.jsxs("select",{value:l,onChange:A=>{o(A.target.value),a(void 0)},className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"All types"}),_$.map(A=>d.jsx("option",{value:A,children:A},A))]})]}),b?d.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):k?d.jsxs("div",{className:"text-center py-8 text-destructive",children:["Failed to load agents: ",k instanceof Error?k.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsxs("section",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h2",{className:"text-lg font-medium",children:"My Agents"}),d.jsxs(be,{size:"sm",onClick:()=>f(!0),children:[d.jsx(fl,{className:"h-4 w-4 mr-2"}),"New Agent"]})]}),d.jsx("div",{className:"border rounded-lg",children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Name"}),d.jsx(Ee,{children:"Display Name"}),d.jsx(Ee,{children:"Type"}),d.jsx(Ee,{children:"Delegate"}),d.jsx(Ee,{children:"Owner"}),d.jsx(Ee,{children:"Runtime"}),d.jsx(Ee,{children:"Status"}),d.jsx(Ee,{children:"Created"})]})}),d.jsx(Zr,{children:j.length===0?d.jsx(at,{children:d.jsx(xe,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"No agents yet — create one to get started"})}):j.map(A=>R(A))})]})})]}),N.length>0&&d.jsxs("section",{children:[d.jsx("h2",{className:"text-lg font-medium mb-3",children:"Team Agents"}),d.jsx("div",{className:"border rounded-lg",children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Name"}),d.jsx(Ee,{children:"Display Name"}),d.jsx(Ee,{children:"Type"}),d.jsx(Ee,{children:"Delegate"}),d.jsx(Ee,{children:"Owner"}),d.jsx(Ee,{children:"Runtime"}),d.jsx(Ee,{children:"Status"}),d.jsx(Ee,{children:"Created"})]})}),d.jsx(Zr,{children:N.map(A=>R(A))})]})})]})]}),(x==null?void 0:x.nextCursor)&&d.jsx("div",{className:"flex justify-end",children:d.jsx(be,{variant:"outline",onClick:()=>a(x.nextCursor??void 0),children:"Next Page"})}),d.jsx(N$,{open:u,onOpenChange:f,onCreated:E}),m&&d.jsx(k$,{agent:m,open:m!==null,onClose:()=>{const A=m.uuid;h(null),e(`/?a=${A}`)},onBound:A=>{h(null),e(`/?a=${A.uuid}`)}})]})}function T$(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Gd({state:e,className:t}){const r=e!==null&&T$(e)?e:"offline",a=r==="offline"?"var(--fg-3)":`var(--state-${r})`;return d.jsxs("span",{className:Re("mono inline-flex items-center gap-1.5 uppercase tracking-wider",t),style:{fontSize:10,letterSpacing:.06,color:a},children:[d.jsx(su,{state:r,size:7}),r]})}function z$(){const{data:e}=qe({queryKey:["members","user-name-map"],queryFn:Rg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const r of e)t.set(r.userId,r.displayName||r.username);return r=>r?t.get(r)??r:"—"},[e])}function R$(){const[e,t]=S.useState(null),[r,a]=S.useState(!1),l=vt({mutationFn:Ow,onSuccess:u=>{t(u),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return e?d.jsxs("div",{className:"mb-4 p-3 border border-border rounded-lg bg-muted/30 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(j0,{className:"h-4 w-4 shrink-0"}),d.jsxs("span",{children:["Run this command in your terminal (expires in ",e.expiresIn/60," min):"]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"flex-1 text-xs bg-background border border-border rounded px-3 py-2 font-mono break-all select-all",children:e.command}),d.jsxs(be,{variant:"outline",size:"sm",onClick:o,className:"shrink-0",children:[r?d.jsx(cg,{className:"h-3 w-3 mr-1"}):d.jsx(dg,{className:"h-3 w-3 mr-1"}),r?"Copied":"Copy"]})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"This token is single-use. Generate a new one if it expires."})]}):d.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 border border-border rounded-lg bg-muted/30",children:[d.jsx(j0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),d.jsx("span",{className:"text-sm text-muted-foreground",children:"Connect a new computer to this Hub"}),d.jsx(be,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating...":"Generate Connect Command"})]})}function O$(){const e=er(),t=wa(),r=z$(),{role:a}=ba(),l=a==="admin",[o,u]=S.useState(null),[f,m]=S.useState(null),[h,v]=S.useState(null),[y,x]=S.useState(null),{data:b}=qe({queryKey:["clients"],queryFn:zd,refetchInterval:1e4}),{data:k}=qe({queryKey:["activity"],queryFn:Td,refetchInterval:1e4}),j=vt({mutationFn:zz,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),N=vt({mutationFn:Tz,onSuccess:()=>{v(null),x(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:A=>{A instanceof _d?x(A.message):x(A instanceof Error?A.message:String(A))}}),E=S.useMemo(()=>{const A=new Map;for(const I of(k==null?void 0:k.agents)??[]){if(!I.clientId)continue;const F=A.get(I.clientId)??[];F.push(I),A.set(I.clientId,F)}return A},[k==null?void 0:k.agents]),R=A=>E.get(A)??[];return d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Computers"}),d.jsx(R$,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["Permanently remove"," ",d.jsx("span",{className:"font-medium text-foreground",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)."]}),R(h.id).length>0&&d.jsxs("div",{className:"mb-3 p-2 rounded bg-yellow-50 dark:bg-yellow-950/30 border border-yellow-200 dark:border-yellow-900",children:[d.jsx("div",{className:"text-xs font-medium text-yellow-900 dark:text-yellow-200 mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-sm space-y-0.5",children:R(h.id).map(A=>d.jsx("li",{className:"font-medium",children:t(A.agentId)},A.agentId))})]}),y&&d.jsx("div",{className:"mb-3 p-2 rounded bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-900 text-sm text-red-900 dark:text-red-200",children:y}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{variant:"outline",size:"sm",onClick:()=>{v(null),x(null)},children:"Cancel"}),d.jsx(be,{variant:"destructive",size:"sm",onClick:()=>N.mutate(h.id),disabled:N.isPending,children:N.isPending?"Retiring...":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["This will disconnect"," ",d.jsx("span",{className:"font-medium text-foreground",children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:R(f.id).length===0?d.jsx("li",{className:"text-sm text-muted-foreground",children:"No bound agents"}):R(f.id).map(A=>d.jsxs("li",{className:"text-sm flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(A.agentId)}),d.jsx(Gd,{state:A.runtimeState})]},A.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(be,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting...":"Disconnect"})]})]})}),!b||b.length===0?d.jsx("div",{className:"text-center text-muted-foreground py-12",children:"No computers. Use the button above to generate a connect command."}):d.jsx("div",{className:"border rounded-lg overflow-hidden",children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{className:"w-8"}),d.jsx(Ee,{children:"Hostname"}),l&&d.jsx(Ee,{children:"Owner"}),d.jsx(Ee,{children:"OS"}),d.jsx(Ee,{children:"SDK"}),d.jsx(Ee,{children:"Agents"}),d.jsx(Ee,{children:"Connected"}),d.jsx(Ee,{children:"Status"}),d.jsx(Ee,{})]})}),d.jsx(Zr,{children:b.map(A=>{const I=o===A.id,F=R(A.id);return d.jsx(D$,{client:A,boundAgents:F,isExpanded:I,agentName:t,showOwner:l,ownerName:r,onToggle:()=>u(I?null:A.id),onDisconnect:()=>m(A),onRetire:()=>{x(null),v(A)}},A.id)})})]})})]})}function D$({client:e,boundAgents:t,isExpanded:r,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){return d.jsxs(d.Fragment,{children:[d.jsxs(at,{className:"cursor-pointer hover:bg-accent/50",onClick:u,children:[d.jsx(xe,{className:"px-2",children:r?d.jsx(nT,{className:"h-4 w-4"}):d.jsx(iT,{className:"h-4 w-4"})}),d.jsx(xe,{className:"font-medium",children:e.hostname??"—"}),l&&d.jsx(xe,{className:"text-sm",children:o(e.userId)}),d.jsx(xe,{className:"text-muted-foreground",children:e.os??"—"}),d.jsx(xe,{className:"font-mono text-xs text-muted-foreground",children:e.sdkVersion??"—"}),d.jsx(xe,{children:e.agentCount}),d.jsx(xe,{className:"text-muted-foreground text-sm",children:e.connectedAt?Cr(e.connectedAt):"—"}),d.jsx(xe,{children:d.jsx(Gt,{variant:e.status==="connected"?"default":"secondary",children:e.status})}),d.jsx(xe,{children:d.jsxs("div",{className:"flex gap-2 justify-end",children:[d.jsxs(be,{variant:"outline",size:"sm",onClick:h=>{h.stopPropagation(),f()},children:[d.jsx(PT,{className:"h-3 w-3 mr-1"}),"Disconnect"]}),d.jsxs(be,{variant:"outline",size:"sm",onClick:h=>{h.stopPropagation(),m()},children:[d.jsx(Wo,{className:"h-3 w-3 mr-1"}),"Retire"]})]})})]}),r&&d.jsx(at,{children:d.jsxs(xe,{colSpan:l?9:8,className:"bg-muted/30 px-8 py-3",children:[d.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:["Bound Agents (",t.length,")"]}),t.length===0?d.jsx("div",{className:"text-sm text-muted-foreground",children:"No agents bound to this computer"}):d.jsx("div",{className:"space-y-1",children:t.map(h=>d.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[d.jsx("span",{className:"font-medium",children:a(h.agentId)}),d.jsx(Gd,{state:h.runtimeState}),d.jsx("span",{className:"text-xs text-muted-foreground",children:h.activeSessions!==null?`${h.activeSessions}/${h.totalSessions??0} sessions`:""})]},h.agentId))})]})})]})}function M$(){const{isAuthenticated:e,login:t}=ba(),[r,a]=S.useState(""),[l,o]=S.useState(""),[u,f]=S.useState(null),[m,h]=S.useState(!1);if(e)return d.jsx(ag,{to:"/",replace:!0});const v=async y=>{y.preventDefault(),f(null),h(!0);try{await t(r,l)}catch(x){f(x instanceof Error?x.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(ul,{className:"w-full max-w-sm",children:[d.jsxs(Ts,{className:"text-center",children:[d.jsx(zs,{className:"text-2xl",children:"First Tree"}),d.jsx(Mj,{children:"Sign in to your workspace"})]}),d.jsx(cl,{children:d.jsxs("form",{onSubmit:v,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"username",children:"Username"}),d.jsx(gt,{id:"username",value:r,onChange:y=>a(y.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ye,{htmlFor:"password",children:"Password"}),d.jsx(gt,{id:"password",type:"password",value:l,onChange:y=>o(y.target.value),required:!0})]}),d.jsx(be,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function L$(){const e=Vr(),t=wa(),{data:r,isLoading:a}=qe({queryKey:["adapters"],queryFn:Ij}),{data:l,isLoading:o}=qe({queryKey:["adapter-mappings"],queryFn:Lj}),{data:u}=qe({queryKey:["adapter-statuses"],queryFn:Uj,refetchInterval:15e3}),f=a||o;return d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of platform bindings for agents you can manage. Configure each binding from the Agent detail page."}),d.jsxs(ul,{children:[d.jsx(Ts,{children:d.jsx(zs,{children:"Bot Bindings"})}),d.jsx(cl,{children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Agent"}),d.jsx(Ee,{children:"Platform"}),d.jsx(Ee,{children:"Status"}),d.jsx(Ee,{children:"Connection"}),d.jsx(Ee,{children:"Created"})]})}),d.jsx(Zr,{children:f?d.jsx(at,{children:d.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):r!=null&&r.length?r.map(m=>{const h=u==null?void 0:u.find(v=>v.configId===m.id);return d.jsxs(at,{className:"cursor-pointer",onClick:()=>e(`/agents/${m.agentId}`),children:[d.jsx(xe,{className:"font-mono text-sm",children:t(m.agentId)}),d.jsx(xe,{children:d.jsx(Gt,{variant:"secondary",children:m.platform})}),d.jsx(xe,{children:d.jsx(Gt,{variant:m.status==="active"?"default":"destructive",children:m.status})}),d.jsx(xe,{children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:Re("inline-block h-2 w-2 rounded-full",h!=null&&h.connected?"bg-green-500":"bg-gray-300")}),d.jsx("span",{className:"text-xs text-muted-foreground",children:h!=null&&h.connected?"Online":"Offline"})]})}),d.jsx(xe,{className:"text-muted-foreground",children:Cr(m.createdAt)})]},m.id)}):d.jsx(at,{children:d.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No bot bindings"})})})]})})]}),d.jsxs(ul,{children:[d.jsx(Ts,{children:d.jsx(zs,{children:"User Bindings"})}),d.jsx(cl,{children:d.jsxs(qr,{children:[d.jsx(Hr,{children:d.jsxs(at,{children:[d.jsx(Ee,{children:"Agent"}),d.jsx(Ee,{children:"Platform"}),d.jsx(Ee,{children:"External User ID"}),d.jsx(Ee,{children:"Display Name"}),d.jsx(Ee,{children:"Bound Via"}),d.jsx(Ee,{children:"Created"})]})}),d.jsx(Zr,{children:f?d.jsx(at,{children:d.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):l!=null&&l.length?l.map(m=>d.jsxs(at,{className:"cursor-pointer",onClick:()=>e(`/agents/${m.agentId}`),children:[d.jsx(xe,{className:"font-mono text-sm",children:t(m.agentId)}),d.jsx(xe,{children:d.jsx(Gt,{variant:"secondary",children:m.platform})}),d.jsx(xe,{className:"font-mono text-sm",children:m.externalUserId}),d.jsx(xe,{children:m.displayName??"—"}),d.jsx(xe,{children:d.jsx(Gt,{variant:"outline",children:m.boundVia??"—"})}),d.jsx(xe,{className:"text-muted-foreground",children:Cr(m.createdAt)})]},m.id)):d.jsx(at,{children:d.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No user bindings"})})})]})})]})]})}function U$(){return d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold mb-6",children:"Settings"}),d.jsx(L$,{})]})}function I$(e){return Me.get(`/admin/chats/${encodeURIComponent(e)}`)}function P$(e,t){return Me.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function pS(e,t){return Me.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}async function B$(e){const t=new FormData;t.append("file",e);const r=o=>{const u={};return o&&(u.Authorization=`Bearer ${o}`),fetch("/api/v1/admin/uploads",{method:"POST",headers:u,body:t})},a=Nd();let l=await r(a==null?void 0:a.accessToken);if(l.status===401&&(a!=null&&a.refreshToken)){const o=await fetch("/api/v1/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:a.refreshToken})});if(o.ok){const u=await o.json(),f={accessToken:u.accessToken,refreshToken:u.refreshToken??a.refreshToken},m=new FormData;m.append("file",e),l=await fetch("/api/v1/admin/uploads",{method:"POST",headers:{Authorization:`Bearer ${f.accessToken}`},body:m})}}if(!l.ok){const o=await l.text();let u;try{u=JSON.parse(o).error??o}catch{u=o}throw new Error(u)}return await l.json()}function $$(e,t){return Me.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function F$(e){return Me.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function q$(e,t){const r=new URLSearchParams;r.set("limit",String(t.limit)),t!=null&&t.cursor&&r.set("cursor",t.cursor);const a=r.toString();return Me.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function ZE(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function H$(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const r=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),a=new Map;for(const l of r){if(l.kind!=="tool_call")continue;const o=gS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return r.filter(l=>{if(l.kind!=="tool_call")return!0;const o=gS(l.payload);return o?a.get(o)===l.seq:!0})}function gS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Kd(e){const t=new Date(e),r=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=r.find(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function VE(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const a=Math.round(r/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function Z$(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function yS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function V$({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const r=e.deliveryStatus??"sent";return r==="acked"?d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):r==="delivered"?d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function Q$({agentId:e,chatId:t,session:r}){const a=er(),[,l]=og(),[o,u]=S.useState(!1),[f,m]=S.useState(null),h=Dw(e,t),v=kp(e),y=N=>{a.setQueryData(h,E=>E&&{...E,state:N}),a.setQueryData(v,E=>E&&E.map(R=>R.chatId===t?{...R,state:N}:R))},x=vt({mutationFn:()=>Lz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:v});const N=a.getQueryData(h),E=a.getQueryData(v);return y("suspended"),{previousSession:N,previousList:E}},onError:(N,E,R)=>{R!=null&&R.previousSession&&a.setQueryData(h,R.previousSession),R!=null&&R.previousList&&a.setQueryData(v,R.previousList)},onSuccess:N=>{y(N.state)}}),b=vt({mutationFn:()=>Uz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:v});const N=a.getQueryData(h),E=a.getQueryData(v);return a.setQueryData(v,R=>R&&R.filter(A=>A.chatId!==t)),{previousSession:N,previousList:E}},onError:(N,E,R)=>{R!=null&&R.previousSession&&a.setQueryData(h,R.previousSession),R!=null&&R.previousList&&a.setQueryData(v,R.previousList),m(N instanceof Error?N.message:"Terminate failed")},onSuccess:(N,E,R)=>{if(N.state!=="evicted"){R!=null&&R.previousList&&a.setQueryData(v,R.previousList),y(N.state),m(`Session is ${N.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(r==null?void 0:r.state)==="active",j=(r==null?void 0:r.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:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[k&&d.jsxs("button",{type:"button",onClick:()=>x.mutate(),disabled:x.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"var(--fg-2)",borderRadius:4},onMouseEnter:N=>N.currentTarget.style.background="var(--bg-hover)",onMouseLeave:N=>N.currentTarget.style.background="transparent",children:[d.jsx(bT,{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:b.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:4},onMouseEnter:N=>N.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:N=>N.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(AT,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(G$,{open:o,onOpenChange:N=>{b.isPending||u(N),N||m(null)},session:r,chatId:t,error:f,pending:b.isPending,onConfirm:()=>b.mutate()})]})}function G$(e){const{open:t,onOpenChange:r,session:a,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(v){v.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(Ln,{open:t,onOpenChange:r,children:d.jsxs(Sn,{children:[d.jsx(Wn,{children:d.jsx(In,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.jsx("p",{className:"text-sm 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",style:{fontSize:11,padding:"8px 10px",borderRadius:4,background:"var(--bg-sunken)",border:"1px 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,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",VE(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",a.messageCount]})]}),u&&d.jsx("p",{className:"mono",style:{fontSize:11,color:"var(--state-error)"},children:u}),d.jsxs(Un,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>r(!1),disabled:o,children:"Cancel"}),d.jsx(be,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function K$({event:e}){const t=Rz(e.payload);if(!t)return null;const r=t.status==="error",a=t.status==="pending",l=r?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=r?"failed":a?"using":"used";return d.jsxs("div",{className:"mono flex items-center",style:{gap:8,fontSize:11,padding:"2px 8px",color:"var(--fg-3)"},children:[a?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:r?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?yS(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:["(",yS(t.args),")"]}):null,t.durationMs!==void 0&&!a?d.jsxs("span",{style:{color:"var(--fg-4)",marginLeft:6,fontSize:10,whiteSpace:"nowrap",flexShrink:0},children:["· ",Z$(t.durationMs)]}):null]})]})}function Y$({event:e,agentNameFn:t,agentId:r}){const a=Dz(e.payload);if(!a||a.text.length===0)return null;const l=t(r);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"4px 0",opacity:.85},children:[d.jsx(QE,{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",style:{fontSize:11,fontWeight:600,color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:Kd(e.createdAt)}),d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{style:{fontSize:12.5,color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2,lineHeight:1.55},children:a.text})]})]})}function X$({event:e}){return d.jsxs("div",{className:"mono flex items-center",style:{gap:8,fontSize:11,padding:"2px 8px",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",style:{fontSize:10,color:"var(--fg-4)"},children:Kd(e.createdAt)})]})}function J$({event:e}){const t=Oz(e.payload),r=Kd(e.createdAt);return d.jsxs("div",{style:{padding:"6px 10px",borderLeft:"2px solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 4px 4px 0"},children:[d.jsxs("div",{className:"mono uppercase",style:{fontSize:10,letterSpacing:.08,color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",r]}),d.jsx("div",{style:{marginTop:2,fontSize:11.5,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function QE({name:e,isSelf:t}){const r=e.slice(0,2).toUpperCase();return d.jsx("div",{className:"mono",style:{width:20,height:20,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",fontSize:9,fontWeight:700,flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"1px solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?r:d.jsx(Ld,{width:9,height:10,style:{color:"var(--accent)"}})})}function W$({msg:e,myAgentId:t,agentNameFn:r}){const a=r(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"6px 0"},children:[d.jsx(QE,{name:a,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",style:{fontSize:12,fontWeight:600,color:l?"var(--fg)":"var(--accent)"},children:a}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:Kd(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(V$,{msg:e,myAgentId:t})})]}),d.jsx("div",{style:{fontSize:12.5,color:"var(--fg)",marginTop:2,lineHeight:1.55},children:e.format==="file"&&eF(e.content)?d.jsx("img",{src:e.content.url,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:6,marginTop:4}}):e.format==="text"?d.jsx(HE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.jsx("pre",{className:"mono",style:{fontSize:11,background:"var(--bg-sunken)",padding:8,borderRadius:4,overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function eF(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.url=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function tF({agentId:e,chatId:t}){var U;const r=er(),a=wa(),{agentId:l}=ba(),[o,u]=S.useState(""),[f,m]=S.useState([]),[h,v]=S.useState(!1),[y,x]=S.useState(null),b=S.useRef(null),k=S.useRef(null),{data:j}=qe({queryKey:["chat-messages",t],queryFn:()=>q$(t,{limit:50}),refetchInterval:5e3}),{data:N}=qe({queryKey:["session-events",e,t],queryFn:()=>Mz(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:E}=qe({queryKey:Dw(e,t),queryFn:()=>Us(e).then(T=>T.find(C=>C.chatId===t)??null),refetchInterval:5e3}),{data:R}=qe({queryKey:["chat-detail",t],queryFn:()=>I$(t),enabled:!!t}),A=vt({mutationFn:T=>pS(t,T),onSuccess:()=>{u(""),r.invalidateQueries({queryKey:["chat-messages",t]})}}),I=S.useCallback(T=>{const C=T.filter(H=>H.type.startsWith("image/"));if(C.length===0)return;const X=C.map(H=>({id:crypto.randomUUID(),file:H,previewUrl:URL.createObjectURL(H)}));m(H=>[...H,...X])},[]),F=S.useCallback(T=>{m(C=>{const X=C.find(H=>H.id===T);return X&&URL.revokeObjectURL(X.previewUrl),C.filter(H=>H.id!==T)})},[]),O=async()=>{const T=o.trim(),C=f;if(!(!T&&C.length===0)&&!h){if(C.length>0){v(!0),x(null);try{for(const X of C){const H=await B$(X.file);await $$(t,{url:H.url,mimeType:H.mimeType,filename:H.filename,size:H.size}),URL.revokeObjectURL(X.previewUrl)}m([]),T&&await pS(t,T),u(""),r.invalidateQueries({queryKey:["chat-messages",t]})}catch(X){x(X instanceof Error?X.message:"Failed to upload image")}finally{v(!1)}return}A.mutate(T)}},[$,V]=S.useState(!1),[J,q]=S.useState(""),re=S.useRef(null);S.useEffect(()=>{var T;$&&((T=re.current)==null||T.focus())},[$]);const ae=vt({mutationFn:T=>P$(t,T),onSuccess:()=>{V(!1),r.invalidateQueries({queryKey:["chat-detail",t]}),r.invalidateQueries({queryKey:["agent-sessions",e]}),r.invalidateQueries({queryKey:["session",e,t]})}}),me=()=>{const T=J.trim();ae.mutate(T.length>0?T:null)},ce=S.useMemo(()=>{const T=(j==null?void 0:j.items)??[],C=H$((N==null?void 0:N.items)??[]),X=[...T.map(H=>({kind:"message",at:H.createdAt,key:`m-${H.id}`,data:H})),...C.map(H=>({kind:"event",at:H.createdAt,key:`e-${H.id}`,data:H}))];return X.sort((H,oe)=>H.at.localeCompare(oe.at)),X},[j,N]),ee=ce.length;S.useEffect(()=>{var T;ee>0&&((T=k.current)==null||T.scrollIntoView({behavior:"smooth"}))},[ee]);const P=R!=null&&R.participants?R.participants.map(T=>{const C=a(T.agentId);return`@${C.length>20?`${C.slice(0,17)}…`:C}`}).join(" "):`@${a(e)}`,W=a(e),pe=(E==null?void 0:E.runtimeState)??"idle",Ce=ZE((E==null?void 0:E.runtimeState)??null,e?"connected":null),z=(E==null?void 0:E.messageCount)??((U=j==null?void 0:j.items)==null?void 0:U.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:"10px 14px",borderBottom:"1px 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(su,{state:Ce,size:8}),$?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:re,value:J,onChange:T=>q(T.target.value),onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),me()):T.key==="Escape"&&(T.preventDefault(),V(!1))},disabled:ae.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none",style:{flex:1,minWidth:0,fontSize:13,fontWeight:600,color:"var(--fg)",background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,padding:"2px 6px"}}),d.jsx("button",{type:"button",onClick:me,disabled:ae.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(cg,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>V(!1),disabled:ae.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(Sp,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate",style:{fontSize:13,fontWeight:600,color:"var(--fg)"},children:(R==null?void 0:R.topic)||(E==null?void 0:E.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{q((R==null?void 0:R.topic)??""),V(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:T=>T.currentTarget.style.color="var(--fg-2)",onMouseLeave:T=>T.currentTarget.style.color="var(--fg-4)",children:d.jsx(Ad,{className:"h-3 w-3"})})]}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)",padding:"1px 5px",border:"1px solid var(--border)",borderRadius:2},children:t})]}),d.jsxs("div",{className:"flex items-center",style:{fontSize:10.5,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 ",VE((E==null?void 0:E.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[z," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:Ce==="error"?"var(--state-error)":"var(--fg-2)"},children:pe})]})]})]}),d.jsx(Q$,{agentId:e,chatId:t,session:E??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",style:{padding:"10px 14px"},children:[ee===0&&d.jsxs("div",{className:"flex flex-col items-center",style:{color:"var(--fg-3)",fontSize:13,padding:"32px 0",gap:6},children:[d.jsx(gw,{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:ce.map(T=>{if(T.kind==="event"){const C=T.data;switch(C.kind){case"tool_call":return d.jsx(K$,{event:C},T.key);case"assistant_text":return d.jsx(Y$,{event:C,agentId:e,agentNameFn:a},T.key);case"thinking":return d.jsx(X$,{event:C},T.key);case"error":return d.jsx(J$,{event:C},T.key);default:return null}}return d.jsx(W$,{msg:T.data,myAgentId:l,agentNameFn:a},T.key)})}),d.jsx("div",{ref:k})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"10px 14px",borderTop:"1px solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:T=>T.preventDefault(),onDrop:T=>{T.preventDefault(),I(Array.from(T.dataTransfer.files))},children:[f.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"6px 10px 0",overflowX:"auto"},children:f.map(T=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"1px solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:T.previewUrl,alt:T.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>F(T.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"none",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:d.jsx(Sp,{className:"h-2 w-2"})})]},T.id))}),d.jsx("textarea",{value:o,onChange:T=>u(T.target.value),onPaste:T=>{const C=Array.from(T.clipboardData.files);C.length>0&&(T.preventDefault(),I(C))},placeholder:`Message @${W} · / for commands · @ to mention`,rows:2,onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),O())},disabled:A.isPending||h,className:"w-full outline-none",style:{padding:"9px 12px 30px",fontSize:12.5,background:"transparent",border:"none",resize:"none",fontFamily:"var(--font-sans)",color:"var(--fg)"}}),d.jsxs("div",{className:"flex items-center justify-between",style:{position:"absolute",bottom:6,left:10,right:10,fontSize: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 T;return(T=b.current)==null?void 0:T.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(vT,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:b,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:T=>{T.target.files&&(I(Array.from(T.target.files)),T.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",style:{fontSize:10,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:O,disabled:A.isPending||h||!o.trim()&&f.length===0,className:Re("inline-flex items-center transition-colors",(A.isPending||h||!o.trim()&&f.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"1px solid var(--accent)",borderRadius:5},children:[d.jsx(NT,{className:"h-3 w-3"})," Send"]})]})]})]}),(A.isError||y)&&d.jsx("p",{className:"mono",style:{fontSize:11,color:"var(--state-error)",padding:"6px 2px 0"},children:y??(A.error instanceof Error?A.error.message:"Failed to send")})]})]})}function nF(){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(Ld,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-sm font-medium mb-1",children:"Select a chat"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function rF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(tF,{agentId:e,chatId:t}):d.jsx(nF,{})}function GE(){const{data:e}=qe({queryKey:["clients"],queryFn:zd,staleTime:1e4,refetchInterval:1e4});return S.useMemo(()=>{const t=e??[],r=new Map;for(const a of t)r.set(a.id,a);return{resolve:a=>a?r.get(a)??null:null,clients:t,connectedClients:t.filter(a=>a.status==="connected")}},[e])}function Vp({children:e}){return d.jsx("div",{className:"mono uppercase",style:{fontSize:11,letterSpacing:.1,color:"var(--fg-4)",marginBottom:8},children:e})}function KE({children:e}){return d.jsx("div",{className:"grid",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4,fontSize:13.5},children:e})}function $r({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 vS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const a=Math.round(r/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function xS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<60)return`${r}m`;const a=Math.floor(r/60);return a<24?`${a}h ${r%60}m`:`${Math.floor(a/24)}d ${a%24}h`}function np({label:e,value:t,accent:r}){return d.jsxs("div",{style:{padding:"6px 8px",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase",style:{fontSize:11,color:"var(--fg-4)",letterSpacing:.08},children:e}),d.jsx("div",{className:"mono",style:{fontSize:15,fontWeight:600,color:r??"var(--fg)"},children:t})]})}function iF({notifications:e,agentId:t}){const[,r]=og(),a=er(),l=vt({mutationFn:o=>Dk(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(Mk,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&r({a:t,c:o.chatId})}},o.id))})}function YE({agentId:e}){var h;const t=wa(),{resolve:r}=GE(),{data:a}=qe({queryKey:["activity"],queryFn:Td,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(v=>v.agentId===e),o=r(l==null?void 0:l.clientId),{data:u}=qe({queryKey:["notifications","agent",e],queryFn:()=>Ap({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:"12px 14px",borderBottom:"1px 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:"1px solid var(--border-strong)"},children:d.jsx(Ld,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{style:{fontSize:15,fontWeight:600,color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate",style:{fontSize:12,color:"var(--fg-4)"},children:e})]}),d.jsx(Gd,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(np,{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(np,{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(np,{label:"uptime",value:xS((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx(Vp,{children:"Computer · runtime"}),d.jsxs(KE,{children:[d.jsx($r,{label:"host",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:(o==null?void 0:o.hostname)??"—"})}),d.jsx($r,{label:"os",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:(o==null?void 0:o.os)??"—"})}),d.jsx($r,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx($r,{label:"sdk",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx($r,{label:"connected",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:xS((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{fontSize:13,color:"var(--accent)"},className:"hover:underline",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{fontSize:13,color:"var(--accent)",marginTop:4},className:"hover:underline",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"12px 14px"},children:[d.jsx(Vp,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center",style:{fontSize:13,color:"var(--fg-3)",padding:"12px 0"},children:"No notifications for this agent"}):d.jsx(iF,{notifications:u.items,agentId:e})]})]})}function aF({agentId:e,chatId:t}){const{data:r}=qe({queryKey:["session",e,t],queryFn:()=>Us(e).then(a=>a.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:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx(Vp,{children:"Session"}),d.jsxs(KE,{children:[d.jsx($r,{label:"state",children:d.jsx(Gd,{state:(r==null?void 0:r.runtimeState)??(r==null?void 0:r.state)??null})}),d.jsx($r,{label:"chat",children:d.jsx("span",{className:"mono",style:{fontSize:12.5},children:t.slice(0,12)})}),d.jsx($r,{label:"started",children:vS((r==null?void 0:r.startedAt)??null)}),d.jsx($r,{label:"last",children:vS((r==null?void 0:r.lastActivityAt)??null)}),d.jsx($r,{label:"messages",children:d.jsx("span",{className:"mono",children:(r==null?void 0:r.messageCount)??0})})]})]}),d.jsx(YE,{agentId:e})]})}function lF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(aF,{agentId:e,chatId:t}):e?d.jsx(YE,{agentId:e}):null}const sF=32;function oF({aggregated:e,stale:t,className:r}){const a=Math.max(1,...e.map(l=>l.workingCount));return d.jsx("div",{className:Re("flex items-end gap-[2px]",t&&"opacity-40",r),style:{height:22},"aria-hidden":!0,children:Array.from({length:sF}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/a,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 uF={error:0,blocked:1,working:2,idle:3};function cF(e,t){return t?e?uF[e]??4:4:5}function dF(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function fF({selectedAgentId:e,selectedChatId:t,onSelectAgent:r,onSelectChat:a}){const l=wa(),{resolve:o}=GE(),u=er(),f=H6(),[m,h]=S.useState(""),[v,y]=S.useState("all"),{data:x}=qe({queryKey:["activity"],queryFn:Td,refetchInterval:1e4}),{data:b}=qe({queryKey:e?kp(e):["agent-sessions",null],queryFn:()=>e?Us(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=vt({mutationFn:O=>F$(O),onSuccess:(O,$)=>{u.invalidateQueries({queryKey:kp($)}),a($,O.id)}}),{humans:j,agents:N,totalAll:E}=S.useMemo(()=>{const O=(x==null?void 0:x.agents)??[],$=m.trim().toLowerCase(),V=O.filter(ae=>{var ee;if(!dF(ae,v))return!1;if(!$)return!0;const me=l(ae.agentId).toLowerCase(),ce=ae.clientId?(((ee=o(ae.clientId))==null?void 0:ee.hostname)??"").toLowerCase():"";return me.includes($)||ce.includes($)||ae.agentId.toLowerCase().includes($)}),J=ae=>cF(ae.runtimeState,ae.clientId),q=[],re=[];for(const ae of V)(ae.type==="human"?q:re).push(ae);return q.sort((ae,me)=>J(ae)-J(me)),re.sort((ae,me)=>J(ae)-J(me)),{humans:q,agents:re,totalAll:O.length}},[x,m,v,l,o]),R=S.useMemo(()=>{const O=(x==null?void 0:x.agents)??[];return{working:O.filter($=>$.runtimeState==="working").length,blocked:O.filter($=>$.runtimeState==="blocked").length,error:O.filter($=>$.runtimeState==="error").length}},[x]),A=[{value:"all",label:"all",count:E},{value:"active",label:"active",count:R.working},{value:"attn",label:"attn",count:R.blocked+R.error,warn:R.blocked+R.error>0}],I=O=>{var ae;const $=e===O.agentId,V=ZE(O.runtimeState,O.clientId),J=O.clientId?((ae=o(O.clientId))==null?void 0:ae.hostname)??O.clientId.slice(0,8):null,q=O.activeSessions??0,re=O.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>r($?null:O.agentId),className:Re("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"14px 1fr auto",columnGap:8,padding:"7px 10px 7px 12px",background:$?"var(--bg-active)":"transparent",borderLeft:`2px solid ${$?"var(--accent)":"transparent"}`},children:[d.jsx(su,{state:V,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",style:{fontSize:14,fontWeight:500,color:"var(--fg)",letterSpacing:-.1},children:l(O.agentId)}),O.type==="human"&&d.jsx("span",{className:"mono",style:{fontSize:11,padding:"1px 5px",borderRadius:2,textTransform:"uppercase",letterSpacing:.08,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),d.jsx("div",{className:"truncate",style:{fontSize:12.5,color:"var(--fg-3)"},children:V==="offline"?"disconnected":J||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:re>0&&d.jsxs("span",{className:"mono tnum",style:{fontSize:11,color:"var(--fg-3)"},children:[q,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",re]})]})})]}),$&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&d.jsx("div",{style:{padding:"4px 10px 4px 28px",fontSize:12.5,color:"var(--fg-4)"},children:"No sessions yet"}),b==null?void 0:b.filter(me=>me.state!=="evicted").map(me=>{const ce=me.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>a(O.agentId,me.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"14px 1fr",columnGap:6,padding:"4px 10px 4px 28px",background:t===me.chatId?"var(--bg-hover)":"transparent",color:me.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:ee=>{t!==me.chatId&&(ee.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:ee=>{t!==me.chatId&&(ee.currentTarget.style.background="transparent")},children:[d.jsx(su,{state:ce,size:6}),d.jsx("span",{className:"truncate",style:{fontSize:13,color:me.topic||me.summary?"var(--fg-2)":"var(--fg-4)"},children:me.topic||me.summary||`Chat · ${me.chatId.slice(0,8)}`})]},me.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(O.agentId),disabled:k.isPending,className:"w-full flex items-center text-left transition-colors",style:{gap:6,padding:"4px 10px 4px 28px",fontSize:12.5,color:"var(--fg-3)"},onMouseEnter:me=>{me.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:me=>{me.currentTarget.style.background="transparent"},children:[d.jsx(fl,{className:"h-3 w-3"}),"New chat"]})]})]},O.agentId)},F=j.length+N.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"1px solid var(--border)"},children:[d.jsxs("div",{className:"shrink-0",style:{padding:"10px 12px 8px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase",style:{fontSize:12,color:"var(--fg-3)",letterSpacing:.08},children:[E," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(fg,{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:O=>h(O.target.value),placeholder:"Filter…",className:"w-full outline-none",style:{padding:"5px 8px 5px 26px",fontSize:14,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:A.map(O=>{const $=v===O.value;return d.jsxs("button",{type:"button",onClick:()=>y(O.value),className:"inline-flex items-center",style:{fontSize:12,padding:"3px 7px",borderRadius:3,gap:4,color:$?"var(--fg)":"var(--fg-3)",background:$?"var(--bg-active)":"transparent",border:`1px solid ${$?"var(--border-strong)":"var(--border)"}`},children:[O.label,d.jsx("span",{className:"mono",style:{color:O.warn&&O.count>0?"var(--state-error)":"var(--fg-4)"},children:O.count})]},O.value)})})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono uppercase flex items-center gap-1.5",style:{fontSize:12,color:"var(--fg-3)",letterSpacing:.08},children:[d.jsx(hF,{}),"Pulse · 5m"]}),d.jsx("span",{className:"mono",style:{fontSize:12,color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(oF,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex",style:{gap:10,marginTop:6,fontSize:12},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:["●",R.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:["●",R.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:["●",R.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[F===0&&d.jsx("div",{className:"text-center",style:{padding:"24px 12px",fontSize:14,color:"var(--fg-3)"},children:m||v!=="all"?"No matches":"No agents"}),N.length>0&&d.jsxs("div",{children:[d.jsx(bS,{label:"Agents",count:N.length}),N.map(I)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(bS,{label:"Humans",count:j.length}),j.map(I)]})]})]})}function bS({label:e,count:t}){return d.jsxs("div",{className:"mono uppercase sticky top-0 z-10",style:{padding:"5px 12px",fontSize:11,letterSpacing:.12,color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"1px solid var(--border-faint)"},children:[e," · ",t]})}function hF(){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 mF(){const[e,t]=og(),r=e.get("a"),a=e.get("c");Tj();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",r],queryFn:()=>r?Us(r):Promise.resolve([]),enabled:!!r&&!a});return S.useEffect(()=>{if(!r||a||!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:r,c:f.chatId},{replace:!0})},[r,a,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(fF,{selectedAgentId:r,selectedChatId:a,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(rF,{selectedAgentId:r,selectedChatId:a})}),r&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"1px solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(lF,{selectedAgentId:r,selectedChatId:a})})]})}const pF=new H_({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function gF(){return d.jsx(Z_,{client:pF,children:d.jsx(PA,{children:d.jsx(NA,{children:d.jsxs(nA,{children:[d.jsx(Mr,{path:"/login",element:d.jsx(M$,{})}),d.jsx(Mr,{element:d.jsx(BA,{}),children:d.jsxs(Mr,{element:d.jsx(q6,{children:d.jsx(vD,{})}),children:[d.jsx(Mr,{index:!0,element:d.jsx(mF,{})}),d.jsx(Mr,{path:"agents",element:d.jsx(A$,{})}),d.jsx(Mr,{path:"agents/:uuid",element:d.jsx(g$,{})}),d.jsx(Mr,{path:"clients",element:d.jsx(O$,{})}),d.jsx(Mr,{path:"settings",element:d.jsx(U$,{})}),d.jsx(Mr,{path:"admin",element:d.jsx(lL,{})})]})})]})})})})}const XE=document.getElementById("root");if(!XE)throw new Error("Root element not found");x_.createRoot(XE).render(d.jsx(S.StrictMode,{children:d.jsx(gF,{})}));
|