morpheus-cli 0.7.7 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -5
- package/dist/cli/commands/smiths.js +110 -0
- package/dist/cli/commands/start.js +20 -0
- package/dist/cli/index.js +2 -0
- package/dist/config/manager.js +22 -0
- package/dist/config/schemas.js +16 -0
- package/dist/http/api.js +3 -0
- package/dist/http/routers/smiths.js +188 -0
- package/dist/runtime/display.js +3 -0
- package/dist/runtime/oracle.js +16 -3
- package/dist/runtime/smiths/connection.js +302 -0
- package/dist/runtime/smiths/delegator.js +214 -0
- package/dist/runtime/smiths/index.js +4 -0
- package/dist/runtime/smiths/registry.js +276 -0
- package/dist/runtime/smiths/types.js +6 -0
- package/dist/runtime/tasks/worker.js +18 -0
- package/dist/runtime/tools/index.js +1 -0
- package/dist/runtime/tools/morpheus-tools.js +122 -0
- package/dist/runtime/tools/smith-tool.js +147 -0
- package/dist/types/config.js +8 -0
- package/dist/ui/assets/index-C8uUR62u.css +1 -0
- package/dist/ui/assets/index-mIH_kbig.js +117 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/sw.js +1 -1
- package/package.json +3 -1
- package/dist/ui/assets/index-B6deYCij.css +0 -1
- package/dist/ui/assets/index-BTQ0jjvm.js +0 -117
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)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(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zh={exports:{}},sl={};var m0;function UC(){if(m0)return sl;m0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,u){var l=null;if(u!==void 0&&(l=""+u),s.key!==void 0&&(l=""+s.key),"key"in s){u={};for(var f in s)f!=="key"&&(u[f]=s[f])}else u=s;return s=u.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:u}}return sl.Fragment=t,sl.jsx=n,sl.jsxs=n,sl}var p0;function VC(){return p0||(p0=1,Zh.exports=UC()),Zh.exports}var d=VC(),Ih={exports:{}},Re={};var g0;function BC(){if(g0)return Re;g0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,T={};function E(_,U,w){this.props=_,this.context=U,this.refs=T,this.updater=w||S}E.prototype.isReactComponent={},E.prototype.setState=function(_,U){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,U,"setState")},E.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function O(){}O.prototype=E.prototype;function C(_,U,w){this.props=_,this.context=U,this.refs=T,this.updater=w||S}var P=C.prototype=new O;P.constructor=C,N(P,E.prototype),P.isPureReactComponent=!0;var M=Array.isArray;function R(){}var I={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function Y(_,U,w){var G=w.ref;return{$$typeof:e,type:_,key:U,ref:G!==void 0?G:null,props:w}}function fe(_,U){return Y(_.type,U,_.props)}function se(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function le(_){var U={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(w){return U[w]})}var ee=/\/+/g;function oe(_,U){return typeof _=="object"&&_!==null&&_.key!=null?le(""+_.key):U.toString(36)}function ae(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(R,R):(_.status="pending",_.then(function(U){_.status==="pending"&&(_.status="fulfilled",_.value=U)},function(U){_.status==="pending"&&(_.status="rejected",_.reason=U)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function V(_,U,w,G,de){var he=typeof _;(he==="undefined"||he==="boolean")&&(_=null);var me=!1;if(_===null)me=!0;else switch(he){case"bigint":case"string":case"number":me=!0;break;case"object":switch(_.$$typeof){case e:case t:me=!0;break;case g:return me=_._init,V(me(_._payload),U,w,G,de)}}if(me)return de=de(_),me=G===""?"."+oe(_,0):G,M(de)?(w="",me!=null&&(w=me.replace(ee,"$&/")+"/"),V(de,U,w,"",function(pt){return pt})):de!=null&&(se(de)&&(de=fe(de,w+(de.key==null||_&&_.key===de.key?"":(""+de.key).replace(ee,"$&/")+"/")+me)),U.push(de)),1;me=0;var Pe=G===""?".":G+":";if(M(_))for(var Ae=0;Ae<_.length;Ae++)G=_[Ae],he=Pe+oe(G,Ae),me+=V(G,U,w,he,de);else if(Ae=b(_),typeof Ae=="function")for(_=Ae.call(_),Ae=0;!(G=_.next()).done;)G=G.value,he=Pe+oe(G,Ae++),me+=V(G,U,w,he,de);else if(he==="object"){if(typeof _.then=="function")return V(ae(_),U,w,G,de);throw U=String(_),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return me}function J(_,U,w){if(_==null)return _;var G=[],de=0;return V(_,G,"","",function(he){return U.call(w,he,de++)}),G}function K(_){if(_._status===-1){var U=_._result;U=U(),U.then(function(w){(_._status===0||_._status===-1)&&(_._status=1,_._result=w)},function(w){(_._status===0||_._status===-1)&&(_._status=2,_._result=w)}),_._status===-1&&(_._status=0,_._result=U)}if(_._status===1)return _._result.default;throw _._result}var ye=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},A={map:J,forEach:function(_,U,w){J(_,function(){U.apply(this,arguments)},w)},count:function(_){var U=0;return J(_,function(){U++}),U},toArray:function(_){return J(_,function(U){return U})||[]},only:function(_){if(!se(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Re.Activity=y,Re.Children=A,Re.Component=E,Re.Fragment=n,Re.Profiler=s,Re.PureComponent=C,Re.StrictMode=a,Re.Suspense=h,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Re.__COMPILER_RUNTIME={__proto__:null,c:function(_){return I.H.useMemoCache(_)}},Re.cache=function(_){return function(){return _.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(_,U,w){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var G=N({},_.props),de=_.key;if(U!=null)for(he in U.key!==void 0&&(de=""+U.key),U)!B.call(U,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&U.ref===void 0||(G[he]=U[he]);var he=arguments.length-2;if(he===1)G.children=w;else if(1<he){for(var me=Array(he),Pe=0;Pe<he;Pe++)me[Pe]=arguments[Pe+2];G.children=me}return Y(_.type,de,G)},Re.createContext=function(_){return _={$$typeof:l,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},Re.createElement=function(_,U,w){var G,de={},he=null;if(U!=null)for(G in U.key!==void 0&&(he=""+U.key),U)B.call(U,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(de[G]=U[G]);var me=arguments.length-2;if(me===1)de.children=w;else if(1<me){for(var Pe=Array(me),Ae=0;Ae<me;Ae++)Pe[Ae]=arguments[Ae+2];de.children=Pe}if(_&&_.defaultProps)for(G in me=_.defaultProps,me)de[G]===void 0&&(de[G]=me[G]);return Y(_,he,de)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(_){return{$$typeof:f,render:_}},Re.isValidElement=se,Re.lazy=function(_){return{$$typeof:g,_payload:{_status:-1,_result:_},_init:K}},Re.memo=function(_,U){return{$$typeof:m,type:_,compare:U===void 0?null:U}},Re.startTransition=function(_){var U=I.T,w={};I.T=w;try{var G=_(),de=I.S;de!==null&&de(w,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(R,ye)}catch(he){ye(he)}finally{U!==null&&w.types!==null&&(U.types=w.types),I.T=U}},Re.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Re.use=function(_){return I.H.use(_)},Re.useActionState=function(_,U,w){return I.H.useActionState(_,U,w)},Re.useCallback=function(_,U){return I.H.useCallback(_,U)},Re.useContext=function(_){return I.H.useContext(_)},Re.useDebugValue=function(){},Re.useDeferredValue=function(_,U){return I.H.useDeferredValue(_,U)},Re.useEffect=function(_,U){return I.H.useEffect(_,U)},Re.useEffectEvent=function(_){return I.H.useEffectEvent(_)},Re.useId=function(){return I.H.useId()},Re.useImperativeHandle=function(_,U,w){return I.H.useImperativeHandle(_,U,w)},Re.useInsertionEffect=function(_,U){return I.H.useInsertionEffect(_,U)},Re.useLayoutEffect=function(_,U){return I.H.useLayoutEffect(_,U)},Re.useMemo=function(_,U){return I.H.useMemo(_,U)},Re.useOptimistic=function(_,U){return I.H.useOptimistic(_,U)},Re.useReducer=function(_,U,w){return I.H.useReducer(_,U,w)},Re.useRef=function(_){return I.H.useRef(_)},Re.useState=function(_){return I.H.useState(_)},Re.useSyncExternalStore=function(_,U,w){return I.H.useSyncExternalStore(_,U,w)},Re.useTransition=function(){return I.H.useTransition()},Re.version="19.2.4",Re}var x0;function dd(){return x0||(x0=1,Ih.exports=BC()),Ih.exports}var z=dd();const Xp=Kp(z);var Hh={exports:{}},ol={},Fh={exports:{}},qh={};var y0;function ZC(){return y0||(y0=1,(function(e){function t(V,J){var K=V.length;V.push(J);e:for(;0<K;){var ye=K-1>>>1,A=V[ye];if(0<s(A,J))V[ye]=J,V[K]=A,K=ye;else break e}}function n(V){return V.length===0?null:V[0]}function a(V){if(V.length===0)return null;var J=V[0],K=V.pop();if(K!==J){V[0]=K;e:for(var ye=0,A=V.length,_=A>>>1;ye<_;){var U=2*(ye+1)-1,w=V[U],G=U+1,de=V[G];if(0>s(w,K))G<A&&0>s(de,w)?(V[ye]=de,V[G]=K,ye=G):(V[ye]=w,V[U]=K,ye=U);else if(G<A&&0>s(de,K))V[ye]=de,V[G]=K,ye=G;else break e}}return J}function s(V,J){var K=V.sortIndex-J.sortIndex;return K!==0?K:V.id-J.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,f=l.now();e.unstable_now=function(){return l.now()-f}}var h=[],m=[],g=1,y=null,v=3,b=!1,S=!1,N=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function P(V){for(var J=n(m);J!==null;){if(J.callback===null)a(m);else if(J.startTime<=V)a(m),J.sortIndex=J.expirationTime,t(h,J);else break;J=n(m)}}function M(V){if(N=!1,P(V),!S)if(n(h)!==null)S=!0,R||(R=!0,le());else{var J=n(m);J!==null&&ae(M,J.startTime-V)}}var R=!1,I=-1,B=5,Y=-1;function fe(){return T?!0:!(e.unstable_now()-Y<B)}function se(){if(T=!1,R){var V=e.unstable_now();Y=V;var J=!0;try{e:{S=!1,N&&(N=!1,O(I),I=-1),b=!0;var K=v;try{t:{for(P(V),y=n(h);y!==null&&!(y.expirationTime>V&&fe());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,v=y.priorityLevel;var A=ye(y.expirationTime<=V);if(V=e.unstable_now(),typeof A=="function"){y.callback=A,P(V),J=!0;break t}y===n(h)&&a(h),P(V)}else a(h);y=n(h)}if(y!==null)J=!0;else{var _=n(m);_!==null&&ae(M,_.startTime-V),J=!1}}break e}finally{y=null,v=K,b=!1}J=void 0}}finally{J?le():R=!1}}}var le;if(typeof C=="function")le=function(){C(se)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,oe=ee.port2;ee.port1.onmessage=se,le=function(){oe.postMessage(null)}}else le=function(){E(se,0)};function ae(V,J){I=E(function(){V(e.unstable_now())},J)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(V){switch(v){case 1:case 2:case 3:var J=3;break;default:J=v}var K=v;v=J;try{return V()}finally{v=K}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(V,J){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var K=v;v=V;try{return J()}finally{v=K}},e.unstable_scheduleCallback=function(V,J,K){var ye=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?ye+K:ye):K=ye,V){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=K+A,V={id:g++,callback:J,priorityLevel:V,startTime:K,expirationTime:A,sortIndex:-1},K>ye?(V.sortIndex=K,t(m,V),n(h)===null&&V===n(m)&&(N?(O(I),I=-1):N=!0,ae(M,K-ye))):(V.sortIndex=A,t(h,V),S||b||(S=!0,R||(R=!0,le()))),V},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(V){var J=v;return function(){var K=v;v=J;try{return V.apply(this,arguments)}finally{v=K}}}})(qh)),qh}var b0;function IC(){return b0||(b0=1,Fh.exports=ZC()),Fh.exports}var Gh={exports:{}},dn={};var v0;function HC(){if(v0)return dn;v0=1;var e=dd();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},s=Symbol.for("react.portal");function u(h,m,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:""+y,children:h,containerInfo:m,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,dn.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)},dn.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()}},dn.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))},dn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},dn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},dn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=f(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)},dn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:y,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})}},dn.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=f(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)},dn.requestFormReset=function(h){a.d.r(h)},dn.unstable_batchedUpdates=function(h,m){return h(m)},dn.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},dn.useFormStatus=function(){return l.H.useHostTransitionStatus()},dn.version="19.2.4",dn}var k0;function FC(){if(k0)return Gh.exports;k0=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(),Gh.exports=HC(),Gh.exports}var w0;function qC(){if(w0)return ol;w0=1;var e=IC(),t=dd(),n=FC();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}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 s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,o=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(o=i.return),r=i.return;while(r)}return i.tag===3?o: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 f(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 o=r,c=i;;){var p=o.return;if(p===null)break;var x=p.alternate;if(x===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===o)return h(p),r;if(x===c)return h(p),i;x=x.sibling}throw Error(a(188))}if(o.return!==c.return)o=p,c=x;else{for(var k=!1,j=p.child;j;){if(j===o){k=!0,o=p,c=x;break}if(j===c){k=!0,c=p,o=x;break}j=j.sibling}if(!k){for(j=x.child;j;){if(j===o){k=!0,o=x,c=p;break}if(j===c){k=!0,c=x,o=p;break}j=j.sibling}if(!k)throw Error(a(189))}}if(o.alternate!==c)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?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 y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),C=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=se&&r[se]||r["@@iterator"],typeof r=="function"?r:null)}var ee=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ee?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case N:return"Fragment";case E:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case Y:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case C:return r.displayName||"Context";case O:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case I:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case B:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ae=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},ye=[],A=-1;function _(r){return{current:r}}function U(r){0>A||(r.current=ye[A],ye[A]=null,A--)}function w(r,i){A++,ye[A]=r.current,r.current=i}var G=_(null),de=_(null),he=_(null),me=_(null);function Pe(r,i){switch(w(he,i),w(de,r),w(G,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Lv(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Lv(i),r=Pv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}U(G),w(G,r)}function Ae(){U(G),U(de),U(he)}function pt(r){r.memoizedState!==null&&w(me,r);var i=G.current,o=Pv(i,r.type);i!==o&&(w(de,r),w(G,o))}function Dt(r){de.current===r&&(U(G),U(de)),me.current===r&&(U(me),nl._currentValue=K)}var $,je;function Ke(r){if($===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);$=i&&i[1]||"",je=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+$+r+je}var _t=!1;function Oe(r,i){if(!r||_t)return"";_t=!0;var o=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(X){var q=X}Reflect.construct(r,[],re)}else{try{re.call()}catch(X){q=X}r.call(re.prototype)}}else{try{throw Error()}catch(X){q=X}(re=r())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(X){if(X&&q&&typeof X.stack=="string")return[X.stack,q.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 x=c.DetermineComponentFrameRoot(),k=x[0],j=x[1];if(k&&j){var D=k.split(`
|
|
4
|
-
`),F=j.split(`
|
|
5
|
-
`);for(p=c=0;c<D.length&&!D[c].includes("DetermineComponentFrameRoot");)c++;for(;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;if(c===D.length||p===F.length)for(c=D.length-1,p=F.length-1;1<=c&&0<=p&&D[c]!==F[p];)p--;for(;1<=c&&0<=p;c--,p--)if(D[c]!==F[p]){if(c!==1||p!==1)do if(c--,p--,0>p||D[c]!==F[p]){var Q=`
|
|
6
|
-
`+D[c].replace(" at new "," at ");return r.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",r.displayName)),Q}while(1<=c&&0<=p);break}}}finally{_t=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?Ke(o):""}function Qe(r,i){switch(r.tag){case 26:case 27:case 5:return Ke(r.type);case 16:return Ke("Lazy");case 13:return r.child!==i&&i!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return Oe(r.type,!1);case 11:return Oe(r.type.render,!1);case 1:return Oe(r.type,!0);case 31:return Ke("Activity");default:return""}}function st(r){try{var i="",o=null;do i+=Qe(r,o),o=r,r=r.return;while(r);return i}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var tt=Object.prototype.hasOwnProperty,Qt=e.unstable_scheduleCallback,Xn=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Gt=e.unstable_requestPaint,gt=e.unstable_now,Ui=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,He=e.unstable_IdlePriority,gn=e.log,Un=e.unstable_setDisableYieldValue,xn=null,Yt=null;function _n(r){if(typeof gn=="function"&&Un(r),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(xn,r)}catch{}}var ct=Math.clz32?Math.clz32:_2,fa=Math.log,yr=Math.LN2;function _2(r){return r>>>=0,r===0?32:31-(fa(r)/yr|0)|0}var Ql=256,Wl=262144,eu=4194304;function ai(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 tu(r,i,o){var c=r.pendingLanes;if(c===0)return 0;var p=0,x=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var j=c&134217727;return j!==0?(c=j&~x,c!==0?p=ai(c):(k&=j,k!==0?p=ai(k):o||(o=j&~r,o!==0&&(p=ai(o))))):(j=c&~x,j!==0?p=ai(j):k!==0?p=ai(k):o||(o=c&~r,o!==0&&(p=ai(o)))),p===0?0:i!==0&&i!==p&&(i&x)===0&&(x=p&-p,o=i&-i,x>=o||x===32&&(o&4194048)!==0)?i:p}function po(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function j2(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 yx(){var r=eu;return eu<<=1,(eu&62914560)===0&&(eu=4194304),r}function Ed(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function go(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function N2(r,i,o,c,p,x){var k=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var j=r.entanglements,D=r.expirationTimes,F=r.hiddenUpdates;for(o=k&~o;0<o;){var Q=31-ct(o),re=1<<Q;j[Q]=0,D[Q]=-1;var q=F[Q];if(q!==null)for(F[Q]=null,Q=0;Q<q.length;Q++){var X=q[Q];X!==null&&(X.lane&=-536870913)}o&=~re}c!==0&&bx(r,c,0),x!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=x&~(k&~i))}function bx(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ct(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|o&261930}function vx(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var c=31-ct(o),p=1<<c;p&i|r[c]&i&&(r[c]|=i),o&=~p}}function kx(r,i){var o=i&-i;return o=(o&42)!==0?1:Td(o),(o&(r.suspendedLanes|i))!==0?0:o}function Td(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 Ad(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function wx(){var r=J.p;return r!==0?r:(r=window.event,r===void 0?32:o0(r.type))}function Sx(r,i){var o=J.p;try{return J.p=r,i()}finally{J.p=o}}var ha=Math.random().toString(36).slice(2),nn="__reactFiber$"+ha,jn="__reactProps$"+ha,Vi="__reactContainer$"+ha,Od="__reactEvents$"+ha,C2="__reactListeners$"+ha,E2="__reactHandles$"+ha,zx="__reactResources$"+ha,xo="__reactMarker$"+ha;function Rd(r){delete r[nn],delete r[jn],delete r[Od],delete r[C2],delete r[E2]}function Bi(r){var i=r[nn];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Vi]||o[nn]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Fv(r);r!==null;){if(o=r[nn])return o;r=Fv(r)}return i}r=o,o=r.parentNode}return null}function Zi(r){if(r=r[nn]||r[Vi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function yo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Ii(r){var i=r[zx];return i||(i=r[zx]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Wt(r){r[xo]=!0}var _x=new Set,jx={};function ii(r,i){Hi(r,i),Hi(r+"Capture",i)}function Hi(r,i){for(jx[r]=i,r=0;r<i.length;r++)_x.add(i[r])}var T2=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]*$"),Nx={},Cx={};function A2(r){return tt.call(Cx,r)?!0:tt.call(Nx,r)?!1:T2.test(r)?Cx[r]=!0:(Nx[r]=!0,!1)}function nu(r,i,o){if(A2(i))if(o===null)r.removeAttribute(i);else{switch(typeof o){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,""+o)}}function ru(r,i,o){if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+o)}}function Br(r,i,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(i,o,""+c)}}function Jn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ex(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function O2(r,i,o){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,x=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(k){o=""+k,x.call(this,k)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(k){o=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Dd(r){if(!r._valueTracker){var i=Ex(r)?"checked":"value";r._valueTracker=O2(r,i,""+r[i])}}function Tx(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),c="";return r&&(c=Ex(r)?r.checked?"true":"false":r.value),r=c,r!==o?(i.setValue(r),!0):!1}function au(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 R2=/[\n"\\]/g;function Qn(r){return r.replace(R2,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Md(r,i,o,c,p,x,k,j){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=""+Jn(i)):r.value!==""+Jn(i)&&(r.value=""+Jn(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?$d(r,k,Jn(i)):o!=null?$d(r,k,Jn(o)):c!=null&&r.removeAttribute("value"),p==null&&x!=null&&(r.defaultChecked=!!x),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.name=""+Jn(j):r.removeAttribute("name")}function Ax(r,i,o,c,p,x,k,j){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.type=x),i!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Dd(r);return}o=o!=null?""+Jn(o):"",i=i!=null?""+Jn(i):o,j||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=j?r.checked:!!c,r.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),Dd(r)}function $d(r,i,o){i==="number"&&au(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Fi(r,i,o,c){if(r=r.options,i){i={};for(var p=0;p<o.length;p++)i["$"+o[p]]=!0;for(o=0;o<r.length;o++)p=i.hasOwnProperty("$"+r[o].value),r[o].selected!==p&&(r[o].selected=p),p&&c&&(r[o].defaultSelected=!0)}else{for(o=""+Jn(o),i=null,p=0;p<r.length;p++){if(r[p].value===o){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ox(r,i,o){if(i!=null&&(i=""+Jn(i),i!==r.value&&(r.value=i),o==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=o!=null?""+Jn(o):""}function Rx(r,i,o,c){if(i==null){if(c!=null){if(o!=null)throw Error(a(92));if(ae(c)){if(1<c.length)throw Error(a(93));c=c[0]}o=c}o==null&&(o=""),i=o}o=Jn(i),r.defaultValue=o,c=r.textContent,c===o&&c!==""&&c!==null&&(r.value=c),Dd(r)}function qi(r,i){if(i){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=i;return}}r.textContent=i}var D2=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 Dx(r,i,o){var c=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,o):typeof o!="number"||o===0||D2.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Mx(r,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,o!=null){for(var c in o)!o.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)&&o[p]!==c&&Dx(r,p,c)}else for(var x in i)i.hasOwnProperty(x)&&Dx(r,x,i[x])}function Ld(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 M2=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"]]),$2=/^[\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 iu(r){return $2.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Zr(){}var Pd=null;function Ud(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Gi=null,Yi=null;function $x(r){var i=Zi(r);if(i&&(r=i.stateNode)){var o=r[jn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Md(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=r;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Qn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var c=o[i];if(c!==r&&c.form===r.form){var p=c[jn]||null;if(!p)throw Error(a(90));Md(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<o.length;i++)c=o[i],c.form===r.form&&Tx(c)}break e;case"textarea":Ox(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Fi(r,!!o.multiple,i,!1)}}}var Vd=!1;function Lx(r,i,o){if(Vd)return r(i,o);Vd=!0;try{var c=r(i);return c}finally{if(Vd=!1,(Gi!==null||Yi!==null)&&(qu(),Gi&&(i=Gi,r=Yi,Yi=Gi=null,$x(i),r)))for(i=0;i<r.length;i++)$x(r[i])}}function bo(r,i){var o=r.stateNode;if(o===null)return null;var c=o[jn]||null;if(c===null)return null;o=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(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bd=!1;if(Ir)try{var vo={};Object.defineProperty(vo,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",vo,vo),window.removeEventListener("test",vo,vo)}catch{Bd=!1}var ma=null,Zd=null,su=null;function Px(){if(su)return su;var r,i=Zd,o=i.length,c,p="value"in ma?ma.value:ma.textContent,x=p.length;for(r=0;r<o&&i[r]===p[r];r++);var k=o-r;for(c=1;c<=k&&i[o-c]===p[x-c];c++);return su=p.slice(r,1<c?1-c:void 0)}function ou(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 lu(){return!0}function Ux(){return!1}function Nn(r){function i(o,c,p,x,k){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var j in r)r.hasOwnProperty(j)&&(o=r[j],this[j]=o?o(x):x[j]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?lu:Ux,this.isPropagationStopped=Ux,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=lu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=lu)},persist:function(){},isPersistent:lu}),i}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uu=Nn(si),ko=y({},si,{view:0,detail:0}),L2=Nn(ko),Id,Hd,wo,cu=y({},ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qd,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!==wo&&(wo&&r.type==="mousemove"?(Id=r.screenX-wo.screenX,Hd=r.screenY-wo.screenY):Hd=Id=0,wo=r),Id)},movementY:function(r){return"movementY"in r?r.movementY:Hd}}),Vx=Nn(cu),P2=y({},cu,{dataTransfer:0}),U2=Nn(P2),V2=y({},ko,{relatedTarget:0}),Fd=Nn(V2),B2=y({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),Z2=Nn(B2),I2=y({},si,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),H2=Nn(I2),F2=y({},si,{data:0}),Bx=Nn(F2),q2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G2={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"},Y2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K2(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Y2[r])?!!i[r]:!1}function qd(){return K2}var X2=y({},ko,{key:function(r){if(r.key){var i=q2[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ou(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?G2[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qd,charCode:function(r){return r.type==="keypress"?ou(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ou(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),J2=Nn(X2),Q2=y({},cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zx=Nn(Q2),W2=y({},ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qd}),eN=Nn(W2),tN=y({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),nN=Nn(tN),rN=y({},cu,{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}),aN=Nn(rN),iN=y({},si,{newState:0,oldState:0}),sN=Nn(iN),oN=[9,13,27,32],Gd=Ir&&"CompositionEvent"in window,So=null;Ir&&"documentMode"in document&&(So=document.documentMode);var lN=Ir&&"TextEvent"in window&&!So,Ix=Ir&&(!Gd||So&&8<So&&11>=So),Hx=" ",Fx=!1;function qx(r,i){switch(r){case"keyup":return oN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ki=!1;function uN(r,i){switch(r){case"compositionend":return Gx(i);case"keypress":return i.which!==32?null:(Fx=!0,Hx);case"textInput":return r=i.data,r===Hx&&Fx?null:r;default:return null}}function cN(r,i){if(Ki)return r==="compositionend"||!Gd&&qx(r,i)?(r=Px(),su=Zd=ma=null,Ki=!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 Ix&&i.locale!=="ko"?null:i.data;default:return null}}var dN={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 Yx(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!dN[r.type]:i==="textarea"}function Kx(r,i,o,c){Gi?Yi?Yi.push(c):Yi=[c]:Gi=c,i=Wu(i,"onChange"),0<i.length&&(o=new uu("onChange","change",null,o,c),r.push({event:o,listeners:i}))}var zo=null,_o=null;function fN(r){Av(r,0)}function du(r){var i=yo(r);if(Tx(i))return r}function Xx(r,i){if(r==="change")return i}var Jx=!1;if(Ir){var Yd;if(Ir){var Kd="oninput"in document;if(!Kd){var Qx=document.createElement("div");Qx.setAttribute("oninput","return;"),Kd=typeof Qx.oninput=="function"}Yd=Kd}else Yd=!1;Jx=Yd&&(!document.documentMode||9<document.documentMode)}function Wx(){zo&&(zo.detachEvent("onpropertychange",ey),_o=zo=null)}function ey(r){if(r.propertyName==="value"&&du(_o)){var i=[];Kx(i,_o,r,Ud(r)),Lx(fN,i)}}function hN(r,i,o){r==="focusin"?(Wx(),zo=i,_o=o,zo.attachEvent("onpropertychange",ey)):r==="focusout"&&Wx()}function mN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return du(_o)}function pN(r,i){if(r==="click")return du(i)}function gN(r,i){if(r==="input"||r==="change")return du(i)}function xN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Vn=typeof Object.is=="function"?Object.is:xN;function jo(r,i){if(Vn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var o=Object.keys(r),c=Object.keys(i);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!tt.call(i,p)||!Vn(r[p],i[p]))return!1}return!0}function ty(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ny(r,i){var o=ty(r);r=0;for(var c;o;){if(o.nodeType===3){if(c=r+o.textContent.length,r<=i&&c>=i)return{node:o,offset:i-r};r=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ty(o)}}function ry(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?ry(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function ay(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=au(r.document);i instanceof r.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)r=i.contentWindow;else break;i=au(r.document)}return i}function Xd(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 yN=Ir&&"documentMode"in document&&11>=document.documentMode,Xi=null,Jd=null,No=null,Qd=!1;function iy(r,i,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Qd||Xi==null||Xi!==au(c)||(c=Xi,"selectionStart"in c&&Xd(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}),No&&jo(No,c)||(No=c,c=Wu(Jd,"onSelect"),0<c.length&&(i=new uu("onSelect","select",null,i,o),r.push({event:i,listeners:c}),i.target=Xi)))}function oi(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var Ji={animationend:oi("Animation","AnimationEnd"),animationiteration:oi("Animation","AnimationIteration"),animationstart:oi("Animation","AnimationStart"),transitionrun:oi("Transition","TransitionRun"),transitionstart:oi("Transition","TransitionStart"),transitioncancel:oi("Transition","TransitionCancel"),transitionend:oi("Transition","TransitionEnd")},Wd={},sy={};Ir&&(sy=document.createElement("div").style,"AnimationEvent"in window||(delete Ji.animationend.animation,delete Ji.animationiteration.animation,delete Ji.animationstart.animation),"TransitionEvent"in window||delete Ji.transitionend.transition);function li(r){if(Wd[r])return Wd[r];if(!Ji[r])return r;var i=Ji[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in sy)return Wd[r]=i[o];return r}var oy=li("animationend"),ly=li("animationiteration"),uy=li("animationstart"),bN=li("transitionrun"),vN=li("transitionstart"),kN=li("transitioncancel"),cy=li("transitionend"),dy=new Map,ef="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(" ");ef.push("scrollEnd");function br(r,i){dy.set(r,i),ii(i,[r])}var fu=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)},Wn=[],Qi=0,tf=0;function hu(){for(var r=Qi,i=tf=Qi=0;i<r;){var o=Wn[i];Wn[i++]=null;var c=Wn[i];Wn[i++]=null;var p=Wn[i];Wn[i++]=null;var x=Wn[i];if(Wn[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}x!==0&&fy(o,p,x)}}function mu(r,i,o,c){Wn[Qi++]=r,Wn[Qi++]=i,Wn[Qi++]=o,Wn[Qi++]=c,tf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function nf(r,i,o,c){return mu(r,i,o,c),pu(r)}function ui(r,i){return mu(r,null,null,i),pu(r)}function fy(r,i,o){r.lanes|=o;var c=r.alternate;c!==null&&(c.lanes|=o);for(var p=!1,x=r.return;x!==null;)x.childLanes|=o,c=x.alternate,c!==null&&(c.childLanes|=o),x.tag===22&&(r=x.stateNode,r===null||r._visibility&1||(p=!0)),r=x,x=x.return;return r.tag===3?(x=r.stateNode,p&&i!==null&&(p=31-ct(o),r=x.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=o|536870912),x):null}function pu(r){if(50<Ko)throw Ko=0,fh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Wi={};function wN(r,i,o,c){this.tag=r,this.key=o,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 Bn(r,i,o,c){return new wN(r,i,o,c)}function rf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Hr(r,i){var o=r.alternate;return o===null?(o=Bn(r.tag,i,r.key,r.mode),o.elementType=r.elementType,o.type=r.type,o.stateNode=r.stateNode,o.alternate=r,r.alternate=o):(o.pendingProps=i,o.type=r.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=r.flags&65011712,o.childLanes=r.childLanes,o.lanes=r.lanes,o.child=r.child,o.memoizedProps=r.memoizedProps,o.memoizedState=r.memoizedState,o.updateQueue=r.updateQueue,i=r.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=r.sibling,o.index=r.index,o.ref=r.ref,o.refCleanup=r.refCleanup,o}function hy(r,i){r.flags&=65011714;var o=r.alternate;return o===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=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function gu(r,i,o,c,p,x){var k=0;if(c=r,typeof r=="function")rf(r)&&(k=1);else if(typeof r=="string")k=NC(r,o,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Y:return r=Bn(31,o,i,p),r.elementType=Y,r.lanes=x,r;case N:return ci(o.children,p,x,i);case T:k=8,p|=24;break;case E:return r=Bn(12,o,i,p|2),r.elementType=E,r.lanes=x,r;case M:return r=Bn(13,o,i,p),r.elementType=M,r.lanes=x,r;case R:return r=Bn(19,o,i,p),r.elementType=R,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:k=10;break e;case O:k=9;break e;case P:k=11;break e;case I:k=14;break e;case B:k=16,c=null;break e}k=29,o=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Bn(k,o,i,p),i.elementType=r,i.type=c,i.lanes=x,i}function ci(r,i,o,c){return r=Bn(7,r,c,i),r.lanes=o,r}function af(r,i,o){return r=Bn(6,r,null,i),r.lanes=o,r}function my(r){var i=Bn(18,null,null,0);return i.stateNode=r,i}function sf(r,i,o){return i=Bn(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var py=new WeakMap;function er(r,i){if(typeof r=="object"&&r!==null){var o=py.get(r);return o!==void 0?o:(i={value:r,source:i,stack:st(i)},py.set(r,i),i)}return{value:r,source:i,stack:st(i)}}var es=[],ts=0,xu=null,Co=0,tr=[],nr=0,pa=null,Cr=1,Er="";function Fr(r,i){es[ts++]=Co,es[ts++]=xu,xu=r,Co=i}function gy(r,i,o){tr[nr++]=Cr,tr[nr++]=Er,tr[nr++]=pa,pa=r;var c=Cr;r=Er;var p=32-ct(c)-1;c&=~(1<<p),o+=1;var x=32-ct(i)+p;if(30<x){var k=p-p%5;x=(c&(1<<k)-1).toString(32),c>>=k,p-=k,Cr=1<<32-ct(i)+p|o<<p|c,Er=x+r}else Cr=1<<x|o<<p|c,Er=r}function of(r){r.return!==null&&(Fr(r,1),gy(r,1,0))}function lf(r){for(;r===xu;)xu=es[--ts],es[ts]=null,Co=es[--ts],es[ts]=null;for(;r===pa;)pa=tr[--nr],tr[nr]=null,Er=tr[--nr],tr[nr]=null,Cr=tr[--nr],tr[nr]=null}function xy(r,i){tr[nr++]=Cr,tr[nr++]=Er,tr[nr++]=pa,Cr=i.id,Er=i.overflow,pa=r}var rn=null,xt=null,Ie=!1,ga=null,rr=!1,uf=Error(a(519));function xa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Eo(er(i,r)),uf}function yy(r){var i=r.stateNode,o=r.type,c=r.memoizedProps;switch(i[nn]=r,i[jn]=c,o){case"dialog":Ve("cancel",i),Ve("close",i);break;case"iframe":case"object":case"embed":Ve("load",i);break;case"video":case"audio":for(o=0;o<Jo.length;o++)Ve(Jo[o],i);break;case"source":Ve("error",i);break;case"img":case"image":case"link":Ve("error",i),Ve("load",i);break;case"details":Ve("toggle",i);break;case"input":Ve("invalid",i),Ax(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ve("invalid",i);break;case"textarea":Ve("invalid",i),Rx(i,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||c.suppressHydrationWarning===!0||Mv(i.textContent,o)?(c.popover!=null&&(Ve("beforetoggle",i),Ve("toggle",i)),c.onScroll!=null&&Ve("scroll",i),c.onScrollEnd!=null&&Ve("scrollend",i),c.onClick!=null&&(i.onclick=Zr),i=!0):i=!1,i||xa(r,!0)}function by(r){for(rn=r.return;rn;)switch(rn.tag){case 5:case 31:case 13:rr=!1;return;case 27:case 3:rr=!0;return;default:rn=rn.return}}function ns(r){if(r!==rn)return!1;if(!Ie)return by(r),Ie=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||Nh(r.type,r.memoizedProps)),o=!o),o&&xt&&xa(r),by(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));xt=Hv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));xt=Hv(r)}else i===27?(i=xt,Aa(r.type)?(r=Oh,Oh=null,xt=r):xt=i):xt=rn?ir(r.stateNode.nextSibling):null;return!0}function di(){xt=rn=null,Ie=!1}function cf(){var r=ga;return r!==null&&(An===null?An=r:An.push.apply(An,r),ga=null),r}function Eo(r){ga===null?ga=[r]:ga.push(r)}var df=_(null),fi=null,qr=null;function ya(r,i,o){w(df,i._currentValue),i._currentValue=o}function Gr(r){r._currentValue=df.current,U(df)}function ff(r,i,o){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===o)break;r=r.return}}function hf(r,i,o,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var x=p.dependencies;if(x!==null){var k=p.child;x=x.firstContext;e:for(;x!==null;){var j=x;x=p;for(var D=0;D<i.length;D++)if(j.context===i[D]){x.lanes|=o,j=x.alternate,j!==null&&(j.lanes|=o),ff(x.return,o,r),c||(k=null);break e}x=j.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(a(341));k.lanes|=o,x=k.alternate,x!==null&&(x.lanes|=o),ff(k,o,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 rs(r,i,o,c){r=null;for(var p=i,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!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 j=p.type;Vn(p.pendingProps.value,k.value)||(r!==null?r.push(j):r=[j])}}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(nl):r=[nl])}p=p.return}r!==null&&hf(i,r,o,c),i.flags|=262144}function yu(r){for(r=r.firstContext;r!==null;){if(!Vn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function hi(r){fi=r,qr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function an(r){return vy(fi,r)}function bu(r,i){return fi===null&&hi(r),vy(r,i)}function vy(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},qr===null){if(r===null)throw Error(a(308));qr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else qr=qr.next=i;return o}var SN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(o,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(o){return o()})}},zN=e.unstable_scheduleCallback,_N=e.unstable_NormalPriority,Pt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mf(){return{controller:new SN,data:new Map,refCount:0}}function To(r){r.refCount--,r.refCount===0&&zN(_N,function(){r.controller.abort()})}var Ao=null,pf=0,as=0,is=null;function jN(r,i){if(Ao===null){var o=Ao=[];pf=0,as=yh(),is={status:"pending",value:void 0,then:function(c){o.push(c)}}}return pf++,i.then(ky,ky),i}function ky(){if(--pf===0&&Ao!==null){is!==null&&(is.status="fulfilled");var r=Ao;Ao=null,as=0,is=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function NN(r,i){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<o.length;p++)(0,o[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var wy=V.S;V.S=function(r,i){iv=gt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&jN(r,i),wy!==null&&wy(r,i)};var mi=_(null);function gf(){var r=mi.current;return r!==null?r:dt.pooledCache}function vu(r,i){i===null?w(mi,mi.current):w(mi,i.pool)}function Sy(){var r=gf();return r===null?null:{parent:Pt._currentValue,pool:r}}var ss=Error(a(460)),xf=Error(a(474)),ku=Error(a(542)),wu={then:function(){}};function zy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function _y(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(Zr,Zr),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Ny(r),r;default:if(typeof i.status=="string")i.then(Zr,Zr);else{if(r=dt,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,Ny(r),r}throw gi=i,ss}}function pi(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(gi=o,ss):o}}var gi=null;function jy(){if(gi===null)throw Error(a(459));var r=gi;return gi=null,r}function Ny(r){if(r===ss||r===ku)throw Error(a(483))}var os=null,Oo=0;function Su(r){var i=Oo;return Oo+=1,os===null&&(os=[]),_y(os,r,i)}function Ro(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function zu(r,i){throw i.$$typeof===v?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Cy(r){function i(Z,L){if(r){var H=Z.deletions;H===null?(Z.deletions=[L],Z.flags|=16):H.push(L)}}function o(Z,L){if(!r)return null;for(;L!==null;)i(Z,L),L=L.sibling;return null}function c(Z){for(var L=new Map;Z!==null;)Z.key!==null?L.set(Z.key,Z):L.set(Z.index,Z),Z=Z.sibling;return L}function p(Z,L){return Z=Hr(Z,L),Z.index=0,Z.sibling=null,Z}function x(Z,L,H){return Z.index=H,r?(H=Z.alternate,H!==null?(H=H.index,H<L?(Z.flags|=67108866,L):H):(Z.flags|=67108866,L)):(Z.flags|=1048576,L)}function k(Z){return r&&Z.alternate===null&&(Z.flags|=67108866),Z}function j(Z,L,H,ne){return L===null||L.tag!==6?(L=af(H,Z.mode,ne),L.return=Z,L):(L=p(L,H),L.return=Z,L)}function D(Z,L,H,ne){var _e=H.type;return _e===N?Q(Z,L,H.props.children,ne,H.key):L!==null&&(L.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&pi(_e)===L.type)?(L=p(L,H.props),Ro(L,H),L.return=Z,L):(L=gu(H.type,H.key,H.props,null,Z.mode,ne),Ro(L,H),L.return=Z,L)}function F(Z,L,H,ne){return L===null||L.tag!==4||L.stateNode.containerInfo!==H.containerInfo||L.stateNode.implementation!==H.implementation?(L=sf(H,Z.mode,ne),L.return=Z,L):(L=p(L,H.children||[]),L.return=Z,L)}function Q(Z,L,H,ne,_e){return L===null||L.tag!==7?(L=ci(H,Z.mode,ne,_e),L.return=Z,L):(L=p(L,H),L.return=Z,L)}function re(Z,L,H){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=af(""+L,Z.mode,H),L.return=Z,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case b:return H=gu(L.type,L.key,L.props,null,Z.mode,H),Ro(H,L),H.return=Z,H;case S:return L=sf(L,Z.mode,H),L.return=Z,L;case B:return L=pi(L),re(Z,L,H)}if(ae(L)||le(L))return L=ci(L,Z.mode,H,null),L.return=Z,L;if(typeof L.then=="function")return re(Z,Su(L),H);if(L.$$typeof===C)return re(Z,bu(Z,L),H);zu(Z,L)}return null}function q(Z,L,H,ne){var _e=L!==null?L.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return _e!==null?null:j(Z,L,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===_e?D(Z,L,H,ne):null;case S:return H.key===_e?F(Z,L,H,ne):null;case B:return H=pi(H),q(Z,L,H,ne)}if(ae(H)||le(H))return _e!==null?null:Q(Z,L,H,ne,null);if(typeof H.then=="function")return q(Z,L,Su(H),ne);if(H.$$typeof===C)return q(Z,L,bu(Z,H),ne);zu(Z,H)}return null}function X(Z,L,H,ne,_e){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Z=Z.get(H)||null,j(L,Z,""+ne,_e);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return Z=Z.get(ne.key===null?H:ne.key)||null,D(L,Z,ne,_e);case S:return Z=Z.get(ne.key===null?H:ne.key)||null,F(L,Z,ne,_e);case B:return ne=pi(ne),X(Z,L,H,ne,_e)}if(ae(ne)||le(ne))return Z=Z.get(H)||null,Q(L,Z,ne,_e,null);if(typeof ne.then=="function")return X(Z,L,H,Su(ne),_e);if(ne.$$typeof===C)return X(Z,L,H,bu(L,ne),_e);zu(L,ne)}return null}function ge(Z,L,H,ne){for(var _e=null,Xe=null,Se=L,Me=L=0,Ze=null;Se!==null&&Me<H.length;Me++){Se.index>Me?(Ze=Se,Se=null):Ze=Se.sibling;var Je=q(Z,Se,H[Me],ne);if(Je===null){Se===null&&(Se=Ze);break}r&&Se&&Je.alternate===null&&i(Z,Se),L=x(Je,L,Me),Xe===null?_e=Je:Xe.sibling=Je,Xe=Je,Se=Ze}if(Me===H.length)return o(Z,Se),Ie&&Fr(Z,Me),_e;if(Se===null){for(;Me<H.length;Me++)Se=re(Z,H[Me],ne),Se!==null&&(L=x(Se,L,Me),Xe===null?_e=Se:Xe.sibling=Se,Xe=Se);return Ie&&Fr(Z,Me),_e}for(Se=c(Se);Me<H.length;Me++)Ze=X(Se,Z,Me,H[Me],ne),Ze!==null&&(r&&Ze.alternate!==null&&Se.delete(Ze.key===null?Me:Ze.key),L=x(Ze,L,Me),Xe===null?_e=Ze:Xe.sibling=Ze,Xe=Ze);return r&&Se.forEach(function($a){return i(Z,$a)}),Ie&&Fr(Z,Me),_e}function Ne(Z,L,H,ne){if(H==null)throw Error(a(151));for(var _e=null,Xe=null,Se=L,Me=L=0,Ze=null,Je=H.next();Se!==null&&!Je.done;Me++,Je=H.next()){Se.index>Me?(Ze=Se,Se=null):Ze=Se.sibling;var $a=q(Z,Se,Je.value,ne);if($a===null){Se===null&&(Se=Ze);break}r&&Se&&$a.alternate===null&&i(Z,Se),L=x($a,L,Me),Xe===null?_e=$a:Xe.sibling=$a,Xe=$a,Se=Ze}if(Je.done)return o(Z,Se),Ie&&Fr(Z,Me),_e;if(Se===null){for(;!Je.done;Me++,Je=H.next())Je=re(Z,Je.value,ne),Je!==null&&(L=x(Je,L,Me),Xe===null?_e=Je:Xe.sibling=Je,Xe=Je);return Ie&&Fr(Z,Me),_e}for(Se=c(Se);!Je.done;Me++,Je=H.next())Je=X(Se,Z,Me,Je.value,ne),Je!==null&&(r&&Je.alternate!==null&&Se.delete(Je.key===null?Me:Je.key),L=x(Je,L,Me),Xe===null?_e=Je:Xe.sibling=Je,Xe=Je);return r&&Se.forEach(function(PC){return i(Z,PC)}),Ie&&Fr(Z,Me),_e}function ut(Z,L,H,ne){if(typeof H=="object"&&H!==null&&H.type===N&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var _e=H.key;L!==null;){if(L.key===_e){if(_e=H.type,_e===N){if(L.tag===7){o(Z,L.sibling),ne=p(L,H.props.children),ne.return=Z,Z=ne;break e}}else if(L.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&pi(_e)===L.type){o(Z,L.sibling),ne=p(L,H.props),Ro(ne,H),ne.return=Z,Z=ne;break e}o(Z,L);break}else i(Z,L);L=L.sibling}H.type===N?(ne=ci(H.props.children,Z.mode,ne,H.key),ne.return=Z,Z=ne):(ne=gu(H.type,H.key,H.props,null,Z.mode,ne),Ro(ne,H),ne.return=Z,Z=ne)}return k(Z);case S:e:{for(_e=H.key;L!==null;){if(L.key===_e)if(L.tag===4&&L.stateNode.containerInfo===H.containerInfo&&L.stateNode.implementation===H.implementation){o(Z,L.sibling),ne=p(L,H.children||[]),ne.return=Z,Z=ne;break e}else{o(Z,L);break}else i(Z,L);L=L.sibling}ne=sf(H,Z.mode,ne),ne.return=Z,Z=ne}return k(Z);case B:return H=pi(H),ut(Z,L,H,ne)}if(ae(H))return ge(Z,L,H,ne);if(le(H)){if(_e=le(H),typeof _e!="function")throw Error(a(150));return H=_e.call(H),Ne(Z,L,H,ne)}if(typeof H.then=="function")return ut(Z,L,Su(H),ne);if(H.$$typeof===C)return ut(Z,L,bu(Z,H),ne);zu(Z,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,L!==null&&L.tag===6?(o(Z,L.sibling),ne=p(L,H),ne.return=Z,Z=ne):(o(Z,L),ne=af(H,Z.mode,ne),ne.return=Z,Z=ne),k(Z)):o(Z,L)}return function(Z,L,H,ne){try{Oo=0;var _e=ut(Z,L,H,ne);return os=null,_e}catch(Se){if(Se===ss||Se===ku)throw Se;var Xe=Bn(29,Se,null,Z.mode);return Xe.lanes=ne,Xe.return=Z,Xe}}}var xi=Cy(!0),Ey=Cy(!1),ba=!1;function yf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bf(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 va(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ka(r,i,o){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(We&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=pu(r),fy(r,null,o),i}return mu(r,c,i,o),pu(r)}function Do(r,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,vx(r,o)}}function vf(r,i){var o=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var k={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?p=x=k:x=x.next=k,o=o.next}while(o!==null);x===null?p=x=i:x=x.next=i}else p=x=i;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=i:r.next=i,o.lastBaseUpdate=i}var kf=!1;function Mo(){if(kf){var r=is;if(r!==null)throw r}}function $o(r,i,o,c){kf=!1;var p=r.updateQueue;ba=!1;var x=p.firstBaseUpdate,k=p.lastBaseUpdate,j=p.shared.pending;if(j!==null){p.shared.pending=null;var D=j,F=D.next;D.next=null,k===null?x=F:k.next=F,k=D;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,j=Q.lastBaseUpdate,j!==k&&(j===null?Q.firstBaseUpdate=F:j.next=F,Q.lastBaseUpdate=D))}if(x!==null){var re=p.baseState;k=0,Q=F=D=null,j=x;do{var q=j.lane&-536870913,X=q!==j.lane;if(X?(Be&q)===q:(c&q)===q){q!==0&&q===as&&(kf=!0),Q!==null&&(Q=Q.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ge=r,Ne=j;q=i;var ut=o;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){re=ge.call(ut,re,q);break e}re=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,q=typeof ge=="function"?ge.call(ut,re,q):ge,q==null)break e;re=y({},re,q);break e;case 2:ba=!0}}q=j.callback,q!==null&&(r.flags|=64,X&&(r.flags|=8192),X=p.callbacks,X===null?p.callbacks=[q]:X.push(q))}else X={lane:q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},Q===null?(F=Q=X,D=re):Q=Q.next=X,k|=q;if(j=j.next,j===null){if(j=p.shared.pending,j===null)break;X=j,j=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);Q===null&&(D=re),p.baseState=D,p.firstBaseUpdate=F,p.lastBaseUpdate=Q,x===null&&(p.shared.lanes=0),ja|=k,r.lanes=k,r.memoizedState=re}}function Ty(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Ay(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)Ty(o[r],i)}var ls=_(null),_u=_(0);function Oy(r,i){r=na,w(_u,r),w(ls,i),na=r|i.baseLanes}function wf(){w(_u,na),w(ls,ls.current)}function Sf(){na=_u.current,U(ls),U(_u)}var Zn=_(null),ar=null;function wa(r){var i=r.alternate;w($t,$t.current&1),w(Zn,r),ar===null&&(i===null||ls.current!==null||i.memoizedState!==null)&&(ar=r)}function zf(r){w($t,$t.current),w(Zn,r),ar===null&&(ar=r)}function Ry(r){r.tag===22?(w($t,$t.current),w(Zn,r),ar===null&&(ar=r)):Sa()}function Sa(){w($t,$t.current),w(Zn,Zn.current)}function In(r){U(Zn),ar===r&&(ar=null),U($t)}var $t=_(0);function ju(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Th(o)||Ah(o)))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 Yr=0,De=null,ot=null,Ut=null,Nu=!1,us=!1,yi=!1,Cu=0,Lo=0,cs=null,CN=0;function At(){throw Error(a(321))}function _f(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!Vn(r[o],i[o]))return!1;return!0}function jf(r,i,o,c,p,x){return Yr=x,De=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=r===null||r.memoizedState===null?gb:Bf,yi=!1,x=o(c,p),yi=!1,us&&(x=My(i,o,c,p)),Dy(r),x}function Dy(r){V.H=Vo;var i=ot!==null&&ot.next!==null;if(Yr=0,Ut=ot=De=null,Nu=!1,Lo=0,cs=null,i)throw Error(a(300));r===null||Vt||(r=r.dependencies,r!==null&&yu(r)&&(Vt=!0))}function My(r,i,o,c){De=r;var p=0;do{if(us&&(cs=null),Lo=0,us=!1,25<=p)throw Error(a(301));if(p+=1,Ut=ot=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}V.H=xb,x=i(o,c)}while(us);return x}function EN(){var r=V.H,i=r.useState()[0];return i=typeof i.then=="function"?Po(i):i,r=r.useState()[0],(ot!==null?ot.memoizedState:null)!==r&&(De.flags|=1024),i}function Nf(){var r=Cu!==0;return Cu=0,r}function Cf(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function Ef(r){if(Nu){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Nu=!1}Yr=0,Ut=ot=De=null,us=!1,Lo=Cu=0,cs=null}function yn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?De.memoizedState=Ut=r:Ut=Ut.next=r,Ut}function Lt(){if(ot===null){var r=De.alternate;r=r!==null?r.memoizedState:null}else r=ot.next;var i=Ut===null?De.memoizedState:Ut.next;if(i!==null)Ut=i,ot=r;else{if(r===null)throw De.alternate===null?Error(a(467)):Error(a(310));ot=r,r={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?De.memoizedState=Ut=r:Ut=Ut.next=r}return Ut}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(r){var i=Lo;return Lo+=1,cs===null&&(cs=[]),r=_y(cs,r,i),i=De,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,V.H=i===null||i.memoizedState===null?gb:Bf),r}function Tu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Po(r);if(r.$$typeof===C)return an(r)}throw Error(a(438,String(r)))}function Tf(r){var i=null,o=De.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var c=De.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}),o===null&&(o=Eu(),De.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(r),c=0;c<r;c++)o[c]=fe;return i.index++,o}function Kr(r,i){return typeof i=="function"?i(r):i}function Au(r){var i=Lt();return Af(i,ot,r)}function Af(r,i,o){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=o;var p=r.baseQueue,x=c.pending;if(x!==null){if(p!==null){var k=p.next;p.next=x.next,x.next=k}i.baseQueue=p=x,c.pending=null}if(x=r.baseState,p===null)r.memoizedState=x;else{i=p.next;var j=k=null,D=null,F=i,Q=!1;do{var re=F.lane&-536870913;if(re!==F.lane?(Be&re)===re:(Yr&re)===re){var q=F.revertLane;if(q===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===as&&(Q=!0);else if((Yr&q)===q){F=F.next,q===as&&(Q=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(j=D=re,k=x):D=D.next=re,De.lanes|=q,ja|=q;re=F.action,yi&&o(x,re),x=F.hasEagerState?F.eagerState:o(x,re)}else q={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(j=D=q,k=x):D=D.next=q,De.lanes|=re,ja|=re;F=F.next}while(F!==null&&F!==i);if(D===null?k=x:D.next=j,!Vn(x,r.memoizedState)&&(Vt=!0,Q&&(o=is,o!==null)))throw o;r.memoizedState=x,r.baseState=k,r.baseQueue=D,c.lastRenderedState=x}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function Of(r){var i=Lt(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=r;var c=o.dispatch,p=o.pending,x=i.memoizedState;if(p!==null){o.pending=null;var k=p=p.next;do x=r(x,k.action),k=k.next;while(k!==p);Vn(x,i.memoizedState)||(Vt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,c]}function $y(r,i,o){var c=De,p=Lt(),x=Ie;if(x){if(o===void 0)throw Error(a(407));o=o()}else o=i();var k=!Vn((ot||p).memoizedState,o);if(k&&(p.memoizedState=o,Vt=!0),p=p.queue,Mf(Uy.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||Ut!==null&&Ut.memoizedState.tag&1){if(c.flags|=2048,ds(9,{destroy:void 0},Py.bind(null,c,p,o,i),null),dt===null)throw Error(a(349));x||(Yr&127)!==0||Ly(c,i,o)}return o}function Ly(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=De.updateQueue,i===null?(i=Eu(),De.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function Py(r,i,o,c){i.value=o,i.getSnapshot=c,Vy(i)&&By(r)}function Uy(r,i,o){return o(function(){Vy(i)&&By(r)})}function Vy(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!Vn(r,o)}catch{return!0}}function By(r){var i=ui(r,2);i!==null&&On(i,r,2)}function Rf(r){var i=yn();if(typeof r=="function"){var o=r;if(r=o(),yi){_n(!0);try{o()}finally{_n(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:r},i}function Zy(r,i,o,c){return r.baseState=o,Af(r,ot,typeof c=="function"?c:Kr)}function TN(r,i,o,c,p){if(Du(r))throw Error(a(485));if(r=i.action,r!==null){var x={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};V.T!==null?o(!0):x.isTransition=!1,c(x),o=i.pending,o===null?(x.next=i.pending=x,Iy(i,x)):(x.next=o.next,i.pending=o.next=x)}}function Iy(r,i){var o=i.action,c=i.payload,p=r.state;if(i.isTransition){var x=V.T,k={};V.T=k;try{var j=o(p,c),D=V.S;D!==null&&D(k,j),Hy(r,i,j)}catch(F){Df(r,i,F)}finally{x!==null&&k.types!==null&&(x.types=k.types),V.T=x}}else try{x=o(p,c),Hy(r,i,x)}catch(F){Df(r,i,F)}}function Hy(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Fy(r,i,c)},function(c){return Df(r,i,c)}):Fy(r,i,o)}function Fy(r,i,o){i.status="fulfilled",i.value=o,qy(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,Iy(r,o)))}function Df(r,i,o){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=o,qy(i),i=i.next;while(i!==c)}r.action=null}function qy(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Gy(r,i){return i}function Yy(r,i){if(Ie){var o=dt.formState;if(o!==null){e:{var c=De;if(Ie){if(xt){t:{for(var p=xt,x=rr;p.nodeType!==8;){if(!x){p=null;break t}if(p=ir(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){xt=ir(p.nextSibling),c=p.data==="F!";break e}}xa(c)}c=!1}c&&(i=o[0])}}return o=yn(),o.memoizedState=o.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gy,lastRenderedState:i},o.queue=c,o=hb.bind(null,De,c),c.dispatch=o,c=Rf(!1),x=Vf.bind(null,De,!1,c.queue),c=yn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,o=TN.bind(null,De,p,x,o),p.dispatch=o,c.memoizedState=r,[i,o,!1]}function Ky(r){var i=Lt();return Xy(i,ot,r)}function Xy(r,i,o){if(i=Af(r,i,Gy)[0],r=Au(Kr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Po(i)}catch(k){throw k===ss?ku:k}else c=i;i=Lt();var p=i.queue,x=p.dispatch;return o!==i.memoizedState&&(De.flags|=2048,ds(9,{destroy:void 0},AN.bind(null,p,o),null)),[c,x,r]}function AN(r,i){r.action=i}function Jy(r){var i=Lt(),o=ot;if(o!==null)return Xy(i,o,r);Lt(),i=i.memoizedState,o=Lt();var c=o.queue.dispatch;return o.memoizedState=r,[i,c,!1]}function ds(r,i,o,c){return r={tag:r,create:o,deps:c,inst:i,next:null},i=De.updateQueue,i===null&&(i=Eu(),De.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=r.next=r:(c=o.next,o.next=r,r.next=c,i.lastEffect=r),r}function Qy(){return Lt().memoizedState}function Ou(r,i,o,c){var p=yn();De.flags|=r,p.memoizedState=ds(1|i,{destroy:void 0},o,c===void 0?null:c)}function Ru(r,i,o,c){var p=Lt();c=c===void 0?null:c;var x=p.memoizedState.inst;ot!==null&&c!==null&&_f(c,ot.memoizedState.deps)?p.memoizedState=ds(i,x,o,c):(De.flags|=r,p.memoizedState=ds(1|i,x,o,c))}function Wy(r,i){Ou(8390656,8,r,i)}function Mf(r,i){Ru(2048,8,r,i)}function ON(r){De.flags|=4;var i=De.updateQueue;if(i===null)i=Eu(),De.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function eb(r){var i=Lt().memoizedState;return ON({ref:i,nextImpl:r}),function(){if((We&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function tb(r,i){return Ru(4,2,r,i)}function nb(r,i){return Ru(4,4,r,i)}function rb(r,i){if(typeof i=="function"){r=r();var o=i(r);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function ab(r,i,o){o=o!=null?o.concat([r]):null,Ru(4,4,rb.bind(null,i,r),o)}function $f(){}function ib(r,i){var o=Lt();i=i===void 0?null:i;var c=o.memoizedState;return i!==null&&_f(i,c[1])?c[0]:(o.memoizedState=[r,i],r)}function sb(r,i){var o=Lt();i=i===void 0?null:i;var c=o.memoizedState;if(i!==null&&_f(i,c[1]))return c[0];if(c=r(),yi){_n(!0);try{r()}finally{_n(!1)}}return o.memoizedState=[c,i],c}function Lf(r,i,o){return o===void 0||(Yr&1073741824)!==0&&(Be&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=ov(),De.lanes|=r,ja|=r,o)}function ob(r,i,o,c){return Vn(o,i)?o:ls.current!==null?(r=Lf(r,o,c),Vn(r,i)||(Vt=!0),r):(Yr&42)===0||(Yr&1073741824)!==0&&(Be&261930)===0?(Vt=!0,r.memoizedState=o):(r=ov(),De.lanes|=r,ja|=r,i)}function lb(r,i,o,c,p){var x=J.p;J.p=x!==0&&8>x?x:8;var k=V.T,j={};V.T=j,Vf(r,!1,i,o);try{var D=p(),F=V.S;if(F!==null&&F(j,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Q=NN(D,c);Uo(r,i,Q,qn(r))}else Uo(r,i,c,qn(r))}catch(re){Uo(r,i,{then:function(){},status:"rejected",reason:re},qn())}finally{J.p=x,k!==null&&j.types!==null&&(k.types=j.types),V.T=k}}function RN(){}function Pf(r,i,o,c){if(r.tag!==5)throw Error(a(476));var p=ub(r).queue;lb(r,p,i,K,o===null?RN:function(){return cb(r),o(c)})}function ub(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:K},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:o},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function cb(r){var i=ub(r);i.next===null&&(i=r.alternate.memoizedState),Uo(r,i.next.queue,{},qn())}function Uf(){return an(nl)}function db(){return Lt().memoizedState}function fb(){return Lt().memoizedState}function DN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=qn();r=va(o);var c=ka(i,r,o);c!==null&&(On(c,i,o),Do(c,i,o)),i={cache:mf()},r.payload=i;return}i=i.return}}function MN(r,i,o){var c=qn();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Du(r)?mb(i,o):(o=nf(r,i,o,c),o!==null&&(On(o,r,c),pb(o,i,c)))}function hb(r,i,o){var c=qn();Uo(r,i,o,c)}function Uo(r,i,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Du(r))mb(i,p);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var k=i.lastRenderedState,j=x(k,o);if(p.hasEagerState=!0,p.eagerState=j,Vn(j,k))return mu(r,i,p,0),dt===null&&hu(),!1}catch{}if(o=nf(r,i,p,c),o!==null)return On(o,r,c),pb(o,i,c),!0}return!1}function Vf(r,i,o,c){if(c={lane:2,revertLane:yh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Du(r)){if(i)throw Error(a(479))}else i=nf(r,o,c,2),i!==null&&On(i,r,2)}function Du(r){var i=r.alternate;return r===De||i!==null&&i===De}function mb(r,i){us=Nu=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function pb(r,i,o){if((o&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,vx(r,o)}}var Vo={readContext:an,use:Tu,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};Vo.useEffectEvent=At;var gb={readContext:an,use:Tu,useCallback:function(r,i){return yn().memoizedState=[r,i===void 0?null:i],r},useContext:an,useEffect:Wy,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,Ou(4194308,4,rb.bind(null,i,r),o)},useLayoutEffect:function(r,i){return Ou(4194308,4,r,i)},useInsertionEffect:function(r,i){Ou(4,2,r,i)},useMemo:function(r,i){var o=yn();i=i===void 0?null:i;var c=r();if(yi){_n(!0);try{r()}finally{_n(!1)}}return o.memoizedState=[c,i],c},useReducer:function(r,i,o){var c=yn();if(o!==void 0){var p=o(i);if(yi){_n(!0);try{o(i)}finally{_n(!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=MN.bind(null,De,r),[c.memoizedState,r]},useRef:function(r){var i=yn();return r={current:r},i.memoizedState=r},useState:function(r){r=Rf(r);var i=r.queue,o=hb.bind(null,De,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:$f,useDeferredValue:function(r,i){var o=yn();return Lf(o,r,i)},useTransition:function(){var r=Rf(!1);return r=lb.bind(null,De,r.queue,!0,!1),yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var c=De,p=yn();if(Ie){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),dt===null)throw Error(a(349));(Be&127)!==0||Ly(c,i,o)}p.memoizedState=o;var x={value:o,getSnapshot:i};return p.queue=x,Wy(Uy.bind(null,c,x,r),[r]),c.flags|=2048,ds(9,{destroy:void 0},Py.bind(null,c,x,o,i),null),o},useId:function(){var r=yn(),i=dt.identifierPrefix;if(Ie){var o=Er,c=Cr;o=(c&~(1<<32-ct(c)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Cu++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=CN++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Uf,useFormState:Yy,useActionState:Yy,useOptimistic:function(r){var i=yn();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=Vf.bind(null,De,!0,o),o.dispatch=i,[r,i]},useMemoCache:Tf,useCacheRefresh:function(){return yn().memoizedState=DN.bind(null,De)},useEffectEvent:function(r){var i=yn(),o={impl:r};return i.memoizedState=o,function(){if((We&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Bf={readContext:an,use:Tu,useCallback:ib,useContext:an,useEffect:Mf,useImperativeHandle:ab,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:sb,useReducer:Au,useRef:Qy,useState:function(){return Au(Kr)},useDebugValue:$f,useDeferredValue:function(r,i){var o=Lt();return ob(o,ot.memoizedState,r,i)},useTransition:function(){var r=Au(Kr)[0],i=Lt().memoizedState;return[typeof r=="boolean"?r:Po(r),i]},useSyncExternalStore:$y,useId:db,useHostTransitionStatus:Uf,useFormState:Ky,useActionState:Ky,useOptimistic:function(r,i){var o=Lt();return Zy(o,ot,r,i)},useMemoCache:Tf,useCacheRefresh:fb};Bf.useEffectEvent=eb;var xb={readContext:an,use:Tu,useCallback:ib,useContext:an,useEffect:Mf,useImperativeHandle:ab,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:sb,useReducer:Of,useRef:Qy,useState:function(){return Of(Kr)},useDebugValue:$f,useDeferredValue:function(r,i){var o=Lt();return ot===null?Lf(o,r,i):ob(o,ot.memoizedState,r,i)},useTransition:function(){var r=Of(Kr)[0],i=Lt().memoizedState;return[typeof r=="boolean"?r:Po(r),i]},useSyncExternalStore:$y,useId:db,useHostTransitionStatus:Uf,useFormState:Jy,useActionState:Jy,useOptimistic:function(r,i){var o=Lt();return ot!==null?Zy(o,ot,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:Tf,useCacheRefresh:fb};xb.useEffectEvent=eb;function Zf(r,i,o,c){i=r.memoizedState,o=o(c,i),o=o==null?i:y({},i,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var If={enqueueSetState:function(r,i,o){r=r._reactInternals;var c=qn(),p=va(c);p.payload=i,o!=null&&(p.callback=o),i=ka(r,p,c),i!==null&&(On(i,r,c),Do(i,r,c))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var c=qn(),p=va(c);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=ka(r,p,c),i!==null&&(On(i,r,c),Do(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=qn(),c=va(o);c.tag=2,i!=null&&(c.callback=i),i=ka(r,c,o),i!==null&&(On(i,r,o),Do(i,r,o))}};function yb(r,i,o,c,p,x,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,x,k):i.prototype&&i.prototype.isPureReactComponent?!jo(o,c)||!jo(p,x):!0}function bb(r,i,o,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,c),i.state!==r&&If.enqueueReplaceState(i,i.state,null)}function bi(r,i){var o=i;if("ref"in i){o={};for(var c in i)c!=="ref"&&(o[c]=i[c])}if(r=r.defaultProps){o===i&&(o=y({},o));for(var p in r)o[p]===void 0&&(o[p]=r[p])}return o}function vb(r){fu(r)}function kb(r){console.error(r)}function wb(r){fu(r)}function Mu(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function Sb(r,i,o){try{var c=r.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Hf(r,i,o){return o=va(o),o.tag=3,o.payload={element:null},o.callback=function(){Mu(r,i)},o}function zb(r){return r=va(r),r.tag=3,r}function _b(r,i,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var x=c.value;r.payload=function(){return p(x)},r.callback=function(){Sb(i,o,c)}}var k=o.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){Sb(i,o,c),typeof p!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var j=c.stack;this.componentDidCatch(c.value,{componentStack:j!==null?j:""})})}function $N(r,i,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=o.alternate,i!==null&&rs(i,o,p,!0),o=Zn.current,o!==null){switch(o.tag){case 31:case 13:return ar===null?Gu():o.alternate===null&&Ot===0&&(Ot=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===wu?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([c]):i.add(c),ph(r,c,p)),!1;case 22:return o.flags|=65536,c===wu?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([c]):o.add(c)),ph(r,c,p)),!1}throw Error(a(435,o.tag))}return ph(r,c,p),Gu(),!1}if(Ie)return i=Zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==uf&&(r=Error(a(422),{cause:c}),Eo(er(r,o)))):(c!==uf&&(i=Error(a(423),{cause:c}),Eo(er(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=er(c,o),p=Hf(r.stateNode,c,p),vf(r,p),Ot!==4&&(Ot=2)),!1;var x=Error(a(520),{cause:c});if(x=er(x,o),Yo===null?Yo=[x]:Yo.push(x),Ot!==4&&(Ot=2),i===null)return!0;c=er(c,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=p&-p,o.lanes|=r,r=Hf(o.stateNode,c,r),vf(o,r),!1;case 1:if(i=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Na===null||!Na.has(x))))return o.flags|=65536,p&=-p,o.lanes|=p,p=zb(p),_b(p,r,o,c),vf(o,p),!1}o=o.return}while(o!==null);return!1}var Ff=Error(a(461)),Vt=!1;function sn(r,i,o,c){i.child=r===null?Ey(i,null,o,c):xi(i,r.child,o,c)}function jb(r,i,o,c,p){o=o.render;var x=i.ref;if("ref"in c){var k={};for(var j in c)j!=="ref"&&(k[j]=c[j])}else k=c;return hi(i),c=jf(r,i,o,k,x,p),j=Nf(),r!==null&&!Vt?(Cf(r,i,p),Xr(r,i,p)):(Ie&&j&&of(i),i.flags|=1,sn(r,i,c,p),i.child)}function Nb(r,i,o,c,p){if(r===null){var x=o.type;return typeof x=="function"&&!rf(x)&&x.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=x,Cb(r,i,x,c,p)):(r=gu(o.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(x=r.child,!Wf(r,p)){var k=x.memoizedProps;if(o=o.compare,o=o!==null?o:jo,o(k,c)&&r.ref===i.ref)return Xr(r,i,p)}return i.flags|=1,r=Hr(x,c),r.ref=i.ref,r.return=i,i.child=r}function Cb(r,i,o,c,p){if(r!==null){var x=r.memoizedProps;if(jo(x,c)&&r.ref===i.ref)if(Vt=!1,i.pendingProps=c=x,Wf(r,p))(r.flags&131072)!==0&&(Vt=!0);else return i.lanes=r.lanes,Xr(r,i,p)}return qf(r,i,o,c,p)}function Eb(r,i,o,c){var p=c.children,x=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(x=x!==null?x.baseLanes|o:o,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~x}else c=0,i.child=null;return Tb(r,i,x,o,c)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&vu(i,x!==null?x.cachePool:null),x!==null?Oy(i,x):wf(),Ry(i);else return c=i.lanes=536870912,Tb(r,i,x!==null?x.baseLanes|o:o,o,c)}else x!==null?(vu(i,x.cachePool),Oy(i,x),Sa(),i.memoizedState=null):(r!==null&&vu(i,null),wf(),Sa());return sn(r,i,p,o),i.child}function Bo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Tb(r,i,o,c,p){var x=gf();return x=x===null?null:{parent:Pt._currentValue,pool:x},i.memoizedState={baseLanes:o,cachePool:x},r!==null&&vu(i,null),wf(),Ry(i),r!==null&&rs(r,i,c,!0),i.childLanes=p,null}function $u(r,i){return i=Pu({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Ab(r,i,o){return xi(i,r.child,null,o),r=$u(i,i.pendingProps),r.flags|=2,In(i),i.memoizedState=null,r}function LN(r,i,o){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ie){if(c.mode==="hidden")return r=$u(i,c),i.lanes=536870912,Bo(null,r);if(zf(i),(r=xt)?(r=Iv(r,rr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:pa!==null?{id:Cr,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},o=my(r),o.return=i,i.child=o,rn=i,xt=null)):r=null,r===null)throw xa(i);return i.lanes=536870912,null}return $u(i,c)}var x=r.memoizedState;if(x!==null){var k=x.dehydrated;if(zf(i),p)if(i.flags&256)i.flags&=-257,i=Ab(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Vt||rs(r,i,o,!1),p=(o&r.childLanes)!==0,Vt||p){if(c=dt,c!==null&&(k=kx(c,o),k!==0&&k!==x.retryLane))throw x.retryLane=k,ui(r,k),On(c,r,k),Ff;Gu(),i=Ab(r,i,o)}else r=x.treeContext,xt=ir(k.nextSibling),rn=i,Ie=!0,ga=null,rr=!1,r!==null&&xy(i,r),i=$u(i,c),i.flags|=4096;return i}return r=Hr(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Lu(r,i){var o=i.ref;if(o===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(r===null||r.ref!==o)&&(i.flags|=4194816)}}function qf(r,i,o,c,p){return hi(i),o=jf(r,i,o,c,void 0,p),c=Nf(),r!==null&&!Vt?(Cf(r,i,p),Xr(r,i,p)):(Ie&&c&&of(i),i.flags|=1,sn(r,i,o,p),i.child)}function Ob(r,i,o,c,p,x){return hi(i),i.updateQueue=null,o=My(i,c,o,p),Dy(r),c=Nf(),r!==null&&!Vt?(Cf(r,i,x),Xr(r,i,x)):(Ie&&c&&of(i),i.flags|=1,sn(r,i,o,x),i.child)}function Rb(r,i,o,c,p){if(hi(i),i.stateNode===null){var x=Wi,k=o.contextType;typeof k=="object"&&k!==null&&(x=an(k)),x=new o(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=If,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},yf(i),k=o.contextType,x.context=typeof k=="object"&&k!==null?an(k):Wi,x.state=i.memoizedState,k=o.getDerivedStateFromProps,typeof k=="function"&&(Zf(i,o,k,c),x.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&If.enqueueReplaceState(x,x.state,null),$o(i,c,x,p),Mo(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){x=i.stateNode;var j=i.memoizedProps,D=bi(o,j);x.props=D;var F=x.context,Q=o.contextType;k=Wi,typeof Q=="object"&&Q!==null&&(k=an(Q));var re=o.getDerivedStateFromProps;Q=typeof re=="function"||typeof x.getSnapshotBeforeUpdate=="function",j=i.pendingProps!==j,Q||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(j||F!==k)&&bb(i,x,c,k),ba=!1;var q=i.memoizedState;x.state=q,$o(i,c,x,p),Mo(),F=i.memoizedState,j||q!==F||ba?(typeof re=="function"&&(Zf(i,o,re,c),F=i.memoizedState),(D=ba||yb(i,o,D,c,q,F,k))?(Q||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=F),x.props=c,x.state=F,x.context=k,c=D):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,bf(r,i),k=i.memoizedProps,Q=bi(o,k),x.props=Q,re=i.pendingProps,q=x.context,F=o.contextType,D=Wi,typeof F=="object"&&F!==null&&(D=an(F)),j=o.getDerivedStateFromProps,(F=typeof j=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==re||q!==D)&&bb(i,x,c,D),ba=!1,q=i.memoizedState,x.state=q,$o(i,c,x,p),Mo();var X=i.memoizedState;k!==re||q!==X||ba||r!==null&&r.dependencies!==null&&yu(r.dependencies)?(typeof j=="function"&&(Zf(i,o,j,c),X=i.memoizedState),(Q=ba||yb(i,o,Q,c,q,X,D)||r!==null&&r.dependencies!==null&&yu(r.dependencies))?(F||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,X,D),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,X,D)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=X),x.props=c,x.state=X,x.context=D,c=Q):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=1024),c=!1)}return x=c,Lu(r,i),c=(i.flags&128)!==0,x||c?(x=i.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,r!==null&&c?(i.child=xi(i,r.child,null,p),i.child=xi(i,null,o,p)):sn(r,i,o,p),i.memoizedState=x.state,r=i.child):r=Xr(r,i,p),r}function Db(r,i,o,c){return di(),i.flags|=256,sn(r,i,o,c),i.child}var Gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yf(r){return{baseLanes:r,cachePool:Sy()}}function Kf(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Fn),r}function Mb(r,i,o){var c=i.pendingProps,p=!1,x=(i.flags&128)!==0,k;if((k=x)||(k=r!==null&&r.memoizedState===null?!1:($t.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ie){if(p?wa(i):Sa(),(r=xt)?(r=Iv(r,rr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:pa!==null?{id:Cr,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},o=my(r),o.return=i,i.child=o,rn=i,xt=null)):r=null,r===null)throw xa(i);return Ah(r)?i.lanes=32:i.lanes=536870912,null}var j=c.children;return c=c.fallback,p?(Sa(),p=i.mode,j=Pu({mode:"hidden",children:j},p),c=ci(c,p,o,null),j.return=i,c.return=i,j.sibling=c,i.child=j,c=i.child,c.memoizedState=Yf(o),c.childLanes=Kf(r,k,o),i.memoizedState=Gf,Bo(null,c)):(wa(i),Xf(i,j))}var D=r.memoizedState;if(D!==null&&(j=D.dehydrated,j!==null)){if(x)i.flags&256?(wa(i),i.flags&=-257,i=Jf(r,i,o)):i.memoizedState!==null?(Sa(),i.child=r.child,i.flags|=128,i=null):(Sa(),j=c.fallback,p=i.mode,c=Pu({mode:"visible",children:c.children},p),j=ci(j,p,o,null),j.flags|=2,c.return=i,j.return=i,c.sibling=j,i.child=c,xi(i,r.child,null,o),c=i.child,c.memoizedState=Yf(o),c.childLanes=Kf(r,k,o),i.memoizedState=Gf,i=Bo(null,c));else if(wa(i),Ah(j)){if(k=j.nextSibling&&j.nextSibling.dataset,k)var F=k.dgst;k=F,c=Error(a(419)),c.stack="",c.digest=k,Eo({value:c,source:null,stack:null}),i=Jf(r,i,o)}else if(Vt||rs(r,i,o,!1),k=(o&r.childLanes)!==0,Vt||k){if(k=dt,k!==null&&(c=kx(k,o),c!==0&&c!==D.retryLane))throw D.retryLane=c,ui(r,c),On(k,r,c),Ff;Th(j)||Gu(),i=Jf(r,i,o)}else Th(j)?(i.flags|=192,i.child=r.child,i=null):(r=D.treeContext,xt=ir(j.nextSibling),rn=i,Ie=!0,ga=null,rr=!1,r!==null&&xy(i,r),i=Xf(i,c.children),i.flags|=4096);return i}return p?(Sa(),j=c.fallback,p=i.mode,D=r.child,F=D.sibling,c=Hr(D,{mode:"hidden",children:c.children}),c.subtreeFlags=D.subtreeFlags&65011712,F!==null?j=Hr(F,j):(j=ci(j,p,o,null),j.flags|=2),j.return=i,c.return=i,c.sibling=j,i.child=c,Bo(null,c),c=i.child,j=r.child.memoizedState,j===null?j=Yf(o):(p=j.cachePool,p!==null?(D=Pt._currentValue,p=p.parent!==D?{parent:D,pool:D}:p):p=Sy(),j={baseLanes:j.baseLanes|o,cachePool:p}),c.memoizedState=j,c.childLanes=Kf(r,k,o),i.memoizedState=Gf,Bo(r.child,c)):(wa(i),o=r.child,r=o.sibling,o=Hr(o,{mode:"visible",children:c.children}),o.return=i,o.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=o,i.memoizedState=null,o)}function Xf(r,i){return i=Pu({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Pu(r,i){return r=Bn(22,r,null,i),r.lanes=0,r}function Jf(r,i,o){return xi(i,r.child,null,o),r=Xf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function $b(r,i,o){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),ff(r.return,i,o)}function Qf(r,i,o,c,p,x){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:x}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=o,k.tailMode=p,k.treeForkCount=x)}function Lb(r,i,o){var c=i.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var k=$t.current,j=(k&2)!==0;if(j?(k=k&1|2,i.flags|=128):k&=1,w($t,k),sn(r,i,c,o),c=Ie?Co:0,!j&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&$b(r,o,i);else if(r.tag===19)$b(r,o,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(o=i.child,p=null;o!==null;)r=o.alternate,r!==null&&ju(r)===null&&(p=o),o=o.sibling;o=p,o===null?(p=i.child,i.child=null):(p=o.sibling,o.sibling=null),Qf(i,!1,p,o,x,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&ju(r)===null){i.child=p;break}r=p.sibling,p.sibling=o,o=p,p=r}Qf(i,!0,o,null,x,c);break;case"together":Qf(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Xr(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),ja|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(rs(r,i,o,!1),(o&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,o=Hr(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=Hr(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function Wf(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&yu(r)))}function PN(r,i,o){switch(i.tag){case 3:Pe(i,i.stateNode.containerInfo),ya(i,Pt,r.memoizedState.cache),di();break;case 27:case 5:pt(i);break;case 4:Pe(i,i.stateNode.containerInfo);break;case 10:ya(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,zf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(wa(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Mb(r,i,o):(wa(i),r=Xr(r,i,o),r!==null?r.sibling:null);wa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(o&i.childLanes)!==0,c||(rs(r,i,o,!1),c=(o&i.childLanes)!==0),p){if(c)return Lb(r,i,o);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w($t,$t.current),c)break;return null;case 22:return i.lanes=0,Eb(r,i,o,i.pendingProps);case 24:ya(i,Pt,r.memoizedState.cache)}return Xr(r,i,o)}function Pb(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Vt=!0;else{if(!Wf(r,o)&&(i.flags&128)===0)return Vt=!1,PN(r,i,o);Vt=(r.flags&131072)!==0}else Vt=!1,Ie&&(i.flags&1048576)!==0&&gy(i,Co,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=pi(i.elementType),i.type=r,typeof r=="function")rf(r)?(c=bi(r,c),i.tag=1,i=Rb(null,i,r,c,o)):(i.tag=0,i=qf(null,i,r,c,o));else{if(r!=null){var p=r.$$typeof;if(p===P){i.tag=11,i=jb(null,i,r,c,o);break e}else if(p===I){i.tag=14,i=Nb(null,i,r,c,o);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return qf(r,i,i.type,i.pendingProps,o);case 1:return c=i.type,p=bi(c,i.pendingProps),Rb(r,i,c,p,o);case 3:e:{if(Pe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;p=x.element,bf(r,i),$o(i,c,null,o);var k=i.memoizedState;if(c=k.cache,ya(i,Pt,c),c!==x.cache&&hf(i,[Pt],o,!0),Mo(),c=k.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=Db(r,i,c,o);break e}else if(c!==p){p=er(Error(a(424)),i),Eo(p),i=Db(r,i,c,o);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,xt=ir(r.firstChild),rn=i,Ie=!0,ga=null,rr=!0,o=Ey(i,null,c,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(di(),c===p){i=Xr(r,i,o);break e}sn(r,i,c,o)}i=i.child}return i;case 26:return Lu(r,i),r===null?(o=Kv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Ie||(o=i.type,r=i.pendingProps,c=ec(he.current).createElement(o),c[nn]=i,c[jn]=r,on(c,o,r),Wt(c),i.stateNode=c):i.memoizedState=Kv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return pt(i),r===null&&Ie&&(c=i.stateNode=qv(i.type,i.pendingProps,he.current),rn=i,rr=!0,p=xt,Aa(i.type)?(Oh=p,xt=ir(c.firstChild)):xt=p),sn(r,i,i.pendingProps.children,o),Lu(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ie&&((p=c=xt)&&(c=mC(c,i.type,i.pendingProps,rr),c!==null?(i.stateNode=c,rn=i,xt=ir(c.firstChild),rr=!1,p=!0):p=!1),p||xa(i)),pt(i),p=i.type,x=i.pendingProps,k=r!==null?r.memoizedProps:null,c=x.children,Nh(p,x)?c=null:k!==null&&Nh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=jf(r,i,EN,null,null,o),nl._currentValue=p),Lu(r,i),sn(r,i,c,o),i.child;case 6:return r===null&&Ie&&((r=o=xt)&&(o=pC(o,i.pendingProps,rr),o!==null?(i.stateNode=o,rn=i,xt=null,r=!0):r=!1),r||xa(i)),null;case 13:return Mb(r,i,o);case 4:return Pe(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=xi(i,null,c,o):sn(r,i,c,o),i.child;case 11:return jb(r,i,i.type,i.pendingProps,o);case 7:return sn(r,i,i.pendingProps,o),i.child;case 8:return sn(r,i,i.pendingProps.children,o),i.child;case 12:return sn(r,i,i.pendingProps.children,o),i.child;case 10:return c=i.pendingProps,ya(i,i.type,c.value),sn(r,i,c.children,o),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,hi(i),p=an(p),c=c(p),i.flags|=1,sn(r,i,c,o),i.child;case 14:return Nb(r,i,i.type,i.pendingProps,o);case 15:return Cb(r,i,i.type,i.pendingProps,o);case 19:return Lb(r,i,o);case 31:return LN(r,i,o);case 22:return Eb(r,i,o,i.pendingProps);case 24:return hi(i),c=an(Pt),r===null?(p=gf(),p===null&&(p=dt,x=mf(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),i.memoizedState={parent:c,cache:p},yf(i),ya(i,Pt,p)):((r.lanes&o)!==0&&(bf(r,i),$o(i,null,null,o),Mo()),p=r.memoizedState,x=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),ya(i,Pt,c)):(c=x.cache,ya(i,Pt,c),c!==p.cache&&hf(i,[Pt],o,!0))),sn(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Jr(r){r.flags|=4}function eh(r,i,o,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(dv())r.flags|=8192;else throw gi=wu,xf}else r.flags&=-16777217}function Ub(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!e0(i))if(dv())r.flags|=8192;else throw gi=wu,xf}function Uu(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?yx():536870912,r.lanes|=i,ps|=i)}function Zo(r,i){if(!Ie)switch(r.tailMode){case"hidden":i=r.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?r.tail=null:o.sibling=null;break;case"collapsed":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function yt(r){var i=r.alternate!==null&&r.alternate.child===r.child,o=0,c=0;if(i)for(var p=r.child;p!==null;)o|=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;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=o,i}function UN(r,i,o){var c=i.pendingProps;switch(lf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(i),null;case 1:return yt(i),null;case 3:return o=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Gr(Pt),Ae(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(ns(i)?Jr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,cf())),yt(i),null;case 26:var p=i.type,x=i.memoizedState;return r===null?(Jr(i),x!==null?(yt(i),Ub(i,x)):(yt(i),eh(i,p,null,c,o))):x?x!==r.memoizedState?(Jr(i),yt(i),Ub(i,x)):(yt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&Jr(i),yt(i),eh(i,p,r,c,o)),null;case 27:if(Dt(i),o=he.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Jr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return yt(i),null}r=G.current,ns(i)?yy(i):(r=qv(p,c,o),i.stateNode=r,Jr(i))}return yt(i),null;case 5:if(Dt(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Jr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return yt(i),null}if(x=G.current,ns(i))yy(i);else{var k=ec(he.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?k.createElement(p,{is:c.is}):k.createElement(p)}}x[nn]=i,x[jn]=c;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)x.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=x;e:switch(on(x,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&&Jr(i)}}return yt(i),eh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&Jr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=he.current,ns(i)){if(r=i.stateNode,o=i.memoizedProps,c=null,p=rn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[nn]=i,r=!!(r.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Mv(r.nodeValue,o)),r||xa(i,!0)}else r=ec(r).createTextNode(c),r[nn]=i,i.stateNode=r}return yt(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(c=ns(i),o!==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[nn]=i}else di(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),r=!1}else o=cf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(In(i),i):(In(i),null);if((i.flags&128)!==0)throw Error(a(558))}return yt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=ns(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[nn]=i}else di(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),p=!1}else p=cf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(In(i),i):(In(i),null)}return In(i),(i.flags&128)!==0?(i.lanes=o,i):(o=c!==null,r=r!==null&&r.memoizedState!==null,o&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048)),o!==r&&o&&(i.child.flags|=8192),Uu(i,i.updateQueue),yt(i),null);case 4:return Ae(),r===null&&wh(i.stateNode.containerInfo),yt(i),null;case 10:return Gr(i.type),yt(i),null;case 19:if(U($t),c=i.memoizedState,c===null)return yt(i),null;if(p=(i.flags&128)!==0,x=c.rendering,x===null)if(p)Zo(c,!1);else{if(Ot!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(x=ju(r),x!==null){for(i.flags|=128,Zo(c,!1),r=x.updateQueue,i.updateQueue=r,Uu(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)hy(o,r),o=o.sibling;return w($t,$t.current&1|2),Ie&&Fr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&>()>Hu&&(i.flags|=128,p=!0,Zo(c,!1),i.lanes=4194304)}else{if(!p)if(r=ju(x),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Uu(i,r),Zo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Ie)return yt(i),null}else 2*gt()-c.renderingStartTime>Hu&&o!==536870912&&(i.flags|=128,p=!0,Zo(c,!1),i.lanes=4194304);c.isBackwards?(x.sibling=i.child,i.child=x):(r=c.last,r!==null?r.sibling=x:i.child=x,c.last=x)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=gt(),r.sibling=null,o=$t.current,w($t,p?o&1|2:o&1),Ie&&Fr(i,c.treeForkCount),r):(yt(i),null);case 22:case 23:return In(i),Sf(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(o&536870912)!==0&&(i.flags&128)===0&&(yt(i),i.subtreeFlags&6&&(i.flags|=8192)):yt(i),o=i.updateQueue,o!==null&&Uu(i,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048),r!==null&&U(mi),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Gr(Pt),yt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function VN(r,i){switch(lf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Gr(Pt),Ae(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Dt(i),null;case 31:if(i.memoizedState!==null){if(In(i),i.alternate===null)throw Error(a(340));di()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(In(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));di()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return U($t),null;case 4:return Ae(),null;case 10:return Gr(i.type),null;case 22:case 23:return In(i),Sf(),r!==null&&U(mi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Gr(Pt),null;case 25:return null;default:return null}}function Vb(r,i){switch(lf(i),i.tag){case 3:Gr(Pt),Ae();break;case 26:case 27:case 5:Dt(i);break;case 4:Ae();break;case 31:i.memoizedState!==null&&In(i);break;case 13:In(i);break;case 19:U($t);break;case 10:Gr(i.type);break;case 22:case 23:In(i),Sf(),r!==null&&U(mi);break;case 24:Gr(Pt)}}function Io(r,i){try{var o=i.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&r)===r){c=void 0;var x=o.create,k=o.inst;c=x(),k.destroy=c}o=o.next}while(o!==p)}}catch(j){at(i,i.return,j)}}function za(r,i,o){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var x=p.next;c=x;do{if((c.tag&r)===r){var k=c.inst,j=k.destroy;if(j!==void 0){k.destroy=void 0,p=i;var D=o,F=j;try{F()}catch(Q){at(p,D,Q)}}}c=c.next}while(c!==x)}}catch(Q){at(i,i.return,Q)}}function Bb(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{Ay(i,o)}catch(c){at(r,r.return,c)}}}function Zb(r,i,o){o.props=bi(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(c){at(r,i,c)}}function Ho(r,i){try{var o=r.ref;if(o!==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 o=="function"?r.refCleanup=o(c):o.current=c}}catch(p){at(r,i,p)}}function Tr(r,i){var o=r.ref,c=r.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){at(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){at(r,i,p)}else o.current=null}function Ib(r){var i=r.type,o=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){at(r,r.return,p)}}function th(r,i,o){try{var c=r.stateNode;lC(c,r.type,o,i),c[jn]=i}catch(p){at(r,r.return,p)}}function Hb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Aa(r.type)||r.tag===4}function nh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Hb(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&&Aa(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function rh(r,i,o){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(r),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Zr));else if(c!==4&&(c===27&&Aa(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(rh(r,i,o),r=r.sibling;r!==null;)rh(r,i,o),r=r.sibling}function Vu(r,i,o){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?o.insertBefore(r,i):o.appendChild(r);else if(c!==4&&(c===27&&Aa(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Vu(r,i,o),r=r.sibling;r!==null;)Vu(r,i,o),r=r.sibling}function Fb(r){var i=r.stateNode,o=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);on(i,c,o),i[nn]=r,i[jn]=o}catch(x){at(r,r.return,x)}}var Qr=!1,Bt=!1,ah=!1,qb=typeof WeakSet=="function"?WeakSet:Set,en=null;function BN(r,i){if(r=r.containerInfo,_h=oc,r=ay(r),Xd(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var k=0,j=-1,D=-1,F=0,Q=0,re=r,q=null;t:for(;;){for(var X;re!==o||p!==0&&re.nodeType!==3||(j=k+p),re!==x||c!==0&&re.nodeType!==3||(D=k+c),re.nodeType===3&&(k+=re.nodeValue.length),(X=re.firstChild)!==null;)q=re,re=X;for(;;){if(re===r)break t;if(q===o&&++F===p&&(j=k),q===x&&++Q===c&&(D=k),(X=re.nextSibling)!==null)break;re=q,q=re.parentNode}re=X}o=j===-1||D===-1?null:{start:j,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(jh={focusedElem:r,selectionRange:o},oc=!1,en=i;en!==null;)if(i=en,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,en=r;else for(;en!==null;){switch(i=en,x=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(o=0;o<r.length;o++)p=r[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&x!==null){r=void 0,o=i,p=x.memoizedProps,x=x.memoizedState,c=o.stateNode;try{var ge=bi(o.type,p);r=c.getSnapshotBeforeUpdate(ge,x),c.__reactInternalSnapshotBeforeUpdate=r}catch(Ne){at(o,o.return,Ne)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)Eh(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Eh(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,en=r;break}en=i.return}}function Gb(r,i,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:ea(r,o),c&4&&Io(5,o);break;case 1:if(ea(r,o),c&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(k){at(o,o.return,k)}else{var p=bi(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){at(o,o.return,k)}}c&64&&Bb(o),c&512&&Ho(o,o.return);break;case 3:if(ea(r,o),c&64&&(r=o.updateQueue,r!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{Ay(r,i)}catch(k){at(o,o.return,k)}}break;case 27:i===null&&c&4&&Fb(o);case 26:case 5:ea(r,o),i===null&&c&4&&Ib(o),c&512&&Ho(o,o.return);break;case 12:ea(r,o);break;case 31:ea(r,o),c&4&&Xb(r,o);break;case 13:ea(r,o),c&4&&Jb(r,o),c&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=XN.bind(null,o),gC(r,o))));break;case 22:if(c=o.memoizedState!==null||Qr,!c){i=i!==null&&i.memoizedState!==null||Bt,p=Qr;var x=Bt;Qr=c,(Bt=i)&&!x?ta(r,o,(o.subtreeFlags&8772)!==0):ea(r,o),Qr=p,Bt=x}break;case 30:break;default:ea(r,o)}}function Yb(r){var i=r.alternate;i!==null&&(r.alternate=null,Yb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Rd(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 vt=null,Cn=!1;function Wr(r,i,o){for(o=o.child;o!==null;)Kb(r,i,o),o=o.sibling}function Kb(r,i,o){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(xn,o)}catch{}switch(o.tag){case 26:Bt||Tr(o,i),Wr(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Bt||Tr(o,i);var c=vt,p=Cn;Aa(o.type)&&(vt=o.stateNode,Cn=!1),Wr(r,i,o),Wo(o.stateNode),vt=c,Cn=p;break;case 5:Bt||Tr(o,i);case 6:if(c=vt,p=Cn,vt=null,Wr(r,i,o),vt=c,Cn=p,vt!==null)if(Cn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(o.stateNode)}catch(x){at(o,i,x)}else try{vt.removeChild(o.stateNode)}catch(x){at(o,i,x)}break;case 18:vt!==null&&(Cn?(r=vt,Bv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),Ss(r)):Bv(vt,o.stateNode));break;case 4:c=vt,p=Cn,vt=o.stateNode.containerInfo,Cn=!0,Wr(r,i,o),vt=c,Cn=p;break;case 0:case 11:case 14:case 15:za(2,o,i),Bt||za(4,o,i),Wr(r,i,o);break;case 1:Bt||(Tr(o,i),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Zb(o,i,c)),Wr(r,i,o);break;case 21:Wr(r,i,o);break;case 22:Bt=(c=Bt)||o.memoizedState!==null,Wr(r,i,o),Bt=c;break;default:Wr(r,i,o)}}function Xb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Ss(r)}catch(o){at(i,i.return,o)}}}function Jb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Ss(r)}catch(o){at(i,i.return,o)}}function ZN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new qb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new qb),i;default:throw Error(a(435,r.tag))}}function Bu(r,i){var o=ZN(r);i.forEach(function(c){if(!o.has(c)){o.add(c);var p=JN.bind(null,r,c);c.then(p,p)}})}function En(r,i){var o=i.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],x=r,k=i,j=k;e:for(;j!==null;){switch(j.tag){case 27:if(Aa(j.type)){vt=j.stateNode,Cn=!1;break e}break;case 5:vt=j.stateNode,Cn=!1;break e;case 3:case 4:vt=j.stateNode.containerInfo,Cn=!0;break e}j=j.return}if(vt===null)throw Error(a(160));Kb(x,k,p),vt=null,Cn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Qb(i,r),i=i.sibling}var vr=null;function Qb(r,i){var o=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:En(i,r),Tn(r),c&4&&(za(3,r,r.return),Io(3,r),za(5,r,r.return));break;case 1:En(i,r),Tn(r),c&512&&(Bt||o===null||Tr(o,o.return)),c&64&&Qr&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=vr;if(En(i,r),Tn(r),c&512&&(Bt||o===null||Tr(o,o.return)),c&4){var x=o!==null?o.memoizedState:null;if(c=r.memoizedState,o===null)if(c===null)if(r.stateNode===null){e:{c=r.type,o=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":x=p.getElementsByTagName("title")[0],(!x||x[xo]||x[nn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),on(x,c,o),x[nn]=r,Wt(x),c=x;break e;case"link":var k=Qv("link","href",p).get(c+(o.href||""));if(k){for(var j=0;j<k.length;j++)if(x=k[j],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(j,1);break t}}x=p.createElement(c),on(x,c,o),p.head.appendChild(x);break;case"meta":if(k=Qv("meta","content",p).get(c+(o.content||""))){for(j=0;j<k.length;j++)if(x=k[j],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(j,1);break t}}x=p.createElement(c),on(x,c,o),p.head.appendChild(x);break;default:throw Error(a(468,c))}x[nn]=r,Wt(x),c=x}r.stateNode=c}else Wv(p,r.type,r.stateNode);else r.stateNode=Jv(p,c,r.memoizedProps);else x!==c?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,c===null?Wv(p,r.type,r.stateNode):Jv(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&th(r,r.memoizedProps,o.memoizedProps)}break;case 27:En(i,r),Tn(r),c&512&&(Bt||o===null||Tr(o,o.return)),o!==null&&c&4&&th(r,r.memoizedProps,o.memoizedProps);break;case 5:if(En(i,r),Tn(r),c&512&&(Bt||o===null||Tr(o,o.return)),r.flags&32){p=r.stateNode;try{qi(p,"")}catch(ge){at(r,r.return,ge)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,th(r,p,o!==null?o.memoizedProps:p)),c&1024&&(ah=!0);break;case 6:if(En(i,r),Tn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,o=r.stateNode;try{o.nodeValue=c}catch(ge){at(r,r.return,ge)}}break;case 3:if(rc=null,p=vr,vr=tc(i.containerInfo),En(i,r),vr=p,Tn(r),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Ss(i.containerInfo)}catch(ge){at(r,r.return,ge)}ah&&(ah=!1,Wb(r));break;case 4:c=vr,vr=tc(r.stateNode.containerInfo),En(i,r),Tn(r),vr=c;break;case 12:En(i,r),Tn(r);break;case 31:En(i,r),Tn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Bu(r,c)));break;case 13:En(i,r),Tn(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Iu=gt()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Bu(r,c)));break;case 22:p=r.memoizedState!==null;var D=o!==null&&o.memoizedState!==null,F=Qr,Q=Bt;if(Qr=F||p,Bt=Q||D,En(i,r),Bt=Q,Qr=F,Tn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||D||Qr||Bt||vi(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){D=o=i;try{if(x=D.stateNode,p)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{j=D.stateNode;var re=D.memoizedProps.style,q=re!=null&&re.hasOwnProperty("display")?re.display:null;j.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(ge){at(D,D.return,ge)}}}else if(i.tag===6){if(o===null){D=i;try{D.stateNode.nodeValue=p?"":D.memoizedProps}catch(ge){at(D,D.return,ge)}}}else if(i.tag===18){if(o===null){D=i;try{var X=D.stateNode;p?Zv(X,!0):Zv(D.stateNode,!1)}catch(ge){at(D,D.return,ge)}}}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;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=r.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,Bu(r,o))));break;case 19:En(i,r),Tn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Bu(r,c)));break;case 30:break;case 21:break;default:En(i,r),Tn(r)}}function Tn(r){var i=r.flags;if(i&2){try{for(var o,c=r.return;c!==null;){if(Hb(c)){o=c;break}c=c.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,x=nh(r);Vu(r,x,p);break;case 5:var k=o.stateNode;o.flags&32&&(qi(k,""),o.flags&=-33);var j=nh(r);Vu(r,j,k);break;case 3:case 4:var D=o.stateNode.containerInfo,F=nh(r);rh(r,F,D);break;default:throw Error(a(161))}}catch(Q){at(r,r.return,Q)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Wb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Wb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ea(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Gb(r,i.alternate,i),i=i.sibling}function vi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:za(4,i,i.return),vi(i);break;case 1:Tr(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&Zb(i,i.return,o),vi(i);break;case 27:Wo(i.stateNode);case 26:case 5:Tr(i,i.return),vi(i);break;case 22:i.memoizedState===null&&vi(i);break;case 30:vi(i);break;default:vi(i)}r=r.sibling}}function ta(r,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,x=i,k=x.flags;switch(x.tag){case 0:case 11:case 15:ta(p,x,o),Io(4,x);break;case 1:if(ta(p,x,o),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(F){at(c,c.return,F)}if(c=x,p=c.updateQueue,p!==null){var j=c.stateNode;try{var D=p.shared.hiddenCallbacks;if(D!==null)for(p.shared.hiddenCallbacks=null,p=0;p<D.length;p++)Ty(D[p],j)}catch(F){at(c,c.return,F)}}o&&k&64&&Bb(x),Ho(x,x.return);break;case 27:Fb(x);case 26:case 5:ta(p,x,o),o&&c===null&&k&4&&Ib(x),Ho(x,x.return);break;case 12:ta(p,x,o);break;case 31:ta(p,x,o),o&&k&4&&Xb(p,x);break;case 13:ta(p,x,o),o&&k&4&&Jb(p,x);break;case 22:x.memoizedState===null&&ta(p,x,o),Ho(x,x.return);break;case 30:break;default:ta(p,x,o)}i=i.sibling}}function ih(r,i){var o=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==o&&(r!=null&&r.refCount++,o!=null&&To(o))}function sh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&To(r))}function kr(r,i,o,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ev(r,i,o,c),i=i.sibling}function ev(r,i,o,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:kr(r,i,o,c),p&2048&&Io(9,i);break;case 1:kr(r,i,o,c);break;case 3:kr(r,i,o,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&To(r)));break;case 12:if(p&2048){kr(r,i,o,c),r=i.stateNode;try{var x=i.memoizedProps,k=x.id,j=x.onPostCommit;typeof j=="function"&&j(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(D){at(i,i.return,D)}}else kr(r,i,o,c);break;case 31:kr(r,i,o,c);break;case 13:kr(r,i,o,c);break;case 23:break;case 22:x=i.stateNode,k=i.alternate,i.memoizedState!==null?x._visibility&2?kr(r,i,o,c):Fo(r,i):x._visibility&2?kr(r,i,o,c):(x._visibility|=2,fs(r,i,o,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&ih(k,i);break;case 24:kr(r,i,o,c),p&2048&&sh(i.alternate,i);break;default:kr(r,i,o,c)}}function fs(r,i,o,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=r,k=i,j=o,D=c,F=k.flags;switch(k.tag){case 0:case 11:case 15:fs(x,k,j,D,p),Io(8,k);break;case 23:break;case 22:var Q=k.stateNode;k.memoizedState!==null?Q._visibility&2?fs(x,k,j,D,p):Fo(x,k):(Q._visibility|=2,fs(x,k,j,D,p)),p&&F&2048&&ih(k.alternate,k);break;case 24:fs(x,k,j,D,p),p&&F&2048&&sh(k.alternate,k);break;default:fs(x,k,j,D,p)}i=i.sibling}}function Fo(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=r,c=i,p=c.flags;switch(c.tag){case 22:Fo(o,c),p&2048&&ih(c.alternate,c);break;case 24:Fo(o,c),p&2048&&sh(c.alternate,c);break;default:Fo(o,c)}i=i.sibling}}var qo=8192;function hs(r,i,o){if(r.subtreeFlags&qo)for(r=r.child;r!==null;)tv(r,i,o),r=r.sibling}function tv(r,i,o){switch(r.tag){case 26:hs(r,i,o),r.flags&qo&&r.memoizedState!==null&&CC(o,vr,r.memoizedState,r.memoizedProps);break;case 5:hs(r,i,o);break;case 3:case 4:var c=vr;vr=tc(r.stateNode.containerInfo),hs(r,i,o),vr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=qo,qo=16777216,hs(r,i,o),qo=c):hs(r,i,o));break;default:hs(r,i,o)}}function nv(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 Go(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];en=c,av(c,r)}nv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)rv(r),r=r.sibling}function rv(r){switch(r.tag){case 0:case 11:case 15:Go(r),r.flags&2048&&za(9,r,r.return);break;case 3:Go(r);break;case 12:Go(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Zu(r)):Go(r);break;default:Go(r)}}function Zu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];en=c,av(c,r)}nv(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:za(8,i,i.return),Zu(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,Zu(i));break;default:Zu(i)}r=r.sibling}}function av(r,i){for(;en!==null;){var o=en;switch(o.tag){case 0:case 11:case 15:za(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:To(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,en=c;else e:for(o=r;en!==null;){c=en;var p=c.sibling,x=c.return;if(Yb(c),c===o){en=null;break e}if(p!==null){p.return=x,en=p;break e}en=x}}}var IN={getCacheForType:function(r){var i=an(Pt),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return an(Pt).controller.signal}},HN=typeof WeakMap=="function"?WeakMap:Map,We=0,dt=null,Ue=null,Be=0,rt=0,Hn=null,_a=!1,ms=!1,oh=!1,na=0,Ot=0,ja=0,ki=0,lh=0,Fn=0,ps=0,Yo=null,An=null,uh=!1,Iu=0,iv=0,Hu=1/0,Fu=null,Na=null,Kt=0,Ca=null,gs=null,ra=0,ch=0,dh=null,sv=null,Ko=0,fh=null;function qn(){return(We&2)!==0&&Be!==0?Be&-Be:V.T!==null?yh():wx()}function ov(){if(Fn===0)if((Be&536870912)===0||Ie){var r=Wl;Wl<<=1,(Wl&3932160)===0&&(Wl=262144),Fn=r}else Fn=536870912;return r=Zn.current,r!==null&&(r.flags|=32),Fn}function On(r,i,o){(r===dt&&(rt===2||rt===9)||r.cancelPendingCommit!==null)&&(xs(r,0),Ea(r,Be,Fn,!1)),go(r,o),((We&2)===0||r!==dt)&&(r===dt&&((We&2)===0&&(ki|=o),Ot===4&&Ea(r,Be,Fn,!1)),Ar(r))}function lv(r,i,o){if((We&6)!==0)throw Error(a(327));var c=!o&&(i&127)===0&&(i&r.expiredLanes)===0||po(r,i),p=c?GN(r,i):mh(r,i,!0),x=c;do{if(p===0){ms&&!c&&Ea(r,i,0,!1);break}else{if(o=r.current.alternate,x&&!FN(o)){p=mh(r,i,!1),x=!1;continue}if(p===2){if(x=i,r.errorRecoveryDisabledLanes&x)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var j=r;p=Yo;var D=j.current.memoizedState.isDehydrated;if(D&&(xs(j,k).flags|=256),k=mh(j,k,!1),k!==2){if(oh&&!D){j.errorRecoveryDisabledLanes|=x,ki|=x,p=4;break e}x=An,An=p,x!==null&&(An===null?An=x:An.push.apply(An,x))}p=k}if(x=!1,p!==2)continue}}if(p===1){xs(r,0),Ea(r,i,0,!0);break}e:{switch(c=r,x=p,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ea(c,i,Fn,!_a);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Iu+300-gt(),10<p)){if(Ea(c,i,Fn,!_a),tu(c,0,!0)!==0)break e;ra=i,c.timeoutHandle=Uv(uv.bind(null,c,o,An,Fu,uh,i,Fn,ki,ps,_a,x,"Throttled",-0,0),p);break e}uv(c,o,An,Fu,uh,i,Fn,ki,ps,_a,x,null,-0,0)}}break}while(!0);Ar(r)}function uv(r,i,o,c,p,x,k,j,D,F,Q,re,q,X){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:Zr},tv(i,x,re);var ge=(x&62914560)===x?Iu-gt():(x&4194048)===x?iv-gt():0;if(ge=EC(re,ge),ge!==null){ra=x,r.cancelPendingCommit=ge(xv.bind(null,r,i,x,o,c,p,k,j,D,Q,re,null,q,X)),Ea(r,x,k,!F);return}}xv(r,i,x,o,c,p,k,j,D)}function FN(r){for(var i=r;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],x=p.getSnapshot;p=p.value;try{if(!Vn(x(),p))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;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 Ea(r,i,o,c){i&=~lh,i&=~ki,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var x=31-ct(p),k=1<<x;c[x]=-1,p&=~k}o!==0&&bx(r,o,i)}function qu(){return(We&6)===0?(Xo(0),!1):!0}function hh(){if(Ue!==null){if(rt===0)var r=Ue.return;else r=Ue,qr=fi=null,Ef(r),os=null,Oo=0,r=Ue;for(;r!==null;)Vb(r.alternate,r),r=r.return;Ue=null}}function xs(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,dC(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),ra=0,hh(),dt=r,Ue=o=Hr(r.current,null),Be=i,rt=0,Hn=null,_a=!1,ms=po(r,i),oh=!1,ps=Fn=lh=ki=ja=Ot=0,An=Yo=null,uh=!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-ct(c),x=1<<p;i|=r[p],c&=~x}return na=i,hu(),o}function cv(r,i){De=null,V.H=Vo,i===ss||i===ku?(i=jy(),rt=3):i===xf?(i=jy(),rt=4):rt=i===Ff?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Hn=i,Ue===null&&(Ot=1,Mu(r,er(i,r.current)))}function dv(){var r=Zn.current;return r===null?!0:(Be&4194048)===Be?ar===null:(Be&62914560)===Be||(Be&536870912)!==0?r===ar:!1}function fv(){var r=V.H;return V.H=Vo,r===null?Vo:r}function hv(){var r=V.A;return V.A=IN,r}function Gu(){Ot=4,_a||(Be&4194048)!==Be&&Zn.current!==null||(ms=!0),(ja&134217727)===0&&(ki&134217727)===0||dt===null||Ea(dt,Be,Fn,!1)}function mh(r,i,o){var c=We;We|=2;var p=fv(),x=hv();(dt!==r||Be!==i)&&(Fu=null,xs(r,i)),i=!1;var k=Ot;e:do try{if(rt!==0&&Ue!==null){var j=Ue,D=Hn;switch(rt){case 8:hh(),k=6;break e;case 3:case 2:case 9:case 6:Zn.current===null&&(i=!0);var F=rt;if(rt=0,Hn=null,ys(r,j,D,F),o&&ms){k=0;break e}break;default:F=rt,rt=0,Hn=null,ys(r,j,D,F)}}qN(),k=Ot;break}catch(Q){cv(r,Q)}while(!0);return i&&r.shellSuspendCounter++,qr=fi=null,We=c,V.H=p,V.A=x,Ue===null&&(dt=null,Be=0,hu()),k}function qN(){for(;Ue!==null;)mv(Ue)}function GN(r,i){var o=We;We|=2;var c=fv(),p=hv();dt!==r||Be!==i?(Fu=null,Hu=gt()+500,xs(r,i)):ms=po(r,i);e:do try{if(rt!==0&&Ue!==null){i=Ue;var x=Hn;t:switch(rt){case 1:rt=0,Hn=null,ys(r,i,x,1);break;case 2:case 9:if(zy(x)){rt=0,Hn=null,pv(i);break}i=function(){rt!==2&&rt!==9||dt!==r||(rt=7),Ar(r)},x.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:zy(x)?(rt=0,Hn=null,pv(i)):(rt=0,Hn=null,ys(r,i,x,7));break;case 5:var k=null;switch(Ue.tag){case 26:k=Ue.memoizedState;case 5:case 27:var j=Ue;if(k?e0(k):j.stateNode.complete){rt=0,Hn=null;var D=j.sibling;if(D!==null)Ue=D;else{var F=j.return;F!==null?(Ue=F,Yu(F)):Ue=null}break t}}rt=0,Hn=null,ys(r,i,x,5);break;case 6:rt=0,Hn=null,ys(r,i,x,6);break;case 8:hh(),Ot=6;break e;default:throw Error(a(462))}}YN();break}catch(Q){cv(r,Q)}while(!0);return qr=fi=null,V.H=c,V.A=p,We=o,Ue!==null?0:(dt=null,Be=0,hu(),Ot)}function YN(){for(;Ue!==null&&!Mt();)mv(Ue)}function mv(r){var i=Pb(r.alternate,r,na);r.memoizedProps=r.pendingProps,i===null?Yu(r):Ue=i}function pv(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=Ob(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Ob(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:Ef(i);default:Vb(o,i),i=Ue=hy(i,na),i=Pb(o,i,na)}r.memoizedProps=r.pendingProps,i===null?Yu(r):Ue=i}function ys(r,i,o,c){qr=fi=null,Ef(i),os=null,Oo=0;var p=i.return;try{if($N(r,p,i,o,Be)){Ot=1,Mu(r,er(o,r.current)),Ue=null;return}}catch(x){if(p!==null)throw Ue=p,x;Ot=1,Mu(r,er(o,r.current)),Ue=null;return}i.flags&32768?(Ie||c===1?r=!0:ms||(Be&536870912)!==0?r=!1:(_a=r=!0,(c===2||c===9||c===3||c===6)&&(c=Zn.current,c!==null&&c.tag===13&&(c.flags|=16384))),gv(i,r)):Yu(i)}function Yu(r){var i=r;do{if((i.flags&32768)!==0){gv(i,_a);return}r=i.return;var o=UN(i.alternate,i,na);if(o!==null){Ue=o;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=r}while(i!==null);Ot===0&&(Ot=5)}function gv(r,i){do{var o=VN(r.alternate,r);if(o!==null){o.flags&=32767,Ue=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Ue=r;return}Ue=r=o}while(r!==null);Ot=6,Ue=null}function xv(r,i,o,c,p,x,k,j,D){r.cancelPendingCommit=null;do Ku();while(Kt!==0);if((We&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=tf,N2(r,o,x,k,j,D),r===dt&&(Ue=dt=null,Be=0),gs=i,Ca=r,ra=o,ch=x,dh=p,sv=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,QN(we,function(){return wv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=V.T,V.T=null,p=J.p,J.p=2,k=We,We|=4;try{BN(r,i,o)}finally{We=k,J.p=p,V.T=c}}Kt=1,yv(),bv(),vv()}}function yv(){if(Kt===1){Kt=0;var r=Ca,i=gs,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=V.T,V.T=null;var c=J.p;J.p=2;var p=We;We|=4;try{Qb(i,r);var x=jh,k=ay(r.containerInfo),j=x.focusedElem,D=x.selectionRange;if(k!==j&&j&&j.ownerDocument&&ry(j.ownerDocument.documentElement,j)){if(D!==null&&Xd(j)){var F=D.start,Q=D.end;if(Q===void 0&&(Q=F),"selectionStart"in j)j.selectionStart=F,j.selectionEnd=Math.min(Q,j.value.length);else{var re=j.ownerDocument||document,q=re&&re.defaultView||window;if(q.getSelection){var X=q.getSelection(),ge=j.textContent.length,Ne=Math.min(D.start,ge),ut=D.end===void 0?Ne:Math.min(D.end,ge);!X.extend&&Ne>ut&&(k=ut,ut=Ne,Ne=k);var Z=ny(j,Ne),L=ny(j,ut);if(Z&&L&&(X.rangeCount!==1||X.anchorNode!==Z.node||X.anchorOffset!==Z.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var H=re.createRange();H.setStart(Z.node,Z.offset),X.removeAllRanges(),Ne>ut?(X.addRange(H),X.extend(L.node,L.offset)):(H.setEnd(L.node,L.offset),X.addRange(H))}}}}for(re=[],X=j;X=X.parentNode;)X.nodeType===1&&re.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<re.length;j++){var ne=re[j];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}oc=!!_h,jh=_h=null}finally{We=p,J.p=c,V.T=o}}r.current=i,Kt=2}}function bv(){if(Kt===2){Kt=0;var r=Ca,i=gs,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=V.T,V.T=null;var c=J.p;J.p=2;var p=We;We|=4;try{Gb(r,i.alternate,i)}finally{We=p,J.p=c,V.T=o}}Kt=3}}function vv(){if(Kt===4||Kt===3){Kt=0,Gt();var r=Ca,i=gs,o=ra,c=sv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,gs=Ca=null,kv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Na=null),Ad(o),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(xn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=V.T,p=J.p,J.p=2,V.T=null;try{for(var x=r.onRecoverableError,k=0;k<c.length;k++){var j=c[k];x(j.value,{componentStack:j.stack})}}finally{V.T=i,J.p=p}}(ra&3)!==0&&Ku(),Ar(r),p=r.pendingLanes,(o&261930)!==0&&(p&42)!==0?r===fh?Ko++:(Ko=0,fh=r):Ko=0,Xo(0)}}function kv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,To(i)))}function Ku(){return yv(),bv(),vv(),wv()}function wv(){if(Kt!==5)return!1;var r=Ca,i=ch;ch=0;var o=Ad(ra),c=V.T,p=J.p;try{J.p=32>o?32:o,V.T=null,o=dh,dh=null;var x=Ca,k=ra;if(Kt=0,gs=Ca=null,ra=0,(We&6)!==0)throw Error(a(331));var j=We;if(We|=4,rv(x.current),ev(x,x.current,k,o),We=j,Xo(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(xn,x)}catch{}return!0}finally{J.p=p,V.T=c,kv(r,i)}}function Sv(r,i,o){i=er(o,i),i=Hf(r.stateNode,i,2),r=ka(r,i,2),r!==null&&(go(r,2),Ar(r))}function at(r,i,o){if(r.tag===3)Sv(r,r,o);else for(;i!==null;){if(i.tag===3){Sv(i,r,o);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Na===null||!Na.has(c))){r=er(o,r),o=zb(2),c=ka(i,o,2),c!==null&&(_b(o,c,i,r),go(c,2),Ar(c));break}}i=i.return}}function ph(r,i,o){var c=r.pingCache;if(c===null){c=r.pingCache=new HN;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(o)||(oh=!0,p.add(o),r=KN.bind(null,r,i,o),i.then(r,r))}function KN(r,i,o){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,dt===r&&(Be&o)===o&&(Ot===4||Ot===3&&(Be&62914560)===Be&&300>gt()-Iu?(We&2)===0&&xs(r,0):lh|=o,ps===Be&&(ps=0)),Ar(r)}function zv(r,i){i===0&&(i=yx()),r=ui(r,i),r!==null&&(go(r,i),Ar(r))}function XN(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),zv(r,o)}function JN(r,i){var o=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(o=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),zv(r,o)}function QN(r,i){return Qt(r,i)}var Xu=null,bs=null,gh=!1,Ju=!1,xh=!1,Ta=0;function Ar(r){r!==bs&&r.next===null&&(bs===null?Xu=bs=r:bs=bs.next=r),Ju=!0,gh||(gh=!0,eC())}function Xo(r,i){if(!xh&&Ju){xh=!0;do for(var o=!1,c=Xu;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var x=0;else{var k=c.suspendedLanes,j=c.pingedLanes;x=(1<<31-ct(42|r)+1)-1,x&=p&~(k&~j),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,Cv(c,x))}else x=Be,x=tu(c,c===dt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||po(c,x)||(o=!0,Cv(c,x));c=c.next}while(o);xh=!1}}function WN(){_v()}function _v(){Ju=gh=!1;var r=0;Ta!==0&&cC()&&(r=Ta);for(var i=gt(),o=null,c=Xu;c!==null;){var p=c.next,x=jv(c,i);x===0?(c.next=null,o===null?Xu=p:o.next=p,p===null&&(bs=o)):(o=c,(r!==0||(x&3)!==0)&&(Ju=!0)),c=p}Kt!==0&&Kt!==5||Xo(r),Ta!==0&&(Ta=0)}function jv(r,i){for(var o=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var k=31-ct(x),j=1<<k,D=p[k];D===-1?((j&o)===0||(j&c)!==0)&&(p[k]=j2(j,i)):D<=i&&(r.expiredLanes|=j),x&=~j}if(i=dt,o=Be,o=tu(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,o===0||r===i&&(rt===2||rt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Xn(c),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||po(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(c!==null&&Xn(c),Ad(o)){case 2:case 8:o=ce;break;case 32:o=we;break;case 268435456:o=He;break;default:o=we}return c=Nv.bind(null,r),o=Qt(o,c),r.callbackPriority=i,r.callbackNode=o,i}return c!==null&&c!==null&&Xn(c),r.callbackPriority=2,r.callbackNode=null,2}function Nv(r,i){if(Kt!==0&&Kt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(Ku()&&r.callbackNode!==o)return null;var c=Be;return c=tu(r,r===dt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(lv(r,c,i),jv(r,gt()),r.callbackNode!=null&&r.callbackNode===o?Nv.bind(null,r):null)}function Cv(r,i){if(Ku())return null;lv(r,i,!0)}function eC(){fC(function(){(We&6)!==0?Qt(W,WN):_v()})}function yh(){if(Ta===0){var r=as;r===0&&(r=Ql,Ql<<=1,(Ql&261888)===0&&(Ql=256)),Ta=r}return Ta}function Ev(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:iu(""+r)}function Tv(r,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,r.id&&o.setAttribute("form",r.id),i.parentNode.insertBefore(o,i),r=new FormData(r),o.parentNode.removeChild(o),r}function tC(r,i,o,c,p){if(i==="submit"&&o&&o.stateNode===p){var x=Ev((p[jn]||null).action),k=c.submitter;k&&(i=(i=k[jn]||null)?Ev(i.formAction):k.getAttribute("formAction"),i!==null&&(x=i,k=null));var j=new uu("action","action",null,c,p);r.push({event:j,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ta!==0){var D=k?Tv(p,k):new FormData(p);Pf(o,{pending:!0,data:D,method:p.method,action:x},null,D)}}else typeof x=="function"&&(j.preventDefault(),D=k?Tv(p,k):new FormData(p),Pf(o,{pending:!0,data:D,method:p.method,action:x},x,D))},currentTarget:p}]})}}for(var bh=0;bh<ef.length;bh++){var vh=ef[bh],nC=vh.toLowerCase(),rC=vh[0].toUpperCase()+vh.slice(1);br(nC,"on"+rC)}br(oy,"onAnimationEnd"),br(ly,"onAnimationIteration"),br(uy,"onAnimationStart"),br("dblclick","onDoubleClick"),br("focusin","onFocus"),br("focusout","onBlur"),br(bN,"onTransitionRun"),br(vN,"onTransitionStart"),br(kN,"onTransitionCancel"),br(cy,"onTransitionEnd"),Hi("onMouseEnter",["mouseout","mouseover"]),Hi("onMouseLeave",["mouseout","mouseover"]),Hi("onPointerEnter",["pointerout","pointerover"]),Hi("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),aC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jo));function Av(r,i){i=(i&4)!==0;for(var o=0;o<r.length;o++){var c=r[o],p=c.event;c=c.listeners;e:{var x=void 0;if(i)for(var k=c.length-1;0<=k;k--){var j=c[k],D=j.instance,F=j.currentTarget;if(j=j.listener,D!==x&&p.isPropagationStopped())break e;x=j,p.currentTarget=F;try{x(p)}catch(Q){fu(Q)}p.currentTarget=null,x=D}else for(k=0;k<c.length;k++){if(j=c[k],D=j.instance,F=j.currentTarget,j=j.listener,D!==x&&p.isPropagationStopped())break e;x=j,p.currentTarget=F;try{x(p)}catch(Q){fu(Q)}p.currentTarget=null,x=D}}}}function Ve(r,i){var o=i[Od];o===void 0&&(o=i[Od]=new Set);var c=r+"__bubble";o.has(c)||(Ov(i,r,2,!1),o.add(c))}function kh(r,i,o){var c=0;i&&(c|=4),Ov(o,r,c,i)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function wh(r){if(!r[Qu]){r[Qu]=!0,_x.forEach(function(o){o!=="selectionchange"&&(aC.has(o)||kh(o,!1,r),kh(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Qu]||(i[Qu]=!0,kh("selectionchange",!1,i))}}function Ov(r,i,o,c){switch(o0(i)){case 2:var p=OC;break;case 8:p=RC;break;default:p=Lh}o=p.bind(null,i,o,r),p=void 0,!Bd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(i,o,{capture:!0,passive:p}):r.addEventListener(i,o,!0):p!==void 0?r.addEventListener(i,o,{passive:p}):r.addEventListener(i,o,!1)}function Sh(r,i,o,c,p){var x=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 j=c.stateNode.containerInfo;if(j===p)break;if(k===4)for(k=c.return;k!==null;){var D=k.tag;if((D===3||D===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;j!==null;){if(k=Bi(j),k===null)return;if(D=k.tag,D===5||D===6||D===26||D===27){c=x=k;continue e}j=j.parentNode}}c=c.return}Lx(function(){var F=x,Q=Ud(o),re=[];e:{var q=dy.get(r);if(q!==void 0){var X=uu,ge=r;switch(r){case"keypress":if(ou(o)===0)break e;case"keydown":case"keyup":X=J2;break;case"focusin":ge="focus",X=Fd;break;case"focusout":ge="blur",X=Fd;break;case"beforeblur":case"afterblur":X=Fd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=Vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=U2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=eN;break;case oy:case ly:case uy:X=Z2;break;case cy:X=nN;break;case"scroll":case"scrollend":X=L2;break;case"wheel":X=aN;break;case"copy":case"cut":case"paste":X=H2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Zx;break;case"toggle":case"beforetoggle":X=sN}var Ne=(i&4)!==0,ut=!Ne&&(r==="scroll"||r==="scrollend"),Z=Ne?q!==null?q+"Capture":null:q;Ne=[];for(var L=F,H;L!==null;){var ne=L;if(H=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||H===null||Z===null||(ne=bo(L,Z),ne!=null&&Ne.push(Qo(L,ne,H))),ut)break;L=L.return}0<Ne.length&&(q=new X(q,ge,null,o,Q),re.push({event:q,listeners:Ne}))}}if((i&7)===0){e:{if(q=r==="mouseover"||r==="pointerover",X=r==="mouseout"||r==="pointerout",q&&o!==Pd&&(ge=o.relatedTarget||o.fromElement)&&(Bi(ge)||ge[Vi]))break e;if((X||q)&&(q=Q.window===Q?Q:(q=Q.ownerDocument)?q.defaultView||q.parentWindow:window,X?(ge=o.relatedTarget||o.toElement,X=F,ge=ge?Bi(ge):null,ge!==null&&(ut=u(ge),Ne=ge.tag,ge!==ut||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(X=null,ge=F),X!==ge)){if(Ne=Vx,ne="onMouseLeave",Z="onMouseEnter",L="mouse",(r==="pointerout"||r==="pointerover")&&(Ne=Zx,ne="onPointerLeave",Z="onPointerEnter",L="pointer"),ut=X==null?q:yo(X),H=ge==null?q:yo(ge),q=new Ne(ne,L+"leave",X,o,Q),q.target=ut,q.relatedTarget=H,ne=null,Bi(Q)===F&&(Ne=new Ne(Z,L+"enter",ge,o,Q),Ne.target=H,Ne.relatedTarget=ut,ne=Ne),ut=ne,X&&ge)t:{for(Ne=iC,Z=X,L=ge,H=0,ne=Z;ne;ne=Ne(ne))H++;ne=0;for(var _e=L;_e;_e=Ne(_e))ne++;for(;0<H-ne;)Z=Ne(Z),H--;for(;0<ne-H;)L=Ne(L),ne--;for(;H--;){if(Z===L||L!==null&&Z===L.alternate){Ne=Z;break t}Z=Ne(Z),L=Ne(L)}Ne=null}else Ne=null;X!==null&&Rv(re,q,X,Ne,!1),ge!==null&&ut!==null&&Rv(re,ut,ge,Ne,!0)}}e:{if(q=F?yo(F):window,X=q.nodeName&&q.nodeName.toLowerCase(),X==="select"||X==="input"&&q.type==="file")var Xe=Xx;else if(Yx(q))if(Jx)Xe=gN;else{Xe=mN;var Se=hN}else X=q.nodeName,!X||X.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?F&&Ld(F.elementType)&&(Xe=Xx):Xe=pN;if(Xe&&(Xe=Xe(r,F))){Kx(re,Xe,o,Q);break e}Se&&Se(r,q,F),r==="focusout"&&F&&q.type==="number"&&F.memoizedProps.value!=null&&$d(q,"number",q.value)}switch(Se=F?yo(F):window,r){case"focusin":(Yx(Se)||Se.contentEditable==="true")&&(Xi=Se,Jd=F,No=null);break;case"focusout":No=Jd=Xi=null;break;case"mousedown":Qd=!0;break;case"contextmenu":case"mouseup":case"dragend":Qd=!1,iy(re,o,Q);break;case"selectionchange":if(yN)break;case"keydown":case"keyup":iy(re,o,Q)}var Me;if(Gd)e:{switch(r){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Ki?qx(r,o)&&(Ze="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Ze="onCompositionStart");Ze&&(Ix&&o.locale!=="ko"&&(Ki||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Ki&&(Me=Px()):(ma=Q,Zd="value"in ma?ma.value:ma.textContent,Ki=!0)),Se=Wu(F,Ze),0<Se.length&&(Ze=new Bx(Ze,r,null,o,Q),re.push({event:Ze,listeners:Se}),Me?Ze.data=Me:(Me=Gx(o),Me!==null&&(Ze.data=Me)))),(Me=lN?uN(r,o):cN(r,o))&&(Ze=Wu(F,"onBeforeInput"),0<Ze.length&&(Se=new Bx("onBeforeInput","beforeinput",null,o,Q),re.push({event:Se,listeners:Ze}),Se.data=Me)),tC(re,r,F,o,Q)}Av(re,i)})}function Qo(r,i,o){return{instance:r,listener:i,currentTarget:o}}function Wu(r,i){for(var o=i+"Capture",c=[];r!==null;){var p=r,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=bo(r,o),p!=null&&c.unshift(Qo(r,p,x)),p=bo(r,i),p!=null&&c.push(Qo(r,p,x))),r.tag===3)return c;r=r.return}return[]}function iC(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Rv(r,i,o,c,p){for(var x=i._reactName,k=[];o!==null&&o!==c;){var j=o,D=j.alternate,F=j.stateNode;if(j=j.tag,D!==null&&D===c)break;j!==5&&j!==26&&j!==27||F===null||(D=F,p?(F=bo(o,x),F!=null&&k.unshift(Qo(o,F,D))):p||(F=bo(o,x),F!=null&&k.push(Qo(o,F,D)))),o=o.return}k.length!==0&&r.push({event:i,listeners:k})}var sC=/\r\n?/g,oC=/\u0000|\uFFFD/g;function Dv(r){return(typeof r=="string"?r:""+r).replace(sC,`
|
|
9
|
-
`).replace(oC,"")}function Mv(r,i){return i=Dv(i),Dv(r)===i}function lt(r,i,o,c,p,x){switch(o){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||qi(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&qi(r,""+c);break;case"className":ru(r,"class",c);break;case"tabIndex":ru(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ru(r,o,c);break;case"style":Mx(r,c,x);break;case"data":if(i!=="object"){ru(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||o!=="href")){r.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=iu(""+c),r.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(o,"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 x=="function"&&(o==="formAction"?(i!=="input"&<(r,i,"name",p.name,p,null),lt(r,i,"formEncType",p.formEncType,p,null),lt(r,i,"formMethod",p.formMethod,p,null),lt(r,i,"formTarget",p.formTarget,p,null)):(lt(r,i,"encType",p.encType,p,null),lt(r,i,"method",p.method,p,null),lt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=iu(""+c),r.setAttribute(o,c);break;case"onClick":c!=null&&(r.onclick=Zr);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}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}o=iu(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);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(o,""+c):r.removeAttribute(o);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(o,""):r.removeAttribute(o);break;case"capture":case"download":c===!0?r.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(o,c):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(o,c):r.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(o):r.setAttribute(o,c);break;case"popover":Ve("beforetoggle",r),Ve("toggle",r),nu(r,"popover",c);break;case"xlinkActuate":Br(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Br(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Br(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Br(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Br(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Br(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Br(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Br(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Br(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":nu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=M2.get(o)||o,nu(r,o,c))}}function zh(r,i,o,c,p,x){switch(o){case"style":Mx(r,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"children":typeof c=="string"?qi(r,c):(typeof c=="number"||typeof c=="bigint")&&qi(r,""+c);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Zr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jx.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),i=o.slice(2,p?o.length-7:void 0),x=r[jn]||null,x=x!=null?x[o]:null,typeof x=="function"&&r.removeEventListener(i,x,p),typeof c=="function")){typeof x!="function"&&x!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(i,c,p);break e}o in r?r[o]=c:c===!0?r.setAttribute(o,""):nu(r,o,c)}}}function on(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",r),Ve("load",r);var c=!1,p=!1,x;for(x in o)if(o.hasOwnProperty(x)){var k=o[x];if(k!=null)switch(x){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(r,i,x,k,o,null)}}p&<(r,i,"srcSet",o.srcSet,o,null),c&<(r,i,"src",o.src,o,null);return;case"input":Ve("invalid",r);var j=x=k=p=null,D=null,F=null;for(c in o)if(o.hasOwnProperty(c)){var Q=o[c];if(Q!=null)switch(c){case"name":p=Q;break;case"type":k=Q;break;case"checked":D=Q;break;case"defaultChecked":F=Q;break;case"value":x=Q;break;case"defaultValue":j=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:lt(r,i,c,Q,o,null)}}Ax(r,x,j,D,F,k,p,!1);return;case"select":Ve("invalid",r),c=k=x=null;for(p in o)if(o.hasOwnProperty(p)&&(j=o[p],j!=null))switch(p){case"value":x=j;break;case"defaultValue":k=j;break;case"multiple":c=j;default:lt(r,i,p,j,o,null)}i=x,o=k,r.multiple=!!c,i!=null?Fi(r,!!c,i,!1):o!=null&&Fi(r,!!c,o,!0);return;case"textarea":Ve("invalid",r),x=p=c=null;for(k in o)if(o.hasOwnProperty(k)&&(j=o[k],j!=null))switch(k){case"value":c=j;break;case"defaultValue":p=j;break;case"children":x=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:lt(r,i,k,j,o,null)}Rx(r,c,p,x);return;case"option":for(D in o)o.hasOwnProperty(D)&&(c=o[D],c!=null)&&(D==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":lt(r,i,D,c,o,null));return;case"dialog":Ve("beforetoggle",r),Ve("toggle",r),Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":Ve("load",r);break;case"video":case"audio":for(c=0;c<Jo.length;c++)Ve(Jo[c],r);break;case"image":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"embed":case"source":case"link":Ve("error",r),Ve("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in o)if(o.hasOwnProperty(F)&&(c=o[F],c!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(r,i,F,c,o,null)}return;default:if(Ld(i)){for(Q in o)o.hasOwnProperty(Q)&&(c=o[Q],c!==void 0&&zh(r,i,Q,c,o,void 0));return}}for(j in o)o.hasOwnProperty(j)&&(c=o[j],c!=null&<(r,i,j,c,o,null))}function lC(r,i,o,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,x=null,k=null,j=null,D=null,F=null,Q=null;for(X in o){var re=o[X];if(o.hasOwnProperty(X)&&re!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":D=re;default:c.hasOwnProperty(X)||lt(r,i,X,null,c,re)}}for(var q in c){var X=c[q];if(re=o[q],c.hasOwnProperty(q)&&(X!=null||re!=null))switch(q){case"type":x=X;break;case"name":p=X;break;case"checked":F=X;break;case"defaultChecked":Q=X;break;case"value":k=X;break;case"defaultValue":j=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:X!==re&<(r,i,q,X,c,re)}}Md(r,k,j,D,F,Q,x,p);return;case"select":X=k=j=q=null;for(x in o)if(D=o[x],o.hasOwnProperty(x)&&D!=null)switch(x){case"value":break;case"multiple":X=D;default:c.hasOwnProperty(x)||lt(r,i,x,null,c,D)}for(p in c)if(x=c[p],D=o[p],c.hasOwnProperty(p)&&(x!=null||D!=null))switch(p){case"value":q=x;break;case"defaultValue":j=x;break;case"multiple":k=x;default:x!==D&<(r,i,p,x,c,D)}i=j,o=k,c=X,q!=null?Fi(r,!!o,q,!1):!!c!=!!o&&(i!=null?Fi(r,!!o,i,!0):Fi(r,!!o,o?[]:"",!1));return;case"textarea":X=q=null;for(j in o)if(p=o[j],o.hasOwnProperty(j)&&p!=null&&!c.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:lt(r,i,j,null,c,p)}for(k in c)if(p=c[k],x=o[k],c.hasOwnProperty(k)&&(p!=null||x!=null))switch(k){case"value":q=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&<(r,i,k,p,c,x)}Ox(r,q,X);return;case"option":for(var ge in o)q=o[ge],o.hasOwnProperty(ge)&&q!=null&&!c.hasOwnProperty(ge)&&(ge==="selected"?r.selected=!1:lt(r,i,ge,null,c,q));for(D in c)q=c[D],X=o[D],c.hasOwnProperty(D)&&q!==X&&(q!=null||X!=null)&&(D==="selected"?r.selected=q&&typeof q!="function"&&typeof q!="symbol":lt(r,i,D,q,c,X));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in o)q=o[Ne],o.hasOwnProperty(Ne)&&q!=null&&!c.hasOwnProperty(Ne)&<(r,i,Ne,null,c,q);for(F in c)if(q=c[F],X=o[F],c.hasOwnProperty(F)&&q!==X&&(q!=null||X!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,i));break;default:lt(r,i,F,q,c,X)}return;default:if(Ld(i)){for(var ut in o)q=o[ut],o.hasOwnProperty(ut)&&q!==void 0&&!c.hasOwnProperty(ut)&&zh(r,i,ut,void 0,c,q);for(Q in c)q=c[Q],X=o[Q],!c.hasOwnProperty(Q)||q===X||q===void 0&&X===void 0||zh(r,i,Q,q,c,X);return}}for(var Z in o)q=o[Z],o.hasOwnProperty(Z)&&q!=null&&!c.hasOwnProperty(Z)&<(r,i,Z,null,c,q);for(re in c)q=c[re],X=o[re],!c.hasOwnProperty(re)||q===X||q==null&&X==null||lt(r,i,re,q,c,X)}function $v(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uC(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],x=p.transferSize,k=p.initiatorType,j=p.duration;if(x&&j&&$v(k)){for(k=0,j=p.responseEnd,c+=1;c<o.length;c++){var D=o[c],F=D.startTime;if(F>j)break;var Q=D.transferSize,re=D.initiatorType;Q&&$v(re)&&(D=D.responseEnd,k+=Q*(D<j?1:(j-F)/(D-F)))}if(--c,i+=8*(x+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 _h=null,jh=null;function ec(r){return r.nodeType===9?r:r.ownerDocument}function Lv(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 Pv(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 Nh(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 Ch=null;function cC(){var r=window.event;return r&&r.type==="popstate"?r===Ch?!1:(Ch=r,!0):(Ch=null,!1)}var Uv=typeof setTimeout=="function"?setTimeout:void 0,dC=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,fC=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(r){return Vv.resolve(null).then(r).catch(hC)}:Uv;function hC(r){setTimeout(function(){throw r})}function Aa(r){return r==="head"}function Bv(r,i){var o=i,c=0;do{var p=o.nextSibling;if(r.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){r.removeChild(p),Ss(i);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")Wo(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,Wo(o);for(var x=o.firstChild;x;){var k=x.nextSibling,j=x.nodeName;x[xo]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=k}}else o==="body"&&Wo(r.ownerDocument.body);o=p}while(o);Ss(i)}function Zv(r,i){var o=r;r=0;do{var c=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(r===0)break;r--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||r++;o=c}while(o)}function Eh(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Eh(o),Rd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function mC(r,i,o,c){for(;r.nodeType===1;){var p=o;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[xo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(x=r.getAttribute("rel"),x==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(x!==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(x=r.getAttribute("src"),(x!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===x)return r}else return r;if(r=ir(r.nextSibling),r===null)break}return null}function pC(r,i,o){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=ir(r.nextSibling),r===null))return null;return r}function Iv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=ir(r.nextSibling),r===null))return null;return r}function Th(r){return r.data==="$?"||r.data==="$~"}function Ah(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function gC(r,i){var o=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||o.readyState!=="loading")i();else{var c=function(){i(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function ir(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 Oh=null;function Hv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="/$"||o==="/&"){if(i===0)return ir(r.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}r=r.nextSibling}return null}function Fv(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return r;i--}else o!=="/$"&&o!=="/&"||i++}r=r.previousSibling}return null}function qv(r,i,o){switch(i=ec(o),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 Wo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Rd(r)}var sr=new Map,Gv=new Set;function tc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var aa=J.d;J.d={f:xC,r:yC,D:bC,C:vC,L:kC,m:wC,X:zC,S:SC,M:_C};function xC(){var r=aa.f(),i=qu();return r||i}function yC(r){var i=Zi(r);i!==null&&i.tag===5&&i.type==="form"?cb(i):aa.r(r)}var vs=typeof document>"u"?null:document;function Yv(r,i,o){var c=vs;if(c&&typeof i=="string"&&i){var p=Qn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Gv.has(p)||(Gv.add(p),r={rel:r,crossOrigin:o,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),on(i,"link",r),Wt(i),c.head.appendChild(i)))}}function bC(r){aa.D(r),Yv("dns-prefetch",r,null)}function vC(r,i){aa.C(r,i),Yv("preconnect",r,i)}function kC(r,i,o){aa.L(r,i,o);var c=vs;if(c&&r&&i){var p='link[rel="preload"][as="'+Qn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Qn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Qn(o.imageSizes)+'"]')):p+='[href="'+Qn(r)+'"]';var x=p;switch(i){case"style":x=ks(r);break;case"script":x=ws(r)}sr.has(x)||(r=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),sr.set(x,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(el(x))||i==="script"&&c.querySelector(tl(x))||(i=c.createElement("link"),on(i,"link",r),Wt(i),c.head.appendChild(i)))}}function wC(r,i){aa.m(r,i);var o=vs;if(o&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Qn(c)+'"][href="'+Qn(r)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ws(r)}if(!sr.has(x)&&(r=y({rel:"modulepreload",href:r},i),sr.set(x,r),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(tl(x)))return}c=o.createElement("link"),on(c,"link",r),Wt(c),o.head.appendChild(c)}}}function SC(r,i,o){aa.S(r,i,o);var c=vs;if(c&&r){var p=Ii(c).hoistableStyles,x=ks(r);i=i||"default";var k=p.get(x);if(!k){var j={loading:0,preload:null};if(k=c.querySelector(el(x)))j.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},o),(o=sr.get(x))&&Rh(r,o);var D=k=c.createElement("link");Wt(D),on(D,"link",r),D._p=new Promise(function(F,Q){D.onload=F,D.onerror=Q}),D.addEventListener("load",function(){j.loading|=1}),D.addEventListener("error",function(){j.loading|=2}),j.loading|=4,nc(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:j},p.set(x,k)}}}function zC(r,i){aa.X(r,i);var o=vs;if(o&&r){var c=Ii(o).hoistableScripts,p=ws(r),x=c.get(p);x||(x=o.querySelector(tl(p)),x||(r=y({src:r,async:!0},i),(i=sr.get(p))&&Dh(r,i),x=o.createElement("script"),Wt(x),on(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function _C(r,i){aa.M(r,i);var o=vs;if(o&&r){var c=Ii(o).hoistableScripts,p=ws(r),x=c.get(p);x||(x=o.querySelector(tl(p)),x||(r=y({src:r,async:!0,type:"module"},i),(i=sr.get(p))&&Dh(r,i),x=o.createElement("script"),Wt(x),on(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Kv(r,i,o,c){var p=(p=he.current)?tc(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=ks(o.href),o=Ii(p).hoistableStyles,c=o.get(i),c||(c={type:"style",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=ks(o.href);var x=Ii(p).hoistableStyles,k=x.get(r);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(r,k),(x=p.querySelector(el(r)))&&!x._p&&(k.instance=x,k.state.loading=5),sr.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},sr.set(r,o),x||jC(p,r,o,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=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ws(o),o=Ii(p).hoistableScripts,c=o.get(i),c||(c={type:"script",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ks(r){return'href="'+Qn(r)+'"'}function el(r){return'link[rel="stylesheet"]['+r+"]"}function Xv(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function jC(r,i,o,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}),on(i,"link",o),Wt(i),r.head.appendChild(i))}function ws(r){return'[src="'+Qn(r)+'"]'}function tl(r){return"script[async]"+r}function Jv(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+Qn(o.href)+'"]');if(c)return i.instance=c,Wt(c),c;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Wt(c),on(c,"style",p),nc(c,o.precedence,r),i.instance=c;case"stylesheet":p=ks(o.href);var x=r.querySelector(el(p));if(x)return i.state.loading|=4,i.instance=x,Wt(x),x;c=Xv(o),(p=sr.get(p))&&Rh(c,p),x=(r.ownerDocument||r).createElement("link"),Wt(x);var k=x;return k._p=new Promise(function(j,D){k.onload=j,k.onerror=D}),on(x,"link",c),i.state.loading|=4,nc(x,o.precedence,r),i.instance=x;case"script":return x=ws(o.src),(p=r.querySelector(tl(x)))?(i.instance=p,Wt(p),p):(c=o,(p=sr.get(x))&&(c=y({},o),Dh(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Wt(p),on(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,nc(c,o.precedence,r));return i.instance}function nc(r,i,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,x=p,k=0;k<c.length;k++){var j=c[k];if(j.dataset.precedence===i)x=j;else if(x!==p)break}x?x.parentNode.insertBefore(r,x.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(r,i.firstChild))}function Rh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Dh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var rc=null;function Qv(r,i,o){if(rc===null){var c=new Map,p=rc=new Map;p.set(o,c)}else p=rc,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(r))return c;for(c.set(r,null),o=o.getElementsByTagName(r),p=0;p<o.length;p++){var x=o[p];if(!(x[xo]||x[nn]||r==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(i)||"";k=r+k;var j=c.get(k);j?j.push(x):c.set(k,[x])}}return c}function Wv(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function NC(r,i,o){if(o===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 e0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function CC(r,i,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=ks(c.href),x=i.querySelector(el(p));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ac.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=x,Wt(x);return}x=i.ownerDocument||i,c=Xv(c),(p=sr.get(p))&&Rh(c,p),x=x.createElement("link"),Wt(x);var k=x;k._p=new Promise(function(j,D){k.onload=j,k.onerror=D}),on(x,"link",c),o.instance=x}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=ac.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var Mh=0;function EC(r,i){return r.stylesheets&&r.count===0&&sc(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var c=setTimeout(function(){if(r.stylesheets&&sc(r,r.stylesheets),r.unsuspend){var x=r.unsuspend;r.unsuspend=null,x()}},6e4+i);0<r.imgBytes&&Mh===0&&(Mh=62500*uC());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&sc(r,r.stylesheets),r.unsuspend)){var x=r.unsuspend;r.unsuspend=null,x()}},(r.imgBytes>Mh?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ic=null;function sc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ic=new Map,i.forEach(TC,r),ic=null,ac.call(r))}function TC(r,i){if(!(i.state.loading&4)){var o=ic.get(r);if(o)var c=o.get(null);else{o=new Map,ic.set(r,o);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var k=p[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(o.set(k.dataset.precedence,k),c=k)}c&&o.set(null,c)}p=i.instance,k=p.getAttribute("data-precedence"),x=o.get(k)||c,x===c&&o.set(null,p),o.set(k,p),this.count++,c=ac.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),x?x.parentNode.insertBefore(p,x.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var nl={$$typeof:C,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function AC(r,i,o,c,p,x,k,j,D){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=Ed(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ed(0),this.hiddenUpdates=Ed(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function t0(r,i,o,c,p,x,k,j,D,F,Q,re){return r=new AC(r,i,o,k,D,F,Q,re,j),i=1,x===!0&&(i|=24),x=Bn(3,null,null,i),r.current=x,x.stateNode=r,i=mf(),i.refCount++,r.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:o,cache:i},yf(x),r}function n0(r){return r?(r=Wi,r):Wi}function r0(r,i,o,c,p,x){p=n0(p),c.context===null?c.context=p:c.pendingContext=p,c=va(i),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=ka(r,c,i),o!==null&&(On(o,r,i),Do(o,r,i))}function a0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function $h(r,i){a0(r,i),(r=r.alternate)&&a0(r,i)}function i0(r){if(r.tag===13||r.tag===31){var i=ui(r,67108864);i!==null&&On(i,r,67108864),$h(r,67108864)}}function s0(r){if(r.tag===13||r.tag===31){var i=qn();i=Td(i);var o=ui(r,i);o!==null&&On(o,r,i),$h(r,i)}}var oc=!0;function OC(r,i,o,c){var p=V.T;V.T=null;var x=J.p;try{J.p=2,Lh(r,i,o,c)}finally{J.p=x,V.T=p}}function RC(r,i,o,c){var p=V.T;V.T=null;var x=J.p;try{J.p=8,Lh(r,i,o,c)}finally{J.p=x,V.T=p}}function Lh(r,i,o,c){if(oc){var p=Ph(c);if(p===null)Sh(r,i,c,lc,o),l0(r,c);else if(MC(p,r,i,o,c))c.stopPropagation();else if(l0(r,c),i&4&&-1<DC.indexOf(r)){for(;p!==null;){var x=Zi(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=ai(x.pendingLanes);if(k!==0){var j=x;for(j.pendingLanes|=2,j.entangledLanes|=2;k;){var D=1<<31-ct(k);j.entanglements[1]|=D,k&=~D}Ar(x),(We&6)===0&&(Hu=gt()+500,Xo(0))}}break;case 31:case 13:j=ui(x,2),j!==null&&On(j,x,2),qu(),$h(x,2)}if(x=Ph(c),x===null&&Sh(r,i,c,lc,o),x===p)break;p=x}p!==null&&c.stopPropagation()}else Sh(r,i,c,null,o)}}function Ph(r){return r=Ud(r),Uh(r)}var lc=null;function Uh(r){if(lc=null,r=Bi(r),r!==null){var i=u(r);if(i===null)r=null;else{var o=i.tag;if(o===13){if(r=l(i),r!==null)return r;r=null}else if(o===31){if(r=f(i),r!==null)return r;r=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return lc=r,null}function o0(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(Ui()){case W:return 2;case ce:return 8;case we:case Ce:return 32;case He:return 268435456;default:return 32}default:return 32}}var Vh=!1,Oa=null,Ra=null,Da=null,rl=new Map,al=new Map,Ma=[],DC="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 l0(r,i){switch(r){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":rl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(i.pointerId)}}function il(r,i,o,c,p,x){return r===null||r.nativeEvent!==x?(r={blockedOn:i,domEventName:o,eventSystemFlags:c,nativeEvent:x,targetContainers:[p]},i!==null&&(i=Zi(i),i!==null&&i0(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function MC(r,i,o,c,p){switch(i){case"focusin":return Oa=il(Oa,r,i,o,c,p),!0;case"dragenter":return Ra=il(Ra,r,i,o,c,p),!0;case"mouseover":return Da=il(Da,r,i,o,c,p),!0;case"pointerover":var x=p.pointerId;return rl.set(x,il(rl.get(x)||null,r,i,o,c,p)),!0;case"gotpointercapture":return x=p.pointerId,al.set(x,il(al.get(x)||null,r,i,o,c,p)),!0}return!1}function u0(r){var i=Bi(r.target);if(i!==null){var o=u(i);if(o!==null){if(i=o.tag,i===13){if(i=l(o),i!==null){r.blockedOn=i,Sx(r.priority,function(){s0(o)});return}}else if(i===31){if(i=f(o),i!==null){r.blockedOn=i,Sx(r.priority,function(){s0(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){r.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}r.blockedOn=null}function uc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=Ph(r.nativeEvent);if(o===null){o=r.nativeEvent;var c=new o.constructor(o.type,o);Pd=c,o.target.dispatchEvent(c),Pd=null}else return i=Zi(o),i!==null&&i0(i),r.blockedOn=o,!1;i.shift()}return!0}function c0(r,i,o){uc(r)&&o.delete(i)}function $C(){Vh=!1,Oa!==null&&uc(Oa)&&(Oa=null),Ra!==null&&uc(Ra)&&(Ra=null),Da!==null&&uc(Da)&&(Da=null),rl.forEach(c0),al.forEach(c0)}function cc(r,i){r.blockedOn===i&&(r.blockedOn=null,Vh||(Vh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$C)))}var dc=null;function d0(r){dc!==r&&(dc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){dc===r&&(dc=null);for(var i=0;i<r.length;i+=3){var o=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Uh(c||o)===null)continue;break}var x=Zi(o);x!==null&&(r.splice(i,3),i-=3,Pf(x,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function Ss(r){function i(D){return cc(D,r)}Oa!==null&&cc(Oa,r),Ra!==null&&cc(Ra,r),Da!==null&&cc(Da,r),rl.forEach(i),al.forEach(i);for(var o=0;o<Ma.length;o++){var c=Ma[o];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Ma.length&&(o=Ma[0],o.blockedOn===null);)u0(o),o.blockedOn===null&&Ma.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],x=o[c+1],k=p[jn]||null;if(typeof x=="function")k||d0(o);else if(k){var j=null;if(x&&x.hasAttribute("formAction")){if(p=x,k=x[jn]||null)j=k.formAction;else if(Uh(p)!==null)continue}else j=k.action;typeof j=="function"?o[c+1]=j:(o.splice(c,3),c-=3),d0(o)}}}function f0(){function r(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.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(o,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Bh(r){this._internalRoot=r}fc.prototype.render=Bh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,c=qn();r0(o,c,r,i,null,null)},fc.prototype.unmount=Bh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;r0(r.current,2,null,r,null,null),qu(),i[Vi]=null}};function fc(r){this._internalRoot=r}fc.prototype.unstable_scheduleHydration=function(r){if(r){var i=wx();r={blockedOn:null,target:r,priority:i};for(var o=0;o<Ma.length&&i!==0&&i<Ma[o].priority;o++);Ma.splice(o,0,r),o===0&&u0(r)}};var h0=t.version;if(h0!=="19.2.4")throw Error(a(527,h0,"19.2.4"));J.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 LC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hc.isDisabled&&hc.supportsFiber)try{xn=hc.inject(LC),Yt=hc}catch{}}return ol.createRoot=function(r,i){if(!s(r))throw Error(a(299));var o=!1,c="",p=vb,x=kb,k=wb;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=t0(r,1,!1,null,null,o,c,null,p,x,k,f0),r[Vi]=i.current,wh(r),new Bh(i)},ol.hydrateRoot=function(r,i,o){if(!s(r))throw Error(a(299));var c=!1,p="",x=vb,k=kb,j=wb,D=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(x=o.onUncaughtError),o.onCaughtError!==void 0&&(k=o.onCaughtError),o.onRecoverableError!==void 0&&(j=o.onRecoverableError),o.formState!==void 0&&(D=o.formState)),i=t0(r,1,!0,i,o??null,c,p,D,x,k,j,f0),i.context=n0(null),o=i.current,c=qn(),c=Td(c),p=va(c),p.callback=null,ka(o,p,c),o=c,i.current.lanes=o,go(i,o),Ar(i),r[Vi]=i.current,wh(r),new fc(i)},ol.version="19.2.4",ol}var S0;function GC(){if(S0)return Hh.exports;S0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hh.exports=qC(),Hh.exports}var YC=GC();var z0="popstate";function KC(e={}){function t(a,s){let{pathname:u,search:l,hash:f}=a.location;return qm("",{pathname:u,search:l,hash:f},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:Nl(s)}return JC(t,n,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XC(){return Math.random().toString(36).substring(2,10)}function _0(e,t){return{usr:e.state,key:e.key,idx:t}}function qm(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?to(t):t,state:n,key:t&&t.key||a||XC()}}function Nl({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 to(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 JC(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:u=!1}=a,l=s.history,f="POP",h=null,m=g();m==null&&(m=0,l.replaceState({...l.state,idx:m},""));function g(){return(l.state||{idx:null}).idx}function y(){f="POP";let T=g(),E=T==null?null:T-m;m=T,h&&h({action:f,location:N.location,delta:E})}function v(T,E){f="PUSH";let O=qm(N.location,T,E);m=g()+1;let C=_0(O,m),P=N.createHref(O);try{l.pushState(C,"",P)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;s.location.assign(P)}u&&h&&h({action:f,location:N.location,delta:1})}function b(T,E){f="REPLACE";let O=qm(N.location,T,E);m=g();let C=_0(O,m),P=N.createHref(O);l.replaceState(C,"",P),u&&h&&h({action:f,location:N.location,delta:0})}function S(T){return QC(T)}let N={get action(){return f},get location(){return e(s,l)},listen(T){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(z0,y),h=T,()=>{s.removeEventListener(z0,y),h=null}},createHref(T){return t(s,T)},createURL:S,encodeLocation(T){let E=S(T);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:b,go(T){return l.go(T)}};return N}function QC(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),wt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Nl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function tS(e,t,n="/"){return WC(e,t,n,!1)}function WC(e,t,n,a){let s=typeof t=="string"?to(t):t,u=ca(s.pathname||"/",n);if(u==null)return null;let l=nS(e);eE(l);let f=null;for(let h=0;f==null&&h<l.length;++h){let m=dE(u);f=uE(l[h],m,a)}return f}function nS(e,t=[],n=[],a="",s=!1){let u=(l,f,h=s,m)=>{let g={relativePath:m===void 0?l.path||"":m,caseSensitive:l.caseSensitive===!0,childrenIndex:f,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;wt(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 y=la([a,g.relativePath]),v=n.concat(g);l.children&&l.children.length>0&&(wt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),nS(l.children,t,v,y,h)),!(l.path==null&&!l.index)&&t.push({path:y,score:oE(y,l.index),routesMeta:v})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))u(l,f);else for(let h of rS(l.path))u(l,f,!0,h)}),t}function rS(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),u=n.replace(/\?$/,"");if(a.length===0)return s?[u,""]:[u];let l=rS(a.join("/")),f=[];return f.push(...l.map(h=>h===""?u:[u,h].join("/"))),s&&f.push(...l),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function eE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lE(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var tE=/^:[\w-]+$/,nE=3,rE=2,aE=1,iE=10,sE=-2,j0=e=>e==="*";function oE(e,t){let n=e.split("/"),a=n.length;return n.some(j0)&&(a+=sE),t&&(a+=rE),n.filter(s=>!j0(s)).reduce((s,u)=>s+(tE.test(u)?nE:u===""?aE:iE),a)}function lE(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function uE(e,t,n=!1){let{routesMeta:a}=e,s={},u="/",l=[];for(let f=0;f<a.length;++f){let h=a[f],m=f===a.length-1,g=u==="/"?t:t.slice(u.length)||"/",y=Fc({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),v=h.route;if(!y&&m&&n&&!a[a.length-1].route.index&&(y=Fc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!y)return null;Object.assign(s,y.params),l.push({params:s,pathname:la([u,y.pathname]),pathnameBase:pE(la([u,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(u=la([u,y.pathnameBase]))}return l}function Fc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=cE(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let u=s[0],l=u.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:y},v)=>{if(g==="*"){let S=f[v]||"";l=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const b=f[v];return y&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function cE(e,t=!1,n=!0){jr(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,f,h)=>(a.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function dE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jr(!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 ca(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 fE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function hE(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?to(e):e,u;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?u=N0(n.substring(1),"/"):u=N0(n,t)):u=t,{pathname:u,search:gE(a),hash:xE(s)}}function N0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Yh(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 mE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jp(e){let t=mE(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Qp(e,t,n,a=!1){let s;typeof e=="string"?s=to(e):(s={...e},wt(!s.pathname||!s.pathname.includes("?"),Yh("?","pathname","search",s)),wt(!s.pathname||!s.pathname.includes("#"),Yh("#","pathname","hash",s)),wt(!s.search||!s.search.includes("#"),Yh("#","search","hash",s)));let u=e===""||s.pathname==="",l=u?"/":s.pathname,f;if(l==null)f=n;else{let y=t.length-1;if(!a&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),y-=1;s.pathname=v.join("/")}f=y>=0?t[y]:"/"}let h=hE(s,f),m=l&&l!=="/"&&l.endsWith("/"),g=(u||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var la=e=>e.join("/").replace(/\/\/+/g,"/"),pE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,yE=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 bE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function vE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var aS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function iS(e,t){let n=e;if(typeof n!="string"||!fE.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(aS)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),f=ca(l.pathname,t);l.origin===u.origin&&f!=null?n=f+l.search+l.hash:s=!0}catch{jr(!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:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sS=["POST","PUT","PATCH","DELETE"];new Set(sS);var kE=["GET",...sS];new Set(kE);var no=z.createContext(null);no.displayName="DataRouter";var fd=z.createContext(null);fd.displayName="DataRouterState";var wE=z.createContext(!1),oS=z.createContext({isTransitioning:!1});oS.displayName="ViewTransition";var SE=z.createContext(new Map);SE.displayName="Fetchers";var zE=z.createContext(null);zE.displayName="Await";var Kn=z.createContext(null);Kn.displayName="Navigation";var Zl=z.createContext(null);Zl.displayName="Location";var Ur=z.createContext({outlet:null,matches:[],isDataRoute:!1});Ur.displayName="Route";var Wp=z.createContext(null);Wp.displayName="RouteError";var lS="REACT_ROUTER_ERROR",_E="REDIRECT",jE="ROUTE_ERROR_RESPONSE";function NE(e){if(e.startsWith(`${lS}:${_E}:{`))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 CE(e){if(e.startsWith(`${lS}:${jE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new yE(t.status,t.statusText,t.data)}catch{}}function EE(e,{relative:t}={}){wt(ro(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=z.useContext(Kn),{hash:s,pathname:u,search:l}=Il(e,{relative:t}),f=u;return n!=="/"&&(f=u==="/"?n:la([n,u])),a.createHref({pathname:f,search:l,hash:s})}function ro(){return z.useContext(Zl)!=null}function Nr(){return wt(ro(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Zl).location}var uS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cS(e){z.useContext(Kn).static||z.useLayoutEffect(e)}function eg(){let{isDataRoute:e}=z.useContext(Ur);return e?ZE():TE()}function TE(){wt(ro(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(no),{basename:t,navigator:n}=z.useContext(Kn),{matches:a}=z.useContext(Ur),{pathname:s}=Nr(),u=JSON.stringify(Jp(a)),l=z.useRef(!1);return cS(()=>{l.current=!0}),z.useCallback((h,m={})=>{if(jr(l.current,uS),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=Qp(h,JSON.parse(u),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:la([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,u,s,e])}z.createContext(null);function Il(e,{relative:t}={}){let{matches:n}=z.useContext(Ur),{pathname:a}=Nr(),s=JSON.stringify(Jp(n));return z.useMemo(()=>Qp(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function AE(e,t){return dS(e,t)}function dS(e,t,n,a,s){wt(ro(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=z.useContext(Kn),{matches:l}=z.useContext(Ur),f=l[l.length-1],h=f?f.params:{},m=f?f.pathname:"/",g=f?f.pathnameBase:"/",y=f&&f.route;{let O=y&&y.path||"";hS(m,!y||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${O}">) 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
|
-
|
|
11
|
-
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let v=Nr(),b;if(t){let O=typeof t=="string"?to(t):t;wt(g==="/"||O.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 "${O.pathname}" was given in the \`location\` prop.`),b=O}else b=v;let S=b.pathname||"/",N=S;if(g!=="/"){let O=g.replace(/^\//,"").split("/");N="/"+S.replace(/^\//,"").split("/").slice(O.length).join("/")}let T=tS(e,{pathname:N});jr(y||T!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),jr(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=$E(T&&T.map(O=>Object.assign({},O,{params:Object.assign({},h,O.params),pathname:la([g,u.encodeLocation?u.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?g:la([g,u.encodeLocation?u.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),l,n,a,s);return t&&E?z.createElement(Zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}function OE(){let e=BE(),t=bE(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)",s={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=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:u},"ErrorBoundary")," or"," ",z.createElement("code",{style:u},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},t),n?z.createElement("pre",{style:s},n):null,l)}var RE=z.createElement(OE,null),fS=class extends z.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=CE(e.digest);n&&(e=n)}let t=e!==void 0?z.createElement(Ur.Provider,{value:this.props.routeContext},z.createElement(Wp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(DE,{error:e},t):t}};fS.contextType=wE;var Kh=new WeakMap;function DE({children:e,error:t}){let{basename:n}=z.useContext(Kn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=NE(t.digest);if(a){let s=Kh.get(t);if(s)throw s;let u=iS(a.location,n);if(aS&&!Kh.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 Kh.set(t,l),l}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function ME({routeContext:e,match:t,children:n}){let a=z.useContext(no);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),z.createElement(Ur.Provider,{value:e},n)}function $E(e,t=[],n=null,a=null,s=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(y=>y.route.id&&l?.[y.route.id]!==void 0);wt(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 f=!1,h=-1;if(n)for(let g=0;g<u.length;g++){let y=u[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(h=g),y.route.id){let{loaderData:v,errors:b}=n,S=y.route.loader&&!v.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||S){f=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let m=n&&a?(g,y)=>{a(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:vE(n.matches),errorInfo:y})}:void 0;return u.reduceRight((g,y,v)=>{let b,S=!1,N=null,T=null;n&&(b=l&&y.route.id?l[y.route.id]:void 0,N=y.route.errorElement||RE,f&&(h<0&&v===0?(hS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,T=null):h===v&&(S=!0,T=y.route.hydrateFallbackElement||null)));let E=t.concat(u.slice(0,v+1)),O=()=>{let C;return b?C=N:S?C=T:y.route.Component?C=z.createElement(y.route.Component,null):y.route.element?C=y.route.element:C=g,z.createElement(ME,{match:y,routeContext:{outlet:g,matches:E,isDataRoute:n!=null},children:C})};return n&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?z.createElement(fS,{location:n.location,revalidation:n.revalidation,component:N,error:b,children:O(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:m}):O()},null)}function tg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function LE(e){let t=z.useContext(no);return wt(t,tg(e)),t}function PE(e){let t=z.useContext(fd);return wt(t,tg(e)),t}function UE(e){let t=z.useContext(Ur);return wt(t,tg(e)),t}function ng(e){let t=UE(e),n=t.matches[t.matches.length-1];return wt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function VE(){return ng("useRouteId")}function BE(){let e=z.useContext(Wp),t=PE("useRouteError"),n=ng("useRouteError");return e!==void 0?e:t.errors?.[n]}function ZE(){let{router:e}=LE("useNavigate"),t=ng("useNavigate"),n=z.useRef(!1);return cS(()=>{n.current=!0}),z.useCallback(async(s,u={})=>{jr(n.current,uS),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...u}))},[e,t])}var C0={};function hS(e,t,n){!t&&!C0[e]&&(C0[e]=!0,jr(!1,n))}z.memo(IE);function IE({routes:e,future:t,state:n,onError:a}){return dS(e,void 0,n,a,t)}function mS({to:e,replace:t,state:n,relative:a}){wt(ro(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=z.useContext(Kn);jr(!s,"<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}=z.useContext(Ur),{pathname:l}=Nr(),f=eg(),h=Qp(e,Jp(u),l,a==="path"),m=JSON.stringify(h);return z.useEffect(()=>{f(JSON.parse(m),{replace:t,state:n,relative:a})},[f,m,a,t,n]),null}function tn(e){wt(!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 HE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:u=!1,unstable_useTransitions:l}){wt(!ro(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=z.useMemo(()=>({basename:f,navigator:s,static:u,unstable_useTransitions:l,future:{}}),[f,s,u,l]);typeof n=="string"&&(n=to(n));let{pathname:m="/",search:g="",hash:y="",state:v=null,key:b="default"}=n,S=z.useMemo(()=>{let N=ca(m,f);return N==null?null:{location:{pathname:N,search:g,hash:y,state:v,key:b},navigationType:a}},[f,m,g,y,v,b,a]);return jr(S!=null,`<Router basename="${f}"> is not able to match the URL "${m}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:z.createElement(Kn.Provider,{value:h},z.createElement(Zl.Provider,{children:t,value:S}))}function E0({children:e,location:t}){return AE(Gm(e),t)}function Gm(e,t=[]){let n=[];return z.Children.forEach(e,(a,s)=>{if(!z.isValidElement(a))return;let u=[...t,s];if(a.type===z.Fragment){n.push.apply(n,Gm(a.props.children,u));return}wt(a.type===tn,`[${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>`),wt(!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=Gm(a.props.children,u)),n.push(l)}),n}var $c="get",Lc="application/x-www-form-urlencoded";function hd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function FE(e){return hd(e)&&e.tagName.toLowerCase()==="button"}function qE(e){return hd(e)&&e.tagName.toLowerCase()==="form"}function GE(e){return hd(e)&&e.tagName.toLowerCase()==="input"}function YE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KE(e,t){return e.button===0&&(!t||t==="_self")&&!YE(e)}var mc=null;function XE(){if(mc===null)try{new FormData(document.createElement("form"),0),mc=!1}catch{mc=!0}return mc}var JE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xh(e){return e!=null&&!JE.has(e)?(jr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lc}"`),null):e}function QE(e,t){let n,a,s,u,l;if(qE(e)){let f=e.getAttribute("action");a=f?ca(f,t):null,n=e.getAttribute("method")||$c,s=Xh(e.getAttribute("enctype"))||Lc,u=new FormData(e)}else if(FE(e)||GE(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(a=h?ca(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||$c,s=Xh(e.getAttribute("formenctype"))||Xh(f.getAttribute("enctype"))||Lc,u=new FormData(f,e),!XE()){let{name:m,type:g,value:y}=e;if(g==="image"){let v=m?`${m}.`:"";u.append(`${v}x`,"0"),u.append(`${v}y`,"0")}else m&&u.append(m,y)}}else{if(hd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=$c,a=null,s=Lc,l=e}return u&&s==="text/plain"&&(l=u,u=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:u,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WE(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&ca(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function eT(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 tT(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 nT(e,t,n){let a=await Promise.all(e.map(async s=>{let u=t.routes[s.route.id];if(u){let l=await eT(u,n);return l.links?l.links():[]}return[]}));return sT(a.flat(1).filter(tT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function T0(e,t,n,a,s,u){let l=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,f=(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)||f(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)||f(h,m))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function rT(e,t,{includeHydrateFallback:n}={}){return aT(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let u=[s.module];return s.clientActionModule&&(u=u.concat(s.clientActionModule)),s.clientLoaderModule&&(u=u.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(u=u.concat(s.hydrateFallbackModule)),s.imports&&(u=u.concat(s.imports)),u}).flat(1))}function aT(e){return[...new Set(e)]}function iT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function sT(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let u=JSON.stringify(iT(s));return n.has(u)||(n.add(u),a.push({key:u,link:s})),a},[])}function pS(){let e=z.useContext(no);return rg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oT(){let e=z.useContext(fd);return rg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ag=z.createContext(void 0);ag.displayName="FrameworkContext";function gS(){let e=z.useContext(ag);return rg(e,"You must render this element inside a <HydratedRouter> element"),e}function lT(e,t){let n=z.useContext(ag),[a,s]=z.useState(!1),[u,l]=z.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:y}=t,v=z.useRef(null);z.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let N=E=>{E.forEach(O=>{l(O.isIntersecting)})},T=new IntersectionObserver(N,{threshold:.5});return v.current&&T.observe(v.current),()=>{T.disconnect()}}},[e]),z.useEffect(()=>{if(a){let N=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(N)}}},[a]);let b=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[u,v,{}]:[u,v,{onFocus:ll(f,b),onBlur:ll(h,S),onMouseEnter:ll(m,b),onMouseLeave:ll(g,S),onTouchStart:ll(y,b)}]:[!1,v,{}]}function ll(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function uT({page:e,...t}){let{router:n}=pS(),a=z.useMemo(()=>tS(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?z.createElement(dT,{page:e,matches:a,...t}):null}function cT(e){let{manifest:t,routeModules:n}=gS(),[a,s]=z.useState([]);return z.useEffect(()=>{let u=!1;return nT(e,t,n).then(l=>{u||s(l)}),()=>{u=!0}},[e,t,n]),a}function dT({page:e,matches:t,...n}){let a=Nr(),{future:s,manifest:u,routeModules:l}=gS(),{basename:f}=pS(),{loaderData:h,matches:m}=oT(),g=z.useMemo(()=>T0(e,t,m,u,a,"data"),[e,t,m,u,a]),y=z.useMemo(()=>T0(e,t,m,u,a,"assets"),[e,t,m,u,a]),v=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let N=new Set,T=!1;if(t.forEach(O=>{let C=u.routes[O.route.id];!C||!C.hasLoader||(!g.some(P=>P.route.id===O.route.id)&&O.route.id in h&&l[O.route.id]?.shouldRevalidate||C.hasClientLoader?T=!0:N.add(O.route.id))}),N.size===0)return[];let E=WE(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return T&&N.size>0&&E.searchParams.set("_routes",t.filter(O=>N.has(O.route.id)).map(O=>O.route.id).join(",")),[E.pathname+E.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),b=z.useMemo(()=>rT(y,u),[y,u]),S=cT(y);return z.createElement(z.Fragment,null,v.map(N=>z.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...n})),b.map(N=>z.createElement("link",{key:N,rel:"modulepreload",href:N,...n})),S.map(({key:N,link:T})=>z.createElement("link",{key:N,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function fT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var hT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{hT&&(window.__reactRouterVersion="7.13.0")}catch{}function mT({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=z.useRef();s.current==null&&(s.current=KC({window:a,v5Compat:!0}));let u=s.current,[l,f]=z.useState({action:u.action,location:u.location}),h=z.useCallback(m=>{n===!1?f(m):z.startTransition(()=>f(m))},[n]);return z.useLayoutEffect(()=>u.listen(h),[u,h]),z.createElement(HE,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:n})}var xS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ia=z.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:u,replace:l,state:f,target:h,to:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},S){let{basename:N,unstable_useTransitions:T}=z.useContext(Kn),E=typeof m=="string"&&xS.test(m),O=iS(m,N);m=O.to;let C=EE(m,{relative:s}),[P,M,R]=lT(a,b),I=yT(m,{replace:l,state:f,target:h,preventScrollReset:g,relative:s,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:T});function B(fe){t&&t(fe),fe.defaultPrevented||I(fe)}let Y=z.createElement("a",{...b,...R,href:O.absoluteURL||C,onClick:O.isExternal||u?t:B,ref:fT(S,M),target:h,"data-discover":!E&&n==="render"?"true":void 0});return P&&!E?z.createElement(z.Fragment,null,Y,z.createElement(uT,{page:C})):Y});Ia.displayName="Link";var pT=z.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:u,to:l,viewTransition:f,children:h,...m},g){let y=Il(l,{relative:m.relative}),v=Nr(),b=z.useContext(fd),{navigator:S,basename:N}=z.useContext(Kn),T=b!=null&&ST(y)&&f===!0,E=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,O=v.pathname,C=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(O=O.toLowerCase(),C=C?C.toLowerCase():null,E=E.toLowerCase()),C&&N&&(C=ca(C,N)||C);const P=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let M=O===E||!s&&O.startsWith(E)&&O.charAt(P)==="/",R=C!=null&&(C===E||!s&&C.startsWith(E)&&C.charAt(E.length)==="/"),I={isActive:M,isPending:R,isTransitioning:T},B=M?t:void 0,Y;typeof a=="function"?Y=a(I):Y=[a,M?"active":null,R?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(I):u;return z.createElement(Ia,{...m,"aria-current":B,className:Y,ref:g,style:fe,to:l,viewTransition:f},typeof h=="function"?h(I):h)});pT.displayName="NavLink";var gT=z.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:u,method:l=$c,action:f,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:N}=z.useContext(Kn),T=kT(),E=wT(f,{relative:m}),O=l.toLowerCase()==="get"?"get":"post",C=typeof f=="string"&&xS.test(f),P=M=>{if(h&&h(M),M.defaultPrevented)return;M.preventDefault();let R=M.nativeEvent.submitter,I=R?.getAttribute("formmethod")||l,B=()=>T(R||M.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:s,state:u,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v});N&&n!==!1?z.startTransition(()=>B()):B()};return z.createElement("form",{ref:S,method:O,action:E,onSubmit:a?h:P,...b,"data-discover":!C&&e==="render"?"true":void 0})});gT.displayName="Form";function xT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yS(e){let t=z.useContext(no);return wt(t,xT(e)),t}function yT(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=eg(),g=Nr(),y=Il(e,{relative:u});return z.useCallback(v=>{if(KE(v,t)){v.preventDefault();let b=n!==void 0?n:Nl(g)===Nl(y),S=()=>m(e,{replace:b,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f});h?z.startTransition(()=>S()):S()}},[g,m,y,n,a,t,e,s,u,l,f,h])}var bT=0,vT=()=>`__${String(++bT)}__`;function kT(){let{router:e}=yS("useSubmit"),{basename:t}=z.useContext(Kn),n=VE(),a=e.fetch,s=e.navigate;return z.useCallback(async(u,l={})=>{let{action:f,method:h,encType:m,formData:g,body:y}=QE(u,t);if(l.navigate===!1){let v=l.fetcherKey||vT();await a(v,n,l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:y,formMethod:l.method||h,formEncType:l.encType||m,flushSync:l.flushSync})}else await s(l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:y,formMethod:l.method||h,formEncType:l.encType||m,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[a,s,t,n])}function wT(e,{relative:t}={}){let{basename:n}=z.useContext(Kn),a=z.useContext(Ur);wt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Il(e||".",{relative:t})},l=Nr();if(e==null){u.search=l.search;let f=new URLSearchParams(u.search),h=f.getAll("index");if(h.some(g=>g==="")){f.delete("index"),h.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:la([n,u.pathname])),Nl(u)}function ST(e,{relative:t}={}){let n=z.useContext(oS);wt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=yS("useViewTransitionState"),s=Il(e,{relative:t});if(!n.isTransitioning)return!1;let u=ca(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=ca(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Fc(s.pathname,l)!=null||Fc(s.pathname,u)!=null}const bS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const zT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const _T=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const A0=e=>{const t=_T(e);return t.charAt(0).toUpperCase()+t.slice(1)};var jT={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 NT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const CT=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:u,iconNode:l,...f},h)=>z.createElement("svg",{ref:h,...jT,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:bS("lucide",s),...!u&&!NT(f)&&{"aria-hidden":"true"},...f},[...l.map(([m,g])=>z.createElement(m,g)),...Array.isArray(u)?u:[u]]));const pe=(e,t)=>{const n=z.forwardRef(({className:a,...s},u)=>z.createElement(CT,{ref:u,iconNode:t,className:bS(`lucide-${zT(A0(e))}`,`lucide-${e}`,a),...s}));return n.displayName=A0(e),n};const ET=[["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"}]],Rs=pe("activity",ET);const TT=[["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"}]],AT=pe("archive",TT);const OT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],vS=pe("arrow-down",OT);const RT=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],DT=pe("arrow-left",RT);const MT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],kS=pe("arrow-up",MT);const $T=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],LT=pe("ban",$T);const PT=[["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"}]],Cl=pe("bell",PT);const UT=[["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"}]],O0=pe("bot",UT);const VT=[["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"}]],BT=pe("box",VT);const ZT=[["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"}]],IT=pe("brain",ZT);const HT=[["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"}]],wS=pe("calendar",HT);const FT=[["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"}]],Ym=pe("chart-column",FT);const qT=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],GT=pe("check-check",qT);const YT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Km=pe("check",YT);const KT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],XT=pe("chevron-down",KT);const JT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],QT=pe("chevron-right",JT);const WT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eA=pe("chevron-up",WT);const tA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],nA=pe("circle-alert",tA);const rA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aA=pe("circle-check-big",rA);const iA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],SS=pe("circle-check",iA);const sA=[["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"}]],Xm=pe("circle-x",sA);const oA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],qa=pe("clock",oA);const lA=[["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"}]],uA=pe("copy",lA);const cA=[["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"}]],zS=pe("cpu",cA);const dA=[["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"}]],Zs=pe("database",dA);const fA=[["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"}]],qc=pe("dollar-sign",fA);const hA=[["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"}]],Hl=pe("eye",hA);const mA=[["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"}]],pA=pe("file-text",mA);const gA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],xA=pe("folder-open",gA);const yA=[["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"}]],bA=pe("funnel",yA);const vA=[["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"}]],kA=pe("hash",vA);const wA=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],SA=pe("history",wA);const zA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_A=pe("info",zA);const jA=[["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"}]],R0=pe("layout-dashboard",jA);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"}]],Jm=pe("list-checks",NA);const CA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],EA=pe("loader-circle",CA);const TA=[["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"}]],D0=pe("log-out",TA);const AA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],OA=pe("menu",AA);const RA=[["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"}]],M0=pe("message-square-plus",RA);const DA=[["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"}]],El=pe("message-square",DA);const MA=[["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"}]],_S=pe("moon",MA);const $A=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],LA=pe("pause",$A);const PA=[["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"}]],UA=pe("pen",PA);const VA=[["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"}]],ig=pe("pencil",VA);const BA=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ZA=pe("play",BA);const IA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],md=pe("plus",IA);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"}]],$0=pe("puzzle",HA);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"}]],Ds=pe("refresh-cw",FA);const qA=[["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"}]],L0=pe("rotate-ccw",qA);const GA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],YA=pe("search",GA);const KA=[["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"}]],XA=pe("send",KA);const JA=[["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"}]],P0=pe("settings",JA);const QA=[["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"}]],U0=pe("shield-check",QA);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"}]],jS=pe("sun",WA);const e4=[["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"}]],sg=pe("tag",e4);const t4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Qm=pe("terminal",t4);const n4=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],NS=pe("toggle-left",n4);const r4=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],CS=pe("toggle-right",r4);const a4=[["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"}]],Ai=pe("trash-2",a4);const i4=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],s4=pe("trending-up",i4);const o4=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],pc=pe("upload",o4);const l4=[["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"}]],og=pe("user",l4);const u4=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Tl=pe("wand-sparkles",u4);const c4=[["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"}]],Wm=pe("webhook",c4);const d4=[["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"}]],f4=pe("wifi-off",d4);const h4=[["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"}]],Jh=pe("wifi",h4);const m4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lg=pe("x",m4);var Qh={exports:{}},Wh={};var V0;function p4(){if(V0)return Wh;V0=1;var e=dd();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function f(y,v){var b=v(),S=a({inst:{value:b,getSnapshot:v}}),N=S[0].inst,T=S[1];return u(function(){N.value=b,N.getSnapshot=v,h(N)&&T({inst:N})},[y,b,v]),s(function(){return h(N)&&T({inst:N}),y(function(){h(N)&&T({inst:N})})},[y]),l(b),b}function h(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!n(y,b)}catch{return!0}}function m(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Wh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Wh}var B0;function g4(){return B0||(B0=1,Qh.exports=p4()),Qh.exports}var Z0=g4();const ES=0,TS=1,AS=2,I0=3;var H0=Object.prototype.hasOwnProperty;function ep(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--&&ep(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(H0.call(e,n)&&++a&&!H0.call(t,n)||!(n in t)||!ep(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const sa=new WeakMap,oa=()=>{},hn=oa(),tp=Object,qe=e=>e===hn,Dr=e=>typeof e=="function",Ga=(e,t)=>({...e,...t}),OS=e=>Dr(e.then),em={},gc={},ug="undefined",Fl=typeof window!=ug,np=typeof document!=ug,x4=Fl&&"Deno"in window,y4=()=>Fl&&typeof window.requestAnimationFrame!=ug,RS=(e,t)=>{const n=sa.get(e);return[()=>!qe(t)&&e.get(t)||em,a=>{if(!qe(t)){const s=e.get(t);t in gc||(gc[t]=s),n[5](t,Ga(s,a),s||em)}},n[6],()=>!qe(t)&&t in gc?gc[t]:!qe(t)&&e.get(t)||em]};let rp=!0;const b4=()=>rp,[ap,ip]=Fl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[oa,oa],v4=()=>{const e=np&&document.visibilityState;return qe(e)||e!=="hidden"},k4=e=>(np&&document.addEventListener("visibilitychange",e),ap("focus",e),()=>{np&&document.removeEventListener("visibilitychange",e),ip("focus",e)}),w4=e=>{const t=()=>{rp=!0,e()},n=()=>{rp=!1};return ap("online",t),ap("offline",n),()=>{ip("online",t),ip("offline",n)}},S4={isOnline:b4,isVisible:v4},z4={initFocus:k4,initReconnect:w4},F0=!Xp.useId,Is=!Fl||x4,_4=e=>y4()?window.requestAnimationFrame(e):setTimeout(e,1),tm=Is?z.useEffect:z.useLayoutEffect,nm=typeof navigator<"u"&&navigator.connection,q0=!Is&&nm&&(["slow-2g","2g"].includes(nm.effectiveType)||nm.saveData),xc=new WeakMap,j4=e=>tp.prototype.toString.call(e),rm=(e,t)=>e===`[object ${t}]`;let N4=0;const sp=e=>{const t=typeof e,n=j4(e),a=rm(n,"Date"),s=rm(n,"RegExp"),u=rm(n,"Object");let l,f;if(tp(e)===e&&!a&&!s){if(l=xc.get(e),l)return l;if(l=++N4+"~",xc.set(e,l),Array.isArray(e)){for(l="@",f=0;f<e.length;f++)l+=sp(e[f])+",";xc.set(e,l)}if(u){l="#";const h=tp.keys(e).sort();for(;!qe(f=h.pop());)qe(e[f])||(l+=f+":"+sp(e[f])+",");xc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},cg=e=>{if(Dr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?sp(e):"",[e,t]};let C4=0;const op=()=>++C4;async function DS(...e){const[t,n,a,s]=e,u=Ga({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let l=u.populateCache;const f=u.rollbackOnError;let h=u.optimisticData;const m=v=>typeof f=="function"?f(v):f!==!1,g=u.throwOnError;if(Dr(n)){const v=n,b=[],S=t.keys();for(const N of S)!/^\$(inf|sub)\$/.test(N)&&v(t.get(N)._k)&&b.push(N);return Promise.all(b.map(y))}return y(n);async function y(v){const[b]=cg(v);if(!b)return;const[S,N]=RS(t,b),[T,E,O,C]=sa.get(t),P=()=>{const oe=T[b];return(Dr(u.revalidate)?u.revalidate(S().data,v):u.revalidate!==!1)&&(delete O[b],delete C[b],oe&&oe[0])?oe[0](AS).then(()=>S().data):S().data};if(e.length<3)return P();let M=a,R,I=!1;const B=op();E[b]=[B,0];const Y=!qe(h),fe=S(),se=fe.data,le=fe._c,ee=qe(le)?se:le;if(Y&&(h=Dr(h)?h(ee,se):h,N({data:h,_c:ee})),Dr(M))try{M=M(ee)}catch(oe){R=oe,I=!0}if(M&&OS(M))if(M=await M.catch(oe=>{R=oe,I=!0}),B!==E[b][0]){if(I)throw R;return M}else I&&Y&&m(R)&&(l=!0,N({data:ee,_c:hn}));if(l&&!I)if(Dr(l)){const oe=l(M,ee);N({data:oe,error:hn,_c:hn})}else N({data:M,error:hn,_c:hn});if(E[b][1]=op(),Promise.resolve(P()).then(()=>{N({_c:hn})}),I){if(g)throw R;return}return M}}const G0=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},E4=(e,t)=>{if(!sa.has(e)){const n=Ga(z4,t),a=Object.create(null),s=DS.bind(hn,e);let u=oa;const l=Object.create(null),f=(g,y)=>{const v=l[g]||[];return l[g]=v,v.push(y),()=>v.splice(v.indexOf(y),1)},h=(g,y,v)=>{e.set(g,y);const b=l[g];if(b)for(const S of b)S(y,v)},m=()=>{if(!sa.has(e)&&(sa.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,f]),!Is)){const g=n.initFocus(setTimeout.bind(hn,G0.bind(hn,a,ES))),y=n.initReconnect(setTimeout.bind(hn,G0.bind(hn,a,TS)));u=()=>{g&&g(),y&&y(),sa.delete(e)}}};return m(),[e,s,m,u]}return[e,sa.get(e)[4]]},T4=(e,t,n,a,s)=>{const u=n.errorRetryCount,l=s.retryCount,f=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!qe(u)&&l>u||setTimeout(a,f,s)},A4=ep,[MS,Dn]=E4(new Map),O4=Ga({onLoadingSlow:oa,onSuccess:oa,onError:oa,onErrorRetry:T4,onDiscarded:oa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:q0?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:q0?5e3:3e3,compare:A4,isPaused:()=>!1,cache:MS,mutate:Dn,fallback:{}},S4),R4=(e,t)=>{const n=Ga(e,t);if(t){const{use:a,fallback:s}=e,{use:u,fallback:l}=t;a&&u&&(n.use=a.concat(u)),s&&l&&(n.fallback=Ga(s,l))}return n},D4=z.createContext({}),M4="$inf$",$S=Fl&&window.__SWR_DEVTOOLS_USE__,$4=$S?window.__SWR_DEVTOOLS_USE__:[],L4=()=>{$S&&(window.__SWR_DEVTOOLS_REACT__=Xp)},P4=e=>Dr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],U4=()=>{const e=z.useContext(D4);return z.useMemo(()=>Ga(O4,e),[e])},V4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=cg(t),[,,,f]=sa.get(MS);if(l.startsWith(M4))return n(...u);const h=f[l];return qe(h)?n(...u):(delete f[l],h)}),a),B4=$4.concat(V4),Z4=e=>function(...n){const a=U4(),[s,u,l]=P4(n),f=R4(a,l);let h=e;const{use:m}=f,g=(m||[]).concat(B4);for(let y=g.length;y--;)h=g[y](h);return h(s,u||f.fetcher||null,f)},I4=(e,t,n)=>{const a=t[e]||(t[e]=[]);return a.push(n),()=>{const s=a.indexOf(n);s>=0&&(a[s]=a[a.length-1],a.pop())}};L4();const am=Xp.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}}),im={dedupe:!0},Y0=Promise.resolve(hn),H4=(e,t,n)=>{const{cache:a,compare:s,suspense:u,fallbackData:l,revalidateOnMount:f,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:v,strictServerPrefetchWarning:b}=n,[S,N,T,E]=sa.get(a),[O,C]=cg(e),P=z.useRef(!1),M=z.useRef(!1),R=z.useRef(O),I=z.useRef(t),B=z.useRef(n),Y=()=>B.current,fe=()=>Y().isVisible()&&Y().isOnline(),[se,le,ee,oe]=RS(a,O),ae=z.useRef({}).current,V=qe(l)?qe(n.fallback)?hn:n.fallback[O]:l,J=(Oe,Qe)=>{for(const st in ae){const tt=st;if(tt==="data"){if(!s(Oe[tt],Qe[tt])&&(!qe(Oe[tt])||!s(he,Qe[tt])))return!1}else if(Qe[tt]!==Oe[tt])return!1}return!0},K=z.useMemo(()=>{const Oe=!O||!t?!1:qe(f)?Y().isPaused()||u?!1:h!==!1:f,Qe=Gt=>{const gt=Ga(Gt);return delete gt._k,Oe?{isValidating:!0,isLoading:!0,...gt}:gt},st=se(),tt=oe(),Qt=Qe(st),Xn=st===tt?Qt:Qe(tt);let Mt=Qt;return[()=>{const Gt=Qe(se());return J(Gt,Mt)?(Mt.data=Gt.data,Mt.isLoading=Gt.isLoading,Mt.isValidating=Gt.isValidating,Mt.error=Gt.error,Mt):(Mt=Gt,Gt)},()=>Xn]},[a,O]),ye=Z0.useSyncExternalStore(z.useCallback(Oe=>ee(O,(Qe,st)=>{J(st,Qe)||Oe()}),[a,O]),K[0],K[1]),A=!P.current,_=S[O]&&S[O].length>0,U=ye.data,w=qe(U)?V&&OS(V)?am(V):V:U,G=ye.error,de=z.useRef(w),he=v?qe(U)?qe(de.current)?w:de.current:U:w,me=O&&qe(w),Pe=!Is&&Z0.useSyncExternalStore(()=>oa,()=>!1,()=>!0);b&&Pe&&!u&&me&&console.warn(`Missing pre-initiated data for serialized key "${O}" 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 Ae=_&&!qe(G)?!1:A&&!qe(f)?f:Y().isPaused()?!1:u?qe(w)?!1:h:qe(w)||h,pt=!!(O&&t&&A&&Ae),Dt=qe(ye.isValidating)?pt:ye.isValidating,$=qe(ye.isLoading)?pt:ye.isLoading,je=z.useCallback(async Oe=>{const Qe=I.current;if(!O||!Qe||M.current||Y().isPaused())return!1;let st,tt,Qt=!0;const Xn=Oe||{},Mt=!T[O]||!Xn.dedupe,Gt=()=>F0?!M.current&&O===R.current&&P.current:O===R.current,gt={isValidating:!1,isLoading:!1},Ui=()=>{le(gt)},W=()=>{const we=T[O];we&&we[1]===tt&&delete T[O]},ce={isValidating:!0};qe(se().data)&&(ce.isLoading=!0);try{if(Mt&&(le(ce),n.loadingTimeout&&qe(se().data)&&setTimeout(()=>{Qt&&Gt()&&Y().onLoadingSlow(O,n)},n.loadingTimeout),T[O]=[Qe(C),op()]),[st,tt]=T[O],st=await st,Mt&&setTimeout(W,n.dedupingInterval),!T[O]||T[O][1]!==tt)return Mt&&Gt()&&Y().onDiscarded(O),!1;gt.error=hn;const we=N[O];if(!qe(we)&&(tt<=we[0]||tt<=we[1]||we[1]===0))return Ui(),Mt&&Gt()&&Y().onDiscarded(O),!1;const Ce=se().data;gt.data=s(Ce,st)?Ce:st,Mt&&Gt()&&Y().onSuccess(st,O,n)}catch(we){W();const Ce=Y(),{shouldRetryOnError:He}=Ce;Ce.isPaused()||(gt.error=we,Mt&&Gt()&&(Ce.onError(we,O,Ce),(He===!0||Dr(He)&&He(we))&&(!Y().revalidateOnFocus||!Y().revalidateOnReconnect||fe())&&Ce.onErrorRetry(we,O,Ce,gn=>{const Un=S[O];Un&&Un[0]&&Un[0](I0,gn)},{retryCount:(Xn.retryCount||0)+1,dedupe:!0})))}return Qt=!1,Ui(),!0},[O,a]),Ke=z.useCallback((...Oe)=>DS(a,R.current,...Oe),[]);if(tm(()=>{I.current=t,B.current=n,qe(U)||(de.current=U)}),tm(()=>{if(!O)return;const Oe=je.bind(hn,im);let Qe=0;Y().revalidateOnFocus&&(Qe=Date.now()+Y().focusThrottleInterval);const tt=I4(O,S,(Qt,Xn={})=>{if(Qt==ES){const Mt=Date.now();Y().revalidateOnFocus&&Mt>Qe&&fe()&&(Qe=Mt+Y().focusThrottleInterval,Oe())}else if(Qt==TS)Y().revalidateOnReconnect&&fe()&&Oe();else{if(Qt==AS)return je();if(Qt==I0)return je(Xn)}});return M.current=!1,R.current=O,P.current=!0,le({_k:C}),Ae&&(T[O]||(qe(w)||Is?Oe():_4(Oe))),()=>{M.current=!0,tt()}},[O]),tm(()=>{let Oe;function Qe(){const tt=Dr(m)?m(se().data):m;tt&&Oe!==-1&&(Oe=setTimeout(st,tt))}function st(){!se().error&&(g||Y().isVisible())&&(y||Y().isOnline())?je(im).then(Qe):Qe()}return Qe(),()=>{Oe&&(clearTimeout(Oe),Oe=-1)}},[m,g,y,O]),z.useDebugValue(he),u){if(!F0&&Is&&me)throw new Error("Fallback data is required when using Suspense in SSR.");me&&(I.current=t,B.current=n,M.current=!1);const Oe=E[O],Qe=!qe(Oe)&&me?Ke(Oe):Y0;if(am(Qe),!qe(G)&&me)throw G;const st=me?je(im):Y0;!qe(he)&&me&&(st.status="fulfilled",st.value=!0),am(st)}return{mutate:Ke,get data(){return ae.data=!0,he},get error(){return ae.error=!0,G},get isValidating(){return ae.isValidating=!0,Dt},get isLoading(){return ae.isLoading=!0,$}}},kt=Z4(H4),F4="x-architect-pass",zs="/api";class Ha{static instance;constructor(){}static getInstance(){return Ha.instance||(Ha.instance=new Ha),Ha.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[F4]=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(`${zs}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${zs}${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(`${zs}${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(`${zs}${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(`${zs}${t}`,{method:"DELETE",headers:this.getHeaders()});return this.handleResponse(n)}async uploadFile(t,n,a="file"){const s=new FormData;s.append(a,n);const u=await fetch(`${zs}${t}`,{method:"POST",headers:this.getHeaders(),body:s});return this.handleResponse(u)}}const xe=Ha.getInstance(),Al="/api",dg=e=>{const t=e.startsWith(Al)?e.substring(Al.length):e;return xe.get(t)};function LS(){return kt(`${Al}/status`,dg,{refreshInterval:5e3})}function q4(){return kt(`${Al}/logs`,dg)}function G4(e){return kt(e?`${Al}/logs/${e}?limit=1000`:null,dg,{refreshInterval:2e3})}function PS(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}=LS();return d.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:[d.jsxs("div",{className:"flex gap-4",children:[d.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),d.jsxs("span",{children:["PID: ",e?.pid||"-"]}),d.jsxs("span",{children:["UPTIME: ",e?PS(e.uptimeSeconds):"-"]})]}),d.jsxs("div",{className:"flex gap-4 opacity-70",children:[d.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),d.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const fg=z.createContext({});function hg(e){const t=z.useRef(null);return t.current===null&&(t.current=e()),t.current}const US=typeof window<"u",VS=US?z.useLayoutEffect:z.useEffect,pd=z.createContext(null);function mg(e,t){e.indexOf(t)===-1&&e.push(t)}function pg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Lr=(e,t,n)=>n>t?t:n<e?e:n;let gg=()=>{};const da={},BS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ZS(e){return typeof e=="object"&&e!==null}const IS=e=>/^0[^.\s]+$/u.test(e);function xg(e){let t;return()=>(t===void 0&&(t=e()),t)}const fr=e=>e,K4=(e,t)=>n=>t(e(n)),ql=(...e)=>e.reduce(K4),Ol=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class yg{constructor(){this.subscriptions=[]}add(t){return mg(this.subscriptions,t),()=>pg(this.subscriptions,t)}notify(t,n,a){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,a);else for(let u=0;u<s;u++){const l=this.subscriptions[u];l&&l(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ua=e=>e*1e3,dr=e=>e/1e3;function HS(e,t){return t?e*(1e3/t):0}const FS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,X4=1e-7,J4=12;function Q4(e,t,n,a,s){let u,l,f=0;do l=t+(n-t)/2,u=FS(l,a,s)-e,u>0?n=l:t=l;while(Math.abs(u)>X4&&++f<J4);return l}function Gl(e,t,n,a){if(e===t&&n===a)return fr;const s=u=>Q4(u,0,1,e,n);return u=>u===0||u===1?u:FS(s(u),t,a)}const qS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,GS=e=>t=>1-e(1-t),YS=Gl(.33,1.53,.69,.99),bg=GS(YS),KS=qS(bg),XS=e=>(e*=2)<1?.5*bg(e):.5*(2-Math.pow(2,-10*(e-1))),vg=e=>1-Math.sin(Math.acos(e)),JS=GS(vg),QS=qS(vg),W4=Gl(.42,0,1,1),e3=Gl(0,0,.58,1),WS=Gl(.42,0,.58,1),t3=e=>Array.isArray(e)&&typeof e[0]!="number",ez=e=>Array.isArray(e)&&typeof e[0]=="number",n3={linear:fr,easeIn:W4,easeInOut:WS,easeOut:e3,circIn:vg,circInOut:QS,circOut:JS,backIn:bg,backInOut:KS,backOut:YS,anticipate:XS},r3=e=>typeof e=="string",K0=e=>{if(ez(e)){gg(e.length===4);const[t,n,a,s]=e;return Gl(t,n,a,s)}else if(r3(e))return n3[e];return e},yc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function a3(e,t){let n=new Set,a=new Set,s=!1,u=!1;const l=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function h(g){l.has(g)&&(m.schedule(g),e()),g(f)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&s?n:a;return y&&l.add(g),S.has(g)||S.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(f=g,s){u=!0;return}s=!0,[n,a]=[a,n],n.forEach(h),n.clear(),s=!1,u&&(u=!1,m.process(g))}};return m}const i3=40;function tz(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,l=yc.reduce((C,P)=>(C[P]=a3(u),C),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:g,update:y,preRender:v,render:b,postRender:S}=l,N=()=>{const C=da.useManualTiming?s.timestamp:performance.now();n=!1,da.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(C-s.timestamp,i3),1)),s.timestamp=C,s.isProcessing=!0,f.process(s),h.process(s),m.process(s),g.process(s),y.process(s),v.process(s),b.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(N))},T=()=>{n=!0,a=!0,s.isProcessing||e(N)};return{schedule:yc.reduce((C,P)=>{const M=l[P];return C[P]=(R,I=!1,B=!1)=>(n||T(),M.schedule(R,I,B)),C},{}),cancel:C=>{for(let P=0;P<yc.length;P++)l[yc[P]].cancel(C)},state:s,steps:l}}const{schedule:bt,cancel:Ya,state:ln,steps:sm}=tz(typeof requestAnimationFrame<"u"?requestAnimationFrame:fr,!0);let Pc;function s3(){Pc=void 0}const Sn={now:()=>(Pc===void 0&&Sn.set(ln.isProcessing||da.useManualTiming?ln.timestamp:performance.now()),Pc),set:e=>{Pc=e,queueMicrotask(s3)}},nz=e=>t=>typeof t=="string"&&t.startsWith(e),rz=nz("--"),o3=nz("var(--"),kg=e=>o3(e)?l3.test(e.split("/*")[0].trim()):!1,l3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function X0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ao={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Rl={...ao,transform:e=>Lr(0,1,e)},bc={...ao,default:1},vl=e=>Math.round(e*1e5)/1e5,wg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function u3(e){return e==null}const c3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Sg=(e,t)=>n=>!!(typeof n=="string"&&c3.test(n)&&n.startsWith(e)||t&&!u3(n)&&Object.prototype.hasOwnProperty.call(n,t)),az=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,u,l,f]=a.match(wg);return{[e]:parseFloat(s),[t]:parseFloat(u),[n]:parseFloat(l),alpha:f!==void 0?parseFloat(f):1}},d3=e=>Lr(0,255,e),om={...ao,transform:e=>Math.round(d3(e))},Ni={test:Sg("rgb","red"),parse:az("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+om.transform(e)+", "+om.transform(t)+", "+om.transform(n)+", "+vl(Rl.transform(a))+")"};function f3(e){let t="",n="",a="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,a+=a,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:s?parseInt(s,16)/255:1}}const lp={test:Sg("#"),parse:f3,transform:Ni.transform},Yl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ba=Yl("deg"),$r=Yl("%"),ke=Yl("px"),h3=Yl("vh"),m3=Yl("vw"),J0={...$r,parse:e=>$r.parse(e)/100,transform:e=>$r.transform(e*100)},Ms={test:Sg("hsl","hue"),parse:az("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+$r.transform(vl(t))+", "+$r.transform(vl(n))+", "+vl(Rl.transform(a))+")"},It={test:e=>Ni.test(e)||lp.test(e)||Ms.test(e),parse:e=>Ni.test(e)?Ni.parse(e):Ms.test(e)?Ms.parse(e):lp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ni.transform(e):Ms.transform(e),getAnimatableNone:e=>{const t=It.parse(e);return t.alpha=0,It.transform(t)}},p3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function g3(e){return isNaN(e)&&typeof e=="string"&&(e.match(wg)?.length||0)+(e.match(p3)?.length||0)>0}const iz="number",sz="color",x3="var",y3="var(",Q0="${}",b3=/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 Dl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let u=0;const f=t.replace(b3,h=>(It.test(h)?(a.color.push(u),s.push(sz),n.push(It.parse(h))):h.startsWith(y3)?(a.var.push(u),s.push(x3),n.push(h)):(a.number.push(u),s.push(iz),n.push(parseFloat(h))),++u,Q0)).split(Q0);return{values:n,split:f,indexes:a,types:s}}function oz(e){return Dl(e).values}function lz(e){const{split:t,types:n}=Dl(e),a=t.length;return s=>{let u="";for(let l=0;l<a;l++)if(u+=t[l],s[l]!==void 0){const f=n[l];f===iz?u+=vl(s[l]):f===sz?u+=It.transform(s[l]):u+=s[l]}return u}}const v3=e=>typeof e=="number"?0:It.test(e)?It.getAnimatableNone(e):e;function k3(e){const t=oz(e);return lz(e)(t.map(v3))}const Ka={test:g3,parse:oz,createTransformer:lz,getAnimatableNone:k3};function lm(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 w3({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,u=0,l=0;if(!t)s=u=l=n;else{const f=n<.5?n*(1+t):n+t-n*t,h=2*n-f;s=lm(h,f,e+1/3),u=lm(h,f,e),l=lm(h,f,e-1/3)}return{red:Math.round(s*255),green:Math.round(u*255),blue:Math.round(l*255),alpha:a}}function Gc(e,t){return n=>n>0?t:e}const jt=(e,t,n)=>e+(t-e)*n,um=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},S3=[lp,Ni,Ms],z3=e=>S3.find(t=>t.test(e));function W0(e){const t=z3(e);if(!t)return!1;let n=t.parse(e);return t===Ms&&(n=w3(n)),n}const e1=(e,t)=>{const n=W0(e),a=W0(t);if(!n||!a)return Gc(e,t);const s={...n};return u=>(s.red=um(n.red,a.red,u),s.green=um(n.green,a.green,u),s.blue=um(n.blue,a.blue,u),s.alpha=jt(n.alpha,a.alpha,u),Ni.transform(s))},up=new Set(["none","hidden"]);function _3(e,t){return up.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function j3(e,t){return n=>jt(e,t,n)}function zg(e){return typeof e=="number"?j3:typeof e=="string"?kg(e)?Gc:It.test(e)?e1:E3:Array.isArray(e)?uz:typeof e=="object"?It.test(e)?e1:N3:Gc}function uz(e,t){const n=[...e],a=n.length,s=e.map((u,l)=>zg(u)(u,t[l]));return u=>{for(let l=0;l<a;l++)n[l]=s[l](u);return n}}function N3(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=zg(e[s])(e[s],t[s]));return s=>{for(const u in a)n[u]=a[u](s);return n}}function C3(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const u=t.types[s],l=e.indexes[u][a[u]],f=e.values[l]??0;n[s]=f,a[u]++}return n}const E3=(e,t)=>{const n=Ka.createTransformer(t),a=Dl(e),s=Dl(t);return a.indexes.var.length===s.indexes.var.length&&a.indexes.color.length===s.indexes.color.length&&a.indexes.number.length>=s.indexes.number.length?up.has(e)&&!s.values.length||up.has(t)&&!a.values.length?_3(e,t):ql(uz(C3(a,s),s.values),n):Gc(e,t)};function cz(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?jt(e,t,n):zg(e)(e,t)}const T3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>bt.update(t,n),stop:()=>Ya(t),now:()=>ln.isProcessing?ln.timestamp:Sn.now()}},dz=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let u=0;u<s;u++)a+=Math.round(e(u/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},Yc=2e4;function _g(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<Yc;)t+=n,a=e.next(t);return t>=Yc?1/0:t}function A3(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(_g(a),Yc);return{type:"keyframes",ease:u=>a.next(s*u).value/t,duration:dr(s)}}const O3=5;function fz(e,t,n){const a=Math.max(t-O3,0);return HS(n-e(a),t-a)}const Rt={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},cm=.001;function R3({duration:e=Rt.duration,bounce:t=Rt.bounce,velocity:n=Rt.velocity,mass:a=Rt.mass}){let s,u,l=1-t;l=Lr(Rt.minDamping,Rt.maxDamping,l),e=Lr(Rt.minDuration,Rt.maxDuration,dr(e)),l<1?(s=m=>{const g=m*l,y=g*e,v=g-n,b=cp(m,l),S=Math.exp(-y);return cm-v/b*S},u=m=>{const y=m*l*e,v=y*n+n,b=Math.pow(l,2)*Math.pow(m,2)*e,S=Math.exp(-y),N=cp(Math.pow(m,2),l);return(-s(m)+cm>0?-1:1)*((v-b)*S)/N}):(s=m=>{const g=Math.exp(-m*e),y=(m-n)*e+1;return-cm+g*y},u=m=>{const g=Math.exp(-m*e),y=(n-m)*(e*e);return g*y});const f=5/e,h=M3(s,u,f);if(e=ua(e),isNaN(h))return{stiffness:Rt.stiffness,damping:Rt.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const D3=12;function M3(e,t,n){let a=n;for(let s=1;s<D3;s++)a=a-e(a)/t(a);return a}function cp(e,t){return e*Math.sqrt(1-t*t)}const $3=["duration","bounce"],L3=["stiffness","damping","mass"];function t1(e,t){return t.some(n=>e[n]!==void 0)}function P3(e){let t={velocity:Rt.velocity,stiffness:Rt.stiffness,damping:Rt.damping,mass:Rt.mass,isResolvedFromDuration:!1,...e};if(!t1(e,L3)&&t1(e,$3))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,u=2*Lr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Rt.mass,stiffness:s,damping:u}}else{const n=R3(e);t={...t,...n,mass:Rt.mass},t.isResolvedFromDuration=!0}return t}function Kc(e=Rt.visualDuration,t=Rt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:s}=n;const u=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],f={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:y,velocity:v,isResolvedFromDuration:b}=P3({...n,velocity:-dr(n.velocity||0)}),S=v||0,N=m/(2*Math.sqrt(h*g)),T=l-u,E=dr(Math.sqrt(h/g)),O=Math.abs(T)<5;a||(a=O?Rt.restSpeed.granular:Rt.restSpeed.default),s||(s=O?Rt.restDelta.granular:Rt.restDelta.default);let C;if(N<1){const M=cp(E,N);C=R=>{const I=Math.exp(-N*E*R);return l-I*((S+N*E*T)/M*Math.sin(M*R)+T*Math.cos(M*R))}}else if(N===1)C=M=>l-Math.exp(-E*M)*(T+(S+E*T)*M);else{const M=E*Math.sqrt(N*N-1);C=R=>{const I=Math.exp(-N*E*R),B=Math.min(M*R,300);return l-I*((S+N*E*T)*Math.sinh(B)+M*T*Math.cosh(B))/M}}const P={calculatedDuration:b&&y||null,next:M=>{const R=C(M);if(b)f.done=M>=y;else{let I=M===0?S:0;N<1&&(I=M===0?ua(S):fz(C,M,R));const B=Math.abs(I)<=a,Y=Math.abs(l-R)<=s;f.done=B&&Y}return f.value=f.done?l:R,f},toString:()=>{const M=Math.min(_g(P),Yc),R=dz(I=>P.next(M*I).value,M,30);return M+"ms "+R},toTransition:()=>{}};return P}Kc.applyToOptions=e=>{const t=A3(e,100,Kc);return e.ease=t.ease,e.duration=ua(t.duration),e.type="keyframes",e};function dp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:u=500,modifyTarget:l,min:f,max:h,restDelta:m=.5,restSpeed:g}){const y=e[0],v={done:!1,value:y},b=B=>f!==void 0&&B<f||h!==void 0&&B>h,S=B=>f===void 0?h:h===void 0||Math.abs(f-B)<Math.abs(h-B)?f:h;let N=n*t;const T=y+N,E=l===void 0?T:l(T);E!==T&&(N=E-y);const O=B=>-N*Math.exp(-B/a),C=B=>E+O(B),P=B=>{const Y=O(B),fe=C(B);v.done=Math.abs(Y)<=m,v.value=v.done?E:fe};let M,R;const I=B=>{b(v.value)&&(M=B,R=Kc({keyframes:[v.value,S(v.value)],velocity:fz(C,B,v.value),damping:s,stiffness:u,restDelta:m,restSpeed:g}))};return I(0),{calculatedDuration:null,next:B=>{let Y=!1;return!R&&M===void 0&&(Y=!0,P(B),I(B)),M!==void 0&&B>=M?R.next(B-M):(!Y&&P(B),v)}}}function U3(e,t,n){const a=[],s=n||da.mix||cz,u=e.length-1;for(let l=0;l<u;l++){let f=s(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||fr:t;f=ql(h,f)}a.push(f)}return a}function V3(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const u=e.length;if(gg(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 f=U3(t,a,s),h=f.length,m=g=>{if(l&&g<e[0])return t[0];let y=0;if(h>1)for(;y<e.length-2&&!(g<e[y+1]);y++);const v=Ol(e[y],e[y+1],g);return f[y](v)};return n?g=>m(Lr(e[0],e[u-1],g)):m}function B3(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Ol(0,t,a);e.push(jt(n,1,s))}}function Z3(e){const t=[0];return B3(t,e.length-1),t}function I3(e,t){return e.map(n=>n*t)}function H3(e,t){return e.map(()=>t||WS).splice(0,e.length-1)}function kl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=t3(a)?a.map(K0):K0(a),u={done:!1,value:t[0]},l=I3(n&&n.length===t.length?n:Z3(t),e),f=V3(l,t,{ease:Array.isArray(s)?s:H3(t,s)});return{calculatedDuration:e,next:h=>(u.value=f(h),u.done=h>=e,u)}}const F3=e=>e!==null;function jg(e,{repeat:t,repeatType:n="loop"},a,s=1){const u=e.filter(F3),f=s<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!f||a===void 0?u[f]:a}const q3={decay:dp,inertia:dp,tween:kl,keyframes:kl,spring:Kc};function hz(e){typeof e.type=="string"&&(e.type=q3[e.type])}class Ng{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 G3=e=>e/100;class Cg extends Ng{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!==Sn.now()&&this.tick(Sn.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;hz(t);const{type:n=kl,repeat:a=0,repeatDelay:s=0,repeatType:u,velocity:l=0}=t;let{keyframes:f}=t;const h=n||kl;h!==kl&&typeof f[0]!="number"&&(this.mixKeyframes=ql(G3,cz(f[0],f[1])),f=[0,100]);const m=h({...t,keyframes:f});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=_g(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+s,this.totalDuration=this.resolvedDuration*(a+1)-s,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:s,mixKeyframes:u,mirroredGenerator:l,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:y,repeatType:v,repeatDelay:b,type:S,onUpdate:N,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const E=this.currentTime-m*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,P=a;if(y){const B=Math.min(this.currentTime,s)/f;let Y=Math.floor(B),fe=B%1;!fe&&B>=1&&(fe=1),fe===1&&Y--,Y=Math.min(Y,y+1),Y%2&&(v==="reverse"?(fe=1-fe,b&&(fe-=b/f)):v==="mirror"&&(P=l)),C=Lr(0,1,fe)*f}const M=O?{done:!1,value:g[0]}:P.next(C);u&&(M.value=u(M.value));let{done:R}=M;!O&&h!==null&&(R=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return I&&S!==dp&&(M.value=jg(g,this.options,T,this.speed)),N&&N(M.value),I&&this.finish(),M}then(t,n){return this.finished.then(t,n)}get duration(){return dr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dr(t)}get time(){return dr(this.currentTime)}set time(t){t=ua(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(Sn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=dr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=T3,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),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(Sn.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 Y3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ci=e=>e*180/Math.PI,fp=e=>{const t=Ci(Math.atan2(e[1],e[0]));return hp(t)},K3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fp,rotateZ:fp,skewX:e=>Ci(Math.atan(e[1])),skewY:e=>Ci(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},hp=e=>(e=e%360,e<0&&(e+=360),e),n1=fp,r1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),a1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),X3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:r1,scaleY:a1,scale:e=>(r1(e)+a1(e))/2,rotateX:e=>hp(Ci(Math.atan2(e[6],e[5]))),rotateY:e=>hp(Ci(Math.atan2(-e[2],e[0]))),rotateZ:n1,rotate:n1,skewX:e=>Ci(Math.atan(e[4])),skewY:e=>Ci(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function mp(e){return e.includes("scale")?1:0}function pp(e,t){if(!e||e==="none")return mp(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=X3,s=n;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=K3,s=f}if(!s)return mp(t);const u=a[t],l=s[1].split(",").map(Q3);return typeof u=="function"?u(l):l[u]}const J3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return pp(n,t)};function Q3(e){return parseFloat(e.trim())}const io=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],so=new Set(io),i1=e=>e===ao||e===ke,W3=new Set(["x","y","z"]),eO=io.filter(e=>!W3.has(e));function tO(e){const t=[];return eO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Fa={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})=>pp(t,"x"),y:(e,{transform:t})=>pp(t,"y")};Fa.translateX=Fa.x;Fa.translateY=Fa.y;const Ei=new Set;let gp=!1,xp=!1,yp=!1;function mz(){if(xp){const e=Array.from(Ei).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=tO(a);s.length&&(n.set(a,s),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const s=n.get(a);s&&s.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)})}xp=!1,gp=!1,Ei.forEach(e=>e.complete(yp)),Ei.clear()}function pz(){Ei.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xp=!0)})}function nO(){yp=!0,pz(),mz(),yp=!1}class Eg{constructor(t,n,a,s,u,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=s,this.element=u,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ei.add(this),gp||(gp=!0,bt.read(pz),bt.resolveKeyframes(mz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const u=s?.get(),l=t[t.length-1];if(u!==void 0)t[0]=u;else if(a&&n){const f=a.readValue(n,l);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=l),s&&u===void 0&&s.set(t[0])}Y3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ei.delete(this)}cancel(){this.state==="scheduled"&&(Ei.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rO=e=>e.startsWith("--");function aO(e,t,n){rO(t)?e.style.setProperty(t,n):e.style[t]=n}const iO=xg(()=>window.ScrollTimeline!==void 0),sO={};function oO(e,t){const n=xg(e);return()=>sO[t]??n()}const gz=oO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),gl=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,s1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gl([0,.65,.55,1]),circOut:gl([.55,0,1,.45]),backIn:gl([.31,.01,.66,-.59]),backOut:gl([.33,1.53,.69,.99])};function xz(e,t){if(e)return typeof e=="function"?gz()?dz(e,t):"ease-out":ez(e)?gl(e):Array.isArray(e)?e.map(n=>xz(n,t)||s1.easeOut):s1[e]}function lO(e,t,n,{delay:a=0,duration:s=300,repeat:u=0,repeatType:l="loop",ease:f="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const y=xz(f,s);Array.isArray(y)&&(g.easing=y);const v={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(g,v)}function yz(e){return typeof e=="function"&&"applyToOptions"in e}function uO({type:e,...t}){return yz(e)&&gz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class cO extends Ng{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:u,allowFlatten:l=!1,finalKeyframe:f,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=l,this.options=t,gg(typeof t.type!="string");const m=uO(t);this.animation=lO(n,a,s,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=jg(s,this.options,f,this.speed);this.updateMotionValue?this.updateMotionValue(g):aO(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 dr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dr(t)}get time(){return dr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ua(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&&iO()?(this.animation.timeline=t,fr):n(this)}}const bz={anticipate:XS,backInOut:KS,circInOut:QS};function dO(e){return e in bz}function fO(e){typeof e.ease=="string"&&dO(e.ease)&&(e.ease=bz[e.ease])}const dm=10;class hO extends cO{constructor(t){fO(t),hz(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:u,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const f=new Cg({...l,autoplay:!1}),h=Math.max(dm,Sn.now()-this.startTime),m=Lr(0,dm,h-dm);n.setWithVelocity(f.sample(Math.max(0,h-m)).value,f.sample(h).value,m),f.stop()}}const o1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ka.test(e)||e==="0")&&!e.startsWith("url("));function mO(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 s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],l=o1(s,t),f=o1(u,t);return!l||!f?!1:mO(e)||(n==="spring"||yz(n))&&a}function bp(e){e.duration=0,e.type="keyframes"}const gO=new Set(["opacity","clipPath","filter","transform"]),xO=xg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function yO(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:u,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return xO()&&n&&gO.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&u!==0&&l!=="inertia"}const bO=40;class vO extends Ng{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:u=0,repeatType:l="loop",keyframes:f,name:h,motionValue:m,element:g,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Sn.now();const v={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...y},b=g?.KeyframeResolver||Eg;this.keyframeResolver=new b(f,(S,N,T)=>this.onKeyframesResolved(S,N,v,!T),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:u,type:l,velocity:f,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=Sn.now(),pO(t,u,l,f)||((da.instantAnimations||!h)&&g?.(jg(t,a,n)),t[0]=t[t.length-1],bp(a),a.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>bO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},b=!m&&yO(v),S=v.motionValue?.owner?.current,N=b?new hO({...v,element:S}):new Cg(v);N.finished.then(()=>{this.notifyFinished()}).catch(fr),this.pendingTimeline&&(this.stopTimeline=N.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=N}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(),nO()),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 vz(e,t,n,a=0,s=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,f=(l-1)*a;return typeof n=="function"?n(u,l):s===1?u*a:f-u*a}const kO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wO(e){const t=kO.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function kz(e,t,n=1){const[a,s]=wO(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const l=u.trim();return BS(l)?parseFloat(l):l}return kg(s)?kz(s,t,n+1):s}const SO={type:"spring",stiffness:500,damping:25,restSpeed:10},zO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_O={type:"keyframes",duration:.8},jO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},NO=(e,{keyframes:t})=>t.length>2?_O:so.has(e)?e.startsWith("scale")?zO(t[1]):SO:jO,CO=e=>e!==null;function EO(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(CO),u=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[u]}function Tg(e,t){return e?.[t]??e?.default??e}function TO({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:s,repeat:u,repeatType:l,repeatDelay:f,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const Ag=(e,t,n,a={},s,u)=>l=>{const f=Tg(a,e)||{},h=f.delay||a.delay||0;let{elapsed:m=0}=a;m=m-ua(h);const g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:v=>{t.set(v),f.onUpdate&&f.onUpdate(v)},onComplete:()=>{l(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:u?void 0:s};TO(f)||Object.assign(g,NO(e,g)),g.duration&&(g.duration=ua(g.duration)),g.repeatDelay&&(g.repeatDelay=ua(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(bp(g),g.delay===0&&(y=!0)),(da.instantAnimations||da.skipAnimations)&&(y=!0,bp(g),g.delay=0),g.allowFlatten=!f.type&&!f.ease,y&&!u&&t.get()!==void 0){const v=EO(g.keyframes,f);if(v!==void 0){bt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return f.isSync?new Cg(g):new vO(g)};function l1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Og(e,t,n,a){if(typeof t=="function"){const[s,u]=l1(a);t=t(n!==void 0?n:e.custom,s,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,u]=l1(a);t=t(n!==void 0?n:e.custom,s,u)}return t}function Hs(e,t,n){const a=e.getProps();return Og(a,t,n!==void 0?n:a.custom,e)}const wz=new Set(["width","height","top","left","right","bottom",...io]),u1=30,AO=e=>!isNaN(parseFloat(e));class OO{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=Sn.now();if(this.updatedAt!==s&&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=Sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=AO(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 yg);const a=this.events[t].add(n);return t==="change"?()=>{a(),bt.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=Sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>u1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,u1);return HS(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 Xs(e,t){return new OO(e,t)}const vp=e=>Array.isArray(e);function RO(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xs(n))}function DO(e){return vp(e)?e[e.length-1]||0:e}function MO(e,t){const n=Hs(e,t);let{transitionEnd:a={},transition:s={},...u}=n||{};u={...u,...a};for(const l in u){const f=DO(u[l]);RO(e,l,f)}}const mn=e=>!!(e&&e.getVelocity);function $O(e){return!!(mn(e)&&e.add)}function kp(e,t){const n=e.getValue("willChange");if($O(n))return n.add(t);if(!n&&da.WillChange){const a=new da.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Rg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const LO="framerAppearId",Sz="data-"+Rg(LO);function zz(e){return e.props[Sz]}function PO({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function _z(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:l,...f}=t;const h=u?.reduceMotion;a&&(u=a);const m=[],g=s&&e.animationState&&e.animationState.getState()[s];for(const y in f){const v=e.getValue(y,e.latestValues[y]??null),b=f[y];if(b===void 0||g&&PO(g,y))continue;const S={delay:n,...Tg(u||{},y)},N=v.get();if(N!==void 0&&!v.isAnimating&&!Array.isArray(b)&&b===N&&!S.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const C=zz(e);if(C){const P=window.MotionHandoffAnimation(C,y,bt);P!==null&&(S.startTime=P,T=!0)}}kp(e,y);const E=h??e.shouldReduceMotion;v.start(Ag(y,v,b,E&&wz.has(y)?{type:!1}:S,e,T));const O=v.animation;O&&m.push(O)}return l&&Promise.all(m).then(()=>{bt.update(()=>{l&&MO(e,l)})}),m}function wp(e,t,n={}){const a=Hs(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const u=a?()=>Promise.all(_z(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:y}=s;return UO(e,t,h,m,g,y,n)}:()=>Promise.resolve(),{when:f}=s;if(f){const[h,m]=f==="beforeChildren"?[u,l]:[l,u];return h().then(()=>m())}else return Promise.all([u(),l(n.delay)])}function UO(e,t,n=0,a=0,s=0,u=1,l){const f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.push(wp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+vz(e.variantChildren,h,a,s,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function VO(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(u=>wp(e,u,n));a=Promise.all(s)}else if(typeof t=="string")a=wp(e,t,n);else{const s=typeof t=="function"?Hs(e,t,n.custom):t;a=Promise.all(_z(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const BO={test:e=>e==="auto",parse:e=>e},jz=e=>t=>t.test(e),Nz=[ao,ke,$r,Ba,m3,h3,BO],c1=e=>Nz.find(jz(e));function ZO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||IS(e):!0}const IO=new Set(["brightness","contrast","saturate","opacity"]);function HO(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(wg)||[];if(!a)return e;const s=n.replace(a,"");let u=IO.has(t)?1:0;return a!==n&&(u*=100),t+"("+u+s+")"}const FO=/\b([a-z-]*)\(.*?\)/gu,Sp={...Ka,getAnimatableNone:e=>{const t=e.match(FO);return t?t.map(HO).join(" "):e}},d1={...ao,transform:Math.round},qO={rotate:Ba,rotateX:Ba,rotateY:Ba,rotateZ:Ba,scale:bc,scaleX:bc,scaleY:bc,scaleZ:bc,skew:Ba,skewX:Ba,skewY:Ba,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Rl,originX:J0,originY:J0,originZ:ke},Dg={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...qO,zIndex:d1,fillOpacity:Rl,strokeOpacity:Rl,numOctaves:d1},GO={...Dg,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:Sp,WebkitFilter:Sp},Cz=e=>GO[e];function Ez(e,t){let n=Cz(e);return n!==Sp&&(n=Ka),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const YO=new Set(["auto","none","0"]);function KO(e,t,n){let a=0,s;for(;a<e.length&&!s;){const u=e[a];typeof u=="string"&&!YO.has(u)&&Dl(u).values.length&&(s=e[a]),a++}if(s&&n)for(const u of t)e[u]=Ez(n,s)}class XO extends Eg{constructor(t,n,a,s,u){super(t,n,a,s,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 y=t[g];if(typeof y=="string"&&(y=y.trim(),kg(y))){const v=kz(y,n.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!wz.has(a)||t.length!==2)return;const[s,u]=t,l=c1(s),f=c1(u),h=X0(s),m=X0(u);if(h!==m&&Fa[a]){this.needsMeasurement=!0;return}if(l!==f)if(i1(l)&&i1(f))for(let g=0;g<t.length;g++){const y=t[g];typeof y=="string"&&(t[g]=parseFloat(y))}else Fa[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||ZO(t[s]))&&a.push(s);a.length&&KO(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=Fa[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(a,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const u=a.length-1,l=a[u];a[u]=Fa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([f,h])=>{t.getValue(f).set(h)}),this.resolveNoneKeyframes()}}function JO(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const s=n?.[e]??a.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(a=>a!=null)}const Tz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function zp(e){return ZS(e)&&"offsetHeight"in e}const{schedule:Mg}=tz(queueMicrotask,!1),zr={x:!1,y:!1};function Az(){return zr.x||zr.y}function QO(e){return e==="x"||e==="y"?zr[e]?null:(zr[e]=!0,()=>{zr[e]=!1}):zr.x||zr.y?null:(zr.x=zr.y=!0,()=>{zr.x=zr.y=!1})}function Oz(e,t){const n=JO(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function f1(e){return!(e.pointerType==="touch"||Az())}function WO(e,t,n={}){const[a,s,u]=Oz(e,n),l=f=>{if(!f1(f))return;const{target:h}=f,m=t(h,f);if(typeof m!="function"||!h)return;const g=y=>{f1(y)&&(m(y),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,s)};return a.forEach(f=>{f.addEventListener("pointerenter",l,s)}),u}const Rz=(e,t)=>t?e===t?!0:Rz(e,t.parentElement):!1,$g=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,eR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Dz(e){return eR.has(e.tagName)||e.isContentEditable===!0}const Uc=new WeakSet;function h1(e){return t=>{t.key==="Enter"&&e(t)}}function fm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const tR=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=h1(()=>{if(Uc.has(n))return;fm(n,"down");const s=h1(()=>{fm(n,"up")}),u=()=>fm(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function m1(e){return $g(e)&&!Az()}function nR(e,t,n={}){const[a,s,u]=Oz(e,n),l=f=>{const h=f.currentTarget;if(!m1(f))return;Uc.add(h);const m=t(h,f),g=(b,S)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),Uc.has(h)&&Uc.delete(h),m1(b)&&typeof m=="function"&&m(b,{success:S})},y=b=>{g(b,h===window||h===document||n.useGlobalTarget||Rz(h,b.target))},v=b=>{g(b,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",v,s)};return a.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",l,s),zp(f)&&(f.addEventListener("focus",m=>tR(m,s)),!Dz(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function Mz(e){return ZS(e)&&"ownerSVGElement"in e}function rR(e){return Mz(e)&&e.tagName==="svg"}const aR=[...Nz,It,Ka],iR=e=>aR.find(jz(e)),p1=()=>({translate:0,scale:1,origin:0,originPoint:0}),$s=()=>({x:p1(),y:p1()}),g1=()=>({min:0,max:0}),Jt=()=>({x:g1(),y:g1()}),_p={current:null},$z={current:!1},sR=typeof window<"u";function oR(){if($z.current=!0,!!sR)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_p.current=e.matches;e.addEventListener("change",t),t()}else _p.current=!1}const lR=new WeakMap;function gd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ml(e){return typeof e=="string"||Array.isArray(e)}const Lg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pg=["initial",...Lg];function xd(e){return gd(e.animate)||Pg.some(t=>Ml(e[t]))}function Lz(e){return!!(xd(e)||e.variants)}function uR(e,t,n){for(const a in t){const s=t[a],u=n[a];if(mn(s))e.addValue(a,s);else if(mn(u))e.addValue(a,Xs(s,{owner:e}));else if(u!==s)if(e.hasValue(a)){const l=e.getValue(a);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(a);e.addValue(a,Xs(l!==void 0?l:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const x1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xc={};function Pz(e){Xc=e}function cR(){return Xc}class dR{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:u,visualState:l},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Eg,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 v=Sn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,bt.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=s,this.options=f,this.blockInitialAnimation=!!u,this.isControllingVariants=xd(n),this.isVariantNode=Lz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in y){const b=y[v];h[v]!==void 0&&mn(b)&&b.set(h[v])}}mount(t){this.current=t,lR.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:($z.current||oR(),this.shouldReduceMotion=_p.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ya(this.notifyUpdate),Ya(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=so.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&bt.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,()=>{s(),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 Xc){const n=Xc[t];if(!n)continue;const{isEnabled:a,Feature:s}=n;if(!this.features[t]&&s&&a(this.props)&&(this.features[t]=new s(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):Jt()}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<x1.length;a++){const s=x1[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const u="on"+s,l=t[u];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=uR(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=Xs(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"&&(BS(a)||IS(a))?a=parseFloat(a):!iR(a)&&Ka.test(n)&&(a=Ez(t,n)),this.setBaseTarget(t,mn(a)?a.get():a)),mn(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=Og(this.props,n,this.presenceContext?.custom);u&&(a=u[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mn(s)?s:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new yg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Mg.render(this.render)}}class Uz extends dR{constructor(){super(...arguments),this.KeyframeResolver=XO}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;mn(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 Vz({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function fR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hR(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 hm(e){return e===void 0||e===1}function jp({scale:e,scaleX:t,scaleY:n}){return!hm(e)||!hm(t)||!hm(n)}function _i(e){return jp(e)||Bz(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Bz(e){return y1(e.x)||y1(e.y)}function y1(e){return e&&e!=="0%"}function Jc(e,t,n){const a=e-n,s=t*a;return n+s}function b1(e,t,n,a,s){return s!==void 0&&(e=Jc(e,s,a)),Jc(e,n,a)+t}function Np(e,t=0,n=1,a,s){e.min=b1(e.min,t,n,a,s),e.max=b1(e.max,t,n,a,s)}function Zz(e,{x:t,y:n}){Np(e.x,t.translate,t.scale,t.originPoint),Np(e.y,n.translate,n.scale,n.originPoint)}const v1=.999999999999,k1=1.0000000000001;function mR(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let u,l;for(let f=0;f<s;f++){u=n[f],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&&Ps(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Zz(e,l)),a&&_i(u.latestValues)&&Ps(e,u.latestValues))}t.x<k1&&t.x>v1&&(t.x=1),t.y<k1&&t.y>v1&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function w1(e,t,n,a,s=.5){const u=jt(e.min,e.max,s);Np(e,t,n,u,a)}function Ps(e,t){w1(e.x,t.x,t.scaleX,t.scale,t.originX),w1(e.y,t.y,t.scaleY,t.scale,t.originY)}function Iz(e,t){return Vz(hR(e.getBoundingClientRect(),t))}function pR(e,t,n){const a=Iz(e,n),{scroll:s}=t;return s&&(Ls(a.x,s.offset.x),Ls(a.y,s.offset.y)),a}const gR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xR=io.length;function yR(e,t,n){let a="",s=!0;for(let u=0;u<xR;u++){const l=io[u],f=e[l];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(l.startsWith("scale")?1:0);else{const m=parseFloat(f);h=l.startsWith("scale")?m===1:m===0}if(!h||n){const m=Tz(f,Dg[l]);if(!h){s=!1;const g=gR[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function Ug(e,t,n){const{style:a,vars:s,transformOrigin:u}=e;let l=!1,f=!1;for(const h in t){const m=t[h];if(so.has(h)){l=!0;continue}else if(rz(h)){s[h]=m;continue}else{const g=Tz(m,Dg[h]);h.startsWith("origin")?(f=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=yR(t,e.transform,n):a.transform&&(a.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:g=0}=u;a.transformOrigin=`${h} ${m} ${g}`}}function Hz(e,{style:t,vars:n},a,s){const u=e.style;let l;for(l in t)u[l]=t[l];s?.applyProjectionStyles(u,a);for(l in n)u.setProperty(l,n[l])}function S1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ul={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=S1(e,t.target.x),a=S1(e,t.target.y);return`${n}% ${a}%`}},bR={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=Ka.parse(e);if(s.length>5)return a;const u=Ka.createTransformer(e),l=typeof s[0]!="number"?1:0,f=n.x.scale*t.x,h=n.y.scale*t.y;s[0+l]/=f,s[1+l]/=h;const m=jt(f,h,.5);return typeof s[2+l]=="number"&&(s[2+l]/=m),typeof s[3+l]=="number"&&(s[3+l]/=m),u(s)}},Cp={borderRadius:{...ul,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ul,borderTopRightRadius:ul,borderBottomLeftRadius:ul,borderBottomRightRadius:ul,boxShadow:bR};function Fz(e,{layout:t,layoutId:n}){return so.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cp[e]||e==="opacity")}function Vg(e,t,n){const a=e.style,s=t?.style,u={};if(!a)return u;for(const l in a)(mn(a[l])||s&&mn(s[l])||Fz(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(u[l]=a[l]);return u}function vR(e){return window.getComputedStyle(e)}class kR extends Uz{constructor(){super(...arguments),this.type="html",this.renderInstance=Hz}readValueFromInstance(t,n){if(so.has(n))return this.projection?.isProjecting?mp(n):J3(t,n);{const a=vR(t),s=(rz(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Iz(t,n)}build(t,n,a){Ug(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Vg(t,n,a)}}const wR={offset:"stroke-dashoffset",array:"stroke-dasharray"},SR={offset:"strokeDashoffset",array:"strokeDasharray"};function zR(e,t,n=1,a=0,s=!0){e.pathLength=1;const u=s?wR:SR;e[u.offset]=`${-a}`,e[u.array]=`${t} ${n}`}const _R=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qz(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:u=1,pathOffset:l=0,...f},h,m,g){if(Ug(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:v}=e;y.transform&&(v.transform=y.transform,delete y.transform),(v.transform||y.transformOrigin)&&(v.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const b of _R)y[b]!==void 0&&(v[b]=y[b],delete y[b]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),s!==void 0&&zR(y,s,u,l,!1)}const Gz=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"]),Yz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function jR(e,t,n,a){Hz(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(Gz.has(s)?s:Rg(s),t.attrs[s])}function Kz(e,t,n){const a=Vg(e,t,n);for(const s in e)if(mn(e[s])||mn(t[s])){const u=io.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[u]=e[s]}return a}class NR extends Uz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(so.has(n)){const a=Cz(n);return a&&a.default||0}return n=Gz.has(n)?n:Rg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Kz(t,n,a)}build(t,n,a){qz(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){jR(t,n,a,s)}mount(t){this.isSVGTag=Yz(t.tagName),super.mount(t)}}const CR=Pg.length;function Xz(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Xz(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<CR;n++){const a=Pg[n],s=e.props[a];(Ml(s)||s===!1)&&(t[a]=s)}return t}function Jz(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 ER=[...Lg].reverse(),TR=Lg.length;function AR(e){return t=>Promise.all(t.map(({animation:n,options:a})=>VO(e,n,a)))}function OR(e){let t=AR(e),n=z1(),a=!0;const s=h=>(m,g)=>{const y=Hs(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:v,transitionEnd:b,...S}=y;m={...m,...S,...b}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Xz(e.parent)||{},y=[],v=new Set;let b={},S=1/0;for(let T=0;T<TR;T++){const E=ER[T],O=n[E],C=m[E]!==void 0?m[E]:g[E],P=Ml(C),M=E===h?O.isActive:null;M===!1&&(S=T);let R=C===g[E]&&C!==m[E]&&P;if(R&&a&&e.manuallyAnimateOnMount&&(R=!1),O.protectedKeys={...b},!O.isActive&&M===null||!C&&!O.prevProp||gd(C)||typeof C=="boolean")continue;const I=RR(O.prevProp,C);let B=I||E===h&&O.isActive&&!R&&P||T>S&&P,Y=!1;const fe=Array.isArray(C)?C:[C];let se=fe.reduce(s(E),{});M===!1&&(se={});const{prevResolvedValues:le={}}=O,ee={...le,...se},oe=J=>{B=!0,v.has(J)&&(Y=!0,v.delete(J)),O.needsAnimating[J]=!0;const K=e.getValue(J);K&&(K.liveStyle=!1)};for(const J in ee){const K=se[J],ye=le[J];if(b.hasOwnProperty(J))continue;let A=!1;vp(K)&&vp(ye)?A=!Jz(K,ye):A=K!==ye,A?K!=null?oe(J):v.add(J):K!==void 0&&v.has(J)?oe(J):O.protectedKeys[J]=!0}O.prevProp=C,O.prevResolvedValues=se,O.isActive&&(b={...b,...se}),a&&e.blockInitialAnimation&&(B=!1);const ae=R&&I;B&&(!ae||Y)&&y.push(...fe.map(J=>{const K={type:E};if(typeof J=="string"&&a&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:ye}=e,A=Hs(ye,J);if(ye.enteringChildren&&A){const{delayChildren:_}=A.transition||{};K.delay=vz(ye.enteringChildren,e,_)}}return{animation:J,options:K}}))}if(v.size){const T={};if(typeof m.initial!="boolean"){const E=Hs(e,Array.isArray(m.initial)?m.initial[0]:m.initial);E&&E.transition&&(T.transition=E.transition)}v.forEach(E=>{const O=e.getBaseTarget(E),C=e.getValue(E);C&&(C.liveStyle=!0),T[E]=O??null}),y.push({animation:T})}let N=!!y.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(N=!1),a=!1,N?t(y):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const g=l(h);for(const y in n)n[y].protectedKeys={};return g}return{animateChanges:l,setActive:f,setAnimateFunction:u,getState:()=>n,reset:()=>{n=z1()}}}function RR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Jz(t,e):!1}function wi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function z1(){return{animate:wi(!0),whileInView:wi(),whileHover:wi(),whileTap:wi(),whileDrag:wi(),whileFocus:wi(),exit:wi()}}function _1(e,t){e.min=t.min,e.max=t.max}function wr(e,t){_1(e.x,t.x),_1(e.y,t.y)}function j1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Qz=1e-4,DR=1-Qz,MR=1+Qz,Wz=.01,$R=0-Wz,LR=0+Wz;function zn(e){return e.max-e.min}function PR(e,t,n){return Math.abs(e-t)<=n}function N1(e,t,n,a=.5){e.origin=a,e.originPoint=jt(t.min,t.max,e.origin),e.scale=zn(n)/zn(t),e.translate=jt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=DR&&e.scale<=MR||isNaN(e.scale))&&(e.scale=1),(e.translate>=$R&&e.translate<=LR||isNaN(e.translate))&&(e.translate=0)}function wl(e,t,n,a){N1(e.x,t.x,n.x,a?a.originX:void 0),N1(e.y,t.y,n.y,a?a.originY:void 0)}function C1(e,t,n){e.min=n.min+t.min,e.max=e.min+zn(t)}function UR(e,t,n){C1(e.x,t.x,n.x),C1(e.y,t.y,n.y)}function E1(e,t,n){e.min=t.min-n.min,e.max=e.min+zn(t)}function Qc(e,t,n){E1(e.x,t.x,n.x),E1(e.y,t.y,n.y)}function T1(e,t,n,a,s){return e-=t,e=Jc(e,1/n,a),s!==void 0&&(e=Jc(e,1/s,a)),e}function VR(e,t=0,n=1,a=.5,s,u=e,l=e){if($r.test(t)&&(t=parseFloat(t),t=jt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let f=jt(u.min,u.max,a);e===u&&(f-=t),e.min=T1(e.min,t,n,f,s),e.max=T1(e.max,t,n,f,s)}function A1(e,t,[n,a,s],u,l){VR(e,t[n],t[a],t[s],t.scale,u,l)}const BR=["x","scaleX","originX"],ZR=["y","scaleY","originY"];function O1(e,t,n,a){A1(e.x,t,BR,n?n.x:void 0,a?a.x:void 0),A1(e.y,t,ZR,n?n.y:void 0,a?a.y:void 0)}function R1(e){return e.translate===0&&e.scale===1}function e_(e){return R1(e.x)&&R1(e.y)}function D1(e,t){return e.min===t.min&&e.max===t.max}function IR(e,t){return D1(e.x,t.x)&&D1(e.y,t.y)}function M1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function t_(e,t){return M1(e.x,t.x)&&M1(e.y,t.y)}function $1(e){return zn(e.x)/zn(e.y)}function L1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function lr(e){return[e("x"),e("y")]}function HR(e,t,n){let a="";const s=e.x.translate/t.x,u=e.y.translate/t.y,l=n?.z||0;if((s||u||l)&&(a=`translate3d(${s}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:y,rotateY:v,skewX:b,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),y&&(a+=`rotateX(${y}deg) `),v&&(a+=`rotateY(${v}deg) `),b&&(a+=`skewX(${b}deg) `),S&&(a+=`skewY(${S}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(a+=`scale(${f}, ${h})`),a||"none"}const n_=["TopLeft","TopRight","BottomLeft","BottomRight"],FR=n_.length,P1=e=>typeof e=="string"?parseFloat(e):e,U1=e=>typeof e=="number"||ke.test(e);function qR(e,t,n,a,s,u){s?(e.opacity=jt(0,n.opacity??1,GR(a)),e.opacityExit=jt(t.opacity??1,0,YR(a))):u&&(e.opacity=jt(t.opacity??1,n.opacity??1,a));for(let l=0;l<FR;l++){const f=`border${n_[l]}Radius`;let h=V1(t,f),m=V1(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||U1(h)===U1(m)?(e[f]=Math.max(jt(P1(h),P1(m),a),0),($r.test(m)||$r.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||n.rotate)&&(e.rotate=jt(t.rotate||0,n.rotate||0,a))}function V1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const GR=r_(0,.5,JS),YR=r_(.5,.95,fr);function r_(e,t,n){return a=>a<e?0:a>t?1:n(Ol(e,t,a))}function KR(e,t,n){const a=mn(e)?e:Xs(e);return a.start(Ag("",a,t,n)),a.animation}function $l(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const XR=(e,t)=>e.depth-t.depth;class JR{constructor(){this.children=[],this.isDirty=!1}add(t){mg(this.children,t),this.isDirty=!0}remove(t){pg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(XR),this.isDirty=!1,this.children.forEach(t)}}function QR(e,t){const n=Sn.now(),a=({timestamp:s})=>{const u=s-n;u>=t&&(Ya(a),e(u-t))};return bt.setup(a,!0),()=>Ya(a)}function Vc(e){return mn(e)?e.get():e}class WR{constructor(){this.members=[]}add(t){mg(this.members,t),t.scheduleRender()}remove(t){if(pg(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(s=>t===s);if(n===0)return!1;let a;for(let s=n;s>=0;s--){const u=this.members[s];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 s=a.options.layoutDependency,u=t.options.layoutDependency;s!==void 0&&u!==void 0&&s===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:f}=t.options;f===!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 Bc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},mm=["","X","Y","Z"],eD=1e3;let tD=0;function pm(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function a_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=zz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",bt,!(s||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&a_(a)}function i_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(l={},f=t?.()){this.id=tD++,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(aD),this.nodes.forEach(lD),this.nodes.forEach(uD),this.nodes.forEach(iD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new JR)}addEventListener(l,f){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new yg),this.eventHandlers.get(l).add(f)}notifyListeners(l,...f){const h=this.eventHandlers.get(l);h&&h.notify(...f)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Mz(l)&&!rR(l),this.instance=l;const{layoutId:f,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||f)&&(this.isLayoutDirty=!0),e){let g,y=0;const v=()=>this.root.updateBlockedByResize=!1;bt.read(()=>{y=window.innerWidth}),e(l,()=>{const b=window.innerWidth;b!==y&&(y=b,this.root.updateBlockedByResize=!0,g&&g(),g=QR(v,250),Bc.hasAnimatedSinceResize&&(Bc.hasAnimatedSinceResize=!1,this.nodes.forEach(I1)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:v,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||mD,{onLayoutAnimationStart:N,onLayoutAnimationComplete:T}=m.getProps(),E=!this.targetLayout||!t_(this.targetLayout,b),O=!y&&v;if(this.options.layoutRoot||this.resumeFrom||O||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Tg(S,"layout"),onPlay:N,onComplete:T};(m.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(g,O)}else y||I1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}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(),Ya(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(cD),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&&a_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:f,layout:h}=this.options;if(f===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(B1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Z1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(oD),this.nodes.forEach(nD),this.nodes.forEach(rD)):this.nodes.forEach(Z1),this.clearAllSnapshots();const f=Sn.now();ln.delta=Lr(0,1e3/60,f-ln.timestamp),ln.timestamp=f,ln.isProcessing=!0,sm.update.process(ln),sm.preRender.process(ln),sm.render.process(ln),ln.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(sD),this.sharedNodes.forEach(dD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,bt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){bt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!zn(this.snapshot.measuredBox.x)&&!zn(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=Jt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(f=!1),f&&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(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!e_(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(f||_i(this.latestValues)||g)&&(s(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return l&&(h=this.removeTransform(h)),pD(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Jt();const f=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gD))){const{scroll:m}=this.root;m&&(Ls(f.x,m.offset.x),Ls(f.y,m.offset.y))}return f}removeElementScroll(l){const f=Jt();if(wr(f,l),this.scroll?.wasRoot)return f;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:y}=m;m!==this.root&&g&&y.layoutScroll&&(g.wasRoot&&wr(f,l),Ls(f.x,g.offset.x),Ls(f.y,g.offset.y))}return f}applyTransform(l,f=!1){const h=Jt();wr(h,l);for(let m=0;m<this.path.length;m++){const g=this.path[m];!f&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ps(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),_i(g.latestValues)&&Ps(h,g.latestValues)}return _i(this.latestValues)&&Ps(h,this.latestValues),h}removeTransform(l){const f=Jt();wr(f,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!_i(m.latestValues))continue;jp(m.latestValues)&&m.updateSnapshot();const g=Jt(),y=m.measurePageBox();wr(g,y),O1(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return _i(this.latestValues)&&O1(f,this.latestValues),f}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!==ln.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;if(!(l||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:y}=this.options;if(!this.layout||!(g||y))return;this.resolvedRelativeTargetAt=ln.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Jt(),this.targetWithTransforms=Jt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),UR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):wr(this.target,this.layout.layoutBox),Zz(this.target,this.targetDelta)):wr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||jp(this.parent.latestValues)||Bz(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,f,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jt(),this.relativeTargetOrigin=Jt(),Qc(this.relativeTargetOrigin,f,h),wr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),f=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===ln.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;wr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,v=this.treeScale.y;mR(this.layoutCorrected,this.treeScale,this.path,f),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Jt());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(j1(this.prevProjectionDelta.x,this.projectionDelta.x),j1(this.prevProjectionDelta.y,this.projectionDelta.y)),wl(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==v||!L1(this.projectionDelta.x,this.prevProjectionDelta.x)||!L1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=$s(),this.projectionDelta=$s(),this.projectionDeltaWithTransform=$s()}setAnimationOrigin(l,f=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},y=$s();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const v=Jt(),b=h?h.source:void 0,S=this.layout?this.layout.source:void 0,N=b!==S,T=this.getStack(),E=!T||T.members.length<=1,O=!!(N&&!E&&this.options.crossfade===!0&&!this.path.some(hD));this.animationProgress=0;let C;this.mixTargetDelta=P=>{const M=P/1e3;H1(y.x,l.x,M),H1(y.y,l.y,M),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qc(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),fD(this.relativeTarget,this.relativeTargetOrigin,v,M),C&&IR(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Jt()),wr(C,this.relativeTarget)),N&&(this.animationValues=g,qR(g,m,this.latestValues,M,O,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=bt.update(()=>{Bc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Xs(0)),this.currentAnimation=KR(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),l.onUpdate&&l.onUpdate(f)},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(eD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:f,target:h,layout:m,latestValues:g}=l;if(!(!f||!h||!m)){if(this!==l&&this.layout&&m&&s_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Jt();const y=zn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+y;const v=zn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+v}wr(f,h),Ps(f,g),wl(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(l,f){this.sharedNodes.has(l)||this.sharedNodes.set(l,new WR),this.sharedNodes.get(l).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):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:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let f=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&pm("z",l,m,this.animationValues);for(let g=0;g<mm.length;g++)pm(`rotate${mm[g]}`,l,m,this.animationValues),pm(`skew${mm[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,f){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=Vc(f?.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=Vc(f?.pointerEvents)||""),this.hasProjected&&!_i(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let y=HR(this.projectionDeltaWithTransform,this.treeScale,g);h&&(y=h(g,y)),l.transform=y;const{x:v,y:b}=this.projectionDelta;l.transformOrigin=`${v.origin*100}% ${b.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 S in Cp){if(g[S]===void 0)continue;const{correct:N,applyTo:T,isCSSVariable:E}=Cp[S],O=y==="none"?g[S]:N(g[S],m);if(T){const C=T.length;for(let P=0;P<C;P++)l[T[P]]=O}else E?this.options.visualElement.renderState.vars[S]=O:l[S]=O}this.options.layoutId&&(l.pointerEvents=m===this?Vc(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(B1),this.root.sharedNodes.clear()}}}function nD(e){e.updateLayout()}function rD(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:s}=e.options,u=t.source!==e.layout.source;s==="size"?lr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],v=zn(y);y.min=n[g].min,y.max=y.min+v}):s_(s,t.layoutBox,n)&&lr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],v=zn(n[g]);y.max=y.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+v)});const l=$s();wl(l,n,t.layoutBox);const f=$s();u?wl(f,e.applyTransform(a,!0),t.measuredBox):wl(f,n,t.layoutBox);const h=!e_(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:v}=g;if(y&&v){const b=Jt();Qc(b,t.layoutBox,y.layoutBox);const S=Jt();Qc(S,n,v.layoutBox),t_(b,S)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:f,layoutDelta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function aD(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 iD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function sD(e){e.clearSnapshot()}function B1(e){e.clearMeasurements()}function Z1(e){e.isLayoutDirty=!1}function oD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function I1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function lD(e){e.resolveTargetDelta()}function uD(e){e.calcProjection()}function cD(e){e.resetSkewAndRotation()}function dD(e){e.removeLeadSnapshot()}function H1(e,t,n){e.translate=jt(t.translate,0,n),e.scale=jt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function F1(e,t,n,a){e.min=jt(t.min,n.min,a),e.max=jt(t.max,n.max,a)}function fD(e,t,n,a){F1(e.x,t.x,n.x,a),F1(e.y,t.y,n.y,a)}function hD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const mD={duration:.45,ease:[.4,0,.1,1]},q1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),G1=q1("applewebkit/")&&!q1("chrome/")?Math.round:fr;function Y1(e){e.min=G1(e.min),e.max=G1(e.max)}function pD(e){Y1(e.x),Y1(e.y)}function s_(e,t,n){return e==="position"||e==="preserve-aspect"&&!PR($1(t),$1(n),.2)}function gD(e){return e!==e.root&&e.scroll?.wasRoot}const xD=i_({attachResizeListener:(e,t)=>$l(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),gm={current:void 0},o_=i_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gm.current){const e=new xD({});e.mount(window),e.setOptions({layoutScroll:!0}),gm.current=e}return gm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Bg=z.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function K1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yD(...e){return t=>{let n=!1;const a=e.map(s=>{const u=K1(s,t);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let s=0;s<a.length;s++){const u=a[s];typeof u=="function"?u():K1(e[s],null)}}}}function bD(...e){return z.useCallback(yD(...e),e)}class vD extends z.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=zp(a)&&a.offsetWidth||0,u=zp(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=s-l.width-l.left,l.bottom=u-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function kD({children:e,isPresent:t,anchorX:n,anchorY:a,root:s}){const u=z.useId(),l=z.useRef(null),f=z.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=z.useContext(Bg),m=e.props?.ref??e?.ref,g=bD(l,m);return z.useInsertionEffect(()=>{const{width:y,height:v,top:b,left:S,right:N,bottom:T}=f.current;if(t||!l.current||!y||!v)return;const E=n==="left"?`left: ${S}`:`right: ${N}`,O=a==="bottom"?`bottom: ${T}`:`top: ${b}`;l.current.dataset.motionPopId=u;const C=document.createElement("style");h&&(C.nonce=h);const P=s??document.head;return P.appendChild(C),C.sheet&&C.sheet.insertRule(`
|
|
12
|
-
[data-motion-pop-id="${u}"] {
|
|
13
|
-
position: absolute !important;
|
|
14
|
-
width: ${y}px !important;
|
|
15
|
-
height: ${v}px !important;
|
|
16
|
-
${E}px !important;
|
|
17
|
-
${O}px !important;
|
|
18
|
-
}
|
|
19
|
-
`),()=>{P.contains(C)&&P.removeChild(C)}},[t]),d.jsx(vD,{isPresent:t,childRef:l,sizeRef:f,children:z.cloneElement(e,{ref:g})})}const wD=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:u,mode:l,anchorX:f,anchorY:h,root:m})=>{const g=hg(SD),y=z.useId();let v=!0,b=z.useMemo(()=>(v=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:S=>{g.set(S,!0);for(const N of g.values())if(!N)return;a&&a()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[n,g,a]);return u&&v&&(b={...b}),z.useMemo(()=>{g.forEach((S,N)=>g.set(N,!1))},[n]),z.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=d.jsx(kD,{isPresent:n,anchorX:f,anchorY:h,root:m,children:e})),d.jsx(pd.Provider,{value:b,children:e})};function SD(){return new Map}function l_(e=!0){const t=z.useContext(pd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,u=z.useId();z.useEffect(()=>{if(e)return s(u)},[e]);const l=z.useCallback(()=>e&&a&&a(u),[u,a,e]);return!n&&a?[!1,l]:[!0]}const vc=e=>e.key||"";function X1(e){const t=[];return z.Children.forEach(e,n=>{z.isValidElement(n)&&t.push(n)}),t}const zD=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:u="sync",propagate:l=!1,anchorX:f="left",anchorY:h="top",root:m})=>{const[g,y]=l_(l),v=z.useMemo(()=>X1(e),[e]),b=l&&!g?[]:v.map(vc),S=z.useRef(!0),N=z.useRef(v),T=hg(()=>new Map),E=z.useRef(new Set),[O,C]=z.useState(v),[P,M]=z.useState(v);VS(()=>{S.current=!1,N.current=v;for(let B=0;B<P.length;B++){const Y=vc(P[B]);b.includes(Y)?(T.delete(Y),E.current.delete(Y)):T.get(Y)!==!0&&T.set(Y,!1)}},[P,b.length,b.join("-")]);const R=[];if(v!==O){let B=[...v];for(let Y=0;Y<P.length;Y++){const fe=P[Y],se=vc(fe);b.includes(se)||(B.splice(Y,0,fe),R.push(fe))}return u==="wait"&&R.length&&(B=R),M(X1(B)),C(v),null}const{forceRender:I}=z.useContext(fg);return d.jsx(d.Fragment,{children:P.map(B=>{const Y=vc(B),fe=l&&!g?!1:v===P||b.includes(Y),se=()=>{if(E.current.has(Y))return;if(E.current.add(Y),T.has(Y))T.set(Y,!0);else return;let le=!0;T.forEach(ee=>{ee||(le=!1)}),le&&(I?.(),M(N.current),l&&y?.(),a&&a())};return d.jsx(wD,{isPresent:fe,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:u,root:m,onExitComplete:fe?void 0:se,anchorX:f,anchorY:h,children:B},Y)})})},u_=z.createContext({strict:!1}),J1={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 Q1=!1;function _D(){if(Q1)return;const e={};for(const t in J1)e[t]={isEnabled:n=>J1[t].some(a=>!!n[a])};Pz(e),Q1=!0}function c_(){return _D(),cR()}function jD(e){const t=c_();for(const n in e)t[n]={...t[n],...e[n]};Pz(t)}const ND=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 Wc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ND.has(e)}let d_=e=>!Wc(e);function CD(e){typeof e=="function"&&(d_=t=>t.startsWith("on")?!Wc(t):e(t))}try{CD(require("@emotion/is-prop-valid").default)}catch{}function ED(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(d_(s)||n===!0&&Wc(s)||!t&&!Wc(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const yd=z.createContext({});function TD(e,t){if(xd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Ml(n)?n:void 0,animate:Ml(a)?a:void 0}}return e.inherit!==!1?t:{}}function AD(e){const{initial:t,animate:n}=TD(e,z.useContext(yd));return z.useMemo(()=>({initial:t,animate:n}),[W1(t),W1(n)])}function W1(e){return Array.isArray(e)?e.join(" "):e}const Zg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function f_(e,t,n){for(const a in t)!mn(t[a])&&!Fz(a,n)&&(e[a]=t[a])}function OD({transformTemplate:e},t){return z.useMemo(()=>{const n=Zg();return Ug(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RD(e,t){const n=e.style||{},a={};return f_(a,n,e),Object.assign(a,OD(e,t)),a}function DD(e,t){const n={},a=RD(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 h_=()=>({...Zg(),attrs:{}});function MD(e,t,n,a){const s=z.useMemo(()=>{const u=h_();return qz(u,t,Yz(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};f_(u,e.style,e),s.style={...u,...s.style}}return s}const $D=["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 Ig(e){return typeof e!="string"||e.includes("-")?!1:!!($D.indexOf(e)>-1||/[A-Z]/u.test(e))}function LD(e,t,n,{latestValues:a},s,u=!1,l){const h=(l??Ig(e)?MD:DD)(t,a,s,e),m=ED(t,typeof e=="string",u),g=e!==z.Fragment?{...m,...h,ref:n}:{},{children:y}=t,v=z.useMemo(()=>mn(y)?y.get():y,[y]);return z.createElement(e,{...g,children:v})}function PD({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:UD(n,a,s,e),renderState:t()}}function UD(e,t,n,a){const s={},u=a(e,{});for(const v in u)s[v]=Vc(u[v]);let{initial:l,animate:f}=e;const h=xd(e),m=Lz(e);t&&m&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),f===void 0&&(f=t.animate));let g=n?n.initial===!1:!1;g=g||l===!1;const y=g?f:l;if(y&&typeof y!="boolean"&&!gd(y)){const v=Array.isArray(y)?y:[y];for(let b=0;b<v.length;b++){const S=Og(e,v[b]);if(S){const{transitionEnd:N,transition:T,...E}=S;for(const O in E){let C=E[O];if(Array.isArray(C)){const P=g?C.length-1:0;C=C[P]}C!==null&&(s[O]=C)}for(const O in N)s[O]=N[O]}}}return s}const m_=e=>(t,n)=>{const a=z.useContext(yd),s=z.useContext(pd),u=()=>PD(e,t,a,s);return n?u():hg(u)},VD=m_({scrapeMotionValuesFromProps:Vg,createRenderState:Zg}),BD=m_({scrapeMotionValuesFromProps:Kz,createRenderState:h_}),ZD=Symbol.for("motionComponentSymbol");function ID(e,t,n){const a=z.useRef(n);z.useInsertionEffect(()=>{a.current=n});const s=z.useRef(null);return z.useCallback(u=>{u&&e.onMount?.(u),t&&(u?t.mount(u):t.unmount());const l=a.current;if(typeof l=="function")if(u){const f=l(u);typeof f=="function"&&(s.current=f)}else s.current?(s.current(),s.current=null):l(u);else l&&(l.current=u)},[t])}const p_=z.createContext({});function xl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function HD(e,t,n,a,s,u){const{visualElement:l}=z.useContext(yd),f=z.useContext(u_),h=z.useContext(pd),m=z.useContext(Bg).reducedMotion,g=z.useRef(null),y=z.useRef(!1);a=a||f.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}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,b=z.useContext(p_);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&FD(g.current,n,s,b);const S=z.useRef(!1);z.useInsertionEffect(()=>{v&&S.current&&v.update(n,h)});const N=n[Sz],T=z.useRef(!!N&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return VS(()=>{y.current=!0,v&&(S.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),T.current&&v.animationState&&v.animationState.animateChanges())}),z.useEffect(()=>{v&&(!T.current&&v.animationState&&v.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),T.current=!1),v.enteringChildren=void 0)}),v}function FD(e,t,n,a){const{layoutId:s,layout:u,drag:l,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:g_(e.parent)),e.projection.setOptions({layoutId:s,layout:u,alwaysMeasureLayout:!!l||f&&xl(f),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function g_(e){if(e)return e.options.allowProjection!==!1?e.projection:g_(e.parent)}function xm(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&jD(a);const u=n?n==="svg":Ig(e),l=u?BD:VD;function f(m,g){let y;const v={...z.useContext(Bg),...m,layoutId:qD(m)},{isStatic:b}=v,S=AD(m),N=l(m,b);if(!b&&US){GD();const T=YD(v);y=T.MeasureLayout,S.visualElement=HD(e,N,v,s,T.ProjectionNode,u)}return d.jsxs(yd.Provider,{value:S,children:[y&&S.visualElement?d.jsx(y,{visualElement:S.visualElement,...v}):null,LD(e,m,ID(N,S.visualElement,g),N,b,t,u)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=z.forwardRef(f);return h[ZD]=e,h}function qD({layoutId:e}){const t=z.useContext(fg).id;return t&&e!==void 0?t+"-"+e:e}function GD(e,t){z.useContext(u_).strict}function YD(e){const t=c_(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function KD(e,t){if(typeof Proxy>"u")return xm;const n=new Map,a=(u,l)=>xm(u,l,e,t),s=(u,l)=>a(u,l);return new Proxy(s,{get:(u,l)=>l==="create"?a:(n.has(l)||n.set(l,xm(l,void 0,e,t)),n.get(l))})}const XD=(e,t)=>t.isSVG??Ig(e)?new NR(t):new kR(t,{allowProjection:e!==z.Fragment});class JD extends Qa{constructor(t){super(t),t.animationState||(t.animationState=OR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();gd(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 QD=0;class WD extends Qa{constructor(){super(...arguments),this.id=QD++}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 s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 eM={animation:{Feature:JD},exit:{Feature:WD}};function Kl(e){return{point:{x:e.pageX,y:e.pageY}}}const tM=e=>t=>$g(t)&&e(t,Kl(t));function Sl(e,t,n,a){return $l(e,t,tM(n),a)}const x_=({current:e})=>e?e.ownerDocument.defaultView:null,ek=(e,t)=>Math.abs(e-t);function nM(e,t){const n=ek(e.x,t.x),a=ek(e.y,t.y);return Math.sqrt(n**2+a**2)}const tk=new Set(["auto","scroll"]);class y_{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:u=!1,distanceThreshold:l=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=bm(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,N=nM(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!N)return;const{point:T}=b,{timestamp:E}=ln;this.history.push({...T,timestamp:E});const{onStart:O,onMove:C}=this.handlers;S||(O&&O(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,b)},this.handlePointerMove=(b,S)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=ym(S,this.transformPagePoint),bt.update(this.updatePoint,!0)},this.handlePointerUp=(b,S)=>{this.end();const{onEnd:N,onSessionEnd:T,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=bm(b.type==="pointercancel"?this.lastMoveEventInfo:ym(S,this.transformPagePoint),this.history);this.startEvent&&N&&N(b,O),T&&T(b,O)},!$g(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=s||window;const h=Kl(t),m=ym(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=ln;this.history=[{...g,timestamp:y}];const{onSessionStart:v}=n;v&&v(t,bm(m,this.history)),this.removeListeners=ql(Sl(this.contextWindow,"pointermove",this.handlePointerMove),Sl(this.contextWindow,"pointerup",this.handlePointerUp),Sl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(tk.has(a.overflowX)||tk.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,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:s.x-n.x,y:s.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,s),bt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ya(this.updatePoint)}}function ym(e,t){return t?{point:t(e.point)}:e}function nk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bm({point:e},t){return{point:e,delta:nk(e,b_(t)),offset:nk(e,rM(t)),velocity:aM(t,.1)}}function rM(e){return e[0]}function b_(e){return e[e.length-1]}function aM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=b_(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>ua(t)));)n--;if(!a)return{x:0,y:0};const u=dr(s.timestamp-a.timestamp);if(u===0)return{x:0,y:0};const l={x:(s.x-a.x)/u,y:(s.y-a.y)/u};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function iM(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?jt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?jt(n,e,a.max):Math.min(e,n)),e}function rk(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 sM(e,{top:t,left:n,bottom:a,right:s}){return{x:rk(e.x,n,s),y:rk(e.y,t,a)}}function ak(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:ak(e.x,t.x),y:ak(e.y,t.y)}}function lM(e,t){let n=.5;const a=zn(e),s=zn(t);return s>a?n=Ol(t.min,t.max-a,e.min):a>s&&(n=Ol(e.min,e.max-s,t.min)),Lr(0,1,n)}function uM(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 Ep=.35;function cM(e=Ep){return e===!1?e=0:e===!0&&(e=Ep),{x:ik(e,"left","right"),y:ik(e,"top","bottom")}}function ik(e,t,n){return{min:sk(e,t),max:sk(e,n)}}function sk(e,t){return typeof e=="number"?e:e[t]||0}const dM=new WeakMap;class fM{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=Jt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const u=y=>{n?(this.stopAnimation(),this.snapToCursor(Kl(y).point)):this.pauseAnimation()},l=(y,v)=>{this.stopAnimation();const{drag:b,dragPropagation:S,onDragStart:N}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=QO(b),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),lr(E=>{let O=this.getAxisMotionValue(E).get()||0;if($r.test(O)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[E];P&&(O=zn(P)*(parseFloat(O)/100))}}this.originPoint[E]=O}),N&&bt.postRender(()=>N(y,v)),kp(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},f=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:N,onDrag:T}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=v;if(S&&this.currentDirection===null){this.currentDirection=hM(E),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),T&&T(y,v)},h=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>lr(y=>this.getAnimationState(y)==="paused"&&this.getAxisMotionValue(y).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new y_(t,{onSessionStart:u,onStart:l,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:x_(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!s||!a)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:f}=this.getProps();f&&bt.postRender(()=>f(a,s))}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:s}=this.getProps();if(!a||!kc(t,s,this.currentDirection))return;const u=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=iM(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,s=this.constraints;t&&xl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=sM(a.layoutBox,t):this.constraints=!1,this.elastic=cM(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&lr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=uM(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const u=pR(a,s.root,this.visualElement.getTransformPagePoint());let l=oM(s.layout.layoutBox,u);if(n){const f=n(fR(l));this.hasMutatedConstraints=!!f,f&&(l=Vz(f))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=lr(g=>{if(!kc(g,n,this.currentDirection))return;let y=h&&h[g]||{};l&&(y={min:0,max:0});const v=s?200:1e6,b=s?40:1e7,S={type:"inertia",velocity:a?t[g]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(f)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return kp(this.visualElement,t),a.start(Ag(t,a,0,n,this.visualElement,!1))}stopAnimation(){lr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){lr(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(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){lr(n=>{const{drag:a}=this.getProps();if(!kc(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,u=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:f}=s.layout.layoutBox[n],h=u.get()||0;u.set(t[n]-jt(l,f,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!xl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};lr(l=>{const f=this.getAxisMotionValue(l);if(f&&this.constraints!==!1){const h=f.get();s[l]=lM({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(),lr(l=>{if(!kc(l,t,null))return;const f=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];f.set(jt(h,m,s[l]))})}addListeners(){if(!this.visualElement.current)return;dM.set(this.visualElement,this);const t=this.visualElement.current,n=Sl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),y=h.target,v=y!==t&&Dz(y);m&&g&&!v&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();xl(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,u=s.addEventListener("measure",a);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),bt.read(a);const l=$l(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(lr(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=h[g].translate,y.set(y.get()+h[g].translate))}),this.visualElement.render())}));return()=>{l(),n(),u(),f&&f()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:u=!1,dragElastic:l=Ep,dragMomentum:f=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:u,dragElastic:l,dragMomentum:f}}}function kc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mM extends Qa{constructor(t){super(t),this.removeGroupControls=fr,this.removeListeners=fr,this.controls=new fM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fr}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 ok=e=>(t,n)=>{e&&bt.postRender(()=>e(t,n))};class pM extends Qa{constructor(){super(...arguments),this.removePointerDownListener=fr}onPointerDown(t){this.session=new y_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:x_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:ok(t),onStart:ok(n),onMove:a,onEnd:(u,l)=>{delete this.session,s&&bt.postRender(()=>s(u,l))}}}mount(){this.removePointerDownListener=Sl(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 vm=!1;class gM extends z.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:u}=t;u&&(n.group&&n.group.add(u),a&&a.register&&s&&a.register(u),vm&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Bc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:u}=this.props,{projection:l}=a;return l&&(l.isPresent=u,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),vm=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==u?l.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?l.promote():l.relegate()||bt.postRender(()=>{const f=l.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Mg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;vm=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function v_(e){const[t,n]=l_(),a=z.useContext(fg);return d.jsx(gM,{...e,layoutGroup:a,switchLayoutGroup:z.useContext(p_),isPresent:t,safeToRemove:n})}const xM={pan:{Feature:pM},drag:{Feature:mM,ProjectionNode:o_,MeasureLayout:v_}};function lk(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,u=a[s];u&&bt.postRender(()=>u(t,Kl(t)))}class yM extends Qa{mount(){const{current:t}=this.node;t&&(this.unmount=WO(t,(n,a)=>(lk(this.node,a,"Start"),s=>lk(this.node,s,"End"))))}unmount(){}}class bM 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=ql($l(this.node.current,"focus",()=>this.onFocus()),$l(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uk(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 s="onTap"+(n==="End"?"":n),u=a[s];u&&bt.postRender(()=>u(t,Kl(t)))}class vM extends Qa{mount(){const{current:t}=this.node;t&&(this.unmount=nR(t,(n,a)=>(uk(this.node,a,"Start"),(s,{success:u})=>uk(this.node,s,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Tp=new WeakMap,km=new WeakMap,kM=e=>{const t=Tp.get(e.target);t&&t(e)},wM=e=>{e.forEach(kM)};function SM({root:e,...t}){const n=e||document;km.has(n)||km.set(n,{});const a=km.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(wM,{root:e,...t})),a[s]}function zM(e,t,n){const a=SM(t);return Tp.set(e,n),a.observe(e),()=>{Tp.delete(e),a.unobserve(e)}}const _M={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:s="some",once:u}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:_M[s]},f=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:y}=this.node.getProps(),v=m?g:y;v&&v(h)};return zM(this.node.current,l,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(NM(t,n))&&this.startObserver()}unmount(){}}function NM({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const CM={inView:{Feature:jM},tap:{Feature:vM},focus:{Feature:bM},hover:{Feature:yM}},EM={layout:{ProjectionNode:o_,MeasureLayout:v_}},TM={...eM,...CM,...xM,...EM},Ye=KD(TM,XD),k_=()=>{const[e,t]=z.useState(!!localStorage.getItem("morpheus.auth.token"));return z.useEffect(()=>{const s=()=>{t(!!localStorage.getItem("morpheus.auth.token"))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]),{isAuthenticated:e,login:s=>{localStorage.setItem("morpheus.auth.token",s),t(!0)},logout:()=>{localStorage.removeItem("morpheus.auth.token"),t(!1),window.location.href="/login"}}};function AM({onMenuClick:e,isDark:t,toggleTheme:n}){return d.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:[d.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Rs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.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?d.jsx(jS,{className:"w-5 h-5"}):d.jsx(_S,{className:"w-5 h-5"})}),d.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:d.jsx(OA,{className:"w-6 h-6"})})]})]})}const Za={list:()=>xe.get("/webhooks"),get:e=>xe.get(`/webhooks/${e}`),create:e=>xe.post("/webhooks",e),update:(e,t)=>xe.put(`/webhooks/${e}`,t),delete:e=>xe.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 xe.get(`/webhooks/notifications${n}`)},unreadCount:()=>xe.get("/webhooks/notifications/unread-count"),markRead:e=>xe.post("/webhooks/notifications/read",{ids:e})},hr=({open:e,onOpenChange:t,children:n})=>e?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),d.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,Js=({className:e,children:t})=>d.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:d.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),mr=({children:e})=>d.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}),pr=({className:e,children:t})=>d.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),OM=({className:e,children:t})=>d.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),cr=({className:e,variant:t="default",size:n="default",...a})=>{const f=`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 d.jsx("button",{className:f,...a})};function RM({isOpen:e,onClose:t,onConfirm:n}){return d.jsx(hr,{open:e,onOpenChange:t,children:d.jsxs(Js,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(mr,{children:d.jsx(pr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),d.jsxs("div",{children:[d.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."}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[d.jsx(cr,{variant:"outline",onClick:t,children:"Cancel"}),d.jsx(cr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Os={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 xe.get(`/tasks${n}`)},get:e=>xe.get(`/tasks/${e}`),stats:()=>xe.get("/tasks/stats"),retry:e=>xe.post(`/tasks/${e}/retry`,{}),cancel:e=>xe.post(`/tasks/${e}/cancel`,{})};function DM({children:e}){const t=Nr(),[n,a]=z.useState(()=>{const T=localStorage.getItem("theme");return T?T==="dark":!0}),[s,u]=z.useState(!1),[l,f]=z.useState(!1),{logout:h}=k_(),{data:m}=kt("/webhooks/notifications/unread-count",()=>Za.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:y}=kt("/tasks/stats",()=>Os.stats(),{refreshInterval:5e3}),v=(y?.pending??0)+(y?.running??0),b=async()=>{try{await xe.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(T){console.error("Failed to restart:",T),alert("Failed to restart the agent. Please try again.")}};z.useEffect(()=>{n?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[n]),z.useEffect(()=>{u(!1)},[t.pathname]);const S=[{icon:R0,label:"Dashboard",path:"/"},{icon:El,label:"Chat",path:"/chat"},{icon:P0,label:"Zaion",path:"/zaion"},{icon:$0,label:"MCP Servers",path:"/mcp-servers"},{icon:Tl,label:"Skills",path:"/skills"},{icon:Ym,label:"Usage Stats",path:"/stats"},{icon:qc,label:"Model Pricing",path:"/model-pricing"},{icon:Rs,label:"Sati Memories",path:"/sati-memories"},{icon:Wm,label:"Webhooks",path:"/webhooks"},{icon:Jm,label:"Tasks",path:"/tasks"},{icon:Zs,label:"Trinity DBs",path:"/trinity-databases"},{icon:qa,label:"Chronos",path:"/chronos"},{icon:Qm,label:"Logs",path:"/logs"}],N=[{icon:R0,label:"Dashboard",path:"/"},{icon:El,label:"Chat",path:"/chat"},{icon:P0,label:"Zaion",path:"/zaion"},{icon:$0,label:"MCP Servers",path:"/mcp-servers"},{icon:Tl,label:"Skills",path:"/skills"},{icon:Ym,label:"Usage Stats",path:"/stats"},{icon:qc,label:"Model Pricing",path:"/model-pricing"},{icon:Rs,label:"Sati Memories",path:"/sati-memories"},{icon:Wm,label:"Webhooks",path:"/webhooks"},{icon:Jm,label:"Tasks",path:"/tasks"},{icon:Zs,label:"Trinity DBs",path:"/trinity-databases"},{icon:qa,label:"Chronos",path:"/chronos"},{icon:Qm,label:"Logs",path:"/logs"}];return d.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:[d.jsx(AM,{onMenuClick:()=>u(!0),isDark:n,toggleTheme:()=>a(!n)}),d.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",d.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:[d.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[d.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Rs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.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?d.jsx(jS,{className:"w-4 h-4"}):d.jsx(_S,{className:"w-4 h-4"})})]}),d.jsxs("nav",{className:"flex-1 p-2 space-y-0.5",children:[S.map(T=>{const E=t.pathname===T.path;return d.jsxs(Ia,{to:T.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${E?"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:[d.jsx(T.icon,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:T.label}),T.path==="/tasks"&&v>0&&d.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:v>99?"99+":v})]},T.path)}),d.jsxs(Ia,{to:"/notifications",className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm 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:[d.jsxs("div",{className:"relative shrink-0",children:[d.jsx(Cl,{className:"w-4 h-4"}),g>0&&d.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})]}),d.jsx("span",{children:"Notifications"}),g>0&&d.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")]}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[d.jsx(L0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Restart"})]})}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm 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:[d.jsx(D0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Logout"})]})})]}),d.jsx(zD,{children:s&&d.jsxs(Ye.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),d.jsxs(Ye.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:T=>T.stopPropagation(),children:[d.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[d.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Rs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.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:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[N.map(T=>{const E=t.pathname===T.path;return d.jsxs(Ia,{to:T.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${E?"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:[d.jsx(T.icon,{className:"w-5 h-5"}),d.jsx("span",{children:T.label}),T.path==="/tasks"&&v>0&&d.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:v>99?"99+":v})]},T.path)}),d.jsxs(Ia,{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:[d.jsxs("div",{className:"relative",children:[d.jsx(Cl,{className:"w-5 h-5"}),g>0&&d.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})]}),d.jsx("span",{children:"Notifications"}),g>0&&d.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})]})]}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>{f(!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:[d.jsx(L0,{className:"w-5 h-5"}),d.jsx("span",{children:"Restart"})]})}),d.jsx("div",{className:"p-2",children:d.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:[d.jsx(D0,{className:"w-5 h-5"}),d.jsx("span",{children:"Logout"})]})})]})]})}),d.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[d.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),d.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"})]})]}),d.jsx(Y4,{}),d.jsx(RM,{isOpen:l,onClose:()=>f(!1),onConfirm:b})]})}const MM={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},ji=({title:e,value:t,icon:n,subValue:a})=>d.jsxs(Ye.div,{variants:MM,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:[d.jsxs("div",{className:"flex justify-between items-start mb-4",children:[d.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),d.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"})]}),d.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&d.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),Ap={fetchUsageStats:async()=>xe.get("/stats/usage"),fetchGroupedUsageStats:async()=>xe.get("/stats/usage/grouped")};function $M(){const{data:e}=kt("/api/stats/usage",Ap.fetchUsageStats,{refreshInterval:5e3});return d.jsxs(d.Fragment,{children:[d.jsx(ji,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:vS,subValue:"Tokens processed"}),d.jsx(ji,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:kS,subValue:"Tokens generated"})]})}function LM(){const{data:e}=LS(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return d.jsxs(Ye.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[d.jsxs(Ye.div,{variants:n,children:[d.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight mb-2",children:"SYSTEM STATUS"}),d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"Overview of the Morpheus agent runtime."})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[d.jsx(ji,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:Rs,subValue:e?`PID: ${e.pid}`:""}),d.jsx(ji,{title:"Uptime",value:e?PS(e.uptimeSeconds):"-",icon:qa,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),d.jsx(ji,{title:"Version",value:e?.projectVersion||"-",icon:zS,subValue:`Node ${e?.nodeVersion||"-"}`}),d.jsx(ji,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:IT,subValue:"LLM Inference Engine"}),d.jsx(ji,{title:"Model",value:e?.llmModel||"-",icon:BT,subValue:"Active Model"}),d.jsx($M,{})]})]})}const PM=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:u,onRenameSession:l,isOpen:f,toggleSidebar:h})=>{const[m,g]=z.useState(null),[y,v]=z.useState(""),b=z.useRef(null);z.useEffect(()=>{m&&b.current&&b.current.focus()},[m]);const S=(O,C)=>{O.stopPropagation(),g(C.id),v(C.title||"Untitled Session")},N=O=>{O?.stopPropagation(),m&&y.trim()&&(l(m,y.trim()),g(null))},T=O=>{O?.stopPropagation(),g(null)},E=O=>{O.key==="Enter"?N():O.key==="Escape"&&T()};return f?d.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:[d.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:[d.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),d.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:d.jsx(El,{size:18})})]}),d.jsx("div",{className:"p-4",children:d.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:[d.jsx(M0,{size:18}),d.jsx("span",{children:"New Chat"})]})}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(O=>d.jsxs("div",{onClick:()=>n(O.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===O.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:[d.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===O.id?d.jsx("div",{className:"flex items-center gap-1 w-full",onClick:C=>C.stopPropagation(),children:d.jsx("input",{ref:b,type:"text",value:y,onChange:C=>v(C.target.value),onKeyDown:E,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"})}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`text-sm font-medium truncate ${t===O.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:O.title||"Untitled Session"}),d.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(O.started_at).toLocaleString()})]})}),d.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===O.id?d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:N,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:d.jsx(Km,{size:14})}),d.jsx("button",{onClick:T,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:d.jsx(lg,{size:14})})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:C=>S(C,O),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:d.jsx(ig,{size:14})}),d.jsx("button",{onClick:C=>{C.stopPropagation(),s(O.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:d.jsx(AT,{size:14})}),d.jsx("button",{onClick:C=>{C.stopPropagation(),u(O.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:d.jsx(Ai,{size:14})})]})})]},O.id)),e.length===0&&d.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):d.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:[d.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:d.jsx(El,{})}),d.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),d.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:d.jsx(M0,{size:20})})]})};function UM(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const VM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZM={};function ck(e,t){return(ZM.jsx?BM:VM).test(e)}const IM=/[ \t\n\f\r]/g;function HM(e){return typeof e=="object"?e.type==="text"?dk(e.value):!1:dk(e)}function dk(e){return e.replace(IM,"")===""}class Xl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Xl.prototype.normal={};Xl.prototype.property={};Xl.prototype.space=void 0;function w_(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Xl(n,a,t)}function Op(e){return e.toLowerCase()}class Ln{constructor(t,n){this.attribute=n,this.property=t}}Ln.prototype.attribute="";Ln.prototype.booleanish=!1;Ln.prototype.boolean=!1;Ln.prototype.commaOrSpaceSeparated=!1;Ln.prototype.commaSeparated=!1;Ln.prototype.defined=!1;Ln.prototype.mustUseProperty=!1;Ln.prototype.number=!1;Ln.prototype.overloadedBoolean=!1;Ln.prototype.property="";Ln.prototype.spaceSeparated=!1;Ln.prototype.space=void 0;let FM=0;const $e=Mi(),Zt=Mi(),Rp=Mi(),ue=Mi(),ht=Mi(),Fs=Mi(),Gn=Mi();function Mi(){return 2**++FM}const Dp=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Zt,commaOrSpaceSeparated:Gn,commaSeparated:Fs,number:ue,overloadedBoolean:Rp,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),wm=Object.keys(Dp);class Hg extends Ln{constructor(t,n,a,s){let u=-1;if(super(t,n),fk(this,"space",s),typeof a=="number")for(;++u<wm.length;){const l=wm[u];fk(this,wm[u],(a&Dp[l])===Dp[l])}}}Hg.prototype.defined=!0;function fk(e,t,n){n&&(e[t]=n)}function oo(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const u=new Hg(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[Op(a)]=a,n[Op(u.attribute)]=a}return new Xl(t,n,e.space)}const S_=oo({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:ht,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:ue,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:ht,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Zt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function z_(e,t){return t in e?e[t]:t}function __(e,t){return z_(e,t.toLowerCase())}const qM=oo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fs,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:ht,autoFocus:$e,autoPlay:$e,blocking:ht,capture:null,charSet:null,checked:$e,cite:null,className:ht,cols:ue,colSpan:null,content:null,contentEditable:Zt,controls:$e,controlsList:ht,coords:ue|Fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:Rp,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:ht,height:ue,hidden:Rp,high:ue,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:ht,itemRef:ht,itemScope:$e,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:ue,pattern:null,ping:ht,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:ht,required:$e,reversed:$e,rows:ue,rowSpan:ue,sandbox:ht,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Zt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:__}),GM=oo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:ht,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:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:Fs,g2:Fs,glyphName:Fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,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:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:z_}),j_=oo({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()}}),N_=oo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:__}),C_=oo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),YM={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"},KM=/[A-Z]/g,hk=/-[a-z]/g,XM=/^data[-\w.:]+$/i;function JM(e,t){const n=Op(t);let a=t,s=Ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&XM.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(hk,WM);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!hk.test(u)){let l=u.replace(KM,QM);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Hg}return new s(a,t)}function QM(e){return"-"+e.toLowerCase()}function WM(e){return e.charAt(1).toUpperCase()}const e5=w_([S_,qM,j_,N_,C_],"html"),Fg=w_([S_,GM,j_,N_,C_],"svg");function t5(e){return e.join(" ").trim()}var _s={},Sm,mk;function n5(){if(mk)return Sm;mk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
20
|
-
`,m="/",g="*",y="",v="comment",b="declaration";function S(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var O=1,C=1;function P(oe){var ae=oe.match(t);ae&&(O+=ae.length);var V=oe.lastIndexOf(h);C=~V?oe.length-V:C+oe.length}function M(){var oe={line:O,column:C};return function(ae){return ae.position=new R(oe),Y(),ae}}function R(oe){this.start=oe,this.end={line:O,column:C},this.source=E.source}R.prototype.content=T;function I(oe){var ae=new Error(E.source+":"+O+":"+C+": "+oe);if(ae.reason=oe,ae.filename=E.source,ae.line=O,ae.column=C,ae.source=T,!E.silent)throw ae}function B(oe){var ae=oe.exec(T);if(ae){var V=ae[0];return P(V),T=T.slice(V.length),ae}}function Y(){B(n)}function fe(oe){var ae;for(oe=oe||[];ae=se();)ae!==!1&&oe.push(ae);return oe}function se(){var oe=M();if(!(m!=T.charAt(0)||g!=T.charAt(1))){for(var ae=2;y!=T.charAt(ae)&&(g!=T.charAt(ae)||m!=T.charAt(ae+1));)++ae;if(ae+=2,y===T.charAt(ae-1))return I("End of comment missing");var V=T.slice(2,ae-2);return C+=2,P(V),T=T.slice(ae),C+=2,oe({type:v,comment:V})}}function le(){var oe=M(),ae=B(a);if(ae){if(se(),!B(s))return I("property missing ':'");var V=B(u),J=oe({type:b,property:N(ae[0].replace(e,y)),value:V?N(V[0].replace(e,y)):y});return B(l),J}}function ee(){var oe=[];fe(oe);for(var ae;ae=le();)ae!==!1&&(oe.push(ae),fe(oe));return oe}return Y(),ee()}function N(T){return T?T.replace(f,y):y}return Sm=S,Sm}var pk;function r5(){if(pk)return _s;pk=1;var e=_s&&_s.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(_s,"__esModule",{value:!0}),_s.default=n;const t=e(n5());function n(a,s){let u=null;if(!a||typeof a!="string")return u;const l=(0,t.default)(a),f=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;f?s(m,g,h):g&&(u=u||{},u[m]=g)}),u}return _s}var cl={},gk;function a5(){if(gk)return cl;gk=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},l=function(m,g){return g.toUpperCase()},f=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(s,f):m=m.replace(a,f),m.replace(t,l))};return cl.camelCase=h,cl}var dl,xk;function i5(){if(xk)return dl;xk=1;var e=dl&&dl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(r5()),n=a5();function a(s,u){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(f,h){f&&h&&(l[(0,n.camelCase)(f,u)]=h)}),l}return a.default=a,dl=a,dl}var s5=i5();const o5=Kp(s5),E_=T_("end"),qg=T_("start");function T_(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 l5(e){const t=qg(e),n=E_(e);if(t&&n)return{start:t,end:n}}function zl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yk(e.position):"start"in e||"end"in e?yk(e):"line"in e||"column"in e?Mp(e):""}function Mp(e){return bk(e&&e.line)+":"+bk(e&&e.column)}function yk(e){return Mp(e&&e.start)+"-"+Mp(e&&e.end)}function bk(e){return e&&typeof e=="number"?e:1}class pn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",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"?s=t:!u.cause&&t&&(l=!0,s=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 f=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=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=zl(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}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const Gg={}.hasOwnProperty,u5=new Map,c5=/[A-Z]/g,d5=new Set(["table","tbody","thead","tfoot","tr"]),f5=new Set(["td","th"]),A_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function h5(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=k5(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=v5(n,t.jsx,t.jsxs)}const s={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"?Fg:e5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=O_(s,e,void 0);return u&&typeof u!="string"?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}function O_(e,t,n){if(t.type==="element")return m5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return p5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return x5(e,t,n);if(t.type==="mdxjsEsm")return g5(e,t);if(t.type==="root")return y5(e,t,n);if(t.type==="text")return b5(e,t)}function m5(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Fg,e.schema=s),e.ancestors.push(t);const u=D_(e,t.tagName,!1),l=w5(e,t);let f=Kg(e,t);return d5.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!HM(h):!0})),R_(e,l,u,t),Yg(l,f),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function p5(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)}Ll(e,t.position)}function g5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ll(e,t.position)}function x5(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Fg,e.schema=s),e.ancestors.push(t);const u=t.name===null?e.Fragment:D_(e,t.name,!0),l=S5(e,t),f=Kg(e,t);return R_(e,l,u,t),Yg(l,f),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function y5(e,t,n){const a={};return Yg(a,Kg(e,t)),e.create(t,e.Fragment,a,n)}function b5(e,t){return t.value}function R_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Yg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function v5(e,t,n){return a;function a(s,u,l,f){const m=Array.isArray(l.children)?n:t;return f?m(u,l,f):m(u,l)}}function k5(e,t){return n;function n(a,s,u,l){const f=Array.isArray(u.children),h=qg(a);return t(s,u,l,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function w5(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&Gg.call(t.properties,s)){const u=z5(e,s,t.properties[s]);if(u){const[l,f]=u;e.tableCellAlignToStyle&&l==="align"&&typeof f=="string"&&f5.has(t.tagName)?a=f:n[l]=f}}if(a){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function S5(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 f=l.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Ll(e,t.position);else{const s=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else Ll(e,t.position);else u=a.value===null?!0:a.value;n[s]=u}return n}function Kg(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:u5;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=s.get(h)||0;l=h+"-"+m,s.set(h,m+1)}}const f=O_(e,u,l);f!==void 0&&n.push(f)}return n}function z5(e,t,n){const a=JM(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?UM(n):t5(n)),a.property==="style"){let s=typeof n=="object"?n:_5(e,String(n));return e.stylePropertyNameCase==="css"&&(s=j5(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?YM[a.property]||a.property:a.attribute,n]}}function _5(e,t){try{return o5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=A_+"#cannot-parse-style-attribute",s}}function D_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let u=-1,l;for(;++u<s.length;){const f=ck(s[u])?{type:"Identifier",name:s[u]}:{type:"Literal",value:s[u]};l=l?{type:"MemberExpression",object:l,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}a=l}else a=ck(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Gg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Ll(e)}function Ll(e,t){const n=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=A_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function j5(e){const t={};let n;for(n in e)Gg.call(e,n)&&(t[N5(n)]=e[n]);return t}function N5(e){let t=e.replace(c5,C5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C5(e){return"-"+e.toLowerCase()}const zm={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,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return M_(e,a,s)}function M_(e,t,n){if(A5(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 vk(e.children,t,n)}return Array.isArray(e)?vk(e,t,n):""}function vk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=M_(e[s],t,n);return a.join("")}function A5(e){return!!(e&&typeof e=="object")}const kk=document.createElement("i");function Xg(e){const t="&"+e+";";kk.innerHTML=t;const n=kk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Pr(e,t,n,a){const s=e.length;let u=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s: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 ur(e,t){return e.length>0?(Pr(e,e.length,0,t),e):t}const wk={}.hasOwnProperty;function O5(e){const t={};let n=-1;for(;++n<e.length;)R5(t,e[n]);return t}function R5(e,t){let n;for(n in t){const s=(wk.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let l;if(u)for(l in u){wk.call(s,l)||(s[l]=[]);const f=u[l];D5(s[l],Array.isArray(f)?f:f?[f]:[])}}}function D5(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Pr(e,0,0,a)}function $_(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 qs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mr=Wa(/[A-Za-z]/),Yn=Wa(/[\dA-Za-z]/),M5=Wa(/[#-'*+\--9=?A-Z^-~]/);function $p(e){return e!==null&&(e<32||e===127)}const Lp=Wa(/\d/),$5=Wa(/[\dA-Fa-f]/),L5=Wa(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function $n(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const P5=Wa(new RegExp("\\p{P}|\\p{S}","u")),U5=Wa(/\s/);function Wa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const u=e.charCodeAt(n);let l="";if(u===37&&Yn(e.charCodeAt(n+1))&&Yn(e.charCodeAt(n+2)))s=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(l=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(n+1);u<56320&&f>56319&&f<57344?(l=String.fromCharCode(u,f),s=1):l="�"}else l=String.fromCharCode(u);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function mt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return et(h)?(e.enter(n),f(h)):t(h)}function f(h){return et(h)&&u++<s?(e.consume(h),f):(e.exit(n),t(h))}}const V5={tokenize:B5};function B5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),mt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(f)}function l(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ee(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),l)}}const Z5={tokenize:I5},Sk={tokenize:H5};function I5(e){const t=this,n=[];let a=0,s,u,l;return f;function f(C){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,h,m)(C)}return m(C)}function h(C){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&O();const P=t.events.length;let M=P,R;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){R=t.events[M][1].end;break}E(a);let I=P;for(;I<t.events.length;)t.events[I][1].end={...R},I++;return Pr(t.events,M+1,0,t.events.slice(P)),t.events.length=I,m(C)}return f(C)}function m(C){if(a===n.length){if(!s)return v(C);if(s.currentConstruct&&s.currentConstruct.concrete)return S(C);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sk,g,y)(C)}function g(C){return s&&O(),E(a),v(C)}function y(C){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(C)}function v(C){return t.containerState={},e.attempt(Sk,b,S)(C)}function b(C){return a++,n.push([t.currentConstruct,t.containerState]),v(C)}function S(C){if(C===null){s&&O(),E(0),e.consume(C);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),N(C)}function N(C){if(C===null){T(e.exit("chunkFlow"),!0),E(0),e.consume(C);return}return Ee(C)?(e.consume(C),T(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(C),N)}function T(C,P){const M=t.sliceStream(C);if(P&&M.push(null),C.previous=u,u&&(u.next=C),u=C,s.defineSkip(C.start),s.write(M),t.parser.lazy[C.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<l&&(!s.events[R][1].end||s.events[R][1].end.offset>l))return;const I=t.events.length;let B=I,Y,fe;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(Y){fe=t.events[B][1].end;break}Y=!0}for(E(a),R=I;R<t.events.length;)t.events[R][1].end={...fe},R++;Pr(t.events,B+1,0,t.events.slice(I)),t.events.length=R}}function E(C){let P=n.length;for(;P-- >C;){const M=n[P];t.containerState=M[1],M[0].exit.call(t,e)}n.length=C}function O(){s.write([null]),u=void 0,s=void 0,t.containerState._closeFlow=void 0}}function H5(e,t,n){return mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zk(e){if(e===null||$n(e)||U5(e))return 1;if(P5(e))return 2}function Jg(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const u=e[s].resolveAll;u&&!a.includes(u)&&(t=u(t,n),a.push(u))}return t}const Pp={name:"attention",resolveAll:F5,tokenize:q5};function F5(e,t){let n=-1,a,s,u,l,f,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 y={...e[a][1].end},v={...e[n][1].start};_k(y,-h),_k(v,h),l={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...f.end}},e[a][1].end={...l.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=ur(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=ur(m,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=ur(m,Jg(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=ur(m,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=ur(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Pr(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 q5(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=zk(a);let u;return l;function l(h){return u=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===u)return e.consume(h),f;const m=e.exit("attentionSequence"),g=zk(h),y=!g||g===2&&s||n.includes(h),v=!s||s===2&&g||n.includes(a);return m._open=!!(u===42?y:y&&(s||!v)),m._close=!!(u===42?v:v&&(g||!y)),t(h)}}function _k(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 s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(b){return Mr(b)?(e.consume(b),l):b===64?n(b):m(b)}function l(b){return b===43||b===45||b===46||Yn(b)?(a=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||Yn(b))&&a++<32?(e.consume(b),f):(a=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||$p(b)?n(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),g):M5(b)?(e.consume(b),m):n(b)}function g(b){return Yn(b)?y(b):n(b)}function y(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||Yn(b))&&a++<63){const S=b===45?v:y;return e.consume(b),S}return n(b)}}const bd={partial:!0,tokenize:K5};function K5(e,t,n){return a;function a(u){return et(u)?mt(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||Ee(u)?t(u):n(u)}}const L_={continuation:{tokenize:J5},exit:Q5,name:"blockQuote",tokenize:X5};function X5(e,t,n){const a=this;return s;function s(l){if(l===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),u}return n(l)}function u(l){return et(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function J5(e,t,n){const a=this;return s;function s(l){return et(l)?mt(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt(L_,t,n)(l)}}function Q5(e){e.exit("blockQuote")}const P_={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"),s}function s(u){return L5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const U_={name:"characterReference",tokenize:e$};function e$(e,t,n){const a=this;let s=0,u,l;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,l=Yn,g(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,l=$5,g):(e.enter("characterReferenceValue"),u=7,l=Lp,g(y))}function g(y){if(y===59&&s){const v=e.exit("characterReferenceValue");return l===Yn&&!Xg(a.sliceSerialize(v))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&s++<u?(e.consume(y),g):n(y)}}const jk={partial:!0,tokenize:n$},Nk={concrete:!0,name:"codeFenced",tokenize:t$};function t$(e,t,n){const a=this,s={partial:!0,tokenize:M};let u=0,l=0,f;return h;function h(R){return m(R)}function m(R){const I=a.events[a.events.length-1];return u=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===f?(l++,e.consume(R),g):l<3?n(R):(e.exit("codeFencedFenceSequence"),et(R)?mt(e,y,"whitespace")(R):y(R))}function y(R){return R===null||Ee(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(jk,N,P)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(R)):et(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mt(e,b,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),v)}function b(R){return R===null||Ee(R)?y(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(R)):R===96&&R===f?n(R):(e.consume(R),S)}function N(R){return e.attempt(s,P,T)(R)}function T(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),E}function E(R){return u>0&&et(R)?mt(e,O,"linePrefix",u+1)(R):O(R)}function O(R){return R===null||Ee(R)?e.check(jk,N,P)(R):(e.enter("codeFlowValue"),C(R))}function C(R){return R===null||Ee(R)?(e.exit("codeFlowValue"),O(R)):(e.consume(R),C)}function P(R){return e.exit("codeFenced"),t(R)}function M(R,I,B){let Y=0;return fe;function fe(ae){return R.enter("lineEnding"),R.consume(ae),R.exit("lineEnding"),se}function se(ae){return R.enter("codeFencedFence"),et(ae)?mt(R,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):le(ae)}function le(ae){return ae===f?(R.enter("codeFencedFenceSequence"),ee(ae)):B(ae)}function ee(ae){return ae===f?(Y++,R.consume(ae),ee):Y>=l?(R.exit("codeFencedFenceSequence"),et(ae)?mt(R,oe,"whitespace")(ae):oe(ae)):B(ae)}function oe(ae){return ae===null||Ee(ae)?(R.exit("codeFencedFence"),I(ae)):B(ae)}}}function n$(e,t,n){const a=this;return s;function s(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 _m={name:"codeIndented",tokenize:a$},r$={partial:!0,tokenize:i$};function a$(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),mt(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):Ee(m)?e.attempt(r$,l,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ee(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function i$(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):Ee(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):mt(e,u,"linePrefix",5)(l)}function u(l){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(l):Ee(l)?s(l):n(l)}}const s$={name:"codeText",previous:l$,resolve:o$,tokenize:u$};function o$(e){let t=e.length-4,n=3,a,s;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;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function l$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u$(e,t,n){let a=0,s,u;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(u=e.enter("codeTextSequence"),s=0,g(y)):Ee(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Ee(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),m)}function g(y){return y===96?(e.consume(y),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(u.type="codeTextData",m(y))}}class c${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 s=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&fl(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),fl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fl(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);fl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fl(this.left,n.reverse())}}}function fl(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 V_(e){const t={};let n=-1,a,s,u,l,f,h,m;const g=new c$(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,d$(g,n)),n=t[n],m=!0);else if(a[1]._container){for(u=n,s=void 0;u--;)if(l=g.get(u),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=u);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},f=g.slice(s,n),f.unshift(a),g.splice(s,n-s+1,f))}}return Pr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function d$(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const u=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const f=l.events,h=[],m={};let g,y,v=-1,b=n,S=0,N=0;const T=[N];for(;b;){for(;e.get(++s)[1]!==b;);u.push(s),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),y&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=n;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(N=v+1,T.push(N),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):T.pop(),v=T.length;v--;){const E=f.slice(T[v],T[v+1]),O=u.pop();h.push([O,O+E.length-1]),e.splice(O,2,E)}for(h.reverse(),v=-1;++v<h.length;)m[S+h[v][0]]=S+h[v][1],S+=h[v][1]-h[v][0]-1;return m}const f$={resolve:m$,tokenize:p$},h$={partial:!0,tokenize:g$};function m$(e){return V_(e),e}function p$(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?u(f):Ee(f)?e.check(h$,l,u)(f):(e.consume(f),s)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function l(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function g$(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),mt(e,u,"linePrefix")}function u(l){if(l===null||Ee(l))return n(l);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function B_(e,t,n,a,s,u,l,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return y;function y(E){return E===60?(e.enter(a),e.enter(s),e.enter(u),e.consume(E),e.exit(u),v):E===null||E===32||E===41||$p(E)?n(E):(e.enter(a),e.enter(l),e.enter(f),e.enter("chunkString",{contentType:"string"}),N(E))}function v(E){return E===62?(e.enter(u),e.consume(E),e.exit(u),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(f),v(E)):E===null||E===60||Ee(E)?n(E):(e.consume(E),E===92?S:b)}function S(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function N(E){return!g&&(E===null||E===41||$n(E))?(e.exit("chunkString"),e.exit(f),e.exit(l),e.exit(a),t(E)):g<m&&E===40?(e.consume(E),g++,N):E===41?(e.consume(E),g--,N):E===null||E===32||E===40||$p(E)?n(E):(e.consume(E),E===92?T:N)}function T(E){return E===40||E===41||E===92?(e.consume(E),N):N(E)}}function Z_(e,t,n,a,s,u){const l=this;let f=0,h;return m;function m(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(u),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(u),e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):Ee(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||Ee(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!et(b)),b===92?v:y)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,y):y(b)}}function I_(e,t,n,a,s,u){let l;return f;function f(v){return v===34||v===39||v===40?(e.enter(a),e.enter(s),e.consume(v),e.exit(s),l=v===40?41:v,h):n(v)}function h(v){return v===l?(e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):(e.enter(u),m(v))}function m(v){return v===l?(e.exit(u),h(l)):v===null?n(v):Ee(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),mt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Ee(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:g)}function y(v){return v===l||v===92?(e.consume(v),g):g(v)}}function _l(e,t){let n;return a;function a(s){return Ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):et(s)?mt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const x$={name:"definition",tokenize:b$},y$={partial:!0,tokenize:v$};function b$(e,t,n){const a=this;let s;return u;function u(b){return e.enter("definition"),l(b)}function l(b){return Z_.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=qs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return $n(b)?_l(e,m)(b):m(b)}function m(b){return B_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(y$,y,y)(b)}function y(b){return et(b)?mt(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Ee(b)?(e.exit("definition"),a.parser.defined.push(s),t(b)):n(b)}}function v$(e,t,n){return a;function a(f){return $n(f)?_l(e,s)(f):n(f)}function s(f){return I_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return et(f)?mt(e,l,"whitespace")(f):l(f)}function l(f){return f===null||Ee(f)?t(f):n(f)}}const k$={name:"hardBreakEscape",tokenize:w$};function w$(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),s}function s(u){return Ee(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const S$={name:"headingAtx",resolve:z$,tokenize:_$};function z$(e,t){let n=e.length-2,a=3,s,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&&(s={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"},Pr(e,a,n-a+1,[["enter",s,t],["enter",u,t],["exit",u,t],["exit",s,t]])),e}function _$(e,t,n){let a=0;return s;function s(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||$n(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ee(g)?(e.exit("atxHeading"),t(g)):et(g)?mt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||$n(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const j$=["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"],Ck=["pre","script","style","textarea"],N$={concrete:!0,name:"htmlFlow",resolveTo:T$,tokenize:A$},C$={partial:!0,tokenize:R$},E$={partial:!0,tokenize:O$};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 A$(e,t,n){const a=this;let s,u,l,f,h;return m;function m(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),y}function y(w){return w===33?(e.consume(w),v):w===47?(e.consume(w),u=!0,N):w===63?(e.consume(w),s=3,a.interrupt?t:A):Mr(w)?(e.consume(w),l=String.fromCharCode(w),T):n(w)}function v(w){return w===45?(e.consume(w),s=2,b):w===91?(e.consume(w),s=5,f=0,S):Mr(w)?(e.consume(w),s=4,a.interrupt?t:A):n(w)}function b(w){return w===45?(e.consume(w),a.interrupt?t:A):n(w)}function S(w){const G="CDATA[";return w===G.charCodeAt(f++)?(e.consume(w),f===G.length?a.interrupt?t:le:S):n(w)}function N(w){return Mr(w)?(e.consume(w),l=String.fromCharCode(w),T):n(w)}function T(w){if(w===null||w===47||w===62||$n(w)){const G=w===47,de=l.toLowerCase();return!G&&!u&&Ck.includes(de)?(s=1,a.interrupt?t(w):le(w)):j$.includes(l.toLowerCase())?(s=6,G?(e.consume(w),E):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?O(w):C(w))}return w===45||Yn(w)?(e.consume(w),l+=String.fromCharCode(w),T):n(w)}function E(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function O(w){return et(w)?(e.consume(w),O):fe(w)}function C(w){return w===47?(e.consume(w),fe):w===58||w===95||Mr(w)?(e.consume(w),P):et(w)?(e.consume(w),C):fe(w)}function P(w){return w===45||w===46||w===58||w===95||Yn(w)?(e.consume(w),P):M(w)}function M(w){return w===61?(e.consume(w),R):et(w)?(e.consume(w),M):C(w)}function R(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,I):et(w)?(e.consume(w),R):B(w)}function I(w){return w===h?(e.consume(w),h=null,Y):w===null||Ee(w)?n(w):(e.consume(w),I)}function B(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||$n(w)?M(w):(e.consume(w),B)}function Y(w){return w===47||w===62||et(w)?C(w):n(w)}function fe(w){return w===62?(e.consume(w),se):n(w)}function se(w){return w===null||Ee(w)?le(w):et(w)?(e.consume(w),se):n(w)}function le(w){return w===45&&s===2?(e.consume(w),V):w===60&&s===1?(e.consume(w),J):w===62&&s===4?(e.consume(w),_):w===63&&s===3?(e.consume(w),A):w===93&&s===5?(e.consume(w),ye):Ee(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(C$,U,ee)(w)):w===null||Ee(w)?(e.exit("htmlFlowData"),ee(w)):(e.consume(w),le)}function ee(w){return e.check(E$,oe,U)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ae}function ae(w){return w===null||Ee(w)?ee(w):(e.enter("htmlFlowData"),le(w))}function V(w){return w===45?(e.consume(w),A):le(w)}function J(w){return w===47?(e.consume(w),l="",K):le(w)}function K(w){if(w===62){const G=l.toLowerCase();return Ck.includes(G)?(e.consume(w),_):le(w)}return Mr(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),K):le(w)}function ye(w){return w===93?(e.consume(w),A):le(w)}function A(w){return w===62?(e.consume(w),_):w===45&&s===2?(e.consume(w),A):le(w)}function _(w){return w===null||Ee(w)?(e.exit("htmlFlowData"),U(w)):(e.consume(w),_)}function U(w){return e.exit("htmlFlow"),t(w)}}function O$(e,t,n){const a=this;return s;function s(l){return Ee(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 R$(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(bd,t,n)}}const D$={name:"htmlText",tokenize:M$};function M$(e,t,n){const a=this;let s,u,l;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),M):A===63?(e.consume(A),C):Mr(A)?(e.consume(A),B):n(A)}function m(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),u=0,S):Mr(A)?(e.consume(A),O):n(A)}function g(A){return A===45?(e.consume(A),b):n(A)}function y(A){return A===null?n(A):A===45?(e.consume(A),v):Ee(A)?(l=y,J(A)):(e.consume(A),y)}function v(A){return A===45?(e.consume(A),b):y(A)}function b(A){return A===62?V(A):A===45?v(A):y(A)}function S(A){const _="CDATA[";return A===_.charCodeAt(u++)?(e.consume(A),u===_.length?N:S):n(A)}function N(A){return A===null?n(A):A===93?(e.consume(A),T):Ee(A)?(l=N,J(A)):(e.consume(A),N)}function T(A){return A===93?(e.consume(A),E):N(A)}function E(A){return A===62?V(A):A===93?(e.consume(A),E):N(A)}function O(A){return A===null||A===62?V(A):Ee(A)?(l=O,J(A)):(e.consume(A),O)}function C(A){return A===null?n(A):A===63?(e.consume(A),P):Ee(A)?(l=C,J(A)):(e.consume(A),C)}function P(A){return A===62?V(A):C(A)}function M(A){return Mr(A)?(e.consume(A),R):n(A)}function R(A){return A===45||Yn(A)?(e.consume(A),R):I(A)}function I(A){return Ee(A)?(l=I,J(A)):et(A)?(e.consume(A),I):V(A)}function B(A){return A===45||Yn(A)?(e.consume(A),B):A===47||A===62||$n(A)?Y(A):n(A)}function Y(A){return A===47?(e.consume(A),V):A===58||A===95||Mr(A)?(e.consume(A),fe):Ee(A)?(l=Y,J(A)):et(A)?(e.consume(A),Y):V(A)}function fe(A){return A===45||A===46||A===58||A===95||Yn(A)?(e.consume(A),fe):se(A)}function se(A){return A===61?(e.consume(A),le):Ee(A)?(l=se,J(A)):et(A)?(e.consume(A),se):Y(A)}function le(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,ee):Ee(A)?(l=le,J(A)):et(A)?(e.consume(A),le):(e.consume(A),oe)}function ee(A){return A===s?(e.consume(A),s=void 0,ae):A===null?n(A):Ee(A)?(l=ee,J(A)):(e.consume(A),ee)}function oe(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||$n(A)?Y(A):(e.consume(A),oe)}function ae(A){return A===47||A===62||$n(A)?Y(A):n(A)}function V(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function J(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),K}function K(A){return et(A)?mt(e,ye,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ye(A)}function ye(A){return e.enter("htmlTextData"),l(A)}}const Qg={name:"labelEnd",resolveAll:U$,resolveTo:V$,tokenize:B$},$$={tokenize:Z$},L$={tokenize:I$},P$={tokenize:H$};function U$(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 s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Pr(e,0,e.length,n),e}function V$(e,t){let n=e.length,a=0,s,u,l,f;for(;n--;)if(s=e[n][1],u){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(u=n,s.type!=="labelLink")){a=2;break}}else s.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 f=[["enter",h,t],["enter",m,t]],f=ur(f,e.slice(u+1,u+a+3)),f=ur(f,[["enter",g,t]]),f=ur(f,Jg(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),f=ur(f,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),f=ur(f,e.slice(l+1)),f=ur(f,[["exit",h,t]]),Pr(e,u,e.length,f),e}function B$(e,t,n){const a=this;let s=a.events.length,u,l;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){u=a.events[s][1];break}return f;function f(v){return u?u._inactive?y(v):(l=a.parser.defined.includes(qs(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):n(v)}function h(v){return v===40?e.attempt($$,g,l?g:y)(v):v===91?e.attempt(L$,g,l?m:y)(v):l?g(v):y(v)}function m(v){return e.attempt(P$,g,y)(v)}function g(v){return t(v)}function y(v){return u._balanced=!0,n(v)}}function Z$(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),s}function s(y){return $n(y)?_l(e,u)(y):u(y)}function u(y){return y===41?g(y):B_(e,l,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return $n(y)?_l(e,h)(y):g(y)}function f(y){return n(y)}function h(y){return y===34||y===39||y===40?I_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function m(y){return $n(y)?_l(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function I$(e,t,n){const a=this;return s;function s(f){return Z_.call(a,e,u,l,"reference","referenceMarker","referenceString")(f)}function u(f){return a.parser.defined.includes(qs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function l(f){return n(f)}}function H$(e,t,n){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),s}function s(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const F$={name:"labelStartImage",resolveAll:Qg.resolveAll,tokenize:q$};function q$(e,t,n){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),l):n(f)}function l(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const G$={name:"labelStartLink",resolveAll:Qg.resolveAll,tokenize:Y$};function Y$(e,t,n){const a=this;return s;function s(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 jm={name:"lineEnding",tokenize:K$};function K$(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),mt(e,t,"linePrefix")}}const Zc={name:"thematicBreak",tokenize:X$};function X$(e,t,n){let a=0,s;return u;function u(m){return e.enter("thematicBreak"),l(m)}function l(m){return s=m,f(m)}function f(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Ee(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),et(m)?mt(e,f,"whitespace")(m):f(m))}}const Rn={continuation:{tokenize:e6},exit:n6,name:"list",tokenize:W$},J$={partial:!0,tokenize:r6},Q$={partial:!0,tokenize:t6};function W$(e,t,n){const a=this,s=a.events[a.events.length-1];let u=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return f;function f(b){const S=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Lp(b)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Zc,n,m)(b):m(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return Lp(b)&&++l<10?(e.consume(b),h):(!a.interrupt||l<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(bd,a.interrupt?n:g,e.attempt(J$,v,y))}function g(b){return a.containerState.initialBlankLine=!0,u++,v(b)}function y(b){return et(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function e6(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(bd,s,u);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,mt(e,t,"listItemIndent",a.containerState.size+1)(f)}function u(f){return a.containerState.furtherBlankLines||!et(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(Q$,t,l)(f))}function l(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,mt(e,e.attempt(Rn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function t6(e,t,n){const a=this;return mt(e,s,"listItemIndent",a.containerState.size+1);function s(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 n6(e){e.exit(this.containerState.type)}function r6(e,t,n){const a=this;return mt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(u){const l=a.events[a.events.length-1];return!et(u)&&l&&l[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const Ek={name:"setextUnderline",resolveTo:a6,tokenize:i6};function a6(e,t){let n=e.length,a,s,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=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[s][1].type="setextHeadingText",u?(e.splice(s,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 i6(e,t,n){const a=this;let s;return u;function u(m){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),s=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===s?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),et(m)?mt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ee(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const s6={tokenize:o6};function o6(e){const t=this,n=e.attempt(bd,a,e.attempt(this.parser.constructs.flowInitial,s,mt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(f$,s)),"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 s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const l6={resolveAll:F_()},u6=H_("string"),c6=H_("text");function H_(e){return{resolveAll:F_(e==="text"?d6:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],u=n.attempt(s,l,f);return l;function l(g){return m(g)?u(g):f(g)}function f(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 y=s[g];let v=-1;if(y)for(;++v<y.length;){const b=y[v];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function F_(e){return t;function t(n,a){let s=-1,u;for(;++s<=n.length;)u===void 0?n[s]&&n[s][1].type==="data"&&(u=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==u+2&&(n[u][1].end=n[s-1][1].end,n.splice(u+2,s-u-2),s=u+2),u=void 0);return e?e(n,a):n}}function d6(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],s=t.sliceStream(a);let u=s.length,l=-1,f=0,h;for(;u--;){const m=s[u];if(typeof m=="string"){for(l=m.length;m.charCodeAt(l-1)===32;)f++,l--;if(l)break;l=-1}else if(m===-2)h=!0,f++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?l:a.start._bufferIndex+l,_index:a.start._index+u,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},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 f6={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:L_},h6={91:x$},m6={[-2]:_m,[-1]:_m,32:_m},p6={35:S$,42:Zc,45:[Ek,Zc],60:N$,61:Ek,95:Zc,96:Nk,126:Nk},g6={38:U_,92:P_},x6={[-5]:jm,[-4]:jm,[-3]:jm,33:F$,38:U_,42:Pp,60:[G5,D$],91:G$,92:[k$,P_],93:Qg,95:Pp,96:s$},y6={null:[Pp,l6]},b6={null:[42,95]},v6={null:[]},k6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:b6,contentInitial:h6,disable:v6,document:f6,flow:p6,flowInitial:m6,insideSpan:y6,string:g6,text:x6},Symbol.toStringTag,{value:"Module"}));function w6(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 s={},u=[];let l=[],f=[];const h={attempt:I(M),check:I(R),consume:O,enter:C,exit:P,interrupt:I(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:N,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:y};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function y(se){return l=ur(l,se),T(),l[l.length-1]!==null?[]:(B(t,0),m.events=Jg(u,m.events,m),m.events)}function v(se,le){return z6(b(se),le)}function b(se){return S6(l,se)}function S(){const{_bufferIndex:se,_index:le,line:ee,column:oe,offset:ae}=a;return{_bufferIndex:se,_index:le,line:ee,column:oe,offset:ae}}function N(se){s[se.line]=se.column,fe()}function T(){let se;for(;a._index<l.length;){const le=l[a._index];if(typeof le=="string")for(se=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===se&&a._bufferIndex<le.length;)E(le.charCodeAt(a._bufferIndex));else E(le)}}function E(se){g=g(se)}function O(se){Ee(se)?(a.line++,a.column=1,a.offset+=se===-3?2:1,fe()):se!==-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=se}function C(se,le){const ee=le||{};return ee.type=se,ee.start=S(),m.events.push(["enter",ee,m]),f.push(ee),ee}function P(se){const le=f.pop();return le.end=S(),m.events.push(["exit",le,m]),le}function M(se,le){B(se,le.from)}function R(se,le){le.restore()}function I(se,le){return ee;function ee(oe,ae,V){let J,K,ye,A;return Array.isArray(oe)?U(oe):"tokenize"in oe?U([oe]):_(oe);function _(he){return me;function me(Pe){const Ae=Pe!==null&&he[Pe],pt=Pe!==null&&he.null,Dt=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(pt)?pt:pt?[pt]:[]];return U(Dt)(Pe)}}function U(he){return J=he,K=0,he.length===0?V:w(he[K])}function w(he){return me;function me(Pe){return A=Y(),ye=he,he.partial||(m.currentConstruct=he),he.name&&m.parser.constructs.disable.null.includes(he.name)?de():he.tokenize.call(le?Object.assign(Object.create(m),le):m,h,G,de)(Pe)}}function G(he){return se(ye,A),ae}function de(he){return A.restore(),++K<J.length?w(J[K]):V}}}function B(se,le){se.resolveAll&&!u.includes(se)&&u.push(se),se.resolve&&Pr(m.events,le,m.events.length-le,se.resolve(m.events.slice(le),m)),se.resolveTo&&(m.events=se.resolveTo(m.events,m))}function Y(){const se=S(),le=m.previous,ee=m.currentConstruct,oe=m.events.length,ae=Array.from(f);return{from:oe,restore:V};function V(){a=se,m.previous=le,m.currentConstruct=ee,m.events.length=oe,f=ae,fe()}}function fe(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function S6(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,u=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(a,u)];else{if(l=e.slice(n,s),a>-1){const f=l[0];typeof f=="string"?l[0]=f.slice(a):l.shift()}u>0&&l.push(e[s].slice(0,u))}return l}function z6(e,t){let n=-1;const a=[];let s;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
|
-
`;break}case-3:{l=`\r
|
|
22
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(u)}s=u===-2,a.push(l)}return a.join("")}function _6(e){const a={constructs:O5([k6,...(e||{}).extensions||[]]),content:s(V5),defined:[],document:s(Z5),flow:s(s6),lazy:{},string:s(u6),text:s(c6)};return a;function s(u){return l;function l(f){return w6(a,u,f)}}}function j6(e){for(;!V_(e););return e}const Tk=/[\0\t\n\r]/g;function N6(){let e=1,t="",n=!0,a;return s;function s(u,l,f){const h=[];let m,g,y,v,b;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(l||void 0).decode(u)),y=0,t="",n&&(u.charCodeAt(0)===65279&&y++,n=void 0);y<u.length;){if(Tk.lastIndex=y,m=Tk.exec(u),v=m&&m.index!==void 0?m.index:u.length,b=u.charCodeAt(v),!m){t=u.slice(y);break}if(b===10&&y===v&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<v&&(h.push(u.slice(y,v)),e+=v-y),b){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}y=v+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const C6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function E6(e){return e.replace(C6,T6)}function T6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),u=s===120||s===88;return $_(n.slice(u?2:1),u?16:10)}return Xg(n)||e}const q_={}.hasOwnProperty;function A6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),O6(n)(j6(_6(n).document().write(N6()(e,t,!0))))}function O6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(tt),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:u(_t),blockQuote:u(pt),characterEscape:Y,characterReference:Y,codeFenced:u(Dt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Dt,l),codeText:u($,l),codeTextData:Y,data:Y,codeFlowValue:Y,definition:u(je),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(Ke),hardBreakEscape:u(Oe),hardBreakTrailing:u(Oe),htmlFlow:u(Qe,l),htmlFlowData:Y,htmlText:u(Qe,l),htmlTextData:Y,image:u(st),label:l,link:u(tt),listItem:u(Xn),listItemValue:v,listOrdered:u(Qt,y),listUnordered:u(Qt),paragraph:u(Mt),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(_t),strong:u(Gt),thematicBreak:u(Ui)},exit:{atxHeading:h(),atxHeadingSequence:M,autolink:h(),autolinkEmail:Ae,autolinkProtocol:Pe,blockQuote:h(),characterEscapeValue:fe,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:he,characterReference:me,codeFenced:h(T),codeFencedFence:N,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:fe,codeIndented:h(E),codeText:h(ae),codeTextData:fe,data:fe,definition:h(),definitionDestinationString:P,definitionLabelString:O,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ee),htmlFlowData:fe,htmlText:h(oe),htmlTextData:fe,image:h(J),label:ye,labelText:K,lineEnding:se,link:h(V),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:G,resourceDestinationString:A,resourceTitleString:_,resource:U,setextHeading:h(B),setextHeadingLineSequence:I,setextHeadingText:R,strong:h(),thematicBreak:h()}};G_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let ce={type:"root",children:[]};const we={stack:[ce],tokenStack:[],config:t,enter:f,exit:m,buffer:l,resume:g,data:n},Ce=[];let He=-1;for(;++He<W.length;)if(W[He][1].type==="listOrdered"||W[He][1].type==="listUnordered")if(W[He][0]==="enter")Ce.push(He);else{const gn=Ce.pop();He=s(W,gn,He)}for(He=-1;++He<W.length;){const gn=t[W[He][0]];q_.call(gn,W[He][1].type)&&gn[W[He][1].type].call(Object.assign({sliceSerialize:W[He][2].sliceSerialize},we),W[He][1])}if(we.tokenStack.length>0){const gn=we.tokenStack[we.tokenStack.length-1];(gn[1]||Ak).call(we,void 0,gn[0])}for(ce.position={start:La(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:La(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)ce=t.transforms[He](ce)||ce;return ce}function s(W,ce,we){let Ce=ce-1,He=-1,gn=!1,Un,xn,Yt,_n;for(;++Ce<=we;){const ct=W[Ce];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?He++:He--,_n=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(Un&&!_n&&!He&&!Yt&&(Yt=Ce),_n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_n=void 0}if(!He&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||He===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(Un){let fa=Ce;for(xn=void 0;fa--;){const yr=W[fa];if(yr[1].type==="lineEnding"||yr[1].type==="lineEndingBlank"){if(yr[0]==="exit")continue;xn&&(W[xn][1].type="lineEndingBlank",gn=!0),yr[1].type="lineEnding",xn=fa}else if(!(yr[1].type==="linePrefix"||yr[1].type==="blockQuotePrefix"||yr[1].type==="blockQuotePrefixWhitespace"||yr[1].type==="blockQuoteMarker"||yr[1].type==="listItemIndent"))break}Yt&&(!xn||Yt<xn)&&(Un._spread=!0),Un.end=Object.assign({},xn?W[xn][1].start:ct[1].end),W.splice(xn||Ce,0,["exit",Un,ct[2]]),Ce++,we++}if(ct[1].type==="listItemPrefix"){const fa={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};Un=fa,W.splice(Ce,0,["enter",fa,ct[2]]),Ce++,we++,Yt=void 0,_n=!0}}}return W[ce][1]._spread=gn,we}function u(W,ce){return we;function we(Ce){f.call(this,W(Ce),Ce),ce&&ce.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function f(W,ce,we){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([ce,we||void 0]),W.position={start:La(ce.start),end:void 0}}function h(W){return ce;function ce(we){W&&W.call(this,we),m.call(this,we)}}function m(W,ce){const we=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==W.type&&(ce?ce.call(this,W,Ce[0]):(Ce[1]||Ak).call(this,W,Ce[0]));else throw new Error("Cannot close `"+W.type+"` ("+zl({start:W.start,end:W.end})+"): it’s not open");we.position.end=La(W.end)}function g(){return T5(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(W){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function b(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=W}function S(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=W}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W.replace(/(\r?\n|\r)$/g,"")}function O(W){const ce=this.resume(),we=this.stack[this.stack.length-1];we.label=ce,we.identifier=qs(this.sliceSerialize(W)).toLowerCase()}function C(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.title=W}function P(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.url=W}function M(W){const ce=this.stack[this.stack.length-1];if(!ce.depth){const we=this.sliceSerialize(W).length;ce.depth=we}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function I(W){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(W){const we=this.stack[this.stack.length-1].children;let Ce=we[we.length-1];(!Ce||Ce.type!=="text")&&(Ce=gt(),Ce.position={start:La(W.start),end:void 0},we.push(Ce)),this.stack.push(Ce)}function fe(W){const ce=this.stack.pop();ce.value+=this.sliceSerialize(W),ce.position.end=La(W.end)}function se(W){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=ce.children[ce.children.length-1];we.position.end=La(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(Y.call(this,W),fe.call(this,W))}function le(){this.data.atHardBreak=!0}function ee(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function oe(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function ae(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function V(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ce,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function J(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ce,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function K(W){const ce=this.sliceSerialize(W),we=this.stack[this.stack.length-2];we.label=E6(ce),we.identifier=qs(ce).toLowerCase()}function ye(){const W=this.stack[this.stack.length-1],ce=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ce=W.children;we.children=Ce}else we.alt=ce}function A(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.url=W}function _(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.title=W}function U(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function G(W){const ce=this.resume(),we=this.stack[this.stack.length-1];we.label=ce,we.identifier=qs(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function de(W){this.data.characterReferenceType=W.type}function he(W){const ce=this.sliceSerialize(W),we=this.data.characterReferenceType;let Ce;we?(Ce=$_(ce,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Xg(ce);const He=this.stack[this.stack.length-1];He.value+=Ce}function me(W){const ce=this.stack.pop();ce.position.end=La(W.end)}function Pe(W){fe.call(this,W);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(W)}function Ae(W){fe.call(this,W);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(W)}function pt(){return{type:"blockquote",children:[]}}function Dt(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ke(){return{type:"emphasis",children:[]}}function _t(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Qe(){return{type:"html",value:""}}function st(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function Qt(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Xn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Mt(){return{type:"paragraph",children:[]}}function Gt(){return{type:"strong",children:[]}}function gt(){return{type:"text",value:""}}function Ui(){return{type:"thematicBreak"}}}function La(e){return{line:e.line,column:e.column,offset:e.offset}}function G_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?G_(e,a):R6(e,a)}}function R6(e,t){let n;for(n in t)if(q_.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 Ak(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zl({start:t.start,end:t.end})+") is still open")}function D6(e){const t=this;t.parser=n;function n(a){return A6(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function M6(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 $6(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={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[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 P6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=lo(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let l,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=u+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(f>1?"-"+f:""),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 B6(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 Z6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Y_(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 s=e.all(t),u=s[0];u&&u.type==="text"?u.value="["+u.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=a:s.push({type:"text",value:a}),s}function I6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Y_(e,t);const s={src:lo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,u),e.applyData(t,u)}function H6(e,t){const n={src:lo(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 F6(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 q6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Y_(e,t);const s={href:lo(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function G6(e,t){const n={href:lo(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),s=n?K6(n):K_(t),u={},l=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(s||f!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
25
|
-
`}),g.type==="element"&&g.tagName==="p"&&!s?l.push(...g.children):l.push(g)}const h=a[a.length-1];h&&(s||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 K6(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=K_(n[a])}return t}function K_(e){const t=e.spread;return t??e.children.length>1}function X6(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const l=a[s];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 J6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q6(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 eL(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=qg(t.children[1]),h=E_(t.children[t.children.length-1]);f&&h&&(l.position={start:f,end:h}),s.push(l)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)}function tL(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,f=l?l.length:t.children.length;let h=-1;const m=[];for(;++h<f;){const y=t.children[h],v={},b=l?l[h]:void 0;b&&(v.align=b);let S={type:"element",tagName:u,properties:v,children:[]};y&&(S.children=e.all(y),e.patch(y,S),S=e.applyData(y,S)),m.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function nL(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ok=9,Rk=32;function rL(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const u=[];for(;a;)u.push(Dk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return u.push(Dk(t.slice(s),s>0,!1)),u.join("")}function Dk(e,t,n){let a=0,s=e.length;if(t){let u=e.codePointAt(a);for(;u===Ok||u===Rk;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(s-1);for(;u===Ok||u===Rk;)s--,u=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function aL(e,t){const n={type:"text",value:rL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function iL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const sL={blockquote:M6,break:$6,code:L6,delete:P6,emphasis:U6,footnoteReference:V6,heading:B6,html:Z6,imageReference:I6,image:H6,inlineCode:F6,linkReference:q6,link:G6,listItem:Y6,list:X6,paragraph:J6,root:Q6,strong:W6,table:eL,tableCell:nL,tableRow:tL,text:aL,thematicBreak:iL,toml:wc,yaml:wc,definition:wc,footnoteDefinition:wc};function wc(){}const X_=-1,vd=0,jl=1,ed=2,Wg=3,ex=4,tx=5,nx=6,J_=7,Q_=8,Mk=typeof self=="object"?self:globalThis,oL=(e,t)=>{const n=(s,u)=>(e.set(u,s),s),a=s=>{if(e.has(s))return e.get(s);const[u,l]=t[s];switch(u){case vd:case X_:return n(l,s);case jl:{const f=n([],s);for(const h of l)f.push(a(h));return f}case ed:{const f=n({},s);for(const[h,m]of l)f[a(h)]=a(m);return f}case Wg:return n(new Date(l),s);case ex:{const{source:f,flags:h}=l;return n(new RegExp(f,h),s)}case tx:{const f=n(new Map,s);for(const[h,m]of l)f.set(a(h),a(m));return f}case nx:{const f=n(new Set,s);for(const h of l)f.add(a(h));return f}case J_:{const{name:f,message:h}=l;return n(new Mk[f](h),s)}case Q_:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:f}=new Uint8Array(l);return n(new DataView(f),l)}}return n(new Mk[u](l),s)};return a},$k=e=>oL(new Map,e)(0),js="",{toString:lL}={},{keys:uL}=Object,hl=e=>{const t=typeof e;if(t!=="object"||!e)return[vd,t];const n=lL.call(e).slice(8,-1);switch(n){case"Array":return[jl,js];case"Object":return[ed,js];case"Date":return[Wg,js];case"RegExp":return[ex,js];case"Map":return[tx,js];case"Set":return[nx,js];case"DataView":return[jl,n]}return n.includes("Array")?[jl,n]:n.includes("Error")?[J_,n]:[ed,n]},Sc=([e,t])=>e===vd&&(t==="function"||t==="symbol"),cL=(e,t,n,a)=>{const s=(l,f)=>{const h=a.push(l)-1;return n.set(f,h),h},u=l=>{if(n.has(l))return n.get(l);let[f,h]=hl(l);switch(f){case vd:{let g=l;switch(h){case"bigint":f=Q_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([X_],l)}return s([f,g],l)}case jl:{if(h){let v=l;return h==="DataView"?v=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(l)),s([h,[...v]],l)}const g=[],y=s([f,g],l);for(const v of l)g.push(u(v));return y}case ed:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return u(l.toJSON());const g=[],y=s([f,g],l);for(const v of uL(l))(e||!Sc(hl(l[v])))&&g.push([u(v),u(l[v])]);return y}case Wg:return s([f,l.toISOString()],l);case ex:{const{source:g,flags:y}=l;return s([f,{source:g,flags:y}],l)}case tx:{const g=[],y=s([f,g],l);for(const[v,b]of l)(e||!(Sc(hl(v))||Sc(hl(b))))&&g.push([u(v),u(b)]);return y}case nx:{const g=[],y=s([f,g],l);for(const v of l)(e||!Sc(hl(v)))&&g.push(u(v));return y}}const{message:m}=l;return s([f,{name:h,message:m}],l)};return u},Lk=(e,{json:t,lossy:n}={})=>{const a=[];return cL(!(t||n),!!t,new Map,a)(e),a},td=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?$k(Lk(e,t)):structuredClone(e):(e,t)=>$k(Lk(e,t));function dL(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 fL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function hL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||dL,a=e.options.footnoteBackLabel||fL,s=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),y=String(m.identifier).toUpperCase(),v=lo(y.toLowerCase());let b=0;const S=[],N=e.footnoteCounts.get(y);for(;N!==void 0&&++b<=N;){S.length>0&&S.push({type:"text",value:" "});let O=typeof n=="string"?n:n(h,b);typeof O=="string"&&(O={type:"text",value:O}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,b),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const T=g[g.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const O=T.children[T.children.length-1];O&&O.type==="text"?O.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...S)}else g.push(...S);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...td(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
27
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
28
|
-
`}]}}const W_=(function(e){if(e==null)return xL;if(typeof e=="function")return kd(e);if(typeof e=="object")return Array.isArray(e)?mL(e):pL(e);if(typeof e=="string")return gL(e);throw new Error("Expected function, string, or object as test")});function mL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=W_(e[n]);return kd(a);function a(...s){let u=-1;for(;++u<t.length;)if(t[u].apply(this,s))return!0;return!1}}function pL(e){const t=e;return kd(n);function n(a){const s=a;let u;for(u in e)if(s[u]!==t[u])return!1;return!0}}function gL(e){return kd(t);function t(n){return n&&n.type===e}}function kd(e){return t;function t(n,a,s){return!!(yL(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function xL(){return!0}function yL(e){return e!==null&&typeof e=="object"&&"type"in e}const ej=[],bL=!0,Pk=!1,vL="skip";function kL(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const u=W_(s),l=a?-1:1;f(e,void 0,[])();function f(h,m,g){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=ej,S,N,T;if((!t||u(h,m,g[g.length-1]||void 0))&&(b=wL(n(h,g)),b[0]===Pk))return b;if("children"in h&&h.children){const E=h;if(E.children&&b[0]!==vL)for(N=(a?E.children.length:-1)+l,T=g.concat(E);N>-1&&N<E.children.length;){const O=E.children[N];if(S=f(O,N,T)(),S[0]===Pk)return S;N=typeof S[1]=="number"?S[1]:N+l}}return b}}}function wL(e){return Array.isArray(e)?e:typeof e=="number"?[bL,e]:e==null?ej:[e]}function tj(e,t,n,a){let s,u,l;typeof t=="function"&&typeof n!="function"?(u=void 0,l=t,s=n):(u=t,l=n,s=a),kL(e,u,f,s);function f(h,m){const g=m[m.length-1],y=g?g.children.indexOf(h):void 0;return l(h,y,g)}}const Up={}.hasOwnProperty,SL={};function zL(e,t){const n=t||SL,a=new Map,s=new Map,u=new Map,l={...sL,...n.handlers},f={all:m,applyData:jL,definitionById:a,footnoteById:s,footnoteCounts:u,footnoteOrder:[],handlers:l,one:h,options:n,patch:_L,wrap:CL};return tj(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:s,v=String(g.identifier).toUpperCase();y.has(v)||y.set(v,g)}}),f;function h(g,y){const v=g.type,b=f.handlers[v];if(Up.call(f.handlers,v)&&b)return b(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in g){const{children:N,...T}=g,E=td(T);return E.children=f.all(g),E}return td(g)}return(f.options.unknownHandler||NL)(f,g,y)}function m(g){const y=[];if("children"in g){const v=g.children;let b=-1;for(;++b<v.length;){const S=f.one(v[b],g);if(S){if(b&&v[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Uk(S.value)),!Array.isArray(S)&&S.type==="element")){const N=S.children[0];N&&N.type==="text"&&(N.value=Uk(N.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function _L(e,t){e.position&&(t.position=l5(e))}function jL(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=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,td(u)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function NL(e,t){const n=t.data||{},a="value"in t&&!(Up.call(n,"hProperties")||Up.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 CL(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
29
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
30
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
31
|
-
`}),n}function Uk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Vk(e,t){const n=zL(e,t),a=n.one(e,void 0),s=hL(n),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&u.children.push({type:"text",value:`
|
|
32
|
-
`},s),u}function EL(e,t){return e&&"run"in e?async function(n,a){const s=Vk(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Vk(n,{file:a,...e||t})}}function Bk(e){if(e)throw e}var Nm,Zk;function TL(){if(Zk)return Nm;Zk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},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},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return Nm=function h(){var m,g,y,v,b,S,N=arguments[0],T=1,E=arguments.length,O=!1;for(typeof N=="boolean"&&(O=N,N=arguments[1]||{},T=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});T<E;++T)if(m=arguments[T],m!=null)for(g in m)y=f(N,g),v=f(m,g),N!==v&&(O&&v&&(u(v)||(b=s(v)))?(b?(b=!1,S=y&&s(y)?y:[]):S=y&&u(y)?y:{},l(N,{name:g,newValue:h(O,S,v)})):typeof v<"u"&&l(N,{name:g,newValue:v}));return N},Nm}var AL=TL();const Cm=Kp(AL);function Vp(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 OL(){const e=[],t={run:n,use:a};return t;function n(...s){let u=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);f(null,...s);function f(h,...m){const g=e[++u];let y=-1;if(h){l(h);return}for(;++y<s.length;)(m[y]===null||m[y]===void 0)&&(m[y]=s[y]);s=m,g?RL(g,f)(...m):l(null,...m)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function RL(e,t){let n;return a;function a(...l){const f=e.length>l.length;let h;f&&l.push(s);try{h=e.apply(this,l)}catch(m){const g=m;if(f&&n)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,s):h instanceof Error?s(h):u(h))}function s(l,...f){n||(n=!0,t(l,...f))}function u(l){s(null,l)}}const Rr={basename:DL,dirname:ML,extname:$L,join:LL,sep:"/"};function DL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jl(e);let n=0,a=-1,s=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else a<0&&(u=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else l<0&&(u=!0,l=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(a=s):(f=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function ML(e){if(Jl(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 $L(e){Jl(e);let t=e.length,n=-1,a=0,s=-1,u=0,l;for(;t--;){const f=e.codePointAt(t);if(f===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),f===46?s<0?s=t:u!==1&&(u=1):s>-1&&(u=-1)}return s<0||n<0||u===0||u===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function LL(...e){let t=-1,n;for(;++t<e.length;)Jl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PL(n)}function PL(e){Jl(e);const t=e.codePointAt(0)===47;let n=UL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function UL(e,t){let n="",a=0,s=-1,u=0,l=-1,f,h;for(;++l<=e.length;){if(l<e.length)f=e.codePointAt(l);else{if(f===47)break;f=47}if(f===47){if(!(s===l-1||u===1))if(s!==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("/")),s=l,u=0;continue}}else if(n.length>0){n="",a=0,s=l,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),a=l-s-1;s=l,u=0}else f===46&&u>-1?u++:u=-1}return n}function Jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VL={cwd:BL};function BL(){return"/"}function Bp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZL(e){if(typeof e=="string")e=new URL(e);else if(!Bp(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 IL(e)}function IL(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Em=["history","path","basename","stem","extname","dirname"];class nj{constructor(t){let n;t?Bp(t)?n={path:t}:typeof t=="string"||HL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":VL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Em.length;){const u=Em[a];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let s;for(s in n)Em.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Rr.basename(this.path):void 0}set basename(t){Am(t,"basename"),Tm(t,"basename"),this.path=Rr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Rr.dirname(this.path):void 0}set dirname(t){Ik(this.basename,"dirname"),this.path=Rr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Rr.extname(this.path):void 0}set extname(t){if(Tm(t,"extname"),Ik(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=Rr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bp(t)&&(t=ZL(t)),Am(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Rr.basename(this.path,this.extname):void 0}set stem(t){Am(t,"stem"),Tm(t,"stem"),this.path=Rr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new pn(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Tm(e,t){if(e&&e.includes(Rr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Rr.sep+"`")}function Am(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ik(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 FL=(function(e){const a=this.constructor.prototype,s=a[e],u=function(){return s.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),qL={}.hasOwnProperty;class rx extends FL{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=OL()}copy(){const t=new rx;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Cm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Dm("data",this.frozen),this.namespace[t]=n,this):qL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Dm("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 s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=zc(t),a=this.parser||this.Parser;return Om("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Om("process",this.parser||this.Parser),Rm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(u,l){const f=zc(t),h=a.parse(f);a.run(h,f,function(g,y,v){if(g||!y||!v)return m(g);const b=y,S=a.stringify(b,v);KL(S)?v.value=S:v.result=S,m(g,v)});function m(g,y){g||!y?l(g):u?u(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),Om("processSync",this.parser||this.Parser),Rm("processSync",this.compiler||this.Compiler),this.process(t,s),Fk("processSync","process",n),a;function s(u,l){n=!0,Bk(u),a=l}}run(t,n,a){Hk(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?u(void 0,a):new Promise(u);function u(l,f){const h=zc(n);s.run(t,h,m);function m(g,y,v){const b=y||t;g?f(g):l?l(b):a(void 0,b,v)}}}runSync(t,n){let a=!1,s;return this.run(t,n,u),Fk("runSync","run",a),s;function u(l,f){Bk(l),s=f,a=!0}}stringify(t,n){this.freeze();const a=zc(n),s=this.compiler||this.Compiler;return Rm("stringify",s),Hk(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(Dm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(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,...y]=m;h(g,y)}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");f(m.plugins),m.settings&&(s.settings=Cm(!0,s.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const y=m[g];u(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let y=-1,v=-1;for(;++y<a.length;)if(a[y][0]===m){v=y;break}if(v===-1)a.push([m,...g]);else if(g.length>0){let[b,...S]=g;const N=a[v][1];Vp(N)&&Vp(b)&&(b=Cm(!0,N,b)),a[v]=[m,b,...S]}}}}const GL=new rx().freeze();function Om(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Rm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Dm(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 Hk(e){if(!Vp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zc(e){return YL(e)?e:new nj(e)}function YL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function KL(e){return typeof e=="string"||XL(e)}function XL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qk=[],Gk={allowDangerousHtml:!0},QL=/^(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 e9(e){const t=t9(e),n=n9(e);return r9(t.runSync(t.parse(n),n),e)}function t9(e){const t=e.rehypePlugins||qk,n=e.remarkPlugins||qk,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gk}:Gk;return GL().use(D6).use(n).use(EL,a).use(t)}function n9(e){const t=e.children||"",n=new nj;return typeof t=="string"&&(n.value=t),n}function r9(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,u=t.disallowedElements,l=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||a9;for(const g of WL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+JL+g.id,void 0);return tj(e,m),h5(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return l?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let b;for(b in zm)if(Object.hasOwn(zm,b)&&Object.hasOwn(g.properties,b)){const S=g.properties[b],N=zm[b];(N===null||N.includes(g.tagName))&&(g.properties[b]=h(String(S||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!b&&a&&typeof y=="number"&&(b=!a(g,y,v)),b&&v&&typeof y=="number")return f&&g.children?v.children.splice(y,1,...g.children):v.children.splice(y,1),y}}}function a9(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||QL.test(e.slice(0,t))?e:""}const i9=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a})=>{const[s,u]=z.useState(""),l=z.useRef(null),f=()=>{l.current?.scrollIntoView({behavior:"smooth"})};z.useEffect(()=>{f()},[e,n]);const h=S=>{S.preventDefault(),!(!s.trim()||n)&&(t(s),u(""))},m=S=>S.session_id?.startsWith("sati-evaluation-")||S.tool_name?.toLowerCase().includes("sati")||S.tool_call_id?.toLowerCase().includes("sati")?!0:Array.isArray(S.tool_calls)?S.tool_calls.some(N=>String(N?.name||"").toLowerCase().includes("sati")):!1,g=S=>m(S)?"SATI Memory":"Tool Call",y=S=>{if(typeof S=="string")try{return JSON.stringify(JSON.parse(S),null,2)}catch{return S}try{return JSON.stringify(S,null,2)}catch{return String(S)}},v=S=>{const N=S.usage_metadata;if(!N||typeof N!="object")return null;const T=N.input_tokens??N.prompt_tokens??N.input??0,E=N.output_tokens??N.completion_tokens??N.output??0,O=Number(T),C=Number(E);if(!Number.isFinite(O)&&!Number.isFinite(C))return null;const P=Number.isFinite(O)?Math.max(0,Math.round(O)):0,M=Number.isFinite(C)?Math.max(0,Math.round(C)):0;return P===0&&M===0?null:{input:P,output:M}},b=S=>S.toLocaleString("pt-BR");return a?d.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((S,N)=>{const T=v(S),E=S.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 d.jsxs("div",{className:`flex gap-4 ${S.type==="human"?"justify-end":"justify-start"}`,children:[S.type!=="human"&&d.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${S.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:S.type==="tool"?d.jsx(zS,{size:16}):d.jsx(O0,{size:18})}),d.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-sm ${S.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":S.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:[S.type==="tool"&&d.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[d.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),d.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:y(S.content)})]}),S.type==="ai"&&d.jsxs(d.Fragment,{children:[d.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:d.jsx(e9,{children:S.content})}),Array.isArray(S.tool_calls)&&S.tool_calls.length>0&&d.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:[d.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),d.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:y(S.tool_calls)})]})]}),S.type==="human"&&d.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:S.content}),T&&d.jsx("div",{className:"mt-3 flex justify-end",children:d.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${E}`,children:[d.jsx(kS,{size:12}),d.jsx("span",{children:b(T.input)}),d.jsx("span",{className:"opacity-60",children:"/"}),d.jsx("span",{children:b(T.output)}),d.jsx(vS,{size:12})]})})]}),S.type==="human"&&d.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:d.jsx(og,{size:18})})]},N)}),n&&d.jsxs("div",{className:"flex gap-4 justify-start",children:[d.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:d.jsx(O0,{size:18})}),d.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:[d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),d.jsx("div",{ref:l})]}),d.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:d.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[d.jsx("input",{type:"text",value:s,onChange:S=>u(S.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}),d.jsx("button",{type:"submit",disabled:!s.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:d.jsx(XA,{size:20})})]})})]}):d.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:[d.jsx(s9,{size:48,className:"mb-4 opacity-20"}),d.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},s9=({size:e,className:t})=>d.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:d.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"})}),Pa={getSessions:async()=>xe.get("/sessions"),createSession:async()=>xe.post("/sessions",{}),deleteSession:async e=>xe.delete(`/sessions/${e}`),renameSession:async(e,t)=>xe.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>xe.post(`/sessions/${e}/archive`,{}),getMessages:async e=>xe.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>xe.post("/chat",{sessionId:e,message:t})};function rj({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:u="Confirm",variant:l="default"}){return d.jsx(hr,{open:e,onOpenChange:t,children:d.jsxs(Js,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(mr,{children:d.jsx(pr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),d.jsx("div",{className:"py-4",children:d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:s})}),d.jsxs(OM,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[d.jsx(cr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),d.jsx(cr,{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 o9=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(null),[s,u]=z.useState([]),[l,f]=z.useState(!1),[h,m]=z.useState(!0),g=z.useRef(!1);z.useEffect(()=>{g.current=l},[l]),z.useEffect(()=>{if(!n)return;const P=setInterval(async()=>{if(!g.current)try{const R=(await Pa.getMessages(n)).filter(I=>I.type!=="system");u(I=>{if(R.length!==I.length)return R;const B=R.at(-1)?.created_at??0,Y=I.at(-1)?.created_at??0;return B>Y?R:I})}catch{}},3e3);return()=>clearInterval(P)},[n]);const[y,v]=z.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),b=async()=>{try{const P=await Pa.getSessions();t(P)}catch(P){console.error("Failed to load sessions:",P)}};z.useEffect(()=>{b()},[]),z.useEffect(()=>{n?S(n):u([])},[n]);const S=async P=>{try{const M=await Pa.getMessages(P);u(M.filter(R=>R.type!=="system"))}catch(M){console.error("Failed to load messages:",M)}},N=async()=>{try{const P=await Pa.createSession();await b(),a(P.id)}catch(P){console.error("Failed to create session:",P)}},T=async P=>{if(!n)return;const M={type:"human",content:P};u(R=>[...R,M]),f(!0);try{await Pa.sendMessage(n,P),await S(n),await b()}catch(R){console.error("Failed to send message:",R)}finally{f(!1)}},E=P=>{v({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 Pa.archiveSession(P),n===P&&a(null),await b()}catch(M){console.error("Failed to archive session:",M)}}})},O=P=>{v({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 Pa.deleteSession(P),n===P&&a(null),await b()}catch(M){console.error("Failed to delete session:",M)}}})},C=async(P,M)=>{try{await Pa.renameSession(P,M),await b()}catch(R){console.error("Failed to rename session:",R)}};return d.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[d.jsx(PM,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:N,onArchiveSession:E,onDeleteSession:O,onRenameSession:C,isOpen:h,toggleSidebar:()=>m(!h)}),d.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:d.jsx(i9,{messages:s,onSendMessage:T,isLoading:l,activeSessionId:n})}),d.jsx(rj,{isOpen:y.isOpen,onClose:()=>v(P=>({...P,isOpen:!1})),onConfirm:y.onConfirm,title:y.title,description:y.description,confirmJson:y.confirmJson,variant:y.variant})]})};function l9(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return kt(`/chronos${n}`,()=>xe.get(`/chronos${n}`))}function u9(e,t=50){return kt(e?`/chronos/${e}/executions?limit=${t}`:null,()=>xe.get(`/chronos/${e}/executions?limit=${t}`))}function aj(){return kt("/config/chronos",()=>xe.get("/config/chronos"))}const Ti={createJob:e=>xe.post("/chronos",e),updateJob:(e,t)=>xe.put(`/chronos/${e}`,t),deleteJob:e=>xe.delete(`/chronos/${e}`),enableJob:e=>xe.patch(`/chronos/${e}/enable`,{}),disableJob:e=>xe.patch(`/chronos/${e}/disable`,{}),getConfig:()=>xe.get("/config/chronos"),updateConfig:e=>xe.post("/config/chronos",e),preview:(e,t,n)=>xe.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function bn({title:e,description:t,children:n}){return d.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:[d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),d.jsx("div",{className:"space-y-4",children:n})]})}const c9=(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},d9=(e,t)=>({classGroupId:e,validator:t}),ij=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),nd="-",Yk=[],f9="arbitrary..",h9=e=>{const t=p9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return m9(l);const f=l.split(nd),h=f[0]===""&&f.length>1?1:0;return sj(f,h,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const h=a[l],m=n[l];return h?m?c9(m,h):h:m||Yk}return n[l]||Yk}}},sj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],u=n.nextPart.get(s);if(u){const m=sj(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const f=t===0?e.join(nd):e.slice(t).join(nd),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(f))return g.classGroupId}},m9=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?f9+a:void 0})(),p9=e=>{const{theme:t,classGroups:n}=e;return g9(n,t)},g9=(e,t)=>{const n=ij();for(const a in e){const s=e[a];ax(s,n,a,t)}return n},ax=(e,t,n,a)=>{const s=e.length;for(let u=0;u<s;u++){const l=e[u];x9(l,t,n,a)}},x9=(e,t,n,a)=>{if(typeof e=="string"){y9(e,t,n);return}if(typeof e=="function"){b9(e,t,n,a);return}v9(e,t,n,a)},y9=(e,t,n)=>{const a=e===""?t:oj(t,e);a.classGroupId=n},b9=(e,t,n,a)=>{if(k9(e)){ax(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(d9(n,e))},v9=(e,t,n,a)=>{const s=Object.entries(e),u=s.length;for(let l=0;l<u;l++){const[f,h]=s[l];ax(h,oj(t,f),n,a)}},oj=(e,t)=>{let n=e;const a=t.split(nd),s=a.length;for(let u=0;u<s;u++){const l=a[u];let f=n.nextPart.get(l);f||(f=ij(),n.nextPart.set(l,f)),n=f}return n},k9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,w9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(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 s(u,l),l},set(u,l){u in n?n[u]=l:s(u,l)}}},Zp="!",Kk=":",S9=[],Xk=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),z9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const u=[];let l=0,f=0,h=0,m;const g=s.length;for(let N=0;N<g;N++){const T=s[N];if(l===0&&f===0){if(T===Kk){u.push(s.slice(h,N)),h=N+1;continue}if(T==="/"){m=N;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const y=u.length===0?s:s.slice(h);let v=y,b=!1;y.endsWith(Zp)?(v=y.slice(0,-1),b=!0):y.startsWith(Zp)&&(v=y.slice(1),b=!0);const S=m&&m>h?m-h:void 0;return Xk(u,b,v,S)};if(t){const s=t+Kk,u=a;a=l=>l.startsWith(s)?u(l.slice(s.length)):Xk(S9,!1,l,void 0,!0)}if(n){const s=a;a=u=>n({className:u,parseClassName:s})}return a},_9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let u=0;u<n.length;u++){const l=n[u],f=l[0]==="[",h=t.has(l);f||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(l)):s.push(l)}return s.length>0&&(s.sort(),a.push(...s)),a}},j9=e=>({cache:w9(e.cacheSize),parseClassName:z9(e),sortModifiers:_9(e),...h9(e)}),N9=/\s+/,C9=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:u}=t,l=[],f=e.trim().split(N9);let h="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:N}=n(g);if(y){h=g+(h.length>0?" "+h:h);continue}let T=!!N,E=a(T?S.substring(0,N):S);if(!E){if(!T){h=g+(h.length>0?" "+h:h);continue}if(E=a(S),!E){h=g+(h.length>0?" "+h:h);continue}T=!1}const O=v.length===0?"":v.length===1?v[0]:u(v).join(":"),C=b?O+Zp:O,P=C+E;if(l.indexOf(P)>-1)continue;l.push(P);const M=s(E,T);for(let R=0;R<M.length;++R){const I=M[R];l.push(C+I)}h=g+(h.length>0?" "+h:h)}return h},E9=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=lj(n))&&(s&&(s+=" "),s+=a);return s},lj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=lj(e[a]))&&(n&&(n+=" "),n+=t);return n},T9=(e,...t)=>{let n,a,s,u;const l=h=>{const m=t.reduce((g,y)=>y(g),e());return n=j9(m),a=n.cache.get,s=n.cache.set,u=f,f(h)},f=h=>{const m=a(h);if(m)return m;const g=C9(h,n);return s(h,g),g};return u=l,(...h)=>u(E9(...h))},A9=[],Xt=e=>{const t=n=>n[e]||A9;return t.isThemeGetter=!0,t},uj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,O9=/^\d+\/\d+$/,R9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D9=/\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$/,M9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,L9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=e=>O9.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),Ua=e=>!!e&&Number.isInteger(Number(e)),Mm=e=>e.endsWith("%")&&Le(e.slice(0,-1)),ia=e=>R9.test(e),P9=()=>!0,U9=e=>D9.test(e)&&!M9.test(e),dj=()=>!1,V9=e=>$9.test(e),B9=e=>L9.test(e),Z9=e=>!be(e)&&!ve(e),I9=e=>uo(e,mj,dj),be=e=>uj.test(e),Si=e=>uo(e,pj,U9),$m=e=>uo(e,Y9,Le),Jk=e=>uo(e,fj,dj),H9=e=>uo(e,hj,B9),_c=e=>uo(e,gj,V9),ve=e=>cj.test(e),ml=e=>co(e,pj),F9=e=>co(e,K9),Qk=e=>co(e,fj),q9=e=>co(e,mj),G9=e=>co(e,hj),jc=e=>co(e,gj,!0),uo=(e,t,n)=>{const a=uj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},co=(e,t,n=!1)=>{const a=cj.exec(e);return a?a[1]?t(a[1]):n:!1},fj=e=>e==="position"||e==="percentage",hj=e=>e==="image"||e==="url",mj=e=>e==="length"||e==="size"||e==="bg-size",pj=e=>e==="length",Y9=e=>e==="number",K9=e=>e==="family-name",gj=e=>e==="shadow",X9=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),a=Xt("font-weight"),s=Xt("tracking"),u=Xt("leading"),l=Xt("breakpoint"),f=Xt("container"),h=Xt("spacing"),m=Xt("radius"),g=Xt("shadow"),y=Xt("inset-shadow"),v=Xt("text-shadow"),b=Xt("drop-shadow"),S=Xt("blur"),N=Xt("perspective"),T=Xt("aspect"),E=Xt("ease"),O=Xt("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...P(),ve,be],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],B=()=>[ve,be,h],Y=()=>[Ns,"full","auto",...B()],fe=()=>[Ua,"none","subgrid",ve,be],se=()=>["auto",{span:["full",Ua,ve,be]},Ua,ve,be],le=()=>[Ua,"auto",ve,be],ee=()=>["auto","min","max","fr",ve,be],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...B()],J=()=>[Ns,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],K=()=>[e,ve,be],ye=()=>[...P(),Qk,Jk,{position:[ve,be]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",q9,I9,{size:[ve,be]}],U=()=>[Mm,ml,Si],w=()=>["","none","full",m,ve,be],G=()=>["",Le,ml,Si],de=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Le,Mm,Qk,Jk],Pe=()=>["","none",S,ve,be],Ae=()=>["none",Le,ve,be],pt=()=>["none",Le,ve,be],Dt=()=>[Le,ve,be],$=()=>[Ns,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ia],breakpoint:[ia],color:[P9],container:[ia],"drop-shadow":[ia],ease:["in","out","in-out"],font:[Z9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ia],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ia],shadow:[ia],spacing:["px",Le],text:[ia],"text-shadow":[ia],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ns,be,ve,T]}],container:["container"],columns:[{columns:[Le,be,ve,f]}],"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:M()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Ua,"auto",ve,be]}],basis:[{basis:[Ns,"full","auto",f,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Ns,"auto","initial","none",be]}],grow:[{grow:["",Le,ve,be]}],shrink:[{shrink:["",Le,ve,be]}],order:[{order:[Ua,"first","last","none",ve,be]}],"grid-cols":[{"grid-cols":fe()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":fe()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"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:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[f,"screen",...J()]}],"min-w":[{"min-w":[f,"screen","none",...J()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,ml,Si]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ve,$m]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mm,be]}],"font-family":[{font:[F9,be,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:[s,ve,be]}],"line-clamp":[{"line-clamp":[Le,"none",ve,$m]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",ve,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",ve,Si]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Le,"auto",ve,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,be]}],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",ve,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ye()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ua,ve,be],radial:["",ve,be],conic:[Ua,ve,be]},G9,H9]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],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:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,ve,be]}],"outline-w":[{outline:["",Le,ml,Si]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",g,jc,_c]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",y,jc,_c]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Le,Si]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",v,jc,_c]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Le,ve,be]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[Le]}],"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":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"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":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"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":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"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":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"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":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"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":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"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":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[ve,be]}],"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":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"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":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ye()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,be]}],filter:[{filter:["","none",ve,be]}],blur:[{blur:Pe()}],brightness:[{brightness:[Le,ve,be]}],contrast:[{contrast:[Le,ve,be]}],"drop-shadow":[{"drop-shadow":["","none",b,jc,_c]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Le,ve,be]}],"hue-rotate":[{"hue-rotate":[Le,ve,be]}],invert:[{invert:["",Le,ve,be]}],saturate:[{saturate:[Le,ve,be]}],sepia:[{sepia:["",Le,ve,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,be]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Le,ve,be]}],"backdrop-contrast":[{"backdrop-contrast":[Le,ve,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,ve,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,ve,be]}],"backdrop-invert":[{"backdrop-invert":["",Le,ve,be]}],"backdrop-opacity":[{"backdrop-opacity":[Le,ve,be]}],"backdrop-saturate":[{"backdrop-saturate":[Le,ve,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,ve,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Le,"initial",ve,be]}],ease:[{ease:["linear","initial",E,ve,be]}],delay:[{delay:[Le,ve,be]}],animate:[{animate:["none",O,ve,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,ve,be]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:pt()}],"scale-x":[{"scale-x":pt()}],"scale-y":[{"scale-y":pt()}],"scale-z":[{"scale-z":pt()}],"scale-3d":["scale-3d"],skew:[{skew:Dt()}],"skew-x":[{"skew-x":Dt()}],"skew-y":[{"skew-y":Dt()}],transform:[{transform:[ve,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"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",ve,be]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",ve,be]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Le,ml,Si,$m]}],stroke:[{stroke:["none",...K()]}],"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"]}},Gs=T9(X9);function Fe({label:e,error:t,helperText:n,className:a,...s}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.jsx("input",{className:Gs("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),...s}),n&&!t&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&d.jsx("p",{className:"text-xs text-red-500",children:t})]})}function wn({label:e,options:t,error:n,helperText:a,className:s,...u}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.jsx("select",{className:Gs("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",s),...u,children:t.map(l=>d.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&d.jsx("p",{className:"text-xs text-red-500",children:n})]})}function fn({label:e,error:t,helperText:n,className:a,...s}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.jsx("input",{type:"number",className:Gs("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),...s}),n&&!t&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&d.jsx("p",{className:"text-xs text-red-500",children:t})]})}function Or({label:e,checked:t,onChange:n,helperText:a,disabled:s}){return d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:Gs("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",s&&"opacity-50"),children:e}),a&&d.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),d.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!s&&n(!t),className:Gs("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",s&&"opacity-50 cursor-not-allowed"),children:d.jsx("span",{className:Gs("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const or={fetchConfig:async()=>xe.get("/config"),updateConfig:async e=>xe.post("/config",e),getSatiConfig:async()=>xe.get("/config/sati"),updateSatiConfig:async e=>xe.post("/config/sati",e),deleteSatiConfig:async()=>xe.delete("/config/sati"),getApocConfig:async()=>xe.get("/config/apoc"),updateApocConfig:async e=>xe.post("/config/apoc",e),deleteApocConfig:async()=>xe.delete("/config/apoc"),getNeoConfig:async()=>xe.get("/config/neo"),updateNeoConfig:async e=>xe.post("/config/neo",e),deleteNeoConfig:async()=>xe.delete("/config/neo"),getTrinityConfig:async()=>xe.get("/config/trinity"),updateTrinityConfig:async e=>xe.post("/config/trinity",e),deleteTrinityConfig:async()=>xe.delete("/config/trinity"),getEncryptionStatus:async()=>xe.get("/config/encryption-status"),getEnvOverrides:async()=>xe.get("/config/env-overrides")};function te(e,t,n){function a(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const v=g[y];v in f||(f[v]=m[v].bind(f))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(f){var h;const m=n?.Parent?new u:this;a(m,f),(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:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let Ys=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xj=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const yj={};function Xa(e){return yj}function bj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Ip(e,t){return typeof t=="bigint"?t.toString():t}function wd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ix(e){return e==null}function sx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function J9(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let s=(a.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(a)){const h=a.match(/\d?e-(\d?)/);h?.[1]&&(s=Number.parseInt(h[1]))}const u=n>s?n:s,l=Number.parseInt(e.toFixed(u).replace(".","")),f=Number.parseInt(t.toFixed(u).replace(".",""));return l%f/10**u}const Wk=Symbol("evaluating");function nt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Wk)return a===void 0&&(a=Wk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function $i(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ei(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function ew(e){return JSON.stringify(e)}function Q9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const vj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const W9=wd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Qs(e){if(Pl(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Pl(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kj(e){return Qs(e)?{...e}:Array.isArray(e)?[...e]:e}const eP=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ti(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function ze(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 tP(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const nP={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 rP(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=ei(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return $i(this,"shape",l),l},checks:[]});return ti(e,u)}function aP(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=ei(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return $i(this,"shape",l),l},checks:[]});return ti(e,u)}function iP(e,t){if(!Qs(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 s=ei(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return $i(this,"shape",u),u}});return ti(e,s)}function sP(e,t){if(!Qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ei(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return $i(this,"shape",a),a}});return ti(e,n)}function oP(e,t){const n=ei(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return $i(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ti(e,n)}function lP(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=ei(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(n)for(const m in n){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)h[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return $i(this,"shape",h),h},checks:[]});return ti(t,l)}function uP(e,t,n){const a=ei(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};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:s[l]}))}else for(const l in s)u[l]=new e({type:"nonoptional",innerType:s[l]});return $i(this,"shape",u),u}});return ti(t,a)}function Us(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 Vs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Nc(e){return typeof e=="string"?e:e?.message}function Ja(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Nc(e.inst?._zod.def?.error?.(e))??Nc(t?.error?.(e))??Nc(n.customError?.(e))??Nc(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ox(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ul(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const wj=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ip,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sj=te("$ZodError",wj),zj=te("$ZodError",wj,{Parent:Error});function cP(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function dP(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const u of s.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,f=0;for(;f<u.path.length;){const h=u.path[f];f===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const lx=e=>(t,n,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Ys;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Ja(h,u,Xa())));throw vj(f,s?.callee),f}return l.value},ux=e=>async(t,n,a,s)=>{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 f=new(s?.Err??e)(l.issues.map(h=>Ja(h,u,Xa())));throw vj(f,s?.callee),f}return l.value},Sd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new Ys;return u.issues.length?{success:!1,error:new(e??Sj)(u.issues.map(l=>Ja(l,s,Xa())))}:{success:!0,data:u.value}},fP=Sd(zj),zd=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Ja(l,s,Xa())))}:{success:!0,data:u.value}},hP=zd(zj),mP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return lx(e)(t,n,s)},pP=e=>(t,n,a)=>lx(e)(t,n,a),gP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ux(e)(t,n,s)},xP=e=>async(t,n,a)=>ux(e)(t,n,a),yP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sd(e)(t,n,s)},bP=e=>(t,n,a)=>Sd(e)(t,n,a),vP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return zd(e)(t,n,s)},kP=e=>async(t,n,a)=>zd(e)(t,n,a),wP=/^[cC][^\s-]{8,}$/,SP=/^[0-9a-z]+$/,zP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_P=/^[0-9a-vA-V]{20}$/,jP=/^[A-Za-z0-9]{27}$/,NP=/^[a-zA-Z0-9_-]{21}$/,CP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,EP=/^([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})$/,tw=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)$/,TP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,AP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OP(){return new RegExp(AP,"u")}const RP=/^(?:(?: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])$/,DP=/^(([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}|:))$/,MP=/^((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])$/,$P=/^(([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])$/,LP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_j=/^[A-Za-z0-9_-]*$/,PP=/^\+[1-9]\d{6,14}$/,jj="(?:(?:\\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])))",UP=new RegExp(`^${jj}$`);function Nj(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 VP(e){return new RegExp(`^${Nj(e)}$`)}function BP(e){const t=Nj({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(`^${jj}T(?:${a})$`)}const ZP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},IP=/^-?\d+$/,Cj=/^-?\d+(?:\.\d+)?$/,HP=/^(?:true|false)$/i,FP=/^[^A-Z]*$/,qP=/^[^a-z]*$/,Pn=te("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ej={number:"number",bigint:"bigint",object:"date"},Tj=te("$ZodCheckLessThan",(e,t)=>{Pn.init(e,t);const n=Ej[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?s.maximum=t.value:s.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})}}),Aj=te("$ZodCheckGreaterThan",(e,t)=>{Pn.init(e,t);const n=Ej[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?s.minimum=t.value:s.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=te("$ZodCheckMultipleOf",(e,t)=>{Pn.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):J9(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=te("$ZodCheckNumberFormat",(e,t)=>{Pn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,u]=nP[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=s,f.maximum=u,n&&(f.pattern=IP)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,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:f,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}}f<s&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),f>u&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),KP=te("$ZodCheckMaxLength",(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ix(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const l=ox(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),XP=te("$ZodCheckMinLength",(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ix(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const l=ox(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),JP=te("$ZodCheckLengthEquals",(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ix(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===t.length)return;const l=ox(s),f=u>t.length;a.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),_d=te("$ZodCheckStringFormat",(e,t)=>{var n,a;Pn.init(e,t),e._zod.onattach.push(s=>{const u=s._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=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),QP=te("$ZodCheckRegex",(e,t)=>{_d.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=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=FP),_d.init(e,t)}),eU=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qP),_d.init(e,t)}),tU=te("$ZodCheckIncludes",(e,t)=>{Pn.init(e,t);const n=Ws(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),nU=te("$ZodCheckStartsWith",(e,t)=>{Pn.init(e,t);const n=new RegExp(`^${Ws(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),rU=te("$ZodCheckEndsWith",(e,t)=>{Pn.init(e,t);const n=new RegExp(`.*${Ws(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),aU=te("$ZodCheckOverwrite",(e,t)=>{Pn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let iU=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
|
-
`).filter(l=>l),s=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,s.join(`
|
|
34
|
-
`))}};const sU={major:4,minor:3,patch:6},Nt=te("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sU;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const u of s._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 s=(l,f,h)=>{let m=Us(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,b=y._zod.check(l);if(b instanceof Promise&&h?.async===!1)throw new Ys;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,l.issues.length!==v&&(m||(m=Us(l,v)))});else{if(l.issues.length===v)continue;m||(m=Us(l,v))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Us(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Ys;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,f)):u(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Ys;return h.then(m=>s(m,a,f))}return s(h,a,f)}}nt(e,"~standard",()=>({validate:s=>{try{const u=fP(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return hP(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),cx=te("$ZodString",(e,t)=>{Nt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ZP(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}}),St=te("$ZodStringFormat",(e,t)=>{_d.init(e,t),cx.init(e,t)}),oU=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=EP),St.init(e,t)}),lU=te("$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=tw(a))}else t.pattern??(t.pattern=tw());St.init(e,t)}),uU=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=TP),St.init(e,t)}),cU=te("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),dU=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=OP()),St.init(e,t)}),fU=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=NP),St.init(e,t)}),hU=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=wP),St.init(e,t)}),mU=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=SP),St.init(e,t)}),pU=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=zP),St.init(e,t)}),gU=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_P),St.init(e,t)}),xU=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jP),St.init(e,t)}),yU=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=BP(t)),St.init(e,t)}),bU=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=UP),St.init(e,t)}),vU=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=VP(t)),St.init(e,t)}),kU=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=CP),St.init(e,t)}),wU=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=RP),St.init(e,t),e._zod.bag.format="ipv4"}),SU=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=DP),St.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})}}}),zU=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=MP),St.init(e,t)}),_U=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=$P),St.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,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://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Oj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jU=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=LP),St.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Oj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function NU(e){if(!_j.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Oj(n)}const CU=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_j),St.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{NU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),EU=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=PP),St.init(e,t)});function TU(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const AU=te("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=n=>{TU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Rj=te("$ZodNumber",(e,t)=>{Nt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Cj,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),n}}),OU=te("$ZodNumberFormat",(e,t)=>{YP.init(e,t),Rj.init(e,t)}),RU=te("$ZodBoolean",(e,t)=>{Nt.init(e,t),e._zod.pattern=HP,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),DU=te("$ZodUnknown",(e,t)=>{Nt.init(e,t),e._zod.parse=n=>n}),MU=te("$ZodNever",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nw(e,t,n){e.issues.length&&t.issues.push(...Vs(n,e.issues)),t.value[n]=e.value}const $U=te("$ZodArray",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const u=[];for(let l=0;l<s.length;l++){const f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?u.push(h.then(m=>nw(m,n,l))):nw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function rd(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Vs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Dj(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=tP(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Mj(e,t,n,a,s,u){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){l.push(y);continue}const v=h.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(b=>rd(b,n,y,t,g))):rd(v,n,y,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 LU=te("$ZodObject",(e,t)=>{if(Nt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=wd(()=>Dj(t));nt(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const y of g.values)h[m].add(y)}}return h});const s=Pl,u=t.catchall;let l;e._zod.parse=(f,h)=>{l??(l=a.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const g=[],y=l.shape;for(const v of l.keys){const b=y[v],S=b._zod.optout==="optional",N=b._zod.run({value:m[v],issues:[]},h);N instanceof Promise?g.push(N.then(T=>rd(T,f,v,m,S))):rd(N,f,v,m,S)}return u?Mj(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),PU=te("$ZodObjectJIT",(e,t)=>{LU.init(e,t);const n=e._zod.parse,a=wd(()=>Dj(t)),s=v=>{const b=new iU(["shape","payload","ctx"]),S=a.value,N=C=>{const P=ew(C);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};b.write("const input = payload.value;");const T=Object.create(null);let E=0;for(const C of S.keys)T[C]=`key_${E++}`;b.write("const newResult = {};");for(const C of S.keys){const P=T[C],M=ew(C),I=v[C]?._zod?.optout==="optional";b.write(`const ${P} = ${N(C)};`),I?b.write(`
|
|
35
|
-
if (${P}.issues.length) {
|
|
36
|
-
if (${M} in input) {
|
|
37
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
38
|
-
...iss,
|
|
39
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
40
|
-
})));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (${P}.value === undefined) {
|
|
45
|
-
if (${M} in input) {
|
|
46
|
-
newResult[${M}] = undefined;
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
newResult[${M}] = ${P}.value;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
`):b.write(`
|
|
53
|
-
if (${P}.issues.length) {
|
|
54
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
55
|
-
...iss,
|
|
56
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
57
|
-
})));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (${P}.value === undefined) {
|
|
61
|
-
if (${M} in input) {
|
|
62
|
-
newResult[${M}] = undefined;
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
newResult[${M}] = ${P}.value;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const O=b.compile();return(C,P)=>O(v,C,P)};let u;const l=Pl,f=!yj.jitless,m=f&&W9.value,g=t.catchall;let y;e._zod.parse=(v,b)=>{y??(y=a.value);const S=v.value;return l(S)?f&&m&&b?.async===!1&&b.jitless!==!0?(u||(u=s(t.shape)),v=u(v,b),g?Mj([],S,v,b,y,e):v):n(v,b):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function rw(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const s=e.filter(u=>!Us(u));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Ja(l,a,Xa())))}),t)}const $j=te("$ZodUnion",(e,t)=>{Nt.init(e,t),nt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),nt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),nt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),nt(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>sx(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,u)=>{if(n)return a(s,u);let l=!1;const f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)f.push(m),l=!0;else{if(m.issues.length===0)return m;f.push(m)}}return l?Promise.all(f).then(h=>rw(h,s,e,u)):rw(f,s,e,u)}}),UU=te("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$j.init(e,t);const n=e._zod.parse;nt(e._zod,"propValues",()=>{const s={};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[f,h]of Object.entries(l)){s[f]||(s[f]=new Set);for(const m of h)s[f].add(m)}}return s});const a=wd(()=>{const s=t.options,u=new Map;for(const l of s){const f=l._zod.propValues?.[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const h of f){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,l)}}return u});e._zod.parse=(s,u)=>{const l=s.value;if(!Pl(l))return s.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),s;const f=a.value.get(l?.[t.discriminator]);return f?f._zod.run(s,u):t.unionFallback?n(s,u):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),s)}}),VU=te("$ZodIntersection",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,u=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>aw(n,h,m)):aw(n,u,l)}});function Hp(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(Qs(e)&&Qs(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(const u of a){const l=Hp(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};s[u]=l.data}return{valid:!0,data:s}}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 s=e[a],u=t[a],l=Hp(s,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 aw(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const u=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(u.length&&s&&e.issues.push({...s,keys:u}),Us(e))return e;const l=Hp(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 BU=te("$ZodRecord",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Qs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const u=[],l=t.keyType._zod.values;if(l){n.value={};const f=new Set;for(const m of l)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const g=t.valueType._zod.run({value:s[m],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Vs(m,y.issues)),n.value[m]=y.value})):(g.issues.length&&n.issues.push(...Vs(m,g.issues)),n.value[m]=g.value)}let h;for(const m in s)f.has(m)||(h=h??[],h.push(m));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const f of Reflect.ownKeys(s)){if(f==="__proto__")continue;let h=t.keyType._zod.run({value:f,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Cj.test(f)&&h.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(h=y)}if(h.issues.length){t.mode==="loose"?n.value[f]=s[f]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>Ja(y,a,Xa())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:s[f],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Vs(f,y.issues)),n.value[h.value]=y.value})):(g.issues.length&&n.issues.push(...Vs(f,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),ZU=te("$ZodEnum",(e,t)=>{Nt.init(e,t);const n=bj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>eP.has(typeof s)).map(s=>typeof s=="string"?Ws(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),IU=te("$ZodLiteral",(e,t)=>{if(Nt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Ws(a):a?Ws(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),HU=te("$ZodTransform",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new xj(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(l=>(n.value=l,n));if(s instanceof Promise)throw new Ys;return n.value=s,n}});function iw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Lj=te("$ZodOptional",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",nt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),nt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>iw(u,n.value)):iw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),FU=te("$ZodExactOptional",(e,t)=>{Lj.init(e,t),nt(e._zod,"values",()=>t.innerType._zod.values),nt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),qU=te("$ZodNullable",(e,t)=>{Nt.init(e,t),nt(e._zod,"optin",()=>t.innerType._zod.optin),nt(e._zod,"optout",()=>t.innerType._zod.optout),nt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)}|null)$`):void 0}),nt(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=te("$ZodDefault",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",nt(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>sw(u,t)):sw(s,t)}});function sw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const YU=te("$ZodPrefault",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",nt(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))}),KU=te("$ZodNonOptional",(e,t)=>{Nt.init(e,t),nt(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>ow(u,e)):ow(s,e)}});function ow(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 XU=te("$ZodCatch",(e,t)=>{Nt.init(e,t),nt(e._zod,"optin",()=>t.innerType._zod.optin),nt(e._zod,"optout",()=>t.innerType._zod.optout),nt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Ja(l,a,Xa()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Ja(u,a,Xa()))},input:n.value}),n.issues=[]),n)}}),JU=te("$ZodPipe",(e,t)=>{Nt.init(e,t),nt(e._zod,"values",()=>t.in._zod.values),nt(e._zod,"optin",()=>t.in._zod.optin),nt(e._zod,"optout",()=>t.out._zod.optout),nt(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=>Cc(l,t.in,a)):Cc(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>Cc(u,t.out,a)):Cc(s,t.out,a)}});function Cc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const QU=te("$ZodReadonly",(e,t)=>{Nt.init(e,t),nt(e._zod,"propValues",()=>t.innerType._zod.propValues),nt(e._zod,"values",()=>t.innerType._zod.values),nt(e._zod,"optin",()=>t.innerType?._zod?.optin),nt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(lw):lw(s)}});function lw(e){return e.value=Object.freeze(e.value),e}const WU=te("$ZodCustom",(e,t)=>{Pn.init(e,t),Nt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(u=>uw(u,n,a,e));uw(s,n,a,e)}});function uw(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Ul(s))}}var cw;let e8=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 s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function t8(){return new e8}(cw=globalThis).__zod_globalRegistry??(cw.__zod_globalRegistry=t8());const yl=globalThis.__zod_globalRegistry;function n8(e,t){return new e({type:"string",...ze(t)})}function r8(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function dw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function a8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function i8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function s8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function o8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function l8(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function u8(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function c8(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function d8(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function f8(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function h8(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function m8(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function p8(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function g8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function x8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function y8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function b8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function v8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function k8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function w8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function S8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function z8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function _8(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function j8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function N8(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function C8(e,t){return new e({type:"number",checks:[],...ze(t)})}function E8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function T8(e,t){return new e({type:"boolean",...ze(t)})}function A8(e){return new e({type:"unknown"})}function O8(e,t){return new e({type:"never",...ze(t)})}function fw(e,t){return new Tj({check:"less_than",...ze(t),value:e,inclusive:!1})}function Lm(e,t){return new Tj({check:"less_than",...ze(t),value:e,inclusive:!0})}function hw(e,t){return new Aj({check:"greater_than",...ze(t),value:e,inclusive:!1})}function Pm(e,t){return new Aj({check:"greater_than",...ze(t),value:e,inclusive:!0})}function mw(e,t){return new GP({check:"multiple_of",...ze(t),value:e})}function Pj(e,t){return new KP({check:"max_length",...ze(t),maximum:e})}function ad(e,t){return new XP({check:"min_length",...ze(t),minimum:e})}function Uj(e,t){return new JP({check:"length_equals",...ze(t),length:e})}function R8(e,t){return new QP({check:"string_format",format:"regex",...ze(t),pattern:e})}function D8(e){return new WP({check:"string_format",format:"lowercase",...ze(e)})}function M8(e){return new eU({check:"string_format",format:"uppercase",...ze(e)})}function $8(e,t){return new tU({check:"string_format",format:"includes",...ze(t),includes:e})}function L8(e,t){return new nU({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function P8(e,t){return new rU({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function fo(e){return new aU({check:"overwrite",tx:e})}function U8(e){return fo(t=>t.normalize(e))}function V8(){return fo(e=>e.trim())}function B8(){return fo(e=>e.toLowerCase())}function Z8(){return fo(e=>e.toUpperCase())}function I8(){return fo(e=>Q9(e))}function H8(e,t,n){return new e({type:"array",element:t,...ze(n)})}function F8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function q8(e){const t=G8(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Ul(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Ul(s))}},e(n.value,n)));return t}function G8(e,t){const n=new Pn({check:"custom",...ze(t)});return n._zod.check=e,n}function Vj(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??yl,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 Ht(e,t,n={path:[],schemaPath:[]}){var a;const s=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 f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const v=l.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,v,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),Ht(y,t,g),t.seen.get(y).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&vn(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 Bj(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 f=e.metadataRegistry.get(l[0])?.id;if(f){const h=a.get(f);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,l[0])}}const s=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(y)return{ref:v(y)};const b=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(l[1]===n)return{ref:"#"};const m=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:h,defId:m}=s(l);f.def={...f.schema},m&&(f.defId=m);const g=f.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
69
|
-
|
|
70
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=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(f.cycle){u(l);continue}if(f.count>1&&e.reused==="ref"){u(l);continue}}}function Zj(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 f=e.seen.get(l);if(f.ref===null)return;const h=f.def??f.schema,m={...h},g=f.ref;if(f.ref=null,g){a(g);const v=e.seen.get(g),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(b)):Object.assign(h,b),Object.assign(h,m),l._zod.parent===g)for(const N in h)N==="$ref"||N==="allOf"||N in m||delete h[N];if(b.$ref&&v.def)for(const N in h)N==="$ref"||N==="allOf"||N in v.def&&JSON.stringify(h[N])===JSON.stringify(v.def[N])&&delete h[N]}const y=l._zod.parent;if(y&&y!==g){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(h.$ref=v.schema.$ref,v.def))for(const b in h)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(h[b])===JSON.stringify(v.def[b])&&delete h[b]}e.override({zodSchema:l,jsonSchema:h,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$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");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(u[f.defId]=f.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:id(t,"input",e.processors),output:id(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function vn(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 vn(a.element,n);if(a.type==="set")return vn(a.valueType,n);if(a.type==="lazy")return vn(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 vn(a.innerType,n);if(a.type==="intersection")return vn(a.left,n)||vn(a.right,n);if(a.type==="record"||a.type==="map")return vn(a.keyType,n)||vn(a.valueType,n);if(a.type==="pipe")return vn(a.in,n)||vn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(vn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(vn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(vn(s,n))return!0;return!!(a.rest&&vn(a.rest,n))}return!1}const Y8=(e,t={})=>n=>{const a=Vj({...n,processors:t});return Ht(e,a),Bj(a,e),Zj(a,e)},id=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=Vj({...s??{},target:u,io:t,processors:n});return Ht(e,l),Bj(l,e),Zj(l,e)},K8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X8=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),f&&(s.format=K8[f]??f,s.format===""&&delete s.format,f==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},J8=(e,t,n,a)=>{const s=n,{minimum:u,maximum:l,format:f,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?s.type="integer":s.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g),typeof u=="number"&&(s.minimum=u,typeof g=="number"&&t.target!=="draft-04"&&(g>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof l=="number"&&(s.maximum=l,typeof m=="number"&&t.target!=="draft-04"&&(m<=l?delete s.maximum:delete s.exclusiveMaximum)),typeof h=="number"&&(s.multipleOf=h)},Q8=(e,t,n,a)=>{n.type="boolean"},W8=(e,t,n,a)=>{n.not={}},eV=(e,t,n,a)=>{},tV=(e,t,n,a)=>{const s=e._zod.def,u=bj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},nV=(e,t,n,a)=>{const s=e._zod.def,u=[];for(const l of s.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},rV=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},aV=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iV=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=Ht(u.element,t,{...a,path:[...a.path,"items"]})},sV=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object",s.properties={};const l=u.shape;for(const m in l)s.properties[m]=Ht(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Ht(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},oV=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((f,h)=>Ht(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},lV=(e,t,n,a)=>{const s=e._zod.def,u=Ht(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=Ht(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(u)?u.allOf:[u],...f(l)?l.allOf:[l]];n.allOf=h},uV=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object";const l=u.keyType,h=l._zod.bag?.patterns;if(u.mode==="loose"&&h&&h.size>0){const g=Ht(u.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const y of h)s.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ht(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Ht(u.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=l._zod.values;if(m){const g=[...m].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(s.required=g)}},cV=(e,t,n,a)=>{const s=e._zod.def,u=Ht(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},dV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},fV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},hV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},mV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType;let l;try{l=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},pV=(e,t,n,a)=>{const s=e._zod.def,u=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ht(u,t,a);const l=t.seen.get(e);l.ref=u},gV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},Ij=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},xV=te("ZodISODateTime",(e,t)=>{yU.init(e,t),Et.init(e,t)});function yV(e){return z8(xV,e)}const bV=te("ZodISODate",(e,t)=>{bU.init(e,t),Et.init(e,t)});function vV(e){return _8(bV,e)}const kV=te("ZodISOTime",(e,t)=>{vU.init(e,t),Et.init(e,t)});function wV(e){return j8(kV,e)}const SV=te("ZodISODuration",(e,t)=>{kU.init(e,t),Et.init(e,t)});function zV(e){return N8(SV,e)}const _V=(e,t)=>{Sj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>dP(e,n)},flatten:{value:n=>cP(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ip,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ip,2)}},isEmpty:{get(){return e.issues.length===0}}})},gr=te("ZodError",_V,{Parent:Error}),jV=lx(gr),NV=ux(gr),CV=Sd(gr),EV=zd(gr),TV=mP(gr),AV=pP(gr),OV=gP(gr),RV=xP(gr),DV=yP(gr),MV=bP(gr),$V=vP(gr),LV=kP(gr),Ct=te("ZodType",(e,t)=>(Nt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:id(e,"input"),output:id(e,"output")}}),e.toJSONSchema=Y8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ei(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)=>ti(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>jV(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>CV(e,n,a),e.parseAsync=async(n,a)=>NV(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>EV(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>TV(e,n,a),e.decode=(n,a)=>AV(e,n,a),e.encodeAsync=async(n,a)=>OV(e,n,a),e.decodeAsync=async(n,a)=>RV(e,n,a),e.safeEncode=(n,a)=>DV(e,n,a),e.safeDecode=(n,a)=>MV(e,n,a),e.safeEncodeAsync=async(n,a)=>$V(e,n,a),e.safeDecodeAsync=async(n,a)=>LV(e,n,a),e.refine=(n,a)=>e.check(AB(n,a)),e.superRefine=n=>e.check(OB(n)),e.overwrite=n=>e.check(fo(n)),e.optional=()=>bw(e),e.exactOptional=()=>yB(e),e.nullable=()=>vw(e),e.nullish=()=>bw(vw(e)),e.nonoptional=n=>zB(e,n),e.array=()=>Oi(e),e.or=n=>Gj([e,n]),e.and=n=>fB(e,n),e.transform=n=>kw(e,gB(n)),e.default=n=>kB(e,n),e.prefault=n=>SB(e,n),e.catch=n=>jB(e,n),e.pipe=n=>kw(e,n),e.readonly=()=>EB(e),e.describe=n=>{const a=e.clone();return yl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return yl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return yl.get(e);const a=e.clone();return yl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Hj=te("_ZodString",(e,t)=>{cx.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(a,s,u)=>X8(e,a,s);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(R8(...a)),e.includes=(...a)=>e.check($8(...a)),e.startsWith=(...a)=>e.check(L8(...a)),e.endsWith=(...a)=>e.check(P8(...a)),e.min=(...a)=>e.check(ad(...a)),e.max=(...a)=>e.check(Pj(...a)),e.length=(...a)=>e.check(Uj(...a)),e.nonempty=(...a)=>e.check(ad(1,...a)),e.lowercase=a=>e.check(D8(a)),e.uppercase=a=>e.check(M8(a)),e.trim=()=>e.check(V8()),e.normalize=(...a)=>e.check(U8(...a)),e.toLowerCase=()=>e.check(B8()),e.toUpperCase=()=>e.check(Z8()),e.slugify=()=>e.check(I8())}),PV=te("ZodString",(e,t)=>{cx.init(e,t),Hj.init(e,t),e.email=n=>e.check(r8(UV,n)),e.url=n=>e.check(l8(VV,n)),e.jwt=n=>e.check(S8(tB,n)),e.emoji=n=>e.check(u8(BV,n)),e.guid=n=>e.check(dw(pw,n)),e.uuid=n=>e.check(a8(Ec,n)),e.uuidv4=n=>e.check(i8(Ec,n)),e.uuidv6=n=>e.check(s8(Ec,n)),e.uuidv7=n=>e.check(o8(Ec,n)),e.nanoid=n=>e.check(c8(ZV,n)),e.guid=n=>e.check(dw(pw,n)),e.cuid=n=>e.check(d8(IV,n)),e.cuid2=n=>e.check(f8(HV,n)),e.ulid=n=>e.check(h8(FV,n)),e.base64=n=>e.check(v8(QV,n)),e.base64url=n=>e.check(k8(WV,n)),e.xid=n=>e.check(m8(qV,n)),e.ksuid=n=>e.check(p8(GV,n)),e.ipv4=n=>e.check(g8(YV,n)),e.ipv6=n=>e.check(x8(KV,n)),e.cidrv4=n=>e.check(y8(XV,n)),e.cidrv6=n=>e.check(b8(JV,n)),e.e164=n=>e.check(w8(eB,n)),e.datetime=n=>e.check(yV(n)),e.date=n=>e.check(vV(n)),e.time=n=>e.check(wV(n)),e.duration=n=>e.check(zV(n))});function Ge(e){return n8(PV,e)}const Et=te("ZodStringFormat",(e,t)=>{St.init(e,t),Hj.init(e,t)}),UV=te("ZodEmail",(e,t)=>{uU.init(e,t),Et.init(e,t)}),pw=te("ZodGUID",(e,t)=>{oU.init(e,t),Et.init(e,t)}),Ec=te("ZodUUID",(e,t)=>{lU.init(e,t),Et.init(e,t)}),VV=te("ZodURL",(e,t)=>{cU.init(e,t),Et.init(e,t)}),BV=te("ZodEmoji",(e,t)=>{dU.init(e,t),Et.init(e,t)}),ZV=te("ZodNanoID",(e,t)=>{fU.init(e,t),Et.init(e,t)}),IV=te("ZodCUID",(e,t)=>{hU.init(e,t),Et.init(e,t)}),HV=te("ZodCUID2",(e,t)=>{mU.init(e,t),Et.init(e,t)}),FV=te("ZodULID",(e,t)=>{pU.init(e,t),Et.init(e,t)}),qV=te("ZodXID",(e,t)=>{gU.init(e,t),Et.init(e,t)}),GV=te("ZodKSUID",(e,t)=>{xU.init(e,t),Et.init(e,t)}),YV=te("ZodIPv4",(e,t)=>{wU.init(e,t),Et.init(e,t)}),KV=te("ZodIPv6",(e,t)=>{SU.init(e,t),Et.init(e,t)}),XV=te("ZodCIDRv4",(e,t)=>{zU.init(e,t),Et.init(e,t)}),JV=te("ZodCIDRv6",(e,t)=>{_U.init(e,t),Et.init(e,t)}),QV=te("ZodBase64",(e,t)=>{jU.init(e,t),Et.init(e,t)}),WV=te("ZodBase64URL",(e,t)=>{CU.init(e,t),Et.init(e,t)}),eB=te("ZodE164",(e,t)=>{EU.init(e,t),Et.init(e,t)}),tB=te("ZodJWT",(e,t)=>{AU.init(e,t),Et.init(e,t)}),Fj=te("ZodNumber",(e,t)=>{Rj.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(a,s,u)=>J8(e,a,s),e.gt=(a,s)=>e.check(hw(a,s)),e.gte=(a,s)=>e.check(Pm(a,s)),e.min=(a,s)=>e.check(Pm(a,s)),e.lt=(a,s)=>e.check(fw(a,s)),e.lte=(a,s)=>e.check(Lm(a,s)),e.max=(a,s)=>e.check(Lm(a,s)),e.int=a=>e.check(gw(a)),e.safe=a=>e.check(gw(a)),e.positive=a=>e.check(hw(0,a)),e.nonnegative=a=>e.check(Pm(0,a)),e.negative=a=>e.check(fw(0,a)),e.nonpositive=a=>e.check(Lm(0,a)),e.multipleOf=(a,s)=>e.check(mw(a,s)),e.step=(a,s)=>e.check(mw(a,s)),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 _r(e){return C8(Fj,e)}const nB=te("ZodNumberFormat",(e,t)=>{OU.init(e,t),Fj.init(e,t)});function gw(e){return E8(nB,e)}const rB=te("ZodBoolean",(e,t)=>{RU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Q8(e,n,a)});function Mn(e){return T8(rB,e)}const aB=te("ZodUnknown",(e,t)=>{DU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eV()});function xw(){return A8(aB)}const iB=te("ZodNever",(e,t)=>{MU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>W8(e,n,a)});function sB(e){return O8(iB,e)}const oB=te("ZodArray",(e,t)=>{$U.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>iV(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(ad(n,a)),e.nonempty=n=>e.check(ad(1,n)),e.max=(n,a)=>e.check(Pj(n,a)),e.length=(n,a)=>e.check(Uj(n,a)),e.unwrap=()=>e.element});function Oi(e,t){return H8(oB,e,t)}const lB=te("ZodObject",(e,t)=>{PU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sV(e,n,a,s),nt(e,"shape",()=>t.shape),e.keyof=()=>Li(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xw()}),e.loose=()=>e.clone({...e._zod.def,catchall:xw()}),e.strict=()=>e.clone({...e._zod.def,catchall:sB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>iP(e,n),e.safeExtend=n=>sP(e,n),e.merge=n=>oP(e,n),e.pick=n=>rP(e,n),e.omit=n=>aP(e,n),e.partial=(...n)=>lP(Yj,e,n[0]),e.required=(...n)=>uP(Kj,e,n[0])});function un(e,t){const n={type:"object",shape:e??{},...ze(t)};return new lB(n)}const qj=te("ZodUnion",(e,t)=>{$j.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oV(e,n,a,s),e.options=t.options});function Gj(e,t){return new qj({type:"union",options:e,...ze(t)})}const uB=te("ZodDiscriminatedUnion",(e,t)=>{qj.init(e,t),UU.init(e,t)});function cB(e,t,n){return new uB({type:"union",options:t,discriminator:e,...ze(n)})}const dB=te("ZodIntersection",(e,t)=>{VU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lV(e,n,a,s)});function fB(e,t){return new dB({type:"intersection",left:e,right:t})}const hB=te("ZodRecord",(e,t)=>{BU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uV(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function Ic(e,t,n){return new hB({type:"record",keyType:e,valueType:t,...ze(n)})}const Fp=te("ZodEnum",(e,t)=>{ZU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(a,s,u)=>tV(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{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 Fp({...t,checks:[],...ze(s),entries:u})},e.exclude=(a,s)=>{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 Fp({...t,checks:[],...ze(s),entries:u})}});function Li(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Fp({type:"enum",entries:n,...ze(t)})}const mB=te("ZodLiteral",(e,t)=>{IU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nV(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 yw(e,t){return new mB({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const pB=te("ZodTransform",(e,t)=>{HU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>aV(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new xj(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Ul(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(Ul(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function gB(e){return new pB({type:"transform",transform:e})}const Yj=te("ZodOptional",(e,t)=>{Lj.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Ij(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new Yj({type:"optional",innerType:e})}const xB=te("ZodExactOptional",(e,t)=>{FU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Ij(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yB(e){return new xB({type:"optional",innerType:e})}const bB=te("ZodNullable",(e,t)=>{qU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function vw(e){return new bB({type:"nullable",innerType:e})}const vB=te("ZodDefault",(e,t)=>{GU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kB(e,t){return new vB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kj(t)}})}const wB=te("ZodPrefault",(e,t)=>{YU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function SB(e,t){return new wB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kj(t)}})}const Kj=te("ZodNonOptional",(e,t)=>{KU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function zB(e,t){return new Kj({type:"nonoptional",innerType:e,...ze(t)})}const _B=te("ZodCatch",(e,t)=>{XU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jB(e,t){return new _B({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const NB=te("ZodPipe",(e,t)=>{JU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pV(e,n,a,s),e.in=t.in,e.out=t.out});function kw(e,t){return new NB({type:"pipe",in:e,out:t})}const CB=te("ZodReadonly",(e,t)=>{QU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function EB(e){return new CB({type:"readonly",innerType:e})}const TB=te("ZodCustom",(e,t)=>{WU.init(e,t),Ct.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rV(e,n)});function AB(e,t={}){return F8(TB,e,t)}function OB(e){return q8(e)}const ft={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,allowedUsers:[]}},ui:{enabled:!0,port:3333}},RB=un({provider:Li(["google","openai","openrouter","ollama"]).default(ft.audio.provider),model:Ge().min(1).default(ft.audio.model),enabled:Mn().default(ft.audio.enabled),apiKey:Ge().optional(),base_url:Ge().optional(),maxDurationSeconds:_r().default(ft.audio.maxDurationSeconds),supportedMimeTypes:Oi(Ge()).default(ft.audio.supportedMimeTypes)}),ho=un({provider:Li(["openai","anthropic","openrouter","ollama","gemini"]).default(ft.llm.provider),model:Ge().min(1).default(ft.llm.model),temperature:_r().min(0).max(1).default(ft.llm.temperature),max_tokens:_r().int().positive().optional(),api_key:Ge().optional(),base_url:Ge().optional(),context_window:_r().int().positive().optional()}),DB=ho.extend({memory_limit:_r().int().positive().optional(),enabled_archived_sessions:Mn().default(!0)}),MB=ho.extend({working_dir:Ge().optional(),timeout_ms:_r().int().positive().optional(),execution_mode:Li(["sync","async"]).default("async")}),$B=ho.extend({execution_mode:Li(["sync","async"]).default("async")}),LB=ho.extend({execution_mode:Li(["sync","async"]).default("async")}),PB=ho.extend({skills_dir:Ge().optional()}),UB=un({telegram_notify_all:Mn().optional()}).optional(),VB=un({timezone:Ge().default("UTC"),check_interval_ms:_r().min(6e4).default(6e4),max_active_jobs:_r().min(1).max(1e3).default(100)}),BB=un({sandbox_dir:Ge().optional(),readonly_mode:Mn().default(!1),allowed_shell_commands:Oi(Ge()).default([]),enable_filesystem:Mn().default(!0),enable_shell:Mn().default(!0),enable_git:Mn().default(!0),enable_network:Mn().default(!0),timeout_ms:_r().int().positive().default(3e4)}),ZB=un({agent:un({name:Ge().default(ft.agent.name),personality:Ge().default(ft.agent.personality)}).default(ft.agent),llm:ho.default(ft.llm),sati:DB.optional(),neo:$B.optional(),apoc:MB.optional(),trinity:LB.optional(),keymaker:PB.optional(),webhooks:UB,audio:RB.default(ft.audio),memory:un({limit:_r().int().positive().optional()}).default(ft.memory),runtime:un({async_tasks:un({enabled:Mn().default(ft.runtime?.async_tasks.enabled)}).default(ft.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:VB.optional(),devkit:BB.optional(),verbose_mode:Mn().default(!0),channels:un({telegram:un({enabled:Mn().default(!1),token:Ge().optional(),allowedUsers:Oi(Ge()).default([])}).default(ft.channels.telegram),discord:un({enabled:Mn().default(!1),token:Ge().optional(),allowedUsers:Oi(Ge()).default([])}).default(ft.channels.discord)}).default(ft.channels),ui:un({enabled:Mn().default(ft.ui.enabled),port:_r().default(ft.ui.port)}).default(ft.ui),logging:un({enabled:Mn().default(ft.logging.enabled),level:Li(["debug","info","warn","error"]).default(ft.logging.level),retention:Ge().default(ft.logging.retention)}).default(ft.logging)}),IB=cB("transport",[un({transport:yw("stdio"),command:Ge().min(1,"Command is required for stdio transport"),args:Oi(Ge()).optional().default([]),env:Ic(Ge(),Ge()).optional().default({}),_comment:Ge().optional()}),un({transport:yw("http"),url:Ge().url("Valid URL is required for http transport"),headers:Ic(Ge(),Ge()).optional().default({}),args:Oi(Ge()).optional().default([]),env:Ic(Ge(),Ge()).optional().default({}),_comment:Ge().optional()})]);Ic(Ge(),Gj([IB,Ge()]));function ie(e,t,n){function a(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const v=g[y];v in f||(f[v]=m[v].bind(f))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(f){var h;const m=n?.Parent?new u:this;a(m,f),(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:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Ks extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jj={};function Ri(e){return Jj}function Qj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function qp(e,t){return typeof t=="bigint"?t.toString():t}function dx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fx(e){return e==null}function hx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const ww=Symbol("evaluating");function it(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==ww)return a===void 0&&(a=ww,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Pi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ni(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Sw(e){return JSON.stringify(e)}function HB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const FB=dx(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Vl(e){if(sd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(sd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function e2(e){return Vl(e)?{...e}:Array.isArray(e)?[...e]:e}const qB=new Set(["string","number","symbol"]);function eo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ri(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Te(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 GB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function YB(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=ni(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return Pi(this,"shape",l),l},checks:[]});return ri(e,u)}function KB(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=ni(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return Pi(this,"shape",l),l},checks:[]});return ri(e,u)}function XB(e,t){if(!Vl(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 s=ni(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Pi(this,"shape",u),u}});return ri(e,s)}function JB(e,t){if(!Vl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ni(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Pi(this,"shape",a),a}});return ri(e,n)}function QB(e,t){const n=ni(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Pi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ri(e,n)}function WB(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=ni(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(n)for(const m in n){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)h[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Pi(this,"shape",h),h},checks:[]});return ri(t,l)}function eZ(e,t,n){const a=ni(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};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:s[l]}))}else for(const l in s)u[l]=new e({type:"nonoptional",innerType:s[l]});return Pi(this,"shape",u),u}});return ri(t,a)}function Bs(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 t2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Tc(e){return typeof e=="string"?e:e?.message}function Di(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Tc(e.inst?._zod.def?.error?.(e))??Tc(t?.error?.(e))??Tc(n.customError?.(e))??Tc(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function mx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Bl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const n2=(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,qp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},r2=ie("$ZodError",n2),a2=ie("$ZodError",n2,{Parent:Error});function tZ(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function nZ(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const u of s.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,f=0;for(;f<u.path.length;){const h=u.path[f];f===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const px=e=>(t,n,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Ks;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Di(h,u,Ri())));throw Wj(f,s?.callee),f}return l.value},gx=e=>async(t,n,a,s)=>{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 f=new(s?.Err??e)(l.issues.map(h=>Di(h,u,Ri())));throw Wj(f,s?.callee),f}return l.value},jd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new Ks;return u.issues.length?{success:!1,error:new(e??r2)(u.issues.map(l=>Di(l,s,Ri())))}:{success:!0,data:u.value}},rZ=jd(a2),Nd=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Di(l,s,Ri())))}:{success:!0,data:u.value}},aZ=Nd(a2),iZ=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return px(e)(t,n,s)},sZ=e=>(t,n,a)=>px(e)(t,n,a),oZ=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return gx(e)(t,n,s)},lZ=e=>async(t,n,a)=>gx(e)(t,n,a),uZ=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jd(e)(t,n,s)},cZ=e=>(t,n,a)=>jd(e)(t,n,a),dZ=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Nd(e)(t,n,s)},fZ=e=>async(t,n,a)=>Nd(e)(t,n,a),hZ=/^[cC][^\s-]{8,}$/,mZ=/^[0-9a-z]+$/,pZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gZ=/^[0-9a-vA-V]{20}$/,xZ=/^[A-Za-z0-9]{27}$/,yZ=/^[a-zA-Z0-9_-]{21}$/,bZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vZ=/^([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})$/,zw=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)$/,kZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function SZ(){return new RegExp(wZ,"u")}const zZ=/^(?:(?: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])$/,_Z=/^(([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}|:))$/,jZ=/^((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])$/,NZ=/^(([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])$/,CZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,i2=/^[A-Za-z0-9_-]*$/,EZ=/^\+[1-9]\d{6,14}$/,s2="(?:(?:\\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])))",TZ=new RegExp(`^${s2}$`);function o2(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 AZ(e){return new RegExp(`^${o2(e)}$`)}function OZ(e){const t=o2({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(`^${s2}T(?:${a})$`)}const RZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},DZ=/^[^A-Z]*$/,MZ=/^[^a-z]*$/,Vr=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$Z=ie("$ZodCheckMaxLength",(e,t)=>{var n;Vr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!fx(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const l=mx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),LZ=ie("$ZodCheckMinLength",(e,t)=>{var n;Vr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!fx(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const l=mx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),PZ=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Vr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!fx(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===t.length)return;const l=mx(s),f=u>t.length;a.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Cd=ie("$ZodCheckStringFormat",(e,t)=>{var n,a;Vr.init(e,t),e._zod.onattach.push(s=>{const u=s._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=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),UZ=ie("$ZodCheckRegex",(e,t)=>{Cd.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})}}),VZ=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=DZ),Cd.init(e,t)}),BZ=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=MZ),Cd.init(e,t)}),ZZ=ie("$ZodCheckIncludes",(e,t)=>{Vr.init(e,t);const n=eo(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),IZ=ie("$ZodCheckStartsWith",(e,t)=>{Vr.init(e,t);const n=new RegExp(`^${eo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),HZ=ie("$ZodCheckEndsWith",(e,t)=>{Vr.init(e,t);const n=new RegExp(`.*${eo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),FZ=ie("$ZodCheckOverwrite",(e,t)=>{Vr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class qZ{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
|
-
`).filter(l=>l),s=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,s.join(`
|
|
72
|
-
`))}}const GZ={major:4,minor:3,patch:6},Ft=ie("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=GZ;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const u of s._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 s=(l,f,h)=>{let m=Bs(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,b=y._zod.check(l);if(b instanceof Promise&&h?.async===!1)throw new Ks;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,l.issues.length!==v&&(m||(m=Bs(l,v)))});else{if(l.issues.length===v)continue;m||(m=Bs(l,v))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Bs(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Ks;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,f)):u(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Ks;return h.then(m=>s(m,a,f))}return s(h,a,f)}}it(e,"~standard",()=>({validate:s=>{try{const u=rZ(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return aZ(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),xx=ie("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??RZ(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}}),zt=ie("$ZodStringFormat",(e,t)=>{Cd.init(e,t),xx.init(e,t)}),YZ=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vZ),zt.init(e,t)}),KZ=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=zw(a))}else t.pattern??(t.pattern=zw());zt.init(e,t)}),XZ=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=kZ),zt.init(e,t)}),JZ=ie("$ZodURL",(e,t)=>{zt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),QZ=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=SZ()),zt.init(e,t)}),WZ=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yZ),zt.init(e,t)}),eI=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=hZ),zt.init(e,t)}),tI=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mZ),zt.init(e,t)}),nI=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=pZ),zt.init(e,t)}),rI=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=gZ),zt.init(e,t)}),aI=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xZ),zt.init(e,t)}),iI=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=OZ(t)),zt.init(e,t)}),sI=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=TZ),zt.init(e,t)}),oI=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=AZ(t)),zt.init(e,t)}),lI=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bZ),zt.init(e,t)}),uI=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=zZ),zt.init(e,t),e._zod.bag.format="ipv4"}),cI=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=_Z),zt.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})}}}),dI=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=jZ),zt.init(e,t)}),fI=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=NZ),zt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,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://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function l2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const hI=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=CZ),zt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{l2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function mI(e){if(!i2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return l2(n)}const pI=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=i2),zt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{mI(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),gI=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=EZ),zt.init(e,t)});function xI(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const yI=ie("$ZodJWT",(e,t)=>{zt.init(e,t),e._zod.check=n=>{xI(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),bI=ie("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),vI=ie("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _w(e,t,n){e.issues.length&&t.issues.push(...t2(n,e.issues)),t.value[n]=e.value}const kI=ie("$ZodArray",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const u=[];for(let l=0;l<s.length;l++){const f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?u.push(h.then(m=>_w(m,n,l))):_w(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function od(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...t2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function u2(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=GB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function c2(e,t,n,a,s,u){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){l.push(y);continue}const v=h.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(b=>od(b,n,y,t,g))):od(v,n,y,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 wI=ie("$ZodObject",(e,t)=>{if(Ft.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=dx(()=>u2(t));it(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const y of g.values)h[m].add(y)}}return h});const s=sd,u=t.catchall;let l;e._zod.parse=(f,h)=>{l??(l=a.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const g=[],y=l.shape;for(const v of l.keys){const b=y[v],S=b._zod.optout==="optional",N=b._zod.run({value:m[v],issues:[]},h);N instanceof Promise?g.push(N.then(T=>od(T,f,v,m,S))):od(N,f,v,m,S)}return u?c2(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),SI=ie("$ZodObjectJIT",(e,t)=>{wI.init(e,t);const n=e._zod.parse,a=dx(()=>u2(t)),s=v=>{const b=new qZ(["shape","payload","ctx"]),S=a.value,N=C=>{const P=Sw(C);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};b.write("const input = payload.value;");const T=Object.create(null);let E=0;for(const C of S.keys)T[C]=`key_${E++}`;b.write("const newResult = {};");for(const C of S.keys){const P=T[C],M=Sw(C),I=v[C]?._zod?.optout==="optional";b.write(`const ${P} = ${N(C)};`),I?b.write(`
|
|
73
|
-
if (${P}.issues.length) {
|
|
74
|
-
if (${M} in input) {
|
|
75
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
76
|
-
...iss,
|
|
77
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
78
|
-
})));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (${P}.value === undefined) {
|
|
83
|
-
if (${M} in input) {
|
|
84
|
-
newResult[${M}] = undefined;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
newResult[${M}] = ${P}.value;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
`):b.write(`
|
|
91
|
-
if (${P}.issues.length) {
|
|
92
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
93
|
-
...iss,
|
|
94
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
95
|
-
})));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (${P}.value === undefined) {
|
|
99
|
-
if (${M} in input) {
|
|
100
|
-
newResult[${M}] = undefined;
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
newResult[${M}] = ${P}.value;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const O=b.compile();return(C,P)=>O(v,C,P)};let u;const l=sd,f=!Jj.jitless,m=f&&FB.value,g=t.catchall;let y;e._zod.parse=(v,b)=>{y??(y=a.value);const S=v.value;return l(S)?f&&m&&b?.async===!1&&b.jitless!==!0?(u||(u=s(t.shape)),v=u(v,b),g?c2([],S,v,b,y,e):v):n(v,b):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function jw(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const s=e.filter(u=>!Bs(u));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Di(l,a,Ri())))}),t)}const zI=ie("$ZodUnion",(e,t)=>{Ft.init(e,t),it(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),it(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),it(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),it(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>hx(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,u)=>{if(n)return a(s,u);let l=!1;const f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)f.push(m),l=!0;else{if(m.issues.length===0)return m;f.push(m)}}return l?Promise.all(f).then(h=>jw(h,s,e,u)):jw(f,s,e,u)}}),_I=ie("$ZodIntersection",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,u=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>Nw(n,h,m)):Nw(n,u,l)}});function Gp(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(Vl(e)&&Vl(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(const u of a){const l=Gp(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};s[u]=l.data}return{valid:!0,data:s}}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 s=e[a],u=t[a],l=Gp(s,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 Nw(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const u=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(u.length&&s&&e.issues.push({...s,keys:u}),Bs(e))return e;const l=Gp(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 jI=ie("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=Qj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>qB.has(typeof s)).map(s=>typeof s=="string"?eo(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),NI=ie("$ZodLiteral",(e,t)=>{if(Ft.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"?eo(a):a?eo(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),CI=ie("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Xj(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(l=>(n.value=l,n));if(s instanceof Promise)throw new Ks;return n.value=s,n}});function Cw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const d2=ie("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),it(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hx(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Cw(u,n.value)):Cw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),EI=ie("$ZodExactOptional",(e,t)=>{d2.init(e,t),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),TI=ie("$ZodNullable",(e,t)=>{Ft.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hx(n.source)}|null)$`):void 0}),it(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)}),AI=ie("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",it(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Ew(u,t)):Ew(s,t)}});function Ew(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const OI=ie("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",it(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))}),RI=ie("$ZodNonOptional",(e,t)=>{Ft.init(e,t),it(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Tw(u,e)):Tw(s,e)}});function Tw(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 DI=ie("$ZodCatch",(e,t)=>{Ft.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Di(l,a,Ri()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Di(u,a,Ri()))},input:n.value}),n.issues=[]),n)}}),MI=ie("$ZodPipe",(e,t)=>{Ft.init(e,t),it(e._zod,"values",()=>t.in._zod.values),it(e._zod,"optin",()=>t.in._zod.optin),it(e._zod,"optout",()=>t.out._zod.optout),it(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=>Ac(l,t.in,a)):Ac(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>Ac(u,t.out,a)):Ac(s,t.out,a)}});function Ac(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const $I=ie("$ZodReadonly",(e,t)=>{Ft.init(e,t),it(e._zod,"propValues",()=>t.innerType._zod.propValues),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"optin",()=>t.innerType?._zod?.optin),it(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(Aw):Aw(s)}});function Aw(e){return e.value=Object.freeze(e.value),e}const LI=ie("$ZodCustom",(e,t)=>{Vr.init(e,t),Ft.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(u=>Ow(u,n,a,e));Ow(s,n,a,e)}});function Ow(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Bl(s))}}var Rw;class PI{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 s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function UI(){return new PI}(Rw=globalThis).__zod_globalRegistry??(Rw.__zod_globalRegistry=UI());const bl=globalThis.__zod_globalRegistry;function VI(e,t){return new e({type:"string",...Te(t)})}function BI(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function Dw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function ZI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function II(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}function HI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}function FI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}function qI(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}function GI(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}function YI(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}function KI(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}function XI(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}function JI(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}function QI(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}function WI(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}function e7(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}function t7(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}function n7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}function r7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}function a7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}function i7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}function s7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}function o7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}function l7(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}function u7(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}function c7(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}function d7(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}function f7(e){return new e({type:"unknown"})}function h7(e,t){return new e({type:"never",...Te(t)})}function f2(e,t){return new $Z({check:"max_length",...Te(t),maximum:e})}function ld(e,t){return new LZ({check:"min_length",...Te(t),minimum:e})}function h2(e,t){return new PZ({check:"length_equals",...Te(t),length:e})}function m7(e,t){return new UZ({check:"string_format",format:"regex",...Te(t),pattern:e})}function p7(e){return new VZ({check:"string_format",format:"lowercase",...Te(e)})}function g7(e){return new BZ({check:"string_format",format:"uppercase",...Te(e)})}function x7(e,t){return new ZZ({check:"string_format",format:"includes",...Te(t),includes:e})}function y7(e,t){return new IZ({check:"string_format",format:"starts_with",...Te(t),prefix:e})}function b7(e,t){return new HZ({check:"string_format",format:"ends_with",...Te(t),suffix:e})}function mo(e){return new FZ({check:"overwrite",tx:e})}function v7(e){return mo(t=>t.normalize(e))}function k7(){return mo(e=>e.trim())}function w7(){return mo(e=>e.toLowerCase())}function S7(){return mo(e=>e.toUpperCase())}function z7(){return mo(e=>HB(e))}function _7(e,t,n){return new e({type:"array",element:t,...Te(n)})}function j7(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}function N7(e){const t=C7(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Bl(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Bl(s))}},e(n.value,n)));return t}function C7(e,t){const n=new Vr({check:"custom",...Te(t)});return n._zod.check=e,n}function m2(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??bl,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 cn(e,t,n={path:[],schemaPath:[]}){var a;const s=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 f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const v=l.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,v,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),cn(y,t,g),t.seen.get(y).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&kn(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 p2(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 f=e.metadataRegistry.get(l[0])?.id;if(f){const h=a.get(f);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,l[0])}}const s=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(y)return{ref:v(y)};const b=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(l[1]===n)return{ref:"#"};const m=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:h,defId:m}=s(l);f.def={...f.schema},m&&(f.defId=m);const g=f.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
107
|
-
|
|
108
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=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(f.cycle){u(l);continue}if(f.count>1&&e.reused==="ref"){u(l);continue}}}function g2(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 f=e.seen.get(l);if(f.ref===null)return;const h=f.def??f.schema,m={...h},g=f.ref;if(f.ref=null,g){a(g);const v=e.seen.get(g),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(b)):Object.assign(h,b),Object.assign(h,m),l._zod.parent===g)for(const N in h)N==="$ref"||N==="allOf"||N in m||delete h[N];if(b.$ref&&v.def)for(const N in h)N==="$ref"||N==="allOf"||N in v.def&&JSON.stringify(h[N])===JSON.stringify(v.def[N])&&delete h[N]}const y=l._zod.parent;if(y&&y!==g){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(h.$ref=v.schema.$ref,v.def))for(const b in h)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(h[b])===JSON.stringify(v.def[b])&&delete h[b]}e.override({zodSchema:l,jsonSchema:h,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$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");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(u[f.defId]=f.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:ud(t,"input",e.processors),output:ud(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function kn(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 kn(a.element,n);if(a.type==="set")return kn(a.valueType,n);if(a.type==="lazy")return kn(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 kn(a.innerType,n);if(a.type==="intersection")return kn(a.left,n)||kn(a.right,n);if(a.type==="record"||a.type==="map")return kn(a.keyType,n)||kn(a.valueType,n);if(a.type==="pipe")return kn(a.in,n)||kn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(kn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(kn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(kn(s,n))return!0;return!!(a.rest&&kn(a.rest,n))}return!1}const E7=(e,t={})=>n=>{const a=m2({...n,processors:t});return cn(e,a),p2(a,e),g2(a,e)},ud=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=m2({...s??{},target:u,io:t,processors:n});return cn(e,l),p2(l,e),g2(l,e)},T7={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},A7=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),f&&(s.format=T7[f]??f,s.format===""&&delete s.format,f==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},O7=(e,t,n,a)=>{n.not={}},R7=(e,t,n,a)=>{},D7=(e,t,n,a)=>{const s=e._zod.def,u=Qj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},M7=(e,t,n,a)=>{const s=e._zod.def,u=[];for(const l of s.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},$7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},L7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},P7=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=cn(u.element,t,{...a,path:[...a.path,"items"]})},U7=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object",s.properties={};const l=u.shape;for(const m in l)s.properties[m]=cn(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=cn(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},V7=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((f,h)=>cn(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},B7=(e,t,n,a)=>{const s=e._zod.def,u=cn(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=cn(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(u)?u.allOf:[u],...f(l)?l.allOf:[l]];n.allOf=h},Z7=(e,t,n,a)=>{const s=e._zod.def,u=cn(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},I7=(e,t,n,a)=>{const s=e._zod.def;cn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},H7=(e,t,n,a)=>{const s=e._zod.def;cn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},F7=(e,t,n,a)=>{const s=e._zod.def;cn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},q7=(e,t,n,a)=>{const s=e._zod.def;cn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType;let l;try{l=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},G7=(e,t,n,a)=>{const s=e._zod.def,u=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;cn(u,t,a);const l=t.seen.get(e);l.ref=u},Y7=(e,t,n,a)=>{const s=e._zod.def;cn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},x2=(e,t,n,a)=>{const s=e._zod.def;cn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},K7=ie("ZodISODateTime",(e,t)=>{iI.init(e,t),Tt.init(e,t)});function X7(e){return l7(K7,e)}const J7=ie("ZodISODate",(e,t)=>{sI.init(e,t),Tt.init(e,t)});function Q7(e){return u7(J7,e)}const W7=ie("ZodISOTime",(e,t)=>{oI.init(e,t),Tt.init(e,t)});function eH(e){return c7(W7,e)}const tH=ie("ZodISODuration",(e,t)=>{lI.init(e,t),Tt.init(e,t)});function nH(e){return d7(tH,e)}const y2=(e,t)=>{r2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>nZ(e,n)},flatten:{value:n=>tZ(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,qp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,qp,2)}},isEmpty:{get(){return e.issues.length===0}}})},rH=ie("ZodError",y2),xr=ie("ZodError",y2,{Parent:Error}),aH=px(xr),iH=gx(xr),sH=jd(xr),oH=Nd(xr),lH=iZ(xr),uH=sZ(xr),cH=oZ(xr),dH=lZ(xr),fH=uZ(xr),hH=cZ(xr),mH=dZ(xr),pH=fZ(xr),qt=ie("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ud(e,"input"),output:ud(e,"output")}}),e.toJSONSchema=E7(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ni(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)=>ri(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>aH(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>sH(e,n,a),e.parseAsync=async(n,a)=>iH(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>oH(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>lH(e,n,a),e.decode=(n,a)=>uH(e,n,a),e.encodeAsync=async(n,a)=>cH(e,n,a),e.decodeAsync=async(n,a)=>dH(e,n,a),e.safeEncode=(n,a)=>fH(e,n,a),e.safeDecode=(n,a)=>hH(e,n,a),e.safeEncodeAsync=async(n,a)=>mH(e,n,a),e.safeDecodeAsync=async(n,a)=>pH(e,n,a),e.refine=(n,a)=>e.check(lF(n,a)),e.superRefine=n=>e.check(uF(n)),e.overwrite=n=>e.check(mo(n)),e.optional=()=>Pw(e),e.exactOptional=()=>KH(e),e.nullable=()=>Uw(e),e.nullish=()=>Pw(Uw(e)),e.nonoptional=n=>tF(e,n),e.array=()=>PH(e),e.or=n=>v2([e,n]),e.and=n=>IH(e,n),e.transform=n=>Vw(e,GH(n)),e.default=n=>QH(e,n),e.prefault=n=>eF(e,n),e.catch=n=>rF(e,n),e.pipe=n=>Vw(e,n),e.readonly=()=>sF(e),e.describe=n=>{const a=e.clone();return bl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return bl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return bl.get(e);const a=e.clone();return bl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),b2=ie("_ZodString",(e,t)=>{xx.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>A7(e,a,s);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(m7(...a)),e.includes=(...a)=>e.check(x7(...a)),e.startsWith=(...a)=>e.check(y7(...a)),e.endsWith=(...a)=>e.check(b7(...a)),e.min=(...a)=>e.check(ld(...a)),e.max=(...a)=>e.check(f2(...a)),e.length=(...a)=>e.check(h2(...a)),e.nonempty=(...a)=>e.check(ld(1,...a)),e.lowercase=a=>e.check(p7(a)),e.uppercase=a=>e.check(g7(a)),e.trim=()=>e.check(k7()),e.normalize=(...a)=>e.check(v7(...a)),e.toLowerCase=()=>e.check(w7()),e.toUpperCase=()=>e.check(S7()),e.slugify=()=>e.check(z7())}),gH=ie("ZodString",(e,t)=>{xx.init(e,t),b2.init(e,t),e.email=n=>e.check(BI(xH,n)),e.url=n=>e.check(qI(yH,n)),e.jwt=n=>e.check(o7(RH,n)),e.emoji=n=>e.check(GI(bH,n)),e.guid=n=>e.check(Dw(Mw,n)),e.uuid=n=>e.check(ZI(Oc,n)),e.uuidv4=n=>e.check(II(Oc,n)),e.uuidv6=n=>e.check(HI(Oc,n)),e.uuidv7=n=>e.check(FI(Oc,n)),e.nanoid=n=>e.check(YI(vH,n)),e.guid=n=>e.check(Dw(Mw,n)),e.cuid=n=>e.check(KI(kH,n)),e.cuid2=n=>e.check(XI(wH,n)),e.ulid=n=>e.check(JI(SH,n)),e.base64=n=>e.check(a7(TH,n)),e.base64url=n=>e.check(i7(AH,n)),e.xid=n=>e.check(QI(zH,n)),e.ksuid=n=>e.check(WI(_H,n)),e.ipv4=n=>e.check(e7(jH,n)),e.ipv6=n=>e.check(t7(NH,n)),e.cidrv4=n=>e.check(n7(CH,n)),e.cidrv6=n=>e.check(r7(EH,n)),e.e164=n=>e.check(s7(OH,n)),e.datetime=n=>e.check(X7(n)),e.date=n=>e.check(Q7(n)),e.time=n=>e.check(eH(n)),e.duration=n=>e.check(nH(n))});function Um(e){return VI(gH,e)}const Tt=ie("ZodStringFormat",(e,t)=>{zt.init(e,t),b2.init(e,t)}),xH=ie("ZodEmail",(e,t)=>{XZ.init(e,t),Tt.init(e,t)}),Mw=ie("ZodGUID",(e,t)=>{YZ.init(e,t),Tt.init(e,t)}),Oc=ie("ZodUUID",(e,t)=>{KZ.init(e,t),Tt.init(e,t)}),yH=ie("ZodURL",(e,t)=>{JZ.init(e,t),Tt.init(e,t)}),bH=ie("ZodEmoji",(e,t)=>{QZ.init(e,t),Tt.init(e,t)}),vH=ie("ZodNanoID",(e,t)=>{WZ.init(e,t),Tt.init(e,t)}),kH=ie("ZodCUID",(e,t)=>{eI.init(e,t),Tt.init(e,t)}),wH=ie("ZodCUID2",(e,t)=>{tI.init(e,t),Tt.init(e,t)}),SH=ie("ZodULID",(e,t)=>{nI.init(e,t),Tt.init(e,t)}),zH=ie("ZodXID",(e,t)=>{rI.init(e,t),Tt.init(e,t)}),_H=ie("ZodKSUID",(e,t)=>{aI.init(e,t),Tt.init(e,t)}),jH=ie("ZodIPv4",(e,t)=>{uI.init(e,t),Tt.init(e,t)}),NH=ie("ZodIPv6",(e,t)=>{cI.init(e,t),Tt.init(e,t)}),CH=ie("ZodCIDRv4",(e,t)=>{dI.init(e,t),Tt.init(e,t)}),EH=ie("ZodCIDRv6",(e,t)=>{fI.init(e,t),Tt.init(e,t)}),TH=ie("ZodBase64",(e,t)=>{hI.init(e,t),Tt.init(e,t)}),AH=ie("ZodBase64URL",(e,t)=>{pI.init(e,t),Tt.init(e,t)}),OH=ie("ZodE164",(e,t)=>{gI.init(e,t),Tt.init(e,t)}),RH=ie("ZodJWT",(e,t)=>{yI.init(e,t),Tt.init(e,t)}),DH=ie("ZodUnknown",(e,t)=>{bI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>R7()});function $w(){return f7(DH)}const MH=ie("ZodNever",(e,t)=>{vI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>O7(e,n,a)});function $H(e){return h7(MH,e)}const LH=ie("ZodArray",(e,t)=>{kI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>P7(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(ld(n,a)),e.nonempty=n=>e.check(ld(1,n)),e.max=(n,a)=>e.check(f2(n,a)),e.length=(n,a)=>e.check(h2(n,a)),e.unwrap=()=>e.element});function PH(e,t){return _7(LH,e,t)}const UH=ie("ZodObject",(e,t)=>{SI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>U7(e,n,a,s),it(e,"shape",()=>t.shape),e.keyof=()=>HH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$w()}),e.loose=()=>e.clone({...e._zod.def,catchall:$w()}),e.strict=()=>e.clone({...e._zod.def,catchall:$H()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>XB(e,n),e.safeExtend=n=>JB(e,n),e.merge=n=>QB(e,n),e.pick=n=>YB(e,n),e.omit=n=>KB(e,n),e.partial=(...n)=>WB(k2,e,n[0]),e.required=(...n)=>eZ(w2,e,n[0])});function VH(e,t){const n={type:"object",shape:e??{},...Te(t)};return new UH(n)}const BH=ie("ZodUnion",(e,t)=>{zI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>V7(e,n,a,s),e.options=t.options});function v2(e,t){return new BH({type:"union",options:e,...Te(t)})}const ZH=ie("ZodIntersection",(e,t)=>{_I.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>B7(e,n,a,s)});function IH(e,t){return new ZH({type:"intersection",left:e,right:t})}const Yp=ie("ZodEnum",(e,t)=>{jI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>D7(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{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 Yp({...t,checks:[],...Te(s),entries:u})},e.exclude=(a,s)=>{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 Yp({...t,checks:[],...Te(s),entries:u})}});function HH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Yp({type:"enum",entries:n,...Te(t)})}const FH=ie("ZodLiteral",(e,t)=>{NI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>M7(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 FH({type:"literal",values:Array.isArray(e)?e:[e],...Te(t)})}const qH=ie("ZodTransform",(e,t)=>{CI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>L7(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Xj(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Bl(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(Bl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function GH(e){return new qH({type:"transform",transform:e})}const k2=ie("ZodOptional",(e,t)=>{d2.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>x2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Pw(e){return new k2({type:"optional",innerType:e})}const YH=ie("ZodExactOptional",(e,t)=>{EI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>x2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function KH(e){return new YH({type:"optional",innerType:e})}const XH=ie("ZodNullable",(e,t)=>{TI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Z7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Uw(e){return new XH({type:"nullable",innerType:e})}const JH=ie("ZodDefault",(e,t)=>{AI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>H7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function QH(e,t){return new JH({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():e2(t)}})}const WH=ie("ZodPrefault",(e,t)=>{OI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>F7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function eF(e,t){return new WH({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():e2(t)}})}const w2=ie("ZodNonOptional",(e,t)=>{RI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>I7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function tF(e,t){return new w2({type:"nonoptional",innerType:e,...Te(t)})}const nF=ie("ZodCatch",(e,t)=>{DI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>q7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rF(e,t){return new nF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const aF=ie("ZodPipe",(e,t)=>{MI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>G7(e,n,a,s),e.in=t.in,e.out=t.out});function Vw(e,t){return new aF({type:"pipe",in:e,out:t})}const iF=ie("ZodReadonly",(e,t)=>{$I.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Y7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function sF(e){return new iF({type:"readonly",innerType:e})}const oF=ie("ZodCustom",(e,t)=>{LI.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$7(e,n)});function lF(e,t={}){return j7(oF,e,t)}function uF(e){return N7(e)}const cF=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"devkit",label:"DevKit"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"ui",label:"Interface"},{id:"logging",label:"Logging"},{id:"chronos",label:"Chronos"}],dF=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],pl=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function fF(){const{data:e,error:t}=kt("/api/config",or.fetchConfig),{data:n}=kt("/api/config/sati",or.getSatiConfig),{data:a}=kt("/api/config/apoc",or.getApocConfig),{data:s}=kt("/api/config/neo",or.getNeoConfig),{data:u}=kt("/api/config/trinity",or.getTrinityConfig),{data:l}=kt("/api/config/encryption-status",()=>or.getEncryptionStatus()),{data:f}=kt("/api/config/env-overrides",()=>or.getEnvOverrides()),{data:h}=aj(),[m,g]=z.useState(null),[y,v]=z.useState(!1),[b,S]=z.useState(null),[N,T]=z.useState(null),[E,O]=z.useState(null),[C,P]=z.useState(null),[M,R]=z.useState(null),[I,B]=z.useState("general"),[Y,fe]=z.useState("oracle"),[se,le]=z.useState(!1),[ee,oe]=z.useState({}),[ae,V]=z.useState(null);z.useEffect(()=>{e&&!b&&S(e)},[e]),z.useEffect(()=>{n&&!N&&T(n)},[n]),z.useEffect(()=>{a&&!C?P(a):!a&&!C&&b&&P({...b.apoc??b.llm,temperature:b.apoc?.temperature??.2,timeout_ms:b.apoc?.timeout_ms??3e4})},[a,b]),z.useEffect(()=>{s&&!E?O(s):!s&&!E&&b&&O({...b.neo??b.llm,temperature:b.neo?.temperature??.2})},[s,b]),z.useEffect(()=>{u&&!M?R(u):!u&&!M&&b&&R({...b.trinity??b.llm,temperature:b.trinity?.temperature??.2})},[u,b]),z.useEffect(()=>{h&&!m&&g(h)},[h]);const J=JSON.stringify(e)!==JSON.stringify(b)||JSON.stringify(n)!==JSON.stringify(N)||JSON.stringify(s)!==JSON.stringify(E)||JSON.stringify(a)!==JSON.stringify(C)||JSON.stringify(u)!==JSON.stringify(M),K=($,je)=>{if(!l?.apiKeysEncrypted)return null;const{morpheusSecretSet:Ke,apiKeysEncrypted:_t}=l,Oe=_t[$];return!je?d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-azure-surface border border-azure-border text-azure-text-secondary dark:bg-matrix-primary/10 dark:border-matrix-primary dark:text-matrix-tertiary",children:"No API key"}):f&&f[ye($)]?null:Ke?Oe?d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-emerald-100 border border-emerald-300 text-emerald-800 dark:bg-emerald-900/30 dark:border-emerald-700 dark:text-emerald-400",title:"API key encrypted with AES-256-GCM",children:"🔒 Encrypted"}):d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-amber-100 border border-amber-300 text-amber-800 dark:bg-amber-900/30 dark:border-amber-700 dark:text-amber-400",title:"Re-save this configuration to encrypt the API key",children:"⚠️ Re-save to encrypt"}):d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-amber-100 border border-amber-300 text-amber-800 dark:bg-amber-900/30 dark:border-amber-700 dark:text-amber-400",title:"Set MORPHEUS_SECRET to enable encryption",children:"⚠️ Plaintext"})},ye=$=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[$],A=$=>!f||!f[$]?null:d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-blue-100 border border-blue-300 text-blue-800 dark:bg-blue-900/30 dark:border-blue-700 dark:text-blue-400",title:"This field is set by an environment variable and cannot be edited",children:"🔒 Env Var"}),_=$=>!!(f&&f[$]),U=($,je)=>{if(!b)return;const Ke=JSON.parse(JSON.stringify(b));let _t=Ke;for(let Oe=0;Oe<$.length-1;Oe++)(_t[$[Oe]]===void 0||_t[$[Oe]]===null)&&(_t[$[Oe]]={}),_t=_t[$[Oe]];_t[$[$.length-1]]=je,S(Ke);try{ZB.parse(Ke),oe({})}catch(Oe){if(Oe instanceof rH){const Qe={};Oe.errors.forEach(st=>{const tt=st.path.join(".");Qe[tt]=st.message}),oe(Qe)}}},w=($,je)=>{N&&T({...N,[$]:je})},G=($,je)=>{C&&P({...C,[$]:je})},de=($,je)=>{E&&O({...E,[$]:je})},he=($,je)=>{M&&R({...M,[$]:je})},me=()=>{!b||!M||R({...M,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Pe=()=>{!b||!N||T({...N,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Ae=()=>{!b||!C||P({...C,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},pt=()=>{!b||!E||O({...E,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Dt=async()=>{if(b){le(!0),V(null);try{const $=await or.updateConfig(b);N&&await or.updateSatiConfig(N),E&&await or.updateNeoConfig(E),C&&await or.updateApocConfig(C),M&&await or.updateTrinityConfig(M),Dn("/api/config"),Dn("/api/config/sati"),Dn("/api/config/neo"),Dn("/api/config/apoc"),Dn("/api/config/trinity");const je=$._restartRequired||[];je.length>0?V({type:"success",message:`Settings saved and applied. Some changes require restart: ${je.join(", ")}`}):V({type:"success",message:"Settings saved and applied successfully."})}catch($){if(V({type:"error",message:$.message}),$.details&&Array.isArray($.details)){const je={};$.details.forEach(Ke=>{const _t=Ke.path.join(".");je[_t]=Ke.message}),oe(je)}}finally{le(!1)}}};return t?d.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):b?d.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Zaion Settings"}),d.jsx("button",{onClick:Dt,disabled:!J||Object.keys(ee).length>0||se,className:`px-4 py-2 rounded font-medium transition-colors ${J&&Object.keys(ee).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:se?"Saving...":"Save Changes"})]}),ae&&d.jsx("div",{className:`p-4 rounded border ${ae.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:ae.message}),d.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:d.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:cF.map($=>d.jsx("button",{onClick:()=>B($.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${I===$.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:$.label},$.id))})}),d.jsxs("div",{className:"space-y-6",children:[I==="general"&&d.jsxs(bn,{title:"Agent Identity",children:[d.jsx(Fe,{label:"Agent Name",value:b.agent.name,onChange:$=>U(["agent","name"],$.target.value),error:ee["agent.name"]}),d.jsx(Fe,{label:"Personality",value:b.agent.personality,onChange:$=>U(["agent","personality"],$.target.value),error:ee["agent.personality"]}),d.jsx(wn,{label:"Verbose Mode",value:b.verbose_mode!==!1?"true":"false",onChange:$=>U(["verbose_mode"],$.target.value==="true"),options:[{value:"true",label:"Enabled (notify tool execution on channels)"},{value:"false",label:"Disabled"}],helperText:"When enabled, channels like Telegram/Discord show which tools are being executed in real-time."})]}),I==="agents"&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:dF.map($=>d.jsx("button",{onClick:()=>fe($.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${Y===$.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:$.label},$.id))}),Y==="oracle"&&d.jsxs(bn,{title:"Oracle Agent",children:[d.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"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),A("llm.provider")]}),d.jsx(wn,{label:"",value:b.llm.provider,onChange:$=>U(["llm","provider"],$.target.value),options:pl,error:ee["llm.provider"],disabled:_("llm.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),A("llm.model")]}),d.jsx(Fe,{label:"",value:b.llm.model,onChange:$=>U(["llm","model"],$.target.value),disabled:_("llm.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),A("llm.temperature")]}),d.jsx(fn,{label:"",value:b.llm.temperature,onChange:$=>U(["llm","temperature"],parseFloat($.target.value)),step:.1,min:0,max:1,error:ee["llm.temperature"],disabled:_("llm.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),A("llm.max_tokens")]}),d.jsx(fn,{label:"",value:b.llm.max_tokens??"",onChange:$=>U(["llm","max_tokens"],$.target.value?parseInt($.target.value):void 0),min:1,error:ee["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:_("llm.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),A("llm.context_window")]}),d.jsx(fn,{label:"",value:b.llm.context_window??100,onChange:$=>U(["llm","context_window"],parseInt($.target.value)),min:1,step:1,error:ee["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:_("llm.context_window")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[A("llm.api_key"),K("oracle",b.llm.api_key)]})]}),d.jsx(Fe,{label:"",type:"password",value:b.llm.api_key||"",onChange:$=>U(["llm","api_key"],$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:_("llm.api_key")}),b.llm.provider==="openrouter"&&d.jsx(Fe,{label:"Base URL",value:b.llm.base_url||"https://openrouter.ai/api/v1",onChange:$=>U(["llm","base_url"],$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),Y==="sati"&&d.jsxs(bn,{title:"Sati Agent",children:[d.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"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:Pe,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"}),d.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"})]}),N&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),A("sati.provider")]}),d.jsx(wn,{label:"",value:N.provider,onChange:$=>w("provider",$.target.value),options:pl,disabled:_("sati.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),A("sati.model")]}),d.jsx(Fe,{label:"",value:N.model,onChange:$=>w("model",$.target.value),disabled:_("sati.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[A("sati.api_key"),K("sati",N.api_key)]})]}),d.jsx(Fe,{label:"",type:"password",value:N.api_key||"",onChange:$=>w("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:_("sati.api_key")}),N.provider==="openrouter"&&d.jsx(Fe,{label:"Base URL",value:N.base_url||"https://openrouter.ai/api/v1",onChange:$=>w("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(fn,{label:"Memory Limit",value:N.memory_limit??10,onChange:$=>w("memory_limit",parseInt($.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),d.jsx(Or,{label:"Enable Archived Sessions in Memory Retrieval",checked:N.enabled_archived_sessions??!0,onChange:$=>w("enabled_archived_sessions",$)})]})]}),Y==="neo"&&d.jsxs(bn,{title:"Neo Agent",children:[d.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"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:pt,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"}),d.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"})]}),E&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),A("neo.provider")]}),d.jsx(wn,{label:"",value:E.provider,onChange:$=>de("provider",$.target.value),options:pl,disabled:_("neo.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),A("neo.model")]}),d.jsx(Fe,{label:"",value:E.model,onChange:$=>de("model",$.target.value),disabled:_("neo.model")}),d.jsx(Fe,{label:"Personality",value:E.personality||"analytical_engineer",onChange:$=>de("personality",$.target.value),placeholder:"analytical_engineer",helperText:"e.g., analytical_engineer, meticulous_auditor, systems_thinker"}),d.jsx(wn,{label:"Execution Mode",value:E.execution_mode||"async",onChange:$=>de("execution_mode",$.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),A("neo.temperature")]}),d.jsx(fn,{label:"",value:E.temperature,onChange:$=>de("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:_("neo.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),A("neo.max_tokens")]}),d.jsx(fn,{label:"",value:E.max_tokens??"",onChange:$=>de("max_tokens",$.target.value?parseInt($.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:_("neo.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),A("neo.context_window")]}),d.jsx(fn,{label:"",value:E.context_window??100,onChange:$=>de("context_window",parseInt($.target.value)),min:1,step:1,disabled:_("neo.context_window")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[A("neo.api_key"),K("neo",E.api_key)]})]}),d.jsx(Fe,{label:"",type:"password",value:E.api_key||"",onChange:$=>de("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:_("neo.api_key")}),E.provider==="openrouter"&&d.jsx(Fe,{label:"Base URL",value:E.base_url||"https://openrouter.ai/api/v1",onChange:$=>de("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),Y==="trinity"&&d.jsxs(bn,{title:"Trinity Agent",children:[d.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)"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:me,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"}),d.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"})]}),M&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),A("trinity.provider")]}),d.jsx(wn,{label:"",value:M.provider,onChange:$=>he("provider",$.target.value),options:pl,disabled:_("trinity.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),A("trinity.model")]}),d.jsx(Fe,{label:"",value:M.model,onChange:$=>he("model",$.target.value),disabled:_("trinity.model")}),d.jsx(Fe,{label:"Personality",value:M.personality||"data_specialist",onChange:$=>he("personality",$.target.value),placeholder:"data_specialist",helperText:"e.g., data_specialist, query_optimizer, db_architect"}),d.jsx(wn,{label:"Execution Mode",value:M.execution_mode||"async",onChange:$=>he("execution_mode",$.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),A("trinity.temperature")]}),d.jsx(fn,{label:"",value:M.temperature,onChange:$=>he("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:_("trinity.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),A("trinity.max_tokens")]}),d.jsx(fn,{label:"",value:M.max_tokens??"",onChange:$=>he("max_tokens",$.target.value?parseInt($.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:_("trinity.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[A("trinity.api_key"),K("trinity",M.api_key)]})]}),d.jsx(Fe,{label:"",type:"password",value:M.api_key||"",onChange:$=>he("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:_("trinity.api_key")}),M.provider==="openrouter"&&d.jsx(Fe,{label:"Base URL",value:M.base_url||"https://openrouter.ai/api/v1",onChange:$=>he("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),Y==="apoc"&&d.jsxs(bn,{title:"Apoc Agent",children:[d.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"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:Ae,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"}),d.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"})]}),C&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),A("apoc.provider")]}),d.jsx(wn,{label:"",value:C.provider,onChange:$=>G("provider",$.target.value),options:pl,disabled:_("apoc.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),A("apoc.model")]}),d.jsx(Fe,{label:"",value:C.model,onChange:$=>G("model",$.target.value),disabled:_("apoc.model")}),d.jsx(Fe,{label:"Personality",value:C.personality||"pragmatic_dev",onChange:$=>G("personality",$.target.value),placeholder:"pragmatic_dev",helperText:"e.g., pragmatic_dev, cautious_admin, automation_specialist"}),d.jsx(wn,{label:"Execution Mode",value:C.execution_mode||"async",onChange:$=>G("execution_mode",$.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),A("apoc.temperature")]}),d.jsx(fn,{label:"",value:C.temperature,onChange:$=>G("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:_("apoc.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[A("apoc.api_key"),K("apoc",C.api_key)]})]}),d.jsx(Fe,{label:"",type:"password",value:C.api_key||"",onChange:$=>G("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:_("apoc.api_key")}),C.provider==="openrouter"&&d.jsx(Fe,{label:"Base URL",value:C.base_url||"https://openrouter.ai/api/v1",onChange:$=>G("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(Fe,{label:"Working Directory",value:C.working_dir||"",onChange:$=>G("working_dir",$.target.value),placeholder:"(deprecated — use DevKit tab)",helperText:"Deprecated: Use the DevKit tab's Sandbox Directory instead.",disabled:!0}),d.jsx(fn,{label:"Timeout (ms)",value:C.timeout_ms??3e4,onChange:$=>G("timeout_ms",parseInt($.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),I==="devkit"&&d.jsxs(d.Fragment,{children:[d.jsxs(bn,{title:"DevKit Security",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Shared security configuration for DevKit tools used by Apoc and Keymaker. Controls path sandboxing, shell command restrictions, and tool category access."}),d.jsx(Fe,{label:"Sandbox Directory",value:b.devkit?.sandbox_dir||"",onChange:$=>U(["devkit","sandbox_dir"],$.target.value),placeholder:typeof window<"u"?"(defaults to process.cwd())":"",helperText:"Root directory for all DevKit operations. All file, shell, and git paths are confined here.",disabled:_("devkit.sandbox_dir")}),d.jsx(wn,{label:"Read-Only Mode",value:b.devkit?.readonly_mode?"true":"false",onChange:$=>U(["devkit","readonly_mode"],$.target.value==="true"),options:[{value:"false",label:"Disabled (read + write)"},{value:"true",label:"Enabled (read-only, blocks writes/deletes)"}],helperText:"When enabled, blocks all write, delete, and create operations on the filesystem.",disabled:_("devkit.readonly_mode")}),d.jsx(fn,{label:"Timeout (ms)",value:b.devkit?.timeout_ms??3e4,onChange:$=>U(["devkit","timeout_ms"],parseInt($.target.value)),min:1e3,step:1e3,helperText:"Default timeout for shell and system operations in milliseconds.",disabled:_("devkit.timeout_ms")})]}),d.jsxs(bn,{title:"Tool Categories",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Enable or disable entire categories of DevKit tools."}),d.jsx(Or,{label:"Filesystem (read, write, list, copy, move, delete files)",checked:b.devkit?.enable_filesystem!==!1,onChange:$=>U(["devkit","enable_filesystem"],$)}),d.jsx(Or,{label:"Shell (run_command, run_script, which)",checked:b.devkit?.enable_shell!==!1,onChange:$=>U(["devkit","enable_shell"],$)}),d.jsx(Or,{label:"Git (status, diff, commit, push, pull, clone, branch)",checked:b.devkit?.enable_git!==!1,onChange:$=>U(["devkit","enable_git"],$)}),d.jsx(Or,{label:"Network (http_request, ping, dns_lookup, download_file)",checked:b.devkit?.enable_network!==!1,onChange:$=>U(["devkit","enable_network"],$)})]}),d.jsxs(bn,{title:"Shell Command Allowlist",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Restrict which shell commands Apoc and Keymaker can execute. Leave empty to allow all commands (default)."}),d.jsx(Fe,{label:"Allowed Commands",value:(b.devkit?.allowed_shell_commands||[]).join(", "),onChange:$=>U(["devkit","allowed_shell_commands"],$.target.value.split(",").map(je=>je.trim()).filter(Boolean)),placeholder:"e.g. node, npm, git, python, cargo",helperText:"Comma-separated list of allowed binary names. Empty = all commands allowed.",disabled:_("devkit.allowed_shell_commands")})]})]}),I==="audio"&&d.jsxs(bn,{title:"Audio Transcription",children:[d.jsx(Or,{label:"Enable Audio",checked:b.audio.enabled,onChange:$=>U(["audio","enabled"],$)}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),A("audio.provider")]}),d.jsx(wn,{label:"",value:b.audio.provider||"google",onChange:$=>U(["audio","provider"],$.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:ee["audio.provider"],disabled:_("audio.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model"}),A("audio.model")]}),d.jsx(Fe,{label:"",value:b.audio.model,onChange:$=>U(["audio","model"],$.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:ee["audio.model"],disabled:_("audio.model")}),b.audio.provider==="ollama"&&d.jsx(Fe,{label:"Base URL",value:b.audio.base_url||"",onChange:$=>U(["audio","base_url"],$.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[A("audio.apiKey"),K("audio",b.audio.apiKey)]})]}),d.jsx(Fe,{label:"",type:"password",value:b.audio.apiKey||"",onChange:$=>U(["audio","apiKey"],$.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:_("audio.apiKey")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Duration (Seconds)"}),A("audio.maxDurationSeconds")]}),d.jsx(fn,{label:"",value:b.audio.maxDurationSeconds,onChange:$=>U(["audio","maxDurationSeconds"],parseInt($.target.value)),min:1,disabled:_("audio.maxDurationSeconds")}),d.jsx(Fe,{label:"Supported Mime Types",value:b.audio.supportedMimeTypes.join(", "),onChange:$=>U(["audio","supportedMimeTypes"],$.target.value.split(",").map(je=>je.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),I==="channels"&&d.jsxs(d.Fragment,{children:[d.jsxs(bn,{title:"Telegram",children:[d.jsx(Or,{label:"Enable Telegram",checked:b.channels.telegram.enabled,onChange:$=>U(["channels","telegram","enabled"],$)}),b.channels.telegram.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(Fe,{label:"Bot Token",type:"password",value:b.channels.telegram.token||"",onChange:$=>U(["channels","telegram","token"],$.target.value)}),d.jsx(Fe,{label:"Allowed Users (comma separated)",value:b.channels.telegram.allowedUsers.join(", "),onChange:$=>U(["channels","telegram","allowedUsers"],$.target.value.split(",").map(je=>je.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),d.jsxs(bn,{title:"Discord",children:[d.jsx(Or,{label:"Enable Discord",checked:b.channels.discord.enabled,onChange:$=>U(["channels","discord","enabled"],$)}),b.channels.discord.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(Fe,{label:"Bot Token",type:"password",value:b.channels.discord.token||"",onChange:$=>U(["channels","discord","token"],$.target.value)}),d.jsx(Fe,{label:"Allowed Users (comma separated)",value:(b.channels.discord.allowedUsers??[]).join(", "),onChange:$=>U(["channels","discord","allowedUsers"],$.target.value.split(",").map(je=>je.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),I==="ui"&&d.jsxs(bn,{title:"Dashboard",children:[d.jsx(Or,{label:"Enable Web UI",checked:b.ui.enabled,onChange:$=>U(["ui","enabled"],$)}),d.jsx(fn,{label:"Port",value:b.ui.port,onChange:$=>U(["ui","port"],parseInt($.target.value)),disabled:!0,helperText:"Port changes require daemon restart."})]}),I==="logging"&&d.jsxs(bn,{title:"Logging",children:[d.jsx(Or,{label:"Enable Logging",checked:b.logging.enabled,onChange:$=>U(["logging","enabled"],$)}),d.jsx(wn,{label:"Log Level",value:b.logging.level,onChange:$=>U(["logging","level"],$.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),I==="chronos"&&m&&d.jsxs(bn,{title:"Chronos — Temporal Intent Engine",children:[d.jsx(wn,{label:"Timezone",value:m.timezone,onChange:$=>g({...m,timezone:$.target.value}),options:[{label:"UTC",value:"UTC"},{label:"America/New_York",value:"America/New_York"},{label:"America/Chicago",value:"America/Chicago"},{label:"America/Denver",value:"America/Denver"},{label:"America/Los_Angeles",value:"America/Los_Angeles"},{label:"America/Sao_Paulo",value:"America/Sao_Paulo"},{label:"America/Buenos_Aires",value:"America/Buenos_Aires"},{label:"America/Bogota",value:"America/Bogota"},{label:"America/Lima",value:"America/Lima"},{label:"America/Santiago",value:"America/Santiago"},{label:"America/Mexico_City",value:"America/Mexico_City"},{label:"America/Toronto",value:"America/Toronto"},{label:"America/Vancouver",value:"America/Vancouver"},{label:"Europe/London",value:"Europe/London"},{label:"Europe/Paris",value:"Europe/Paris"},{label:"Europe/Berlin",value:"Europe/Berlin"},{label:"Europe/Madrid",value:"Europe/Madrid"},{label:"Europe/Rome",value:"Europe/Rome"},{label:"Europe/Amsterdam",value:"Europe/Amsterdam"},{label:"Europe/Brussels",value:"Europe/Brussels"},{label:"Europe/Zurich",value:"Europe/Zurich"},{label:"Europe/Lisbon",value:"Europe/Lisbon"},{label:"Europe/Warsaw",value:"Europe/Warsaw"},{label:"Europe/Stockholm",value:"Europe/Stockholm"},{label:"Europe/Helsinki",value:"Europe/Helsinki"},{label:"Europe/Moscow",value:"Europe/Moscow"},{label:"Asia/Dubai",value:"Asia/Dubai"},{label:"Asia/Kolkata",value:"Asia/Kolkata"},{label:"Asia/Bangkok",value:"Asia/Bangkok"},{label:"Asia/Singapore",value:"Asia/Singapore"},{label:"Asia/Hong_Kong",value:"Asia/Hong_Kong"},{label:"Asia/Shanghai",value:"Asia/Shanghai"},{label:"Asia/Tokyo",value:"Asia/Tokyo"},{label:"Asia/Seoul",value:"Asia/Seoul"},{label:"Australia/Sydney",value:"Australia/Sydney"},{label:"Australia/Melbourne",value:"Australia/Melbourne"},{label:"Pacific/Auckland",value:"Pacific/Auckland"},{label:"Africa/Cairo",value:"Africa/Cairo"},{label:"Africa/Johannesburg",value:"Africa/Johannesburg"}]}),d.jsx(fn,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:$=>g({...m,check_interval_ms:Number($.target.value)*1e3}),min:60}),d.jsx(fn,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:$=>g({...m,max_active_jobs:Number($.target.value)}),min:1,max:1e3}),d.jsx("div",{className:"flex justify-end pt-2",children:d.jsx("button",{onClick:async()=>{v(!0),V(null);try{await Ti.updateConfig(m),Dn("/api/config/chronos"),V({type:"success",message:"Chronos settings saved."})}catch($){V({type:"error",message:$.message})}finally{v(!1)}},disabled:y,className:"px-4 py-2 rounded font-medium bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:y?"Saving…":"Save Chronos Settings"})})]})]})]}):d.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function hF(){const{data:e}=q4(),[t,n]=z.useState(null),{data:a,mutate:s}=G4(t),u=z.useRef(null);return z.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),z.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[a]),d.jsxs(Ye.div,{className:"flex flex-col space-y-4 md:pt-0",style:{height:"calc(100vh - 2rem)"},initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.3},children:[d.jsxs("div",{className:"shrink-0",children:[d.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"SYSTEM LOGS"}),d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"View runtime logs."})]}),d.jsxs("div",{className:"flex-1 flex gap-4 min-h-0 border border-azure-border dark:border-matrix-primary rounded bg-azure-surface dark:bg-zinc-950 p-4",children:[d.jsxs("div",{className:"hidden md:flex w-64 flex-col gap-2 border-r border-azure-border dark:border-matrix-primary pr-4 overflow-y-auto shrink-0",children:[d.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(l=>d.jsxs("button",{onClick:()=>n(l.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===l.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:[d.jsx(pA,{className:"w-4 h-4 shrink-0"}),d.jsxs("div",{className:"flex flex-col overflow-hidden",children:[d.jsx("span",{className:"truncate font-bold",children:l.name}),d.jsxs("span",{className:"text-xs opacity-70",children:[(l.size/1024).toFixed(1)," KB"]})]})]},l.name))]}),d.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary/50 rounded",children:[d.jsxs("div",{className:"shrink-0 flex justify-between items-center gap-2 p-2 bg-azure-hover dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary/50",children:[d.jsx("select",{value:t??"",onChange:l=>n(l.target.value),className:"md:hidden flex-1 bg-transparent text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm border-none outline-none cursor-pointer",children:e?.map(l=>d.jsx("option",{value:l.name,children:l.name},l.name))}),d.jsx("span",{className:"hidden md:block text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm truncate",children:t}),d.jsx("button",{onClick:()=>s(),className:"shrink-0 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:d.jsx(Ds,{className:"w-4 h-4"})})]}),d.jsx("div",{ref:u,className:"flex-1 overflow-x-hidden overflow-y-auto p-4 font-mono text-xs break-all text-azure-text-primary dark:text-white",children:a?a.lines.map((l,f)=>{const h=l.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s?(.*)/s);return h?d.jsxs("div",{children:[d.jsxs("span",{className:"hidden md:inline opacity-50",children:[h[1]," "]}),d.jsx("span",{children:h[2]})]},f):d.jsx("div",{children:l},f)}):d.jsx("span",{className:"opacity-50",children:"Select a log file to view content..."})})]})]})]})}function mF(){const[e,t]=z.useState(null),[n,a]=z.useState([]),[s,u]=z.useState(!0),[l,f]=z.useState("");if(z.useEffect(()=>{async function g(){try{const[y,v]=await Promise.all([Ap.fetchUsageStats(),Ap.fetchGroupedUsageStats()]);t(y),a(v)}catch(y){f("Failed to load usage statistics"),console.error(y)}finally{u(!1)}}g()},[]),s)return d.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 d.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 d.jsxs(Ye.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between border-b border-azure-border dark:border-matrix-primary pb-4",children:d.jsxs("div",{children:[d.jsxs("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight font-mono flex items-center gap-2",children:[d.jsx(Ym,{className:"w-6 h-6"}),"USAGE_ANALYTICS"]}),d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1 font-mono text-sm",children:"Resource consumption tracking and metrics"})]})}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[d.jsxs(Ye.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:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(El,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),d.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),d.jsxs(Ye.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:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(Zs,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),d.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),d.jsxs(Ye.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:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(qc,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),d.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),d.jsxs(Ye.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:[d.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:d.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[d.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:d.jsxs("tr",{children:[d.jsx("th",{className:"p-4",children:"Provider"}),d.jsx("th",{className:"p-4",children:"Model"}),d.jsx("th",{className:"p-4 text-right",children:"Messages"}),d.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),d.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),d.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?d.jsx("tr",{children:d.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,y)=>d.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),d.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),d.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}-${y}`))})]})})]})]})}const pF=()=>{const[e,t]=z.useState(""),[n,a]=z.useState(""),s=eg(),u=Nr(),l=f=>{f.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||"/";s(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return d.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:d.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:[d.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"}),d.jsxs("form",{onSubmit:l,className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),d.jsx("input",{type:"password",value:e,onChange:f=>t(f.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&&d.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),d.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"})]}),d.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."})]})})},gF=({children:e})=>{const{isAuthenticated:t}=k_(),n=Nr();return t?d.jsx(d.Fragment,{children:e}):d.jsx(mS,{to:"/login",state:{from:n},replace:!0})},xF=({className:e,...t})=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),yF=({...e})=>d.jsx("thead",{...e}),bF=({...e})=>d.jsx("tbody",{...e}),Vm=({...e})=>d.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}),Cs=({className:e,...t})=>d.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}),zi=({className:e,...t})=>d.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),Bw=({checked:e,onCheckedChange:t,className:n,...a})=>{const s=u=>{t&&t(u.target.checked),a.onChange&&a.onChange(u)};return d.jsx("input",{type:"checkbox",checked:e,onChange:s,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})},cd=({className:e,variant:t="default",...n})=>{const s=`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 d.jsx("div",{className:s,...n})},Bm=({className:e,...t})=>d.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}),Zw=({className:e,...t})=>d.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),vF=({className:e,...t})=>d.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),Zm=({className:e,...t})=>d.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),kF=({className:e,variant:t="default",...n})=>{const s=`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 d.jsx("div",{className:s,...n})},wF=({className:e,...t})=>d.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),S2=({isOpen:e,onClose:t,title:n,children:a,size:s="md"})=>{if(!e)return null;const u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),d.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[s]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&d.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&d.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:d.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:d.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),d.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},SF=({isOpen:e,onClose:t,memory:n})=>n?d.jsx(S2,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(sg,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),d.jsx("div",{children:d.jsx(cd,{variant:"outline",children:n.category})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(s4,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),d.jsx("div",{children:d.jsx(cd,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(wS,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(qa,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Hl,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(kA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(_A,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),d.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&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),d.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})]}),d.jsx("div",{className:"flex justify-end pt-4",children:d.jsx(cr,{onClick:t,children:"Close"})})]})}):null,z2=({isOpen:e,onClose:t,onConfirm:n,title:a="Confirm Deletion",message:s="Are you sure you want to delete this item? This action cannot be undone.",confirmButtonText:u="Delete",cancelButtonText:l="Cancel"})=>d.jsx(S2,{isOpen:e,onClose:t,title:a,size:"md",children:d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(cr,{variant:"outline",onClick:t,children:l}),d.jsx(cr,{variant:"destructive",onClick:()=>{n(),t()},children:u})]})]})}),zF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=z.useCallback(h=>(t(!0),a(null),xe.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),u=z.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),l=z.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),f=z.useCallback(h=>(t(!0),a(null),xe.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:s,post:u,put:l,del:f,loading:e,error:n}},_F=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(!0),[s,u]=z.useState([]),[l,f]=z.useState(""),[h,m]=z.useState("all"),[g,y]=z.useState("all"),[v,b]=z.useState(null),[S,N]=z.useState(!1),[T,E]=z.useState(null),[O,C]=z.useState(!1),[P,M]=z.useState(null),[R,I]=z.useState(!1),{get:B,del:Y,post:fe}=zF();z.useEffect(()=>{se()},[]);const se=async()=>{try{a(!0);const _=await B("/sati/memories");t(_),b(null)}catch(_){b("Failed to load memories. Please try again."),console.error("Error fetching memories:",_)}finally{a(!1)}},le=()=>{s.length===K.length?u([]):u(K.map(_=>_.id))},ee=_=>{s.includes(_)?u(s.filter(U=>U!==_)):u([...s,_])},oe=async()=>{if(s.length!==0)try{await fe("/sati/memories/bulk-delete",{ids:s}),await se(),u([]),N(!1)}catch(_){b("Failed to delete memories. Please try again."),console.error("Error deleting memories:",_)}},ae=_=>{M(_),I(!0)},V=async()=>{if(P)try{await Y(`/sati/memories/${P}`),await se()}catch(_){b("Failed to delete memory. Please try again."),console.error("Error deleting memory:",_)}finally{M(null),I(!1)}},J=_=>{E(_),C(!0)},K=e.filter(_=>{const U=_.summary.toLowerCase().includes(l.toLowerCase())||_.details?.toLowerCase().includes(l.toLowerCase())||_.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||_.category===h,G=g==="all"||_.importance===g;return U&&w&&G&&!_.archived}),ye=Array.from(new Set(e.map(_=>_.category))),A=Array.from(new Set(e.map(_=>_.importance)));return n?d.jsx(Bm,{className:"w-full",children:d.jsx(Zm,{className:"flex justify-center items-center h-64",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Sati Memories"}),d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1",children:"View and manage your long-term memories stored by Sati"})]}),s.length>0&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[s.length," selected"]}),d.jsxs(cr,{variant:"destructive",size:"sm",onClick:()=>N(!0),disabled:s.length===0,children:[d.jsx(Ai,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),v&&d.jsx(kF,{variant:"destructive",children:d.jsx(wF,{children:v})}),d.jsxs(Bm,{children:[d.jsx(Zw,{className:"border-b border-azure-border dark:border-matrix-primary",children:d.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[d.jsxs("div",{className:"flex flex-col relative w-full",children:[d.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"}),d.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:_=>f(_.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"})]}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[d.jsxs("select",{value:h,onChange:_=>m(_.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:[d.jsx("option",{value:"all",children:"All Categories"}),ye.map(_=>d.jsx("option",{value:_,children:_},_))]}),d.jsxs("select",{value:g,onChange:_=>y(_.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:[d.jsx("option",{value:"all",children:"All Importance"}),A.map(_=>d.jsx("option",{value:_,children:_},_))]})]})]})}),d.jsx(Zm,{className:"p-0",children:d.jsxs(xF,{children:[d.jsx(yF,{children:d.jsxs(Vm,{className:"hover:bg-transparent",children:[d.jsx(Cs,{className:"w-12",children:d.jsx(Bw,{checked:K.length>0&&s.length===K.length,onCheckedChange:le})}),d.jsx(Cs,{children:"Summary"}),d.jsx(Cs,{children:"Category"}),d.jsx(Cs,{children:"Importance"}),d.jsx(Cs,{children:"Created"}),d.jsx(Cs,{className:"w-32",children:"Actions"})]})}),d.jsx(bF,{children:K.length===0?d.jsx(Vm,{children:d.jsx(zi,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):K.map(_=>d.jsxs(Vm,{children:[d.jsx(zi,{children:d.jsx(Bw,{checked:s.includes(_.id),onCheckedChange:()=>ee(_.id)})}),d.jsx(zi,{className:"font-medium max-w-xs truncate",children:_.summary}),d.jsx(zi,{children:d.jsx(cd,{variant:"outline",children:_.category})}),d.jsx(zi,{children:d.jsx(cd,{variant:_.importance==="critical"?"destructive":_.importance==="high"?"default":_.importance==="medium"?"secondary":"outline",children:_.importance})}),d.jsx(zi,{children:d.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(wS,{className:"w-4 h-4"}),new Date(_.created_at).toLocaleDateString()]})}),d.jsx(zi,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(cr,{variant:"ghost",size:"sm",onClick:()=>J(_),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.jsx(Hl,{className:"w-4 h-4"})}),d.jsx(cr,{variant:"ghost",size:"sm",onClick:()=>ae(_.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:d.jsx(Ai,{className:"w-4 h-4"})})]})})]},_.id))})]})})]}),S&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs(Bm,{className:"w-full max-w-md mx-4",children:[d.jsx(Zw,{children:d.jsx(vF,{children:"Delete Memories"})}),d.jsxs(Zm,{children:[d.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",s.length," ","memory(ies)? This action cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(cr,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),d.jsx(cr,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),d.jsx(SF,{isOpen:O,onClose:()=>C(!1),memory:T}),d.jsx(z2,{isOpen:R,onClose:()=>I(!1),onConfirm:V,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},Va=Ha.getInstance(),Sr={fetchServers:async()=>Va.get("/mcp/servers"),addServer:async(e,t)=>Va.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>Va.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>Va.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>Va.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>Va.post("/mcp/reload",{}),fetchStatus:async()=>Va.get("/mcp/status"),fetchStats:async()=>Va.get("/mcp/stats")},jF=({label:e,values:t,onChange:n,placeholder:a})=>{const s=t.length>0?t:[""],u=(h,m)=>{const g=[...s];g[h]=m,n(g.filter(y=>y.trim().length>0))},l=()=>n([...s,""]),f=h=>{const m=s.filter((g,y)=>y!==h);n(m.filter(g=>g.trim().length>0))};return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),s.map((h,m)=>d.jsxs("div",{className:"flex gap-2",children:[d.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)}),d.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:()=>f(m),children:"Remove"})]},`${e}-${m}`)),d.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"})]})},Iw=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const u=z.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,y)=>{const v=[...u];v[m]={...v[m],[g]:y},n(v.filter(b=>b.key.trim().length>0||b.value.trim().length>0))},f=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((y,v)=>v!==m);n(g.filter(y=>y.key.trim().length>0||y.value.trim().length>0))};return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),u.map((m,g)=>d.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[d.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:y=>l(g,"key",y.target.value)}),d.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:s,onChange:y=>l(g,"value",y.target.value)}),d.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}`)),d.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:f,children:"Add entry"})]})},NF=({transport:e,command:t,url:n,args:a,env:s,headers:u,onCommandChange:l,onUrlChange:f,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>d.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",d.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:y=>l(y.target.value),placeholder:"npx"})]}),d.jsx(jF,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",d.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:y=>f(y.target.value),placeholder:"https://example.com/mcp"})]}),d.jsx(Iw,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&d.jsx(Iw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),CF=VH({name:Um().min(1,"Name is required"),transport:v2([Lw("stdio"),Lw("http")]),command:Um().optional(),url:Um().optional()}),Rc=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Im=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),EF=({open:e,mode:t,initial:n,onClose:a,onSubmit:s})=>{const[u,l]=z.useState(n?.name??""),[f,h]=z.useState(n?.config.transport??"stdio"),[m,g]=z.useState(n?.config.transport==="stdio"?n.config.command:""),[y,v]=z.useState(n?.config.transport==="http"?n.config.url:""),[b,S]=z.useState(n?.config.args??[]),[N,T]=z.useState(Rc(n?.config.env)),[E,O]=z.useState(n?.config.transport==="http"?Rc(n.config.headers):[]),[C,P]=z.useState(null);z.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),v(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),T(Rc(n?.config.env)),O(n?.config.transport==="http"?Rc(n.config.headers):[]),P(null))},[e,n]);const M=t==="create",R=async()=>{const B=CF.safeParse({name:u,transport:f,command:m,url:y});if(!B.success){P(B.error.issues[0]?.message??"Invalid form");return}if(f==="stdio"&&(!m||m.trim().length===0)){P("Command is required for stdio transport.");return}if(f==="http"&&(!y||y.trim().length===0)){P("URL is required for http transport.");return}const Y=f==="stdio"?{transport:"stdio",command:m.trim(),args:b.length>0?b:void 0,env:N.length>0?Im(N):void 0}:{transport:"http",url:y.trim(),headers:E.length>0?Im(E):void 0,env:N.length>0?Im(N):void 0};P(null),await s(u.trim(),Y)},I=z.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return d.jsx(hr,{open:e,onOpenChange:a,children:d.jsxs(Js,{children:[d.jsx(mr,{children:d.jsx(pr,{children:I})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",d.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:B=>l(B.target.value),placeholder:"coolify",disabled:!M})]}),d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",d.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:f,onChange:B=>h(B.target.value),children:[d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),d.jsx(NF,{transport:f,command:m,url:y,args:b,env:N,headers:E,onCommandChange:g,onUrlChange:v,onArgsChange:S,onEnvChange:T,onHeadersChange:O}),C&&d.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}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.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"}),d.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:R,children:"Save"})]})]})]})})},TF=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:s})=>d.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:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"text-lg font-semibold text-azure-text-primary break-words dark:text-matrix-highlight",children:e.name}),d.jsx("div",{className:"text-xs uppercase tracking-wide text-azure-text-muted dark:text-matrix-secondary",children:e.config.transport})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[t&&d.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"}),d.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:()=>s(e,!e.enabled),children:e.enabled?"Enabled":"Disabled"})]})]}),d.jsxs("div",{className:"mt-4 space-y-2 text-sm text-azure-text-secondary dark:text-matrix-secondary",children:[e.config.transport==="stdio"&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Command:"})," ",e.config.command]}),e.config.transport==="http"&&d.jsxs("div",{className:"break-all",children:[d.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&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Args:"})," ",e.config.args.join(" ")]}),t&&!t.ok&&t.error&&d.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})]}),d.jsxs("div",{className:"mt-4 flex gap-2",children:[d.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"}),d.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"})]})]}),AF=()=>{const{data:e,error:t,mutate:n,isLoading:a}=kt("/api/mcp/servers",()=>Sr.fetchServers()),[s,u]=z.useState(""),[l,f]=z.useState("all"),[h,m]=z.useState(!1),[g,y]=z.useState(null),[v,b]=z.useState(!1),[S,N]=z.useState(null),[T,E]=z.useState(null),[O,C]=z.useState({}),[P,M]=z.useState(!1),[R,I]=z.useState(!1),[B,Y]=z.useState(null),fe=e?.servers??[];z.useEffect(()=>{Sr.fetchStats().then(_=>{Y(_);const U={};for(const w of _.servers)U[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};C(U)}).catch(()=>{})},[]);const se=z.useMemo(()=>fe.filter(_=>{const U=_.name.toLowerCase().includes(s.toLowerCase()),w=l==="all"||_.config.transport===l;return U&&w}),[fe,s,l]),le=()=>{y(null),m(!0)},ee=_=>{y(_),m(!0)},oe=async()=>{const _=await Sr.fetchStats();Y(_);const U={};for(const w of _.servers)U[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};return C(U),_},ae=async(_,U)=>{try{g?await Sr.updateServer(g.name,U):await Sr.addServer(_,U),m(!1),y(null),await n(),await Sr.reloadTools();const w=await oe();E({type:"success",message:`MCP server saved. Tools reloaded: ${w.totalTools} total.`})}catch(w){E({type:"error",message:w.message||"Failed to save MCP server."})}},V=async _=>{N(_),b(!0)},J=async()=>{if(S)try{await Sr.deleteServer(S.name),await n(),b(!1),N(null),await Sr.reloadTools();const _=await oe();E({type:"success",message:`MCP server deleted. Tools reloaded: ${_.totalTools} total.`})}catch(_){E({type:"error",message:_.message||"Failed to delete MCP server."})}},K=async()=>{M(!0);try{const _=await oe();E({type:"success",message:`Status checked: ${_.totalTools} tools from ${_.servers.length} servers.`})}catch(_){E({type:"error",message:_.message||"Failed to check MCP status."})}finally{M(!1)}},ye=async()=>{I(!0);try{await Sr.reloadTools();const _=await oe();E({type:"success",message:`MCP tools reloaded: ${_.totalTools} tools from ${_.servers.length} servers.`})}catch(_){E({type:"error",message:_.message||"Failed to reload MCP tools."})}finally{I(!1)}},A=async(_,U)=>{try{await Sr.toggleServer(_.name,U),await n(),await Sr.reloadTools();const w=await oe();E({type:"success",message:`MCP server ${U?"enabled":"disabled"}. Tools reloaded: ${w.totalTools} total.`})}catch(w){E({type:"error",message:w.message||"Failed to toggle MCP server."})}};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),B&&B.totalTools>0&&d.jsxs("span",{className:"rounded-full bg-azure-primary/10 px-3 py-1 text-sm font-semibold text-azure-primary dark:bg-matrix-highlight/20 dark:text-matrix-highlight",children:[B.totalTools," tools cached"]})]}),d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Manage MCP servers stored in mcps.json."," ",B?.lastLoadedAt&&d.jsxs("span",{className:"text-azure-text-muted dark:text-matrix-tertiary",children:["Last loaded: ",new Date(B.lastLoadedAt).toLocaleTimeString()]})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"button",disabled:P,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:K,children:P?"Checking…":"Check Status"}),d.jsx("button",{type:"button",disabled:R,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:ye,children:R?"Reloading…":"Reload MCPs"}),d.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:le,children:"Add Server"})]})]}),T&&d.jsx("div",{className:`p-4 rounded border ${T.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:T.message}),d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[d.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:s,onChange:_=>u(_.target.value),placeholder:"Search by name"}),d.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:_=>f(_.target.value),children:[d.jsx("option",{value:"all",children:"All"}),d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),a&&d.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&d.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&se.length===0&&d.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."}),d.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:se.map(_=>d.jsx(TF,{server:_,probeResult:O[_.name],onEdit:ee,onDelete:V,onToggle:A},`${_.name}-${_.enabled?"on":"off"}`))}),d.jsx(EF,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:ae}),d.jsx(hr,{open:v,onOpenChange:b,children:d.jsxs(Js,{children:[d.jsx(mr,{children:d.jsx(pr,{children:"Confirm Deletion"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",d.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',S?.name,'"']}),"? This action cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.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:()=>b(!1),children:"Cancel"}),d.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:J,children:"Delete"})]})]})]})})]})},Hm={list:()=>xe.get("/model-pricing"),upsert:e=>xe.post("/model-pricing",e),update:(e,t,n)=>xe.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>xe.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},OF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Hw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},RF=["anthropic","openai","google","openrouter","ollama","other"],Fw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),DF=()=>{const{data:e=[],mutate:t}=kt("/api/model-pricing",()=>Hm.list()),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Fw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[v,b]=z.useState(!1),S=(C,P)=>{y({type:C,message:P}),setTimeout(()=>y(null),3e3)},N=()=>{u(null),f(Fw()),a(!0)},T=C=>{u(C),f({...C}),a(!0)},E=async()=>{if(!(!l.provider.trim()||!l.model.trim())){b(!0);try{await Hm.upsert(l),await t(),a(!1),S("success",s?"Pricing updated.":"Pricing created.")}catch{S("error","Failed to save pricing entry.")}finally{b(!1)}}},O=async()=>{if(h)try{await Hm.delete(h.provider,h.model),await t(),m(null),S("success","Pricing entry deleted.")}catch{S("error","Failed to delete pricing entry.")}};return d.jsxs(Ye.div,{variants:OF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Ye.div,{variants:Hw,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(qc,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Model Pricing"}),d.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."})]})]}),d.jsxs("button",{onClick:N,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:[d.jsx(md,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&d.jsx(Ye.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}),d.jsx(Ye.div,{variants:Hw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(C=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:C},C))})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.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=>d.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:[d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:C.provider}),d.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:C.model}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.input_price_per_1m.toFixed(4)]}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.output_price_per_1m.toFixed(4)]}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>T(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:d.jsx(ig,{className:"w-4 h-4"})}),d.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:d.jsx(Ai,{className:"w-4 h-4"})})]})})]},`${C.provider}/${C.model}`))})]})}),d.jsx(hr,{open:n,onOpenChange:a,children:d.jsxs(Js,{children:[d.jsx(mr,{children:d.jsx(pr,{children:s?"Edit Pricing":"Add Pricing"})}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),s?d.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}):d.jsxs("select",{value:l.provider,onChange:C=>f({...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:[d.jsx("option",{value:"",children:"Select provider..."}),RF.map(C=>d.jsx("option",{value:C,children:C},C))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),s?d.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}):d.jsx("input",{type:"text",value:l.model,onChange:C=>f({...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"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),d.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:C=>f({...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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),d.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:C=>f({...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"})]})]}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[d.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"}),d.jsx("button",{onClick:E,disabled:v||!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:v?"Saving...":"Save"})]})]})]})}),d.jsx(hr,{open:!!h,onOpenChange:C=>!C&&m(null),children:d.jsxs(Js,{children:[d.jsx(mr,{children:d.jsx(pr,{children:"Delete Pricing Entry"})}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",d.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.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"}),d.jsx("button",{onClick:O,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},MF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},qw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},$F=["ui","telegram","discord"],Gw=()=>({name:"",prompt:"",notification_channels:["ui"]}),LF=()=>{const{data:e=[],mutate:t}=kt("/webhooks",()=>Za.list(),{refreshInterval:1e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Gw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[v,b]=z.useState(!1),[S,N]=z.useState(null),[T,E]=z.useState(null),O=(ee,oe)=>{y({type:ee,message:oe}),setTimeout(()=>y(null),3500)},C=()=>{u(null),f(Gw()),E(null),a(!0)},P=ee=>{u(ee),f({name:ee.name,prompt:ee.prompt,notification_channels:ee.notification_channels}),E(null),a(!0)},M=ee=>/^[a-z0-9-_]+$/.test(ee),R=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!M(l.name)){E("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){E("Select at least one notification channel.");return}E(null),b(!0);try{s?(await Za.update(s.id,l),O("success","Webhook updated.")):(await Za.create(l),O("success","Webhook created.")),await t(),a(!1)}catch(ee){const oe=ee?.message||"Failed to save webhook.";E(oe)}finally{b(!1)}}},I=async ee=>{try{await Za.update(ee.id,{enabled:!ee.enabled}),await t()}catch{O("error","Failed to toggle webhook.")}},B=async()=>{if(h)try{await Za.delete(h.id),await t(),m(null),O("success","Webhook deleted.")}catch{O("error","Failed to delete webhook.")}},Y=ee=>`${window.location.origin}/api/webhooks/trigger/${ee}`,fe=ee=>`curl -X POST ${Y(ee.name)} \\
|
|
109
|
-
-H "x-api-key: ${ee.api_key}" \\
|
|
110
|
-
-H "Content-Type: application/json" \\
|
|
111
|
-
-d '{"event":"your_payload"}'`,se=async(ee,oe)=>{await navigator.clipboard.writeText(ee),N(oe),setTimeout(()=>N(null),2e3)},le=ee=>{const oe=l.notification_channels.includes(ee);f({...l,notification_channels:oe?l.notification_channels.filter(ae=>ae!==ee):[...l.notification_channels,ee]})};return d.jsxs(Ye.div,{variants:MF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Ye.div,{variants:qw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Wm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Webhooks"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(Ia,{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:[d.jsx(Cl,{className:"w-4 h-4"}),"Notifications"]}),d.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:[d.jsx(md,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&d.jsx(Ye.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}),d.jsx(Ye.div,{variants:qw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(ee=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ee},ee))})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",d.jsx("button",{onClick:C,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ee=>d.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:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:ee.name})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[ee.api_key.slice(0,16),"…"]}),d.jsx("button",{onClick:()=>se(fe(ee),`curl-${ee.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:S===`curl-${ee.id}`?d.jsx(Km,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(Qm,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:()=>se(ee.api_key,`key-${ee.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:S===`key-${ee.id}`?d.jsx(Km,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(uA,{className:"w-3.5 h-3.5"})})]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"flex gap-1 flex-wrap",children:ee.notification_channels.map(oe=>d.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))})}),d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ee.trigger_count}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("button",{onClick:()=>I(ee),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ee.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:ee.enabled?d.jsxs(d.Fragment,{children:[d.jsx(CS,{className:"w-3.5 h-3.5"})," Enabled"]}):d.jsxs(d.Fragment,{children:[d.jsx(NS,{className:"w-3.5 h-3.5"})," Disabled"]})})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>P(ee),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:d.jsx(ig,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(ee),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:d.jsx(Ai,{className:"w-4 h-4"})})]})})]},ee.id))})]})})}),d.jsxs(hr,{open:n,onOpenChange:a,children:[d.jsx(mr,{children:d.jsx(pr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Webhook":"New Webhook"})}),d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",d.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),d.jsx("input",{type:"text",value:l.name,onChange:ee=>{f({...l,name:ee.target.value.toLowerCase().replace(/\s+/g,"-")}),E(null)},placeholder:"e.g. deploy-done, github-issue-opened",disabled:!!s,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&&d.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",d.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),d.jsx("textarea",{rows:5,value:l.prompt,onChange:ee=>f({...l,prompt:ee.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),d.jsx("div",{className:"flex gap-4",children:$F.map(ee=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(ee),onChange:()=>le(ee),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),d.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:ee})]},ee))})]}),T&&d.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:T}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[d.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"}),d.jsx("button",{onClick:R,disabled:v||!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:v?"Saving…":s?"Update":"Create"})]})]})]}),d.jsxs(hr,{open:!!h,onOpenChange:ee=>!ee&&m(null),children:[d.jsx(mr,{children:d.jsx(pr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",d.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.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"}),d.jsx("button",{onClick:B,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},PF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Yw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},Kw=({status:e})=>e==="completed"?d.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[d.jsx(SS,{className:"w-4 h-4"}),d.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?d.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[d.jsx(Xm,{className:"w-4 h-4"}),d.jsx("span",{className:"text-xs",children:"Failed"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[d.jsx(qa,{className:"w-4 h-4 animate-pulse"}),d.jsx("span",{className:"text-xs",children:"Pending"})]}),Dc=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),UF=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},VF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),{data:s=[],mutate:u}=kt(["/webhooks/notifications",e],()=>Za.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=s.filter(g=>!g.read).length,f=async g=>{g.length!==0&&(await Za.markRead(g),await u())},h=()=>{const g=s.filter(y=>!y.read).map(y=>y.id);f(g)},m=async g=>{a(g),g.read||await f([g.id])};return d.jsxs(Ye.div,{variants:PF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Ye.div,{variants:Yw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Cl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),l>0&&d.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})]}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Notifications"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsxs(Ia,{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:[d.jsx(DT,{className:"w-4 h-4"}),"Back to Webhooks"]}),d.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:[d.jsx(bA,{className:"w-4 h-4"}),"Unread only"]}),l>0&&d.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:[d.jsx(GT,{className:"w-4 h-4"}),"Mark all read"]})]})]}),d.jsx(Ye.div,{variants:Yw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),d.jsx("tbody",{children:s.length===0?d.jsx("tr",{children:d.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."})}):s.map(g=>d.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:[d.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&d.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),d.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(Kw,{status:g.status})}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:Dc(g.created_at)}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?Dc(g.completed_at):"—"}),d.jsx("td",{className:"px-4 py-3",children:d.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:d.jsx(Hl,{className:"w-4 h-4"})})})]},g.id))})]})})}),d.jsxs(hr,{open:!!n,onOpenChange:g=>!g&&a(null),children:[d.jsx(mr,{children:d.jsxs(pr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cl,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[d.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[d.jsx(Kw,{status:n.status}),d.jsx("span",{children:Dc(n.created_at)}),n.completed_at&&d.jsxs("span",{children:["→ ",Dc(n.completed_at)]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),d.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:UF(n.payload)})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),d.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??d.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),d.jsx("div",{className:"flex justify-end pt-2",children:d.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"})})]})]})]})},BF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Mc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},ZF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function IF({status:e}){return e==="completed"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[d.jsx(SS,{className:"w-4 h-4"}),"Completed"]}):e==="failed"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600 dark:text-red-400",children:[d.jsx(Xm,{className:"w-4 h-4"}),"Failed"]}):e==="running"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[d.jsx(EA,{className:"w-4 h-4 animate-spin"}),"Running"]}):e==="cancelled"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[d.jsx(Xm,{className:"w-4 h-4"}),"Cancelled"]}):d.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[d.jsx(qa,{className:"w-4 h-4"}),"Pending"]})}const Xw=e=>e?new Date(e).toLocaleString():"—";function HF(){const[e,t]=z.useState(""),[n,a]=z.useState(""),[s,u]=z.useState(""),[l,f]=z.useState(""),[h,m]=z.useState(null),g=z.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:s||void 0,session_id:l.trim()||void 0,limit:200}),[e,n,s,l]),{data:y}=kt("/tasks/stats",()=>Os.stats(),{refreshInterval:5e3}),{data:v=[],mutate:b}=kt(["/tasks",g],()=>Os.list(g),{refreshInterval:3e3});return d.jsxs(Ye.div,{variants:BF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Ye.div,{variants:Mc,className:"flex items-center gap-3",children:[d.jsx(Jm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Tasks"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),d.jsxs(Ye.div,{variants:Mc,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[d.jsx(Es,{label:"Pending",value:y?.pending??0}),d.jsx(Es,{label:"Running",value:y?.running??0}),d.jsx(Es,{label:"Completed",value:y?.completed??0}),d.jsx(Es,{label:"Failed",value:y?.failed??0}),d.jsx(Es,{label:"Cancelled",value:y?.cancelled??0}),d.jsx(Es,{label:"Total",value:y?.total??0})]}),d.jsxs(Ye.div,{variants:Mc,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:[d.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:S=>t(S.target.value||""),children:[d.jsx("option",{value:"",children:"All status"}),Object.entries(ZF).map(([S,N])=>d.jsx("option",{value:S,children:N},S))]}),d.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:S=>a(S.target.value||""),children:[d.jsx("option",{value:"",children:"All agents"}),d.jsx("option",{value:"apoc",children:"Apoc"}),d.jsx("option",{value:"neo",children:"Neo"})]}),d.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:s,onChange:S=>u(S.target.value||""),children:[d.jsx("option",{value:"",children:"All channels"}),d.jsx("option",{value:"telegram",children:"Telegram"}),d.jsx("option",{value:"ui",children:"UI"}),d.jsx("option",{value:"api",children:"API"}),d.jsx("option",{value:"webhook",children:"Webhook"}),d.jsx("option",{value:"cli",children:"CLI"})]}),d.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:S=>f(S.target.value),placeholder:"Filter by session id"})]}),d.jsx(Ye.div,{variants:Mc,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Task ID","Status","Agent","Channel","Session","Attempts","Created","Finished","Actions"].map(S=>d.jsx("th",{className:"text-left px-4 py-3 font-semibold text-azure-text-secondary dark:text-matrix-dim",children:S},S))})}),d.jsx("tbody",{children:v.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:9,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:"No tasks found."})}):v.map(S=>d.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:[d.jsx("td",{className:"px-4 py-3 font-mono",children:S.id.slice(0,8)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(IF,{status:S.status})}),d.jsx("td",{className:"px-4 py-3",children:S.agent.toUpperCase()}),d.jsx("td",{className:"px-4 py-3",children:S.origin_channel.toUpperCase()}),d.jsx("td",{className:"px-4 py-3 font-mono",children:S.session_id}),d.jsxs("td",{className:"px-4 py-3",children:[S.attempt_count,"/",S.max_attempts]}),d.jsx("td",{className:"px-4 py-3",children:Xw(S.created_at)}),d.jsx("td",{className:"px-4 py-3",children:Xw(S.finished_at)}),d.jsxs("td",{className:"px-4 py-3 flex items-center gap-1",children:[d.jsx("button",{onClick:()=>m(S),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim",children:d.jsx(Hl,{className:"w-4 h-4"})}),(S.status==="pending"||S.status==="running")&&d.jsx("button",{onClick:async()=>{await Os.cancel(S.id),await b()},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:d.jsx(LT,{className:"w-4 h-4"})})]})]},S.id))})]})}),d.jsxs(hr,{open:!!h,onOpenChange:S=>!S&&m(null),children:[d.jsx(mr,{children:d.jsx(pr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Task Details"})}),h&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[70vh] text-sm",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-azure-text-secondary dark:text-matrix-dim",children:[d.jsxs("div",{children:[d.jsx("b",{children:"ID:"})," ",d.jsx("span",{className:"font-mono",children:h.id})]}),d.jsxs("div",{children:[d.jsx("b",{children:"Status:"})," ",h.status]}),d.jsxs("div",{children:[d.jsx("b",{children:"Agent:"})," ",h.agent]}),d.jsxs("div",{children:[d.jsx("b",{children:"Origin:"})," ",h.origin_channel]}),d.jsxs("div",{children:[d.jsx("b",{children:"Session:"})," ",d.jsx("span",{className:"font-mono",children:h.session_id})]}),d.jsxs("div",{children:[d.jsx("b",{children:"Attempts:"})," ",h.attempt_count,"/",h.max_attempts]})]}),d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1",children:"Input"}),d.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&&d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1",children:"Output"}),d.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&&d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1 text-red-600 dark:text-red-400",children:"Error"}),d.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")&&d.jsxs("div",{className:"flex justify-end gap-2",children:[(h.status==="pending"||h.status==="running")&&d.jsx("button",{onClick:async()=>{await Os.cancel(h.id),m(null),await b()},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"&&d.jsx("button",{onClick:async()=>{await Os.retry(h.id),m(null),await b()},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 Es({label:e,value:t}){return d.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:[d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:e}),d.jsx("p",{className:"text-xl font-semibold text-azure-text-primary dark:text-matrix-highlight",children:t})]})}const Fm={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},Jw={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 qF(){return xe.get("/trinity/databases")}function GF(){const{data:e,error:t}=kt("/trinity/databases",qF,{refreshInterval:3e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Jw),[h,m]=z.useState(!1),[g,y]=z.useState(null),[v,b]=z.useState({}),[S,N]=z.useState(null),[T,E]=z.useState({}),[O,C]=z.useState(null),[P,M]=z.useState(null),[R,I]=z.useState(null),[B,Y]=z.useState(!1),fe=()=>{u(null),f(Jw),Y(!1),y(null),a(!0)},se=w=>{u(w),f({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}),Y(!!w.connection_string),y(null),a(!0)},le=async()=>{if(m(!0),y(null),!B&&!l.database_name.trim()){y(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};B?(!s||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,(!s||l.password)&&(w.password=l.password||null)),s?await xe.put(`/trinity/databases/${s.id}`,w):await xe.post("/trinity/databases",w),await Dn("/trinity/databases"),a(!1)}catch(w){y(w.message||"Failed to save database")}finally{m(!1)}},ee=w=>{I(w)},oe=async()=>{if(!R)return;const w=R.id;M(w);try{await xe.delete(`/trinity/databases/${w}`),await Dn("/trinity/databases")}catch(G){alert(`Delete failed: ${G.message}`)}finally{M(null),I(null)}},ae=async w=>{N(w);try{const G=await xe.post(`/trinity/databases/${w}/test`,{});E(de=>({...de,[w]:G.success}))}catch{E(G=>({...G,[w]:!1}))}finally{N(null)}},V=async w=>{C(w);try{await xe.post(`/trinity/databases/${w}/refresh-schema`,{}),await Dn("/trinity/databases")}catch(G){alert(`Schema refresh failed: ${G.message}`)}finally{C(null)}},J=w=>{b(G=>({...G,[w]:!G[w]}))},K=w=>{w!=="mongodb"&&Y(!1),f(G=>({...G,type:w,port:Fm[w]?String(Fm[w]):""}))},ye=w=>{f(G=>({...G,[w]:!G[w]}))};if(t)return d.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const A="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",_="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",U=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 d.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Zs,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Trinity Databases"})]}),d.jsxs("button",{onClick:fe,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:[d.jsx(md,{className:"w-4 h-4"}),"Register Database"]})]}),d.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?d.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:[d.jsx(Zs,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),d.jsx("p",{className:"font-medium",children:"No databases registered"}),d.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):d.jsx("div",{className:"space-y-4",children:e.map(w=>{const G=w.schema_json?JSON.parse(w.schema_json):null,de=!!G?.databases,he=de?G.databases.reduce((je,Ke)=>je+Ke.tables.length,0):G?.tables?.length??0,me=de?G.databases.length:0,Pe=w.type==="mongodb"?"collection":"table",Ae=w.type==="mongodb"?"collections":"tables",pt=T[w.id],Dt=v[w.id],$=U(w);return d.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[d.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[d.jsx(Zs,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),d.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}),pt===!0&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[d.jsx(Jh,{className:"w-3 h-3"})," Connected"]}),pt===!1&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[d.jsx(f4,{className:"w-3 h-3"})," Failed"]}),$.length>0&&d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(U0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),$.map(je=>d.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:je},je))]})]}),d.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&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",me," database",me!==1?"s":""," · ",he," ",he!==1?Ae:Pe]}),!de&&he>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",he," ",he!==1?Ae:Pe]}),w.schema_updated_at&&d.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),d.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d.jsx("button",{onClick:()=>ae(w.id),disabled:S===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:S===w.id?d.jsx(Jh,{className:"w-4 h-4 animate-pulse"}):d.jsx(Jh,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>V(w.id),disabled:O===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:d.jsx(Ds,{className:`w-4 h-4 ${O===w.id?"animate-spin":""}`})}),d.jsx("button",{onClick:()=>se(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"}),d.jsx("button",{onClick:()=>ee(w),disabled:P===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:d.jsx(Ai,{className:"w-4 h-4"})}),G&&d.jsx("button",{onClick:()=>J(w.id),title:Dt?"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:Dt?d.jsx(XT,{className:"w-4 h-4"}):d.jsx(QT,{className:"w-4 h-4"})})]})]}),Dt&&G&&d.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[d.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:de?`${me} database${me!==1?"s":""} — ${he} ${he!==1?Ae:Pe} total`:`Schema — ${he} ${he!==1?Ae:Pe}`}),d.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:de?G.databases?.map(je=>d.jsxs("div",{className:"text-xs",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[d.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:je.name}),d.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",je.tables.length," ",je.tables.length!==1?Ae:Pe,")"]})]}),d.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[je.tables.map(Ke=>d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:Ke.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:Ke.columns?.map(_t=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{children:_t.name}),d.jsx("span",{className:"opacity-50 ml-2",children:_t.type}),_t.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},_t.name))})]},Ke.name)),je.tables.length===0&&d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ae]})]})]},je.name)):G.tables?.map(je=>d.jsxs("div",{className:"text-xs",children:[d.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:je.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:je.columns?.map(Ke=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:Ke.name}),d.jsx("span",{className:"opacity-50 ml-2",children:Ke.type}),Ke.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},Ke.name))})]},je.name))})]})]},w.id)})}):d.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),d.jsx(rj,{isOpen:!!R,onClose:()=>I(null),onConfirm:oe,title:"Delete database",description:`Remove "${R?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),d.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:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Database":"Register Database"}),d.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:d.jsx(lg,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:_,children:"Name *"}),d.jsx("input",{className:A,value:l.name,onChange:w=>f(G=>({...G,name:w.target.value})),placeholder:"My Production DB"})]}),d.jsxs("div",{children:[d.jsx("label",{className:_,children:"Type *"}),d.jsxs("select",{className:A,value:l.type,onChange:w=>K(w.target.value),children:[d.jsx("option",{value:"postgresql",children:"PostgreSQL"}),d.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),d.jsx("option",{value:"sqlite",children:"SQLite"}),d.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{type:"button",onClick:()=>Y(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${B?"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"}),d.jsx("button",{type:"button",onClick:()=>Y(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${B?"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"&&B?d.jsxs("div",{children:[d.jsxs("label",{className:_,children:["Connection String ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:A,type:"password",value:l.connection_string,onChange:w=>f(G=>({...G,connection_string:w.target.value})),placeholder:s?"unchanged":"mongodb://user:pass@host:27017/dbname"}),d.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."})]}):d.jsxs(d.Fragment,{children:[l.type!=="sqlite"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:_,children:"Host"}),d.jsx("input",{className:A,value:l.host,onChange:w=>f(G=>({...G,host:w.target.value})),placeholder:"localhost"})]}),d.jsxs("div",{children:[d.jsx("label",{className:_,children:"Port"}),d.jsx("input",{className:A,type:"number",value:l.port,onChange:w=>f(G=>({...G,port:w.target.value})),placeholder:String(Fm[l.type]||"")})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:_,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),d.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=>f(G=>({...G,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:_,children:"Username"}),d.jsx("input",{className:A,value:l.username,onChange:w=>f(G=>({...G,username:w.target.value})),placeholder:"postgres"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:_,children:["Password ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:A,type:"password",value:l.password,onChange:w=>f(G=>({...G,password:w.target.value})),placeholder:s?"unchanged":"••••••••"}),d.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."})]})]})]}),d.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(U0,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),d.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),d.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."}),d.jsx("div",{className:"space-y-2",children:FF[l.type]?.map(({key:w,label:G,description:de})=>d.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[d.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[d.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>ye(w),className:"sr-only"}),d.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]&&d.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:d.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:G}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:de})]})]},w))})]}),g&&d.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),d.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[d.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"}),d.jsx("button",{onClick:le,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...":s?"Update":"Register"})]})]})]})]})}const YF={running:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",success:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",failed:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",timeout:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400"};function KF({jobId:e}){const{data:t,isLoading:n}=u9(e,50);return n?d.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary animate-pulse",children:"Loading history…"}):!t||t.length===0?d.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary italic",children:"No executions yet."}):d.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary dark:bg-zinc-900 overflow-hidden",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Triggered At"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Completed At"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Status"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Error"})]})}),d.jsx("tbody",{children:t.map(a=>d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0",children:[d.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:new Date(a.triggered_at).toLocaleString()}),d.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:a.completed_at?new Date(a.completed_at).toLocaleString():"—"}),d.jsx("td",{className:"px-3 py-2",children:d.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold uppercase ${YF[a.status]}`,children:a.status})}),d.jsx("td",{className:"px-3 py-2 dark:text-red-400 max-w-xs truncate",children:a.error??"—"})]},a.id))})]})})}function XF({enabled:e}){return d.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold uppercase ${e?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-zinc-800 dark:text-matrix-tertiary"}`,children:e?"Enabled":"Disabled"})}function Qw(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Ww(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function JF({onEdit:e}){const{data:t,isLoading:n}=l9(),[a,s]=z.useState(null),[u,l]=z.useState(null),[f,h]=z.useState(null),m=async y=>{l(y.id);try{y.enabled?await Ti.disableJob(y.id):await Ti.enableJob(y.id),await Dn(v=>typeof v=="string"&&v.startsWith("/chronos"))}finally{l(null)}},g=async()=>{if(f){l(f.id);try{await Ti.deleteJob(f.id),await Dn(y=>typeof y=="string"&&y.startsWith("/chronos"))}finally{l(null),h(null)}}};return n?d.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary p-8 text-center dark:text-matrix-secondary animate-pulse",children:"Loading jobs…"}):!t||t.length===0?d.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary p-8 text-center dark:text-matrix-secondary",children:["No Chronos jobs yet. Click ",d.jsx("strong",{className:"dark:text-matrix-highlight",children:"New Job"})," to get started."]}):d.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary overflow-hidden",children:[d.jsxs("table",{className:"w-full text-sm font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900",children:[d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Prompt"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden md:table-cell",children:"Schedule"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden lg:table-cell",children:"Next Run"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden lg:table-cell",children:"Last Run"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Status"}),d.jsx("th",{className:"px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium text-right",children:"Actions"})]})}),d.jsx("tbody",{children:t.map(y=>d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0 hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary max-w-xs",children:[d.jsx("span",{title:y.prompt,children:Qw(y.prompt,50)}),d.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:y.created_by})]}),d.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden md:table-cell text-xs",children:[d.jsx("div",{className:"capitalize",children:y.schedule_type}),d.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:y.schedule_expression,children:y.schedule_expression})]}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Ww(y.next_run_at)}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Ww(y.last_run_at)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(XF,{enabled:y.enabled})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.jsx("button",{title:a===y.id?"Hide history":"View history",onClick:()=>s(a===y.id?null:y.id),className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors",children:a===y.id?d.jsx(eA,{className:"w-4 h-4"}):d.jsx(SA,{className:"w-4 h-4"})}),d.jsx("button",{title:"Edit",onClick:()=>e(y),className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors",children:d.jsx(UA,{className:"w-4 h-4"})}),d.jsx("button",{title:y.enabled?"Disable":"Enable",onClick:()=>m(y),disabled:u===y.id,className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors disabled:opacity-40",children:y.enabled?d.jsx(LA,{className:"w-4 h-4"}):d.jsx(ZA,{className:"w-4 h-4"})}),d.jsx("button",{title:"Delete",onClick:()=>h(y),disabled:u===y.id,className:"p-1.5 rounded text-red-500 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-40",children:d.jsx(Ai,{className:"w-4 h-4"})})]})})]},y.id),a===y.id&&d.jsx("tr",{className:"bg-azure-surface dark:bg-zinc-900/50",children:d.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[d.jsx("div",{className:"text-xs font-bold dark:text-matrix-highlight mb-2",children:"Execution History"}),d.jsx(KF,{jobId:y.id})]})},`${y.id}-history`)]}))})]}),d.jsx(z2,{isOpen:!!f,onClose:()=>h(null),onConfirm:g,title:"Delete Chronos Job",message:f?`Delete job "${Qw(f.prompt,60)}"? This action cannot be undone.`:""})]})}function QF({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=z.useState(null),[u,l]=z.useState(null),f=z.useRef(null);if(z.useEffect(()=>{if(!e.trim()){s(null),l(null);return}return f.current&&clearTimeout(f.current),f.current=setTimeout(async()=>{try{const m=await Ti.preview(e,t,n);s(m),l(null)}catch(m){l(m.message??"Invalid expression"),s(null)}},500),()=>{f.current&&clearTimeout(f.current)}},[e,t,n]),!e.trim())return null;const h=(m,g)=>{try{return new Date(m).toLocaleString("pt-BR",{timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return new Date(m).toLocaleString()}};return d.jsx("div",{className:"mt-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900 p-3 text-sm",children:u?d.jsxs("p",{className:"text-red-500 dark:text-red-400 flex items-center gap-1.5",children:[d.jsx("span",{children:"⚠"})," ",u]}):a?d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(qa,{className:"w-3.5 h-3.5 text-azure-primary dark:text-matrix-highlight shrink-0"}),d.jsx("span",{className:"font-medium dark:text-matrix-highlight",children:"Next run:"}),d.jsx("span",{children:h(a.next_run_at,n||"UTC")})]}),a.human_readable&&d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary/70 pl-5",children:a.human_readable}),a.next_occurrences.length>0&&d.jsx("div",{className:"pl-5 space-y-0.5",children:a.next_occurrences.map((m,g)=>d.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",g+2,": ",m]},g))})]}):d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})})}const WF=["UTC","America/Sao_Paulo","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Mexico_City","America/Buenos_Aires","America/Bogota","America/Lima","America/Santiago","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Europe/Madrid","Europe/Lisbon","Europe/Moscow","Europe/Istanbul","Asia/Dubai","Asia/Kolkata","Asia/Bangkok","Asia/Singapore","Asia/Tokyo","Asia/Shanghai","Asia/Seoul","Asia/Jakarta","Australia/Sydney","Australia/Melbourne","Pacific/Auckland","Africa/Cairo","Africa/Johannesburg","Africa/Lagos"],eq=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],tq=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],nq={once:'e.g. "in 30 minutes", "tomorrow at 9am", "2026-03-01T09:00:00"',cron:'e.g. "0 9 * * 1-5" (weekdays at 9am)',interval:'e.g. "every 30 minutes", "every sunday at 9am", "every weekday"'};function rq({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:u}=aj(),[l,f]=z.useState(""),[h,m]=z.useState("once"),[g,y]=z.useState(""),[v,b]=z.useState("UTC"),[S,N]=z.useState([]),[T,E]=z.useState(null),[O,C]=z.useState(!1),P=R=>{N(I=>I.includes(R)?I.filter(B=>B!==R):[...I,R])};z.useEffect(()=>{a?(f(a.prompt),m(a.schedule_type),y(a.schedule_expression),b(a.timezone),N(a.notify_channels??[])):(f(""),m("once"),y(""),b(u?.timezone??"UTC"),N([])),E(null)},[a,e,u?.timezone]);const M=async()=>{if(E(null),!l.trim()){E("Prompt is required");return}if(!g.trim()){E("Schedule expression is required");return}C(!0);try{if(s&&a){const R={prompt:l,schedule_expression:g,timezone:v,notify_channels:S};await Ti.updateJob(a.id,R)}else{const R={prompt:l,schedule_type:h,schedule_expression:g,timezone:v,notify_channels:S};await Ti.createJob(R)}await Dn(R=>typeof R=="string"&&R.startsWith("/chronos")),n(),t()}catch(R){E(R.message??"Failed to save job")}finally{C(!1)}};return e?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),d.jsxs("div",{className:"relative z-10 w-full max-w-lg mx-4 rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black shadow-xl",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono",children:s?"Edit Chronos Job":"New Chronos Job"}),d.jsx("button",{onClick:t,className:"p-1 rounded text-azure-text-muted dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight transition-colors",children:d.jsx(lg,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx(Fe,{label:"Prompt",value:l,onChange:R=>f(R.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&d.jsx(wn,{label:"Schedule Type",value:h,onChange:R=>m(R.target.value),options:tq}),d.jsxs("div",{children:[d.jsx(Fe,{label:"Schedule Expression",value:g,onChange:R=>y(R.target.value),placeholder:nq[h]}),d.jsx(QF,{scheduleExpression:g,scheduleType:h,timezone:v})]}),d.jsx(wn,{label:"Timezone",value:v,onChange:R=>b(R.target.value),options:WF.map(R=>({value:R,label:R}))}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:["Notify Channels ",d.jsx("span",{className:"text-xs font-normal opacity-60",children:"(empty = all active channels)"})]}),d.jsx("div",{className:"flex gap-4",children:eq.map(({value:R,label:I})=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:S.includes(R),onChange:()=>P(R),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),d.jsx("span",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary capitalize",children:I})]},R))})]}),T&&d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:T})]}),d.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-azure-border dark:border-matrix-primary",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 rounded text-sm border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors font-mono",children:"Cancel"}),d.jsx("button",{onClick:M,disabled:O,className:"px-4 py-2 rounded text-sm bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight font-bold hover:opacity-90 disabled:opacity-50 transition-opacity font-mono",children:O?"Saving…":s?"Update":"Create"})]})]})]}):null}function aq(){const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=f=>{a(f),t(!0)},u=()=>{t(!1),a(null)},l=()=>{Dn(f=>typeof f=="string"&&f.startsWith("/chronos"))};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(qa,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Chronos"}),d.jsx("p",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary mt-0.5",children:"Temporal Intent Engine — schedule prompts for the Oracle"})]})]}),d.jsxs("button",{onClick:()=>{a(null),t(!0)},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:[d.jsx(md,{className:"w-4 h-4"}),"New Job"]})]}),d.jsx(JF,{onEdit:s}),d.jsx(rq,{isOpen:e,onClose:u,onCreated:l,editJob:n})]})}const Ts=Ha.getInstance(),As={fetchSkills:async()=>Ts.get("/skills"),fetchSkill:async e=>Ts.get(`/skills/${encodeURIComponent(e)}`),reloadSkills:async()=>Ts.post("/skills/reload",{}),enableSkill:async e=>Ts.post(`/skills/${encodeURIComponent(e)}/enable`,{}),disableSkill:async e=>Ts.post(`/skills/${encodeURIComponent(e)}/disable`,{}),uploadSkill:async e=>Ts.uploadFile("/skills/upload",e)},eS={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Hc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function iq({skill:e,onToggle:t,onView:n}){return d.jsxs(Ye.div,{variants:Hc,className:`rounded-lg border p-4 transition-all ${e.enabled?"border-azure-primary dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950":"border-azure-border dark:border-zinc-700 bg-azure-surface/50 dark:bg-zinc-900/50 opacity-60"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h3",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight truncate",children:e.name}),e.version&&d.jsxs("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:["v",e.version]})]}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1 line-clamp-2",children:e.description}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full bg-azure-primary/10 dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-primary",children:[d.jsx(sg,{className:"w-3 h-3"}),a]},a))})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:n,className:"p-2 rounded-lg hover:bg-azure-hover dark:hover:bg-zinc-800 text-azure-text-secondary dark:text-matrix-tertiary",title:"View details",children:d.jsx(Hl,{className:"w-4 h-4"})}),d.jsx("button",{onClick:t,className:`p-2 rounded-lg transition-colors ${e.enabled?"text-green-600 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/20":"text-zinc-400 dark:text-zinc-600 hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,title:e.enabled?"Disable skill":"Enable skill",children:e.enabled?d.jsx(CS,{className:"w-5 h-5"}):d.jsx(NS,{className:"w-5 h-5"})})]})]}),e.author&&d.jsxs("div",{className:"flex items-center gap-1 mt-2 text-xs text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(og,{className:"w-3 h-3"}),e.author]})]})}function sq({skill:e,open:t,onOpenChange:n}){return e?d.jsxs(hr,{open:t,onOpenChange:n,children:[d.jsx(mr,{children:d.jsx(pr,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Tl,{className:"w-5 h-5"}),e.name,e.version&&d.jsxs("span",{className:"text-sm font-normal text-azure-text-secondary dark:text-matrix-dim",children:["v",e.version]})]})})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{children:d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:e.description})}),e.author&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(og,{className:"w-4 h-4"}),"Author: ",e.author]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(xA,{className:"w-4 h-4"}),"Path: ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:e.path})]}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-azure-primary/10 dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-primary",children:[d.jsx(sg,{className:"w-3 h-3"}),a]},a))}),e.examples&&e.examples.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"Examples"}),d.jsx("ul",{className:"list-disc list-inside text-sm text-azure-text-secondary dark:text-matrix-secondary space-y-1",children:e.examples.map((a,s)=>d.jsx("li",{children:a},s))})]}),e.content&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"SKILL.md Content"}),d.jsx("pre",{className:"p-3 rounded-lg bg-azure-hover dark:bg-zinc-900 text-xs overflow-auto max-h-64 text-azure-text-secondary dark:text-matrix-secondary whitespace-pre-wrap",children:e.content})]})]})]}):null}function oq(){const[e,t]=z.useState(null),[n,a]=z.useState(!1),[s,u]=z.useState(!1),[l,f]=z.useState(!1),[h,m]=z.useState(null),[g,y]=z.useState(null),v=z.useRef(null),{data:b,mutate:S,isLoading:N}=kt("/skills",()=>As.fetchSkills(),{refreshInterval:1e4}),T=b?.skills??[],E=b?.enabled??0,O=async()=>{await As.reloadSkills(),S()},C=async I=>{I.enabled?await As.disableSkill(I.name):await As.enableSkill(I.name),S()},P=async I=>{a(!0);try{const B=await As.fetchSkill(I.name);t(B)}finally{a(!1)}},M=async I=>{const B=I.target.files?.[0];if(B){m(null),y(null),f(!0);try{const Y=await As.uploadSkill(B);y(`Skill "${Y.skill.name}" uploaded successfully!`),S(),v.current&&(v.current.value="")}catch(Y){m({error:Y.message||"Upload failed",details:Y.details})}finally{f(!1)}}},R=()=>{m(null),y(null),u(!0)};return d.jsxs(Ye.div,{variants:eS,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Ye.div,{variants:Hc,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Tl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Skills"}),d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:[T.length," skill",T.length!==1?"s":"",", ",E," enabled"]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:R,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-primary dark:border-matrix-primary text-azure-primary dark:text-matrix-primary font-medium hover:bg-azure-primary/10 dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsx(pc,{className:"w-4 h-4"}),"Upload"]}),d.jsxs("button",{onClick:O,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[d.jsx(Ds,{className:"w-4 h-4"}),"Reload"]})]})]}),N?d.jsxs(Ye.div,{variants:Hc,className:"text-center py-12",children:[d.jsx(Ds,{className:"w-8 h-8 animate-spin mx-auto text-azure-text-secondary dark:text-matrix-dim"}),d.jsx("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-dim",children:"Loading skills..."})]}):T.length===0?d.jsxs(Ye.div,{variants:Hc,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[d.jsx(Tl,{className:"w-12 h-12 mx-auto text-azure-text-tertiary dark:text-matrix-dim"}),d.jsx("h3",{className:"mt-4 text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:"No skills found"}),d.jsxs("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-secondary max-w-md mx-auto",children:["Upload a skill ZIP or add skills manually to"," ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"~/.morpheus/skills/"}),". Each skill folder must contain a"," ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file with frontmatter."]}),d.jsxs("button",{onClick:R,className:"mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[d.jsx(pc,{className:"w-4 h-4"}),"Upload Skill"]})]}):d.jsx(Ye.div,{variants:eS,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:T.map(I=>d.jsx(iq,{skill:I,onToggle:()=>C(I),onView:()=>P(I)},I.name))}),d.jsx(sq,{skill:e,open:!!e,onOpenChange:I=>!I&&t(null)}),d.jsxs(hr,{open:s,onOpenChange:u,children:[d.jsx(mr,{children:d.jsx(pr,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(pc,{className:"w-5 h-5"}),"Upload Skill"]})})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm",children:["Upload a ZIP file containing your skill folder. The ZIP must have exactly one folder at root level with a valid ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file."]}),d.jsxs("div",{className:"border-2 border-dashed border-azure-border dark:border-matrix-primary rounded-lg p-6",children:[d.jsx("input",{ref:v,type:"file",accept:".zip,application/zip,application/x-zip-compressed",onChange:M,disabled:l,className:"hidden",id:"skill-upload-input"}),d.jsxs("label",{htmlFor:"skill-upload-input",className:`flex flex-col items-center gap-2 cursor-pointer ${l?"opacity-50 cursor-not-allowed":""}`,children:[l?d.jsx(Ds,{className:"w-8 h-8 animate-spin text-azure-primary dark:text-matrix-primary"}):d.jsx(pc,{className:"w-8 h-8 text-azure-text-tertiary dark:text-matrix-dim"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:l?"Uploading...":"Click to select ZIP file"})]})]}),h&&d.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:[d.jsx(nA,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:h.error}),h.details&&d.jsx("p",{className:"text-xs text-red-600 dark:text-red-300 mt-1",children:h.details})]})]}),g&&d.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800",children:[d.jsx(aA,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),d.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:g})]}),d.jsxs("div",{className:"rounded-lg bg-azure-hover dark:bg-zinc-900 p-3",children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"ZIP Structure Example"}),d.jsx("pre",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:`my-skill.zip
|
|
112
|
-
└── my-skill/
|
|
113
|
-
├── SKILL.md (required)
|
|
114
|
-
├── scripts/ (optional)
|
|
115
|
-
│ └── script.js
|
|
116
|
-
└── examples/ (optional)
|
|
117
|
-
└── output.txt`})]})]})]}),n&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsx(Ds,{className:"w-8 h-8 animate-spin text-white"})})]})}function lq(){return d.jsx(mT,{children:d.jsxs(E0,{children:[d.jsx(tn,{path:"/login",element:d.jsx(pF,{})}),d.jsx(tn,{path:"/*",element:d.jsx(gF,{children:d.jsx(DM,{children:d.jsxs(E0,{children:[d.jsx(tn,{path:"/",element:d.jsx(LM,{})}),d.jsx(tn,{path:"/chat",element:d.jsx(o9,{})}),d.jsx(tn,{path:"/zaion",element:d.jsx(fF,{})}),d.jsx(tn,{path:"/logs",element:d.jsx(hF,{})}),d.jsx(tn,{path:"/stats",element:d.jsx(mF,{})}),d.jsx(tn,{path:"/sati-memories",element:d.jsx(_F,{})}),d.jsx(tn,{path:"/mcp-servers",element:d.jsx(AF,{})}),d.jsx(tn,{path:"/model-pricing",element:d.jsx(DF,{})}),d.jsx(tn,{path:"/webhooks",element:d.jsx(LF,{})}),d.jsx(tn,{path:"/notifications",element:d.jsx(VF,{})}),d.jsx(tn,{path:"/tasks",element:d.jsx(HF,{})}),d.jsx(tn,{path:"/trinity-databases",element:d.jsx(GF,{})}),d.jsx(tn,{path:"/chronos",element:d.jsx(aq,{})}),d.jsx(tn,{path:"/skills",element:d.jsx(oq,{})}),d.jsx(tn,{path:"*",element:d.jsx(mS,{to:"/",replace:!0})})]})})})})]})})}YC.createRoot(document.getElementById("root")).render(d.jsx(z.StrictMode,{children:d.jsx(lq,{})}));
|