morpheus-cli 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function Bp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mh={exports:{}},Xs={};var a0;function zC(){if(a0)return Xs;a0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,u){var l=null;if(u!==void 0&&(l=""+u),o.key!==void 0&&(l=""+o.key),"key"in o){u={};for(var d in o)d!=="key"&&(u[d]=o[d])}else u=o;return o=u.ref,{$$typeof:e,type:a,key:l,ref:o!==void 0?o:null,props:u}}return Xs.Fragment=t,Xs.jsx=n,Xs.jsxs=n,Xs}var i0;function _C(){return i0||(i0=1,Mh.exports=zC()),Mh.exports}var f=_C(),Dh={exports:{}},Ee={};var o0;function jC(){if(o0)return Ee;o0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function v(S){return S===null||typeof S!="object"?null:(S=b&&S[b]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,E={};function N(S,H,w){this.props=S,this.context=H,this.refs=E,this.updater=w||z}N.prototype.isReactComponent={},N.prototype.setState=function(S,H){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,H,"setState")},N.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function A(){}A.prototype=N.prototype;function C(S,H,w){this.props=S,this.context=H,this.refs=E,this.updater=w||z}var $=C.prototype=new A;$.constructor=C,T($,N.prototype),$.isPureReactComponent=!0;var L=Array.isArray;function M(){}var q={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function X(S,H,w){var G=w.ref;return{$$typeof:e,type:S,key:H,ref:G!==void 0?G:null,props:w}}function ce(S,H){return X(S.type,H,S.props)}function Q(S){return typeof S=="object"&&S!==null&&S.$$typeof===e}function se(S){var H={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(w){return H[w]})}var te=/\/+/g;function oe(S,H){return typeof S=="object"&&S!==null&&S.key!=null?se(""+S.key):H.toString(36)}function ae(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(M,M):(S.status="pending",S.then(function(H){S.status==="pending"&&(S.status="fulfilled",S.value=H)},function(H){S.status==="pending"&&(S.status="rejected",S.reason=H)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function U(S,H,w,G,de){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var me=!1;if(S===null)me=!0;else switch(fe){case"bigint":case"string":case"number":me=!0;break;case"object":switch(S.$$typeof){case e:case t:me=!0;break;case g:return me=S._init,U(me(S._payload),H,w,G,de)}}if(me)return de=de(S),me=G===""?"."+oe(S,0):G,L(de)?(w="",me!=null&&(w=me.replace(te,"$&/")+"/"),U(de,H,w,"",function(kt){return kt})):de!=null&&(Q(de)&&(de=ce(de,w+(de.key==null||S&&S.key===de.key?"":(""+de.key).replace(te,"$&/")+"/")+me)),H.push(de)),1;me=0;var De=G===""?".":G+":";if(L(S))for(var Ne=0;Ne<S.length;Ne++)G=S[Ne],fe=De+oe(G,Ne),me+=U(G,H,w,fe,de);else if(Ne=v(S),typeof Ne=="function")for(S=Ne.call(S),Ne=0;!(G=S.next()).done;)G=G.value,fe=De+oe(G,Ne++),me+=U(G,H,w,fe,de);else if(fe==="object"){if(typeof S.then=="function")return U(ae(S),H,w,G,de);throw H=String(S),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return me}function K(S,H,w){if(S==null)return S;var G=[],de=0;return U(S,G,"","",function(fe){return H.call(w,fe,de++)}),G}function B(S){if(S._status===-1){var H=S._result;H=H(),H.then(function(w){(S._status===0||S._status===-1)&&(S._status=1,S._result=w)},function(w){(S._status===0||S._status===-1)&&(S._status=2,S._result=w)}),S._status===-1&&(S._status=0,S._result=H)}if(S._status===1)return S._result.default;throw S._result}var he=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},O={map:K,forEach:function(S,H,w){K(S,function(){H.apply(this,arguments)},w)},count:function(S){var H=0;return K(S,function(){H++}),H},toArray:function(S){return K(S,function(H){return H})||[]},only:function(S){if(!Q(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ee.Activity=x,Ee.Children=O,Ee.Component=N,Ee.Fragment=n,Ee.Profiler=o,Ee.PureComponent=C,Ee.StrictMode=a,Ee.Suspense=h,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(S){return q.H.useMemoCache(S)}},Ee.cache=function(S){return function(){return S.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(S,H,w){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var G=T({},S.props),de=S.key;if(H!=null)for(fe in H.key!==void 0&&(de=""+H.key),H)!V.call(H,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&H.ref===void 0||(G[fe]=H[fe]);var fe=arguments.length-2;if(fe===1)G.children=w;else if(1<fe){for(var me=Array(fe),De=0;De<fe;De++)me[De]=arguments[De+2];G.children=me}return X(S.type,de,G)},Ee.createContext=function(S){return S={$$typeof:l,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:u,_context:S},S},Ee.createElement=function(S,H,w){var G,de={},fe=null;if(H!=null)for(G in H.key!==void 0&&(fe=""+H.key),H)V.call(H,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(de[G]=H[G]);var me=arguments.length-2;if(me===1)de.children=w;else if(1<me){for(var De=Array(me),Ne=0;Ne<me;Ne++)De[Ne]=arguments[Ne+2];de.children=De}if(S&&S.defaultProps)for(G in me=S.defaultProps,me)de[G]===void 0&&(de[G]=me[G]);return X(S,fe,de)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(S){return{$$typeof:d,render:S}},Ee.isValidElement=Q,Ee.lazy=function(S){return{$$typeof:g,_payload:{_status:-1,_result:S},_init:B}},Ee.memo=function(S,H){return{$$typeof:m,type:S,compare:H===void 0?null:H}},Ee.startTransition=function(S){var H=q.T,w={};q.T=w;try{var G=S(),de=q.S;de!==null&&de(w,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(M,he)}catch(fe){he(fe)}finally{H!==null&&w.types!==null&&(H.types=w.types),q.T=H}},Ee.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Ee.use=function(S){return q.H.use(S)},Ee.useActionState=function(S,H,w){return q.H.useActionState(S,H,w)},Ee.useCallback=function(S,H){return q.H.useCallback(S,H)},Ee.useContext=function(S){return q.H.useContext(S)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(S,H){return q.H.useDeferredValue(S,H)},Ee.useEffect=function(S,H){return q.H.useEffect(S,H)},Ee.useEffectEvent=function(S){return q.H.useEffectEvent(S)},Ee.useId=function(){return q.H.useId()},Ee.useImperativeHandle=function(S,H,w){return q.H.useImperativeHandle(S,H,w)},Ee.useInsertionEffect=function(S,H){return q.H.useInsertionEffect(S,H)},Ee.useLayoutEffect=function(S,H){return q.H.useLayoutEffect(S,H)},Ee.useMemo=function(S,H){return q.H.useMemo(S,H)},Ee.useOptimistic=function(S,H){return q.H.useOptimistic(S,H)},Ee.useReducer=function(S,H,w){return q.H.useReducer(S,H,w)},Ee.useRef=function(S){return q.H.useRef(S)},Ee.useState=function(S){return q.H.useState(S)},Ee.useSyncExternalStore=function(S,H,w){return q.H.useSyncExternalStore(S,H,w)},Ee.useTransition=function(){return q.H.useTransition()},Ee.version="19.2.4",Ee}var s0;function td(){return s0||(s0=1,Dh.exports=jC()),Dh.exports}var j=td();const Zp=Bp(j);var $h={exports:{}},Ks={},Lh={exports:{}},Ph={};var l0;function TC(){return l0||(l0=1,(function(e){function t(U,K){var B=U.length;U.push(K);e:for(;0<B;){var he=B-1>>>1,O=U[he];if(0<o(O,K))U[he]=K,U[B]=O,B=he;else break e}}function n(U){return U.length===0?null:U[0]}function a(U){if(U.length===0)return null;var K=U[0],B=U.pop();if(B!==K){U[0]=B;e:for(var he=0,O=U.length,S=O>>>1;he<S;){var H=2*(he+1)-1,w=U[H],G=H+1,de=U[G];if(0>o(w,B))G<O&&0>o(de,w)?(U[he]=de,U[G]=B,he=G):(U[he]=w,U[H]=B,he=H);else if(G<O&&0>o(de,B))U[he]=de,U[G]=B,he=G;else break e}}return K}function o(U,K){var B=U.sortIndex-K.sortIndex;return B!==0?B:U.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var h=[],m=[],g=1,x=null,b=3,v=!1,z=!1,T=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function $(U){for(var K=n(m);K!==null;){if(K.callback===null)a(m);else if(K.startTime<=U)a(m),K.sortIndex=K.expirationTime,t(h,K);else break;K=n(m)}}function L(U){if(T=!1,$(U),!z)if(n(h)!==null)z=!0,M||(M=!0,se());else{var K=n(m);K!==null&&ae(L,K.startTime-U)}}var M=!1,q=-1,V=5,X=-1;function ce(){return E?!0:!(e.unstable_now()-X<V)}function Q(){if(E=!1,M){var U=e.unstable_now();X=U;var K=!0;try{e:{z=!1,T&&(T=!1,A(q),q=-1),v=!0;var B=b;try{t:{for($(U),x=n(h);x!==null&&!(x.expirationTime>U&&ce());){var he=x.callback;if(typeof he=="function"){x.callback=null,b=x.priorityLevel;var O=he(x.expirationTime<=U);if(U=e.unstable_now(),typeof O=="function"){x.callback=O,$(U),K=!0;break t}x===n(h)&&a(h),$(U)}else a(h);x=n(h)}if(x!==null)K=!0;else{var S=n(m);S!==null&&ae(L,S.startTime-U),K=!1}}break e}finally{x=null,b=B,v=!1}K=void 0}}finally{K?se():M=!1}}}var se;if(typeof C=="function")se=function(){C(Q)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,oe=te.port2;te.port1.onmessage=Q,se=function(){oe.postMessage(null)}}else se=function(){N(Q,0)};function ae(U,K){q=N(function(){U(e.unstable_now())},K)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(U){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var B=b;b=K;try{return U()}finally{b=B}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(U,K){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var B=b;b=U;try{return K()}finally{b=B}},e.unstable_scheduleCallback=function(U,K,B){var he=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?he+B:he):B=he,U){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=B+O,U={id:g++,callback:K,priorityLevel:U,startTime:B,expirationTime:O,sortIndex:-1},B>he?(U.sortIndex=B,t(m,U),n(h)===null&&U===n(m)&&(T?(A(q),q=-1):T=!0,ae(L,B-he))):(U.sortIndex=O,t(h,U),z||v||(z=!0,M||(M=!0,se()))),U},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(U){var K=b;return function(){var B=b;b=K;try{return U.apply(this,arguments)}finally{b=B}}}})(Ph)),Ph}var u0;function CC(){return u0||(u0=1,Lh.exports=TC()),Lh.exports}var Uh={exports:{}},sn={};var c0;function EC(){if(c0)return sn;c0=1;var e=td();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(h,m,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:h,containerInfo:m,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,sn.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return u(h,m,null,g)},sn.flushSync=function(h){var m=l.T,g=a.p;try{if(l.T=null,a.p=2,h)return h()}finally{l.T=m,a.p=g,a.d.f()}},sn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},sn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},sn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,x=d(g,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:v}):g==="script"&&a.d.X(h,{crossOrigin:x,integrity:b,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},sn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},sn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,x=d(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},sn.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},sn.requestFormReset=function(h){a.d.r(h)},sn.unstable_batchedUpdates=function(h,m){return h(m)},sn.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},sn.useFormStatus=function(){return l.H.useHostTransitionStatus()},sn.version="19.2.4",sn}var d0;function NC(){if(d0)return Uh.exports;d0=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(),Uh.exports=EC(),Uh.exports}var f0;function AC(){if(f0)return Ks;f0=1;var e=CC(),t=td(),n=NC();function a(r){var i="https://react.dev/errors/"+r;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 #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function l(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(u(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,c=i;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return h(p),r;if(y===c)return h(p),i;y=y.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=y;else{for(var k=!1,_=p.child;_;){if(_===s){k=!0,s=p,c=y;break}if(_===c){k=!0,c=p,s=y;break}_=_.sibling}if(!k){for(_=y.child;_;){if(_===s){k=!0,s=y,c=p;break}if(_===c){k=!0,c=y,s=p;break}_=_.sibling}if(!k)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?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),C=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ce=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(r){return r===null||typeof r!="object"?null:(r=Q&&r[Q]||r["@@iterator"],typeof r=="function"?r:null)}var te=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===te?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case z:return"Portal";case C:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case $:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case q:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case V:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ae=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},he=[],O=-1;function S(r){return{current:r}}function H(r){0>O||(r.current=he[O],he[O]=null,O--)}function w(r,i){O++,he[O]=r.current,r.current=i}var G=S(null),de=S(null),fe=S(null),me=S(null);function De(r,i){switch(w(fe,i),w(de,r),w(G,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Tv(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Tv(i),r=Cv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(G),w(G,r)}function Ne(){H(G),H(de),H(fe)}function kt(r){r.memoizedState!==null&&w(me,r);var i=G.current,s=Cv(i,r.type);i!==s&&(w(de,r),w(G,s))}function It(r){de.current===r&&(H(G),H(de)),me.current===r&&(H(me),Fs._currentValue=B)}var fn,st;function wt(r){if(fn===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);fn=i&&i[1]||"",st=-1<s.stack.indexOf(`
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function Bp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mh={exports:{}},Ks={};var a0;function zC(){if(a0)return Ks;a0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,u){var l=null;if(u!==void 0&&(l=""+u),o.key!==void 0&&(l=""+o.key),"key"in o){u={};for(var d in o)d!=="key"&&(u[d]=o[d])}else u=o;return o=u.ref,{$$typeof:e,type:a,key:l,ref:o!==void 0?o:null,props:u}}return Ks.Fragment=t,Ks.jsx=n,Ks.jsxs=n,Ks}var i0;function _C(){return i0||(i0=1,Mh.exports=zC()),Mh.exports}var f=_C(),Dh={exports:{}},Ee={};var o0;function jC(){if(o0)return Ee;o0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function v(S){return S===null||typeof S!="object"?null:(S=b&&S[b]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,E={};function N(S,H,w){this.props=S,this.context=H,this.refs=E,this.updater=w||z}N.prototype.isReactComponent={},N.prototype.setState=function(S,H){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,H,"setState")},N.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function A(){}A.prototype=N.prototype;function C(S,H,w){this.props=S,this.context=H,this.refs=E,this.updater=w||z}var $=C.prototype=new A;$.constructor=C,T($,N.prototype),$.isPureReactComponent=!0;var L=Array.isArray;function M(){}var q={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function X(S,H,w){var G=w.ref;return{$$typeof:e,type:S,key:H,ref:G!==void 0?G:null,props:w}}function ce(S,H){return X(S.type,H,S.props)}function Q(S){return typeof S=="object"&&S!==null&&S.$$typeof===e}function se(S){var H={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(w){return H[w]})}var te=/\/+/g;function oe(S,H){return typeof S=="object"&&S!==null&&S.key!=null?se(""+S.key):H.toString(36)}function ae(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(M,M):(S.status="pending",S.then(function(H){S.status==="pending"&&(S.status="fulfilled",S.value=H)},function(H){S.status==="pending"&&(S.status="rejected",S.reason=H)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function U(S,H,w,G,de){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var me=!1;if(S===null)me=!0;else switch(fe){case"bigint":case"string":case"number":me=!0;break;case"object":switch(S.$$typeof){case e:case t:me=!0;break;case g:return me=S._init,U(me(S._payload),H,w,G,de)}}if(me)return de=de(S),me=G===""?"."+oe(S,0):G,L(de)?(w="",me!=null&&(w=me.replace(te,"$&/")+"/"),U(de,H,w,"",function(kt){return kt})):de!=null&&(Q(de)&&(de=ce(de,w+(de.key==null||S&&S.key===de.key?"":(""+de.key).replace(te,"$&/")+"/")+me)),H.push(de)),1;me=0;var De=G===""?".":G+":";if(L(S))for(var Ne=0;Ne<S.length;Ne++)G=S[Ne],fe=De+oe(G,Ne),me+=U(G,H,w,fe,de);else if(Ne=v(S),typeof Ne=="function")for(S=Ne.call(S),Ne=0;!(G=S.next()).done;)G=G.value,fe=De+oe(G,Ne++),me+=U(G,H,w,fe,de);else if(fe==="object"){if(typeof S.then=="function")return U(ae(S),H,w,G,de);throw H=String(S),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return me}function K(S,H,w){if(S==null)return S;var G=[],de=0;return U(S,G,"","",function(fe){return H.call(w,fe,de++)}),G}function B(S){if(S._status===-1){var H=S._result;H=H(),H.then(function(w){(S._status===0||S._status===-1)&&(S._status=1,S._result=w)},function(w){(S._status===0||S._status===-1)&&(S._status=2,S._result=w)}),S._status===-1&&(S._status=0,S._result=H)}if(S._status===1)return S._result.default;throw S._result}var he=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},O={map:K,forEach:function(S,H,w){K(S,function(){H.apply(this,arguments)},w)},count:function(S){var H=0;return K(S,function(){H++}),H},toArray:function(S){return K(S,function(H){return H})||[]},only:function(S){if(!Q(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ee.Activity=x,Ee.Children=O,Ee.Component=N,Ee.Fragment=n,Ee.Profiler=o,Ee.PureComponent=C,Ee.StrictMode=a,Ee.Suspense=h,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(S){return q.H.useMemoCache(S)}},Ee.cache=function(S){return function(){return S.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(S,H,w){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var G=T({},S.props),de=S.key;if(H!=null)for(fe in H.key!==void 0&&(de=""+H.key),H)!V.call(H,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&H.ref===void 0||(G[fe]=H[fe]);var fe=arguments.length-2;if(fe===1)G.children=w;else if(1<fe){for(var me=Array(fe),De=0;De<fe;De++)me[De]=arguments[De+2];G.children=me}return X(S.type,de,G)},Ee.createContext=function(S){return S={$$typeof:l,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:u,_context:S},S},Ee.createElement=function(S,H,w){var G,de={},fe=null;if(H!=null)for(G in H.key!==void 0&&(fe=""+H.key),H)V.call(H,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(de[G]=H[G]);var me=arguments.length-2;if(me===1)de.children=w;else if(1<me){for(var De=Array(me),Ne=0;Ne<me;Ne++)De[Ne]=arguments[Ne+2];de.children=De}if(S&&S.defaultProps)for(G in me=S.defaultProps,me)de[G]===void 0&&(de[G]=me[G]);return X(S,fe,de)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(S){return{$$typeof:d,render:S}},Ee.isValidElement=Q,Ee.lazy=function(S){return{$$typeof:g,_payload:{_status:-1,_result:S},_init:B}},Ee.memo=function(S,H){return{$$typeof:m,type:S,compare:H===void 0?null:H}},Ee.startTransition=function(S){var H=q.T,w={};q.T=w;try{var G=S(),de=q.S;de!==null&&de(w,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(M,he)}catch(fe){he(fe)}finally{H!==null&&w.types!==null&&(H.types=w.types),q.T=H}},Ee.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Ee.use=function(S){return q.H.use(S)},Ee.useActionState=function(S,H,w){return q.H.useActionState(S,H,w)},Ee.useCallback=function(S,H){return q.H.useCallback(S,H)},Ee.useContext=function(S){return q.H.useContext(S)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(S,H){return q.H.useDeferredValue(S,H)},Ee.useEffect=function(S,H){return q.H.useEffect(S,H)},Ee.useEffectEvent=function(S){return q.H.useEffectEvent(S)},Ee.useId=function(){return q.H.useId()},Ee.useImperativeHandle=function(S,H,w){return q.H.useImperativeHandle(S,H,w)},Ee.useInsertionEffect=function(S,H){return q.H.useInsertionEffect(S,H)},Ee.useLayoutEffect=function(S,H){return q.H.useLayoutEffect(S,H)},Ee.useMemo=function(S,H){return q.H.useMemo(S,H)},Ee.useOptimistic=function(S,H){return q.H.useOptimistic(S,H)},Ee.useReducer=function(S,H,w){return q.H.useReducer(S,H,w)},Ee.useRef=function(S){return q.H.useRef(S)},Ee.useState=function(S){return q.H.useState(S)},Ee.useSyncExternalStore=function(S,H,w){return q.H.useSyncExternalStore(S,H,w)},Ee.useTransition=function(){return q.H.useTransition()},Ee.version="19.2.4",Ee}var s0;function td(){return s0||(s0=1,Dh.exports=jC()),Dh.exports}var j=td();const Zp=Bp(j);var $h={exports:{}},Js={},Lh={exports:{}},Ph={};var l0;function TC(){return l0||(l0=1,(function(e){function t(U,K){var B=U.length;U.push(K);e:for(;0<B;){var he=B-1>>>1,O=U[he];if(0<o(O,K))U[he]=K,U[B]=O,B=he;else break e}}function n(U){return U.length===0?null:U[0]}function a(U){if(U.length===0)return null;var K=U[0],B=U.pop();if(B!==K){U[0]=B;e:for(var he=0,O=U.length,S=O>>>1;he<S;){var H=2*(he+1)-1,w=U[H],G=H+1,de=U[G];if(0>o(w,B))G<O&&0>o(de,w)?(U[he]=de,U[G]=B,he=G):(U[he]=w,U[H]=B,he=H);else if(G<O&&0>o(de,B))U[he]=de,U[G]=B,he=G;else break e}}return K}function o(U,K){var B=U.sortIndex-K.sortIndex;return B!==0?B:U.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var h=[],m=[],g=1,x=null,b=3,v=!1,z=!1,T=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function $(U){for(var K=n(m);K!==null;){if(K.callback===null)a(m);else if(K.startTime<=U)a(m),K.sortIndex=K.expirationTime,t(h,K);else break;K=n(m)}}function L(U){if(T=!1,$(U),!z)if(n(h)!==null)z=!0,M||(M=!0,se());else{var K=n(m);K!==null&&ae(L,K.startTime-U)}}var M=!1,q=-1,V=5,X=-1;function ce(){return E?!0:!(e.unstable_now()-X<V)}function Q(){if(E=!1,M){var U=e.unstable_now();X=U;var K=!0;try{e:{z=!1,T&&(T=!1,A(q),q=-1),v=!0;var B=b;try{t:{for($(U),x=n(h);x!==null&&!(x.expirationTime>U&&ce());){var he=x.callback;if(typeof he=="function"){x.callback=null,b=x.priorityLevel;var O=he(x.expirationTime<=U);if(U=e.unstable_now(),typeof O=="function"){x.callback=O,$(U),K=!0;break t}x===n(h)&&a(h),$(U)}else a(h);x=n(h)}if(x!==null)K=!0;else{var S=n(m);S!==null&&ae(L,S.startTime-U),K=!1}}break e}finally{x=null,b=B,v=!1}K=void 0}}finally{K?se():M=!1}}}var se;if(typeof C=="function")se=function(){C(Q)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,oe=te.port2;te.port1.onmessage=Q,se=function(){oe.postMessage(null)}}else se=function(){N(Q,0)};function ae(U,K){q=N(function(){U(e.unstable_now())},K)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(U){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var B=b;b=K;try{return U()}finally{b=B}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(U,K){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var B=b;b=U;try{return K()}finally{b=B}},e.unstable_scheduleCallback=function(U,K,B){var he=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?he+B:he):B=he,U){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=B+O,U={id:g++,callback:K,priorityLevel:U,startTime:B,expirationTime:O,sortIndex:-1},B>he?(U.sortIndex=B,t(m,U),n(h)===null&&U===n(m)&&(T?(A(q),q=-1):T=!0,ae(L,B-he))):(U.sortIndex=O,t(h,U),z||v||(z=!0,M||(M=!0,se()))),U},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(U){var K=b;return function(){var B=b;b=K;try{return U.apply(this,arguments)}finally{b=B}}}})(Ph)),Ph}var u0;function CC(){return u0||(u0=1,Lh.exports=TC()),Lh.exports}var Uh={exports:{}},sn={};var c0;function EC(){if(c0)return sn;c0=1;var e=td();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(h,m,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:h,containerInfo:m,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,sn.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return u(h,m,null,g)},sn.flushSync=function(h){var m=l.T,g=a.p;try{if(l.T=null,a.p=2,h)return h()}finally{l.T=m,a.p=g,a.d.f()}},sn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},sn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},sn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,x=d(g,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:v}):g==="script"&&a.d.X(h,{crossOrigin:x,integrity:b,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},sn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},sn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,x=d(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},sn.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},sn.requestFormReset=function(h){a.d.r(h)},sn.unstable_batchedUpdates=function(h,m){return h(m)},sn.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},sn.useFormStatus=function(){return l.H.useHostTransitionStatus()},sn.version="19.2.4",sn}var d0;function NC(){if(d0)return Uh.exports;d0=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(),Uh.exports=EC(),Uh.exports}var f0;function AC(){if(f0)return Js;f0=1;var e=CC(),t=td(),n=NC();function a(r){var i="https://react.dev/errors/"+r;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 #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function l(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(u(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,c=i;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return h(p),r;if(y===c)return h(p),i;y=y.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=y;else{for(var k=!1,_=p.child;_;){if(_===s){k=!0,s=p,c=y;break}if(_===c){k=!0,c=p,s=y;break}_=_.sibling}if(!k){for(_=y.child;_;){if(_===s){k=!0,s=y,c=p;break}if(_===c){k=!0,c=y,s=p;break}_=_.sibling}if(!k)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?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),C=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ce=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(r){return r===null||typeof r!="object"?null:(r=Q&&r[Q]||r["@@iterator"],typeof r=="function"?r:null)}var te=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===te?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case z:return"Portal";case C:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case $:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case q:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case V:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ae=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},he=[],O=-1;function S(r){return{current:r}}function H(r){0>O||(r.current=he[O],he[O]=null,O--)}function w(r,i){O++,he[O]=r.current,r.current=i}var G=S(null),de=S(null),fe=S(null),me=S(null);function De(r,i){switch(w(fe,i),w(de,r),w(G,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Tv(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Tv(i),r=Cv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(G),w(G,r)}function Ne(){H(G),H(de),H(fe)}function kt(r){r.memoizedState!==null&&w(me,r);var i=G.current,s=Cv(i,r.type);i!==s&&(w(de,r),w(G,s))}function It(r){de.current===r&&(H(G),H(de)),me.current===r&&(H(me),qs._currentValue=B)}var fn,st;function wt(r){if(fn===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);fn=i&&i[1]||"",st=-1<s.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+fn+r+st}var Fn=!1;function Ie(r,i){if(!r||Fn)return"";Fn=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Y){var F=Y}Reflect.construct(r,[],re)}else{try{re.call()}catch(Y){F=Y}r.call(re.prototype)}}else{try{throw Error()}catch(Y){F=Y}(re=r())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Y){if(Y&&F&&typeof Y.stack=="string")return[Y.stack,F.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 y=c.DetermineComponentFrameRoot(),k=y[0],_=y[1];if(k&&_){var R=k.split(`
4
4
  `),I=_.split(`
5
5
  `);for(p=c=0;c<R.length&&!R[c].includes("DetermineComponentFrameRoot");)c++;for(;p<I.length&&!I[p].includes("DetermineComponentFrameRoot");)p++;if(c===R.length||p===I.length)for(c=R.length-1,p=I.length-1;1<=c&&0<=p&&R[c]!==I[p];)p--;for(;1<=c&&0<=p;c--,p--)if(R[c]!==I[p]){if(c!==1||p!==1)do if(c--,p--,0>p||R[c]!==I[p]){var J=`
6
6
  `+R[c].replace(" at new "," at ");return r.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",r.displayName)),J}while(1<=c&&0<=p);break}}}finally{Fn=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?wt(s):""}function rt(r,i){switch(r.tag){case 26:case 27:case 5:return wt(r.type);case 16:return wt("Lazy");case 13:return r.child!==i&&i!==null?wt("Suspense Fallback"):wt("Suspense");case 19:return wt("SuspenseList");case 0:case 15:return Ie(r.type,!1);case 11:return Ie(r.type.render,!1);case 1:return Ie(r.type,!0);case 31:return wt("Activity");default:return""}}function dt(r){try{var i="",s=null;do i+=rt(r,s),s=r,r=r.return;while(r);return i}catch(c){return`
7
7
  Error generating stack: `+c.message+`
8
- `+c.stack}}var Qe=Object.prototype.hasOwnProperty,Xt=e.unstable_scheduleCallback,qn=e.unstable_cancelCallback,At=e.unstable_shouldYield,Ht=e.unstable_requestPaint,ft=e.unstable_now,Ri=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,ue=e.unstable_UserBlockingPriority,be=e.unstable_NormalPriority,je=e.unstable_LowPriority,Be=e.unstable_IdlePriority,hn=e.log,Rn=e.unstable_setDisableYieldValue,mn=null,Ft=null;function kn(r){if(typeof hn=="function"&&Rn(r),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(mn,r)}catch{}}var at=Math.clz32?Math.clz32:cj,la=Math.log,cr=Math.LN2;function cj(r){return r>>>=0,r===0?32:31-(la(r)/cr|0)|0}var Il=256,Hl=262144,Fl=4194304;function Qa(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ql(r,i,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var _=c&134217727;return _!==0?(c=_&~y,c!==0?p=Qa(c):(k&=_,k!==0?p=Qa(k):s||(s=_&~r,s!==0&&(p=Qa(s))))):(_=c&~y,_!==0?p=Qa(_):k!==0?p=Qa(k):s||(s=c&~r,s!==0&&(p=Qa(s)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,s=i&-i,y>=s||y===32&&(s&4194048)!==0)?i:p}function as(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function dj(r,i){switch(r){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 ly(){var r=Fl;return Fl<<=1,(Fl&62914560)===0&&(Fl=4194304),r}function kd(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function is(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function fj(r,i,s,c,p,y){var k=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var _=r.entanglements,R=r.expirationTimes,I=r.hiddenUpdates;for(s=k&~s;0<s;){var J=31-at(s),re=1<<J;_[J]=0,R[J]=-1;var F=I[J];if(F!==null)for(I[J]=null,J=0;J<F.length;J++){var Y=F[J];Y!==null&&(Y.lane&=-536870913)}s&=~re}c!==0&&uy(r,c,0),y!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function uy(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-at(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function cy(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var c=31-at(s),p=1<<c;p&i|r[c]&i&&(r[c]|=i),s&=~p}}function dy(r,i){var s=i&-i;return s=(s&42)!==0?1:wd(s),(s&(r.suspendedLanes|i))!==0?0:s}function wd(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Sd(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function fy(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:Jv(r.type))}function hy(r,i){var s=K.p;try{return K.p=r,i()}finally{K.p=s}}var ua=Math.random().toString(36).slice(2),Wt="__reactFiber$"+ua,wn="__reactProps$"+ua,Mi="__reactContainer$"+ua,zd="__reactEvents$"+ua,hj="__reactListeners$"+ua,mj="__reactHandles$"+ua,my="__reactResources$"+ua,os="__reactMarker$"+ua;function _d(r){delete r[Wt],delete r[wn],delete r[zd],delete r[hj],delete r[mj]}function Di(r){var i=r[Wt];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Mi]||s[Wt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Dv(r);r!==null;){if(s=r[Wt])return s;r=Dv(r)}return i}r=s,s=r.parentNode}return null}function $i(r){if(r=r[Wt]||r[Mi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ss(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Li(r){var i=r[my];return i||(i=r[my]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Kt(r){r[os]=!0}var py=new Set,gy={};function Wa(r,i){Pi(r,i),Pi(r+"Capture",i)}function Pi(r,i){for(gy[r]=i,r=0;r<i.length;r++)py.add(i[r])}var pj=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]*$"),yy={},xy={};function gj(r){return Qe.call(xy,r)?!0:Qe.call(yy,r)?!1:pj.test(r)?xy[r]=!0:(yy[r]=!0,!1)}function Gl(r,i,s){if(gj(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Yl(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function $r(r,i,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+c)}}function Gn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function by(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function yj(r,i,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(k){s=""+k,y.call(this,k)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function jd(r){if(!r._valueTracker){var i=by(r)?"checked":"value";r._valueTracker=yj(r,i,""+r[i])}}function vy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return r&&(c=by(r)?r.checked?"true":"false":r.value),r=c,r!==s?(i.setValue(r),!0):!1}function Xl(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var xj=/[\n"\\]/g;function Yn(r){return r.replace(xj,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Td(r,i,s,c,p,y,k,_){r.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.type=k:r.removeAttribute("type"),i!=null?k==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Gn(i)):r.value!==""+Gn(i)&&(r.value=""+Gn(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?Cd(r,k,Gn(i)):s!=null?Cd(r,k,Gn(s)):c!=null&&r.removeAttribute("value"),p==null&&y!=null&&(r.defaultChecked=!!y),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+Gn(_):r.removeAttribute("name")}function ky(r,i,s,c,p,y,k,_){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){jd(r);return}s=s!=null?""+Gn(s):"",i=i!=null?""+Gn(i):s,_||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=_?r.checked:!!c,r.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),jd(r)}function Cd(r,i,s){i==="number"&&Xl(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ui(r,i,s,c){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&c&&(r[s].defaultSelected=!0)}else{for(s=""+Gn(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function wy(r,i,s){if(i!=null&&(i=""+Gn(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+Gn(s):""}function Sy(r,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(ae(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=Gn(i),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),jd(r)}function Vi(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var bj=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 zy(r,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,s):typeof s!="number"||s===0||bj.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function _y(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&zy(r,p,c)}else for(var y in i)i.hasOwnProperty(y)&&zy(r,y,i[y])}function Ed(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vj=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"]]),kj=/^[\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 Kl(r){return kj.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Lr(){}var Nd=null;function Ad(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Bi=null,Zi=null;function jy(r){var i=$i(r);if(i&&(r=i.stateNode)){var s=r[wn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Td(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Yn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==r&&c.form===r.form){var p=c[wn]||null;if(!p)throw Error(a(90));Td(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===r.form&&vy(c)}break e;case"textarea":wy(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ui(r,!!s.multiple,i,!1)}}}var Od=!1;function Ty(r,i,s){if(Od)return r(i,s);Od=!0;try{var c=r(i);return c}finally{if(Od=!1,(Bi!==null||Zi!==null)&&(Lu(),Bi&&(i=Bi,r=Zi,Zi=Bi=null,jy(i),r)))for(i=0;i<r.length;i++)jy(r[i])}}function ls(r,i){var s=r.stateNode;if(s===null)return null;var c=s[wn]||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)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rd=!1;if(Pr)try{var us={};Object.defineProperty(us,"passive",{get:function(){Rd=!0}}),window.addEventListener("test",us,us),window.removeEventListener("test",us,us)}catch{Rd=!1}var ca=null,Md=null,Jl=null;function Cy(){if(Jl)return Jl;var r,i=Md,s=i.length,c,p="value"in ca?ca.value:ca.textContent,y=p.length;for(r=0;r<s&&i[r]===p[r];r++);var k=s-r;for(c=1;c<=k&&i[s-c]===p[y-c];c++);return Jl=p.slice(r,1<c?1-c:void 0)}function Ql(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Wl(){return!0}function Ey(){return!1}function Sn(r){function i(s,c,p,y,k){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(s=r[_],this[_]=s?s(y):y[_]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Wl:Ey,this.isPropagationStopped=Ey,this}return x(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=Wl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),i}var ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=Sn(ei),cs=x({},ei,{view:0,detail:0}),wj=Sn(cs),Dd,$d,ds,tu=x({},cs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ds&&(ds&&r.type==="mousemove"?(Dd=r.screenX-ds.screenX,$d=r.screenY-ds.screenY):$d=Dd=0,ds=r),Dd)},movementY:function(r){return"movementY"in r?r.movementY:$d}}),Ny=Sn(tu),Sj=x({},tu,{dataTransfer:0}),zj=Sn(Sj),_j=x({},cs,{relatedTarget:0}),Ld=Sn(_j),jj=x({},ei,{animationName:0,elapsedTime:0,pseudoElement:0}),Tj=Sn(jj),Cj=x({},ei,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Ej=Sn(Cj),Nj=x({},ei,{data:0}),Ay=Sn(Nj),Aj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oj={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"},Rj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mj(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Rj[r])?!!i[r]:!1}function Pd(){return Mj}var Dj=x({},cs,{key:function(r){if(r.key){var i=Aj[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ql(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Oj[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pd,charCode:function(r){return r.type==="keypress"?Ql(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ql(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),$j=Sn(Dj),Lj=x({},tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Oy=Sn(Lj),Pj=x({},cs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pd}),Uj=Sn(Pj),Vj=x({},ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bj=Sn(Vj),Zj=x({},tu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Ij=Sn(Zj),Hj=x({},ei,{newState:0,oldState:0}),Fj=Sn(Hj),qj=[9,13,27,32],Ud=Pr&&"CompositionEvent"in window,fs=null;Pr&&"documentMode"in document&&(fs=document.documentMode);var Gj=Pr&&"TextEvent"in window&&!fs,Ry=Pr&&(!Ud||fs&&8<fs&&11>=fs),My=" ",Dy=!1;function $y(r,i){switch(r){case"keyup":return qj.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ly(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ii=!1;function Yj(r,i){switch(r){case"compositionend":return Ly(i);case"keypress":return i.which!==32?null:(Dy=!0,My);case"textInput":return r=i.data,r===My&&Dy?null:r;default:return null}}function Xj(r,i){if(Ii)return r==="compositionend"||!Ud&&$y(r,i)?(r=Cy(),Jl=Md=ca=null,Ii=!1,r):null;switch(r){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 Ry&&i.locale!=="ko"?null:i.data;default:return null}}var Kj={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 Py(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!Kj[r.type]:i==="textarea"}function Uy(r,i,s,c){Bi?Zi?Zi.push(c):Zi=[c]:Bi=c,i=Hu(i,"onChange"),0<i.length&&(s=new eu("onChange","change",null,s,c),r.push({event:s,listeners:i}))}var hs=null,ms=null;function Jj(r){kv(r,0)}function nu(r){var i=ss(r);if(vy(i))return r}function Vy(r,i){if(r==="change")return i}var By=!1;if(Pr){var Vd;if(Pr){var Bd="oninput"in document;if(!Bd){var Zy=document.createElement("div");Zy.setAttribute("oninput","return;"),Bd=typeof Zy.oninput=="function"}Vd=Bd}else Vd=!1;By=Vd&&(!document.documentMode||9<document.documentMode)}function Iy(){hs&&(hs.detachEvent("onpropertychange",Hy),ms=hs=null)}function Hy(r){if(r.propertyName==="value"&&nu(ms)){var i=[];Uy(i,ms,r,Ad(r)),Ty(Jj,i)}}function Qj(r,i,s){r==="focusin"?(Iy(),hs=i,ms=s,hs.attachEvent("onpropertychange",Hy)):r==="focusout"&&Iy()}function Wj(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return nu(ms)}function eT(r,i){if(r==="click")return nu(i)}function tT(r,i){if(r==="input"||r==="change")return nu(i)}function nT(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Mn=typeof Object.is=="function"?Object.is:nT;function ps(r,i){if(Mn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Qe.call(i,p)||!Mn(r[p],i[p]))return!1}return!0}function Fy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function qy(r,i){var s=Fy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=i&&c>=i)return{node:s,offset:i-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fy(s)}}function Gy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Gy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Yy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Xl(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=Xl(r.document)}return i}function Zd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var rT=Pr&&"documentMode"in document&&11>=document.documentMode,Hi=null,Id=null,gs=null,Hd=!1;function Xy(r,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Hd||Hi==null||Hi!==Xl(c)||(c=Hi,"selectionStart"in c&&Zd(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}),gs&&ps(gs,c)||(gs=c,c=Hu(Id,"onSelect"),0<c.length&&(i=new eu("onSelect","select",null,i,s),r.push({event:i,listeners:c}),i.target=Hi)))}function ti(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Fi={animationend:ti("Animation","AnimationEnd"),animationiteration:ti("Animation","AnimationIteration"),animationstart:ti("Animation","AnimationStart"),transitionrun:ti("Transition","TransitionRun"),transitionstart:ti("Transition","TransitionStart"),transitioncancel:ti("Transition","TransitionCancel"),transitionend:ti("Transition","TransitionEnd")},Fd={},Ky={};Pr&&(Ky=document.createElement("div").style,"AnimationEvent"in window||(delete Fi.animationend.animation,delete Fi.animationiteration.animation,delete Fi.animationstart.animation),"TransitionEvent"in window||delete Fi.transitionend.transition);function ni(r){if(Fd[r])return Fd[r];if(!Fi[r])return r;var i=Fi[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Ky)return Fd[r]=i[s];return r}var Jy=ni("animationend"),Qy=ni("animationiteration"),Wy=ni("animationstart"),aT=ni("transitionrun"),iT=ni("transitionstart"),oT=ni("transitioncancel"),ex=ni("transitionend"),tx=new Map,qd="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(" ");qd.push("scrollEnd");function dr(r,i){tx.set(r,i),Wa(i,[r])}var ru=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Xn=[],qi=0,Gd=0;function au(){for(var r=qi,i=Gd=qi=0;i<r;){var s=Xn[i];Xn[i++]=null;var c=Xn[i];Xn[i++]=null;var p=Xn[i];Xn[i++]=null;var y=Xn[i];if(Xn[i++]=null,c!==null&&p!==null){var k=c.pending;k===null?p.next=p:(p.next=k.next,k.next=p),c.pending=p}y!==0&&nx(s,p,y)}}function iu(r,i,s,c){Xn[qi++]=r,Xn[qi++]=i,Xn[qi++]=s,Xn[qi++]=c,Gd|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Yd(r,i,s,c){return iu(r,i,s,c),ou(r)}function ri(r,i){return iu(r,null,null,i),ou(r)}function nx(r,i,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,y=r.return;y!==null;)y.childLanes|=s,c=y.alternate,c!==null&&(c.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(p=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,p&&i!==null&&(p=31-at(s),r=y.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=s|536870912),y):null}function ou(r){if(50<Ps)throw Ps=0,ah=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Gi={};function sT(r,i,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=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 Dn(r,i,s,c){return new sT(r,i,s,c)}function Xd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ur(r,i){var s=r.alternate;return s===null?(s=Dn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function rx(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function su(r,i,s,c,p,y){var k=0;if(c=r,typeof r=="function")Xd(r)&&(k=1);else if(typeof r=="string")k=fC(r,s,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=Dn(31,s,i,p),r.elementType=X,r.lanes=y,r;case T:return ai(s.children,p,y,i);case E:k=8,p|=24;break;case N:return r=Dn(12,s,i,p|2),r.elementType=N,r.lanes=y,r;case L:return r=Dn(13,s,i,p),r.elementType=L,r.lanes=y,r;case M:return r=Dn(19,s,i,p),r.elementType=M,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:k=10;break e;case A:k=9;break e;case $:k=11;break e;case q:k=14;break e;case V:k=16,c=null;break e}k=29,s=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Dn(k,s,i,p),i.elementType=r,i.type=c,i.lanes=y,i}function ai(r,i,s,c){return r=Dn(7,r,c,i),r.lanes=s,r}function Kd(r,i,s){return r=Dn(6,r,null,i),r.lanes=s,r}function ax(r){var i=Dn(18,null,null,0);return i.stateNode=r,i}function Jd(r,i,s){return i=Dn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var ix=new WeakMap;function Kn(r,i){if(typeof r=="object"&&r!==null){var s=ix.get(r);return s!==void 0?s:(i={value:r,source:i,stack:dt(i)},ix.set(r,i),i)}return{value:r,source:i,stack:dt(i)}}var Yi=[],Xi=0,lu=null,ys=0,Jn=[],Qn=0,da=null,xr=1,br="";function Vr(r,i){Yi[Xi++]=ys,Yi[Xi++]=lu,lu=r,ys=i}function ox(r,i,s){Jn[Qn++]=xr,Jn[Qn++]=br,Jn[Qn++]=da,da=r;var c=xr;r=br;var p=32-at(c)-1;c&=~(1<<p),s+=1;var y=32-at(i)+p;if(30<y){var k=p-p%5;y=(c&(1<<k)-1).toString(32),c>>=k,p-=k,xr=1<<32-at(i)+p|s<<p|c,br=y+r}else xr=1<<y|s<<p|c,br=r}function Qd(r){r.return!==null&&(Vr(r,1),ox(r,1,0))}function Wd(r){for(;r===lu;)lu=Yi[--Xi],Yi[Xi]=null,ys=Yi[--Xi],Yi[Xi]=null;for(;r===da;)da=Jn[--Qn],Jn[Qn]=null,br=Jn[--Qn],Jn[Qn]=null,xr=Jn[--Qn],Jn[Qn]=null}function sx(r,i){Jn[Qn++]=xr,Jn[Qn++]=br,Jn[Qn++]=da,xr=i.id,br=i.overflow,da=r}var en=null,ht=null,Ve=!1,fa=null,Wn=!1,ef=Error(a(519));function ha(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xs(Kn(i,r)),ef}function lx(r){var i=r.stateNode,s=r.type,c=r.memoizedProps;switch(i[Wt]=r,i[wn]=c,s){case"dialog":Le("cancel",i),Le("close",i);break;case"iframe":case"object":case"embed":Le("load",i);break;case"video":case"audio":for(s=0;s<Vs.length;s++)Le(Vs[s],i);break;case"source":Le("error",i);break;case"img":case"image":case"link":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"input":Le("invalid",i),ky(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Le("invalid",i);break;case"textarea":Le("invalid",i),Sy(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||_v(i.textContent,s)?(c.popover!=null&&(Le("beforetoggle",i),Le("toggle",i)),c.onScroll!=null&&Le("scroll",i),c.onScrollEnd!=null&&Le("scrollend",i),c.onClick!=null&&(i.onclick=Lr),i=!0):i=!1,i||ha(r,!0)}function ux(r){for(en=r.return;en;)switch(en.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:en=en.return}}function Ki(r){if(r!==en)return!1;if(!Ve)return ux(r),Ve=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||bh(r.type,r.memoizedProps)),s=!s),s&&ht&&ha(r),ux(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));ht=Mv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));ht=Mv(r)}else i===27?(i=ht,Ta(r.type)?(r=zh,zh=null,ht=r):ht=i):ht=en?tr(r.stateNode.nextSibling):null;return!0}function ii(){ht=en=null,Ve=!1}function tf(){var r=fa;return r!==null&&(Tn===null?Tn=r:Tn.push.apply(Tn,r),fa=null),r}function xs(r){fa===null?fa=[r]:fa.push(r)}var nf=S(null),oi=null,Br=null;function ma(r,i,s){w(nf,i._currentValue),i._currentValue=s}function Zr(r){r._currentValue=nf.current,H(nf)}function rf(r,i,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===s)break;r=r.return}}function af(r,i,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var y=p.dependencies;if(y!==null){var k=p.child;y=y.firstContext;e:for(;y!==null;){var _=y;y=p;for(var R=0;R<i.length;R++)if(_.context===i[R]){y.lanes|=s,_=y.alternate,_!==null&&(_.lanes|=s),rf(y.return,s,r),c||(k=null);break e}y=_.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(a(341));k.lanes|=s,y=k.alternate,y!==null&&(y.lanes|=s),rf(k,s,r),k=null}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===r){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function Ji(r,i,s,c){r=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(a(387));if(k=k.memoizedProps,k!==null){var _=p.type;Mn(p.pendingProps.value,k.value)||(r!==null?r.push(_):r=[_])}}else if(p===me.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Fs):r=[Fs])}p=p.return}r!==null&&af(i,r,s,c),i.flags|=262144}function uu(r){for(r=r.firstContext;r!==null;){if(!Mn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function si(r){oi=r,Br=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function tn(r){return cx(oi,r)}function cu(r,i){return oi===null&&si(r),cx(r,i)}function cx(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Br===null){if(r===null)throw Error(a(308));Br=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Br=Br.next=i;return s}var lT=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},uT=e.unstable_scheduleCallback,cT=e.unstable_NormalPriority,Mt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function of(){return{controller:new lT,data:new Map,refCount:0}}function bs(r){r.refCount--,r.refCount===0&&uT(cT,function(){r.controller.abort()})}var vs=null,sf=0,Qi=0,Wi=null;function dT(r,i){if(vs===null){var s=vs=[];sf=0,Qi=ch(),Wi={status:"pending",value:void 0,then:function(c){s.push(c)}}}return sf++,i.then(dx,dx),i}function dx(){if(--sf===0&&vs!==null){Wi!==null&&(Wi.status="fulfilled");var r=vs;vs=null,Qi=0,Wi=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function fT(r,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.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 fx=U.S;U.S=function(r,i){Xb=ft(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&dT(r,i),fx!==null&&fx(r,i)};var li=S(null);function lf(){var r=li.current;return r!==null?r:it.pooledCache}function du(r,i){i===null?w(li,li.current):w(li,i.pool)}function hx(){var r=lf();return r===null?null:{parent:Mt._currentValue,pool:r}}var eo=Error(a(460)),uf=Error(a(474)),fu=Error(a(542)),hu={then:function(){}};function mx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function px(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(Lr,Lr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,yx(r),r;default:if(typeof i.status=="string")i.then(Lr,Lr);else{if(r=it,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.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 r=i.reason,yx(r),r}throw ci=i,eo}}function ui(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ci=s,eo):s}}var ci=null;function gx(){if(ci===null)throw Error(a(459));var r=ci;return ci=null,r}function yx(r){if(r===eo||r===fu)throw Error(a(483))}var to=null,ks=0;function mu(r){var i=ks;return ks+=1,to===null&&(to=[]),px(to,r,i)}function ws(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function pu(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function xx(r){function i(P,D){if(r){var Z=P.deletions;Z===null?(P.deletions=[D],P.flags|=16):Z.push(D)}}function s(P,D){if(!r)return null;for(;D!==null;)i(P,D),D=D.sibling;return null}function c(P){for(var D=new Map;P!==null;)P.key!==null?D.set(P.key,P):D.set(P.index,P),P=P.sibling;return D}function p(P,D){return P=Ur(P,D),P.index=0,P.sibling=null,P}function y(P,D,Z){return P.index=Z,r?(Z=P.alternate,Z!==null?(Z=Z.index,Z<D?(P.flags|=67108866,D):Z):(P.flags|=67108866,D)):(P.flags|=1048576,D)}function k(P){return r&&P.alternate===null&&(P.flags|=67108866),P}function _(P,D,Z,ne){return D===null||D.tag!==6?(D=Kd(Z,P.mode,ne),D.return=P,D):(D=p(D,Z),D.return=P,D)}function R(P,D,Z,ne){var Se=Z.type;return Se===T?J(P,D,Z.props.children,ne,Z.key):D!==null&&(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&ui(Se)===D.type)?(D=p(D,Z.props),ws(D,Z),D.return=P,D):(D=su(Z.type,Z.key,Z.props,null,P.mode,ne),ws(D,Z),D.return=P,D)}function I(P,D,Z,ne){return D===null||D.tag!==4||D.stateNode.containerInfo!==Z.containerInfo||D.stateNode.implementation!==Z.implementation?(D=Jd(Z,P.mode,ne),D.return=P,D):(D=p(D,Z.children||[]),D.return=P,D)}function J(P,D,Z,ne,Se){return D===null||D.tag!==7?(D=ai(Z,P.mode,ne,Se),D.return=P,D):(D=p(D,Z),D.return=P,D)}function re(P,D,Z){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=Kd(""+D,P.mode,Z),D.return=P,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case v:return Z=su(D.type,D.key,D.props,null,P.mode,Z),ws(Z,D),Z.return=P,Z;case z:return D=Jd(D,P.mode,Z),D.return=P,D;case V:return D=ui(D),re(P,D,Z)}if(ae(D)||se(D))return D=ai(D,P.mode,Z,null),D.return=P,D;if(typeof D.then=="function")return re(P,mu(D),Z);if(D.$$typeof===C)return re(P,cu(P,D),Z);pu(P,D)}return null}function F(P,D,Z,ne){var Se=D!==null?D.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Se!==null?null:_(P,D,""+Z,ne);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return Z.key===Se?R(P,D,Z,ne):null;case z:return Z.key===Se?I(P,D,Z,ne):null;case V:return Z=ui(Z),F(P,D,Z,ne)}if(ae(Z)||se(Z))return Se!==null?null:J(P,D,Z,ne,null);if(typeof Z.then=="function")return F(P,D,mu(Z),ne);if(Z.$$typeof===C)return F(P,D,cu(P,Z),ne);pu(P,Z)}return null}function Y(P,D,Z,ne,Se){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return P=P.get(Z)||null,_(D,P,""+ne,Se);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return P=P.get(ne.key===null?Z:ne.key)||null,R(D,P,ne,Se);case z:return P=P.get(ne.key===null?Z:ne.key)||null,I(D,P,ne,Se);case V:return ne=ui(ne),Y(P,D,Z,ne,Se)}if(ae(ne)||se(ne))return P=P.get(Z)||null,J(D,P,ne,Se,null);if(typeof ne.then=="function")return Y(P,D,Z,mu(ne),Se);if(ne.$$typeof===C)return Y(P,D,Z,cu(D,ne),Se);pu(D,ne)}return null}function pe(P,D,Z,ne){for(var Se=null,He=null,ve=D,Oe=D=0,Ue=null;ve!==null&&Oe<Z.length;Oe++){ve.index>Oe?(Ue=ve,ve=null):Ue=ve.sibling;var Fe=F(P,ve,Z[Oe],ne);if(Fe===null){ve===null&&(ve=Ue);break}r&&ve&&Fe.alternate===null&&i(P,ve),D=y(Fe,D,Oe),He===null?Se=Fe:He.sibling=Fe,He=Fe,ve=Ue}if(Oe===Z.length)return s(P,ve),Ve&&Vr(P,Oe),Se;if(ve===null){for(;Oe<Z.length;Oe++)ve=re(P,Z[Oe],ne),ve!==null&&(D=y(ve,D,Oe),He===null?Se=ve:He.sibling=ve,He=ve);return Ve&&Vr(P,Oe),Se}for(ve=c(ve);Oe<Z.length;Oe++)Ue=Y(ve,P,Oe,Z[Oe],ne),Ue!==null&&(r&&Ue.alternate!==null&&ve.delete(Ue.key===null?Oe:Ue.key),D=y(Ue,D,Oe),He===null?Se=Ue:He.sibling=Ue,He=Ue);return r&&ve.forEach(function(Oa){return i(P,Oa)}),Ve&&Vr(P,Oe),Se}function ze(P,D,Z,ne){if(Z==null)throw Error(a(151));for(var Se=null,He=null,ve=D,Oe=D=0,Ue=null,Fe=Z.next();ve!==null&&!Fe.done;Oe++,Fe=Z.next()){ve.index>Oe?(Ue=ve,ve=null):Ue=ve.sibling;var Oa=F(P,ve,Fe.value,ne);if(Oa===null){ve===null&&(ve=Ue);break}r&&ve&&Oa.alternate===null&&i(P,ve),D=y(Oa,D,Oe),He===null?Se=Oa:He.sibling=Oa,He=Oa,ve=Ue}if(Fe.done)return s(P,ve),Ve&&Vr(P,Oe),Se;if(ve===null){for(;!Fe.done;Oe++,Fe=Z.next())Fe=re(P,Fe.value,ne),Fe!==null&&(D=y(Fe,D,Oe),He===null?Se=Fe:He.sibling=Fe,He=Fe);return Ve&&Vr(P,Oe),Se}for(ve=c(ve);!Fe.done;Oe++,Fe=Z.next())Fe=Y(ve,P,Oe,Fe.value,ne),Fe!==null&&(r&&Fe.alternate!==null&&ve.delete(Fe.key===null?Oe:Fe.key),D=y(Fe,D,Oe),He===null?Se=Fe:He.sibling=Fe,He=Fe);return r&&ve.forEach(function(SC){return i(P,SC)}),Ve&&Vr(P,Oe),Se}function tt(P,D,Z,ne){if(typeof Z=="object"&&Z!==null&&Z.type===T&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:e:{for(var Se=Z.key;D!==null;){if(D.key===Se){if(Se=Z.type,Se===T){if(D.tag===7){s(P,D.sibling),ne=p(D,Z.props.children),ne.return=P,P=ne;break e}}else if(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&ui(Se)===D.type){s(P,D.sibling),ne=p(D,Z.props),ws(ne,Z),ne.return=P,P=ne;break e}s(P,D);break}else i(P,D);D=D.sibling}Z.type===T?(ne=ai(Z.props.children,P.mode,ne,Z.key),ne.return=P,P=ne):(ne=su(Z.type,Z.key,Z.props,null,P.mode,ne),ws(ne,Z),ne.return=P,P=ne)}return k(P);case z:e:{for(Se=Z.key;D!==null;){if(D.key===Se)if(D.tag===4&&D.stateNode.containerInfo===Z.containerInfo&&D.stateNode.implementation===Z.implementation){s(P,D.sibling),ne=p(D,Z.children||[]),ne.return=P,P=ne;break e}else{s(P,D);break}else i(P,D);D=D.sibling}ne=Jd(Z,P.mode,ne),ne.return=P,P=ne}return k(P);case V:return Z=ui(Z),tt(P,D,Z,ne)}if(ae(Z))return pe(P,D,Z,ne);if(se(Z)){if(Se=se(Z),typeof Se!="function")throw Error(a(150));return Z=Se.call(Z),ze(P,D,Z,ne)}if(typeof Z.then=="function")return tt(P,D,mu(Z),ne);if(Z.$$typeof===C)return tt(P,D,cu(P,Z),ne);pu(P,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,D!==null&&D.tag===6?(s(P,D.sibling),ne=p(D,Z),ne.return=P,P=ne):(s(P,D),ne=Kd(Z,P.mode,ne),ne.return=P,P=ne),k(P)):s(P,D)}return function(P,D,Z,ne){try{ks=0;var Se=tt(P,D,Z,ne);return to=null,Se}catch(ve){if(ve===eo||ve===fu)throw ve;var He=Dn(29,ve,null,P.mode);return He.lanes=ne,He.return=P,He}}}var di=xx(!0),bx=xx(!1),pa=!1;function cf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function df(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ga(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ya(r,i,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(qe&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=ou(r),nx(r,null,s),i}return iu(r,c,i,s),ou(r)}function Ss(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,cy(r,s)}}function ff(r,i){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=k:y=y.next=k,s=s.next}while(s!==null);y===null?p=y=i:y=y.next=i}else p=y=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var hf=!1;function zs(){if(hf){var r=Wi;if(r!==null)throw r}}function _s(r,i,s,c){hf=!1;var p=r.updateQueue;pa=!1;var y=p.firstBaseUpdate,k=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var R=_,I=R.next;R.next=null,k===null?y=I:k.next=I,k=R;var J=r.alternate;J!==null&&(J=J.updateQueue,_=J.lastBaseUpdate,_!==k&&(_===null?J.firstBaseUpdate=I:_.next=I,J.lastBaseUpdate=R))}if(y!==null){var re=p.baseState;k=0,J=I=R=null,_=y;do{var F=_.lane&-536870913,Y=F!==_.lane;if(Y?(Pe&F)===F:(c&F)===F){F!==0&&F===Qi&&(hf=!0),J!==null&&(J=J.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var pe=r,ze=_;F=i;var tt=s;switch(ze.tag){case 1:if(pe=ze.payload,typeof pe=="function"){re=pe.call(tt,re,F);break e}re=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ze.payload,F=typeof pe=="function"?pe.call(tt,re,F):pe,F==null)break e;re=x({},re,F);break e;case 2:pa=!0}}F=_.callback,F!==null&&(r.flags|=64,Y&&(r.flags|=8192),Y=p.callbacks,Y===null?p.callbacks=[F]:Y.push(F))}else Y={lane:F,tag:_.tag,payload:_.payload,callback:_.callback,next:null},J===null?(I=J=Y,R=re):J=J.next=Y,k|=F;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,p.lastBaseUpdate=Y,p.shared.pending=null}}while(!0);J===null&&(R=re),p.baseState=R,p.firstBaseUpdate=I,p.lastBaseUpdate=J,y===null&&(p.shared.lanes=0),wa|=k,r.lanes=k,r.memoizedState=re}}function vx(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function kx(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)vx(s[r],i)}var no=S(null),gu=S(0);function wx(r,i){r=Jr,w(gu,r),w(no,i),Jr=r|i.baseLanes}function mf(){w(gu,Jr),w(no,no.current)}function pf(){Jr=gu.current,H(no),H(gu)}var $n=S(null),er=null;function xa(r){var i=r.alternate;w(Ot,Ot.current&1),w($n,r),er===null&&(i===null||no.current!==null||i.memoizedState!==null)&&(er=r)}function gf(r){w(Ot,Ot.current),w($n,r),er===null&&(er=r)}function Sx(r){r.tag===22?(w(Ot,Ot.current),w($n,r),er===null&&(er=r)):ba()}function ba(){w(Ot,Ot.current),w($n,$n.current)}function Ln(r){H($n),er===r&&(er=null),H(Ot)}var Ot=S(0);function yu(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||wh(s)||Sh(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===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ir=0,Ae=null,We=null,Dt=null,xu=!1,ro=!1,fi=!1,bu=0,js=0,ao=null,hT=0;function Ct(){throw Error(a(321))}function yf(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Mn(r[s],i[s]))return!1;return!0}function xf(r,i,s,c,p,y){return Ir=y,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,U.H=r===null||r.memoizedState===null?ob:Rf,fi=!1,y=s(c,p),fi=!1,ro&&(y=_x(i,s,c,p)),zx(r),y}function zx(r){U.H=Es;var i=We!==null&&We.next!==null;if(Ir=0,Dt=We=Ae=null,xu=!1,js=0,ao=null,i)throw Error(a(300));r===null||$t||(r=r.dependencies,r!==null&&uu(r)&&($t=!0))}function _x(r,i,s,c){Ae=r;var p=0;do{if(ro&&(ao=null),js=0,ro=!1,25<=p)throw Error(a(301));if(p+=1,Dt=We=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}U.H=sb,y=i(s,c)}while(ro);return y}function mT(){var r=U.H,i=r.useState()[0];return i=typeof i.then=="function"?Ts(i):i,r=r.useState()[0],(We!==null?We.memoizedState:null)!==r&&(Ae.flags|=1024),i}function bf(){var r=bu!==0;return bu=0,r}function vf(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function kf(r){if(xu){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}xu=!1}Ir=0,Dt=We=Ae=null,ro=!1,js=bu=0,ao=null}function pn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Ae.memoizedState=Dt=r:Dt=Dt.next=r,Dt}function Rt(){if(We===null){var r=Ae.alternate;r=r!==null?r.memoizedState:null}else r=We.next;var i=Dt===null?Ae.memoizedState:Dt.next;if(i!==null)Dt=i,We=r;else{if(r===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));We=r,r={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},Dt===null?Ae.memoizedState=Dt=r:Dt=Dt.next=r}return Dt}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ts(r){var i=js;return js+=1,ao===null&&(ao=[]),r=px(ao,r,i),i=Ae,(Dt===null?i.memoizedState:Dt.next)===null&&(i=i.alternate,U.H=i===null||i.memoizedState===null?ob:Rf),r}function ku(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ts(r);if(r.$$typeof===C)return tn(r)}throw Error(a(438,String(r)))}function wf(r){var i=null,s=Ae.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Ae.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=vu(),Ae.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),c=0;c<r;c++)s[c]=ce;return i.index++,s}function Hr(r,i){return typeof i=="function"?i(r):i}function wu(r){var i=Rt();return Sf(i,We,r)}function Sf(r,i,s){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=r.baseQueue,y=c.pending;if(y!==null){if(p!==null){var k=p.next;p.next=y.next,y.next=k}i.baseQueue=p=y,c.pending=null}if(y=r.baseState,p===null)r.memoizedState=y;else{i=p.next;var _=k=null,R=null,I=i,J=!1;do{var re=I.lane&-536870913;if(re!==I.lane?(Pe&re)===re:(Ir&re)===re){var F=I.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),re===Qi&&(J=!0);else if((Ir&F)===F){I=I.next,F===Qi&&(J=!0);continue}else re={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},R===null?(_=R=re,k=y):R=R.next=re,Ae.lanes|=F,wa|=F;re=I.action,fi&&s(y,re),y=I.hasEagerState?I.eagerState:s(y,re)}else F={lane:re,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},R===null?(_=R=F,k=y):R=R.next=F,Ae.lanes|=re,wa|=re;I=I.next}while(I!==null&&I!==i);if(R===null?k=y:R.next=_,!Mn(y,r.memoizedState)&&($t=!0,J&&(s=Wi,s!==null)))throw s;r.memoizedState=y,r.baseState=k,r.baseQueue=R,c.lastRenderedState=y}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function zf(r){var i=Rt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,y=i.memoizedState;if(p!==null){s.pending=null;var k=p=p.next;do y=r(y,k.action),k=k.next;while(k!==p);Mn(y,i.memoizedState)||($t=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),s.lastRenderedState=y}return[y,c]}function jx(r,i,s){var c=Ae,p=Rt(),y=Ve;if(y){if(s===void 0)throw Error(a(407));s=s()}else s=i();var k=!Mn((We||p).memoizedState,s);if(k&&(p.memoizedState=s,$t=!0),p=p.queue,Tf(Ex.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||Dt!==null&&Dt.memoizedState.tag&1){if(c.flags|=2048,io(9,{destroy:void 0},Cx.bind(null,c,p,s,i),null),it===null)throw Error(a(349));y||(Ir&127)!==0||Tx(c,i,s)}return s}function Tx(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Ae.updateQueue,i===null?(i=vu(),Ae.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Cx(r,i,s,c){i.value=s,i.getSnapshot=c,Nx(i)&&Ax(r)}function Ex(r,i,s){return s(function(){Nx(i)&&Ax(r)})}function Nx(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Mn(r,s)}catch{return!0}}function Ax(r){var i=ri(r,2);i!==null&&Cn(i,r,2)}function _f(r){var i=pn();if(typeof r=="function"){var s=r;if(r=s(),fi){kn(!0);try{s()}finally{kn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:r},i}function Ox(r,i,s,c){return r.baseState=s,Sf(r,We,typeof c=="function"?c:Hr)}function pT(r,i,s,c,p){if(_u(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};U.T!==null?s(!0):y.isTransition=!1,c(y),s=i.pending,s===null?(y.next=i.pending=y,Rx(i,y)):(y.next=s.next,i.pending=s.next=y)}}function Rx(r,i){var s=i.action,c=i.payload,p=r.state;if(i.isTransition){var y=U.T,k={};U.T=k;try{var _=s(p,c),R=U.S;R!==null&&R(k,_),Mx(r,i,_)}catch(I){jf(r,i,I)}finally{y!==null&&k.types!==null&&(y.types=k.types),U.T=y}}else try{y=s(p,c),Mx(r,i,y)}catch(I){jf(r,i,I)}}function Mx(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Dx(r,i,c)},function(c){return jf(r,i,c)}):Dx(r,i,s)}function Dx(r,i,s){i.status="fulfilled",i.value=s,$x(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Rx(r,s)))}function jf(r,i,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,$x(i),i=i.next;while(i!==c)}r.action=null}function $x(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Lx(r,i){return i}function Px(r,i){if(Ve){var s=it.formState;if(s!==null){e:{var c=Ae;if(Ve){if(ht){t:{for(var p=ht,y=Wn;p.nodeType!==8;){if(!y){p=null;break t}if(p=tr(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){ht=tr(p.nextSibling),c=p.data==="F!";break e}}ha(c)}c=!1}c&&(i=s[0])}}return s=pn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lx,lastRenderedState:i},s.queue=c,s=rb.bind(null,Ae,c),c.dispatch=s,c=_f(!1),y=Of.bind(null,Ae,!1,c.queue),c=pn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,s=pT.bind(null,Ae,p,y,s),p.dispatch=s,c.memoizedState=r,[i,s,!1]}function Ux(r){var i=Rt();return Vx(i,We,r)}function Vx(r,i,s){if(i=Sf(r,i,Lx)[0],r=wu(Hr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Ts(i)}catch(k){throw k===eo?fu:k}else c=i;i=Rt();var p=i.queue,y=p.dispatch;return s!==i.memoizedState&&(Ae.flags|=2048,io(9,{destroy:void 0},gT.bind(null,p,s),null)),[c,y,r]}function gT(r,i){r.action=i}function Bx(r){var i=Rt(),s=We;if(s!==null)return Vx(i,s,r);Rt(),i=i.memoizedState,s=Rt();var c=s.queue.dispatch;return s.memoizedState=r,[i,c,!1]}function io(r,i,s,c){return r={tag:r,create:s,deps:c,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=vu(),Ae.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,i.lastEffect=r),r}function Zx(){return Rt().memoizedState}function Su(r,i,s,c){var p=pn();Ae.flags|=r,p.memoizedState=io(1|i,{destroy:void 0},s,c===void 0?null:c)}function zu(r,i,s,c){var p=Rt();c=c===void 0?null:c;var y=p.memoizedState.inst;We!==null&&c!==null&&yf(c,We.memoizedState.deps)?p.memoizedState=io(i,y,s,c):(Ae.flags|=r,p.memoizedState=io(1|i,y,s,c))}function Ix(r,i){Su(8390656,8,r,i)}function Tf(r,i){zu(2048,8,r,i)}function yT(r){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=vu(),Ae.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Hx(r){var i=Rt().memoizedState;return yT({ref:i,nextImpl:r}),function(){if((qe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Fx(r,i){return zu(4,2,r,i)}function qx(r,i){return zu(4,4,r,i)}function Gx(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Yx(r,i,s){s=s!=null?s.concat([r]):null,zu(4,4,Gx.bind(null,i,r),s)}function Cf(){}function Xx(r,i){var s=Rt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&yf(i,c[1])?c[0]:(s.memoizedState=[r,i],r)}function Kx(r,i){var s=Rt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&yf(i,c[1]))return c[0];if(c=r(),fi){kn(!0);try{r()}finally{kn(!1)}}return s.memoizedState=[c,i],c}function Ef(r,i,s){return s===void 0||(Ir&1073741824)!==0&&(Pe&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Jb(),Ae.lanes|=r,wa|=r,s)}function Jx(r,i,s,c){return Mn(s,i)?s:no.current!==null?(r=Ef(r,s,c),Mn(r,i)||($t=!0),r):(Ir&42)===0||(Ir&1073741824)!==0&&(Pe&261930)===0?($t=!0,r.memoizedState=s):(r=Jb(),Ae.lanes|=r,wa|=r,i)}function Qx(r,i,s,c,p){var y=K.p;K.p=y!==0&&8>y?y:8;var k=U.T,_={};U.T=_,Of(r,!1,i,s);try{var R=p(),I=U.S;if(I!==null&&I(_,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var J=fT(R,c);Cs(r,i,J,Vn(r))}else Cs(r,i,c,Vn(r))}catch(re){Cs(r,i,{then:function(){},status:"rejected",reason:re},Vn())}finally{K.p=y,k!==null&&_.types!==null&&(k.types=_.types),U.T=k}}function xT(){}function Nf(r,i,s,c){if(r.tag!==5)throw Error(a(476));var p=Wx(r).queue;Qx(r,p,i,B,s===null?xT:function(){return eb(r),s(c)})}function Wx(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:B},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function eb(r){var i=Wx(r);i.next===null&&(i=r.alternate.memoizedState),Cs(r,i.next.queue,{},Vn())}function Af(){return tn(Fs)}function tb(){return Rt().memoizedState}function nb(){return Rt().memoizedState}function bT(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Vn();r=ga(s);var c=ya(i,r,s);c!==null&&(Cn(c,i,s),Ss(c,i,s)),i={cache:of()},r.payload=i;return}i=i.return}}function vT(r,i,s){var c=Vn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},_u(r)?ab(i,s):(s=Yd(r,i,s,c),s!==null&&(Cn(s,r,c),ib(s,i,c)))}function rb(r,i,s){var c=Vn();Cs(r,i,s,c)}function Cs(r,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(_u(r))ab(i,p);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var k=i.lastRenderedState,_=y(k,s);if(p.hasEagerState=!0,p.eagerState=_,Mn(_,k))return iu(r,i,p,0),it===null&&au(),!1}catch{}if(s=Yd(r,i,p,c),s!==null)return Cn(s,r,c),ib(s,i,c),!0}return!1}function Of(r,i,s,c){if(c={lane:2,revertLane:ch(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},_u(r)){if(i)throw Error(a(479))}else i=Yd(r,s,c,2),i!==null&&Cn(i,r,2)}function _u(r){var i=r.alternate;return r===Ae||i!==null&&i===Ae}function ab(r,i){ro=xu=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function ib(r,i,s){if((s&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,cy(r,s)}}var Es={readContext:tn,use:ku,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Es.useEffectEvent=Ct;var ob={readContext:tn,use:ku,useCallback:function(r,i){return pn().memoizedState=[r,i===void 0?null:i],r},useContext:tn,useEffect:Ix,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Su(4194308,4,Gx.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Su(4194308,4,r,i)},useInsertionEffect:function(r,i){Su(4,2,r,i)},useMemo:function(r,i){var s=pn();i=i===void 0?null:i;var c=r();if(fi){kn(!0);try{r()}finally{kn(!1)}}return s.memoizedState=[c,i],c},useReducer:function(r,i,s){var c=pn();if(s!==void 0){var p=s(i);if(fi){kn(!0);try{s(i)}finally{kn(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=vT.bind(null,Ae,r),[c.memoizedState,r]},useRef:function(r){var i=pn();return r={current:r},i.memoizedState=r},useState:function(r){r=_f(r);var i=r.queue,s=rb.bind(null,Ae,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Cf,useDeferredValue:function(r,i){var s=pn();return Ef(s,r,i)},useTransition:function(){var r=_f(!1);return r=Qx.bind(null,Ae,r.queue,!0,!1),pn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var c=Ae,p=pn();if(Ve){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),it===null)throw Error(a(349));(Pe&127)!==0||Tx(c,i,s)}p.memoizedState=s;var y={value:s,getSnapshot:i};return p.queue=y,Ix(Ex.bind(null,c,y,r),[r]),c.flags|=2048,io(9,{destroy:void 0},Cx.bind(null,c,y,s,i),null),s},useId:function(){var r=pn(),i=it.identifierPrefix;if(Ve){var s=br,c=xr;s=(c&~(1<<32-at(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=bu++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=hT++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Af,useFormState:Px,useActionState:Px,useOptimistic:function(r){var i=pn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Of.bind(null,Ae,!0,s),s.dispatch=i,[r,i]},useMemoCache:wf,useCacheRefresh:function(){return pn().memoizedState=bT.bind(null,Ae)},useEffectEvent:function(r){var i=pn(),s={impl:r};return i.memoizedState=s,function(){if((qe&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Rf={readContext:tn,use:ku,useCallback:Xx,useContext:tn,useEffect:Tf,useImperativeHandle:Yx,useInsertionEffect:Fx,useLayoutEffect:qx,useMemo:Kx,useReducer:wu,useRef:Zx,useState:function(){return wu(Hr)},useDebugValue:Cf,useDeferredValue:function(r,i){var s=Rt();return Jx(s,We.memoizedState,r,i)},useTransition:function(){var r=wu(Hr)[0],i=Rt().memoizedState;return[typeof r=="boolean"?r:Ts(r),i]},useSyncExternalStore:jx,useId:tb,useHostTransitionStatus:Af,useFormState:Ux,useActionState:Ux,useOptimistic:function(r,i){var s=Rt();return Ox(s,We,r,i)},useMemoCache:wf,useCacheRefresh:nb};Rf.useEffectEvent=Hx;var sb={readContext:tn,use:ku,useCallback:Xx,useContext:tn,useEffect:Tf,useImperativeHandle:Yx,useInsertionEffect:Fx,useLayoutEffect:qx,useMemo:Kx,useReducer:zf,useRef:Zx,useState:function(){return zf(Hr)},useDebugValue:Cf,useDeferredValue:function(r,i){var s=Rt();return We===null?Ef(s,r,i):Jx(s,We.memoizedState,r,i)},useTransition:function(){var r=zf(Hr)[0],i=Rt().memoizedState;return[typeof r=="boolean"?r:Ts(r),i]},useSyncExternalStore:jx,useId:tb,useHostTransitionStatus:Af,useFormState:Bx,useActionState:Bx,useOptimistic:function(r,i){var s=Rt();return We!==null?Ox(s,We,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:wf,useCacheRefresh:nb};sb.useEffectEvent=Hx;function Mf(r,i,s,c){i=r.memoizedState,s=s(c,i),s=s==null?i:x({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Df={enqueueSetState:function(r,i,s){r=r._reactInternals;var c=Vn(),p=ga(c);p.payload=i,s!=null&&(p.callback=s),i=ya(r,p,c),i!==null&&(Cn(i,r,c),Ss(i,r,c))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var c=Vn(),p=ga(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=ya(r,p,c),i!==null&&(Cn(i,r,c),Ss(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=Vn(),c=ga(s);c.tag=2,i!=null&&(c.callback=i),i=ya(r,c,s),i!==null&&(Cn(i,r,s),Ss(i,r,s))}};function lb(r,i,s,c,p,y,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,y,k):i.prototype&&i.prototype.isPureReactComponent?!ps(s,c)||!ps(p,y):!0}function ub(r,i,s,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==r&&Df.enqueueReplaceState(i,i.state,null)}function hi(r,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}if(r=r.defaultProps){s===i&&(s=x({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function cb(r){ru(r)}function db(r){console.error(r)}function fb(r){ru(r)}function ju(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function hb(r,i,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function $f(r,i,s){return s=ga(s),s.tag=3,s.payload={element:null},s.callback=function(){ju(r,i)},s}function mb(r){return r=ga(r),r.tag=3,r}function pb(r,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;r.payload=function(){return p(y)},r.callback=function(){hb(i,s,c)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){hb(i,s,c),typeof p!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function kT(r,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Ji(i,s,p,!0),s=$n.current,s!==null){switch(s.tag){case 31:case 13:return er===null?Pu():s.alternate===null&&Et===0&&(Et=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===hu?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),sh(r,c,p)),!1;case 22:return s.flags|=65536,c===hu?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)),sh(r,c,p)),!1}throw Error(a(435,s.tag))}return sh(r,c,p),Pu(),!1}if(Ve)return i=$n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==ef&&(r=Error(a(422),{cause:c}),xs(Kn(r,s)))):(c!==ef&&(i=Error(a(423),{cause:c}),xs(Kn(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=Kn(c,s),p=$f(r.stateNode,c,p),ff(r,p),Et!==4&&(Et=2)),!1;var y=Error(a(520),{cause:c});if(y=Kn(y,s),Ls===null?Ls=[y]:Ls.push(y),Et!==4&&(Et=2),i===null)return!0;c=Kn(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=$f(s.stateNode,c,r),ff(s,r),!1;case 1:if(i=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Sa===null||!Sa.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=mb(p),pb(p,r,s,c),ff(s,p),!1}s=s.return}while(s!==null);return!1}var Lf=Error(a(461)),$t=!1;function nn(r,i,s,c){i.child=r===null?bx(i,null,s,c):di(i,r.child,s,c)}function gb(r,i,s,c,p){s=s.render;var y=i.ref;if("ref"in c){var k={};for(var _ in c)_!=="ref"&&(k[_]=c[_])}else k=c;return si(i),c=xf(r,i,s,k,y,p),_=bf(),r!==null&&!$t?(vf(r,i,p),Fr(r,i,p)):(Ve&&_&&Qd(i),i.flags|=1,nn(r,i,c,p),i.child)}function yb(r,i,s,c,p){if(r===null){var y=s.type;return typeof y=="function"&&!Xd(y)&&y.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=y,xb(r,i,y,c,p)):(r=su(s.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Ff(r,p)){var k=y.memoizedProps;if(s=s.compare,s=s!==null?s:ps,s(k,c)&&r.ref===i.ref)return Fr(r,i,p)}return i.flags|=1,r=Ur(y,c),r.ref=i.ref,r.return=i,i.child=r}function xb(r,i,s,c,p){if(r!==null){var y=r.memoizedProps;if(ps(y,c)&&r.ref===i.ref)if($t=!1,i.pendingProps=c=y,Ff(r,p))(r.flags&131072)!==0&&($t=!0);else return i.lanes=r.lanes,Fr(r,i,p)}return Pf(r,i,s,c,p)}function bb(r,i,s,c){var p=c.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|s:s,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,i.child=null;return vb(r,i,y,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&du(i,y!==null?y.cachePool:null),y!==null?wx(i,y):mf(),Sx(i);else return c=i.lanes=536870912,vb(r,i,y!==null?y.baseLanes|s:s,s,c)}else y!==null?(du(i,y.cachePool),wx(i,y),ba(),i.memoizedState=null):(r!==null&&du(i,null),mf(),ba());return nn(r,i,p,s),i.child}function Ns(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function vb(r,i,s,c,p){var y=lf();return y=y===null?null:{parent:Mt._currentValue,pool:y},i.memoizedState={baseLanes:s,cachePool:y},r!==null&&du(i,null),mf(),Sx(i),r!==null&&Ji(r,i,c,!0),i.childLanes=p,null}function Tu(r,i){return i=Eu({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function kb(r,i,s){return di(i,r.child,null,s),r=Tu(i,i.pendingProps),r.flags|=2,Ln(i),i.memoizedState=null,r}function wT(r,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ve){if(c.mode==="hidden")return r=Tu(i,c),i.lanes=536870912,Ns(null,r);if(gf(i),(r=ht)?(r=Rv(r,Wn),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:da!==null?{id:xr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},s=ax(r),s.return=i,i.child=s,en=i,ht=null)):r=null,r===null)throw ha(i);return i.lanes=536870912,null}return Tu(i,c)}var y=r.memoizedState;if(y!==null){var k=y.dehydrated;if(gf(i),p)if(i.flags&256)i.flags&=-257,i=kb(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if($t||Ji(r,i,s,!1),p=(s&r.childLanes)!==0,$t||p){if(c=it,c!==null&&(k=dy(c,s),k!==0&&k!==y.retryLane))throw y.retryLane=k,ri(r,k),Cn(c,r,k),Lf;Pu(),i=kb(r,i,s)}else r=y.treeContext,ht=tr(k.nextSibling),en=i,Ve=!0,fa=null,Wn=!1,r!==null&&sx(i,r),i=Tu(i,c),i.flags|=4096;return i}return r=Ur(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Cu(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Pf(r,i,s,c,p){return si(i),s=xf(r,i,s,c,void 0,p),c=bf(),r!==null&&!$t?(vf(r,i,p),Fr(r,i,p)):(Ve&&c&&Qd(i),i.flags|=1,nn(r,i,s,p),i.child)}function wb(r,i,s,c,p,y){return si(i),i.updateQueue=null,s=_x(i,c,s,p),zx(r),c=bf(),r!==null&&!$t?(vf(r,i,y),Fr(r,i,y)):(Ve&&c&&Qd(i),i.flags|=1,nn(r,i,s,y),i.child)}function Sb(r,i,s,c,p){if(si(i),i.stateNode===null){var y=Gi,k=s.contextType;typeof k=="object"&&k!==null&&(y=tn(k)),y=new s(c,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Df,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=c,y.state=i.memoizedState,y.refs={},cf(i),k=s.contextType,y.context=typeof k=="object"&&k!==null?tn(k):Gi,y.state=i.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(Mf(i,s,k,c),y.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&Df.enqueueReplaceState(y,y.state,null),_s(i,c,y,p),zs(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){y=i.stateNode;var _=i.memoizedProps,R=hi(s,_);y.props=R;var I=y.context,J=s.contextType;k=Gi,typeof J=="object"&&J!==null&&(k=tn(J));var re=s.getDerivedStateFromProps;J=typeof re=="function"||typeof y.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,J||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(_||I!==k)&&ub(i,y,c,k),pa=!1;var F=i.memoizedState;y.state=F,_s(i,c,y,p),zs(),I=i.memoizedState,_||F!==I||pa?(typeof re=="function"&&(Mf(i,s,re,c),I=i.memoizedState),(R=pa||lb(i,s,R,c,F,I,k))?(J||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=I),y.props=c,y.state=I,y.context=k,c=R):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{y=i.stateNode,df(r,i),k=i.memoizedProps,J=hi(s,k),y.props=J,re=i.pendingProps,F=y.context,I=s.contextType,R=Gi,typeof I=="object"&&I!==null&&(R=tn(I)),_=s.getDerivedStateFromProps,(I=typeof _=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==re||F!==R)&&ub(i,y,c,R),pa=!1,F=i.memoizedState,y.state=F,_s(i,c,y,p),zs();var Y=i.memoizedState;k!==re||F!==Y||pa||r!==null&&r.dependencies!==null&&uu(r.dependencies)?(typeof _=="function"&&(Mf(i,s,_,c),Y=i.memoizedState),(J=pa||lb(i,s,J,c,F,Y,R)||r!==null&&r.dependencies!==null&&uu(r.dependencies))?(I||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,Y,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,Y,R)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=Y),y.props=c,y.state=Y,y.context=R,c=J):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=1024),c=!1)}return y=c,Cu(r,i),c=(i.flags&128)!==0,y||c?(y=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&c?(i.child=di(i,r.child,null,p),i.child=di(i,null,s,p)):nn(r,i,s,p),i.memoizedState=y.state,r=i.child):r=Fr(r,i,p),r}function zb(r,i,s,c){return ii(),i.flags|=256,nn(r,i,s,c),i.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vf(r){return{baseLanes:r,cachePool:hx()}}function Bf(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Un),r}function _b(r,i,s){var c=i.pendingProps,p=!1,y=(i.flags&128)!==0,k;if((k=y)||(k=r!==null&&r.memoizedState===null?!1:(Ot.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ve){if(p?xa(i):ba(),(r=ht)?(r=Rv(r,Wn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:da!==null?{id:xr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},s=ax(r),s.return=i,i.child=s,en=i,ht=null)):r=null,r===null)throw ha(i);return Sh(r)?i.lanes=32:i.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(ba(),p=i.mode,_=Eu({mode:"hidden",children:_},p),c=ai(c,p,s,null),_.return=i,c.return=i,_.sibling=c,i.child=_,c=i.child,c.memoizedState=Vf(s),c.childLanes=Bf(r,k,s),i.memoizedState=Uf,Ns(null,c)):(xa(i),Zf(i,_))}var R=r.memoizedState;if(R!==null&&(_=R.dehydrated,_!==null)){if(y)i.flags&256?(xa(i),i.flags&=-257,i=If(r,i,s)):i.memoizedState!==null?(ba(),i.child=r.child,i.flags|=128,i=null):(ba(),_=c.fallback,p=i.mode,c=Eu({mode:"visible",children:c.children},p),_=ai(_,p,s,null),_.flags|=2,c.return=i,_.return=i,c.sibling=_,i.child=c,di(i,r.child,null,s),c=i.child,c.memoizedState=Vf(s),c.childLanes=Bf(r,k,s),i.memoizedState=Uf,i=Ns(null,c));else if(xa(i),Sh(_)){if(k=_.nextSibling&&_.nextSibling.dataset,k)var I=k.dgst;k=I,c=Error(a(419)),c.stack="",c.digest=k,xs({value:c,source:null,stack:null}),i=If(r,i,s)}else if($t||Ji(r,i,s,!1),k=(s&r.childLanes)!==0,$t||k){if(k=it,k!==null&&(c=dy(k,s),c!==0&&c!==R.retryLane))throw R.retryLane=c,ri(r,c),Cn(k,r,c),Lf;wh(_)||Pu(),i=If(r,i,s)}else wh(_)?(i.flags|=192,i.child=r.child,i=null):(r=R.treeContext,ht=tr(_.nextSibling),en=i,Ve=!0,fa=null,Wn=!1,r!==null&&sx(i,r),i=Zf(i,c.children),i.flags|=4096);return i}return p?(ba(),_=c.fallback,p=i.mode,R=r.child,I=R.sibling,c=Ur(R,{mode:"hidden",children:c.children}),c.subtreeFlags=R.subtreeFlags&65011712,I!==null?_=Ur(I,_):(_=ai(_,p,s,null),_.flags|=2),_.return=i,c.return=i,c.sibling=_,i.child=c,Ns(null,c),c=i.child,_=r.child.memoizedState,_===null?_=Vf(s):(p=_.cachePool,p!==null?(R=Mt._currentValue,p=p.parent!==R?{parent:R,pool:R}:p):p=hx(),_={baseLanes:_.baseLanes|s,cachePool:p}),c.memoizedState=_,c.childLanes=Bf(r,k,s),i.memoizedState=Uf,Ns(r.child,c)):(xa(i),s=r.child,r=s.sibling,s=Ur(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=s,i.memoizedState=null,s)}function Zf(r,i){return i=Eu({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Eu(r,i){return r=Dn(22,r,null,i),r.lanes=0,r}function If(r,i,s){return di(i,r.child,null,s),r=Zf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function jb(r,i,s){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),rf(r.return,i,s)}function Hf(r,i,s,c,p,y){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:y}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=s,k.tailMode=p,k.treeForkCount=y)}function Tb(r,i,s){var c=i.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var k=Ot.current,_=(k&2)!==0;if(_?(k=k&1|2,i.flags|=128):k&=1,w(Ot,k),nn(r,i,c,s),c=Ve?ys:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&jb(r,s,i);else if(r.tag===19)jb(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&yu(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Hf(i,!1,p,s,y,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&yu(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Hf(i,!0,s,null,y,c);break;case"together":Hf(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Fr(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),wa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ji(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=Ur(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=Ur(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Ff(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&uu(r)))}function ST(r,i,s){switch(i.tag){case 3:De(i,i.stateNode.containerInfo),ma(i,Mt,r.memoizedState.cache),ii();break;case 27:case 5:kt(i);break;case 4:De(i,i.stateNode.containerInfo);break;case 10:ma(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,gf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(xa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?_b(r,i,s):(xa(i),r=Fr(r,i,s),r!==null?r.sibling:null);xa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Ji(r,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return Tb(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w(Ot,Ot.current),c)break;return null;case 22:return i.lanes=0,bb(r,i,s,i.pendingProps);case 24:ma(i,Mt,r.memoizedState.cache)}return Fr(r,i,s)}function Cb(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)$t=!0;else{if(!Ff(r,s)&&(i.flags&128)===0)return $t=!1,ST(r,i,s);$t=(r.flags&131072)!==0}else $t=!1,Ve&&(i.flags&1048576)!==0&&ox(i,ys,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=ui(i.elementType),i.type=r,typeof r=="function")Xd(r)?(c=hi(r,c),i.tag=1,i=Sb(null,i,r,c,s)):(i.tag=0,i=Pf(null,i,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===$){i.tag=11,i=gb(null,i,r,c,s);break e}else if(p===q){i.tag=14,i=yb(null,i,r,c,s);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return Pf(r,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=hi(c,i.pendingProps),Sb(r,i,c,p,s);case 3:e:{if(De(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var y=i.memoizedState;p=y.element,df(r,i),_s(i,c,null,s);var k=i.memoizedState;if(c=k.cache,ma(i,Mt,c),c!==y.cache&&af(i,[Mt],s,!0),zs(),c=k.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=zb(r,i,c,s);break e}else if(c!==p){p=Kn(Error(a(424)),i),xs(p),i=zb(r,i,c,s);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,ht=tr(r.firstChild),en=i,Ve=!0,fa=null,Wn=!0,s=bx(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ii(),c===p){i=Fr(r,i,s);break e}nn(r,i,c,s)}i=i.child}return i;case 26:return Cu(r,i),r===null?(s=Uv(i.type,null,i.pendingProps,null))?i.memoizedState=s:Ve||(s=i.type,r=i.pendingProps,c=Fu(fe.current).createElement(s),c[Wt]=i,c[wn]=r,rn(c,s,r),Kt(c),i.stateNode=c):i.memoizedState=Uv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return kt(i),r===null&&Ve&&(c=i.stateNode=$v(i.type,i.pendingProps,fe.current),en=i,Wn=!0,p=ht,Ta(i.type)?(zh=p,ht=tr(c.firstChild)):ht=p),nn(r,i,i.pendingProps.children,s),Cu(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ve&&((p=c=ht)&&(c=WT(c,i.type,i.pendingProps,Wn),c!==null?(i.stateNode=c,en=i,ht=tr(c.firstChild),Wn=!1,p=!0):p=!1),p||ha(i)),kt(i),p=i.type,y=i.pendingProps,k=r!==null?r.memoizedProps:null,c=y.children,bh(p,y)?c=null:k!==null&&bh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=xf(r,i,mT,null,null,s),Fs._currentValue=p),Cu(r,i),nn(r,i,c,s),i.child;case 6:return r===null&&Ve&&((r=s=ht)&&(s=eC(s,i.pendingProps,Wn),s!==null?(i.stateNode=s,en=i,ht=null,r=!0):r=!1),r||ha(i)),null;case 13:return _b(r,i,s);case 4:return De(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=di(i,null,c,s):nn(r,i,c,s),i.child;case 11:return gb(r,i,i.type,i.pendingProps,s);case 7:return nn(r,i,i.pendingProps,s),i.child;case 8:return nn(r,i,i.pendingProps.children,s),i.child;case 12:return nn(r,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,ma(i,i.type,c.value),nn(r,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,si(i),p=tn(p),c=c(p),i.flags|=1,nn(r,i,c,s),i.child;case 14:return yb(r,i,i.type,i.pendingProps,s);case 15:return xb(r,i,i.type,i.pendingProps,s);case 19:return Tb(r,i,s);case 31:return wT(r,i,s);case 22:return bb(r,i,s,i.pendingProps);case 24:return si(i),c=tn(Mt),r===null?(p=lf(),p===null&&(p=it,y=of(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),i.memoizedState={parent:c,cache:p},cf(i),ma(i,Mt,p)):((r.lanes&s)!==0&&(df(r,i),_s(i,null,null,s),zs()),p=r.memoizedState,y=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),ma(i,Mt,c)):(c=y.cache,ma(i,Mt,c),c!==p.cache&&af(i,[Mt],s,!0))),nn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function qr(r){r.flags|=4}function qf(r,i,s,c,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(tv())r.flags|=8192;else throw ci=hu,uf}else r.flags&=-16777217}function Eb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Hv(i))if(tv())r.flags|=8192;else throw ci=hu,uf}function Nu(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ly():536870912,r.lanes|=i,uo|=i)}function As(r,i){if(!Ve)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function mt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,i}function zT(r,i,s){var c=i.pendingProps;switch(Wd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return s=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Zr(Mt),Ne(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Ki(i)?qr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,tf())),mt(i),null;case 26:var p=i.type,y=i.memoizedState;return r===null?(qr(i),y!==null?(mt(i),Eb(i,y)):(mt(i),qf(i,p,null,c,s))):y?y!==r.memoizedState?(qr(i),mt(i),Eb(i,y)):(mt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&qr(i),mt(i),qf(i,p,r,c,s)),null;case 27:if(It(i),s=fe.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&qr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return mt(i),null}r=G.current,Ki(i)?lx(i):(r=$v(p,c,s),i.stateNode=r,qr(i))}return mt(i),null;case 5:if(It(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&qr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(y=G.current,Ki(i))lx(i);else{var k=Fu(fe.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?k.createElement(p,{is:c.is}):k.createElement(p)}}y[Wt]=i,y[wn]=c;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===i)break e;for(;k.sibling===null;){if(k.return===null||k.return===i)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}i.stateNode=y;e:switch(rn(y,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&&qr(i)}}return mt(i),qf(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&qr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=fe.current,Ki(i)){if(r=i.stateNode,s=i.memoizedProps,c=null,p=en,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[Wt]=i,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||_v(r.nodeValue,s)),r||ha(i,!0)}else r=Fu(r).createTextNode(c),r[Wt]=i,i.stateNode=r}return mt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(c=Ki(i),s!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Wt]=i}else ii(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),r=!1}else s=tf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Ln(i),i):(Ln(i),null);if((i.flags&128)!==0)throw Error(a(558))}return mt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ki(i),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Wt]=i}else ii(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),p=!1}else p=tf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Ln(i),i):(Ln(i),null)}return Ln(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,r=r!==null&&r.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),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Nu(i,i.updateQueue),mt(i),null);case 4:return Ne(),r===null&&mh(i.stateNode.containerInfo),mt(i),null;case 10:return Zr(i.type),mt(i),null;case 19:if(H(Ot),c=i.memoizedState,c===null)return mt(i),null;if(p=(i.flags&128)!==0,y=c.rendering,y===null)if(p)As(c,!1);else{if(Et!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=yu(r),y!==null){for(i.flags|=128,As(c,!1),r=y.updateQueue,i.updateQueue=r,Nu(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)rx(s,r),s=s.sibling;return w(Ot,Ot.current&1|2),Ve&&Vr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&ft()>Du&&(i.flags|=128,p=!0,As(c,!1),i.lanes=4194304)}else{if(!p)if(r=yu(y),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Nu(i,r),As(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!Ve)return mt(i),null}else 2*ft()-c.renderingStartTime>Du&&s!==536870912&&(i.flags|=128,p=!0,As(c,!1),i.lanes=4194304);c.isBackwards?(y.sibling=i.child,i.child=y):(r=c.last,r!==null?r.sibling=y:i.child=y,c.last=y)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=ft(),r.sibling=null,s=Ot.current,w(Ot,p?s&1|2:s&1),Ve&&Vr(i,c.treeForkCount),r):(mt(i),null);case 22:case 23:return Ln(i),pf(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),s=i.updateQueue,s!==null&&Nu(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),r!==null&&H(li),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Zr(Mt),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function _T(r,i){switch(Wd(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Zr(Mt),Ne(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return It(i),null;case 31:if(i.memoizedState!==null){if(Ln(i),i.alternate===null)throw Error(a(340));ii()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Ln(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ii()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return H(Ot),null;case 4:return Ne(),null;case 10:return Zr(i.type),null;case 22:case 23:return Ln(i),pf(),r!==null&&H(li),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Zr(Mt),null;case 25:return null;default:return null}}function Nb(r,i){switch(Wd(i),i.tag){case 3:Zr(Mt),Ne();break;case 26:case 27:case 5:It(i);break;case 4:Ne();break;case 31:i.memoizedState!==null&&Ln(i);break;case 13:Ln(i);break;case 19:H(Ot);break;case 10:Zr(i.type);break;case 22:case 23:Ln(i),pf(),r!==null&&H(li);break;case 24:Zr(Mt)}}function Os(r,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&r)===r){c=void 0;var y=s.create,k=s.inst;c=y(),k.destroy=c}s=s.next}while(s!==p)}}catch(_){Ke(i,i.return,_)}}function va(r,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&r)===r){var k=c.inst,_=k.destroy;if(_!==void 0){k.destroy=void 0,p=i;var R=s,I=_;try{I()}catch(J){Ke(p,R,J)}}}c=c.next}while(c!==y)}}catch(J){Ke(i,i.return,J)}}function Ab(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{kx(i,s)}catch(c){Ke(r,r.return,c)}}}function Ob(r,i,s){s.props=hi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){Ke(r,i,c)}}function Rs(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){Ke(r,i,p)}}function vr(r,i){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){Ke(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){Ke(r,i,p)}else s.current=null}function Rb(r){var i=r.type,s=r.memoizedProps,c=r.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){Ke(r,r.return,p)}}function Gf(r,i,s){try{var c=r.stateNode;GT(c,r.type,s,i),c[wn]=i}catch(p){Ke(r,r.return,p)}}function Mb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ta(r.type)||r.tag===4}function Yf(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Mb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ta(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Xf(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Lr));else if(c!==4&&(c===27&&Ta(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Xf(r,i,s),r=r.sibling;r!==null;)Xf(r,i,s),r=r.sibling}function Au(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(c!==4&&(c===27&&Ta(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Au(r,i,s),r=r.sibling;r!==null;)Au(r,i,s),r=r.sibling}function Db(r){var i=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);rn(i,c,s),i[Wt]=r,i[wn]=s}catch(y){Ke(r,r.return,y)}}var Gr=!1,Lt=!1,Kf=!1,$b=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function jT(r,i){if(r=r.containerInfo,yh=Qu,r=Yy(r),Zd(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var k=0,_=-1,R=-1,I=0,J=0,re=r,F=null;t:for(;;){for(var Y;re!==s||p!==0&&re.nodeType!==3||(_=k+p),re!==y||c!==0&&re.nodeType!==3||(R=k+c),re.nodeType===3&&(k+=re.nodeValue.length),(Y=re.firstChild)!==null;)F=re,re=Y;for(;;){if(re===r)break t;if(F===s&&++I===p&&(_=k),F===y&&++J===c&&(R=k),(Y=re.nextSibling)!==null)break;re=F,F=re.parentNode}re=Y}s=_===-1||R===-1?null:{start:_,end:R}}else s=null}s=s||{start:0,end:0}}else s=null;for(xh={focusedElem:r,selectionRange:s},Qu=!1,Jt=i;Jt!==null;)if(i=Jt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Jt=r;else for(;Jt!==null;){switch(i=Jt,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,s=i,p=y.memoizedProps,y=y.memoizedState,c=s.stateNode;try{var pe=hi(s.type,p);r=c.getSnapshotBeforeUpdate(pe,y),c.__reactInternalSnapshotBeforeUpdate=r}catch(ze){Ke(s,s.return,ze)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)kh(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":kh(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Jt=r;break}Jt=i.return}}function Lb(r,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Xr(r,s),c&4&&Os(5,s);break;case 1:if(Xr(r,s),c&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(k){Ke(s,s.return,k)}else{var p=hi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){Ke(s,s.return,k)}}c&64&&Ab(s),c&512&&Rs(s,s.return);break;case 3:if(Xr(r,s),c&64&&(r=s.updateQueue,r!==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{kx(r,i)}catch(k){Ke(s,s.return,k)}}break;case 27:i===null&&c&4&&Db(s);case 26:case 5:Xr(r,s),i===null&&c&4&&Rb(s),c&512&&Rs(s,s.return);break;case 12:Xr(r,s);break;case 31:Xr(r,s),c&4&&Vb(r,s);break;case 13:Xr(r,s),c&4&&Bb(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=DT.bind(null,s),tC(r,s))));break;case 22:if(c=s.memoizedState!==null||Gr,!c){i=i!==null&&i.memoizedState!==null||Lt,p=Gr;var y=Lt;Gr=c,(Lt=i)&&!y?Kr(r,s,(s.subtreeFlags&8772)!==0):Xr(r,s),Gr=p,Lt=y}break;case 30:break;default:Xr(r,s)}}function Pb(r){var i=r.alternate;i!==null&&(r.alternate=null,Pb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&_d(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var gt=null,zn=!1;function Yr(r,i,s){for(s=s.child;s!==null;)Ub(r,i,s),s=s.sibling}function Ub(r,i,s){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(mn,s)}catch{}switch(s.tag){case 26:Lt||vr(s,i),Yr(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Lt||vr(s,i);var c=gt,p=zn;Ta(s.type)&&(gt=s.stateNode,zn=!1),Yr(r,i,s),Zs(s.stateNode),gt=c,zn=p;break;case 5:Lt||vr(s,i);case 6:if(c=gt,p=zn,gt=null,Yr(r,i,s),gt=c,zn=p,gt!==null)if(zn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(s.stateNode)}catch(y){Ke(s,i,y)}else try{gt.removeChild(s.stateNode)}catch(y){Ke(s,i,y)}break;case 18:gt!==null&&(zn?(r=gt,Av(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),xo(r)):Av(gt,s.stateNode));break;case 4:c=gt,p=zn,gt=s.stateNode.containerInfo,zn=!0,Yr(r,i,s),gt=c,zn=p;break;case 0:case 11:case 14:case 15:va(2,s,i),Lt||va(4,s,i),Yr(r,i,s);break;case 1:Lt||(vr(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Ob(s,i,c)),Yr(r,i,s);break;case 21:Yr(r,i,s);break;case 22:Lt=(c=Lt)||s.memoizedState!==null,Yr(r,i,s),Lt=c;break;default:Yr(r,i,s)}}function Vb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{xo(r)}catch(s){Ke(i,i.return,s)}}}function Bb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{xo(r)}catch(s){Ke(i,i.return,s)}}function TT(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new $b),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new $b),i;default:throw Error(a(435,r.tag))}}function Ou(r,i){var s=TT(r);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=$T.bind(null,r,c);c.then(p,p)}})}function _n(r,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],y=r,k=i,_=k;e:for(;_!==null;){switch(_.tag){case 27:if(Ta(_.type)){gt=_.stateNode,zn=!1;break e}break;case 5:gt=_.stateNode,zn=!1;break e;case 3:case 4:gt=_.stateNode.containerInfo,zn=!0;break e}_=_.return}if(gt===null)throw Error(a(160));Ub(y,k,p),gt=null,zn=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Zb(i,r),i=i.sibling}var fr=null;function Zb(r,i){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:_n(i,r),jn(r),c&4&&(va(3,r,r.return),Os(3,r),va(5,r,r.return));break;case 1:_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),c&64&&Gr&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=fr;if(_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),c&4){var y=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[os]||y[Wt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),rn(y,c,s),y[Wt]=r,Kt(y),c=y;break e;case"link":var k=Zv("link","href",p).get(c+(s.href||""));if(k){for(var _=0;_<k.length;_++)if(y=k[_],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){k.splice(_,1);break t}}y=p.createElement(c),rn(y,c,s),p.head.appendChild(y);break;case"meta":if(k=Zv("meta","content",p).get(c+(s.content||""))){for(_=0;_<k.length;_++)if(y=k[_],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){k.splice(_,1);break t}}y=p.createElement(c),rn(y,c,s),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Wt]=r,Kt(y),c=y}r.stateNode=c}else Iv(p,r.type,r.stateNode);else r.stateNode=Bv(p,c,r.memoizedProps);else y!==c?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,c===null?Iv(p,r.type,r.stateNode):Bv(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Gf(r,r.memoizedProps,s.memoizedProps)}break;case 27:_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),s!==null&&c&4&&Gf(r,r.memoizedProps,s.memoizedProps);break;case 5:if(_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),r.flags&32){p=r.stateNode;try{Vi(p,"")}catch(pe){Ke(r,r.return,pe)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Gf(r,p,s!==null?s.memoizedProps:p)),c&1024&&(Kf=!0);break;case 6:if(_n(i,r),jn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(pe){Ke(r,r.return,pe)}}break;case 3:if(Yu=null,p=fr,fr=qu(i.containerInfo),_n(i,r),fr=p,jn(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{xo(i.containerInfo)}catch(pe){Ke(r,r.return,pe)}Kf&&(Kf=!1,Ib(r));break;case 4:c=fr,fr=qu(r.stateNode.containerInfo),_n(i,r),jn(r),fr=c;break;case 12:_n(i,r),jn(r);break;case 31:_n(i,r),jn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ou(r,c)));break;case 13:_n(i,r),jn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Mu=ft()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ou(r,c)));break;case 22:p=r.memoizedState!==null;var R=s!==null&&s.memoizedState!==null,I=Gr,J=Lt;if(Gr=I||p,Lt=J||R,_n(i,r),Lt=J,Gr=I,jn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||R||Gr||Lt||mi(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){R=s=i;try{if(y=R.stateNode,p)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{_=R.stateNode;var re=R.memoizedProps.style,F=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(pe){Ke(R,R.return,pe)}}}else if(i.tag===6){if(s===null){R=i;try{R.stateNode.nodeValue=p?"":R.memoizedProps}catch(pe){Ke(R,R.return,pe)}}}else if(i.tag===18){if(s===null){R=i;try{var Y=R.stateNode;p?Ov(Y,!0):Ov(R.stateNode,!1)}catch(pe){Ke(R,R.return,pe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Ou(r,s))));break;case 19:_n(i,r),jn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ou(r,c)));break;case 30:break;case 21:break;default:_n(i,r),jn(r)}}function jn(r){var i=r.flags;if(i&2){try{for(var s,c=r.return;c!==null;){if(Mb(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,y=Yf(r);Au(r,y,p);break;case 5:var k=s.stateNode;s.flags&32&&(Vi(k,""),s.flags&=-33);var _=Yf(r);Au(r,_,k);break;case 3:case 4:var R=s.stateNode.containerInfo,I=Yf(r);Xf(r,I,R);break;default:throw Error(a(161))}}catch(J){Ke(r,r.return,J)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ib(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ib(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Xr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Lb(r,i.alternate,i),i=i.sibling}function mi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:va(4,i,i.return),mi(i);break;case 1:vr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Ob(i,i.return,s),mi(i);break;case 27:Zs(i.stateNode);case 26:case 5:vr(i,i.return),mi(i);break;case 22:i.memoizedState===null&&mi(i);break;case 30:mi(i);break;default:mi(i)}r=r.sibling}}function Kr(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,y=i,k=y.flags;switch(y.tag){case 0:case 11:case 15:Kr(p,y,s),Os(4,y);break;case 1:if(Kr(p,y,s),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(I){Ke(c,c.return,I)}if(c=y,p=c.updateQueue,p!==null){var _=c.stateNode;try{var R=p.shared.hiddenCallbacks;if(R!==null)for(p.shared.hiddenCallbacks=null,p=0;p<R.length;p++)vx(R[p],_)}catch(I){Ke(c,c.return,I)}}s&&k&64&&Ab(y),Rs(y,y.return);break;case 27:Db(y);case 26:case 5:Kr(p,y,s),s&&c===null&&k&4&&Rb(y),Rs(y,y.return);break;case 12:Kr(p,y,s);break;case 31:Kr(p,y,s),s&&k&4&&Vb(p,y);break;case 13:Kr(p,y,s),s&&k&4&&Bb(p,y);break;case 22:y.memoizedState===null&&Kr(p,y,s),Rs(y,y.return);break;case 30:break;default:Kr(p,y,s)}i=i.sibling}}function Jf(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&bs(s))}function Qf(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&bs(r))}function hr(r,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Hb(r,i,s,c),i=i.sibling}function Hb(r,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:hr(r,i,s,c),p&2048&&Os(9,i);break;case 1:hr(r,i,s,c);break;case 3:hr(r,i,s,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&bs(r)));break;case 12:if(p&2048){hr(r,i,s,c),r=i.stateNode;try{var y=i.memoizedProps,k=y.id,_=y.onPostCommit;typeof _=="function"&&_(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){Ke(i,i.return,R)}}else hr(r,i,s,c);break;case 31:hr(r,i,s,c);break;case 13:hr(r,i,s,c);break;case 23:break;case 22:y=i.stateNode,k=i.alternate,i.memoizedState!==null?y._visibility&2?hr(r,i,s,c):Ms(r,i):y._visibility&2?hr(r,i,s,c):(y._visibility|=2,oo(r,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Jf(k,i);break;case 24:hr(r,i,s,c),p&2048&&Qf(i.alternate,i);break;default:hr(r,i,s,c)}}function oo(r,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,k=i,_=s,R=c,I=k.flags;switch(k.tag){case 0:case 11:case 15:oo(y,k,_,R,p),Os(8,k);break;case 23:break;case 22:var J=k.stateNode;k.memoizedState!==null?J._visibility&2?oo(y,k,_,R,p):Ms(y,k):(J._visibility|=2,oo(y,k,_,R,p)),p&&I&2048&&Jf(k.alternate,k);break;case 24:oo(y,k,_,R,p),p&&I&2048&&Qf(k.alternate,k);break;default:oo(y,k,_,R,p)}i=i.sibling}}function Ms(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,c=i,p=c.flags;switch(c.tag){case 22:Ms(s,c),p&2048&&Jf(c.alternate,c);break;case 24:Ms(s,c),p&2048&&Qf(c.alternate,c);break;default:Ms(s,c)}i=i.sibling}}var Ds=8192;function so(r,i,s){if(r.subtreeFlags&Ds)for(r=r.child;r!==null;)Fb(r,i,s),r=r.sibling}function Fb(r,i,s){switch(r.tag){case 26:so(r,i,s),r.flags&Ds&&r.memoizedState!==null&&hC(s,fr,r.memoizedState,r.memoizedProps);break;case 5:so(r,i,s);break;case 3:case 4:var c=fr;fr=qu(r.stateNode.containerInfo),so(r,i,s),fr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Ds,Ds=16777216,so(r,i,s),Ds=c):so(r,i,s));break;default:so(r,i,s)}}function qb(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function $s(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Jt=c,Yb(c,r)}qb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Gb(r),r=r.sibling}function Gb(r){switch(r.tag){case 0:case 11:case 15:$s(r),r.flags&2048&&va(9,r,r.return);break;case 3:$s(r);break;case 12:$s(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Ru(r)):$s(r);break;default:$s(r)}}function Ru(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Jt=c,Yb(c,r)}qb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:va(8,i,i.return),Ru(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Ru(i));break;default:Ru(i)}r=r.sibling}}function Yb(r,i){for(;Jt!==null;){var s=Jt;switch(s.tag){case 0:case 11:case 15:va(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:bs(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Jt=c;else e:for(s=r;Jt!==null;){c=Jt;var p=c.sibling,y=c.return;if(Pb(c),c===s){Jt=null;break e}if(p!==null){p.return=y,Jt=p;break e}Jt=y}}}var CT={getCacheForType:function(r){var i=tn(Mt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return tn(Mt).controller.signal}},ET=typeof WeakMap=="function"?WeakMap:Map,qe=0,it=null,$e=null,Pe=0,Xe=0,Pn=null,ka=!1,lo=!1,Wf=!1,Jr=0,Et=0,wa=0,pi=0,eh=0,Un=0,uo=0,Ls=null,Tn=null,th=!1,Mu=0,Xb=0,Du=1/0,$u=null,Sa=null,qt=0,za=null,co=null,Qr=0,nh=0,rh=null,Kb=null,Ps=0,ah=null;function Vn(){return(qe&2)!==0&&Pe!==0?Pe&-Pe:U.T!==null?ch():fy()}function Jb(){if(Un===0)if((Pe&536870912)===0||Ve){var r=Hl;Hl<<=1,(Hl&3932160)===0&&(Hl=262144),Un=r}else Un=536870912;return r=$n.current,r!==null&&(r.flags|=32),Un}function Cn(r,i,s){(r===it&&(Xe===2||Xe===9)||r.cancelPendingCommit!==null)&&(fo(r,0),_a(r,Pe,Un,!1)),is(r,s),((qe&2)===0||r!==it)&&(r===it&&((qe&2)===0&&(pi|=s),Et===4&&_a(r,Pe,Un,!1)),kr(r))}function Qb(r,i,s){if((qe&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&r.expiredLanes)===0||as(r,i),p=c?OT(r,i):oh(r,i,!0),y=c;do{if(p===0){lo&&!c&&_a(r,i,0,!1);break}else{if(s=r.current.alternate,y&&!NT(s)){p=oh(r,i,!1),y=!1;continue}if(p===2){if(y=i,r.errorRecoveryDisabledLanes&y)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var _=r;p=Ls;var R=_.current.memoizedState.isDehydrated;if(R&&(fo(_,k).flags|=256),k=oh(_,k,!1),k!==2){if(Wf&&!R){_.errorRecoveryDisabledLanes|=y,pi|=y,p=4;break e}y=Tn,Tn=p,y!==null&&(Tn===null?Tn=y:Tn.push.apply(Tn,y))}p=k}if(y=!1,p!==2)continue}}if(p===1){fo(r,0),_a(r,i,0,!0);break}e:{switch(c=r,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:_a(c,i,Un,!ka);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Mu+300-ft(),10<p)){if(_a(c,i,Un,!ka),ql(c,0,!0)!==0)break e;Qr=i,c.timeoutHandle=Ev(Wb.bind(null,c,s,Tn,$u,th,i,Un,pi,uo,ka,y,"Throttled",-0,0),p);break e}Wb(c,s,Tn,$u,th,i,Un,pi,uo,ka,y,null,-0,0)}}break}while(!0);kr(r)}function Wb(r,i,s,c,p,y,k,_,R,I,J,re,F,Y){if(r.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lr},Fb(i,y,re);var pe=(y&62914560)===y?Mu-ft():(y&4194048)===y?Xb-ft():0;if(pe=mC(re,pe),pe!==null){Qr=y,r.cancelPendingCommit=pe(sv.bind(null,r,i,y,s,c,p,k,_,R,J,re,null,F,Y)),_a(r,y,k,!I);return}}sv(r,i,y,s,c,p,k,_,R)}function NT(r){for(var i=r;;){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],y=p.getSnapshot;p=p.value;try{if(!Mn(y(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function _a(r,i,s,c){i&=~eh,i&=~pi,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var y=31-at(p),k=1<<y;c[y]=-1,p&=~k}s!==0&&uy(r,s,i)}function Lu(){return(qe&6)===0?(Us(0),!1):!0}function ih(){if($e!==null){if(Xe===0)var r=$e.return;else r=$e,Br=oi=null,kf(r),to=null,ks=0,r=$e;for(;r!==null;)Nb(r.alternate,r),r=r.return;$e=null}}function fo(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,KT(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Qr=0,ih(),it=r,$e=s=Ur(r.current,null),Pe=i,Xe=0,Pn=null,ka=!1,lo=as(r,i),Wf=!1,uo=Un=eh=pi=wa=Et=0,Tn=Ls=null,th=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-at(c),y=1<<p;i|=r[p],c&=~y}return Jr=i,au(),s}function ev(r,i){Ae=null,U.H=Es,i===eo||i===fu?(i=gx(),Xe=3):i===uf?(i=gx(),Xe=4):Xe=i===Lf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Pn=i,$e===null&&(Et=1,ju(r,Kn(i,r.current)))}function tv(){var r=$n.current;return r===null?!0:(Pe&4194048)===Pe?er===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?r===er:!1}function nv(){var r=U.H;return U.H=Es,r===null?Es:r}function rv(){var r=U.A;return U.A=CT,r}function Pu(){Et=4,ka||(Pe&4194048)!==Pe&&$n.current!==null||(lo=!0),(wa&134217727)===0&&(pi&134217727)===0||it===null||_a(it,Pe,Un,!1)}function oh(r,i,s){var c=qe;qe|=2;var p=nv(),y=rv();(it!==r||Pe!==i)&&($u=null,fo(r,i)),i=!1;var k=Et;e:do try{if(Xe!==0&&$e!==null){var _=$e,R=Pn;switch(Xe){case 8:ih(),k=6;break e;case 3:case 2:case 9:case 6:$n.current===null&&(i=!0);var I=Xe;if(Xe=0,Pn=null,ho(r,_,R,I),s&&lo){k=0;break e}break;default:I=Xe,Xe=0,Pn=null,ho(r,_,R,I)}}AT(),k=Et;break}catch(J){ev(r,J)}while(!0);return i&&r.shellSuspendCounter++,Br=oi=null,qe=c,U.H=p,U.A=y,$e===null&&(it=null,Pe=0,au()),k}function AT(){for(;$e!==null;)av($e)}function OT(r,i){var s=qe;qe|=2;var c=nv(),p=rv();it!==r||Pe!==i?($u=null,Du=ft()+500,fo(r,i)):lo=as(r,i);e:do try{if(Xe!==0&&$e!==null){i=$e;var y=Pn;t:switch(Xe){case 1:Xe=0,Pn=null,ho(r,i,y,1);break;case 2:case 9:if(mx(y)){Xe=0,Pn=null,iv(i);break}i=function(){Xe!==2&&Xe!==9||it!==r||(Xe=7),kr(r)},y.then(i,i);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:mx(y)?(Xe=0,Pn=null,iv(i)):(Xe=0,Pn=null,ho(r,i,y,7));break;case 5:var k=null;switch($e.tag){case 26:k=$e.memoizedState;case 5:case 27:var _=$e;if(k?Hv(k):_.stateNode.complete){Xe=0,Pn=null;var R=_.sibling;if(R!==null)$e=R;else{var I=_.return;I!==null?($e=I,Uu(I)):$e=null}break t}}Xe=0,Pn=null,ho(r,i,y,5);break;case 6:Xe=0,Pn=null,ho(r,i,y,6);break;case 8:ih(),Et=6;break e;default:throw Error(a(462))}}RT();break}catch(J){ev(r,J)}while(!0);return Br=oi=null,U.H=c,U.A=p,qe=s,$e!==null?0:(it=null,Pe=0,au(),Et)}function RT(){for(;$e!==null&&!At();)av($e)}function av(r){var i=Cb(r.alternate,r,Jr);r.memoizedProps=r.pendingProps,i===null?Uu(r):$e=i}function iv(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=wb(s,i,i.pendingProps,i.type,void 0,Pe);break;case 11:i=wb(s,i,i.pendingProps,i.type.render,i.ref,Pe);break;case 5:kf(i);default:Nb(s,i),i=$e=rx(i,Jr),i=Cb(s,i,Jr)}r.memoizedProps=r.pendingProps,i===null?Uu(r):$e=i}function ho(r,i,s,c){Br=oi=null,kf(i),to=null,ks=0;var p=i.return;try{if(kT(r,p,i,s,Pe)){Et=1,ju(r,Kn(s,r.current)),$e=null;return}}catch(y){if(p!==null)throw $e=p,y;Et=1,ju(r,Kn(s,r.current)),$e=null;return}i.flags&32768?(Ve||c===1?r=!0:lo||(Pe&536870912)!==0?r=!1:(ka=r=!0,(c===2||c===9||c===3||c===6)&&(c=$n.current,c!==null&&c.tag===13&&(c.flags|=16384))),ov(i,r)):Uu(i)}function Uu(r){var i=r;do{if((i.flags&32768)!==0){ov(i,ka);return}r=i.return;var s=zT(i.alternate,i,Jr);if(s!==null){$e=s;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=r}while(i!==null);Et===0&&(Et=5)}function ov(r,i){do{var s=_T(r.alternate,r);if(s!==null){s.flags&=32767,$e=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){$e=r;return}$e=r=s}while(r!==null);Et=6,$e=null}function sv(r,i,s,c,p,y,k,_,R){r.cancelPendingCommit=null;do Vu();while(qt!==0);if((qe&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Gd,fj(r,s,y,k,_,R),r===it&&($e=it=null,Pe=0),co=i,za=r,Qr=s,nh=y,rh=p,Kb=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,LT(be,function(){return fv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=U.T,U.T=null,p=K.p,K.p=2,k=qe,qe|=4;try{jT(r,i,s)}finally{qe=k,K.p=p,U.T=c}}qt=1,lv(),uv(),cv()}}function lv(){if(qt===1){qt=0;var r=za,i=co,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=U.T,U.T=null;var c=K.p;K.p=2;var p=qe;qe|=4;try{Zb(i,r);var y=xh,k=Yy(r.containerInfo),_=y.focusedElem,R=y.selectionRange;if(k!==_&&_&&_.ownerDocument&&Gy(_.ownerDocument.documentElement,_)){if(R!==null&&Zd(_)){var I=R.start,J=R.end;if(J===void 0&&(J=I),"selectionStart"in _)_.selectionStart=I,_.selectionEnd=Math.min(J,_.value.length);else{var re=_.ownerDocument||document,F=re&&re.defaultView||window;if(F.getSelection){var Y=F.getSelection(),pe=_.textContent.length,ze=Math.min(R.start,pe),tt=R.end===void 0?ze:Math.min(R.end,pe);!Y.extend&&ze>tt&&(k=tt,tt=ze,ze=k);var P=qy(_,ze),D=qy(_,tt);if(P&&D&&(Y.rangeCount!==1||Y.anchorNode!==P.node||Y.anchorOffset!==P.offset||Y.focusNode!==D.node||Y.focusOffset!==D.offset)){var Z=re.createRange();Z.setStart(P.node,P.offset),Y.removeAllRanges(),ze>tt?(Y.addRange(Z),Y.extend(D.node,D.offset)):(Z.setEnd(D.node,D.offset),Y.addRange(Z))}}}}for(re=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var ne=re[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Qu=!!yh,xh=yh=null}finally{qe=p,K.p=c,U.T=s}}r.current=i,qt=2}}function uv(){if(qt===2){qt=0;var r=za,i=co,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=U.T,U.T=null;var c=K.p;K.p=2;var p=qe;qe|=4;try{Lb(r,i.alternate,i)}finally{qe=p,K.p=c,U.T=s}}qt=3}}function cv(){if(qt===4||qt===3){qt=0,Ht();var r=za,i=co,s=Qr,c=Kb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?qt=5:(qt=0,co=za=null,dv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Sa=null),Sd(s),i=i.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(mn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=U.T,p=K.p,K.p=2,U.T=null;try{for(var y=r.onRecoverableError,k=0;k<c.length;k++){var _=c[k];y(_.value,{componentStack:_.stack})}}finally{U.T=i,K.p=p}}(Qr&3)!==0&&Vu(),kr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===ah?Ps++:(Ps=0,ah=r):Ps=0,Us(0)}}function dv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,bs(i)))}function Vu(){return lv(),uv(),cv(),fv()}function fv(){if(qt!==5)return!1;var r=za,i=nh;nh=0;var s=Sd(Qr),c=U.T,p=K.p;try{K.p=32>s?32:s,U.T=null,s=rh,rh=null;var y=za,k=Qr;if(qt=0,co=za=null,Qr=0,(qe&6)!==0)throw Error(a(331));var _=qe;if(qe|=4,Gb(y.current),Hb(y,y.current,k,s),qe=_,Us(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(mn,y)}catch{}return!0}finally{K.p=p,U.T=c,dv(r,i)}}function hv(r,i,s){i=Kn(s,i),i=$f(r.stateNode,i,2),r=ya(r,i,2),r!==null&&(is(r,2),kr(r))}function Ke(r,i,s){if(r.tag===3)hv(r,r,s);else for(;i!==null;){if(i.tag===3){hv(i,r,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Sa===null||!Sa.has(c))){r=Kn(s,r),s=mb(2),c=ya(i,s,2),c!==null&&(pb(s,c,i,r),is(c,2),kr(c));break}}i=i.return}}function sh(r,i,s){var c=r.pingCache;if(c===null){c=r.pingCache=new ET;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)||(Wf=!0,p.add(s),r=MT.bind(null,r,i,s),i.then(r,r))}function MT(r,i,s){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,it===r&&(Pe&s)===s&&(Et===4||Et===3&&(Pe&62914560)===Pe&&300>ft()-Mu?(qe&2)===0&&fo(r,0):eh|=s,uo===Pe&&(uo=0)),kr(r)}function mv(r,i){i===0&&(i=ly()),r=ri(r,i),r!==null&&(is(r,i),kr(r))}function DT(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),mv(r,s)}function $T(r,i){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),mv(r,s)}function LT(r,i){return Xt(r,i)}var Bu=null,mo=null,lh=!1,Zu=!1,uh=!1,ja=0;function kr(r){r!==mo&&r.next===null&&(mo===null?Bu=mo=r:mo=mo.next=r),Zu=!0,lh||(lh=!0,UT())}function Us(r,i){if(!uh&&Zu){uh=!0;do for(var s=!1,c=Bu;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var k=c.suspendedLanes,_=c.pingedLanes;y=(1<<31-at(42|r)+1)-1,y&=p&~(k&~_),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,xv(c,y))}else y=Pe,y=ql(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||as(c,y)||(s=!0,xv(c,y));c=c.next}while(s);uh=!1}}function PT(){pv()}function pv(){Zu=lh=!1;var r=0;ja!==0&&XT()&&(r=ja);for(var i=ft(),s=null,c=Bu;c!==null;){var p=c.next,y=gv(c,i);y===0?(c.next=null,s===null?Bu=p:s.next=p,p===null&&(mo=s)):(s=c,(r!==0||(y&3)!==0)&&(Zu=!0)),c=p}qt!==0&&qt!==5||Us(r),ja!==0&&(ja=0)}function gv(r,i){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var k=31-at(y),_=1<<k,R=p[k];R===-1?((_&s)===0||(_&c)!==0)&&(p[k]=dj(_,i)):R<=i&&(r.expiredLanes|=_),y&=~_}if(i=it,s=Pe,s=ql(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===i&&(Xe===2||Xe===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&qn(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||as(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(c!==null&&qn(c),Sd(s)){case 2:case 8:s=ue;break;case 32:s=be;break;case 268435456:s=Be;break;default:s=be}return c=yv.bind(null,r),s=Xt(s,c),r.callbackPriority=i,r.callbackNode=s,i}return c!==null&&c!==null&&qn(c),r.callbackPriority=2,r.callbackNode=null,2}function yv(r,i){if(qt!==0&&qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Vu()&&r.callbackNode!==s)return null;var c=Pe;return c=ql(r,r===it?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Qb(r,c,i),gv(r,ft()),r.callbackNode!=null&&r.callbackNode===s?yv.bind(null,r):null)}function xv(r,i){if(Vu())return null;Qb(r,i,!0)}function UT(){JT(function(){(qe&6)!==0?Xt(W,PT):pv()})}function ch(){if(ja===0){var r=Qi;r===0&&(r=Il,Il<<=1,(Il&261888)===0&&(Il=256)),ja=r}return ja}function bv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Kl(""+r)}function vv(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function VT(r,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var y=bv((p[wn]||null).action),k=c.submitter;k&&(i=(i=k[wn]||null)?bv(i.formAction):k.getAttribute("formAction"),i!==null&&(y=i,k=null));var _=new eu("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ja!==0){var R=k?vv(p,k):new FormData(p);Nf(s,{pending:!0,data:R,method:p.method,action:y},null,R)}}else typeof y=="function"&&(_.preventDefault(),R=k?vv(p,k):new FormData(p),Nf(s,{pending:!0,data:R,method:p.method,action:y},y,R))},currentTarget:p}]})}}for(var dh=0;dh<qd.length;dh++){var fh=qd[dh],BT=fh.toLowerCase(),ZT=fh[0].toUpperCase()+fh.slice(1);dr(BT,"on"+ZT)}dr(Jy,"onAnimationEnd"),dr(Qy,"onAnimationIteration"),dr(Wy,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(aT,"onTransitionRun"),dr(iT,"onTransitionStart"),dr(oT,"onTransitionCancel"),dr(ex,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),Wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vs="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(" "),IT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vs));function kv(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var y=void 0;if(i)for(var k=c.length-1;0<=k;k--){var _=c[k],R=_.instance,I=_.currentTarget;if(_=_.listener,R!==y&&p.isPropagationStopped())break e;y=_,p.currentTarget=I;try{y(p)}catch(J){ru(J)}p.currentTarget=null,y=R}else for(k=0;k<c.length;k++){if(_=c[k],R=_.instance,I=_.currentTarget,_=_.listener,R!==y&&p.isPropagationStopped())break e;y=_,p.currentTarget=I;try{y(p)}catch(J){ru(J)}p.currentTarget=null,y=R}}}}function Le(r,i){var s=i[zd];s===void 0&&(s=i[zd]=new Set);var c=r+"__bubble";s.has(c)||(wv(i,r,2,!1),s.add(c))}function hh(r,i,s){var c=0;i&&(c|=4),wv(s,r,c,i)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function mh(r){if(!r[Iu]){r[Iu]=!0,py.forEach(function(s){s!=="selectionchange"&&(IT.has(s)||hh(s,!1,r),hh(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Iu]||(i[Iu]=!0,hh("selectionchange",!1,i))}}function wv(r,i,s,c){switch(Jv(i)){case 2:var p=yC;break;case 8:p=xC;break;default:p=Eh}s=p.bind(null,i,s,r),p=void 0,!Rd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function ph(r,i,s,c,p){var y=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var _=c.stateNode.containerInfo;if(_===p)break;if(k===4)for(k=c.return;k!==null;){var R=k.tag;if((R===3||R===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;_!==null;){if(k=Di(_),k===null)return;if(R=k.tag,R===5||R===6||R===26||R===27){c=y=k;continue e}_=_.parentNode}}c=c.return}Ty(function(){var I=y,J=Ad(s),re=[];e:{var F=tx.get(r);if(F!==void 0){var Y=eu,pe=r;switch(r){case"keypress":if(Ql(s)===0)break e;case"keydown":case"keyup":Y=$j;break;case"focusin":pe="focus",Y=Ld;break;case"focusout":pe="blur",Y=Ld;break;case"beforeblur":case"afterblur":Y=Ld;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=Ny;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=zj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Uj;break;case Jy:case Qy:case Wy:Y=Tj;break;case ex:Y=Bj;break;case"scroll":case"scrollend":Y=wj;break;case"wheel":Y=Ij;break;case"copy":case"cut":case"paste":Y=Ej;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Oy;break;case"toggle":case"beforetoggle":Y=Fj}var ze=(i&4)!==0,tt=!ze&&(r==="scroll"||r==="scrollend"),P=ze?F!==null?F+"Capture":null:F;ze=[];for(var D=I,Z;D!==null;){var ne=D;if(Z=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||Z===null||P===null||(ne=ls(D,P),ne!=null&&ze.push(Bs(D,ne,Z))),tt)break;D=D.return}0<ze.length&&(F=new Y(F,pe,null,s,J),re.push({event:F,listeners:ze}))}}if((i&7)===0){e:{if(F=r==="mouseover"||r==="pointerover",Y=r==="mouseout"||r==="pointerout",F&&s!==Nd&&(pe=s.relatedTarget||s.fromElement)&&(Di(pe)||pe[Mi]))break e;if((Y||F)&&(F=J.window===J?J:(F=J.ownerDocument)?F.defaultView||F.parentWindow:window,Y?(pe=s.relatedTarget||s.toElement,Y=I,pe=pe?Di(pe):null,pe!==null&&(tt=u(pe),ze=pe.tag,pe!==tt||ze!==5&&ze!==27&&ze!==6)&&(pe=null)):(Y=null,pe=I),Y!==pe)){if(ze=Ny,ne="onMouseLeave",P="onMouseEnter",D="mouse",(r==="pointerout"||r==="pointerover")&&(ze=Oy,ne="onPointerLeave",P="onPointerEnter",D="pointer"),tt=Y==null?F:ss(Y),Z=pe==null?F:ss(pe),F=new ze(ne,D+"leave",Y,s,J),F.target=tt,F.relatedTarget=Z,ne=null,Di(J)===I&&(ze=new ze(P,D+"enter",pe,s,J),ze.target=Z,ze.relatedTarget=tt,ne=ze),tt=ne,Y&&pe)t:{for(ze=HT,P=Y,D=pe,Z=0,ne=P;ne;ne=ze(ne))Z++;ne=0;for(var Se=D;Se;Se=ze(Se))ne++;for(;0<Z-ne;)P=ze(P),Z--;for(;0<ne-Z;)D=ze(D),ne--;for(;Z--;){if(P===D||D!==null&&P===D.alternate){ze=P;break t}P=ze(P),D=ze(D)}ze=null}else ze=null;Y!==null&&Sv(re,F,Y,ze,!1),pe!==null&&tt!==null&&Sv(re,tt,pe,ze,!0)}}e:{if(F=I?ss(I):window,Y=F.nodeName&&F.nodeName.toLowerCase(),Y==="select"||Y==="input"&&F.type==="file")var He=Vy;else if(Py(F))if(By)He=tT;else{He=Wj;var ve=Qj}else Y=F.nodeName,!Y||Y.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?I&&Ed(I.elementType)&&(He=Vy):He=eT;if(He&&(He=He(r,I))){Uy(re,He,s,J);break e}ve&&ve(r,F,I),r==="focusout"&&I&&F.type==="number"&&I.memoizedProps.value!=null&&Cd(F,"number",F.value)}switch(ve=I?ss(I):window,r){case"focusin":(Py(ve)||ve.contentEditable==="true")&&(Hi=ve,Id=I,gs=null);break;case"focusout":gs=Id=Hi=null;break;case"mousedown":Hd=!0;break;case"contextmenu":case"mouseup":case"dragend":Hd=!1,Xy(re,s,J);break;case"selectionchange":if(rT)break;case"keydown":case"keyup":Xy(re,s,J)}var Oe;if(Ud)e:{switch(r){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ii?$y(r,s)&&(Ue="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(Ue="onCompositionStart");Ue&&(Ry&&s.locale!=="ko"&&(Ii||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ii&&(Oe=Cy()):(ca=J,Md="value"in ca?ca.value:ca.textContent,Ii=!0)),ve=Hu(I,Ue),0<ve.length&&(Ue=new Ay(Ue,r,null,s,J),re.push({event:Ue,listeners:ve}),Oe?Ue.data=Oe:(Oe=Ly(s),Oe!==null&&(Ue.data=Oe)))),(Oe=Gj?Yj(r,s):Xj(r,s))&&(Ue=Hu(I,"onBeforeInput"),0<Ue.length&&(ve=new Ay("onBeforeInput","beforeinput",null,s,J),re.push({event:ve,listeners:Ue}),ve.data=Oe)),VT(re,r,I,s,J)}kv(re,i)})}function Bs(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Hu(r,i){for(var s=i+"Capture",c=[];r!==null;){var p=r,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=ls(r,s),p!=null&&c.unshift(Bs(r,p,y)),p=ls(r,i),p!=null&&c.push(Bs(r,p,y))),r.tag===3)return c;r=r.return}return[]}function HT(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Sv(r,i,s,c,p){for(var y=i._reactName,k=[];s!==null&&s!==c;){var _=s,R=_.alternate,I=_.stateNode;if(_=_.tag,R!==null&&R===c)break;_!==5&&_!==26&&_!==27||I===null||(R=I,p?(I=ls(s,y),I!=null&&k.unshift(Bs(s,I,R))):p||(I=ls(s,y),I!=null&&k.push(Bs(s,I,R)))),s=s.return}k.length!==0&&r.push({event:i,listeners:k})}var FT=/\r\n?/g,qT=/\u0000|\uFFFD/g;function zv(r){return(typeof r=="string"?r:""+r).replace(FT,`
9
- `).replace(qT,"")}function _v(r,i){return i=zv(i),zv(r)===i}function et(r,i,s,c,p,y){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Vi(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Vi(r,""+c);break;case"className":Yl(r,"class",c);break;case"tabIndex":Yl(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Yl(r,s,c);break;case"style":_y(r,c,y);break;case"data":if(i!=="object"){Yl(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Kl(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(s==="formAction"?(i!=="input"&&et(r,i,"name",p.name,p,null),et(r,i,"formEncType",p.formEncType,p,null),et(r,i,"formMethod",p.formMethod,p,null),et(r,i,"formTarget",p.formTarget,p,null)):(et(r,i,"encType",p.encType,p,null),et(r,i,"method",p.method,p,null),et(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Kl(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Lr);break;case"onScroll":c!=null&&Le("scroll",r);break;case"onScrollEnd":c!=null&&Le("scrollend",r);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));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Kl(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Le("beforetoggle",r),Le("toggle",r),Gl(r,"popover",c);break;case"xlinkActuate":$r(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":$r(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":$r(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":$r(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":$r(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":$r(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":$r(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":$r(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":$r(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Gl(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=vj.get(s)||s,Gl(r,s,c))}}function gh(r,i,s,c,p,y){switch(s){case"style":_y(r,c,y);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));r.innerHTML=s}}break;case"children":typeof c=="string"?Vi(r,c):(typeof c=="number"||typeof c=="bigint")&&Vi(r,""+c);break;case"onScroll":c!=null&&Le("scroll",r);break;case"onScrollEnd":c!=null&&Le("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gy.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),y=r[wn]||null,y=y!=null?y[s]:null,typeof y=="function"&&r.removeEventListener(i,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Gl(r,s,c)}}}function rn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",r),Le("load",r);var c=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var k=s[y];if(k!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:et(r,i,y,k,s,null)}}p&&et(r,i,"srcSet",s.srcSet,s,null),c&&et(r,i,"src",s.src,s,null);return;case"input":Le("invalid",r);var _=y=k=p=null,R=null,I=null;for(c in s)if(s.hasOwnProperty(c)){var J=s[c];if(J!=null)switch(c){case"name":p=J;break;case"type":k=J;break;case"checked":R=J;break;case"defaultChecked":I=J;break;case"value":y=J;break;case"defaultValue":_=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:et(r,i,c,J,s,null)}}ky(r,y,_,R,I,k,p,!1);return;case"select":Le("invalid",r),c=k=y=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":y=_;break;case"defaultValue":k=_;break;case"multiple":c=_;default:et(r,i,p,_,s,null)}i=y,s=k,r.multiple=!!c,i!=null?Ui(r,!!c,i,!1):s!=null&&Ui(r,!!c,s,!0);return;case"textarea":Le("invalid",r),y=p=c=null;for(k in s)if(s.hasOwnProperty(k)&&(_=s[k],_!=null))switch(k){case"value":c=_;break;case"defaultValue":p=_;break;case"children":y=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:et(r,i,k,_,s,null)}Sy(r,c,p,y);return;case"option":for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null)&&(R==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":et(r,i,R,c,s,null));return;case"dialog":Le("beforetoggle",r),Le("toggle",r),Le("cancel",r),Le("close",r);break;case"iframe":case"object":Le("load",r);break;case"video":case"audio":for(c=0;c<Vs.length;c++)Le(Vs[c],r);break;case"image":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"embed":case"source":case"link":Le("error",r),Le("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(I in s)if(s.hasOwnProperty(I)&&(c=s[I],c!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:et(r,i,I,c,s,null)}return;default:if(Ed(i)){for(J in s)s.hasOwnProperty(J)&&(c=s[J],c!==void 0&&gh(r,i,J,c,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(c=s[_],c!=null&&et(r,i,_,c,s,null))}function GT(r,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,y=null,k=null,_=null,R=null,I=null,J=null;for(Y in s){var re=s[Y];if(s.hasOwnProperty(Y)&&re!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":R=re;default:c.hasOwnProperty(Y)||et(r,i,Y,null,c,re)}}for(var F in c){var Y=c[F];if(re=s[F],c.hasOwnProperty(F)&&(Y!=null||re!=null))switch(F){case"type":y=Y;break;case"name":p=Y;break;case"checked":I=Y;break;case"defaultChecked":J=Y;break;case"value":k=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==re&&et(r,i,F,Y,c,re)}}Td(r,k,_,R,I,J,y,p);return;case"select":Y=k=_=F=null;for(y in s)if(R=s[y],s.hasOwnProperty(y)&&R!=null)switch(y){case"value":break;case"multiple":Y=R;default:c.hasOwnProperty(y)||et(r,i,y,null,c,R)}for(p in c)if(y=c[p],R=s[p],c.hasOwnProperty(p)&&(y!=null||R!=null))switch(p){case"value":F=y;break;case"defaultValue":_=y;break;case"multiple":k=y;default:y!==R&&et(r,i,p,y,c,R)}i=_,s=k,c=Y,F!=null?Ui(r,!!s,F,!1):!!c!=!!s&&(i!=null?Ui(r,!!s,i,!0):Ui(r,!!s,s?[]:"",!1));return;case"textarea":Y=F=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:et(r,i,_,null,c,p)}for(k in c)if(p=c[k],y=s[k],c.hasOwnProperty(k)&&(p!=null||y!=null))switch(k){case"value":F=p;break;case"defaultValue":Y=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&et(r,i,k,p,c,y)}wy(r,F,Y);return;case"option":for(var pe in s)F=s[pe],s.hasOwnProperty(pe)&&F!=null&&!c.hasOwnProperty(pe)&&(pe==="selected"?r.selected=!1:et(r,i,pe,null,c,F));for(R in c)F=c[R],Y=s[R],c.hasOwnProperty(R)&&F!==Y&&(F!=null||Y!=null)&&(R==="selected"?r.selected=F&&typeof F!="function"&&typeof F!="symbol":et(r,i,R,F,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)F=s[ze],s.hasOwnProperty(ze)&&F!=null&&!c.hasOwnProperty(ze)&&et(r,i,ze,null,c,F);for(I in c)if(F=c[I],Y=s[I],c.hasOwnProperty(I)&&F!==Y&&(F!=null||Y!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,i));break;default:et(r,i,I,F,c,Y)}return;default:if(Ed(i)){for(var tt in s)F=s[tt],s.hasOwnProperty(tt)&&F!==void 0&&!c.hasOwnProperty(tt)&&gh(r,i,tt,void 0,c,F);for(J in c)F=c[J],Y=s[J],!c.hasOwnProperty(J)||F===Y||F===void 0&&Y===void 0||gh(r,i,J,F,c,Y);return}}for(var P in s)F=s[P],s.hasOwnProperty(P)&&F!=null&&!c.hasOwnProperty(P)&&et(r,i,P,null,c,F);for(re in c)F=c[re],Y=s[re],!c.hasOwnProperty(re)||F===Y||F==null&&Y==null||et(r,i,re,F,c,Y)}function jv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function YT(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],y=p.transferSize,k=p.initiatorType,_=p.duration;if(y&&_&&jv(k)){for(k=0,_=p.responseEnd,c+=1;c<s.length;c++){var R=s[c],I=R.startTime;if(I>_)break;var J=R.transferSize,re=R.initiatorType;J&&jv(re)&&(R=R.responseEnd,k+=J*(R<_?1:(_-I)/(R-I)))}if(--c,i+=8*(y+k)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var yh=null,xh=null;function Fu(r){return r.nodeType===9?r:r.ownerDocument}function Tv(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cv(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function bh(r,i){return r==="textarea"||r==="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 vh=null;function XT(){var r=window.event;return r&&r.type==="popstate"?r===vh?!1:(vh=r,!0):(vh=null,!1)}var Ev=typeof setTimeout=="function"?setTimeout:void 0,KT=typeof clearTimeout=="function"?clearTimeout:void 0,Nv=typeof Promise=="function"?Promise:void 0,JT=typeof queueMicrotask=="function"?queueMicrotask:typeof Nv<"u"?function(r){return Nv.resolve(null).then(r).catch(QT)}:Ev;function QT(r){setTimeout(function(){throw r})}function Ta(r){return r==="head"}function Av(r,i){var s=i,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),xo(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Zs(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Zs(s);for(var y=s.firstChild;y;){var k=y.nextSibling,_=y.nodeName;y[os]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=k}}else s==="body"&&Zs(r.ownerDocument.body);s=p}while(s);xo(i)}function Ov(r,i){var s=r;r=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(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function kh(r){var i=r.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":kh(s),_d(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function WT(r,i,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[os])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=tr(r.nextSibling),r===null)break}return null}function eC(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=tr(r.nextSibling),r===null))return null;return r}function Rv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=tr(r.nextSibling),r===null))return null;return r}function wh(r){return r.data==="$?"||r.data==="$~"}function Sh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function tC(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function tr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var zh=null;function Mv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return tr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Dv(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function $v(r,i,s){switch(i=Fu(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Zs(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);_d(r)}var nr=new Map,Lv=new Set;function qu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Wr=K.d;K.d={f:nC,r:rC,D:aC,C:iC,L:oC,m:sC,X:uC,S:lC,M:cC};function nC(){var r=Wr.f(),i=Lu();return r||i}function rC(r){var i=$i(r);i!==null&&i.tag===5&&i.type==="form"?eb(i):Wr.r(r)}var po=typeof document>"u"?null:document;function Pv(r,i,s){var c=po;if(c&&typeof i=="string"&&i){var p=Yn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Lv.has(p)||(Lv.add(p),r={rel:r,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),rn(i,"link",r),Kt(i),c.head.appendChild(i)))}}function aC(r){Wr.D(r),Pv("dns-prefetch",r,null)}function iC(r,i){Wr.C(r,i),Pv("preconnect",r,i)}function oC(r,i,s){Wr.L(r,i,s);var c=po;if(c&&r&&i){var p='link[rel="preload"][as="'+Yn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+Yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+Yn(s.imageSizes)+'"]')):p+='[href="'+Yn(r)+'"]';var y=p;switch(i){case"style":y=go(r);break;case"script":y=yo(r)}nr.has(y)||(r=x({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),nr.set(y,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Is(y))||i==="script"&&c.querySelector(Hs(y))||(i=c.createElement("link"),rn(i,"link",r),Kt(i),c.head.appendChild(i)))}}function sC(r,i){Wr.m(r,i);var s=po;if(s&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Yn(c)+'"][href="'+Yn(r)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yo(r)}if(!nr.has(y)&&(r=x({rel:"modulepreload",href:r},i),nr.set(y,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Hs(y)))return}c=s.createElement("link"),rn(c,"link",r),Kt(c),s.head.appendChild(c)}}}function lC(r,i,s){Wr.S(r,i,s);var c=po;if(c&&r){var p=Li(c).hoistableStyles,y=go(r);i=i||"default";var k=p.get(y);if(!k){var _={loading:0,preload:null};if(k=c.querySelector(Is(y)))_.loading=5;else{r=x({rel:"stylesheet",href:r,"data-precedence":i},s),(s=nr.get(y))&&_h(r,s);var R=k=c.createElement("link");Kt(R),rn(R,"link",r),R._p=new Promise(function(I,J){R.onload=I,R.onerror=J}),R.addEventListener("load",function(){_.loading|=1}),R.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Gu(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:_},p.set(y,k)}}}function uC(r,i){Wr.X(r,i);var s=po;if(s&&r){var c=Li(s).hoistableScripts,p=yo(r),y=c.get(p);y||(y=s.querySelector(Hs(p)),y||(r=x({src:r,async:!0},i),(i=nr.get(p))&&jh(r,i),y=s.createElement("script"),Kt(y),rn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function cC(r,i){Wr.M(r,i);var s=po;if(s&&r){var c=Li(s).hoistableScripts,p=yo(r),y=c.get(p);y||(y=s.querySelector(Hs(p)),y||(r=x({src:r,async:!0,type:"module"},i),(i=nr.get(p))&&jh(r,i),y=s.createElement("script"),Kt(y),rn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Uv(r,i,s,c){var p=(p=fe.current)?qu(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=go(s.href),s=Li(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"){r=go(s.href);var y=Li(p).hoistableStyles,k=y.get(r);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,k),(y=p.querySelector(Is(r)))&&!y._p&&(k.instance=y,k.state.loading=5),nr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},nr.set(r,s),y||dC(p,r,s,k.state))),i&&c===null)throw Error(a(528,""));return k}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=yo(s),s=Li(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,r))}}function go(r){return'href="'+Yn(r)+'"'}function Is(r){return'link[rel="stylesheet"]['+r+"]"}function Vv(r){return x({},r,{"data-precedence":r.precedence,precedence:null})}function dC(r,i,s,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),rn(i,"link",s),Kt(i),r.head.appendChild(i))}function yo(r){return'[src="'+Yn(r)+'"]'}function Hs(r){return"script[async]"+r}function Bv(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+Yn(s.href)+'"]');if(c)return i.instance=c,Kt(c),c;var p=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Kt(c),rn(c,"style",p),Gu(c,s.precedence,r),i.instance=c;case"stylesheet":p=go(s.href);var y=r.querySelector(Is(p));if(y)return i.state.loading|=4,i.instance=y,Kt(y),y;c=Vv(s),(p=nr.get(p))&&_h(c,p),y=(r.ownerDocument||r).createElement("link"),Kt(y);var k=y;return k._p=new Promise(function(_,R){k.onload=_,k.onerror=R}),rn(y,"link",c),i.state.loading|=4,Gu(y,s.precedence,r),i.instance=y;case"script":return y=yo(s.src),(p=r.querySelector(Hs(y)))?(i.instance=p,Kt(p),p):(c=s,(p=nr.get(y))&&(c=x({},s),jh(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Kt(p),rn(p,"link",c),r.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,Gu(c,s.precedence,r));return i.instance}function Gu(r,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,k=0;k<c.length;k++){var _=c[k];if(_.dataset.precedence===i)y=_;else if(y!==p)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function _h(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function jh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Yu=null;function Zv(r,i,s){if(Yu===null){var c=new Map,p=Yu=new Map;p.set(s,c)}else p=Yu,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var y=s[p];if(!(y[os]||y[Wt]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(i)||"";k=r+k;var _=c.get(k);_?_.push(y):c.set(k,[y])}}return c}function Iv(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function fC(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){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;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!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 Hv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function hC(r,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=go(c.href),y=i.querySelector(Is(p));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Xu.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=y,Kt(y);return}y=i.ownerDocument||i,c=Vv(c),(p=nr.get(p))&&_h(c,p),y=y.createElement("link"),Kt(y);var k=y;k._p=new Promise(function(_,R){k.onload=_,k.onerror=R}),rn(y,"link",c),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=Xu.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Th=0;function mC(r,i){return r.stylesheets&&r.count===0&&Ju(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Ju(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&Th===0&&(Th=62500*YT());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Ju(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>Th?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ju(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ku=null;function Ju(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ku=new Map,i.forEach(pC,r),Ku=null,Xu.call(r))}function pC(r,i){if(!(i.state.loading&4)){var s=Ku.get(r);if(s)var c=s.get(null);else{s=new Map,Ku.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var k=p[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),c=k)}c&&s.set(null,c)}p=i.instance,k=p.getAttribute("data-precedence"),y=s.get(k)||c,y===c&&s.set(null,p),s.set(k,p),this.count++,c=Xu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Fs={$$typeof:C,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function gC(r,i,s,c,p,y,k,_,R){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kd(0),this.hiddenUpdates=kd(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Fv(r,i,s,c,p,y,k,_,R,I,J,re){return r=new gC(r,i,s,k,R,I,J,re,_),i=1,y===!0&&(i|=24),y=Dn(3,null,null,i),r.current=y,y.stateNode=r,i=of(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:c,isDehydrated:s,cache:i},cf(y),r}function qv(r){return r?(r=Gi,r):Gi}function Gv(r,i,s,c,p,y){p=qv(p),c.context===null?c.context=p:c.pendingContext=p,c=ga(i),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=ya(r,c,i),s!==null&&(Cn(s,r,i),Ss(s,r,i))}function Yv(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Ch(r,i){Yv(r,i),(r=r.alternate)&&Yv(r,i)}function Xv(r){if(r.tag===13||r.tag===31){var i=ri(r,67108864);i!==null&&Cn(i,r,67108864),Ch(r,67108864)}}function Kv(r){if(r.tag===13||r.tag===31){var i=Vn();i=wd(i);var s=ri(r,i);s!==null&&Cn(s,r,i),Ch(r,i)}}var Qu=!0;function yC(r,i,s,c){var p=U.T;U.T=null;var y=K.p;try{K.p=2,Eh(r,i,s,c)}finally{K.p=y,U.T=p}}function xC(r,i,s,c){var p=U.T;U.T=null;var y=K.p;try{K.p=8,Eh(r,i,s,c)}finally{K.p=y,U.T=p}}function Eh(r,i,s,c){if(Qu){var p=Nh(c);if(p===null)ph(r,i,c,Wu,s),Qv(r,c);else if(vC(p,r,i,s,c))c.stopPropagation();else if(Qv(r,c),i&4&&-1<bC.indexOf(r)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=Qa(y.pendingLanes);if(k!==0){var _=y;for(_.pendingLanes|=2,_.entangledLanes|=2;k;){var R=1<<31-at(k);_.entanglements[1]|=R,k&=~R}kr(y),(qe&6)===0&&(Du=ft()+500,Us(0))}}break;case 31:case 13:_=ri(y,2),_!==null&&Cn(_,y,2),Lu(),Ch(y,2)}if(y=Nh(c),y===null&&ph(r,i,c,Wu,s),y===p)break;p=y}p!==null&&c.stopPropagation()}else ph(r,i,c,null,s)}}function Nh(r){return r=Ad(r),Ah(r)}var Wu=null;function Ah(r){if(Wu=null,r=Di(r),r!==null){var i=u(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=l(i),r!==null)return r;r=null}else if(s===31){if(r=d(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Wu=r,null}function Jv(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ri()){case W:return 2;case ue:return 8;case be:case je:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Oh=!1,Ca=null,Ea=null,Na=null,qs=new Map,Gs=new Map,Aa=[],bC="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 Qv(r,i){switch(r){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ea=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":qs.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gs.delete(i.pointerId)}}function Ys(r,i,s,c,p,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},i!==null&&(i=$i(i),i!==null&&Xv(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function vC(r,i,s,c,p){switch(i){case"focusin":return Ca=Ys(Ca,r,i,s,c,p),!0;case"dragenter":return Ea=Ys(Ea,r,i,s,c,p),!0;case"mouseover":return Na=Ys(Na,r,i,s,c,p),!0;case"pointerover":var y=p.pointerId;return qs.set(y,Ys(qs.get(y)||null,r,i,s,c,p)),!0;case"gotpointercapture":return y=p.pointerId,Gs.set(y,Ys(Gs.get(y)||null,r,i,s,c,p)),!0}return!1}function Wv(r){var i=Di(r.target);if(i!==null){var s=u(i);if(s!==null){if(i=s.tag,i===13){if(i=l(s),i!==null){r.blockedOn=i,hy(r.priority,function(){Kv(s)});return}}else if(i===31){if(i=d(s),i!==null){r.blockedOn=i,hy(r.priority,function(){Kv(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function ec(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Nh(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);Nd=c,s.target.dispatchEvent(c),Nd=null}else return i=$i(s),i!==null&&Xv(i),r.blockedOn=s,!1;i.shift()}return!0}function e0(r,i,s){ec(r)&&s.delete(i)}function kC(){Oh=!1,Ca!==null&&ec(Ca)&&(Ca=null),Ea!==null&&ec(Ea)&&(Ea=null),Na!==null&&ec(Na)&&(Na=null),qs.forEach(e0),Gs.forEach(e0)}function tc(r,i){r.blockedOn===i&&(r.blockedOn=null,Oh||(Oh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kC)))}var nc=null;function t0(r){nc!==r&&(nc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nc===r&&(nc=null);for(var i=0;i<r.length;i+=3){var s=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Ah(c||s)===null)continue;break}var y=$i(s);y!==null&&(r.splice(i,3),i-=3,Nf(y,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function xo(r){function i(R){return tc(R,r)}Ca!==null&&tc(Ca,r),Ea!==null&&tc(Ea,r),Na!==null&&tc(Na,r),qs.forEach(i),Gs.forEach(i);for(var s=0;s<Aa.length;s++){var c=Aa[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Aa.length&&(s=Aa[0],s.blockedOn===null);)Wv(s),s.blockedOn===null&&Aa.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],y=s[c+1],k=p[wn]||null;if(typeof y=="function")k||t0(s);else if(k){var _=null;if(y&&y.hasAttribute("formAction")){if(p=y,k=y[wn]||null)_=k.formAction;else if(Ah(p)!==null)continue}else _=k.action;typeof _=="function"?s[c+1]=_:(s.splice(c,3),c-=3),t0(s)}}}function n0(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Rh(r){this._internalRoot=r}rc.prototype.render=Rh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Vn();Gv(s,c,r,i,null,null)},rc.prototype.unmount=Rh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Gv(r.current,2,null,r,null,null),Lu(),i[Mi]=null}};function rc(r){this._internalRoot=r}rc.prototype.unstable_scheduleHydration=function(r){if(r){var i=fy();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Aa.length&&i!==0&&i<Aa[s].priority;s++);Aa.splice(s,0,r),s===0&&Wv(r)}};var r0=t.version;if(r0!=="19.2.4")throw Error(a(527,r0,"19.2.4"));K.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var wC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ac.isDisabled&&ac.supportsFiber)try{mn=ac.inject(wC),Ft=ac}catch{}}return Ks.createRoot=function(r,i){if(!o(r))throw Error(a(299));var s=!1,c="",p=cb,y=db,k=fb;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&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=Fv(r,1,!1,null,null,s,c,null,p,y,k,n0),r[Mi]=i.current,mh(r),new Rh(i)},Ks.hydrateRoot=function(r,i,s){if(!o(r))throw Error(a(299));var c=!1,p="",y=cb,k=db,_=fb,R=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(R=s.formState)),i=Fv(r,1,!0,i,s??null,c,p,R,y,k,_,n0),i.context=qv(null),s=i.current,c=Vn(),c=wd(c),p=ga(c),p.callback=null,ya(s,p,c),s=c,i.current.lanes=s,is(i,s),kr(i),r[Mi]=i.current,mh(r),new rc(i)},Ks.version="19.2.4",Ks}var h0;function OC(){if(h0)return $h.exports;h0=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(),$h.exports=AC(),$h.exports}var RC=OC();var m0="popstate";function MC(e={}){function t(a,o){let{pathname:u,search:l,hash:d}=a.location;return Pm("",{pathname:u,search:l,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(a,o){return typeof o=="string"?o:xl(o)}return $C(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DC(){return Math.random().toString(36).substring(2,10)}function p0(e,t){return{usr:e.state,key:e.key,idx:t}}function Pm(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qo(t):t,state:n,key:t&&t.key||a||DC()}}function xl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function $C(e,t,n,a={}){let{window:o=document.defaultView,v5Compat:u=!1}=a,l=o.history,d="POP",h=null,m=g();m==null&&(m=0,l.replaceState({...l.state,idx:m},""));function g(){return(l.state||{idx:null}).idx}function x(){d="POP";let E=g(),N=E==null?null:E-m;m=E,h&&h({action:d,location:T.location,delta:N})}function b(E,N){d="PUSH";let A=Pm(T.location,E,N);m=g()+1;let C=p0(A,m),$=T.createHref(A);try{l.pushState(C,"",$)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign($)}u&&h&&h({action:d,location:T.location,delta:1})}function v(E,N){d="REPLACE";let A=Pm(T.location,E,N);m=g();let C=p0(A,m),$=T.createHref(A);l.replaceState(C,"",$),u&&h&&h({action:d,location:T.location,delta:0})}function z(E){return LC(E)}let T={get action(){return d},get location(){return e(o,l)},listen(E){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(m0,x),h=E,()=>{o.removeEventListener(m0,x),h=null}},createHref(E){return t(o,E)},createURL:z,encodeLocation(E){let N=z(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:v,go(E){return l.go(E)}};return T}function LC(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:xl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function Zw(e,t,n="/"){return PC(e,t,n,!1)}function PC(e,t,n,a){let o=typeof t=="string"?qo(t):t,u=oa(o.pathname||"/",n);if(u==null)return null;let l=Iw(e);UC(l);let d=null;for(let h=0;d==null&&h<l.length;++h){let m=KC(u);d=YC(l[h],m,a)}return d}function Iw(e,t=[],n=[],a="",o=!1){let u=(l,d,h=o,m)=>{let g={relativePath:m===void 0?l.path||"":m,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;xt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let x=aa([a,g.relativePath]),b=n.concat(g);l.children&&l.children.length>0&&(xt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Iw(l.children,t,b,x,h)),!(l.path==null&&!l.index)&&t.push({path:x,score:qC(x,l.index),routesMeta:b})};return e.forEach((l,d)=>{if(l.path===""||!l.path?.includes("?"))u(l,d);else for(let h of Hw(l.path))u(l,d,!0,h)}),t}function Hw(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,o=n.endsWith("?"),u=n.replace(/\?$/,"");if(a.length===0)return o?[u,""]:[u];let l=Hw(a.join("/")),d=[];return d.push(...l.map(h=>h===""?u:[u,h].join("/"))),o&&d.push(...l),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function UC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GC(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var VC=/^:[\w-]+$/,BC=3,ZC=2,IC=1,HC=10,FC=-2,g0=e=>e==="*";function qC(e,t){let n=e.split("/"),a=n.length;return n.some(g0)&&(a+=FC),t&&(a+=ZC),n.filter(o=>!g0(o)).reduce((o,u)=>o+(VC.test(u)?BC:u===""?IC:HC),a)}function GC(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function YC(e,t,n=!1){let{routesMeta:a}=e,o={},u="/",l=[];for(let d=0;d<a.length;++d){let h=a[d],m=d===a.length-1,g=u==="/"?t:t.slice(u.length)||"/",x=Dc({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),b=h.route;if(!x&&m&&n&&!a[a.length-1].route.index&&(x=Dc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!x)return null;Object.assign(o,x.params),l.push({params:o,pathname:aa([u,x.pathname]),pathnameBase:eE(aa([u,x.pathnameBase])),route:b}),x.pathnameBase!=="/"&&(u=aa([u,x.pathnameBase]))}return l}function Dc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=XC(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let u=o[0],l=u.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:x},b)=>{if(g==="*"){let z=d[b]||"";l=u.slice(0,u.length-z.length).replace(/(.)\/+$/,"$1")}const v=d[b];return x&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function XC(e,t=!1,n=!0){gr(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,h)=>(a.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function KC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return gr(!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 oa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var JC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function QC(e,t="/"){let{pathname:n,search:a="",hash:o=""}=typeof e=="string"?qo(e):e,u;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?u=y0(n.substring(1),"/"):u=y0(n,t)):u=t,{pathname:u,search:tE(a),hash:nE(o)}}function y0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Vh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function WC(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ip(e){let t=WC(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Hp(e,t,n,a=!1){let o;typeof e=="string"?o=qo(e):(o={...e},xt(!o.pathname||!o.pathname.includes("?"),Vh("?","pathname","search",o)),xt(!o.pathname||!o.pathname.includes("#"),Vh("#","pathname","hash",o)),xt(!o.search||!o.search.includes("#"),Vh("#","search","hash",o)));let u=e===""||o.pathname==="",l=u?"/":o.pathname,d;if(l==null)d=n;else{let x=t.length-1;if(!a&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),x-=1;o.pathname=b.join("/")}d=x>=0?t[x]:"/"}let h=QC(o,d),m=l&&l!=="/"&&l.endsWith("/"),g=(u||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var aa=e=>e.join("/").replace(/\/\/+/g,"/"),eE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rE=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function aE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function iE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Fw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qw(e,t){let n=e;if(typeof n!="string"||!JC.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,o=!1;if(Fw)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),d=oa(l.pathname,t);l.origin===u.origin&&d!=null?n=d+l.search+l.hash:o=!0}catch{gr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Gw=["POST","PUT","PATCH","DELETE"];new Set(Gw);var oE=["GET",...Gw];new Set(oE);var Go=j.createContext(null);Go.displayName="DataRouter";var nd=j.createContext(null);nd.displayName="DataRouterState";var sE=j.createContext(!1),Yw=j.createContext({isTransitioning:!1});Yw.displayName="ViewTransition";var lE=j.createContext(new Map);lE.displayName="Fetchers";var uE=j.createContext(null);uE.displayName="Await";var Hn=j.createContext(null);Hn.displayName="Navigation";var Rl=j.createContext(null);Rl.displayName="Location";var Mr=j.createContext({outlet:null,matches:[],isDataRoute:!1});Mr.displayName="Route";var Fp=j.createContext(null);Fp.displayName="RouteError";var Xw="REACT_ROUTER_ERROR",cE="REDIRECT",dE="ROUTE_ERROR_RESPONSE";function fE(e){if(e.startsWith(`${Xw}:${cE}:{`))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 hE(e){if(e.startsWith(`${Xw}:${dE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rE(t.status,t.statusText,t.data)}catch{}}function mE(e,{relative:t}={}){xt(Yo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=j.useContext(Hn),{hash:o,pathname:u,search:l}=Ml(e,{relative:t}),d=u;return n!=="/"&&(d=u==="/"?n:aa([n,u])),a.createHref({pathname:d,search:l,hash:o})}function Yo(){return j.useContext(Rl)!=null}function yr(){return xt(Yo(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Rl).location}var Kw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jw(e){j.useContext(Hn).static||j.useLayoutEffect(e)}function qp(){let{isDataRoute:e}=j.useContext(Mr);return e?TE():pE()}function pE(){xt(Yo(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Go),{basename:t,navigator:n}=j.useContext(Hn),{matches:a}=j.useContext(Mr),{pathname:o}=yr(),u=JSON.stringify(Ip(a)),l=j.useRef(!1);return Jw(()=>{l.current=!0}),j.useCallback((h,m={})=>{if(gr(l.current,Kw),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=Hp(h,JSON.parse(u),o,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:aa([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,u,o,e])}j.createContext(null);function Ml(e,{relative:t}={}){let{matches:n}=j.useContext(Mr),{pathname:a}=yr(),o=JSON.stringify(Ip(n));return j.useMemo(()=>Hp(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function gE(e,t){return Qw(e,t)}function Qw(e,t,n,a,o){xt(Yo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(Hn),{matches:l}=j.useContext(Mr),d=l[l.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",x=d&&d.route;{let A=x&&x.path||"";eS(m,!x||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${A}">) 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.
8
+ `+c.stack}}var Qe=Object.prototype.hasOwnProperty,Xt=e.unstable_scheduleCallback,qn=e.unstable_cancelCallback,At=e.unstable_shouldYield,Ht=e.unstable_requestPaint,ft=e.unstable_now,Ri=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,ue=e.unstable_UserBlockingPriority,be=e.unstable_NormalPriority,je=e.unstable_LowPriority,Be=e.unstable_IdlePriority,hn=e.log,Rn=e.unstable_setDisableYieldValue,mn=null,Ft=null;function kn(r){if(typeof hn=="function"&&Rn(r),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(mn,r)}catch{}}var at=Math.clz32?Math.clz32:cj,la=Math.log,cr=Math.LN2;function cj(r){return r>>>=0,r===0?32:31-(la(r)/cr|0)|0}var Hl=256,Fl=262144,ql=4194304;function Qa(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Gl(r,i,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var _=c&134217727;return _!==0?(c=_&~y,c!==0?p=Qa(c):(k&=_,k!==0?p=Qa(k):s||(s=_&~r,s!==0&&(p=Qa(s))))):(_=c&~y,_!==0?p=Qa(_):k!==0?p=Qa(k):s||(s=c&~r,s!==0&&(p=Qa(s)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,s=i&-i,y>=s||y===32&&(s&4194048)!==0)?i:p}function is(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function dj(r,i){switch(r){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 ly(){var r=ql;return ql<<=1,(ql&62914560)===0&&(ql=4194304),r}function kd(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function os(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function fj(r,i,s,c,p,y){var k=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var _=r.entanglements,R=r.expirationTimes,I=r.hiddenUpdates;for(s=k&~s;0<s;){var J=31-at(s),re=1<<J;_[J]=0,R[J]=-1;var F=I[J];if(F!==null)for(I[J]=null,J=0;J<F.length;J++){var Y=F[J];Y!==null&&(Y.lane&=-536870913)}s&=~re}c!==0&&uy(r,c,0),y!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function uy(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-at(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function cy(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var c=31-at(s),p=1<<c;p&i|r[c]&i&&(r[c]|=i),s&=~p}}function dy(r,i){var s=i&-i;return s=(s&42)!==0?1:wd(s),(s&(r.suspendedLanes|i))!==0?0:s}function wd(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Sd(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function fy(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:Jv(r.type))}function hy(r,i){var s=K.p;try{return K.p=r,i()}finally{K.p=s}}var ua=Math.random().toString(36).slice(2),Wt="__reactFiber$"+ua,wn="__reactProps$"+ua,Mi="__reactContainer$"+ua,zd="__reactEvents$"+ua,hj="__reactListeners$"+ua,mj="__reactHandles$"+ua,my="__reactResources$"+ua,ss="__reactMarker$"+ua;function _d(r){delete r[Wt],delete r[wn],delete r[zd],delete r[hj],delete r[mj]}function Di(r){var i=r[Wt];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Mi]||s[Wt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Dv(r);r!==null;){if(s=r[Wt])return s;r=Dv(r)}return i}r=s,s=r.parentNode}return null}function $i(r){if(r=r[Wt]||r[Mi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ls(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Li(r){var i=r[my];return i||(i=r[my]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Kt(r){r[ss]=!0}var py=new Set,gy={};function Wa(r,i){Pi(r,i),Pi(r+"Capture",i)}function Pi(r,i){for(gy[r]=i,r=0;r<i.length;r++)py.add(i[r])}var pj=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]*$"),yy={},xy={};function gj(r){return Qe.call(xy,r)?!0:Qe.call(yy,r)?!1:pj.test(r)?xy[r]=!0:(yy[r]=!0,!1)}function Yl(r,i,s){if(gj(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Xl(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function $r(r,i,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+c)}}function Gn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function by(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function yj(r,i,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(k){s=""+k,y.call(this,k)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function jd(r){if(!r._valueTracker){var i=by(r)?"checked":"value";r._valueTracker=yj(r,i,""+r[i])}}function vy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return r&&(c=by(r)?r.checked?"true":"false":r.value),r=c,r!==s?(i.setValue(r),!0):!1}function Kl(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var xj=/[\n"\\]/g;function Yn(r){return r.replace(xj,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Td(r,i,s,c,p,y,k,_){r.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.type=k:r.removeAttribute("type"),i!=null?k==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Gn(i)):r.value!==""+Gn(i)&&(r.value=""+Gn(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?Cd(r,k,Gn(i)):s!=null?Cd(r,k,Gn(s)):c!=null&&r.removeAttribute("value"),p==null&&y!=null&&(r.defaultChecked=!!y),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+Gn(_):r.removeAttribute("name")}function ky(r,i,s,c,p,y,k,_){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){jd(r);return}s=s!=null?""+Gn(s):"",i=i!=null?""+Gn(i):s,_||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=_?r.checked:!!c,r.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),jd(r)}function Cd(r,i,s){i==="number"&&Kl(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ui(r,i,s,c){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&c&&(r[s].defaultSelected=!0)}else{for(s=""+Gn(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function wy(r,i,s){if(i!=null&&(i=""+Gn(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+Gn(s):""}function Sy(r,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(ae(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=Gn(i),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),jd(r)}function Vi(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var bj=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 zy(r,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,s):typeof s!="number"||s===0||bj.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function _y(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&zy(r,p,c)}else for(var y in i)i.hasOwnProperty(y)&&zy(r,y,i[y])}function Ed(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vj=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"]]),kj=/^[\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 Jl(r){return kj.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Lr(){}var Nd=null;function Ad(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Bi=null,Zi=null;function jy(r){var i=$i(r);if(i&&(r=i.stateNode)){var s=r[wn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Td(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Yn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==r&&c.form===r.form){var p=c[wn]||null;if(!p)throw Error(a(90));Td(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===r.form&&vy(c)}break e;case"textarea":wy(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ui(r,!!s.multiple,i,!1)}}}var Od=!1;function Ty(r,i,s){if(Od)return r(i,s);Od=!0;try{var c=r(i);return c}finally{if(Od=!1,(Bi!==null||Zi!==null)&&(Pu(),Bi&&(i=Bi,r=Zi,Zi=Bi=null,jy(i),r)))for(i=0;i<r.length;i++)jy(r[i])}}function us(r,i){var s=r.stateNode;if(s===null)return null;var c=s[wn]||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)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rd=!1;if(Pr)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){Rd=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{Rd=!1}var ca=null,Md=null,Ql=null;function Cy(){if(Ql)return Ql;var r,i=Md,s=i.length,c,p="value"in ca?ca.value:ca.textContent,y=p.length;for(r=0;r<s&&i[r]===p[r];r++);var k=s-r;for(c=1;c<=k&&i[s-c]===p[y-c];c++);return Ql=p.slice(r,1<c?1-c:void 0)}function Wl(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function eu(){return!0}function Ey(){return!1}function Sn(r){function i(s,c,p,y,k){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(s=r[_],this[_]=s?s(y):y[_]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?eu:Ey,this.isPropagationStopped=Ey,this}return x(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=eu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=eu)},persist:function(){},isPersistent:eu}),i}var ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tu=Sn(ei),ds=x({},ei,{view:0,detail:0}),wj=Sn(ds),Dd,$d,fs,nu=x({},ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==fs&&(fs&&r.type==="mousemove"?(Dd=r.screenX-fs.screenX,$d=r.screenY-fs.screenY):$d=Dd=0,fs=r),Dd)},movementY:function(r){return"movementY"in r?r.movementY:$d}}),Ny=Sn(nu),Sj=x({},nu,{dataTransfer:0}),zj=Sn(Sj),_j=x({},ds,{relatedTarget:0}),Ld=Sn(_j),jj=x({},ei,{animationName:0,elapsedTime:0,pseudoElement:0}),Tj=Sn(jj),Cj=x({},ei,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Ej=Sn(Cj),Nj=x({},ei,{data:0}),Ay=Sn(Nj),Aj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oj={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"},Rj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mj(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Rj[r])?!!i[r]:!1}function Pd(){return Mj}var Dj=x({},ds,{key:function(r){if(r.key){var i=Aj[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Wl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Oj[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pd,charCode:function(r){return r.type==="keypress"?Wl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Wl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),$j=Sn(Dj),Lj=x({},nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Oy=Sn(Lj),Pj=x({},ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pd}),Uj=Sn(Pj),Vj=x({},ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bj=Sn(Vj),Zj=x({},nu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Ij=Sn(Zj),Hj=x({},ei,{newState:0,oldState:0}),Fj=Sn(Hj),qj=[9,13,27,32],Ud=Pr&&"CompositionEvent"in window,hs=null;Pr&&"documentMode"in document&&(hs=document.documentMode);var Gj=Pr&&"TextEvent"in window&&!hs,Ry=Pr&&(!Ud||hs&&8<hs&&11>=hs),My=" ",Dy=!1;function $y(r,i){switch(r){case"keyup":return qj.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ly(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ii=!1;function Yj(r,i){switch(r){case"compositionend":return Ly(i);case"keypress":return i.which!==32?null:(Dy=!0,My);case"textInput":return r=i.data,r===My&&Dy?null:r;default:return null}}function Xj(r,i){if(Ii)return r==="compositionend"||!Ud&&$y(r,i)?(r=Cy(),Ql=Md=ca=null,Ii=!1,r):null;switch(r){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 Ry&&i.locale!=="ko"?null:i.data;default:return null}}var Kj={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 Py(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!Kj[r.type]:i==="textarea"}function Uy(r,i,s,c){Bi?Zi?Zi.push(c):Zi=[c]:Bi=c,i=Fu(i,"onChange"),0<i.length&&(s=new tu("onChange","change",null,s,c),r.push({event:s,listeners:i}))}var ms=null,ps=null;function Jj(r){kv(r,0)}function ru(r){var i=ls(r);if(vy(i))return r}function Vy(r,i){if(r==="change")return i}var By=!1;if(Pr){var Vd;if(Pr){var Bd="oninput"in document;if(!Bd){var Zy=document.createElement("div");Zy.setAttribute("oninput","return;"),Bd=typeof Zy.oninput=="function"}Vd=Bd}else Vd=!1;By=Vd&&(!document.documentMode||9<document.documentMode)}function Iy(){ms&&(ms.detachEvent("onpropertychange",Hy),ps=ms=null)}function Hy(r){if(r.propertyName==="value"&&ru(ps)){var i=[];Uy(i,ps,r,Ad(r)),Ty(Jj,i)}}function Qj(r,i,s){r==="focusin"?(Iy(),ms=i,ps=s,ms.attachEvent("onpropertychange",Hy)):r==="focusout"&&Iy()}function Wj(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ru(ps)}function eT(r,i){if(r==="click")return ru(i)}function tT(r,i){if(r==="input"||r==="change")return ru(i)}function nT(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Mn=typeof Object.is=="function"?Object.is:nT;function gs(r,i){if(Mn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Qe.call(i,p)||!Mn(r[p],i[p]))return!1}return!0}function Fy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function qy(r,i){var s=Fy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=i&&c>=i)return{node:s,offset:i-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fy(s)}}function Gy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Gy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Yy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Kl(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=Kl(r.document)}return i}function Zd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var rT=Pr&&"documentMode"in document&&11>=document.documentMode,Hi=null,Id=null,ys=null,Hd=!1;function Xy(r,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Hd||Hi==null||Hi!==Kl(c)||(c=Hi,"selectionStart"in c&&Zd(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}),ys&&gs(ys,c)||(ys=c,c=Fu(Id,"onSelect"),0<c.length&&(i=new tu("onSelect","select",null,i,s),r.push({event:i,listeners:c}),i.target=Hi)))}function ti(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Fi={animationend:ti("Animation","AnimationEnd"),animationiteration:ti("Animation","AnimationIteration"),animationstart:ti("Animation","AnimationStart"),transitionrun:ti("Transition","TransitionRun"),transitionstart:ti("Transition","TransitionStart"),transitioncancel:ti("Transition","TransitionCancel"),transitionend:ti("Transition","TransitionEnd")},Fd={},Ky={};Pr&&(Ky=document.createElement("div").style,"AnimationEvent"in window||(delete Fi.animationend.animation,delete Fi.animationiteration.animation,delete Fi.animationstart.animation),"TransitionEvent"in window||delete Fi.transitionend.transition);function ni(r){if(Fd[r])return Fd[r];if(!Fi[r])return r;var i=Fi[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Ky)return Fd[r]=i[s];return r}var Jy=ni("animationend"),Qy=ni("animationiteration"),Wy=ni("animationstart"),aT=ni("transitionrun"),iT=ni("transitionstart"),oT=ni("transitioncancel"),ex=ni("transitionend"),tx=new Map,qd="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(" ");qd.push("scrollEnd");function dr(r,i){tx.set(r,i),Wa(i,[r])}var au=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Xn=[],qi=0,Gd=0;function iu(){for(var r=qi,i=Gd=qi=0;i<r;){var s=Xn[i];Xn[i++]=null;var c=Xn[i];Xn[i++]=null;var p=Xn[i];Xn[i++]=null;var y=Xn[i];if(Xn[i++]=null,c!==null&&p!==null){var k=c.pending;k===null?p.next=p:(p.next=k.next,k.next=p),c.pending=p}y!==0&&nx(s,p,y)}}function ou(r,i,s,c){Xn[qi++]=r,Xn[qi++]=i,Xn[qi++]=s,Xn[qi++]=c,Gd|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Yd(r,i,s,c){return ou(r,i,s,c),su(r)}function ri(r,i){return ou(r,null,null,i),su(r)}function nx(r,i,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,y=r.return;y!==null;)y.childLanes|=s,c=y.alternate,c!==null&&(c.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(p=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,p&&i!==null&&(p=31-at(s),r=y.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=s|536870912),y):null}function su(r){if(50<Us)throw Us=0,ah=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Gi={};function sT(r,i,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=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 Dn(r,i,s,c){return new sT(r,i,s,c)}function Xd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ur(r,i){var s=r.alternate;return s===null?(s=Dn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function rx(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function lu(r,i,s,c,p,y){var k=0;if(c=r,typeof r=="function")Xd(r)&&(k=1);else if(typeof r=="string")k=fC(r,s,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=Dn(31,s,i,p),r.elementType=X,r.lanes=y,r;case T:return ai(s.children,p,y,i);case E:k=8,p|=24;break;case N:return r=Dn(12,s,i,p|2),r.elementType=N,r.lanes=y,r;case L:return r=Dn(13,s,i,p),r.elementType=L,r.lanes=y,r;case M:return r=Dn(19,s,i,p),r.elementType=M,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:k=10;break e;case A:k=9;break e;case $:k=11;break e;case q:k=14;break e;case V:k=16,c=null;break e}k=29,s=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Dn(k,s,i,p),i.elementType=r,i.type=c,i.lanes=y,i}function ai(r,i,s,c){return r=Dn(7,r,c,i),r.lanes=s,r}function Kd(r,i,s){return r=Dn(6,r,null,i),r.lanes=s,r}function ax(r){var i=Dn(18,null,null,0);return i.stateNode=r,i}function Jd(r,i,s){return i=Dn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var ix=new WeakMap;function Kn(r,i){if(typeof r=="object"&&r!==null){var s=ix.get(r);return s!==void 0?s:(i={value:r,source:i,stack:dt(i)},ix.set(r,i),i)}return{value:r,source:i,stack:dt(i)}}var Yi=[],Xi=0,uu=null,xs=0,Jn=[],Qn=0,da=null,xr=1,br="";function Vr(r,i){Yi[Xi++]=xs,Yi[Xi++]=uu,uu=r,xs=i}function ox(r,i,s){Jn[Qn++]=xr,Jn[Qn++]=br,Jn[Qn++]=da,da=r;var c=xr;r=br;var p=32-at(c)-1;c&=~(1<<p),s+=1;var y=32-at(i)+p;if(30<y){var k=p-p%5;y=(c&(1<<k)-1).toString(32),c>>=k,p-=k,xr=1<<32-at(i)+p|s<<p|c,br=y+r}else xr=1<<y|s<<p|c,br=r}function Qd(r){r.return!==null&&(Vr(r,1),ox(r,1,0))}function Wd(r){for(;r===uu;)uu=Yi[--Xi],Yi[Xi]=null,xs=Yi[--Xi],Yi[Xi]=null;for(;r===da;)da=Jn[--Qn],Jn[Qn]=null,br=Jn[--Qn],Jn[Qn]=null,xr=Jn[--Qn],Jn[Qn]=null}function sx(r,i){Jn[Qn++]=xr,Jn[Qn++]=br,Jn[Qn++]=da,xr=i.id,br=i.overflow,da=r}var en=null,ht=null,Ve=!1,fa=null,Wn=!1,ef=Error(a(519));function ha(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bs(Kn(i,r)),ef}function lx(r){var i=r.stateNode,s=r.type,c=r.memoizedProps;switch(i[Wt]=r,i[wn]=c,s){case"dialog":Le("cancel",i),Le("close",i);break;case"iframe":case"object":case"embed":Le("load",i);break;case"video":case"audio":for(s=0;s<Bs.length;s++)Le(Bs[s],i);break;case"source":Le("error",i);break;case"img":case"image":case"link":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"input":Le("invalid",i),ky(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Le("invalid",i);break;case"textarea":Le("invalid",i),Sy(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||_v(i.textContent,s)?(c.popover!=null&&(Le("beforetoggle",i),Le("toggle",i)),c.onScroll!=null&&Le("scroll",i),c.onScrollEnd!=null&&Le("scrollend",i),c.onClick!=null&&(i.onclick=Lr),i=!0):i=!1,i||ha(r,!0)}function ux(r){for(en=r.return;en;)switch(en.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:en=en.return}}function Ki(r){if(r!==en)return!1;if(!Ve)return ux(r),Ve=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||bh(r.type,r.memoizedProps)),s=!s),s&&ht&&ha(r),ux(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));ht=Mv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));ht=Mv(r)}else i===27?(i=ht,Ta(r.type)?(r=zh,zh=null,ht=r):ht=i):ht=en?tr(r.stateNode.nextSibling):null;return!0}function ii(){ht=en=null,Ve=!1}function tf(){var r=fa;return r!==null&&(Tn===null?Tn=r:Tn.push.apply(Tn,r),fa=null),r}function bs(r){fa===null?fa=[r]:fa.push(r)}var nf=S(null),oi=null,Br=null;function ma(r,i,s){w(nf,i._currentValue),i._currentValue=s}function Zr(r){r._currentValue=nf.current,H(nf)}function rf(r,i,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===s)break;r=r.return}}function af(r,i,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var y=p.dependencies;if(y!==null){var k=p.child;y=y.firstContext;e:for(;y!==null;){var _=y;y=p;for(var R=0;R<i.length;R++)if(_.context===i[R]){y.lanes|=s,_=y.alternate,_!==null&&(_.lanes|=s),rf(y.return,s,r),c||(k=null);break e}y=_.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(a(341));k.lanes|=s,y=k.alternate,y!==null&&(y.lanes|=s),rf(k,s,r),k=null}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===r){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function Ji(r,i,s,c){r=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(a(387));if(k=k.memoizedProps,k!==null){var _=p.type;Mn(p.pendingProps.value,k.value)||(r!==null?r.push(_):r=[_])}}else if(p===me.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(qs):r=[qs])}p=p.return}r!==null&&af(i,r,s,c),i.flags|=262144}function cu(r){for(r=r.firstContext;r!==null;){if(!Mn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function si(r){oi=r,Br=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function tn(r){return cx(oi,r)}function du(r,i){return oi===null&&si(r),cx(r,i)}function cx(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Br===null){if(r===null)throw Error(a(308));Br=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Br=Br.next=i;return s}var lT=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},uT=e.unstable_scheduleCallback,cT=e.unstable_NormalPriority,Mt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function of(){return{controller:new lT,data:new Map,refCount:0}}function vs(r){r.refCount--,r.refCount===0&&uT(cT,function(){r.controller.abort()})}var ks=null,sf=0,Qi=0,Wi=null;function dT(r,i){if(ks===null){var s=ks=[];sf=0,Qi=ch(),Wi={status:"pending",value:void 0,then:function(c){s.push(c)}}}return sf++,i.then(dx,dx),i}function dx(){if(--sf===0&&ks!==null){Wi!==null&&(Wi.status="fulfilled");var r=ks;ks=null,Qi=0,Wi=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function fT(r,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.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 fx=U.S;U.S=function(r,i){Xb=ft(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&dT(r,i),fx!==null&&fx(r,i)};var li=S(null);function lf(){var r=li.current;return r!==null?r:it.pooledCache}function fu(r,i){i===null?w(li,li.current):w(li,i.pool)}function hx(){var r=lf();return r===null?null:{parent:Mt._currentValue,pool:r}}var eo=Error(a(460)),uf=Error(a(474)),hu=Error(a(542)),mu={then:function(){}};function mx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function px(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(Lr,Lr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,yx(r),r;default:if(typeof i.status=="string")i.then(Lr,Lr);else{if(r=it,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.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 r=i.reason,yx(r),r}throw ci=i,eo}}function ui(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ci=s,eo):s}}var ci=null;function gx(){if(ci===null)throw Error(a(459));var r=ci;return ci=null,r}function yx(r){if(r===eo||r===hu)throw Error(a(483))}var to=null,ws=0;function pu(r){var i=ws;return ws+=1,to===null&&(to=[]),px(to,r,i)}function Ss(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function gu(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function xx(r){function i(P,D){if(r){var Z=P.deletions;Z===null?(P.deletions=[D],P.flags|=16):Z.push(D)}}function s(P,D){if(!r)return null;for(;D!==null;)i(P,D),D=D.sibling;return null}function c(P){for(var D=new Map;P!==null;)P.key!==null?D.set(P.key,P):D.set(P.index,P),P=P.sibling;return D}function p(P,D){return P=Ur(P,D),P.index=0,P.sibling=null,P}function y(P,D,Z){return P.index=Z,r?(Z=P.alternate,Z!==null?(Z=Z.index,Z<D?(P.flags|=67108866,D):Z):(P.flags|=67108866,D)):(P.flags|=1048576,D)}function k(P){return r&&P.alternate===null&&(P.flags|=67108866),P}function _(P,D,Z,ne){return D===null||D.tag!==6?(D=Kd(Z,P.mode,ne),D.return=P,D):(D=p(D,Z),D.return=P,D)}function R(P,D,Z,ne){var Se=Z.type;return Se===T?J(P,D,Z.props.children,ne,Z.key):D!==null&&(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&ui(Se)===D.type)?(D=p(D,Z.props),Ss(D,Z),D.return=P,D):(D=lu(Z.type,Z.key,Z.props,null,P.mode,ne),Ss(D,Z),D.return=P,D)}function I(P,D,Z,ne){return D===null||D.tag!==4||D.stateNode.containerInfo!==Z.containerInfo||D.stateNode.implementation!==Z.implementation?(D=Jd(Z,P.mode,ne),D.return=P,D):(D=p(D,Z.children||[]),D.return=P,D)}function J(P,D,Z,ne,Se){return D===null||D.tag!==7?(D=ai(Z,P.mode,ne,Se),D.return=P,D):(D=p(D,Z),D.return=P,D)}function re(P,D,Z){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=Kd(""+D,P.mode,Z),D.return=P,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case v:return Z=lu(D.type,D.key,D.props,null,P.mode,Z),Ss(Z,D),Z.return=P,Z;case z:return D=Jd(D,P.mode,Z),D.return=P,D;case V:return D=ui(D),re(P,D,Z)}if(ae(D)||se(D))return D=ai(D,P.mode,Z,null),D.return=P,D;if(typeof D.then=="function")return re(P,pu(D),Z);if(D.$$typeof===C)return re(P,du(P,D),Z);gu(P,D)}return null}function F(P,D,Z,ne){var Se=D!==null?D.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Se!==null?null:_(P,D,""+Z,ne);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return Z.key===Se?R(P,D,Z,ne):null;case z:return Z.key===Se?I(P,D,Z,ne):null;case V:return Z=ui(Z),F(P,D,Z,ne)}if(ae(Z)||se(Z))return Se!==null?null:J(P,D,Z,ne,null);if(typeof Z.then=="function")return F(P,D,pu(Z),ne);if(Z.$$typeof===C)return F(P,D,du(P,Z),ne);gu(P,Z)}return null}function Y(P,D,Z,ne,Se){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return P=P.get(Z)||null,_(D,P,""+ne,Se);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return P=P.get(ne.key===null?Z:ne.key)||null,R(D,P,ne,Se);case z:return P=P.get(ne.key===null?Z:ne.key)||null,I(D,P,ne,Se);case V:return ne=ui(ne),Y(P,D,Z,ne,Se)}if(ae(ne)||se(ne))return P=P.get(Z)||null,J(D,P,ne,Se,null);if(typeof ne.then=="function")return Y(P,D,Z,pu(ne),Se);if(ne.$$typeof===C)return Y(P,D,Z,du(D,ne),Se);gu(D,ne)}return null}function pe(P,D,Z,ne){for(var Se=null,He=null,ve=D,Oe=D=0,Ue=null;ve!==null&&Oe<Z.length;Oe++){ve.index>Oe?(Ue=ve,ve=null):Ue=ve.sibling;var Fe=F(P,ve,Z[Oe],ne);if(Fe===null){ve===null&&(ve=Ue);break}r&&ve&&Fe.alternate===null&&i(P,ve),D=y(Fe,D,Oe),He===null?Se=Fe:He.sibling=Fe,He=Fe,ve=Ue}if(Oe===Z.length)return s(P,ve),Ve&&Vr(P,Oe),Se;if(ve===null){for(;Oe<Z.length;Oe++)ve=re(P,Z[Oe],ne),ve!==null&&(D=y(ve,D,Oe),He===null?Se=ve:He.sibling=ve,He=ve);return Ve&&Vr(P,Oe),Se}for(ve=c(ve);Oe<Z.length;Oe++)Ue=Y(ve,P,Oe,Z[Oe],ne),Ue!==null&&(r&&Ue.alternate!==null&&ve.delete(Ue.key===null?Oe:Ue.key),D=y(Ue,D,Oe),He===null?Se=Ue:He.sibling=Ue,He=Ue);return r&&ve.forEach(function(Oa){return i(P,Oa)}),Ve&&Vr(P,Oe),Se}function _e(P,D,Z,ne){if(Z==null)throw Error(a(151));for(var Se=null,He=null,ve=D,Oe=D=0,Ue=null,Fe=Z.next();ve!==null&&!Fe.done;Oe++,Fe=Z.next()){ve.index>Oe?(Ue=ve,ve=null):Ue=ve.sibling;var Oa=F(P,ve,Fe.value,ne);if(Oa===null){ve===null&&(ve=Ue);break}r&&ve&&Oa.alternate===null&&i(P,ve),D=y(Oa,D,Oe),He===null?Se=Oa:He.sibling=Oa,He=Oa,ve=Ue}if(Fe.done)return s(P,ve),Ve&&Vr(P,Oe),Se;if(ve===null){for(;!Fe.done;Oe++,Fe=Z.next())Fe=re(P,Fe.value,ne),Fe!==null&&(D=y(Fe,D,Oe),He===null?Se=Fe:He.sibling=Fe,He=Fe);return Ve&&Vr(P,Oe),Se}for(ve=c(ve);!Fe.done;Oe++,Fe=Z.next())Fe=Y(ve,P,Oe,Fe.value,ne),Fe!==null&&(r&&Fe.alternate!==null&&ve.delete(Fe.key===null?Oe:Fe.key),D=y(Fe,D,Oe),He===null?Se=Fe:He.sibling=Fe,He=Fe);return r&&ve.forEach(function(SC){return i(P,SC)}),Ve&&Vr(P,Oe),Se}function tt(P,D,Z,ne){if(typeof Z=="object"&&Z!==null&&Z.type===T&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:e:{for(var Se=Z.key;D!==null;){if(D.key===Se){if(Se=Z.type,Se===T){if(D.tag===7){s(P,D.sibling),ne=p(D,Z.props.children),ne.return=P,P=ne;break e}}else if(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&ui(Se)===D.type){s(P,D.sibling),ne=p(D,Z.props),Ss(ne,Z),ne.return=P,P=ne;break e}s(P,D);break}else i(P,D);D=D.sibling}Z.type===T?(ne=ai(Z.props.children,P.mode,ne,Z.key),ne.return=P,P=ne):(ne=lu(Z.type,Z.key,Z.props,null,P.mode,ne),Ss(ne,Z),ne.return=P,P=ne)}return k(P);case z:e:{for(Se=Z.key;D!==null;){if(D.key===Se)if(D.tag===4&&D.stateNode.containerInfo===Z.containerInfo&&D.stateNode.implementation===Z.implementation){s(P,D.sibling),ne=p(D,Z.children||[]),ne.return=P,P=ne;break e}else{s(P,D);break}else i(P,D);D=D.sibling}ne=Jd(Z,P.mode,ne),ne.return=P,P=ne}return k(P);case V:return Z=ui(Z),tt(P,D,Z,ne)}if(ae(Z))return pe(P,D,Z,ne);if(se(Z)){if(Se=se(Z),typeof Se!="function")throw Error(a(150));return Z=Se.call(Z),_e(P,D,Z,ne)}if(typeof Z.then=="function")return tt(P,D,pu(Z),ne);if(Z.$$typeof===C)return tt(P,D,du(P,Z),ne);gu(P,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,D!==null&&D.tag===6?(s(P,D.sibling),ne=p(D,Z),ne.return=P,P=ne):(s(P,D),ne=Kd(Z,P.mode,ne),ne.return=P,P=ne),k(P)):s(P,D)}return function(P,D,Z,ne){try{ws=0;var Se=tt(P,D,Z,ne);return to=null,Se}catch(ve){if(ve===eo||ve===hu)throw ve;var He=Dn(29,ve,null,P.mode);return He.lanes=ne,He.return=P,He}}}var di=xx(!0),bx=xx(!1),pa=!1;function cf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function df(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ga(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ya(r,i,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(qe&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=su(r),nx(r,null,s),i}return ou(r,c,i,s),su(r)}function zs(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,cy(r,s)}}function ff(r,i){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=k:y=y.next=k,s=s.next}while(s!==null);y===null?p=y=i:y=y.next=i}else p=y=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var hf=!1;function _s(){if(hf){var r=Wi;if(r!==null)throw r}}function js(r,i,s,c){hf=!1;var p=r.updateQueue;pa=!1;var y=p.firstBaseUpdate,k=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var R=_,I=R.next;R.next=null,k===null?y=I:k.next=I,k=R;var J=r.alternate;J!==null&&(J=J.updateQueue,_=J.lastBaseUpdate,_!==k&&(_===null?J.firstBaseUpdate=I:_.next=I,J.lastBaseUpdate=R))}if(y!==null){var re=p.baseState;k=0,J=I=R=null,_=y;do{var F=_.lane&-536870913,Y=F!==_.lane;if(Y?(Pe&F)===F:(c&F)===F){F!==0&&F===Qi&&(hf=!0),J!==null&&(J=J.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var pe=r,_e=_;F=i;var tt=s;switch(_e.tag){case 1:if(pe=_e.payload,typeof pe=="function"){re=pe.call(tt,re,F);break e}re=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=_e.payload,F=typeof pe=="function"?pe.call(tt,re,F):pe,F==null)break e;re=x({},re,F);break e;case 2:pa=!0}}F=_.callback,F!==null&&(r.flags|=64,Y&&(r.flags|=8192),Y=p.callbacks,Y===null?p.callbacks=[F]:Y.push(F))}else Y={lane:F,tag:_.tag,payload:_.payload,callback:_.callback,next:null},J===null?(I=J=Y,R=re):J=J.next=Y,k|=F;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,p.lastBaseUpdate=Y,p.shared.pending=null}}while(!0);J===null&&(R=re),p.baseState=R,p.firstBaseUpdate=I,p.lastBaseUpdate=J,y===null&&(p.shared.lanes=0),wa|=k,r.lanes=k,r.memoizedState=re}}function vx(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function kx(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)vx(s[r],i)}var no=S(null),yu=S(0);function wx(r,i){r=Jr,w(yu,r),w(no,i),Jr=r|i.baseLanes}function mf(){w(yu,Jr),w(no,no.current)}function pf(){Jr=yu.current,H(no),H(yu)}var $n=S(null),er=null;function xa(r){var i=r.alternate;w(Ot,Ot.current&1),w($n,r),er===null&&(i===null||no.current!==null||i.memoizedState!==null)&&(er=r)}function gf(r){w(Ot,Ot.current),w($n,r),er===null&&(er=r)}function Sx(r){r.tag===22?(w(Ot,Ot.current),w($n,r),er===null&&(er=r)):ba()}function ba(){w(Ot,Ot.current),w($n,$n.current)}function Ln(r){H($n),er===r&&(er=null),H(Ot)}var Ot=S(0);function xu(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||wh(s)||Sh(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===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ir=0,Ae=null,We=null,Dt=null,bu=!1,ro=!1,fi=!1,vu=0,Ts=0,ao=null,hT=0;function Ct(){throw Error(a(321))}function yf(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Mn(r[s],i[s]))return!1;return!0}function xf(r,i,s,c,p,y){return Ir=y,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,U.H=r===null||r.memoizedState===null?ob:Rf,fi=!1,y=s(c,p),fi=!1,ro&&(y=_x(i,s,c,p)),zx(r),y}function zx(r){U.H=Ns;var i=We!==null&&We.next!==null;if(Ir=0,Dt=We=Ae=null,bu=!1,Ts=0,ao=null,i)throw Error(a(300));r===null||$t||(r=r.dependencies,r!==null&&cu(r)&&($t=!0))}function _x(r,i,s,c){Ae=r;var p=0;do{if(ro&&(ao=null),Ts=0,ro=!1,25<=p)throw Error(a(301));if(p+=1,Dt=We=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}U.H=sb,y=i(s,c)}while(ro);return y}function mT(){var r=U.H,i=r.useState()[0];return i=typeof i.then=="function"?Cs(i):i,r=r.useState()[0],(We!==null?We.memoizedState:null)!==r&&(Ae.flags|=1024),i}function bf(){var r=vu!==0;return vu=0,r}function vf(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function kf(r){if(bu){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}bu=!1}Ir=0,Dt=We=Ae=null,ro=!1,Ts=vu=0,ao=null}function pn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Ae.memoizedState=Dt=r:Dt=Dt.next=r,Dt}function Rt(){if(We===null){var r=Ae.alternate;r=r!==null?r.memoizedState:null}else r=We.next;var i=Dt===null?Ae.memoizedState:Dt.next;if(i!==null)Dt=i,We=r;else{if(r===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));We=r,r={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},Dt===null?Ae.memoizedState=Dt=r:Dt=Dt.next=r}return Dt}function ku(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cs(r){var i=Ts;return Ts+=1,ao===null&&(ao=[]),r=px(ao,r,i),i=Ae,(Dt===null?i.memoizedState:Dt.next)===null&&(i=i.alternate,U.H=i===null||i.memoizedState===null?ob:Rf),r}function wu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Cs(r);if(r.$$typeof===C)return tn(r)}throw Error(a(438,String(r)))}function wf(r){var i=null,s=Ae.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Ae.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=ku(),Ae.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),c=0;c<r;c++)s[c]=ce;return i.index++,s}function Hr(r,i){return typeof i=="function"?i(r):i}function Su(r){var i=Rt();return Sf(i,We,r)}function Sf(r,i,s){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=r.baseQueue,y=c.pending;if(y!==null){if(p!==null){var k=p.next;p.next=y.next,y.next=k}i.baseQueue=p=y,c.pending=null}if(y=r.baseState,p===null)r.memoizedState=y;else{i=p.next;var _=k=null,R=null,I=i,J=!1;do{var re=I.lane&-536870913;if(re!==I.lane?(Pe&re)===re:(Ir&re)===re){var F=I.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),re===Qi&&(J=!0);else if((Ir&F)===F){I=I.next,F===Qi&&(J=!0);continue}else re={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},R===null?(_=R=re,k=y):R=R.next=re,Ae.lanes|=F,wa|=F;re=I.action,fi&&s(y,re),y=I.hasEagerState?I.eagerState:s(y,re)}else F={lane:re,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},R===null?(_=R=F,k=y):R=R.next=F,Ae.lanes|=re,wa|=re;I=I.next}while(I!==null&&I!==i);if(R===null?k=y:R.next=_,!Mn(y,r.memoizedState)&&($t=!0,J&&(s=Wi,s!==null)))throw s;r.memoizedState=y,r.baseState=k,r.baseQueue=R,c.lastRenderedState=y}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function zf(r){var i=Rt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,y=i.memoizedState;if(p!==null){s.pending=null;var k=p=p.next;do y=r(y,k.action),k=k.next;while(k!==p);Mn(y,i.memoizedState)||($t=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),s.lastRenderedState=y}return[y,c]}function jx(r,i,s){var c=Ae,p=Rt(),y=Ve;if(y){if(s===void 0)throw Error(a(407));s=s()}else s=i();var k=!Mn((We||p).memoizedState,s);if(k&&(p.memoizedState=s,$t=!0),p=p.queue,Tf(Ex.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||Dt!==null&&Dt.memoizedState.tag&1){if(c.flags|=2048,io(9,{destroy:void 0},Cx.bind(null,c,p,s,i),null),it===null)throw Error(a(349));y||(Ir&127)!==0||Tx(c,i,s)}return s}function Tx(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Ae.updateQueue,i===null?(i=ku(),Ae.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Cx(r,i,s,c){i.value=s,i.getSnapshot=c,Nx(i)&&Ax(r)}function Ex(r,i,s){return s(function(){Nx(i)&&Ax(r)})}function Nx(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Mn(r,s)}catch{return!0}}function Ax(r){var i=ri(r,2);i!==null&&Cn(i,r,2)}function _f(r){var i=pn();if(typeof r=="function"){var s=r;if(r=s(),fi){kn(!0);try{s()}finally{kn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:r},i}function Ox(r,i,s,c){return r.baseState=s,Sf(r,We,typeof c=="function"?c:Hr)}function pT(r,i,s,c,p){if(ju(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};U.T!==null?s(!0):y.isTransition=!1,c(y),s=i.pending,s===null?(y.next=i.pending=y,Rx(i,y)):(y.next=s.next,i.pending=s.next=y)}}function Rx(r,i){var s=i.action,c=i.payload,p=r.state;if(i.isTransition){var y=U.T,k={};U.T=k;try{var _=s(p,c),R=U.S;R!==null&&R(k,_),Mx(r,i,_)}catch(I){jf(r,i,I)}finally{y!==null&&k.types!==null&&(y.types=k.types),U.T=y}}else try{y=s(p,c),Mx(r,i,y)}catch(I){jf(r,i,I)}}function Mx(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Dx(r,i,c)},function(c){return jf(r,i,c)}):Dx(r,i,s)}function Dx(r,i,s){i.status="fulfilled",i.value=s,$x(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Rx(r,s)))}function jf(r,i,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,$x(i),i=i.next;while(i!==c)}r.action=null}function $x(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Lx(r,i){return i}function Px(r,i){if(Ve){var s=it.formState;if(s!==null){e:{var c=Ae;if(Ve){if(ht){t:{for(var p=ht,y=Wn;p.nodeType!==8;){if(!y){p=null;break t}if(p=tr(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){ht=tr(p.nextSibling),c=p.data==="F!";break e}}ha(c)}c=!1}c&&(i=s[0])}}return s=pn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lx,lastRenderedState:i},s.queue=c,s=rb.bind(null,Ae,c),c.dispatch=s,c=_f(!1),y=Of.bind(null,Ae,!1,c.queue),c=pn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,s=pT.bind(null,Ae,p,y,s),p.dispatch=s,c.memoizedState=r,[i,s,!1]}function Ux(r){var i=Rt();return Vx(i,We,r)}function Vx(r,i,s){if(i=Sf(r,i,Lx)[0],r=Su(Hr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Cs(i)}catch(k){throw k===eo?hu:k}else c=i;i=Rt();var p=i.queue,y=p.dispatch;return s!==i.memoizedState&&(Ae.flags|=2048,io(9,{destroy:void 0},gT.bind(null,p,s),null)),[c,y,r]}function gT(r,i){r.action=i}function Bx(r){var i=Rt(),s=We;if(s!==null)return Vx(i,s,r);Rt(),i=i.memoizedState,s=Rt();var c=s.queue.dispatch;return s.memoizedState=r,[i,c,!1]}function io(r,i,s,c){return r={tag:r,create:s,deps:c,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=ku(),Ae.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,i.lastEffect=r),r}function Zx(){return Rt().memoizedState}function zu(r,i,s,c){var p=pn();Ae.flags|=r,p.memoizedState=io(1|i,{destroy:void 0},s,c===void 0?null:c)}function _u(r,i,s,c){var p=Rt();c=c===void 0?null:c;var y=p.memoizedState.inst;We!==null&&c!==null&&yf(c,We.memoizedState.deps)?p.memoizedState=io(i,y,s,c):(Ae.flags|=r,p.memoizedState=io(1|i,y,s,c))}function Ix(r,i){zu(8390656,8,r,i)}function Tf(r,i){_u(2048,8,r,i)}function yT(r){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=ku(),Ae.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Hx(r){var i=Rt().memoizedState;return yT({ref:i,nextImpl:r}),function(){if((qe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Fx(r,i){return _u(4,2,r,i)}function qx(r,i){return _u(4,4,r,i)}function Gx(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Yx(r,i,s){s=s!=null?s.concat([r]):null,_u(4,4,Gx.bind(null,i,r),s)}function Cf(){}function Xx(r,i){var s=Rt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&yf(i,c[1])?c[0]:(s.memoizedState=[r,i],r)}function Kx(r,i){var s=Rt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&yf(i,c[1]))return c[0];if(c=r(),fi){kn(!0);try{r()}finally{kn(!1)}}return s.memoizedState=[c,i],c}function Ef(r,i,s){return s===void 0||(Ir&1073741824)!==0&&(Pe&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Jb(),Ae.lanes|=r,wa|=r,s)}function Jx(r,i,s,c){return Mn(s,i)?s:no.current!==null?(r=Ef(r,s,c),Mn(r,i)||($t=!0),r):(Ir&42)===0||(Ir&1073741824)!==0&&(Pe&261930)===0?($t=!0,r.memoizedState=s):(r=Jb(),Ae.lanes|=r,wa|=r,i)}function Qx(r,i,s,c,p){var y=K.p;K.p=y!==0&&8>y?y:8;var k=U.T,_={};U.T=_,Of(r,!1,i,s);try{var R=p(),I=U.S;if(I!==null&&I(_,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var J=fT(R,c);Es(r,i,J,Vn(r))}else Es(r,i,c,Vn(r))}catch(re){Es(r,i,{then:function(){},status:"rejected",reason:re},Vn())}finally{K.p=y,k!==null&&_.types!==null&&(k.types=_.types),U.T=k}}function xT(){}function Nf(r,i,s,c){if(r.tag!==5)throw Error(a(476));var p=Wx(r).queue;Qx(r,p,i,B,s===null?xT:function(){return eb(r),s(c)})}function Wx(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:B},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function eb(r){var i=Wx(r);i.next===null&&(i=r.alternate.memoizedState),Es(r,i.next.queue,{},Vn())}function Af(){return tn(qs)}function tb(){return Rt().memoizedState}function nb(){return Rt().memoizedState}function bT(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Vn();r=ga(s);var c=ya(i,r,s);c!==null&&(Cn(c,i,s),zs(c,i,s)),i={cache:of()},r.payload=i;return}i=i.return}}function vT(r,i,s){var c=Vn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ju(r)?ab(i,s):(s=Yd(r,i,s,c),s!==null&&(Cn(s,r,c),ib(s,i,c)))}function rb(r,i,s){var c=Vn();Es(r,i,s,c)}function Es(r,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ju(r))ab(i,p);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var k=i.lastRenderedState,_=y(k,s);if(p.hasEagerState=!0,p.eagerState=_,Mn(_,k))return ou(r,i,p,0),it===null&&iu(),!1}catch{}if(s=Yd(r,i,p,c),s!==null)return Cn(s,r,c),ib(s,i,c),!0}return!1}function Of(r,i,s,c){if(c={lane:2,revertLane:ch(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},ju(r)){if(i)throw Error(a(479))}else i=Yd(r,s,c,2),i!==null&&Cn(i,r,2)}function ju(r){var i=r.alternate;return r===Ae||i!==null&&i===Ae}function ab(r,i){ro=bu=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function ib(r,i,s){if((s&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,cy(r,s)}}var Ns={readContext:tn,use:wu,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Ns.useEffectEvent=Ct;var ob={readContext:tn,use:wu,useCallback:function(r,i){return pn().memoizedState=[r,i===void 0?null:i],r},useContext:tn,useEffect:Ix,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,zu(4194308,4,Gx.bind(null,i,r),s)},useLayoutEffect:function(r,i){return zu(4194308,4,r,i)},useInsertionEffect:function(r,i){zu(4,2,r,i)},useMemo:function(r,i){var s=pn();i=i===void 0?null:i;var c=r();if(fi){kn(!0);try{r()}finally{kn(!1)}}return s.memoizedState=[c,i],c},useReducer:function(r,i,s){var c=pn();if(s!==void 0){var p=s(i);if(fi){kn(!0);try{s(i)}finally{kn(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=vT.bind(null,Ae,r),[c.memoizedState,r]},useRef:function(r){var i=pn();return r={current:r},i.memoizedState=r},useState:function(r){r=_f(r);var i=r.queue,s=rb.bind(null,Ae,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Cf,useDeferredValue:function(r,i){var s=pn();return Ef(s,r,i)},useTransition:function(){var r=_f(!1);return r=Qx.bind(null,Ae,r.queue,!0,!1),pn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var c=Ae,p=pn();if(Ve){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),it===null)throw Error(a(349));(Pe&127)!==0||Tx(c,i,s)}p.memoizedState=s;var y={value:s,getSnapshot:i};return p.queue=y,Ix(Ex.bind(null,c,y,r),[r]),c.flags|=2048,io(9,{destroy:void 0},Cx.bind(null,c,y,s,i),null),s},useId:function(){var r=pn(),i=it.identifierPrefix;if(Ve){var s=br,c=xr;s=(c&~(1<<32-at(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=vu++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=hT++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Af,useFormState:Px,useActionState:Px,useOptimistic:function(r){var i=pn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Of.bind(null,Ae,!0,s),s.dispatch=i,[r,i]},useMemoCache:wf,useCacheRefresh:function(){return pn().memoizedState=bT.bind(null,Ae)},useEffectEvent:function(r){var i=pn(),s={impl:r};return i.memoizedState=s,function(){if((qe&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Rf={readContext:tn,use:wu,useCallback:Xx,useContext:tn,useEffect:Tf,useImperativeHandle:Yx,useInsertionEffect:Fx,useLayoutEffect:qx,useMemo:Kx,useReducer:Su,useRef:Zx,useState:function(){return Su(Hr)},useDebugValue:Cf,useDeferredValue:function(r,i){var s=Rt();return Jx(s,We.memoizedState,r,i)},useTransition:function(){var r=Su(Hr)[0],i=Rt().memoizedState;return[typeof r=="boolean"?r:Cs(r),i]},useSyncExternalStore:jx,useId:tb,useHostTransitionStatus:Af,useFormState:Ux,useActionState:Ux,useOptimistic:function(r,i){var s=Rt();return Ox(s,We,r,i)},useMemoCache:wf,useCacheRefresh:nb};Rf.useEffectEvent=Hx;var sb={readContext:tn,use:wu,useCallback:Xx,useContext:tn,useEffect:Tf,useImperativeHandle:Yx,useInsertionEffect:Fx,useLayoutEffect:qx,useMemo:Kx,useReducer:zf,useRef:Zx,useState:function(){return zf(Hr)},useDebugValue:Cf,useDeferredValue:function(r,i){var s=Rt();return We===null?Ef(s,r,i):Jx(s,We.memoizedState,r,i)},useTransition:function(){var r=zf(Hr)[0],i=Rt().memoizedState;return[typeof r=="boolean"?r:Cs(r),i]},useSyncExternalStore:jx,useId:tb,useHostTransitionStatus:Af,useFormState:Bx,useActionState:Bx,useOptimistic:function(r,i){var s=Rt();return We!==null?Ox(s,We,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:wf,useCacheRefresh:nb};sb.useEffectEvent=Hx;function Mf(r,i,s,c){i=r.memoizedState,s=s(c,i),s=s==null?i:x({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Df={enqueueSetState:function(r,i,s){r=r._reactInternals;var c=Vn(),p=ga(c);p.payload=i,s!=null&&(p.callback=s),i=ya(r,p,c),i!==null&&(Cn(i,r,c),zs(i,r,c))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var c=Vn(),p=ga(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=ya(r,p,c),i!==null&&(Cn(i,r,c),zs(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=Vn(),c=ga(s);c.tag=2,i!=null&&(c.callback=i),i=ya(r,c,s),i!==null&&(Cn(i,r,s),zs(i,r,s))}};function lb(r,i,s,c,p,y,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,y,k):i.prototype&&i.prototype.isPureReactComponent?!gs(s,c)||!gs(p,y):!0}function ub(r,i,s,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==r&&Df.enqueueReplaceState(i,i.state,null)}function hi(r,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}if(r=r.defaultProps){s===i&&(s=x({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function cb(r){au(r)}function db(r){console.error(r)}function fb(r){au(r)}function Tu(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function hb(r,i,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function $f(r,i,s){return s=ga(s),s.tag=3,s.payload={element:null},s.callback=function(){Tu(r,i)},s}function mb(r){return r=ga(r),r.tag=3,r}function pb(r,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;r.payload=function(){return p(y)},r.callback=function(){hb(i,s,c)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){hb(i,s,c),typeof p!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function kT(r,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Ji(i,s,p,!0),s=$n.current,s!==null){switch(s.tag){case 31:case 13:return er===null?Uu():s.alternate===null&&Et===0&&(Et=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===mu?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),sh(r,c,p)),!1;case 22:return s.flags|=65536,c===mu?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)),sh(r,c,p)),!1}throw Error(a(435,s.tag))}return sh(r,c,p),Uu(),!1}if(Ve)return i=$n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==ef&&(r=Error(a(422),{cause:c}),bs(Kn(r,s)))):(c!==ef&&(i=Error(a(423),{cause:c}),bs(Kn(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=Kn(c,s),p=$f(r.stateNode,c,p),ff(r,p),Et!==4&&(Et=2)),!1;var y=Error(a(520),{cause:c});if(y=Kn(y,s),Ps===null?Ps=[y]:Ps.push(y),Et!==4&&(Et=2),i===null)return!0;c=Kn(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=$f(s.stateNode,c,r),ff(s,r),!1;case 1:if(i=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Sa===null||!Sa.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=mb(p),pb(p,r,s,c),ff(s,p),!1}s=s.return}while(s!==null);return!1}var Lf=Error(a(461)),$t=!1;function nn(r,i,s,c){i.child=r===null?bx(i,null,s,c):di(i,r.child,s,c)}function gb(r,i,s,c,p){s=s.render;var y=i.ref;if("ref"in c){var k={};for(var _ in c)_!=="ref"&&(k[_]=c[_])}else k=c;return si(i),c=xf(r,i,s,k,y,p),_=bf(),r!==null&&!$t?(vf(r,i,p),Fr(r,i,p)):(Ve&&_&&Qd(i),i.flags|=1,nn(r,i,c,p),i.child)}function yb(r,i,s,c,p){if(r===null){var y=s.type;return typeof y=="function"&&!Xd(y)&&y.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=y,xb(r,i,y,c,p)):(r=lu(s.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Ff(r,p)){var k=y.memoizedProps;if(s=s.compare,s=s!==null?s:gs,s(k,c)&&r.ref===i.ref)return Fr(r,i,p)}return i.flags|=1,r=Ur(y,c),r.ref=i.ref,r.return=i,i.child=r}function xb(r,i,s,c,p){if(r!==null){var y=r.memoizedProps;if(gs(y,c)&&r.ref===i.ref)if($t=!1,i.pendingProps=c=y,Ff(r,p))(r.flags&131072)!==0&&($t=!0);else return i.lanes=r.lanes,Fr(r,i,p)}return Pf(r,i,s,c,p)}function bb(r,i,s,c){var p=c.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|s:s,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,i.child=null;return vb(r,i,y,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&fu(i,y!==null?y.cachePool:null),y!==null?wx(i,y):mf(),Sx(i);else return c=i.lanes=536870912,vb(r,i,y!==null?y.baseLanes|s:s,s,c)}else y!==null?(fu(i,y.cachePool),wx(i,y),ba(),i.memoizedState=null):(r!==null&&fu(i,null),mf(),ba());return nn(r,i,p,s),i.child}function As(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function vb(r,i,s,c,p){var y=lf();return y=y===null?null:{parent:Mt._currentValue,pool:y},i.memoizedState={baseLanes:s,cachePool:y},r!==null&&fu(i,null),mf(),Sx(i),r!==null&&Ji(r,i,c,!0),i.childLanes=p,null}function Cu(r,i){return i=Nu({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function kb(r,i,s){return di(i,r.child,null,s),r=Cu(i,i.pendingProps),r.flags|=2,Ln(i),i.memoizedState=null,r}function wT(r,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ve){if(c.mode==="hidden")return r=Cu(i,c),i.lanes=536870912,As(null,r);if(gf(i),(r=ht)?(r=Rv(r,Wn),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:da!==null?{id:xr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},s=ax(r),s.return=i,i.child=s,en=i,ht=null)):r=null,r===null)throw ha(i);return i.lanes=536870912,null}return Cu(i,c)}var y=r.memoizedState;if(y!==null){var k=y.dehydrated;if(gf(i),p)if(i.flags&256)i.flags&=-257,i=kb(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if($t||Ji(r,i,s,!1),p=(s&r.childLanes)!==0,$t||p){if(c=it,c!==null&&(k=dy(c,s),k!==0&&k!==y.retryLane))throw y.retryLane=k,ri(r,k),Cn(c,r,k),Lf;Uu(),i=kb(r,i,s)}else r=y.treeContext,ht=tr(k.nextSibling),en=i,Ve=!0,fa=null,Wn=!1,r!==null&&sx(i,r),i=Cu(i,c),i.flags|=4096;return i}return r=Ur(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Eu(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Pf(r,i,s,c,p){return si(i),s=xf(r,i,s,c,void 0,p),c=bf(),r!==null&&!$t?(vf(r,i,p),Fr(r,i,p)):(Ve&&c&&Qd(i),i.flags|=1,nn(r,i,s,p),i.child)}function wb(r,i,s,c,p,y){return si(i),i.updateQueue=null,s=_x(i,c,s,p),zx(r),c=bf(),r!==null&&!$t?(vf(r,i,y),Fr(r,i,y)):(Ve&&c&&Qd(i),i.flags|=1,nn(r,i,s,y),i.child)}function Sb(r,i,s,c,p){if(si(i),i.stateNode===null){var y=Gi,k=s.contextType;typeof k=="object"&&k!==null&&(y=tn(k)),y=new s(c,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Df,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=c,y.state=i.memoizedState,y.refs={},cf(i),k=s.contextType,y.context=typeof k=="object"&&k!==null?tn(k):Gi,y.state=i.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(Mf(i,s,k,c),y.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&Df.enqueueReplaceState(y,y.state,null),js(i,c,y,p),_s(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){y=i.stateNode;var _=i.memoizedProps,R=hi(s,_);y.props=R;var I=y.context,J=s.contextType;k=Gi,typeof J=="object"&&J!==null&&(k=tn(J));var re=s.getDerivedStateFromProps;J=typeof re=="function"||typeof y.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,J||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(_||I!==k)&&ub(i,y,c,k),pa=!1;var F=i.memoizedState;y.state=F,js(i,c,y,p),_s(),I=i.memoizedState,_||F!==I||pa?(typeof re=="function"&&(Mf(i,s,re,c),I=i.memoizedState),(R=pa||lb(i,s,R,c,F,I,k))?(J||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=I),y.props=c,y.state=I,y.context=k,c=R):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{y=i.stateNode,df(r,i),k=i.memoizedProps,J=hi(s,k),y.props=J,re=i.pendingProps,F=y.context,I=s.contextType,R=Gi,typeof I=="object"&&I!==null&&(R=tn(I)),_=s.getDerivedStateFromProps,(I=typeof _=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==re||F!==R)&&ub(i,y,c,R),pa=!1,F=i.memoizedState,y.state=F,js(i,c,y,p),_s();var Y=i.memoizedState;k!==re||F!==Y||pa||r!==null&&r.dependencies!==null&&cu(r.dependencies)?(typeof _=="function"&&(Mf(i,s,_,c),Y=i.memoizedState),(J=pa||lb(i,s,J,c,F,Y,R)||r!==null&&r.dependencies!==null&&cu(r.dependencies))?(I||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,Y,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,Y,R)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=Y),y.props=c,y.state=Y,y.context=R,c=J):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&F===r.memoizedState||(i.flags|=1024),c=!1)}return y=c,Eu(r,i),c=(i.flags&128)!==0,y||c?(y=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&c?(i.child=di(i,r.child,null,p),i.child=di(i,null,s,p)):nn(r,i,s,p),i.memoizedState=y.state,r=i.child):r=Fr(r,i,p),r}function zb(r,i,s,c){return ii(),i.flags|=256,nn(r,i,s,c),i.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vf(r){return{baseLanes:r,cachePool:hx()}}function Bf(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Un),r}function _b(r,i,s){var c=i.pendingProps,p=!1,y=(i.flags&128)!==0,k;if((k=y)||(k=r!==null&&r.memoizedState===null?!1:(Ot.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ve){if(p?xa(i):ba(),(r=ht)?(r=Rv(r,Wn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:da!==null?{id:xr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},s=ax(r),s.return=i,i.child=s,en=i,ht=null)):r=null,r===null)throw ha(i);return Sh(r)?i.lanes=32:i.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(ba(),p=i.mode,_=Nu({mode:"hidden",children:_},p),c=ai(c,p,s,null),_.return=i,c.return=i,_.sibling=c,i.child=_,c=i.child,c.memoizedState=Vf(s),c.childLanes=Bf(r,k,s),i.memoizedState=Uf,As(null,c)):(xa(i),Zf(i,_))}var R=r.memoizedState;if(R!==null&&(_=R.dehydrated,_!==null)){if(y)i.flags&256?(xa(i),i.flags&=-257,i=If(r,i,s)):i.memoizedState!==null?(ba(),i.child=r.child,i.flags|=128,i=null):(ba(),_=c.fallback,p=i.mode,c=Nu({mode:"visible",children:c.children},p),_=ai(_,p,s,null),_.flags|=2,c.return=i,_.return=i,c.sibling=_,i.child=c,di(i,r.child,null,s),c=i.child,c.memoizedState=Vf(s),c.childLanes=Bf(r,k,s),i.memoizedState=Uf,i=As(null,c));else if(xa(i),Sh(_)){if(k=_.nextSibling&&_.nextSibling.dataset,k)var I=k.dgst;k=I,c=Error(a(419)),c.stack="",c.digest=k,bs({value:c,source:null,stack:null}),i=If(r,i,s)}else if($t||Ji(r,i,s,!1),k=(s&r.childLanes)!==0,$t||k){if(k=it,k!==null&&(c=dy(k,s),c!==0&&c!==R.retryLane))throw R.retryLane=c,ri(r,c),Cn(k,r,c),Lf;wh(_)||Uu(),i=If(r,i,s)}else wh(_)?(i.flags|=192,i.child=r.child,i=null):(r=R.treeContext,ht=tr(_.nextSibling),en=i,Ve=!0,fa=null,Wn=!1,r!==null&&sx(i,r),i=Zf(i,c.children),i.flags|=4096);return i}return p?(ba(),_=c.fallback,p=i.mode,R=r.child,I=R.sibling,c=Ur(R,{mode:"hidden",children:c.children}),c.subtreeFlags=R.subtreeFlags&65011712,I!==null?_=Ur(I,_):(_=ai(_,p,s,null),_.flags|=2),_.return=i,c.return=i,c.sibling=_,i.child=c,As(null,c),c=i.child,_=r.child.memoizedState,_===null?_=Vf(s):(p=_.cachePool,p!==null?(R=Mt._currentValue,p=p.parent!==R?{parent:R,pool:R}:p):p=hx(),_={baseLanes:_.baseLanes|s,cachePool:p}),c.memoizedState=_,c.childLanes=Bf(r,k,s),i.memoizedState=Uf,As(r.child,c)):(xa(i),s=r.child,r=s.sibling,s=Ur(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=s,i.memoizedState=null,s)}function Zf(r,i){return i=Nu({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Nu(r,i){return r=Dn(22,r,null,i),r.lanes=0,r}function If(r,i,s){return di(i,r.child,null,s),r=Zf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function jb(r,i,s){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),rf(r.return,i,s)}function Hf(r,i,s,c,p,y){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:y}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=s,k.tailMode=p,k.treeForkCount=y)}function Tb(r,i,s){var c=i.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var k=Ot.current,_=(k&2)!==0;if(_?(k=k&1|2,i.flags|=128):k&=1,w(Ot,k),nn(r,i,c,s),c=Ve?xs:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&jb(r,s,i);else if(r.tag===19)jb(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&xu(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Hf(i,!1,p,s,y,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&xu(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Hf(i,!0,s,null,y,c);break;case"together":Hf(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Fr(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),wa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ji(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=Ur(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=Ur(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Ff(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&cu(r)))}function ST(r,i,s){switch(i.tag){case 3:De(i,i.stateNode.containerInfo),ma(i,Mt,r.memoizedState.cache),ii();break;case 27:case 5:kt(i);break;case 4:De(i,i.stateNode.containerInfo);break;case 10:ma(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,gf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(xa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?_b(r,i,s):(xa(i),r=Fr(r,i,s),r!==null?r.sibling:null);xa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Ji(r,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return Tb(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w(Ot,Ot.current),c)break;return null;case 22:return i.lanes=0,bb(r,i,s,i.pendingProps);case 24:ma(i,Mt,r.memoizedState.cache)}return Fr(r,i,s)}function Cb(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)$t=!0;else{if(!Ff(r,s)&&(i.flags&128)===0)return $t=!1,ST(r,i,s);$t=(r.flags&131072)!==0}else $t=!1,Ve&&(i.flags&1048576)!==0&&ox(i,xs,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=ui(i.elementType),i.type=r,typeof r=="function")Xd(r)?(c=hi(r,c),i.tag=1,i=Sb(null,i,r,c,s)):(i.tag=0,i=Pf(null,i,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===$){i.tag=11,i=gb(null,i,r,c,s);break e}else if(p===q){i.tag=14,i=yb(null,i,r,c,s);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return Pf(r,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=hi(c,i.pendingProps),Sb(r,i,c,p,s);case 3:e:{if(De(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var y=i.memoizedState;p=y.element,df(r,i),js(i,c,null,s);var k=i.memoizedState;if(c=k.cache,ma(i,Mt,c),c!==y.cache&&af(i,[Mt],s,!0),_s(),c=k.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=zb(r,i,c,s);break e}else if(c!==p){p=Kn(Error(a(424)),i),bs(p),i=zb(r,i,c,s);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,ht=tr(r.firstChild),en=i,Ve=!0,fa=null,Wn=!0,s=bx(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ii(),c===p){i=Fr(r,i,s);break e}nn(r,i,c,s)}i=i.child}return i;case 26:return Eu(r,i),r===null?(s=Uv(i.type,null,i.pendingProps,null))?i.memoizedState=s:Ve||(s=i.type,r=i.pendingProps,c=qu(fe.current).createElement(s),c[Wt]=i,c[wn]=r,rn(c,s,r),Kt(c),i.stateNode=c):i.memoizedState=Uv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return kt(i),r===null&&Ve&&(c=i.stateNode=$v(i.type,i.pendingProps,fe.current),en=i,Wn=!0,p=ht,Ta(i.type)?(zh=p,ht=tr(c.firstChild)):ht=p),nn(r,i,i.pendingProps.children,s),Eu(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ve&&((p=c=ht)&&(c=WT(c,i.type,i.pendingProps,Wn),c!==null?(i.stateNode=c,en=i,ht=tr(c.firstChild),Wn=!1,p=!0):p=!1),p||ha(i)),kt(i),p=i.type,y=i.pendingProps,k=r!==null?r.memoizedProps:null,c=y.children,bh(p,y)?c=null:k!==null&&bh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=xf(r,i,mT,null,null,s),qs._currentValue=p),Eu(r,i),nn(r,i,c,s),i.child;case 6:return r===null&&Ve&&((r=s=ht)&&(s=eC(s,i.pendingProps,Wn),s!==null?(i.stateNode=s,en=i,ht=null,r=!0):r=!1),r||ha(i)),null;case 13:return _b(r,i,s);case 4:return De(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=di(i,null,c,s):nn(r,i,c,s),i.child;case 11:return gb(r,i,i.type,i.pendingProps,s);case 7:return nn(r,i,i.pendingProps,s),i.child;case 8:return nn(r,i,i.pendingProps.children,s),i.child;case 12:return nn(r,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,ma(i,i.type,c.value),nn(r,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,si(i),p=tn(p),c=c(p),i.flags|=1,nn(r,i,c,s),i.child;case 14:return yb(r,i,i.type,i.pendingProps,s);case 15:return xb(r,i,i.type,i.pendingProps,s);case 19:return Tb(r,i,s);case 31:return wT(r,i,s);case 22:return bb(r,i,s,i.pendingProps);case 24:return si(i),c=tn(Mt),r===null?(p=lf(),p===null&&(p=it,y=of(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),i.memoizedState={parent:c,cache:p},cf(i),ma(i,Mt,p)):((r.lanes&s)!==0&&(df(r,i),js(i,null,null,s),_s()),p=r.memoizedState,y=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),ma(i,Mt,c)):(c=y.cache,ma(i,Mt,c),c!==p.cache&&af(i,[Mt],s,!0))),nn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function qr(r){r.flags|=4}function qf(r,i,s,c,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(tv())r.flags|=8192;else throw ci=mu,uf}else r.flags&=-16777217}function Eb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Hv(i))if(tv())r.flags|=8192;else throw ci=mu,uf}function Au(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ly():536870912,r.lanes|=i,uo|=i)}function Os(r,i){if(!Ve)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function mt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,i}function zT(r,i,s){var c=i.pendingProps;switch(Wd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return s=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Zr(Mt),Ne(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Ki(i)?qr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,tf())),mt(i),null;case 26:var p=i.type,y=i.memoizedState;return r===null?(qr(i),y!==null?(mt(i),Eb(i,y)):(mt(i),qf(i,p,null,c,s))):y?y!==r.memoizedState?(qr(i),mt(i),Eb(i,y)):(mt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&qr(i),mt(i),qf(i,p,r,c,s)),null;case 27:if(It(i),s=fe.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&qr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return mt(i),null}r=G.current,Ki(i)?lx(i):(r=$v(p,c,s),i.stateNode=r,qr(i))}return mt(i),null;case 5:if(It(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&qr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(y=G.current,Ki(i))lx(i);else{var k=qu(fe.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?k.createElement(p,{is:c.is}):k.createElement(p)}}y[Wt]=i,y[wn]=c;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===i)break e;for(;k.sibling===null;){if(k.return===null||k.return===i)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}i.stateNode=y;e:switch(rn(y,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&&qr(i)}}return mt(i),qf(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&qr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=fe.current,Ki(i)){if(r=i.stateNode,s=i.memoizedProps,c=null,p=en,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[Wt]=i,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||_v(r.nodeValue,s)),r||ha(i,!0)}else r=qu(r).createTextNode(c),r[Wt]=i,i.stateNode=r}return mt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(c=Ki(i),s!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Wt]=i}else ii(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),r=!1}else s=tf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Ln(i),i):(Ln(i),null);if((i.flags&128)!==0)throw Error(a(558))}return mt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ki(i),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Wt]=i}else ii(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),p=!1}else p=tf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Ln(i),i):(Ln(i),null)}return Ln(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,r=r!==null&&r.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),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Au(i,i.updateQueue),mt(i),null);case 4:return Ne(),r===null&&mh(i.stateNode.containerInfo),mt(i),null;case 10:return Zr(i.type),mt(i),null;case 19:if(H(Ot),c=i.memoizedState,c===null)return mt(i),null;if(p=(i.flags&128)!==0,y=c.rendering,y===null)if(p)Os(c,!1);else{if(Et!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=xu(r),y!==null){for(i.flags|=128,Os(c,!1),r=y.updateQueue,i.updateQueue=r,Au(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)rx(s,r),s=s.sibling;return w(Ot,Ot.current&1|2),Ve&&Vr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&ft()>$u&&(i.flags|=128,p=!0,Os(c,!1),i.lanes=4194304)}else{if(!p)if(r=xu(y),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Au(i,r),Os(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!Ve)return mt(i),null}else 2*ft()-c.renderingStartTime>$u&&s!==536870912&&(i.flags|=128,p=!0,Os(c,!1),i.lanes=4194304);c.isBackwards?(y.sibling=i.child,i.child=y):(r=c.last,r!==null?r.sibling=y:i.child=y,c.last=y)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=ft(),r.sibling=null,s=Ot.current,w(Ot,p?s&1|2:s&1),Ve&&Vr(i,c.treeForkCount),r):(mt(i),null);case 22:case 23:return Ln(i),pf(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),s=i.updateQueue,s!==null&&Au(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),r!==null&&H(li),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Zr(Mt),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function _T(r,i){switch(Wd(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Zr(Mt),Ne(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return It(i),null;case 31:if(i.memoizedState!==null){if(Ln(i),i.alternate===null)throw Error(a(340));ii()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Ln(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ii()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return H(Ot),null;case 4:return Ne(),null;case 10:return Zr(i.type),null;case 22:case 23:return Ln(i),pf(),r!==null&&H(li),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Zr(Mt),null;case 25:return null;default:return null}}function Nb(r,i){switch(Wd(i),i.tag){case 3:Zr(Mt),Ne();break;case 26:case 27:case 5:It(i);break;case 4:Ne();break;case 31:i.memoizedState!==null&&Ln(i);break;case 13:Ln(i);break;case 19:H(Ot);break;case 10:Zr(i.type);break;case 22:case 23:Ln(i),pf(),r!==null&&H(li);break;case 24:Zr(Mt)}}function Rs(r,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&r)===r){c=void 0;var y=s.create,k=s.inst;c=y(),k.destroy=c}s=s.next}while(s!==p)}}catch(_){Ke(i,i.return,_)}}function va(r,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&r)===r){var k=c.inst,_=k.destroy;if(_!==void 0){k.destroy=void 0,p=i;var R=s,I=_;try{I()}catch(J){Ke(p,R,J)}}}c=c.next}while(c!==y)}}catch(J){Ke(i,i.return,J)}}function Ab(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{kx(i,s)}catch(c){Ke(r,r.return,c)}}}function Ob(r,i,s){s.props=hi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){Ke(r,i,c)}}function Ms(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){Ke(r,i,p)}}function vr(r,i){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){Ke(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){Ke(r,i,p)}else s.current=null}function Rb(r){var i=r.type,s=r.memoizedProps,c=r.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){Ke(r,r.return,p)}}function Gf(r,i,s){try{var c=r.stateNode;GT(c,r.type,s,i),c[wn]=i}catch(p){Ke(r,r.return,p)}}function Mb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ta(r.type)||r.tag===4}function Yf(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Mb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ta(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Xf(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Lr));else if(c!==4&&(c===27&&Ta(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Xf(r,i,s),r=r.sibling;r!==null;)Xf(r,i,s),r=r.sibling}function Ou(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(c!==4&&(c===27&&Ta(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Ou(r,i,s),r=r.sibling;r!==null;)Ou(r,i,s),r=r.sibling}function Db(r){var i=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);rn(i,c,s),i[Wt]=r,i[wn]=s}catch(y){Ke(r,r.return,y)}}var Gr=!1,Lt=!1,Kf=!1,$b=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function jT(r,i){if(r=r.containerInfo,yh=Wu,r=Yy(r),Zd(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var k=0,_=-1,R=-1,I=0,J=0,re=r,F=null;t:for(;;){for(var Y;re!==s||p!==0&&re.nodeType!==3||(_=k+p),re!==y||c!==0&&re.nodeType!==3||(R=k+c),re.nodeType===3&&(k+=re.nodeValue.length),(Y=re.firstChild)!==null;)F=re,re=Y;for(;;){if(re===r)break t;if(F===s&&++I===p&&(_=k),F===y&&++J===c&&(R=k),(Y=re.nextSibling)!==null)break;re=F,F=re.parentNode}re=Y}s=_===-1||R===-1?null:{start:_,end:R}}else s=null}s=s||{start:0,end:0}}else s=null;for(xh={focusedElem:r,selectionRange:s},Wu=!1,Jt=i;Jt!==null;)if(i=Jt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Jt=r;else for(;Jt!==null;){switch(i=Jt,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,s=i,p=y.memoizedProps,y=y.memoizedState,c=s.stateNode;try{var pe=hi(s.type,p);r=c.getSnapshotBeforeUpdate(pe,y),c.__reactInternalSnapshotBeforeUpdate=r}catch(_e){Ke(s,s.return,_e)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)kh(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":kh(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Jt=r;break}Jt=i.return}}function Lb(r,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Xr(r,s),c&4&&Rs(5,s);break;case 1:if(Xr(r,s),c&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(k){Ke(s,s.return,k)}else{var p=hi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){Ke(s,s.return,k)}}c&64&&Ab(s),c&512&&Ms(s,s.return);break;case 3:if(Xr(r,s),c&64&&(r=s.updateQueue,r!==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{kx(r,i)}catch(k){Ke(s,s.return,k)}}break;case 27:i===null&&c&4&&Db(s);case 26:case 5:Xr(r,s),i===null&&c&4&&Rb(s),c&512&&Ms(s,s.return);break;case 12:Xr(r,s);break;case 31:Xr(r,s),c&4&&Vb(r,s);break;case 13:Xr(r,s),c&4&&Bb(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=DT.bind(null,s),tC(r,s))));break;case 22:if(c=s.memoizedState!==null||Gr,!c){i=i!==null&&i.memoizedState!==null||Lt,p=Gr;var y=Lt;Gr=c,(Lt=i)&&!y?Kr(r,s,(s.subtreeFlags&8772)!==0):Xr(r,s),Gr=p,Lt=y}break;case 30:break;default:Xr(r,s)}}function Pb(r){var i=r.alternate;i!==null&&(r.alternate=null,Pb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&_d(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var gt=null,zn=!1;function Yr(r,i,s){for(s=s.child;s!==null;)Ub(r,i,s),s=s.sibling}function Ub(r,i,s){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(mn,s)}catch{}switch(s.tag){case 26:Lt||vr(s,i),Yr(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Lt||vr(s,i);var c=gt,p=zn;Ta(s.type)&&(gt=s.stateNode,zn=!1),Yr(r,i,s),Is(s.stateNode),gt=c,zn=p;break;case 5:Lt||vr(s,i);case 6:if(c=gt,p=zn,gt=null,Yr(r,i,s),gt=c,zn=p,gt!==null)if(zn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(s.stateNode)}catch(y){Ke(s,i,y)}else try{gt.removeChild(s.stateNode)}catch(y){Ke(s,i,y)}break;case 18:gt!==null&&(zn?(r=gt,Av(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),xo(r)):Av(gt,s.stateNode));break;case 4:c=gt,p=zn,gt=s.stateNode.containerInfo,zn=!0,Yr(r,i,s),gt=c,zn=p;break;case 0:case 11:case 14:case 15:va(2,s,i),Lt||va(4,s,i),Yr(r,i,s);break;case 1:Lt||(vr(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Ob(s,i,c)),Yr(r,i,s);break;case 21:Yr(r,i,s);break;case 22:Lt=(c=Lt)||s.memoizedState!==null,Yr(r,i,s),Lt=c;break;default:Yr(r,i,s)}}function Vb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{xo(r)}catch(s){Ke(i,i.return,s)}}}function Bb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{xo(r)}catch(s){Ke(i,i.return,s)}}function TT(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new $b),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new $b),i;default:throw Error(a(435,r.tag))}}function Ru(r,i){var s=TT(r);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=$T.bind(null,r,c);c.then(p,p)}})}function _n(r,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],y=r,k=i,_=k;e:for(;_!==null;){switch(_.tag){case 27:if(Ta(_.type)){gt=_.stateNode,zn=!1;break e}break;case 5:gt=_.stateNode,zn=!1;break e;case 3:case 4:gt=_.stateNode.containerInfo,zn=!0;break e}_=_.return}if(gt===null)throw Error(a(160));Ub(y,k,p),gt=null,zn=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Zb(i,r),i=i.sibling}var fr=null;function Zb(r,i){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:_n(i,r),jn(r),c&4&&(va(3,r,r.return),Rs(3,r),va(5,r,r.return));break;case 1:_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),c&64&&Gr&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=fr;if(_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),c&4){var y=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[ss]||y[Wt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),rn(y,c,s),y[Wt]=r,Kt(y),c=y;break e;case"link":var k=Zv("link","href",p).get(c+(s.href||""));if(k){for(var _=0;_<k.length;_++)if(y=k[_],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){k.splice(_,1);break t}}y=p.createElement(c),rn(y,c,s),p.head.appendChild(y);break;case"meta":if(k=Zv("meta","content",p).get(c+(s.content||""))){for(_=0;_<k.length;_++)if(y=k[_],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){k.splice(_,1);break t}}y=p.createElement(c),rn(y,c,s),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Wt]=r,Kt(y),c=y}r.stateNode=c}else Iv(p,r.type,r.stateNode);else r.stateNode=Bv(p,c,r.memoizedProps);else y!==c?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,c===null?Iv(p,r.type,r.stateNode):Bv(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Gf(r,r.memoizedProps,s.memoizedProps)}break;case 27:_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),s!==null&&c&4&&Gf(r,r.memoizedProps,s.memoizedProps);break;case 5:if(_n(i,r),jn(r),c&512&&(Lt||s===null||vr(s,s.return)),r.flags&32){p=r.stateNode;try{Vi(p,"")}catch(pe){Ke(r,r.return,pe)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Gf(r,p,s!==null?s.memoizedProps:p)),c&1024&&(Kf=!0);break;case 6:if(_n(i,r),jn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(pe){Ke(r,r.return,pe)}}break;case 3:if(Xu=null,p=fr,fr=Gu(i.containerInfo),_n(i,r),fr=p,jn(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{xo(i.containerInfo)}catch(pe){Ke(r,r.return,pe)}Kf&&(Kf=!1,Ib(r));break;case 4:c=fr,fr=Gu(r.stateNode.containerInfo),_n(i,r),jn(r),fr=c;break;case 12:_n(i,r),jn(r);break;case 31:_n(i,r),jn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ru(r,c)));break;case 13:_n(i,r),jn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Du=ft()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ru(r,c)));break;case 22:p=r.memoizedState!==null;var R=s!==null&&s.memoizedState!==null,I=Gr,J=Lt;if(Gr=I||p,Lt=J||R,_n(i,r),Lt=J,Gr=I,jn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||R||Gr||Lt||mi(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){R=s=i;try{if(y=R.stateNode,p)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{_=R.stateNode;var re=R.memoizedProps.style,F=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(pe){Ke(R,R.return,pe)}}}else if(i.tag===6){if(s===null){R=i;try{R.stateNode.nodeValue=p?"":R.memoizedProps}catch(pe){Ke(R,R.return,pe)}}}else if(i.tag===18){if(s===null){R=i;try{var Y=R.stateNode;p?Ov(Y,!0):Ov(R.stateNode,!1)}catch(pe){Ke(R,R.return,pe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Ru(r,s))));break;case 19:_n(i,r),jn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ru(r,c)));break;case 30:break;case 21:break;default:_n(i,r),jn(r)}}function jn(r){var i=r.flags;if(i&2){try{for(var s,c=r.return;c!==null;){if(Mb(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,y=Yf(r);Ou(r,y,p);break;case 5:var k=s.stateNode;s.flags&32&&(Vi(k,""),s.flags&=-33);var _=Yf(r);Ou(r,_,k);break;case 3:case 4:var R=s.stateNode.containerInfo,I=Yf(r);Xf(r,I,R);break;default:throw Error(a(161))}}catch(J){Ke(r,r.return,J)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ib(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ib(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Xr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Lb(r,i.alternate,i),i=i.sibling}function mi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:va(4,i,i.return),mi(i);break;case 1:vr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Ob(i,i.return,s),mi(i);break;case 27:Is(i.stateNode);case 26:case 5:vr(i,i.return),mi(i);break;case 22:i.memoizedState===null&&mi(i);break;case 30:mi(i);break;default:mi(i)}r=r.sibling}}function Kr(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,y=i,k=y.flags;switch(y.tag){case 0:case 11:case 15:Kr(p,y,s),Rs(4,y);break;case 1:if(Kr(p,y,s),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(I){Ke(c,c.return,I)}if(c=y,p=c.updateQueue,p!==null){var _=c.stateNode;try{var R=p.shared.hiddenCallbacks;if(R!==null)for(p.shared.hiddenCallbacks=null,p=0;p<R.length;p++)vx(R[p],_)}catch(I){Ke(c,c.return,I)}}s&&k&64&&Ab(y),Ms(y,y.return);break;case 27:Db(y);case 26:case 5:Kr(p,y,s),s&&c===null&&k&4&&Rb(y),Ms(y,y.return);break;case 12:Kr(p,y,s);break;case 31:Kr(p,y,s),s&&k&4&&Vb(p,y);break;case 13:Kr(p,y,s),s&&k&4&&Bb(p,y);break;case 22:y.memoizedState===null&&Kr(p,y,s),Ms(y,y.return);break;case 30:break;default:Kr(p,y,s)}i=i.sibling}}function Jf(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&vs(s))}function Qf(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&vs(r))}function hr(r,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Hb(r,i,s,c),i=i.sibling}function Hb(r,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:hr(r,i,s,c),p&2048&&Rs(9,i);break;case 1:hr(r,i,s,c);break;case 3:hr(r,i,s,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&vs(r)));break;case 12:if(p&2048){hr(r,i,s,c),r=i.stateNode;try{var y=i.memoizedProps,k=y.id,_=y.onPostCommit;typeof _=="function"&&_(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){Ke(i,i.return,R)}}else hr(r,i,s,c);break;case 31:hr(r,i,s,c);break;case 13:hr(r,i,s,c);break;case 23:break;case 22:y=i.stateNode,k=i.alternate,i.memoizedState!==null?y._visibility&2?hr(r,i,s,c):Ds(r,i):y._visibility&2?hr(r,i,s,c):(y._visibility|=2,oo(r,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Jf(k,i);break;case 24:hr(r,i,s,c),p&2048&&Qf(i.alternate,i);break;default:hr(r,i,s,c)}}function oo(r,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,k=i,_=s,R=c,I=k.flags;switch(k.tag){case 0:case 11:case 15:oo(y,k,_,R,p),Rs(8,k);break;case 23:break;case 22:var J=k.stateNode;k.memoizedState!==null?J._visibility&2?oo(y,k,_,R,p):Ds(y,k):(J._visibility|=2,oo(y,k,_,R,p)),p&&I&2048&&Jf(k.alternate,k);break;case 24:oo(y,k,_,R,p),p&&I&2048&&Qf(k.alternate,k);break;default:oo(y,k,_,R,p)}i=i.sibling}}function Ds(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,c=i,p=c.flags;switch(c.tag){case 22:Ds(s,c),p&2048&&Jf(c.alternate,c);break;case 24:Ds(s,c),p&2048&&Qf(c.alternate,c);break;default:Ds(s,c)}i=i.sibling}}var $s=8192;function so(r,i,s){if(r.subtreeFlags&$s)for(r=r.child;r!==null;)Fb(r,i,s),r=r.sibling}function Fb(r,i,s){switch(r.tag){case 26:so(r,i,s),r.flags&$s&&r.memoizedState!==null&&hC(s,fr,r.memoizedState,r.memoizedProps);break;case 5:so(r,i,s);break;case 3:case 4:var c=fr;fr=Gu(r.stateNode.containerInfo),so(r,i,s),fr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=$s,$s=16777216,so(r,i,s),$s=c):so(r,i,s));break;default:so(r,i,s)}}function qb(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Ls(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Jt=c,Yb(c,r)}qb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Gb(r),r=r.sibling}function Gb(r){switch(r.tag){case 0:case 11:case 15:Ls(r),r.flags&2048&&va(9,r,r.return);break;case 3:Ls(r);break;case 12:Ls(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Mu(r)):Ls(r);break;default:Ls(r)}}function Mu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Jt=c,Yb(c,r)}qb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:va(8,i,i.return),Mu(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Mu(i));break;default:Mu(i)}r=r.sibling}}function Yb(r,i){for(;Jt!==null;){var s=Jt;switch(s.tag){case 0:case 11:case 15:va(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:vs(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Jt=c;else e:for(s=r;Jt!==null;){c=Jt;var p=c.sibling,y=c.return;if(Pb(c),c===s){Jt=null;break e}if(p!==null){p.return=y,Jt=p;break e}Jt=y}}}var CT={getCacheForType:function(r){var i=tn(Mt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return tn(Mt).controller.signal}},ET=typeof WeakMap=="function"?WeakMap:Map,qe=0,it=null,$e=null,Pe=0,Xe=0,Pn=null,ka=!1,lo=!1,Wf=!1,Jr=0,Et=0,wa=0,pi=0,eh=0,Un=0,uo=0,Ps=null,Tn=null,th=!1,Du=0,Xb=0,$u=1/0,Lu=null,Sa=null,qt=0,za=null,co=null,Qr=0,nh=0,rh=null,Kb=null,Us=0,ah=null;function Vn(){return(qe&2)!==0&&Pe!==0?Pe&-Pe:U.T!==null?ch():fy()}function Jb(){if(Un===0)if((Pe&536870912)===0||Ve){var r=Fl;Fl<<=1,(Fl&3932160)===0&&(Fl=262144),Un=r}else Un=536870912;return r=$n.current,r!==null&&(r.flags|=32),Un}function Cn(r,i,s){(r===it&&(Xe===2||Xe===9)||r.cancelPendingCommit!==null)&&(fo(r,0),_a(r,Pe,Un,!1)),os(r,s),((qe&2)===0||r!==it)&&(r===it&&((qe&2)===0&&(pi|=s),Et===4&&_a(r,Pe,Un,!1)),kr(r))}function Qb(r,i,s){if((qe&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&r.expiredLanes)===0||is(r,i),p=c?OT(r,i):oh(r,i,!0),y=c;do{if(p===0){lo&&!c&&_a(r,i,0,!1);break}else{if(s=r.current.alternate,y&&!NT(s)){p=oh(r,i,!1),y=!1;continue}if(p===2){if(y=i,r.errorRecoveryDisabledLanes&y)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var _=r;p=Ps;var R=_.current.memoizedState.isDehydrated;if(R&&(fo(_,k).flags|=256),k=oh(_,k,!1),k!==2){if(Wf&&!R){_.errorRecoveryDisabledLanes|=y,pi|=y,p=4;break e}y=Tn,Tn=p,y!==null&&(Tn===null?Tn=y:Tn.push.apply(Tn,y))}p=k}if(y=!1,p!==2)continue}}if(p===1){fo(r,0),_a(r,i,0,!0);break}e:{switch(c=r,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:_a(c,i,Un,!ka);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Du+300-ft(),10<p)){if(_a(c,i,Un,!ka),Gl(c,0,!0)!==0)break e;Qr=i,c.timeoutHandle=Ev(Wb.bind(null,c,s,Tn,Lu,th,i,Un,pi,uo,ka,y,"Throttled",-0,0),p);break e}Wb(c,s,Tn,Lu,th,i,Un,pi,uo,ka,y,null,-0,0)}}break}while(!0);kr(r)}function Wb(r,i,s,c,p,y,k,_,R,I,J,re,F,Y){if(r.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lr},Fb(i,y,re);var pe=(y&62914560)===y?Du-ft():(y&4194048)===y?Xb-ft():0;if(pe=mC(re,pe),pe!==null){Qr=y,r.cancelPendingCommit=pe(sv.bind(null,r,i,y,s,c,p,k,_,R,J,re,null,F,Y)),_a(r,y,k,!I);return}}sv(r,i,y,s,c,p,k,_,R)}function NT(r){for(var i=r;;){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],y=p.getSnapshot;p=p.value;try{if(!Mn(y(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function _a(r,i,s,c){i&=~eh,i&=~pi,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var y=31-at(p),k=1<<y;c[y]=-1,p&=~k}s!==0&&uy(r,s,i)}function Pu(){return(qe&6)===0?(Vs(0),!1):!0}function ih(){if($e!==null){if(Xe===0)var r=$e.return;else r=$e,Br=oi=null,kf(r),to=null,ws=0,r=$e;for(;r!==null;)Nb(r.alternate,r),r=r.return;$e=null}}function fo(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,KT(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Qr=0,ih(),it=r,$e=s=Ur(r.current,null),Pe=i,Xe=0,Pn=null,ka=!1,lo=is(r,i),Wf=!1,uo=Un=eh=pi=wa=Et=0,Tn=Ps=null,th=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-at(c),y=1<<p;i|=r[p],c&=~y}return Jr=i,iu(),s}function ev(r,i){Ae=null,U.H=Ns,i===eo||i===hu?(i=gx(),Xe=3):i===uf?(i=gx(),Xe=4):Xe=i===Lf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Pn=i,$e===null&&(Et=1,Tu(r,Kn(i,r.current)))}function tv(){var r=$n.current;return r===null?!0:(Pe&4194048)===Pe?er===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?r===er:!1}function nv(){var r=U.H;return U.H=Ns,r===null?Ns:r}function rv(){var r=U.A;return U.A=CT,r}function Uu(){Et=4,ka||(Pe&4194048)!==Pe&&$n.current!==null||(lo=!0),(wa&134217727)===0&&(pi&134217727)===0||it===null||_a(it,Pe,Un,!1)}function oh(r,i,s){var c=qe;qe|=2;var p=nv(),y=rv();(it!==r||Pe!==i)&&(Lu=null,fo(r,i)),i=!1;var k=Et;e:do try{if(Xe!==0&&$e!==null){var _=$e,R=Pn;switch(Xe){case 8:ih(),k=6;break e;case 3:case 2:case 9:case 6:$n.current===null&&(i=!0);var I=Xe;if(Xe=0,Pn=null,ho(r,_,R,I),s&&lo){k=0;break e}break;default:I=Xe,Xe=0,Pn=null,ho(r,_,R,I)}}AT(),k=Et;break}catch(J){ev(r,J)}while(!0);return i&&r.shellSuspendCounter++,Br=oi=null,qe=c,U.H=p,U.A=y,$e===null&&(it=null,Pe=0,iu()),k}function AT(){for(;$e!==null;)av($e)}function OT(r,i){var s=qe;qe|=2;var c=nv(),p=rv();it!==r||Pe!==i?(Lu=null,$u=ft()+500,fo(r,i)):lo=is(r,i);e:do try{if(Xe!==0&&$e!==null){i=$e;var y=Pn;t:switch(Xe){case 1:Xe=0,Pn=null,ho(r,i,y,1);break;case 2:case 9:if(mx(y)){Xe=0,Pn=null,iv(i);break}i=function(){Xe!==2&&Xe!==9||it!==r||(Xe=7),kr(r)},y.then(i,i);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:mx(y)?(Xe=0,Pn=null,iv(i)):(Xe=0,Pn=null,ho(r,i,y,7));break;case 5:var k=null;switch($e.tag){case 26:k=$e.memoizedState;case 5:case 27:var _=$e;if(k?Hv(k):_.stateNode.complete){Xe=0,Pn=null;var R=_.sibling;if(R!==null)$e=R;else{var I=_.return;I!==null?($e=I,Vu(I)):$e=null}break t}}Xe=0,Pn=null,ho(r,i,y,5);break;case 6:Xe=0,Pn=null,ho(r,i,y,6);break;case 8:ih(),Et=6;break e;default:throw Error(a(462))}}RT();break}catch(J){ev(r,J)}while(!0);return Br=oi=null,U.H=c,U.A=p,qe=s,$e!==null?0:(it=null,Pe=0,iu(),Et)}function RT(){for(;$e!==null&&!At();)av($e)}function av(r){var i=Cb(r.alternate,r,Jr);r.memoizedProps=r.pendingProps,i===null?Vu(r):$e=i}function iv(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=wb(s,i,i.pendingProps,i.type,void 0,Pe);break;case 11:i=wb(s,i,i.pendingProps,i.type.render,i.ref,Pe);break;case 5:kf(i);default:Nb(s,i),i=$e=rx(i,Jr),i=Cb(s,i,Jr)}r.memoizedProps=r.pendingProps,i===null?Vu(r):$e=i}function ho(r,i,s,c){Br=oi=null,kf(i),to=null,ws=0;var p=i.return;try{if(kT(r,p,i,s,Pe)){Et=1,Tu(r,Kn(s,r.current)),$e=null;return}}catch(y){if(p!==null)throw $e=p,y;Et=1,Tu(r,Kn(s,r.current)),$e=null;return}i.flags&32768?(Ve||c===1?r=!0:lo||(Pe&536870912)!==0?r=!1:(ka=r=!0,(c===2||c===9||c===3||c===6)&&(c=$n.current,c!==null&&c.tag===13&&(c.flags|=16384))),ov(i,r)):Vu(i)}function Vu(r){var i=r;do{if((i.flags&32768)!==0){ov(i,ka);return}r=i.return;var s=zT(i.alternate,i,Jr);if(s!==null){$e=s;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=r}while(i!==null);Et===0&&(Et=5)}function ov(r,i){do{var s=_T(r.alternate,r);if(s!==null){s.flags&=32767,$e=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){$e=r;return}$e=r=s}while(r!==null);Et=6,$e=null}function sv(r,i,s,c,p,y,k,_,R){r.cancelPendingCommit=null;do Bu();while(qt!==0);if((qe&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Gd,fj(r,s,y,k,_,R),r===it&&($e=it=null,Pe=0),co=i,za=r,Qr=s,nh=y,rh=p,Kb=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,LT(be,function(){return fv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=U.T,U.T=null,p=K.p,K.p=2,k=qe,qe|=4;try{jT(r,i,s)}finally{qe=k,K.p=p,U.T=c}}qt=1,lv(),uv(),cv()}}function lv(){if(qt===1){qt=0;var r=za,i=co,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=U.T,U.T=null;var c=K.p;K.p=2;var p=qe;qe|=4;try{Zb(i,r);var y=xh,k=Yy(r.containerInfo),_=y.focusedElem,R=y.selectionRange;if(k!==_&&_&&_.ownerDocument&&Gy(_.ownerDocument.documentElement,_)){if(R!==null&&Zd(_)){var I=R.start,J=R.end;if(J===void 0&&(J=I),"selectionStart"in _)_.selectionStart=I,_.selectionEnd=Math.min(J,_.value.length);else{var re=_.ownerDocument||document,F=re&&re.defaultView||window;if(F.getSelection){var Y=F.getSelection(),pe=_.textContent.length,_e=Math.min(R.start,pe),tt=R.end===void 0?_e:Math.min(R.end,pe);!Y.extend&&_e>tt&&(k=tt,tt=_e,_e=k);var P=qy(_,_e),D=qy(_,tt);if(P&&D&&(Y.rangeCount!==1||Y.anchorNode!==P.node||Y.anchorOffset!==P.offset||Y.focusNode!==D.node||Y.focusOffset!==D.offset)){var Z=re.createRange();Z.setStart(P.node,P.offset),Y.removeAllRanges(),_e>tt?(Y.addRange(Z),Y.extend(D.node,D.offset)):(Z.setEnd(D.node,D.offset),Y.addRange(Z))}}}}for(re=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var ne=re[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Wu=!!yh,xh=yh=null}finally{qe=p,K.p=c,U.T=s}}r.current=i,qt=2}}function uv(){if(qt===2){qt=0;var r=za,i=co,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=U.T,U.T=null;var c=K.p;K.p=2;var p=qe;qe|=4;try{Lb(r,i.alternate,i)}finally{qe=p,K.p=c,U.T=s}}qt=3}}function cv(){if(qt===4||qt===3){qt=0,Ht();var r=za,i=co,s=Qr,c=Kb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?qt=5:(qt=0,co=za=null,dv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Sa=null),Sd(s),i=i.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(mn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=U.T,p=K.p,K.p=2,U.T=null;try{for(var y=r.onRecoverableError,k=0;k<c.length;k++){var _=c[k];y(_.value,{componentStack:_.stack})}}finally{U.T=i,K.p=p}}(Qr&3)!==0&&Bu(),kr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===ah?Us++:(Us=0,ah=r):Us=0,Vs(0)}}function dv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,vs(i)))}function Bu(){return lv(),uv(),cv(),fv()}function fv(){if(qt!==5)return!1;var r=za,i=nh;nh=0;var s=Sd(Qr),c=U.T,p=K.p;try{K.p=32>s?32:s,U.T=null,s=rh,rh=null;var y=za,k=Qr;if(qt=0,co=za=null,Qr=0,(qe&6)!==0)throw Error(a(331));var _=qe;if(qe|=4,Gb(y.current),Hb(y,y.current,k,s),qe=_,Vs(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(mn,y)}catch{}return!0}finally{K.p=p,U.T=c,dv(r,i)}}function hv(r,i,s){i=Kn(s,i),i=$f(r.stateNode,i,2),r=ya(r,i,2),r!==null&&(os(r,2),kr(r))}function Ke(r,i,s){if(r.tag===3)hv(r,r,s);else for(;i!==null;){if(i.tag===3){hv(i,r,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Sa===null||!Sa.has(c))){r=Kn(s,r),s=mb(2),c=ya(i,s,2),c!==null&&(pb(s,c,i,r),os(c,2),kr(c));break}}i=i.return}}function sh(r,i,s){var c=r.pingCache;if(c===null){c=r.pingCache=new ET;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)||(Wf=!0,p.add(s),r=MT.bind(null,r,i,s),i.then(r,r))}function MT(r,i,s){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,it===r&&(Pe&s)===s&&(Et===4||Et===3&&(Pe&62914560)===Pe&&300>ft()-Du?(qe&2)===0&&fo(r,0):eh|=s,uo===Pe&&(uo=0)),kr(r)}function mv(r,i){i===0&&(i=ly()),r=ri(r,i),r!==null&&(os(r,i),kr(r))}function DT(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),mv(r,s)}function $T(r,i){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),mv(r,s)}function LT(r,i){return Xt(r,i)}var Zu=null,mo=null,lh=!1,Iu=!1,uh=!1,ja=0;function kr(r){r!==mo&&r.next===null&&(mo===null?Zu=mo=r:mo=mo.next=r),Iu=!0,lh||(lh=!0,UT())}function Vs(r,i){if(!uh&&Iu){uh=!0;do for(var s=!1,c=Zu;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var k=c.suspendedLanes,_=c.pingedLanes;y=(1<<31-at(42|r)+1)-1,y&=p&~(k&~_),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,xv(c,y))}else y=Pe,y=Gl(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||is(c,y)||(s=!0,xv(c,y));c=c.next}while(s);uh=!1}}function PT(){pv()}function pv(){Iu=lh=!1;var r=0;ja!==0&&XT()&&(r=ja);for(var i=ft(),s=null,c=Zu;c!==null;){var p=c.next,y=gv(c,i);y===0?(c.next=null,s===null?Zu=p:s.next=p,p===null&&(mo=s)):(s=c,(r!==0||(y&3)!==0)&&(Iu=!0)),c=p}qt!==0&&qt!==5||Vs(r),ja!==0&&(ja=0)}function gv(r,i){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var k=31-at(y),_=1<<k,R=p[k];R===-1?((_&s)===0||(_&c)!==0)&&(p[k]=dj(_,i)):R<=i&&(r.expiredLanes|=_),y&=~_}if(i=it,s=Pe,s=Gl(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===i&&(Xe===2||Xe===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&qn(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||is(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(c!==null&&qn(c),Sd(s)){case 2:case 8:s=ue;break;case 32:s=be;break;case 268435456:s=Be;break;default:s=be}return c=yv.bind(null,r),s=Xt(s,c),r.callbackPriority=i,r.callbackNode=s,i}return c!==null&&c!==null&&qn(c),r.callbackPriority=2,r.callbackNode=null,2}function yv(r,i){if(qt!==0&&qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Bu()&&r.callbackNode!==s)return null;var c=Pe;return c=Gl(r,r===it?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Qb(r,c,i),gv(r,ft()),r.callbackNode!=null&&r.callbackNode===s?yv.bind(null,r):null)}function xv(r,i){if(Bu())return null;Qb(r,i,!0)}function UT(){JT(function(){(qe&6)!==0?Xt(W,PT):pv()})}function ch(){if(ja===0){var r=Qi;r===0&&(r=Hl,Hl<<=1,(Hl&261888)===0&&(Hl=256)),ja=r}return ja}function bv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Jl(""+r)}function vv(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function VT(r,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var y=bv((p[wn]||null).action),k=c.submitter;k&&(i=(i=k[wn]||null)?bv(i.formAction):k.getAttribute("formAction"),i!==null&&(y=i,k=null));var _=new tu("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ja!==0){var R=k?vv(p,k):new FormData(p);Nf(s,{pending:!0,data:R,method:p.method,action:y},null,R)}}else typeof y=="function"&&(_.preventDefault(),R=k?vv(p,k):new FormData(p),Nf(s,{pending:!0,data:R,method:p.method,action:y},y,R))},currentTarget:p}]})}}for(var dh=0;dh<qd.length;dh++){var fh=qd[dh],BT=fh.toLowerCase(),ZT=fh[0].toUpperCase()+fh.slice(1);dr(BT,"on"+ZT)}dr(Jy,"onAnimationEnd"),dr(Qy,"onAnimationIteration"),dr(Wy,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(aT,"onTransitionRun"),dr(iT,"onTransitionStart"),dr(oT,"onTransitionCancel"),dr(ex,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),Wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bs="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(" "),IT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bs));function kv(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var y=void 0;if(i)for(var k=c.length-1;0<=k;k--){var _=c[k],R=_.instance,I=_.currentTarget;if(_=_.listener,R!==y&&p.isPropagationStopped())break e;y=_,p.currentTarget=I;try{y(p)}catch(J){au(J)}p.currentTarget=null,y=R}else for(k=0;k<c.length;k++){if(_=c[k],R=_.instance,I=_.currentTarget,_=_.listener,R!==y&&p.isPropagationStopped())break e;y=_,p.currentTarget=I;try{y(p)}catch(J){au(J)}p.currentTarget=null,y=R}}}}function Le(r,i){var s=i[zd];s===void 0&&(s=i[zd]=new Set);var c=r+"__bubble";s.has(c)||(wv(i,r,2,!1),s.add(c))}function hh(r,i,s){var c=0;i&&(c|=4),wv(s,r,c,i)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function mh(r){if(!r[Hu]){r[Hu]=!0,py.forEach(function(s){s!=="selectionchange"&&(IT.has(s)||hh(s,!1,r),hh(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Hu]||(i[Hu]=!0,hh("selectionchange",!1,i))}}function wv(r,i,s,c){switch(Jv(i)){case 2:var p=yC;break;case 8:p=xC;break;default:p=Eh}s=p.bind(null,i,s,r),p=void 0,!Rd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function ph(r,i,s,c,p){var y=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var _=c.stateNode.containerInfo;if(_===p)break;if(k===4)for(k=c.return;k!==null;){var R=k.tag;if((R===3||R===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;_!==null;){if(k=Di(_),k===null)return;if(R=k.tag,R===5||R===6||R===26||R===27){c=y=k;continue e}_=_.parentNode}}c=c.return}Ty(function(){var I=y,J=Ad(s),re=[];e:{var F=tx.get(r);if(F!==void 0){var Y=tu,pe=r;switch(r){case"keypress":if(Wl(s)===0)break e;case"keydown":case"keyup":Y=$j;break;case"focusin":pe="focus",Y=Ld;break;case"focusout":pe="blur",Y=Ld;break;case"beforeblur":case"afterblur":Y=Ld;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=Ny;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=zj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Uj;break;case Jy:case Qy:case Wy:Y=Tj;break;case ex:Y=Bj;break;case"scroll":case"scrollend":Y=wj;break;case"wheel":Y=Ij;break;case"copy":case"cut":case"paste":Y=Ej;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Oy;break;case"toggle":case"beforetoggle":Y=Fj}var _e=(i&4)!==0,tt=!_e&&(r==="scroll"||r==="scrollend"),P=_e?F!==null?F+"Capture":null:F;_e=[];for(var D=I,Z;D!==null;){var ne=D;if(Z=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||Z===null||P===null||(ne=us(D,P),ne!=null&&_e.push(Zs(D,ne,Z))),tt)break;D=D.return}0<_e.length&&(F=new Y(F,pe,null,s,J),re.push({event:F,listeners:_e}))}}if((i&7)===0){e:{if(F=r==="mouseover"||r==="pointerover",Y=r==="mouseout"||r==="pointerout",F&&s!==Nd&&(pe=s.relatedTarget||s.fromElement)&&(Di(pe)||pe[Mi]))break e;if((Y||F)&&(F=J.window===J?J:(F=J.ownerDocument)?F.defaultView||F.parentWindow:window,Y?(pe=s.relatedTarget||s.toElement,Y=I,pe=pe?Di(pe):null,pe!==null&&(tt=u(pe),_e=pe.tag,pe!==tt||_e!==5&&_e!==27&&_e!==6)&&(pe=null)):(Y=null,pe=I),Y!==pe)){if(_e=Ny,ne="onMouseLeave",P="onMouseEnter",D="mouse",(r==="pointerout"||r==="pointerover")&&(_e=Oy,ne="onPointerLeave",P="onPointerEnter",D="pointer"),tt=Y==null?F:ls(Y),Z=pe==null?F:ls(pe),F=new _e(ne,D+"leave",Y,s,J),F.target=tt,F.relatedTarget=Z,ne=null,Di(J)===I&&(_e=new _e(P,D+"enter",pe,s,J),_e.target=Z,_e.relatedTarget=tt,ne=_e),tt=ne,Y&&pe)t:{for(_e=HT,P=Y,D=pe,Z=0,ne=P;ne;ne=_e(ne))Z++;ne=0;for(var Se=D;Se;Se=_e(Se))ne++;for(;0<Z-ne;)P=_e(P),Z--;for(;0<ne-Z;)D=_e(D),ne--;for(;Z--;){if(P===D||D!==null&&P===D.alternate){_e=P;break t}P=_e(P),D=_e(D)}_e=null}else _e=null;Y!==null&&Sv(re,F,Y,_e,!1),pe!==null&&tt!==null&&Sv(re,tt,pe,_e,!0)}}e:{if(F=I?ls(I):window,Y=F.nodeName&&F.nodeName.toLowerCase(),Y==="select"||Y==="input"&&F.type==="file")var He=Vy;else if(Py(F))if(By)He=tT;else{He=Wj;var ve=Qj}else Y=F.nodeName,!Y||Y.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?I&&Ed(I.elementType)&&(He=Vy):He=eT;if(He&&(He=He(r,I))){Uy(re,He,s,J);break e}ve&&ve(r,F,I),r==="focusout"&&I&&F.type==="number"&&I.memoizedProps.value!=null&&Cd(F,"number",F.value)}switch(ve=I?ls(I):window,r){case"focusin":(Py(ve)||ve.contentEditable==="true")&&(Hi=ve,Id=I,ys=null);break;case"focusout":ys=Id=Hi=null;break;case"mousedown":Hd=!0;break;case"contextmenu":case"mouseup":case"dragend":Hd=!1,Xy(re,s,J);break;case"selectionchange":if(rT)break;case"keydown":case"keyup":Xy(re,s,J)}var Oe;if(Ud)e:{switch(r){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ii?$y(r,s)&&(Ue="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(Ue="onCompositionStart");Ue&&(Ry&&s.locale!=="ko"&&(Ii||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ii&&(Oe=Cy()):(ca=J,Md="value"in ca?ca.value:ca.textContent,Ii=!0)),ve=Fu(I,Ue),0<ve.length&&(Ue=new Ay(Ue,r,null,s,J),re.push({event:Ue,listeners:ve}),Oe?Ue.data=Oe:(Oe=Ly(s),Oe!==null&&(Ue.data=Oe)))),(Oe=Gj?Yj(r,s):Xj(r,s))&&(Ue=Fu(I,"onBeforeInput"),0<Ue.length&&(ve=new Ay("onBeforeInput","beforeinput",null,s,J),re.push({event:ve,listeners:Ue}),ve.data=Oe)),VT(re,r,I,s,J)}kv(re,i)})}function Zs(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Fu(r,i){for(var s=i+"Capture",c=[];r!==null;){var p=r,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=us(r,s),p!=null&&c.unshift(Zs(r,p,y)),p=us(r,i),p!=null&&c.push(Zs(r,p,y))),r.tag===3)return c;r=r.return}return[]}function HT(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Sv(r,i,s,c,p){for(var y=i._reactName,k=[];s!==null&&s!==c;){var _=s,R=_.alternate,I=_.stateNode;if(_=_.tag,R!==null&&R===c)break;_!==5&&_!==26&&_!==27||I===null||(R=I,p?(I=us(s,y),I!=null&&k.unshift(Zs(s,I,R))):p||(I=us(s,y),I!=null&&k.push(Zs(s,I,R)))),s=s.return}k.length!==0&&r.push({event:i,listeners:k})}var FT=/\r\n?/g,qT=/\u0000|\uFFFD/g;function zv(r){return(typeof r=="string"?r:""+r).replace(FT,`
9
+ `).replace(qT,"")}function _v(r,i){return i=zv(i),zv(r)===i}function et(r,i,s,c,p,y){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Vi(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Vi(r,""+c);break;case"className":Xl(r,"class",c);break;case"tabIndex":Xl(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Xl(r,s,c);break;case"style":_y(r,c,y);break;case"data":if(i!=="object"){Xl(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Jl(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(s==="formAction"?(i!=="input"&&et(r,i,"name",p.name,p,null),et(r,i,"formEncType",p.formEncType,p,null),et(r,i,"formMethod",p.formMethod,p,null),et(r,i,"formTarget",p.formTarget,p,null)):(et(r,i,"encType",p.encType,p,null),et(r,i,"method",p.method,p,null),et(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Jl(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Lr);break;case"onScroll":c!=null&&Le("scroll",r);break;case"onScrollEnd":c!=null&&Le("scrollend",r);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));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Jl(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Le("beforetoggle",r),Le("toggle",r),Yl(r,"popover",c);break;case"xlinkActuate":$r(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":$r(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":$r(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":$r(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":$r(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":$r(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":$r(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":$r(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":$r(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Yl(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=vj.get(s)||s,Yl(r,s,c))}}function gh(r,i,s,c,p,y){switch(s){case"style":_y(r,c,y);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));r.innerHTML=s}}break;case"children":typeof c=="string"?Vi(r,c):(typeof c=="number"||typeof c=="bigint")&&Vi(r,""+c);break;case"onScroll":c!=null&&Le("scroll",r);break;case"onScrollEnd":c!=null&&Le("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gy.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),y=r[wn]||null,y=y!=null?y[s]:null,typeof y=="function"&&r.removeEventListener(i,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Yl(r,s,c)}}}function rn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",r),Le("load",r);var c=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var k=s[y];if(k!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:et(r,i,y,k,s,null)}}p&&et(r,i,"srcSet",s.srcSet,s,null),c&&et(r,i,"src",s.src,s,null);return;case"input":Le("invalid",r);var _=y=k=p=null,R=null,I=null;for(c in s)if(s.hasOwnProperty(c)){var J=s[c];if(J!=null)switch(c){case"name":p=J;break;case"type":k=J;break;case"checked":R=J;break;case"defaultChecked":I=J;break;case"value":y=J;break;case"defaultValue":_=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:et(r,i,c,J,s,null)}}ky(r,y,_,R,I,k,p,!1);return;case"select":Le("invalid",r),c=k=y=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":y=_;break;case"defaultValue":k=_;break;case"multiple":c=_;default:et(r,i,p,_,s,null)}i=y,s=k,r.multiple=!!c,i!=null?Ui(r,!!c,i,!1):s!=null&&Ui(r,!!c,s,!0);return;case"textarea":Le("invalid",r),y=p=c=null;for(k in s)if(s.hasOwnProperty(k)&&(_=s[k],_!=null))switch(k){case"value":c=_;break;case"defaultValue":p=_;break;case"children":y=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:et(r,i,k,_,s,null)}Sy(r,c,p,y);return;case"option":for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null)&&(R==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":et(r,i,R,c,s,null));return;case"dialog":Le("beforetoggle",r),Le("toggle",r),Le("cancel",r),Le("close",r);break;case"iframe":case"object":Le("load",r);break;case"video":case"audio":for(c=0;c<Bs.length;c++)Le(Bs[c],r);break;case"image":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"embed":case"source":case"link":Le("error",r),Le("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(I in s)if(s.hasOwnProperty(I)&&(c=s[I],c!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:et(r,i,I,c,s,null)}return;default:if(Ed(i)){for(J in s)s.hasOwnProperty(J)&&(c=s[J],c!==void 0&&gh(r,i,J,c,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(c=s[_],c!=null&&et(r,i,_,c,s,null))}function GT(r,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,y=null,k=null,_=null,R=null,I=null,J=null;for(Y in s){var re=s[Y];if(s.hasOwnProperty(Y)&&re!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":R=re;default:c.hasOwnProperty(Y)||et(r,i,Y,null,c,re)}}for(var F in c){var Y=c[F];if(re=s[F],c.hasOwnProperty(F)&&(Y!=null||re!=null))switch(F){case"type":y=Y;break;case"name":p=Y;break;case"checked":I=Y;break;case"defaultChecked":J=Y;break;case"value":k=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==re&&et(r,i,F,Y,c,re)}}Td(r,k,_,R,I,J,y,p);return;case"select":Y=k=_=F=null;for(y in s)if(R=s[y],s.hasOwnProperty(y)&&R!=null)switch(y){case"value":break;case"multiple":Y=R;default:c.hasOwnProperty(y)||et(r,i,y,null,c,R)}for(p in c)if(y=c[p],R=s[p],c.hasOwnProperty(p)&&(y!=null||R!=null))switch(p){case"value":F=y;break;case"defaultValue":_=y;break;case"multiple":k=y;default:y!==R&&et(r,i,p,y,c,R)}i=_,s=k,c=Y,F!=null?Ui(r,!!s,F,!1):!!c!=!!s&&(i!=null?Ui(r,!!s,i,!0):Ui(r,!!s,s?[]:"",!1));return;case"textarea":Y=F=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:et(r,i,_,null,c,p)}for(k in c)if(p=c[k],y=s[k],c.hasOwnProperty(k)&&(p!=null||y!=null))switch(k){case"value":F=p;break;case"defaultValue":Y=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&et(r,i,k,p,c,y)}wy(r,F,Y);return;case"option":for(var pe in s)F=s[pe],s.hasOwnProperty(pe)&&F!=null&&!c.hasOwnProperty(pe)&&(pe==="selected"?r.selected=!1:et(r,i,pe,null,c,F));for(R in c)F=c[R],Y=s[R],c.hasOwnProperty(R)&&F!==Y&&(F!=null||Y!=null)&&(R==="selected"?r.selected=F&&typeof F!="function"&&typeof F!="symbol":et(r,i,R,F,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 _e in s)F=s[_e],s.hasOwnProperty(_e)&&F!=null&&!c.hasOwnProperty(_e)&&et(r,i,_e,null,c,F);for(I in c)if(F=c[I],Y=s[I],c.hasOwnProperty(I)&&F!==Y&&(F!=null||Y!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,i));break;default:et(r,i,I,F,c,Y)}return;default:if(Ed(i)){for(var tt in s)F=s[tt],s.hasOwnProperty(tt)&&F!==void 0&&!c.hasOwnProperty(tt)&&gh(r,i,tt,void 0,c,F);for(J in c)F=c[J],Y=s[J],!c.hasOwnProperty(J)||F===Y||F===void 0&&Y===void 0||gh(r,i,J,F,c,Y);return}}for(var P in s)F=s[P],s.hasOwnProperty(P)&&F!=null&&!c.hasOwnProperty(P)&&et(r,i,P,null,c,F);for(re in c)F=c[re],Y=s[re],!c.hasOwnProperty(re)||F===Y||F==null&&Y==null||et(r,i,re,F,c,Y)}function jv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function YT(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],y=p.transferSize,k=p.initiatorType,_=p.duration;if(y&&_&&jv(k)){for(k=0,_=p.responseEnd,c+=1;c<s.length;c++){var R=s[c],I=R.startTime;if(I>_)break;var J=R.transferSize,re=R.initiatorType;J&&jv(re)&&(R=R.responseEnd,k+=J*(R<_?1:(_-I)/(R-I)))}if(--c,i+=8*(y+k)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var yh=null,xh=null;function qu(r){return r.nodeType===9?r:r.ownerDocument}function Tv(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cv(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function bh(r,i){return r==="textarea"||r==="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 vh=null;function XT(){var r=window.event;return r&&r.type==="popstate"?r===vh?!1:(vh=r,!0):(vh=null,!1)}var Ev=typeof setTimeout=="function"?setTimeout:void 0,KT=typeof clearTimeout=="function"?clearTimeout:void 0,Nv=typeof Promise=="function"?Promise:void 0,JT=typeof queueMicrotask=="function"?queueMicrotask:typeof Nv<"u"?function(r){return Nv.resolve(null).then(r).catch(QT)}:Ev;function QT(r){setTimeout(function(){throw r})}function Ta(r){return r==="head"}function Av(r,i){var s=i,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),xo(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Is(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Is(s);for(var y=s.firstChild;y;){var k=y.nextSibling,_=y.nodeName;y[ss]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=k}}else s==="body"&&Is(r.ownerDocument.body);s=p}while(s);xo(i)}function Ov(r,i){var s=r;r=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(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function kh(r){var i=r.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":kh(s),_d(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function WT(r,i,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[ss])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=tr(r.nextSibling),r===null)break}return null}function eC(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=tr(r.nextSibling),r===null))return null;return r}function Rv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=tr(r.nextSibling),r===null))return null;return r}function wh(r){return r.data==="$?"||r.data==="$~"}function Sh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function tC(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function tr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var zh=null;function Mv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return tr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Dv(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function $v(r,i,s){switch(i=qu(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Is(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);_d(r)}var nr=new Map,Lv=new Set;function Gu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Wr=K.d;K.d={f:nC,r:rC,D:aC,C:iC,L:oC,m:sC,X:uC,S:lC,M:cC};function nC(){var r=Wr.f(),i=Pu();return r||i}function rC(r){var i=$i(r);i!==null&&i.tag===5&&i.type==="form"?eb(i):Wr.r(r)}var po=typeof document>"u"?null:document;function Pv(r,i,s){var c=po;if(c&&typeof i=="string"&&i){var p=Yn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Lv.has(p)||(Lv.add(p),r={rel:r,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),rn(i,"link",r),Kt(i),c.head.appendChild(i)))}}function aC(r){Wr.D(r),Pv("dns-prefetch",r,null)}function iC(r,i){Wr.C(r,i),Pv("preconnect",r,i)}function oC(r,i,s){Wr.L(r,i,s);var c=po;if(c&&r&&i){var p='link[rel="preload"][as="'+Yn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+Yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+Yn(s.imageSizes)+'"]')):p+='[href="'+Yn(r)+'"]';var y=p;switch(i){case"style":y=go(r);break;case"script":y=yo(r)}nr.has(y)||(r=x({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),nr.set(y,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Hs(y))||i==="script"&&c.querySelector(Fs(y))||(i=c.createElement("link"),rn(i,"link",r),Kt(i),c.head.appendChild(i)))}}function sC(r,i){Wr.m(r,i);var s=po;if(s&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Yn(c)+'"][href="'+Yn(r)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yo(r)}if(!nr.has(y)&&(r=x({rel:"modulepreload",href:r},i),nr.set(y,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Fs(y)))return}c=s.createElement("link"),rn(c,"link",r),Kt(c),s.head.appendChild(c)}}}function lC(r,i,s){Wr.S(r,i,s);var c=po;if(c&&r){var p=Li(c).hoistableStyles,y=go(r);i=i||"default";var k=p.get(y);if(!k){var _={loading:0,preload:null};if(k=c.querySelector(Hs(y)))_.loading=5;else{r=x({rel:"stylesheet",href:r,"data-precedence":i},s),(s=nr.get(y))&&_h(r,s);var R=k=c.createElement("link");Kt(R),rn(R,"link",r),R._p=new Promise(function(I,J){R.onload=I,R.onerror=J}),R.addEventListener("load",function(){_.loading|=1}),R.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Yu(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:_},p.set(y,k)}}}function uC(r,i){Wr.X(r,i);var s=po;if(s&&r){var c=Li(s).hoistableScripts,p=yo(r),y=c.get(p);y||(y=s.querySelector(Fs(p)),y||(r=x({src:r,async:!0},i),(i=nr.get(p))&&jh(r,i),y=s.createElement("script"),Kt(y),rn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function cC(r,i){Wr.M(r,i);var s=po;if(s&&r){var c=Li(s).hoistableScripts,p=yo(r),y=c.get(p);y||(y=s.querySelector(Fs(p)),y||(r=x({src:r,async:!0,type:"module"},i),(i=nr.get(p))&&jh(r,i),y=s.createElement("script"),Kt(y),rn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Uv(r,i,s,c){var p=(p=fe.current)?Gu(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=go(s.href),s=Li(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"){r=go(s.href);var y=Li(p).hoistableStyles,k=y.get(r);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,k),(y=p.querySelector(Hs(r)))&&!y._p&&(k.instance=y,k.state.loading=5),nr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},nr.set(r,s),y||dC(p,r,s,k.state))),i&&c===null)throw Error(a(528,""));return k}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=yo(s),s=Li(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,r))}}function go(r){return'href="'+Yn(r)+'"'}function Hs(r){return'link[rel="stylesheet"]['+r+"]"}function Vv(r){return x({},r,{"data-precedence":r.precedence,precedence:null})}function dC(r,i,s,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),rn(i,"link",s),Kt(i),r.head.appendChild(i))}function yo(r){return'[src="'+Yn(r)+'"]'}function Fs(r){return"script[async]"+r}function Bv(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+Yn(s.href)+'"]');if(c)return i.instance=c,Kt(c),c;var p=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Kt(c),rn(c,"style",p),Yu(c,s.precedence,r),i.instance=c;case"stylesheet":p=go(s.href);var y=r.querySelector(Hs(p));if(y)return i.state.loading|=4,i.instance=y,Kt(y),y;c=Vv(s),(p=nr.get(p))&&_h(c,p),y=(r.ownerDocument||r).createElement("link"),Kt(y);var k=y;return k._p=new Promise(function(_,R){k.onload=_,k.onerror=R}),rn(y,"link",c),i.state.loading|=4,Yu(y,s.precedence,r),i.instance=y;case"script":return y=yo(s.src),(p=r.querySelector(Fs(y)))?(i.instance=p,Kt(p),p):(c=s,(p=nr.get(y))&&(c=x({},s),jh(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Kt(p),rn(p,"link",c),r.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,Yu(c,s.precedence,r));return i.instance}function Yu(r,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,k=0;k<c.length;k++){var _=c[k];if(_.dataset.precedence===i)y=_;else if(y!==p)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function _h(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function jh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Xu=null;function Zv(r,i,s){if(Xu===null){var c=new Map,p=Xu=new Map;p.set(s,c)}else p=Xu,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var y=s[p];if(!(y[ss]||y[Wt]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(i)||"";k=r+k;var _=c.get(k);_?_.push(y):c.set(k,[y])}}return c}function Iv(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function fC(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){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;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!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 Hv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function hC(r,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=go(c.href),y=i.querySelector(Hs(p));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Ku.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=y,Kt(y);return}y=i.ownerDocument||i,c=Vv(c),(p=nr.get(p))&&_h(c,p),y=y.createElement("link"),Kt(y);var k=y;k._p=new Promise(function(_,R){k.onload=_,k.onerror=R}),rn(y,"link",c),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=Ku.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Th=0;function mC(r,i){return r.stylesheets&&r.count===0&&Qu(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Qu(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&Th===0&&(Th=62500*YT());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Qu(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>Th?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ju=null;function Qu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ju=new Map,i.forEach(pC,r),Ju=null,Ku.call(r))}function pC(r,i){if(!(i.state.loading&4)){var s=Ju.get(r);if(s)var c=s.get(null);else{s=new Map,Ju.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var k=p[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),c=k)}c&&s.set(null,c)}p=i.instance,k=p.getAttribute("data-precedence"),y=s.get(k)||c,y===c&&s.set(null,p),s.set(k,p),this.count++,c=Ku.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var qs={$$typeof:C,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function gC(r,i,s,c,p,y,k,_,R){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kd(0),this.hiddenUpdates=kd(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Fv(r,i,s,c,p,y,k,_,R,I,J,re){return r=new gC(r,i,s,k,R,I,J,re,_),i=1,y===!0&&(i|=24),y=Dn(3,null,null,i),r.current=y,y.stateNode=r,i=of(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:c,isDehydrated:s,cache:i},cf(y),r}function qv(r){return r?(r=Gi,r):Gi}function Gv(r,i,s,c,p,y){p=qv(p),c.context===null?c.context=p:c.pendingContext=p,c=ga(i),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=ya(r,c,i),s!==null&&(Cn(s,r,i),zs(s,r,i))}function Yv(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Ch(r,i){Yv(r,i),(r=r.alternate)&&Yv(r,i)}function Xv(r){if(r.tag===13||r.tag===31){var i=ri(r,67108864);i!==null&&Cn(i,r,67108864),Ch(r,67108864)}}function Kv(r){if(r.tag===13||r.tag===31){var i=Vn();i=wd(i);var s=ri(r,i);s!==null&&Cn(s,r,i),Ch(r,i)}}var Wu=!0;function yC(r,i,s,c){var p=U.T;U.T=null;var y=K.p;try{K.p=2,Eh(r,i,s,c)}finally{K.p=y,U.T=p}}function xC(r,i,s,c){var p=U.T;U.T=null;var y=K.p;try{K.p=8,Eh(r,i,s,c)}finally{K.p=y,U.T=p}}function Eh(r,i,s,c){if(Wu){var p=Nh(c);if(p===null)ph(r,i,c,ec,s),Qv(r,c);else if(vC(p,r,i,s,c))c.stopPropagation();else if(Qv(r,c),i&4&&-1<bC.indexOf(r)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=Qa(y.pendingLanes);if(k!==0){var _=y;for(_.pendingLanes|=2,_.entangledLanes|=2;k;){var R=1<<31-at(k);_.entanglements[1]|=R,k&=~R}kr(y),(qe&6)===0&&($u=ft()+500,Vs(0))}}break;case 31:case 13:_=ri(y,2),_!==null&&Cn(_,y,2),Pu(),Ch(y,2)}if(y=Nh(c),y===null&&ph(r,i,c,ec,s),y===p)break;p=y}p!==null&&c.stopPropagation()}else ph(r,i,c,null,s)}}function Nh(r){return r=Ad(r),Ah(r)}var ec=null;function Ah(r){if(ec=null,r=Di(r),r!==null){var i=u(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=l(i),r!==null)return r;r=null}else if(s===31){if(r=d(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return ec=r,null}function Jv(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ri()){case W:return 2;case ue:return 8;case be:case je:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Oh=!1,Ca=null,Ea=null,Na=null,Gs=new Map,Ys=new Map,Aa=[],bC="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 Qv(r,i){switch(r){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ea=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":Gs.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(i.pointerId)}}function Xs(r,i,s,c,p,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},i!==null&&(i=$i(i),i!==null&&Xv(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function vC(r,i,s,c,p){switch(i){case"focusin":return Ca=Xs(Ca,r,i,s,c,p),!0;case"dragenter":return Ea=Xs(Ea,r,i,s,c,p),!0;case"mouseover":return Na=Xs(Na,r,i,s,c,p),!0;case"pointerover":var y=p.pointerId;return Gs.set(y,Xs(Gs.get(y)||null,r,i,s,c,p)),!0;case"gotpointercapture":return y=p.pointerId,Ys.set(y,Xs(Ys.get(y)||null,r,i,s,c,p)),!0}return!1}function Wv(r){var i=Di(r.target);if(i!==null){var s=u(i);if(s!==null){if(i=s.tag,i===13){if(i=l(s),i!==null){r.blockedOn=i,hy(r.priority,function(){Kv(s)});return}}else if(i===31){if(i=d(s),i!==null){r.blockedOn=i,hy(r.priority,function(){Kv(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function tc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Nh(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);Nd=c,s.target.dispatchEvent(c),Nd=null}else return i=$i(s),i!==null&&Xv(i),r.blockedOn=s,!1;i.shift()}return!0}function e0(r,i,s){tc(r)&&s.delete(i)}function kC(){Oh=!1,Ca!==null&&tc(Ca)&&(Ca=null),Ea!==null&&tc(Ea)&&(Ea=null),Na!==null&&tc(Na)&&(Na=null),Gs.forEach(e0),Ys.forEach(e0)}function nc(r,i){r.blockedOn===i&&(r.blockedOn=null,Oh||(Oh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kC)))}var rc=null;function t0(r){rc!==r&&(rc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){rc===r&&(rc=null);for(var i=0;i<r.length;i+=3){var s=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Ah(c||s)===null)continue;break}var y=$i(s);y!==null&&(r.splice(i,3),i-=3,Nf(y,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function xo(r){function i(R){return nc(R,r)}Ca!==null&&nc(Ca,r),Ea!==null&&nc(Ea,r),Na!==null&&nc(Na,r),Gs.forEach(i),Ys.forEach(i);for(var s=0;s<Aa.length;s++){var c=Aa[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Aa.length&&(s=Aa[0],s.blockedOn===null);)Wv(s),s.blockedOn===null&&Aa.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],y=s[c+1],k=p[wn]||null;if(typeof y=="function")k||t0(s);else if(k){var _=null;if(y&&y.hasAttribute("formAction")){if(p=y,k=y[wn]||null)_=k.formAction;else if(Ah(p)!==null)continue}else _=k.action;typeof _=="function"?s[c+1]=_:(s.splice(c,3),c-=3),t0(s)}}}function n0(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Rh(r){this._internalRoot=r}ac.prototype.render=Rh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Vn();Gv(s,c,r,i,null,null)},ac.prototype.unmount=Rh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Gv(r.current,2,null,r,null,null),Pu(),i[Mi]=null}};function ac(r){this._internalRoot=r}ac.prototype.unstable_scheduleHydration=function(r){if(r){var i=fy();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Aa.length&&i!==0&&i<Aa[s].priority;s++);Aa.splice(s,0,r),s===0&&Wv(r)}};var r0=t.version;if(r0!=="19.2.4")throw Error(a(527,r0,"19.2.4"));K.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var wC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{mn=ic.inject(wC),Ft=ic}catch{}}return Js.createRoot=function(r,i){if(!o(r))throw Error(a(299));var s=!1,c="",p=cb,y=db,k=fb;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&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=Fv(r,1,!1,null,null,s,c,null,p,y,k,n0),r[Mi]=i.current,mh(r),new Rh(i)},Js.hydrateRoot=function(r,i,s){if(!o(r))throw Error(a(299));var c=!1,p="",y=cb,k=db,_=fb,R=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(R=s.formState)),i=Fv(r,1,!0,i,s??null,c,p,R,y,k,_,n0),i.context=qv(null),s=i.current,c=Vn(),c=wd(c),p=ga(c),p.callback=null,ya(s,p,c),s=c,i.current.lanes=s,os(i,s),kr(i),r[Mi]=i.current,mh(r),new ac(i)},Js.version="19.2.4",Js}var h0;function OC(){if(h0)return $h.exports;h0=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(),$h.exports=AC(),$h.exports}var RC=OC();var m0="popstate";function MC(e={}){function t(a,o){let{pathname:u,search:l,hash:d}=a.location;return Pm("",{pathname:u,search:l,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(a,o){return typeof o=="string"?o:bl(o)}return $C(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DC(){return Math.random().toString(36).substring(2,10)}function p0(e,t){return{usr:e.state,key:e.key,idx:t}}function Pm(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Go(t):t,state:n,key:t&&t.key||a||DC()}}function bl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Go(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function $C(e,t,n,a={}){let{window:o=document.defaultView,v5Compat:u=!1}=a,l=o.history,d="POP",h=null,m=g();m==null&&(m=0,l.replaceState({...l.state,idx:m},""));function g(){return(l.state||{idx:null}).idx}function x(){d="POP";let E=g(),N=E==null?null:E-m;m=E,h&&h({action:d,location:T.location,delta:N})}function b(E,N){d="PUSH";let A=Pm(T.location,E,N);m=g()+1;let C=p0(A,m),$=T.createHref(A);try{l.pushState(C,"",$)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign($)}u&&h&&h({action:d,location:T.location,delta:1})}function v(E,N){d="REPLACE";let A=Pm(T.location,E,N);m=g();let C=p0(A,m),$=T.createHref(A);l.replaceState(C,"",$),u&&h&&h({action:d,location:T.location,delta:0})}function z(E){return LC(E)}let T={get action(){return d},get location(){return e(o,l)},listen(E){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(m0,x),h=E,()=>{o.removeEventListener(m0,x),h=null}},createHref(E){return t(o,E)},createURL:z,encodeLocation(E){let N=z(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:v,go(E){return l.go(E)}};return T}function LC(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:bl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function Zw(e,t,n="/"){return PC(e,t,n,!1)}function PC(e,t,n,a){let o=typeof t=="string"?Go(t):t,u=oa(o.pathname||"/",n);if(u==null)return null;let l=Iw(e);UC(l);let d=null;for(let h=0;d==null&&h<l.length;++h){let m=KC(u);d=YC(l[h],m,a)}return d}function Iw(e,t=[],n=[],a="",o=!1){let u=(l,d,h=o,m)=>{let g={relativePath:m===void 0?l.path||"":m,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;xt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let x=aa([a,g.relativePath]),b=n.concat(g);l.children&&l.children.length>0&&(xt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Iw(l.children,t,b,x,h)),!(l.path==null&&!l.index)&&t.push({path:x,score:qC(x,l.index),routesMeta:b})};return e.forEach((l,d)=>{if(l.path===""||!l.path?.includes("?"))u(l,d);else for(let h of Hw(l.path))u(l,d,!0,h)}),t}function Hw(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,o=n.endsWith("?"),u=n.replace(/\?$/,"");if(a.length===0)return o?[u,""]:[u];let l=Hw(a.join("/")),d=[];return d.push(...l.map(h=>h===""?u:[u,h].join("/"))),o&&d.push(...l),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function UC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GC(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var VC=/^:[\w-]+$/,BC=3,ZC=2,IC=1,HC=10,FC=-2,g0=e=>e==="*";function qC(e,t){let n=e.split("/"),a=n.length;return n.some(g0)&&(a+=FC),t&&(a+=ZC),n.filter(o=>!g0(o)).reduce((o,u)=>o+(VC.test(u)?BC:u===""?IC:HC),a)}function GC(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function YC(e,t,n=!1){let{routesMeta:a}=e,o={},u="/",l=[];for(let d=0;d<a.length;++d){let h=a[d],m=d===a.length-1,g=u==="/"?t:t.slice(u.length)||"/",x=Dc({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),b=h.route;if(!x&&m&&n&&!a[a.length-1].route.index&&(x=Dc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!x)return null;Object.assign(o,x.params),l.push({params:o,pathname:aa([u,x.pathname]),pathnameBase:eE(aa([u,x.pathnameBase])),route:b}),x.pathnameBase!=="/"&&(u=aa([u,x.pathnameBase]))}return l}function Dc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=XC(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let u=o[0],l=u.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:x},b)=>{if(g==="*"){let z=d[b]||"";l=u.slice(0,u.length-z.length).replace(/(.)\/+$/,"$1")}const v=d[b];return x&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function XC(e,t=!1,n=!0){gr(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,h)=>(a.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function KC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return gr(!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 oa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var JC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function QC(e,t="/"){let{pathname:n,search:a="",hash:o=""}=typeof e=="string"?Go(e):e,u;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?u=y0(n.substring(1),"/"):u=y0(n,t)):u=t,{pathname:u,search:tE(a),hash:nE(o)}}function y0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Vh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function WC(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ip(e){let t=WC(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Hp(e,t,n,a=!1){let o;typeof e=="string"?o=Go(e):(o={...e},xt(!o.pathname||!o.pathname.includes("?"),Vh("?","pathname","search",o)),xt(!o.pathname||!o.pathname.includes("#"),Vh("#","pathname","hash",o)),xt(!o.search||!o.search.includes("#"),Vh("#","search","hash",o)));let u=e===""||o.pathname==="",l=u?"/":o.pathname,d;if(l==null)d=n;else{let x=t.length-1;if(!a&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),x-=1;o.pathname=b.join("/")}d=x>=0?t[x]:"/"}let h=QC(o,d),m=l&&l!=="/"&&l.endsWith("/"),g=(u||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var aa=e=>e.join("/").replace(/\/\/+/g,"/"),eE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rE=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function aE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function iE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Fw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qw(e,t){let n=e;if(typeof n!="string"||!JC.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,o=!1;if(Fw)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),d=oa(l.pathname,t);l.origin===u.origin&&d!=null?n=d+l.search+l.hash:o=!0}catch{gr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Gw=["POST","PUT","PATCH","DELETE"];new Set(Gw);var oE=["GET",...Gw];new Set(oE);var Yo=j.createContext(null);Yo.displayName="DataRouter";var nd=j.createContext(null);nd.displayName="DataRouterState";var sE=j.createContext(!1),Yw=j.createContext({isTransitioning:!1});Yw.displayName="ViewTransition";var lE=j.createContext(new Map);lE.displayName="Fetchers";var uE=j.createContext(null);uE.displayName="Await";var Hn=j.createContext(null);Hn.displayName="Navigation";var Ml=j.createContext(null);Ml.displayName="Location";var Mr=j.createContext({outlet:null,matches:[],isDataRoute:!1});Mr.displayName="Route";var Fp=j.createContext(null);Fp.displayName="RouteError";var Xw="REACT_ROUTER_ERROR",cE="REDIRECT",dE="ROUTE_ERROR_RESPONSE";function fE(e){if(e.startsWith(`${Xw}:${cE}:{`))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 hE(e){if(e.startsWith(`${Xw}:${dE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rE(t.status,t.statusText,t.data)}catch{}}function mE(e,{relative:t}={}){xt(Xo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=j.useContext(Hn),{hash:o,pathname:u,search:l}=Dl(e,{relative:t}),d=u;return n!=="/"&&(d=u==="/"?n:aa([n,u])),a.createHref({pathname:d,search:l,hash:o})}function Xo(){return j.useContext(Ml)!=null}function yr(){return xt(Xo(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Ml).location}var Kw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jw(e){j.useContext(Hn).static||j.useLayoutEffect(e)}function qp(){let{isDataRoute:e}=j.useContext(Mr);return e?TE():pE()}function pE(){xt(Xo(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Yo),{basename:t,navigator:n}=j.useContext(Hn),{matches:a}=j.useContext(Mr),{pathname:o}=yr(),u=JSON.stringify(Ip(a)),l=j.useRef(!1);return Jw(()=>{l.current=!0}),j.useCallback((h,m={})=>{if(gr(l.current,Kw),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=Hp(h,JSON.parse(u),o,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:aa([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,u,o,e])}j.createContext(null);function Dl(e,{relative:t}={}){let{matches:n}=j.useContext(Mr),{pathname:a}=yr(),o=JSON.stringify(Ip(n));return j.useMemo(()=>Hp(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function gE(e,t){return Qw(e,t)}function Qw(e,t,n,a,o){xt(Xo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(Hn),{matches:l}=j.useContext(Mr),d=l[l.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",x=d&&d.route;{let A=x&&x.path||"";eS(m,!x||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${A}">) 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.
10
10
 
11
- Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=yr(),v;if(t){let A=typeof t=="string"?qo(t):t;xt(g==="/"||A.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=b;let z=v.pathname||"/",T=z;if(g!=="/"){let A=g.replace(/^\//,"").split("/");T="/"+z.replace(/^\//,"").split("/").slice(A.length).join("/")}let E=Zw(e,{pathname:T});gr(x||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),gr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 N=kE(E&&E.map(A=>Object.assign({},A,{params:Object.assign({},h,A.params),pathname:aa([g,u.encodeLocation?u.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:aa([g,u.encodeLocation?u.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),l,n,a,o);return t&&N?j.createElement(Rl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},N):N}function yE(){let e=jE(),t=aE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:u},"ErrorBoundary")," or"," ",j.createElement("code",{style:u},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:o},n):null,l)}var xE=j.createElement(yE,null),Ww=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=hE(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Mr.Provider,{value:this.props.routeContext},j.createElement(Fp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(bE,{error:e},t):t}};Ww.contextType=sE;var Bh=new WeakMap;function bE({children:e,error:t}){let{basename:n}=j.useContext(Hn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=fE(t.digest);if(a){let o=Bh.get(t);if(o)throw o;let u=qw(a.location,n);if(Fw&&!Bh.get(t))if(u.isExternal||a.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:a.replace}));throw Bh.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function vE({routeContext:e,match:t,children:n}){let a=j.useContext(Go);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Mr.Provider,{value:e},n)}function kE(e,t=[],n=null,a=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let u=e,l=n?.errors;if(l!=null){let g=u.findIndex(x=>x.route.id&&l?.[x.route.id]!==void 0);xt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let d=!1,h=-1;if(n)for(let g=0;g<u.length;g++){let x=u[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=g),x.route.id){let{loaderData:b,errors:v}=n,z=x.route.loader&&!b.hasOwnProperty(x.route.id)&&(!v||v[x.route.id]===void 0);if(x.route.lazy||z){d=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let m=n&&a?(g,x)=>{a(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:iE(n.matches),errorInfo:x})}:void 0;return u.reduceRight((g,x,b)=>{let v,z=!1,T=null,E=null;n&&(v=l&&x.route.id?l[x.route.id]:void 0,T=x.route.errorElement||xE,d&&(h<0&&b===0?(eS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,E=null):h===b&&(z=!0,E=x.route.hydrateFallbackElement||null)));let N=t.concat(u.slice(0,b+1)),A=()=>{let C;return v?C=T:z?C=E:x.route.Component?C=j.createElement(x.route.Component,null):x.route.element?C=x.route.element:C=g,j.createElement(vE,{match:x,routeContext:{outlet:g,matches:N,isDataRoute:n!=null},children:C})};return n&&(x.route.ErrorBoundary||x.route.errorElement||b===0)?j.createElement(Ww,{location:n.location,revalidation:n.revalidation,component:T,error:v,children:A(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:m}):A()},null)}function Gp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wE(e){let t=j.useContext(Go);return xt(t,Gp(e)),t}function SE(e){let t=j.useContext(nd);return xt(t,Gp(e)),t}function zE(e){let t=j.useContext(Mr);return xt(t,Gp(e)),t}function Yp(e){let t=zE(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function _E(){return Yp("useRouteId")}function jE(){let e=j.useContext(Fp),t=SE("useRouteError"),n=Yp("useRouteError");return e!==void 0?e:t.errors?.[n]}function TE(){let{router:e}=wE("useNavigate"),t=Yp("useNavigate"),n=j.useRef(!1);return Jw(()=>{n.current=!0}),j.useCallback(async(o,u={})=>{gr(n.current,Kw),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...u}))},[e,t])}var x0={};function eS(e,t,n){!t&&!x0[e]&&(x0[e]=!0,gr(!1,n))}j.memo(CE);function CE({routes:e,future:t,state:n,onError:a}){return Qw(e,void 0,n,a,t)}function tS({to:e,replace:t,state:n,relative:a}){xt(Yo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=j.useContext(Hn);gr(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=j.useContext(Mr),{pathname:l}=yr(),d=qp(),h=Hp(e,Ip(u),l,a==="path"),m=JSON.stringify(h);return j.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:a})},[d,m,a,t,n]),null}function ln(e){xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function EE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:o,static:u=!1,unstable_useTransitions:l}){xt(!Yo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=j.useMemo(()=>({basename:d,navigator:o,static:u,unstable_useTransitions:l,future:{}}),[d,o,u,l]);typeof n=="string"&&(n=qo(n));let{pathname:m="/",search:g="",hash:x="",state:b=null,key:v="default"}=n,z=j.useMemo(()=>{let T=oa(m,d);return T==null?null:{location:{pathname:T,search:g,hash:x,state:b,key:v},navigationType:a}},[d,m,g,x,b,v,a]);return gr(z!=null,`<Router basename="${d}"> is not able to match the URL "${m}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:j.createElement(Hn.Provider,{value:h},j.createElement(Rl.Provider,{children:t,value:z}))}function b0({children:e,location:t}){return gE(Um(e),t)}function Um(e,t=[]){let n=[];return j.Children.forEach(e,(a,o)=>{if(!j.isValidElement(a))return;let u=[...t,o];if(a.type===j.Fragment){n.push.apply(n,Um(a.props.children,u));return}xt(a.type===ln,`[${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>`),xt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||u.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&&(l.children=Um(a.props.children,u)),n.push(l)}),n}var jc="get",Tc="application/x-www-form-urlencoded";function rd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function NE(e){return rd(e)&&e.tagName.toLowerCase()==="button"}function AE(e){return rd(e)&&e.tagName.toLowerCase()==="form"}function OE(e){return rd(e)&&e.tagName.toLowerCase()==="input"}function RE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ME(e,t){return e.button===0&&(!t||t==="_self")&&!RE(e)}var ic=null;function DE(){if(ic===null)try{new FormData(document.createElement("form"),0),ic=!1}catch{ic=!0}return ic}var $E=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zh(e){return e!=null&&!$E.has(e)?(gr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tc}"`),null):e}function LE(e,t){let n,a,o,u,l;if(AE(e)){let d=e.getAttribute("action");a=d?oa(d,t):null,n=e.getAttribute("method")||jc,o=Zh(e.getAttribute("enctype"))||Tc,u=new FormData(e)}else if(NE(e)||OE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?oa(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||jc,o=Zh(e.getAttribute("formenctype"))||Zh(d.getAttribute("enctype"))||Tc,u=new FormData(d,e),!DE()){let{name:m,type:g,value:x}=e;if(g==="image"){let b=m?`${m}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else m&&u.append(m,x)}}else{if(rd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=jc,a=null,o=Tc,l=e}return u&&o==="text/plain"&&(l=u,u=void 0),{action:a,method:n.toLowerCase(),encType:o,formData:u,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function PE(e,t,n,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&oa(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function UE(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VE(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 BE(e,t,n){let a=await Promise.all(e.map(async o=>{let u=t.routes[o.route.id];if(u){let l=await UE(u,n);return l.links?l.links():[]}return[]}));return FE(a.flat(1).filter(VE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function v0(e,t,n,a,o,u){let l=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return u==="assets"?t.filter((h,m)=>l(h,m)||d(h,m)):u==="data"?t.filter((h,m)=>{let g=a.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function ZE(e,t,{includeHydrateFallback:n}={}){return IE(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function IE(e){return[...new Set(e)]}function HE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function FE(e,t){let n=new Set;return new Set(t),e.reduce((a,o)=>{let u=JSON.stringify(HE(o));return n.has(u)||(n.add(u),a.push({key:u,link:o})),a},[])}function nS(){let e=j.useContext(Go);return Xp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qE(){let e=j.useContext(nd);return Xp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Kp=j.createContext(void 0);Kp.displayName="FrameworkContext";function rS(){let e=j.useContext(Kp);return Xp(e,"You must render this element inside a <HydratedRouter> element"),e}function GE(e,t){let n=j.useContext(Kp),[a,o]=j.useState(!1),[u,l]=j.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:x}=t,b=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let T=N=>{N.forEach(A=>{l(A.isIntersecting)})},E=new IntersectionObserver(T,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),j.useEffect(()=>{if(a){let T=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(T)}}},[a]);let v=()=>{o(!0)},z=()=>{o(!1),l(!1)};return n?e!=="intent"?[u,b,{}]:[u,b,{onFocus:Js(d,v),onBlur:Js(h,z),onMouseEnter:Js(m,v),onMouseLeave:Js(g,z),onTouchStart:Js(x,v)}]:[!1,b,{}]}function Js(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YE({page:e,...t}){let{router:n}=nS(),a=j.useMemo(()=>Zw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?j.createElement(KE,{page:e,matches:a,...t}):null}function XE(e){let{manifest:t,routeModules:n}=rS(),[a,o]=j.useState([]);return j.useEffect(()=>{let u=!1;return BE(e,t,n).then(l=>{u||o(l)}),()=>{u=!0}},[e,t,n]),a}function KE({page:e,matches:t,...n}){let a=yr(),{future:o,manifest:u,routeModules:l}=rS(),{basename:d}=nS(),{loaderData:h,matches:m}=qE(),g=j.useMemo(()=>v0(e,t,m,u,a,"data"),[e,t,m,u,a]),x=j.useMemo(()=>v0(e,t,m,u,a,"assets"),[e,t,m,u,a]),b=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let T=new Set,E=!1;if(t.forEach(A=>{let C=u.routes[A.route.id];!C||!C.hasLoader||(!g.some($=>$.route.id===A.route.id)&&A.route.id in h&&l[A.route.id]?.shouldRevalidate||C.hasClientLoader?E=!0:T.add(A.route.id))}),T.size===0)return[];let N=PE(e,d,o.unstable_trailingSlashAwareDataRequests,"data");return E&&T.size>0&&N.searchParams.set("_routes",t.filter(A=>T.has(A.route.id)).map(A=>A.route.id).join(",")),[N.pathname+N.search]},[d,o.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),v=j.useMemo(()=>ZE(x,u),[x,u]),z=XE(x);return j.createElement(j.Fragment,null,b.map(T=>j.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...n})),v.map(T=>j.createElement("link",{key:T,rel:"modulepreload",href:T,...n})),z.map(({key:T,link:E})=>j.createElement("link",{key:T,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function JE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var QE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{QE&&(window.__reactRouterVersion="7.13.0")}catch{}function WE({basename:e,children:t,unstable_useTransitions:n,window:a}){let o=j.useRef();o.current==null&&(o.current=MC({window:a,v5Compat:!0}));let u=o.current,[l,d]=j.useState({action:u.action,location:u.location}),h=j.useCallback(m=>{n===!1?d(m):j.startTransition(()=>d(m))},[n]);return j.useLayoutEffect(()=>u.listen(h),[u,h]),j.createElement(EE,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:n})}var aS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_r=j.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:o,reloadDocument:u,replace:l,state:d,target:h,to:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...v},z){let{basename:T,unstable_useTransitions:E}=j.useContext(Hn),N=typeof m=="string"&&aS.test(m),A=qw(m,T);m=A.to;let C=mE(m,{relative:o}),[$,L,M]=GE(a,v),q=rN(m,{replace:l,state:d,target:h,preventScrollReset:g,relative:o,viewTransition:x,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function V(ce){t&&t(ce),ce.defaultPrevented||q(ce)}let X=j.createElement("a",{...v,...M,href:A.absoluteURL||C,onClick:A.isExternal||u?t:V,ref:JE(z,L),target:h,"data-discover":!N&&n==="render"?"true":void 0});return $&&!N?j.createElement(j.Fragment,null,X,j.createElement(YE,{page:C})):X});_r.displayName="Link";var eN=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:o=!1,style:u,to:l,viewTransition:d,children:h,...m},g){let x=Ml(l,{relative:m.relative}),b=yr(),v=j.useContext(nd),{navigator:z,basename:T}=j.useContext(Hn),E=v!=null&&lN(x)&&d===!0,N=z.encodeLocation?z.encodeLocation(x).pathname:x.pathname,A=b.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),C=C?C.toLowerCase():null,N=N.toLowerCase()),C&&T&&(C=oa(C,T)||C);const $=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let L=A===N||!o&&A.startsWith(N)&&A.charAt($)==="/",M=C!=null&&(C===N||!o&&C.startsWith(N)&&C.charAt(N.length)==="/"),q={isActive:L,isPending:M,isTransitioning:E},V=L?t:void 0,X;typeof a=="function"?X=a(q):X=[a,L?"active":null,M?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ce=typeof u=="function"?u(q):u;return j.createElement(_r,{...m,"aria-current":V,className:X,ref:g,style:ce,to:l,viewTransition:d},typeof h=="function"?h(q):h)});eN.displayName="NavLink";var tN=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:u,method:l=jc,action:d,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...v},z)=>{let{unstable_useTransitions:T}=j.useContext(Hn),E=oN(),N=sN(d,{relative:m}),A=l.toLowerCase()==="get"?"get":"post",C=typeof d=="string"&&aS.test(d),$=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let M=L.nativeEvent.submitter,q=M?.getAttribute("formmethod")||l,V=()=>E(M||L.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:o,state:u,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b});T&&n!==!1?j.startTransition(()=>V()):V()};return j.createElement("form",{ref:z,method:A,action:N,onSubmit:a?h:$,...v,"data-discover":!C&&e==="render"?"true":void 0})});tN.displayName="Form";function nN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iS(e){let t=j.useContext(Go);return xt(t,nN(e)),t}function rN(e,{target:t,replace:n,state:a,preventScrollReset:o,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let m=qp(),g=yr(),x=Ml(e,{relative:u});return j.useCallback(b=>{if(ME(b,t)){b.preventDefault();let v=n!==void 0?n:xl(g)===xl(x),z=()=>m(e,{replace:v,state:a,preventScrollReset:o,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:d});h?j.startTransition(()=>z()):z()}},[g,m,x,n,a,t,e,o,u,l,d,h])}var aN=0,iN=()=>`__${String(++aN)}__`;function oN(){let{router:e}=iS("useSubmit"),{basename:t}=j.useContext(Hn),n=_E(),a=e.fetch,o=e.navigate;return j.useCallback(async(u,l={})=>{let{action:d,method:h,encType:m,formData:g,body:x}=LE(u,t);if(l.navigate===!1){let b=l.fetcherKey||iN();await a(b,n,l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:x,formMethod:l.method||h,formEncType:l.encType||m,flushSync:l.flushSync})}else await o(l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:x,formMethod:l.method||h,formEncType:l.encType||m,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[a,o,t,n])}function sN(e,{relative:t}={}){let{basename:n}=j.useContext(Hn),a=j.useContext(Mr);xt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),u={...Ml(e||".",{relative:t})},l=yr();if(e==null){u.search=l.search;let d=new URLSearchParams(u.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(x=>x).forEach(x=>d.append("index",x));let g=d.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:aa([n,u.pathname])),xl(u)}function lN(e,{relative:t}={}){let n=j.useContext(Yw);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=iS("useViewTransitionState"),o=Ml(e,{relative:t});if(!n.isTransitioning)return!1;let u=oa(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=oa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Dc(o.pathname,l)!=null||Dc(o.pathname,u)!=null}const oS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const uN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const cN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const k0=e=>{const t=cN(e);return t.charAt(0).toUpperCase()+t.slice(1)};var dN={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"};const fN=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const hN=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:u,iconNode:l,...d},h)=>j.createElement("svg",{ref:h,...dN,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:oS("lucide",o),...!u&&!fN(d)&&{"aria-hidden":"true"},...d},[...l.map(([m,g])=>j.createElement(m,g)),...Array.isArray(u)?u:[u]]));const we=(e,t)=>{const n=j.forwardRef(({className:a,...o},u)=>j.createElement(hN,{ref:u,iconNode:t,className:oS(`lucide-${uN(k0(e))}`,`lucide-${e}`,a),...o}));return n.displayName=k0(e),n};const mN=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],zo=we("activity",mN);const pN=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],gN=we("archive",pN);const yN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],sS=we("arrow-down",yN);const xN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],bN=we("arrow-left",xN);const vN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],lS=we("arrow-up",vN);const kN=[["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"}]],bl=we("bell",kN);const wN=[["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"}]],w0=we("bot",wN);const SN=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],zN=we("box",SN);const _N=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],jN=we("brain",_N);const TN=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],uS=we("calendar",TN);const CN=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Vm=we("chart-column",CN);const EN=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],NN=we("check-check",EN);const AN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Bm=we("check",AN);const ON=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],RN=we("chevron-down",ON);const MN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],DN=we("chevron-right",MN);const $N=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],cS=we("circle-check",$N);const LN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Zm=we("circle-x",LN);const PN=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ad=we("clock",PN);const UN=[["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"}]],VN=we("copy",UN);const BN=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],dS=we("cpu",BN);const ZN=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Oo=we("database",ZN);const IN=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],$c=we("dollar-sign",IN);const HN=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],id=we("eye",HN);const FN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],qN=we("file-text",FN);const GN=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],YN=we("funnel",GN);const XN=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],KN=we("hash",XN);const JN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],QN=we("info",JN);const WN=[["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"}]],S0=we("layout-dashboard",WN);const eA=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Im=we("list-checks",eA);const tA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],nA=we("loader-circle",tA);const rA=[["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"}]],z0=we("log-out",rA);const aA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],iA=we("menu",aA);const oA=[["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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],_0=we("message-square-plus",oA);const sA=[["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"}]],vl=we("message-square",sA);const lA=[["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"}]],fS=we("moon",lA);const uA=[["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"}]],Jp=we("pencil",uA);const cA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qp=we("plus",cA);const dA=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],j0=we("puzzle",dA);const fA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],hS=we("refresh-cw",fA);const hA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],T0=we("rotate-ccw",hA);const mA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pA=we("search",mA);const gA=[["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"}]],yA=we("send",gA);const xA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],C0=we("settings",xA);const bA=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],E0=we("shield-check",bA);const vA=[["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"}]],mS=we("sun",vA);const kA=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],wA=we("tag",kA);const SA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Hm=we("terminal",SA);const zA=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],_A=we("toggle-left",zA);const jA=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],TA=we("toggle-right",jA);const CA=[["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"}]],Vo=we("trash-2",CA);const EA=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],NA=we("trending-up",EA);const AA=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],OA=we("user",AA);const RA=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Fm=we("webhook",RA);const MA=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],DA=we("wifi-off",MA);const $A=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Ih=we("wifi",$A);const LA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pS=we("x",LA);var Hh={exports:{}},Fh={};var N0;function PA(){if(N0)return Fh;N0=1;var e=td();function t(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function d(x,b){var v=b(),z=a({inst:{value:v,getSnapshot:b}}),T=z[0].inst,E=z[1];return u(function(){T.value=v,T.getSnapshot=b,h(T)&&E({inst:T})},[x,v,b]),o(function(){return h(T)&&E({inst:T}),x(function(){h(T)&&E({inst:T})})},[x]),l(v),v}function h(x){var b=x.getSnapshot;x=x.value;try{var v=b();return!n(x,v)}catch{return!0}}function m(x,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Fh}var A0;function UA(){return A0||(A0=1,Hh.exports=PA()),Hh.exports}var O0=UA();const gS=0,yS=1,xS=2,R0=3;var M0=Object.prototype.hasOwnProperty;function qm(e,t){var n,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((a=e.length)===t.length)for(;a--&&qm(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(M0.call(e,n)&&++a&&!M0.call(t,n)||!(n in t)||!qm(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const ta=new WeakMap,ra=()=>{},un=ra(),Gm=Object,Ze=e=>e===un,jr=e=>typeof e=="function",Ba=(e,t)=>({...e,...t}),bS=e=>jr(e.then),qh={},oc={},Wp="undefined",Dl=typeof window!=Wp,Ym=typeof document!=Wp,VA=Dl&&"Deno"in window,BA=()=>Dl&&typeof window.requestAnimationFrame!=Wp,vS=(e,t)=>{const n=ta.get(e);return[()=>!Ze(t)&&e.get(t)||qh,a=>{if(!Ze(t)){const o=e.get(t);t in oc||(oc[t]=o),n[5](t,Ba(o,a),o||qh)}},n[6],()=>!Ze(t)&&t in oc?oc[t]:!Ze(t)&&e.get(t)||qh]};let Xm=!0;const ZA=()=>Xm,[Km,Jm]=Dl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ra,ra],IA=()=>{const e=Ym&&document.visibilityState;return Ze(e)||e!=="hidden"},HA=e=>(Ym&&document.addEventListener("visibilitychange",e),Km("focus",e),()=>{Ym&&document.removeEventListener("visibilitychange",e),Jm("focus",e)}),FA=e=>{const t=()=>{Xm=!0,e()},n=()=>{Xm=!1};return Km("online",t),Km("offline",n),()=>{Jm("online",t),Jm("offline",n)}},qA={isOnline:ZA,isVisible:IA},GA={initFocus:HA,initReconnect:FA},D0=!Zp.useId,Ro=!Dl||VA,YA=e=>BA()?window.requestAnimationFrame(e):setTimeout(e,1),Gh=Ro?j.useEffect:j.useLayoutEffect,Yh=typeof navigator<"u"&&navigator.connection,$0=!Ro&&Yh&&(["slow-2g","2g"].includes(Yh.effectiveType)||Yh.saveData),sc=new WeakMap,XA=e=>Gm.prototype.toString.call(e),Xh=(e,t)=>e===`[object ${t}]`;let KA=0;const Qm=e=>{const t=typeof e,n=XA(e),a=Xh(n,"Date"),o=Xh(n,"RegExp"),u=Xh(n,"Object");let l,d;if(Gm(e)===e&&!a&&!o){if(l=sc.get(e),l)return l;if(l=++KA+"~",sc.set(e,l),Array.isArray(e)){for(l="@",d=0;d<e.length;d++)l+=Qm(e[d])+",";sc.set(e,l)}if(u){l="#";const h=Gm.keys(e).sort();for(;!Ze(d=h.pop());)Ze(e[d])||(l+=d+":"+Qm(e[d])+",");sc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},eg=e=>{if(jr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Qm(e):"",[e,t]};let JA=0;const Wm=()=>++JA;async function kS(...e){const[t,n,a,o]=e,u=Ba({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let l=u.populateCache;const d=u.rollbackOnError;let h=u.optimisticData;const m=b=>typeof d=="function"?d(b):d!==!1,g=u.throwOnError;if(jr(n)){const b=n,v=[],z=t.keys();for(const T of z)!/^\$(inf|sub)\$/.test(T)&&b(t.get(T)._k)&&v.push(T);return Promise.all(v.map(x))}return x(n);async function x(b){const[v]=eg(b);if(!v)return;const[z,T]=vS(t,v),[E,N,A,C]=ta.get(t),$=()=>{const oe=E[v];return(jr(u.revalidate)?u.revalidate(z().data,b):u.revalidate!==!1)&&(delete A[v],delete C[v],oe&&oe[0])?oe[0](xS).then(()=>z().data):z().data};if(e.length<3)return $();let L=a,M,q=!1;const V=Wm();N[v]=[V,0];const X=!Ze(h),ce=z(),Q=ce.data,se=ce._c,te=Ze(se)?Q:se;if(X&&(h=jr(h)?h(te,Q):h,T({data:h,_c:te})),jr(L))try{L=L(te)}catch(oe){M=oe,q=!0}if(L&&bS(L))if(L=await L.catch(oe=>{M=oe,q=!0}),V!==N[v][0]){if(q)throw M;return L}else q&&X&&m(M)&&(l=!0,T({data:te,_c:un}));if(l&&!q)if(jr(l)){const oe=l(L,te);T({data:oe,error:un,_c:un})}else T({data:L,error:un,_c:un});if(N[v][1]=Wm(),Promise.resolve($()).then(()=>{T({_c:un})}),q){if(g)throw M;return}return L}}const L0=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},QA=(e,t)=>{if(!ta.has(e)){const n=Ba(GA,t),a=Object.create(null),o=kS.bind(un,e);let u=ra;const l=Object.create(null),d=(g,x)=>{const b=l[g]||[];return l[g]=b,b.push(x),()=>b.splice(b.indexOf(x),1)},h=(g,x,b)=>{e.set(g,x);const v=l[g];if(v)for(const z of v)z(x,b)},m=()=>{if(!ta.has(e)&&(ta.set(e,[a,Object.create(null),Object.create(null),Object.create(null),o,h,d]),!Ro)){const g=n.initFocus(setTimeout.bind(un,L0.bind(un,a,gS))),x=n.initReconnect(setTimeout.bind(un,L0.bind(un,a,yS)));u=()=>{g&&g(),x&&x(),ta.delete(e)}}};return m(),[e,o,m,u]}return[e,ta.get(e)[4]]},WA=(e,t,n,a,o)=>{const u=n.errorRetryCount,l=o.retryCount,d=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Ze(u)&&l>u||setTimeout(a,d,o)},e4=qm,[wS,na]=QA(new Map),t4=Ba({onLoadingSlow:ra,onSuccess:ra,onError:ra,onErrorRetry:WA,onDiscarded:ra,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:$0?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:$0?5e3:3e3,compare:e4,isPaused:()=>!1,cache:wS,mutate:na,fallback:{}},qA),n4=(e,t)=>{const n=Ba(e,t);if(t){const{use:a,fallback:o}=e,{use:u,fallback:l}=t;a&&u&&(n.use=a.concat(u)),o&&l&&(n.fallback=Ba(o,l))}return n},r4=j.createContext({}),a4="$inf$",SS=Dl&&window.__SWR_DEVTOOLS_USE__,i4=SS?window.__SWR_DEVTOOLS_USE__:[],o4=()=>{SS&&(window.__SWR_DEVTOOLS_REACT__=Zp)},s4=e=>jr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],l4=()=>{const e=j.useContext(r4);return j.useMemo(()=>Ba(t4,e),[e])},u4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=eg(t),[,,,d]=ta.get(wS);if(l.startsWith(a4))return n(...u);const h=d[l];return Ze(h)?n(...u):(delete d[l],h)}),a),c4=i4.concat(u4),d4=e=>function(...n){const a=l4(),[o,u,l]=s4(n),d=n4(a,l);let h=e;const{use:m}=d,g=(m||[]).concat(c4);for(let x=g.length;x--;)h=g[x](h);return h(o,u||d.fetcher||null,d)},f4=(e,t,n)=>{const a=t[e]||(t[e]=[]);return a.push(n),()=>{const o=a.indexOf(n);o>=0&&(a[o]=a[a.length-1],a.pop())}};o4();const Kh=Zp.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Jh={dedupe:!0},P0=Promise.resolve(un),h4=(e,t,n)=>{const{cache:a,compare:o,suspense:u,fallbackData:l,revalidateOnMount:d,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:x,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[z,T,E,N]=ta.get(a),[A,C]=eg(e),$=j.useRef(!1),L=j.useRef(!1),M=j.useRef(A),q=j.useRef(t),V=j.useRef(n),X=()=>V.current,ce=()=>X().isVisible()&&X().isOnline(),[Q,se,te,oe]=vS(a,A),ae=j.useRef({}).current,U=Ze(l)?Ze(n.fallback)?un:n.fallback[A]:l,K=(Ie,rt)=>{for(const dt in ae){const Qe=dt;if(Qe==="data"){if(!o(Ie[Qe],rt[Qe])&&(!Ze(Ie[Qe])||!o(fe,rt[Qe])))return!1}else if(rt[Qe]!==Ie[Qe])return!1}return!0},B=j.useMemo(()=>{const Ie=!A||!t?!1:Ze(d)?X().isPaused()||u?!1:h!==!1:d,rt=Ht=>{const ft=Ba(Ht);return delete ft._k,Ie?{isValidating:!0,isLoading:!0,...ft}:ft},dt=Q(),Qe=oe(),Xt=rt(dt),qn=dt===Qe?Xt:rt(Qe);let At=Xt;return[()=>{const Ht=rt(Q());return K(Ht,At)?(At.data=Ht.data,At.isLoading=Ht.isLoading,At.isValidating=Ht.isValidating,At.error=Ht.error,At):(At=Ht,Ht)},()=>qn]},[a,A]),he=O0.useSyncExternalStore(j.useCallback(Ie=>te(A,(rt,dt)=>{K(dt,rt)||Ie()}),[a,A]),B[0],B[1]),O=!$.current,S=z[A]&&z[A].length>0,H=he.data,w=Ze(H)?U&&bS(U)?Kh(U):U:H,G=he.error,de=j.useRef(w),fe=b?Ze(H)?Ze(de.current)?w:de.current:H:w,me=A&&Ze(w),De=!Ro&&O0.useSyncExternalStore(()=>ra,()=>!1,()=>!0);v&&De&&!u&&me&&console.warn(`Missing pre-initiated data for serialized key "${A}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ne=S&&!Ze(G)?!1:O&&!Ze(d)?d:X().isPaused()?!1:u?Ze(w)?!1:h:Ze(w)||h,kt=!!(A&&t&&O&&Ne),It=Ze(he.isValidating)?kt:he.isValidating,fn=Ze(he.isLoading)?kt:he.isLoading,st=j.useCallback(async Ie=>{const rt=q.current;if(!A||!rt||L.current||X().isPaused())return!1;let dt,Qe,Xt=!0;const qn=Ie||{},At=!E[A]||!qn.dedupe,Ht=()=>D0?!L.current&&A===M.current&&$.current:A===M.current,ft={isValidating:!1,isLoading:!1},Ri=()=>{se(ft)},W=()=>{const be=E[A];be&&be[1]===Qe&&delete E[A]},ue={isValidating:!0};Ze(Q().data)&&(ue.isLoading=!0);try{if(At&&(se(ue),n.loadingTimeout&&Ze(Q().data)&&setTimeout(()=>{Xt&&Ht()&&X().onLoadingSlow(A,n)},n.loadingTimeout),E[A]=[rt(C),Wm()]),[dt,Qe]=E[A],dt=await dt,At&&setTimeout(W,n.dedupingInterval),!E[A]||E[A][1]!==Qe)return At&&Ht()&&X().onDiscarded(A),!1;ft.error=un;const be=T[A];if(!Ze(be)&&(Qe<=be[0]||Qe<=be[1]||be[1]===0))return Ri(),At&&Ht()&&X().onDiscarded(A),!1;const je=Q().data;ft.data=o(je,dt)?je:dt,At&&Ht()&&X().onSuccess(dt,A,n)}catch(be){W();const je=X(),{shouldRetryOnError:Be}=je;je.isPaused()||(ft.error=be,At&&Ht()&&(je.onError(be,A,je),(Be===!0||jr(Be)&&Be(be))&&(!X().revalidateOnFocus||!X().revalidateOnReconnect||ce())&&je.onErrorRetry(be,A,je,hn=>{const Rn=z[A];Rn&&Rn[0]&&Rn[0](R0,hn)},{retryCount:(qn.retryCount||0)+1,dedupe:!0})))}return Xt=!1,Ri(),!0},[A,a]),wt=j.useCallback((...Ie)=>kS(a,M.current,...Ie),[]);if(Gh(()=>{q.current=t,V.current=n,Ze(H)||(de.current=H)}),Gh(()=>{if(!A)return;const Ie=st.bind(un,Jh);let rt=0;X().revalidateOnFocus&&(rt=Date.now()+X().focusThrottleInterval);const Qe=f4(A,z,(Xt,qn={})=>{if(Xt==gS){const At=Date.now();X().revalidateOnFocus&&At>rt&&ce()&&(rt=At+X().focusThrottleInterval,Ie())}else if(Xt==yS)X().revalidateOnReconnect&&ce()&&Ie();else{if(Xt==xS)return st();if(Xt==R0)return st(qn)}});return L.current=!1,M.current=A,$.current=!0,se({_k:C}),Ne&&(E[A]||(Ze(w)||Ro?Ie():YA(Ie))),()=>{L.current=!0,Qe()}},[A]),Gh(()=>{let Ie;function rt(){const Qe=jr(m)?m(Q().data):m;Qe&&Ie!==-1&&(Ie=setTimeout(dt,Qe))}function dt(){!Q().error&&(g||X().isVisible())&&(x||X().isOnline())?st(Jh).then(rt):rt()}return rt(),()=>{Ie&&(clearTimeout(Ie),Ie=-1)}},[m,g,x,A]),j.useDebugValue(fe),u){if(!D0&&Ro&&me)throw new Error("Fallback data is required when using Suspense in SSR.");me&&(q.current=t,V.current=n,L.current=!1);const Ie=N[A],rt=!Ze(Ie)&&me?wt(Ie):P0;if(Kh(rt),!Ze(G)&&me)throw G;const dt=me?st(Jh):P0;!Ze(fe)&&me&&(dt.status="fulfilled",dt.value=!0),Kh(dt)}return{mutate:wt,get data(){return ae.data=!0,fe},get error(){return ae.error=!0,G},get isValidating(){return ae.isValidating=!0,It},get isLoading(){return ae.isLoading=!0,fn}}},Qt=d4(h4),m4="x-architect-pass",Qs="/api";class zi{static instance;constructor(){}static getInstance(){return zi.instance||(zi.instance=new zi),zi.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[m4]=n),a}async handleResponse(t){if(t.status===401)throw localStorage.removeItem("morpheus.auth.token"),window.location.pathname.endsWith("/login")||(window.location.href="/login"),new Error("Unauthorized");if(!t.ok){const n=await t.json().catch(()=>({error:"Unknown error"})),a=new Error(n.error||`HTTP error! status: ${t.status}`);throw a.details=n.details,a}return t.json()}async get(t){const n=await fetch(`${Qs}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${Qs}${t}`,{method:"POST",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async put(t,n){const a=await fetch(`${Qs}${t}`,{method:"PUT",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async patch(t,n){const a=await fetch(`${Qs}${t}`,{method:"PATCH",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async delete(t){const n=await fetch(`${Qs}${t}`,{method:"DELETE",headers:this.getHeaders()});return this.handleResponse(n)}}const _e=zi.getInstance(),kl="/api",tg=e=>{const t=e.startsWith(kl)?e.substring(kl.length):e;return _e.get(t)};function zS(){return Qt(`${kl}/status`,tg,{refreshInterval:5e3})}function p4(){return Qt(`${kl}/logs`,tg)}function g4(e){return Qt(e?`${kl}/logs/${e}?limit=1000`:null,tg,{refreshInterval:2e3})}function _S(e){const t=Math.floor(e/60);if(t>59){const n=Math.floor(t/60),a=t%60;return`${n}h ${a}m`}return`${t}m`}function y4(){const{data:e}=zS();return f.jsxs("footer",{className:"h-8 bg-azure-bg dark:bg-zinc-950 border-t border-azure-border dark:border-matrix-primary flex items-center px-4 text-xs justify-between select-none z-10 shrink-0",children:[f.jsxs("div",{className:"flex gap-4",children:[f.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),f.jsxs("span",{children:["PID: ",e?.pid||"-"]}),f.jsxs("span",{children:["UPTIME: ",e?_S(e.uptimeSeconds):"-"]})]}),f.jsxs("div",{className:"flex gap-4 opacity-70",children:[f.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),f.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const ng=j.createContext({});function rg(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const jS=typeof window<"u",TS=jS?j.useLayoutEffect:j.useEffect,od=j.createContext(null);function ag(e,t){e.indexOf(t)===-1&&e.push(t)}function ig(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Er=(e,t,n)=>n>t?t:n<e?e:n;let og=()=>{};const sa={},CS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ES(e){return typeof e=="object"&&e!==null}const NS=e=>/^0[^.\s]+$/u.test(e);function sg(e){let t;return()=>(t===void 0&&(t=e()),t)}const sr=e=>e,x4=(e,t)=>n=>t(e(n)),$l=(...e)=>e.reduce(x4),wl=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class lg{constructor(){this.subscriptions=[]}add(t){return ag(this.subscriptions,t),()=>ig(this.subscriptions,t)}notify(t,n,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,a);else for(let u=0;u<o;u++){const l=this.subscriptions[u];l&&l(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ia=e=>e*1e3,or=e=>e/1e3;function AS(e,t){return t?e*(1e3/t):0}const OS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,b4=1e-7,v4=12;function k4(e,t,n,a,o){let u,l,d=0;do l=t+(n-t)/2,u=OS(l,a,o)-e,u>0?n=l:t=l;while(Math.abs(u)>b4&&++d<v4);return l}function Ll(e,t,n,a){if(e===t&&n===a)return sr;const o=u=>k4(u,0,1,e,n);return u=>u===0||u===1?u:OS(o(u),t,a)}const RS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,MS=e=>t=>1-e(1-t),DS=Ll(.33,1.53,.69,.99),ug=MS(DS),$S=RS(ug),LS=e=>(e*=2)<1?.5*ug(e):.5*(2-Math.pow(2,-10*(e-1))),cg=e=>1-Math.sin(Math.acos(e)),PS=MS(cg),US=RS(cg),w4=Ll(.42,0,1,1),S4=Ll(0,0,.58,1),VS=Ll(.42,0,.58,1),z4=e=>Array.isArray(e)&&typeof e[0]!="number",BS=e=>Array.isArray(e)&&typeof e[0]=="number",_4={linear:sr,easeIn:w4,easeInOut:VS,easeOut:S4,circIn:cg,circInOut:US,circOut:PS,backIn:ug,backInOut:$S,backOut:DS,anticipate:LS},j4=e=>typeof e=="string",U0=e=>{if(BS(e)){og(e.length===4);const[t,n,a,o]=e;return Ll(t,n,a,o)}else if(j4(e))return _4[e];return e},lc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function T4(e,t){let n=new Set,a=new Set,o=!1,u=!1;const l=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(g){l.has(g)&&(m.schedule(g),e()),g(d)}const m={schedule:(g,x=!1,b=!1)=>{const z=b&&o?n:a;return x&&l.add(g),z.has(g)||z.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(d=g,o){u=!0;return}o=!0,[n,a]=[a,n],n.forEach(h),n.clear(),o=!1,u&&(u=!1,m.process(g))}};return m}const C4=40;function ZS(e,t){let n=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,l=lc.reduce((C,$)=>(C[$]=T4(u),C),{}),{setup:d,read:h,resolveKeyframes:m,preUpdate:g,update:x,preRender:b,render:v,postRender:z}=l,T=()=>{const C=sa.useManualTiming?o.timestamp:performance.now();n=!1,sa.useManualTiming||(o.delta=a?1e3/60:Math.max(Math.min(C-o.timestamp,C4),1)),o.timestamp=C,o.isProcessing=!0,d.process(o),h.process(o),m.process(o),g.process(o),x.process(o),b.process(o),v.process(o),z.process(o),o.isProcessing=!1,n&&t&&(a=!1,e(T))},E=()=>{n=!0,a=!0,o.isProcessing||e(T)};return{schedule:lc.reduce((C,$)=>{const L=l[$];return C[$]=(M,q=!1,V=!1)=>(n||E(),L.schedule(M,q,V)),C},{}),cancel:C=>{for(let $=0;$<lc.length;$++)l[lc[$]].cancel(C)},state:o,steps:l}}const{schedule:pt,cancel:Za,state:an,steps:Qh}=ZS(typeof requestAnimationFrame<"u"?requestAnimationFrame:sr,!0);let Cc;function E4(){Cc=void 0}const bn={now:()=>(Cc===void 0&&bn.set(an.isProcessing||sa.useManualTiming?an.timestamp:performance.now()),Cc),set:e=>{Cc=e,queueMicrotask(E4)}},IS=e=>t=>typeof t=="string"&&t.startsWith(e),HS=IS("--"),N4=IS("var(--"),dg=e=>N4(e)?A4.test(e.split("/*")[0].trim()):!1,A4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function V0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Xo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Sl={...Xo,transform:e=>Er(0,1,e)},uc={...Xo,default:1},dl=e=>Math.round(e*1e5)/1e5,fg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function O4(e){return e==null}const R4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,hg=(e,t)=>n=>!!(typeof n=="string"&&R4.test(n)&&n.startsWith(e)||t&&!O4(n)&&Object.prototype.hasOwnProperty.call(n,t)),FS=(e,t,n)=>a=>{if(typeof a!="string")return a;const[o,u,l,d]=a.match(fg);return{[e]:parseFloat(o),[t]:parseFloat(u),[n]:parseFloat(l),alpha:d!==void 0?parseFloat(d):1}},M4=e=>Er(0,255,e),Wh={...Xo,transform:e=>Math.round(M4(e))},_i={test:hg("rgb","red"),parse:FS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Wh.transform(e)+", "+Wh.transform(t)+", "+Wh.transform(n)+", "+dl(Sl.transform(a))+")"};function D4(e){let t="",n="",a="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}const ep={test:hg("#"),parse:D4,transform:_i.transform},Pl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$a=Pl("deg"),Cr=Pl("%"),xe=Pl("px"),$4=Pl("vh"),L4=Pl("vw"),B0={...Cr,parse:e=>Cr.parse(e)/100,transform:e=>Cr.transform(e*100)},_o={test:hg("hsl","hue"),parse:FS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Cr.transform(dl(t))+", "+Cr.transform(dl(n))+", "+dl(Sl.transform(a))+")"},Ut={test:e=>_i.test(e)||ep.test(e)||_o.test(e),parse:e=>_i.test(e)?_i.parse(e):_o.test(e)?_o.parse(e):ep.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_i.transform(e):_o.transform(e),getAnimatableNone:e=>{const t=Ut.parse(e);return t.alpha=0,Ut.transform(t)}},P4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function U4(e){return isNaN(e)&&typeof e=="string"&&(e.match(fg)?.length||0)+(e.match(P4)?.length||0)>0}const qS="number",GS="color",V4="var",B4="var(",Z0="${}",Z4=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function zl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},o=[];let u=0;const d=t.replace(Z4,h=>(Ut.test(h)?(a.color.push(u),o.push(GS),n.push(Ut.parse(h))):h.startsWith(B4)?(a.var.push(u),o.push(V4),n.push(h)):(a.number.push(u),o.push(qS),n.push(parseFloat(h))),++u,Z0)).split(Z0);return{values:n,split:d,indexes:a,types:o}}function YS(e){return zl(e).values}function XS(e){const{split:t,types:n}=zl(e),a=t.length;return o=>{let u="";for(let l=0;l<a;l++)if(u+=t[l],o[l]!==void 0){const d=n[l];d===qS?u+=dl(o[l]):d===GS?u+=Ut.transform(o[l]):u+=o[l]}return u}}const I4=e=>typeof e=="number"?0:Ut.test(e)?Ut.getAnimatableNone(e):e;function H4(e){const t=YS(e);return XS(e)(t.map(I4))}const Ia={test:U4,parse:YS,createTransformer:XS,getAnimatableNone:H4};function em(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function F4({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let o=0,u=0,l=0;if(!t)o=u=l=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;o=em(h,d,e+1/3),u=em(h,d,e),l=em(h,d,e-1/3)}return{red:Math.round(o*255),green:Math.round(u*255),blue:Math.round(l*255),alpha:a}}function Lc(e,t){return n=>n>0?t:e}const St=(e,t,n)=>e+(t-e)*n,tm=(e,t,n)=>{const a=e*e,o=n*(t*t-a)+a;return o<0?0:Math.sqrt(o)},q4=[ep,_i,_o],G4=e=>q4.find(t=>t.test(e));function I0(e){const t=G4(e);if(!t)return!1;let n=t.parse(e);return t===_o&&(n=F4(n)),n}const H0=(e,t)=>{const n=I0(e),a=I0(t);if(!n||!a)return Lc(e,t);const o={...n};return u=>(o.red=tm(n.red,a.red,u),o.green=tm(n.green,a.green,u),o.blue=tm(n.blue,a.blue,u),o.alpha=St(n.alpha,a.alpha,u),_i.transform(o))},tp=new Set(["none","hidden"]);function Y4(e,t){return tp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function X4(e,t){return n=>St(e,t,n)}function mg(e){return typeof e=="number"?X4:typeof e=="string"?dg(e)?Lc:Ut.test(e)?H0:Q4:Array.isArray(e)?KS:typeof e=="object"?Ut.test(e)?H0:K4:Lc}function KS(e,t){const n=[...e],a=n.length,o=e.map((u,l)=>mg(u)(u,t[l]));return u=>{for(let l=0;l<a;l++)n[l]=o[l](u);return n}}function K4(e,t){const n={...e,...t},a={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(a[o]=mg(e[o])(e[o],t[o]));return o=>{for(const u in a)n[u]=a[u](o);return n}}function J4(e,t){const n=[],a={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const u=t.types[o],l=e.indexes[u][a[u]],d=e.values[l]??0;n[o]=d,a[u]++}return n}const Q4=(e,t)=>{const n=Ia.createTransformer(t),a=zl(e),o=zl(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?tp.has(e)&&!o.values.length||tp.has(t)&&!a.values.length?Y4(e,t):$l(KS(J4(a,o),o.values),n):Lc(e,t)};function JS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?St(e,t,n):mg(e)(e,t)}const W4=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>pt.update(t,n),stop:()=>Za(t),now:()=>an.isProcessing?an.timestamp:bn.now()}},QS=(e,t,n=10)=>{let a="";const o=Math.max(Math.round(t/n),2);for(let u=0;u<o;u++)a+=Math.round(e(u/(o-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},Pc=2e4;function pg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<Pc;)t+=n,a=e.next(t);return t>=Pc?1/0:t}function eO(e,t=100,n){const a=n({...e,keyframes:[0,t]}),o=Math.min(pg(a),Pc);return{type:"keyframes",ease:u=>a.next(o*u).value/t,duration:or(o)}}const tO=5;function WS(e,t,n){const a=Math.max(t-tO,0);return AS(n-e(a),t-a)}const Nt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nm=.001;function nO({duration:e=Nt.duration,bounce:t=Nt.bounce,velocity:n=Nt.velocity,mass:a=Nt.mass}){let o,u,l=1-t;l=Er(Nt.minDamping,Nt.maxDamping,l),e=Er(Nt.minDuration,Nt.maxDuration,or(e)),l<1?(o=m=>{const g=m*l,x=g*e,b=g-n,v=np(m,l),z=Math.exp(-x);return nm-b/v*z},u=m=>{const x=m*l*e,b=x*n+n,v=Math.pow(l,2)*Math.pow(m,2)*e,z=Math.exp(-x),T=np(Math.pow(m,2),l);return(-o(m)+nm>0?-1:1)*((b-v)*z)/T}):(o=m=>{const g=Math.exp(-m*e),x=(m-n)*e+1;return-nm+g*x},u=m=>{const g=Math.exp(-m*e),x=(n-m)*(e*e);return g*x});const d=5/e,h=aO(o,u,d);if(e=ia(e),isNaN(h))return{stiffness:Nt.stiffness,damping:Nt.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const rO=12;function aO(e,t,n){let a=n;for(let o=1;o<rO;o++)a=a-e(a)/t(a);return a}function np(e,t){return e*Math.sqrt(1-t*t)}const iO=["duration","bounce"],oO=["stiffness","damping","mass"];function F0(e,t){return t.some(n=>e[n]!==void 0)}function sO(e){let t={velocity:Nt.velocity,stiffness:Nt.stiffness,damping:Nt.damping,mass:Nt.mass,isResolvedFromDuration:!1,...e};if(!F0(e,oO)&&F0(e,iO))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),o=a*a,u=2*Er(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Nt.mass,stiffness:o,damping:u}}else{const n=nO(e);t={...t,...n,mass:Nt.mass},t.isResolvedFromDuration=!0}return t}function Uc(e=Nt.visualDuration,t=Nt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:o}=n;const u=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],d={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:x,velocity:b,isResolvedFromDuration:v}=sO({...n,velocity:-or(n.velocity||0)}),z=b||0,T=m/(2*Math.sqrt(h*g)),E=l-u,N=or(Math.sqrt(h/g)),A=Math.abs(E)<5;a||(a=A?Nt.restSpeed.granular:Nt.restSpeed.default),o||(o=A?Nt.restDelta.granular:Nt.restDelta.default);let C;if(T<1){const L=np(N,T);C=M=>{const q=Math.exp(-T*N*M);return l-q*((z+T*N*E)/L*Math.sin(L*M)+E*Math.cos(L*M))}}else if(T===1)C=L=>l-Math.exp(-N*L)*(E+(z+N*E)*L);else{const L=N*Math.sqrt(T*T-1);C=M=>{const q=Math.exp(-T*N*M),V=Math.min(L*M,300);return l-q*((z+T*N*E)*Math.sinh(V)+L*E*Math.cosh(V))/L}}const $={calculatedDuration:v&&x||null,next:L=>{const M=C(L);if(v)d.done=L>=x;else{let q=L===0?z:0;T<1&&(q=L===0?ia(z):WS(C,L,M));const V=Math.abs(q)<=a,X=Math.abs(l-M)<=o;d.done=V&&X}return d.value=d.done?l:M,d},toString:()=>{const L=Math.min(pg($),Pc),M=QS(q=>$.next(L*q).value,L,30);return L+"ms "+M},toTransition:()=>{}};return $}Uc.applyToOptions=e=>{const t=eO(e,100,Uc);return e.ease=t.ease,e.duration=ia(t.duration),e.type="keyframes",e};function rp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:u=500,modifyTarget:l,min:d,max:h,restDelta:m=.5,restSpeed:g}){const x=e[0],b={done:!1,value:x},v=V=>d!==void 0&&V<d||h!==void 0&&V>h,z=V=>d===void 0?h:h===void 0||Math.abs(d-V)<Math.abs(h-V)?d:h;let T=n*t;const E=x+T,N=l===void 0?E:l(E);N!==E&&(T=N-x);const A=V=>-T*Math.exp(-V/a),C=V=>N+A(V),$=V=>{const X=A(V),ce=C(V);b.done=Math.abs(X)<=m,b.value=b.done?N:ce};let L,M;const q=V=>{v(b.value)&&(L=V,M=Uc({keyframes:[b.value,z(b.value)],velocity:WS(C,V,b.value),damping:o,stiffness:u,restDelta:m,restSpeed:g}))};return q(0),{calculatedDuration:null,next:V=>{let X=!1;return!M&&L===void 0&&(X=!0,$(V),q(V)),L!==void 0&&V>=L?M.next(V-L):(!X&&$(V),b)}}}function lO(e,t,n){const a=[],o=n||sa.mix||JS,u=e.length-1;for(let l=0;l<u;l++){let d=o(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||sr:t;d=$l(h,d)}a.push(d)}return a}function uO(e,t,{clamp:n=!0,ease:a,mixer:o}={}){const u=e.length;if(og(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=lO(t,a,o),h=d.length,m=g=>{if(l&&g<e[0])return t[0];let x=0;if(h>1)for(;x<e.length-2&&!(g<e[x+1]);x++);const b=wl(e[x],e[x+1],g);return d[x](b)};return n?g=>m(Er(e[0],e[u-1],g)):m}function cO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const o=wl(0,t,a);e.push(St(n,1,o))}}function dO(e){const t=[0];return cO(t,e.length-1),t}function fO(e,t){return e.map(n=>n*t)}function hO(e,t){return e.map(()=>t||VS).splice(0,e.length-1)}function fl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const o=z4(a)?a.map(U0):U0(a),u={done:!1,value:t[0]},l=fO(n&&n.length===t.length?n:dO(t),e),d=uO(l,t,{ease:Array.isArray(o)?o:hO(t,o)});return{calculatedDuration:e,next:h=>(u.value=d(h),u.done=h>=e,u)}}const mO=e=>e!==null;function gg(e,{repeat:t,repeatType:n="loop"},a,o=1){const u=e.filter(mO),d=o<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!d||a===void 0?u[d]:a}const pO={decay:rp,inertia:rp,tween:fl,keyframes:fl,spring:Uc};function ez(e){typeof e.type=="string"&&(e.type=pO[e.type])}class yg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const gO=e=>e/100;class xg extends yg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==bn.now()&&this.tick(bn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ez(t);const{type:n=fl,repeat:a=0,repeatDelay:o=0,repeatType:u,velocity:l=0}=t;let{keyframes:d}=t;const h=n||fl;h!==fl&&typeof d[0]!="number"&&(this.mixKeyframes=$l(gO,JS(d[0],d[1])),d=[0,100]);const m=h({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=pg(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+o,this.totalDuration=this.resolvedDuration*(a+1)-o,this.generator=m}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:o,mixKeyframes:u,mirroredGenerator:l,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:x,repeatType:b,repeatDelay:v,type:z,onUpdate:T,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-m*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?N<0:N>o;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,$=a;if(x){const V=Math.min(this.currentTime,o)/d;let X=Math.floor(V),ce=V%1;!ce&&V>=1&&(ce=1),ce===1&&X--,X=Math.min(X,x+1),X%2&&(b==="reverse"?(ce=1-ce,v&&(ce-=v/d)):b==="mirror"&&($=l)),C=Er(0,1,ce)*d}const L=A?{done:!1,value:g[0]}:$.next(C);u&&(L.value=u(L.value));let{done:M}=L;!A&&h!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return q&&z!==rp&&(L.value=gg(g,this.options,E,this.speed)),T&&T(L.value),q&&this.finish(),L}then(t,n){return this.finished.then(t,n)}get duration(){return or(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+or(t)}get time(){return or(this.currentTime)}set time(t){t=ia(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(bn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=or(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=W4,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(bn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function yO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ji=e=>e*180/Math.PI,ap=e=>{const t=ji(Math.atan2(e[1],e[0]));return ip(t)},xO={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ap,rotateZ:ap,skewX:e=>ji(Math.atan(e[1])),skewY:e=>ji(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ip=e=>(e=e%360,e<0&&(e+=360),e),q0=ap,G0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Y0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),bO={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:G0,scaleY:Y0,scale:e=>(G0(e)+Y0(e))/2,rotateX:e=>ip(ji(Math.atan2(e[6],e[5]))),rotateY:e=>ip(ji(Math.atan2(-e[2],e[0]))),rotateZ:q0,rotate:q0,skewX:e=>ji(Math.atan(e[4])),skewY:e=>ji(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function op(e){return e.includes("scale")?1:0}function sp(e,t){if(!e||e==="none")return op(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,o;if(n)a=bO,o=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=xO,o=d}if(!o)return op(t);const u=a[t],l=o[1].split(",").map(kO);return typeof u=="function"?u(l):l[u]}const vO=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return sp(n,t)};function kO(e){return parseFloat(e.trim())}const Ko=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jo=new Set(Ko),X0=e=>e===Xo||e===xe,wO=new Set(["x","y","z"]),SO=Ko.filter(e=>!wO.has(e));function zO(e){const t=[];return SO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Ua={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>sp(t,"x"),y:(e,{transform:t})=>sp(t,"y")};Ua.translateX=Ua.x;Ua.translateY=Ua.y;const Ti=new Set;let lp=!1,up=!1,cp=!1;function tz(){if(up){const e=Array.from(Ti).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const o=zO(a);o.length&&(n.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const o=n.get(a);o&&o.forEach(([u,l])=>{a.getValue(u)?.set(l)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}up=!1,lp=!1,Ti.forEach(e=>e.complete(cp)),Ti.clear()}function nz(){Ti.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(up=!0)})}function _O(){cp=!0,nz(),tz(),cp=!1}class bg{constructor(t,n,a,o,u,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=o,this.element=u,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ti.add(this),lp||(lp=!0,pt.read(nz),pt.resolveKeyframes(tz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:o}=this;if(t[0]===null){const u=o?.get(),l=t[t.length-1];if(u!==void 0)t[0]=u;else if(a&&n){const d=a.readValue(n,l);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=l),o&&u===void 0&&o.set(t[0])}yO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ti.delete(this)}cancel(){this.state==="scheduled"&&(Ti.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const jO=e=>e.startsWith("--");function TO(e,t,n){jO(t)?e.style.setProperty(t,n):e.style[t]=n}const CO=sg(()=>window.ScrollTimeline!==void 0),EO={};function NO(e,t){const n=sg(e);return()=>EO[t]??n()}const rz=NO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sl=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,K0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sl([0,.65,.55,1]),circOut:sl([.55,0,1,.45]),backIn:sl([.31,.01,.66,-.59]),backOut:sl([.33,1.53,.69,.99])};function az(e,t){if(e)return typeof e=="function"?rz()?QS(e,t):"ease-out":BS(e)?sl(e):Array.isArray(e)?e.map(n=>az(n,t)||K0.easeOut):K0[e]}function AO(e,t,n,{delay:a=0,duration:o=300,repeat:u=0,repeatType:l="loop",ease:d="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const x=az(d,o);Array.isArray(x)&&(g.easing=x);const b={delay:a,duration:o,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(g,b)}function iz(e){return typeof e=="function"&&"applyToOptions"in e}function OO({type:e,...t}){return iz(e)&&rz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class RO extends yg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:o,pseudoElement:u,allowFlatten:l=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=l,this.options=t,og(typeof t.type!="string");const m=OO(t);this.animation=AO(n,a,o,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=gg(o,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(g):TO(n,a,g),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return or(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+or(t)}get time(){return or(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ia(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&CO()?(this.animation.timeline=t,sr):n(this)}}const oz={anticipate:LS,backInOut:$S,circInOut:US};function MO(e){return e in oz}function DO(e){typeof e.ease=="string"&&MO(e.ease)&&(e.ease=oz[e.ease])}const rm=10;class $O extends RO{constructor(t){DO(t),ez(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:o,element:u,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new xg({...l,autoplay:!1}),h=Math.max(rm,bn.now()-this.startTime),m=Er(0,rm,h-rm);n.setWithVelocity(d.sample(Math.max(0,h-m)).value,d.sample(h).value,m),d.stop()}}const J0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ia.test(e)||e==="0")&&!e.startsWith("url("));function LO(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function PO(e,t,n,a){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],l=J0(o,t),d=J0(u,t);return!l||!d?!1:LO(e)||(n==="spring"||iz(n))&&a}function dp(e){e.duration=0,e.type="keyframes"}const UO=new Set(["opacity","clipPath","filter","transform"]),VO=sg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function BO(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:o,damping:u,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return VO()&&n&&UO.has(n)&&(n!=="transform"||!m)&&!h&&!a&&o!=="mirror"&&u!==0&&l!=="inertia"}const ZO=40;class IO extends yg{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:l="loop",keyframes:d,name:h,motionValue:m,element:g,...x}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=bn.now();const b={autoplay:t,delay:n,type:a,repeat:o,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...x},v=g?.KeyframeResolver||bg;this.keyframeResolver=new v(d,(z,T,E)=>this.onKeyframesResolved(z,T,b,!E),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,o){this.keyframeResolver=void 0;const{name:u,type:l,velocity:d,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=bn.now(),PO(t,u,l,d)||((sa.instantAnimations||!h)&&g?.(gg(t,a,n)),t[0]=t[t.length-1],dp(a),a.repeat=0);const b={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>ZO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&BO(b),z=b.motionValue?.owner?.current,T=v?new $O({...b,element:z}):new xg(b);T.finished.then(()=>{this.notifyFinished()}).catch(sr),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),_O()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function sz(e,t,n,a=0,o=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,d=(l-1)*a;return typeof n=="function"?n(u,l):o===1?u*a:d-u*a}const HO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FO(e){const t=HO.exec(e);if(!t)return[,];const[,n,a,o]=t;return[`--${n??a}`,o]}function lz(e,t,n=1){const[a,o]=FO(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const l=u.trim();return CS(l)?parseFloat(l):l}return dg(o)?lz(o,t,n+1):o}const qO={type:"spring",stiffness:500,damping:25,restSpeed:10},GO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),YO={type:"keyframes",duration:.8},XO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},KO=(e,{keyframes:t})=>t.length>2?YO:Jo.has(e)?e.startsWith("scale")?GO(t[1]):qO:XO,JO=e=>e!==null;function QO(e,{repeat:t,repeatType:n="loop"},a){const o=e.filter(JO),u=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[u]}function vg(e,t){return e?.[t]??e?.default??e}function WO({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:o,repeat:u,repeatType:l,repeatDelay:d,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const kg=(e,t,n,a={},o,u)=>l=>{const d=vg(a,e)||{},h=d.delay||a.delay||0;let{elapsed:m=0}=a;m=m-ia(h);const g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{l(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:o};WO(d)||Object.assign(g,KO(e,g)),g.duration&&(g.duration=ia(g.duration)),g.repeatDelay&&(g.repeatDelay=ia(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let x=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(dp(g),g.delay===0&&(x=!0)),(sa.instantAnimations||sa.skipAnimations)&&(x=!0,dp(g),g.delay=0),g.allowFlatten=!d.type&&!d.ease,x&&!u&&t.get()!==void 0){const b=QO(g.keyframes,d);if(b!==void 0){pt.update(()=>{g.onUpdate(b),g.onComplete()});return}}return d.isSync?new xg(g):new IO(g)};function Q0(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function wg(e,t,n,a){if(typeof t=="function"){const[o,u]=Q0(a);t=t(n!==void 0?n:e.custom,o,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,u]=Q0(a);t=t(n!==void 0?n:e.custom,o,u)}return t}function Mo(e,t,n){const a=e.getProps();return wg(a,t,n!==void 0?n:a.custom,e)}const uz=new Set(["width","height","top","left","right","bottom",...Ko]),W0=30,eR=e=>!isNaN(parseFloat(e));class tR{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const o=bn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new lg);const a=this.events[t].add(n);return t==="change"?()=>{a(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=bn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>W0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,W0);return AS(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bo(e,t){return new tR(e,t)}const fp=e=>Array.isArray(e);function nR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Bo(n))}function rR(e){return fp(e)?e[e.length-1]||0:e}function aR(e,t){const n=Mo(e,t);let{transitionEnd:a={},transition:o={},...u}=n||{};u={...u,...a};for(const l in u){const d=rR(u[l]);nR(e,l,d)}}const cn=e=>!!(e&&e.getVelocity);function iR(e){return!!(cn(e)&&e.add)}function hp(e,t){const n=e.getValue("willChange");if(iR(n))return n.add(t);if(!n&&sa.WillChange){const a=new sa.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Sg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const oR="framerAppearId",cz="data-"+Sg(oR);function dz(e){return e.props[cz]}function sR({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function fz(e,t,{delay:n=0,transitionOverride:a,type:o}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:l,...d}=t;const h=u?.reduceMotion;a&&(u=a);const m=[],g=o&&e.animationState&&e.animationState.getState()[o];for(const x in d){const b=e.getValue(x,e.latestValues[x]??null),v=d[x];if(v===void 0||g&&sR(g,x))continue;const z={delay:n,...vg(u||{},x)},T=b.get();if(T!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===T&&!z.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const C=dz(e);if(C){const $=window.MotionHandoffAnimation(C,x,pt);$!==null&&(z.startTime=$,E=!0)}}hp(e,x);const N=h??e.shouldReduceMotion;b.start(kg(x,b,v,N&&uz.has(x)?{type:!1}:z,e,E));const A=b.animation;A&&m.push(A)}return l&&Promise.all(m).then(()=>{pt.update(()=>{l&&aR(e,l)})}),m}function mp(e,t,n={}){const a=Mo(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(o=n.transitionOverride);const u=a?()=>Promise.all(fz(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:x}=o;return lR(e,t,h,m,g,x,n)}:()=>Promise.resolve(),{when:d}=o;if(d){const[h,m]=d==="beforeChildren"?[u,l]:[l,u];return h().then(()=>m())}else return Promise.all([u(),l(n.delay)])}function lR(e,t,n=0,a=0,o=0,u=1,l){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(mp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+sz(e.variantChildren,h,a,o,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function uR(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const o=t.map(u=>mp(e,u,n));a=Promise.all(o)}else if(typeof t=="string")a=mp(e,t,n);else{const o=typeof t=="function"?Mo(e,t,n.custom):t;a=Promise.all(fz(e,o,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const cR={test:e=>e==="auto",parse:e=>e},hz=e=>t=>t.test(e),mz=[Xo,xe,Cr,$a,L4,$4,cR],e1=e=>mz.find(hz(e));function dR(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||NS(e):!0}const fR=new Set(["brightness","contrast","saturate","opacity"]);function hR(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(fg)||[];if(!a)return e;const o=n.replace(a,"");let u=fR.has(t)?1:0;return a!==n&&(u*=100),t+"("+u+o+")"}const mR=/\b([a-z-]*)\(.*?\)/gu,pp={...Ia,getAnimatableNone:e=>{const t=e.match(mR);return t?t.map(hR).join(" "):e}},t1={...Xo,transform:Math.round},pR={rotate:$a,rotateX:$a,rotateY:$a,rotateZ:$a,scale:uc,scaleX:uc,scaleY:uc,scaleZ:uc,skew:$a,skewX:$a,skewY:$a,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Sl,originX:B0,originY:B0,originZ:xe},zg={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,inset:xe,insetBlock:xe,insetBlockStart:xe,insetBlockEnd:xe,insetInline:xe,insetInlineStart:xe,insetInlineEnd:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,paddingBlock:xe,paddingBlockStart:xe,paddingBlockEnd:xe,paddingInline:xe,paddingInlineStart:xe,paddingInlineEnd:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,marginBlock:xe,marginBlockStart:xe,marginBlockEnd:xe,marginInline:xe,marginInlineStart:xe,marginInlineEnd:xe,fontSize:xe,backgroundPositionX:xe,backgroundPositionY:xe,...pR,zIndex:t1,fillOpacity:Sl,strokeOpacity:Sl,numOctaves:t1},gR={...zg,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:pp,WebkitFilter:pp},pz=e=>gR[e];function gz(e,t){let n=pz(e);return n!==pp&&(n=Ia),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yR=new Set(["auto","none","0"]);function xR(e,t,n){let a=0,o;for(;a<e.length&&!o;){const u=e[a];typeof u=="string"&&!yR.has(u)&&zl(u).values.length&&(o=e[a]),a++}if(o&&n)for(const u of t)e[u]=gz(n,o)}class bR extends bg{constructor(t,n,a,o,u){super(t,n,a,o,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let x=t[g];if(typeof x=="string"&&(x=x.trim(),dg(x))){const b=lz(x,n.current);b!==void 0&&(t[g]=b),g===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!uz.has(a)||t.length!==2)return;const[o,u]=t,l=e1(o),d=e1(u),h=V0(o),m=V0(u);if(h!==m&&Ua[a]){this.needsMeasurement=!0;return}if(l!==d)if(X0(l)&&X0(d))for(let g=0;g<t.length;g++){const x=t[g];typeof x=="string"&&(t[g]=parseFloat(x))}else Ua[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let o=0;o<t.length;o++)(t[o]===null||dR(t[o]))&&a.push(o);a.length&&xR(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ua[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const u=a.length-1,l=a[u];a[u]=Ua[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function vR(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const o=n?.[e]??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}const yz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function gp(e){return ES(e)&&"offsetHeight"in e}const{schedule:_g}=ZS(queueMicrotask,!1),pr={x:!1,y:!1};function xz(){return pr.x||pr.y}function kR(e){return e==="x"||e==="y"?pr[e]?null:(pr[e]=!0,()=>{pr[e]=!1}):pr.x||pr.y?null:(pr.x=pr.y=!0,()=>{pr.x=pr.y=!1})}function bz(e,t){const n=vR(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[n,o,()=>a.abort()]}function n1(e){return!(e.pointerType==="touch"||xz())}function wR(e,t,n={}){const[a,o,u]=bz(e,n),l=d=>{if(!n1(d))return;const{target:h}=d,m=t(h,d);if(typeof m!="function"||!h)return;const g=x=>{n1(x)&&(m(x),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,o)};return a.forEach(d=>{d.addEventListener("pointerenter",l,o)}),u}const vz=(e,t)=>t?e===t?!0:vz(e,t.parentElement):!1,jg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,SR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kz(e){return SR.has(e.tagName)||e.isContentEditable===!0}const Ec=new WeakSet;function r1(e){return t=>{t.key==="Enter"&&e(t)}}function am(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const zR=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=r1(()=>{if(Ec.has(n))return;am(n,"down");const o=r1(()=>{am(n,"up")}),u=()=>am(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function a1(e){return jg(e)&&!xz()}function _R(e,t,n={}){const[a,o,u]=bz(e,n),l=d=>{const h=d.currentTarget;if(!a1(d))return;Ec.add(h);const m=t(h,d),g=(v,z)=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",b),Ec.has(h)&&Ec.delete(h),a1(v)&&typeof m=="function"&&m(v,{success:z})},x=v=>{g(v,h===window||h===document||n.useGlobalTarget||vz(h,v.target))},b=v=>{g(v,!1)};window.addEventListener("pointerup",x,o),window.addEventListener("pointercancel",b,o)};return a.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",l,o),gp(d)&&(d.addEventListener("focus",m=>zR(m,o)),!kz(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function wz(e){return ES(e)&&"ownerSVGElement"in e}function jR(e){return wz(e)&&e.tagName==="svg"}const TR=[...mz,Ut,Ia],CR=e=>TR.find(hz(e)),i1=()=>({translate:0,scale:1,origin:0,originPoint:0}),jo=()=>({x:i1(),y:i1()}),o1=()=>({min:0,max:0}),Yt=()=>({x:o1(),y:o1()}),yp={current:null},Sz={current:!1},ER=typeof window<"u";function NR(){if(Sz.current=!0,!!ER)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yp.current=e.matches;e.addEventListener("change",t),t()}else yp.current=!1}const AR=new WeakMap;function sd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function _l(e){return typeof e=="string"||Array.isArray(e)}const Tg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cg=["initial",...Tg];function ld(e){return sd(e.animate)||Cg.some(t=>_l(e[t]))}function zz(e){return!!(ld(e)||e.variants)}function OR(e,t,n){for(const a in t){const o=t[a],u=n[a];if(cn(o))e.addValue(a,o);else if(cn(u))e.addValue(a,Bo(o,{owner:e}));else if(u!==o)if(e.hasValue(a)){const l=e.getValue(a);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(a);e.addValue(a,Bo(l!==void 0?l:o,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const s1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Vc={};function _z(e){Vc=e}function RR(){return Vc}class MR{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:o,blockInitialAnimation:u,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=bn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,pt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=l;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=ld(n),this.isVariantNode=zz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...x}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in x){const v=x[b];h[b]!==void 0&&cn(v)&&v.set(h[b])}}mount(t){this.current=t,AR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Sz.current||NR(),this.shouldReduceMotion=yp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Za(this.notifyUpdate),Za(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const a=Jo.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&pt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),u&&u(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Vc){const n=Vc[t];if(!n)continue;const{isEnabled:a,Feature:o}=n;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Yt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<s1.length;a++){const o=s1[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const u="on"+o,l=t[u];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=OR(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=Bo(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(CS(a)||NS(a))?a=parseFloat(a):!CR(a)&&Ia.test(n)&&(a=gz(t,n)),this.setBaseTarget(t,cn(a)?a.get():a)),cn(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const u=wg(this.props,n,this.presenceContext?.custom);u&&(a=u[t])}if(n&&a!==void 0)return a;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!cn(o)?o:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new lg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){_g.render(this.render)}}class jz extends MR{constructor(){super(...arguments),this.KeyframeResolver=bR}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;cn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class qa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tz({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function DR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $R(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function im(e){return e===void 0||e===1}function xp({scale:e,scaleX:t,scaleY:n}){return!im(e)||!im(t)||!im(n)}function wi(e){return xp(e)||Cz(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cz(e){return l1(e.x)||l1(e.y)}function l1(e){return e&&e!=="0%"}function Bc(e,t,n){const a=e-n,o=t*a;return n+o}function u1(e,t,n,a,o){return o!==void 0&&(e=Bc(e,o,a)),Bc(e,n,a)+t}function bp(e,t=0,n=1,a,o){e.min=u1(e.min,t,n,a,o),e.max=u1(e.max,t,n,a,o)}function Ez(e,{x:t,y:n}){bp(e.x,t.translate,t.scale,t.originPoint),bp(e.y,n.translate,n.scale,n.originPoint)}const c1=.999999999999,d1=1.0000000000001;function LR(e,t,n,a=!1){const o=n.length;if(!o)return;t.x=t.y=1;let u,l;for(let d=0;d<o;d++){u=n[d],l=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Co(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Ez(e,l)),a&&wi(u.latestValues)&&Co(e,u.latestValues))}t.x<d1&&t.x>c1&&(t.x=1),t.y<d1&&t.y>c1&&(t.y=1)}function To(e,t){e.min=e.min+t,e.max=e.max+t}function f1(e,t,n,a,o=.5){const u=St(e.min,e.max,o);bp(e,t,n,u,a)}function Co(e,t){f1(e.x,t.x,t.scaleX,t.scale,t.originX),f1(e.y,t.y,t.scaleY,t.scale,t.originY)}function Nz(e,t){return Tz($R(e.getBoundingClientRect(),t))}function PR(e,t,n){const a=Nz(e,n),{scroll:o}=t;return o&&(To(a.x,o.offset.x),To(a.y,o.offset.y)),a}const UR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VR=Ko.length;function BR(e,t,n){let a="",o=!0;for(let u=0;u<VR;u++){const l=Ko[u],d=e[l];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(l.startsWith("scale")?1:0);else{const m=parseFloat(d);h=l.startsWith("scale")?m===1:m===0}if(!h||n){const m=yz(d,zg[l]);if(!h){o=!1;const g=UR[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,o?"":a):o&&(a="none"),a}function Eg(e,t,n){const{style:a,vars:o,transformOrigin:u}=e;let l=!1,d=!1;for(const h in t){const m=t[h];if(Jo.has(h)){l=!0;continue}else if(HS(h)){o[h]=m;continue}else{const g=yz(m,zg[h]);h.startsWith("origin")?(d=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=BR(t,e.transform,n):a.transform&&(a.transform="none")),d){const{originX:h="50%",originY:m="50%",originZ:g=0}=u;a.transformOrigin=`${h} ${m} ${g}`}}function Az(e,{style:t,vars:n},a,o){const u=e.style;let l;for(l in t)u[l]=t[l];o?.applyProjectionStyles(u,a);for(l in n)u.setProperty(l,n[l])}function h1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ws={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(xe.test(e))e=parseFloat(e);else return e;const n=h1(e,t.target.x),a=h1(e,t.target.y);return`${n}% ${a}%`}},ZR={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,o=Ia.parse(e);if(o.length>5)return a;const u=Ia.createTransformer(e),l=typeof o[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;o[0+l]/=d,o[1+l]/=h;const m=St(d,h,.5);return typeof o[2+l]=="number"&&(o[2+l]/=m),typeof o[3+l]=="number"&&(o[3+l]/=m),u(o)}},vp={borderRadius:{...Ws,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ws,borderTopRightRadius:Ws,borderBottomLeftRadius:Ws,borderBottomRightRadius:Ws,boxShadow:ZR};function Oz(e,{layout:t,layoutId:n}){return Jo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!vp[e]||e==="opacity")}function Ng(e,t,n){const a=e.style,o=t?.style,u={};if(!a)return u;for(const l in a)(cn(a[l])||o&&cn(o[l])||Oz(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(u[l]=a[l]);return u}function IR(e){return window.getComputedStyle(e)}class HR extends jz{constructor(){super(...arguments),this.type="html",this.renderInstance=Az}readValueFromInstance(t,n){if(Jo.has(n))return this.projection?.isProjecting?op(n):vO(t,n);{const a=IR(t),o=(HS(n)?a.getPropertyValue(n):a[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nz(t,n)}build(t,n,a){Eg(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Ng(t,n,a)}}const FR={offset:"stroke-dashoffset",array:"stroke-dasharray"},qR={offset:"strokeDashoffset",array:"strokeDasharray"};function GR(e,t,n=1,a=0,o=!0){e.pathLength=1;const u=o?FR:qR;e[u.offset]=`${-a}`,e[u.array]=`${t} ${n}`}const YR=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rz(e,{attrX:t,attrY:n,attrScale:a,pathLength:o,pathSpacing:u=1,pathOffset:l=0,...d},h,m,g){if(Eg(e,d,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:b}=e;x.transform&&(b.transform=x.transform,delete x.transform),(b.transform||x.transformOrigin)&&(b.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),b.transform&&(b.transformBox=g?.transformBox??"fill-box",delete x.transformBox);for(const v of YR)x[v]!==void 0&&(b[v]=x[v],delete x[v]);t!==void 0&&(x.x=t),n!==void 0&&(x.y=n),a!==void 0&&(x.scale=a),o!==void 0&&GR(x,o,u,l,!1)}const Mz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Dz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function XR(e,t,n,a){Az(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(Mz.has(o)?o:Sg(o),t.attrs[o])}function $z(e,t,n){const a=Ng(e,t,n);for(const o in e)if(cn(e[o])||cn(t[o])){const u=Ko.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[u]=e[o]}return a}class KR extends jz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Yt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Jo.has(n)){const a=pz(n);return a&&a.default||0}return n=Mz.has(n)?n:Sg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return $z(t,n,a)}build(t,n,a){Rz(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,o){XR(t,n,a,o)}mount(t){this.isSVGTag=Dz(t.tagName),super.mount(t)}}const JR=Cg.length;function Lz(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Lz(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<JR;n++){const a=Cg[n],o=e.props[a];(_l(o)||o===!1)&&(t[a]=o)}return t}function Pz(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const QR=[...Tg].reverse(),WR=Tg.length;function e3(e){return t=>Promise.all(t.map(({animation:n,options:a})=>uR(e,n,a)))}function t3(e){let t=e3(e),n=m1(),a=!0;const o=h=>(m,g)=>{const x=Mo(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(x){const{transition:b,transitionEnd:v,...z}=x;m={...m,...z,...v}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Lz(e.parent)||{},x=[],b=new Set;let v={},z=1/0;for(let E=0;E<WR;E++){const N=QR[E],A=n[N],C=m[N]!==void 0?m[N]:g[N],$=_l(C),L=N===h?A.isActive:null;L===!1&&(z=E);let M=C===g[N]&&C!==m[N]&&$;if(M&&a&&e.manuallyAnimateOnMount&&(M=!1),A.protectedKeys={...v},!A.isActive&&L===null||!C&&!A.prevProp||sd(C)||typeof C=="boolean")continue;const q=n3(A.prevProp,C);let V=q||N===h&&A.isActive&&!M&&$||E>z&&$,X=!1;const ce=Array.isArray(C)?C:[C];let Q=ce.reduce(o(N),{});L===!1&&(Q={});const{prevResolvedValues:se={}}=A,te={...se,...Q},oe=K=>{V=!0,b.has(K)&&(X=!0,b.delete(K)),A.needsAnimating[K]=!0;const B=e.getValue(K);B&&(B.liveStyle=!1)};for(const K in te){const B=Q[K],he=se[K];if(v.hasOwnProperty(K))continue;let O=!1;fp(B)&&fp(he)?O=!Pz(B,he):O=B!==he,O?B!=null?oe(K):b.add(K):B!==void 0&&b.has(K)?oe(K):A.protectedKeys[K]=!0}A.prevProp=C,A.prevResolvedValues=Q,A.isActive&&(v={...v,...Q}),a&&e.blockInitialAnimation&&(V=!1);const ae=M&&q;V&&(!ae||X)&&x.push(...ce.map(K=>{const B={type:N};if(typeof K=="string"&&a&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:he}=e,O=Mo(he,K);if(he.enteringChildren&&O){const{delayChildren:S}=O.transition||{};B.delay=sz(he.enteringChildren,e,S)}}return{animation:K,options:B}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const N=Mo(e,Array.isArray(m.initial)?m.initial[0]:m.initial);N&&N.transition&&(E.transition=N.transition)}b.forEach(N=>{const A=e.getBaseTarget(N),C=e.getValue(N);C&&(C.liveStyle=!0),E[N]=A??null}),x.push({animation:E})}let T=!!x.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(T=!1),a=!1,T?t(x):Promise.resolve()}function d(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(x=>x.animationState?.setActive(h,m)),n[h].isActive=m;const g=l(h);for(const x in n)n[x].protectedKeys={};return g}return{animateChanges:l,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=m1()}}}function n3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Pz(t,e):!1}function gi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function m1(){return{animate:gi(!0),whileInView:gi(),whileHover:gi(),whileTap:gi(),whileDrag:gi(),whileFocus:gi(),exit:gi()}}function p1(e,t){e.min=t.min,e.max=t.max}function mr(e,t){p1(e.x,t.x),p1(e.y,t.y)}function g1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Uz=1e-4,r3=1-Uz,a3=1+Uz,Vz=.01,i3=0-Vz,o3=0+Vz;function vn(e){return e.max-e.min}function s3(e,t,n){return Math.abs(e-t)<=n}function y1(e,t,n,a=.5){e.origin=a,e.originPoint=St(t.min,t.max,e.origin),e.scale=vn(n)/vn(t),e.translate=St(n.min,n.max,e.origin)-e.originPoint,(e.scale>=r3&&e.scale<=a3||isNaN(e.scale))&&(e.scale=1),(e.translate>=i3&&e.translate<=o3||isNaN(e.translate))&&(e.translate=0)}function hl(e,t,n,a){y1(e.x,t.x,n.x,a?a.originX:void 0),y1(e.y,t.y,n.y,a?a.originY:void 0)}function x1(e,t,n){e.min=n.min+t.min,e.max=e.min+vn(t)}function l3(e,t,n){x1(e.x,t.x,n.x),x1(e.y,t.y,n.y)}function b1(e,t,n){e.min=t.min-n.min,e.max=e.min+vn(t)}function Zc(e,t,n){b1(e.x,t.x,n.x),b1(e.y,t.y,n.y)}function v1(e,t,n,a,o){return e-=t,e=Bc(e,1/n,a),o!==void 0&&(e=Bc(e,1/o,a)),e}function u3(e,t=0,n=1,a=.5,o,u=e,l=e){if(Cr.test(t)&&(t=parseFloat(t),t=St(l.min,l.max,t/100)-l.min),typeof t!="number")return;let d=St(u.min,u.max,a);e===u&&(d-=t),e.min=v1(e.min,t,n,d,o),e.max=v1(e.max,t,n,d,o)}function k1(e,t,[n,a,o],u,l){u3(e,t[n],t[a],t[o],t.scale,u,l)}const c3=["x","scaleX","originX"],d3=["y","scaleY","originY"];function w1(e,t,n,a){k1(e.x,t,c3,n?n.x:void 0,a?a.x:void 0),k1(e.y,t,d3,n?n.y:void 0,a?a.y:void 0)}function S1(e){return e.translate===0&&e.scale===1}function Bz(e){return S1(e.x)&&S1(e.y)}function z1(e,t){return e.min===t.min&&e.max===t.max}function f3(e,t){return z1(e.x,t.x)&&z1(e.y,t.y)}function _1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Zz(e,t){return _1(e.x,t.x)&&_1(e.y,t.y)}function j1(e){return vn(e.x)/vn(e.y)}function T1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function rr(e){return[e("x"),e("y")]}function h3(e,t,n){let a="";const o=e.x.translate/t.x,u=e.y.translate/t.y,l=n?.z||0;if((o||u||l)&&(a=`translate3d(${o}px, ${u}px, ${l}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:x,rotateY:b,skewX:v,skewY:z}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),x&&(a+=`rotateX(${x}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),z&&(a+=`skewY(${z}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(a+=`scale(${d}, ${h})`),a||"none"}const Iz=["TopLeft","TopRight","BottomLeft","BottomRight"],m3=Iz.length,C1=e=>typeof e=="string"?parseFloat(e):e,E1=e=>typeof e=="number"||xe.test(e);function p3(e,t,n,a,o,u){o?(e.opacity=St(0,n.opacity??1,g3(a)),e.opacityExit=St(t.opacity??1,0,y3(a))):u&&(e.opacity=St(t.opacity??1,n.opacity??1,a));for(let l=0;l<m3;l++){const d=`border${Iz[l]}Radius`;let h=N1(t,d),m=N1(n,d);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||E1(h)===E1(m)?(e[d]=Math.max(St(C1(h),C1(m),a),0),(Cr.test(m)||Cr.test(h))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=St(t.rotate||0,n.rotate||0,a))}function N1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const g3=Hz(0,.5,PS),y3=Hz(.5,.95,sr);function Hz(e,t,n){return a=>a<e?0:a>t?1:n(wl(e,t,a))}function x3(e,t,n){const a=cn(e)?e:Bo(e);return a.start(kg("",a,t,n)),a.animation}function jl(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const b3=(e,t)=>e.depth-t.depth;class v3{constructor(){this.children=[],this.isDirty=!1}add(t){ag(this.children,t),this.isDirty=!0}remove(t){ig(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(b3),this.isDirty=!1,this.children.forEach(t)}}function k3(e,t){const n=bn.now(),a=({timestamp:o})=>{const u=o-n;u>=t&&(Za(a),e(u-t))};return pt.setup(a,!0),()=>Za(a)}function Nc(e){return cn(e)?e.get():e}class w3{constructor(){this.members=[]}add(t){ag(this.members,t),t.scheduleRender()}remove(t){if(ig(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let a;for(let o=n;o>=0;o--){const u=this.members[o];if(u.isPresent!==!1){a=u;break}}return a?(this.promote(a),!0):!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender();const o=a.options.layoutDependency,u=t.options.layoutDependency;o!==void 0&&u!==void 0&&o===u||(t.resumeFrom=a,n&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:d}=t.options;d===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:a}=t;n.onExitComplete&&n.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Ac={hasAnimatedSinceResize:!0,hasEverUpdated:!1},om=["","X","Y","Z"],S3=1e3;let z3=0;function sm(e,t,n,a){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function Fz(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",pt,!(o||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&Fz(a)}function qz({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(l={},d=t?.()){this.id=z3++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(T3),this.nodes.forEach(A3),this.nodes.forEach(O3),this.nodes.forEach(C3)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new v3)}addEventListener(l,d){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new lg),this.eventHandlers.get(l).add(d)}notifyListeners(l,...d){const h=this.eventHandlers.get(l);h&&h.notify(...d)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=wz(l)&&!jR(l),this.instance=l;const{layoutId:d,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let g,x=0;const b=()=>this.root.updateBlockedByResize=!1;pt.read(()=>{x=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==x&&(x=v,this.root.updateBlockedByResize=!0,g&&g(),g=k3(b,250),Ac.hasAnimatedSinceResize&&(Ac.hasAnimatedSinceResize=!1,this.nodes.forEach(R1)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const z=this.options.transition||m.getDefaultTransition()||L3,{onLayoutAnimationStart:T,onLayoutAnimationComplete:E}=m.getProps(),N=!this.targetLayout||!Zz(this.targetLayout,v),A=!x&&b;if(this.options.layoutRoot||this.resumeFrom||A||x&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...vg(z,"layout"),onPlay:T,onComplete:E};(m.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(g,A)}else x||R1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Za(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(R3),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fz(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const x=this.path[g];x.shouldResetTransform=!0,x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(A1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(O1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(N3),this.nodes.forEach(_3),this.nodes.forEach(j3)):this.nodes.forEach(O1),this.clearAllSnapshots();const d=bn.now();an.delta=Er(0,1e3/60,d-an.timestamp),an.timestamp=d,an.isProcessing=!0,Qh.update.process(an),Qh.preRender.process(an),Qh.render.process(an),an.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_g.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(E3),this.sharedNodes.forEach(M3)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Yt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(d=!1),d&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Bz(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(d||wi(this.latestValues)||g)&&(o(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return l&&(h=this.removeTransform(h)),P3(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Yt();const d=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(U3))){const{scroll:m}=this.root;m&&(To(d.x,m.offset.x),To(d.y,m.offset.y))}return d}removeElementScroll(l){const d=Yt();if(mr(d,l),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:x}=m;m!==this.root&&g&&x.layoutScroll&&(g.wasRoot&&mr(d,l),To(d.x,g.offset.x),To(d.y,g.offset.y))}return d}applyTransform(l,d=!1){const h=Yt();mr(h,l);for(let m=0;m<this.path.length;m++){const g=this.path[m];!d&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Co(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),wi(g.latestValues)&&Co(h,g.latestValues)}return wi(this.latestValues)&&Co(h,this.latestValues),h}removeTransform(l){const d=Yt();mr(d,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!wi(m.latestValues))continue;xp(m.latestValues)&&m.updateSnapshot();const g=Yt(),x=m.measurePageBox();mr(g,x),w1(d,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return wi(this.latestValues)&&w1(d,this.latestValues),d}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==an.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(l||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:x}=this.options;if(!this.layout||!(g||x))return;this.resolvedRelativeTargetAt=an.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Yt(),this.targetWithTransforms=Yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),l3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mr(this.target,this.layout.layoutBox),Ez(this.target,this.targetDelta)):mr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||xp(this.parent.latestValues)||Cz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,d,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Yt(),this.relativeTargetOrigin=Yt(),Zc(this.relativeTargetOrigin,d,h),mr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),d=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===an.timestamp&&(h=!1),h)return;const{layout:m,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||g))return;mr(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;LR(this.layoutCorrected,this.treeScale,this.path,d),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Yt());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(g1(this.prevProjectionDelta.x,this.projectionDelta.x),g1(this.prevProjectionDelta.y,this.projectionDelta.y)),hl(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!T1(this.projectionDelta.x,this.prevProjectionDelta.x)||!T1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=jo(),this.projectionDelta=jo(),this.projectionDeltaWithTransform=jo()}setAnimationOrigin(l,d=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},x=jo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const b=Yt(),v=h?h.source:void 0,z=this.layout?this.layout.source:void 0,T=v!==z,E=this.getStack(),N=!E||E.members.length<=1,A=!!(T&&!N&&this.options.crossfade===!0&&!this.path.some($3));this.animationProgress=0;let C;this.mixTargetDelta=$=>{const L=$/1e3;M1(x.x,l.x,L),M1(x.y,l.y,L),this.setTargetDelta(x),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zc(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),D3(this.relativeTarget,this.relativeTargetOrigin,b,L),C&&f3(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Yt()),mr(C,this.relativeTarget)),T&&(this.animationValues=g,p3(g,m,this.latestValues,L,A,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Za(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Ac.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bo(0)),this.currentAnimation=x3(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),l.onUpdate&&l.onUpdate(d)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(S3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:d,target:h,layout:m,latestValues:g}=l;if(!(!d||!h||!m)){if(this!==l&&this.layout&&m&&Gz(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Yt();const x=vn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+x;const b=vn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+b}mr(d,h),Co(d,g),hl(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(l,d){this.sharedNodes.has(l)||this.sharedNodes.set(l,new w3),this.sharedNodes.get(l).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:d,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let d=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const m={};h.z&&sm("z",l,m,this.animationValues);for(let g=0;g<om.length;g++)sm(`rotate${om[g]}`,l,m,this.animationValues),sm(`skew${om[g]}`,l,m,this.animationValues);l.render();for(const g in m)l.setStaticValue(g,m[g]),this.animationValues&&(this.animationValues[g]=m[g]);l.scheduleRender()}applyProjectionStyles(l,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Nc(d?.pointerEvents)||"",l.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Nc(d?.pointerEvents)||""),this.hasProjected&&!wi(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let x=h3(this.projectionDeltaWithTransform,this.treeScale,g);h&&(x=h(g,x)),l.transform=x;const{x:b,y:v}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?l.opacity=m===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:l.opacity=m===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const z in vp){if(g[z]===void 0)continue;const{correct:T,applyTo:E,isCSSVariable:N}=vp[z],A=x==="none"?g[z]:T(g[z],m);if(E){const C=E.length;for(let $=0;$<C;$++)l[E[$]]=A}else N?this.options.visualElement.renderState.vars[z]=A:l[z]=A}this.options.layoutId&&(l.pointerEvents=m===this?Nc(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(A1),this.root.sharedNodes.clear()}}}function _3(e){e.updateLayout()}function j3(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:o}=e.options,u=t.source!==e.layout.source;o==="size"?rr(g=>{const x=u?t.measuredBox[g]:t.layoutBox[g],b=vn(x);x.min=n[g].min,x.max=x.min+b}):Gz(o,t.layoutBox,n)&&rr(g=>{const x=u?t.measuredBox[g]:t.layoutBox[g],b=vn(n[g]);x.max=x.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+b)});const l=jo();hl(l,n,t.layoutBox);const d=jo();u?hl(d,e.applyTransform(a,!0),t.measuredBox):hl(d,n,t.layoutBox);const h=!Bz(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:x,layout:b}=g;if(x&&b){const v=Yt();Zc(v,t.layoutBox,x.layoutBox);const z=Yt();Zc(z,n,b.layoutBox),Zz(v,z)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=z,e.relativeTargetOrigin=v,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function T3(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function C3(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function E3(e){e.clearSnapshot()}function A1(e){e.clearMeasurements()}function O1(e){e.isLayoutDirty=!1}function N3(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function R1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function A3(e){e.resolveTargetDelta()}function O3(e){e.calcProjection()}function R3(e){e.resetSkewAndRotation()}function M3(e){e.removeLeadSnapshot()}function M1(e,t,n){e.translate=St(t.translate,0,n),e.scale=St(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function D1(e,t,n,a){e.min=St(t.min,n.min,a),e.max=St(t.max,n.max,a)}function D3(e,t,n,a){D1(e.x,t.x,n.x,a),D1(e.y,t.y,n.y,a)}function $3(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const L3={duration:.45,ease:[.4,0,.1,1]},$1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),L1=$1("applewebkit/")&&!$1("chrome/")?Math.round:sr;function P1(e){e.min=L1(e.min),e.max=L1(e.max)}function P3(e){P1(e.x),P1(e.y)}function Gz(e,t,n){return e==="position"||e==="preserve-aspect"&&!s3(j1(t),j1(n),.2)}function U3(e){return e!==e.root&&e.scroll?.wasRoot}const V3=qz({attachResizeListener:(e,t)=>jl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),lm={current:void 0},Yz=qz({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lm.current){const e=new V3({});e.mount(window),e.setOptions({layoutScroll:!0}),lm.current=e}return lm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ag=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function U1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function B3(...e){return t=>{let n=!1;const a=e.map(o=>{const u=U1(o,t);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let o=0;o<a.length;o++){const u=a[o];typeof u=="function"?u():U1(e[o],null)}}}}function Z3(...e){return j.useCallback(B3(...e),e)}class I3 extends j.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,o=gp(a)&&a.offsetWidth||0,u=gp(a)&&a.offsetHeight||0,l=this.props.sizeRef.current;l.height=n.offsetHeight||0,l.width=n.offsetWidth||0,l.top=n.offsetTop,l.left=n.offsetLeft,l.right=o-l.width-l.left,l.bottom=u-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function H3({children:e,isPresent:t,anchorX:n,anchorY:a,root:o}){const u=j.useId(),l=j.useRef(null),d=j.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=j.useContext(Ag),m=e.props?.ref??e?.ref,g=Z3(l,m);return j.useInsertionEffect(()=>{const{width:x,height:b,top:v,left:z,right:T,bottom:E}=d.current;if(t||!l.current||!x||!b)return;const N=n==="left"?`left: ${z}`:`right: ${T}`,A=a==="bottom"?`bottom: ${E}`:`top: ${v}`;l.current.dataset.motionPopId=u;const C=document.createElement("style");h&&(C.nonce=h);const $=o??document.head;return $.appendChild(C),C.sheet&&C.sheet.insertRule(`
11
+ Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=yr(),v;if(t){let A=typeof t=="string"?Go(t):t;xt(g==="/"||A.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=b;let z=v.pathname||"/",T=z;if(g!=="/"){let A=g.replace(/^\//,"").split("/");T="/"+z.replace(/^\//,"").split("/").slice(A.length).join("/")}let E=Zw(e,{pathname:T});gr(x||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),gr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 N=kE(E&&E.map(A=>Object.assign({},A,{params:Object.assign({},h,A.params),pathname:aa([g,u.encodeLocation?u.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:aa([g,u.encodeLocation?u.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),l,n,a,o);return t&&N?j.createElement(Ml.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},N):N}function yE(){let e=jE(),t=aE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:u},"ErrorBoundary")," or"," ",j.createElement("code",{style:u},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:o},n):null,l)}var xE=j.createElement(yE,null),Ww=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=hE(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Mr.Provider,{value:this.props.routeContext},j.createElement(Fp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(bE,{error:e},t):t}};Ww.contextType=sE;var Bh=new WeakMap;function bE({children:e,error:t}){let{basename:n}=j.useContext(Hn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=fE(t.digest);if(a){let o=Bh.get(t);if(o)throw o;let u=qw(a.location,n);if(Fw&&!Bh.get(t))if(u.isExternal||a.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:a.replace}));throw Bh.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function vE({routeContext:e,match:t,children:n}){let a=j.useContext(Yo);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Mr.Provider,{value:e},n)}function kE(e,t=[],n=null,a=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let u=e,l=n?.errors;if(l!=null){let g=u.findIndex(x=>x.route.id&&l?.[x.route.id]!==void 0);xt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let d=!1,h=-1;if(n)for(let g=0;g<u.length;g++){let x=u[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=g),x.route.id){let{loaderData:b,errors:v}=n,z=x.route.loader&&!b.hasOwnProperty(x.route.id)&&(!v||v[x.route.id]===void 0);if(x.route.lazy||z){d=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let m=n&&a?(g,x)=>{a(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:iE(n.matches),errorInfo:x})}:void 0;return u.reduceRight((g,x,b)=>{let v,z=!1,T=null,E=null;n&&(v=l&&x.route.id?l[x.route.id]:void 0,T=x.route.errorElement||xE,d&&(h<0&&b===0?(eS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,E=null):h===b&&(z=!0,E=x.route.hydrateFallbackElement||null)));let N=t.concat(u.slice(0,b+1)),A=()=>{let C;return v?C=T:z?C=E:x.route.Component?C=j.createElement(x.route.Component,null):x.route.element?C=x.route.element:C=g,j.createElement(vE,{match:x,routeContext:{outlet:g,matches:N,isDataRoute:n!=null},children:C})};return n&&(x.route.ErrorBoundary||x.route.errorElement||b===0)?j.createElement(Ww,{location:n.location,revalidation:n.revalidation,component:T,error:v,children:A(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:m}):A()},null)}function Gp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wE(e){let t=j.useContext(Yo);return xt(t,Gp(e)),t}function SE(e){let t=j.useContext(nd);return xt(t,Gp(e)),t}function zE(e){let t=j.useContext(Mr);return xt(t,Gp(e)),t}function Yp(e){let t=zE(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function _E(){return Yp("useRouteId")}function jE(){let e=j.useContext(Fp),t=SE("useRouteError"),n=Yp("useRouteError");return e!==void 0?e:t.errors?.[n]}function TE(){let{router:e}=wE("useNavigate"),t=Yp("useNavigate"),n=j.useRef(!1);return Jw(()=>{n.current=!0}),j.useCallback(async(o,u={})=>{gr(n.current,Kw),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...u}))},[e,t])}var x0={};function eS(e,t,n){!t&&!x0[e]&&(x0[e]=!0,gr(!1,n))}j.memo(CE);function CE({routes:e,future:t,state:n,onError:a}){return Qw(e,void 0,n,a,t)}function tS({to:e,replace:t,state:n,relative:a}){xt(Xo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=j.useContext(Hn);gr(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=j.useContext(Mr),{pathname:l}=yr(),d=qp(),h=Hp(e,Ip(u),l,a==="path"),m=JSON.stringify(h);return j.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:a})},[d,m,a,t,n]),null}function ln(e){xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function EE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:o,static:u=!1,unstable_useTransitions:l}){xt(!Xo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=j.useMemo(()=>({basename:d,navigator:o,static:u,unstable_useTransitions:l,future:{}}),[d,o,u,l]);typeof n=="string"&&(n=Go(n));let{pathname:m="/",search:g="",hash:x="",state:b=null,key:v="default"}=n,z=j.useMemo(()=>{let T=oa(m,d);return T==null?null:{location:{pathname:T,search:g,hash:x,state:b,key:v},navigationType:a}},[d,m,g,x,b,v,a]);return gr(z!=null,`<Router basename="${d}"> is not able to match the URL "${m}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:j.createElement(Hn.Provider,{value:h},j.createElement(Ml.Provider,{children:t,value:z}))}function b0({children:e,location:t}){return gE(Um(e),t)}function Um(e,t=[]){let n=[];return j.Children.forEach(e,(a,o)=>{if(!j.isValidElement(a))return;let u=[...t,o];if(a.type===j.Fragment){n.push.apply(n,Um(a.props.children,u));return}xt(a.type===ln,`[${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>`),xt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||u.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&&(l.children=Um(a.props.children,u)),n.push(l)}),n}var Tc="get",Cc="application/x-www-form-urlencoded";function rd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function NE(e){return rd(e)&&e.tagName.toLowerCase()==="button"}function AE(e){return rd(e)&&e.tagName.toLowerCase()==="form"}function OE(e){return rd(e)&&e.tagName.toLowerCase()==="input"}function RE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ME(e,t){return e.button===0&&(!t||t==="_self")&&!RE(e)}var oc=null;function DE(){if(oc===null)try{new FormData(document.createElement("form"),0),oc=!1}catch{oc=!0}return oc}var $E=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zh(e){return e!=null&&!$E.has(e)?(gr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cc}"`),null):e}function LE(e,t){let n,a,o,u,l;if(AE(e)){let d=e.getAttribute("action");a=d?oa(d,t):null,n=e.getAttribute("method")||Tc,o=Zh(e.getAttribute("enctype"))||Cc,u=new FormData(e)}else if(NE(e)||OE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?oa(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Tc,o=Zh(e.getAttribute("formenctype"))||Zh(d.getAttribute("enctype"))||Cc,u=new FormData(d,e),!DE()){let{name:m,type:g,value:x}=e;if(g==="image"){let b=m?`${m}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else m&&u.append(m,x)}}else{if(rd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tc,a=null,o=Cc,l=e}return u&&o==="text/plain"&&(l=u,u=void 0),{action:a,method:n.toLowerCase(),encType:o,formData:u,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function PE(e,t,n,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&oa(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function UE(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VE(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 BE(e,t,n){let a=await Promise.all(e.map(async o=>{let u=t.routes[o.route.id];if(u){let l=await UE(u,n);return l.links?l.links():[]}return[]}));return FE(a.flat(1).filter(VE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function v0(e,t,n,a,o,u){let l=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return u==="assets"?t.filter((h,m)=>l(h,m)||d(h,m)):u==="data"?t.filter((h,m)=>{let g=a.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function ZE(e,t,{includeHydrateFallback:n}={}){return IE(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function IE(e){return[...new Set(e)]}function HE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function FE(e,t){let n=new Set;return new Set(t),e.reduce((a,o)=>{let u=JSON.stringify(HE(o));return n.has(u)||(n.add(u),a.push({key:u,link:o})),a},[])}function nS(){let e=j.useContext(Yo);return Xp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qE(){let e=j.useContext(nd);return Xp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Kp=j.createContext(void 0);Kp.displayName="FrameworkContext";function rS(){let e=j.useContext(Kp);return Xp(e,"You must render this element inside a <HydratedRouter> element"),e}function GE(e,t){let n=j.useContext(Kp),[a,o]=j.useState(!1),[u,l]=j.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:x}=t,b=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let T=N=>{N.forEach(A=>{l(A.isIntersecting)})},E=new IntersectionObserver(T,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),j.useEffect(()=>{if(a){let T=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(T)}}},[a]);let v=()=>{o(!0)},z=()=>{o(!1),l(!1)};return n?e!=="intent"?[u,b,{}]:[u,b,{onFocus:Qs(d,v),onBlur:Qs(h,z),onMouseEnter:Qs(m,v),onMouseLeave:Qs(g,z),onTouchStart:Qs(x,v)}]:[!1,b,{}]}function Qs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YE({page:e,...t}){let{router:n}=nS(),a=j.useMemo(()=>Zw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?j.createElement(KE,{page:e,matches:a,...t}):null}function XE(e){let{manifest:t,routeModules:n}=rS(),[a,o]=j.useState([]);return j.useEffect(()=>{let u=!1;return BE(e,t,n).then(l=>{u||o(l)}),()=>{u=!0}},[e,t,n]),a}function KE({page:e,matches:t,...n}){let a=yr(),{future:o,manifest:u,routeModules:l}=rS(),{basename:d}=nS(),{loaderData:h,matches:m}=qE(),g=j.useMemo(()=>v0(e,t,m,u,a,"data"),[e,t,m,u,a]),x=j.useMemo(()=>v0(e,t,m,u,a,"assets"),[e,t,m,u,a]),b=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let T=new Set,E=!1;if(t.forEach(A=>{let C=u.routes[A.route.id];!C||!C.hasLoader||(!g.some($=>$.route.id===A.route.id)&&A.route.id in h&&l[A.route.id]?.shouldRevalidate||C.hasClientLoader?E=!0:T.add(A.route.id))}),T.size===0)return[];let N=PE(e,d,o.unstable_trailingSlashAwareDataRequests,"data");return E&&T.size>0&&N.searchParams.set("_routes",t.filter(A=>T.has(A.route.id)).map(A=>A.route.id).join(",")),[N.pathname+N.search]},[d,o.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),v=j.useMemo(()=>ZE(x,u),[x,u]),z=XE(x);return j.createElement(j.Fragment,null,b.map(T=>j.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...n})),v.map(T=>j.createElement("link",{key:T,rel:"modulepreload",href:T,...n})),z.map(({key:T,link:E})=>j.createElement("link",{key:T,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function JE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var QE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{QE&&(window.__reactRouterVersion="7.13.0")}catch{}function WE({basename:e,children:t,unstable_useTransitions:n,window:a}){let o=j.useRef();o.current==null&&(o.current=MC({window:a,v5Compat:!0}));let u=o.current,[l,d]=j.useState({action:u.action,location:u.location}),h=j.useCallback(m=>{n===!1?d(m):j.startTransition(()=>d(m))},[n]);return j.useLayoutEffect(()=>u.listen(h),[u,h]),j.createElement(EE,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:n})}var aS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_r=j.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:o,reloadDocument:u,replace:l,state:d,target:h,to:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...v},z){let{basename:T,unstable_useTransitions:E}=j.useContext(Hn),N=typeof m=="string"&&aS.test(m),A=qw(m,T);m=A.to;let C=mE(m,{relative:o}),[$,L,M]=GE(a,v),q=rN(m,{replace:l,state:d,target:h,preventScrollReset:g,relative:o,viewTransition:x,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function V(ce){t&&t(ce),ce.defaultPrevented||q(ce)}let X=j.createElement("a",{...v,...M,href:A.absoluteURL||C,onClick:A.isExternal||u?t:V,ref:JE(z,L),target:h,"data-discover":!N&&n==="render"?"true":void 0});return $&&!N?j.createElement(j.Fragment,null,X,j.createElement(YE,{page:C})):X});_r.displayName="Link";var eN=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:o=!1,style:u,to:l,viewTransition:d,children:h,...m},g){let x=Dl(l,{relative:m.relative}),b=yr(),v=j.useContext(nd),{navigator:z,basename:T}=j.useContext(Hn),E=v!=null&&lN(x)&&d===!0,N=z.encodeLocation?z.encodeLocation(x).pathname:x.pathname,A=b.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),C=C?C.toLowerCase():null,N=N.toLowerCase()),C&&T&&(C=oa(C,T)||C);const $=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let L=A===N||!o&&A.startsWith(N)&&A.charAt($)==="/",M=C!=null&&(C===N||!o&&C.startsWith(N)&&C.charAt(N.length)==="/"),q={isActive:L,isPending:M,isTransitioning:E},V=L?t:void 0,X;typeof a=="function"?X=a(q):X=[a,L?"active":null,M?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ce=typeof u=="function"?u(q):u;return j.createElement(_r,{...m,"aria-current":V,className:X,ref:g,style:ce,to:l,viewTransition:d},typeof h=="function"?h(q):h)});eN.displayName="NavLink";var tN=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:u,method:l=Tc,action:d,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...v},z)=>{let{unstable_useTransitions:T}=j.useContext(Hn),E=oN(),N=sN(d,{relative:m}),A=l.toLowerCase()==="get"?"get":"post",C=typeof d=="string"&&aS.test(d),$=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let M=L.nativeEvent.submitter,q=M?.getAttribute("formmethod")||l,V=()=>E(M||L.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:o,state:u,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b});T&&n!==!1?j.startTransition(()=>V()):V()};return j.createElement("form",{ref:z,method:A,action:N,onSubmit:a?h:$,...v,"data-discover":!C&&e==="render"?"true":void 0})});tN.displayName="Form";function nN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iS(e){let t=j.useContext(Yo);return xt(t,nN(e)),t}function rN(e,{target:t,replace:n,state:a,preventScrollReset:o,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let m=qp(),g=yr(),x=Dl(e,{relative:u});return j.useCallback(b=>{if(ME(b,t)){b.preventDefault();let v=n!==void 0?n:bl(g)===bl(x),z=()=>m(e,{replace:v,state:a,preventScrollReset:o,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:d});h?j.startTransition(()=>z()):z()}},[g,m,x,n,a,t,e,o,u,l,d,h])}var aN=0,iN=()=>`__${String(++aN)}__`;function oN(){let{router:e}=iS("useSubmit"),{basename:t}=j.useContext(Hn),n=_E(),a=e.fetch,o=e.navigate;return j.useCallback(async(u,l={})=>{let{action:d,method:h,encType:m,formData:g,body:x}=LE(u,t);if(l.navigate===!1){let b=l.fetcherKey||iN();await a(b,n,l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:x,formMethod:l.method||h,formEncType:l.encType||m,flushSync:l.flushSync})}else await o(l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:x,formMethod:l.method||h,formEncType:l.encType||m,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[a,o,t,n])}function sN(e,{relative:t}={}){let{basename:n}=j.useContext(Hn),a=j.useContext(Mr);xt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),u={...Dl(e||".",{relative:t})},l=yr();if(e==null){u.search=l.search;let d=new URLSearchParams(u.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(x=>x).forEach(x=>d.append("index",x));let g=d.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:aa([n,u.pathname])),bl(u)}function lN(e,{relative:t}={}){let n=j.useContext(Yw);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=iS("useViewTransitionState"),o=Dl(e,{relative:t});if(!n.isTransitioning)return!1;let u=oa(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=oa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Dc(o.pathname,l)!=null||Dc(o.pathname,u)!=null}const oS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const uN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const cN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const k0=e=>{const t=cN(e);return t.charAt(0).toUpperCase()+t.slice(1)};var dN={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"};const fN=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const hN=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:u,iconNode:l,...d},h)=>j.createElement("svg",{ref:h,...dN,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:oS("lucide",o),...!u&&!fN(d)&&{"aria-hidden":"true"},...d},[...l.map(([m,g])=>j.createElement(m,g)),...Array.isArray(u)?u:[u]]));const we=(e,t)=>{const n=j.forwardRef(({className:a,...o},u)=>j.createElement(hN,{ref:u,iconNode:t,className:oS(`lucide-${uN(k0(e))}`,`lucide-${e}`,a),...o}));return n.displayName=k0(e),n};const mN=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],_o=we("activity",mN);const pN=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],gN=we("archive",pN);const yN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],sS=we("arrow-down",yN);const xN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],bN=we("arrow-left",xN);const vN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],lS=we("arrow-up",vN);const kN=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],wN=we("ban",kN);const SN=[["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"}]],vl=we("bell",SN);const zN=[["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"}]],w0=we("bot",zN);const _N=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],jN=we("box",_N);const TN=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],CN=we("brain",TN);const EN=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],uS=we("calendar",EN);const NN=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Vm=we("chart-column",NN);const AN=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],ON=we("check-check",AN);const RN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Bm=we("check",RN);const MN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],DN=we("chevron-down",MN);const $N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],LN=we("chevron-right",$N);const PN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],cS=we("circle-check",PN);const UN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Zm=we("circle-x",UN);const VN=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ad=we("clock",VN);const BN=[["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"}]],ZN=we("copy",BN);const IN=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],dS=we("cpu",IN);const HN=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Ro=we("database",HN);const FN=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],$c=we("dollar-sign",FN);const qN=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],id=we("eye",qN);const GN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],YN=we("file-text",GN);const XN=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],KN=we("funnel",XN);const JN=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],QN=we("hash",JN);const WN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],eA=we("info",WN);const tA=[["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"}]],S0=we("layout-dashboard",tA);const nA=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Im=we("list-checks",nA);const rA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aA=we("loader-circle",rA);const iA=[["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"}]],z0=we("log-out",iA);const oA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],sA=we("menu",oA);const lA=[["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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],_0=we("message-square-plus",lA);const uA=[["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"}]],kl=we("message-square",uA);const cA=[["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"}]],fS=we("moon",cA);const dA=[["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"}]],Jp=we("pencil",dA);const fA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qp=we("plus",fA);const hA=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],j0=we("puzzle",hA);const mA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],hS=we("refresh-cw",mA);const pA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],T0=we("rotate-ccw",pA);const gA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yA=we("search",gA);const xA=[["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"}]],bA=we("send",xA);const vA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],C0=we("settings",vA);const kA=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],E0=we("shield-check",kA);const wA=[["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"}]],mS=we("sun",wA);const SA=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],zA=we("tag",SA);const _A=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Hm=we("terminal",_A);const jA=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],TA=we("toggle-left",jA);const CA=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],EA=we("toggle-right",CA);const NA=[["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"}]],Bo=we("trash-2",NA);const AA=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],OA=we("trending-up",AA);const RA=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],MA=we("user",RA);const DA=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Fm=we("webhook",DA);const $A=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],LA=we("wifi-off",$A);const PA=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Ih=we("wifi",PA);const UA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pS=we("x",UA);var Hh={exports:{}},Fh={};var N0;function VA(){if(N0)return Fh;N0=1;var e=td();function t(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function d(x,b){var v=b(),z=a({inst:{value:v,getSnapshot:b}}),T=z[0].inst,E=z[1];return u(function(){T.value=v,T.getSnapshot=b,h(T)&&E({inst:T})},[x,v,b]),o(function(){return h(T)&&E({inst:T}),x(function(){h(T)&&E({inst:T})})},[x]),l(v),v}function h(x){var b=x.getSnapshot;x=x.value;try{var v=b();return!n(x,v)}catch{return!0}}function m(x,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Fh}var A0;function BA(){return A0||(A0=1,Hh.exports=VA()),Hh.exports}var O0=BA();const gS=0,yS=1,xS=2,R0=3;var M0=Object.prototype.hasOwnProperty;function qm(e,t){var n,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((a=e.length)===t.length)for(;a--&&qm(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(M0.call(e,n)&&++a&&!M0.call(t,n)||!(n in t)||!qm(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const ta=new WeakMap,ra=()=>{},un=ra(),Gm=Object,Ze=e=>e===un,jr=e=>typeof e=="function",Ba=(e,t)=>({...e,...t}),bS=e=>jr(e.then),qh={},sc={},Wp="undefined",$l=typeof window!=Wp,Ym=typeof document!=Wp,ZA=$l&&"Deno"in window,IA=()=>$l&&typeof window.requestAnimationFrame!=Wp,vS=(e,t)=>{const n=ta.get(e);return[()=>!Ze(t)&&e.get(t)||qh,a=>{if(!Ze(t)){const o=e.get(t);t in sc||(sc[t]=o),n[5](t,Ba(o,a),o||qh)}},n[6],()=>!Ze(t)&&t in sc?sc[t]:!Ze(t)&&e.get(t)||qh]};let Xm=!0;const HA=()=>Xm,[Km,Jm]=$l&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ra,ra],FA=()=>{const e=Ym&&document.visibilityState;return Ze(e)||e!=="hidden"},qA=e=>(Ym&&document.addEventListener("visibilitychange",e),Km("focus",e),()=>{Ym&&document.removeEventListener("visibilitychange",e),Jm("focus",e)}),GA=e=>{const t=()=>{Xm=!0,e()},n=()=>{Xm=!1};return Km("online",t),Km("offline",n),()=>{Jm("online",t),Jm("offline",n)}},YA={isOnline:HA,isVisible:FA},XA={initFocus:qA,initReconnect:GA},D0=!Zp.useId,Mo=!$l||ZA,KA=e=>IA()?window.requestAnimationFrame(e):setTimeout(e,1),Gh=Mo?j.useEffect:j.useLayoutEffect,Yh=typeof navigator<"u"&&navigator.connection,$0=!Mo&&Yh&&(["slow-2g","2g"].includes(Yh.effectiveType)||Yh.saveData),lc=new WeakMap,JA=e=>Gm.prototype.toString.call(e),Xh=(e,t)=>e===`[object ${t}]`;let QA=0;const Qm=e=>{const t=typeof e,n=JA(e),a=Xh(n,"Date"),o=Xh(n,"RegExp"),u=Xh(n,"Object");let l,d;if(Gm(e)===e&&!a&&!o){if(l=lc.get(e),l)return l;if(l=++QA+"~",lc.set(e,l),Array.isArray(e)){for(l="@",d=0;d<e.length;d++)l+=Qm(e[d])+",";lc.set(e,l)}if(u){l="#";const h=Gm.keys(e).sort();for(;!Ze(d=h.pop());)Ze(e[d])||(l+=d+":"+Qm(e[d])+",");lc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},eg=e=>{if(jr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Qm(e):"",[e,t]};let WA=0;const Wm=()=>++WA;async function kS(...e){const[t,n,a,o]=e,u=Ba({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let l=u.populateCache;const d=u.rollbackOnError;let h=u.optimisticData;const m=b=>typeof d=="function"?d(b):d!==!1,g=u.throwOnError;if(jr(n)){const b=n,v=[],z=t.keys();for(const T of z)!/^\$(inf|sub)\$/.test(T)&&b(t.get(T)._k)&&v.push(T);return Promise.all(v.map(x))}return x(n);async function x(b){const[v]=eg(b);if(!v)return;const[z,T]=vS(t,v),[E,N,A,C]=ta.get(t),$=()=>{const oe=E[v];return(jr(u.revalidate)?u.revalidate(z().data,b):u.revalidate!==!1)&&(delete A[v],delete C[v],oe&&oe[0])?oe[0](xS).then(()=>z().data):z().data};if(e.length<3)return $();let L=a,M,q=!1;const V=Wm();N[v]=[V,0];const X=!Ze(h),ce=z(),Q=ce.data,se=ce._c,te=Ze(se)?Q:se;if(X&&(h=jr(h)?h(te,Q):h,T({data:h,_c:te})),jr(L))try{L=L(te)}catch(oe){M=oe,q=!0}if(L&&bS(L))if(L=await L.catch(oe=>{M=oe,q=!0}),V!==N[v][0]){if(q)throw M;return L}else q&&X&&m(M)&&(l=!0,T({data:te,_c:un}));if(l&&!q)if(jr(l)){const oe=l(L,te);T({data:oe,error:un,_c:un})}else T({data:L,error:un,_c:un});if(N[v][1]=Wm(),Promise.resolve($()).then(()=>{T({_c:un})}),q){if(g)throw M;return}return L}}const L0=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},e4=(e,t)=>{if(!ta.has(e)){const n=Ba(XA,t),a=Object.create(null),o=kS.bind(un,e);let u=ra;const l=Object.create(null),d=(g,x)=>{const b=l[g]||[];return l[g]=b,b.push(x),()=>b.splice(b.indexOf(x),1)},h=(g,x,b)=>{e.set(g,x);const v=l[g];if(v)for(const z of v)z(x,b)},m=()=>{if(!ta.has(e)&&(ta.set(e,[a,Object.create(null),Object.create(null),Object.create(null),o,h,d]),!Mo)){const g=n.initFocus(setTimeout.bind(un,L0.bind(un,a,gS))),x=n.initReconnect(setTimeout.bind(un,L0.bind(un,a,yS)));u=()=>{g&&g(),x&&x(),ta.delete(e)}}};return m(),[e,o,m,u]}return[e,ta.get(e)[4]]},t4=(e,t,n,a,o)=>{const u=n.errorRetryCount,l=o.retryCount,d=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Ze(u)&&l>u||setTimeout(a,d,o)},n4=qm,[wS,na]=e4(new Map),r4=Ba({onLoadingSlow:ra,onSuccess:ra,onError:ra,onErrorRetry:t4,onDiscarded:ra,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:$0?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:$0?5e3:3e3,compare:n4,isPaused:()=>!1,cache:wS,mutate:na,fallback:{}},YA),a4=(e,t)=>{const n=Ba(e,t);if(t){const{use:a,fallback:o}=e,{use:u,fallback:l}=t;a&&u&&(n.use=a.concat(u)),o&&l&&(n.fallback=Ba(o,l))}return n},i4=j.createContext({}),o4="$inf$",SS=$l&&window.__SWR_DEVTOOLS_USE__,s4=SS?window.__SWR_DEVTOOLS_USE__:[],l4=()=>{SS&&(window.__SWR_DEVTOOLS_REACT__=Zp)},u4=e=>jr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],c4=()=>{const e=j.useContext(i4);return j.useMemo(()=>Ba(r4,e),[e])},d4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=eg(t),[,,,d]=ta.get(wS);if(l.startsWith(o4))return n(...u);const h=d[l];return Ze(h)?n(...u):(delete d[l],h)}),a),f4=s4.concat(d4),h4=e=>function(...n){const a=c4(),[o,u,l]=u4(n),d=a4(a,l);let h=e;const{use:m}=d,g=(m||[]).concat(f4);for(let x=g.length;x--;)h=g[x](h);return h(o,u||d.fetcher||null,d)},m4=(e,t,n)=>{const a=t[e]||(t[e]=[]);return a.push(n),()=>{const o=a.indexOf(n);o>=0&&(a[o]=a[a.length-1],a.pop())}};l4();const Kh=Zp.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Jh={dedupe:!0},P0=Promise.resolve(un),p4=(e,t,n)=>{const{cache:a,compare:o,suspense:u,fallbackData:l,revalidateOnMount:d,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:x,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[z,T,E,N]=ta.get(a),[A,C]=eg(e),$=j.useRef(!1),L=j.useRef(!1),M=j.useRef(A),q=j.useRef(t),V=j.useRef(n),X=()=>V.current,ce=()=>X().isVisible()&&X().isOnline(),[Q,se,te,oe]=vS(a,A),ae=j.useRef({}).current,U=Ze(l)?Ze(n.fallback)?un:n.fallback[A]:l,K=(Ie,rt)=>{for(const dt in ae){const Qe=dt;if(Qe==="data"){if(!o(Ie[Qe],rt[Qe])&&(!Ze(Ie[Qe])||!o(fe,rt[Qe])))return!1}else if(rt[Qe]!==Ie[Qe])return!1}return!0},B=j.useMemo(()=>{const Ie=!A||!t?!1:Ze(d)?X().isPaused()||u?!1:h!==!1:d,rt=Ht=>{const ft=Ba(Ht);return delete ft._k,Ie?{isValidating:!0,isLoading:!0,...ft}:ft},dt=Q(),Qe=oe(),Xt=rt(dt),qn=dt===Qe?Xt:rt(Qe);let At=Xt;return[()=>{const Ht=rt(Q());return K(Ht,At)?(At.data=Ht.data,At.isLoading=Ht.isLoading,At.isValidating=Ht.isValidating,At.error=Ht.error,At):(At=Ht,Ht)},()=>qn]},[a,A]),he=O0.useSyncExternalStore(j.useCallback(Ie=>te(A,(rt,dt)=>{K(dt,rt)||Ie()}),[a,A]),B[0],B[1]),O=!$.current,S=z[A]&&z[A].length>0,H=he.data,w=Ze(H)?U&&bS(U)?Kh(U):U:H,G=he.error,de=j.useRef(w),fe=b?Ze(H)?Ze(de.current)?w:de.current:H:w,me=A&&Ze(w),De=!Mo&&O0.useSyncExternalStore(()=>ra,()=>!1,()=>!0);v&&De&&!u&&me&&console.warn(`Missing pre-initiated data for serialized key "${A}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ne=S&&!Ze(G)?!1:O&&!Ze(d)?d:X().isPaused()?!1:u?Ze(w)?!1:h:Ze(w)||h,kt=!!(A&&t&&O&&Ne),It=Ze(he.isValidating)?kt:he.isValidating,fn=Ze(he.isLoading)?kt:he.isLoading,st=j.useCallback(async Ie=>{const rt=q.current;if(!A||!rt||L.current||X().isPaused())return!1;let dt,Qe,Xt=!0;const qn=Ie||{},At=!E[A]||!qn.dedupe,Ht=()=>D0?!L.current&&A===M.current&&$.current:A===M.current,ft={isValidating:!1,isLoading:!1},Ri=()=>{se(ft)},W=()=>{const be=E[A];be&&be[1]===Qe&&delete E[A]},ue={isValidating:!0};Ze(Q().data)&&(ue.isLoading=!0);try{if(At&&(se(ue),n.loadingTimeout&&Ze(Q().data)&&setTimeout(()=>{Xt&&Ht()&&X().onLoadingSlow(A,n)},n.loadingTimeout),E[A]=[rt(C),Wm()]),[dt,Qe]=E[A],dt=await dt,At&&setTimeout(W,n.dedupingInterval),!E[A]||E[A][1]!==Qe)return At&&Ht()&&X().onDiscarded(A),!1;ft.error=un;const be=T[A];if(!Ze(be)&&(Qe<=be[0]||Qe<=be[1]||be[1]===0))return Ri(),At&&Ht()&&X().onDiscarded(A),!1;const je=Q().data;ft.data=o(je,dt)?je:dt,At&&Ht()&&X().onSuccess(dt,A,n)}catch(be){W();const je=X(),{shouldRetryOnError:Be}=je;je.isPaused()||(ft.error=be,At&&Ht()&&(je.onError(be,A,je),(Be===!0||jr(Be)&&Be(be))&&(!X().revalidateOnFocus||!X().revalidateOnReconnect||ce())&&je.onErrorRetry(be,A,je,hn=>{const Rn=z[A];Rn&&Rn[0]&&Rn[0](R0,hn)},{retryCount:(qn.retryCount||0)+1,dedupe:!0})))}return Xt=!1,Ri(),!0},[A,a]),wt=j.useCallback((...Ie)=>kS(a,M.current,...Ie),[]);if(Gh(()=>{q.current=t,V.current=n,Ze(H)||(de.current=H)}),Gh(()=>{if(!A)return;const Ie=st.bind(un,Jh);let rt=0;X().revalidateOnFocus&&(rt=Date.now()+X().focusThrottleInterval);const Qe=m4(A,z,(Xt,qn={})=>{if(Xt==gS){const At=Date.now();X().revalidateOnFocus&&At>rt&&ce()&&(rt=At+X().focusThrottleInterval,Ie())}else if(Xt==yS)X().revalidateOnReconnect&&ce()&&Ie();else{if(Xt==xS)return st();if(Xt==R0)return st(qn)}});return L.current=!1,M.current=A,$.current=!0,se({_k:C}),Ne&&(E[A]||(Ze(w)||Mo?Ie():KA(Ie))),()=>{L.current=!0,Qe()}},[A]),Gh(()=>{let Ie;function rt(){const Qe=jr(m)?m(Q().data):m;Qe&&Ie!==-1&&(Ie=setTimeout(dt,Qe))}function dt(){!Q().error&&(g||X().isVisible())&&(x||X().isOnline())?st(Jh).then(rt):rt()}return rt(),()=>{Ie&&(clearTimeout(Ie),Ie=-1)}},[m,g,x,A]),j.useDebugValue(fe),u){if(!D0&&Mo&&me)throw new Error("Fallback data is required when using Suspense in SSR.");me&&(q.current=t,V.current=n,L.current=!1);const Ie=N[A],rt=!Ze(Ie)&&me?wt(Ie):P0;if(Kh(rt),!Ze(G)&&me)throw G;const dt=me?st(Jh):P0;!Ze(fe)&&me&&(dt.status="fulfilled",dt.value=!0),Kh(dt)}return{mutate:wt,get data(){return ae.data=!0,fe},get error(){return ae.error=!0,G},get isValidating(){return ae.isValidating=!0,It},get isLoading(){return ae.isLoading=!0,fn}}},Qt=h4(p4),g4="x-architect-pass",Ws="/api";class zi{static instance;constructor(){}static getInstance(){return zi.instance||(zi.instance=new zi),zi.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[g4]=n),a}async handleResponse(t){if(t.status===401)throw localStorage.removeItem("morpheus.auth.token"),window.location.pathname.endsWith("/login")||(window.location.href="/login"),new Error("Unauthorized");if(!t.ok){const n=await t.json().catch(()=>({error:"Unknown error"})),a=new Error(n.error||`HTTP error! status: ${t.status}`);throw a.details=n.details,a}return t.json()}async get(t){const n=await fetch(`${Ws}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${Ws}${t}`,{method:"POST",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async put(t,n){const a=await fetch(`${Ws}${t}`,{method:"PUT",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async patch(t,n){const a=await fetch(`${Ws}${t}`,{method:"PATCH",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async delete(t){const n=await fetch(`${Ws}${t}`,{method:"DELETE",headers:this.getHeaders()});return this.handleResponse(n)}}const ze=zi.getInstance(),wl="/api",tg=e=>{const t=e.startsWith(wl)?e.substring(wl.length):e;return ze.get(t)};function zS(){return Qt(`${wl}/status`,tg,{refreshInterval:5e3})}function y4(){return Qt(`${wl}/logs`,tg)}function x4(e){return Qt(e?`${wl}/logs/${e}?limit=1000`:null,tg,{refreshInterval:2e3})}function _S(e){const t=Math.floor(e/60);if(t>59){const n=Math.floor(t/60),a=t%60;return`${n}h ${a}m`}return`${t}m`}function b4(){const{data:e}=zS();return f.jsxs("footer",{className:"h-8 bg-azure-bg dark:bg-zinc-950 border-t border-azure-border dark:border-matrix-primary flex items-center px-4 text-xs justify-between select-none z-10 shrink-0",children:[f.jsxs("div",{className:"flex gap-4",children:[f.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),f.jsxs("span",{children:["PID: ",e?.pid||"-"]}),f.jsxs("span",{children:["UPTIME: ",e?_S(e.uptimeSeconds):"-"]})]}),f.jsxs("div",{className:"flex gap-4 opacity-70",children:[f.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),f.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const ng=j.createContext({});function rg(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const jS=typeof window<"u",TS=jS?j.useLayoutEffect:j.useEffect,od=j.createContext(null);function ag(e,t){e.indexOf(t)===-1&&e.push(t)}function ig(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Er=(e,t,n)=>n>t?t:n<e?e:n;let og=()=>{};const sa={},CS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ES(e){return typeof e=="object"&&e!==null}const NS=e=>/^0[^.\s]+$/u.test(e);function sg(e){let t;return()=>(t===void 0&&(t=e()),t)}const sr=e=>e,v4=(e,t)=>n=>t(e(n)),Ll=(...e)=>e.reduce(v4),Sl=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class lg{constructor(){this.subscriptions=[]}add(t){return ag(this.subscriptions,t),()=>ig(this.subscriptions,t)}notify(t,n,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,a);else for(let u=0;u<o;u++){const l=this.subscriptions[u];l&&l(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ia=e=>e*1e3,or=e=>e/1e3;function AS(e,t){return t?e*(1e3/t):0}const OS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,k4=1e-7,w4=12;function S4(e,t,n,a,o){let u,l,d=0;do l=t+(n-t)/2,u=OS(l,a,o)-e,u>0?n=l:t=l;while(Math.abs(u)>k4&&++d<w4);return l}function Pl(e,t,n,a){if(e===t&&n===a)return sr;const o=u=>S4(u,0,1,e,n);return u=>u===0||u===1?u:OS(o(u),t,a)}const RS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,MS=e=>t=>1-e(1-t),DS=Pl(.33,1.53,.69,.99),ug=MS(DS),$S=RS(ug),LS=e=>(e*=2)<1?.5*ug(e):.5*(2-Math.pow(2,-10*(e-1))),cg=e=>1-Math.sin(Math.acos(e)),PS=MS(cg),US=RS(cg),z4=Pl(.42,0,1,1),_4=Pl(0,0,.58,1),VS=Pl(.42,0,.58,1),j4=e=>Array.isArray(e)&&typeof e[0]!="number",BS=e=>Array.isArray(e)&&typeof e[0]=="number",T4={linear:sr,easeIn:z4,easeInOut:VS,easeOut:_4,circIn:cg,circInOut:US,circOut:PS,backIn:ug,backInOut:$S,backOut:DS,anticipate:LS},C4=e=>typeof e=="string",U0=e=>{if(BS(e)){og(e.length===4);const[t,n,a,o]=e;return Pl(t,n,a,o)}else if(C4(e))return T4[e];return e},uc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function E4(e,t){let n=new Set,a=new Set,o=!1,u=!1;const l=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(g){l.has(g)&&(m.schedule(g),e()),g(d)}const m={schedule:(g,x=!1,b=!1)=>{const z=b&&o?n:a;return x&&l.add(g),z.has(g)||z.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(d=g,o){u=!0;return}o=!0,[n,a]=[a,n],n.forEach(h),n.clear(),o=!1,u&&(u=!1,m.process(g))}};return m}const N4=40;function ZS(e,t){let n=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,l=uc.reduce((C,$)=>(C[$]=E4(u),C),{}),{setup:d,read:h,resolveKeyframes:m,preUpdate:g,update:x,preRender:b,render:v,postRender:z}=l,T=()=>{const C=sa.useManualTiming?o.timestamp:performance.now();n=!1,sa.useManualTiming||(o.delta=a?1e3/60:Math.max(Math.min(C-o.timestamp,N4),1)),o.timestamp=C,o.isProcessing=!0,d.process(o),h.process(o),m.process(o),g.process(o),x.process(o),b.process(o),v.process(o),z.process(o),o.isProcessing=!1,n&&t&&(a=!1,e(T))},E=()=>{n=!0,a=!0,o.isProcessing||e(T)};return{schedule:uc.reduce((C,$)=>{const L=l[$];return C[$]=(M,q=!1,V=!1)=>(n||E(),L.schedule(M,q,V)),C},{}),cancel:C=>{for(let $=0;$<uc.length;$++)l[uc[$]].cancel(C)},state:o,steps:l}}const{schedule:pt,cancel:Za,state:an,steps:Qh}=ZS(typeof requestAnimationFrame<"u"?requestAnimationFrame:sr,!0);let Ec;function A4(){Ec=void 0}const bn={now:()=>(Ec===void 0&&bn.set(an.isProcessing||sa.useManualTiming?an.timestamp:performance.now()),Ec),set:e=>{Ec=e,queueMicrotask(A4)}},IS=e=>t=>typeof t=="string"&&t.startsWith(e),HS=IS("--"),O4=IS("var(--"),dg=e=>O4(e)?R4.test(e.split("/*")[0].trim()):!1,R4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function V0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ko={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},zl={...Ko,transform:e=>Er(0,1,e)},cc={...Ko,default:1},fl=e=>Math.round(e*1e5)/1e5,fg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function M4(e){return e==null}const D4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,hg=(e,t)=>n=>!!(typeof n=="string"&&D4.test(n)&&n.startsWith(e)||t&&!M4(n)&&Object.prototype.hasOwnProperty.call(n,t)),FS=(e,t,n)=>a=>{if(typeof a!="string")return a;const[o,u,l,d]=a.match(fg);return{[e]:parseFloat(o),[t]:parseFloat(u),[n]:parseFloat(l),alpha:d!==void 0?parseFloat(d):1}},$4=e=>Er(0,255,e),Wh={...Ko,transform:e=>Math.round($4(e))},_i={test:hg("rgb","red"),parse:FS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Wh.transform(e)+", "+Wh.transform(t)+", "+Wh.transform(n)+", "+fl(zl.transform(a))+")"};function L4(e){let t="",n="",a="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}const ep={test:hg("#"),parse:L4,transform:_i.transform},Ul=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$a=Ul("deg"),Cr=Ul("%"),xe=Ul("px"),P4=Ul("vh"),U4=Ul("vw"),B0={...Cr,parse:e=>Cr.parse(e)/100,transform:e=>Cr.transform(e*100)},jo={test:hg("hsl","hue"),parse:FS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Cr.transform(fl(t))+", "+Cr.transform(fl(n))+", "+fl(zl.transform(a))+")"},Ut={test:e=>_i.test(e)||ep.test(e)||jo.test(e),parse:e=>_i.test(e)?_i.parse(e):jo.test(e)?jo.parse(e):ep.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_i.transform(e):jo.transform(e),getAnimatableNone:e=>{const t=Ut.parse(e);return t.alpha=0,Ut.transform(t)}},V4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function B4(e){return isNaN(e)&&typeof e=="string"&&(e.match(fg)?.length||0)+(e.match(V4)?.length||0)>0}const qS="number",GS="color",Z4="var",I4="var(",Z0="${}",H4=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function _l(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},o=[];let u=0;const d=t.replace(H4,h=>(Ut.test(h)?(a.color.push(u),o.push(GS),n.push(Ut.parse(h))):h.startsWith(I4)?(a.var.push(u),o.push(Z4),n.push(h)):(a.number.push(u),o.push(qS),n.push(parseFloat(h))),++u,Z0)).split(Z0);return{values:n,split:d,indexes:a,types:o}}function YS(e){return _l(e).values}function XS(e){const{split:t,types:n}=_l(e),a=t.length;return o=>{let u="";for(let l=0;l<a;l++)if(u+=t[l],o[l]!==void 0){const d=n[l];d===qS?u+=fl(o[l]):d===GS?u+=Ut.transform(o[l]):u+=o[l]}return u}}const F4=e=>typeof e=="number"?0:Ut.test(e)?Ut.getAnimatableNone(e):e;function q4(e){const t=YS(e);return XS(e)(t.map(F4))}const Ia={test:B4,parse:YS,createTransformer:XS,getAnimatableNone:q4};function em(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function G4({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let o=0,u=0,l=0;if(!t)o=u=l=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;o=em(h,d,e+1/3),u=em(h,d,e),l=em(h,d,e-1/3)}return{red:Math.round(o*255),green:Math.round(u*255),blue:Math.round(l*255),alpha:a}}function Lc(e,t){return n=>n>0?t:e}const St=(e,t,n)=>e+(t-e)*n,tm=(e,t,n)=>{const a=e*e,o=n*(t*t-a)+a;return o<0?0:Math.sqrt(o)},Y4=[ep,_i,jo],X4=e=>Y4.find(t=>t.test(e));function I0(e){const t=X4(e);if(!t)return!1;let n=t.parse(e);return t===jo&&(n=G4(n)),n}const H0=(e,t)=>{const n=I0(e),a=I0(t);if(!n||!a)return Lc(e,t);const o={...n};return u=>(o.red=tm(n.red,a.red,u),o.green=tm(n.green,a.green,u),o.blue=tm(n.blue,a.blue,u),o.alpha=St(n.alpha,a.alpha,u),_i.transform(o))},tp=new Set(["none","hidden"]);function K4(e,t){return tp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function J4(e,t){return n=>St(e,t,n)}function mg(e){return typeof e=="number"?J4:typeof e=="string"?dg(e)?Lc:Ut.test(e)?H0:eO:Array.isArray(e)?KS:typeof e=="object"?Ut.test(e)?H0:Q4:Lc}function KS(e,t){const n=[...e],a=n.length,o=e.map((u,l)=>mg(u)(u,t[l]));return u=>{for(let l=0;l<a;l++)n[l]=o[l](u);return n}}function Q4(e,t){const n={...e,...t},a={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(a[o]=mg(e[o])(e[o],t[o]));return o=>{for(const u in a)n[u]=a[u](o);return n}}function W4(e,t){const n=[],a={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const u=t.types[o],l=e.indexes[u][a[u]],d=e.values[l]??0;n[o]=d,a[u]++}return n}const eO=(e,t)=>{const n=Ia.createTransformer(t),a=_l(e),o=_l(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?tp.has(e)&&!o.values.length||tp.has(t)&&!a.values.length?K4(e,t):Ll(KS(W4(a,o),o.values),n):Lc(e,t)};function JS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?St(e,t,n):mg(e)(e,t)}const tO=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>pt.update(t,n),stop:()=>Za(t),now:()=>an.isProcessing?an.timestamp:bn.now()}},QS=(e,t,n=10)=>{let a="";const o=Math.max(Math.round(t/n),2);for(let u=0;u<o;u++)a+=Math.round(e(u/(o-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},Pc=2e4;function pg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<Pc;)t+=n,a=e.next(t);return t>=Pc?1/0:t}function nO(e,t=100,n){const a=n({...e,keyframes:[0,t]}),o=Math.min(pg(a),Pc);return{type:"keyframes",ease:u=>a.next(o*u).value/t,duration:or(o)}}const rO=5;function WS(e,t,n){const a=Math.max(t-rO,0);return AS(n-e(a),t-a)}const Nt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nm=.001;function aO({duration:e=Nt.duration,bounce:t=Nt.bounce,velocity:n=Nt.velocity,mass:a=Nt.mass}){let o,u,l=1-t;l=Er(Nt.minDamping,Nt.maxDamping,l),e=Er(Nt.minDuration,Nt.maxDuration,or(e)),l<1?(o=m=>{const g=m*l,x=g*e,b=g-n,v=np(m,l),z=Math.exp(-x);return nm-b/v*z},u=m=>{const x=m*l*e,b=x*n+n,v=Math.pow(l,2)*Math.pow(m,2)*e,z=Math.exp(-x),T=np(Math.pow(m,2),l);return(-o(m)+nm>0?-1:1)*((b-v)*z)/T}):(o=m=>{const g=Math.exp(-m*e),x=(m-n)*e+1;return-nm+g*x},u=m=>{const g=Math.exp(-m*e),x=(n-m)*(e*e);return g*x});const d=5/e,h=oO(o,u,d);if(e=ia(e),isNaN(h))return{stiffness:Nt.stiffness,damping:Nt.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const iO=12;function oO(e,t,n){let a=n;for(let o=1;o<iO;o++)a=a-e(a)/t(a);return a}function np(e,t){return e*Math.sqrt(1-t*t)}const sO=["duration","bounce"],lO=["stiffness","damping","mass"];function F0(e,t){return t.some(n=>e[n]!==void 0)}function uO(e){let t={velocity:Nt.velocity,stiffness:Nt.stiffness,damping:Nt.damping,mass:Nt.mass,isResolvedFromDuration:!1,...e};if(!F0(e,lO)&&F0(e,sO))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),o=a*a,u=2*Er(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Nt.mass,stiffness:o,damping:u}}else{const n=aO(e);t={...t,...n,mass:Nt.mass},t.isResolvedFromDuration=!0}return t}function Uc(e=Nt.visualDuration,t=Nt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:o}=n;const u=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],d={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:x,velocity:b,isResolvedFromDuration:v}=uO({...n,velocity:-or(n.velocity||0)}),z=b||0,T=m/(2*Math.sqrt(h*g)),E=l-u,N=or(Math.sqrt(h/g)),A=Math.abs(E)<5;a||(a=A?Nt.restSpeed.granular:Nt.restSpeed.default),o||(o=A?Nt.restDelta.granular:Nt.restDelta.default);let C;if(T<1){const L=np(N,T);C=M=>{const q=Math.exp(-T*N*M);return l-q*((z+T*N*E)/L*Math.sin(L*M)+E*Math.cos(L*M))}}else if(T===1)C=L=>l-Math.exp(-N*L)*(E+(z+N*E)*L);else{const L=N*Math.sqrt(T*T-1);C=M=>{const q=Math.exp(-T*N*M),V=Math.min(L*M,300);return l-q*((z+T*N*E)*Math.sinh(V)+L*E*Math.cosh(V))/L}}const $={calculatedDuration:v&&x||null,next:L=>{const M=C(L);if(v)d.done=L>=x;else{let q=L===0?z:0;T<1&&(q=L===0?ia(z):WS(C,L,M));const V=Math.abs(q)<=a,X=Math.abs(l-M)<=o;d.done=V&&X}return d.value=d.done?l:M,d},toString:()=>{const L=Math.min(pg($),Pc),M=QS(q=>$.next(L*q).value,L,30);return L+"ms "+M},toTransition:()=>{}};return $}Uc.applyToOptions=e=>{const t=nO(e,100,Uc);return e.ease=t.ease,e.duration=ia(t.duration),e.type="keyframes",e};function rp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:u=500,modifyTarget:l,min:d,max:h,restDelta:m=.5,restSpeed:g}){const x=e[0],b={done:!1,value:x},v=V=>d!==void 0&&V<d||h!==void 0&&V>h,z=V=>d===void 0?h:h===void 0||Math.abs(d-V)<Math.abs(h-V)?d:h;let T=n*t;const E=x+T,N=l===void 0?E:l(E);N!==E&&(T=N-x);const A=V=>-T*Math.exp(-V/a),C=V=>N+A(V),$=V=>{const X=A(V),ce=C(V);b.done=Math.abs(X)<=m,b.value=b.done?N:ce};let L,M;const q=V=>{v(b.value)&&(L=V,M=Uc({keyframes:[b.value,z(b.value)],velocity:WS(C,V,b.value),damping:o,stiffness:u,restDelta:m,restSpeed:g}))};return q(0),{calculatedDuration:null,next:V=>{let X=!1;return!M&&L===void 0&&(X=!0,$(V),q(V)),L!==void 0&&V>=L?M.next(V-L):(!X&&$(V),b)}}}function cO(e,t,n){const a=[],o=n||sa.mix||JS,u=e.length-1;for(let l=0;l<u;l++){let d=o(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||sr:t;d=Ll(h,d)}a.push(d)}return a}function dO(e,t,{clamp:n=!0,ease:a,mixer:o}={}){const u=e.length;if(og(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=cO(t,a,o),h=d.length,m=g=>{if(l&&g<e[0])return t[0];let x=0;if(h>1)for(;x<e.length-2&&!(g<e[x+1]);x++);const b=Sl(e[x],e[x+1],g);return d[x](b)};return n?g=>m(Er(e[0],e[u-1],g)):m}function fO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const o=Sl(0,t,a);e.push(St(n,1,o))}}function hO(e){const t=[0];return fO(t,e.length-1),t}function mO(e,t){return e.map(n=>n*t)}function pO(e,t){return e.map(()=>t||VS).splice(0,e.length-1)}function hl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const o=j4(a)?a.map(U0):U0(a),u={done:!1,value:t[0]},l=mO(n&&n.length===t.length?n:hO(t),e),d=dO(l,t,{ease:Array.isArray(o)?o:pO(t,o)});return{calculatedDuration:e,next:h=>(u.value=d(h),u.done=h>=e,u)}}const gO=e=>e!==null;function gg(e,{repeat:t,repeatType:n="loop"},a,o=1){const u=e.filter(gO),d=o<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!d||a===void 0?u[d]:a}const yO={decay:rp,inertia:rp,tween:hl,keyframes:hl,spring:Uc};function ez(e){typeof e.type=="string"&&(e.type=yO[e.type])}class yg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const xO=e=>e/100;class xg extends yg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==bn.now()&&this.tick(bn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ez(t);const{type:n=hl,repeat:a=0,repeatDelay:o=0,repeatType:u,velocity:l=0}=t;let{keyframes:d}=t;const h=n||hl;h!==hl&&typeof d[0]!="number"&&(this.mixKeyframes=Ll(xO,JS(d[0],d[1])),d=[0,100]);const m=h({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=pg(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+o,this.totalDuration=this.resolvedDuration*(a+1)-o,this.generator=m}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:o,mixKeyframes:u,mirroredGenerator:l,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:x,repeatType:b,repeatDelay:v,type:z,onUpdate:T,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-m*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?N<0:N>o;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,$=a;if(x){const V=Math.min(this.currentTime,o)/d;let X=Math.floor(V),ce=V%1;!ce&&V>=1&&(ce=1),ce===1&&X--,X=Math.min(X,x+1),X%2&&(b==="reverse"?(ce=1-ce,v&&(ce-=v/d)):b==="mirror"&&($=l)),C=Er(0,1,ce)*d}const L=A?{done:!1,value:g[0]}:$.next(C);u&&(L.value=u(L.value));let{done:M}=L;!A&&h!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return q&&z!==rp&&(L.value=gg(g,this.options,E,this.speed)),T&&T(L.value),q&&this.finish(),L}then(t,n){return this.finished.then(t,n)}get duration(){return or(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+or(t)}get time(){return or(this.currentTime)}set time(t){t=ia(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(bn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=or(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=tO,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(bn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function bO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ji=e=>e*180/Math.PI,ap=e=>{const t=ji(Math.atan2(e[1],e[0]));return ip(t)},vO={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ap,rotateZ:ap,skewX:e=>ji(Math.atan(e[1])),skewY:e=>ji(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ip=e=>(e=e%360,e<0&&(e+=360),e),q0=ap,G0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Y0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),kO={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:G0,scaleY:Y0,scale:e=>(G0(e)+Y0(e))/2,rotateX:e=>ip(ji(Math.atan2(e[6],e[5]))),rotateY:e=>ip(ji(Math.atan2(-e[2],e[0]))),rotateZ:q0,rotate:q0,skewX:e=>ji(Math.atan(e[4])),skewY:e=>ji(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function op(e){return e.includes("scale")?1:0}function sp(e,t){if(!e||e==="none")return op(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,o;if(n)a=kO,o=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=vO,o=d}if(!o)return op(t);const u=a[t],l=o[1].split(",").map(SO);return typeof u=="function"?u(l):l[u]}const wO=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return sp(n,t)};function SO(e){return parseFloat(e.trim())}const Jo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qo=new Set(Jo),X0=e=>e===Ko||e===xe,zO=new Set(["x","y","z"]),_O=Jo.filter(e=>!zO.has(e));function jO(e){const t=[];return _O.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Ua={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>sp(t,"x"),y:(e,{transform:t})=>sp(t,"y")};Ua.translateX=Ua.x;Ua.translateY=Ua.y;const Ti=new Set;let lp=!1,up=!1,cp=!1;function tz(){if(up){const e=Array.from(Ti).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const o=jO(a);o.length&&(n.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const o=n.get(a);o&&o.forEach(([u,l])=>{a.getValue(u)?.set(l)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}up=!1,lp=!1,Ti.forEach(e=>e.complete(cp)),Ti.clear()}function nz(){Ti.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(up=!0)})}function TO(){cp=!0,nz(),tz(),cp=!1}class bg{constructor(t,n,a,o,u,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=o,this.element=u,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ti.add(this),lp||(lp=!0,pt.read(nz),pt.resolveKeyframes(tz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:o}=this;if(t[0]===null){const u=o?.get(),l=t[t.length-1];if(u!==void 0)t[0]=u;else if(a&&n){const d=a.readValue(n,l);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=l),o&&u===void 0&&o.set(t[0])}bO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ti.delete(this)}cancel(){this.state==="scheduled"&&(Ti.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const CO=e=>e.startsWith("--");function EO(e,t,n){CO(t)?e.style.setProperty(t,n):e.style[t]=n}const NO=sg(()=>window.ScrollTimeline!==void 0),AO={};function OO(e,t){const n=sg(e);return()=>AO[t]??n()}const rz=OO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ll=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,K0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ll([0,.65,.55,1]),circOut:ll([.55,0,1,.45]),backIn:ll([.31,.01,.66,-.59]),backOut:ll([.33,1.53,.69,.99])};function az(e,t){if(e)return typeof e=="function"?rz()?QS(e,t):"ease-out":BS(e)?ll(e):Array.isArray(e)?e.map(n=>az(n,t)||K0.easeOut):K0[e]}function RO(e,t,n,{delay:a=0,duration:o=300,repeat:u=0,repeatType:l="loop",ease:d="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const x=az(d,o);Array.isArray(x)&&(g.easing=x);const b={delay:a,duration:o,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(g,b)}function iz(e){return typeof e=="function"&&"applyToOptions"in e}function MO({type:e,...t}){return iz(e)&&rz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class DO extends yg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:o,pseudoElement:u,allowFlatten:l=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=l,this.options=t,og(typeof t.type!="string");const m=MO(t);this.animation=RO(n,a,o,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=gg(o,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(g):EO(n,a,g),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return or(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+or(t)}get time(){return or(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ia(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&NO()?(this.animation.timeline=t,sr):n(this)}}const oz={anticipate:LS,backInOut:$S,circInOut:US};function $O(e){return e in oz}function LO(e){typeof e.ease=="string"&&$O(e.ease)&&(e.ease=oz[e.ease])}const rm=10;class PO extends DO{constructor(t){LO(t),ez(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:o,element:u,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new xg({...l,autoplay:!1}),h=Math.max(rm,bn.now()-this.startTime),m=Er(0,rm,h-rm);n.setWithVelocity(d.sample(Math.max(0,h-m)).value,d.sample(h).value,m),d.stop()}}const J0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ia.test(e)||e==="0")&&!e.startsWith("url("));function UO(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function VO(e,t,n,a){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],l=J0(o,t),d=J0(u,t);return!l||!d?!1:UO(e)||(n==="spring"||iz(n))&&a}function dp(e){e.duration=0,e.type="keyframes"}const BO=new Set(["opacity","clipPath","filter","transform"]),ZO=sg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function IO(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:o,damping:u,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return ZO()&&n&&BO.has(n)&&(n!=="transform"||!m)&&!h&&!a&&o!=="mirror"&&u!==0&&l!=="inertia"}const HO=40;class FO extends yg{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:l="loop",keyframes:d,name:h,motionValue:m,element:g,...x}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=bn.now();const b={autoplay:t,delay:n,type:a,repeat:o,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...x},v=g?.KeyframeResolver||bg;this.keyframeResolver=new v(d,(z,T,E)=>this.onKeyframesResolved(z,T,b,!E),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,o){this.keyframeResolver=void 0;const{name:u,type:l,velocity:d,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=bn.now(),VO(t,u,l,d)||((sa.instantAnimations||!h)&&g?.(gg(t,a,n)),t[0]=t[t.length-1],dp(a),a.repeat=0);const b={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>HO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&IO(b),z=b.motionValue?.owner?.current,T=v?new PO({...b,element:z}):new xg(b);T.finished.then(()=>{this.notifyFinished()}).catch(sr),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),TO()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function sz(e,t,n,a=0,o=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,d=(l-1)*a;return typeof n=="function"?n(u,l):o===1?u*a:d-u*a}const qO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function GO(e){const t=qO.exec(e);if(!t)return[,];const[,n,a,o]=t;return[`--${n??a}`,o]}function lz(e,t,n=1){const[a,o]=GO(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const l=u.trim();return CS(l)?parseFloat(l):l}return dg(o)?lz(o,t,n+1):o}const YO={type:"spring",stiffness:500,damping:25,restSpeed:10},XO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),KO={type:"keyframes",duration:.8},JO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},QO=(e,{keyframes:t})=>t.length>2?KO:Qo.has(e)?e.startsWith("scale")?XO(t[1]):YO:JO,WO=e=>e!==null;function eR(e,{repeat:t,repeatType:n="loop"},a){const o=e.filter(WO),u=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[u]}function vg(e,t){return e?.[t]??e?.default??e}function tR({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:o,repeat:u,repeatType:l,repeatDelay:d,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const kg=(e,t,n,a={},o,u)=>l=>{const d=vg(a,e)||{},h=d.delay||a.delay||0;let{elapsed:m=0}=a;m=m-ia(h);const g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{l(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:o};tR(d)||Object.assign(g,QO(e,g)),g.duration&&(g.duration=ia(g.duration)),g.repeatDelay&&(g.repeatDelay=ia(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let x=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(dp(g),g.delay===0&&(x=!0)),(sa.instantAnimations||sa.skipAnimations)&&(x=!0,dp(g),g.delay=0),g.allowFlatten=!d.type&&!d.ease,x&&!u&&t.get()!==void 0){const b=eR(g.keyframes,d);if(b!==void 0){pt.update(()=>{g.onUpdate(b),g.onComplete()});return}}return d.isSync?new xg(g):new FO(g)};function Q0(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function wg(e,t,n,a){if(typeof t=="function"){const[o,u]=Q0(a);t=t(n!==void 0?n:e.custom,o,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,u]=Q0(a);t=t(n!==void 0?n:e.custom,o,u)}return t}function Do(e,t,n){const a=e.getProps();return wg(a,t,n!==void 0?n:a.custom,e)}const uz=new Set(["width","height","top","left","right","bottom",...Jo]),W0=30,nR=e=>!isNaN(parseFloat(e));class rR{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const o=bn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=nR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new lg);const a=this.events[t].add(n);return t==="change"?()=>{a(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=bn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>W0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,W0);return AS(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zo(e,t){return new rR(e,t)}const fp=e=>Array.isArray(e);function aR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Zo(n))}function iR(e){return fp(e)?e[e.length-1]||0:e}function oR(e,t){const n=Do(e,t);let{transitionEnd:a={},transition:o={},...u}=n||{};u={...u,...a};for(const l in u){const d=iR(u[l]);aR(e,l,d)}}const cn=e=>!!(e&&e.getVelocity);function sR(e){return!!(cn(e)&&e.add)}function hp(e,t){const n=e.getValue("willChange");if(sR(n))return n.add(t);if(!n&&sa.WillChange){const a=new sa.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Sg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const lR="framerAppearId",cz="data-"+Sg(lR);function dz(e){return e.props[cz]}function uR({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function fz(e,t,{delay:n=0,transitionOverride:a,type:o}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:l,...d}=t;const h=u?.reduceMotion;a&&(u=a);const m=[],g=o&&e.animationState&&e.animationState.getState()[o];for(const x in d){const b=e.getValue(x,e.latestValues[x]??null),v=d[x];if(v===void 0||g&&uR(g,x))continue;const z={delay:n,...vg(u||{},x)},T=b.get();if(T!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===T&&!z.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const C=dz(e);if(C){const $=window.MotionHandoffAnimation(C,x,pt);$!==null&&(z.startTime=$,E=!0)}}hp(e,x);const N=h??e.shouldReduceMotion;b.start(kg(x,b,v,N&&uz.has(x)?{type:!1}:z,e,E));const A=b.animation;A&&m.push(A)}return l&&Promise.all(m).then(()=>{pt.update(()=>{l&&oR(e,l)})}),m}function mp(e,t,n={}){const a=Do(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(o=n.transitionOverride);const u=a?()=>Promise.all(fz(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:x}=o;return cR(e,t,h,m,g,x,n)}:()=>Promise.resolve(),{when:d}=o;if(d){const[h,m]=d==="beforeChildren"?[u,l]:[l,u];return h().then(()=>m())}else return Promise.all([u(),l(n.delay)])}function cR(e,t,n=0,a=0,o=0,u=1,l){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(mp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+sz(e.variantChildren,h,a,o,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function dR(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const o=t.map(u=>mp(e,u,n));a=Promise.all(o)}else if(typeof t=="string")a=mp(e,t,n);else{const o=typeof t=="function"?Do(e,t,n.custom):t;a=Promise.all(fz(e,o,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const fR={test:e=>e==="auto",parse:e=>e},hz=e=>t=>t.test(e),mz=[Ko,xe,Cr,$a,U4,P4,fR],e1=e=>mz.find(hz(e));function hR(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||NS(e):!0}const mR=new Set(["brightness","contrast","saturate","opacity"]);function pR(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(fg)||[];if(!a)return e;const o=n.replace(a,"");let u=mR.has(t)?1:0;return a!==n&&(u*=100),t+"("+u+o+")"}const gR=/\b([a-z-]*)\(.*?\)/gu,pp={...Ia,getAnimatableNone:e=>{const t=e.match(gR);return t?t.map(pR).join(" "):e}},t1={...Ko,transform:Math.round},yR={rotate:$a,rotateX:$a,rotateY:$a,rotateZ:$a,scale:cc,scaleX:cc,scaleY:cc,scaleZ:cc,skew:$a,skewX:$a,skewY:$a,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:zl,originX:B0,originY:B0,originZ:xe},zg={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,inset:xe,insetBlock:xe,insetBlockStart:xe,insetBlockEnd:xe,insetInline:xe,insetInlineStart:xe,insetInlineEnd:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,paddingBlock:xe,paddingBlockStart:xe,paddingBlockEnd:xe,paddingInline:xe,paddingInlineStart:xe,paddingInlineEnd:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,marginBlock:xe,marginBlockStart:xe,marginBlockEnd:xe,marginInline:xe,marginInlineStart:xe,marginInlineEnd:xe,fontSize:xe,backgroundPositionX:xe,backgroundPositionY:xe,...yR,zIndex:t1,fillOpacity:zl,strokeOpacity:zl,numOctaves:t1},xR={...zg,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:pp,WebkitFilter:pp},pz=e=>xR[e];function gz(e,t){let n=pz(e);return n!==pp&&(n=Ia),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const bR=new Set(["auto","none","0"]);function vR(e,t,n){let a=0,o;for(;a<e.length&&!o;){const u=e[a];typeof u=="string"&&!bR.has(u)&&_l(u).values.length&&(o=e[a]),a++}if(o&&n)for(const u of t)e[u]=gz(n,o)}class kR extends bg{constructor(t,n,a,o,u){super(t,n,a,o,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let x=t[g];if(typeof x=="string"&&(x=x.trim(),dg(x))){const b=lz(x,n.current);b!==void 0&&(t[g]=b),g===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!uz.has(a)||t.length!==2)return;const[o,u]=t,l=e1(o),d=e1(u),h=V0(o),m=V0(u);if(h!==m&&Ua[a]){this.needsMeasurement=!0;return}if(l!==d)if(X0(l)&&X0(d))for(let g=0;g<t.length;g++){const x=t[g];typeof x=="string"&&(t[g]=parseFloat(x))}else Ua[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let o=0;o<t.length;o++)(t[o]===null||hR(t[o]))&&a.push(o);a.length&&vR(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ua[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const u=a.length-1,l=a[u];a[u]=Ua[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function wR(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const o=n?.[e]??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}const yz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function gp(e){return ES(e)&&"offsetHeight"in e}const{schedule:_g}=ZS(queueMicrotask,!1),pr={x:!1,y:!1};function xz(){return pr.x||pr.y}function SR(e){return e==="x"||e==="y"?pr[e]?null:(pr[e]=!0,()=>{pr[e]=!1}):pr.x||pr.y?null:(pr.x=pr.y=!0,()=>{pr.x=pr.y=!1})}function bz(e,t){const n=wR(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[n,o,()=>a.abort()]}function n1(e){return!(e.pointerType==="touch"||xz())}function zR(e,t,n={}){const[a,o,u]=bz(e,n),l=d=>{if(!n1(d))return;const{target:h}=d,m=t(h,d);if(typeof m!="function"||!h)return;const g=x=>{n1(x)&&(m(x),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,o)};return a.forEach(d=>{d.addEventListener("pointerenter",l,o)}),u}const vz=(e,t)=>t?e===t?!0:vz(e,t.parentElement):!1,jg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,_R=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kz(e){return _R.has(e.tagName)||e.isContentEditable===!0}const Nc=new WeakSet;function r1(e){return t=>{t.key==="Enter"&&e(t)}}function am(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const jR=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=r1(()=>{if(Nc.has(n))return;am(n,"down");const o=r1(()=>{am(n,"up")}),u=()=>am(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function a1(e){return jg(e)&&!xz()}function TR(e,t,n={}){const[a,o,u]=bz(e,n),l=d=>{const h=d.currentTarget;if(!a1(d))return;Nc.add(h);const m=t(h,d),g=(v,z)=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",b),Nc.has(h)&&Nc.delete(h),a1(v)&&typeof m=="function"&&m(v,{success:z})},x=v=>{g(v,h===window||h===document||n.useGlobalTarget||vz(h,v.target))},b=v=>{g(v,!1)};window.addEventListener("pointerup",x,o),window.addEventListener("pointercancel",b,o)};return a.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",l,o),gp(d)&&(d.addEventListener("focus",m=>jR(m,o)),!kz(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function wz(e){return ES(e)&&"ownerSVGElement"in e}function CR(e){return wz(e)&&e.tagName==="svg"}const ER=[...mz,Ut,Ia],NR=e=>ER.find(hz(e)),i1=()=>({translate:0,scale:1,origin:0,originPoint:0}),To=()=>({x:i1(),y:i1()}),o1=()=>({min:0,max:0}),Yt=()=>({x:o1(),y:o1()}),yp={current:null},Sz={current:!1},AR=typeof window<"u";function OR(){if(Sz.current=!0,!!AR)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yp.current=e.matches;e.addEventListener("change",t),t()}else yp.current=!1}const RR=new WeakMap;function sd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function jl(e){return typeof e=="string"||Array.isArray(e)}const Tg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cg=["initial",...Tg];function ld(e){return sd(e.animate)||Cg.some(t=>jl(e[t]))}function zz(e){return!!(ld(e)||e.variants)}function MR(e,t,n){for(const a in t){const o=t[a],u=n[a];if(cn(o))e.addValue(a,o);else if(cn(u))e.addValue(a,Zo(o,{owner:e}));else if(u!==o)if(e.hasValue(a)){const l=e.getValue(a);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(a);e.addValue(a,Zo(l!==void 0?l:o,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const s1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Vc={};function _z(e){Vc=e}function DR(){return Vc}class $R{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:o,blockInitialAnimation:u,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=bn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,pt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=l;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=ld(n),this.isVariantNode=zz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...x}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in x){const v=x[b];h[b]!==void 0&&cn(v)&&v.set(h[b])}}mount(t){this.current=t,RR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Sz.current||OR(),this.shouldReduceMotion=yp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Za(this.notifyUpdate),Za(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const a=Qo.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&pt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),u&&u(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Vc){const n=Vc[t];if(!n)continue;const{isEnabled:a,Feature:o}=n;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Yt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<s1.length;a++){const o=s1[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const u="on"+o,l=t[u];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=MR(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=Zo(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(CS(a)||NS(a))?a=parseFloat(a):!NR(a)&&Ia.test(n)&&(a=gz(t,n)),this.setBaseTarget(t,cn(a)?a.get():a)),cn(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const u=wg(this.props,n,this.presenceContext?.custom);u&&(a=u[t])}if(n&&a!==void 0)return a;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!cn(o)?o:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new lg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){_g.render(this.render)}}class jz extends $R{constructor(){super(...arguments),this.KeyframeResolver=kR}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;cn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class qa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tz({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function LR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PR(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function im(e){return e===void 0||e===1}function xp({scale:e,scaleX:t,scaleY:n}){return!im(e)||!im(t)||!im(n)}function wi(e){return xp(e)||Cz(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cz(e){return l1(e.x)||l1(e.y)}function l1(e){return e&&e!=="0%"}function Bc(e,t,n){const a=e-n,o=t*a;return n+o}function u1(e,t,n,a,o){return o!==void 0&&(e=Bc(e,o,a)),Bc(e,n,a)+t}function bp(e,t=0,n=1,a,o){e.min=u1(e.min,t,n,a,o),e.max=u1(e.max,t,n,a,o)}function Ez(e,{x:t,y:n}){bp(e.x,t.translate,t.scale,t.originPoint),bp(e.y,n.translate,n.scale,n.originPoint)}const c1=.999999999999,d1=1.0000000000001;function UR(e,t,n,a=!1){const o=n.length;if(!o)return;t.x=t.y=1;let u,l;for(let d=0;d<o;d++){u=n[d],l=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Eo(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Ez(e,l)),a&&wi(u.latestValues)&&Eo(e,u.latestValues))}t.x<d1&&t.x>c1&&(t.x=1),t.y<d1&&t.y>c1&&(t.y=1)}function Co(e,t){e.min=e.min+t,e.max=e.max+t}function f1(e,t,n,a,o=.5){const u=St(e.min,e.max,o);bp(e,t,n,u,a)}function Eo(e,t){f1(e.x,t.x,t.scaleX,t.scale,t.originX),f1(e.y,t.y,t.scaleY,t.scale,t.originY)}function Nz(e,t){return Tz(PR(e.getBoundingClientRect(),t))}function VR(e,t,n){const a=Nz(e,n),{scroll:o}=t;return o&&(Co(a.x,o.offset.x),Co(a.y,o.offset.y)),a}const BR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ZR=Jo.length;function IR(e,t,n){let a="",o=!0;for(let u=0;u<ZR;u++){const l=Jo[u],d=e[l];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(l.startsWith("scale")?1:0);else{const m=parseFloat(d);h=l.startsWith("scale")?m===1:m===0}if(!h||n){const m=yz(d,zg[l]);if(!h){o=!1;const g=BR[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,o?"":a):o&&(a="none"),a}function Eg(e,t,n){const{style:a,vars:o,transformOrigin:u}=e;let l=!1,d=!1;for(const h in t){const m=t[h];if(Qo.has(h)){l=!0;continue}else if(HS(h)){o[h]=m;continue}else{const g=yz(m,zg[h]);h.startsWith("origin")?(d=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=IR(t,e.transform,n):a.transform&&(a.transform="none")),d){const{originX:h="50%",originY:m="50%",originZ:g=0}=u;a.transformOrigin=`${h} ${m} ${g}`}}function Az(e,{style:t,vars:n},a,o){const u=e.style;let l;for(l in t)u[l]=t[l];o?.applyProjectionStyles(u,a);for(l in n)u.setProperty(l,n[l])}function h1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const el={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(xe.test(e))e=parseFloat(e);else return e;const n=h1(e,t.target.x),a=h1(e,t.target.y);return`${n}% ${a}%`}},HR={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,o=Ia.parse(e);if(o.length>5)return a;const u=Ia.createTransformer(e),l=typeof o[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;o[0+l]/=d,o[1+l]/=h;const m=St(d,h,.5);return typeof o[2+l]=="number"&&(o[2+l]/=m),typeof o[3+l]=="number"&&(o[3+l]/=m),u(o)}},vp={borderRadius:{...el,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:el,borderTopRightRadius:el,borderBottomLeftRadius:el,borderBottomRightRadius:el,boxShadow:HR};function Oz(e,{layout:t,layoutId:n}){return Qo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!vp[e]||e==="opacity")}function Ng(e,t,n){const a=e.style,o=t?.style,u={};if(!a)return u;for(const l in a)(cn(a[l])||o&&cn(o[l])||Oz(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(u[l]=a[l]);return u}function FR(e){return window.getComputedStyle(e)}class qR extends jz{constructor(){super(...arguments),this.type="html",this.renderInstance=Az}readValueFromInstance(t,n){if(Qo.has(n))return this.projection?.isProjecting?op(n):wO(t,n);{const a=FR(t),o=(HS(n)?a.getPropertyValue(n):a[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nz(t,n)}build(t,n,a){Eg(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Ng(t,n,a)}}const GR={offset:"stroke-dashoffset",array:"stroke-dasharray"},YR={offset:"strokeDashoffset",array:"strokeDasharray"};function XR(e,t,n=1,a=0,o=!0){e.pathLength=1;const u=o?GR:YR;e[u.offset]=`${-a}`,e[u.array]=`${t} ${n}`}const KR=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rz(e,{attrX:t,attrY:n,attrScale:a,pathLength:o,pathSpacing:u=1,pathOffset:l=0,...d},h,m,g){if(Eg(e,d,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:b}=e;x.transform&&(b.transform=x.transform,delete x.transform),(b.transform||x.transformOrigin)&&(b.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),b.transform&&(b.transformBox=g?.transformBox??"fill-box",delete x.transformBox);for(const v of KR)x[v]!==void 0&&(b[v]=x[v],delete x[v]);t!==void 0&&(x.x=t),n!==void 0&&(x.y=n),a!==void 0&&(x.scale=a),o!==void 0&&XR(x,o,u,l,!1)}const Mz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Dz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JR(e,t,n,a){Az(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(Mz.has(o)?o:Sg(o),t.attrs[o])}function $z(e,t,n){const a=Ng(e,t,n);for(const o in e)if(cn(e[o])||cn(t[o])){const u=Jo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[u]=e[o]}return a}class QR extends jz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Yt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Qo.has(n)){const a=pz(n);return a&&a.default||0}return n=Mz.has(n)?n:Sg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return $z(t,n,a)}build(t,n,a){Rz(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,o){JR(t,n,a,o)}mount(t){this.isSVGTag=Dz(t.tagName),super.mount(t)}}const WR=Cg.length;function Lz(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Lz(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<WR;n++){const a=Cg[n],o=e.props[a];(jl(o)||o===!1)&&(t[a]=o)}return t}function Pz(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const e3=[...Tg].reverse(),t3=Tg.length;function n3(e){return t=>Promise.all(t.map(({animation:n,options:a})=>dR(e,n,a)))}function r3(e){let t=n3(e),n=m1(),a=!0;const o=h=>(m,g)=>{const x=Do(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(x){const{transition:b,transitionEnd:v,...z}=x;m={...m,...z,...v}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Lz(e.parent)||{},x=[],b=new Set;let v={},z=1/0;for(let E=0;E<t3;E++){const N=e3[E],A=n[N],C=m[N]!==void 0?m[N]:g[N],$=jl(C),L=N===h?A.isActive:null;L===!1&&(z=E);let M=C===g[N]&&C!==m[N]&&$;if(M&&a&&e.manuallyAnimateOnMount&&(M=!1),A.protectedKeys={...v},!A.isActive&&L===null||!C&&!A.prevProp||sd(C)||typeof C=="boolean")continue;const q=a3(A.prevProp,C);let V=q||N===h&&A.isActive&&!M&&$||E>z&&$,X=!1;const ce=Array.isArray(C)?C:[C];let Q=ce.reduce(o(N),{});L===!1&&(Q={});const{prevResolvedValues:se={}}=A,te={...se,...Q},oe=K=>{V=!0,b.has(K)&&(X=!0,b.delete(K)),A.needsAnimating[K]=!0;const B=e.getValue(K);B&&(B.liveStyle=!1)};for(const K in te){const B=Q[K],he=se[K];if(v.hasOwnProperty(K))continue;let O=!1;fp(B)&&fp(he)?O=!Pz(B,he):O=B!==he,O?B!=null?oe(K):b.add(K):B!==void 0&&b.has(K)?oe(K):A.protectedKeys[K]=!0}A.prevProp=C,A.prevResolvedValues=Q,A.isActive&&(v={...v,...Q}),a&&e.blockInitialAnimation&&(V=!1);const ae=M&&q;V&&(!ae||X)&&x.push(...ce.map(K=>{const B={type:N};if(typeof K=="string"&&a&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:he}=e,O=Do(he,K);if(he.enteringChildren&&O){const{delayChildren:S}=O.transition||{};B.delay=sz(he.enteringChildren,e,S)}}return{animation:K,options:B}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const N=Do(e,Array.isArray(m.initial)?m.initial[0]:m.initial);N&&N.transition&&(E.transition=N.transition)}b.forEach(N=>{const A=e.getBaseTarget(N),C=e.getValue(N);C&&(C.liveStyle=!0),E[N]=A??null}),x.push({animation:E})}let T=!!x.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(T=!1),a=!1,T?t(x):Promise.resolve()}function d(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(x=>x.animationState?.setActive(h,m)),n[h].isActive=m;const g=l(h);for(const x in n)n[x].protectedKeys={};return g}return{animateChanges:l,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=m1()}}}function a3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Pz(t,e):!1}function gi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function m1(){return{animate:gi(!0),whileInView:gi(),whileHover:gi(),whileTap:gi(),whileDrag:gi(),whileFocus:gi(),exit:gi()}}function p1(e,t){e.min=t.min,e.max=t.max}function mr(e,t){p1(e.x,t.x),p1(e.y,t.y)}function g1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Uz=1e-4,i3=1-Uz,o3=1+Uz,Vz=.01,s3=0-Vz,l3=0+Vz;function vn(e){return e.max-e.min}function u3(e,t,n){return Math.abs(e-t)<=n}function y1(e,t,n,a=.5){e.origin=a,e.originPoint=St(t.min,t.max,e.origin),e.scale=vn(n)/vn(t),e.translate=St(n.min,n.max,e.origin)-e.originPoint,(e.scale>=i3&&e.scale<=o3||isNaN(e.scale))&&(e.scale=1),(e.translate>=s3&&e.translate<=l3||isNaN(e.translate))&&(e.translate=0)}function ml(e,t,n,a){y1(e.x,t.x,n.x,a?a.originX:void 0),y1(e.y,t.y,n.y,a?a.originY:void 0)}function x1(e,t,n){e.min=n.min+t.min,e.max=e.min+vn(t)}function c3(e,t,n){x1(e.x,t.x,n.x),x1(e.y,t.y,n.y)}function b1(e,t,n){e.min=t.min-n.min,e.max=e.min+vn(t)}function Zc(e,t,n){b1(e.x,t.x,n.x),b1(e.y,t.y,n.y)}function v1(e,t,n,a,o){return e-=t,e=Bc(e,1/n,a),o!==void 0&&(e=Bc(e,1/o,a)),e}function d3(e,t=0,n=1,a=.5,o,u=e,l=e){if(Cr.test(t)&&(t=parseFloat(t),t=St(l.min,l.max,t/100)-l.min),typeof t!="number")return;let d=St(u.min,u.max,a);e===u&&(d-=t),e.min=v1(e.min,t,n,d,o),e.max=v1(e.max,t,n,d,o)}function k1(e,t,[n,a,o],u,l){d3(e,t[n],t[a],t[o],t.scale,u,l)}const f3=["x","scaleX","originX"],h3=["y","scaleY","originY"];function w1(e,t,n,a){k1(e.x,t,f3,n?n.x:void 0,a?a.x:void 0),k1(e.y,t,h3,n?n.y:void 0,a?a.y:void 0)}function S1(e){return e.translate===0&&e.scale===1}function Bz(e){return S1(e.x)&&S1(e.y)}function z1(e,t){return e.min===t.min&&e.max===t.max}function m3(e,t){return z1(e.x,t.x)&&z1(e.y,t.y)}function _1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Zz(e,t){return _1(e.x,t.x)&&_1(e.y,t.y)}function j1(e){return vn(e.x)/vn(e.y)}function T1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function rr(e){return[e("x"),e("y")]}function p3(e,t,n){let a="";const o=e.x.translate/t.x,u=e.y.translate/t.y,l=n?.z||0;if((o||u||l)&&(a=`translate3d(${o}px, ${u}px, ${l}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:x,rotateY:b,skewX:v,skewY:z}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),x&&(a+=`rotateX(${x}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),z&&(a+=`skewY(${z}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(a+=`scale(${d}, ${h})`),a||"none"}const Iz=["TopLeft","TopRight","BottomLeft","BottomRight"],g3=Iz.length,C1=e=>typeof e=="string"?parseFloat(e):e,E1=e=>typeof e=="number"||xe.test(e);function y3(e,t,n,a,o,u){o?(e.opacity=St(0,n.opacity??1,x3(a)),e.opacityExit=St(t.opacity??1,0,b3(a))):u&&(e.opacity=St(t.opacity??1,n.opacity??1,a));for(let l=0;l<g3;l++){const d=`border${Iz[l]}Radius`;let h=N1(t,d),m=N1(n,d);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||E1(h)===E1(m)?(e[d]=Math.max(St(C1(h),C1(m),a),0),(Cr.test(m)||Cr.test(h))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=St(t.rotate||0,n.rotate||0,a))}function N1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const x3=Hz(0,.5,PS),b3=Hz(.5,.95,sr);function Hz(e,t,n){return a=>a<e?0:a>t?1:n(Sl(e,t,a))}function v3(e,t,n){const a=cn(e)?e:Zo(e);return a.start(kg("",a,t,n)),a.animation}function Tl(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const k3=(e,t)=>e.depth-t.depth;class w3{constructor(){this.children=[],this.isDirty=!1}add(t){ag(this.children,t),this.isDirty=!0}remove(t){ig(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(k3),this.isDirty=!1,this.children.forEach(t)}}function S3(e,t){const n=bn.now(),a=({timestamp:o})=>{const u=o-n;u>=t&&(Za(a),e(u-t))};return pt.setup(a,!0),()=>Za(a)}function Ac(e){return cn(e)?e.get():e}class z3{constructor(){this.members=[]}add(t){ag(this.members,t),t.scheduleRender()}remove(t){if(ig(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let a;for(let o=n;o>=0;o--){const u=this.members[o];if(u.isPresent!==!1){a=u;break}}return a?(this.promote(a),!0):!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender();const o=a.options.layoutDependency,u=t.options.layoutDependency;o!==void 0&&u!==void 0&&o===u||(t.resumeFrom=a,n&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:d}=t.options;d===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:a}=t;n.onExitComplete&&n.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},om=["","X","Y","Z"],_3=1e3;let j3=0;function sm(e,t,n,a){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function Fz(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",pt,!(o||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&Fz(a)}function qz({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(l={},d=t?.()){this.id=j3++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(E3),this.nodes.forEach(R3),this.nodes.forEach(M3),this.nodes.forEach(N3)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new w3)}addEventListener(l,d){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new lg),this.eventHandlers.get(l).add(d)}notifyListeners(l,...d){const h=this.eventHandlers.get(l);h&&h.notify(...d)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=wz(l)&&!CR(l),this.instance=l;const{layoutId:d,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let g,x=0;const b=()=>this.root.updateBlockedByResize=!1;pt.read(()=>{x=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==x&&(x=v,this.root.updateBlockedByResize=!0,g&&g(),g=S3(b,250),Oc.hasAnimatedSinceResize&&(Oc.hasAnimatedSinceResize=!1,this.nodes.forEach(R1)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const z=this.options.transition||m.getDefaultTransition()||U3,{onLayoutAnimationStart:T,onLayoutAnimationComplete:E}=m.getProps(),N=!this.targetLayout||!Zz(this.targetLayout,v),A=!x&&b;if(this.options.layoutRoot||this.resumeFrom||A||x&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...vg(z,"layout"),onPlay:T,onComplete:E};(m.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(g,A)}else x||R1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Za(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(D3),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fz(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const x=this.path[g];x.shouldResetTransform=!0,x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(A1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(O1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(O3),this.nodes.forEach(T3),this.nodes.forEach(C3)):this.nodes.forEach(O1),this.clearAllSnapshots();const d=bn.now();an.delta=Er(0,1e3/60,d-an.timestamp),an.timestamp=d,an.isProcessing=!0,Qh.update.process(an),Qh.preRender.process(an),Qh.render.process(an),an.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_g.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(A3),this.sharedNodes.forEach($3)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Yt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(d=!1),d&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Bz(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(d||wi(this.latestValues)||g)&&(o(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return l&&(h=this.removeTransform(h)),V3(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Yt();const d=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(B3))){const{scroll:m}=this.root;m&&(Co(d.x,m.offset.x),Co(d.y,m.offset.y))}return d}removeElementScroll(l){const d=Yt();if(mr(d,l),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:x}=m;m!==this.root&&g&&x.layoutScroll&&(g.wasRoot&&mr(d,l),Co(d.x,g.offset.x),Co(d.y,g.offset.y))}return d}applyTransform(l,d=!1){const h=Yt();mr(h,l);for(let m=0;m<this.path.length;m++){const g=this.path[m];!d&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Eo(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),wi(g.latestValues)&&Eo(h,g.latestValues)}return wi(this.latestValues)&&Eo(h,this.latestValues),h}removeTransform(l){const d=Yt();mr(d,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!wi(m.latestValues))continue;xp(m.latestValues)&&m.updateSnapshot();const g=Yt(),x=m.measurePageBox();mr(g,x),w1(d,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return wi(this.latestValues)&&w1(d,this.latestValues),d}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==an.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(l||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:x}=this.options;if(!this.layout||!(g||x))return;this.resolvedRelativeTargetAt=an.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Yt(),this.targetWithTransforms=Yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),c3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mr(this.target,this.layout.layoutBox),Ez(this.target,this.targetDelta)):mr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||xp(this.parent.latestValues)||Cz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,d,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Yt(),this.relativeTargetOrigin=Yt(),Zc(this.relativeTargetOrigin,d,h),mr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),d=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===an.timestamp&&(h=!1),h)return;const{layout:m,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||g))return;mr(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;UR(this.layoutCorrected,this.treeScale,this.path,d),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Yt());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(g1(this.prevProjectionDelta.x,this.projectionDelta.x),g1(this.prevProjectionDelta.y,this.projectionDelta.y)),ml(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!T1(this.projectionDelta.x,this.prevProjectionDelta.x)||!T1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=To(),this.projectionDelta=To(),this.projectionDeltaWithTransform=To()}setAnimationOrigin(l,d=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},x=To();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const b=Yt(),v=h?h.source:void 0,z=this.layout?this.layout.source:void 0,T=v!==z,E=this.getStack(),N=!E||E.members.length<=1,A=!!(T&&!N&&this.options.crossfade===!0&&!this.path.some(P3));this.animationProgress=0;let C;this.mixTargetDelta=$=>{const L=$/1e3;M1(x.x,l.x,L),M1(x.y,l.y,L),this.setTargetDelta(x),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zc(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),L3(this.relativeTarget,this.relativeTargetOrigin,b,L),C&&m3(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Yt()),mr(C,this.relativeTarget)),T&&(this.animationValues=g,y3(g,m,this.latestValues,L,A,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Za(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Oc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zo(0)),this.currentAnimation=v3(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),l.onUpdate&&l.onUpdate(d)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:d,target:h,layout:m,latestValues:g}=l;if(!(!d||!h||!m)){if(this!==l&&this.layout&&m&&Gz(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Yt();const x=vn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+x;const b=vn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+b}mr(d,h),Eo(d,g),ml(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(l,d){this.sharedNodes.has(l)||this.sharedNodes.set(l,new z3),this.sharedNodes.get(l).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:d,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let d=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const m={};h.z&&sm("z",l,m,this.animationValues);for(let g=0;g<om.length;g++)sm(`rotate${om[g]}`,l,m,this.animationValues),sm(`skew${om[g]}`,l,m,this.animationValues);l.render();for(const g in m)l.setStaticValue(g,m[g]),this.animationValues&&(this.animationValues[g]=m[g]);l.scheduleRender()}applyProjectionStyles(l,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Ac(d?.pointerEvents)||"",l.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Ac(d?.pointerEvents)||""),this.hasProjected&&!wi(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let x=p3(this.projectionDeltaWithTransform,this.treeScale,g);h&&(x=h(g,x)),l.transform=x;const{x:b,y:v}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?l.opacity=m===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:l.opacity=m===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const z in vp){if(g[z]===void 0)continue;const{correct:T,applyTo:E,isCSSVariable:N}=vp[z],A=x==="none"?g[z]:T(g[z],m);if(E){const C=E.length;for(let $=0;$<C;$++)l[E[$]]=A}else N?this.options.visualElement.renderState.vars[z]=A:l[z]=A}this.options.layoutId&&(l.pointerEvents=m===this?Ac(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(A1),this.root.sharedNodes.clear()}}}function T3(e){e.updateLayout()}function C3(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:o}=e.options,u=t.source!==e.layout.source;o==="size"?rr(g=>{const x=u?t.measuredBox[g]:t.layoutBox[g],b=vn(x);x.min=n[g].min,x.max=x.min+b}):Gz(o,t.layoutBox,n)&&rr(g=>{const x=u?t.measuredBox[g]:t.layoutBox[g],b=vn(n[g]);x.max=x.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+b)});const l=To();ml(l,n,t.layoutBox);const d=To();u?ml(d,e.applyTransform(a,!0),t.measuredBox):ml(d,n,t.layoutBox);const h=!Bz(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:x,layout:b}=g;if(x&&b){const v=Yt();Zc(v,t.layoutBox,x.layoutBox);const z=Yt();Zc(z,n,b.layoutBox),Zz(v,z)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=z,e.relativeTargetOrigin=v,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function E3(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function N3(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function A3(e){e.clearSnapshot()}function A1(e){e.clearMeasurements()}function O1(e){e.isLayoutDirty=!1}function O3(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function R1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function R3(e){e.resolveTargetDelta()}function M3(e){e.calcProjection()}function D3(e){e.resetSkewAndRotation()}function $3(e){e.removeLeadSnapshot()}function M1(e,t,n){e.translate=St(t.translate,0,n),e.scale=St(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function D1(e,t,n,a){e.min=St(t.min,n.min,a),e.max=St(t.max,n.max,a)}function L3(e,t,n,a){D1(e.x,t.x,n.x,a),D1(e.y,t.y,n.y,a)}function P3(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const U3={duration:.45,ease:[.4,0,.1,1]},$1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),L1=$1("applewebkit/")&&!$1("chrome/")?Math.round:sr;function P1(e){e.min=L1(e.min),e.max=L1(e.max)}function V3(e){P1(e.x),P1(e.y)}function Gz(e,t,n){return e==="position"||e==="preserve-aspect"&&!u3(j1(t),j1(n),.2)}function B3(e){return e!==e.root&&e.scroll?.wasRoot}const Z3=qz({attachResizeListener:(e,t)=>Tl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),lm={current:void 0},Yz=qz({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lm.current){const e=new Z3({});e.mount(window),e.setOptions({layoutScroll:!0}),lm.current=e}return lm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ag=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function U1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function I3(...e){return t=>{let n=!1;const a=e.map(o=>{const u=U1(o,t);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let o=0;o<a.length;o++){const u=a[o];typeof u=="function"?u():U1(e[o],null)}}}}function H3(...e){return j.useCallback(I3(...e),e)}class F3 extends j.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,o=gp(a)&&a.offsetWidth||0,u=gp(a)&&a.offsetHeight||0,l=this.props.sizeRef.current;l.height=n.offsetHeight||0,l.width=n.offsetWidth||0,l.top=n.offsetTop,l.left=n.offsetLeft,l.right=o-l.width-l.left,l.bottom=u-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function q3({children:e,isPresent:t,anchorX:n,anchorY:a,root:o}){const u=j.useId(),l=j.useRef(null),d=j.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=j.useContext(Ag),m=e.props?.ref??e?.ref,g=H3(l,m);return j.useInsertionEffect(()=>{const{width:x,height:b,top:v,left:z,right:T,bottom:E}=d.current;if(t||!l.current||!x||!b)return;const N=n==="left"?`left: ${z}`:`right: ${T}`,A=a==="bottom"?`bottom: ${E}`:`top: ${v}`;l.current.dataset.motionPopId=u;const C=document.createElement("style");h&&(C.nonce=h);const $=o??document.head;return $.appendChild(C),C.sheet&&C.sheet.insertRule(`
12
12
  [data-motion-pop-id="${u}"] {
13
13
  position: absolute !important;
14
14
  width: ${x}px !important;
@@ -16,22 +16,22 @@ Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}
16
16
  ${N}px !important;
17
17
  ${A}px !important;
18
18
  }
19
- `),()=>{$.contains(C)&&$.removeChild(C)}},[t]),f.jsx(I3,{isPresent:t,childRef:l,sizeRef:d,children:j.cloneElement(e,{ref:g})})}const F3=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:u,mode:l,anchorX:d,anchorY:h,root:m})=>{const g=rg(q3),x=j.useId();let b=!0,v=j.useMemo(()=>(b=!1,{id:x,initial:t,isPresent:n,custom:o,onExitComplete:z=>{g.set(z,!0);for(const T of g.values())if(!T)return;a&&a()},register:z=>(g.set(z,!1),()=>g.delete(z))}),[n,g,a]);return u&&b&&(v={...v}),j.useMemo(()=>{g.forEach((z,T)=>g.set(T,!1))},[n]),j.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=f.jsx(H3,{isPresent:n,anchorX:d,anchorY:h,root:m,children:e})),f.jsx(od.Provider,{value:v,children:e})};function q3(){return new Map}function Xz(e=!0){const t=j.useContext(od);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,u=j.useId();j.useEffect(()=>{if(e)return o(u)},[e]);const l=j.useCallback(()=>e&&a&&a(u),[u,a,e]);return!n&&a?[!1,l]:[!0]}const cc=e=>e.key||"";function V1(e){const t=[];return j.Children.forEach(e,n=>{j.isValidElement(n)&&t.push(n)}),t}const G3=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:u="sync",propagate:l=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[g,x]=Xz(l),b=j.useMemo(()=>V1(e),[e]),v=l&&!g?[]:b.map(cc),z=j.useRef(!0),T=j.useRef(b),E=rg(()=>new Map),N=j.useRef(new Set),[A,C]=j.useState(b),[$,L]=j.useState(b);TS(()=>{z.current=!1,T.current=b;for(let V=0;V<$.length;V++){const X=cc($[V]);v.includes(X)?(E.delete(X),N.current.delete(X)):E.get(X)!==!0&&E.set(X,!1)}},[$,v.length,v.join("-")]);const M=[];if(b!==A){let V=[...b];for(let X=0;X<$.length;X++){const ce=$[X],Q=cc(ce);v.includes(Q)||(V.splice(X,0,ce),M.push(ce))}return u==="wait"&&M.length&&(V=M),L(V1(V)),C(b),null}const{forceRender:q}=j.useContext(ng);return f.jsx(f.Fragment,{children:$.map(V=>{const X=cc(V),ce=l&&!g?!1:b===$||v.includes(X),Q=()=>{if(N.current.has(X))return;if(N.current.add(X),E.has(X))E.set(X,!0);else return;let se=!0;E.forEach(te=>{te||(se=!1)}),se&&(q?.(),L(T.current),l&&x?.(),a&&a())};return f.jsx(F3,{isPresent:ce,initial:!z.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:u,root:m,onExitComplete:ce?void 0:Q,anchorX:d,anchorY:h,children:V},X)})})},Kz=j.createContext({strict:!1}),B1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Z1=!1;function Y3(){if(Z1)return;const e={};for(const t in B1)e[t]={isEnabled:n=>B1[t].some(a=>!!n[a])};_z(e),Z1=!0}function Jz(){return Y3(),RR()}function X3(e){const t=Jz();for(const n in e)t[n]={...t[n],...e[n]};_z(t)}const K3=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ic(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||K3.has(e)}let Qz=e=>!Ic(e);function J3(e){typeof e=="function"&&(Qz=t=>t.startsWith("on")?!Ic(t):e(t))}try{J3(require("@emotion/is-prop-valid").default)}catch{}function Q3(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||(Qz(o)||n===!0&&Ic(o)||!t&&!Ic(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const ud=j.createContext({});function W3(e,t){if(ld(e)){const{initial:n,animate:a}=e;return{initial:n===!1||_l(n)?n:void 0,animate:_l(a)?a:void 0}}return e.inherit!==!1?t:{}}function eM(e){const{initial:t,animate:n}=W3(e,j.useContext(ud));return j.useMemo(()=>({initial:t,animate:n}),[I1(t),I1(n)])}function I1(e){return Array.isArray(e)?e.join(" "):e}const Og=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Wz(e,t,n){for(const a in t)!cn(t[a])&&!Oz(a,n)&&(e[a]=t[a])}function tM({transformTemplate:e},t){return j.useMemo(()=>{const n=Og();return Eg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nM(e,t){const n=e.style||{},a={};return Wz(a,n,e),Object.assign(a,tM(e,t)),a}function rM(e,t){const n={},a=nM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const e_=()=>({...Og(),attrs:{}});function aM(e,t,n,a){const o=j.useMemo(()=>{const u=e_();return Rz(u,t,Dz(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};Wz(u,e.style,e),o.style={...u,...o.style}}return o}const iM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Rg(e){return typeof e!="string"||e.includes("-")?!1:!!(iM.indexOf(e)>-1||/[A-Z]/u.test(e))}function oM(e,t,n,{latestValues:a},o,u=!1,l){const h=(l??Rg(e)?aM:rM)(t,a,o,e),m=Q3(t,typeof e=="string",u),g=e!==j.Fragment?{...m,...h,ref:n}:{},{children:x}=t,b=j.useMemo(()=>cn(x)?x.get():x,[x]);return j.createElement(e,{...g,children:b})}function sM({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:lM(n,a,o,e),renderState:t()}}function lM(e,t,n,a){const o={},u=a(e,{});for(const b in u)o[b]=Nc(u[b]);let{initial:l,animate:d}=e;const h=ld(e),m=zz(e);t&&m&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),d===void 0&&(d=t.animate));let g=n?n.initial===!1:!1;g=g||l===!1;const x=g?d:l;if(x&&typeof x!="boolean"&&!sd(x)){const b=Array.isArray(x)?x:[x];for(let v=0;v<b.length;v++){const z=wg(e,b[v]);if(z){const{transitionEnd:T,transition:E,...N}=z;for(const A in N){let C=N[A];if(Array.isArray(C)){const $=g?C.length-1:0;C=C[$]}C!==null&&(o[A]=C)}for(const A in T)o[A]=T[A]}}}return o}const t_=e=>(t,n)=>{const a=j.useContext(ud),o=j.useContext(od),u=()=>sM(e,t,a,o);return n?u():rg(u)},uM=t_({scrapeMotionValuesFromProps:Ng,createRenderState:Og}),cM=t_({scrapeMotionValuesFromProps:$z,createRenderState:e_}),dM=Symbol.for("motionComponentSymbol");function fM(e,t,n){const a=j.useRef(n);j.useInsertionEffect(()=>{a.current=n});const o=j.useRef(null);return j.useCallback(u=>{u&&e.onMount?.(u),t&&(u?t.mount(u):t.unmount());const l=a.current;if(typeof l=="function")if(u){const d=l(u);typeof d=="function"&&(o.current=d)}else o.current?(o.current(),o.current=null):l(u);else l&&(l.current=u)},[t])}const n_=j.createContext({});function ll(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function hM(e,t,n,a,o,u){const{visualElement:l}=j.useContext(ud),d=j.useContext(Kz),h=j.useContext(od),m=j.useContext(Ag).reducedMotion,g=j.useRef(null),x=j.useRef(!1);a=a||d.renderer,!g.current&&a&&(g.current=a(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,isSVG:u}),x.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const b=g.current,v=j.useContext(n_);b&&!b.projection&&o&&(b.type==="html"||b.type==="svg")&&mM(g.current,n,o,v);const z=j.useRef(!1);j.useInsertionEffect(()=>{b&&z.current&&b.update(n,h)});const T=n[cz],E=j.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return TS(()=>{x.current=!0,b&&(z.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),E.current&&b.animationState&&b.animationState.animateChanges())}),j.useEffect(()=>{b&&(!E.current&&b.animationState&&b.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),E.current=!1),b.enteringChildren=void 0)}),b}function mM(e,t,n,a){const{layoutId:o,layout:u,drag:l,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:r_(e.parent)),e.projection.setOptions({layoutId:o,layout:u,alwaysMeasureLayout:!!l||d&&ll(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function r_(e){if(e)return e.options.allowProjection!==!1?e.projection:r_(e.parent)}function um(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&X3(a);const u=n?n==="svg":Rg(e),l=u?cM:uM;function d(m,g){let x;const b={...j.useContext(Ag),...m,layoutId:pM(m)},{isStatic:v}=b,z=eM(m),T=l(m,v);if(!v&&jS){gM();const E=yM(b);x=E.MeasureLayout,z.visualElement=hM(e,T,b,o,E.ProjectionNode,u)}return f.jsxs(ud.Provider,{value:z,children:[x&&z.visualElement?f.jsx(x,{visualElement:z.visualElement,...b}):null,oM(e,m,fM(T,z.visualElement,g),T,v,t,u)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=j.forwardRef(d);return h[dM]=e,h}function pM({layoutId:e}){const t=j.useContext(ng).id;return t&&e!==void 0?t+"-"+e:e}function gM(e,t){j.useContext(Kz).strict}function yM(e){const t=Jz(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function xM(e,t){if(typeof Proxy>"u")return um;const n=new Map,a=(u,l)=>um(u,l,e,t),o=(u,l)=>a(u,l);return new Proxy(o,{get:(u,l)=>l==="create"?a:(n.has(l)||n.set(l,um(l,void 0,e,t)),n.get(l))})}const bM=(e,t)=>t.isSVG??Rg(e)?new KR(t):new HR(t,{allowProjection:e!==j.Fragment});class vM extends qa{constructor(t){super(t),t.animationState||(t.animationState=t3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();sd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let kM=0;class wM extends qa{constructor(){super(...arguments),this.id=kM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const SM={animation:{Feature:vM},exit:{Feature:wM}};function Ul(e){return{point:{x:e.pageX,y:e.pageY}}}const zM=e=>t=>jg(t)&&e(t,Ul(t));function ml(e,t,n,a){return jl(e,t,zM(n),a)}const a_=({current:e})=>e?e.ownerDocument.defaultView:null,H1=(e,t)=>Math.abs(e-t);function _M(e,t){const n=H1(e.x,t.x),a=H1(e.y,t.y);return Math.sqrt(n**2+a**2)}const F1=new Set(["auto","scroll"]);class i_{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:u=!1,distanceThreshold:l=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=dm(this.lastMoveEventInfo,this.history),z=this.startEvent!==null,T=_M(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!z&&!T)return;const{point:E}=v,{timestamp:N}=an;this.history.push({...E,timestamp:N});const{onStart:A,onMove:C}=this.handlers;z||(A&&A(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,v)},this.handlePointerMove=(v,z)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=cm(z,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(v,z)=>{this.end();const{onEnd:T,onSessionEnd:E,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=dm(v.type==="pointercancel"?this.lastMoveEventInfo:cm(z,this.transformPagePoint),this.history);this.startEvent&&T&&T(v,A),E&&E(v,A)},!jg(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=o||window;const h=Ul(t),m=cm(h,this.transformPagePoint),{point:g}=m,{timestamp:x}=an;this.history=[{...g,timestamp:x}];const{onSessionStart:b}=n;b&&b(t,dm(m,this.history)),this.removeListeners=$l(ml(this.contextWindow,"pointermove",this.handlePointerMove),ml(this.contextWindow,"pointerup",this.handlePointerUp),ml(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(F1.has(a.overflowX)||F1.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:o.x-n.x,y:o.y-n.y};u.x===0&&u.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(t,o),pt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Za(this.updatePoint)}}function cm(e,t){return t?{point:t(e.point)}:e}function q1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dm({point:e},t){return{point:e,delta:q1(e,o_(t)),offset:q1(e,jM(t)),velocity:TM(t,.1)}}function jM(e){return e[0]}function o_(e){return e[e.length-1]}function TM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=o_(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>ia(t)));)n--;if(!a)return{x:0,y:0};const u=or(o.timestamp-a.timestamp);if(u===0)return{x:0,y:0};const l={x:(o.x-a.x)/u,y:(o.y-a.y)/u};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function CM(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?St(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?St(n,e,a.max):Math.min(e,n)),e}function G1(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function EM(e,{top:t,left:n,bottom:a,right:o}){return{x:G1(e.x,n,o),y:G1(e.y,t,a)}}function Y1(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function NM(e,t){return{x:Y1(e.x,t.x),y:Y1(e.y,t.y)}}function AM(e,t){let n=.5;const a=vn(e),o=vn(t);return o>a?n=wl(t.min,t.max-a,e.min):a>o&&(n=wl(e.min,e.max-o,t.min)),Er(0,1,n)}function OM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const kp=.35;function RM(e=kp){return e===!1?e=0:e===!0&&(e=kp),{x:X1(e,"left","right"),y:X1(e,"top","bottom")}}function X1(e,t,n){return{min:K1(e,t),max:K1(e,n)}}function K1(e,t){return typeof e=="number"?e:e[t]||0}const MM=new WeakMap;class DM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Yt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const u=x=>{n?(this.stopAnimation(),this.snapToCursor(Ul(x).point)):this.pauseAnimation()},l=(x,b)=>{this.stopAnimation();const{drag:v,dragPropagation:z,onDragStart:T}=this.getProps();if(v&&!z&&(this.openDragLock&&this.openDragLock(),this.openDragLock=kR(v),!this.openDragLock))return;this.latestPointerEvent=x,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(N=>{let A=this.getAxisMotionValue(N).get()||0;if(Cr.test(A)){const{projection:C}=this.visualElement;if(C&&C.layout){const $=C.layout.layoutBox[N];$&&(A=vn($)*(parseFloat(A)/100))}}this.originPoint[N]=A}),T&&pt.postRender(()=>T(x,b)),hp(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:z,onDirectionLock:T,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:N}=b;if(z&&this.currentDirection===null){this.currentDirection=$M(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),E&&E(x,b)},h=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b,this.stop(x,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>rr(x=>this.getAnimationState(x)==="paused"&&this.getAxisMotionValue(x).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new i_(t,{onSessionStart:u,onStart:l,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:a_(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!o||!a)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:d}=this.getProps();d&&pt.postRender(()=>d(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!dc(t,o,this.currentDirection))return;const u=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=CM(l,this.constraints[t],this.elastic[t])),u.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&ll(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=EM(a.layoutBox,t):this.constraints=!1,this.elastic=RM(n),o!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&rr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=OM(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ll(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const u=PR(a,o.root,this.visualElement.getTransformPagePoint());let l=NM(o.layout.layoutBox,u);if(n){const d=n(DR(l));this.hasMutatedConstraints=!!d,d&&(l=Tz(d))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=rr(g=>{if(!dc(g,n,this.currentDirection))return;let x=h&&h[g]||{};l&&(x={min:0,max:0});const b=o?200:1e6,v=o?40:1e7,z={type:"inertia",velocity:a?t[g]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...u,...x};return this.startAxisValueAnimation(g,z)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return hp(this.visualElement,t),a.start(kg(t,a,0,n,this.visualElement,!1))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){rr(n=>{const{drag:a}=this.getProps();if(!dc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,u=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:d}=o.layout.layoutBox[n],h=u.get()||0;u.set(t[n]-St(l,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ll(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};rr(l=>{const d=this.getAxisMotionValue(l);if(d&&this.constraints!==!1){const h=d.get();o[l]=AM({min:h,max:h},this.constraints[l])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),rr(l=>{if(!dc(l,t,null))return;const d=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];d.set(St(h,m,o[l]))})}addListeners(){if(!this.visualElement.current)return;MM.set(this.visualElement,this);const t=this.visualElement.current,n=ml(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),x=h.target,b=x!==t&&kz(x);m&&g&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();ll(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,u=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),pt.read(a);const l=jl(window,"resize",()=>this.scalePositionWithinConstraints()),d=o.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(rr(g=>{const x=this.getAxisMotionValue(g);x&&(this.originPoint[g]+=h[g].translate,x.set(x.get()+h[g].translate))}),this.visualElement.render())}));return()=>{l(),n(),u(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:u=!1,dragElastic:l=kp,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:u,dragElastic:l,dragMomentum:d}}}function dc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $M(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class LM extends qa{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new DM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const J1=e=>(t,n)=>{e&&pt.postRender(()=>e(t,n))};class PM extends qa{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new i_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:a_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:J1(t),onStart:J1(n),onMove:a,onEnd:(u,l)=>{delete this.session,o&&pt.postRender(()=>o(u,l))}}}mount(){this.removePointerDownListener=ml(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let fm=!1;class UM extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:u}=t;u&&(n.group&&n.group.add(u),a&&a.register&&o&&a.register(u),fm&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ac.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:u}=this.props,{projection:l}=a;return l&&(l.isPresent=u,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),fm=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==u?l.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?l.promote():l.relegate()||pt.postRender(()=>{const d=l.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),_g.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;fm=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function s_(e){const[t,n]=Xz(),a=j.useContext(ng);return f.jsx(UM,{...e,layoutGroup:a,switchLayoutGroup:j.useContext(n_),isPresent:t,safeToRemove:n})}const VM={pan:{Feature:PM},drag:{Feature:LM,ProjectionNode:Yz,MeasureLayout:s_}};function Q1(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,u=a[o];u&&pt.postRender(()=>u(t,Ul(t)))}class BM extends qa{mount(){const{current:t}=this.node;t&&(this.unmount=wR(t,(n,a)=>(Q1(this.node,a,"Start"),o=>Q1(this.node,o,"End"))))}unmount(){}}class ZM extends qa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$l(jl(this.node.current,"focus",()=>this.onFocus()),jl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function W1(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),u=a[o];u&&pt.postRender(()=>u(t,Ul(t)))}class IM extends qa{mount(){const{current:t}=this.node;t&&(this.unmount=_R(t,(n,a)=>(W1(this.node,a,"Start"),(o,{success:u})=>W1(this.node,o,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wp=new WeakMap,hm=new WeakMap,HM=e=>{const t=wp.get(e.target);t&&t(e)},FM=e=>{e.forEach(HM)};function qM({root:e,...t}){const n=e||document;hm.has(n)||hm.set(n,{});const a=hm.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(FM,{root:e,...t})),a[o]}function GM(e,t,n){const a=qM(t);return wp.set(e,n),a.observe(e),()=>{wp.delete(e),a.unobserve(e)}}const YM={some:0,all:1};class XM extends qa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:u}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:YM[o]},d=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:x}=this.node.getProps(),b=m?g:x;b&&b(h)};return GM(this.node.current,l,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(KM(t,n))&&this.startObserver()}unmount(){}}function KM({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const JM={inView:{Feature:XM},tap:{Feature:IM},focus:{Feature:ZM},hover:{Feature:BM}},QM={layout:{ProjectionNode:Yz,MeasureLayout:s_}},WM={...SM,...JM,...VM,...QM},ot=xM(WM,bM),l_=()=>{const[e,t]=j.useState(!!localStorage.getItem("morpheus.auth.token"));return j.useEffect(()=>{const o=()=>{t(!!localStorage.getItem("morpheus.auth.token"))};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[]),{isAuthenticated:e,login:o=>{localStorage.setItem("morpheus.auth.token",o),t(!0)},logout:()=>{localStorage.removeItem("morpheus.auth.token"),t(!1),window.location.href="/login"}}};function eD({onMenuClick:e,isDark:t,toggleTheme:n}){return f.jsxs("header",{className:"lg:hidden fixed top-0 left-0 right-0 z-50 bg-azure-surface dark:bg-black border-b border-azure-border dark:border-matrix-primary/30 p-4 flex items-center justify-between",children:[f.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(zo,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight","aria-label":t?"Modo claro":"Modo escuro",children:t?f.jsx(mS,{className:"w-5 h-5"}):f.jsx(fS,{className:"w-5 h-5"})}),f.jsx("button",{onClick:e,className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-secondary","aria-label":"Abrir menu",children:f.jsx(iA,{className:"w-6 h-6"})})]})]})}const La={list:()=>_e.get("/webhooks"),get:e=>_e.get(`/webhooks/${e}`),create:e=>_e.post("/webhooks",e),update:(e,t)=>_e.put(`/webhooks/${e}`,t),delete:e=>_e.delete(`/webhooks/${e}`),listNotifications:e=>{const t=new URLSearchParams;e?.webhookId&&t.set("webhookId",e.webhookId),e?.unreadOnly&&t.set("unreadOnly","true");const n=t.toString()?`?${t}`:"";return _e.get(`/webhooks/notifications${n}`)},unreadCount:()=>_e.get("/webhooks/notifications/unread-count"),markRead:e=>_e.post("/webhooks/notifications/read",{ids:e})},Nr=({open:e,onOpenChange:t,children:n})=>e?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),f.jsx("div",{className:"relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:n})]}):null,Zo=({className:e,children:t})=>f.jsx("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col ${e}`,children:f.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),Ar=({children:e})=>f.jsx("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left border-b border-azure-border dark:border-matrix-primary p-6",children:e}),Or=({className:e,children:t})=>f.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),tD=({className:e,children:t})=>f.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),ir=({className:e,variant:t="default",size:n="default",...a})=>{const d=`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 ${t==="destructive"?"bg-red-500 text-zinc-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90":t==="outline"?"border border-azure-border dark:border-matrix-primary bg-transparent hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="secondary"?"bg-azure-surface dark:bg-zinc-800 hover:bg-azure-hover dark:hover:bg-zinc-700/80 text-azure-text-primary dark:text-matrix-secondary":t==="ghost"?"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="link"?"text-azure-primary dark:text-matrix-highlight underline-offset-4 hover:underline":"bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black hover:bg-azure-primary/90 dark:hover:bg-matrix-highlight/90"} ${n==="sm"?"h-9 px-3 rounded-md":n==="lg"?"h-11 px-8 rounded-md":n==="icon"?"h-10 w-10":"h-10 px-4 py-2"} ${e||""}`;return f.jsx("button",{className:d,...a})};function nD({isOpen:e,onClose:t,onConfirm:n}){return f.jsx(Nr,{open:e,onOpenChange:t,children:f.jsxs(Zo,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),f.jsxs("div",{children:[f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary mb-6",children:"Are you sure you want to restart the Morpheus agent? This will temporarily disconnect all services and channels."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[f.jsx(ir,{variant:"outline",onClick:t,children:"Cancel"}),f.jsx(ir,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Oc={list:e=>{const t=new URLSearchParams;e?.status&&t.set("status",e.status),e?.agent&&t.set("agent",e.agent),e?.origin_channel&&t.set("origin_channel",e.origin_channel),e?.session_id&&t.set("session_id",e.session_id),e?.limit&&t.set("limit",String(e.limit));const n=t.toString()?`?${t}`:"";return _e.get(`/tasks${n}`)},get:e=>_e.get(`/tasks/${e}`),stats:()=>_e.get("/tasks/stats"),retry:e=>_e.post(`/tasks/${e}/retry`,{})};function rD({children:e}){const t=yr(),[n,a]=j.useState(()=>{const E=localStorage.getItem("theme");return E?E==="dark":!0}),[o,u]=j.useState(!1),[l,d]=j.useState(!1),{logout:h}=l_(),{data:m}=Qt("/webhooks/notifications/unread-count",()=>La.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:x}=Qt("/tasks/stats",()=>Oc.stats(),{refreshInterval:5e3}),b=(x?.pending??0)+(x?.running??0),v=async()=>{try{await _e.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(E){console.error("Failed to restart:",E),alert("Failed to restart the agent. Please try again.")}};j.useEffect(()=>{n?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[n]),j.useEffect(()=>{u(!1)},[t.pathname]);const z=[{icon:S0,label:"Dashboard",path:"/"},{icon:vl,label:"Chat",path:"/chat"},{icon:C0,label:"Zaion",path:"/zaion"},{icon:j0,label:"MCP Servers",path:"/mcp-servers"},{icon:Vm,label:"Usage Stats",path:"/stats"},{icon:$c,label:"Model Pricing",path:"/model-pricing"},{icon:zo,label:"Sati Memories",path:"/sati-memories"},{icon:Fm,label:"Webhooks",path:"/webhooks"},{icon:Im,label:"Tasks",path:"/tasks"},{icon:Oo,label:"Trinity DBs",path:"/trinity-databases"}],T=[{icon:S0,label:"Dashboard",path:"/"},{icon:vl,label:"Chat",path:"/chat"},{icon:C0,label:"Zaion",path:"/zaion"},{icon:j0,label:"MCP Servers",path:"/mcp-servers"},{icon:Vm,label:"Usage Stats",path:"/stats"},{icon:$c,label:"Model Pricing",path:"/model-pricing"},{icon:zo,label:"Sati Memories",path:"/sati-memories"},{icon:Fm,label:"Webhooks",path:"/webhooks"},{icon:Im,label:"Tasks",path:"/tasks"},{icon:Oo,label:"Trinity DBs",path:"/trinity-databases"}];return f.jsxs("div",{className:"flex flex-col h-screen bg-azure-bg dark:bg-black text-azure-text-primary dark:text-matrix-secondary font-mono overflow-hidden transition-colors duration-300",children:[f.jsx(eD,{onMenuClick:()=>u(!0),isDark:n,toggleTheme:()=>a(!n)}),f.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",f.jsxs("div",{className:"hidden lg:flex w-64 border-r border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-black flex-col shrink-0 transition-colors duration-300",children:[f.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[f.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(zo,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsx("button",{onClick:()=>a(!n),className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors",children:n?f.jsx(mS,{className:"w-4 h-4"}):f.jsx(fS,{className:"w-4 h-4"})})]}),f.jsxs("nav",{className:"flex-1 p-4 space-y-2",children:[z.map(E=>{const N=t.pathname===E.path;return f.jsxs(_r,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsx(E.icon,{className:"w-5 h-5"}),f.jsx("span",{children:E.label}),E.path==="/tasks"&&b>0&&f.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:b>99?"99+":b})]},E.path)}),f.jsxs(_r,{to:"/logs",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/logs"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsx(Hm,{className:"w-5 h-5"}),f.jsx("span",{children:"Logs"})]},"/logs"),f.jsxs(_r,{to:"/notifications",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsxs("div",{className:"relative",children:[f.jsx(bl,{className:"w-5 h-5"}),g>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),f.jsx("span",{children:"Notifications"}),g>0&&f.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]},"/notifications")]}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[f.jsx(T0,{className:"w-5 h-5"}),f.jsx("span",{children:"Restart"})]})}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:h,className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[f.jsx(z0,{className:"w-5 h-5"}),f.jsx("span",{children:"Logout"})]})})]}),f.jsx(G3,{children:o&&f.jsxs(ot.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),children:[f.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),f.jsxs(ot.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[f.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(zo,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsx("button",{onClick:()=>u(!1),className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors","aria-label":"Fechar menu",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[T.map(E=>{const N=t.pathname===E.path;return f.jsxs(_r,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[f.jsx(E.icon,{className:"w-5 h-5"}),f.jsx("span",{children:E.label}),E.path==="/tasks"&&b>0&&f.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:b>99?"99+":b})]},E.path)}),f.jsxs(_r,{to:"/logs",className:"flex items-center gap-3 px-4 py-3 rounded transition-colors hidden lg:flex hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary",onClick:()=>u(!1),children:[f.jsx(Hm,{className:"w-5 h-5"}),f.jsx("span",{children:"Logs"})]}),f.jsxs(_r,{to:"/notifications",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[f.jsxs("div",{className:"relative",children:[f.jsx(bl,{className:"w-5 h-5"}),g>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),f.jsx("span",{children:"Notifications"}),g>0&&f.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]})]}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>{d(!0),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[f.jsx(T0,{className:"w-5 h-5"}),f.jsx("span",{children:"Restart"})]})}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>{h(),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[f.jsx(z0,{className:"w-5 h-5"}),f.jsx("span",{children:"Logout"})]})})]})]})}),f.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[f.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),f.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(18,16,16,0)_50%,rgba(0,0,0,0.1)_50%),linear-gradient(90deg,rgba(0,255,0,0.03),rgba(0,255,0,0.01))] bg-[length:100%_2px,3px_100%] opacity-0 dark:opacity-20 transition-opacity duration-300"})]})]}),f.jsx(y4,{}),f.jsx(nD,{isOpen:l,onClose:()=>d(!1),onConfirm:v})]})}const aD={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},Si=({title:e,value:t,icon:n,subValue:a})=>f.jsxs(ot.div,{variants:aD,className:"border border-azure-border dark:border-matrix-primary bg-azure-surface/50 dark:bg-zinc-950/50 p-6 rounded relative overflow-hidden group hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",children:[f.jsxs("div",{className:"flex justify-between items-start mb-4",children:[f.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),f.jsx(n,{className:"w-6 h-6 text-azure-primary dark:text-matrix-primary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),f.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&f.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),Sp={fetchUsageStats:async()=>_e.get("/stats/usage"),fetchGroupedUsageStats:async()=>_e.get("/stats/usage/grouped")};function iD(){const{data:e}=Qt("/api/stats/usage",Sp.fetchUsageStats,{refreshInterval:5e3});return f.jsxs(f.Fragment,{children:[f.jsx(Si,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:sS,subValue:"Tokens processed"}),f.jsx(Si,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:lS,subValue:"Tokens generated"})]})}function oD(){const{data:e}=zS(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return f.jsxs(ot.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[f.jsxs(ot.div,{variants:n,children:[f.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight mb-2",children:"SYSTEM STATUS"}),f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"Overview of the Morpheus agent runtime."})]}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[f.jsx(Si,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:zo,subValue:e?`PID: ${e.pid}`:""}),f.jsx(Si,{title:"Uptime",value:e?_S(e.uptimeSeconds):"-",icon:ad,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),f.jsx(Si,{title:"Version",value:e?.projectVersion||"-",icon:dS,subValue:`Node ${e?.nodeVersion||"-"}`}),f.jsx(Si,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:jN,subValue:"LLM Inference Engine"}),f.jsx(Si,{title:"Model",value:e?.llmModel||"-",icon:zN,subValue:"Active Model"}),f.jsx(iD,{})]})]})}const sD=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:o,onDeleteSession:u,onRenameSession:l,isOpen:d,toggleSidebar:h})=>{const[m,g]=j.useState(null),[x,b]=j.useState(""),v=j.useRef(null);j.useEffect(()=>{m&&v.current&&v.current.focus()},[m]);const z=(A,C)=>{A.stopPropagation(),g(C.id),b(C.title||"Untitled Session")},T=A=>{A?.stopPropagation(),m&&x.trim()&&(l(m,x.trim()),g(null))},E=A=>{A?.stopPropagation(),g(null)},N=A=>{A.key==="Enter"?T():A.key==="Escape"&&E()};return d?f.jsxs("div",{className:"w-80 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col h-full transition-all duration-300",children:[f.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-matrix-primary/30 flex justify-between items-center bg-azure-bg dark:bg-black",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),f.jsx("button",{onClick:h,className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",children:f.jsx(vl,{size:18})})]}),f.jsx("div",{className:"p-4",children:f.jsxs("button",{onClick:a,className:"w-full flex items-center justify-center gap-2 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black py-2 px-4 rounded-lg hover:bg-azure-secondary dark:hover:bg-matrix-secondary transition-colors shadow-sm",children:[f.jsx(_0,{size:18}),f.jsx("span",{children:"New Chat"})]})}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(A=>f.jsxs("div",{onClick:()=>n(A.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===A.id?"bg-azure-hover dark:bg-matrix-primary/20 border-azure-primary dark:border-matrix-highlight":"hover:bg-gray-50 dark:hover:bg-matrix-primary/10 border-transparent"}`,children:[f.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===A.id?f.jsx("div",{className:"flex items-center gap-1 w-full",onClick:C=>C.stopPropagation(),children:f.jsx("input",{ref:v,type:"text",value:x,onChange:C=>b(C.target.value),onKeyDown:N,className:"w-full text-sm px-1 py-0.5 bg-white dark:bg-black border border-azure-primary dark:border-matrix-highlight rounded focus:outline-none dark:text-matrix-highlight"})}):f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`text-sm font-medium truncate ${t===A.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:A.title||"Untitled Session"}),f.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(A.started_at).toLocaleString()})]})}),f.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===A.id?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:T,className:"p-1.5 text-green-600 hover:bg-green-50 dark:text-matrix-highlight dark:hover:bg-matrix-primary/20 rounded",title:"Save",children:f.jsx(Bm,{size:14})}),f.jsx("button",{onClick:E,className:"p-1.5 text-red-500 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 rounded",title:"Cancel",children:f.jsx(pS,{size:14})})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:C=>z(C,A),className:"p-1.5 text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 dark:text-matrix-secondary/50 dark:hover:text-blue-400 rounded",title:"Rename",children:f.jsx(Jp,{size:14})}),f.jsx("button",{onClick:C=>{C.stopPropagation(),o(A.id)},className:"p-1.5 text-gray-400 hover:text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-900/20 dark:text-matrix-secondary/50 dark:hover:text-amber-500 rounded",title:"Archive",children:f.jsx(gN,{size:14})}),f.jsx("button",{onClick:C=>{C.stopPropagation(),u(A.id)},className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 dark:text-matrix-secondary/50 dark:hover:text-red-500 rounded",title:"Delete",children:f.jsx(Vo,{size:14})})]})})]},A.id)),e.length===0&&f.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):f.jsxs("div",{className:"w-16 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col items-center py-4 space-y-4 transition-colors duration-300",children:[f.jsx("button",{onClick:h,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",title:"Expand Sidebar",children:f.jsx(vl,{})}),f.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),f.jsx("button",{onClick:a,className:"p-3 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black rounded-full hover:bg-azure-secondary dark:hover:bg-matrix-secondary shadow-lg transition-all",title:"New Session",children:f.jsx(_0,{size:20})})]})};function lD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dD={};function ek(e,t){return(dD.jsx?cD:uD).test(e)}const fD=/[ \t\n\f\r]/g;function hD(e){return typeof e=="object"?e.type==="text"?tk(e.value):!1:tk(e)}function tk(e){return e.replace(fD,"")===""}class Vl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Vl.prototype.normal={};Vl.prototype.property={};Vl.prototype.space=void 0;function u_(e,t){const n={},a={};for(const o of e)Object.assign(n,o.property),Object.assign(a,o.normal);return new Vl(n,a,t)}function zp(e){return e.toLowerCase()}class An{constructor(t,n){this.attribute=n,this.property=t}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let mD=0;const Re=Ni(),Pt=Ni(),_p=Ni(),le=Ni(),ut=Ni(),Do=Ni(),Zn=Ni();function Ni(){return 2**++mD}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:Pt,commaOrSpaceSeparated:Zn,commaSeparated:Do,number:le,overloadedBoolean:_p,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),mm=Object.keys(jp);class Mg extends An{constructor(t,n,a,o){let u=-1;if(super(t,n),nk(this,"space",o),typeof a=="number")for(;++u<mm.length;){const l=mm[u];nk(this,mm[u],(a&jp[l])===jp[l])}}}Mg.prototype.defined=!0;function nk(e,t,n){n&&(e[t]=n)}function Qo(e){const t={},n={};for(const[a,o]of Object.entries(e.properties)){const u=new Mg(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[zp(a)]=a,n[zp(u.attribute)]=a}return new Vl(t,n,e.space)}const c_=Qo({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:ut,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:le,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:ut,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:Pt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function d_(e,t){return t in e?e[t]:t}function f_(e,t){return d_(e,t.toLowerCase())}const pD=Qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Do,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:ut,autoFocus:Re,autoPlay:Re,blocking:ut,capture:null,charSet:null,checked:Re,cite:null,className:ut,cols:le,colSpan:null,content:null,contentEditable:Pt,controls:Re,controlsList:ut,coords:le|Do,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:_p,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:ut,height:le,hidden:_p,high:le,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:ut,itemRef:ut,itemScope:Re,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,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:Re,optimum:le,pattern:null,ping:ut,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:ut,required:Re,reversed:Re,rows:le,rowSpan:le,sandbox:ut,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Re,useMap:null,value:Pt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Re,disableRemotePlayback:Re,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:f_}),gD=Qo({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:Zn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:ut,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Re,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:Do,g2:Do,glyphName:Do,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zn,rev:Zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zn,requiredFeatures:Zn,requiredFonts:Zn,requiredFormats:Zn,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:d_}),h_=Qo({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()}}),m_=Qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:f_}),p_=Qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),yD={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"},xD=/[A-Z]/g,rk=/-[a-z]/g,bD=/^data[-\w.:]+$/i;function vD(e,t){const n=zp(t);let a=t,o=An;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&bD.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(rk,wD);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!rk.test(u)){let l=u.replace(xD,kD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Mg}return new o(a,t)}function kD(e){return"-"+e.toLowerCase()}function wD(e){return e.charAt(1).toUpperCase()}const SD=u_([c_,pD,h_,m_,p_],"html"),Dg=u_([c_,gD,h_,m_,p_],"svg");function zD(e){return e.join(" ").trim()}var bo={},pm,ak;function _D(){if(ak)return pm;ak=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
20
- `,m="/",g="*",x="",b="comment",v="declaration";function z(E,N){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];N=N||{};var A=1,C=1;function $(oe){var ae=oe.match(t);ae&&(A+=ae.length);var U=oe.lastIndexOf(h);C=~U?oe.length-U:C+oe.length}function L(){var oe={line:A,column:C};return function(ae){return ae.position=new M(oe),X(),ae}}function M(oe){this.start=oe,this.end={line:A,column:C},this.source=N.source}M.prototype.content=E;function q(oe){var ae=new Error(N.source+":"+A+":"+C+": "+oe);if(ae.reason=oe,ae.filename=N.source,ae.line=A,ae.column=C,ae.source=E,!N.silent)throw ae}function V(oe){var ae=oe.exec(E);if(ae){var U=ae[0];return $(U),E=E.slice(U.length),ae}}function X(){V(n)}function ce(oe){var ae;for(oe=oe||[];ae=Q();)ae!==!1&&oe.push(ae);return oe}function Q(){var oe=L();if(!(m!=E.charAt(0)||g!=E.charAt(1))){for(var ae=2;x!=E.charAt(ae)&&(g!=E.charAt(ae)||m!=E.charAt(ae+1));)++ae;if(ae+=2,x===E.charAt(ae-1))return q("End of comment missing");var U=E.slice(2,ae-2);return C+=2,$(U),E=E.slice(ae),C+=2,oe({type:b,comment:U})}}function se(){var oe=L(),ae=V(a);if(ae){if(Q(),!V(o))return q("property missing ':'");var U=V(u),K=oe({type:v,property:T(ae[0].replace(e,x)),value:U?T(U[0].replace(e,x)):x});return V(l),K}}function te(){var oe=[];ce(oe);for(var ae;ae=se();)ae!==!1&&(oe.push(ae),ce(oe));return oe}return X(),te()}function T(E){return E?E.replace(d,x):x}return pm=z,pm}var ik;function jD(){if(ik)return bo;ik=1;var e=bo&&bo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(bo,"__esModule",{value:!0}),bo.default=n;const t=e(_D());function n(a,o){let u=null;if(!a||typeof a!="string")return u;const l=(0,t.default)(a),d=typeof o=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;d?o(m,g,h):g&&(u=u||{},u[m]=g)}),u}return bo}var el={},ok;function TD(){if(ok)return el;ok=1,Object.defineProperty(el,"__esModule",{value:!0}),el.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},l=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(o,d):m=m.replace(a,d),m.replace(t,l))};return el.camelCase=h,el}var tl,sk;function CD(){if(sk)return tl;sk=1;var e=tl&&tl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(jD()),n=TD();function a(o,u){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(d,h){d&&h&&(l[(0,n.camelCase)(d,u)]=h)}),l}return a.default=a,tl=a,tl}var ED=CD();const ND=Bp(ED),g_=y_("end"),$g=y_("start");function y_(e){return t;function t(n){const a=n&&n.position&&n.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 AD(e){const t=$g(e),n=g_(e);if(t&&n)return{start:t,end:n}}function pl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lk(e.position):"start"in e||"end"in e?lk(e):"line"in e||"column"in e?Tp(e):""}function Tp(e){return uk(e&&e.line)+":"+uk(e&&e.column)}function lk(e){return Tp(e&&e.start)+"-"+Tp(e&&e.end)}function uk(e){return e&&typeof e=="number"?e:1}class dn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let o="",u={},l=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?o=t:!u.cause&&t&&(l=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?u.ruleId=a:(u.source=a.slice(0,h),u.ruleId=a.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const d=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=pl(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=l&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const Lg={}.hasOwnProperty,OD=new Map,RD=/[A-Z]/g,MD=new Set(["table","tbody","thead","tfoot","tr"]),DD=new Set(["td","th"]),x_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $D(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=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=HD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=ID(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Dg:SD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=b_(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function b_(e,t,n){if(t.type==="element")return LD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return PD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VD(e,t,n);if(t.type==="mdxjsEsm")return UD(e,t);if(t.type==="root")return BD(e,t,n);if(t.type==="text")return ZD(e,t)}function LD(e,t,n){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Dg,e.schema=o),e.ancestors.push(t);const u=k_(e,t.tagName,!1),l=FD(e,t);let d=Ug(e,t);return MD.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!hD(h):!0})),v_(e,l,u,t),Pg(l,d),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function PD(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)}Tl(e,t.position)}function UD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tl(e,t.position)}function VD(e,t,n){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Dg,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:k_(e,t.name,!0),l=qD(e,t),d=Ug(e,t);return v_(e,l,u,t),Pg(l,d),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function BD(e,t,n){const a={};return Pg(a,Ug(e,t)),e.create(t,e.Fragment,a,n)}function ZD(e,t){return t.value}function v_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Pg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ID(e,t,n){return a;function a(o,u,l,d){const m=Array.isArray(l.children)?n:t;return d?m(u,l,d):m(u,l)}}function HD(e,t){return n;function n(a,o,u,l){const d=Array.isArray(u.children),h=$g(a);return t(o,u,l,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function FD(e,t){const n={};let a,o;for(o in t.properties)if(o!=="children"&&Lg.call(t.properties,o)){const u=GD(e,o,t.properties[o]);if(u){const[l,d]=u;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&DD.has(t.tagName)?a=d:n[l]=d}}if(a){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function qD(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const l=u.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Tl(e,t.position);else{const o=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,u=e.evaluater.evaluateExpression(d.expression)}else Tl(e,t.position);else u=a.value===null?!0:a.value;n[o]=u}return n}function Ug(e,t){const n=[];let a=-1;const o=e.passKeys?new Map:OD;for(;++a<t.children.length;){const u=t.children[a];let l;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=o.get(h)||0;l=h+"-"+m,o.set(h,m+1)}}const d=b_(e,u,l);d!==void 0&&n.push(d)}return n}function GD(e,t,n){const a=vD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?lD(n):zD(n)),a.property==="style"){let o=typeof n=="object"?n:YD(e,String(n));return e.stylePropertyNameCase==="css"&&(o=XD(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?yD[a.property]||a.property:a.attribute,n]}}function YD(e,t){try{return ND(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,o=new dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=x_+"#cannot-parse-style-attribute",o}}function k_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,l;for(;++u<o.length;){const d=ek(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(u&&d.type==="Literal"),optional:!1}:d}a=l}else a=ek(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return Lg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);Tl(e)}function Tl(e,t){const n=new dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=x_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function XD(e){const t={};let n;for(n in e)Lg.call(e,n)&&(t[KD(n)]=e[n]);return t}function KD(e){let t=e.replace(RD,JD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function JD(e){return"-"+e.toLowerCase()}const gm={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"]},QD={};function WD(e,t){const n=QD,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return w_(e,a,o)}function w_(e,t,n){if(e5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ck(e.children,t,n)}return Array.isArray(e)?ck(e,t,n):""}function ck(e,t,n){const a=[];let o=-1;for(;++o<e.length;)a[o]=w_(e[o],t,n);return a.join("")}function e5(e){return!!(e&&typeof e=="object")}const dk=document.createElement("i");function Vg(e){const t="&"+e+";";dk.innerHTML=t;const n=dk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rr(e,t,n,a){const o=e.length;let u=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,a.length<1e4)l=Array.from(a),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);u<a.length;)l=a.slice(u,u+1e4),l.unshift(t,0),e.splice(...l),u+=1e4,t+=1e4}function ar(e,t){return e.length>0?(Rr(e,e.length,0,t),e):t}const fk={}.hasOwnProperty;function t5(e){const t={};let n=-1;for(;++n<e.length;)n5(t,e[n]);return t}function n5(e,t){let n;for(n in t){const o=(fk.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let l;if(u)for(l in u){fk.call(o,l)||(o[l]=[]);const d=u[l];r5(o[l],Array.isArray(d)?d:d?[d]:[])}}}function r5(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Rr(e,0,0,a)}function S_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function $o(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tr=Ga(/[A-Za-z]/),In=Ga(/[\dA-Za-z]/),a5=Ga(/[#-'*+\--9=?A-Z^-~]/);function Cp(e){return e!==null&&(e<32||e===127)}const Ep=Ga(/\d/),i5=Ga(/[\dA-Fa-f]/),o5=Ga(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function Nn(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const s5=Ga(new RegExp("\\p{P}|\\p{S}","u")),l5=Ga(/\s/);function Ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wo(e){const t=[];let n=-1,a=0,o=0;for(;++n<e.length;){const u=e.charCodeAt(n);let l="";if(u===37&&In(e.charCodeAt(n+1))&&In(e.charCodeAt(n+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(l=String.fromCharCode(u));else if(u>55295&&u<57344){const d=e.charCodeAt(n+1);u<56320&&d>56319&&d<57344?(l=String.fromCharCode(u,d),o=1):l="�"}else l=String.fromCharCode(u);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(a)}function ct(e,t,n,a){const o=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return Ge(h)?(e.enter(n),d(h)):t(h)}function d(h){return Ge(h)&&u++<o?(e.consume(h),d):(e.exit(n),t(h))}}const u5={tokenize:c5};function c5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,o);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ct(e,t,"linePrefix")}function o(d){return e.enter("paragraph"),u(d)}function u(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Te(d)?(e.consume(d),e.exit("chunkText"),u):(e.consume(d),l)}}const d5={tokenize:f5},hk={tokenize:h5};function f5(e){const t=this,n=[];let a=0,o,u,l;return d;function d(C){if(a<n.length){const $=n[a];return t.containerState=$[1],e.attempt($[0].continuation,h,m)(C)}return m(C)}function h(C){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&A();const $=t.events.length;let L=$,M;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){M=t.events[L][1].end;break}N(a);let q=$;for(;q<t.events.length;)t.events[q][1].end={...M},q++;return Rr(t.events,L+1,0,t.events.slice($)),t.events.length=q,m(C)}return d(C)}function m(C){if(a===n.length){if(!o)return b(C);if(o.currentConstruct&&o.currentConstruct.concrete)return z(C);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hk,g,x)(C)}function g(C){return o&&A(),N(a),b(C)}function x(C){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,z(C)}function b(C){return t.containerState={},e.attempt(hk,v,z)(C)}function v(C){return a++,n.push([t.currentConstruct,t.containerState]),b(C)}function z(C){if(C===null){o&&A(),N(0),e.consume(C);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),T(C)}function T(C){if(C===null){E(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return Te(C)?(e.consume(C),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(C),T)}function E(C,$){const L=t.sliceStream(C);if($&&L.push(null),C.previous=u,u&&(u.next=C),u=C,o.defineSkip(C.start),o.write(L),t.parser.lazy[C.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<l&&(!o.events[M][1].end||o.events[M][1].end.offset>l))return;const q=t.events.length;let V=q,X,ce;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(X){ce=t.events[V][1].end;break}X=!0}for(N(a),M=q;M<t.events.length;)t.events[M][1].end={...ce},M++;Rr(t.events,V+1,0,t.events.slice(q)),t.events.length=M}}function N(C){let $=n.length;for(;$-- >C;){const L=n[$];t.containerState=L[1],L[0].exit.call(t,e)}n.length=C}function A(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function h5(e,t,n){return ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mk(e){if(e===null||Nn(e)||l5(e))return 1;if(s5(e))return 2}function Bg(e,t,n){const a=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!a.includes(u)&&(t=u(t,n),a.push(u))}return t}const Np={name:"attention",resolveAll:m5,tokenize:p5};function m5(e,t){let n=-1,a,o,u,l,d,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;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[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[a][1].end},b={...e[n][1].start};pk(x,-h),pk(b,h),l={type:h>1?"strongSequence":"emphasisSequence",start:x,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},o={type:h>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[a][1].end={...l.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=ar(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=ar(m,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=ar(m,Bg(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=ar(m,[["exit",u,t],["enter",d,t],["exit",d,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=ar(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Rr(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function p5(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,o=mk(a);let u;return l;function l(h){return u=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===u)return e.consume(h),d;const m=e.exit("attentionSequence"),g=mk(h),x=!g||g===2&&o||n.includes(h),b=!o||o===2&&g||n.includes(a);return m._open=!!(u===42?x:x&&(o||!b)),m._close=!!(u===42?b:b&&(g||!x)),t(h)}}function pk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const g5={name:"autolink",tokenize:y5};function y5(e,t,n){let a=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(v){return Tr(v)?(e.consume(v),l):v===64?n(v):m(v)}function l(v){return v===43||v===45||v===46||In(v)?(a=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||In(v))&&a++<32?(e.consume(v),d):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Cp(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),g):a5(v)?(e.consume(v),m):n(v)}function g(v){return In(v)?x(v):n(v)}function x(v){return v===46?(e.consume(v),a=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||In(v))&&a++<63){const z=v===45?b:x;return e.consume(v),z}return n(v)}}const cd={partial:!0,tokenize:x5};function x5(e,t,n){return a;function a(u){return Ge(u)?ct(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Te(u)?t(u):n(u)}}const z_={continuation:{tokenize:v5},exit:k5,name:"blockQuote",tokenize:b5};function b5(e,t,n){const a=this;return o;function o(l){if(l===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),u}return n(l)}function u(l){return Ge(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function v5(e,t,n){const a=this;return o;function o(l){return Ge(l)?ct(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt(z_,t,n)(l)}}function k5(e){e.exit("blockQuote")}const __={name:"characterEscape",tokenize:w5};function w5(e,t,n){return a;function a(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return o5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const j_={name:"characterReference",tokenize:S5};function S5(e,t,n){const a=this;let o=0,u,l;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),h}function h(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,l=In,g(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,l=i5,g):(e.enter("characterReferenceValue"),u=7,l=Ep,g(x))}function g(x){if(x===59&&o){const b=e.exit("characterReferenceValue");return l===In&&!Vg(a.sliceSerialize(b))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(x)&&o++<u?(e.consume(x),g):n(x)}}const gk={partial:!0,tokenize:_5},yk={concrete:!0,name:"codeFenced",tokenize:z5};function z5(e,t,n){const a=this,o={partial:!0,tokenize:L};let u=0,l=0,d;return h;function h(M){return m(M)}function m(M){const q=a.events[a.events.length-1];return u=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===d?(l++,e.consume(M),g):l<3?n(M):(e.exit("codeFencedFenceSequence"),Ge(M)?ct(e,x,"whitespace")(M):x(M))}function x(M){return M===null||Te(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(gk,T,$)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||Te(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(M)):Ge(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,v,"whitespace")(M)):M===96&&M===d?n(M):(e.consume(M),b)}function v(M){return M===null||Te(M)?x(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),z(M))}function z(M){return M===null||Te(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(M)):M===96&&M===d?n(M):(e.consume(M),z)}function T(M){return e.attempt(o,$,E)(M)}function E(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),N}function N(M){return u>0&&Ge(M)?ct(e,A,"linePrefix",u+1)(M):A(M)}function A(M){return M===null||Te(M)?e.check(gk,T,$)(M):(e.enter("codeFlowValue"),C(M))}function C(M){return M===null||Te(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),C)}function $(M){return e.exit("codeFenced"),t(M)}function L(M,q,V){let X=0;return ce;function ce(ae){return M.enter("lineEnding"),M.consume(ae),M.exit("lineEnding"),Q}function Q(ae){return M.enter("codeFencedFence"),Ge(ae)?ct(M,se,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):se(ae)}function se(ae){return ae===d?(M.enter("codeFencedFenceSequence"),te(ae)):V(ae)}function te(ae){return ae===d?(X++,M.consume(ae),te):X>=l?(M.exit("codeFencedFenceSequence"),Ge(ae)?ct(M,oe,"whitespace")(ae):oe(ae)):V(ae)}function oe(ae){return ae===null||Te(ae)?(M.exit("codeFencedFence"),q(ae)):V(ae)}}}function _5(e,t,n){const a=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const ym={name:"codeIndented",tokenize:T5},j5={partial:!0,tokenize:C5};function T5(e,t,n){const a=this;return o;function o(m){return e.enter("codeIndented"),ct(e,u,"linePrefix",5)(m)}function u(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(m):n(m)}function l(m){return m===null?h(m):Te(m)?e.attempt(j5,l,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function C5(e,t,n){const a=this;return o;function o(l){return a.parser.lazy[a.now().line]?n(l):Te(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ct(e,u,"linePrefix",5)(l)}function u(l){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):Te(l)?o(l):n(l)}}const E5={name:"codeText",previous:A5,resolve:N5,tokenize:O5};function N5(e){let t=e.length-4,n=3,a,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)o===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(o=a):(a===t||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),t-=a-o-2,a=o+2),o=void 0);return e}function A5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function O5(e,t,n){let a=0,o,u;return l;function l(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),a++,d):(e.exit("codeTextSequence"),h(x))}function h(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),h):x===96?(u=e.enter("codeTextSequence"),o=0,g(x)):Te(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Te(x)?(e.exit("codeTextData"),h(x)):(e.consume(x),m)}function g(x){return x===96?(e.consume(x),o++,g):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(u.type="codeTextData",m(x))}}class R5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??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,n,a){const o=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&nl(this.left,a),u.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),nl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);nl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);nl(this.left,n.reverse())}}}function nl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function T_(e){const t={};let n=-1,a,o,u,l,d,h,m;const g=new R5(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,M5(g,n)),n=t[n],m=!0);else if(a[1]._container){for(u=n,o=void 0;u--;)if(l=g.get(u),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=u);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(a[1].end={...g.get(o)[1].start},d=g.slice(o,n),d.unshift(a),g.splice(o,n-o+1,d))}}return Rr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function M5(e,t){const n=e.get(t)[1],a=e.get(t)[2];let o=t-1;const u=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,h=[],m={};let g,x,b=-1,v=n,z=0,T=0;const E=[T];for(;v;){for(;e.get(++o)[1]!==v;);u.push(o),v._tokenizer||(g=a.sliceStream(v),v.next||g.push(null),x&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),x=v,v=v.next}for(v=n;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(T=b+1,E.push(T),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),b=E.length;b--;){const N=d.slice(E[b],E[b+1]),A=u.pop();h.push([A,A+N.length-1]),e.splice(A,2,N)}for(h.reverse(),b=-1;++b<h.length;)m[z+h[b][0]]=z+h[b][1],z+=h[b][1]-h[b][0]-1;return m}const D5={resolve:L5,tokenize:P5},$5={partial:!0,tokenize:U5};function L5(e){return T_(e),e}function P5(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?u(d):Te(d)?e.check($5,l,u)(d):(e.consume(d),o)}function u(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function U5(e,t,n){const a=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ct(e,u,"linePrefix")}function u(l){if(l===null||Te(l))return n(l);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function C_(e,t,n,a,o,u,l,d,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return x;function x(N){return N===60?(e.enter(a),e.enter(o),e.enter(u),e.consume(N),e.exit(u),b):N===null||N===32||N===41||Cp(N)?n(N):(e.enter(a),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(N))}function b(N){return N===62?(e.enter(u),e.consume(N),e.exit(u),e.exit(o),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(d),b(N)):N===null||N===60||Te(N)?n(N):(e.consume(N),N===92?z:v)}function z(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function T(N){return!g&&(N===null||N===41||Nn(N))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(a),t(N)):g<m&&N===40?(e.consume(N),g++,T):N===41?(e.consume(N),g--,T):N===null||N===32||N===40||Cp(N)?n(N):(e.consume(N),N===92?E:T)}function E(N){return N===40||N===41||N===92?(e.consume(N),T):T(N)}}function E_(e,t,n,a,o,u){const l=this;let d=0,h;return m;function m(v){return e.enter(a),e.enter(o),e.consume(v),e.exit(o),e.enter(u),g}function g(v){return d>999||v===null||v===91||v===93&&!h||v===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(u),e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):Te(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||Te(v)||d++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!Ge(v)),v===92?b:x)}function b(v){return v===91||v===92||v===93?(e.consume(v),d++,x):x(v)}}function N_(e,t,n,a,o,u){let l;return d;function d(b){return b===34||b===39||b===40?(e.enter(a),e.enter(o),e.consume(b),e.exit(o),l=b===40?41:b,h):n(b)}function h(b){return b===l?(e.enter(o),e.consume(b),e.exit(o),e.exit(a),t):(e.enter(u),m(b))}function m(b){return b===l?(e.exit(u),h(l)):b===null?n(b):Te(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ct(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||Te(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?x:g)}function x(b){return b===l||b===92?(e.consume(b),g):g(b)}}function gl(e,t){let n;return a;function a(o){return Te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,a):Ge(o)?ct(e,a,n?"linePrefix":"lineSuffix")(o):t(o)}}const V5={name:"definition",tokenize:Z5},B5={partial:!0,tokenize:I5};function Z5(e,t,n){const a=this;let o;return u;function u(v){return e.enter("definition"),l(v)}function l(v){return E_.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return o=$o(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return Nn(v)?gl(e,m)(v):m(v)}function m(v){return C_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(B5,x,x)(v)}function x(v){return Ge(v)?ct(e,b,"whitespace")(v):b(v)}function b(v){return v===null||Te(v)?(e.exit("definition"),a.parser.defined.push(o),t(v)):n(v)}}function I5(e,t,n){return a;function a(d){return Nn(d)?gl(e,o)(d):n(d)}function o(d){return N_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function u(d){return Ge(d)?ct(e,l,"whitespace")(d):l(d)}function l(d){return d===null||Te(d)?t(d):n(d)}}const H5={name:"hardBreakEscape",tokenize:F5};function F5(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Te(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const q5={name:"headingAtx",resolve:G5,tokenize:Y5};function G5(e,t){let n=e.length-2,a=3,o,u;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},u={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Rr(e,a,n-a+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function Y5(e,t,n){let a=0;return o;function o(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&a++<6?(e.consume(g),l):g===null||Nn(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Te(g)?(e.exit("atxHeading"),t(g)):Ge(g)?ct(e,d,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),d(g))}function m(g){return g===null||g===35||Nn(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),m)}}const X5=["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"],xk=["pre","script","style","textarea"],K5={concrete:!0,name:"htmlFlow",resolveTo:W5,tokenize:e$},J5={partial:!0,tokenize:n$},Q5={partial:!0,tokenize:t$};function W5(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 e$(e,t,n){const a=this;let o,u,l,d,h;return m;function m(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),x}function x(w){return w===33?(e.consume(w),b):w===47?(e.consume(w),u=!0,T):w===63?(e.consume(w),o=3,a.interrupt?t:O):Tr(w)?(e.consume(w),l=String.fromCharCode(w),E):n(w)}function b(w){return w===45?(e.consume(w),o=2,v):w===91?(e.consume(w),o=5,d=0,z):Tr(w)?(e.consume(w),o=4,a.interrupt?t:O):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:O):n(w)}function z(w){const G="CDATA[";return w===G.charCodeAt(d++)?(e.consume(w),d===G.length?a.interrupt?t:se:z):n(w)}function T(w){return Tr(w)?(e.consume(w),l=String.fromCharCode(w),E):n(w)}function E(w){if(w===null||w===47||w===62||Nn(w)){const G=w===47,de=l.toLowerCase();return!G&&!u&&xk.includes(de)?(o=1,a.interrupt?t(w):se(w)):X5.includes(l.toLowerCase())?(o=6,G?(e.consume(w),N):a.interrupt?t(w):se(w)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?A(w):C(w))}return w===45||In(w)?(e.consume(w),l+=String.fromCharCode(w),E):n(w)}function N(w){return w===62?(e.consume(w),a.interrupt?t:se):n(w)}function A(w){return Ge(w)?(e.consume(w),A):ce(w)}function C(w){return w===47?(e.consume(w),ce):w===58||w===95||Tr(w)?(e.consume(w),$):Ge(w)?(e.consume(w),C):ce(w)}function $(w){return w===45||w===46||w===58||w===95||In(w)?(e.consume(w),$):L(w)}function L(w){return w===61?(e.consume(w),M):Ge(w)?(e.consume(w),L):C(w)}function M(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,q):Ge(w)?(e.consume(w),M):V(w)}function q(w){return w===h?(e.consume(w),h=null,X):w===null||Te(w)?n(w):(e.consume(w),q)}function V(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Nn(w)?L(w):(e.consume(w),V)}function X(w){return w===47||w===62||Ge(w)?C(w):n(w)}function ce(w){return w===62?(e.consume(w),Q):n(w)}function Q(w){return w===null||Te(w)?se(w):Ge(w)?(e.consume(w),Q):n(w)}function se(w){return w===45&&o===2?(e.consume(w),U):w===60&&o===1?(e.consume(w),K):w===62&&o===4?(e.consume(w),S):w===63&&o===3?(e.consume(w),O):w===93&&o===5?(e.consume(w),he):Te(w)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(J5,H,te)(w)):w===null||Te(w)?(e.exit("htmlFlowData"),te(w)):(e.consume(w),se)}function te(w){return e.check(Q5,oe,H)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ae}function ae(w){return w===null||Te(w)?te(w):(e.enter("htmlFlowData"),se(w))}function U(w){return w===45?(e.consume(w),O):se(w)}function K(w){return w===47?(e.consume(w),l="",B):se(w)}function B(w){if(w===62){const G=l.toLowerCase();return xk.includes(G)?(e.consume(w),S):se(w)}return Tr(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),B):se(w)}function he(w){return w===93?(e.consume(w),O):se(w)}function O(w){return w===62?(e.consume(w),S):w===45&&o===2?(e.consume(w),O):se(w)}function S(w){return w===null||Te(w)?(e.exit("htmlFlowData"),H(w)):(e.consume(w),S)}function H(w){return e.exit("htmlFlow"),t(w)}}function t$(e,t,n){const a=this;return o;function o(l){return Te(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u):n(l)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function n$(e,t,n){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(cd,t,n)}}const r$={name:"htmlText",tokenize:a$};function a$(e,t,n){const a=this;let o,u,l;return d;function d(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),L):O===63?(e.consume(O),C):Tr(O)?(e.consume(O),V):n(O)}function m(O){return O===45?(e.consume(O),g):O===91?(e.consume(O),u=0,z):Tr(O)?(e.consume(O),A):n(O)}function g(O){return O===45?(e.consume(O),v):n(O)}function x(O){return O===null?n(O):O===45?(e.consume(O),b):Te(O)?(l=x,K(O)):(e.consume(O),x)}function b(O){return O===45?(e.consume(O),v):x(O)}function v(O){return O===62?U(O):O===45?b(O):x(O)}function z(O){const S="CDATA[";return O===S.charCodeAt(u++)?(e.consume(O),u===S.length?T:z):n(O)}function T(O){return O===null?n(O):O===93?(e.consume(O),E):Te(O)?(l=T,K(O)):(e.consume(O),T)}function E(O){return O===93?(e.consume(O),N):T(O)}function N(O){return O===62?U(O):O===93?(e.consume(O),N):T(O)}function A(O){return O===null||O===62?U(O):Te(O)?(l=A,K(O)):(e.consume(O),A)}function C(O){return O===null?n(O):O===63?(e.consume(O),$):Te(O)?(l=C,K(O)):(e.consume(O),C)}function $(O){return O===62?U(O):C(O)}function L(O){return Tr(O)?(e.consume(O),M):n(O)}function M(O){return O===45||In(O)?(e.consume(O),M):q(O)}function q(O){return Te(O)?(l=q,K(O)):Ge(O)?(e.consume(O),q):U(O)}function V(O){return O===45||In(O)?(e.consume(O),V):O===47||O===62||Nn(O)?X(O):n(O)}function X(O){return O===47?(e.consume(O),U):O===58||O===95||Tr(O)?(e.consume(O),ce):Te(O)?(l=X,K(O)):Ge(O)?(e.consume(O),X):U(O)}function ce(O){return O===45||O===46||O===58||O===95||In(O)?(e.consume(O),ce):Q(O)}function Q(O){return O===61?(e.consume(O),se):Te(O)?(l=Q,K(O)):Ge(O)?(e.consume(O),Q):X(O)}function se(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),o=O,te):Te(O)?(l=se,K(O)):Ge(O)?(e.consume(O),se):(e.consume(O),oe)}function te(O){return O===o?(e.consume(O),o=void 0,ae):O===null?n(O):Te(O)?(l=te,K(O)):(e.consume(O),te)}function oe(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Nn(O)?X(O):(e.consume(O),oe)}function ae(O){return O===47||O===62||Nn(O)?X(O):n(O)}function U(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function K(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),B}function B(O){return Ge(O)?ct(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):he(O)}function he(O){return e.enter("htmlTextData"),l(O)}}const Zg={name:"labelEnd",resolveAll:l$,resolveTo:u$,tokenize:c$},i$={tokenize:d$},o$={tokenize:f$},s$={tokenize:h$};function l$(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",t+=o}}return e.length!==n.length&&Rr(e,0,e.length,n),e}function u$(e,t){let n=e.length,a=0,o,u,l,d;for(;n--;)if(o=e[n][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=n,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(l=n);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[u+a+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=ar(d,e.slice(u+1,u+a+3)),d=ar(d,[["enter",g,t]]),d=ar(d,Bg(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),d=ar(d,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),d=ar(d,e.slice(l+1)),d=ar(d,[["exit",h,t]]),Rr(e,u,e.length,d),e}function c$(e,t,n){const a=this;let o=a.events.length,u,l;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){u=a.events[o][1];break}return d;function d(b){return u?u._inactive?x(b):(l=a.parser.defined.includes($o(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt(i$,g,l?g:x)(b):b===91?e.attempt(o$,g,l?m:x)(b):l?g(b):x(b)}function m(b){return e.attempt(s$,g,x)(b)}function g(b){return t(b)}function x(b){return u._balanced=!0,n(b)}}function d$(e,t,n){return a;function a(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),o}function o(x){return Nn(x)?gl(e,u)(x):u(x)}function u(x){return x===41?g(x):C_(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function l(x){return Nn(x)?gl(e,h)(x):g(x)}function d(x){return n(x)}function h(x){return x===34||x===39||x===40?N_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):g(x)}function m(x){return Nn(x)?gl(e,g)(x):g(x)}function g(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function f$(e,t,n){const a=this;return o;function o(d){return E_.call(a,e,u,l,"reference","referenceMarker","referenceString")(d)}function u(d){return a.parser.defined.includes($o(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function h$(e,t,n){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const m$={name:"labelStartImage",resolveAll:Zg.resolveAll,tokenize:p$};function p$(e,t,n){const a=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),u}function u(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const g$={name:"labelStartLink",resolveAll:Zg.resolveAll,tokenize:y$};function y$(e,t,n){const a=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),u}function u(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const xm={name:"lineEnding",tokenize:x$};function x$(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const Rc={name:"thematicBreak",tokenize:b$};function b$(e,t,n){let a=0,o;return u;function u(m){return e.enter("thematicBreak"),l(m)}function l(m){return o=m,d(m)}function d(m){return m===o?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Te(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===o?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Ge(m)?ct(e,d,"whitespace")(m):d(m))}}const En={continuation:{tokenize:S$},exit:_$,name:"list",tokenize:w$},v$={partial:!0,tokenize:j$},k$={partial:!0,tokenize:z$};function w$(e,t,n){const a=this,o=a.events[a.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return d;function d(v){const z=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(z==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Ep(v)){if(a.containerState.type||(a.containerState.type=z,e.enter(z,{_container:!0})),z==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Rc,n,m)(v):m(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return Ep(v)&&++l<10?(e.consume(v),h):(!a.interrupt||l<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(cd,a.interrupt?n:g,e.attempt(v$,b,x))}function g(v){return a.containerState.initialBlankLine=!0,u++,b(v)}function x(v){return Ge(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function S$(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(cd,o,u);function o(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ct(e,t,"listItemIndent",a.containerState.size+1)(d)}function u(d){return a.containerState.furtherBlankLines||!Ge(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(k$,t,l)(d))}function l(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,ct(e,e.attempt(En,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function z$(e,t,n){const a=this;return ct(e,o,"listItemIndent",a.containerState.size+1);function o(u){const l=a.events[a.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===a.containerState.size?t(u):n(u)}}function _$(e){e.exit(this.containerState.type)}function j$(e,t,n){const a=this;return ct(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const l=a.events[a.events.length-1];return!Ge(u)&&l&&l[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const bk={name:"setextUnderline",resolveTo:T$,tokenize:C$};function T$(e,t){let n=e.length,a,o,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",l,t]),e.splice(u+1,0,["exit",e[a][1],t]),e[a][1].end={...e[u][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function C$(e,t,n){const a=this;let o;return u;function u(m){let g=a.events.length,x;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){x=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||x)?(e.enter("setextHeadingLine"),o=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===o?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Ge(m)?ct(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Te(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const E$={tokenize:N$};function N$(e){const t=this,n=e.attempt(cd,a,e.attempt(this.parser.constructs.flowInitial,o,ct(e,e.attempt(this.parser.constructs.flow,o,e.attempt(D5,o)),"linePrefix")));return n;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const A$={resolveAll:O_()},O$=A_("string"),R$=A_("text");function A_(e){return{resolveAll:O_(e==="text"?M$:void 0),tokenize:t};function t(n){const a=this,o=this.parser.constructs[e],u=n.attempt(o,l,d);return l;function l(g){return m(g)?u(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),u(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const x=o[g];let b=-1;if(x)for(;++b<x.length;){const v=x[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function O_(e){return t;function t(n,a){let o=-1,u;for(;++o<=n.length;)u===void 0?n[o]&&n[o][1].type==="data"&&(u=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==u+2&&(n[u][1].end=n[o-1][1].end,n.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(n,a):n}}function M$(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],o=t.sliceStream(a);let u=o.length,l=-1,d=0,h;for(;u--;){const m=o[u];if(typeof m=="string"){for(l=m.length;m.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(m===-2)h=!0,d++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?l:a.start._bufferIndex+l,_index:a.start._index+u,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const D$={42:En,43:En,45:En,48:En,49:En,50:En,51:En,52:En,53:En,54:En,55:En,56:En,57:En,62:z_},$$={91:V5},L$={[-2]:ym,[-1]:ym,32:ym},P$={35:q5,42:Rc,45:[bk,Rc],60:K5,61:bk,95:Rc,96:yk,126:yk},U$={38:j_,92:__},V$={[-5]:xm,[-4]:xm,[-3]:xm,33:m$,38:j_,42:Np,60:[g5,r$],91:g$,92:[H5,__],93:Zg,95:Np,96:E5},B$={null:[Np,A$]},Z$={null:[42,95]},I$={null:[]},H$=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Z$,contentInitial:$$,disable:I$,document:D$,flow:P$,flowInitial:L$,insideSpan:B$,string:U$,text:V$},Symbol.toStringTag,{value:"Module"}));function F$(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},u=[];let l=[],d=[];const h={attempt:q(L),check:q(M),consume:A,enter:C,exit:$,interrupt:q(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:T,events:[],now:z,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:x};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function x(Q){return l=ar(l,Q),E(),l[l.length-1]!==null?[]:(V(t,0),m.events=Bg(u,m.events,m),m.events)}function b(Q,se){return G$(v(Q),se)}function v(Q){return q$(l,Q)}function z(){const{_bufferIndex:Q,_index:se,line:te,column:oe,offset:ae}=a;return{_bufferIndex:Q,_index:se,line:te,column:oe,offset:ae}}function T(Q){o[Q.line]=Q.column,ce()}function E(){let Q;for(;a._index<l.length;){const se=l[a._index];if(typeof se=="string")for(Q=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===Q&&a._bufferIndex<se.length;)N(se.charCodeAt(a._bufferIndex));else N(se)}}function N(Q){g=g(Q)}function A(Q){Te(Q)?(a.line++,a.column=1,a.offset+=Q===-3?2:1,ce()):Q!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=Q}function C(Q,se){const te=se||{};return te.type=Q,te.start=z(),m.events.push(["enter",te,m]),d.push(te),te}function $(Q){const se=d.pop();return se.end=z(),m.events.push(["exit",se,m]),se}function L(Q,se){V(Q,se.from)}function M(Q,se){se.restore()}function q(Q,se){return te;function te(oe,ae,U){let K,B,he,O;return Array.isArray(oe)?H(oe):"tokenize"in oe?H([oe]):S(oe);function S(fe){return me;function me(De){const Ne=De!==null&&fe[De],kt=De!==null&&fe.null,It=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(kt)?kt:kt?[kt]:[]];return H(It)(De)}}function H(fe){return K=fe,B=0,fe.length===0?U:w(fe[B])}function w(fe){return me;function me(De){return O=X(),he=fe,fe.partial||(m.currentConstruct=fe),fe.name&&m.parser.constructs.disable.null.includes(fe.name)?de():fe.tokenize.call(se?Object.assign(Object.create(m),se):m,h,G,de)(De)}}function G(fe){return Q(he,O),ae}function de(fe){return O.restore(),++B<K.length?w(K[B]):U}}}function V(Q,se){Q.resolveAll&&!u.includes(Q)&&u.push(Q),Q.resolve&&Rr(m.events,se,m.events.length-se,Q.resolve(m.events.slice(se),m)),Q.resolveTo&&(m.events=Q.resolveTo(m.events,m))}function X(){const Q=z(),se=m.previous,te=m.currentConstruct,oe=m.events.length,ae=Array.from(d);return{from:oe,restore:U};function U(){a=Q,m.previous=se,m.currentConstruct=te,m.events.length=oe,d=ae,ce()}}function ce(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function q$(e,t){const n=t.start._index,a=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(a,u)];else{if(l=e.slice(n,o),a>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(a):l.shift()}u>0&&l.push(e[o].slice(0,u))}return l}function G$(e,t){let n=-1;const a=[];let o;for(;++n<e.length;){const u=e[n];let l;if(typeof u=="string")l=u;else switch(u){case-5:{l="\r";break}case-4:{l=`
19
+ `),()=>{$.contains(C)&&$.removeChild(C)}},[t]),f.jsx(F3,{isPresent:t,childRef:l,sizeRef:d,children:j.cloneElement(e,{ref:g})})}const G3=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:u,mode:l,anchorX:d,anchorY:h,root:m})=>{const g=rg(Y3),x=j.useId();let b=!0,v=j.useMemo(()=>(b=!1,{id:x,initial:t,isPresent:n,custom:o,onExitComplete:z=>{g.set(z,!0);for(const T of g.values())if(!T)return;a&&a()},register:z=>(g.set(z,!1),()=>g.delete(z))}),[n,g,a]);return u&&b&&(v={...v}),j.useMemo(()=>{g.forEach((z,T)=>g.set(T,!1))},[n]),j.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=f.jsx(q3,{isPresent:n,anchorX:d,anchorY:h,root:m,children:e})),f.jsx(od.Provider,{value:v,children:e})};function Y3(){return new Map}function Xz(e=!0){const t=j.useContext(od);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,u=j.useId();j.useEffect(()=>{if(e)return o(u)},[e]);const l=j.useCallback(()=>e&&a&&a(u),[u,a,e]);return!n&&a?[!1,l]:[!0]}const dc=e=>e.key||"";function V1(e){const t=[];return j.Children.forEach(e,n=>{j.isValidElement(n)&&t.push(n)}),t}const X3=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:u="sync",propagate:l=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[g,x]=Xz(l),b=j.useMemo(()=>V1(e),[e]),v=l&&!g?[]:b.map(dc),z=j.useRef(!0),T=j.useRef(b),E=rg(()=>new Map),N=j.useRef(new Set),[A,C]=j.useState(b),[$,L]=j.useState(b);TS(()=>{z.current=!1,T.current=b;for(let V=0;V<$.length;V++){const X=dc($[V]);v.includes(X)?(E.delete(X),N.current.delete(X)):E.get(X)!==!0&&E.set(X,!1)}},[$,v.length,v.join("-")]);const M=[];if(b!==A){let V=[...b];for(let X=0;X<$.length;X++){const ce=$[X],Q=dc(ce);v.includes(Q)||(V.splice(X,0,ce),M.push(ce))}return u==="wait"&&M.length&&(V=M),L(V1(V)),C(b),null}const{forceRender:q}=j.useContext(ng);return f.jsx(f.Fragment,{children:$.map(V=>{const X=dc(V),ce=l&&!g?!1:b===$||v.includes(X),Q=()=>{if(N.current.has(X))return;if(N.current.add(X),E.has(X))E.set(X,!0);else return;let se=!0;E.forEach(te=>{te||(se=!1)}),se&&(q?.(),L(T.current),l&&x?.(),a&&a())};return f.jsx(G3,{isPresent:ce,initial:!z.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:u,root:m,onExitComplete:ce?void 0:Q,anchorX:d,anchorY:h,children:V},X)})})},Kz=j.createContext({strict:!1}),B1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Z1=!1;function K3(){if(Z1)return;const e={};for(const t in B1)e[t]={isEnabled:n=>B1[t].some(a=>!!n[a])};_z(e),Z1=!0}function Jz(){return K3(),DR()}function J3(e){const t=Jz();for(const n in e)t[n]={...t[n],...e[n]};_z(t)}const Q3=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ic(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Q3.has(e)}let Qz=e=>!Ic(e);function W3(e){typeof e=="function"&&(Qz=t=>t.startsWith("on")?!Ic(t):e(t))}try{W3(require("@emotion/is-prop-valid").default)}catch{}function eM(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||(Qz(o)||n===!0&&Ic(o)||!t&&!Ic(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const ud=j.createContext({});function tM(e,t){if(ld(e)){const{initial:n,animate:a}=e;return{initial:n===!1||jl(n)?n:void 0,animate:jl(a)?a:void 0}}return e.inherit!==!1?t:{}}function nM(e){const{initial:t,animate:n}=tM(e,j.useContext(ud));return j.useMemo(()=>({initial:t,animate:n}),[I1(t),I1(n)])}function I1(e){return Array.isArray(e)?e.join(" "):e}const Og=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Wz(e,t,n){for(const a in t)!cn(t[a])&&!Oz(a,n)&&(e[a]=t[a])}function rM({transformTemplate:e},t){return j.useMemo(()=>{const n=Og();return Eg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function aM(e,t){const n=e.style||{},a={};return Wz(a,n,e),Object.assign(a,rM(e,t)),a}function iM(e,t){const n={},a=aM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const e_=()=>({...Og(),attrs:{}});function oM(e,t,n,a){const o=j.useMemo(()=>{const u=e_();return Rz(u,t,Dz(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};Wz(u,e.style,e),o.style={...u,...o.style}}return o}const sM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Rg(e){return typeof e!="string"||e.includes("-")?!1:!!(sM.indexOf(e)>-1||/[A-Z]/u.test(e))}function lM(e,t,n,{latestValues:a},o,u=!1,l){const h=(l??Rg(e)?oM:iM)(t,a,o,e),m=eM(t,typeof e=="string",u),g=e!==j.Fragment?{...m,...h,ref:n}:{},{children:x}=t,b=j.useMemo(()=>cn(x)?x.get():x,[x]);return j.createElement(e,{...g,children:b})}function uM({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:cM(n,a,o,e),renderState:t()}}function cM(e,t,n,a){const o={},u=a(e,{});for(const b in u)o[b]=Ac(u[b]);let{initial:l,animate:d}=e;const h=ld(e),m=zz(e);t&&m&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),d===void 0&&(d=t.animate));let g=n?n.initial===!1:!1;g=g||l===!1;const x=g?d:l;if(x&&typeof x!="boolean"&&!sd(x)){const b=Array.isArray(x)?x:[x];for(let v=0;v<b.length;v++){const z=wg(e,b[v]);if(z){const{transitionEnd:T,transition:E,...N}=z;for(const A in N){let C=N[A];if(Array.isArray(C)){const $=g?C.length-1:0;C=C[$]}C!==null&&(o[A]=C)}for(const A in T)o[A]=T[A]}}}return o}const t_=e=>(t,n)=>{const a=j.useContext(ud),o=j.useContext(od),u=()=>uM(e,t,a,o);return n?u():rg(u)},dM=t_({scrapeMotionValuesFromProps:Ng,createRenderState:Og}),fM=t_({scrapeMotionValuesFromProps:$z,createRenderState:e_}),hM=Symbol.for("motionComponentSymbol");function mM(e,t,n){const a=j.useRef(n);j.useInsertionEffect(()=>{a.current=n});const o=j.useRef(null);return j.useCallback(u=>{u&&e.onMount?.(u),t&&(u?t.mount(u):t.unmount());const l=a.current;if(typeof l=="function")if(u){const d=l(u);typeof d=="function"&&(o.current=d)}else o.current?(o.current(),o.current=null):l(u);else l&&(l.current=u)},[t])}const n_=j.createContext({});function ul(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function pM(e,t,n,a,o,u){const{visualElement:l}=j.useContext(ud),d=j.useContext(Kz),h=j.useContext(od),m=j.useContext(Ag).reducedMotion,g=j.useRef(null),x=j.useRef(!1);a=a||d.renderer,!g.current&&a&&(g.current=a(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,isSVG:u}),x.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const b=g.current,v=j.useContext(n_);b&&!b.projection&&o&&(b.type==="html"||b.type==="svg")&&gM(g.current,n,o,v);const z=j.useRef(!1);j.useInsertionEffect(()=>{b&&z.current&&b.update(n,h)});const T=n[cz],E=j.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return TS(()=>{x.current=!0,b&&(z.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),E.current&&b.animationState&&b.animationState.animateChanges())}),j.useEffect(()=>{b&&(!E.current&&b.animationState&&b.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),E.current=!1),b.enteringChildren=void 0)}),b}function gM(e,t,n,a){const{layoutId:o,layout:u,drag:l,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:r_(e.parent)),e.projection.setOptions({layoutId:o,layout:u,alwaysMeasureLayout:!!l||d&&ul(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function r_(e){if(e)return e.options.allowProjection!==!1?e.projection:r_(e.parent)}function um(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&J3(a);const u=n?n==="svg":Rg(e),l=u?fM:dM;function d(m,g){let x;const b={...j.useContext(Ag),...m,layoutId:yM(m)},{isStatic:v}=b,z=nM(m),T=l(m,v);if(!v&&jS){xM();const E=bM(b);x=E.MeasureLayout,z.visualElement=pM(e,T,b,o,E.ProjectionNode,u)}return f.jsxs(ud.Provider,{value:z,children:[x&&z.visualElement?f.jsx(x,{visualElement:z.visualElement,...b}):null,lM(e,m,mM(T,z.visualElement,g),T,v,t,u)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=j.forwardRef(d);return h[hM]=e,h}function yM({layoutId:e}){const t=j.useContext(ng).id;return t&&e!==void 0?t+"-"+e:e}function xM(e,t){j.useContext(Kz).strict}function bM(e){const t=Jz(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function vM(e,t){if(typeof Proxy>"u")return um;const n=new Map,a=(u,l)=>um(u,l,e,t),o=(u,l)=>a(u,l);return new Proxy(o,{get:(u,l)=>l==="create"?a:(n.has(l)||n.set(l,um(l,void 0,e,t)),n.get(l))})}const kM=(e,t)=>t.isSVG??Rg(e)?new QR(t):new qR(t,{allowProjection:e!==j.Fragment});class wM extends qa{constructor(t){super(t),t.animationState||(t.animationState=r3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();sd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let SM=0;class zM extends qa{constructor(){super(...arguments),this.id=SM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const _M={animation:{Feature:wM},exit:{Feature:zM}};function Vl(e){return{point:{x:e.pageX,y:e.pageY}}}const jM=e=>t=>jg(t)&&e(t,Vl(t));function pl(e,t,n,a){return Tl(e,t,jM(n),a)}const a_=({current:e})=>e?e.ownerDocument.defaultView:null,H1=(e,t)=>Math.abs(e-t);function TM(e,t){const n=H1(e.x,t.x),a=H1(e.y,t.y);return Math.sqrt(n**2+a**2)}const F1=new Set(["auto","scroll"]);class i_{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:u=!1,distanceThreshold:l=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=dm(this.lastMoveEventInfo,this.history),z=this.startEvent!==null,T=TM(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!z&&!T)return;const{point:E}=v,{timestamp:N}=an;this.history.push({...E,timestamp:N});const{onStart:A,onMove:C}=this.handlers;z||(A&&A(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,v)},this.handlePointerMove=(v,z)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=cm(z,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(v,z)=>{this.end();const{onEnd:T,onSessionEnd:E,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=dm(v.type==="pointercancel"?this.lastMoveEventInfo:cm(z,this.transformPagePoint),this.history);this.startEvent&&T&&T(v,A),E&&E(v,A)},!jg(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=o||window;const h=Vl(t),m=cm(h,this.transformPagePoint),{point:g}=m,{timestamp:x}=an;this.history=[{...g,timestamp:x}];const{onSessionStart:b}=n;b&&b(t,dm(m,this.history)),this.removeListeners=Ll(pl(this.contextWindow,"pointermove",this.handlePointerMove),pl(this.contextWindow,"pointerup",this.handlePointerUp),pl(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(F1.has(a.overflowX)||F1.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:o.x-n.x,y:o.y-n.y};u.x===0&&u.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(t,o),pt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Za(this.updatePoint)}}function cm(e,t){return t?{point:t(e.point)}:e}function q1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dm({point:e},t){return{point:e,delta:q1(e,o_(t)),offset:q1(e,CM(t)),velocity:EM(t,.1)}}function CM(e){return e[0]}function o_(e){return e[e.length-1]}function EM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=o_(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>ia(t)));)n--;if(!a)return{x:0,y:0};const u=or(o.timestamp-a.timestamp);if(u===0)return{x:0,y:0};const l={x:(o.x-a.x)/u,y:(o.y-a.y)/u};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function NM(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?St(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?St(n,e,a.max):Math.min(e,n)),e}function G1(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function AM(e,{top:t,left:n,bottom:a,right:o}){return{x:G1(e.x,n,o),y:G1(e.y,t,a)}}function Y1(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function OM(e,t){return{x:Y1(e.x,t.x),y:Y1(e.y,t.y)}}function RM(e,t){let n=.5;const a=vn(e),o=vn(t);return o>a?n=Sl(t.min,t.max-a,e.min):a>o&&(n=Sl(e.min,e.max-o,t.min)),Er(0,1,n)}function MM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const kp=.35;function DM(e=kp){return e===!1?e=0:e===!0&&(e=kp),{x:X1(e,"left","right"),y:X1(e,"top","bottom")}}function X1(e,t,n){return{min:K1(e,t),max:K1(e,n)}}function K1(e,t){return typeof e=="number"?e:e[t]||0}const $M=new WeakMap;class LM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Yt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const u=x=>{n?(this.stopAnimation(),this.snapToCursor(Vl(x).point)):this.pauseAnimation()},l=(x,b)=>{this.stopAnimation();const{drag:v,dragPropagation:z,onDragStart:T}=this.getProps();if(v&&!z&&(this.openDragLock&&this.openDragLock(),this.openDragLock=SR(v),!this.openDragLock))return;this.latestPointerEvent=x,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(N=>{let A=this.getAxisMotionValue(N).get()||0;if(Cr.test(A)){const{projection:C}=this.visualElement;if(C&&C.layout){const $=C.layout.layoutBox[N];$&&(A=vn($)*(parseFloat(A)/100))}}this.originPoint[N]=A}),T&&pt.postRender(()=>T(x,b)),hp(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:z,onDirectionLock:T,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:N}=b;if(z&&this.currentDirection===null){this.currentDirection=PM(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),E&&E(x,b)},h=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b,this.stop(x,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>rr(x=>this.getAnimationState(x)==="paused"&&this.getAxisMotionValue(x).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new i_(t,{onSessionStart:u,onStart:l,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:a_(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!o||!a)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:d}=this.getProps();d&&pt.postRender(()=>d(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!fc(t,o,this.currentDirection))return;const u=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=NM(l,this.constraints[t],this.elastic[t])),u.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&ul(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=AM(a.layoutBox,t):this.constraints=!1,this.elastic=DM(n),o!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&rr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=MM(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ul(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const u=VR(a,o.root,this.visualElement.getTransformPagePoint());let l=OM(o.layout.layoutBox,u);if(n){const d=n(LR(l));this.hasMutatedConstraints=!!d,d&&(l=Tz(d))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=rr(g=>{if(!fc(g,n,this.currentDirection))return;let x=h&&h[g]||{};l&&(x={min:0,max:0});const b=o?200:1e6,v=o?40:1e7,z={type:"inertia",velocity:a?t[g]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...u,...x};return this.startAxisValueAnimation(g,z)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return hp(this.visualElement,t),a.start(kg(t,a,0,n,this.visualElement,!1))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){rr(n=>{const{drag:a}=this.getProps();if(!fc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,u=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:d}=o.layout.layoutBox[n],h=u.get()||0;u.set(t[n]-St(l,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ul(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};rr(l=>{const d=this.getAxisMotionValue(l);if(d&&this.constraints!==!1){const h=d.get();o[l]=RM({min:h,max:h},this.constraints[l])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),rr(l=>{if(!fc(l,t,null))return;const d=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];d.set(St(h,m,o[l]))})}addListeners(){if(!this.visualElement.current)return;$M.set(this.visualElement,this);const t=this.visualElement.current,n=pl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),x=h.target,b=x!==t&&kz(x);m&&g&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();ul(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,u=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),pt.read(a);const l=Tl(window,"resize",()=>this.scalePositionWithinConstraints()),d=o.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(rr(g=>{const x=this.getAxisMotionValue(g);x&&(this.originPoint[g]+=h[g].translate,x.set(x.get()+h[g].translate))}),this.visualElement.render())}));return()=>{l(),n(),u(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:u=!1,dragElastic:l=kp,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:u,dragElastic:l,dragMomentum:d}}}function fc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function PM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class UM extends qa{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new LM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const J1=e=>(t,n)=>{e&&pt.postRender(()=>e(t,n))};class VM extends qa{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new i_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:a_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:J1(t),onStart:J1(n),onMove:a,onEnd:(u,l)=>{delete this.session,o&&pt.postRender(()=>o(u,l))}}}mount(){this.removePointerDownListener=pl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let fm=!1;class BM extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:u}=t;u&&(n.group&&n.group.add(u),a&&a.register&&o&&a.register(u),fm&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:u}=this.props,{projection:l}=a;return l&&(l.isPresent=u,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),fm=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==u?l.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?l.promote():l.relegate()||pt.postRender(()=>{const d=l.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),_g.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;fm=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function s_(e){const[t,n]=Xz(),a=j.useContext(ng);return f.jsx(BM,{...e,layoutGroup:a,switchLayoutGroup:j.useContext(n_),isPresent:t,safeToRemove:n})}const ZM={pan:{Feature:VM},drag:{Feature:UM,ProjectionNode:Yz,MeasureLayout:s_}};function Q1(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,u=a[o];u&&pt.postRender(()=>u(t,Vl(t)))}class IM extends qa{mount(){const{current:t}=this.node;t&&(this.unmount=zR(t,(n,a)=>(Q1(this.node,a,"Start"),o=>Q1(this.node,o,"End"))))}unmount(){}}class HM extends qa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ll(Tl(this.node.current,"focus",()=>this.onFocus()),Tl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function W1(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),u=a[o];u&&pt.postRender(()=>u(t,Vl(t)))}class FM extends qa{mount(){const{current:t}=this.node;t&&(this.unmount=TR(t,(n,a)=>(W1(this.node,a,"Start"),(o,{success:u})=>W1(this.node,o,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wp=new WeakMap,hm=new WeakMap,qM=e=>{const t=wp.get(e.target);t&&t(e)},GM=e=>{e.forEach(qM)};function YM({root:e,...t}){const n=e||document;hm.has(n)||hm.set(n,{});const a=hm.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(GM,{root:e,...t})),a[o]}function XM(e,t,n){const a=YM(t);return wp.set(e,n),a.observe(e),()=>{wp.delete(e),a.unobserve(e)}}const KM={some:0,all:1};class JM extends qa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:u}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:KM[o]},d=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:x}=this.node.getProps(),b=m?g:x;b&&b(h)};return XM(this.node.current,l,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(QM(t,n))&&this.startObserver()}unmount(){}}function QM({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WM={inView:{Feature:JM},tap:{Feature:FM},focus:{Feature:HM},hover:{Feature:IM}},eD={layout:{ProjectionNode:Yz,MeasureLayout:s_}},tD={..._M,...WM,...ZM,...eD},ot=vM(tD,kM),l_=()=>{const[e,t]=j.useState(!!localStorage.getItem("morpheus.auth.token"));return j.useEffect(()=>{const o=()=>{t(!!localStorage.getItem("morpheus.auth.token"))};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[]),{isAuthenticated:e,login:o=>{localStorage.setItem("morpheus.auth.token",o),t(!0)},logout:()=>{localStorage.removeItem("morpheus.auth.token"),t(!1),window.location.href="/login"}}};function nD({onMenuClick:e,isDark:t,toggleTheme:n}){return f.jsxs("header",{className:"lg:hidden fixed top-0 left-0 right-0 z-50 bg-azure-surface dark:bg-black border-b border-azure-border dark:border-matrix-primary/30 p-4 flex items-center justify-between",children:[f.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(_o,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight","aria-label":t?"Modo claro":"Modo escuro",children:t?f.jsx(mS,{className:"w-5 h-5"}):f.jsx(fS,{className:"w-5 h-5"})}),f.jsx("button",{onClick:e,className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-secondary","aria-label":"Abrir menu",children:f.jsx(sA,{className:"w-6 h-6"})})]})]})}const La={list:()=>ze.get("/webhooks"),get:e=>ze.get(`/webhooks/${e}`),create:e=>ze.post("/webhooks",e),update:(e,t)=>ze.put(`/webhooks/${e}`,t),delete:e=>ze.delete(`/webhooks/${e}`),listNotifications:e=>{const t=new URLSearchParams;e?.webhookId&&t.set("webhookId",e.webhookId),e?.unreadOnly&&t.set("unreadOnly","true");const n=t.toString()?`?${t}`:"";return ze.get(`/webhooks/notifications${n}`)},unreadCount:()=>ze.get("/webhooks/notifications/unread-count"),markRead:e=>ze.post("/webhooks/notifications/read",{ids:e})},Nr=({open:e,onOpenChange:t,children:n})=>e?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),f.jsx("div",{className:"relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:n})]}):null,Io=({className:e,children:t})=>f.jsx("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col ${e}`,children:f.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),Ar=({children:e})=>f.jsx("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left border-b border-azure-border dark:border-matrix-primary p-6",children:e}),Or=({className:e,children:t})=>f.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),rD=({className:e,children:t})=>f.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),ir=({className:e,variant:t="default",size:n="default",...a})=>{const d=`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 ${t==="destructive"?"bg-red-500 text-zinc-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90":t==="outline"?"border border-azure-border dark:border-matrix-primary bg-transparent hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="secondary"?"bg-azure-surface dark:bg-zinc-800 hover:bg-azure-hover dark:hover:bg-zinc-700/80 text-azure-text-primary dark:text-matrix-secondary":t==="ghost"?"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="link"?"text-azure-primary dark:text-matrix-highlight underline-offset-4 hover:underline":"bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black hover:bg-azure-primary/90 dark:hover:bg-matrix-highlight/90"} ${n==="sm"?"h-9 px-3 rounded-md":n==="lg"?"h-11 px-8 rounded-md":n==="icon"?"h-10 w-10":"h-10 px-4 py-2"} ${e||""}`;return f.jsx("button",{className:d,...a})};function aD({isOpen:e,onClose:t,onConfirm:n}){return f.jsx(Nr,{open:e,onOpenChange:t,children:f.jsxs(Io,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),f.jsxs("div",{children:[f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary mb-6",children:"Are you sure you want to restart the Morpheus agent? This will temporarily disconnect all services and channels."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[f.jsx(ir,{variant:"outline",onClick:t,children:"Cancel"}),f.jsx(ir,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const zo={list:e=>{const t=new URLSearchParams;e?.status&&t.set("status",e.status),e?.agent&&t.set("agent",e.agent),e?.origin_channel&&t.set("origin_channel",e.origin_channel),e?.session_id&&t.set("session_id",e.session_id),e?.limit&&t.set("limit",String(e.limit));const n=t.toString()?`?${t}`:"";return ze.get(`/tasks${n}`)},get:e=>ze.get(`/tasks/${e}`),stats:()=>ze.get("/tasks/stats"),retry:e=>ze.post(`/tasks/${e}/retry`,{}),cancel:e=>ze.post(`/tasks/${e}/cancel`,{})};function iD({children:e}){const t=yr(),[n,a]=j.useState(()=>{const E=localStorage.getItem("theme");return E?E==="dark":!0}),[o,u]=j.useState(!1),[l,d]=j.useState(!1),{logout:h}=l_(),{data:m}=Qt("/webhooks/notifications/unread-count",()=>La.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:x}=Qt("/tasks/stats",()=>zo.stats(),{refreshInterval:5e3}),b=(x?.pending??0)+(x?.running??0),v=async()=>{try{await ze.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(E){console.error("Failed to restart:",E),alert("Failed to restart the agent. Please try again.")}};j.useEffect(()=>{n?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[n]),j.useEffect(()=>{u(!1)},[t.pathname]);const z=[{icon:S0,label:"Dashboard",path:"/"},{icon:kl,label:"Chat",path:"/chat"},{icon:C0,label:"Zaion",path:"/zaion"},{icon:j0,label:"MCP Servers",path:"/mcp-servers"},{icon:Vm,label:"Usage Stats",path:"/stats"},{icon:$c,label:"Model Pricing",path:"/model-pricing"},{icon:_o,label:"Sati Memories",path:"/sati-memories"},{icon:Fm,label:"Webhooks",path:"/webhooks"},{icon:Im,label:"Tasks",path:"/tasks"},{icon:Ro,label:"Trinity DBs",path:"/trinity-databases"}],T=[{icon:S0,label:"Dashboard",path:"/"},{icon:kl,label:"Chat",path:"/chat"},{icon:C0,label:"Zaion",path:"/zaion"},{icon:j0,label:"MCP Servers",path:"/mcp-servers"},{icon:Vm,label:"Usage Stats",path:"/stats"},{icon:$c,label:"Model Pricing",path:"/model-pricing"},{icon:_o,label:"Sati Memories",path:"/sati-memories"},{icon:Fm,label:"Webhooks",path:"/webhooks"},{icon:Im,label:"Tasks",path:"/tasks"},{icon:Ro,label:"Trinity DBs",path:"/trinity-databases"}];return f.jsxs("div",{className:"flex flex-col h-screen bg-azure-bg dark:bg-black text-azure-text-primary dark:text-matrix-secondary font-mono overflow-hidden transition-colors duration-300",children:[f.jsx(nD,{onMenuClick:()=>u(!0),isDark:n,toggleTheme:()=>a(!n)}),f.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",f.jsxs("div",{className:"hidden lg:flex w-64 border-r border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-black flex-col shrink-0 transition-colors duration-300",children:[f.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[f.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(_o,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsx("button",{onClick:()=>a(!n),className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors",children:n?f.jsx(mS,{className:"w-4 h-4"}):f.jsx(fS,{className:"w-4 h-4"})})]}),f.jsxs("nav",{className:"flex-1 p-4 space-y-2",children:[z.map(E=>{const N=t.pathname===E.path;return f.jsxs(_r,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsx(E.icon,{className:"w-5 h-5"}),f.jsx("span",{children:E.label}),E.path==="/tasks"&&b>0&&f.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:b>99?"99+":b})]},E.path)}),f.jsxs(_r,{to:"/logs",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/logs"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsx(Hm,{className:"w-5 h-5"}),f.jsx("span",{children:"Logs"})]},"/logs"),f.jsxs(_r,{to:"/notifications",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsxs("div",{className:"relative",children:[f.jsx(vl,{className:"w-5 h-5"}),g>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),f.jsx("span",{children:"Notifications"}),g>0&&f.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]},"/notifications")]}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[f.jsx(T0,{className:"w-5 h-5"}),f.jsx("span",{children:"Restart"})]})}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:h,className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[f.jsx(z0,{className:"w-5 h-5"}),f.jsx("span",{children:"Logout"})]})})]}),f.jsx(X3,{children:o&&f.jsxs(ot.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),children:[f.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),f.jsxs(ot.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[f.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(_o,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsx("button",{onClick:()=>u(!1),className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors","aria-label":"Fechar menu",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[T.map(E=>{const N=t.pathname===E.path;return f.jsxs(_r,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[f.jsx(E.icon,{className:"w-5 h-5"}),f.jsx("span",{children:E.label}),E.path==="/tasks"&&b>0&&f.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:b>99?"99+":b})]},E.path)}),f.jsxs(_r,{to:"/logs",className:"flex items-center gap-3 px-4 py-3 rounded transition-colors hidden lg:flex hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary",onClick:()=>u(!1),children:[f.jsx(Hm,{className:"w-5 h-5"}),f.jsx("span",{children:"Logs"})]}),f.jsxs(_r,{to:"/notifications",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[f.jsxs("div",{className:"relative",children:[f.jsx(vl,{className:"w-5 h-5"}),g>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),f.jsx("span",{children:"Notifications"}),g>0&&f.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]})]}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>{d(!0),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[f.jsx(T0,{className:"w-5 h-5"}),f.jsx("span",{children:"Restart"})]})}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>{h(),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[f.jsx(z0,{className:"w-5 h-5"}),f.jsx("span",{children:"Logout"})]})})]})]})}),f.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[f.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),f.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(18,16,16,0)_50%,rgba(0,0,0,0.1)_50%),linear-gradient(90deg,rgba(0,255,0,0.03),rgba(0,255,0,0.01))] bg-[length:100%_2px,3px_100%] opacity-0 dark:opacity-20 transition-opacity duration-300"})]})]}),f.jsx(b4,{}),f.jsx(aD,{isOpen:l,onClose:()=>d(!1),onConfirm:v})]})}const oD={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},Si=({title:e,value:t,icon:n,subValue:a})=>f.jsxs(ot.div,{variants:oD,className:"border border-azure-border dark:border-matrix-primary bg-azure-surface/50 dark:bg-zinc-950/50 p-6 rounded relative overflow-hidden group hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",children:[f.jsxs("div",{className:"flex justify-between items-start mb-4",children:[f.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),f.jsx(n,{className:"w-6 h-6 text-azure-primary dark:text-matrix-primary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),f.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&f.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),Sp={fetchUsageStats:async()=>ze.get("/stats/usage"),fetchGroupedUsageStats:async()=>ze.get("/stats/usage/grouped")};function sD(){const{data:e}=Qt("/api/stats/usage",Sp.fetchUsageStats,{refreshInterval:5e3});return f.jsxs(f.Fragment,{children:[f.jsx(Si,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:sS,subValue:"Tokens processed"}),f.jsx(Si,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:lS,subValue:"Tokens generated"})]})}function lD(){const{data:e}=zS(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return f.jsxs(ot.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[f.jsxs(ot.div,{variants:n,children:[f.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight mb-2",children:"SYSTEM STATUS"}),f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"Overview of the Morpheus agent runtime."})]}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[f.jsx(Si,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:_o,subValue:e?`PID: ${e.pid}`:""}),f.jsx(Si,{title:"Uptime",value:e?_S(e.uptimeSeconds):"-",icon:ad,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),f.jsx(Si,{title:"Version",value:e?.projectVersion||"-",icon:dS,subValue:`Node ${e?.nodeVersion||"-"}`}),f.jsx(Si,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:CN,subValue:"LLM Inference Engine"}),f.jsx(Si,{title:"Model",value:e?.llmModel||"-",icon:jN,subValue:"Active Model"}),f.jsx(sD,{})]})]})}const uD=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:o,onDeleteSession:u,onRenameSession:l,isOpen:d,toggleSidebar:h})=>{const[m,g]=j.useState(null),[x,b]=j.useState(""),v=j.useRef(null);j.useEffect(()=>{m&&v.current&&v.current.focus()},[m]);const z=(A,C)=>{A.stopPropagation(),g(C.id),b(C.title||"Untitled Session")},T=A=>{A?.stopPropagation(),m&&x.trim()&&(l(m,x.trim()),g(null))},E=A=>{A?.stopPropagation(),g(null)},N=A=>{A.key==="Enter"?T():A.key==="Escape"&&E()};return d?f.jsxs("div",{className:"w-80 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col h-full transition-all duration-300",children:[f.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-matrix-primary/30 flex justify-between items-center bg-azure-bg dark:bg-black",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),f.jsx("button",{onClick:h,className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",children:f.jsx(kl,{size:18})})]}),f.jsx("div",{className:"p-4",children:f.jsxs("button",{onClick:a,className:"w-full flex items-center justify-center gap-2 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black py-2 px-4 rounded-lg hover:bg-azure-secondary dark:hover:bg-matrix-secondary transition-colors shadow-sm",children:[f.jsx(_0,{size:18}),f.jsx("span",{children:"New Chat"})]})}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(A=>f.jsxs("div",{onClick:()=>n(A.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===A.id?"bg-azure-hover dark:bg-matrix-primary/20 border-azure-primary dark:border-matrix-highlight":"hover:bg-gray-50 dark:hover:bg-matrix-primary/10 border-transparent"}`,children:[f.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===A.id?f.jsx("div",{className:"flex items-center gap-1 w-full",onClick:C=>C.stopPropagation(),children:f.jsx("input",{ref:v,type:"text",value:x,onChange:C=>b(C.target.value),onKeyDown:N,className:"w-full text-sm px-1 py-0.5 bg-white dark:bg-black border border-azure-primary dark:border-matrix-highlight rounded focus:outline-none dark:text-matrix-highlight"})}):f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`text-sm font-medium truncate ${t===A.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:A.title||"Untitled Session"}),f.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(A.started_at).toLocaleString()})]})}),f.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===A.id?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:T,className:"p-1.5 text-green-600 hover:bg-green-50 dark:text-matrix-highlight dark:hover:bg-matrix-primary/20 rounded",title:"Save",children:f.jsx(Bm,{size:14})}),f.jsx("button",{onClick:E,className:"p-1.5 text-red-500 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 rounded",title:"Cancel",children:f.jsx(pS,{size:14})})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:C=>z(C,A),className:"p-1.5 text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 dark:text-matrix-secondary/50 dark:hover:text-blue-400 rounded",title:"Rename",children:f.jsx(Jp,{size:14})}),f.jsx("button",{onClick:C=>{C.stopPropagation(),o(A.id)},className:"p-1.5 text-gray-400 hover:text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-900/20 dark:text-matrix-secondary/50 dark:hover:text-amber-500 rounded",title:"Archive",children:f.jsx(gN,{size:14})}),f.jsx("button",{onClick:C=>{C.stopPropagation(),u(A.id)},className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 dark:text-matrix-secondary/50 dark:hover:text-red-500 rounded",title:"Delete",children:f.jsx(Bo,{size:14})})]})})]},A.id)),e.length===0&&f.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):f.jsxs("div",{className:"w-16 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col items-center py-4 space-y-4 transition-colors duration-300",children:[f.jsx("button",{onClick:h,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",title:"Expand Sidebar",children:f.jsx(kl,{})}),f.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),f.jsx("button",{onClick:a,className:"p-3 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black rounded-full hover:bg-azure-secondary dark:hover:bg-matrix-secondary shadow-lg transition-all",title:"New Session",children:f.jsx(_0,{size:20})})]})};function cD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hD={};function ek(e,t){return(hD.jsx?fD:dD).test(e)}const mD=/[ \t\n\f\r]/g;function pD(e){return typeof e=="object"?e.type==="text"?tk(e.value):!1:tk(e)}function tk(e){return e.replace(mD,"")===""}class Bl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Bl.prototype.normal={};Bl.prototype.property={};Bl.prototype.space=void 0;function u_(e,t){const n={},a={};for(const o of e)Object.assign(n,o.property),Object.assign(a,o.normal);return new Bl(n,a,t)}function zp(e){return e.toLowerCase()}class An{constructor(t,n){this.attribute=n,this.property=t}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let gD=0;const Re=Ni(),Pt=Ni(),_p=Ni(),le=Ni(),ut=Ni(),$o=Ni(),Zn=Ni();function Ni(){return 2**++gD}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:Pt,commaOrSpaceSeparated:Zn,commaSeparated:$o,number:le,overloadedBoolean:_p,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),mm=Object.keys(jp);class Mg extends An{constructor(t,n,a,o){let u=-1;if(super(t,n),nk(this,"space",o),typeof a=="number")for(;++u<mm.length;){const l=mm[u];nk(this,mm[u],(a&jp[l])===jp[l])}}}Mg.prototype.defined=!0;function nk(e,t,n){n&&(e[t]=n)}function Wo(e){const t={},n={};for(const[a,o]of Object.entries(e.properties)){const u=new Mg(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[zp(a)]=a,n[zp(u.attribute)]=a}return new Bl(t,n,e.space)}const c_=Wo({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:ut,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:le,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:ut,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:Pt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function d_(e,t){return t in e?e[t]:t}function f_(e,t){return d_(e,t.toLowerCase())}const yD=Wo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$o,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:ut,autoFocus:Re,autoPlay:Re,blocking:ut,capture:null,charSet:null,checked:Re,cite:null,className:ut,cols:le,colSpan:null,content:null,contentEditable:Pt,controls:Re,controlsList:ut,coords:le|$o,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:_p,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:ut,height:le,hidden:_p,high:le,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:ut,itemRef:ut,itemScope:Re,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,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:Re,optimum:le,pattern:null,ping:ut,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:ut,required:Re,reversed:Re,rows:le,rowSpan:le,sandbox:ut,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Re,useMap:null,value:Pt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Re,disableRemotePlayback:Re,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:f_}),xD=Wo({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:Zn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:ut,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Re,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:$o,g2:$o,glyphName:$o,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zn,rev:Zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zn,requiredFeatures:Zn,requiredFonts:Zn,requiredFormats:Zn,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:d_}),h_=Wo({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()}}),m_=Wo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:f_}),p_=Wo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bD={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"},vD=/[A-Z]/g,rk=/-[a-z]/g,kD=/^data[-\w.:]+$/i;function wD(e,t){const n=zp(t);let a=t,o=An;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kD.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(rk,zD);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!rk.test(u)){let l=u.replace(vD,SD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Mg}return new o(a,t)}function SD(e){return"-"+e.toLowerCase()}function zD(e){return e.charAt(1).toUpperCase()}const _D=u_([c_,yD,h_,m_,p_],"html"),Dg=u_([c_,xD,h_,m_,p_],"svg");function jD(e){return e.join(" ").trim()}var bo={},pm,ak;function TD(){if(ak)return pm;ak=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
20
+ `,m="/",g="*",x="",b="comment",v="declaration";function z(E,N){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];N=N||{};var A=1,C=1;function $(oe){var ae=oe.match(t);ae&&(A+=ae.length);var U=oe.lastIndexOf(h);C=~U?oe.length-U:C+oe.length}function L(){var oe={line:A,column:C};return function(ae){return ae.position=new M(oe),X(),ae}}function M(oe){this.start=oe,this.end={line:A,column:C},this.source=N.source}M.prototype.content=E;function q(oe){var ae=new Error(N.source+":"+A+":"+C+": "+oe);if(ae.reason=oe,ae.filename=N.source,ae.line=A,ae.column=C,ae.source=E,!N.silent)throw ae}function V(oe){var ae=oe.exec(E);if(ae){var U=ae[0];return $(U),E=E.slice(U.length),ae}}function X(){V(n)}function ce(oe){var ae;for(oe=oe||[];ae=Q();)ae!==!1&&oe.push(ae);return oe}function Q(){var oe=L();if(!(m!=E.charAt(0)||g!=E.charAt(1))){for(var ae=2;x!=E.charAt(ae)&&(g!=E.charAt(ae)||m!=E.charAt(ae+1));)++ae;if(ae+=2,x===E.charAt(ae-1))return q("End of comment missing");var U=E.slice(2,ae-2);return C+=2,$(U),E=E.slice(ae),C+=2,oe({type:b,comment:U})}}function se(){var oe=L(),ae=V(a);if(ae){if(Q(),!V(o))return q("property missing ':'");var U=V(u),K=oe({type:v,property:T(ae[0].replace(e,x)),value:U?T(U[0].replace(e,x)):x});return V(l),K}}function te(){var oe=[];ce(oe);for(var ae;ae=se();)ae!==!1&&(oe.push(ae),ce(oe));return oe}return X(),te()}function T(E){return E?E.replace(d,x):x}return pm=z,pm}var ik;function CD(){if(ik)return bo;ik=1;var e=bo&&bo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(bo,"__esModule",{value:!0}),bo.default=n;const t=e(TD());function n(a,o){let u=null;if(!a||typeof a!="string")return u;const l=(0,t.default)(a),d=typeof o=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;d?o(m,g,h):g&&(u=u||{},u[m]=g)}),u}return bo}var tl={},ok;function ED(){if(ok)return tl;ok=1,Object.defineProperty(tl,"__esModule",{value:!0}),tl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},l=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(o,d):m=m.replace(a,d),m.replace(t,l))};return tl.camelCase=h,tl}var nl,sk;function ND(){if(sk)return nl;sk=1;var e=nl&&nl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(CD()),n=ED();function a(o,u){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(d,h){d&&h&&(l[(0,n.camelCase)(d,u)]=h)}),l}return a.default=a,nl=a,nl}var AD=ND();const OD=Bp(AD),g_=y_("end"),$g=y_("start");function y_(e){return t;function t(n){const a=n&&n.position&&n.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 RD(e){const t=$g(e),n=g_(e);if(t&&n)return{start:t,end:n}}function gl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lk(e.position):"start"in e||"end"in e?lk(e):"line"in e||"column"in e?Tp(e):""}function Tp(e){return uk(e&&e.line)+":"+uk(e&&e.column)}function lk(e){return Tp(e&&e.start)+"-"+Tp(e&&e.end)}function uk(e){return e&&typeof e=="number"?e:1}class dn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let o="",u={},l=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?o=t:!u.cause&&t&&(l=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?u.ruleId=a:(u.source=a.slice(0,h),u.ruleId=a.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const d=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=gl(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=l&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const Lg={}.hasOwnProperty,MD=new Map,DD=/[A-Z]/g,$D=new Set(["table","tbody","thead","tfoot","tr"]),LD=new Set(["td","th"]),x_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=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=qD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=FD(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Dg:_D,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=b_(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function b_(e,t,n){if(t.type==="element")return UD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return VD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ZD(e,t,n);if(t.type==="mdxjsEsm")return BD(e,t);if(t.type==="root")return ID(e,t,n);if(t.type==="text")return HD(e,t)}function UD(e,t,n){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Dg,e.schema=o),e.ancestors.push(t);const u=k_(e,t.tagName,!1),l=GD(e,t);let d=Ug(e,t);return $D.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!pD(h):!0})),v_(e,l,u,t),Pg(l,d),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function VD(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)}Cl(e,t.position)}function BD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cl(e,t.position)}function ZD(e,t,n){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Dg,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:k_(e,t.name,!0),l=YD(e,t),d=Ug(e,t);return v_(e,l,u,t),Pg(l,d),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function ID(e,t,n){const a={};return Pg(a,Ug(e,t)),e.create(t,e.Fragment,a,n)}function HD(e,t){return t.value}function v_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Pg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FD(e,t,n){return a;function a(o,u,l,d){const m=Array.isArray(l.children)?n:t;return d?m(u,l,d):m(u,l)}}function qD(e,t){return n;function n(a,o,u,l){const d=Array.isArray(u.children),h=$g(a);return t(o,u,l,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function GD(e,t){const n={};let a,o;for(o in t.properties)if(o!=="children"&&Lg.call(t.properties,o)){const u=XD(e,o,t.properties[o]);if(u){const[l,d]=u;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&LD.has(t.tagName)?a=d:n[l]=d}}if(a){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function YD(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const l=u.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Cl(e,t.position);else{const o=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,u=e.evaluater.evaluateExpression(d.expression)}else Cl(e,t.position);else u=a.value===null?!0:a.value;n[o]=u}return n}function Ug(e,t){const n=[];let a=-1;const o=e.passKeys?new Map:MD;for(;++a<t.children.length;){const u=t.children[a];let l;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=o.get(h)||0;l=h+"-"+m,o.set(h,m+1)}}const d=b_(e,u,l);d!==void 0&&n.push(d)}return n}function XD(e,t,n){const a=wD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?cD(n):jD(n)),a.property==="style"){let o=typeof n=="object"?n:KD(e,String(n));return e.stylePropertyNameCase==="css"&&(o=JD(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?bD[a.property]||a.property:a.attribute,n]}}function KD(e,t){try{return OD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,o=new dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=x_+"#cannot-parse-style-attribute",o}}function k_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,l;for(;++u<o.length;){const d=ek(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(u&&d.type==="Literal"),optional:!1}:d}a=l}else a=ek(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return Lg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);Cl(e)}function Cl(e,t){const n=new dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=x_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function JD(e){const t={};let n;for(n in e)Lg.call(e,n)&&(t[QD(n)]=e[n]);return t}function QD(e){let t=e.replace(DD,WD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WD(e){return"-"+e.toLowerCase()}const gm={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"]},e5={};function t5(e,t){const n=e5,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return w_(e,a,o)}function w_(e,t,n){if(n5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ck(e.children,t,n)}return Array.isArray(e)?ck(e,t,n):""}function ck(e,t,n){const a=[];let o=-1;for(;++o<e.length;)a[o]=w_(e[o],t,n);return a.join("")}function n5(e){return!!(e&&typeof e=="object")}const dk=document.createElement("i");function Vg(e){const t="&"+e+";";dk.innerHTML=t;const n=dk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rr(e,t,n,a){const o=e.length;let u=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,a.length<1e4)l=Array.from(a),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);u<a.length;)l=a.slice(u,u+1e4),l.unshift(t,0),e.splice(...l),u+=1e4,t+=1e4}function ar(e,t){return e.length>0?(Rr(e,e.length,0,t),e):t}const fk={}.hasOwnProperty;function r5(e){const t={};let n=-1;for(;++n<e.length;)a5(t,e[n]);return t}function a5(e,t){let n;for(n in t){const o=(fk.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let l;if(u)for(l in u){fk.call(o,l)||(o[l]=[]);const d=u[l];i5(o[l],Array.isArray(d)?d:d?[d]:[])}}}function i5(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Rr(e,0,0,a)}function S_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Lo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tr=Ga(/[A-Za-z]/),In=Ga(/[\dA-Za-z]/),o5=Ga(/[#-'*+\--9=?A-Z^-~]/);function Cp(e){return e!==null&&(e<32||e===127)}const Ep=Ga(/\d/),s5=Ga(/[\dA-Fa-f]/),l5=Ga(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function Nn(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const u5=Ga(new RegExp("\\p{P}|\\p{S}","u")),c5=Ga(/\s/);function Ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function es(e){const t=[];let n=-1,a=0,o=0;for(;++n<e.length;){const u=e.charCodeAt(n);let l="";if(u===37&&In(e.charCodeAt(n+1))&&In(e.charCodeAt(n+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(l=String.fromCharCode(u));else if(u>55295&&u<57344){const d=e.charCodeAt(n+1);u<56320&&d>56319&&d<57344?(l=String.fromCharCode(u,d),o=1):l="�"}else l=String.fromCharCode(u);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(a)}function ct(e,t,n,a){const o=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return Ge(h)?(e.enter(n),d(h)):t(h)}function d(h){return Ge(h)&&u++<o?(e.consume(h),d):(e.exit(n),t(h))}}const d5={tokenize:f5};function f5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,o);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ct(e,t,"linePrefix")}function o(d){return e.enter("paragraph"),u(d)}function u(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Te(d)?(e.consume(d),e.exit("chunkText"),u):(e.consume(d),l)}}const h5={tokenize:m5},hk={tokenize:p5};function m5(e){const t=this,n=[];let a=0,o,u,l;return d;function d(C){if(a<n.length){const $=n[a];return t.containerState=$[1],e.attempt($[0].continuation,h,m)(C)}return m(C)}function h(C){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&A();const $=t.events.length;let L=$,M;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){M=t.events[L][1].end;break}N(a);let q=$;for(;q<t.events.length;)t.events[q][1].end={...M},q++;return Rr(t.events,L+1,0,t.events.slice($)),t.events.length=q,m(C)}return d(C)}function m(C){if(a===n.length){if(!o)return b(C);if(o.currentConstruct&&o.currentConstruct.concrete)return z(C);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hk,g,x)(C)}function g(C){return o&&A(),N(a),b(C)}function x(C){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,z(C)}function b(C){return t.containerState={},e.attempt(hk,v,z)(C)}function v(C){return a++,n.push([t.currentConstruct,t.containerState]),b(C)}function z(C){if(C===null){o&&A(),N(0),e.consume(C);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),T(C)}function T(C){if(C===null){E(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return Te(C)?(e.consume(C),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(C),T)}function E(C,$){const L=t.sliceStream(C);if($&&L.push(null),C.previous=u,u&&(u.next=C),u=C,o.defineSkip(C.start),o.write(L),t.parser.lazy[C.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<l&&(!o.events[M][1].end||o.events[M][1].end.offset>l))return;const q=t.events.length;let V=q,X,ce;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(X){ce=t.events[V][1].end;break}X=!0}for(N(a),M=q;M<t.events.length;)t.events[M][1].end={...ce},M++;Rr(t.events,V+1,0,t.events.slice(q)),t.events.length=M}}function N(C){let $=n.length;for(;$-- >C;){const L=n[$];t.containerState=L[1],L[0].exit.call(t,e)}n.length=C}function A(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function p5(e,t,n){return ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mk(e){if(e===null||Nn(e)||c5(e))return 1;if(u5(e))return 2}function Bg(e,t,n){const a=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!a.includes(u)&&(t=u(t,n),a.push(u))}return t}const Np={name:"attention",resolveAll:g5,tokenize:y5};function g5(e,t){let n=-1,a,o,u,l,d,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;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[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[a][1].end},b={...e[n][1].start};pk(x,-h),pk(b,h),l={type:h>1?"strongSequence":"emphasisSequence",start:x,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},o={type:h>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[a][1].end={...l.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=ar(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=ar(m,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=ar(m,Bg(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=ar(m,[["exit",u,t],["enter",d,t],["exit",d,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=ar(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Rr(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function y5(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,o=mk(a);let u;return l;function l(h){return u=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===u)return e.consume(h),d;const m=e.exit("attentionSequence"),g=mk(h),x=!g||g===2&&o||n.includes(h),b=!o||o===2&&g||n.includes(a);return m._open=!!(u===42?x:x&&(o||!b)),m._close=!!(u===42?b:b&&(g||!x)),t(h)}}function pk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const x5={name:"autolink",tokenize:b5};function b5(e,t,n){let a=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(v){return Tr(v)?(e.consume(v),l):v===64?n(v):m(v)}function l(v){return v===43||v===45||v===46||In(v)?(a=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||In(v))&&a++<32?(e.consume(v),d):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Cp(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),g):o5(v)?(e.consume(v),m):n(v)}function g(v){return In(v)?x(v):n(v)}function x(v){return v===46?(e.consume(v),a=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||In(v))&&a++<63){const z=v===45?b:x;return e.consume(v),z}return n(v)}}const cd={partial:!0,tokenize:v5};function v5(e,t,n){return a;function a(u){return Ge(u)?ct(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Te(u)?t(u):n(u)}}const z_={continuation:{tokenize:w5},exit:S5,name:"blockQuote",tokenize:k5};function k5(e,t,n){const a=this;return o;function o(l){if(l===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),u}return n(l)}function u(l){return Ge(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function w5(e,t,n){const a=this;return o;function o(l){return Ge(l)?ct(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt(z_,t,n)(l)}}function S5(e){e.exit("blockQuote")}const __={name:"characterEscape",tokenize:z5};function z5(e,t,n){return a;function a(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return l5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const j_={name:"characterReference",tokenize:_5};function _5(e,t,n){const a=this;let o=0,u,l;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),h}function h(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,l=In,g(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,l=s5,g):(e.enter("characterReferenceValue"),u=7,l=Ep,g(x))}function g(x){if(x===59&&o){const b=e.exit("characterReferenceValue");return l===In&&!Vg(a.sliceSerialize(b))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(x)&&o++<u?(e.consume(x),g):n(x)}}const gk={partial:!0,tokenize:T5},yk={concrete:!0,name:"codeFenced",tokenize:j5};function j5(e,t,n){const a=this,o={partial:!0,tokenize:L};let u=0,l=0,d;return h;function h(M){return m(M)}function m(M){const q=a.events[a.events.length-1];return u=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===d?(l++,e.consume(M),g):l<3?n(M):(e.exit("codeFencedFenceSequence"),Ge(M)?ct(e,x,"whitespace")(M):x(M))}function x(M){return M===null||Te(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(gk,T,$)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||Te(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(M)):Ge(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,v,"whitespace")(M)):M===96&&M===d?n(M):(e.consume(M),b)}function v(M){return M===null||Te(M)?x(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),z(M))}function z(M){return M===null||Te(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(M)):M===96&&M===d?n(M):(e.consume(M),z)}function T(M){return e.attempt(o,$,E)(M)}function E(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),N}function N(M){return u>0&&Ge(M)?ct(e,A,"linePrefix",u+1)(M):A(M)}function A(M){return M===null||Te(M)?e.check(gk,T,$)(M):(e.enter("codeFlowValue"),C(M))}function C(M){return M===null||Te(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),C)}function $(M){return e.exit("codeFenced"),t(M)}function L(M,q,V){let X=0;return ce;function ce(ae){return M.enter("lineEnding"),M.consume(ae),M.exit("lineEnding"),Q}function Q(ae){return M.enter("codeFencedFence"),Ge(ae)?ct(M,se,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):se(ae)}function se(ae){return ae===d?(M.enter("codeFencedFenceSequence"),te(ae)):V(ae)}function te(ae){return ae===d?(X++,M.consume(ae),te):X>=l?(M.exit("codeFencedFenceSequence"),Ge(ae)?ct(M,oe,"whitespace")(ae):oe(ae)):V(ae)}function oe(ae){return ae===null||Te(ae)?(M.exit("codeFencedFence"),q(ae)):V(ae)}}}function T5(e,t,n){const a=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const ym={name:"codeIndented",tokenize:E5},C5={partial:!0,tokenize:N5};function E5(e,t,n){const a=this;return o;function o(m){return e.enter("codeIndented"),ct(e,u,"linePrefix",5)(m)}function u(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(m):n(m)}function l(m){return m===null?h(m):Te(m)?e.attempt(C5,l,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function N5(e,t,n){const a=this;return o;function o(l){return a.parser.lazy[a.now().line]?n(l):Te(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ct(e,u,"linePrefix",5)(l)}function u(l){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):Te(l)?o(l):n(l)}}const A5={name:"codeText",previous:R5,resolve:O5,tokenize:M5};function O5(e){let t=e.length-4,n=3,a,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)o===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(o=a):(a===t||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),t-=a-o-2,a=o+2),o=void 0);return e}function R5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M5(e,t,n){let a=0,o,u;return l;function l(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),a++,d):(e.exit("codeTextSequence"),h(x))}function h(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),h):x===96?(u=e.enter("codeTextSequence"),o=0,g(x)):Te(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Te(x)?(e.exit("codeTextData"),h(x)):(e.consume(x),m)}function g(x){return x===96?(e.consume(x),o++,g):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(u.type="codeTextData",m(x))}}class D5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??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,n,a){const o=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&rl(this.left,a),u.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),rl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),rl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);rl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);rl(this.left,n.reverse())}}}function rl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function T_(e){const t={};let n=-1,a,o,u,l,d,h,m;const g=new D5(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,$5(g,n)),n=t[n],m=!0);else if(a[1]._container){for(u=n,o=void 0;u--;)if(l=g.get(u),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=u);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(a[1].end={...g.get(o)[1].start},d=g.slice(o,n),d.unshift(a),g.splice(o,n-o+1,d))}}return Rr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function $5(e,t){const n=e.get(t)[1],a=e.get(t)[2];let o=t-1;const u=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,h=[],m={};let g,x,b=-1,v=n,z=0,T=0;const E=[T];for(;v;){for(;e.get(++o)[1]!==v;);u.push(o),v._tokenizer||(g=a.sliceStream(v),v.next||g.push(null),x&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),x=v,v=v.next}for(v=n;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(T=b+1,E.push(T),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),b=E.length;b--;){const N=d.slice(E[b],E[b+1]),A=u.pop();h.push([A,A+N.length-1]),e.splice(A,2,N)}for(h.reverse(),b=-1;++b<h.length;)m[z+h[b][0]]=z+h[b][1],z+=h[b][1]-h[b][0]-1;return m}const L5={resolve:U5,tokenize:V5},P5={partial:!0,tokenize:B5};function U5(e){return T_(e),e}function V5(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?u(d):Te(d)?e.check(P5,l,u)(d):(e.consume(d),o)}function u(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function B5(e,t,n){const a=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ct(e,u,"linePrefix")}function u(l){if(l===null||Te(l))return n(l);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function C_(e,t,n,a,o,u,l,d,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return x;function x(N){return N===60?(e.enter(a),e.enter(o),e.enter(u),e.consume(N),e.exit(u),b):N===null||N===32||N===41||Cp(N)?n(N):(e.enter(a),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(N))}function b(N){return N===62?(e.enter(u),e.consume(N),e.exit(u),e.exit(o),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(d),b(N)):N===null||N===60||Te(N)?n(N):(e.consume(N),N===92?z:v)}function z(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function T(N){return!g&&(N===null||N===41||Nn(N))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(a),t(N)):g<m&&N===40?(e.consume(N),g++,T):N===41?(e.consume(N),g--,T):N===null||N===32||N===40||Cp(N)?n(N):(e.consume(N),N===92?E:T)}function E(N){return N===40||N===41||N===92?(e.consume(N),T):T(N)}}function E_(e,t,n,a,o,u){const l=this;let d=0,h;return m;function m(v){return e.enter(a),e.enter(o),e.consume(v),e.exit(o),e.enter(u),g}function g(v){return d>999||v===null||v===91||v===93&&!h||v===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(u),e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):Te(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||Te(v)||d++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!Ge(v)),v===92?b:x)}function b(v){return v===91||v===92||v===93?(e.consume(v),d++,x):x(v)}}function N_(e,t,n,a,o,u){let l;return d;function d(b){return b===34||b===39||b===40?(e.enter(a),e.enter(o),e.consume(b),e.exit(o),l=b===40?41:b,h):n(b)}function h(b){return b===l?(e.enter(o),e.consume(b),e.exit(o),e.exit(a),t):(e.enter(u),m(b))}function m(b){return b===l?(e.exit(u),h(l)):b===null?n(b):Te(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ct(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||Te(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?x:g)}function x(b){return b===l||b===92?(e.consume(b),g):g(b)}}function yl(e,t){let n;return a;function a(o){return Te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,a):Ge(o)?ct(e,a,n?"linePrefix":"lineSuffix")(o):t(o)}}const Z5={name:"definition",tokenize:H5},I5={partial:!0,tokenize:F5};function H5(e,t,n){const a=this;let o;return u;function u(v){return e.enter("definition"),l(v)}function l(v){return E_.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return o=Lo(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return Nn(v)?yl(e,m)(v):m(v)}function m(v){return C_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(I5,x,x)(v)}function x(v){return Ge(v)?ct(e,b,"whitespace")(v):b(v)}function b(v){return v===null||Te(v)?(e.exit("definition"),a.parser.defined.push(o),t(v)):n(v)}}function F5(e,t,n){return a;function a(d){return Nn(d)?yl(e,o)(d):n(d)}function o(d){return N_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function u(d){return Ge(d)?ct(e,l,"whitespace")(d):l(d)}function l(d){return d===null||Te(d)?t(d):n(d)}}const q5={name:"hardBreakEscape",tokenize:G5};function G5(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Te(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const Y5={name:"headingAtx",resolve:X5,tokenize:K5};function X5(e,t){let n=e.length-2,a=3,o,u;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},u={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Rr(e,a,n-a+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function K5(e,t,n){let a=0;return o;function o(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&a++<6?(e.consume(g),l):g===null||Nn(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Te(g)?(e.exit("atxHeading"),t(g)):Ge(g)?ct(e,d,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),d(g))}function m(g){return g===null||g===35||Nn(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),m)}}const J5=["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"],xk=["pre","script","style","textarea"],Q5={concrete:!0,name:"htmlFlow",resolveTo:t$,tokenize:n$},W5={partial:!0,tokenize:a$},e$={partial:!0,tokenize:r$};function t$(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 n$(e,t,n){const a=this;let o,u,l,d,h;return m;function m(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),x}function x(w){return w===33?(e.consume(w),b):w===47?(e.consume(w),u=!0,T):w===63?(e.consume(w),o=3,a.interrupt?t:O):Tr(w)?(e.consume(w),l=String.fromCharCode(w),E):n(w)}function b(w){return w===45?(e.consume(w),o=2,v):w===91?(e.consume(w),o=5,d=0,z):Tr(w)?(e.consume(w),o=4,a.interrupt?t:O):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:O):n(w)}function z(w){const G="CDATA[";return w===G.charCodeAt(d++)?(e.consume(w),d===G.length?a.interrupt?t:se:z):n(w)}function T(w){return Tr(w)?(e.consume(w),l=String.fromCharCode(w),E):n(w)}function E(w){if(w===null||w===47||w===62||Nn(w)){const G=w===47,de=l.toLowerCase();return!G&&!u&&xk.includes(de)?(o=1,a.interrupt?t(w):se(w)):J5.includes(l.toLowerCase())?(o=6,G?(e.consume(w),N):a.interrupt?t(w):se(w)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?A(w):C(w))}return w===45||In(w)?(e.consume(w),l+=String.fromCharCode(w),E):n(w)}function N(w){return w===62?(e.consume(w),a.interrupt?t:se):n(w)}function A(w){return Ge(w)?(e.consume(w),A):ce(w)}function C(w){return w===47?(e.consume(w),ce):w===58||w===95||Tr(w)?(e.consume(w),$):Ge(w)?(e.consume(w),C):ce(w)}function $(w){return w===45||w===46||w===58||w===95||In(w)?(e.consume(w),$):L(w)}function L(w){return w===61?(e.consume(w),M):Ge(w)?(e.consume(w),L):C(w)}function M(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,q):Ge(w)?(e.consume(w),M):V(w)}function q(w){return w===h?(e.consume(w),h=null,X):w===null||Te(w)?n(w):(e.consume(w),q)}function V(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Nn(w)?L(w):(e.consume(w),V)}function X(w){return w===47||w===62||Ge(w)?C(w):n(w)}function ce(w){return w===62?(e.consume(w),Q):n(w)}function Q(w){return w===null||Te(w)?se(w):Ge(w)?(e.consume(w),Q):n(w)}function se(w){return w===45&&o===2?(e.consume(w),U):w===60&&o===1?(e.consume(w),K):w===62&&o===4?(e.consume(w),S):w===63&&o===3?(e.consume(w),O):w===93&&o===5?(e.consume(w),he):Te(w)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(W5,H,te)(w)):w===null||Te(w)?(e.exit("htmlFlowData"),te(w)):(e.consume(w),se)}function te(w){return e.check(e$,oe,H)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ae}function ae(w){return w===null||Te(w)?te(w):(e.enter("htmlFlowData"),se(w))}function U(w){return w===45?(e.consume(w),O):se(w)}function K(w){return w===47?(e.consume(w),l="",B):se(w)}function B(w){if(w===62){const G=l.toLowerCase();return xk.includes(G)?(e.consume(w),S):se(w)}return Tr(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),B):se(w)}function he(w){return w===93?(e.consume(w),O):se(w)}function O(w){return w===62?(e.consume(w),S):w===45&&o===2?(e.consume(w),O):se(w)}function S(w){return w===null||Te(w)?(e.exit("htmlFlowData"),H(w)):(e.consume(w),S)}function H(w){return e.exit("htmlFlow"),t(w)}}function r$(e,t,n){const a=this;return o;function o(l){return Te(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u):n(l)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function a$(e,t,n){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(cd,t,n)}}const i$={name:"htmlText",tokenize:o$};function o$(e,t,n){const a=this;let o,u,l;return d;function d(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),L):O===63?(e.consume(O),C):Tr(O)?(e.consume(O),V):n(O)}function m(O){return O===45?(e.consume(O),g):O===91?(e.consume(O),u=0,z):Tr(O)?(e.consume(O),A):n(O)}function g(O){return O===45?(e.consume(O),v):n(O)}function x(O){return O===null?n(O):O===45?(e.consume(O),b):Te(O)?(l=x,K(O)):(e.consume(O),x)}function b(O){return O===45?(e.consume(O),v):x(O)}function v(O){return O===62?U(O):O===45?b(O):x(O)}function z(O){const S="CDATA[";return O===S.charCodeAt(u++)?(e.consume(O),u===S.length?T:z):n(O)}function T(O){return O===null?n(O):O===93?(e.consume(O),E):Te(O)?(l=T,K(O)):(e.consume(O),T)}function E(O){return O===93?(e.consume(O),N):T(O)}function N(O){return O===62?U(O):O===93?(e.consume(O),N):T(O)}function A(O){return O===null||O===62?U(O):Te(O)?(l=A,K(O)):(e.consume(O),A)}function C(O){return O===null?n(O):O===63?(e.consume(O),$):Te(O)?(l=C,K(O)):(e.consume(O),C)}function $(O){return O===62?U(O):C(O)}function L(O){return Tr(O)?(e.consume(O),M):n(O)}function M(O){return O===45||In(O)?(e.consume(O),M):q(O)}function q(O){return Te(O)?(l=q,K(O)):Ge(O)?(e.consume(O),q):U(O)}function V(O){return O===45||In(O)?(e.consume(O),V):O===47||O===62||Nn(O)?X(O):n(O)}function X(O){return O===47?(e.consume(O),U):O===58||O===95||Tr(O)?(e.consume(O),ce):Te(O)?(l=X,K(O)):Ge(O)?(e.consume(O),X):U(O)}function ce(O){return O===45||O===46||O===58||O===95||In(O)?(e.consume(O),ce):Q(O)}function Q(O){return O===61?(e.consume(O),se):Te(O)?(l=Q,K(O)):Ge(O)?(e.consume(O),Q):X(O)}function se(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),o=O,te):Te(O)?(l=se,K(O)):Ge(O)?(e.consume(O),se):(e.consume(O),oe)}function te(O){return O===o?(e.consume(O),o=void 0,ae):O===null?n(O):Te(O)?(l=te,K(O)):(e.consume(O),te)}function oe(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Nn(O)?X(O):(e.consume(O),oe)}function ae(O){return O===47||O===62||Nn(O)?X(O):n(O)}function U(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function K(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),B}function B(O){return Ge(O)?ct(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):he(O)}function he(O){return e.enter("htmlTextData"),l(O)}}const Zg={name:"labelEnd",resolveAll:c$,resolveTo:d$,tokenize:f$},s$={tokenize:h$},l$={tokenize:m$},u$={tokenize:p$};function c$(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",t+=o}}return e.length!==n.length&&Rr(e,0,e.length,n),e}function d$(e,t){let n=e.length,a=0,o,u,l,d;for(;n--;)if(o=e[n][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=n,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(l=n);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[u+a+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=ar(d,e.slice(u+1,u+a+3)),d=ar(d,[["enter",g,t]]),d=ar(d,Bg(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),d=ar(d,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),d=ar(d,e.slice(l+1)),d=ar(d,[["exit",h,t]]),Rr(e,u,e.length,d),e}function f$(e,t,n){const a=this;let o=a.events.length,u,l;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){u=a.events[o][1];break}return d;function d(b){return u?u._inactive?x(b):(l=a.parser.defined.includes(Lo(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt(s$,g,l?g:x)(b):b===91?e.attempt(l$,g,l?m:x)(b):l?g(b):x(b)}function m(b){return e.attempt(u$,g,x)(b)}function g(b){return t(b)}function x(b){return u._balanced=!0,n(b)}}function h$(e,t,n){return a;function a(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),o}function o(x){return Nn(x)?yl(e,u)(x):u(x)}function u(x){return x===41?g(x):C_(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function l(x){return Nn(x)?yl(e,h)(x):g(x)}function d(x){return n(x)}function h(x){return x===34||x===39||x===40?N_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):g(x)}function m(x){return Nn(x)?yl(e,g)(x):g(x)}function g(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function m$(e,t,n){const a=this;return o;function o(d){return E_.call(a,e,u,l,"reference","referenceMarker","referenceString")(d)}function u(d){return a.parser.defined.includes(Lo(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function p$(e,t,n){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const g$={name:"labelStartImage",resolveAll:Zg.resolveAll,tokenize:y$};function y$(e,t,n){const a=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),u}function u(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const x$={name:"labelStartLink",resolveAll:Zg.resolveAll,tokenize:b$};function b$(e,t,n){const a=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),u}function u(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const xm={name:"lineEnding",tokenize:v$};function v$(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const Rc={name:"thematicBreak",tokenize:k$};function k$(e,t,n){let a=0,o;return u;function u(m){return e.enter("thematicBreak"),l(m)}function l(m){return o=m,d(m)}function d(m){return m===o?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Te(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===o?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Ge(m)?ct(e,d,"whitespace")(m):d(m))}}const En={continuation:{tokenize:_$},exit:T$,name:"list",tokenize:z$},w$={partial:!0,tokenize:C$},S$={partial:!0,tokenize:j$};function z$(e,t,n){const a=this,o=a.events[a.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return d;function d(v){const z=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(z==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Ep(v)){if(a.containerState.type||(a.containerState.type=z,e.enter(z,{_container:!0})),z==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Rc,n,m)(v):m(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return Ep(v)&&++l<10?(e.consume(v),h):(!a.interrupt||l<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(cd,a.interrupt?n:g,e.attempt(w$,b,x))}function g(v){return a.containerState.initialBlankLine=!0,u++,b(v)}function x(v){return Ge(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function _$(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(cd,o,u);function o(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ct(e,t,"listItemIndent",a.containerState.size+1)(d)}function u(d){return a.containerState.furtherBlankLines||!Ge(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(S$,t,l)(d))}function l(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,ct(e,e.attempt(En,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function j$(e,t,n){const a=this;return ct(e,o,"listItemIndent",a.containerState.size+1);function o(u){const l=a.events[a.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===a.containerState.size?t(u):n(u)}}function T$(e){e.exit(this.containerState.type)}function C$(e,t,n){const a=this;return ct(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const l=a.events[a.events.length-1];return!Ge(u)&&l&&l[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const bk={name:"setextUnderline",resolveTo:E$,tokenize:N$};function E$(e,t){let n=e.length,a,o,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",l,t]),e.splice(u+1,0,["exit",e[a][1],t]),e[a][1].end={...e[u][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function N$(e,t,n){const a=this;let o;return u;function u(m){let g=a.events.length,x;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){x=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||x)?(e.enter("setextHeadingLine"),o=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===o?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Ge(m)?ct(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Te(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const A$={tokenize:O$};function O$(e){const t=this,n=e.attempt(cd,a,e.attempt(this.parser.constructs.flowInitial,o,ct(e,e.attempt(this.parser.constructs.flow,o,e.attempt(L5,o)),"linePrefix")));return n;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const R$={resolveAll:O_()},M$=A_("string"),D$=A_("text");function A_(e){return{resolveAll:O_(e==="text"?$$:void 0),tokenize:t};function t(n){const a=this,o=this.parser.constructs[e],u=n.attempt(o,l,d);return l;function l(g){return m(g)?u(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),u(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const x=o[g];let b=-1;if(x)for(;++b<x.length;){const v=x[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function O_(e){return t;function t(n,a){let o=-1,u;for(;++o<=n.length;)u===void 0?n[o]&&n[o][1].type==="data"&&(u=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==u+2&&(n[u][1].end=n[o-1][1].end,n.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(n,a):n}}function $$(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],o=t.sliceStream(a);let u=o.length,l=-1,d=0,h;for(;u--;){const m=o[u];if(typeof m=="string"){for(l=m.length;m.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(m===-2)h=!0,d++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?l:a.start._bufferIndex+l,_index:a.start._index+u,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const L$={42:En,43:En,45:En,48:En,49:En,50:En,51:En,52:En,53:En,54:En,55:En,56:En,57:En,62:z_},P$={91:Z5},U$={[-2]:ym,[-1]:ym,32:ym},V$={35:Y5,42:Rc,45:[bk,Rc],60:Q5,61:bk,95:Rc,96:yk,126:yk},B$={38:j_,92:__},Z$={[-5]:xm,[-4]:xm,[-3]:xm,33:g$,38:j_,42:Np,60:[x5,i$],91:x$,92:[q5,__],93:Zg,95:Np,96:A5},I$={null:[Np,R$]},H$={null:[42,95]},F$={null:[]},q$=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:H$,contentInitial:P$,disable:F$,document:L$,flow:V$,flowInitial:U$,insideSpan:I$,string:B$,text:Z$},Symbol.toStringTag,{value:"Module"}));function G$(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},u=[];let l=[],d=[];const h={attempt:q(L),check:q(M),consume:A,enter:C,exit:$,interrupt:q(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:T,events:[],now:z,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:x};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function x(Q){return l=ar(l,Q),E(),l[l.length-1]!==null?[]:(V(t,0),m.events=Bg(u,m.events,m),m.events)}function b(Q,se){return X$(v(Q),se)}function v(Q){return Y$(l,Q)}function z(){const{_bufferIndex:Q,_index:se,line:te,column:oe,offset:ae}=a;return{_bufferIndex:Q,_index:se,line:te,column:oe,offset:ae}}function T(Q){o[Q.line]=Q.column,ce()}function E(){let Q;for(;a._index<l.length;){const se=l[a._index];if(typeof se=="string")for(Q=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===Q&&a._bufferIndex<se.length;)N(se.charCodeAt(a._bufferIndex));else N(se)}}function N(Q){g=g(Q)}function A(Q){Te(Q)?(a.line++,a.column=1,a.offset+=Q===-3?2:1,ce()):Q!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=Q}function C(Q,se){const te=se||{};return te.type=Q,te.start=z(),m.events.push(["enter",te,m]),d.push(te),te}function $(Q){const se=d.pop();return se.end=z(),m.events.push(["exit",se,m]),se}function L(Q,se){V(Q,se.from)}function M(Q,se){se.restore()}function q(Q,se){return te;function te(oe,ae,U){let K,B,he,O;return Array.isArray(oe)?H(oe):"tokenize"in oe?H([oe]):S(oe);function S(fe){return me;function me(De){const Ne=De!==null&&fe[De],kt=De!==null&&fe.null,It=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(kt)?kt:kt?[kt]:[]];return H(It)(De)}}function H(fe){return K=fe,B=0,fe.length===0?U:w(fe[B])}function w(fe){return me;function me(De){return O=X(),he=fe,fe.partial||(m.currentConstruct=fe),fe.name&&m.parser.constructs.disable.null.includes(fe.name)?de():fe.tokenize.call(se?Object.assign(Object.create(m),se):m,h,G,de)(De)}}function G(fe){return Q(he,O),ae}function de(fe){return O.restore(),++B<K.length?w(K[B]):U}}}function V(Q,se){Q.resolveAll&&!u.includes(Q)&&u.push(Q),Q.resolve&&Rr(m.events,se,m.events.length-se,Q.resolve(m.events.slice(se),m)),Q.resolveTo&&(m.events=Q.resolveTo(m.events,m))}function X(){const Q=z(),se=m.previous,te=m.currentConstruct,oe=m.events.length,ae=Array.from(d);return{from:oe,restore:U};function U(){a=Q,m.previous=se,m.currentConstruct=te,m.events.length=oe,d=ae,ce()}}function ce(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function Y$(e,t){const n=t.start._index,a=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(a,u)];else{if(l=e.slice(n,o),a>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(a):l.shift()}u>0&&l.push(e[o].slice(0,u))}return l}function X$(e,t){let n=-1;const a=[];let o;for(;++n<e.length;){const u=e[n];let l;if(typeof u=="string")l=u;else switch(u){case-5:{l="\r";break}case-4:{l=`
21
21
  `;break}case-3:{l=`\r
22
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(u)}o=u===-2,a.push(l)}return a.join("")}function Y$(e){const a={constructs:t5([H$,...(e||{}).extensions||[]]),content:o(u5),defined:[],document:o(d5),flow:o(E$),lazy:{},string:o(O$),text:o(R$)};return a;function o(u){return l;function l(d){return F$(a,u,d)}}}function X$(e){for(;!T_(e););return e}const vk=/[\0\t\n\r]/g;function K$(){let e=1,t="",n=!0,a;return o;function o(u,l,d){const h=[];let m,g,x,b,v;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(l||void 0).decode(u)),x=0,t="",n&&(u.charCodeAt(0)===65279&&x++,n=void 0);x<u.length;){if(vk.lastIndex=x,m=vk.exec(u),b=m&&m.index!==void 0?m.index:u.length,v=u.charCodeAt(b),!m){t=u.slice(x);break}if(v===10&&x===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),x<b&&(h.push(u.slice(x,b)),e+=b-x),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}x=b+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const J$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Q$(e){return e.replace(J$,W$)}function W$(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),u=o===120||o===88;return S_(n.slice(u?2:1),u?16:10)}return Vg(n)||e}const R_={}.hasOwnProperty;function e6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),t6(n)(X$(Y$(n).document().write(K$()(e,t,!0))))}function t6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Qe),autolinkProtocol:X,autolinkEmail:X,atxHeading:u(Fn),blockQuote:u(kt),characterEscape:X,characterReference:X,codeFenced:u(It),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(It,l),codeText:u(fn,l),codeTextData:X,data:X,codeFlowValue:X,definition:u(st),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(wt),hardBreakEscape:u(Ie),hardBreakTrailing:u(Ie),htmlFlow:u(rt,l),htmlFlowData:X,htmlText:u(rt,l),htmlTextData:X,image:u(dt),label:l,link:u(Qe),listItem:u(qn),listItemValue:b,listOrdered:u(Xt,x),listUnordered:u(Xt),paragraph:u(At),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(Fn),strong:u(Ht),thematicBreak:u(Ri)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:Ne,autolinkProtocol:De,blockQuote:h(),characterEscapeValue:ce,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:me,codeFenced:h(E),codeFencedFence:T,codeFencedFenceInfo:v,codeFencedFenceMeta:z,codeFlowValue:ce,codeIndented:h(N),codeText:h(ae),codeTextData:ce,data:ce,definition:h(),definitionDestinationString:$,definitionLabelString:A,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(se),hardBreakTrailing:h(se),htmlFlow:h(te),htmlFlowData:ce,htmlText:h(oe),htmlTextData:ce,image:h(K),label:he,labelText:B,lineEnding:Q,link:h(U),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:G,resourceDestinationString:O,resourceTitleString:S,resource:H,setextHeading:h(V),setextHeadingLineSequence:q,setextHeadingText:M,strong:h(),thematicBreak:h()}};M_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let ue={type:"root",children:[]};const be={stack:[ue],tokenStack:[],config:t,enter:d,exit:m,buffer:l,resume:g,data:n},je=[];let Be=-1;for(;++Be<W.length;)if(W[Be][1].type==="listOrdered"||W[Be][1].type==="listUnordered")if(W[Be][0]==="enter")je.push(Be);else{const hn=je.pop();Be=o(W,hn,Be)}for(Be=-1;++Be<W.length;){const hn=t[W[Be][0]];R_.call(hn,W[Be][1].type)&&hn[W[Be][1].type].call(Object.assign({sliceSerialize:W[Be][2].sliceSerialize},be),W[Be][1])}if(be.tokenStack.length>0){const hn=be.tokenStack[be.tokenStack.length-1];(hn[1]||kk).call(be,void 0,hn[0])}for(ue.position={start:Ra(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ra(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)ue=t.transforms[Be](ue)||ue;return ue}function o(W,ue,be){let je=ue-1,Be=-1,hn=!1,Rn,mn,Ft,kn;for(;++je<=be;){const at=W[je];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?Be++:Be--,kn=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(Rn&&!kn&&!Be&&!Ft&&(Ft=je),kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kn=void 0}if(!Be&&at[0]==="enter"&&at[1].type==="listItemPrefix"||Be===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(Rn){let la=je;for(mn=void 0;la--;){const cr=W[la];if(cr[1].type==="lineEnding"||cr[1].type==="lineEndingBlank"){if(cr[0]==="exit")continue;mn&&(W[mn][1].type="lineEndingBlank",hn=!0),cr[1].type="lineEnding",mn=la}else if(!(cr[1].type==="linePrefix"||cr[1].type==="blockQuotePrefix"||cr[1].type==="blockQuotePrefixWhitespace"||cr[1].type==="blockQuoteMarker"||cr[1].type==="listItemIndent"))break}Ft&&(!mn||Ft<mn)&&(Rn._spread=!0),Rn.end=Object.assign({},mn?W[mn][1].start:at[1].end),W.splice(mn||je,0,["exit",Rn,at[2]]),je++,be++}if(at[1].type==="listItemPrefix"){const la={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};Rn=la,W.splice(je,0,["enter",la,at[2]]),je++,be++,Ft=void 0,kn=!0}}}return W[ue][1]._spread=hn,be}function u(W,ue){return be;function be(je){d.call(this,W(je),je),ue&&ue.call(this,je)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(W,ue,be){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([ue,be||void 0]),W.position={start:Ra(ue.start),end:void 0}}function h(W){return ue;function ue(be){W&&W.call(this,be),m.call(this,be)}}function m(W,ue){const be=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==W.type&&(ue?ue.call(this,W,je[0]):(je[1]||kk).call(this,W,je[0]));else throw new Error("Cannot close `"+W.type+"` ("+pl({start:W.start,end:W.end})+"): it’s not open");be.position.end=Ra(W.end)}function g(){return WD(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function b(W){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function v(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=W}function z(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=W}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W.replace(/(\r?\n|\r)$/g,"")}function A(W){const ue=this.resume(),be=this.stack[this.stack.length-1];be.label=ue,be.identifier=$o(this.sliceSerialize(W)).toLowerCase()}function C(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.title=W}function $(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.url=W}function L(W){const ue=this.stack[this.stack.length-1];if(!ue.depth){const be=this.sliceSerialize(W).length;ue.depth=be}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function q(W){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function X(W){const be=this.stack[this.stack.length-1].children;let je=be[be.length-1];(!je||je.type!=="text")&&(je=ft(),je.position={start:Ra(W.start),end:void 0},be.push(je)),this.stack.push(je)}function ce(W){const ue=this.stack.pop();ue.value+=this.sliceSerialize(W),ue.position.end=Ra(W.end)}function Q(W){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=ue.children[ue.children.length-1];be.position.end=Ra(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(X.call(this,W),ce.call(this,W))}function se(){this.data.atHardBreak=!0}function te(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W}function oe(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W}function ae(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W}function U(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ue,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function K(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ue,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function B(W){const ue=this.sliceSerialize(W),be=this.stack[this.stack.length-2];be.label=Q$(ue),be.identifier=$o(ue).toLowerCase()}function he(){const W=this.stack[this.stack.length-1],ue=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const je=W.children;be.children=je}else be.alt=ue}function O(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.url=W}function S(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.title=W}function H(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function G(W){const ue=this.resume(),be=this.stack[this.stack.length-1];be.label=ue,be.identifier=$o(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function de(W){this.data.characterReferenceType=W.type}function fe(W){const ue=this.sliceSerialize(W),be=this.data.characterReferenceType;let je;be?(je=S_(ue,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Vg(ue);const Be=this.stack[this.stack.length-1];Be.value+=je}function me(W){const ue=this.stack.pop();ue.position.end=Ra(W.end)}function De(W){ce.call(this,W);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(W)}function Ne(W){ce.call(this,W);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(W)}function kt(){return{type:"blockquote",children:[]}}function It(){return{type:"code",lang:null,meta:null,value:""}}function fn(){return{type:"inlineCode",value:""}}function st(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wt(){return{type:"emphasis",children:[]}}function Fn(){return{type:"heading",depth:0,children:[]}}function Ie(){return{type:"break"}}function rt(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function Xt(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function qn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function At(){return{type:"paragraph",children:[]}}function Ht(){return{type:"strong",children:[]}}function ft(){return{type:"text",value:""}}function Ri(){return{type:"thematicBreak"}}}function Ra(e){return{line:e.line,column:e.column,offset:e.offset}}function M_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?M_(e,a):n6(e,a)}}function n6(e,t){let n;for(n in t)if(R_.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function kk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pl({start:t.start,end:t.end})+") is still open")}function r6(e){const t=this;t.parser=n;function n(a){return e6(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function a6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function i6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
23
- `}]}function o6(e,t){const n=t.value?t.value+`
24
- `:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function s6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=Wo(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let l,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=u+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function c6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function D_(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=a:o.push({type:"text",value:a}),o}function f6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return D_(e,t);const o={src:Wo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function h6(e,t){const n={src:Wo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function m6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function p6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return D_(e,t);const o={href:Wo(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function g6(e,t){const n={href:Wo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function y6(e,t,n){const a=e.all(t),o=n?x6(n):$_(t),u={},l=[];if(typeof t.checked=="boolean"){const g=a[0];let x;g&&g.type==="element"&&g.tagName==="p"?x=g:(x={type:"element",tagName:"p",properties:{},children:[]},a.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const g=a[d];(o||d!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
22
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(u)}o=u===-2,a.push(l)}return a.join("")}function K$(e){const a={constructs:r5([q$,...(e||{}).extensions||[]]),content:o(d5),defined:[],document:o(h5),flow:o(A$),lazy:{},string:o(M$),text:o(D$)};return a;function o(u){return l;function l(d){return G$(a,u,d)}}}function J$(e){for(;!T_(e););return e}const vk=/[\0\t\n\r]/g;function Q$(){let e=1,t="",n=!0,a;return o;function o(u,l,d){const h=[];let m,g,x,b,v;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(l||void 0).decode(u)),x=0,t="",n&&(u.charCodeAt(0)===65279&&x++,n=void 0);x<u.length;){if(vk.lastIndex=x,m=vk.exec(u),b=m&&m.index!==void 0?m.index:u.length,v=u.charCodeAt(b),!m){t=u.slice(x);break}if(v===10&&x===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),x<b&&(h.push(u.slice(x,b)),e+=b-x),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}x=b+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const W$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e6(e){return e.replace(W$,t6)}function t6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),u=o===120||o===88;return S_(n.slice(u?2:1),u?16:10)}return Vg(n)||e}const R_={}.hasOwnProperty;function n6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),r6(n)(J$(K$(n).document().write(Q$()(e,t,!0))))}function r6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Qe),autolinkProtocol:X,autolinkEmail:X,atxHeading:u(Fn),blockQuote:u(kt),characterEscape:X,characterReference:X,codeFenced:u(It),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(It,l),codeText:u(fn,l),codeTextData:X,data:X,codeFlowValue:X,definition:u(st),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(wt),hardBreakEscape:u(Ie),hardBreakTrailing:u(Ie),htmlFlow:u(rt,l),htmlFlowData:X,htmlText:u(rt,l),htmlTextData:X,image:u(dt),label:l,link:u(Qe),listItem:u(qn),listItemValue:b,listOrdered:u(Xt,x),listUnordered:u(Xt),paragraph:u(At),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(Fn),strong:u(Ht),thematicBreak:u(Ri)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:Ne,autolinkProtocol:De,blockQuote:h(),characterEscapeValue:ce,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:me,codeFenced:h(E),codeFencedFence:T,codeFencedFenceInfo:v,codeFencedFenceMeta:z,codeFlowValue:ce,codeIndented:h(N),codeText:h(ae),codeTextData:ce,data:ce,definition:h(),definitionDestinationString:$,definitionLabelString:A,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(se),hardBreakTrailing:h(se),htmlFlow:h(te),htmlFlowData:ce,htmlText:h(oe),htmlTextData:ce,image:h(K),label:he,labelText:B,lineEnding:Q,link:h(U),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:G,resourceDestinationString:O,resourceTitleString:S,resource:H,setextHeading:h(V),setextHeadingLineSequence:q,setextHeadingText:M,strong:h(),thematicBreak:h()}};M_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let ue={type:"root",children:[]};const be={stack:[ue],tokenStack:[],config:t,enter:d,exit:m,buffer:l,resume:g,data:n},je=[];let Be=-1;for(;++Be<W.length;)if(W[Be][1].type==="listOrdered"||W[Be][1].type==="listUnordered")if(W[Be][0]==="enter")je.push(Be);else{const hn=je.pop();Be=o(W,hn,Be)}for(Be=-1;++Be<W.length;){const hn=t[W[Be][0]];R_.call(hn,W[Be][1].type)&&hn[W[Be][1].type].call(Object.assign({sliceSerialize:W[Be][2].sliceSerialize},be),W[Be][1])}if(be.tokenStack.length>0){const hn=be.tokenStack[be.tokenStack.length-1];(hn[1]||kk).call(be,void 0,hn[0])}for(ue.position={start:Ra(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ra(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)ue=t.transforms[Be](ue)||ue;return ue}function o(W,ue,be){let je=ue-1,Be=-1,hn=!1,Rn,mn,Ft,kn;for(;++je<=be;){const at=W[je];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?Be++:Be--,kn=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(Rn&&!kn&&!Be&&!Ft&&(Ft=je),kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kn=void 0}if(!Be&&at[0]==="enter"&&at[1].type==="listItemPrefix"||Be===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(Rn){let la=je;for(mn=void 0;la--;){const cr=W[la];if(cr[1].type==="lineEnding"||cr[1].type==="lineEndingBlank"){if(cr[0]==="exit")continue;mn&&(W[mn][1].type="lineEndingBlank",hn=!0),cr[1].type="lineEnding",mn=la}else if(!(cr[1].type==="linePrefix"||cr[1].type==="blockQuotePrefix"||cr[1].type==="blockQuotePrefixWhitespace"||cr[1].type==="blockQuoteMarker"||cr[1].type==="listItemIndent"))break}Ft&&(!mn||Ft<mn)&&(Rn._spread=!0),Rn.end=Object.assign({},mn?W[mn][1].start:at[1].end),W.splice(mn||je,0,["exit",Rn,at[2]]),je++,be++}if(at[1].type==="listItemPrefix"){const la={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};Rn=la,W.splice(je,0,["enter",la,at[2]]),je++,be++,Ft=void 0,kn=!0}}}return W[ue][1]._spread=hn,be}function u(W,ue){return be;function be(je){d.call(this,W(je),je),ue&&ue.call(this,je)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(W,ue,be){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([ue,be||void 0]),W.position={start:Ra(ue.start),end:void 0}}function h(W){return ue;function ue(be){W&&W.call(this,be),m.call(this,be)}}function m(W,ue){const be=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==W.type&&(ue?ue.call(this,W,je[0]):(je[1]||kk).call(this,W,je[0]));else throw new Error("Cannot close `"+W.type+"` ("+gl({start:W.start,end:W.end})+"): it’s not open");be.position.end=Ra(W.end)}function g(){return t5(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function b(W){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function v(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=W}function z(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=W}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W.replace(/(\r?\n|\r)$/g,"")}function A(W){const ue=this.resume(),be=this.stack[this.stack.length-1];be.label=ue,be.identifier=Lo(this.sliceSerialize(W)).toLowerCase()}function C(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.title=W}function $(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.url=W}function L(W){const ue=this.stack[this.stack.length-1];if(!ue.depth){const be=this.sliceSerialize(W).length;ue.depth=be}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function q(W){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function X(W){const be=this.stack[this.stack.length-1].children;let je=be[be.length-1];(!je||je.type!=="text")&&(je=ft(),je.position={start:Ra(W.start),end:void 0},be.push(je)),this.stack.push(je)}function ce(W){const ue=this.stack.pop();ue.value+=this.sliceSerialize(W),ue.position.end=Ra(W.end)}function Q(W){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=ue.children[ue.children.length-1];be.position.end=Ra(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(X.call(this,W),ce.call(this,W))}function se(){this.data.atHardBreak=!0}function te(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W}function oe(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W}function ae(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.value=W}function U(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ue,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function K(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ue,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function B(W){const ue=this.sliceSerialize(W),be=this.stack[this.stack.length-2];be.label=e6(ue),be.identifier=Lo(ue).toLowerCase()}function he(){const W=this.stack[this.stack.length-1],ue=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const je=W.children;be.children=je}else be.alt=ue}function O(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.url=W}function S(){const W=this.resume(),ue=this.stack[this.stack.length-1];ue.title=W}function H(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function G(W){const ue=this.resume(),be=this.stack[this.stack.length-1];be.label=ue,be.identifier=Lo(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function de(W){this.data.characterReferenceType=W.type}function fe(W){const ue=this.sliceSerialize(W),be=this.data.characterReferenceType;let je;be?(je=S_(ue,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Vg(ue);const Be=this.stack[this.stack.length-1];Be.value+=je}function me(W){const ue=this.stack.pop();ue.position.end=Ra(W.end)}function De(W){ce.call(this,W);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(W)}function Ne(W){ce.call(this,W);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(W)}function kt(){return{type:"blockquote",children:[]}}function It(){return{type:"code",lang:null,meta:null,value:""}}function fn(){return{type:"inlineCode",value:""}}function st(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wt(){return{type:"emphasis",children:[]}}function Fn(){return{type:"heading",depth:0,children:[]}}function Ie(){return{type:"break"}}function rt(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function Xt(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function qn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function At(){return{type:"paragraph",children:[]}}function Ht(){return{type:"strong",children:[]}}function ft(){return{type:"text",value:""}}function Ri(){return{type:"thematicBreak"}}}function Ra(e){return{line:e.line,column:e.column,offset:e.offset}}function M_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?M_(e,a):a6(e,a)}}function a6(e,t){let n;for(n in t)if(R_.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function kk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+gl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+gl({start:t.start,end:t.end})+") is still open")}function i6(e){const t=this;t.parser=n;function n(a){return n6(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function o6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function s6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
23
+ `}]}function l6(e,t){const n=t.value?t.value+`
24
+ `:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function u6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=es(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let l,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=u+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function f6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function h6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function D_(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=a:o.push({type:"text",value:a}),o}function m6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return D_(e,t);const o={src:es(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function p6(e,t){const n={src:es(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function g6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function y6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return D_(e,t);const o={href:es(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function x6(e,t){const n={href:es(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function b6(e,t,n){const a=e.all(t),o=n?v6(n):$_(t),u={},l=[];if(typeof t.checked=="boolean"){const g=a[0];let x;g&&g.type==="element"&&g.tagName==="p"?x=g:(x={type:"element",tagName:"p",properties:{},children:[]},a.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const g=a[d];(o||d!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
25
25
  `}),g.type==="element"&&g.tagName==="p"&&!o?l.push(...g.children):l.push(g)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
26
- `});const m={type:"element",tagName:"li",properties:u,children:l};return e.patch(t,m),e.applyData(t,m)}function x6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=$_(n[a])}return t}function $_(e){const t=e.spread;return t??e.children.length>1}function b6(e,t){const n={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<a.length;){const l=a[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function v6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function w6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S6(e,t){const n=e.all(t),a=n.shift(),o=[];if(a){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=$g(t.children[1]),h=g_(t.children[t.children.length-1]);d&&h&&(l.position={start:d,end:h}),o.push(l)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,u),e.applyData(t,u)}function z6(e,t,n){const a=n?n.children:void 0,u=(a?a.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const x=t.children[h],b={},v=l?l[h]:void 0;v&&(b.align=v);let z={type:"element",tagName:u,properties:b,children:[]};x&&(z.children=e.all(x),e.patch(x,z),z=e.applyData(x,z)),m.push(z)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function _6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const wk=9,Sk=32;function j6(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),o=0;const u=[];for(;a;)u.push(zk(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=n.exec(t);return u.push(zk(t.slice(o),o>0,!1)),u.join("")}function zk(e,t,n){let a=0,o=e.length;if(t){let u=e.codePointAt(a);for(;u===wk||u===Sk;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(o-1);for(;u===wk||u===Sk;)o--,u=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function T6(e,t){const n={type:"text",value:j6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function C6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const E6={blockquote:a6,break:i6,code:o6,delete:s6,emphasis:l6,footnoteReference:u6,heading:c6,html:d6,imageReference:f6,image:h6,inlineCode:m6,linkReference:p6,link:g6,listItem:y6,list:b6,paragraph:v6,root:k6,strong:w6,table:S6,tableCell:_6,tableRow:z6,text:T6,thematicBreak:C6,toml:fc,yaml:fc,definition:fc,footnoteDefinition:fc};function fc(){}const L_=-1,dd=0,yl=1,Hc=2,Ig=3,Hg=4,Fg=5,qg=6,P_=7,U_=8,_k=typeof self=="object"?self:globalThis,N6=(e,t)=>{const n=(o,u)=>(e.set(u,o),o),a=o=>{if(e.has(o))return e.get(o);const[u,l]=t[o];switch(u){case dd:case L_:return n(l,o);case yl:{const d=n([],o);for(const h of l)d.push(a(h));return d}case Hc:{const d=n({},o);for(const[h,m]of l)d[a(h)]=a(m);return d}case Ig:return n(new Date(l),o);case Hg:{const{source:d,flags:h}=l;return n(new RegExp(d,h),o)}case Fg:{const d=n(new Map,o);for(const[h,m]of l)d.set(a(h),a(m));return d}case qg:{const d=n(new Set,o);for(const h of l)d.add(a(h));return d}case P_:{const{name:d,message:h}=l;return n(new _k[d](h),o)}case U_:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(new _k[u](l),o)};return a},jk=e=>N6(new Map,e)(0),vo="",{toString:A6}={},{keys:O6}=Object,rl=e=>{const t=typeof e;if(t!=="object"||!e)return[dd,t];const n=A6.call(e).slice(8,-1);switch(n){case"Array":return[yl,vo];case"Object":return[Hc,vo];case"Date":return[Ig,vo];case"RegExp":return[Hg,vo];case"Map":return[Fg,vo];case"Set":return[qg,vo];case"DataView":return[yl,n]}return n.includes("Array")?[yl,n]:n.includes("Error")?[P_,n]:[Hc,n]},hc=([e,t])=>e===dd&&(t==="function"||t==="symbol"),R6=(e,t,n,a)=>{const o=(l,d)=>{const h=a.push(l)-1;return n.set(d,h),h},u=l=>{if(n.has(l))return n.get(l);let[d,h]=rl(l);switch(d){case dd:{let g=l;switch(h){case"bigint":d=U_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([L_],l)}return o([d,g],l)}case yl:{if(h){let b=l;return h==="DataView"?b=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(l)),o([h,[...b]],l)}const g=[],x=o([d,g],l);for(const b of l)g.push(u(b));return x}case Hc:{if(h)switch(h){case"BigInt":return o([h,l.toString()],l);case"Boolean":case"Number":case"String":return o([h,l.valueOf()],l)}if(t&&"toJSON"in l)return u(l.toJSON());const g=[],x=o([d,g],l);for(const b of O6(l))(e||!hc(rl(l[b])))&&g.push([u(b),u(l[b])]);return x}case Ig:return o([d,l.toISOString()],l);case Hg:{const{source:g,flags:x}=l;return o([d,{source:g,flags:x}],l)}case Fg:{const g=[],x=o([d,g],l);for(const[b,v]of l)(e||!(hc(rl(b))||hc(rl(v))))&&g.push([u(b),u(v)]);return x}case qg:{const g=[],x=o([d,g],l);for(const b of l)(e||!hc(rl(b)))&&g.push(u(b));return x}}const{message:m}=l;return o([d,{name:h,message:m}],l)};return u},Tk=(e,{json:t,lossy:n}={})=>{const a=[];return R6(!(t||n),!!t,new Map,a)(e),a},Fc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jk(Tk(e,t)):structuredClone(e):(e,t)=>jk(Tk(e,t));function M6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function D6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||M6,a=e.options.footnoteBackLabel||D6,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),x=String(m.identifier).toUpperCase(),b=Wo(x.toLowerCase());let v=0;const z=[],T=e.footnoteCounts.get(x);for(;T!==void 0&&++v<=T;){z.length>0&&z.push({type:"text",value:" "});let A=typeof n=="string"?n:n(h,v);typeof A=="string"&&(A={type:"text",value:A}),z.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...z)}else g.push(...z);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(m,N),d.push(N)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Fc(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
26
+ `});const m={type:"element",tagName:"li",properties:u,children:l};return e.patch(t,m),e.applyData(t,m)}function v6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=$_(n[a])}return t}function $_(e){const t=e.spread;return t??e.children.length>1}function k6(e,t){const n={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<a.length;){const l=a[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function w6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function z6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _6(e,t){const n=e.all(t),a=n.shift(),o=[];if(a){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=$g(t.children[1]),h=g_(t.children[t.children.length-1]);d&&h&&(l.position={start:d,end:h}),o.push(l)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,u),e.applyData(t,u)}function j6(e,t,n){const a=n?n.children:void 0,u=(a?a.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const x=t.children[h],b={},v=l?l[h]:void 0;v&&(b.align=v);let z={type:"element",tagName:u,properties:b,children:[]};x&&(z.children=e.all(x),e.patch(x,z),z=e.applyData(x,z)),m.push(z)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function T6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const wk=9,Sk=32;function C6(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),o=0;const u=[];for(;a;)u.push(zk(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=n.exec(t);return u.push(zk(t.slice(o),o>0,!1)),u.join("")}function zk(e,t,n){let a=0,o=e.length;if(t){let u=e.codePointAt(a);for(;u===wk||u===Sk;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(o-1);for(;u===wk||u===Sk;)o--,u=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function E6(e,t){const n={type:"text",value:C6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function N6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const A6={blockquote:o6,break:s6,code:l6,delete:u6,emphasis:c6,footnoteReference:d6,heading:f6,html:h6,imageReference:m6,image:p6,inlineCode:g6,linkReference:y6,link:x6,listItem:b6,list:k6,paragraph:w6,root:S6,strong:z6,table:_6,tableCell:T6,tableRow:j6,text:E6,thematicBreak:N6,toml:hc,yaml:hc,definition:hc,footnoteDefinition:hc};function hc(){}const L_=-1,dd=0,xl=1,Hc=2,Ig=3,Hg=4,Fg=5,qg=6,P_=7,U_=8,_k=typeof self=="object"?self:globalThis,O6=(e,t)=>{const n=(o,u)=>(e.set(u,o),o),a=o=>{if(e.has(o))return e.get(o);const[u,l]=t[o];switch(u){case dd:case L_:return n(l,o);case xl:{const d=n([],o);for(const h of l)d.push(a(h));return d}case Hc:{const d=n({},o);for(const[h,m]of l)d[a(h)]=a(m);return d}case Ig:return n(new Date(l),o);case Hg:{const{source:d,flags:h}=l;return n(new RegExp(d,h),o)}case Fg:{const d=n(new Map,o);for(const[h,m]of l)d.set(a(h),a(m));return d}case qg:{const d=n(new Set,o);for(const h of l)d.add(a(h));return d}case P_:{const{name:d,message:h}=l;return n(new _k[d](h),o)}case U_:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(new _k[u](l),o)};return a},jk=e=>O6(new Map,e)(0),vo="",{toString:R6}={},{keys:M6}=Object,al=e=>{const t=typeof e;if(t!=="object"||!e)return[dd,t];const n=R6.call(e).slice(8,-1);switch(n){case"Array":return[xl,vo];case"Object":return[Hc,vo];case"Date":return[Ig,vo];case"RegExp":return[Hg,vo];case"Map":return[Fg,vo];case"Set":return[qg,vo];case"DataView":return[xl,n]}return n.includes("Array")?[xl,n]:n.includes("Error")?[P_,n]:[Hc,n]},mc=([e,t])=>e===dd&&(t==="function"||t==="symbol"),D6=(e,t,n,a)=>{const o=(l,d)=>{const h=a.push(l)-1;return n.set(d,h),h},u=l=>{if(n.has(l))return n.get(l);let[d,h]=al(l);switch(d){case dd:{let g=l;switch(h){case"bigint":d=U_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([L_],l)}return o([d,g],l)}case xl:{if(h){let b=l;return h==="DataView"?b=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(l)),o([h,[...b]],l)}const g=[],x=o([d,g],l);for(const b of l)g.push(u(b));return x}case Hc:{if(h)switch(h){case"BigInt":return o([h,l.toString()],l);case"Boolean":case"Number":case"String":return o([h,l.valueOf()],l)}if(t&&"toJSON"in l)return u(l.toJSON());const g=[],x=o([d,g],l);for(const b of M6(l))(e||!mc(al(l[b])))&&g.push([u(b),u(l[b])]);return x}case Ig:return o([d,l.toISOString()],l);case Hg:{const{source:g,flags:x}=l;return o([d,{source:g,flags:x}],l)}case Fg:{const g=[],x=o([d,g],l);for(const[b,v]of l)(e||!(mc(al(b))||mc(al(v))))&&g.push([u(b),u(v)]);return x}case qg:{const g=[],x=o([d,g],l);for(const b of l)(e||!mc(al(b)))&&g.push(u(b));return x}}const{message:m}=l;return o([d,{name:h,message:m}],l)};return u},Tk=(e,{json:t,lossy:n}={})=>{const a=[];return D6(!(t||n),!!t,new Map,a)(e),a},Fc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jk(Tk(e,t)):structuredClone(e):(e,t)=>jk(Tk(e,t));function $6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function L6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function P6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$6,a=e.options.footnoteBackLabel||L6,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),x=String(m.identifier).toUpperCase(),b=es(x.toLowerCase());let v=0;const z=[],T=e.footnoteCounts.get(x);for(;T!==void 0&&++v<=T;){z.length>0&&z.push({type:"text",value:" "});let A=typeof n=="string"?n:n(h,v);typeof A=="string"&&(A={type:"text",value:A}),z.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...z)}else g.push(...z);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(m,N),d.push(N)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Fc(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
27
27
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
28
- `}]}}const V_=(function(e){if(e==null)return V6;if(typeof e=="function")return fd(e);if(typeof e=="object")return Array.isArray(e)?L6(e):P6(e);if(typeof e=="string")return U6(e);throw new Error("Expected function, string, or object as test")});function L6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=V_(e[n]);return fd(a);function a(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function P6(e){const t=e;return fd(n);function n(a){const o=a;let u;for(u in e)if(o[u]!==t[u])return!1;return!0}}function U6(e){return fd(t);function t(n){return n&&n.type===e}}function fd(e){return t;function t(n,a,o){return!!(B6(n)&&e.call(this,n,typeof a=="number"?a:void 0,o||void 0))}}function V6(){return!0}function B6(e){return e!==null&&typeof e=="object"&&"type"in e}const B_=[],Z6=!0,Ck=!1,I6="skip";function H6(e,t,n,a){let o;typeof t=="function"&&typeof n!="function"?(a=n,n=t):o=t;const u=V_(o),l=a?-1:1;d(e,void 0,[])();function d(h,m,g){const x=h&&typeof h=="object"?h:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=B_,z,T,E;if((!t||u(h,m,g[g.length-1]||void 0))&&(v=F6(n(h,g)),v[0]===Ck))return v;if("children"in h&&h.children){const N=h;if(N.children&&v[0]!==I6)for(T=(a?N.children.length:-1)+l,E=g.concat(N);T>-1&&T<N.children.length;){const A=N.children[T];if(z=d(A,T,E)(),z[0]===Ck)return z;T=typeof z[1]=="number"?z[1]:T+l}}return v}}}function F6(e){return Array.isArray(e)?e:typeof e=="number"?[Z6,e]:e==null?B_:[e]}function Z_(e,t,n,a){let o,u,l;typeof t=="function"&&typeof n!="function"?(u=void 0,l=t,o=n):(u=t,l=n,o=a),H6(e,u,d,o);function d(h,m){const g=m[m.length-1],x=g?g.children.indexOf(h):void 0;return l(h,x,g)}}const Ap={}.hasOwnProperty,q6={};function G6(e,t){const n=t||q6,a=new Map,o=new Map,u=new Map,l={...E6,...n.handlers},d={all:m,applyData:X6,definitionById:a,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:l,one:h,options:n,patch:Y6,wrap:J6};return Z_(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const x=g.type==="definition"?a:o,b=String(g.identifier).toUpperCase();x.has(b)||x.set(b,g)}}),d;function h(g,x){const b=g.type,v=d.handlers[b];if(Ap.call(d.handlers,b)&&v)return v(d,g,x);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in g){const{children:T,...E}=g,N=Fc(E);return N.children=d.all(g),N}return Fc(g)}return(d.options.unknownHandler||K6)(d,g,x)}function m(g){const x=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const z=d.one(b[v],g);if(z){if(v&&b[v-1].type==="break"&&(!Array.isArray(z)&&z.type==="text"&&(z.value=Ek(z.value)),!Array.isArray(z)&&z.type==="element")){const T=z.children[0];T&&T.type==="text"&&(T.value=Ek(T.value))}Array.isArray(z)?x.push(...z):x.push(z)}}}return x}}function Y6(e,t){e.position&&(t.position=AD(e))}function X6(e,t){let n=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const l="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:l}}n.type==="element"&&u&&Object.assign(n.properties,Fc(u)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function K6(e,t){const n=t.data||{},a="value"in t&&!(Ap.call(n,"hProperties")||Ap.call(n,"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 J6(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
28
+ `}]}}const V_=(function(e){if(e==null)return Z6;if(typeof e=="function")return fd(e);if(typeof e=="object")return Array.isArray(e)?U6(e):V6(e);if(typeof e=="string")return B6(e);throw new Error("Expected function, string, or object as test")});function U6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=V_(e[n]);return fd(a);function a(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function V6(e){const t=e;return fd(n);function n(a){const o=a;let u;for(u in e)if(o[u]!==t[u])return!1;return!0}}function B6(e){return fd(t);function t(n){return n&&n.type===e}}function fd(e){return t;function t(n,a,o){return!!(I6(n)&&e.call(this,n,typeof a=="number"?a:void 0,o||void 0))}}function Z6(){return!0}function I6(e){return e!==null&&typeof e=="object"&&"type"in e}const B_=[],H6=!0,Ck=!1,F6="skip";function q6(e,t,n,a){let o;typeof t=="function"&&typeof n!="function"?(a=n,n=t):o=t;const u=V_(o),l=a?-1:1;d(e,void 0,[])();function d(h,m,g){const x=h&&typeof h=="object"?h:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=B_,z,T,E;if((!t||u(h,m,g[g.length-1]||void 0))&&(v=G6(n(h,g)),v[0]===Ck))return v;if("children"in h&&h.children){const N=h;if(N.children&&v[0]!==F6)for(T=(a?N.children.length:-1)+l,E=g.concat(N);T>-1&&T<N.children.length;){const A=N.children[T];if(z=d(A,T,E)(),z[0]===Ck)return z;T=typeof z[1]=="number"?z[1]:T+l}}return v}}}function G6(e){return Array.isArray(e)?e:typeof e=="number"?[H6,e]:e==null?B_:[e]}function Z_(e,t,n,a){let o,u,l;typeof t=="function"&&typeof n!="function"?(u=void 0,l=t,o=n):(u=t,l=n,o=a),q6(e,u,d,o);function d(h,m){const g=m[m.length-1],x=g?g.children.indexOf(h):void 0;return l(h,x,g)}}const Ap={}.hasOwnProperty,Y6={};function X6(e,t){const n=t||Y6,a=new Map,o=new Map,u=new Map,l={...A6,...n.handlers},d={all:m,applyData:J6,definitionById:a,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:l,one:h,options:n,patch:K6,wrap:W6};return Z_(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const x=g.type==="definition"?a:o,b=String(g.identifier).toUpperCase();x.has(b)||x.set(b,g)}}),d;function h(g,x){const b=g.type,v=d.handlers[b];if(Ap.call(d.handlers,b)&&v)return v(d,g,x);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in g){const{children:T,...E}=g,N=Fc(E);return N.children=d.all(g),N}return Fc(g)}return(d.options.unknownHandler||Q6)(d,g,x)}function m(g){const x=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const z=d.one(b[v],g);if(z){if(v&&b[v-1].type==="break"&&(!Array.isArray(z)&&z.type==="text"&&(z.value=Ek(z.value)),!Array.isArray(z)&&z.type==="element")){const T=z.children[0];T&&T.type==="text"&&(T.value=Ek(T.value))}Array.isArray(z)?x.push(...z):x.push(z)}}}return x}}function K6(e,t){e.position&&(t.position=RD(e))}function J6(e,t){let n=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const l="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:l}}n.type==="element"&&u&&Object.assign(n.properties,Fc(u)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function Q6(e,t){const n=t.data||{},a="value"in t&&!(Ap.call(n,"hProperties")||Ap.call(n,"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 W6(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
29
29
  `});++a<e.length;)a&&n.push({type:"text",value:`
30
30
  `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
31
- `}),n}function Ek(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Nk(e,t){const n=G6(e,t),a=n.one(e,void 0),o=$6(n),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
32
- `},o),u}function Q6(e,t){return e&&"run"in e?async function(n,a){const o=Nk(n,{file:a,...t});await e.run(o,a)}:function(n,a){return Nk(n,{file:a,...e||t})}}function Ak(e){if(e)throw e}var bm,Ok;function W6(){if(Ok)return bm;Ok=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!x)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},l=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},d=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return bm=function h(){var m,g,x,b,v,z,T=arguments[0],E=1,N=arguments.length,A=!1;for(typeof T=="boolean"&&(A=T,T=arguments[1]||{},E=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});E<N;++E)if(m=arguments[E],m!=null)for(g in m)x=d(T,g),b=d(m,g),T!==b&&(A&&b&&(u(b)||(v=o(b)))?(v?(v=!1,z=x&&o(x)?x:[]):z=x&&u(x)?x:{},l(T,{name:g,newValue:h(A,z,b)})):typeof b<"u"&&l(T,{name:g,newValue:b}));return T},bm}var eL=W6();const vm=Bp(eL);function Op(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 tL(){const e=[],t={run:n,use:a};return t;function n(...o){let u=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...o);function d(h,...m){const g=e[++u];let x=-1;if(h){l(h);return}for(;++x<o.length;)(m[x]===null||m[x]===void 0)&&(m[x]=o[x]);o=m,g?nL(g,d)(...m):l(null,...m)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function nL(e,t){let n;return a;function a(...l){const d=e.length>l.length;let h;d&&l.push(o);try{h=e.apply(this,l)}catch(m){const g=m;if(d&&n)throw g;return o(g)}d||(h&&h.then&&typeof h.then=="function"?h.then(u,o):h instanceof Error?o(h):u(h))}function o(l,...d){n||(n=!0,t(l,...d))}function u(l){o(null,l)}}const zr={basename:rL,dirname:aL,extname:iL,join:oL,sep:"/"};function rL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bl(e);let n=0,a=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){n=o+1;break}}else a<0&&(u=!0,a=o+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,d=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){n=o+1;break}}else l<0&&(u=!0,l=o+1),d>-1&&(e.codePointAt(o)===t.codePointAt(d--)?d<0&&(a=o):(d=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function aL(e){if(Bl(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function iL(e){Bl(e);let t=e.length,n=-1,a=0,o=-1,u=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||n<0||u===0||u===1&&o===n-1&&o===a+1?"":e.slice(o,n)}function oL(...e){let t=-1,n;for(;++t<e.length;)Bl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":sL(n)}function sL(e){Bl(e);const t=e.codePointAt(0)===47;let n=lL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lL(e,t){let n="",a=0,o=-1,u=0,l=-1,d,h;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(o===l-1||u===1))if(o!==l-1&&u===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),o=l,u=0;continue}}else if(n.length>0){n="",a=0,o=l,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),a=l-o-1;o=l,u=0}else d===46&&u>-1?u++:u=-1}return n}function Bl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uL={cwd:cL};function cL(){return"/"}function Rp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dL(e){if(typeof e=="string")e=new URL(e);else if(!Rp(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 fL(e)}function fL(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 n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const km=["history","path","basename","stem","extname","dirname"];class I_{constructor(t){let n;t?Rp(t)?n={path:t}:typeof t=="string"||hL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<km.length;){const u=km[a];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let o;for(o in n)km.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?zr.basename(this.path):void 0}set basename(t){Sm(t,"basename"),wm(t,"basename"),this.path=zr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zr.dirname(this.path):void 0}set dirname(t){Rk(this.basename,"dirname"),this.path=zr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zr.extname(this.path):void 0}set extname(t){if(wm(t,"extname"),Rk(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=zr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rp(t)&&(t=dL(t)),Sm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zr.basename(this.path,this.extname):void 0}set stem(t){Sm(t,"stem"),wm(t,"stem"),this.path=zr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const o=this.message(t,n,a);throw o.fatal=!0,o}info(t,n,a){const o=this.message(t,n,a);return o.fatal=void 0,o}message(t,n,a){const o=new dn(t,n,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function wm(e,t){if(e&&e.includes(zr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zr.sep+"`")}function Sm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Rk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mL=(function(e){const a=this.constructor.prototype,o=a[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),pL={}.hasOwnProperty;class Gg extends mL{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=tL()}copy(){const t=new Gg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(vm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(jm("data",this.frozen),this.namespace[t]=n,this):pL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=n.call(t,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=mc(t),a=this.parser||this.Parser;return zm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zm("process",this.parser||this.Parser),_m("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(u,l){const d=mc(t),h=a.parse(d);a.run(h,d,function(g,x,b){if(g||!x||!b)return m(g);const v=x,z=a.stringify(v,b);xL(z)?b.value=z:b.result=z,m(g,b)});function m(g,x){g||!x?l(g):u?u(x):n(void 0,x)}}}processSync(t){let n=!1,a;return this.freeze(),zm("processSync",this.parser||this.Parser),_m("processSync",this.compiler||this.Compiler),this.process(t,o),Dk("processSync","process",n),a;function o(u,l){n=!0,Ak(u),a=l}}run(t,n,a){Mk(t),this.freeze();const o=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?u(void 0,a):new Promise(u);function u(l,d){const h=mc(n);o.run(t,h,m);function m(g,x,b){const v=x||t;g?d(g):l?l(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,o;return this.run(t,n,u),Dk("runSync","run",a),o;function u(l,d){Ak(l),o=d,a=!0}}stringify(t,n){this.freeze();const a=mc(n),o=this.compiler||this.Compiler;return _m("stringify",o),Mk(t),o(t,a)}use(t,...n){const a=this.attachers,o=this.namespace;if(jm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...x]=m;h(g,x)}else l(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function l(m){if(!("plugins"in m)&&!("settings"in m))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");d(m.plugins),m.settings&&(o.settings=vm(!0,o.settings,m.settings))}function d(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const x=m[g];u(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let x=-1,b=-1;for(;++x<a.length;)if(a[x][0]===m){b=x;break}if(b===-1)a.push([m,...g]);else if(g.length>0){let[v,...z]=g;const T=a[b][1];Op(T)&&Op(v)&&(v=vm(!0,T,v)),a[b]=[m,v,...z]}}}}const gL=new Gg().freeze();function zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _m(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jm(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 Mk(e){if(!Op(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mc(e){return yL(e)?e:new I_(e)}function yL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xL(e){return typeof e=="string"||bL(e)}function bL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$k=[],Lk={allowDangerousHtml:!0},kL=/^(https?|ircs?|mailto|xmpp)$/i,wL=[{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 SL(e){const t=zL(e),n=_L(e);return jL(t.runSync(t.parse(n),n),e)}function zL(e){const t=e.rehypePlugins||$k,n=e.remarkPlugins||$k,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Lk}:Lk;return gL().use(r6).use(n).use(Q6,a).use(t)}function _L(e){const t=e.children||"",n=new I_;return typeof t=="string"&&(n.value=t),n}function jL(e,t){const n=t.allowedElements,a=t.allowElement,o=t.components,u=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||TL;for(const g of wL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+vL+g.id,void 0);return Z_(e,m),$D(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function m(g,x,b){if(g.type==="raw"&&b&&typeof x=="number")return l?b.children.splice(x,1):b.children[x]={type:"text",value:g.value},x;if(g.type==="element"){let v;for(v in gm)if(Object.hasOwn(gm,v)&&Object.hasOwn(g.properties,v)){const z=g.properties[v],T=gm[v];(T===null||T.includes(g.tagName))&&(g.properties[v]=h(String(z||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!v&&a&&typeof x=="number"&&(v=!a(g,x,b)),v&&b&&typeof x=="number")return d&&g.children?b.children.splice(x,1,...g.children):b.children.splice(x,1),x}}}function TL(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||a!==-1&&t>a||kL.test(e.slice(0,t))?e:""}const CL=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a})=>{const[o,u]=j.useState(""),l=j.useRef(null),d=()=>{l.current?.scrollIntoView({behavior:"smooth"})};j.useEffect(()=>{d()},[e,n]);const h=z=>{z.preventDefault(),!(!o.trim()||n)&&(t(o),u(""))},m=z=>z.session_id?.startsWith("sati-evaluation-")||z.tool_name?.toLowerCase().includes("sati")||z.tool_call_id?.toLowerCase().includes("sati")?!0:Array.isArray(z.tool_calls)?z.tool_calls.some(T=>String(T?.name||"").toLowerCase().includes("sati")):!1,g=z=>m(z)?"SATI Memory":"Tool Call",x=z=>{if(typeof z=="string")try{return JSON.stringify(JSON.parse(z),null,2)}catch{return z}try{return JSON.stringify(z,null,2)}catch{return String(z)}},b=z=>{const T=z.usage_metadata;if(!T||typeof T!="object")return null;const E=T.input_tokens??T.prompt_tokens??T.input??0,N=T.output_tokens??T.completion_tokens??T.output??0,A=Number(E),C=Number(N);if(!Number.isFinite(A)&&!Number.isFinite(C))return null;const $=Number.isFinite(A)?Math.max(0,Math.round(A)):0,L=Number.isFinite(C)?Math.max(0,Math.round(C)):0;return $===0&&L===0?null:{input:$,output:L}},v=z=>z.toLocaleString("pt-BR");return a?f.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((z,T)=>{const E=b(z),N=z.type==="human"?"bg-white/20 border border-white/30 text-white":"bg-gray-100 border border-gray-200 text-gray-600 dark:bg-zinc-900 dark:border-zinc-700 dark:text-gray-300";return f.jsxs("div",{className:`flex gap-4 ${z.type==="human"?"justify-end":"justify-start"}`,children:[z.type!=="human"&&f.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${z.type==="tool"?"bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400":"bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight"}`,children:z.type==="tool"?f.jsx(dS,{size:16}):f.jsx(w0,{size:18})}),f.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-sm ${z.type==="human"?"bg-azure-primary text-white dark:bg-matrix-primary dark:text-matrix-highlight dark:border dark:border-matrix-highlight/20 rounded-br-none":z.type==="tool"?"bg-white dark:bg-black border border-gray-200 dark:border-zinc-800 text-gray-800 dark:text-gray-200 rounded-bl-none":"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 text-gray-800 dark:text-matrix-secondary rounded-bl-none"}`,children:[z.type==="tool"&&f.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(z)}),f.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:x(z.content)})]}),z.type==="ai"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"prose dark:prose-invert max-w-none text-sm leading-relaxed dark:prose-p:text-matrix-secondary dark:prose-headings:text-matrix-highlight dark:prose-strong:text-matrix-highlight dark:prose-code:text-matrix-highlight",children:f.jsx(SL,{children:z.content})}),Array.isArray(z.tool_calls)&&z.tool_calls.length>0&&f.jsxs("details",{className:"mt-3 rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(z)}),f.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:x(z.tool_calls)})]})]}),z.type==="human"&&f.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:z.content}),E&&f.jsx("div",{className:"mt-3 flex justify-end",children:f.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${N}`,children:[f.jsx(lS,{size:12}),f.jsx("span",{children:v(E.input)}),f.jsx("span",{className:"opacity-60",children:"/"}),f.jsx("span",{children:v(E.output)}),f.jsx(sS,{size:12})]})})]}),z.type==="human"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-200 dark:bg-matrix-primary/20 flex items-center justify-center flex-shrink-0 text-gray-500 dark:text-matrix-secondary",children:f.jsx(OA,{size:18})})]},T)}),n&&f.jsxs("div",{className:"flex gap-4 justify-start",children:[f.jsx("div",{className:"w-8 h-8 rounded-full bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight flex items-center justify-center flex-shrink-0",children:f.jsx(w0,{size:18})}),f.jsxs("div",{className:"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 p-4 rounded-2xl rounded-bl-none shadow-sm flex items-center gap-2",children:[f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),f.jsx("div",{ref:l})]}),f.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:f.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[f.jsx("input",{type:"text",value:o,onChange:z=>u(z.target.value),placeholder:"Type your message...",className:"flex-1 bg-gray-100 dark:bg-black/50 border border-transparent dark:border-matrix-primary/30 rounded-xl px-4 py-3 focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight outline-none transition-all dark:text-matrix-highlight dark:placeholder-matrix-secondary/50",disabled:n}),f.jsx("button",{type:"submit",disabled:!o.trim()||n,className:"p-3 bg-azure-primary text-white dark:bg-matrix-secondary dark:text-black dark:hover:bg-matrix-highlight rounded-xl hover:bg-azure-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-md",children:f.jsx(yA,{size:20})})]})})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-gray-50 dark:bg-black text-gray-400 dark:text-matrix-secondary/50 h-full",children:[f.jsx(EL,{size:48,className:"mb-4 opacity-20"}),f.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},EL=({size:e,className:t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:f.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),Ma={getSessions:async()=>_e.get("/sessions"),createSession:async()=>_e.post("/sessions",{}),deleteSession:async e=>_e.delete(`/sessions/${e}`),renameSession:async(e,t)=>_e.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>_e.post(`/sessions/${e}/archive`,{}),getMessages:async e=>_e.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>_e.post("/chat",{sessionId:e,message:t})};function H_({isOpen:e,onClose:t,onConfirm:n,title:a,description:o,confirmJson:u="Confirm",variant:l="default"}){return f.jsx(Nr,{open:e,onOpenChange:t,children:f.jsxs(Zo,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),f.jsx("div",{className:"py-4",children:f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:o})}),f.jsxs(tD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[f.jsx(ir,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),f.jsx(ir,{variant:l,onClick:()=>{n(),t()},className:l==="destructive"?"dark:bg-red-900/50 dark:text-red-200 dark:hover:bg-red-800/60":"dark:bg-matrix-primary dark:text-black dark:hover:bg-matrix-highlight",children:u})]})]})})}const NL=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(null),[o,u]=j.useState([]),[l,d]=j.useState(!1),[h,m]=j.useState(!0),g=j.useRef(!1);j.useEffect(()=>{g.current=l},[l]),j.useEffect(()=>{if(!n)return;const $=setInterval(async()=>{if(!g.current)try{const M=(await Ma.getMessages(n)).filter(q=>q.type!=="system");u(q=>{if(M.length!==q.length)return M;const V=M.at(-1)?.created_at??0,X=q.at(-1)?.created_at??0;return V>X?M:q})}catch{}},3e3);return()=>clearInterval($)},[n]);const[x,b]=j.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const $=await Ma.getSessions();t($)}catch($){console.error("Failed to load sessions:",$)}};j.useEffect(()=>{v()},[]),j.useEffect(()=>{n?z(n):u([])},[n]);const z=async $=>{try{const L=await Ma.getMessages($);u(L.filter(M=>M.type!=="system"))}catch(L){console.error("Failed to load messages:",L)}},T=async()=>{try{const $=await Ma.createSession();await v(),a($.id)}catch($){console.error("Failed to create session:",$)}},E=async $=>{if(!n)return;const L={type:"human",content:$};u(M=>[...M,L]),d(!0);try{await Ma.sendMessage(n,$),await z(n),await v()}catch(M){console.error("Failed to send message:",M)}finally{d(!1)}},N=$=>{b({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await Ma.archiveSession($),n===$&&a(null),await v()}catch(L){console.error("Failed to archive session:",L)}}})},A=$=>{b({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await Ma.deleteSession($),n===$&&a(null),await v()}catch(L){console.error("Failed to delete session:",L)}}})},C=async($,L)=>{try{await Ma.renameSession($,L),await v()}catch(M){console.error("Failed to rename session:",M)}};return f.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[f.jsx(sD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:T,onArchiveSession:N,onDeleteSession:A,onRenameSession:C,isOpen:h,toggleSidebar:()=>m(!h)}),f.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:f.jsx(CL,{messages:o,onSendMessage:E,isLoading:l,activeSessionId:n})}),f.jsx(H_,{isOpen:x.isOpen,onClose:()=>b($=>({...$,isOpen:!1})),onConfirm:x.onConfirm,title:x.title,description:x.description,confirmJson:x.confirmJson,variant:x.variant})]})};function wr({title:e,description:t,children:n}){return f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg p-6 bg-azure-surface/50 dark:bg-matrix-base/50",children:[f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),f.jsx("div",{className:"space-y-4",children:n})]})}const AL=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},OL=(e,t)=>({classGroupId:e,validator:t}),F_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qc="-",Pk=[],RL="arbitrary..",ML=e=>{const t=$L(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return DL(l);const d=l.split(qc),h=d[0]===""&&d.length>1?1:0;return q_(d,h,t)},getConflictingClassGroupIds:(l,d)=>{if(d){const h=a[l],m=n[l];return h?m?AL(m,h):h:m||Pk}return n[l]||Pk}}},q_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const m=q_(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const d=t===0?e.join(qc):e.slice(t).join(qc),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(d))return g.classGroupId}},DL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?RL+a:void 0})(),$L=e=>{const{theme:t,classGroups:n}=e;return LL(n,t)},LL=(e,t)=>{const n=F_();for(const a in e){const o=e[a];Yg(o,n,a,t)}return n},Yg=(e,t,n,a)=>{const o=e.length;for(let u=0;u<o;u++){const l=e[u];PL(l,t,n,a)}},PL=(e,t,n,a)=>{if(typeof e=="string"){UL(e,t,n);return}if(typeof e=="function"){VL(e,t,n,a);return}BL(e,t,n,a)},UL=(e,t,n)=>{const a=e===""?t:G_(t,e);a.classGroupId=n},VL=(e,t,n,a)=>{if(ZL(e)){Yg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(OL(n,e))},BL=(e,t,n,a)=>{const o=Object.entries(e),u=o.length;for(let l=0;l<u;l++){const[d,h]=o[l];Yg(h,G_(t,d),n,a)}},G_=(e,t)=>{let n=e;const a=t.split(qc),o=a.length;for(let u=0;u<o;u++){const l=a[u];let d=n.nextPart.get(l);d||(d=F_(),n.nextPart.set(l,d)),n=d}return n},ZL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,IL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(u,l)=>{n[u]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(u){let l=n[u];if(l!==void 0)return l;if((l=a[u])!==void 0)return o(u,l),l},set(u,l){u in n?n[u]=l:o(u,l)}}},Mp="!",Uk=":",HL=[],Vk=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),FL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const u=[];let l=0,d=0,h=0,m;const g=o.length;for(let T=0;T<g;T++){const E=o[T];if(l===0&&d===0){if(E===Uk){u.push(o.slice(h,T)),h=T+1;continue}if(E==="/"){m=T;continue}}E==="["?l++:E==="]"?l--:E==="("?d++:E===")"&&d--}const x=u.length===0?o:o.slice(h);let b=x,v=!1;x.endsWith(Mp)?(b=x.slice(0,-1),v=!0):x.startsWith(Mp)&&(b=x.slice(1),v=!0);const z=m&&m>h?m-h:void 0;return Vk(u,v,b,z)};if(t){const o=t+Uk,u=a;a=l=>l.startsWith(o)?u(l.slice(o.length)):Vk(HL,!1,l,void 0,!0)}if(n){const o=a;a=u=>n({className:u,parseClassName:o})}return a},qL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let u=0;u<n.length;u++){const l=n[u],d=l[0]==="[",h=t.has(l);d||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(l)):o.push(l)}return o.length>0&&(o.sort(),a.push(...o)),a}},GL=e=>({cache:IL(e.cacheSize),parseClassName:FL(e),sortModifiers:qL(e),...ML(e)}),YL=/\s+/,XL=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:u}=t,l=[],d=e.trim().split(YL);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:x,modifiers:b,hasImportantModifier:v,baseClassName:z,maybePostfixModifierPosition:T}=n(g);if(x){h=g+(h.length>0?" "+h:h);continue}let E=!!T,N=a(E?z.substring(0,T):z);if(!N){if(!E){h=g+(h.length>0?" "+h:h);continue}if(N=a(z),!N){h=g+(h.length>0?" "+h:h);continue}E=!1}const A=b.length===0?"":b.length===1?b[0]:u(b).join(":"),C=v?A+Mp:A,$=C+N;if(l.indexOf($)>-1)continue;l.push($);const L=o(N,E);for(let M=0;M<L.length;++M){const q=L[M];l.push(C+q)}h=g+(h.length>0?" "+h:h)}return h},KL=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Y_(n))&&(o&&(o+=" "),o+=a);return o},Y_=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Y_(e[a]))&&(n&&(n+=" "),n+=t);return n},JL=(e,...t)=>{let n,a,o,u;const l=h=>{const m=t.reduce((g,x)=>x(g),e());return n=GL(m),a=n.cache.get,o=n.cache.set,u=d,d(h)},d=h=>{const m=a(h);if(m)return m;const g=XL(h,n);return o(h,g),g};return u=l,(...h)=>u(KL(...h))},QL=[],Gt=e=>{const t=n=>n[e]||QL;return t.isThemeGetter=!0,t},X_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WL=/^\d+\/\d+$/,e9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t9=/\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$/,n9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ko=e=>WL.test(e),Me=e=>!!e&&!Number.isNaN(Number(e)),Da=e=>!!e&&Number.isInteger(Number(e)),Tm=e=>e.endsWith("%")&&Me(e.slice(0,-1)),ea=e=>e9.test(e),i9=()=>!0,o9=e=>t9.test(e)&&!n9.test(e),J_=()=>!1,s9=e=>r9.test(e),l9=e=>a9.test(e),u9=e=>!ge(e)&&!ye(e),c9=e=>es(e,e2,J_),ge=e=>X_.test(e),yi=e=>es(e,t2,o9),Cm=e=>es(e,p9,Me),Bk=e=>es(e,Q_,J_),d9=e=>es(e,W_,l9),pc=e=>es(e,n2,s9),ye=e=>K_.test(e),al=e=>ts(e,t2),f9=e=>ts(e,g9),Zk=e=>ts(e,Q_),h9=e=>ts(e,e2),m9=e=>ts(e,W_),gc=e=>ts(e,n2,!0),es=(e,t,n)=>{const a=X_.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},ts=(e,t,n=!1)=>{const a=K_.exec(e);return a?a[1]?t(a[1]):n:!1},Q_=e=>e==="position"||e==="percentage",W_=e=>e==="image"||e==="url",e2=e=>e==="length"||e==="size"||e==="bg-size",t2=e=>e==="length",p9=e=>e==="number",g9=e=>e==="family-name",n2=e=>e==="shadow",y9=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),a=Gt("font-weight"),o=Gt("tracking"),u=Gt("leading"),l=Gt("breakpoint"),d=Gt("container"),h=Gt("spacing"),m=Gt("radius"),g=Gt("shadow"),x=Gt("inset-shadow"),b=Gt("text-shadow"),v=Gt("drop-shadow"),z=Gt("blur"),T=Gt("perspective"),E=Gt("aspect"),N=Gt("ease"),A=Gt("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...$(),ye,ge],M=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],V=()=>[ye,ge,h],X=()=>[ko,"full","auto",...V()],ce=()=>[Da,"none","subgrid",ye,ge],Q=()=>["auto",{span:["full",Da,ye,ge]},Da,ye,ge],se=()=>[Da,"auto",ye,ge],te=()=>["auto","min","max","fr",ye,ge],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...V()],K=()=>[ko,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],B=()=>[e,ye,ge],he=()=>[...$(),Zk,Bk,{position:[ye,ge]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",h9,c9,{size:[ye,ge]}],H=()=>[Tm,al,yi],w=()=>["","none","full",m,ye,ge],G=()=>["",Me,al,yi],de=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Me,Tm,Zk,Bk],De=()=>["","none",z,ye,ge],Ne=()=>["none",Me,ye,ge],kt=()=>["none",Me,ye,ge],It=()=>[Me,ye,ge],fn=()=>[ko,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ea],breakpoint:[ea],color:[i9],container:[ea],"drop-shadow":[ea],ease:["in","out","in-out"],font:[u9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ea],shadow:[ea],spacing:["px",Me],text:[ea],"text-shadow":[ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ko,ge,ye,E]}],container:["container"],columns:[{columns:[Me,ge,ye,d]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:L()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{start:X()}],end:[{end:X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[Da,"auto",ye,ge]}],basis:[{basis:[ko,"full","auto",d,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,ko,"auto","initial","none",ge]}],grow:[{grow:["",Me,ye,ge]}],shrink:[{shrink:["",Me,ye,ge]}],order:[{order:[Da,"first","last","none",ye,ge]}],"grid-cols":[{"grid-cols":ce()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":ce()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[d,"screen",...K()]}],"min-w":[{"min-w":[d,"screen","none",...K()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,al,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ye,Cm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Tm,ge]}],"font-family":[{font:[f9,ge,t]}],"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:[o,ye,ge]}],"line-clamp":[{"line-clamp":[Me,"none",ye,Cm]}],leading:[{leading:[u,...V()]}],"list-image":[{"list-image":["none",ye,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ye,yi]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Me,"auto",ye,ge]}],"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",ye,ge]}],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",ye,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:he()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Da,ye,ge],radial:["",ye,ge],conic:[Da,ye,ge]},m9,d9]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:w()}],"rounded-s":[{"rounded-s":w()}],"rounded-e":[{"rounded-e":w()}],"rounded-t":[{"rounded-t":w()}],"rounded-r":[{"rounded-r":w()}],"rounded-b":[{"rounded-b":w()}],"rounded-l":[{"rounded-l":w()}],"rounded-ss":[{"rounded-ss":w()}],"rounded-se":[{"rounded-se":w()}],"rounded-ee":[{"rounded-ee":w()}],"rounded-es":[{"rounded-es":w()}],"rounded-tl":[{"rounded-tl":w()}],"rounded-tr":[{"rounded-tr":w()}],"rounded-br":[{"rounded-br":w()}],"rounded-bl":[{"rounded-bl":w()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ye,ge]}],"outline-w":[{outline:["",Me,al,yi]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,gc,pc]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",x,gc,pc]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Me,yi]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",b,gc,pc]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Me,ye,ge]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"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":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ye,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":$()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:he()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ge]}],filter:[{filter:["","none",ye,ge]}],blur:[{blur:De()}],brightness:[{brightness:[Me,ye,ge]}],contrast:[{contrast:[Me,ye,ge]}],"drop-shadow":[{"drop-shadow":["","none",v,gc,pc]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Me,ye,ge]}],"hue-rotate":[{"hue-rotate":[Me,ye,ge]}],invert:[{invert:["",Me,ye,ge]}],saturate:[{saturate:[Me,ye,ge]}],sepia:[{sepia:["",Me,ye,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ge]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ye,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ye,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ye,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ye,ge]}],"backdrop-invert":[{"backdrop-invert":["",Me,ye,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ye,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ye,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ye,ge]}],"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",ye,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ye,ge]}],ease:[{ease:["linear","initial",N,ye,ge]}],delay:[{delay:[Me,ye,ge]}],animate:[{animate:["none",A,ye,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,ye,ge]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Ne()}],"rotate-x":[{"rotate-x":Ne()}],"rotate-y":[{"rotate-y":Ne()}],"rotate-z":[{"rotate-z":Ne()}],scale:[{scale:kt()}],"scale-x":[{"scale-x":kt()}],"scale-y":[{"scale-y":kt()}],"scale-z":[{"scale-z":kt()}],"scale-3d":["scale-3d"],skew:[{skew:It()}],"skew-x":[{"skew-x":It()}],"skew-y":[{"skew-y":It()}],transform:[{transform:[ye,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fn()}],"translate-x":[{"translate-x":fn()}],"translate-y":[{"translate-y":fn()}],"translate-z":[{"translate-z":fn()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",ye,ge]}],"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-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,ge]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Me,al,yi,Cm]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lo=JL(y9);function yt({label:e,error:t,helperText:n,className:a,...o}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("input",{className:Lo("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...o}),n&&!t&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&f.jsx("p",{className:"text-xs text-red-500",children:t})]})}function xi({label:e,options:t,error:n,helperText:a,className:o,...u}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("select",{className:Lo("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors appearance-none",n&&"border-red-500 focus:border-red-500 focus:ring-red-500",o),...u,children:t.map(l=>f.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&f.jsx("p",{className:"text-xs text-red-500",children:n})]})}function Bn({label:e,error:t,helperText:n,className:a,...o}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("input",{type:"number",className:Lo("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...o}),n&&!t&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&f.jsx("p",{className:"text-xs text-red-500",children:t})]})}function il({label:e,checked:t,onChange:n,helperText:a,disabled:o}){return f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:Lo("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",o&&"opacity-50"),children:e}),a&&f.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),f.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!o&&n(!t),className:Lo("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:ring-offset-2 focus:ring-offset-azure-bg dark:focus:ring-offset-black",t?"bg-azure-primary dark:bg-matrix-highlight":"bg-slate-300 dark:bg-matrix-primary",o&&"opacity-50 cursor-not-allowed"),children:f.jsx("span",{className:Lo("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const Sr={fetchConfig:async()=>_e.get("/config"),updateConfig:async e=>_e.post("/config",e),getSatiConfig:async()=>_e.get("/config/sati"),updateSatiConfig:async e=>_e.post("/config/sati",e),deleteSatiConfig:async()=>_e.delete("/config/sati"),getApocConfig:async()=>_e.get("/config/apoc"),updateApocConfig:async e=>_e.post("/config/apoc",e),deleteApocConfig:async()=>_e.delete("/config/apoc"),getNeoConfig:async()=>_e.get("/config/neo"),updateNeoConfig:async e=>_e.post("/config/neo",e),deleteNeoConfig:async()=>_e.delete("/config/neo"),getTrinityConfig:async()=>_e.get("/config/trinity"),updateTrinityConfig:async e=>_e.post("/config/trinity",e),deleteTrinityConfig:async()=>_e.delete("/config/trinity")};function ee(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=l.prototype,g=Object.keys(m);for(let x=0;x<g.length;x++){const b=g[x];b in d||(d[b]=m[b].bind(d))}}const o=n?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function l(d){var h;const m=n?.Parent?new u:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let Po=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},r2=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const a2={};function Ha(e){return a2}function i2(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>t.indexOf(+a)===-1).map(([a,o])=>o)}function Dp(e,t){return typeof t=="bigint"?t.toString():t}function hd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Xg(e){return e==null}function Kg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function x9(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let o=(a.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(a)){const h=a.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const u=n>o?n:o,l=Number.parseInt(e.toFixed(u).replace(".","")),d=Number.parseInt(t.toFixed(u).replace(".",""));return l%d/10**u}const Ik=Symbol("evaluating");function Ye(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Ik)return a===void 0&&(a=Ik,a=n()),a},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ai(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ya(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Hk(e){return JSON.stringify(e)}function b9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const o2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const v9=hd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Io(e){if(Cl(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Cl(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function s2(e){return Io(e)?{...e}:Array.isArray(e)?[...e]:e}const k9=new Set(["string","number","symbol"]);function Ho(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xa(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function ke(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(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 w9(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const S9={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 z9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Ya(e._zod.def,{get shape(){const l={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(l[d]=n.shape[d])}return Ai(this,"shape",l),l},checks:[]});return Xa(e,u)}function _9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Ya(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete l[d]}return Ai(this,"shape",l),l},checks:[]});return Xa(e,u)}function j9(e,t){if(!Io(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ya(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Ai(this,"shape",u),u}});return Xa(e,o)}function T9(e,t){if(!Io(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ya(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ai(this,"shape",a),a}});return Xa(e,n)}function C9(e,t){const n=Ya(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ai(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Xa(e,n)}function E9(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ya(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Ai(this,"shape",h),h},checks:[]});return Xa(t,l)}function N9(e,t,n){const a=Ya(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:o[l]}))}else for(const l in o)u[l]=new e({type:"nonoptional",innerType:o[l]});return Ai(this,"shape",u),u}});return Xa(t,a)}function Eo(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function No(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function yc(e){return typeof e=="string"?e:e?.message}function Fa(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const o=yc(e.inst?._zod.def?.error?.(e))??yc(t?.error?.(e))??yc(n.customError?.(e))??yc(n.localeError?.(e))??"Invalid input";a.message=o}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Jg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function El(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const l2=(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,Dp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},u2=ee("$ZodError",l2),c2=ee("$ZodError",l2,{Parent:Error});function A9(e,t=n=>n.message){const n={},a=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:n}}function O9(e,t=n=>n.message){const n={_errors:[]},a=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],d++}}};return a(e),n}const Qg=e=>(t,n,a,o)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Po;if(l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Fa(h,u,Ha())));throw o2(d,o?.callee),d}return l.value},Wg=e=>async(t,n,a,o)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Fa(h,u,Ha())));throw o2(d,o?.callee),d}return l.value},md=e=>(t,n,a)=>{const o=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new Po;return u.issues.length?{success:!1,error:new(e??u2)(u.issues.map(l=>Fa(l,o,Ha())))}:{success:!0,data:u.value}},R9=md(c2),pd=e=>async(t,n,a)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Fa(l,o,Ha())))}:{success:!0,data:u.value}},M9=pd(c2),D9=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qg(e)(t,n,o)},$9=e=>(t,n,a)=>Qg(e)(t,n,a),L9=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Wg(e)(t,n,o)},P9=e=>async(t,n,a)=>Wg(e)(t,n,a),U9=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return md(e)(t,n,o)},V9=e=>(t,n,a)=>md(e)(t,n,a),B9=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return pd(e)(t,n,o)},Z9=e=>async(t,n,a)=>pd(e)(t,n,a),I9=/^[cC][^\s-]{8,}$/,H9=/^[0-9a-z]+$/,F9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,q9=/^[0-9a-vA-V]{20}$/,G9=/^[A-Za-z0-9]{27}$/,Y9=/^[a-zA-Z0-9_-]{21}$/,X9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,K9=/^([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})$/,Fk=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)$/,J9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Q9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function W9(){return new RegExp(Q9,"u")}const eP=/^(?:(?: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])$/,tP=/^(([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}|:))$/,nP=/^((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])$/,rP=/^(([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])$/,aP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d2=/^[A-Za-z0-9_-]*$/,iP=/^\+[1-9]\d{6,14}$/,f2="(?:(?:\\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])))",oP=new RegExp(`^${f2}$`);function h2(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 sP(e){return new RegExp(`^${h2(e)}$`)}function lP(e){const t=h2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${f2}T(?:${a})$`)}const uP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cP=/^-?\d+$/,m2=/^-?\d+(?:\.\d+)?$/,dP=/^(?:true|false)$/i,fP=/^[^A-Z]*$/,hP=/^[^a-z]*$/,On=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),p2={number:"number",bigint:"bigint",object:"date"},g2=ee("$ZodCheckLessThan",(e,t)=>{On.init(e,t);const n=p2[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,u=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),y2=ee("$ZodCheckGreaterThan",(e,t)=>{On.init(e,t);const n=p2[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,u=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mP=ee("$ZodCheckMultipleOf",(e,t)=>{On.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):x9(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),pP=ee("$ZodCheckNumberFormat",(e,t)=>{On.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[o,u]=S9[t.format];e._zod.onattach.push(l=>{const d=l._zod.bag;d.format=t.format,d.minimum=o,d.maximum=u,n&&(d.pattern=cP)}),e._zod.check=l=>{const d=l.value;if(n){if(!Number.isInteger(d)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?l.issues.push({input:d,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}):l.issues.push({input:d,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}}d<o&&l.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),d>u&&l.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),gP=ee("$ZodCheckMaxLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Xg(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const o=a.value;if(o.length<=t.maximum)return;const l=Jg(o);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),yP=ee("$ZodCheckMinLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Xg(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const o=a.value;if(o.length>=t.minimum)return;const l=Jg(o);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),xP=ee("$ZodCheckLengthEquals",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Xg(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=a=>{const o=a.value,u=o.length;if(u===t.length)return;const l=Jg(o),d=u>t.length;a.issues.push({origin:l,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),gd=ee("$ZodCheckStringFormat",(e,t)=>{var n,a;On.init(e,t),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),bP=ee("$ZodCheckRegex",(e,t)=>{gd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vP=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fP),gd.init(e,t)}),kP=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hP),gd.init(e,t)}),wP=ee("$ZodCheckIncludes",(e,t)=>{On.init(e,t);const n=Ho(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),SP=ee("$ZodCheckStartsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`^${Ho(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),zP=ee("$ZodCheckEndsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`.*${Ho(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),_P=ee("$ZodCheckOverwrite",(e,t)=>{On.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let jP=class{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(`
31
+ `}),n}function Ek(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Nk(e,t){const n=X6(e,t),a=n.one(e,void 0),o=P6(n),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
32
+ `},o),u}function eL(e,t){return e&&"run"in e?async function(n,a){const o=Nk(n,{file:a,...t});await e.run(o,a)}:function(n,a){return Nk(n,{file:a,...e||t})}}function Ak(e){if(e)throw e}var bm,Ok;function tL(){if(Ok)return bm;Ok=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!x)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},l=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},d=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return bm=function h(){var m,g,x,b,v,z,T=arguments[0],E=1,N=arguments.length,A=!1;for(typeof T=="boolean"&&(A=T,T=arguments[1]||{},E=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});E<N;++E)if(m=arguments[E],m!=null)for(g in m)x=d(T,g),b=d(m,g),T!==b&&(A&&b&&(u(b)||(v=o(b)))?(v?(v=!1,z=x&&o(x)?x:[]):z=x&&u(x)?x:{},l(T,{name:g,newValue:h(A,z,b)})):typeof b<"u"&&l(T,{name:g,newValue:b}));return T},bm}var nL=tL();const vm=Bp(nL);function Op(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 rL(){const e=[],t={run:n,use:a};return t;function n(...o){let u=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...o);function d(h,...m){const g=e[++u];let x=-1;if(h){l(h);return}for(;++x<o.length;)(m[x]===null||m[x]===void 0)&&(m[x]=o[x]);o=m,g?aL(g,d)(...m):l(null,...m)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function aL(e,t){let n;return a;function a(...l){const d=e.length>l.length;let h;d&&l.push(o);try{h=e.apply(this,l)}catch(m){const g=m;if(d&&n)throw g;return o(g)}d||(h&&h.then&&typeof h.then=="function"?h.then(u,o):h instanceof Error?o(h):u(h))}function o(l,...d){n||(n=!0,t(l,...d))}function u(l){o(null,l)}}const zr={basename:iL,dirname:oL,extname:sL,join:lL,sep:"/"};function iL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zl(e);let n=0,a=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){n=o+1;break}}else a<0&&(u=!0,a=o+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,d=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){n=o+1;break}}else l<0&&(u=!0,l=o+1),d>-1&&(e.codePointAt(o)===t.codePointAt(d--)?d<0&&(a=o):(d=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function oL(e){if(Zl(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sL(e){Zl(e);let t=e.length,n=-1,a=0,o=-1,u=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||n<0||u===0||u===1&&o===n-1&&o===a+1?"":e.slice(o,n)}function lL(...e){let t=-1,n;for(;++t<e.length;)Zl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":uL(n)}function uL(e){Zl(e);const t=e.codePointAt(0)===47;let n=cL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function cL(e,t){let n="",a=0,o=-1,u=0,l=-1,d,h;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(o===l-1||u===1))if(o!==l-1&&u===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),o=l,u=0;continue}}else if(n.length>0){n="",a=0,o=l,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),a=l-o-1;o=l,u=0}else d===46&&u>-1?u++:u=-1}return n}function Zl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dL={cwd:fL};function fL(){return"/"}function Rp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hL(e){if(typeof e=="string")e=new URL(e);else if(!Rp(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 mL(e)}function mL(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 n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const km=["history","path","basename","stem","extname","dirname"];class I_{constructor(t){let n;t?Rp(t)?n={path:t}:typeof t=="string"||pL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<km.length;){const u=km[a];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let o;for(o in n)km.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?zr.basename(this.path):void 0}set basename(t){Sm(t,"basename"),wm(t,"basename"),this.path=zr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zr.dirname(this.path):void 0}set dirname(t){Rk(this.basename,"dirname"),this.path=zr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zr.extname(this.path):void 0}set extname(t){if(wm(t,"extname"),Rk(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=zr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rp(t)&&(t=hL(t)),Sm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zr.basename(this.path,this.extname):void 0}set stem(t){Sm(t,"stem"),wm(t,"stem"),this.path=zr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const o=this.message(t,n,a);throw o.fatal=!0,o}info(t,n,a){const o=this.message(t,n,a);return o.fatal=void 0,o}message(t,n,a){const o=new dn(t,n,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function wm(e,t){if(e&&e.includes(zr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zr.sep+"`")}function Sm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Rk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function pL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gL=(function(e){const a=this.constructor.prototype,o=a[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),yL={}.hasOwnProperty;class Gg extends gL{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=rL()}copy(){const t=new Gg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(vm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(jm("data",this.frozen),this.namespace[t]=n,this):yL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=n.call(t,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=pc(t),a=this.parser||this.Parser;return zm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zm("process",this.parser||this.Parser),_m("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(u,l){const d=pc(t),h=a.parse(d);a.run(h,d,function(g,x,b){if(g||!x||!b)return m(g);const v=x,z=a.stringify(v,b);vL(z)?b.value=z:b.result=z,m(g,b)});function m(g,x){g||!x?l(g):u?u(x):n(void 0,x)}}}processSync(t){let n=!1,a;return this.freeze(),zm("processSync",this.parser||this.Parser),_m("processSync",this.compiler||this.Compiler),this.process(t,o),Dk("processSync","process",n),a;function o(u,l){n=!0,Ak(u),a=l}}run(t,n,a){Mk(t),this.freeze();const o=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?u(void 0,a):new Promise(u);function u(l,d){const h=pc(n);o.run(t,h,m);function m(g,x,b){const v=x||t;g?d(g):l?l(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,o;return this.run(t,n,u),Dk("runSync","run",a),o;function u(l,d){Ak(l),o=d,a=!0}}stringify(t,n){this.freeze();const a=pc(n),o=this.compiler||this.Compiler;return _m("stringify",o),Mk(t),o(t,a)}use(t,...n){const a=this.attachers,o=this.namespace;if(jm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...x]=m;h(g,x)}else l(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function l(m){if(!("plugins"in m)&&!("settings"in m))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");d(m.plugins),m.settings&&(o.settings=vm(!0,o.settings,m.settings))}function d(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const x=m[g];u(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let x=-1,b=-1;for(;++x<a.length;)if(a[x][0]===m){b=x;break}if(b===-1)a.push([m,...g]);else if(g.length>0){let[v,...z]=g;const T=a[b][1];Op(T)&&Op(v)&&(v=vm(!0,T,v)),a[b]=[m,v,...z]}}}}const xL=new Gg().freeze();function zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _m(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jm(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 Mk(e){if(!Op(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pc(e){return bL(e)?e:new I_(e)}function bL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vL(e){return typeof e=="string"||kL(e)}function kL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$k=[],Lk={allowDangerousHtml:!0},SL=/^(https?|ircs?|mailto|xmpp)$/i,zL=[{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 _L(e){const t=jL(e),n=TL(e);return CL(t.runSync(t.parse(n),n),e)}function jL(e){const t=e.rehypePlugins||$k,n=e.remarkPlugins||$k,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Lk}:Lk;return xL().use(i6).use(n).use(eL,a).use(t)}function TL(e){const t=e.children||"",n=new I_;return typeof t=="string"&&(n.value=t),n}function CL(e,t){const n=t.allowedElements,a=t.allowElement,o=t.components,u=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||EL;for(const g of zL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+wL+g.id,void 0);return Z_(e,m),PD(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function m(g,x,b){if(g.type==="raw"&&b&&typeof x=="number")return l?b.children.splice(x,1):b.children[x]={type:"text",value:g.value},x;if(g.type==="element"){let v;for(v in gm)if(Object.hasOwn(gm,v)&&Object.hasOwn(g.properties,v)){const z=g.properties[v],T=gm[v];(T===null||T.includes(g.tagName))&&(g.properties[v]=h(String(z||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!v&&a&&typeof x=="number"&&(v=!a(g,x,b)),v&&b&&typeof x=="number")return d&&g.children?b.children.splice(x,1,...g.children):b.children.splice(x,1),x}}}function EL(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||a!==-1&&t>a||SL.test(e.slice(0,t))?e:""}const NL=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a})=>{const[o,u]=j.useState(""),l=j.useRef(null),d=()=>{l.current?.scrollIntoView({behavior:"smooth"})};j.useEffect(()=>{d()},[e,n]);const h=z=>{z.preventDefault(),!(!o.trim()||n)&&(t(o),u(""))},m=z=>z.session_id?.startsWith("sati-evaluation-")||z.tool_name?.toLowerCase().includes("sati")||z.tool_call_id?.toLowerCase().includes("sati")?!0:Array.isArray(z.tool_calls)?z.tool_calls.some(T=>String(T?.name||"").toLowerCase().includes("sati")):!1,g=z=>m(z)?"SATI Memory":"Tool Call",x=z=>{if(typeof z=="string")try{return JSON.stringify(JSON.parse(z),null,2)}catch{return z}try{return JSON.stringify(z,null,2)}catch{return String(z)}},b=z=>{const T=z.usage_metadata;if(!T||typeof T!="object")return null;const E=T.input_tokens??T.prompt_tokens??T.input??0,N=T.output_tokens??T.completion_tokens??T.output??0,A=Number(E),C=Number(N);if(!Number.isFinite(A)&&!Number.isFinite(C))return null;const $=Number.isFinite(A)?Math.max(0,Math.round(A)):0,L=Number.isFinite(C)?Math.max(0,Math.round(C)):0;return $===0&&L===0?null:{input:$,output:L}},v=z=>z.toLocaleString("pt-BR");return a?f.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((z,T)=>{const E=b(z),N=z.type==="human"?"bg-white/20 border border-white/30 text-white":"bg-gray-100 border border-gray-200 text-gray-600 dark:bg-zinc-900 dark:border-zinc-700 dark:text-gray-300";return f.jsxs("div",{className:`flex gap-4 ${z.type==="human"?"justify-end":"justify-start"}`,children:[z.type!=="human"&&f.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${z.type==="tool"?"bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400":"bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight"}`,children:z.type==="tool"?f.jsx(dS,{size:16}):f.jsx(w0,{size:18})}),f.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-sm ${z.type==="human"?"bg-azure-primary text-white dark:bg-matrix-primary dark:text-matrix-highlight dark:border dark:border-matrix-highlight/20 rounded-br-none":z.type==="tool"?"bg-white dark:bg-black border border-gray-200 dark:border-zinc-800 text-gray-800 dark:text-gray-200 rounded-bl-none":"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 text-gray-800 dark:text-matrix-secondary rounded-bl-none"}`,children:[z.type==="tool"&&f.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(z)}),f.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:x(z.content)})]}),z.type==="ai"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"prose dark:prose-invert max-w-none text-sm leading-relaxed dark:prose-p:text-matrix-secondary dark:prose-headings:text-matrix-highlight dark:prose-strong:text-matrix-highlight dark:prose-code:text-matrix-highlight",children:f.jsx(_L,{children:z.content})}),Array.isArray(z.tool_calls)&&z.tool_calls.length>0&&f.jsxs("details",{className:"mt-3 rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(z)}),f.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:x(z.tool_calls)})]})]}),z.type==="human"&&f.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:z.content}),E&&f.jsx("div",{className:"mt-3 flex justify-end",children:f.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${N}`,children:[f.jsx(lS,{size:12}),f.jsx("span",{children:v(E.input)}),f.jsx("span",{className:"opacity-60",children:"/"}),f.jsx("span",{children:v(E.output)}),f.jsx(sS,{size:12})]})})]}),z.type==="human"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-200 dark:bg-matrix-primary/20 flex items-center justify-center flex-shrink-0 text-gray-500 dark:text-matrix-secondary",children:f.jsx(MA,{size:18})})]},T)}),n&&f.jsxs("div",{className:"flex gap-4 justify-start",children:[f.jsx("div",{className:"w-8 h-8 rounded-full bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight flex items-center justify-center flex-shrink-0",children:f.jsx(w0,{size:18})}),f.jsxs("div",{className:"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 p-4 rounded-2xl rounded-bl-none shadow-sm flex items-center gap-2",children:[f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),f.jsx("div",{ref:l})]}),f.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:f.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[f.jsx("input",{type:"text",value:o,onChange:z=>u(z.target.value),placeholder:"Type your message...",className:"flex-1 bg-gray-100 dark:bg-black/50 border border-transparent dark:border-matrix-primary/30 rounded-xl px-4 py-3 focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight outline-none transition-all dark:text-matrix-highlight dark:placeholder-matrix-secondary/50",disabled:n}),f.jsx("button",{type:"submit",disabled:!o.trim()||n,className:"p-3 bg-azure-primary text-white dark:bg-matrix-secondary dark:text-black dark:hover:bg-matrix-highlight rounded-xl hover:bg-azure-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-md",children:f.jsx(bA,{size:20})})]})})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-gray-50 dark:bg-black text-gray-400 dark:text-matrix-secondary/50 h-full",children:[f.jsx(AL,{size:48,className:"mb-4 opacity-20"}),f.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},AL=({size:e,className:t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:f.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),Ma={getSessions:async()=>ze.get("/sessions"),createSession:async()=>ze.post("/sessions",{}),deleteSession:async e=>ze.delete(`/sessions/${e}`),renameSession:async(e,t)=>ze.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>ze.post(`/sessions/${e}/archive`,{}),getMessages:async e=>ze.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>ze.post("/chat",{sessionId:e,message:t})};function H_({isOpen:e,onClose:t,onConfirm:n,title:a,description:o,confirmJson:u="Confirm",variant:l="default"}){return f.jsx(Nr,{open:e,onOpenChange:t,children:f.jsxs(Io,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),f.jsx("div",{className:"py-4",children:f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:o})}),f.jsxs(rD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[f.jsx(ir,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),f.jsx(ir,{variant:l,onClick:()=>{n(),t()},className:l==="destructive"?"dark:bg-red-900/50 dark:text-red-200 dark:hover:bg-red-800/60":"dark:bg-matrix-primary dark:text-black dark:hover:bg-matrix-highlight",children:u})]})]})})}const OL=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(null),[o,u]=j.useState([]),[l,d]=j.useState(!1),[h,m]=j.useState(!0),g=j.useRef(!1);j.useEffect(()=>{g.current=l},[l]),j.useEffect(()=>{if(!n)return;const $=setInterval(async()=>{if(!g.current)try{const M=(await Ma.getMessages(n)).filter(q=>q.type!=="system");u(q=>{if(M.length!==q.length)return M;const V=M.at(-1)?.created_at??0,X=q.at(-1)?.created_at??0;return V>X?M:q})}catch{}},3e3);return()=>clearInterval($)},[n]);const[x,b]=j.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const $=await Ma.getSessions();t($)}catch($){console.error("Failed to load sessions:",$)}};j.useEffect(()=>{v()},[]),j.useEffect(()=>{n?z(n):u([])},[n]);const z=async $=>{try{const L=await Ma.getMessages($);u(L.filter(M=>M.type!=="system"))}catch(L){console.error("Failed to load messages:",L)}},T=async()=>{try{const $=await Ma.createSession();await v(),a($.id)}catch($){console.error("Failed to create session:",$)}},E=async $=>{if(!n)return;const L={type:"human",content:$};u(M=>[...M,L]),d(!0);try{await Ma.sendMessage(n,$),await z(n),await v()}catch(M){console.error("Failed to send message:",M)}finally{d(!1)}},N=$=>{b({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await Ma.archiveSession($),n===$&&a(null),await v()}catch(L){console.error("Failed to archive session:",L)}}})},A=$=>{b({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await Ma.deleteSession($),n===$&&a(null),await v()}catch(L){console.error("Failed to delete session:",L)}}})},C=async($,L)=>{try{await Ma.renameSession($,L),await v()}catch(M){console.error("Failed to rename session:",M)}};return f.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[f.jsx(uD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:T,onArchiveSession:N,onDeleteSession:A,onRenameSession:C,isOpen:h,toggleSidebar:()=>m(!h)}),f.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:f.jsx(NL,{messages:o,onSendMessage:E,isLoading:l,activeSessionId:n})}),f.jsx(H_,{isOpen:x.isOpen,onClose:()=>b($=>({...$,isOpen:!1})),onConfirm:x.onConfirm,title:x.title,description:x.description,confirmJson:x.confirmJson,variant:x.variant})]})};function wr({title:e,description:t,children:n}){return f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg p-6 bg-azure-surface/50 dark:bg-matrix-base/50",children:[f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),f.jsx("div",{className:"space-y-4",children:n})]})}const RL=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},ML=(e,t)=>({classGroupId:e,validator:t}),F_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qc="-",Pk=[],DL="arbitrary..",$L=e=>{const t=PL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return LL(l);const d=l.split(qc),h=d[0]===""&&d.length>1?1:0;return q_(d,h,t)},getConflictingClassGroupIds:(l,d)=>{if(d){const h=a[l],m=n[l];return h?m?RL(m,h):h:m||Pk}return n[l]||Pk}}},q_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const m=q_(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const d=t===0?e.join(qc):e.slice(t).join(qc),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(d))return g.classGroupId}},LL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?DL+a:void 0})(),PL=e=>{const{theme:t,classGroups:n}=e;return UL(n,t)},UL=(e,t)=>{const n=F_();for(const a in e){const o=e[a];Yg(o,n,a,t)}return n},Yg=(e,t,n,a)=>{const o=e.length;for(let u=0;u<o;u++){const l=e[u];VL(l,t,n,a)}},VL=(e,t,n,a)=>{if(typeof e=="string"){BL(e,t,n);return}if(typeof e=="function"){ZL(e,t,n,a);return}IL(e,t,n,a)},BL=(e,t,n)=>{const a=e===""?t:G_(t,e);a.classGroupId=n},ZL=(e,t,n,a)=>{if(HL(e)){Yg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(ML(n,e))},IL=(e,t,n,a)=>{const o=Object.entries(e),u=o.length;for(let l=0;l<u;l++){const[d,h]=o[l];Yg(h,G_(t,d),n,a)}},G_=(e,t)=>{let n=e;const a=t.split(qc),o=a.length;for(let u=0;u<o;u++){const l=a[u];let d=n.nextPart.get(l);d||(d=F_(),n.nextPart.set(l,d)),n=d}return n},HL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,FL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(u,l)=>{n[u]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(u){let l=n[u];if(l!==void 0)return l;if((l=a[u])!==void 0)return o(u,l),l},set(u,l){u in n?n[u]=l:o(u,l)}}},Mp="!",Uk=":",qL=[],Vk=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),GL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const u=[];let l=0,d=0,h=0,m;const g=o.length;for(let T=0;T<g;T++){const E=o[T];if(l===0&&d===0){if(E===Uk){u.push(o.slice(h,T)),h=T+1;continue}if(E==="/"){m=T;continue}}E==="["?l++:E==="]"?l--:E==="("?d++:E===")"&&d--}const x=u.length===0?o:o.slice(h);let b=x,v=!1;x.endsWith(Mp)?(b=x.slice(0,-1),v=!0):x.startsWith(Mp)&&(b=x.slice(1),v=!0);const z=m&&m>h?m-h:void 0;return Vk(u,v,b,z)};if(t){const o=t+Uk,u=a;a=l=>l.startsWith(o)?u(l.slice(o.length)):Vk(qL,!1,l,void 0,!0)}if(n){const o=a;a=u=>n({className:u,parseClassName:o})}return a},YL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let u=0;u<n.length;u++){const l=n[u],d=l[0]==="[",h=t.has(l);d||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(l)):o.push(l)}return o.length>0&&(o.sort(),a.push(...o)),a}},XL=e=>({cache:FL(e.cacheSize),parseClassName:GL(e),sortModifiers:YL(e),...$L(e)}),KL=/\s+/,JL=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:u}=t,l=[],d=e.trim().split(KL);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:x,modifiers:b,hasImportantModifier:v,baseClassName:z,maybePostfixModifierPosition:T}=n(g);if(x){h=g+(h.length>0?" "+h:h);continue}let E=!!T,N=a(E?z.substring(0,T):z);if(!N){if(!E){h=g+(h.length>0?" "+h:h);continue}if(N=a(z),!N){h=g+(h.length>0?" "+h:h);continue}E=!1}const A=b.length===0?"":b.length===1?b[0]:u(b).join(":"),C=v?A+Mp:A,$=C+N;if(l.indexOf($)>-1)continue;l.push($);const L=o(N,E);for(let M=0;M<L.length;++M){const q=L[M];l.push(C+q)}h=g+(h.length>0?" "+h:h)}return h},QL=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Y_(n))&&(o&&(o+=" "),o+=a);return o},Y_=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Y_(e[a]))&&(n&&(n+=" "),n+=t);return n},WL=(e,...t)=>{let n,a,o,u;const l=h=>{const m=t.reduce((g,x)=>x(g),e());return n=XL(m),a=n.cache.get,o=n.cache.set,u=d,d(h)},d=h=>{const m=a(h);if(m)return m;const g=JL(h,n);return o(h,g),g};return u=l,(...h)=>u(QL(...h))},e9=[],Gt=e=>{const t=n=>n[e]||e9;return t.isThemeGetter=!0,t},X_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,t9=/^\d+\/\d+$/,n9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r9=/\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$/,a9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,o9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ko=e=>t9.test(e),Me=e=>!!e&&!Number.isNaN(Number(e)),Da=e=>!!e&&Number.isInteger(Number(e)),Tm=e=>e.endsWith("%")&&Me(e.slice(0,-1)),ea=e=>n9.test(e),s9=()=>!0,l9=e=>r9.test(e)&&!a9.test(e),J_=()=>!1,u9=e=>i9.test(e),c9=e=>o9.test(e),d9=e=>!ge(e)&&!ye(e),f9=e=>ts(e,e2,J_),ge=e=>X_.test(e),yi=e=>ts(e,t2,l9),Cm=e=>ts(e,y9,Me),Bk=e=>ts(e,Q_,J_),h9=e=>ts(e,W_,c9),gc=e=>ts(e,n2,u9),ye=e=>K_.test(e),il=e=>ns(e,t2),m9=e=>ns(e,x9),Zk=e=>ns(e,Q_),p9=e=>ns(e,e2),g9=e=>ns(e,W_),yc=e=>ns(e,n2,!0),ts=(e,t,n)=>{const a=X_.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},ns=(e,t,n=!1)=>{const a=K_.exec(e);return a?a[1]?t(a[1]):n:!1},Q_=e=>e==="position"||e==="percentage",W_=e=>e==="image"||e==="url",e2=e=>e==="length"||e==="size"||e==="bg-size",t2=e=>e==="length",y9=e=>e==="number",x9=e=>e==="family-name",n2=e=>e==="shadow",b9=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),a=Gt("font-weight"),o=Gt("tracking"),u=Gt("leading"),l=Gt("breakpoint"),d=Gt("container"),h=Gt("spacing"),m=Gt("radius"),g=Gt("shadow"),x=Gt("inset-shadow"),b=Gt("text-shadow"),v=Gt("drop-shadow"),z=Gt("blur"),T=Gt("perspective"),E=Gt("aspect"),N=Gt("ease"),A=Gt("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...$(),ye,ge],M=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],V=()=>[ye,ge,h],X=()=>[ko,"full","auto",...V()],ce=()=>[Da,"none","subgrid",ye,ge],Q=()=>["auto",{span:["full",Da,ye,ge]},Da,ye,ge],se=()=>[Da,"auto",ye,ge],te=()=>["auto","min","max","fr",ye,ge],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...V()],K=()=>[ko,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],B=()=>[e,ye,ge],he=()=>[...$(),Zk,Bk,{position:[ye,ge]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",p9,f9,{size:[ye,ge]}],H=()=>[Tm,il,yi],w=()=>["","none","full",m,ye,ge],G=()=>["",Me,il,yi],de=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Me,Tm,Zk,Bk],De=()=>["","none",z,ye,ge],Ne=()=>["none",Me,ye,ge],kt=()=>["none",Me,ye,ge],It=()=>[Me,ye,ge],fn=()=>[ko,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ea],breakpoint:[ea],color:[s9],container:[ea],"drop-shadow":[ea],ease:["in","out","in-out"],font:[d9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ea],shadow:[ea],spacing:["px",Me],text:[ea],"text-shadow":[ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ko,ge,ye,E]}],container:["container"],columns:[{columns:[Me,ge,ye,d]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:L()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{start:X()}],end:[{end:X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[Da,"auto",ye,ge]}],basis:[{basis:[ko,"full","auto",d,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,ko,"auto","initial","none",ge]}],grow:[{grow:["",Me,ye,ge]}],shrink:[{shrink:["",Me,ye,ge]}],order:[{order:[Da,"first","last","none",ye,ge]}],"grid-cols":[{"grid-cols":ce()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":ce()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[d,"screen",...K()]}],"min-w":[{"min-w":[d,"screen","none",...K()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,il,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ye,Cm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Tm,ge]}],"font-family":[{font:[m9,ge,t]}],"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:[o,ye,ge]}],"line-clamp":[{"line-clamp":[Me,"none",ye,Cm]}],leading:[{leading:[u,...V()]}],"list-image":[{"list-image":["none",ye,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ye,yi]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Me,"auto",ye,ge]}],"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",ye,ge]}],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",ye,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:he()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Da,ye,ge],radial:["",ye,ge],conic:[Da,ye,ge]},g9,h9]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:w()}],"rounded-s":[{"rounded-s":w()}],"rounded-e":[{"rounded-e":w()}],"rounded-t":[{"rounded-t":w()}],"rounded-r":[{"rounded-r":w()}],"rounded-b":[{"rounded-b":w()}],"rounded-l":[{"rounded-l":w()}],"rounded-ss":[{"rounded-ss":w()}],"rounded-se":[{"rounded-se":w()}],"rounded-ee":[{"rounded-ee":w()}],"rounded-es":[{"rounded-es":w()}],"rounded-tl":[{"rounded-tl":w()}],"rounded-tr":[{"rounded-tr":w()}],"rounded-br":[{"rounded-br":w()}],"rounded-bl":[{"rounded-bl":w()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ye,ge]}],"outline-w":[{outline:["",Me,il,yi]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,yc,gc]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",x,yc,gc]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Me,yi]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",b,yc,gc]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Me,ye,ge]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"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":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ye,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":$()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:he()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ge]}],filter:[{filter:["","none",ye,ge]}],blur:[{blur:De()}],brightness:[{brightness:[Me,ye,ge]}],contrast:[{contrast:[Me,ye,ge]}],"drop-shadow":[{"drop-shadow":["","none",v,yc,gc]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Me,ye,ge]}],"hue-rotate":[{"hue-rotate":[Me,ye,ge]}],invert:[{invert:["",Me,ye,ge]}],saturate:[{saturate:[Me,ye,ge]}],sepia:[{sepia:["",Me,ye,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ge]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ye,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ye,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ye,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ye,ge]}],"backdrop-invert":[{"backdrop-invert":["",Me,ye,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ye,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ye,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ye,ge]}],"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",ye,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ye,ge]}],ease:[{ease:["linear","initial",N,ye,ge]}],delay:[{delay:[Me,ye,ge]}],animate:[{animate:["none",A,ye,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,ye,ge]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Ne()}],"rotate-x":[{"rotate-x":Ne()}],"rotate-y":[{"rotate-y":Ne()}],"rotate-z":[{"rotate-z":Ne()}],scale:[{scale:kt()}],"scale-x":[{"scale-x":kt()}],"scale-y":[{"scale-y":kt()}],"scale-z":[{"scale-z":kt()}],"scale-3d":["scale-3d"],skew:[{skew:It()}],"skew-x":[{"skew-x":It()}],"skew-y":[{"skew-y":It()}],transform:[{transform:[ye,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fn()}],"translate-x":[{"translate-x":fn()}],"translate-y":[{"translate-y":fn()}],"translate-z":[{"translate-z":fn()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",ye,ge]}],"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-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,ge]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Me,il,yi,Cm]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Po=WL(b9);function yt({label:e,error:t,helperText:n,className:a,...o}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("input",{className:Po("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...o}),n&&!t&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&f.jsx("p",{className:"text-xs text-red-500",children:t})]})}function xi({label:e,options:t,error:n,helperText:a,className:o,...u}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("select",{className:Po("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors appearance-none",n&&"border-red-500 focus:border-red-500 focus:ring-red-500",o),...u,children:t.map(l=>f.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&f.jsx("p",{className:"text-xs text-red-500",children:n})]})}function Bn({label:e,error:t,helperText:n,className:a,...o}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("input",{type:"number",className:Po("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...o}),n&&!t&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&f.jsx("p",{className:"text-xs text-red-500",children:t})]})}function ol({label:e,checked:t,onChange:n,helperText:a,disabled:o}){return f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:Po("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",o&&"opacity-50"),children:e}),a&&f.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),f.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!o&&n(!t),className:Po("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:ring-offset-2 focus:ring-offset-azure-bg dark:focus:ring-offset-black",t?"bg-azure-primary dark:bg-matrix-highlight":"bg-slate-300 dark:bg-matrix-primary",o&&"opacity-50 cursor-not-allowed"),children:f.jsx("span",{className:Po("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const Sr={fetchConfig:async()=>ze.get("/config"),updateConfig:async e=>ze.post("/config",e),getSatiConfig:async()=>ze.get("/config/sati"),updateSatiConfig:async e=>ze.post("/config/sati",e),deleteSatiConfig:async()=>ze.delete("/config/sati"),getApocConfig:async()=>ze.get("/config/apoc"),updateApocConfig:async e=>ze.post("/config/apoc",e),deleteApocConfig:async()=>ze.delete("/config/apoc"),getNeoConfig:async()=>ze.get("/config/neo"),updateNeoConfig:async e=>ze.post("/config/neo",e),deleteNeoConfig:async()=>ze.delete("/config/neo"),getTrinityConfig:async()=>ze.get("/config/trinity"),updateTrinityConfig:async e=>ze.post("/config/trinity",e),deleteTrinityConfig:async()=>ze.delete("/config/trinity")};function ee(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=l.prototype,g=Object.keys(m);for(let x=0;x<g.length;x++){const b=g[x];b in d||(d[b]=m[b].bind(d))}}const o=n?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function l(d){var h;const m=n?.Parent?new u:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let Uo=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},r2=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const a2={};function Ha(e){return a2}function i2(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>t.indexOf(+a)===-1).map(([a,o])=>o)}function Dp(e,t){return typeof t=="bigint"?t.toString():t}function hd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Xg(e){return e==null}function Kg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function v9(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let o=(a.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(a)){const h=a.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const u=n>o?n:o,l=Number.parseInt(e.toFixed(u).replace(".","")),d=Number.parseInt(t.toFixed(u).replace(".",""));return l%d/10**u}const Ik=Symbol("evaluating");function Ye(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Ik)return a===void 0&&(a=Ik,a=n()),a},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ai(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ya(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Hk(e){return JSON.stringify(e)}function k9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const o2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function El(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const w9=hd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ho(e){if(El(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(El(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function s2(e){return Ho(e)?{...e}:Array.isArray(e)?[...e]:e}const S9=new Set(["string","number","symbol"]);function Fo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xa(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function ke(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(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 z9(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _9={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 j9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Ya(e._zod.def,{get shape(){const l={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(l[d]=n.shape[d])}return Ai(this,"shape",l),l},checks:[]});return Xa(e,u)}function T9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Ya(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete l[d]}return Ai(this,"shape",l),l},checks:[]});return Xa(e,u)}function C9(e,t){if(!Ho(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ya(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Ai(this,"shape",u),u}});return Xa(e,o)}function E9(e,t){if(!Ho(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ya(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ai(this,"shape",a),a}});return Xa(e,n)}function N9(e,t){const n=Ya(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ai(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Xa(e,n)}function A9(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ya(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Ai(this,"shape",h),h},checks:[]});return Xa(t,l)}function O9(e,t,n){const a=Ya(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:o[l]}))}else for(const l in o)u[l]=new e({type:"nonoptional",innerType:o[l]});return Ai(this,"shape",u),u}});return Xa(t,a)}function No(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ao(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function xc(e){return typeof e=="string"?e:e?.message}function Fa(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const o=xc(e.inst?._zod.def?.error?.(e))??xc(t?.error?.(e))??xc(n.customError?.(e))??xc(n.localeError?.(e))??"Invalid input";a.message=o}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Jg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const l2=(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,Dp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},u2=ee("$ZodError",l2),c2=ee("$ZodError",l2,{Parent:Error});function R9(e,t=n=>n.message){const n={},a=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:n}}function M9(e,t=n=>n.message){const n={_errors:[]},a=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],d++}}};return a(e),n}const Qg=e=>(t,n,a,o)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Uo;if(l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Fa(h,u,Ha())));throw o2(d,o?.callee),d}return l.value},Wg=e=>async(t,n,a,o)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Fa(h,u,Ha())));throw o2(d,o?.callee),d}return l.value},md=e=>(t,n,a)=>{const o=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new Uo;return u.issues.length?{success:!1,error:new(e??u2)(u.issues.map(l=>Fa(l,o,Ha())))}:{success:!0,data:u.value}},D9=md(c2),pd=e=>async(t,n,a)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Fa(l,o,Ha())))}:{success:!0,data:u.value}},$9=pd(c2),L9=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qg(e)(t,n,o)},P9=e=>(t,n,a)=>Qg(e)(t,n,a),U9=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Wg(e)(t,n,o)},V9=e=>async(t,n,a)=>Wg(e)(t,n,a),B9=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return md(e)(t,n,o)},Z9=e=>(t,n,a)=>md(e)(t,n,a),I9=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return pd(e)(t,n,o)},H9=e=>async(t,n,a)=>pd(e)(t,n,a),F9=/^[cC][^\s-]{8,}$/,q9=/^[0-9a-z]+$/,G9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Y9=/^[0-9a-vA-V]{20}$/,X9=/^[A-Za-z0-9]{27}$/,K9=/^[a-zA-Z0-9_-]{21}$/,J9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Q9=/^([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})$/,Fk=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)$/,W9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tP(){return new RegExp(eP,"u")}const nP=/^(?:(?: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])$/,rP=/^(([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}|:))$/,aP=/^((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])$/,iP=/^(([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])$/,oP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d2=/^[A-Za-z0-9_-]*$/,sP=/^\+[1-9]\d{6,14}$/,f2="(?:(?:\\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])))",lP=new RegExp(`^${f2}$`);function h2(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 uP(e){return new RegExp(`^${h2(e)}$`)}function cP(e){const t=h2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${f2}T(?:${a})$`)}const dP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fP=/^-?\d+$/,m2=/^-?\d+(?:\.\d+)?$/,hP=/^(?:true|false)$/i,mP=/^[^A-Z]*$/,pP=/^[^a-z]*$/,On=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),p2={number:"number",bigint:"bigint",object:"date"},g2=ee("$ZodCheckLessThan",(e,t)=>{On.init(e,t);const n=p2[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,u=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),y2=ee("$ZodCheckGreaterThan",(e,t)=>{On.init(e,t);const n=p2[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,u=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gP=ee("$ZodCheckMultipleOf",(e,t)=>{On.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):v9(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),yP=ee("$ZodCheckNumberFormat",(e,t)=>{On.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[o,u]=_9[t.format];e._zod.onattach.push(l=>{const d=l._zod.bag;d.format=t.format,d.minimum=o,d.maximum=u,n&&(d.pattern=fP)}),e._zod.check=l=>{const d=l.value;if(n){if(!Number.isInteger(d)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?l.issues.push({input:d,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}):l.issues.push({input:d,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}}d<o&&l.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),d>u&&l.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),xP=ee("$ZodCheckMaxLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Xg(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const o=a.value;if(o.length<=t.maximum)return;const l=Jg(o);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),bP=ee("$ZodCheckMinLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Xg(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const o=a.value;if(o.length>=t.minimum)return;const l=Jg(o);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),vP=ee("$ZodCheckLengthEquals",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Xg(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=a=>{const o=a.value,u=o.length;if(u===t.length)return;const l=Jg(o),d=u>t.length;a.issues.push({origin:l,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),gd=ee("$ZodCheckStringFormat",(e,t)=>{var n,a;On.init(e,t),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),kP=ee("$ZodCheckRegex",(e,t)=>{gd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),wP=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mP),gd.init(e,t)}),SP=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pP),gd.init(e,t)}),zP=ee("$ZodCheckIncludes",(e,t)=>{On.init(e,t);const n=Fo(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),_P=ee("$ZodCheckStartsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`^${Fo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),jP=ee("$ZodCheckEndsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`.*${Fo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),TP=ee("$ZodCheckOverwrite",(e,t)=>{On.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let CP=class{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(`
33
33
  `).filter(l=>l),o=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(o)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,o.join(`
34
- `))}};const TP={major:4,minor:3,patch:6},zt=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=TP;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)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(l,d,h)=>{let m=Eo(l),g;for(const x of d){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=x._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Po;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Eo(l,b)))});else{if(l.issues.length===b)continue;m||(m=Eo(l,b))}}return g?g.then(()=>l):l},u=(l,d,h)=>{if(Eo(l))return l.aborted=!0,l;const m=o(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new Po;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,d)):u(m,l,d)}const h=e._zod.parse(l,d);if(h instanceof Promise){if(d.async===!1)throw new Po;return h.then(m=>o(m,a,d))}return o(h,a,d)}}Ye(e,"~standard",()=>({validate:o=>{try{const u=R9(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return M9(e,o).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),ey=ee("$ZodString",(e,t)=>{zt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??uP(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),bt=ee("$ZodStringFormat",(e,t)=>{gd.init(e,t),ey.init(e,t)}),CP=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=K9),bt.init(e,t)}),EP=ee("$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=Fk(a))}else t.pattern??(t.pattern=Fk());bt.init(e,t)}),NP=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=J9),bt.init(e,t)}),AP=ee("$ZodURL",(e,t)=>{bt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),OP=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=W9()),bt.init(e,t)}),RP=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Y9),bt.init(e,t)}),MP=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=I9),bt.init(e,t)}),DP=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=H9),bt.init(e,t)}),$P=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=F9),bt.init(e,t)}),LP=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=q9),bt.init(e,t)}),PP=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=G9),bt.init(e,t)}),UP=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lP(t)),bt.init(e,t)}),VP=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oP),bt.init(e,t)}),BP=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sP(t)),bt.init(e,t)}),ZP=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=X9),bt.init(e,t)}),IP=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eP),bt.init(e,t),e._zod.bag.format="ipv4"}),HP=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tP),bt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),FP=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nP),bt.init(e,t)}),qP=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rP),bt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[o,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function x2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const GP=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=aP),bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{x2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function YP(e){if(!d2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return x2(n)}const XP=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=d2),bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{YP(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),KP=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=iP),bt.init(e,t)});function JP(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const QP=ee("$ZodJWT",(e,t)=>{bt.init(e,t),e._zod.check=n=>{JP(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),b2=ee("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??m2,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),n}}),WP=ee("$ZodNumberFormat",(e,t)=>{pP.init(e,t),b2.init(e,t)}),eU=ee("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=dP,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),tU=ee("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),nU=ee("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function qk(e,t,n){e.issues.length&&t.issues.push(...No(n,e.issues)),t.value[n]=e.value}const rU=ee("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const u=[];for(let l=0;l<o.length;l++){const d=o[l],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?u.push(h.then(m=>qk(m,n,l))):qk(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function Gc(e,t,n,a,o){if(e.issues.length){if(o&&!(n in a))return;t.issues.push(...No(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function v2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=w9(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function k2(e,t,n,a,o,u){const l=[],d=o.keySet,h=o.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const x in t){if(d.has(x))continue;if(m==="never"){l.push(x);continue}const b=h.run({value:t[x],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Gc(v,n,x,t,g))):Gc(b,n,x,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const aU=ee("$ZodObject",(e,t)=>{if(zt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=hd(()=>v2(t));Ye(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const g=d[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const x of g.values)h[m].add(x)}}return h});const o=Cl,u=t.catchall;let l;e._zod.parse=(d,h)=>{l??(l=a.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const g=[],x=l.shape;for(const b of l.keys){const v=x[b],z=v._zod.optout==="optional",T=v._zod.run({value:m[b],issues:[]},h);T instanceof Promise?g.push(T.then(E=>Gc(E,d,b,m,z))):Gc(T,d,b,m,z)}return u?k2(g,m,d,h,a.value,e):g.length?Promise.all(g).then(()=>d):d}}),iU=ee("$ZodObjectJIT",(e,t)=>{aU.init(e,t);const n=e._zod.parse,a=hd(()=>v2(t)),o=b=>{const v=new jP(["shape","payload","ctx"]),z=a.value,T=C=>{const $=Hk(C);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const C of z.keys)E[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of z.keys){const $=E[C],L=Hk(C),q=b[C]?._zod?.optout==="optional";v.write(`const ${$} = ${T(C)};`),q?v.write(`
34
+ `))}};const EP={major:4,minor:3,patch:6},zt=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=EP;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)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(l,d,h)=>{let m=No(l),g;for(const x of d){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=x._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Uo;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=No(l,b)))});else{if(l.issues.length===b)continue;m||(m=No(l,b))}}return g?g.then(()=>l):l},u=(l,d,h)=>{if(No(l))return l.aborted=!0,l;const m=o(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new Uo;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,d)):u(m,l,d)}const h=e._zod.parse(l,d);if(h instanceof Promise){if(d.async===!1)throw new Uo;return h.then(m=>o(m,a,d))}return o(h,a,d)}}Ye(e,"~standard",()=>({validate:o=>{try{const u=D9(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return $9(e,o).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),ey=ee("$ZodString",(e,t)=>{zt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dP(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),bt=ee("$ZodStringFormat",(e,t)=>{gd.init(e,t),ey.init(e,t)}),NP=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Q9),bt.init(e,t)}),AP=ee("$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=Fk(a))}else t.pattern??(t.pattern=Fk());bt.init(e,t)}),OP=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=W9),bt.init(e,t)}),RP=ee("$ZodURL",(e,t)=>{bt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),MP=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tP()),bt.init(e,t)}),DP=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=K9),bt.init(e,t)}),$P=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=F9),bt.init(e,t)}),LP=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=q9),bt.init(e,t)}),PP=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=G9),bt.init(e,t)}),UP=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Y9),bt.init(e,t)}),VP=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=X9),bt.init(e,t)}),BP=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cP(t)),bt.init(e,t)}),ZP=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=lP),bt.init(e,t)}),IP=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=uP(t)),bt.init(e,t)}),HP=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=J9),bt.init(e,t)}),FP=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=nP),bt.init(e,t),e._zod.bag.format="ipv4"}),qP=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rP),bt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),GP=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=aP),bt.init(e,t)}),YP=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=iP),bt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[o,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function x2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const XP=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=oP),bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{x2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function KP(e){if(!d2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return x2(n)}const JP=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=d2),bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{KP(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),QP=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=sP),bt.init(e,t)});function WP(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const eU=ee("$ZodJWT",(e,t)=>{bt.init(e,t),e._zod.check=n=>{WP(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),b2=ee("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??m2,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),n}}),tU=ee("$ZodNumberFormat",(e,t)=>{yP.init(e,t),b2.init(e,t)}),nU=ee("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=hP,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),rU=ee("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),aU=ee("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function qk(e,t,n){e.issues.length&&t.issues.push(...Ao(n,e.issues)),t.value[n]=e.value}const iU=ee("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const u=[];for(let l=0;l<o.length;l++){const d=o[l],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?u.push(h.then(m=>qk(m,n,l))):qk(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function Gc(e,t,n,a,o){if(e.issues.length){if(o&&!(n in a))return;t.issues.push(...Ao(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function v2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=z9(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function k2(e,t,n,a,o,u){const l=[],d=o.keySet,h=o.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const x in t){if(d.has(x))continue;if(m==="never"){l.push(x);continue}const b=h.run({value:t[x],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Gc(v,n,x,t,g))):Gc(b,n,x,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const oU=ee("$ZodObject",(e,t)=>{if(zt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=hd(()=>v2(t));Ye(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const g=d[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const x of g.values)h[m].add(x)}}return h});const o=El,u=t.catchall;let l;e._zod.parse=(d,h)=>{l??(l=a.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const g=[],x=l.shape;for(const b of l.keys){const v=x[b],z=v._zod.optout==="optional",T=v._zod.run({value:m[b],issues:[]},h);T instanceof Promise?g.push(T.then(E=>Gc(E,d,b,m,z))):Gc(T,d,b,m,z)}return u?k2(g,m,d,h,a.value,e):g.length?Promise.all(g).then(()=>d):d}}),sU=ee("$ZodObjectJIT",(e,t)=>{oU.init(e,t);const n=e._zod.parse,a=hd(()=>v2(t)),o=b=>{const v=new CP(["shape","payload","ctx"]),z=a.value,T=C=>{const $=Hk(C);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const C of z.keys)E[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of z.keys){const $=E[C],L=Hk(C),q=b[C]?._zod?.optout==="optional";v.write(`const ${$} = ${T(C)};`),q?v.write(`
35
35
  if (${$}.issues.length) {
36
36
  if (${L} in input) {
37
37
  payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
@@ -65,11 +65,11 @@ Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}
65
65
  newResult[${L}] = ${$}.value;
66
66
  }
67
67
 
68
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(C,$)=>A(b,C,$)};let u;const l=Cl,d=!a2.jitless,m=d&&v9.value,g=t.catchall;let x;e._zod.parse=(b,v)=>{x??(x=a.value);const z=b.value;return l(z)?d&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=o(t.shape)),b=u(b,v),g?k2([],z,b,v,x,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),b)}});function Gk(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const o=e.filter(u=>!Eo(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Fa(l,a,Ha())))}),t)}const w2=ee("$ZodUnion",(e,t)=>{zt.init(e,t),Ye(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ye(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ye(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ye(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>Kg(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(n)return a(o,u);let l=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:o.value,issues:[]},u);if(m instanceof Promise)d.push(m),l=!0;else{if(m.issues.length===0)return m;d.push(m)}}return l?Promise.all(d).then(h=>Gk(h,o,e,u)):Gk(d,o,e,u)}}),oU=ee("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,w2.init(e,t);const n=e._zod.parse;Ye(e._zod,"propValues",()=>{const o={};for(const u of t.options){const l=u._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const[d,h]of Object.entries(l)){o[d]||(o[d]=new Set);for(const m of h)o[d].add(m)}}return o});const a=hd(()=>{const o=t.options,u=new Map;for(const l of o){const d=l._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const h of d){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,l)}}return u});e._zod.parse=(o,u)=>{const l=o.value;if(!Cl(l))return o.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),o;const d=a.value.get(l?.[t.discriminator]);return d?d._zod.run(o,u):t.unionFallback?n(o,u):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),o)}}),sU=ee("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value,u=t.left._zod.run({value:o,issues:[]},a),l=t.right._zod.run({value:o,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>Yk(n,h,m)):Yk(n,u,l)}});function $p(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(Io(e)&&Io(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),o={...e,...t};for(const u of a){const l=$p(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};o[u]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const o=e[a],u=t[a],l=$p(o,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Yk(e,t,n){const a=new Map;let o;for(const d of t.issues)if(d.code==="unrecognized_keys"){o??(o=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&o&&e.issues.push({...o,keys:u}),Eo(e))return e;const l=$p(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const lU=ee("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Io(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const u=[],l=t.keyType._zod.values;if(l){n.value={};const d=new Set;for(const m of l)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);const g=t.valueType._zod.run({value:o[m],issues:[]},a);g instanceof Promise?u.push(g.then(x=>{x.issues.length&&n.issues.push(...No(m,x.issues)),n.value[m]=x.value})):(g.issues.length&&n.issues.push(...No(m,g.issues)),n.value[m]=g.value)}let h;for(const m in o)d.has(m)||(h=h??[],h.push(m));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:h})}else{n.value={};for(const d of Reflect.ownKeys(o)){if(d==="__proto__")continue;let h=t.keyType._zod.run({value:d,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&m2.test(d)&&h.issues.length){const x=t.keyType._zod.run({value:Number(d),issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(h=x)}if(h.issues.length){t.mode==="loose"?n.value[d]=o[d]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>Fa(x,a,Ha())),input:d,path:[d],inst:e});continue}const g=t.valueType._zod.run({value:o[d],issues:[]},a);g instanceof Promise?u.push(g.then(x=>{x.issues.length&&n.issues.push(...No(d,x.issues)),n.value[h.value]=x.value})):(g.issues.length&&n.issues.push(...No(d,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),uU=ee("$ZodEnum",(e,t)=>{zt.init(e,t);const n=i2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(o=>k9.has(typeof o)).map(o=>typeof o=="string"?Ho(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const l=o.value;return a.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),cU=ee("$ZodLiteral",(e,t)=>{if(zt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Ho(a):a?Ho(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,o)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),dU=ee("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new r2(e.constructor.name);const o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new Po;return n.value=o,n}});function Xk(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const S2=ee("$ZodOptional",(e,t)=>{zt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ye(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ye(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kg(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>Xk(u,n.value)):Xk(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),fU=ee("$ZodExactOptional",(e,t)=>{S2.init(e,t),Ye(e._zod,"values",()=>t.innerType._zod.values),Ye(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),hU=ee("$ZodNullable",(e,t)=>{zt.init(e,t),Ye(e._zod,"optin",()=>t.innerType._zod.optin),Ye(e._zod,"optout",()=>t.innerType._zod.optout),Ye(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kg(n.source)}|null)$`):void 0}),Ye(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),mU=ee("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>Kk(u,t)):Kk(o,t)}});function Kk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const pU=ee("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),gU=ee("$ZodNonOptional",(e,t)=>{zt.init(e,t),Ye(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>Jk(u,e)):Jk(o,e)}});function Jk(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 yU=ee("$ZodCatch",(e,t)=>{zt.init(e,t),Ye(e._zod,"optin",()=>t.innerType._zod.optin),Ye(e._zod,"optout",()=>t.innerType._zod.optout),Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Fa(l,a,Ha()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>Fa(u,a,Ha()))},input:n.value}),n.issues=[]),n)}}),xU=ee("$ZodPipe",(e,t)=>{zt.init(e,t),Ye(e._zod,"values",()=>t.in._zod.values),Ye(e._zod,"optin",()=>t.in._zod.optin),Ye(e._zod,"optout",()=>t.out._zod.optout),Ye(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>xc(l,t.in,a)):xc(u,t.in,a)}const o=t.in._zod.run(n,a);return o instanceof Promise?o.then(u=>xc(u,t.out,a)):xc(o,t.out,a)}});function xc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const bU=ee("$ZodReadonly",(e,t)=>{zt.init(e,t),Ye(e._zod,"propValues",()=>t.innerType._zod.propValues),Ye(e._zod,"values",()=>t.innerType._zod.values),Ye(e._zod,"optin",()=>t.innerType?._zod?.optin),Ye(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(Qk):Qk(o)}});function Qk(e){return e.value=Object.freeze(e.value),e}const vU=ee("$ZodCustom",(e,t)=>{On.init(e,t),zt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,o=t.fn(a);if(o instanceof Promise)return o.then(u=>Wk(u,n,a,e));Wk(o,n,a,e)}});function Wk(e,t,n,a){if(!e){const o={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),t.issues.push(El(o))}}var ew;let kU=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[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 n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const o={...a,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function wU(){return new kU}(ew=globalThis).__zod_globalRegistry??(ew.__zod_globalRegistry=wU());const ul=globalThis.__zod_globalRegistry;function SU(e,t){return new e({type:"string",...ke(t)})}function zU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function tw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function _U(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function jU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function TU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function CU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function EU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function NU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function AU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function OU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function RU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function MU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function DU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function $U(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function LU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function PU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function UU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function VU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function BU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function ZU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function IU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function HU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function FU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function qU(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function GU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function YU(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function XU(e,t){return new e({type:"number",checks:[],...ke(t)})}function KU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}function JU(e,t){return new e({type:"boolean",...ke(t)})}function QU(e){return new e({type:"unknown"})}function WU(e,t){return new e({type:"never",...ke(t)})}function nw(e,t){return new g2({check:"less_than",...ke(t),value:e,inclusive:!1})}function Em(e,t){return new g2({check:"less_than",...ke(t),value:e,inclusive:!0})}function rw(e,t){return new y2({check:"greater_than",...ke(t),value:e,inclusive:!1})}function Nm(e,t){return new y2({check:"greater_than",...ke(t),value:e,inclusive:!0})}function aw(e,t){return new mP({check:"multiple_of",...ke(t),value:e})}function z2(e,t){return new gP({check:"max_length",...ke(t),maximum:e})}function Yc(e,t){return new yP({check:"min_length",...ke(t),minimum:e})}function _2(e,t){return new xP({check:"length_equals",...ke(t),length:e})}function e8(e,t){return new bP({check:"string_format",format:"regex",...ke(t),pattern:e})}function t8(e){return new vP({check:"string_format",format:"lowercase",...ke(e)})}function n8(e){return new kP({check:"string_format",format:"uppercase",...ke(e)})}function r8(e,t){return new wP({check:"string_format",format:"includes",...ke(t),includes:e})}function a8(e,t){return new SP({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function i8(e,t){return new zP({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function ns(e){return new _P({check:"overwrite",tx:e})}function o8(e){return ns(t=>t.normalize(e))}function s8(){return ns(e=>e.trim())}function l8(){return ns(e=>e.toLowerCase())}function u8(){return ns(e=>e.toUpperCase())}function c8(){return ns(e=>b9(e))}function d8(e,t,n){return new e({type:"array",element:t,...ke(n)})}function f8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function h8(e){const t=m8(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(El(a,n.value,t._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(El(o))}},e(n.value,n)));return t}function m8(e,t){const n=new On({check:"custom",...ke(t)});return n._zod.check=e,n}function j2(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ul,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vt(e,t,n={path:[],schemaPath:[]}){var a;const o=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const d=e._zod.toJSONSchema?.();if(d)l.schema=d;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,b,g)}const x=e._zod.parent;x&&(l.ref||(l.ref=x),Vt(x,t,g),t.seen.get(x).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&gn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function T2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const d=e.metadataRegistry.get(l[0])?.id;if(d){const h=a.get(d);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,l[0])}}const o=l=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(l[0])?.id,b=e.external.uri??(z=>z);if(x)return{ref:b(x)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(l[1]===n)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:h,defId:m}=o(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const x in g)delete g[x];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
68
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(C,$)=>A(b,C,$)};let u;const l=El,d=!a2.jitless,m=d&&w9.value,g=t.catchall;let x;e._zod.parse=(b,v)=>{x??(x=a.value);const z=b.value;return l(z)?d&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=o(t.shape)),b=u(b,v),g?k2([],z,b,v,x,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),b)}});function Gk(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const o=e.filter(u=>!No(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Fa(l,a,Ha())))}),t)}const w2=ee("$ZodUnion",(e,t)=>{zt.init(e,t),Ye(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ye(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ye(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ye(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>Kg(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(n)return a(o,u);let l=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:o.value,issues:[]},u);if(m instanceof Promise)d.push(m),l=!0;else{if(m.issues.length===0)return m;d.push(m)}}return l?Promise.all(d).then(h=>Gk(h,o,e,u)):Gk(d,o,e,u)}}),lU=ee("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,w2.init(e,t);const n=e._zod.parse;Ye(e._zod,"propValues",()=>{const o={};for(const u of t.options){const l=u._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const[d,h]of Object.entries(l)){o[d]||(o[d]=new Set);for(const m of h)o[d].add(m)}}return o});const a=hd(()=>{const o=t.options,u=new Map;for(const l of o){const d=l._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const h of d){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,l)}}return u});e._zod.parse=(o,u)=>{const l=o.value;if(!El(l))return o.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),o;const d=a.value.get(l?.[t.discriminator]);return d?d._zod.run(o,u):t.unionFallback?n(o,u):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),o)}}),uU=ee("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value,u=t.left._zod.run({value:o,issues:[]},a),l=t.right._zod.run({value:o,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>Yk(n,h,m)):Yk(n,u,l)}});function $p(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(Ho(e)&&Ho(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),o={...e,...t};for(const u of a){const l=$p(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};o[u]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const o=e[a],u=t[a],l=$p(o,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Yk(e,t,n){const a=new Map;let o;for(const d of t.issues)if(d.code==="unrecognized_keys"){o??(o=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&o&&e.issues.push({...o,keys:u}),No(e))return e;const l=$p(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const cU=ee("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Ho(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const u=[],l=t.keyType._zod.values;if(l){n.value={};const d=new Set;for(const m of l)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);const g=t.valueType._zod.run({value:o[m],issues:[]},a);g instanceof Promise?u.push(g.then(x=>{x.issues.length&&n.issues.push(...Ao(m,x.issues)),n.value[m]=x.value})):(g.issues.length&&n.issues.push(...Ao(m,g.issues)),n.value[m]=g.value)}let h;for(const m in o)d.has(m)||(h=h??[],h.push(m));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:h})}else{n.value={};for(const d of Reflect.ownKeys(o)){if(d==="__proto__")continue;let h=t.keyType._zod.run({value:d,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&m2.test(d)&&h.issues.length){const x=t.keyType._zod.run({value:Number(d),issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(h=x)}if(h.issues.length){t.mode==="loose"?n.value[d]=o[d]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>Fa(x,a,Ha())),input:d,path:[d],inst:e});continue}const g=t.valueType._zod.run({value:o[d],issues:[]},a);g instanceof Promise?u.push(g.then(x=>{x.issues.length&&n.issues.push(...Ao(d,x.issues)),n.value[h.value]=x.value})):(g.issues.length&&n.issues.push(...Ao(d,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),dU=ee("$ZodEnum",(e,t)=>{zt.init(e,t);const n=i2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(o=>S9.has(typeof o)).map(o=>typeof o=="string"?Fo(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const l=o.value;return a.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),fU=ee("$ZodLiteral",(e,t)=>{if(zt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Fo(a):a?Fo(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,o)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),hU=ee("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new r2(e.constructor.name);const o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new Uo;return n.value=o,n}});function Xk(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const S2=ee("$ZodOptional",(e,t)=>{zt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ye(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ye(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kg(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>Xk(u,n.value)):Xk(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),mU=ee("$ZodExactOptional",(e,t)=>{S2.init(e,t),Ye(e._zod,"values",()=>t.innerType._zod.values),Ye(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),pU=ee("$ZodNullable",(e,t)=>{zt.init(e,t),Ye(e._zod,"optin",()=>t.innerType._zod.optin),Ye(e._zod,"optout",()=>t.innerType._zod.optout),Ye(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kg(n.source)}|null)$`):void 0}),Ye(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),gU=ee("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>Kk(u,t)):Kk(o,t)}});function Kk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yU=ee("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),xU=ee("$ZodNonOptional",(e,t)=>{zt.init(e,t),Ye(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>Jk(u,e)):Jk(o,e)}});function Jk(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 bU=ee("$ZodCatch",(e,t)=>{zt.init(e,t),Ye(e._zod,"optin",()=>t.innerType._zod.optin),Ye(e._zod,"optout",()=>t.innerType._zod.optout),Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Fa(l,a,Ha()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>Fa(u,a,Ha()))},input:n.value}),n.issues=[]),n)}}),vU=ee("$ZodPipe",(e,t)=>{zt.init(e,t),Ye(e._zod,"values",()=>t.in._zod.values),Ye(e._zod,"optin",()=>t.in._zod.optin),Ye(e._zod,"optout",()=>t.out._zod.optout),Ye(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>bc(l,t.in,a)):bc(u,t.in,a)}const o=t.in._zod.run(n,a);return o instanceof Promise?o.then(u=>bc(u,t.out,a)):bc(o,t.out,a)}});function bc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const kU=ee("$ZodReadonly",(e,t)=>{zt.init(e,t),Ye(e._zod,"propValues",()=>t.innerType._zod.propValues),Ye(e._zod,"values",()=>t.innerType._zod.values),Ye(e._zod,"optin",()=>t.innerType?._zod?.optin),Ye(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(Qk):Qk(o)}});function Qk(e){return e.value=Object.freeze(e.value),e}const wU=ee("$ZodCustom",(e,t)=>{On.init(e,t),zt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,o=t.fn(a);if(o instanceof Promise)return o.then(u=>Wk(u,n,a,e));Wk(o,n,a,e)}});function Wk(e,t,n,a){if(!e){const o={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),t.issues.push(Nl(o))}}var ew;let SU=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[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 n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const o={...a,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function zU(){return new SU}(ew=globalThis).__zod_globalRegistry??(ew.__zod_globalRegistry=zU());const cl=globalThis.__zod_globalRegistry;function _U(e,t){return new e({type:"string",...ke(t)})}function jU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function tw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function TU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function CU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function EU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function NU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function AU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function OU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function RU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function MU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function DU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function $U(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function LU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function PU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function UU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function VU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function BU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function ZU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function IU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function HU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function FU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function qU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function GU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function YU(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function XU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function KU(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function JU(e,t){return new e({type:"number",checks:[],...ke(t)})}function QU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}function WU(e,t){return new e({type:"boolean",...ke(t)})}function e8(e){return new e({type:"unknown"})}function t8(e,t){return new e({type:"never",...ke(t)})}function nw(e,t){return new g2({check:"less_than",...ke(t),value:e,inclusive:!1})}function Em(e,t){return new g2({check:"less_than",...ke(t),value:e,inclusive:!0})}function rw(e,t){return new y2({check:"greater_than",...ke(t),value:e,inclusive:!1})}function Nm(e,t){return new y2({check:"greater_than",...ke(t),value:e,inclusive:!0})}function aw(e,t){return new gP({check:"multiple_of",...ke(t),value:e})}function z2(e,t){return new xP({check:"max_length",...ke(t),maximum:e})}function Yc(e,t){return new bP({check:"min_length",...ke(t),minimum:e})}function _2(e,t){return new vP({check:"length_equals",...ke(t),length:e})}function n8(e,t){return new kP({check:"string_format",format:"regex",...ke(t),pattern:e})}function r8(e){return new wP({check:"string_format",format:"lowercase",...ke(e)})}function a8(e){return new SP({check:"string_format",format:"uppercase",...ke(e)})}function i8(e,t){return new zP({check:"string_format",format:"includes",...ke(t),includes:e})}function o8(e,t){return new _P({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function s8(e,t){return new jP({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function rs(e){return new TP({check:"overwrite",tx:e})}function l8(e){return rs(t=>t.normalize(e))}function u8(){return rs(e=>e.trim())}function c8(){return rs(e=>e.toLowerCase())}function d8(){return rs(e=>e.toUpperCase())}function f8(){return rs(e=>k9(e))}function h8(e,t,n){return new e({type:"array",element:t,...ke(n)})}function m8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function p8(e){const t=g8(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Nl(a,n.value,t._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Nl(o))}},e(n.value,n)));return t}function g8(e,t){const n=new On({check:"custom",...ke(t)});return n._zod.check=e,n}function j2(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??cl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vt(e,t,n={path:[],schemaPath:[]}){var a;const o=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const d=e._zod.toJSONSchema?.();if(d)l.schema=d;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,b,g)}const x=e._zod.parent;x&&(l.ref||(l.ref=x),Vt(x,t,g),t.seen.get(x).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&gn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function T2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const d=e.metadataRegistry.get(l[0])?.id;if(d){const h=a.get(d);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,l[0])}}const o=l=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(l[0])?.id,b=e.external.uri??(z=>z);if(x)return{ref:b(x)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(l[1]===n)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:h,defId:m}=o(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const x in g)delete g[x];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
69
69
 
70
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(d.cycle){u(l);continue}if(d.count>1&&e.reused==="ref"){u(l);continue}}}function C2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const d=e.seen.get(l);if(d.ref===null)return;const h=d.def??d.schema,m={...h},g=d.ref;if(d.ref=null,g){a(g);const b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const T in h)T==="$ref"||T==="allOf"||T in m||delete h[T];if(v.$ref&&b.def)for(const T in h)T==="$ref"||T==="allOf"||T in b.def&&JSON.stringify(h[T])===JSON.stringify(b.def[T])&&delete h[T]}const x=l._zod.parent;if(x&&x!==g){a(x);const b=e.seen.get(x);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path:d.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xc(t,"input",e.processors),output:Xc(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return gn(a.element,n);if(a.type==="set")return gn(a.valueType,n);if(a.type==="lazy")return gn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return gn(a.innerType,n);if(a.type==="intersection")return gn(a.left,n)||gn(a.right,n);if(a.type==="record"||a.type==="map")return gn(a.keyType,n)||gn(a.valueType,n);if(a.type==="pipe")return gn(a.in,n)||gn(a.out,n);if(a.type==="object"){for(const o in a.shape)if(gn(a.shape[o],n))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(gn(o,n))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(gn(o,n))return!0;return!!(a.rest&&gn(a.rest,n))}return!1}const p8=(e,t={})=>n=>{const a=j2({...n,processors:t});return Vt(e,a),T2(a,e),C2(a,e)},Xc=(e,t,n={})=>a=>{const{libraryOptions:o,target:u}=a??{},l=j2({...o??{},target:u,io:t,processors:n});return Vt(e,l),T2(l,e),C2(l,e)},g8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},y8=(e,t,n,a)=>{const o=n;o.type="string";const{minimum:u,maximum:l,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(o.minLength=u),typeof l=="number"&&(o.maxLength=l),d&&(o.format=g8[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),m&&(o.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},x8=(e,t,n,a)=>{const o=n,{minimum:u,maximum:l,format:d,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof d=="string"&&d.includes("int")?o.type="integer":o.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=g,o.exclusiveMinimum=!0):o.exclusiveMinimum=g),typeof u=="number"&&(o.minimum=u,typeof g=="number"&&t.target!=="draft-04"&&(g>=u?delete o.minimum:delete o.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=m,o.exclusiveMaximum=!0):o.exclusiveMaximum=m),typeof l=="number"&&(o.maximum=l,typeof m=="number"&&t.target!=="draft-04"&&(m<=l?delete o.maximum:delete o.exclusiveMaximum)),typeof h=="number"&&(o.multipleOf=h)},b8=(e,t,n,a)=>{n.type="boolean"},v8=(e,t,n,a)=>{n.not={}},k8=(e,t,n,a)=>{},w8=(e,t,n,a)=>{const o=e._zod.def,u=i2(o.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},S8=(e,t,n,a)=>{const o=e._zod.def,u=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},z8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},j8=(e,t,n,a)=>{const o=n,u=e._zod.def,{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=Vt(u.element,t,{...a,path:[...a.path,"items"]})},T8=(e,t,n,a)=>{const o=n,u=e._zod.def;o.type="object",o.properties={};const l=u.shape;for(const m in l)o.properties[m]=Vt(l[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(l)),h=new Set([...d].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(o.required=Array.from(h)),u.catchall?._zod.def.type==="never"?o.additionalProperties=!1:u.catchall?u.catchall&&(o.additionalProperties=Vt(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},C8=(e,t,n,a)=>{const o=e._zod.def,u=o.inclusive===!1,l=o.options.map((d,h)=>Vt(d,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},E8=(e,t,n,a)=>{const o=e._zod.def,u=Vt(o.left,t,{...a,path:[...a.path,"allOf",0]}),l=Vt(o.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(u)?u.allOf:[u],...d(l)?l.allOf:[l]];n.allOf=h},N8=(e,t,n,a)=>{const o=n,u=e._zod.def;o.type="object";const l=u.keyType,h=l._zod.bag?.patterns;if(u.mode==="loose"&&h&&h.size>0){const g=Vt(u.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});o.patternProperties={};for(const x of h)o.patternProperties[x.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Vt(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),o.additionalProperties=Vt(u.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=l._zod.values;if(m){const g=[...m].filter(x=>typeof x=="string"||typeof x=="number");g.length>0&&(o.required=g)}},A8=(e,t,n,a)=>{const o=e._zod.def,u=Vt(o.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},O8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},R8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},M8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},D8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},$8=(e,t,n,a)=>{const o=e._zod.def,u=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Vt(u,t,a);const l=t.seen.get(e);l.ref=u},L8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.readOnly=!0},E2=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},P8=ee("ZodISODateTime",(e,t)=>{UP.init(e,t),jt.init(e,t)});function U8(e){return FU(P8,e)}const V8=ee("ZodISODate",(e,t)=>{VP.init(e,t),jt.init(e,t)});function B8(e){return qU(V8,e)}const Z8=ee("ZodISOTime",(e,t)=>{BP.init(e,t),jt.init(e,t)});function I8(e){return GU(Z8,e)}const H8=ee("ZodISODuration",(e,t)=>{ZP.init(e,t),jt.init(e,t)});function F8(e){return YU(H8,e)}const q8=(e,t)=>{u2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>O9(e,n)},flatten:{value:n=>A9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Dp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Dp,2)}},isEmpty:{get(){return e.issues.length===0}}})},lr=ee("ZodError",q8,{Parent:Error}),G8=Qg(lr),Y8=Wg(lr),X8=md(lr),K8=pd(lr),J8=D9(lr),Q8=$9(lr),W8=L9(lr),eV=P9(lr),tV=U9(lr),nV=V9(lr),rV=B9(lr),aV=Z9(lr),_t=ee("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xc(e,"input"),output:Xc(e,"output")}}),e.toJSONSchema=p8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ya(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Xa(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>G8(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>X8(e,n,a),e.parseAsync=async(n,a)=>Y8(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>K8(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>J8(e,n,a),e.decode=(n,a)=>Q8(e,n,a),e.encodeAsync=async(n,a)=>W8(e,n,a),e.decodeAsync=async(n,a)=>eV(e,n,a),e.safeEncode=(n,a)=>tV(e,n,a),e.safeDecode=(n,a)=>nV(e,n,a),e.safeEncodeAsync=async(n,a)=>rV(e,n,a),e.safeDecodeAsync=async(n,a)=>aV(e,n,a),e.refine=(n,a)=>e.check(QV(n,a)),e.superRefine=n=>e.check(WV(n)),e.overwrite=n=>e.check(ns(n)),e.optional=()=>uw(e),e.exactOptional=()=>UV(e),e.nullable=()=>cw(e),e.nullish=()=>uw(cw(e)),e.nonoptional=n=>FV(e,n),e.array=()=>Nl(e),e.or=n=>R2([e,n]),e.and=n=>RV(e,n),e.transform=n=>dw(e,LV(n)),e.default=n=>ZV(e,n),e.prefault=n=>HV(e,n),e.catch=n=>GV(e,n),e.pipe=n=>dw(e,n),e.readonly=()=>KV(e),e.describe=n=>{const a=e.clone();return ul.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return ul.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ul.get(e);const a=e.clone();return ul.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),N2=ee("_ZodString",(e,t)=>{ey.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,u)=>y8(e,a,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(e8(...a)),e.includes=(...a)=>e.check(r8(...a)),e.startsWith=(...a)=>e.check(a8(...a)),e.endsWith=(...a)=>e.check(i8(...a)),e.min=(...a)=>e.check(Yc(...a)),e.max=(...a)=>e.check(z2(...a)),e.length=(...a)=>e.check(_2(...a)),e.nonempty=(...a)=>e.check(Yc(1,...a)),e.lowercase=a=>e.check(t8(a)),e.uppercase=a=>e.check(n8(a)),e.trim=()=>e.check(s8()),e.normalize=(...a)=>e.check(o8(...a)),e.toLowerCase=()=>e.check(l8()),e.toUpperCase=()=>e.check(u8()),e.slugify=()=>e.check(c8())}),iV=ee("ZodString",(e,t)=>{ey.init(e,t),N2.init(e,t),e.email=n=>e.check(zU(oV,n)),e.url=n=>e.check(EU(sV,n)),e.jwt=n=>e.check(HU(wV,n)),e.emoji=n=>e.check(NU(lV,n)),e.guid=n=>e.check(tw(iw,n)),e.uuid=n=>e.check(_U(bc,n)),e.uuidv4=n=>e.check(jU(bc,n)),e.uuidv6=n=>e.check(TU(bc,n)),e.uuidv7=n=>e.check(CU(bc,n)),e.nanoid=n=>e.check(AU(uV,n)),e.guid=n=>e.check(tw(iw,n)),e.cuid=n=>e.check(OU(cV,n)),e.cuid2=n=>e.check(RU(dV,n)),e.ulid=n=>e.check(MU(fV,n)),e.base64=n=>e.check(BU(bV,n)),e.base64url=n=>e.check(ZU(vV,n)),e.xid=n=>e.check(DU(hV,n)),e.ksuid=n=>e.check($U(mV,n)),e.ipv4=n=>e.check(LU(pV,n)),e.ipv6=n=>e.check(PU(gV,n)),e.cidrv4=n=>e.check(UU(yV,n)),e.cidrv6=n=>e.check(VU(xV,n)),e.e164=n=>e.check(IU(kV,n)),e.datetime=n=>e.check(U8(n)),e.date=n=>e.check(B8(n)),e.time=n=>e.check(I8(n)),e.duration=n=>e.check(F8(n))});function nt(e){return SU(iV,e)}const jt=ee("ZodStringFormat",(e,t)=>{bt.init(e,t),N2.init(e,t)}),oV=ee("ZodEmail",(e,t)=>{NP.init(e,t),jt.init(e,t)}),iw=ee("ZodGUID",(e,t)=>{CP.init(e,t),jt.init(e,t)}),bc=ee("ZodUUID",(e,t)=>{EP.init(e,t),jt.init(e,t)}),sV=ee("ZodURL",(e,t)=>{AP.init(e,t),jt.init(e,t)}),lV=ee("ZodEmoji",(e,t)=>{OP.init(e,t),jt.init(e,t)}),uV=ee("ZodNanoID",(e,t)=>{RP.init(e,t),jt.init(e,t)}),cV=ee("ZodCUID",(e,t)=>{MP.init(e,t),jt.init(e,t)}),dV=ee("ZodCUID2",(e,t)=>{DP.init(e,t),jt.init(e,t)}),fV=ee("ZodULID",(e,t)=>{$P.init(e,t),jt.init(e,t)}),hV=ee("ZodXID",(e,t)=>{LP.init(e,t),jt.init(e,t)}),mV=ee("ZodKSUID",(e,t)=>{PP.init(e,t),jt.init(e,t)}),pV=ee("ZodIPv4",(e,t)=>{IP.init(e,t),jt.init(e,t)}),gV=ee("ZodIPv6",(e,t)=>{HP.init(e,t),jt.init(e,t)}),yV=ee("ZodCIDRv4",(e,t)=>{FP.init(e,t),jt.init(e,t)}),xV=ee("ZodCIDRv6",(e,t)=>{qP.init(e,t),jt.init(e,t)}),bV=ee("ZodBase64",(e,t)=>{GP.init(e,t),jt.init(e,t)}),vV=ee("ZodBase64URL",(e,t)=>{XP.init(e,t),jt.init(e,t)}),kV=ee("ZodE164",(e,t)=>{KP.init(e,t),jt.init(e,t)}),wV=ee("ZodJWT",(e,t)=>{QP.init(e,t),jt.init(e,t)}),A2=ee("ZodNumber",(e,t)=>{b2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,u)=>x8(e,a,o),e.gt=(a,o)=>e.check(rw(a,o)),e.gte=(a,o)=>e.check(Nm(a,o)),e.min=(a,o)=>e.check(Nm(a,o)),e.lt=(a,o)=>e.check(nw(a,o)),e.lte=(a,o)=>e.check(Em(a,o)),e.max=(a,o)=>e.check(Em(a,o)),e.int=a=>e.check(ow(a)),e.safe=a=>e.check(ow(a)),e.positive=a=>e.check(rw(0,a)),e.nonnegative=a=>e.check(Nm(0,a)),e.negative=a=>e.check(nw(0,a)),e.nonpositive=a=>e.check(Em(0,a)),e.multipleOf=(a,o)=>e.check(aw(a,o)),e.step=(a,o)=>e.check(aw(a,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Va(e){return XU(A2,e)}const SV=ee("ZodNumberFormat",(e,t)=>{WP.init(e,t),A2.init(e,t)});function ow(e){return KU(SV,e)}const zV=ee("ZodBoolean",(e,t)=>{eU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>b8(e,n,a)});function Pa(e){return JU(zV,e)}const _V=ee("ZodUnknown",(e,t)=>{tU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>k8()});function sw(){return QU(_V)}const jV=ee("ZodNever",(e,t)=>{nU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>v8(e,n,a)});function TV(e){return WU(jV,e)}const CV=ee("ZodArray",(e,t)=>{rU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>j8(e,n,a,o),e.element=t.element,e.min=(n,a)=>e.check(Yc(n,a)),e.nonempty=n=>e.check(Yc(1,n)),e.max=(n,a)=>e.check(z2(n,a)),e.length=(n,a)=>e.check(_2(n,a)),e.unwrap=()=>e.element});function Nl(e,t){return d8(CV,e,t)}const EV=ee("ZodObject",(e,t)=>{iU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>T8(e,n,a,o),Ye(e,"shape",()=>t.shape),e.keyof=()=>yd(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sw()}),e.loose=()=>e.clone({...e._zod.def,catchall:sw()}),e.strict=()=>e.clone({...e._zod.def,catchall:TV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>j9(e,n),e.safeExtend=n=>T9(e,n),e.merge=n=>C9(e,n),e.pick=n=>z9(e,n),e.omit=n=>_9(e,n),e.partial=(...n)=>E9(M2,e,n[0]),e.required=(...n)=>N9(D2,e,n[0])});function xn(e,t){const n={type:"object",shape:e??{},...ke(t)};return new EV(n)}const O2=ee("ZodUnion",(e,t)=>{w2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>C8(e,n,a,o),e.options=t.options});function R2(e,t){return new O2({type:"union",options:e,...ke(t)})}const NV=ee("ZodDiscriminatedUnion",(e,t)=>{O2.init(e,t),oU.init(e,t)});function AV(e,t,n){return new NV({type:"union",options:t,discriminator:e,...ke(n)})}const OV=ee("ZodIntersection",(e,t)=>{sU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>E8(e,n,a,o)});function RV(e,t){return new OV({type:"intersection",left:e,right:t})}const MV=ee("ZodRecord",(e,t)=>{lU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>N8(e,n,a,o),e.keyType=t.keyType,e.valueType=t.valueType});function Mc(e,t,n){return new MV({type:"record",keyType:e,valueType:t,...ke(n)})}const Lp=ee("ZodEnum",(e,t)=>{uU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,u)=>w8(e,a,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,o)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Lp({...t,checks:[],...ke(o),entries:u})},e.exclude=(a,o)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Lp({...t,checks:[],...ke(o),entries:u})}});function yd(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Lp({type:"enum",entries:n,...ke(t)})}const DV=ee("ZodLiteral",(e,t)=>{cU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>S8(e,n,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 lw(e,t){return new DV({type:"literal",values:Array.isArray(e)?e:[e],...ke(t)})}const $V=ee("ZodTransform",(e,t)=>{dU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>_8(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new r2(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(El(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(El(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(u=>(n.value=u,n)):(n.value=o,n)}});function LV(e){return new $V({type:"transform",transform:e})}const M2=ee("ZodOptional",(e,t)=>{S2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>E2(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function uw(e){return new M2({type:"optional",innerType:e})}const PV=ee("ZodExactOptional",(e,t)=>{fU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>E2(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function UV(e){return new PV({type:"optional",innerType:e})}const VV=ee("ZodNullable",(e,t)=>{hU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>A8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function cw(e){return new VV({type:"nullable",innerType:e})}const BV=ee("ZodDefault",(e,t)=>{mU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>R8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZV(e,t){return new BV({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():s2(t)}})}const IV=ee("ZodPrefault",(e,t)=>{pU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>M8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function HV(e,t){return new IV({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():s2(t)}})}const D2=ee("ZodNonOptional",(e,t)=>{gU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>O8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function FV(e,t){return new D2({type:"nonoptional",innerType:e,...ke(t)})}const qV=ee("ZodCatch",(e,t)=>{yU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>D8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function GV(e,t){return new qV({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const YV=ee("ZodPipe",(e,t)=>{xU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>$8(e,n,a,o),e.in=t.in,e.out=t.out});function dw(e,t){return new YV({type:"pipe",in:e,out:t})}const XV=ee("ZodReadonly",(e,t)=>{bU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>L8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function KV(e){return new XV({type:"readonly",innerType:e})}const JV=ee("ZodCustom",(e,t)=>{vU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>z8(e,n)});function QV(e,t={}){return f8(JV,e,t)}function WV(e){return h8(e)}const lt={agent:{name:"morpheus",personality:"helpful_dev"},logging:{enabled:!0,level:"info",retention:"14d"},audio:{provider:"google",model:"gemini-2.5-flash-lite",enabled:!0,maxDurationSeconds:300,supportedMimeTypes:["audio/ogg","audio/mp3","audio/mpeg","audio/wav"]},memory:{limit:100},runtime:{async_tasks:{enabled:!0}},llm:{provider:"openai",model:"gpt-4",temperature:.7,context_window:100},channels:{telegram:{enabled:!1,allowedUsers:[]},discord:{enabled:!1}},ui:{enabled:!0,port:3333}},eB=xn({provider:yd(["google","openai","openrouter","ollama"]).default(lt.audio.provider),model:nt().min(1).default(lt.audio.model),enabled:Pa().default(lt.audio.enabled),apiKey:nt().optional(),base_url:nt().optional(),maxDurationSeconds:Va().default(lt.audio.maxDurationSeconds),supportedMimeTypes:Nl(nt()).default(lt.audio.supportedMimeTypes)}),Zl=xn({provider:yd(["openai","anthropic","openrouter","ollama","gemini"]).default(lt.llm.provider),model:nt().min(1).default(lt.llm.model),temperature:Va().min(0).max(1).default(lt.llm.temperature),max_tokens:Va().int().positive().optional(),api_key:nt().optional(),base_url:nt().optional(),context_window:Va().int().positive().optional()}),tB=Zl.extend({memory_limit:Va().int().positive().optional(),enabled_archived_sessions:Pa().default(!0)}),nB=Zl.extend({working_dir:nt().optional(),timeout_ms:Va().int().positive().optional()}),rB=Zl,aB=Zl,iB=xn({telegram_notify_all:Pa().optional()}).optional(),oB=xn({agent:xn({name:nt().default(lt.agent.name),personality:nt().default(lt.agent.personality)}).default(lt.agent),llm:Zl.default(lt.llm),sati:tB.optional(),neo:rB.optional(),apoc:nB.optional(),trinity:aB.optional(),webhooks:iB,audio:eB.default(lt.audio),memory:xn({limit:Va().int().positive().optional()}).default(lt.memory),runtime:xn({async_tasks:xn({enabled:Pa().default(lt.runtime?.async_tasks.enabled)}).default(lt.runtime?.async_tasks??{enabled:!0})}).optional(),channels:xn({telegram:xn({enabled:Pa().default(!1),token:nt().optional(),allowedUsers:Nl(nt()).default([])}).default(lt.channels.telegram),discord:xn({enabled:Pa().default(!1),token:nt().optional()}).default(lt.channels.discord)}).default(lt.channels),ui:xn({enabled:Pa().default(lt.ui.enabled),port:Va().default(lt.ui.port)}).default(lt.ui),logging:xn({enabled:Pa().default(lt.logging.enabled),level:yd(["debug","info","warn","error"]).default(lt.logging.level),retention:nt().default(lt.logging.retention)}).default(lt.logging)}),sB=AV("transport",[xn({transport:lw("stdio"),command:nt().min(1,"Command is required for stdio transport"),args:Nl(nt()).optional().default([]),env:Mc(nt(),nt()).optional().default({}),_comment:nt().optional()}),xn({transport:lw("http"),url:nt().url("Valid URL is required for http transport"),headers:Mc(nt(),nt()).optional().default({}),args:Nl(nt()).optional().default([]),env:Mc(nt(),nt()).optional().default({}),_comment:nt().optional()})]);Mc(nt(),R2([sB,nt()]));function ie(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=l.prototype,g=Object.keys(m);for(let x=0;x<g.length;x++){const b=g[x];b in d||(d[b]=m[b].bind(d))}}const o=n?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function l(d){var h;const m=n?.Parent?new u:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Uo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $2 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const L2={};function Ci(e){return L2}function P2(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>t.indexOf(+a)===-1).map(([a,o])=>o)}function Pp(e,t){return typeof t=="bigint"?t.toString():t}function ty(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ny(e){return e==null}function ry(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const fw=Symbol("evaluating");function Je(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==fw)return a===void 0&&(a=fw,a=n()),a},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Oi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ka(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function hw(e){return JSON.stringify(e)}function lB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const U2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const uB=ty(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Al(e){if(Kc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Kc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function V2(e){return Al(e)?{...e}:Array.isArray(e)?[...e]:e}const cB=new Set(["string","number","symbol"]);function Fo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ja(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(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 dB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function fB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Ka(e._zod.def,{get shape(){const l={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(l[d]=n.shape[d])}return Oi(this,"shape",l),l},checks:[]});return Ja(e,u)}function hB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Ka(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete l[d]}return Oi(this,"shape",l),l},checks:[]});return Ja(e,u)}function mB(e,t){if(!Al(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ka(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Oi(this,"shape",u),u}});return Ja(e,o)}function pB(e,t){if(!Al(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ka(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Oi(this,"shape",a),a}});return Ja(e,n)}function gB(e,t){const n=Ka(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Oi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ja(e,n)}function yB(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ka(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Oi(this,"shape",h),h},checks:[]});return Ja(t,l)}function xB(e,t,n){const a=Ka(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:o[l]}))}else for(const l in o)u[l]=new e({type:"nonoptional",innerType:o[l]});return Oi(this,"shape",u),u}});return Ja(t,a)}function Ao(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function B2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function vc(e){return typeof e=="string"?e:e?.message}function Ei(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const o=vc(e.inst?._zod.def?.error?.(e))??vc(t?.error?.(e))??vc(n.customError?.(e))??vc(n.localeError?.(e))??"Invalid input";a.message=o}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ay(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ol(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const Z2=(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,Pp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},I2=ie("$ZodError",Z2),H2=ie("$ZodError",Z2,{Parent:Error});function bB(e,t=n=>n.message){const n={},a=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:n}}function vB(e,t=n=>n.message){const n={_errors:[]},a=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],d++}}};return a(e),n}const iy=e=>(t,n,a,o)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Uo;if(l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Ei(h,u,Ci())));throw U2(d,o?.callee),d}return l.value},oy=e=>async(t,n,a,o)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Ei(h,u,Ci())));throw U2(d,o?.callee),d}return l.value},xd=e=>(t,n,a)=>{const o=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new Uo;return u.issues.length?{success:!1,error:new(e??I2)(u.issues.map(l=>Ei(l,o,Ci())))}:{success:!0,data:u.value}},kB=xd(H2),bd=e=>async(t,n,a)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Ei(l,o,Ci())))}:{success:!0,data:u.value}},wB=bd(H2),SB=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return iy(e)(t,n,o)},zB=e=>(t,n,a)=>iy(e)(t,n,a),_B=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return oy(e)(t,n,o)},jB=e=>async(t,n,a)=>oy(e)(t,n,a),TB=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return xd(e)(t,n,o)},CB=e=>(t,n,a)=>xd(e)(t,n,a),EB=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return bd(e)(t,n,o)},NB=e=>async(t,n,a)=>bd(e)(t,n,a),AB=/^[cC][^\s-]{8,}$/,OB=/^[0-9a-z]+$/,RB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,MB=/^[0-9a-vA-V]{20}$/,DB=/^[A-Za-z0-9]{27}$/,$B=/^[a-zA-Z0-9_-]{21}$/,LB=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,PB=/^([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})$/,mw=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)$/,UB=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,VB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function BB(){return new RegExp(VB,"u")}const ZB=/^(?:(?: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])$/,IB=/^(([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}|:))$/,HB=/^((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])$/,FB=/^(([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])$/,qB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,F2=/^[A-Za-z0-9_-]*$/,GB=/^\+[1-9]\d{6,14}$/,q2="(?:(?:\\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])))",YB=new RegExp(`^${q2}$`);function G2(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 XB(e){return new RegExp(`^${G2(e)}$`)}function KB(e){const t=G2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${q2}T(?:${a})$`)}const JB=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},QB=/^[^A-Z]*$/,WB=/^[^a-z]*$/,Dr=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),eZ=ie("$ZodCheckMaxLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!ny(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const o=a.value;if(o.length<=t.maximum)return;const l=ay(o);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tZ=ie("$ZodCheckMinLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!ny(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const o=a.value;if(o.length>=t.minimum)return;const l=ay(o);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),nZ=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!ny(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=a=>{const o=a.value,u=o.length;if(u===t.length)return;const l=ay(o),d=u>t.length;a.issues.push({origin:l,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),vd=ie("$ZodCheckStringFormat",(e,t)=>{var n,a;Dr.init(e,t),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),rZ=ie("$ZodCheckRegex",(e,t)=>{vd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),aZ=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=QB),vd.init(e,t)}),iZ=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=WB),vd.init(e,t)}),oZ=ie("$ZodCheckIncludes",(e,t)=>{Dr.init(e,t);const n=Fo(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),sZ=ie("$ZodCheckStartsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`^${Fo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),lZ=ie("$ZodCheckEndsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`.*${Fo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),uZ=ie("$ZodCheckOverwrite",(e,t)=>{Dr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class cZ{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(`
70
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(d.cycle){u(l);continue}if(d.count>1&&e.reused==="ref"){u(l);continue}}}function C2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const d=e.seen.get(l);if(d.ref===null)return;const h=d.def??d.schema,m={...h},g=d.ref;if(d.ref=null,g){a(g);const b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const T in h)T==="$ref"||T==="allOf"||T in m||delete h[T];if(v.$ref&&b.def)for(const T in h)T==="$ref"||T==="allOf"||T in b.def&&JSON.stringify(h[T])===JSON.stringify(b.def[T])&&delete h[T]}const x=l._zod.parent;if(x&&x!==g){a(x);const b=e.seen.get(x);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path:d.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xc(t,"input",e.processors),output:Xc(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return gn(a.element,n);if(a.type==="set")return gn(a.valueType,n);if(a.type==="lazy")return gn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return gn(a.innerType,n);if(a.type==="intersection")return gn(a.left,n)||gn(a.right,n);if(a.type==="record"||a.type==="map")return gn(a.keyType,n)||gn(a.valueType,n);if(a.type==="pipe")return gn(a.in,n)||gn(a.out,n);if(a.type==="object"){for(const o in a.shape)if(gn(a.shape[o],n))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(gn(o,n))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(gn(o,n))return!0;return!!(a.rest&&gn(a.rest,n))}return!1}const y8=(e,t={})=>n=>{const a=j2({...n,processors:t});return Vt(e,a),T2(a,e),C2(a,e)},Xc=(e,t,n={})=>a=>{const{libraryOptions:o,target:u}=a??{},l=j2({...o??{},target:u,io:t,processors:n});return Vt(e,l),T2(l,e),C2(l,e)},x8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},b8=(e,t,n,a)=>{const o=n;o.type="string";const{minimum:u,maximum:l,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(o.minLength=u),typeof l=="number"&&(o.maxLength=l),d&&(o.format=x8[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),m&&(o.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},v8=(e,t,n,a)=>{const o=n,{minimum:u,maximum:l,format:d,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof d=="string"&&d.includes("int")?o.type="integer":o.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=g,o.exclusiveMinimum=!0):o.exclusiveMinimum=g),typeof u=="number"&&(o.minimum=u,typeof g=="number"&&t.target!=="draft-04"&&(g>=u?delete o.minimum:delete o.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=m,o.exclusiveMaximum=!0):o.exclusiveMaximum=m),typeof l=="number"&&(o.maximum=l,typeof m=="number"&&t.target!=="draft-04"&&(m<=l?delete o.maximum:delete o.exclusiveMaximum)),typeof h=="number"&&(o.multipleOf=h)},k8=(e,t,n,a)=>{n.type="boolean"},w8=(e,t,n,a)=>{n.not={}},S8=(e,t,n,a)=>{},z8=(e,t,n,a)=>{const o=e._zod.def,u=i2(o.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},_8=(e,t,n,a)=>{const o=e._zod.def,u=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},j8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},T8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},C8=(e,t,n,a)=>{const o=n,u=e._zod.def,{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=Vt(u.element,t,{...a,path:[...a.path,"items"]})},E8=(e,t,n,a)=>{const o=n,u=e._zod.def;o.type="object",o.properties={};const l=u.shape;for(const m in l)o.properties[m]=Vt(l[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(l)),h=new Set([...d].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(o.required=Array.from(h)),u.catchall?._zod.def.type==="never"?o.additionalProperties=!1:u.catchall?u.catchall&&(o.additionalProperties=Vt(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},N8=(e,t,n,a)=>{const o=e._zod.def,u=o.inclusive===!1,l=o.options.map((d,h)=>Vt(d,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},A8=(e,t,n,a)=>{const o=e._zod.def,u=Vt(o.left,t,{...a,path:[...a.path,"allOf",0]}),l=Vt(o.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(u)?u.allOf:[u],...d(l)?l.allOf:[l]];n.allOf=h},O8=(e,t,n,a)=>{const o=n,u=e._zod.def;o.type="object";const l=u.keyType,h=l._zod.bag?.patterns;if(u.mode==="loose"&&h&&h.size>0){const g=Vt(u.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});o.patternProperties={};for(const x of h)o.patternProperties[x.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Vt(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),o.additionalProperties=Vt(u.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=l._zod.values;if(m){const g=[...m].filter(x=>typeof x=="string"||typeof x=="number");g.length>0&&(o.required=g)}},R8=(e,t,n,a)=>{const o=e._zod.def,u=Vt(o.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},M8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},D8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},$8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},L8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},P8=(e,t,n,a)=>{const o=e._zod.def,u=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Vt(u,t,a);const l=t.seen.get(e);l.ref=u},U8=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.readOnly=!0},E2=(e,t,n,a)=>{const o=e._zod.def;Vt(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},V8=ee("ZodISODateTime",(e,t)=>{BP.init(e,t),jt.init(e,t)});function B8(e){return GU(V8,e)}const Z8=ee("ZodISODate",(e,t)=>{ZP.init(e,t),jt.init(e,t)});function I8(e){return YU(Z8,e)}const H8=ee("ZodISOTime",(e,t)=>{IP.init(e,t),jt.init(e,t)});function F8(e){return XU(H8,e)}const q8=ee("ZodISODuration",(e,t)=>{HP.init(e,t),jt.init(e,t)});function G8(e){return KU(q8,e)}const Y8=(e,t)=>{u2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>M9(e,n)},flatten:{value:n=>R9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Dp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Dp,2)}},isEmpty:{get(){return e.issues.length===0}}})},lr=ee("ZodError",Y8,{Parent:Error}),X8=Qg(lr),K8=Wg(lr),J8=md(lr),Q8=pd(lr),W8=L9(lr),eV=P9(lr),tV=U9(lr),nV=V9(lr),rV=B9(lr),aV=Z9(lr),iV=I9(lr),oV=H9(lr),_t=ee("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xc(e,"input"),output:Xc(e,"output")}}),e.toJSONSchema=y8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ya(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Xa(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>X8(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>J8(e,n,a),e.parseAsync=async(n,a)=>K8(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>Q8(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>W8(e,n,a),e.decode=(n,a)=>eV(e,n,a),e.encodeAsync=async(n,a)=>tV(e,n,a),e.decodeAsync=async(n,a)=>nV(e,n,a),e.safeEncode=(n,a)=>rV(e,n,a),e.safeDecode=(n,a)=>aV(e,n,a),e.safeEncodeAsync=async(n,a)=>iV(e,n,a),e.safeDecodeAsync=async(n,a)=>oV(e,n,a),e.refine=(n,a)=>e.check(eB(n,a)),e.superRefine=n=>e.check(tB(n)),e.overwrite=n=>e.check(rs(n)),e.optional=()=>uw(e),e.exactOptional=()=>BV(e),e.nullable=()=>cw(e),e.nullish=()=>uw(cw(e)),e.nonoptional=n=>GV(e,n),e.array=()=>Al(e),e.or=n=>R2([e,n]),e.and=n=>DV(e,n),e.transform=n=>dw(e,UV(n)),e.default=n=>HV(e,n),e.prefault=n=>qV(e,n),e.catch=n=>XV(e,n),e.pipe=n=>dw(e,n),e.readonly=()=>QV(e),e.describe=n=>{const a=e.clone();return cl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return cl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cl.get(e);const a=e.clone();return cl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),N2=ee("_ZodString",(e,t)=>{ey.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,u)=>b8(e,a,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(n8(...a)),e.includes=(...a)=>e.check(i8(...a)),e.startsWith=(...a)=>e.check(o8(...a)),e.endsWith=(...a)=>e.check(s8(...a)),e.min=(...a)=>e.check(Yc(...a)),e.max=(...a)=>e.check(z2(...a)),e.length=(...a)=>e.check(_2(...a)),e.nonempty=(...a)=>e.check(Yc(1,...a)),e.lowercase=a=>e.check(r8(a)),e.uppercase=a=>e.check(a8(a)),e.trim=()=>e.check(u8()),e.normalize=(...a)=>e.check(l8(...a)),e.toLowerCase=()=>e.check(c8()),e.toUpperCase=()=>e.check(d8()),e.slugify=()=>e.check(f8())}),sV=ee("ZodString",(e,t)=>{ey.init(e,t),N2.init(e,t),e.email=n=>e.check(jU(lV,n)),e.url=n=>e.check(AU(uV,n)),e.jwt=n=>e.check(qU(zV,n)),e.emoji=n=>e.check(OU(cV,n)),e.guid=n=>e.check(tw(iw,n)),e.uuid=n=>e.check(TU(vc,n)),e.uuidv4=n=>e.check(CU(vc,n)),e.uuidv6=n=>e.check(EU(vc,n)),e.uuidv7=n=>e.check(NU(vc,n)),e.nanoid=n=>e.check(RU(dV,n)),e.guid=n=>e.check(tw(iw,n)),e.cuid=n=>e.check(MU(fV,n)),e.cuid2=n=>e.check(DU(hV,n)),e.ulid=n=>e.check($U(mV,n)),e.base64=n=>e.check(IU(kV,n)),e.base64url=n=>e.check(HU(wV,n)),e.xid=n=>e.check(LU(pV,n)),e.ksuid=n=>e.check(PU(gV,n)),e.ipv4=n=>e.check(UU(yV,n)),e.ipv6=n=>e.check(VU(xV,n)),e.cidrv4=n=>e.check(BU(bV,n)),e.cidrv6=n=>e.check(ZU(vV,n)),e.e164=n=>e.check(FU(SV,n)),e.datetime=n=>e.check(B8(n)),e.date=n=>e.check(I8(n)),e.time=n=>e.check(F8(n)),e.duration=n=>e.check(G8(n))});function nt(e){return _U(sV,e)}const jt=ee("ZodStringFormat",(e,t)=>{bt.init(e,t),N2.init(e,t)}),lV=ee("ZodEmail",(e,t)=>{OP.init(e,t),jt.init(e,t)}),iw=ee("ZodGUID",(e,t)=>{NP.init(e,t),jt.init(e,t)}),vc=ee("ZodUUID",(e,t)=>{AP.init(e,t),jt.init(e,t)}),uV=ee("ZodURL",(e,t)=>{RP.init(e,t),jt.init(e,t)}),cV=ee("ZodEmoji",(e,t)=>{MP.init(e,t),jt.init(e,t)}),dV=ee("ZodNanoID",(e,t)=>{DP.init(e,t),jt.init(e,t)}),fV=ee("ZodCUID",(e,t)=>{$P.init(e,t),jt.init(e,t)}),hV=ee("ZodCUID2",(e,t)=>{LP.init(e,t),jt.init(e,t)}),mV=ee("ZodULID",(e,t)=>{PP.init(e,t),jt.init(e,t)}),pV=ee("ZodXID",(e,t)=>{UP.init(e,t),jt.init(e,t)}),gV=ee("ZodKSUID",(e,t)=>{VP.init(e,t),jt.init(e,t)}),yV=ee("ZodIPv4",(e,t)=>{FP.init(e,t),jt.init(e,t)}),xV=ee("ZodIPv6",(e,t)=>{qP.init(e,t),jt.init(e,t)}),bV=ee("ZodCIDRv4",(e,t)=>{GP.init(e,t),jt.init(e,t)}),vV=ee("ZodCIDRv6",(e,t)=>{YP.init(e,t),jt.init(e,t)}),kV=ee("ZodBase64",(e,t)=>{XP.init(e,t),jt.init(e,t)}),wV=ee("ZodBase64URL",(e,t)=>{JP.init(e,t),jt.init(e,t)}),SV=ee("ZodE164",(e,t)=>{QP.init(e,t),jt.init(e,t)}),zV=ee("ZodJWT",(e,t)=>{eU.init(e,t),jt.init(e,t)}),A2=ee("ZodNumber",(e,t)=>{b2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,u)=>v8(e,a,o),e.gt=(a,o)=>e.check(rw(a,o)),e.gte=(a,o)=>e.check(Nm(a,o)),e.min=(a,o)=>e.check(Nm(a,o)),e.lt=(a,o)=>e.check(nw(a,o)),e.lte=(a,o)=>e.check(Em(a,o)),e.max=(a,o)=>e.check(Em(a,o)),e.int=a=>e.check(ow(a)),e.safe=a=>e.check(ow(a)),e.positive=a=>e.check(rw(0,a)),e.nonnegative=a=>e.check(Nm(0,a)),e.negative=a=>e.check(nw(0,a)),e.nonpositive=a=>e.check(Em(0,a)),e.multipleOf=(a,o)=>e.check(aw(a,o)),e.step=(a,o)=>e.check(aw(a,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Va(e){return JU(A2,e)}const _V=ee("ZodNumberFormat",(e,t)=>{tU.init(e,t),A2.init(e,t)});function ow(e){return QU(_V,e)}const jV=ee("ZodBoolean",(e,t)=>{nU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>k8(e,n,a)});function Pa(e){return WU(jV,e)}const TV=ee("ZodUnknown",(e,t)=>{rU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>S8()});function sw(){return e8(TV)}const CV=ee("ZodNever",(e,t)=>{aU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>w8(e,n,a)});function EV(e){return t8(CV,e)}const NV=ee("ZodArray",(e,t)=>{iU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>C8(e,n,a,o),e.element=t.element,e.min=(n,a)=>e.check(Yc(n,a)),e.nonempty=n=>e.check(Yc(1,n)),e.max=(n,a)=>e.check(z2(n,a)),e.length=(n,a)=>e.check(_2(n,a)),e.unwrap=()=>e.element});function Al(e,t){return h8(NV,e,t)}const AV=ee("ZodObject",(e,t)=>{sU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>E8(e,n,a,o),Ye(e,"shape",()=>t.shape),e.keyof=()=>yd(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sw()}),e.loose=()=>e.clone({...e._zod.def,catchall:sw()}),e.strict=()=>e.clone({...e._zod.def,catchall:EV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>C9(e,n),e.safeExtend=n=>E9(e,n),e.merge=n=>N9(e,n),e.pick=n=>j9(e,n),e.omit=n=>T9(e,n),e.partial=(...n)=>A9(M2,e,n[0]),e.required=(...n)=>O9(D2,e,n[0])});function xn(e,t){const n={type:"object",shape:e??{},...ke(t)};return new AV(n)}const O2=ee("ZodUnion",(e,t)=>{w2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>N8(e,n,a,o),e.options=t.options});function R2(e,t){return new O2({type:"union",options:e,...ke(t)})}const OV=ee("ZodDiscriminatedUnion",(e,t)=>{O2.init(e,t),lU.init(e,t)});function RV(e,t,n){return new OV({type:"union",options:t,discriminator:e,...ke(n)})}const MV=ee("ZodIntersection",(e,t)=>{uU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>A8(e,n,a,o)});function DV(e,t){return new MV({type:"intersection",left:e,right:t})}const $V=ee("ZodRecord",(e,t)=>{cU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>O8(e,n,a,o),e.keyType=t.keyType,e.valueType=t.valueType});function Mc(e,t,n){return new $V({type:"record",keyType:e,valueType:t,...ke(n)})}const Lp=ee("ZodEnum",(e,t)=>{dU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,u)=>z8(e,a,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,o)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Lp({...t,checks:[],...ke(o),entries:u})},e.exclude=(a,o)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Lp({...t,checks:[],...ke(o),entries:u})}});function yd(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Lp({type:"enum",entries:n,...ke(t)})}const LV=ee("ZodLiteral",(e,t)=>{fU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>_8(e,n,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 lw(e,t){return new LV({type:"literal",values:Array.isArray(e)?e:[e],...ke(t)})}const PV=ee("ZodTransform",(e,t)=>{hU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>T8(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new r2(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Nl(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Nl(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(u=>(n.value=u,n)):(n.value=o,n)}});function UV(e){return new PV({type:"transform",transform:e})}const M2=ee("ZodOptional",(e,t)=>{S2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>E2(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function uw(e){return new M2({type:"optional",innerType:e})}const VV=ee("ZodExactOptional",(e,t)=>{mU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>E2(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function BV(e){return new VV({type:"optional",innerType:e})}const ZV=ee("ZodNullable",(e,t)=>{pU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>R8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function cw(e){return new ZV({type:"nullable",innerType:e})}const IV=ee("ZodDefault",(e,t)=>{gU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>D8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function HV(e,t){return new IV({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():s2(t)}})}const FV=ee("ZodPrefault",(e,t)=>{yU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>$8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function qV(e,t){return new FV({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():s2(t)}})}const D2=ee("ZodNonOptional",(e,t)=>{xU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>M8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function GV(e,t){return new D2({type:"nonoptional",innerType:e,...ke(t)})}const YV=ee("ZodCatch",(e,t)=>{bU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>L8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XV(e,t){return new YV({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const KV=ee("ZodPipe",(e,t)=>{vU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>P8(e,n,a,o),e.in=t.in,e.out=t.out});function dw(e,t){return new KV({type:"pipe",in:e,out:t})}const JV=ee("ZodReadonly",(e,t)=>{kU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>U8(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function QV(e){return new JV({type:"readonly",innerType:e})}const WV=ee("ZodCustom",(e,t)=>{wU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>j8(e,n)});function eB(e,t={}){return m8(WV,e,t)}function tB(e){return p8(e)}const lt={agent:{name:"morpheus",personality:"helpful_dev"},logging:{enabled:!0,level:"info",retention:"14d"},audio:{provider:"google",model:"gemini-2.5-flash-lite",enabled:!0,maxDurationSeconds:300,supportedMimeTypes:["audio/ogg","audio/mp3","audio/mpeg","audio/wav"]},memory:{limit:100},runtime:{async_tasks:{enabled:!0}},llm:{provider:"openai",model:"gpt-4",temperature:.7,context_window:100},channels:{telegram:{enabled:!1,allowedUsers:[]},discord:{enabled:!1}},ui:{enabled:!0,port:3333}},nB=xn({provider:yd(["google","openai","openrouter","ollama"]).default(lt.audio.provider),model:nt().min(1).default(lt.audio.model),enabled:Pa().default(lt.audio.enabled),apiKey:nt().optional(),base_url:nt().optional(),maxDurationSeconds:Va().default(lt.audio.maxDurationSeconds),supportedMimeTypes:Al(nt()).default(lt.audio.supportedMimeTypes)}),Il=xn({provider:yd(["openai","anthropic","openrouter","ollama","gemini"]).default(lt.llm.provider),model:nt().min(1).default(lt.llm.model),temperature:Va().min(0).max(1).default(lt.llm.temperature),max_tokens:Va().int().positive().optional(),api_key:nt().optional(),base_url:nt().optional(),context_window:Va().int().positive().optional()}),rB=Il.extend({memory_limit:Va().int().positive().optional(),enabled_archived_sessions:Pa().default(!0)}),aB=Il.extend({working_dir:nt().optional(),timeout_ms:Va().int().positive().optional()}),iB=Il,oB=Il,sB=xn({telegram_notify_all:Pa().optional()}).optional(),lB=xn({agent:xn({name:nt().default(lt.agent.name),personality:nt().default(lt.agent.personality)}).default(lt.agent),llm:Il.default(lt.llm),sati:rB.optional(),neo:iB.optional(),apoc:aB.optional(),trinity:oB.optional(),webhooks:sB,audio:nB.default(lt.audio),memory:xn({limit:Va().int().positive().optional()}).default(lt.memory),runtime:xn({async_tasks:xn({enabled:Pa().default(lt.runtime?.async_tasks.enabled)}).default(lt.runtime?.async_tasks??{enabled:!0})}).optional(),channels:xn({telegram:xn({enabled:Pa().default(!1),token:nt().optional(),allowedUsers:Al(nt()).default([])}).default(lt.channels.telegram),discord:xn({enabled:Pa().default(!1),token:nt().optional()}).default(lt.channels.discord)}).default(lt.channels),ui:xn({enabled:Pa().default(lt.ui.enabled),port:Va().default(lt.ui.port)}).default(lt.ui),logging:xn({enabled:Pa().default(lt.logging.enabled),level:yd(["debug","info","warn","error"]).default(lt.logging.level),retention:nt().default(lt.logging.retention)}).default(lt.logging)}),uB=RV("transport",[xn({transport:lw("stdio"),command:nt().min(1,"Command is required for stdio transport"),args:Al(nt()).optional().default([]),env:Mc(nt(),nt()).optional().default({}),_comment:nt().optional()}),xn({transport:lw("http"),url:nt().url("Valid URL is required for http transport"),headers:Mc(nt(),nt()).optional().default({}),args:Al(nt()).optional().default([]),env:Mc(nt(),nt()).optional().default({}),_comment:nt().optional()})]);Mc(nt(),R2([uB,nt()]));function ie(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=l.prototype,g=Object.keys(m);for(let x=0;x<g.length;x++){const b=g[x];b in d||(d[b]=m[b].bind(d))}}const o=n?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function l(d){var h;const m=n?.Parent?new u:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Vo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $2 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const L2={};function Ci(e){return L2}function P2(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>t.indexOf(+a)===-1).map(([a,o])=>o)}function Pp(e,t){return typeof t=="bigint"?t.toString():t}function ty(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ny(e){return e==null}function ry(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const fw=Symbol("evaluating");function Je(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==fw)return a===void 0&&(a=fw,a=n()),a},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Oi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ka(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function hw(e){return JSON.stringify(e)}function cB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const U2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const dB=ty(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ol(e){if(Kc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Kc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function V2(e){return Ol(e)?{...e}:Array.isArray(e)?[...e]:e}const fB=new Set(["string","number","symbol"]);function qo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ja(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(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 hB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function mB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Ka(e._zod.def,{get shape(){const l={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(l[d]=n.shape[d])}return Oi(this,"shape",l),l},checks:[]});return Ja(e,u)}function pB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Ka(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete l[d]}return Oi(this,"shape",l),l},checks:[]});return Ja(e,u)}function gB(e,t){if(!Ol(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ka(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Oi(this,"shape",u),u}});return Ja(e,o)}function yB(e,t){if(!Ol(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ka(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Oi(this,"shape",a),a}});return Ja(e,n)}function xB(e,t){const n=Ka(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Oi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ja(e,n)}function bB(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ka(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Oi(this,"shape",h),h},checks:[]});return Ja(t,l)}function vB(e,t,n){const a=Ka(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:o[l]}))}else for(const l in o)u[l]=new e({type:"nonoptional",innerType:o[l]});return Oi(this,"shape",u),u}});return Ja(t,a)}function Oo(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function B2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function kc(e){return typeof e=="string"?e:e?.message}function Ei(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const o=kc(e.inst?._zod.def?.error?.(e))??kc(t?.error?.(e))??kc(n.customError?.(e))??kc(n.localeError?.(e))??"Invalid input";a.message=o}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ay(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Rl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const Z2=(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,Pp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},I2=ie("$ZodError",Z2),H2=ie("$ZodError",Z2,{Parent:Error});function kB(e,t=n=>n.message){const n={},a=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:n}}function wB(e,t=n=>n.message){const n={_errors:[]},a=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],d++}}};return a(e),n}const iy=e=>(t,n,a,o)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Vo;if(l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Ei(h,u,Ci())));throw U2(d,o?.callee),d}return l.value},oy=e=>async(t,n,a,o)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const d=new(o?.Err??e)(l.issues.map(h=>Ei(h,u,Ci())));throw U2(d,o?.callee),d}return l.value},xd=e=>(t,n,a)=>{const o=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new Vo;return u.issues.length?{success:!1,error:new(e??I2)(u.issues.map(l=>Ei(l,o,Ci())))}:{success:!0,data:u.value}},SB=xd(H2),bd=e=>async(t,n,a)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Ei(l,o,Ci())))}:{success:!0,data:u.value}},zB=bd(H2),_B=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return iy(e)(t,n,o)},jB=e=>(t,n,a)=>iy(e)(t,n,a),TB=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return oy(e)(t,n,o)},CB=e=>async(t,n,a)=>oy(e)(t,n,a),EB=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return xd(e)(t,n,o)},NB=e=>(t,n,a)=>xd(e)(t,n,a),AB=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return bd(e)(t,n,o)},OB=e=>async(t,n,a)=>bd(e)(t,n,a),RB=/^[cC][^\s-]{8,}$/,MB=/^[0-9a-z]+$/,DB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$B=/^[0-9a-vA-V]{20}$/,LB=/^[A-Za-z0-9]{27}$/,PB=/^[a-zA-Z0-9_-]{21}$/,UB=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VB=/^([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})$/,mw=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)$/,BB=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ZB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function IB(){return new RegExp(ZB,"u")}const HB=/^(?:(?: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])$/,FB=/^(([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}|:))$/,qB=/^((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])$/,GB=/^(([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])$/,YB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,F2=/^[A-Za-z0-9_-]*$/,XB=/^\+[1-9]\d{6,14}$/,q2="(?:(?:\\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])))",KB=new RegExp(`^${q2}$`);function G2(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 JB(e){return new RegExp(`^${G2(e)}$`)}function QB(e){const t=G2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${q2}T(?:${a})$`)}const WB=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eZ=/^[^A-Z]*$/,tZ=/^[^a-z]*$/,Dr=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nZ=ie("$ZodCheckMaxLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!ny(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const o=a.value;if(o.length<=t.maximum)return;const l=ay(o);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),rZ=ie("$ZodCheckMinLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!ny(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const o=a.value;if(o.length>=t.minimum)return;const l=ay(o);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),aZ=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!ny(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=a=>{const o=a.value,u=o.length;if(u===t.length)return;const l=ay(o),d=u>t.length;a.issues.push({origin:l,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),vd=ie("$ZodCheckStringFormat",(e,t)=>{var n,a;Dr.init(e,t),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),iZ=ie("$ZodCheckRegex",(e,t)=>{vd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),oZ=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eZ),vd.init(e,t)}),sZ=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tZ),vd.init(e,t)}),lZ=ie("$ZodCheckIncludes",(e,t)=>{Dr.init(e,t);const n=qo(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),uZ=ie("$ZodCheckStartsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`^${qo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),cZ=ie("$ZodCheckEndsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`.*${qo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),dZ=ie("$ZodCheckOverwrite",(e,t)=>{Dr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class fZ{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(`
71
71
  `).filter(l=>l),o=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(o)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,o.join(`
72
- `))}}const dZ={major:4,minor:3,patch:6},Bt=ie("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dZ;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)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(l,d,h)=>{let m=Ao(l),g;for(const x of d){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=x._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Uo;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Ao(l,b)))});else{if(l.issues.length===b)continue;m||(m=Ao(l,b))}}return g?g.then(()=>l):l},u=(l,d,h)=>{if(Ao(l))return l.aborted=!0,l;const m=o(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new Uo;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,d)):u(m,l,d)}const h=e._zod.parse(l,d);if(h instanceof Promise){if(d.async===!1)throw new Uo;return h.then(m=>o(m,a,d))}return o(h,a,d)}}Je(e,"~standard",()=>({validate:o=>{try{const u=kB(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return wB(e,o).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),sy=ie("$ZodString",(e,t)=>{Bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??JB(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),vt=ie("$ZodStringFormat",(e,t)=>{vd.init(e,t),sy.init(e,t)}),fZ=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=PB),vt.init(e,t)}),hZ=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=mw(a))}else t.pattern??(t.pattern=mw());vt.init(e,t)}),mZ=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=UB),vt.init(e,t)}),pZ=ie("$ZodURL",(e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),gZ=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=BB()),vt.init(e,t)}),yZ=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$B),vt.init(e,t)}),xZ=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=AB),vt.init(e,t)}),bZ=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=OB),vt.init(e,t)}),vZ=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=RB),vt.init(e,t)}),kZ=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=MB),vt.init(e,t)}),wZ=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=DB),vt.init(e,t)}),SZ=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=KB(t)),vt.init(e,t)}),zZ=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=YB),vt.init(e,t)}),_Z=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=XB(t)),vt.init(e,t)}),jZ=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=LB),vt.init(e,t)}),TZ=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZB),vt.init(e,t),e._zod.bag.format="ipv4"}),CZ=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=IB),vt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),EZ=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=HB),vt.init(e,t)}),NZ=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=FB),vt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[o,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Y2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const AZ=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qB),vt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Y2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function OZ(e){if(!F2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Y2(n)}const RZ=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=F2),vt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{OZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),MZ=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=GB),vt.init(e,t)});function DZ(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const $Z=ie("$ZodJWT",(e,t)=>{vt.init(e,t),e._zod.check=n=>{DZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),LZ=ie("$ZodUnknown",(e,t)=>{Bt.init(e,t),e._zod.parse=n=>n}),PZ=ie("$ZodNever",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function pw(e,t,n){e.issues.length&&t.issues.push(...B2(n,e.issues)),t.value[n]=e.value}const UZ=ie("$ZodArray",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const u=[];for(let l=0;l<o.length;l++){const d=o[l],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?u.push(h.then(m=>pw(m,n,l))):pw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function Jc(e,t,n,a,o){if(e.issues.length){if(o&&!(n in a))return;t.issues.push(...B2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function X2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=dB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function K2(e,t,n,a,o,u){const l=[],d=o.keySet,h=o.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const x in t){if(d.has(x))continue;if(m==="never"){l.push(x);continue}const b=h.run({value:t[x],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Jc(v,n,x,t,g))):Jc(b,n,x,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const VZ=ie("$ZodObject",(e,t)=>{if(Bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=ty(()=>X2(t));Je(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const g=d[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const x of g.values)h[m].add(x)}}return h});const o=Kc,u=t.catchall;let l;e._zod.parse=(d,h)=>{l??(l=a.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const g=[],x=l.shape;for(const b of l.keys){const v=x[b],z=v._zod.optout==="optional",T=v._zod.run({value:m[b],issues:[]},h);T instanceof Promise?g.push(T.then(E=>Jc(E,d,b,m,z))):Jc(T,d,b,m,z)}return u?K2(g,m,d,h,a.value,e):g.length?Promise.all(g).then(()=>d):d}}),BZ=ie("$ZodObjectJIT",(e,t)=>{VZ.init(e,t);const n=e._zod.parse,a=ty(()=>X2(t)),o=b=>{const v=new cZ(["shape","payload","ctx"]),z=a.value,T=C=>{const $=hw(C);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const C of z.keys)E[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of z.keys){const $=E[C],L=hw(C),q=b[C]?._zod?.optout==="optional";v.write(`const ${$} = ${T(C)};`),q?v.write(`
72
+ `))}}const hZ={major:4,minor:3,patch:6},Bt=ie("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hZ;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)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(l,d,h)=>{let m=Oo(l),g;for(const x of d){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=x._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Vo;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Oo(l,b)))});else{if(l.issues.length===b)continue;m||(m=Oo(l,b))}}return g?g.then(()=>l):l},u=(l,d,h)=>{if(Oo(l))return l.aborted=!0,l;const m=o(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new Vo;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,d)):u(m,l,d)}const h=e._zod.parse(l,d);if(h instanceof Promise){if(d.async===!1)throw new Vo;return h.then(m=>o(m,a,d))}return o(h,a,d)}}Je(e,"~standard",()=>({validate:o=>{try{const u=SB(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return zB(e,o).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),sy=ie("$ZodString",(e,t)=>{Bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??WB(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),vt=ie("$ZodStringFormat",(e,t)=>{vd.init(e,t),sy.init(e,t)}),mZ=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=VB),vt.init(e,t)}),pZ=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=mw(a))}else t.pattern??(t.pattern=mw());vt.init(e,t)}),gZ=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=BB),vt.init(e,t)}),yZ=ie("$ZodURL",(e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),xZ=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=IB()),vt.init(e,t)}),bZ=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=PB),vt.init(e,t)}),vZ=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=RB),vt.init(e,t)}),kZ=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=MB),vt.init(e,t)}),wZ=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=DB),vt.init(e,t)}),SZ=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$B),vt.init(e,t)}),zZ=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=LB),vt.init(e,t)}),_Z=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=QB(t)),vt.init(e,t)}),jZ=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=KB),vt.init(e,t)}),TZ=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=JB(t)),vt.init(e,t)}),CZ=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=UB),vt.init(e,t)}),EZ=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=HB),vt.init(e,t),e._zod.bag.format="ipv4"}),NZ=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=FB),vt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),AZ=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=qB),vt.init(e,t)}),OZ=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=GB),vt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[o,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Y2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const RZ=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=YB),vt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Y2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function MZ(e){if(!F2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Y2(n)}const DZ=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=F2),vt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{MZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$Z=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=XB),vt.init(e,t)});function LZ(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const PZ=ie("$ZodJWT",(e,t)=>{vt.init(e,t),e._zod.check=n=>{LZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),UZ=ie("$ZodUnknown",(e,t)=>{Bt.init(e,t),e._zod.parse=n=>n}),VZ=ie("$ZodNever",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function pw(e,t,n){e.issues.length&&t.issues.push(...B2(n,e.issues)),t.value[n]=e.value}const BZ=ie("$ZodArray",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const u=[];for(let l=0;l<o.length;l++){const d=o[l],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?u.push(h.then(m=>pw(m,n,l))):pw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function Jc(e,t,n,a,o){if(e.issues.length){if(o&&!(n in a))return;t.issues.push(...B2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function X2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=hB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function K2(e,t,n,a,o,u){const l=[],d=o.keySet,h=o.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const x in t){if(d.has(x))continue;if(m==="never"){l.push(x);continue}const b=h.run({value:t[x],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Jc(v,n,x,t,g))):Jc(b,n,x,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const ZZ=ie("$ZodObject",(e,t)=>{if(Bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=ty(()=>X2(t));Je(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const g=d[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const x of g.values)h[m].add(x)}}return h});const o=Kc,u=t.catchall;let l;e._zod.parse=(d,h)=>{l??(l=a.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const g=[],x=l.shape;for(const b of l.keys){const v=x[b],z=v._zod.optout==="optional",T=v._zod.run({value:m[b],issues:[]},h);T instanceof Promise?g.push(T.then(E=>Jc(E,d,b,m,z))):Jc(T,d,b,m,z)}return u?K2(g,m,d,h,a.value,e):g.length?Promise.all(g).then(()=>d):d}}),IZ=ie("$ZodObjectJIT",(e,t)=>{ZZ.init(e,t);const n=e._zod.parse,a=ty(()=>X2(t)),o=b=>{const v=new fZ(["shape","payload","ctx"]),z=a.value,T=C=>{const $=hw(C);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const C of z.keys)E[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of z.keys){const $=E[C],L=hw(C),q=b[C]?._zod?.optout==="optional";v.write(`const ${$} = ${T(C)};`),q?v.write(`
73
73
  if (${$}.issues.length) {
74
74
  if (${L} in input) {
75
75
  payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
@@ -103,10 +103,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
103
103
  newResult[${L}] = ${$}.value;
104
104
  }
105
105
 
106
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(C,$)=>A(b,C,$)};let u;const l=Kc,d=!L2.jitless,m=d&&uB.value,g=t.catchall;let x;e._zod.parse=(b,v)=>{x??(x=a.value);const z=b.value;return l(z)?d&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=o(t.shape)),b=u(b,v),g?K2([],z,b,v,x,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),b)}});function gw(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const o=e.filter(u=>!Ao(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Ei(l,a,Ci())))}),t)}const ZZ=ie("$ZodUnion",(e,t)=>{Bt.init(e,t),Je(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Je(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Je(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Je(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>ry(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(n)return a(o,u);let l=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:o.value,issues:[]},u);if(m instanceof Promise)d.push(m),l=!0;else{if(m.issues.length===0)return m;d.push(m)}}return l?Promise.all(d).then(h=>gw(h,o,e,u)):gw(d,o,e,u)}}),IZ=ie("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value,u=t.left._zod.run({value:o,issues:[]},a),l=t.right._zod.run({value:o,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>yw(n,h,m)):yw(n,u,l)}});function Up(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(Al(e)&&Al(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),o={...e,...t};for(const u of a){const l=Up(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};o[u]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const o=e[a],u=t[a],l=Up(o,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yw(e,t,n){const a=new Map;let o;for(const d of t.issues)if(d.code==="unrecognized_keys"){o??(o=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&o&&e.issues.push({...o,keys:u}),Ao(e))return e;const l=Up(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const HZ=ie("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=P2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(o=>cB.has(typeof o)).map(o=>typeof o=="string"?Fo(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const l=o.value;return a.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),FZ=ie("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Fo(a):a?Fo(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,o)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),qZ=ie("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new $2(e.constructor.name);const o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new Uo;return n.value=o,n}});function xw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const J2=ie("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ry(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>xw(u,n.value)):xw(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),GZ=ie("$ZodExactOptional",(e,t)=>{J2.init(e,t),Je(e._zod,"values",()=>t.innerType._zod.values),Je(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),YZ=ie("$ZodNullable",(e,t)=>{Bt.init(e,t),Je(e._zod,"optin",()=>t.innerType._zod.optin),Je(e._zod,"optout",()=>t.innerType._zod.optout),Je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ry(n.source)}|null)$`):void 0}),Je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),XZ=ie("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>bw(u,t)):bw(o,t)}});function bw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const KZ=ie("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),JZ=ie("$ZodNonOptional",(e,t)=>{Bt.init(e,t),Je(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>vw(u,e)):vw(o,e)}});function vw(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 QZ=ie("$ZodCatch",(e,t)=>{Bt.init(e,t),Je(e._zod,"optin",()=>t.innerType._zod.optin),Je(e._zod,"optout",()=>t.innerType._zod.optout),Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Ei(l,a,Ci()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>Ei(u,a,Ci()))},input:n.value}),n.issues=[]),n)}}),WZ=ie("$ZodPipe",(e,t)=>{Bt.init(e,t),Je(e._zod,"values",()=>t.in._zod.values),Je(e._zod,"optin",()=>t.in._zod.optin),Je(e._zod,"optout",()=>t.out._zod.optout),Je(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>kc(l,t.in,a)):kc(u,t.in,a)}const o=t.in._zod.run(n,a);return o instanceof Promise?o.then(u=>kc(u,t.out,a)):kc(o,t.out,a)}});function kc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const eI=ie("$ZodReadonly",(e,t)=>{Bt.init(e,t),Je(e._zod,"propValues",()=>t.innerType._zod.propValues),Je(e._zod,"values",()=>t.innerType._zod.values),Je(e._zod,"optin",()=>t.innerType?._zod?.optin),Je(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(kw):kw(o)}});function kw(e){return e.value=Object.freeze(e.value),e}const tI=ie("$ZodCustom",(e,t)=>{Dr.init(e,t),Bt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,o=t.fn(a);if(o instanceof Promise)return o.then(u=>ww(u,n,a,e));ww(o,n,a,e)}});function ww(e,t,n,a){if(!e){const o={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),t.issues.push(Ol(o))}}var Sw;class nI{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[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 n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const o={...a,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function rI(){return new nI}(Sw=globalThis).__zod_globalRegistry??(Sw.__zod_globalRegistry=rI());const cl=globalThis.__zod_globalRegistry;function aI(e,t){return new e({type:"string",...Ce(t)})}function iI(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function zw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function oI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function sI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function lI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function uI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function cI(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function dI(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function fI(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function hI(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function mI(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function pI(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function gI(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function yI(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function xI(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function bI(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function vI(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function kI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function wI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function SI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function zI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function _I(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function jI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function TI(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function CI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function EI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function NI(e){return new e({type:"unknown"})}function AI(e,t){return new e({type:"never",...Ce(t)})}function Q2(e,t){return new eZ({check:"max_length",...Ce(t),maximum:e})}function Qc(e,t){return new tZ({check:"min_length",...Ce(t),minimum:e})}function W2(e,t){return new nZ({check:"length_equals",...Ce(t),length:e})}function OI(e,t){return new rZ({check:"string_format",format:"regex",...Ce(t),pattern:e})}function RI(e){return new aZ({check:"string_format",format:"lowercase",...Ce(e)})}function MI(e){return new iZ({check:"string_format",format:"uppercase",...Ce(e)})}function DI(e,t){return new oZ({check:"string_format",format:"includes",...Ce(t),includes:e})}function $I(e,t){return new sZ({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function LI(e,t){return new lZ({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function rs(e){return new uZ({check:"overwrite",tx:e})}function PI(e){return rs(t=>t.normalize(e))}function UI(){return rs(e=>e.trim())}function VI(){return rs(e=>e.toLowerCase())}function BI(){return rs(e=>e.toUpperCase())}function ZI(){return rs(e=>lB(e))}function II(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function HI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function FI(e){const t=qI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Ol(a,n.value,t._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Ol(o))}},e(n.value,n)));return t}function qI(e,t){const n=new Dr({check:"custom",...Ce(t)});return n._zod.check=e,n}function ej(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??cl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function on(e,t,n={path:[],schemaPath:[]}){var a;const o=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const d=e._zod.toJSONSchema?.();if(d)l.schema=d;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,b,g)}const x=e._zod.parent;x&&(l.ref||(l.ref=x),on(x,t,g),t.seen.get(x).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&yn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function tj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const d=e.metadataRegistry.get(l[0])?.id;if(d){const h=a.get(d);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,l[0])}}const o=l=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(l[0])?.id,b=e.external.uri??(z=>z);if(x)return{ref:b(x)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(l[1]===n)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:h,defId:m}=o(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const x in g)delete g[x];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
106
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(C,$)=>A(b,C,$)};let u;const l=Kc,d=!L2.jitless,m=d&&dB.value,g=t.catchall;let x;e._zod.parse=(b,v)=>{x??(x=a.value);const z=b.value;return l(z)?d&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=o(t.shape)),b=u(b,v),g?K2([],z,b,v,x,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),b)}});function gw(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const o=e.filter(u=>!Oo(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Ei(l,a,Ci())))}),t)}const HZ=ie("$ZodUnion",(e,t)=>{Bt.init(e,t),Je(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Je(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Je(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Je(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>ry(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(n)return a(o,u);let l=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:o.value,issues:[]},u);if(m instanceof Promise)d.push(m),l=!0;else{if(m.issues.length===0)return m;d.push(m)}}return l?Promise.all(d).then(h=>gw(h,o,e,u)):gw(d,o,e,u)}}),FZ=ie("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value,u=t.left._zod.run({value:o,issues:[]},a),l=t.right._zod.run({value:o,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>yw(n,h,m)):yw(n,u,l)}});function Up(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(Ol(e)&&Ol(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),o={...e,...t};for(const u of a){const l=Up(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};o[u]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const o=e[a],u=t[a],l=Up(o,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yw(e,t,n){const a=new Map;let o;for(const d of t.issues)if(d.code==="unrecognized_keys"){o??(o=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&o&&e.issues.push({...o,keys:u}),Oo(e))return e;const l=Up(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const qZ=ie("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=P2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(o=>fB.has(typeof o)).map(o=>typeof o=="string"?qo(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const l=o.value;return a.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),GZ=ie("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?qo(a):a?qo(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,o)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),YZ=ie("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new $2(e.constructor.name);const o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new Vo;return n.value=o,n}});function xw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const J2=ie("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ry(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>xw(u,n.value)):xw(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),XZ=ie("$ZodExactOptional",(e,t)=>{J2.init(e,t),Je(e._zod,"values",()=>t.innerType._zod.values),Je(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),KZ=ie("$ZodNullable",(e,t)=>{Bt.init(e,t),Je(e._zod,"optin",()=>t.innerType._zod.optin),Je(e._zod,"optout",()=>t.innerType._zod.optout),Je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ry(n.source)}|null)$`):void 0}),Je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),JZ=ie("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>bw(u,t)):bw(o,t)}});function bw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const QZ=ie("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),WZ=ie("$ZodNonOptional",(e,t)=>{Bt.init(e,t),Je(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>vw(u,e)):vw(o,e)}});function vw(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 eI=ie("$ZodCatch",(e,t)=>{Bt.init(e,t),Je(e._zod,"optin",()=>t.innerType._zod.optin),Je(e._zod,"optout",()=>t.innerType._zod.optout),Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Ei(l,a,Ci()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>Ei(u,a,Ci()))},input:n.value}),n.issues=[]),n)}}),tI=ie("$ZodPipe",(e,t)=>{Bt.init(e,t),Je(e._zod,"values",()=>t.in._zod.values),Je(e._zod,"optin",()=>t.in._zod.optin),Je(e._zod,"optout",()=>t.out._zod.optout),Je(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>wc(l,t.in,a)):wc(u,t.in,a)}const o=t.in._zod.run(n,a);return o instanceof Promise?o.then(u=>wc(u,t.out,a)):wc(o,t.out,a)}});function wc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const nI=ie("$ZodReadonly",(e,t)=>{Bt.init(e,t),Je(e._zod,"propValues",()=>t.innerType._zod.propValues),Je(e._zod,"values",()=>t.innerType._zod.values),Je(e._zod,"optin",()=>t.innerType?._zod?.optin),Je(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(kw):kw(o)}});function kw(e){return e.value=Object.freeze(e.value),e}const rI=ie("$ZodCustom",(e,t)=>{Dr.init(e,t),Bt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,o=t.fn(a);if(o instanceof Promise)return o.then(u=>ww(u,n,a,e));ww(o,n,a,e)}});function ww(e,t,n,a){if(!e){const o={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),t.issues.push(Rl(o))}}var Sw;class aI{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[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 n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const o={...a,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function iI(){return new aI}(Sw=globalThis).__zod_globalRegistry??(Sw.__zod_globalRegistry=iI());const dl=globalThis.__zod_globalRegistry;function oI(e,t){return new e({type:"string",...Ce(t)})}function sI(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function zw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function lI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function uI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function cI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function dI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function fI(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function hI(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function mI(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function pI(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function gI(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function yI(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function xI(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function bI(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function vI(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function kI(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function wI(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function SI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function zI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function _I(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function jI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function TI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function CI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function EI(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function NI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function AI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function OI(e){return new e({type:"unknown"})}function RI(e,t){return new e({type:"never",...Ce(t)})}function Q2(e,t){return new nZ({check:"max_length",...Ce(t),maximum:e})}function Qc(e,t){return new rZ({check:"min_length",...Ce(t),minimum:e})}function W2(e,t){return new aZ({check:"length_equals",...Ce(t),length:e})}function MI(e,t){return new iZ({check:"string_format",format:"regex",...Ce(t),pattern:e})}function DI(e){return new oZ({check:"string_format",format:"lowercase",...Ce(e)})}function $I(e){return new sZ({check:"string_format",format:"uppercase",...Ce(e)})}function LI(e,t){return new lZ({check:"string_format",format:"includes",...Ce(t),includes:e})}function PI(e,t){return new uZ({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function UI(e,t){return new cZ({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function as(e){return new dZ({check:"overwrite",tx:e})}function VI(e){return as(t=>t.normalize(e))}function BI(){return as(e=>e.trim())}function ZI(){return as(e=>e.toLowerCase())}function II(){return as(e=>e.toUpperCase())}function HI(){return as(e=>cB(e))}function FI(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function qI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function GI(e){const t=YI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Rl(a,n.value,t._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Rl(o))}},e(n.value,n)));return t}function YI(e,t){const n=new Dr({check:"custom",...Ce(t)});return n._zod.check=e,n}function ej(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??dl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function on(e,t,n={path:[],schemaPath:[]}){var a;const o=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const d=e._zod.toJSONSchema?.();if(d)l.schema=d;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,b,g)}const x=e._zod.parent;x&&(l.ref||(l.ref=x),on(x,t,g),t.seen.get(x).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&yn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function tj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const d=e.metadataRegistry.get(l[0])?.id;if(d){const h=a.get(d);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,l[0])}}const o=l=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(l[0])?.id,b=e.external.uri??(z=>z);if(x)return{ref:b(x)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(l[1]===n)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:h,defId:m}=o(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const x in g)delete g[x];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
107
107
 
108
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(d.cycle){u(l);continue}if(d.count>1&&e.reused==="ref"){u(l);continue}}}function nj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const d=e.seen.get(l);if(d.ref===null)return;const h=d.def??d.schema,m={...h},g=d.ref;if(d.ref=null,g){a(g);const b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const T in h)T==="$ref"||T==="allOf"||T in m||delete h[T];if(v.$ref&&b.def)for(const T in h)T==="$ref"||T==="allOf"||T in b.def&&JSON.stringify(h[T])===JSON.stringify(b.def[T])&&delete h[T]}const x=l._zod.parent;if(x&&x!==g){a(x);const b=e.seen.get(x);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path:d.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Wc(t,"input",e.processors),output:Wc(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return yn(a.element,n);if(a.type==="set")return yn(a.valueType,n);if(a.type==="lazy")return yn(a.getter(),n);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,n);if(a.type==="intersection")return yn(a.left,n)||yn(a.right,n);if(a.type==="record"||a.type==="map")return yn(a.keyType,n)||yn(a.valueType,n);if(a.type==="pipe")return yn(a.in,n)||yn(a.out,n);if(a.type==="object"){for(const o in a.shape)if(yn(a.shape[o],n))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(yn(o,n))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(yn(o,n))return!0;return!!(a.rest&&yn(a.rest,n))}return!1}const GI=(e,t={})=>n=>{const a=ej({...n,processors:t});return on(e,a),tj(a,e),nj(a,e)},Wc=(e,t,n={})=>a=>{const{libraryOptions:o,target:u}=a??{},l=ej({...o??{},target:u,io:t,processors:n});return on(e,l),tj(l,e),nj(l,e)},YI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},XI=(e,t,n,a)=>{const o=n;o.type="string";const{minimum:u,maximum:l,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(o.minLength=u),typeof l=="number"&&(o.maxLength=l),d&&(o.format=YI[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),m&&(o.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},KI=(e,t,n,a)=>{n.not={}},JI=(e,t,n,a)=>{},QI=(e,t,n,a)=>{const o=e._zod.def,u=P2(o.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},WI=(e,t,n,a)=>{const o=e._zod.def,u=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},e7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},t7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},n7=(e,t,n,a)=>{const o=n,u=e._zod.def,{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=on(u.element,t,{...a,path:[...a.path,"items"]})},r7=(e,t,n,a)=>{const o=n,u=e._zod.def;o.type="object",o.properties={};const l=u.shape;for(const m in l)o.properties[m]=on(l[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(l)),h=new Set([...d].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(o.required=Array.from(h)),u.catchall?._zod.def.type==="never"?o.additionalProperties=!1:u.catchall?u.catchall&&(o.additionalProperties=on(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},a7=(e,t,n,a)=>{const o=e._zod.def,u=o.inclusive===!1,l=o.options.map((d,h)=>on(d,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},i7=(e,t,n,a)=>{const o=e._zod.def,u=on(o.left,t,{...a,path:[...a.path,"allOf",0]}),l=on(o.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(u)?u.allOf:[u],...d(l)?l.allOf:[l]];n.allOf=h},o7=(e,t,n,a)=>{const o=e._zod.def,u=on(o.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},s7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},l7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},u7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},c7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},d7=(e,t,n,a)=>{const o=e._zod.def,u=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;on(u,t,a);const l=t.seen.get(e);l.ref=u},f7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.readOnly=!0},rj=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},h7=ie("ZodISODateTime",(e,t)=>{SZ.init(e,t),Tt.init(e,t)});function m7(e){return jI(h7,e)}const p7=ie("ZodISODate",(e,t)=>{zZ.init(e,t),Tt.init(e,t)});function g7(e){return TI(p7,e)}const y7=ie("ZodISOTime",(e,t)=>{_Z.init(e,t),Tt.init(e,t)});function x7(e){return CI(y7,e)}const b7=ie("ZodISODuration",(e,t)=>{jZ.init(e,t),Tt.init(e,t)});function v7(e){return EI(b7,e)}const aj=(e,t)=>{I2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>vB(e,n)},flatten:{value:n=>bB(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Pp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Pp,2)}},isEmpty:{get(){return e.issues.length===0}}})},k7=ie("ZodError",aj),ur=ie("ZodError",aj,{Parent:Error}),w7=iy(ur),S7=oy(ur),z7=xd(ur),_7=bd(ur),j7=SB(ur),T7=zB(ur),C7=_B(ur),E7=jB(ur),N7=TB(ur),A7=CB(ur),O7=EB(ur),R7=NB(ur),Zt=ie("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Wc(e,"input"),output:Wc(e,"output")}}),e.toJSONSchema=GI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ka(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Ja(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>w7(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>z7(e,n,a),e.parseAsync=async(n,a)=>S7(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>_7(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>j7(e,n,a),e.decode=(n,a)=>T7(e,n,a),e.encodeAsync=async(n,a)=>C7(e,n,a),e.decodeAsync=async(n,a)=>E7(e,n,a),e.safeEncode=(n,a)=>N7(e,n,a),e.safeDecode=(n,a)=>A7(e,n,a),e.safeEncodeAsync=async(n,a)=>O7(e,n,a),e.safeDecodeAsync=async(n,a)=>R7(e,n,a),e.refine=(n,a)=>e.check(jH(n,a)),e.superRefine=n=>e.check(TH(n)),e.overwrite=n=>e.check(rs(n)),e.optional=()=>Cw(e),e.exactOptional=()=>hH(e),e.nullable=()=>Ew(e),e.nullish=()=>Cw(Ew(e)),e.nonoptional=n=>bH(e,n),e.array=()=>nH(e),e.or=n=>oj([e,n]),e.and=n=>sH(e,n),e.transform=n=>Nw(e,dH(n)),e.default=n=>gH(e,n),e.prefault=n=>xH(e,n),e.catch=n=>kH(e,n),e.pipe=n=>Nw(e,n),e.readonly=()=>zH(e),e.describe=n=>{const a=e.clone();return cl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return cl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cl.get(e);const a=e.clone();return cl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ij=ie("_ZodString",(e,t)=>{sy.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(a,o,u)=>XI(e,a,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(OI(...a)),e.includes=(...a)=>e.check(DI(...a)),e.startsWith=(...a)=>e.check($I(...a)),e.endsWith=(...a)=>e.check(LI(...a)),e.min=(...a)=>e.check(Qc(...a)),e.max=(...a)=>e.check(Q2(...a)),e.length=(...a)=>e.check(W2(...a)),e.nonempty=(...a)=>e.check(Qc(1,...a)),e.lowercase=a=>e.check(RI(a)),e.uppercase=a=>e.check(MI(a)),e.trim=()=>e.check(UI()),e.normalize=(...a)=>e.check(PI(...a)),e.toLowerCase=()=>e.check(VI()),e.toUpperCase=()=>e.check(BI()),e.slugify=()=>e.check(ZI())}),M7=ie("ZodString",(e,t)=>{sy.init(e,t),ij.init(e,t),e.email=n=>e.check(iI(D7,n)),e.url=n=>e.check(cI($7,n)),e.jwt=n=>e.check(_I(J7,n)),e.emoji=n=>e.check(dI(L7,n)),e.guid=n=>e.check(zw(_w,n)),e.uuid=n=>e.check(oI(wc,n)),e.uuidv4=n=>e.check(sI(wc,n)),e.uuidv6=n=>e.check(lI(wc,n)),e.uuidv7=n=>e.check(uI(wc,n)),e.nanoid=n=>e.check(fI(P7,n)),e.guid=n=>e.check(zw(_w,n)),e.cuid=n=>e.check(hI(U7,n)),e.cuid2=n=>e.check(mI(V7,n)),e.ulid=n=>e.check(pI(B7,n)),e.base64=n=>e.check(wI(Y7,n)),e.base64url=n=>e.check(SI(X7,n)),e.xid=n=>e.check(gI(Z7,n)),e.ksuid=n=>e.check(yI(I7,n)),e.ipv4=n=>e.check(xI(H7,n)),e.ipv6=n=>e.check(bI(F7,n)),e.cidrv4=n=>e.check(vI(q7,n)),e.cidrv6=n=>e.check(kI(G7,n)),e.e164=n=>e.check(zI(K7,n)),e.datetime=n=>e.check(m7(n)),e.date=n=>e.check(g7(n)),e.time=n=>e.check(x7(n)),e.duration=n=>e.check(v7(n))});function Am(e){return aI(M7,e)}const Tt=ie("ZodStringFormat",(e,t)=>{vt.init(e,t),ij.init(e,t)}),D7=ie("ZodEmail",(e,t)=>{mZ.init(e,t),Tt.init(e,t)}),_w=ie("ZodGUID",(e,t)=>{fZ.init(e,t),Tt.init(e,t)}),wc=ie("ZodUUID",(e,t)=>{hZ.init(e,t),Tt.init(e,t)}),$7=ie("ZodURL",(e,t)=>{pZ.init(e,t),Tt.init(e,t)}),L7=ie("ZodEmoji",(e,t)=>{gZ.init(e,t),Tt.init(e,t)}),P7=ie("ZodNanoID",(e,t)=>{yZ.init(e,t),Tt.init(e,t)}),U7=ie("ZodCUID",(e,t)=>{xZ.init(e,t),Tt.init(e,t)}),V7=ie("ZodCUID2",(e,t)=>{bZ.init(e,t),Tt.init(e,t)}),B7=ie("ZodULID",(e,t)=>{vZ.init(e,t),Tt.init(e,t)}),Z7=ie("ZodXID",(e,t)=>{kZ.init(e,t),Tt.init(e,t)}),I7=ie("ZodKSUID",(e,t)=>{wZ.init(e,t),Tt.init(e,t)}),H7=ie("ZodIPv4",(e,t)=>{TZ.init(e,t),Tt.init(e,t)}),F7=ie("ZodIPv6",(e,t)=>{CZ.init(e,t),Tt.init(e,t)}),q7=ie("ZodCIDRv4",(e,t)=>{EZ.init(e,t),Tt.init(e,t)}),G7=ie("ZodCIDRv6",(e,t)=>{NZ.init(e,t),Tt.init(e,t)}),Y7=ie("ZodBase64",(e,t)=>{AZ.init(e,t),Tt.init(e,t)}),X7=ie("ZodBase64URL",(e,t)=>{RZ.init(e,t),Tt.init(e,t)}),K7=ie("ZodE164",(e,t)=>{MZ.init(e,t),Tt.init(e,t)}),J7=ie("ZodJWT",(e,t)=>{$Z.init(e,t),Tt.init(e,t)}),Q7=ie("ZodUnknown",(e,t)=>{LZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>JI()});function jw(){return NI(Q7)}const W7=ie("ZodNever",(e,t)=>{PZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>KI(e,n,a)});function eH(e){return AI(W7,e)}const tH=ie("ZodArray",(e,t)=>{UZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>n7(e,n,a,o),e.element=t.element,e.min=(n,a)=>e.check(Qc(n,a)),e.nonempty=n=>e.check(Qc(1,n)),e.max=(n,a)=>e.check(Q2(n,a)),e.length=(n,a)=>e.check(W2(n,a)),e.unwrap=()=>e.element});function nH(e,t){return II(tH,e,t)}const rH=ie("ZodObject",(e,t)=>{BZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>r7(e,n,a,o),Je(e,"shape",()=>t.shape),e.keyof=()=>lH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jw()}),e.loose=()=>e.clone({...e._zod.def,catchall:jw()}),e.strict=()=>e.clone({...e._zod.def,catchall:eH()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>mB(e,n),e.safeExtend=n=>pB(e,n),e.merge=n=>gB(e,n),e.pick=n=>fB(e,n),e.omit=n=>hB(e,n),e.partial=(...n)=>yB(sj,e,n[0]),e.required=(...n)=>xB(lj,e,n[0])});function aH(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new rH(n)}const iH=ie("ZodUnion",(e,t)=>{ZZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>a7(e,n,a,o),e.options=t.options});function oj(e,t){return new iH({type:"union",options:e,...Ce(t)})}const oH=ie("ZodIntersection",(e,t)=>{IZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>i7(e,n,a,o)});function sH(e,t){return new oH({type:"intersection",left:e,right:t})}const Vp=ie("ZodEnum",(e,t)=>{HZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(a,o,u)=>QI(e,a,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,o)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Vp({...t,checks:[],...Ce(o),entries:u})},e.exclude=(a,o)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Vp({...t,checks:[],...Ce(o),entries:u})}});function lH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Vp({type:"enum",entries:n,...Ce(t)})}const uH=ie("ZodLiteral",(e,t)=>{FZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>WI(e,n,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 Tw(e,t){return new uH({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const cH=ie("ZodTransform",(e,t)=>{qZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>t7(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new $2(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Ol(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Ol(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(u=>(n.value=u,n)):(n.value=o,n)}});function dH(e){return new cH({type:"transform",transform:e})}const sj=ie("ZodOptional",(e,t)=>{J2.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>rj(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function Cw(e){return new sj({type:"optional",innerType:e})}const fH=ie("ZodExactOptional",(e,t)=>{GZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>rj(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function hH(e){return new fH({type:"optional",innerType:e})}const mH=ie("ZodNullable",(e,t)=>{YZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>o7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function Ew(e){return new mH({type:"nullable",innerType:e})}const pH=ie("ZodDefault",(e,t)=>{XZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>l7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gH(e,t){return new pH({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V2(t)}})}const yH=ie("ZodPrefault",(e,t)=>{KZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>u7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function xH(e,t){return new yH({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V2(t)}})}const lj=ie("ZodNonOptional",(e,t)=>{JZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>s7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function bH(e,t){return new lj({type:"nonoptional",innerType:e,...Ce(t)})}const vH=ie("ZodCatch",(e,t)=>{QZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>c7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function kH(e,t){return new vH({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wH=ie("ZodPipe",(e,t)=>{WZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>d7(e,n,a,o),e.in=t.in,e.out=t.out});function Nw(e,t){return new wH({type:"pipe",in:e,out:t})}const SH=ie("ZodReadonly",(e,t)=>{eI.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>f7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function zH(e){return new SH({type:"readonly",innerType:e})}const _H=ie("ZodCustom",(e,t)=>{tI.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>e7(e,n)});function jH(e,t={}){return HI(_H,e,t)}function TH(e){return FI(e)}const CH=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"ui",label:"Interface"},{id:"logging",label:"Logging"}],EH=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],ol=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function NH(){const{data:e,error:t}=Qt("/api/config",Sr.fetchConfig),{data:n}=Qt("/api/config/sati",Sr.getSatiConfig),{data:a}=Qt("/api/config/apoc",Sr.getApocConfig),{data:o}=Qt("/api/config/neo",Sr.getNeoConfig),{data:u}=Qt("/api/config/trinity",Sr.getTrinityConfig),[l,d]=j.useState(null),[h,m]=j.useState(null),[g,x]=j.useState(null),[b,v]=j.useState(null),[z,T]=j.useState(null),[E,N]=j.useState("general"),[A,C]=j.useState("oracle"),[$,L]=j.useState(!1),[M,q]=j.useState({}),[V,X]=j.useState(null);j.useEffect(()=>{e&&!l&&d(e)},[e]),j.useEffect(()=>{n&&!h&&m(n)},[n]),j.useEffect(()=>{a&&!b?v(a):!a&&!b&&l&&v({...l.apoc??l.llm,temperature:l.apoc?.temperature??.2,timeout_ms:l.apoc?.timeout_ms??3e4})},[a,l]),j.useEffect(()=>{o&&!g?x(o):!o&&!g&&l&&x({...l.neo??l.llm,temperature:l.neo?.temperature??.2})},[o,l]),j.useEffect(()=>{u&&!z?T(u):!u&&!z&&l&&T({...l.trinity??l.llm,temperature:l.trinity?.temperature??.2})},[u,l]);const ce=JSON.stringify(e)!==JSON.stringify(l)||JSON.stringify(n)!==JSON.stringify(h)||JSON.stringify(o)!==JSON.stringify(g)||JSON.stringify(a)!==JSON.stringify(b)||JSON.stringify(u)!==JSON.stringify(z),Q=(S,H)=>{if(!l)return;const w=JSON.parse(JSON.stringify(l));let G=w;for(let de=0;de<S.length-1;de++)G=G[S[de]];G[S[S.length-1]]=H,d(w);try{oB.parse(w),q({})}catch(de){if(de instanceof k7){const fe={};de.errors.forEach(me=>{const De=me.path.join(".");fe[De]=me.message}),q(fe)}}},se=(S,H)=>{h&&m({...h,[S]:H})},te=(S,H)=>{b&&v({...b,[S]:H})},oe=(S,H)=>{g&&x({...g,[S]:H})},ae=(S,H)=>{z&&T({...z,[S]:H})},U=()=>{!l||!z||T({...z,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},K=()=>{!l||!h||m({...h,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},B=()=>{!l||!b||v({...b,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},he=()=>{!l||!g||x({...g,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},O=async()=>{if(l){L(!0),X(null);try{await Sr.updateConfig(l),h&&await Sr.updateSatiConfig(h),g&&await Sr.updateNeoConfig(g),b&&await Sr.updateApocConfig(b),z&&await Sr.updateTrinityConfig(z),na("/api/config"),na("/api/config/sati"),na("/api/config/neo"),na("/api/config/apoc"),na("/api/config/trinity"),X({type:"success",message:"Settings saved successfully. Restart Morpheus daemon for changes to take effect."})}catch(S){if(X({type:"error",message:S.message}),S.details&&Array.isArray(S.details)){const H={};S.details.forEach(w=>{const G=w.path.join(".");H[G]=w.message}),q(H)}}finally{L(!1)}}};return t?f.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):l?f.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Zaion Settings"}),f.jsx("button",{onClick:O,disabled:!ce||Object.keys(M).length>0||$,className:`px-4 py-2 rounded font-medium transition-colors ${ce&&Object.keys(M).length===0?"bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90":"bg-azure-border text-azure-text-secondary cursor-not-allowed dark:bg-matrix-primary/50 dark:text-matrix-highlight/50"}`,children:$?"Saving...":"Save Changes"})]}),V&&f.jsx("div",{className:`p-4 rounded border ${V.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:V.message}),f.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:f.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:CH.map(S=>f.jsx("button",{onClick:()=>N(S.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${E===S.id?"bg-azure-surface/50 text-azure-primary border-t border-x border-azure-border dark:bg-matrix-primary/20 dark:text-matrix-highlight dark:border-t dark:border-x dark:border-matrix-primary":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:S.label},S.id))})}),f.jsxs("div",{className:"space-y-6",children:[E==="general"&&f.jsxs(wr,{title:"Agent Identity",children:[f.jsx(yt,{label:"Agent Name",value:l.agent.name,onChange:S=>Q(["agent","name"],S.target.value),error:M["agent.name"]}),f.jsx(yt,{label:"Personality",value:l.agent.personality,onChange:S=>Q(["agent","personality"],S.target.value),error:M["agent.personality"]})]}),E==="agents"&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:EH.map(S=>f.jsx("button",{onClick:()=>C(S.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${A===S.id?"bg-azure-primary/10 text-azure-primary border-b-2 border-azure-primary dark:bg-matrix-highlight/10 dark:text-matrix-highlight dark:border-matrix-highlight":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:S.label},S.id))}),A==="oracle"&&f.jsxs(wr,{title:"Oracle Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Main orchestration agent — handles user requests and delegates to subagents"}),f.jsx(xi,{label:"Provider",value:l.llm.provider,onChange:S=>Q(["llm","provider"],S.target.value),options:ol,error:M["llm.provider"]}),f.jsx(yt,{label:"Model Name",value:l.llm.model,onChange:S=>Q(["llm","model"],S.target.value),error:M["llm.model"]}),f.jsx(Bn,{label:"Temperature",value:l.llm.temperature,onChange:S=>Q(["llm","temperature"],parseFloat(S.target.value)),step:.1,min:0,max:1,error:M["llm.temperature"]}),f.jsx(Bn,{label:"Max Tokens",value:l.llm.max_tokens??"",onChange:S=>Q(["llm","max_tokens"],S.target.value?parseInt(S.target.value):void 0),min:1,error:M["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(Bn,{label:"Context Window (Messages)",value:l.llm.context_window??100,onChange:S=>Q(["llm","context_window"],parseInt(S.target.value)),min:1,step:1,error:M["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100)."}),f.jsx(yt,{label:"API Key",type:"password",value:l.llm.api_key||"",onChange:S=>Q(["llm","api_key"],S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),l.llm.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:l.llm.base_url||"https://openrouter.ai/api/v1",onChange:S=>Q(["llm","base_url"],S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),A==="sati"&&f.jsxs(wr,{title:"Sati Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Background memory consolidation agent — evaluates conversations and persists important context"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:K,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),h&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:h.provider,onChange:S=>se("provider",S.target.value),options:ol}),f.jsx(yt,{label:"Model Name",value:h.model,onChange:S=>se("model",S.target.value)}),f.jsx(yt,{label:"API Key",type:"password",value:h.api_key||"",onChange:S=>se("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),h.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:h.base_url||"https://openrouter.ai/api/v1",onChange:S=>se("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),f.jsx(Bn,{label:"Memory Limit",value:h.memory_limit??10,onChange:S=>se("memory_limit",parseInt(S.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),f.jsx(il,{label:"Enable Archived Sessions in Memory Retrieval",checked:h.enabled_archived_sessions??!0,onChange:S=>se("enabled_archived_sessions",S)})]})]}),A==="neo"&&f.jsxs(wr,{title:"Neo Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"MCP + internal tools subagent — executes analytical and operational tasks delegated by Oracle"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:he,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),g&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:g.provider,onChange:S=>oe("provider",S.target.value),options:ol}),f.jsx(yt,{label:"Model Name",value:g.model,onChange:S=>oe("model",S.target.value)}),f.jsx(Bn,{label:"Temperature",value:g.temperature,onChange:S=>oe("temperature",parseFloat(S.target.value)),step:.1,min:0,max:1}),f.jsx(Bn,{label:"Max Tokens",value:g.max_tokens??"",onChange:S=>oe("max_tokens",S.target.value?parseInt(S.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(Bn,{label:"Context Window (Messages)",value:g.context_window??100,onChange:S=>oe("context_window",parseInt(S.target.value)),min:1,step:1}),f.jsx(yt,{label:"API Key",type:"password",value:g.api_key||"",onChange:S=>oe("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),g.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:g.base_url||"https://openrouter.ai/api/v1",onChange:S=>oe("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),A==="trinity"&&f.jsxs(wr,{title:"Trinity Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Database subagent — interprets natural language queries and executes them against registered databases (PostgreSQL, MySQL, SQLite, MongoDB)"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:U,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),z&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:z.provider,onChange:S=>ae("provider",S.target.value),options:ol}),f.jsx(yt,{label:"Model Name",value:z.model,onChange:S=>ae("model",S.target.value)}),f.jsx(Bn,{label:"Temperature",value:z.temperature,onChange:S=>ae("temperature",parseFloat(S.target.value)),step:.1,min:0,max:1}),f.jsx(Bn,{label:"Max Tokens",value:z.max_tokens??"",onChange:S=>ae("max_tokens",S.target.value?parseInt(S.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(yt,{label:"API Key",type:"password",value:z.api_key||"",onChange:S=>ae("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),z.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:z.base_url||"https://openrouter.ai/api/v1",onChange:S=>ae("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),A==="apoc"&&f.jsxs(wr,{title:"Apoc Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"DevTools subagent — executes file, shell, git, network, and system operations on behalf of Oracle"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:B,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),b&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:b.provider,onChange:S=>te("provider",S.target.value),options:ol}),f.jsx(yt,{label:"Model Name",value:b.model,onChange:S=>te("model",S.target.value)}),f.jsx(Bn,{label:"Temperature",value:b.temperature,onChange:S=>te("temperature",parseFloat(S.target.value)),step:.1,min:0,max:1}),f.jsx(yt,{label:"API Key",type:"password",value:b.api_key||"",onChange:S=>te("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),b.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:b.base_url||"https://openrouter.ai/api/v1",onChange:S=>te("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),f.jsx(yt,{label:"Working Directory",value:b.working_dir||"",onChange:S=>te("working_dir",S.target.value),placeholder:"/home/user/projects",helperText:"Root directory for file and shell operations. Leave empty to use process working directory."}),f.jsx(Bn,{label:"Timeout (ms)",value:b.timeout_ms??3e4,onChange:S=>te("timeout_ms",parseInt(S.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),E==="audio"&&f.jsxs(wr,{title:"Audio Transcription",children:[f.jsx(il,{label:"Enable Audio",checked:l.audio.enabled,onChange:S=>Q(["audio","enabled"],S)}),f.jsx(xi,{label:"Provider",value:l.audio.provider||"google",onChange:S=>Q(["audio","provider"],S.target.value),options:[{label:"Google Gemini",value:"google"},{label:"OpenAI (Whisper)",value:"openai"},{label:"OpenRouter (multimodal)",value:"openrouter"},{label:"Ollama (Whisper local)",value:"ollama"}],error:M["audio.provider"]}),f.jsx(yt,{label:"Model",value:l.audio.model,onChange:S=>Q(["audio","model"],S.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:M["audio.model"]}),l.audio.provider==="ollama"&&f.jsx(yt,{label:"Base URL",value:l.audio.base_url||"",onChange:S=>Q(["audio","base_url"],S.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),f.jsx(yt,{label:"API Key",type:"password",value:l.audio.apiKey||"",onChange:S=>Q(["audio","apiKey"],S.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider."}),f.jsx(Bn,{label:"Max Duration (Seconds)",value:l.audio.maxDurationSeconds,onChange:S=>Q(["audio","maxDurationSeconds"],parseInt(S.target.value)),min:1}),f.jsx(yt,{label:"Supported Mime Types",value:l.audio.supportedMimeTypes.join(", "),onChange:S=>Q(["audio","supportedMimeTypes"],S.target.value.split(",").map(H=>H.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),E==="channels"&&f.jsxs(wr,{title:"Telegram",children:[f.jsx(il,{label:"Enable Telegram",checked:l.channels.telegram.enabled,onChange:S=>Q(["channels","telegram","enabled"],S)}),l.channels.telegram.enabled&&f.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[f.jsx(yt,{label:"Bot Token",type:"password",value:l.channels.telegram.token||"",onChange:S=>Q(["channels","telegram","token"],S.target.value)}),f.jsx(yt,{label:"Allowed Users (comma separated)",value:l.channels.telegram.allowedUsers.join(", "),onChange:S=>Q(["channels","telegram","allowedUsers"],S.target.value.split(",").map(H=>H.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),E==="ui"&&f.jsxs(wr,{title:"Dashboard",children:[f.jsx(il,{label:"Enable Web UI",checked:l.ui.enabled,onChange:S=>Q(["ui","enabled"],S)}),f.jsx(Bn,{label:"Port",value:l.ui.port,onChange:S=>Q(["ui","port"],parseInt(S.target.value)),disabled:!0,helperText:"Requires restart to change."})]}),E==="logging"&&f.jsxs(wr,{title:"Logging",children:[f.jsx(il,{label:"Enable Logging",checked:l.logging.enabled,onChange:S=>Q(["logging","enabled"],S)}),f.jsx(xi,{label:"Log Level",value:l.logging.level,onChange:S=>Q(["logging","level"],S.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]})]})]}):f.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function AH(){const{data:e}=p4(),[t,n]=j.useState(null),{data:a,mutate:o}=g4(t);return j.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),f.jsxs(ot.div,{className:"h-full flex flex-col space-y-4 pt-16 md:pt-0",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.3},children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"SYSTEM LOGS"}),f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"View runtime logs."})]}),f.jsxs("div",{className:"flex-1 flex gap-4 overflow-hidden border border-azure-border dark:border-matrix-primary rounded bg-azure-surface dark:bg-zinc-950 p-4",children:[f.jsxs("div",{className:"w-64 flex flex-col gap-2 border-r border-azure-border dark:border-matrix-primary pr-4 overflow-y-auto shrink-0",children:[f.jsx("h3",{className:"font-bold text-azure-text-secondary dark:text-matrix-secondary mb-2 sticky top-0 bg-azure-surface dark:bg-zinc-950",children:"LOG FILES"}),e?.map(u=>f.jsxs("button",{onClick:()=>n(u.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===u.name?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-zinc-900 group-hover:text-azure-primary dark:group-hover:text-matrix-highlight"}`,children:[f.jsx(qN,{className:"w-4 h-4 shrink-0"}),f.jsxs("div",{className:"flex flex-col overflow-hidden",children:[f.jsx("span",{className:"truncate font-bold",children:u.name}),f.jsxs("span",{className:"text-xs opacity-70",children:[(u.size/1024).toFixed(1)," KB"]})]})]},u.name))]}),f.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary/50 rounded",children:[f.jsxs("div",{className:"flex justify-between items-center p-2 bg-azure-hover dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary/50",children:[f.jsx("span",{className:"text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm",children:t}),f.jsx("button",{onClick:()=>o(),className:"text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(hS,{className:"w-4 h-4"})})]}),f.jsx("div",{className:"flex-1 overflow-auto p-4 font-mono text-xs whitespace-pre-wrap text-azure-text-primary dark:text-white",children:a?a.lines.join(`
109
- `):"Select a log file to view content..."})]})]})]})}function OH(){const[e,t]=j.useState(null),[n,a]=j.useState([]),[o,u]=j.useState(!0),[l,d]=j.useState("");if(j.useEffect(()=>{async function g(){try{const[x,b]=await Promise.all([Sp.fetchUsageStats(),Sp.fetchGroupedUsageStats()]);t(x),a(b)}catch(x){d("Failed to load usage statistics"),console.error(x)}finally{u(!1)}}g()},[]),o)return f.jsx("div",{className:"flex items-center justify-center h-64 text-azure-accent dark:text-matrix-highlight font-mono animate-pulse",children:"LOADING_DATA_STREAM..."});if(l)return f.jsxs("div",{className:"p-4 bg-red-900/20 border border-red-500/50 text-red-500 font-mono rounded",children:["ERROR_ACCESSING_DATABASE: ",l]});const h={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},m={hidden:{y:20,opacity:0},show:{y:0,opacity:1}};return f.jsxs(ot.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsx("div",{className:"flex items-center justify-between border-b border-azure-border dark:border-matrix-primary pb-4",children:f.jsxs("div",{children:[f.jsxs("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight font-mono flex items-center gap-2",children:[f.jsx(Vm,{className:"w-6 h-6"}),"USAGE_ANALYTICS"]}),f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1 font-mono text-sm",children:"Resource consumption tracking and metrics"})]})}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[f.jsxs(ot.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx(vl,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),f.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),f.jsxs(ot.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx(Oo,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),f.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),f.jsxs(ot.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx($c,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),f.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),f.jsxs(ot.div,{variants:m,className:"bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden backdrop-blur-sm",children:[f.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:f.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[f.jsx("thead",{className:"bg-azure-bg dark:bg-zinc-900/50 text-azure-text-secondary dark:text-matrix-secondary border-b border-azure-border dark:border-matrix-primary",children:f.jsxs("tr",{children:[f.jsx("th",{className:"p-4",children:"Provider"}),f.jsx("th",{className:"p-4",children:"Model"}),f.jsx("th",{className:"p-4 text-right",children:"Messages"}),f.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),f.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),f.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:8,className:"p-8 text-center text-azure-text-muted dark:text-matrix-secondary italic",children:"NO_DATA_AVAILABLE"})}):n.map((g,x)=>f.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[f.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),f.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),f.jsx("td",{className:"p-4 text-right font-bold text-green-600 dark:text-green-400",children:g.estimatedCostUsd!=null?`$${g.estimatedCostUsd.toFixed(4)}`:"—"})]},`${g.provider}-${g.model}-${x}`))})]})})]})]})}const RH=()=>{const[e,t]=j.useState(""),[n,a]=j.useState(""),o=qp(),u=yr(),l=d=>{d.preventDefault(),e&&(a(""),fetch("/api/config",{headers:{"x-architect-pass":e}}).then(async h=>{if(h.ok){localStorage.setItem("morpheus.auth.token",e);const m=u.state?.from?.pathname||"/";o(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return f.jsx("div",{className:"flex items-center justify-center min-h-screen bg-azure-bg dark:bg-black text-azure-primary dark:text-green-500 font-mono",children:f.jsxs("div",{className:"max-w-md w-full p-8 border border-azure-primary dark:border-green-500 shadow-xl dark:shadow-[0_0_15px_rgba(34,197,94,0.3)] bg-white dark:bg-black rounded-lg dark:rounded-none",children:[f.jsx("h1",{className:"text-2xl font-bold mb-6 text-center tracking-widest uppercase text-azure-primary dark:text-green-500",children:"> The Architect Login"}),f.jsxs("form",{onSubmit:l,className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),f.jsx("input",{type:"password",value:e,onChange:d=>t(d.target.value),className:"w-full bg-azure-bg dark:bg-black border border-azure-border dark:border-green-800 p-2 focus:outline-none focus:border-azure-primary dark:focus:border-green-500 text-azure-text-primary dark:text-green-500 placeholder-azure-text-secondary/50 dark:placeholder-green-900 rounded dark:rounded-none",placeholder:"••••••••",autoFocus:!0})]}),n&&f.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),f.jsx("button",{type:"submit",className:"w-full bg-azure-primary hover:bg-azure-active dark:bg-green-900 dark:hover:bg-green-700 text-white dark:text-black font-bold py-2 transition-colors duration-200 uppercase tracking-wider rounded dark:rounded-none",children:"Authenticate"})]}),f.jsx("div",{className:"mt-8 text-[10px] opacity-30 text-center uppercase text-azure-text-secondary dark:text-green-500",children:"Morpheus OS v0.1.5 | Unauthorized access is logged."})]})})},MH=({children:e})=>{const{isAuthenticated:t}=l_(),n=yr();return t?f.jsx(f.Fragment,{children:e}):f.jsx(tS,{to:"/login",state:{from:n},replace:!0})},DH=({className:e,...t})=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),$H=({...e})=>f.jsx("thead",{...e}),LH=({...e})=>f.jsx("tbody",{...e}),Om=({...e})=>f.jsx("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 transition-colors hover:bg-azure-hover/50 dark:hover:bg-matrix-primary/10",...e}),wo=({className:e,...t})=>f.jsx("th",{className:`h-12 px-4 text-left align-middle font-medium text-azure-text-secondary dark:text-matrix-secondary/70 [&:has([role=checkbox])]:pr-0 ${e}`,...t}),bi=({className:e,...t})=>f.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),Aw=({checked:e,onCheckedChange:t,className:n,...a})=>{const o=u=>{t&&t(u.target.checked),a.onChange&&a.onChange(u)};return f.jsx("input",{type:"checkbox",checked:e,onChange:o,className:`h-4 w-4 rounded border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-primary dark:text-matrix-highlight focus:ring-azure-primary dark:focus:ring-matrix-highlight ${n||""}`,...a})},ed=({className:e,variant:t="default",...n})=>{const o=`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:focus:ring-zinc-300 ${t==="destructive"?"border-transparent bg-red-500 text-zinc-50 dark:bg-red-900 dark:text-zinc-50":t==="secondary"?"border-transparent bg-azure-surface dark:bg-zinc-800 text-azure-text-secondary dark:text-matrix-secondary":t==="outline"?"text-azure-text-primary dark:text-matrix-secondary border-azure-border dark:border-matrix-primary":"border-transparent bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black"} ${e||""}`;return f.jsx("div",{className:o,...n})},Rm=({className:e,...t})=>f.jsx("div",{className:`rounded-lg border border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary shadow-sm ${e||""}`,...t}),Ow=({className:e,...t})=>f.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),PH=({className:e,...t})=>f.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),Mm=({className:e,...t})=>f.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),UH=({className:e,variant:t="default",...n})=>{const o=`relative w-full rounded-lg border p-4 ${t==="destructive"?"border-red-500/50 text-red-700 dark:border-red-900/50 dark:text-red-300":"border-azure-border dark:border-matrix-primary"} ${e||""}`;return f.jsx("div",{className:o,...n})},VH=({className:e,...t})=>f.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),uj=({isOpen:e,onClose:t,title:n,children:a,size:o="md"})=>{if(!e)return null;const u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),f.jsxs("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full ${u[o]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&f.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&f.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),f.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},BH=({isOpen:e,onClose:t,memory:n})=>n?f.jsx(uj,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(wA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),f.jsx("div",{children:f.jsx(ed,{variant:"outline",children:n.category})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(NA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),f.jsx("div",{children:f.jsx(ed,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(uS,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ad,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(id,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(KN,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(QN,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),f.jsxs("div",{children:[f.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),f.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md",children:n.summary})]}),n.details&&f.jsxs("div",{children:[f.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md whitespace-pre-wrap",children:n.details})]}),f.jsx("div",{className:"flex justify-end pt-4",children:f.jsx(ir,{onClick:t,children:"Close"})})]})}):null,ZH=({isOpen:e,onClose:t,onConfirm:n,title:a="Confirm Deletion",message:o="Are you sure you want to delete this item? This action cannot be undone.",confirmButtonText:u="Delete",cancelButtonText:l="Cancel"})=>f.jsx(uj,{isOpen:e,onClose:t,title:a,size:"md",children:f.jsxs("div",{className:"space-y-6",children:[f.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ir,{variant:"outline",onClick:t,children:l}),f.jsx(ir,{variant:"destructive",onClick:()=>{n(),t()},children:u})]})]})}),IH=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),o=j.useCallback(h=>(t(!0),a(null),_e.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),u=j.useCallback((h,m)=>(t(!0),a(null),_e.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),l=j.useCallback((h,m)=>(t(!0),a(null),_e.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),d=j.useCallback(h=>(t(!0),a(null),_e.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:o,post:u,put:l,del:d,loading:e,error:n}},HH=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(!0),[o,u]=j.useState([]),[l,d]=j.useState(""),[h,m]=j.useState("all"),[g,x]=j.useState("all"),[b,v]=j.useState(null),[z,T]=j.useState(!1),[E,N]=j.useState(null),[A,C]=j.useState(!1),[$,L]=j.useState(null),[M,q]=j.useState(!1),{get:V,del:X,post:ce}=IH();j.useEffect(()=>{Q()},[]);const Q=async()=>{try{a(!0);const S=await V("/sati/memories");t(S),v(null)}catch(S){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",S)}finally{a(!1)}},se=()=>{o.length===B.length?u([]):u(B.map(S=>S.id))},te=S=>{o.includes(S)?u(o.filter(H=>H!==S)):u([...o,S])},oe=async()=>{if(o.length!==0)try{await ce("/sati/memories/bulk-delete",{ids:o}),await Q(),u([]),T(!1)}catch(S){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",S)}},ae=S=>{L(S),q(!0)},U=async()=>{if($)try{await X(`/sati/memories/${$}`),await Q()}catch(S){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",S)}finally{L(null),q(!1)}},K=S=>{N(S),C(!0)},B=e.filter(S=>{const H=S.summary.toLowerCase().includes(l.toLowerCase())||S.details?.toLowerCase().includes(l.toLowerCase())||S.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||S.category===h,G=g==="all"||S.importance===g;return H&&w&&G&&!S.archived}),he=Array.from(new Set(e.map(S=>S.category))),O=Array.from(new Set(e.map(S=>S.importance)));return n?f.jsx(Rm,{className:"w-full",children:f.jsx(Mm,{className:"flex justify-center items-center h-64",children:f.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Sati Memories"}),f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1",children:"View and manage your long-term memories stored by Sati"})]}),o.length>0&&f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[o.length," selected"]}),f.jsxs(ir,{variant:"destructive",size:"sm",onClick:()=>T(!0),disabled:o.length===0,children:[f.jsx(Vo,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&f.jsx(UH,{variant:"destructive",children:f.jsx(VH,{children:b})}),f.jsxs(Rm,{children:[f.jsx(Ow,{className:"border-b border-azure-border dark:border-matrix-primary",children:f.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[f.jsxs("div",{className:"flex flex-col relative w-full",children:[f.jsx(pA,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),f.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:S=>d(S.target.value),className:"w-full pl-10 pr-4 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight"})]}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[f.jsxs("select",{value:h,onChange:S=>m(S.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[f.jsx("option",{value:"all",children:"All Categories"}),he.map(S=>f.jsx("option",{value:S,children:S},S))]}),f.jsxs("select",{value:g,onChange:S=>x(S.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[f.jsx("option",{value:"all",children:"All Importance"}),O.map(S=>f.jsx("option",{value:S,children:S},S))]})]})]})}),f.jsx(Mm,{className:"p-0",children:f.jsxs(DH,{children:[f.jsx($H,{children:f.jsxs(Om,{className:"hover:bg-transparent",children:[f.jsx(wo,{className:"w-12",children:f.jsx(Aw,{checked:B.length>0&&o.length===B.length,onCheckedChange:se})}),f.jsx(wo,{children:"Summary"}),f.jsx(wo,{children:"Category"}),f.jsx(wo,{children:"Importance"}),f.jsx(wo,{children:"Created"}),f.jsx(wo,{className:"w-32",children:"Actions"})]})}),f.jsx(LH,{children:B.length===0?f.jsx(Om,{children:f.jsx(bi,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):B.map(S=>f.jsxs(Om,{children:[f.jsx(bi,{children:f.jsx(Aw,{checked:o.includes(S.id),onCheckedChange:()=>te(S.id)})}),f.jsx(bi,{className:"font-medium max-w-xs truncate",children:S.summary}),f.jsx(bi,{children:f.jsx(ed,{variant:"outline",children:S.category})}),f.jsx(bi,{children:f.jsx(ed,{variant:S.importance==="critical"?"destructive":S.importance==="high"?"default":S.importance==="medium"?"secondary":"outline",children:S.importance})}),f.jsx(bi,{children:f.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx(uS,{className:"w-4 h-4"}),new Date(S.created_at).toLocaleDateString()]})}),f.jsx(bi,{children:f.jsxs("div",{className:"flex gap-1",children:[f.jsx(ir,{variant:"ghost",size:"sm",onClick:()=>K(S),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:f.jsx(id,{className:"w-4 h-4"})}),f.jsx(ir,{variant:"ghost",size:"sm",onClick:()=>ae(S.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:f.jsx(Vo,{className:"w-4 h-4"})})]})})]},S.id))})]})})]}),z&&f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:f.jsxs(Rm,{className:"w-full max-w-md mx-4",children:[f.jsx(Ow,{children:f.jsx(PH,{children:"Delete Memories"})}),f.jsxs(Mm,{children:[f.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",o.length," ","memory(ies)? This action cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ir,{variant:"outline",onClick:()=>T(!1),children:"Cancel"}),f.jsx(ir,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),f.jsx(BH,{isOpen:A,onClose:()=>C(!1),memory:E}),f.jsx(ZH,{isOpen:M,onClose:()=>q(!1),onConfirm:U,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},vi=zi.getInstance(),ki={fetchServers:async()=>vi.get("/mcp/servers"),addServer:async(e,t)=>vi.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>vi.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>vi.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>vi.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>vi.post("/mcp/reload",{}),fetchStatus:async()=>vi.get("/mcp/status")},FH=({label:e,values:t,onChange:n,placeholder:a})=>{const o=t.length>0?t:[""],u=(h,m)=>{const g=[...o];g[h]=m,n(g.filter(x=>x.trim().length>0))},l=()=>n([...o,""]),d=h=>{const m=o.filter((g,x)=>x!==h);n(m.filter(g=>g.trim().length>0))};return f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),o.map((h,m)=>f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{className:"flex-1 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:h,placeholder:a,onChange:g=>u(m,g.target.value)}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>d(m),children:"Remove"})]},`${e}-${m}`)),f.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:l,children:"Add argument"})]})},Rw=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:o})=>{const u=j.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,x)=>{const b=[...u];b[m]={...b[m],[g]:x},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},d=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((x,b)=>b!==m);n(g.filter(x=>x.key.trim().length>0||x.value.trim().length>0))};return f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),u.map((m,g)=>f.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[f.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.key,placeholder:a,onChange:x=>l(g,"key",x.target.value)}),f.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.value,placeholder:o,onChange:x=>l(g,"value",x.target.value)}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>h(g),children:"Remove"})]},`${e}-${g}`)),f.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:d,children:"Add entry"})]})},qH=({transport:e,command:t,url:n,args:a,env:o,headers:u,onCommandChange:l,onUrlChange:d,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>f.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:t,onChange:x=>l(x.target.value),placeholder:"npx"})]}),f.jsx(FH,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:n,onChange:x=>d(x.target.value),placeholder:"https://example.com/mcp"})]}),f.jsx(Rw,{label:"Environment Variables",values:o,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&f.jsx(Rw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),GH=aH({name:Am().min(1,"Name is required"),transport:oj([Tw("stdio"),Tw("http")]),command:Am().optional(),url:Am().optional()}),Sc=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Dm=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),YH=({open:e,mode:t,initial:n,onClose:a,onSubmit:o})=>{const[u,l]=j.useState(n?.name??""),[d,h]=j.useState(n?.config.transport??"stdio"),[m,g]=j.useState(n?.config.transport==="stdio"?n.config.command:""),[x,b]=j.useState(n?.config.transport==="http"?n.config.url:""),[v,z]=j.useState(n?.config.args??[]),[T,E]=j.useState(Sc(n?.config.env)),[N,A]=j.useState(n?.config.transport==="http"?Sc(n.config.headers):[]),[C,$]=j.useState(null);j.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),b(n?.config.transport==="http"?n.config.url:""),z(n?.config.args??[]),E(Sc(n?.config.env)),A(n?.config.transport==="http"?Sc(n.config.headers):[]),$(null))},[e,n]);const L=t==="create",M=async()=>{const V=GH.safeParse({name:u,transport:d,command:m,url:x});if(!V.success){$(V.error.issues[0]?.message??"Invalid form");return}if(d==="stdio"&&(!m||m.trim().length===0)){$("Command is required for stdio transport.");return}if(d==="http"&&(!x||x.trim().length===0)){$("URL is required for http transport.");return}const X=d==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:T.length>0?Dm(T):void 0}:{transport:"http",url:x.trim(),headers:N.length>0?Dm(N):void 0,env:T.length>0?Dm(T):void 0};$(null),await o(u.trim(),X)},q=j.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return f.jsx(Nr,{open:e,onOpenChange:a,children:f.jsxs(Zo,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:q})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none disabled:bg-azure-border dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary dark:disabled:bg-matrix-primary/50",value:u,onChange:V=>l(V.target.value),placeholder:"coolify",disabled:!L})]}),f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",f.jsxs("select",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:d,onChange:V=>h(V.target.value),children:[f.jsx("option",{value:"stdio",children:"stdio"}),f.jsx("option",{value:"http",children:"http"})]})]}),f.jsx(qH,{transport:d,command:m,url:x,args:v,env:T,headers:N,onCommandChange:g,onUrlChange:b,onArgsChange:z,onEnvChange:E,onHeadersChange:A}),C&&f.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/50 dark:text-red-400",children:C}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:a,children:"Cancel"}),f.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:M,children:"Save"})]})]})]})})},XH=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:o})=>f.jsxs("div",{className:"rounded-2xl border border-azure-border bg-azure-surface/80 p-4 shadow-sm overflow-hidden dark:border-matrix-primary dark:bg-zinc-950/70",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-lg font-semibold text-azure-text-primary break-words dark:text-matrix-highlight",children:e.name}),f.jsx("div",{className:"text-xs uppercase tracking-wide text-azure-text-muted dark:text-matrix-secondary",children:e.config.transport})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx("span",{title:t.ok?`${t.toolCount} tools`:t.error,className:`rounded-full px-2 py-0.5 text-xs font-semibold ${t.ok?"bg-green-500/20 text-green-600 dark:bg-green-400/20 dark:text-green-400":"bg-red-500/20 text-red-600 dark:bg-red-400/20 dark:text-red-400"}`,children:t.ok?`✓ ${t.toolCount} tools`:"✗ Failed"}),f.jsx("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-semibold ${e.enabled?"bg-matrix-highlight dark:text-matrix-primary":"bg-azure-border text-azure-text-secondary dark:bg-matrix-primary/50 dark:text-matrix-secondary"}`,onClick:()=>o(e,!e.enabled),children:e.enabled?"Enabled":"Disabled"})]})]}),f.jsxs("div",{className:"mt-4 space-y-2 text-sm text-azure-text-secondary dark:text-matrix-secondary",children:[e.config.transport==="stdio"&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Command:"})," ",e.config.command]}),e.config.transport==="http"&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"URL:"})," ",e.config.url]}),e.config.args&&e.config.args.length>0&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Args:"})," ",e.config.args.join(" ")]}),t&&!t.ok&&t.error&&f.jsx("div",{className:"mt-1 break-all rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/30 dark:text-red-400",children:t.error.length>120?t.error.slice(0,120)+"…":t.error})]}),f.jsxs("div",{className:"mt-4 flex gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-3 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>n(e),children:"Edit"}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>a(e),children:"Delete"})]})]}),KH=()=>{const{data:e,error:t,mutate:n,isLoading:a}=Qt("/api/mcp/servers",()=>ki.fetchServers()),[o,u]=j.useState(""),[l,d]=j.useState("all"),[h,m]=j.useState(!1),[g,x]=j.useState(null),[b,v]=j.useState(!1),[z,T]=j.useState(null),[E,N]=j.useState(null),[A,C]=j.useState({}),[$,L]=j.useState(!1),[M,q]=j.useState(!1),V=e?.servers??[],X=j.useMemo(()=>V.filter(B=>{const he=B.name.toLowerCase().includes(o.toLowerCase()),O=l==="all"||B.config.transport===l;return he&&O}),[V,o,l]),ce=()=>{x(null),m(!0)},Q=B=>{x(B),m(!0)},se=async(B,he)=>{try{g?await ki.updateServer(g.name,he):await ki.addServer(B,he),m(!1),x(null),await n(),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(O){N({type:"error",message:O.message||"Failed to save MCP server."})}},te=async B=>{T(B),v(!0)},oe=async()=>{if(z)try{await ki.deleteServer(z.name),await n(),v(!1),T(null),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(B){N({type:"error",message:B.message||"Failed to delete MCP server."})}},ae=async()=>{L(!0);try{const B=await ki.fetchStatus(),he={};for(const O of B.servers)he[O.name]=O;C(he)}catch(B){N({type:"error",message:B.message||"Failed to check MCP status."})}finally{L(!1)}},U=async()=>{q(!0);try{await ki.reloadTools(),N({type:"success",message:"MCP tools reloaded successfully."})}catch(B){N({type:"error",message:B.message||"Failed to reload MCP tools."})}finally{q(!1)}},K=async(B,he)=>{try{await ki.toggleServer(B.name,he),await n(),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(O){N({type:"error",message:O.message||"Failed to toggle MCP server."})}};return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Manage MCP servers stored in mcps.json."})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{type:"button",disabled:$,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:ae,children:$?"Checking…":"Check Status"}),f.jsx("button",{type:"button",disabled:M,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:U,children:M?"Reloading…":"Reload MCPs"}),f.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:ce,children:"Add Server"})]})]}),E&&f.jsx("div",{className:`p-4 rounded border ${E.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:E.message}),f.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:o,onChange:B=>u(B.target.value),placeholder:"Search by name"}),f.jsxs("select",{className:"rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:l,onChange:B=>d(B.target.value),children:[f.jsx("option",{value:"all",children:"All"}),f.jsx("option",{value:"stdio",children:"stdio"}),f.jsx("option",{value:"http",children:"http"})]})]}),a&&f.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&f.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&X.length===0&&f.jsx("div",{className:"rounded-2xl border border-dashed border-azure-border bg-azure-surface/60 p-6 text-center text-sm text-azure-text-secondary dark:border-matrix-primary dark:bg-zinc-950/60 dark:text-matrix-secondary",children:"No MCP servers found. Add a server to get started."}),f.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:X.map(B=>f.jsx(XH,{server:B,probeResult:A[B.name],onEdit:Q,onDelete:te,onToggle:K},`${B.name}-${B.enabled?"on":"off"}`))}),f.jsx(YH,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:se}),f.jsx(Nr,{open:b,onOpenChange:v,children:f.jsxs(Zo,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:"Confirm Deletion"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",f.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',z?.name,'"']}),"? This action cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>v(!1),children:"Cancel"}),f.jsx("button",{type:"button",className:"rounded-md bg-red-500 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-red-400 dark:bg-red-600 hover:dark:bg-red-500",onClick:oe,children:"Delete"})]})]})]})})]})},$m={list:()=>_e.get("/model-pricing"),upsert:e=>_e.post("/model-pricing",e),update:(e,t,n)=>_e.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>_e.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},JH={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Mw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},QH=["anthropic","openai","google","openrouter","ollama","other"],Dw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),WH=()=>{const{data:e=[],mutate:t}=Qt("/api/model-pricing",()=>$m.list()),[n,a]=j.useState(!1),[o,u]=j.useState(null),[l,d]=j.useState(Dw()),[h,m]=j.useState(null),[g,x]=j.useState(null),[b,v]=j.useState(!1),z=(C,$)=>{x({type:C,message:$}),setTimeout(()=>x(null),3e3)},T=()=>{u(null),d(Dw()),a(!0)},E=C=>{u(C),d({...C}),a(!0)},N=async()=>{if(!(!l.provider.trim()||!l.model.trim())){v(!0);try{await $m.upsert(l),await t(),a(!1),z("success",o?"Pricing updated.":"Pricing created.")}catch{z("error","Failed to save pricing entry.")}finally{v(!1)}}},A=async()=>{if(h)try{await $m.delete(h.provider,h.model),await t(),m(null),z("success","Pricing entry deleted.")}catch{z("error","Failed to delete pricing entry.")}};return f.jsxs(ot.div,{variants:JH,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:Mw,className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx($c,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Model Pricing"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Manage per-model pricing to estimate LLM costs in Usage Stats."})]})]}),f.jsxs("button",{onClick:T,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(Qp,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&f.jsx(ot.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),f.jsx(ot.div,{variants:Mw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(C=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:C},C))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:'No pricing entries. Click "Add Pricing" to get started.'})}):e.map(C=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[f.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:C.provider}),f.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:C.model}),f.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.input_price_per_1m.toFixed(4)]}),f.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.output_price_per_1m.toFixed(4)]}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>E(C),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:f.jsx(Jp,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>m(C),className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",title:"Delete",children:f.jsx(Vo,{className:"w-4 h-4"})})]})})]},`${C.provider}/${C.model}`))})]})}),f.jsx(Nr,{open:n,onOpenChange:a,children:f.jsxs(Zo,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:o?"Edit Pricing":"Add Pricing"})}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),o?f.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm capitalize",children:l.provider}):f.jsxs("select",{value:l.provider,onChange:C=>d({...l,provider:C.target.value}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight",children:[f.jsx("option",{value:"",children:"Select provider..."}),QH.map(C=>f.jsx("option",{value:C,children:C},C))]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),o?f.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm font-mono",children:l.model}):f.jsx("input",{type:"text",value:l.model,onChange:C=>d({...l,model:C.target.value}),placeholder:"e.g. gpt-4o",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),f.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:C=>d({...l,input_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),f.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:C=>d({...l,output_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]})]}),f.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:N,disabled:b||!l.provider.trim()||!l.model.trim(),className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving...":"Save"})]})]})]})}),f.jsx(Nr,{open:!!h,onOpenChange:C=>!C&&m(null),children:f.jsxs(Zo,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:"Delete Pricing Entry"})}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",f.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:A,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},eF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},$w={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},tF=["ui","telegram"],Lw=()=>({name:"",prompt:"",notification_channels:["ui"]}),nF=()=>{const{data:e=[],mutate:t}=Qt("/webhooks",()=>La.list(),{refreshInterval:1e4}),[n,a]=j.useState(!1),[o,u]=j.useState(null),[l,d]=j.useState(Lw()),[h,m]=j.useState(null),[g,x]=j.useState(null),[b,v]=j.useState(!1),[z,T]=j.useState(null),[E,N]=j.useState(null),A=(te,oe)=>{x({type:te,message:oe}),setTimeout(()=>x(null),3500)},C=()=>{u(null),d(Lw()),N(null),a(!0)},$=te=>{u(te),d({name:te.name,prompt:te.prompt,notification_channels:te.notification_channels}),N(null),a(!0)},L=te=>/^[a-z0-9-_]+$/.test(te),M=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!L(l.name)){N("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){N("Select at least one notification channel.");return}N(null),v(!0);try{o?(await La.update(o.id,l),A("success","Webhook updated.")):(await La.create(l),A("success","Webhook created.")),await t(),a(!1)}catch(te){const oe=te?.message||"Failed to save webhook.";N(oe)}finally{v(!1)}}},q=async te=>{try{await La.update(te.id,{enabled:!te.enabled}),await t()}catch{A("error","Failed to toggle webhook.")}},V=async()=>{if(h)try{await La.delete(h.id),await t(),m(null),A("success","Webhook deleted.")}catch{A("error","Failed to delete webhook.")}},X=te=>`${window.location.origin}/api/webhooks/trigger/${te}`,ce=te=>`curl -X POST ${X(te.name)} \\
108
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(d.cycle){u(l);continue}if(d.count>1&&e.reused==="ref"){u(l);continue}}}function nj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const d=e.seen.get(l);if(d.ref===null)return;const h=d.def??d.schema,m={...h},g=d.ref;if(d.ref=null,g){a(g);const b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const T in h)T==="$ref"||T==="allOf"||T in m||delete h[T];if(v.$ref&&b.def)for(const T in h)T==="$ref"||T==="allOf"||T in b.def&&JSON.stringify(h[T])===JSON.stringify(b.def[T])&&delete h[T]}const x=l._zod.parent;if(x&&x!==g){a(x);const b=e.seen.get(x);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path:d.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Wc(t,"input",e.processors),output:Wc(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return yn(a.element,n);if(a.type==="set")return yn(a.valueType,n);if(a.type==="lazy")return yn(a.getter(),n);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,n);if(a.type==="intersection")return yn(a.left,n)||yn(a.right,n);if(a.type==="record"||a.type==="map")return yn(a.keyType,n)||yn(a.valueType,n);if(a.type==="pipe")return yn(a.in,n)||yn(a.out,n);if(a.type==="object"){for(const o in a.shape)if(yn(a.shape[o],n))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(yn(o,n))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(yn(o,n))return!0;return!!(a.rest&&yn(a.rest,n))}return!1}const XI=(e,t={})=>n=>{const a=ej({...n,processors:t});return on(e,a),tj(a,e),nj(a,e)},Wc=(e,t,n={})=>a=>{const{libraryOptions:o,target:u}=a??{},l=ej({...o??{},target:u,io:t,processors:n});return on(e,l),tj(l,e),nj(l,e)},KI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},JI=(e,t,n,a)=>{const o=n;o.type="string";const{minimum:u,maximum:l,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(o.minLength=u),typeof l=="number"&&(o.maxLength=l),d&&(o.format=KI[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),m&&(o.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},QI=(e,t,n,a)=>{n.not={}},WI=(e,t,n,a)=>{},e7=(e,t,n,a)=>{const o=e._zod.def,u=P2(o.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},t7=(e,t,n,a)=>{const o=e._zod.def,u=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},n7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},r7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},a7=(e,t,n,a)=>{const o=n,u=e._zod.def,{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=on(u.element,t,{...a,path:[...a.path,"items"]})},i7=(e,t,n,a)=>{const o=n,u=e._zod.def;o.type="object",o.properties={};const l=u.shape;for(const m in l)o.properties[m]=on(l[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(l)),h=new Set([...d].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(o.required=Array.from(h)),u.catchall?._zod.def.type==="never"?o.additionalProperties=!1:u.catchall?u.catchall&&(o.additionalProperties=on(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},o7=(e,t,n,a)=>{const o=e._zod.def,u=o.inclusive===!1,l=o.options.map((d,h)=>on(d,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},s7=(e,t,n,a)=>{const o=e._zod.def,u=on(o.left,t,{...a,path:[...a.path,"allOf",0]}),l=on(o.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(u)?u.allOf:[u],...d(l)?l.allOf:[l]];n.allOf=h},l7=(e,t,n,a)=>{const o=e._zod.def,u=on(o.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},u7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},c7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},d7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},f7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},h7=(e,t,n,a)=>{const o=e._zod.def,u=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;on(u,t,a);const l=t.seen.get(e);l.ref=u},m7=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType,n.readOnly=!0},rj=(e,t,n,a)=>{const o=e._zod.def;on(o.innerType,t,a);const u=t.seen.get(e);u.ref=o.innerType},p7=ie("ZodISODateTime",(e,t)=>{_Z.init(e,t),Tt.init(e,t)});function g7(e){return CI(p7,e)}const y7=ie("ZodISODate",(e,t)=>{jZ.init(e,t),Tt.init(e,t)});function x7(e){return EI(y7,e)}const b7=ie("ZodISOTime",(e,t)=>{TZ.init(e,t),Tt.init(e,t)});function v7(e){return NI(b7,e)}const k7=ie("ZodISODuration",(e,t)=>{CZ.init(e,t),Tt.init(e,t)});function w7(e){return AI(k7,e)}const aj=(e,t)=>{I2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>wB(e,n)},flatten:{value:n=>kB(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Pp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Pp,2)}},isEmpty:{get(){return e.issues.length===0}}})},S7=ie("ZodError",aj),ur=ie("ZodError",aj,{Parent:Error}),z7=iy(ur),_7=oy(ur),j7=xd(ur),T7=bd(ur),C7=_B(ur),E7=jB(ur),N7=TB(ur),A7=CB(ur),O7=EB(ur),R7=NB(ur),M7=AB(ur),D7=OB(ur),Zt=ie("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Wc(e,"input"),output:Wc(e,"output")}}),e.toJSONSchema=XI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ka(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Ja(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>z7(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>j7(e,n,a),e.parseAsync=async(n,a)=>_7(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>T7(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>C7(e,n,a),e.decode=(n,a)=>E7(e,n,a),e.encodeAsync=async(n,a)=>N7(e,n,a),e.decodeAsync=async(n,a)=>A7(e,n,a),e.safeEncode=(n,a)=>O7(e,n,a),e.safeDecode=(n,a)=>R7(e,n,a),e.safeEncodeAsync=async(n,a)=>M7(e,n,a),e.safeDecodeAsync=async(n,a)=>D7(e,n,a),e.refine=(n,a)=>e.check(CH(n,a)),e.superRefine=n=>e.check(EH(n)),e.overwrite=n=>e.check(as(n)),e.optional=()=>Cw(e),e.exactOptional=()=>pH(e),e.nullable=()=>Ew(e),e.nullish=()=>Cw(Ew(e)),e.nonoptional=n=>kH(e,n),e.array=()=>aH(e),e.or=n=>oj([e,n]),e.and=n=>uH(e,n),e.transform=n=>Nw(e,hH(n)),e.default=n=>xH(e,n),e.prefault=n=>vH(e,n),e.catch=n=>SH(e,n),e.pipe=n=>Nw(e,n),e.readonly=()=>jH(e),e.describe=n=>{const a=e.clone();return dl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return dl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return dl.get(e);const a=e.clone();return dl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ij=ie("_ZodString",(e,t)=>{sy.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(a,o,u)=>JI(e,a,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(MI(...a)),e.includes=(...a)=>e.check(LI(...a)),e.startsWith=(...a)=>e.check(PI(...a)),e.endsWith=(...a)=>e.check(UI(...a)),e.min=(...a)=>e.check(Qc(...a)),e.max=(...a)=>e.check(Q2(...a)),e.length=(...a)=>e.check(W2(...a)),e.nonempty=(...a)=>e.check(Qc(1,...a)),e.lowercase=a=>e.check(DI(a)),e.uppercase=a=>e.check($I(a)),e.trim=()=>e.check(BI()),e.normalize=(...a)=>e.check(VI(...a)),e.toLowerCase=()=>e.check(ZI()),e.toUpperCase=()=>e.check(II()),e.slugify=()=>e.check(HI())}),$7=ie("ZodString",(e,t)=>{sy.init(e,t),ij.init(e,t),e.email=n=>e.check(sI(L7,n)),e.url=n=>e.check(fI(P7,n)),e.jwt=n=>e.check(TI(W7,n)),e.emoji=n=>e.check(hI(U7,n)),e.guid=n=>e.check(zw(_w,n)),e.uuid=n=>e.check(lI(Sc,n)),e.uuidv4=n=>e.check(uI(Sc,n)),e.uuidv6=n=>e.check(cI(Sc,n)),e.uuidv7=n=>e.check(dI(Sc,n)),e.nanoid=n=>e.check(mI(V7,n)),e.guid=n=>e.check(zw(_w,n)),e.cuid=n=>e.check(pI(B7,n)),e.cuid2=n=>e.check(gI(Z7,n)),e.ulid=n=>e.check(yI(I7,n)),e.base64=n=>e.check(zI(K7,n)),e.base64url=n=>e.check(_I(J7,n)),e.xid=n=>e.check(xI(H7,n)),e.ksuid=n=>e.check(bI(F7,n)),e.ipv4=n=>e.check(vI(q7,n)),e.ipv6=n=>e.check(kI(G7,n)),e.cidrv4=n=>e.check(wI(Y7,n)),e.cidrv6=n=>e.check(SI(X7,n)),e.e164=n=>e.check(jI(Q7,n)),e.datetime=n=>e.check(g7(n)),e.date=n=>e.check(x7(n)),e.time=n=>e.check(v7(n)),e.duration=n=>e.check(w7(n))});function Am(e){return oI($7,e)}const Tt=ie("ZodStringFormat",(e,t)=>{vt.init(e,t),ij.init(e,t)}),L7=ie("ZodEmail",(e,t)=>{gZ.init(e,t),Tt.init(e,t)}),_w=ie("ZodGUID",(e,t)=>{mZ.init(e,t),Tt.init(e,t)}),Sc=ie("ZodUUID",(e,t)=>{pZ.init(e,t),Tt.init(e,t)}),P7=ie("ZodURL",(e,t)=>{yZ.init(e,t),Tt.init(e,t)}),U7=ie("ZodEmoji",(e,t)=>{xZ.init(e,t),Tt.init(e,t)}),V7=ie("ZodNanoID",(e,t)=>{bZ.init(e,t),Tt.init(e,t)}),B7=ie("ZodCUID",(e,t)=>{vZ.init(e,t),Tt.init(e,t)}),Z7=ie("ZodCUID2",(e,t)=>{kZ.init(e,t),Tt.init(e,t)}),I7=ie("ZodULID",(e,t)=>{wZ.init(e,t),Tt.init(e,t)}),H7=ie("ZodXID",(e,t)=>{SZ.init(e,t),Tt.init(e,t)}),F7=ie("ZodKSUID",(e,t)=>{zZ.init(e,t),Tt.init(e,t)}),q7=ie("ZodIPv4",(e,t)=>{EZ.init(e,t),Tt.init(e,t)}),G7=ie("ZodIPv6",(e,t)=>{NZ.init(e,t),Tt.init(e,t)}),Y7=ie("ZodCIDRv4",(e,t)=>{AZ.init(e,t),Tt.init(e,t)}),X7=ie("ZodCIDRv6",(e,t)=>{OZ.init(e,t),Tt.init(e,t)}),K7=ie("ZodBase64",(e,t)=>{RZ.init(e,t),Tt.init(e,t)}),J7=ie("ZodBase64URL",(e,t)=>{DZ.init(e,t),Tt.init(e,t)}),Q7=ie("ZodE164",(e,t)=>{$Z.init(e,t),Tt.init(e,t)}),W7=ie("ZodJWT",(e,t)=>{PZ.init(e,t),Tt.init(e,t)}),eH=ie("ZodUnknown",(e,t)=>{UZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>WI()});function jw(){return OI(eH)}const tH=ie("ZodNever",(e,t)=>{VZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>QI(e,n,a)});function nH(e){return RI(tH,e)}const rH=ie("ZodArray",(e,t)=>{BZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>a7(e,n,a,o),e.element=t.element,e.min=(n,a)=>e.check(Qc(n,a)),e.nonempty=n=>e.check(Qc(1,n)),e.max=(n,a)=>e.check(Q2(n,a)),e.length=(n,a)=>e.check(W2(n,a)),e.unwrap=()=>e.element});function aH(e,t){return FI(rH,e,t)}const iH=ie("ZodObject",(e,t)=>{IZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>i7(e,n,a,o),Je(e,"shape",()=>t.shape),e.keyof=()=>cH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jw()}),e.loose=()=>e.clone({...e._zod.def,catchall:jw()}),e.strict=()=>e.clone({...e._zod.def,catchall:nH()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>gB(e,n),e.safeExtend=n=>yB(e,n),e.merge=n=>xB(e,n),e.pick=n=>mB(e,n),e.omit=n=>pB(e,n),e.partial=(...n)=>bB(sj,e,n[0]),e.required=(...n)=>vB(lj,e,n[0])});function oH(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new iH(n)}const sH=ie("ZodUnion",(e,t)=>{HZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>o7(e,n,a,o),e.options=t.options});function oj(e,t){return new sH({type:"union",options:e,...Ce(t)})}const lH=ie("ZodIntersection",(e,t)=>{FZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>s7(e,n,a,o)});function uH(e,t){return new lH({type:"intersection",left:e,right:t})}const Vp=ie("ZodEnum",(e,t)=>{qZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(a,o,u)=>e7(e,a,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,o)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Vp({...t,checks:[],...Ce(o),entries:u})},e.exclude=(a,o)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Vp({...t,checks:[],...Ce(o),entries:u})}});function cH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Vp({type:"enum",entries:n,...Ce(t)})}const dH=ie("ZodLiteral",(e,t)=>{GZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>t7(e,n,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 Tw(e,t){return new dH({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const fH=ie("ZodTransform",(e,t)=>{YZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>r7(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new $2(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Rl(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Rl(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(u=>(n.value=u,n)):(n.value=o,n)}});function hH(e){return new fH({type:"transform",transform:e})}const sj=ie("ZodOptional",(e,t)=>{J2.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>rj(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function Cw(e){return new sj({type:"optional",innerType:e})}const mH=ie("ZodExactOptional",(e,t)=>{XZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>rj(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function pH(e){return new mH({type:"optional",innerType:e})}const gH=ie("ZodNullable",(e,t)=>{KZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>l7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function Ew(e){return new gH({type:"nullable",innerType:e})}const yH=ie("ZodDefault",(e,t)=>{JZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>c7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xH(e,t){return new yH({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V2(t)}})}const bH=ie("ZodPrefault",(e,t)=>{QZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>d7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function vH(e,t){return new bH({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V2(t)}})}const lj=ie("ZodNonOptional",(e,t)=>{WZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>u7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function kH(e,t){return new lj({type:"nonoptional",innerType:e,...Ce(t)})}const wH=ie("ZodCatch",(e,t)=>{eI.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>f7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function SH(e,t){return new wH({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const zH=ie("ZodPipe",(e,t)=>{tI.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>h7(e,n,a,o),e.in=t.in,e.out=t.out});function Nw(e,t){return new zH({type:"pipe",in:e,out:t})}const _H=ie("ZodReadonly",(e,t)=>{nI.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>m7(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function jH(e){return new _H({type:"readonly",innerType:e})}const TH=ie("ZodCustom",(e,t)=>{rI.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,a,o)=>n7(e,n)});function CH(e,t={}){return qI(TH,e,t)}function EH(e){return GI(e)}const NH=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"ui",label:"Interface"},{id:"logging",label:"Logging"}],AH=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],sl=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function OH(){const{data:e,error:t}=Qt("/api/config",Sr.fetchConfig),{data:n}=Qt("/api/config/sati",Sr.getSatiConfig),{data:a}=Qt("/api/config/apoc",Sr.getApocConfig),{data:o}=Qt("/api/config/neo",Sr.getNeoConfig),{data:u}=Qt("/api/config/trinity",Sr.getTrinityConfig),[l,d]=j.useState(null),[h,m]=j.useState(null),[g,x]=j.useState(null),[b,v]=j.useState(null),[z,T]=j.useState(null),[E,N]=j.useState("general"),[A,C]=j.useState("oracle"),[$,L]=j.useState(!1),[M,q]=j.useState({}),[V,X]=j.useState(null);j.useEffect(()=>{e&&!l&&d(e)},[e]),j.useEffect(()=>{n&&!h&&m(n)},[n]),j.useEffect(()=>{a&&!b?v(a):!a&&!b&&l&&v({...l.apoc??l.llm,temperature:l.apoc?.temperature??.2,timeout_ms:l.apoc?.timeout_ms??3e4})},[a,l]),j.useEffect(()=>{o&&!g?x(o):!o&&!g&&l&&x({...l.neo??l.llm,temperature:l.neo?.temperature??.2})},[o,l]),j.useEffect(()=>{u&&!z?T(u):!u&&!z&&l&&T({...l.trinity??l.llm,temperature:l.trinity?.temperature??.2})},[u,l]);const ce=JSON.stringify(e)!==JSON.stringify(l)||JSON.stringify(n)!==JSON.stringify(h)||JSON.stringify(o)!==JSON.stringify(g)||JSON.stringify(a)!==JSON.stringify(b)||JSON.stringify(u)!==JSON.stringify(z),Q=(S,H)=>{if(!l)return;const w=JSON.parse(JSON.stringify(l));let G=w;for(let de=0;de<S.length-1;de++)G=G[S[de]];G[S[S.length-1]]=H,d(w);try{lB.parse(w),q({})}catch(de){if(de instanceof S7){const fe={};de.errors.forEach(me=>{const De=me.path.join(".");fe[De]=me.message}),q(fe)}}},se=(S,H)=>{h&&m({...h,[S]:H})},te=(S,H)=>{b&&v({...b,[S]:H})},oe=(S,H)=>{g&&x({...g,[S]:H})},ae=(S,H)=>{z&&T({...z,[S]:H})},U=()=>{!l||!z||T({...z,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},K=()=>{!l||!h||m({...h,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},B=()=>{!l||!b||v({...b,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},he=()=>{!l||!g||x({...g,provider:l.llm.provider,model:l.llm.model,api_key:l.llm.api_key})},O=async()=>{if(l){L(!0),X(null);try{await Sr.updateConfig(l),h&&await Sr.updateSatiConfig(h),g&&await Sr.updateNeoConfig(g),b&&await Sr.updateApocConfig(b),z&&await Sr.updateTrinityConfig(z),na("/api/config"),na("/api/config/sati"),na("/api/config/neo"),na("/api/config/apoc"),na("/api/config/trinity"),X({type:"success",message:"Settings saved successfully. Restart Morpheus daemon for changes to take effect."})}catch(S){if(X({type:"error",message:S.message}),S.details&&Array.isArray(S.details)){const H={};S.details.forEach(w=>{const G=w.path.join(".");H[G]=w.message}),q(H)}}finally{L(!1)}}};return t?f.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):l?f.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Zaion Settings"}),f.jsx("button",{onClick:O,disabled:!ce||Object.keys(M).length>0||$,className:`px-4 py-2 rounded font-medium transition-colors ${ce&&Object.keys(M).length===0?"bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90":"bg-azure-border text-azure-text-secondary cursor-not-allowed dark:bg-matrix-primary/50 dark:text-matrix-highlight/50"}`,children:$?"Saving...":"Save Changes"})]}),V&&f.jsx("div",{className:`p-4 rounded border ${V.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:V.message}),f.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:f.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:NH.map(S=>f.jsx("button",{onClick:()=>N(S.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${E===S.id?"bg-azure-surface/50 text-azure-primary border-t border-x border-azure-border dark:bg-matrix-primary/20 dark:text-matrix-highlight dark:border-t dark:border-x dark:border-matrix-primary":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:S.label},S.id))})}),f.jsxs("div",{className:"space-y-6",children:[E==="general"&&f.jsxs(wr,{title:"Agent Identity",children:[f.jsx(yt,{label:"Agent Name",value:l.agent.name,onChange:S=>Q(["agent","name"],S.target.value),error:M["agent.name"]}),f.jsx(yt,{label:"Personality",value:l.agent.personality,onChange:S=>Q(["agent","personality"],S.target.value),error:M["agent.personality"]})]}),E==="agents"&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:AH.map(S=>f.jsx("button",{onClick:()=>C(S.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${A===S.id?"bg-azure-primary/10 text-azure-primary border-b-2 border-azure-primary dark:bg-matrix-highlight/10 dark:text-matrix-highlight dark:border-matrix-highlight":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:S.label},S.id))}),A==="oracle"&&f.jsxs(wr,{title:"Oracle Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Main orchestration agent — handles user requests and delegates to subagents"}),f.jsx(xi,{label:"Provider",value:l.llm.provider,onChange:S=>Q(["llm","provider"],S.target.value),options:sl,error:M["llm.provider"]}),f.jsx(yt,{label:"Model Name",value:l.llm.model,onChange:S=>Q(["llm","model"],S.target.value),error:M["llm.model"]}),f.jsx(Bn,{label:"Temperature",value:l.llm.temperature,onChange:S=>Q(["llm","temperature"],parseFloat(S.target.value)),step:.1,min:0,max:1,error:M["llm.temperature"]}),f.jsx(Bn,{label:"Max Tokens",value:l.llm.max_tokens??"",onChange:S=>Q(["llm","max_tokens"],S.target.value?parseInt(S.target.value):void 0),min:1,error:M["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(Bn,{label:"Context Window (Messages)",value:l.llm.context_window??100,onChange:S=>Q(["llm","context_window"],parseInt(S.target.value)),min:1,step:1,error:M["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100)."}),f.jsx(yt,{label:"API Key",type:"password",value:l.llm.api_key||"",onChange:S=>Q(["llm","api_key"],S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),l.llm.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:l.llm.base_url||"https://openrouter.ai/api/v1",onChange:S=>Q(["llm","base_url"],S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),A==="sati"&&f.jsxs(wr,{title:"Sati Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Background memory consolidation agent — evaluates conversations and persists important context"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:K,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),h&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:h.provider,onChange:S=>se("provider",S.target.value),options:sl}),f.jsx(yt,{label:"Model Name",value:h.model,onChange:S=>se("model",S.target.value)}),f.jsx(yt,{label:"API Key",type:"password",value:h.api_key||"",onChange:S=>se("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),h.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:h.base_url||"https://openrouter.ai/api/v1",onChange:S=>se("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),f.jsx(Bn,{label:"Memory Limit",value:h.memory_limit??10,onChange:S=>se("memory_limit",parseInt(S.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),f.jsx(ol,{label:"Enable Archived Sessions in Memory Retrieval",checked:h.enabled_archived_sessions??!0,onChange:S=>se("enabled_archived_sessions",S)})]})]}),A==="neo"&&f.jsxs(wr,{title:"Neo Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"MCP + internal tools subagent — executes analytical and operational tasks delegated by Oracle"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:he,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),g&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:g.provider,onChange:S=>oe("provider",S.target.value),options:sl}),f.jsx(yt,{label:"Model Name",value:g.model,onChange:S=>oe("model",S.target.value)}),f.jsx(Bn,{label:"Temperature",value:g.temperature,onChange:S=>oe("temperature",parseFloat(S.target.value)),step:.1,min:0,max:1}),f.jsx(Bn,{label:"Max Tokens",value:g.max_tokens??"",onChange:S=>oe("max_tokens",S.target.value?parseInt(S.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(Bn,{label:"Context Window (Messages)",value:g.context_window??100,onChange:S=>oe("context_window",parseInt(S.target.value)),min:1,step:1}),f.jsx(yt,{label:"API Key",type:"password",value:g.api_key||"",onChange:S=>oe("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),g.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:g.base_url||"https://openrouter.ai/api/v1",onChange:S=>oe("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),A==="trinity"&&f.jsxs(wr,{title:"Trinity Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Database subagent — interprets natural language queries and executes them against registered databases (PostgreSQL, MySQL, SQLite, MongoDB)"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:U,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),z&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:z.provider,onChange:S=>ae("provider",S.target.value),options:sl}),f.jsx(yt,{label:"Model Name",value:z.model,onChange:S=>ae("model",S.target.value)}),f.jsx(Bn,{label:"Temperature",value:z.temperature,onChange:S=>ae("temperature",parseFloat(S.target.value)),step:.1,min:0,max:1}),f.jsx(Bn,{label:"Max Tokens",value:z.max_tokens??"",onChange:S=>ae("max_tokens",S.target.value?parseInt(S.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(yt,{label:"API Key",type:"password",value:z.api_key||"",onChange:S=>ae("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),z.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:z.base_url||"https://openrouter.ai/api/v1",onChange:S=>ae("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),A==="apoc"&&f.jsxs(wr,{title:"Apoc Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"DevTools subagent — executes file, shell, git, network, and system operations on behalf of Oracle"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:B,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),b&&f.jsxs(f.Fragment,{children:[f.jsx(xi,{label:"Provider",value:b.provider,onChange:S=>te("provider",S.target.value),options:sl}),f.jsx(yt,{label:"Model Name",value:b.model,onChange:S=>te("model",S.target.value)}),f.jsx(Bn,{label:"Temperature",value:b.temperature,onChange:S=>te("temperature",parseFloat(S.target.value)),step:.1,min:0,max:1}),f.jsx(yt,{label:"API Key",type:"password",value:b.api_key||"",onChange:S=>te("api_key",S.target.value),placeholder:"sk-...",helperText:"Stored locally."}),b.provider==="openrouter"&&f.jsx(yt,{label:"Base URL",value:b.base_url||"https://openrouter.ai/api/v1",onChange:S=>te("base_url",S.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),f.jsx(yt,{label:"Working Directory",value:b.working_dir||"",onChange:S=>te("working_dir",S.target.value),placeholder:"/home/user/projects",helperText:"Root directory for file and shell operations. Leave empty to use process working directory."}),f.jsx(Bn,{label:"Timeout (ms)",value:b.timeout_ms??3e4,onChange:S=>te("timeout_ms",parseInt(S.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),E==="audio"&&f.jsxs(wr,{title:"Audio Transcription",children:[f.jsx(ol,{label:"Enable Audio",checked:l.audio.enabled,onChange:S=>Q(["audio","enabled"],S)}),f.jsx(xi,{label:"Provider",value:l.audio.provider||"google",onChange:S=>Q(["audio","provider"],S.target.value),options:[{label:"Google Gemini",value:"google"},{label:"OpenAI (Whisper)",value:"openai"},{label:"OpenRouter (multimodal)",value:"openrouter"},{label:"Ollama (Whisper local)",value:"ollama"}],error:M["audio.provider"]}),f.jsx(yt,{label:"Model",value:l.audio.model,onChange:S=>Q(["audio","model"],S.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:M["audio.model"]}),l.audio.provider==="ollama"&&f.jsx(yt,{label:"Base URL",value:l.audio.base_url||"",onChange:S=>Q(["audio","base_url"],S.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),f.jsx(yt,{label:"API Key",type:"password",value:l.audio.apiKey||"",onChange:S=>Q(["audio","apiKey"],S.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider."}),f.jsx(Bn,{label:"Max Duration (Seconds)",value:l.audio.maxDurationSeconds,onChange:S=>Q(["audio","maxDurationSeconds"],parseInt(S.target.value)),min:1}),f.jsx(yt,{label:"Supported Mime Types",value:l.audio.supportedMimeTypes.join(", "),onChange:S=>Q(["audio","supportedMimeTypes"],S.target.value.split(",").map(H=>H.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),E==="channels"&&f.jsxs(wr,{title:"Telegram",children:[f.jsx(ol,{label:"Enable Telegram",checked:l.channels.telegram.enabled,onChange:S=>Q(["channels","telegram","enabled"],S)}),l.channels.telegram.enabled&&f.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[f.jsx(yt,{label:"Bot Token",type:"password",value:l.channels.telegram.token||"",onChange:S=>Q(["channels","telegram","token"],S.target.value)}),f.jsx(yt,{label:"Allowed Users (comma separated)",value:l.channels.telegram.allowedUsers.join(", "),onChange:S=>Q(["channels","telegram","allowedUsers"],S.target.value.split(",").map(H=>H.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),E==="ui"&&f.jsxs(wr,{title:"Dashboard",children:[f.jsx(ol,{label:"Enable Web UI",checked:l.ui.enabled,onChange:S=>Q(["ui","enabled"],S)}),f.jsx(Bn,{label:"Port",value:l.ui.port,onChange:S=>Q(["ui","port"],parseInt(S.target.value)),disabled:!0,helperText:"Requires restart to change."})]}),E==="logging"&&f.jsxs(wr,{title:"Logging",children:[f.jsx(ol,{label:"Enable Logging",checked:l.logging.enabled,onChange:S=>Q(["logging","enabled"],S)}),f.jsx(xi,{label:"Log Level",value:l.logging.level,onChange:S=>Q(["logging","level"],S.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]})]})]}):f.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function RH(){const{data:e}=y4(),[t,n]=j.useState(null),{data:a,mutate:o}=x4(t);return j.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),f.jsxs(ot.div,{className:"h-full flex flex-col space-y-4 pt-16 md:pt-0",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.3},children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"SYSTEM LOGS"}),f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"View runtime logs."})]}),f.jsxs("div",{className:"flex-1 flex gap-4 overflow-hidden border border-azure-border dark:border-matrix-primary rounded bg-azure-surface dark:bg-zinc-950 p-4",children:[f.jsxs("div",{className:"w-64 flex flex-col gap-2 border-r border-azure-border dark:border-matrix-primary pr-4 overflow-y-auto shrink-0",children:[f.jsx("h3",{className:"font-bold text-azure-text-secondary dark:text-matrix-secondary mb-2 sticky top-0 bg-azure-surface dark:bg-zinc-950",children:"LOG FILES"}),e?.map(u=>f.jsxs("button",{onClick:()=>n(u.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===u.name?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-zinc-900 group-hover:text-azure-primary dark:group-hover:text-matrix-highlight"}`,children:[f.jsx(YN,{className:"w-4 h-4 shrink-0"}),f.jsxs("div",{className:"flex flex-col overflow-hidden",children:[f.jsx("span",{className:"truncate font-bold",children:u.name}),f.jsxs("span",{className:"text-xs opacity-70",children:[(u.size/1024).toFixed(1)," KB"]})]})]},u.name))]}),f.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary/50 rounded",children:[f.jsxs("div",{className:"flex justify-between items-center p-2 bg-azure-hover dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary/50",children:[f.jsx("span",{className:"text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm",children:t}),f.jsx("button",{onClick:()=>o(),className:"text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(hS,{className:"w-4 h-4"})})]}),f.jsx("div",{className:"flex-1 overflow-auto p-4 font-mono text-xs whitespace-pre-wrap text-azure-text-primary dark:text-white",children:a?a.lines.join(`
109
+ `):"Select a log file to view content..."})]})]})]})}function MH(){const[e,t]=j.useState(null),[n,a]=j.useState([]),[o,u]=j.useState(!0),[l,d]=j.useState("");if(j.useEffect(()=>{async function g(){try{const[x,b]=await Promise.all([Sp.fetchUsageStats(),Sp.fetchGroupedUsageStats()]);t(x),a(b)}catch(x){d("Failed to load usage statistics"),console.error(x)}finally{u(!1)}}g()},[]),o)return f.jsx("div",{className:"flex items-center justify-center h-64 text-azure-accent dark:text-matrix-highlight font-mono animate-pulse",children:"LOADING_DATA_STREAM..."});if(l)return f.jsxs("div",{className:"p-4 bg-red-900/20 border border-red-500/50 text-red-500 font-mono rounded",children:["ERROR_ACCESSING_DATABASE: ",l]});const h={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},m={hidden:{y:20,opacity:0},show:{y:0,opacity:1}};return f.jsxs(ot.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsx("div",{className:"flex items-center justify-between border-b border-azure-border dark:border-matrix-primary pb-4",children:f.jsxs("div",{children:[f.jsxs("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight font-mono flex items-center gap-2",children:[f.jsx(Vm,{className:"w-6 h-6"}),"USAGE_ANALYTICS"]}),f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1 font-mono text-sm",children:"Resource consumption tracking and metrics"})]})}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[f.jsxs(ot.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx(kl,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),f.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),f.jsxs(ot.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx(Ro,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),f.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),f.jsxs(ot.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx($c,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),f.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),f.jsxs(ot.div,{variants:m,className:"bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden backdrop-blur-sm",children:[f.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:f.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[f.jsx("thead",{className:"bg-azure-bg dark:bg-zinc-900/50 text-azure-text-secondary dark:text-matrix-secondary border-b border-azure-border dark:border-matrix-primary",children:f.jsxs("tr",{children:[f.jsx("th",{className:"p-4",children:"Provider"}),f.jsx("th",{className:"p-4",children:"Model"}),f.jsx("th",{className:"p-4 text-right",children:"Messages"}),f.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),f.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),f.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:8,className:"p-8 text-center text-azure-text-muted dark:text-matrix-secondary italic",children:"NO_DATA_AVAILABLE"})}):n.map((g,x)=>f.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[f.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),f.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),f.jsx("td",{className:"p-4 text-right font-bold text-green-600 dark:text-green-400",children:g.estimatedCostUsd!=null?`$${g.estimatedCostUsd.toFixed(4)}`:"—"})]},`${g.provider}-${g.model}-${x}`))})]})})]})]})}const DH=()=>{const[e,t]=j.useState(""),[n,a]=j.useState(""),o=qp(),u=yr(),l=d=>{d.preventDefault(),e&&(a(""),fetch("/api/config",{headers:{"x-architect-pass":e}}).then(async h=>{if(h.ok){localStorage.setItem("morpheus.auth.token",e);const m=u.state?.from?.pathname||"/";o(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return f.jsx("div",{className:"flex items-center justify-center min-h-screen bg-azure-bg dark:bg-black text-azure-primary dark:text-green-500 font-mono",children:f.jsxs("div",{className:"max-w-md w-full p-8 border border-azure-primary dark:border-green-500 shadow-xl dark:shadow-[0_0_15px_rgba(34,197,94,0.3)] bg-white dark:bg-black rounded-lg dark:rounded-none",children:[f.jsx("h1",{className:"text-2xl font-bold mb-6 text-center tracking-widest uppercase text-azure-primary dark:text-green-500",children:"> The Architect Login"}),f.jsxs("form",{onSubmit:l,className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),f.jsx("input",{type:"password",value:e,onChange:d=>t(d.target.value),className:"w-full bg-azure-bg dark:bg-black border border-azure-border dark:border-green-800 p-2 focus:outline-none focus:border-azure-primary dark:focus:border-green-500 text-azure-text-primary dark:text-green-500 placeholder-azure-text-secondary/50 dark:placeholder-green-900 rounded dark:rounded-none",placeholder:"••••••••",autoFocus:!0})]}),n&&f.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),f.jsx("button",{type:"submit",className:"w-full bg-azure-primary hover:bg-azure-active dark:bg-green-900 dark:hover:bg-green-700 text-white dark:text-black font-bold py-2 transition-colors duration-200 uppercase tracking-wider rounded dark:rounded-none",children:"Authenticate"})]}),f.jsx("div",{className:"mt-8 text-[10px] opacity-30 text-center uppercase text-azure-text-secondary dark:text-green-500",children:"Morpheus OS v0.1.5 | Unauthorized access is logged."})]})})},$H=({children:e})=>{const{isAuthenticated:t}=l_(),n=yr();return t?f.jsx(f.Fragment,{children:e}):f.jsx(tS,{to:"/login",state:{from:n},replace:!0})},LH=({className:e,...t})=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),PH=({...e})=>f.jsx("thead",{...e}),UH=({...e})=>f.jsx("tbody",{...e}),Om=({...e})=>f.jsx("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 transition-colors hover:bg-azure-hover/50 dark:hover:bg-matrix-primary/10",...e}),wo=({className:e,...t})=>f.jsx("th",{className:`h-12 px-4 text-left align-middle font-medium text-azure-text-secondary dark:text-matrix-secondary/70 [&:has([role=checkbox])]:pr-0 ${e}`,...t}),bi=({className:e,...t})=>f.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),Aw=({checked:e,onCheckedChange:t,className:n,...a})=>{const o=u=>{t&&t(u.target.checked),a.onChange&&a.onChange(u)};return f.jsx("input",{type:"checkbox",checked:e,onChange:o,className:`h-4 w-4 rounded border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-primary dark:text-matrix-highlight focus:ring-azure-primary dark:focus:ring-matrix-highlight ${n||""}`,...a})},ed=({className:e,variant:t="default",...n})=>{const o=`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:focus:ring-zinc-300 ${t==="destructive"?"border-transparent bg-red-500 text-zinc-50 dark:bg-red-900 dark:text-zinc-50":t==="secondary"?"border-transparent bg-azure-surface dark:bg-zinc-800 text-azure-text-secondary dark:text-matrix-secondary":t==="outline"?"text-azure-text-primary dark:text-matrix-secondary border-azure-border dark:border-matrix-primary":"border-transparent bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black"} ${e||""}`;return f.jsx("div",{className:o,...n})},Rm=({className:e,...t})=>f.jsx("div",{className:`rounded-lg border border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary shadow-sm ${e||""}`,...t}),Ow=({className:e,...t})=>f.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),VH=({className:e,...t})=>f.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),Mm=({className:e,...t})=>f.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),BH=({className:e,variant:t="default",...n})=>{const o=`relative w-full rounded-lg border p-4 ${t==="destructive"?"border-red-500/50 text-red-700 dark:border-red-900/50 dark:text-red-300":"border-azure-border dark:border-matrix-primary"} ${e||""}`;return f.jsx("div",{className:o,...n})},ZH=({className:e,...t})=>f.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),uj=({isOpen:e,onClose:t,title:n,children:a,size:o="md"})=>{if(!e)return null;const u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),f.jsxs("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full ${u[o]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&f.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&f.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),f.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},IH=({isOpen:e,onClose:t,memory:n})=>n?f.jsx(uj,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(zA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),f.jsx("div",{children:f.jsx(ed,{variant:"outline",children:n.category})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(OA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),f.jsx("div",{children:f.jsx(ed,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(uS,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ad,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(id,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(QN,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(eA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),f.jsxs("div",{children:[f.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),f.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md",children:n.summary})]}),n.details&&f.jsxs("div",{children:[f.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md whitespace-pre-wrap",children:n.details})]}),f.jsx("div",{className:"flex justify-end pt-4",children:f.jsx(ir,{onClick:t,children:"Close"})})]})}):null,HH=({isOpen:e,onClose:t,onConfirm:n,title:a="Confirm Deletion",message:o="Are you sure you want to delete this item? This action cannot be undone.",confirmButtonText:u="Delete",cancelButtonText:l="Cancel"})=>f.jsx(uj,{isOpen:e,onClose:t,title:a,size:"md",children:f.jsxs("div",{className:"space-y-6",children:[f.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ir,{variant:"outline",onClick:t,children:l}),f.jsx(ir,{variant:"destructive",onClick:()=>{n(),t()},children:u})]})]})}),FH=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),o=j.useCallback(h=>(t(!0),a(null),ze.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),u=j.useCallback((h,m)=>(t(!0),a(null),ze.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),l=j.useCallback((h,m)=>(t(!0),a(null),ze.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),d=j.useCallback(h=>(t(!0),a(null),ze.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:o,post:u,put:l,del:d,loading:e,error:n}},qH=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(!0),[o,u]=j.useState([]),[l,d]=j.useState(""),[h,m]=j.useState("all"),[g,x]=j.useState("all"),[b,v]=j.useState(null),[z,T]=j.useState(!1),[E,N]=j.useState(null),[A,C]=j.useState(!1),[$,L]=j.useState(null),[M,q]=j.useState(!1),{get:V,del:X,post:ce}=FH();j.useEffect(()=>{Q()},[]);const Q=async()=>{try{a(!0);const S=await V("/sati/memories");t(S),v(null)}catch(S){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",S)}finally{a(!1)}},se=()=>{o.length===B.length?u([]):u(B.map(S=>S.id))},te=S=>{o.includes(S)?u(o.filter(H=>H!==S)):u([...o,S])},oe=async()=>{if(o.length!==0)try{await ce("/sati/memories/bulk-delete",{ids:o}),await Q(),u([]),T(!1)}catch(S){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",S)}},ae=S=>{L(S),q(!0)},U=async()=>{if($)try{await X(`/sati/memories/${$}`),await Q()}catch(S){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",S)}finally{L(null),q(!1)}},K=S=>{N(S),C(!0)},B=e.filter(S=>{const H=S.summary.toLowerCase().includes(l.toLowerCase())||S.details?.toLowerCase().includes(l.toLowerCase())||S.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||S.category===h,G=g==="all"||S.importance===g;return H&&w&&G&&!S.archived}),he=Array.from(new Set(e.map(S=>S.category))),O=Array.from(new Set(e.map(S=>S.importance)));return n?f.jsx(Rm,{className:"w-full",children:f.jsx(Mm,{className:"flex justify-center items-center h-64",children:f.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Sati Memories"}),f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1",children:"View and manage your long-term memories stored by Sati"})]}),o.length>0&&f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[o.length," selected"]}),f.jsxs(ir,{variant:"destructive",size:"sm",onClick:()=>T(!0),disabled:o.length===0,children:[f.jsx(Bo,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&f.jsx(BH,{variant:"destructive",children:f.jsx(ZH,{children:b})}),f.jsxs(Rm,{children:[f.jsx(Ow,{className:"border-b border-azure-border dark:border-matrix-primary",children:f.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[f.jsxs("div",{className:"flex flex-col relative w-full",children:[f.jsx(yA,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),f.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:S=>d(S.target.value),className:"w-full pl-10 pr-4 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight"})]}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[f.jsxs("select",{value:h,onChange:S=>m(S.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[f.jsx("option",{value:"all",children:"All Categories"}),he.map(S=>f.jsx("option",{value:S,children:S},S))]}),f.jsxs("select",{value:g,onChange:S=>x(S.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[f.jsx("option",{value:"all",children:"All Importance"}),O.map(S=>f.jsx("option",{value:S,children:S},S))]})]})]})}),f.jsx(Mm,{className:"p-0",children:f.jsxs(LH,{children:[f.jsx(PH,{children:f.jsxs(Om,{className:"hover:bg-transparent",children:[f.jsx(wo,{className:"w-12",children:f.jsx(Aw,{checked:B.length>0&&o.length===B.length,onCheckedChange:se})}),f.jsx(wo,{children:"Summary"}),f.jsx(wo,{children:"Category"}),f.jsx(wo,{children:"Importance"}),f.jsx(wo,{children:"Created"}),f.jsx(wo,{className:"w-32",children:"Actions"})]})}),f.jsx(UH,{children:B.length===0?f.jsx(Om,{children:f.jsx(bi,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):B.map(S=>f.jsxs(Om,{children:[f.jsx(bi,{children:f.jsx(Aw,{checked:o.includes(S.id),onCheckedChange:()=>te(S.id)})}),f.jsx(bi,{className:"font-medium max-w-xs truncate",children:S.summary}),f.jsx(bi,{children:f.jsx(ed,{variant:"outline",children:S.category})}),f.jsx(bi,{children:f.jsx(ed,{variant:S.importance==="critical"?"destructive":S.importance==="high"?"default":S.importance==="medium"?"secondary":"outline",children:S.importance})}),f.jsx(bi,{children:f.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx(uS,{className:"w-4 h-4"}),new Date(S.created_at).toLocaleDateString()]})}),f.jsx(bi,{children:f.jsxs("div",{className:"flex gap-1",children:[f.jsx(ir,{variant:"ghost",size:"sm",onClick:()=>K(S),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:f.jsx(id,{className:"w-4 h-4"})}),f.jsx(ir,{variant:"ghost",size:"sm",onClick:()=>ae(S.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:f.jsx(Bo,{className:"w-4 h-4"})})]})})]},S.id))})]})})]}),z&&f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:f.jsxs(Rm,{className:"w-full max-w-md mx-4",children:[f.jsx(Ow,{children:f.jsx(VH,{children:"Delete Memories"})}),f.jsxs(Mm,{children:[f.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",o.length," ","memory(ies)? This action cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ir,{variant:"outline",onClick:()=>T(!1),children:"Cancel"}),f.jsx(ir,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),f.jsx(IH,{isOpen:A,onClose:()=>C(!1),memory:E}),f.jsx(HH,{isOpen:M,onClose:()=>q(!1),onConfirm:U,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},vi=zi.getInstance(),ki={fetchServers:async()=>vi.get("/mcp/servers"),addServer:async(e,t)=>vi.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>vi.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>vi.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>vi.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>vi.post("/mcp/reload",{}),fetchStatus:async()=>vi.get("/mcp/status")},GH=({label:e,values:t,onChange:n,placeholder:a})=>{const o=t.length>0?t:[""],u=(h,m)=>{const g=[...o];g[h]=m,n(g.filter(x=>x.trim().length>0))},l=()=>n([...o,""]),d=h=>{const m=o.filter((g,x)=>x!==h);n(m.filter(g=>g.trim().length>0))};return f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),o.map((h,m)=>f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{className:"flex-1 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:h,placeholder:a,onChange:g=>u(m,g.target.value)}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>d(m),children:"Remove"})]},`${e}-${m}`)),f.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:l,children:"Add argument"})]})},Rw=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:o})=>{const u=j.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,x)=>{const b=[...u];b[m]={...b[m],[g]:x},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},d=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((x,b)=>b!==m);n(g.filter(x=>x.key.trim().length>0||x.value.trim().length>0))};return f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),u.map((m,g)=>f.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[f.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.key,placeholder:a,onChange:x=>l(g,"key",x.target.value)}),f.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.value,placeholder:o,onChange:x=>l(g,"value",x.target.value)}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>h(g),children:"Remove"})]},`${e}-${g}`)),f.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:d,children:"Add entry"})]})},YH=({transport:e,command:t,url:n,args:a,env:o,headers:u,onCommandChange:l,onUrlChange:d,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>f.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:t,onChange:x=>l(x.target.value),placeholder:"npx"})]}),f.jsx(GH,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:n,onChange:x=>d(x.target.value),placeholder:"https://example.com/mcp"})]}),f.jsx(Rw,{label:"Environment Variables",values:o,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&f.jsx(Rw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),XH=oH({name:Am().min(1,"Name is required"),transport:oj([Tw("stdio"),Tw("http")]),command:Am().optional(),url:Am().optional()}),zc=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Dm=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),KH=({open:e,mode:t,initial:n,onClose:a,onSubmit:o})=>{const[u,l]=j.useState(n?.name??""),[d,h]=j.useState(n?.config.transport??"stdio"),[m,g]=j.useState(n?.config.transport==="stdio"?n.config.command:""),[x,b]=j.useState(n?.config.transport==="http"?n.config.url:""),[v,z]=j.useState(n?.config.args??[]),[T,E]=j.useState(zc(n?.config.env)),[N,A]=j.useState(n?.config.transport==="http"?zc(n.config.headers):[]),[C,$]=j.useState(null);j.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),b(n?.config.transport==="http"?n.config.url:""),z(n?.config.args??[]),E(zc(n?.config.env)),A(n?.config.transport==="http"?zc(n.config.headers):[]),$(null))},[e,n]);const L=t==="create",M=async()=>{const V=XH.safeParse({name:u,transport:d,command:m,url:x});if(!V.success){$(V.error.issues[0]?.message??"Invalid form");return}if(d==="stdio"&&(!m||m.trim().length===0)){$("Command is required for stdio transport.");return}if(d==="http"&&(!x||x.trim().length===0)){$("URL is required for http transport.");return}const X=d==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:T.length>0?Dm(T):void 0}:{transport:"http",url:x.trim(),headers:N.length>0?Dm(N):void 0,env:T.length>0?Dm(T):void 0};$(null),await o(u.trim(),X)},q=j.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return f.jsx(Nr,{open:e,onOpenChange:a,children:f.jsxs(Io,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:q})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none disabled:bg-azure-border dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary dark:disabled:bg-matrix-primary/50",value:u,onChange:V=>l(V.target.value),placeholder:"coolify",disabled:!L})]}),f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",f.jsxs("select",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:d,onChange:V=>h(V.target.value),children:[f.jsx("option",{value:"stdio",children:"stdio"}),f.jsx("option",{value:"http",children:"http"})]})]}),f.jsx(YH,{transport:d,command:m,url:x,args:v,env:T,headers:N,onCommandChange:g,onUrlChange:b,onArgsChange:z,onEnvChange:E,onHeadersChange:A}),C&&f.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/50 dark:text-red-400",children:C}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:a,children:"Cancel"}),f.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:M,children:"Save"})]})]})]})})},JH=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:o})=>f.jsxs("div",{className:"rounded-2xl border border-azure-border bg-azure-surface/80 p-4 shadow-sm overflow-hidden dark:border-matrix-primary dark:bg-zinc-950/70",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-lg font-semibold text-azure-text-primary break-words dark:text-matrix-highlight",children:e.name}),f.jsx("div",{className:"text-xs uppercase tracking-wide text-azure-text-muted dark:text-matrix-secondary",children:e.config.transport})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx("span",{title:t.ok?`${t.toolCount} tools`:t.error,className:`rounded-full px-2 py-0.5 text-xs font-semibold ${t.ok?"bg-green-500/20 text-green-600 dark:bg-green-400/20 dark:text-green-400":"bg-red-500/20 text-red-600 dark:bg-red-400/20 dark:text-red-400"}`,children:t.ok?`✓ ${t.toolCount} tools`:"✗ Failed"}),f.jsx("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-semibold ${e.enabled?"bg-matrix-highlight dark:text-matrix-primary":"bg-azure-border text-azure-text-secondary dark:bg-matrix-primary/50 dark:text-matrix-secondary"}`,onClick:()=>o(e,!e.enabled),children:e.enabled?"Enabled":"Disabled"})]})]}),f.jsxs("div",{className:"mt-4 space-y-2 text-sm text-azure-text-secondary dark:text-matrix-secondary",children:[e.config.transport==="stdio"&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Command:"})," ",e.config.command]}),e.config.transport==="http"&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"URL:"})," ",e.config.url]}),e.config.args&&e.config.args.length>0&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Args:"})," ",e.config.args.join(" ")]}),t&&!t.ok&&t.error&&f.jsx("div",{className:"mt-1 break-all rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/30 dark:text-red-400",children:t.error.length>120?t.error.slice(0,120)+"…":t.error})]}),f.jsxs("div",{className:"mt-4 flex gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-3 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>n(e),children:"Edit"}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>a(e),children:"Delete"})]})]}),QH=()=>{const{data:e,error:t,mutate:n,isLoading:a}=Qt("/api/mcp/servers",()=>ki.fetchServers()),[o,u]=j.useState(""),[l,d]=j.useState("all"),[h,m]=j.useState(!1),[g,x]=j.useState(null),[b,v]=j.useState(!1),[z,T]=j.useState(null),[E,N]=j.useState(null),[A,C]=j.useState({}),[$,L]=j.useState(!1),[M,q]=j.useState(!1),V=e?.servers??[],X=j.useMemo(()=>V.filter(B=>{const he=B.name.toLowerCase().includes(o.toLowerCase()),O=l==="all"||B.config.transport===l;return he&&O}),[V,o,l]),ce=()=>{x(null),m(!0)},Q=B=>{x(B),m(!0)},se=async(B,he)=>{try{g?await ki.updateServer(g.name,he):await ki.addServer(B,he),m(!1),x(null),await n(),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(O){N({type:"error",message:O.message||"Failed to save MCP server."})}},te=async B=>{T(B),v(!0)},oe=async()=>{if(z)try{await ki.deleteServer(z.name),await n(),v(!1),T(null),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(B){N({type:"error",message:B.message||"Failed to delete MCP server."})}},ae=async()=>{L(!0);try{const B=await ki.fetchStatus(),he={};for(const O of B.servers)he[O.name]=O;C(he)}catch(B){N({type:"error",message:B.message||"Failed to check MCP status."})}finally{L(!1)}},U=async()=>{q(!0);try{await ki.reloadTools(),N({type:"success",message:"MCP tools reloaded successfully."})}catch(B){N({type:"error",message:B.message||"Failed to reload MCP tools."})}finally{q(!1)}},K=async(B,he)=>{try{await ki.toggleServer(B.name,he),await n(),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(O){N({type:"error",message:O.message||"Failed to toggle MCP server."})}};return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Manage MCP servers stored in mcps.json."})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{type:"button",disabled:$,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:ae,children:$?"Checking…":"Check Status"}),f.jsx("button",{type:"button",disabled:M,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:U,children:M?"Reloading…":"Reload MCPs"}),f.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:ce,children:"Add Server"})]})]}),E&&f.jsx("div",{className:`p-4 rounded border ${E.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:E.message}),f.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:o,onChange:B=>u(B.target.value),placeholder:"Search by name"}),f.jsxs("select",{className:"rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:l,onChange:B=>d(B.target.value),children:[f.jsx("option",{value:"all",children:"All"}),f.jsx("option",{value:"stdio",children:"stdio"}),f.jsx("option",{value:"http",children:"http"})]})]}),a&&f.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&f.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&X.length===0&&f.jsx("div",{className:"rounded-2xl border border-dashed border-azure-border bg-azure-surface/60 p-6 text-center text-sm text-azure-text-secondary dark:border-matrix-primary dark:bg-zinc-950/60 dark:text-matrix-secondary",children:"No MCP servers found. Add a server to get started."}),f.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:X.map(B=>f.jsx(JH,{server:B,probeResult:A[B.name],onEdit:Q,onDelete:te,onToggle:K},`${B.name}-${B.enabled?"on":"off"}`))}),f.jsx(KH,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:se}),f.jsx(Nr,{open:b,onOpenChange:v,children:f.jsxs(Io,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:"Confirm Deletion"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",f.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',z?.name,'"']}),"? This action cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>v(!1),children:"Cancel"}),f.jsx("button",{type:"button",className:"rounded-md bg-red-500 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-red-400 dark:bg-red-600 hover:dark:bg-red-500",onClick:oe,children:"Delete"})]})]})]})})]})},$m={list:()=>ze.get("/model-pricing"),upsert:e=>ze.post("/model-pricing",e),update:(e,t,n)=>ze.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>ze.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},WH={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Mw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},eF=["anthropic","openai","google","openrouter","ollama","other"],Dw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),tF=()=>{const{data:e=[],mutate:t}=Qt("/api/model-pricing",()=>$m.list()),[n,a]=j.useState(!1),[o,u]=j.useState(null),[l,d]=j.useState(Dw()),[h,m]=j.useState(null),[g,x]=j.useState(null),[b,v]=j.useState(!1),z=(C,$)=>{x({type:C,message:$}),setTimeout(()=>x(null),3e3)},T=()=>{u(null),d(Dw()),a(!0)},E=C=>{u(C),d({...C}),a(!0)},N=async()=>{if(!(!l.provider.trim()||!l.model.trim())){v(!0);try{await $m.upsert(l),await t(),a(!1),z("success",o?"Pricing updated.":"Pricing created.")}catch{z("error","Failed to save pricing entry.")}finally{v(!1)}}},A=async()=>{if(h)try{await $m.delete(h.provider,h.model),await t(),m(null),z("success","Pricing entry deleted.")}catch{z("error","Failed to delete pricing entry.")}};return f.jsxs(ot.div,{variants:WH,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:Mw,className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx($c,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Model Pricing"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Manage per-model pricing to estimate LLM costs in Usage Stats."})]})]}),f.jsxs("button",{onClick:T,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(Qp,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&f.jsx(ot.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),f.jsx(ot.div,{variants:Mw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(C=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:C},C))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:'No pricing entries. Click "Add Pricing" to get started.'})}):e.map(C=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[f.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:C.provider}),f.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:C.model}),f.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.input_price_per_1m.toFixed(4)]}),f.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.output_price_per_1m.toFixed(4)]}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>E(C),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:f.jsx(Jp,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>m(C),className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",title:"Delete",children:f.jsx(Bo,{className:"w-4 h-4"})})]})})]},`${C.provider}/${C.model}`))})]})}),f.jsx(Nr,{open:n,onOpenChange:a,children:f.jsxs(Io,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:o?"Edit Pricing":"Add Pricing"})}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),o?f.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm capitalize",children:l.provider}):f.jsxs("select",{value:l.provider,onChange:C=>d({...l,provider:C.target.value}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight",children:[f.jsx("option",{value:"",children:"Select provider..."}),eF.map(C=>f.jsx("option",{value:C,children:C},C))]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),o?f.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm font-mono",children:l.model}):f.jsx("input",{type:"text",value:l.model,onChange:C=>d({...l,model:C.target.value}),placeholder:"e.g. gpt-4o",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),f.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:C=>d({...l,input_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),f.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:C=>d({...l,output_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]})]}),f.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:N,disabled:b||!l.provider.trim()||!l.model.trim(),className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving...":"Save"})]})]})]})}),f.jsx(Nr,{open:!!h,onOpenChange:C=>!C&&m(null),children:f.jsxs(Io,{children:[f.jsx(Ar,{children:f.jsx(Or,{children:"Delete Pricing Entry"})}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",f.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:A,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},nF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},$w={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},rF=["ui","telegram"],Lw=()=>({name:"",prompt:"",notification_channels:["ui"]}),aF=()=>{const{data:e=[],mutate:t}=Qt("/webhooks",()=>La.list(),{refreshInterval:1e4}),[n,a]=j.useState(!1),[o,u]=j.useState(null),[l,d]=j.useState(Lw()),[h,m]=j.useState(null),[g,x]=j.useState(null),[b,v]=j.useState(!1),[z,T]=j.useState(null),[E,N]=j.useState(null),A=(te,oe)=>{x({type:te,message:oe}),setTimeout(()=>x(null),3500)},C=()=>{u(null),d(Lw()),N(null),a(!0)},$=te=>{u(te),d({name:te.name,prompt:te.prompt,notification_channels:te.notification_channels}),N(null),a(!0)},L=te=>/^[a-z0-9-_]+$/.test(te),M=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!L(l.name)){N("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){N("Select at least one notification channel.");return}N(null),v(!0);try{o?(await La.update(o.id,l),A("success","Webhook updated.")):(await La.create(l),A("success","Webhook created.")),await t(),a(!1)}catch(te){const oe=te?.message||"Failed to save webhook.";N(oe)}finally{v(!1)}}},q=async te=>{try{await La.update(te.id,{enabled:!te.enabled}),await t()}catch{A("error","Failed to toggle webhook.")}},V=async()=>{if(h)try{await La.delete(h.id),await t(),m(null),A("success","Webhook deleted.")}catch{A("error","Failed to delete webhook.")}},X=te=>`${window.location.origin}/api/webhooks/trigger/${te}`,ce=te=>`curl -X POST ${X(te.name)} \\
110
110
  -H "x-api-key: ${te.api_key}" \\
111
111
  -H "Content-Type: application/json" \\
112
- -d '{"event":"your_payload"}'`,Q=async(te,oe)=>{await navigator.clipboard.writeText(te),T(oe),setTimeout(()=>T(null),2e3)},se=te=>{const oe=l.notification_channels.includes(te);d({...l,notification_channels:oe?l.notification_channels.filter(ae=>ae!==te):[...l.notification_channels,te]})};return f.jsxs(ot.div,{variants:eF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:$w,className:"flex items-center justify-between flex-wrap gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Fm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Webhooks"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs(_r,{to:"/notifications",className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[f.jsx(bl,{className:"w-4 h-4"}),"Notifications"]}),f.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(Qp,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&f.jsx(ot.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),f.jsx(ot.div,{variants:$w,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(te=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:te},te))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{children:f.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",f.jsx("button",{onClick:C,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(te=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[f.jsx("td",{className:"px-4 py-3",children:f.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:te.name})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[te.api_key.slice(0,16),"…"]}),f.jsx("button",{onClick:()=>Q(ce(te),`curl-${te.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy curl example",children:z===`curl-${te.id}`?f.jsx(Bm,{className:"w-3.5 h-3.5 text-green-500"}):f.jsx(Hm,{className:"w-3.5 h-3.5"})}),f.jsx("button",{onClick:()=>Q(te.api_key,`key-${te.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy API key",children:z===`key-${te.id}`?f.jsx(Bm,{className:"w-3.5 h-3.5 text-green-500"}):f.jsx(VN,{className:"w-3.5 h-3.5"})})]})}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("div",{className:"flex gap-1 flex-wrap",children:te.notification_channels.map(oe=>f.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-azure-border dark:bg-matrix-primary/20 text-azure-text-secondary dark:text-matrix-secondary capitalize",children:oe},oe))})}),f.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:te.trigger_count}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>q(te),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${te.enabled?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:te.enabled?f.jsxs(f.Fragment,{children:[f.jsx(TA,{className:"w-3.5 h-3.5"})," Enabled"]}):f.jsxs(f.Fragment,{children:[f.jsx(_A,{className:"w-3.5 h-3.5"})," Disabled"]})})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:()=>$(te),title:"Edit",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(Jp,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>m(te),title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",children:f.jsx(Vo,{className:"w-4 h-4"})})]})})]},te.id))})]})})}),f.jsxs(Nr,{open:n,onOpenChange:a,children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-text-primary dark:text-matrix-highlight",children:o?"Edit Webhook":"New Webhook"})}),f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",f.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),f.jsx("input",{type:"text",value:l.name,onChange:te=>{d({...l,name:te.target.value.toLowerCase().replace(/\s+/g,"-")}),N(null)},placeholder:"e.g. deploy-done, github-issue-opened",disabled:!!o,className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight disabled:opacity-50 disabled:cursor-not-allowed"}),l.name&&f.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",f.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),f.jsx("textarea",{rows:5,value:l.prompt,onChange:te=>d({...l,prompt:te.target.value}),placeholder:"Describe what Apoc should do when this webhook fires. The received payload will be appended automatically.",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight resize-none"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),f.jsx("div",{className:"flex gap-4",children:tF.map(te=>f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(te),onChange:()=>se(te),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),f.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:te})]},te))})]}),E&&f.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded px-3 py-2",children:E}),f.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:M,disabled:b||!l.name.trim()||!l.prompt.trim()||l.notification_channels.length===0,className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving…":o?"Update":"Create"})]})]})]}),f.jsxs(Nr,{open:!!h,onOpenChange:te=>!te&&m(null),children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),f.jsxs("div",{className:"p-6 space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",f.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:V,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},rF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Pw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},Uw=({status:e})=>e==="completed"?f.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[f.jsx(cS,{className:"w-4 h-4"}),f.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?f.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[f.jsx(Zm,{className:"w-4 h-4"}),f.jsx("span",{className:"text-xs",children:"Failed"})]}):f.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[f.jsx(ad,{className:"w-4 h-4 animate-pulse"}),f.jsx("span",{className:"text-xs",children:"Pending"})]}),zc=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),aF=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},iF=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),{data:o=[],mutate:u}=Qt(["/webhooks/notifications",e],()=>La.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=o.filter(g=>!g.read).length,d=async g=>{g.length!==0&&(await La.markRead(g),await u())},h=()=>{const g=o.filter(x=>!x.read).map(x=>x.id);d(g)},m=async g=>{a(g),g.read||await d([g.id])};return f.jsxs(ot.div,{variants:rF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:Pw,className:"flex items-center justify-between flex-wrap gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("div",{className:"relative",children:[f.jsx(bl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),l>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[10px] font-bold rounded-full w-4 h-4 flex items-center justify-center leading-none",children:l>9?"9+":l})]}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Notifications"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs(_r,{to:"/webhooks",className:"flex items-center gap-2 text-sm text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:[f.jsx(bN,{className:"w-4 h-4"}),"Back to Webhooks"]}),f.jsxs("button",{onClick:()=>t(!e),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm transition-colors ${e?"border-azure-primary dark:border-matrix-highlight bg-azure-active dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800"}`,children:[f.jsx(YN,{className:"w-4 h-4"}),"Unread only"]}),l>0&&f.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[f.jsx(NN,{className:"w-4 h-4"}),"Mark all read"]})]})]}),f.jsx(ot.div,{variants:Pw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),f.jsx("tbody",{children:o.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:e?"No unread notifications.":"No notifications yet."})}):o.map(g=>f.jsxs("tr",{className:`border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors ${g.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[f.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&f.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),f.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(Uw,{status:g.status})}),f.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:zc(g.created_at)}),f.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?zc(g.completed_at):"—"}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>m(g),title:"View details",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(id,{className:"w-4 h-4"})})})]},g.id))})]})})}),f.jsxs(Nr,{open:!!n,onOpenChange:g=>!g&&a(null),children:[f.jsx(Ar,{children:f.jsxs(Or,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(bl,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[f.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[f.jsx(Uw,{status:n.status}),f.jsx("span",{children:zc(n.created_at)}),n.completed_at&&f.jsxs("span",{children:["→ ",zc(n.completed_at)]})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),f.jsx("pre",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-44 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:aF(n.payload)})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),f.jsx("div",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-64 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:n.result??f.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),f.jsx("div",{className:"flex justify-end pt-2",children:f.jsx("button",{onClick:()=>a(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Close"})})]})]})]})},oF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},_c={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},sF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function lF({status:e}){return e==="completed"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[f.jsx(cS,{className:"w-4 h-4"}),"Completed"]}):e==="failed"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600 dark:text-red-400",children:[f.jsx(Zm,{className:"w-4 h-4"}),"Failed"]}):e==="running"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[f.jsx(nA,{className:"w-4 h-4 animate-spin"}),"Running"]}):e==="cancelled"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[f.jsx(Zm,{className:"w-4 h-4"}),"Cancelled"]}):f.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[f.jsx(ad,{className:"w-4 h-4"}),"Pending"]})}const Vw=e=>e?new Date(e).toLocaleString():"—";function uF(){const[e,t]=j.useState(""),[n,a]=j.useState(""),[o,u]=j.useState(""),[l,d]=j.useState(""),[h,m]=j.useState(null),g=j.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:o||void 0,session_id:l.trim()||void 0,limit:200}),[e,n,o,l]),{data:x}=Qt("/tasks/stats",()=>Oc.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=Qt(["/tasks",g],()=>Oc.list(g),{refreshInterval:3e3});return f.jsxs(ot.div,{variants:oF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:_c,className:"flex items-center gap-3",children:[f.jsx(Im,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Tasks"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),f.jsxs(ot.div,{variants:_c,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[f.jsx(So,{label:"Pending",value:x?.pending??0}),f.jsx(So,{label:"Running",value:x?.running??0}),f.jsx(So,{label:"Completed",value:x?.completed??0}),f.jsx(So,{label:"Failed",value:x?.failed??0}),f.jsx(So,{label:"Cancelled",value:x?.cancelled??0}),f.jsx(So,{label:"Total",value:x?.total??0})]}),f.jsxs(ot.div,{variants:_c,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-azure-surface dark:bg-zinc-950 grid grid-cols-1 md:grid-cols-4 gap-3",children:[f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:e,onChange:z=>t(z.target.value||""),children:[f.jsx("option",{value:"",children:"All status"}),Object.entries(sF).map(([z,T])=>f.jsx("option",{value:z,children:T},z))]}),f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:n,onChange:z=>a(z.target.value||""),children:[f.jsx("option",{value:"",children:"All agents"}),f.jsx("option",{value:"apoc",children:"Apoc"}),f.jsx("option",{value:"neo",children:"Neo"})]}),f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:o,onChange:z=>u(z.target.value||""),children:[f.jsx("option",{value:"",children:"All channels"}),f.jsx("option",{value:"telegram",children:"Telegram"}),f.jsx("option",{value:"ui",children:"UI"}),f.jsx("option",{value:"api",children:"API"}),f.jsx("option",{value:"webhook",children:"Webhook"}),f.jsx("option",{value:"cli",children:"CLI"})]}),f.jsx("input",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:l,onChange:z=>d(z.target.value),placeholder:"Filter by session id"})]}),f.jsx(ot.div,{variants:_c,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Task ID","Status","Agent","Channel","Session","Attempts","Created","Finished","Actions"].map(z=>f.jsx("th",{className:"text-left px-4 py-3 font-semibold text-azure-text-secondary dark:text-matrix-dim",children:z},z))})}),f.jsx("tbody",{children:b.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:9,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:"No tasks found."})}):b.map(z=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-900/40 transition-colors",children:[f.jsx("td",{className:"px-4 py-3 font-mono",children:z.id.slice(0,8)}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(lF,{status:z.status})}),f.jsx("td",{className:"px-4 py-3",children:z.agent.toUpperCase()}),f.jsx("td",{className:"px-4 py-3",children:z.origin_channel.toUpperCase()}),f.jsx("td",{className:"px-4 py-3 font-mono",children:z.session_id}),f.jsxs("td",{className:"px-4 py-3",children:[z.attempt_count,"/",z.max_attempts]}),f.jsx("td",{className:"px-4 py-3",children:Vw(z.created_at)}),f.jsx("td",{className:"px-4 py-3",children:Vw(z.finished_at)}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>m(z),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim",children:f.jsx(id,{className:"w-4 h-4"})})})]},z.id))})]})}),f.jsxs(Nr,{open:!!h,onOpenChange:z=>!z&&m(null),children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Task Details"})}),h&&f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[70vh] text-sm",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-azure-text-secondary dark:text-matrix-dim",children:[f.jsxs("div",{children:[f.jsx("b",{children:"ID:"})," ",f.jsx("span",{className:"font-mono",children:h.id})]}),f.jsxs("div",{children:[f.jsx("b",{children:"Status:"})," ",h.status]}),f.jsxs("div",{children:[f.jsx("b",{children:"Agent:"})," ",h.agent]}),f.jsxs("div",{children:[f.jsx("b",{children:"Origin:"})," ",h.origin_channel]}),f.jsxs("div",{children:[f.jsx("b",{children:"Session:"})," ",f.jsx("span",{className:"font-mono",children:h.session_id})]}),f.jsxs("div",{children:[f.jsx("b",{children:"Attempts:"})," ",h.attempt_count,"/",h.max_attempts]})]}),f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1",children:"Input"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.input})]}),h.output&&f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1",children:"Output"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.output})]}),h.error&&f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1 text-red-600 dark:text-red-400",children:"Error"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-red-200 dark:border-red-900/50 p-3 bg-red-50 dark:bg-red-950/40",children:h.error})]}),h.status==="failed"&&f.jsx("div",{className:"flex justify-end",children:f.jsx("button",{onClick:async()=>{await Oc.retry(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black text-sm",children:"Retry Task"})})]})]})]})}function So({label:e,value:t}){return f.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950 px-4 py-3",children:[f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:e}),f.jsx("p",{className:"text-xl font-semibold text-azure-text-primary dark:text-matrix-highlight",children:t})]})}const Lm={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},Bw={name:"",type:"postgresql",host:"",port:"",database_name:"",username:"",password:"",connection_string:"",allow_read:!0,allow_insert:!1,allow_update:!1,allow_delete:!1,allow_ddl:!1},cF={postgresql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mysql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],sqlite:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mongodb:[{key:"allow_read",label:"find / aggregate",description:"Permite consultas e agregações"},{key:"allow_insert",label:"insertOne / insertMany",description:"Permite inserir documentos"},{key:"allow_update",label:"updateOne / updateMany",description:"Permite atualizar documentos"},{key:"allow_delete",label:"deleteOne / deleteMany",description:"Permite excluir documentos"},{key:"allow_ddl",label:"Schema changes",description:"createCollection / dropCollection / createIndex"}]};async function dF(){return _e.get("/trinity/databases")}function fF(){const{data:e,error:t}=Qt("/trinity/databases",dF,{refreshInterval:3e4}),[n,a]=j.useState(!1),[o,u]=j.useState(null),[l,d]=j.useState(Bw),[h,m]=j.useState(!1),[g,x]=j.useState(null),[b,v]=j.useState({}),[z,T]=j.useState(null),[E,N]=j.useState({}),[A,C]=j.useState(null),[$,L]=j.useState(null),[M,q]=j.useState(null),[V,X]=j.useState(!1),ce=()=>{u(null),d(Bw),X(!1),x(null),a(!0)},Q=w=>{u(w),d({name:w.name,type:w.type,host:w.host||"",port:w.port?String(w.port):"",database_name:w.database_name||"",username:w.username||"",password:"",connection_string:"",allow_read:w.allow_read,allow_insert:w.allow_insert,allow_update:w.allow_update,allow_delete:w.allow_delete,allow_ddl:w.allow_ddl}),X(!!w.connection_string),x(null),a(!0)},se=async()=>{if(m(!0),x(null),!V&&!l.database_name.trim()){x(l.type==="sqlite"?"File path is required.":"Database name is required."),m(!1);return}try{const w={name:l.name,type:l.type,allow_read:l.allow_read,allow_insert:l.allow_insert,allow_update:l.allow_update,allow_delete:l.allow_delete,allow_ddl:l.allow_ddl};V?(!o||l.connection_string)&&(w.connection_string=l.connection_string||null):(w.host=l.host||null,w.port=l.port?parseInt(l.port):null,w.database_name=l.database_name||null,w.username=l.username||null,(!o||l.password)&&(w.password=l.password||null)),o?await _e.put(`/trinity/databases/${o.id}`,w):await _e.post("/trinity/databases",w),await na("/trinity/databases"),a(!1)}catch(w){x(w.message||"Failed to save database")}finally{m(!1)}},te=w=>{q(w)},oe=async()=>{if(!M)return;const w=M.id;L(w);try{await _e.delete(`/trinity/databases/${w}`),await na("/trinity/databases")}catch(G){alert(`Delete failed: ${G.message}`)}finally{L(null),q(null)}},ae=async w=>{T(w);try{const G=await _e.post(`/trinity/databases/${w}/test`,{});N(de=>({...de,[w]:G.success}))}catch{N(G=>({...G,[w]:!1}))}finally{T(null)}},U=async w=>{C(w);try{await _e.post(`/trinity/databases/${w}/refresh-schema`,{}),await na("/trinity/databases")}catch(G){alert(`Schema refresh failed: ${G.message}`)}finally{C(null)}},K=w=>{v(G=>({...G,[w]:!G[w]}))},B=w=>{w!=="mongodb"&&X(!1),d(G=>({...G,type:w,port:Lm[w]?String(Lm[w]):""}))},he=w=>{d(G=>({...G,[w]:!G[w]}))};if(t)return f.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const O="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",S="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",H=w=>[{key:"allow_read",badge:"R"},{key:"allow_insert",badge:"I"},{key:"allow_update",badge:"U"},{key:"allow_delete",badge:"D"},{key:"allow_ddl",badge:"DDL"}].filter(de=>w[de.key]).map(de=>de.badge);return f.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Oo,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Trinity Databases"})]}),f.jsxs("button",{onClick:ce,className:"flex items-center gap-2 px-4 py-2 bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors text-sm font-medium",children:[f.jsx(Qp,{className:"w-4 h-4"}),"Register Database"]})]}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Register databases for Trinity to access. Configure permissions to control what operations Trinity can perform on each database."}),e?e.length===0?f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded p-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx(Oo,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),f.jsx("p",{className:"font-medium",children:"No databases registered"}),f.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):f.jsx("div",{className:"space-y-4",children:e.map(w=>{const G=w.schema_json?JSON.parse(w.schema_json):null,de=!!G?.databases,fe=de?G.databases.reduce((st,wt)=>st+wt.tables.length,0):G?.tables?.length??0,me=de?G.databases.length:0,De=w.type==="mongodb"?"collection":"table",Ne=w.type==="mongodb"?"collections":"tables",kt=E[w.id],It=b[w.id],fn=H(w);return f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[f.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[f.jsx(Oo,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),f.jsx("span",{className:"text-xs px-2 py-0.5 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary uppercase flex-shrink-0",children:w.type}),kt===!0&&f.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[f.jsx(Ih,{className:"w-3 h-3"})," Connected"]}),kt===!1&&f.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[f.jsx(DA,{className:"w-3 h-3"})," Failed"]}),fn.length>0&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(E0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),fn.map(st=>f.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight font-mono",children:st},st))]})]}),f.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary truncate mt-0.5",children:[w.host?`${w.host}:${w.port}${w.database_name?`/${w.database_name}`:""}`:w.database_name||"connection string configured",de&&me>0&&f.jsxs("span",{className:"ml-2 opacity-70",children:["· ",me," database",me!==1?"s":""," · ",fe," ",fe!==1?Ne:De]}),!de&&fe>0&&f.jsxs("span",{className:"ml-2 opacity-70",children:["· ",fe," ",fe!==1?Ne:De]}),w.schema_updated_at&&f.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[f.jsx("button",{onClick:()=>ae(w.id),disabled:z===w.id,title:"Test connection",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:z===w.id?f.jsx(Ih,{className:"w-4 h-4 animate-pulse"}):f.jsx(Ih,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>U(w.id),disabled:A===w.id,title:"Refresh schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:f.jsx(hS,{className:`w-4 h-4 ${A===w.id?"animate-spin":""}`})}),f.jsx("button",{onClick:()=>Q(w),title:"Edit",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors text-xs font-medium px-2",children:"Edit"}),f.jsx("button",{onClick:()=>te(w),disabled:$===w.id,title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-red-500 transition-colors",children:f.jsx(Vo,{className:"w-4 h-4"})}),G&&f.jsx("button",{onClick:()=>K(w.id),title:It?"Hide schema":"Show schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:It?f.jsx(RN,{className:"w-4 h-4"}):f.jsx(DN,{className:"w-4 h-4"})})]})]}),It&&G&&f.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[f.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:de?`${me} database${me!==1?"s":""} — ${fe} ${fe!==1?Ne:De} total`:`Schema — ${fe} ${fe!==1?Ne:De}`}),f.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:de?G.databases?.map(st=>f.jsxs("div",{className:"text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[f.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:st.name}),f.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",st.tables.length," ",st.tables.length!==1?Ne:De,")"]})]}),f.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[st.tables.map(wt=>f.jsxs("div",{children:[f.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:wt.name}),f.jsx("div",{className:"pl-3 space-y-0.5",children:wt.columns?.map(Fn=>f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[f.jsx("span",{children:Fn.name}),f.jsx("span",{className:"opacity-50 ml-2",children:Fn.type}),Fn.nullable===!1&&f.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},Fn.name))})]},wt.name)),st.tables.length===0&&f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ne]})]})]},st.name)):G.tables?.map(st=>f.jsxs("div",{className:"text-xs",children:[f.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:st.name}),f.jsx("div",{className:"pl-3 space-y-0.5",children:st.columns?.map(wt=>f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[f.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:wt.name}),f.jsx("span",{className:"opacity-50 ml-2",children:wt.type}),wt.nullable===!1&&f.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},wt.name))})]},st.name))})]})]},w.id)})}):f.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),f.jsx(H_,{isOpen:!!M,onClose:()=>q(null),onConfirm:oe,title:"Delete database",description:`Remove "${M?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),f.jsxs("div",{className:"relative bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[90vh] overflow-y-auto",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[f.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:o?"Edit Database":"Register Database"}),f.jsx("button",{onClick:()=>a(!1),className:"text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:f.jsx(pS,{className:"w-5 h-5"})})]}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Name *"}),f.jsx("input",{className:O,value:l.name,onChange:w=>d(G=>({...G,name:w.target.value})),placeholder:"My Production DB"})]}),f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Type *"}),f.jsxs("select",{className:O,value:l.type,onChange:w=>B(w.target.value),children:[f.jsx("option",{value:"postgresql",children:"PostgreSQL"}),f.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),f.jsx("option",{value:"sqlite",children:"SQLite"}),f.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{type:"button",onClick:()=>X(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${V?"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary":"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight"}`,children:"Individual fields"}),f.jsx("button",{type:"button",onClick:()=>X(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${V?"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary"}`,children:"Connection string"})]}),l.type==="mongodb"&&V?f.jsxs("div",{children:[f.jsxs("label",{className:S,children:["Connection String ",o&&f.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),f.jsx("input",{className:O,type:"password",value:l.connection_string,onChange:w=>d(G=>({...G,connection_string:w.target.value})),placeholder:o?"unchanged":"mongodb://user:pass@host:27017/dbname"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]}):f.jsxs(f.Fragment,{children:[l.type!=="sqlite"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Host"}),f.jsx("input",{className:O,value:l.host,onChange:w=>d(G=>({...G,host:w.target.value})),placeholder:"localhost"})]}),f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Port"}),f.jsx("input",{className:O,type:"number",value:l.port,onChange:w=>d(G=>({...G,port:w.target.value})),placeholder:String(Lm[l.type]||"")})]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:S,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),f.jsx("input",{className:`w-full px-3 py-2 bg-azure-surface dark:bg-black border rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none ${g&&!l.database_name.trim()?"border-red-500 dark:border-red-500":"border-azure-border dark:border-matrix-primary focus:border-azure-primary dark:focus:border-matrix-highlight"}`,value:l.database_name,onChange:w=>d(G=>({...G,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Username"}),f.jsx("input",{className:O,value:l.username,onChange:w=>d(G=>({...G,username:w.target.value})),placeholder:"postgres"})]}),f.jsxs("div",{children:[f.jsxs("label",{className:S,children:["Password ",o&&f.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),f.jsx("input",{className:O,type:"password",value:l.password,onChange:w=>d(G=>({...G,password:w.target.value})),placeholder:o?"unchanged":"••••••••"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]})]})]}),f.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(E0,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),f.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mb-3",children:"Defina quais operações Trinity pode executar neste banco. Operações não permitidas retornarão erro de permissão."}),f.jsx("div",{className:"space-y-2",children:cF[l.type]?.map(({key:w,label:G,description:de})=>f.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[f.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[f.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>he(w),className:"sr-only"}),f.jsx("div",{className:`w-4 h-4 rounded border transition-colors flex items-center justify-center ${l[w]?"bg-azure-primary dark:bg-matrix-highlight border-azure-primary dark:border-matrix-highlight":"border-azure-border dark:border-matrix-primary bg-transparent"}`,children:l[w]&&f.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:f.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:G}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:de})]})]},w))})]}),g&&f.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),f.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 text-sm text-azure-text-secondary dark:text-matrix-secondary border border-azure-border dark:border-matrix-primary rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:se,disabled:h||!l.name,className:"px-4 py-2 text-sm font-medium bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors disabled:opacity-50",children:h?"Saving...":o?"Update":"Register"})]})]})]})]})}function hF(){return f.jsx(WE,{children:f.jsxs(b0,{children:[f.jsx(ln,{path:"/login",element:f.jsx(RH,{})}),f.jsx(ln,{path:"/*",element:f.jsx(MH,{children:f.jsx(rD,{children:f.jsxs(b0,{children:[f.jsx(ln,{path:"/",element:f.jsx(oD,{})}),f.jsx(ln,{path:"/chat",element:f.jsx(NL,{})}),f.jsx(ln,{path:"/zaion",element:f.jsx(NH,{})}),f.jsx(ln,{path:"/logs",element:f.jsx(AH,{})}),f.jsx(ln,{path:"/stats",element:f.jsx(OH,{})}),f.jsx(ln,{path:"/sati-memories",element:f.jsx(HH,{})}),f.jsx(ln,{path:"/mcp-servers",element:f.jsx(KH,{})}),f.jsx(ln,{path:"/model-pricing",element:f.jsx(WH,{})}),f.jsx(ln,{path:"/webhooks",element:f.jsx(nF,{})}),f.jsx(ln,{path:"/notifications",element:f.jsx(iF,{})}),f.jsx(ln,{path:"/tasks",element:f.jsx(uF,{})}),f.jsx(ln,{path:"/trinity-databases",element:f.jsx(fF,{})}),f.jsx(ln,{path:"*",element:f.jsx(tS,{to:"/",replace:!0})})]})})})})]})})}RC.createRoot(document.getElementById("root")).render(f.jsx(j.StrictMode,{children:f.jsx(hF,{})}));
112
+ -d '{"event":"your_payload"}'`,Q=async(te,oe)=>{await navigator.clipboard.writeText(te),T(oe),setTimeout(()=>T(null),2e3)},se=te=>{const oe=l.notification_channels.includes(te);d({...l,notification_channels:oe?l.notification_channels.filter(ae=>ae!==te):[...l.notification_channels,te]})};return f.jsxs(ot.div,{variants:nF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:$w,className:"flex items-center justify-between flex-wrap gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Fm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Webhooks"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs(_r,{to:"/notifications",className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[f.jsx(vl,{className:"w-4 h-4"}),"Notifications"]}),f.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(Qp,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&f.jsx(ot.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),f.jsx(ot.div,{variants:$w,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(te=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:te},te))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{children:f.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",f.jsx("button",{onClick:C,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(te=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[f.jsx("td",{className:"px-4 py-3",children:f.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:te.name})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[te.api_key.slice(0,16),"…"]}),f.jsx("button",{onClick:()=>Q(ce(te),`curl-${te.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy curl example",children:z===`curl-${te.id}`?f.jsx(Bm,{className:"w-3.5 h-3.5 text-green-500"}):f.jsx(Hm,{className:"w-3.5 h-3.5"})}),f.jsx("button",{onClick:()=>Q(te.api_key,`key-${te.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy API key",children:z===`key-${te.id}`?f.jsx(Bm,{className:"w-3.5 h-3.5 text-green-500"}):f.jsx(ZN,{className:"w-3.5 h-3.5"})})]})}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("div",{className:"flex gap-1 flex-wrap",children:te.notification_channels.map(oe=>f.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-azure-border dark:bg-matrix-primary/20 text-azure-text-secondary dark:text-matrix-secondary capitalize",children:oe},oe))})}),f.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:te.trigger_count}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>q(te),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${te.enabled?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:te.enabled?f.jsxs(f.Fragment,{children:[f.jsx(EA,{className:"w-3.5 h-3.5"})," Enabled"]}):f.jsxs(f.Fragment,{children:[f.jsx(TA,{className:"w-3.5 h-3.5"})," Disabled"]})})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:()=>$(te),title:"Edit",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(Jp,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>m(te),title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",children:f.jsx(Bo,{className:"w-4 h-4"})})]})})]},te.id))})]})})}),f.jsxs(Nr,{open:n,onOpenChange:a,children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-text-primary dark:text-matrix-highlight",children:o?"Edit Webhook":"New Webhook"})}),f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",f.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),f.jsx("input",{type:"text",value:l.name,onChange:te=>{d({...l,name:te.target.value.toLowerCase().replace(/\s+/g,"-")}),N(null)},placeholder:"e.g. deploy-done, github-issue-opened",disabled:!!o,className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight disabled:opacity-50 disabled:cursor-not-allowed"}),l.name&&f.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",f.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),f.jsx("textarea",{rows:5,value:l.prompt,onChange:te=>d({...l,prompt:te.target.value}),placeholder:"Describe what Apoc should do when this webhook fires. The received payload will be appended automatically.",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight resize-none"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),f.jsx("div",{className:"flex gap-4",children:rF.map(te=>f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(te),onChange:()=>se(te),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),f.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:te})]},te))})]}),E&&f.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded px-3 py-2",children:E}),f.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:M,disabled:b||!l.name.trim()||!l.prompt.trim()||l.notification_channels.length===0,className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving…":o?"Update":"Create"})]})]})]}),f.jsxs(Nr,{open:!!h,onOpenChange:te=>!te&&m(null),children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),f.jsxs("div",{className:"p-6 space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",f.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:V,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},iF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Pw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},Uw=({status:e})=>e==="completed"?f.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[f.jsx(cS,{className:"w-4 h-4"}),f.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?f.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[f.jsx(Zm,{className:"w-4 h-4"}),f.jsx("span",{className:"text-xs",children:"Failed"})]}):f.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[f.jsx(ad,{className:"w-4 h-4 animate-pulse"}),f.jsx("span",{className:"text-xs",children:"Pending"})]}),_c=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),oF=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},sF=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),{data:o=[],mutate:u}=Qt(["/webhooks/notifications",e],()=>La.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=o.filter(g=>!g.read).length,d=async g=>{g.length!==0&&(await La.markRead(g),await u())},h=()=>{const g=o.filter(x=>!x.read).map(x=>x.id);d(g)},m=async g=>{a(g),g.read||await d([g.id])};return f.jsxs(ot.div,{variants:iF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:Pw,className:"flex items-center justify-between flex-wrap gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("div",{className:"relative",children:[f.jsx(vl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),l>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[10px] font-bold rounded-full w-4 h-4 flex items-center justify-center leading-none",children:l>9?"9+":l})]}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Notifications"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs(_r,{to:"/webhooks",className:"flex items-center gap-2 text-sm text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:[f.jsx(bN,{className:"w-4 h-4"}),"Back to Webhooks"]}),f.jsxs("button",{onClick:()=>t(!e),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm transition-colors ${e?"border-azure-primary dark:border-matrix-highlight bg-azure-active dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800"}`,children:[f.jsx(KN,{className:"w-4 h-4"}),"Unread only"]}),l>0&&f.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[f.jsx(ON,{className:"w-4 h-4"}),"Mark all read"]})]})]}),f.jsx(ot.div,{variants:Pw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),f.jsx("tbody",{children:o.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:e?"No unread notifications.":"No notifications yet."})}):o.map(g=>f.jsxs("tr",{className:`border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors ${g.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[f.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&f.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),f.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(Uw,{status:g.status})}),f.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:_c(g.created_at)}),f.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?_c(g.completed_at):"—"}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>m(g),title:"View details",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(id,{className:"w-4 h-4"})})})]},g.id))})]})})}),f.jsxs(Nr,{open:!!n,onOpenChange:g=>!g&&a(null),children:[f.jsx(Ar,{children:f.jsxs(Or,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(vl,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[f.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[f.jsx(Uw,{status:n.status}),f.jsx("span",{children:_c(n.created_at)}),n.completed_at&&f.jsxs("span",{children:["→ ",_c(n.completed_at)]})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),f.jsx("pre",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-44 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:oF(n.payload)})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),f.jsx("div",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-64 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:n.result??f.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),f.jsx("div",{className:"flex justify-end pt-2",children:f.jsx("button",{onClick:()=>a(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Close"})})]})]})]})},lF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},jc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},uF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function cF({status:e}){return e==="completed"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[f.jsx(cS,{className:"w-4 h-4"}),"Completed"]}):e==="failed"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600 dark:text-red-400",children:[f.jsx(Zm,{className:"w-4 h-4"}),"Failed"]}):e==="running"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[f.jsx(aA,{className:"w-4 h-4 animate-spin"}),"Running"]}):e==="cancelled"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[f.jsx(Zm,{className:"w-4 h-4"}),"Cancelled"]}):f.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[f.jsx(ad,{className:"w-4 h-4"}),"Pending"]})}const Vw=e=>e?new Date(e).toLocaleString():"—";function dF(){const[e,t]=j.useState(""),[n,a]=j.useState(""),[o,u]=j.useState(""),[l,d]=j.useState(""),[h,m]=j.useState(null),g=j.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:o||void 0,session_id:l.trim()||void 0,limit:200}),[e,n,o,l]),{data:x}=Qt("/tasks/stats",()=>zo.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=Qt(["/tasks",g],()=>zo.list(g),{refreshInterval:3e3});return f.jsxs(ot.div,{variants:lF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ot.div,{variants:jc,className:"flex items-center gap-3",children:[f.jsx(Im,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Tasks"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),f.jsxs(ot.div,{variants:jc,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[f.jsx(So,{label:"Pending",value:x?.pending??0}),f.jsx(So,{label:"Running",value:x?.running??0}),f.jsx(So,{label:"Completed",value:x?.completed??0}),f.jsx(So,{label:"Failed",value:x?.failed??0}),f.jsx(So,{label:"Cancelled",value:x?.cancelled??0}),f.jsx(So,{label:"Total",value:x?.total??0})]}),f.jsxs(ot.div,{variants:jc,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-azure-surface dark:bg-zinc-950 grid grid-cols-1 md:grid-cols-4 gap-3",children:[f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:e,onChange:z=>t(z.target.value||""),children:[f.jsx("option",{value:"",children:"All status"}),Object.entries(uF).map(([z,T])=>f.jsx("option",{value:z,children:T},z))]}),f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:n,onChange:z=>a(z.target.value||""),children:[f.jsx("option",{value:"",children:"All agents"}),f.jsx("option",{value:"apoc",children:"Apoc"}),f.jsx("option",{value:"neo",children:"Neo"})]}),f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:o,onChange:z=>u(z.target.value||""),children:[f.jsx("option",{value:"",children:"All channels"}),f.jsx("option",{value:"telegram",children:"Telegram"}),f.jsx("option",{value:"ui",children:"UI"}),f.jsx("option",{value:"api",children:"API"}),f.jsx("option",{value:"webhook",children:"Webhook"}),f.jsx("option",{value:"cli",children:"CLI"})]}),f.jsx("input",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:l,onChange:z=>d(z.target.value),placeholder:"Filter by session id"})]}),f.jsx(ot.div,{variants:jc,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Task ID","Status","Agent","Channel","Session","Attempts","Created","Finished","Actions"].map(z=>f.jsx("th",{className:"text-left px-4 py-3 font-semibold text-azure-text-secondary dark:text-matrix-dim",children:z},z))})}),f.jsx("tbody",{children:b.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:9,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:"No tasks found."})}):b.map(z=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-900/40 transition-colors",children:[f.jsx("td",{className:"px-4 py-3 font-mono",children:z.id.slice(0,8)}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(cF,{status:z.status})}),f.jsx("td",{className:"px-4 py-3",children:z.agent.toUpperCase()}),f.jsx("td",{className:"px-4 py-3",children:z.origin_channel.toUpperCase()}),f.jsx("td",{className:"px-4 py-3 font-mono",children:z.session_id}),f.jsxs("td",{className:"px-4 py-3",children:[z.attempt_count,"/",z.max_attempts]}),f.jsx("td",{className:"px-4 py-3",children:Vw(z.created_at)}),f.jsx("td",{className:"px-4 py-3",children:Vw(z.finished_at)}),f.jsxs("td",{className:"px-4 py-3 flex items-center gap-1",children:[f.jsx("button",{onClick:()=>m(z),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim",children:f.jsx(id,{className:"w-4 h-4"})}),(z.status==="pending"||z.status==="running")&&f.jsx("button",{onClick:async()=>{await zo.cancel(z.id),await v()},title:"Cancel task",className:"p-1.5 rounded hover:bg-red-100 dark:hover:bg-red-900/30 text-red-500 dark:text-red-400",children:f.jsx(wN,{className:"w-4 h-4"})})]})]},z.id))})]})}),f.jsxs(Nr,{open:!!h,onOpenChange:z=>!z&&m(null),children:[f.jsx(Ar,{children:f.jsx(Or,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Task Details"})}),h&&f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[70vh] text-sm",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-azure-text-secondary dark:text-matrix-dim",children:[f.jsxs("div",{children:[f.jsx("b",{children:"ID:"})," ",f.jsx("span",{className:"font-mono",children:h.id})]}),f.jsxs("div",{children:[f.jsx("b",{children:"Status:"})," ",h.status]}),f.jsxs("div",{children:[f.jsx("b",{children:"Agent:"})," ",h.agent]}),f.jsxs("div",{children:[f.jsx("b",{children:"Origin:"})," ",h.origin_channel]}),f.jsxs("div",{children:[f.jsx("b",{children:"Session:"})," ",f.jsx("span",{className:"font-mono",children:h.session_id})]}),f.jsxs("div",{children:[f.jsx("b",{children:"Attempts:"})," ",h.attempt_count,"/",h.max_attempts]})]}),f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1",children:"Input"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.input})]}),h.output&&f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1",children:"Output"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.output})]}),h.error&&f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1 text-red-600 dark:text-red-400",children:"Error"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-red-200 dark:border-red-900/50 p-3 bg-red-50 dark:bg-red-950/40",children:h.error})]}),(h.status==="failed"||h.status==="pending"||h.status==="running")&&f.jsxs("div",{className:"flex justify-end gap-2",children:[(h.status==="pending"||h.status==="running")&&f.jsx("button",{onClick:async()=>{await zo.cancel(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg border border-red-400 dark:border-red-500 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 text-sm",children:"Cancel Task"}),h.status==="failed"&&f.jsx("button",{onClick:async()=>{await zo.retry(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black text-sm",children:"Retry Task"})]})]})]})]})}function So({label:e,value:t}){return f.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950 px-4 py-3",children:[f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:e}),f.jsx("p",{className:"text-xl font-semibold text-azure-text-primary dark:text-matrix-highlight",children:t})]})}const Lm={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},Bw={name:"",type:"postgresql",host:"",port:"",database_name:"",username:"",password:"",connection_string:"",allow_read:!0,allow_insert:!1,allow_update:!1,allow_delete:!1,allow_ddl:!1},fF={postgresql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mysql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],sqlite:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mongodb:[{key:"allow_read",label:"find / aggregate",description:"Permite consultas e agregações"},{key:"allow_insert",label:"insertOne / insertMany",description:"Permite inserir documentos"},{key:"allow_update",label:"updateOne / updateMany",description:"Permite atualizar documentos"},{key:"allow_delete",label:"deleteOne / deleteMany",description:"Permite excluir documentos"},{key:"allow_ddl",label:"Schema changes",description:"createCollection / dropCollection / createIndex"}]};async function hF(){return ze.get("/trinity/databases")}function mF(){const{data:e,error:t}=Qt("/trinity/databases",hF,{refreshInterval:3e4}),[n,a]=j.useState(!1),[o,u]=j.useState(null),[l,d]=j.useState(Bw),[h,m]=j.useState(!1),[g,x]=j.useState(null),[b,v]=j.useState({}),[z,T]=j.useState(null),[E,N]=j.useState({}),[A,C]=j.useState(null),[$,L]=j.useState(null),[M,q]=j.useState(null),[V,X]=j.useState(!1),ce=()=>{u(null),d(Bw),X(!1),x(null),a(!0)},Q=w=>{u(w),d({name:w.name,type:w.type,host:w.host||"",port:w.port?String(w.port):"",database_name:w.database_name||"",username:w.username||"",password:"",connection_string:"",allow_read:w.allow_read,allow_insert:w.allow_insert,allow_update:w.allow_update,allow_delete:w.allow_delete,allow_ddl:w.allow_ddl}),X(!!w.connection_string),x(null),a(!0)},se=async()=>{if(m(!0),x(null),!V&&!l.database_name.trim()){x(l.type==="sqlite"?"File path is required.":"Database name is required."),m(!1);return}try{const w={name:l.name,type:l.type,allow_read:l.allow_read,allow_insert:l.allow_insert,allow_update:l.allow_update,allow_delete:l.allow_delete,allow_ddl:l.allow_ddl};V?(!o||l.connection_string)&&(w.connection_string=l.connection_string||null):(w.host=l.host||null,w.port=l.port?parseInt(l.port):null,w.database_name=l.database_name||null,w.username=l.username||null,(!o||l.password)&&(w.password=l.password||null)),o?await ze.put(`/trinity/databases/${o.id}`,w):await ze.post("/trinity/databases",w),await na("/trinity/databases"),a(!1)}catch(w){x(w.message||"Failed to save database")}finally{m(!1)}},te=w=>{q(w)},oe=async()=>{if(!M)return;const w=M.id;L(w);try{await ze.delete(`/trinity/databases/${w}`),await na("/trinity/databases")}catch(G){alert(`Delete failed: ${G.message}`)}finally{L(null),q(null)}},ae=async w=>{T(w);try{const G=await ze.post(`/trinity/databases/${w}/test`,{});N(de=>({...de,[w]:G.success}))}catch{N(G=>({...G,[w]:!1}))}finally{T(null)}},U=async w=>{C(w);try{await ze.post(`/trinity/databases/${w}/refresh-schema`,{}),await na("/trinity/databases")}catch(G){alert(`Schema refresh failed: ${G.message}`)}finally{C(null)}},K=w=>{v(G=>({...G,[w]:!G[w]}))},B=w=>{w!=="mongodb"&&X(!1),d(G=>({...G,type:w,port:Lm[w]?String(Lm[w]):""}))},he=w=>{d(G=>({...G,[w]:!G[w]}))};if(t)return f.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const O="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",S="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",H=w=>[{key:"allow_read",badge:"R"},{key:"allow_insert",badge:"I"},{key:"allow_update",badge:"U"},{key:"allow_delete",badge:"D"},{key:"allow_ddl",badge:"DDL"}].filter(de=>w[de.key]).map(de=>de.badge);return f.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ro,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Trinity Databases"})]}),f.jsxs("button",{onClick:ce,className:"flex items-center gap-2 px-4 py-2 bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors text-sm font-medium",children:[f.jsx(Qp,{className:"w-4 h-4"}),"Register Database"]})]}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Register databases for Trinity to access. Configure permissions to control what operations Trinity can perform on each database."}),e?e.length===0?f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded p-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx(Ro,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),f.jsx("p",{className:"font-medium",children:"No databases registered"}),f.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):f.jsx("div",{className:"space-y-4",children:e.map(w=>{const G=w.schema_json?JSON.parse(w.schema_json):null,de=!!G?.databases,fe=de?G.databases.reduce((st,wt)=>st+wt.tables.length,0):G?.tables?.length??0,me=de?G.databases.length:0,De=w.type==="mongodb"?"collection":"table",Ne=w.type==="mongodb"?"collections":"tables",kt=E[w.id],It=b[w.id],fn=H(w);return f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[f.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[f.jsx(Ro,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),f.jsx("span",{className:"text-xs px-2 py-0.5 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary uppercase flex-shrink-0",children:w.type}),kt===!0&&f.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[f.jsx(Ih,{className:"w-3 h-3"})," Connected"]}),kt===!1&&f.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[f.jsx(LA,{className:"w-3 h-3"})," Failed"]}),fn.length>0&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(E0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),fn.map(st=>f.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight font-mono",children:st},st))]})]}),f.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary truncate mt-0.5",children:[w.host?`${w.host}:${w.port}${w.database_name?`/${w.database_name}`:""}`:w.database_name||"connection string configured",de&&me>0&&f.jsxs("span",{className:"ml-2 opacity-70",children:["· ",me," database",me!==1?"s":""," · ",fe," ",fe!==1?Ne:De]}),!de&&fe>0&&f.jsxs("span",{className:"ml-2 opacity-70",children:["· ",fe," ",fe!==1?Ne:De]}),w.schema_updated_at&&f.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[f.jsx("button",{onClick:()=>ae(w.id),disabled:z===w.id,title:"Test connection",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:z===w.id?f.jsx(Ih,{className:"w-4 h-4 animate-pulse"}):f.jsx(Ih,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>U(w.id),disabled:A===w.id,title:"Refresh schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:f.jsx(hS,{className:`w-4 h-4 ${A===w.id?"animate-spin":""}`})}),f.jsx("button",{onClick:()=>Q(w),title:"Edit",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors text-xs font-medium px-2",children:"Edit"}),f.jsx("button",{onClick:()=>te(w),disabled:$===w.id,title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-red-500 transition-colors",children:f.jsx(Bo,{className:"w-4 h-4"})}),G&&f.jsx("button",{onClick:()=>K(w.id),title:It?"Hide schema":"Show schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:It?f.jsx(DN,{className:"w-4 h-4"}):f.jsx(LN,{className:"w-4 h-4"})})]})]}),It&&G&&f.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[f.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:de?`${me} database${me!==1?"s":""} — ${fe} ${fe!==1?Ne:De} total`:`Schema — ${fe} ${fe!==1?Ne:De}`}),f.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:de?G.databases?.map(st=>f.jsxs("div",{className:"text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[f.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:st.name}),f.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",st.tables.length," ",st.tables.length!==1?Ne:De,")"]})]}),f.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[st.tables.map(wt=>f.jsxs("div",{children:[f.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:wt.name}),f.jsx("div",{className:"pl-3 space-y-0.5",children:wt.columns?.map(Fn=>f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[f.jsx("span",{children:Fn.name}),f.jsx("span",{className:"opacity-50 ml-2",children:Fn.type}),Fn.nullable===!1&&f.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},Fn.name))})]},wt.name)),st.tables.length===0&&f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ne]})]})]},st.name)):G.tables?.map(st=>f.jsxs("div",{className:"text-xs",children:[f.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:st.name}),f.jsx("div",{className:"pl-3 space-y-0.5",children:st.columns?.map(wt=>f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[f.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:wt.name}),f.jsx("span",{className:"opacity-50 ml-2",children:wt.type}),wt.nullable===!1&&f.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},wt.name))})]},st.name))})]})]},w.id)})}):f.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),f.jsx(H_,{isOpen:!!M,onClose:()=>q(null),onConfirm:oe,title:"Delete database",description:`Remove "${M?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),f.jsxs("div",{className:"relative bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[90vh] overflow-y-auto",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[f.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:o?"Edit Database":"Register Database"}),f.jsx("button",{onClick:()=>a(!1),className:"text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:f.jsx(pS,{className:"w-5 h-5"})})]}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Name *"}),f.jsx("input",{className:O,value:l.name,onChange:w=>d(G=>({...G,name:w.target.value})),placeholder:"My Production DB"})]}),f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Type *"}),f.jsxs("select",{className:O,value:l.type,onChange:w=>B(w.target.value),children:[f.jsx("option",{value:"postgresql",children:"PostgreSQL"}),f.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),f.jsx("option",{value:"sqlite",children:"SQLite"}),f.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{type:"button",onClick:()=>X(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${V?"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary":"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight"}`,children:"Individual fields"}),f.jsx("button",{type:"button",onClick:()=>X(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${V?"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary"}`,children:"Connection string"})]}),l.type==="mongodb"&&V?f.jsxs("div",{children:[f.jsxs("label",{className:S,children:["Connection String ",o&&f.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),f.jsx("input",{className:O,type:"password",value:l.connection_string,onChange:w=>d(G=>({...G,connection_string:w.target.value})),placeholder:o?"unchanged":"mongodb://user:pass@host:27017/dbname"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]}):f.jsxs(f.Fragment,{children:[l.type!=="sqlite"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Host"}),f.jsx("input",{className:O,value:l.host,onChange:w=>d(G=>({...G,host:w.target.value})),placeholder:"localhost"})]}),f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Port"}),f.jsx("input",{className:O,type:"number",value:l.port,onChange:w=>d(G=>({...G,port:w.target.value})),placeholder:String(Lm[l.type]||"")})]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:S,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),f.jsx("input",{className:`w-full px-3 py-2 bg-azure-surface dark:bg-black border rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none ${g&&!l.database_name.trim()?"border-red-500 dark:border-red-500":"border-azure-border dark:border-matrix-primary focus:border-azure-primary dark:focus:border-matrix-highlight"}`,value:l.database_name,onChange:w=>d(G=>({...G,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx("label",{className:S,children:"Username"}),f.jsx("input",{className:O,value:l.username,onChange:w=>d(G=>({...G,username:w.target.value})),placeholder:"postgres"})]}),f.jsxs("div",{children:[f.jsxs("label",{className:S,children:["Password ",o&&f.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),f.jsx("input",{className:O,type:"password",value:l.password,onChange:w=>d(G=>({...G,password:w.target.value})),placeholder:o?"unchanged":"••••••••"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]})]})]}),f.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(E0,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),f.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mb-3",children:"Defina quais operações Trinity pode executar neste banco. Operações não permitidas retornarão erro de permissão."}),f.jsx("div",{className:"space-y-2",children:fF[l.type]?.map(({key:w,label:G,description:de})=>f.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[f.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[f.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>he(w),className:"sr-only"}),f.jsx("div",{className:`w-4 h-4 rounded border transition-colors flex items-center justify-center ${l[w]?"bg-azure-primary dark:bg-matrix-highlight border-azure-primary dark:border-matrix-highlight":"border-azure-border dark:border-matrix-primary bg-transparent"}`,children:l[w]&&f.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:f.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:G}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:de})]})]},w))})]}),g&&f.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),f.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 text-sm text-azure-text-secondary dark:text-matrix-secondary border border-azure-border dark:border-matrix-primary rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:se,disabled:h||!l.name,className:"px-4 py-2 text-sm font-medium bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors disabled:opacity-50",children:h?"Saving...":o?"Update":"Register"})]})]})]})]})}function pF(){return f.jsx(WE,{children:f.jsxs(b0,{children:[f.jsx(ln,{path:"/login",element:f.jsx(DH,{})}),f.jsx(ln,{path:"/*",element:f.jsx($H,{children:f.jsx(iD,{children:f.jsxs(b0,{children:[f.jsx(ln,{path:"/",element:f.jsx(lD,{})}),f.jsx(ln,{path:"/chat",element:f.jsx(OL,{})}),f.jsx(ln,{path:"/zaion",element:f.jsx(OH,{})}),f.jsx(ln,{path:"/logs",element:f.jsx(RH,{})}),f.jsx(ln,{path:"/stats",element:f.jsx(MH,{})}),f.jsx(ln,{path:"/sati-memories",element:f.jsx(qH,{})}),f.jsx(ln,{path:"/mcp-servers",element:f.jsx(QH,{})}),f.jsx(ln,{path:"/model-pricing",element:f.jsx(tF,{})}),f.jsx(ln,{path:"/webhooks",element:f.jsx(aF,{})}),f.jsx(ln,{path:"/notifications",element:f.jsx(sF,{})}),f.jsx(ln,{path:"/tasks",element:f.jsx(dF,{})}),f.jsx(ln,{path:"/trinity-databases",element:f.jsx(mF,{})}),f.jsx(ln,{path:"*",element:f.jsx(tS,{to:"/",replace:!0})})]})})})})]})})}RC.createRoot(document.getElementById("root")).render(f.jsx(j.StrictMode,{children:f.jsx(pF,{})}));