morpheus-cli 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devkit/registry.js +46 -1
- package/dist/http/api.js +31 -0
- package/dist/runtime/apoc.js +28 -11
- package/dist/runtime/audit/repository.js +132 -0
- package/dist/runtime/audit/types.js +1 -0
- package/dist/runtime/chronos/worker.js +20 -0
- package/dist/runtime/keymaker.js +22 -10
- package/dist/runtime/memory/sati/repository.js +1 -1
- package/dist/runtime/memory/sati/service.js +21 -0
- package/dist/runtime/memory/sqlite.js +73 -7
- package/dist/runtime/neo.js +27 -11
- package/dist/runtime/oracle.js +28 -1
- package/dist/runtime/smiths/delegator.js +30 -14
- package/dist/runtime/tasks/repository.js +15 -3
- package/dist/runtime/tasks/worker.js +79 -8
- package/dist/runtime/tools/apoc-tool.js +16 -1
- package/dist/runtime/tools/factory.js +42 -2
- package/dist/runtime/tools/neo-tool.js +16 -1
- package/dist/runtime/tools/smith-tool.js +17 -1
- package/dist/runtime/tools/trinity-tool.js +16 -1
- package/dist/runtime/trinity.js +25 -10
- package/dist/ui/assets/index-CZS235KG.js +177 -0
- package/dist/ui/assets/index-QQyZIsmH.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/sw.js +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/index-C8uUR62u.css +0 -1
- package/dist/ui/assets/index-mIH_kbig.js +0 -117
|
@@ -0,0 +1,177 @@
|
|
|
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 c of s)if(c.type==="childList")for(const o of c.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(s){if(s.ep)return;s.ep=!0;const c=n(s);fetch(s.href,c)}})();function Rx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bm={exports:{}},kl={};var i1;function dT(){if(i1)return kl;i1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,c){var o=null;if(c!==void 0&&(o=""+c),s.key!==void 0&&(o=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:e,type:a,key:o,ref:s!==void 0?s:null,props:c}}return kl.Fragment=t,kl.jsx=n,kl.jsxs=n,kl}var s1;function fT(){return s1||(s1=1,bm.exports=dT()),bm.exports}var u=fT(),vm={exports:{}},Ae={};var o1;function hT(){if(o1)return Ae;o1=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"),c=Symbol.for("react.consumer"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(C){return C===null||typeof C!="object"?null:(C=b&&C[b]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,A={};function _(C,H,w){this.props=C,this.context=H,this.refs=A,this.updater=w||S}_.prototype.isReactComponent={},_.prototype.setState=function(C,H){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,H,"setState")},_.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function E(){}E.prototype=_.prototype;function N(C,H,w){this.props=C,this.context=H,this.refs=A,this.updater=w||S}var P=N.prototype=new E;P.constructor=N,z(P,_.prototype),P.isPureReactComponent=!0;var D=Array.isArray;function M(){}var V={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function K(C,H,w){var X=w.ref;return{$$typeof:e,type:C,key:H,ref:X!==void 0?X:null,props:w}}function I(C,H){return K(C.type,H,C.props)}function te(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function le(C){var H={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(w){return H[w]})}var ne=/\/+/g;function oe(C,H){return typeof C=="object"&&C!==null&&C.key!=null?le(""+C.key):H.toString(36)}function se(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(M,M):(C.status="pending",C.then(function(H){C.status==="pending"&&(C.status="fulfilled",C.value=H)},function(H){C.status==="pending"&&(C.status="rejected",C.reason=H)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function Z(C,H,w,X,me){var pe=typeof C;(pe==="undefined"||pe==="boolean")&&(C=null);var ge=!1;if(C===null)ge=!0;else switch(pe){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(C.$$typeof){case e:case t:ge=!0;break;case x:return ge=C._init,Z(ge(C._payload),H,w,X,me)}}if(ge)return me=me(C),ge=X===""?"."+oe(C,0):X,D(me)?(w="",ge!=null&&(w=ge.replace(ne,"$&/")+"/"),Z(me,H,w,"",function(yt){return yt})):me!=null&&(te(me)&&(me=I(me,w+(me.key==null||C&&C.key===me.key?"":(""+me.key).replace(ne,"$&/")+"/")+ge)),H.push(me)),1;ge=0;var Pe=X===""?".":X+":";if(D(C))for(var Ee=0;Ee<C.length;Ee++)X=C[Ee],pe=Pe+oe(X,Ee),ge+=Z(X,H,w,pe,me);else if(Ee=v(C),typeof Ee=="function")for(C=Ee.call(C),Ee=0;!(X=C.next()).done;)X=X.value,pe=Pe+oe(X,Ee++),ge+=Z(X,H,w,pe,me);else if(pe==="object"){if(typeof C.then=="function")return Z(se(C),H,w,X,me);throw H=String(C),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ge}function B(C,H,w){if(C==null)return C;var X=[],me=0;return Z(C,X,"","",function(pe){return H.call(w,pe,me++)}),X}function Y(C){if(C._status===-1){var H=C._result;H=H(),H.then(function(w){(C._status===0||C._status===-1)&&(C._status=1,C._result=w)},function(w){(C._status===0||C._status===-1)&&(C._status=2,C._result=w)}),C._status===-1&&(C._status=0,C._result=H)}if(C._status===1)return C._result.default;throw C._result}var ue=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},O={map:B,forEach:function(C,H,w){B(C,function(){H.apply(this,arguments)},w)},count:function(C){var H=0;return B(C,function(){H++}),H},toArray:function(C){return B(C,function(H){return H})||[]},only:function(C){if(!te(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ae.Activity=p,Ae.Children=O,Ae.Component=_,Ae.Fragment=n,Ae.Profiler=s,Ae.PureComponent=N,Ae.StrictMode=a,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(C){return V.H.useMemoCache(C)}},Ae.cache=function(C){return function(){return C.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(C,H,w){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var X=z({},C.props),me=C.key;if(H!=null)for(pe in H.key!==void 0&&(me=""+H.key),H)!U.call(H,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&H.ref===void 0||(X[pe]=H[pe]);var pe=arguments.length-2;if(pe===1)X.children=w;else if(1<pe){for(var ge=Array(pe),Pe=0;Pe<pe;Pe++)ge[Pe]=arguments[Pe+2];X.children=ge}return K(C.type,me,X)},Ae.createContext=function(C){return C={$$typeof:o,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},Ae.createElement=function(C,H,w){var X,me={},pe=null;if(H!=null)for(X in H.key!==void 0&&(pe=""+H.key),H)U.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(me[X]=H[X]);var ge=arguments.length-2;if(ge===1)me.children=w;else if(1<ge){for(var Pe=Array(ge),Ee=0;Ee<ge;Ee++)Pe[Ee]=arguments[Ee+2];me.children=Pe}if(C&&C.defaultProps)for(X in ge=C.defaultProps,ge)me[X]===void 0&&(me[X]=ge[X]);return K(C,pe,me)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(C){return{$$typeof:d,render:C}},Ae.isValidElement=te,Ae.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:Y}},Ae.memo=function(C,H){return{$$typeof:m,type:C,compare:H===void 0?null:H}},Ae.startTransition=function(C){var H=V.T,w={};V.T=w;try{var X=C(),me=V.S;me!==null&&me(w,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(M,ue)}catch(pe){ue(pe)}finally{H!==null&&w.types!==null&&(H.types=w.types),V.T=H}},Ae.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Ae.use=function(C){return V.H.use(C)},Ae.useActionState=function(C,H,w){return V.H.useActionState(C,H,w)},Ae.useCallback=function(C,H){return V.H.useCallback(C,H)},Ae.useContext=function(C){return V.H.useContext(C)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(C,H){return V.H.useDeferredValue(C,H)},Ae.useEffect=function(C,H){return V.H.useEffect(C,H)},Ae.useEffectEvent=function(C){return V.H.useEffectEvent(C)},Ae.useId=function(){return V.H.useId()},Ae.useImperativeHandle=function(C,H,w){return V.H.useImperativeHandle(C,H,w)},Ae.useInsertionEffect=function(C,H){return V.H.useInsertionEffect(C,H)},Ae.useLayoutEffect=function(C,H){return V.H.useLayoutEffect(C,H)},Ae.useMemo=function(C,H){return V.H.useMemo(C,H)},Ae.useOptimistic=function(C,H){return V.H.useOptimistic(C,H)},Ae.useReducer=function(C,H,w){return V.H.useReducer(C,H,w)},Ae.useRef=function(C){return V.H.useRef(C)},Ae.useState=function(C){return V.H.useState(C)},Ae.useSyncExternalStore=function(C,H,w){return V.H.useSyncExternalStore(C,H,w)},Ae.useTransition=function(){return V.H.useTransition()},Ae.version="19.2.4",Ae}var l1;function Id(){return l1||(l1=1,vm.exports=hT()),vm.exports}var j=Id();const $x=Rx(j);var km={exports:{}},wl={},wm={exports:{}},Sm={};var c1;function mT(){return c1||(c1=1,(function(e){function t(Z,B){var Y=Z.length;Z.push(B);e:for(;0<Y;){var ue=Y-1>>>1,O=Z[ue];if(0<s(O,B))Z[ue]=B,Z[Y]=O,Y=ue;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var B=Z[0],Y=Z.pop();if(Y!==B){Z[0]=Y;e:for(var ue=0,O=Z.length,C=O>>>1;ue<C;){var H=2*(ue+1)-1,w=Z[H],X=H+1,me=Z[X];if(0>s(w,Y))X<O&&0>s(me,w)?(Z[ue]=me,Z[X]=Y,ue=X):(Z[ue]=w,Z[H]=Y,ue=H);else if(X<O&&0>s(me,Y))Z[ue]=me,Z[X]=Y,ue=X;else break e}}return B}function s(Z,B){var Y=Z.sortIndex-B.sortIndex;return Y!==0?Y:Z.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var o=Date,d=o.now();e.unstable_now=function(){return o.now()-d}}var h=[],m=[],x=1,p=null,b=3,v=!1,S=!1,z=!1,A=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function P(Z){for(var B=n(m);B!==null;){if(B.callback===null)a(m);else if(B.startTime<=Z)a(m),B.sortIndex=B.expirationTime,t(h,B);else break;B=n(m)}}function D(Z){if(z=!1,P(Z),!S)if(n(h)!==null)S=!0,M||(M=!0,le());else{var B=n(m);B!==null&&se(D,B.startTime-Z)}}var M=!1,V=-1,U=5,K=-1;function I(){return A?!0:!(e.unstable_now()-K<U)}function te(){if(A=!1,M){var Z=e.unstable_now();K=Z;var B=!0;try{e:{S=!1,z&&(z=!1,E(V),V=-1),v=!0;var Y=b;try{t:{for(P(Z),p=n(h);p!==null&&!(p.expirationTime>Z&&I());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,b=p.priorityLevel;var O=ue(p.expirationTime<=Z);if(Z=e.unstable_now(),typeof O=="function"){p.callback=O,P(Z),B=!0;break t}p===n(h)&&a(h),P(Z)}else a(h);p=n(h)}if(p!==null)B=!0;else{var C=n(m);C!==null&&se(D,C.startTime-Z),B=!1}}break e}finally{p=null,b=Y,v=!1}B=void 0}}finally{B?le():M=!1}}}var le;if(typeof N=="function")le=function(){N(te)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,oe=ne.port2;ne.port1.onmessage=te,le=function(){oe.postMessage(null)}}else le=function(){_(te,0)};function se(Z,B){V=_(function(){Z(e.unstable_now())},B)}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(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var B=3;break;default:B=b}var Y=b;b=B;try{return Z()}finally{b=Y}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(Z,B){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var Y=b;b=Z;try{return B()}finally{b=Y}},e.unstable_scheduleCallback=function(Z,B,Y){var ue=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ue+Y:ue):Y=ue,Z){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Y+O,Z={id:x++,callback:B,priorityLevel:Z,startTime:Y,expirationTime:O,sortIndex:-1},Y>ue?(Z.sortIndex=Y,t(m,Z),n(h)===null&&Z===n(m)&&(z?(E(V),V=-1):z=!0,se(D,Y-ue))):(Z.sortIndex=O,t(h,Z),S||v||(S=!0,M||(M=!0,le()))),Z},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(Z){var B=b;return function(){var Y=b;b=B;try{return Z.apply(this,arguments)}finally{b=Y}}}})(Sm)),Sm}var u1;function pT(){return u1||(u1=1,wm.exports=mT()),wm.exports}var zm={exports:{}},mn={};var d1;function xT(){if(d1)return mn;d1=1;var e=Id();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}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 c(h,m,x){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:m,implementation:x}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,mn.createPortal=function(h,m){var x=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 c(h,m,null,x)},mn.flushSync=function(h){var m=o.T,x=a.p;try{if(o.T=null,a.p=2,h)return h()}finally{o.T=m,a.p=x,a.d.f()}},mn.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))},mn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},mn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var x=m.as,p=d(x,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):x==="script"&&a.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},mn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:x,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)},mn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,p=d(x,m.crossOrigin);a.d.L(h,x,{crossOrigin:p,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})}},mn.preloadModule=function(h,m){if(typeof h=="string")if(m){var x=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},mn.requestFormReset=function(h){a.d.r(h)},mn.unstable_batchedUpdates=function(h,m){return h(m)},mn.useFormState=function(h,m,x){return o.H.useFormState(h,m,x)},mn.useFormStatus=function(){return o.H.useHostTransitionStatus()},mn.version="19.2.4",mn}var f1;function gT(){if(f1)return zm.exports;f1=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(),zm.exports=xT(),zm.exports}var h1;function yT(){if(h1)return wl;h1=1;var e=pT(),t=Id(),n=gT();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}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 c(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function o(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(c(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=c(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,f=i;;){var g=l.return;if(g===null)break;var y=g.alternate;if(y===null){if(f=g.return,f!==null){l=f;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===l)return h(g),r;if(y===f)return h(g),i;y=y.sibling}throw Error(a(188))}if(l.return!==f.return)l=g,f=y;else{for(var k=!1,T=g.child;T;){if(T===l){k=!0,l=g,f=y;break}if(T===f){k=!0,f=g,l=y;break}T=T.sibling}if(!k){for(T=y.child;T;){if(T===l){k=!0,l=y,f=g;break}if(T===f){k=!0,f=y,l=g;break}T=T.sibling}if(!k)throw Error(a(189))}}if(l.alternate!==f)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function x(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=x(r),i!==null)return i;r=r.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=te&&r[te]||r["@@iterator"],typeof r=="function"?r:null)}var ne=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ne?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case z:return"Fragment";case _:return"Profiler";case A:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case E: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 V:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var se=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ue=[],O=-1;function C(r){return{current:r}}function H(r){0>O||(r.current=ue[O],ue[O]=null,O--)}function w(r,i){O++,ue[O]=r.current,r.current=i}var X=C(null),me=C(null),pe=C(null),ge=C(null);function Pe(r,i){switch(w(pe,i),w(me,r),w(X,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Cv(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Cv(i),r=Tv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(X),w(X,r)}function Ee(){H(X),H(me),H(pe)}function yt(r){r.memoizedState!==null&&w(ge,r);var i=X.current,l=Tv(i,r.type);i!==l&&(w(me,r),w(X,l))}function $(r){me.current===r&&(H(X),H(me)),ge.current===r&&(H(ge),gl._currentValue=Y)}var Oe,Ue;function Je(r){if(Oe===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);Oe=i&&i[1]||"",Ue=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Oe+r+Ue}var St=!1;function Ze(r,i){if(!r||St)return"";St=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Q){var J=Q}Reflect.construct(r,[],ie)}else{try{ie.call()}catch(Q){J=Q}r.call(ie.prototype)}}else{try{throw Error()}catch(Q){J=Q}(ie=r())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Q){if(Q&&J&&typeof Q.stack=="string")return[Q.stack,J.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),k=y[0],T=y[1];if(k&&T){var R=k.split(`
|
|
4
|
+
`),G=T.split(`
|
|
5
|
+
`);for(g=f=0;f<R.length&&!R[f].includes("DetermineComponentFrameRoot");)f++;for(;g<G.length&&!G[g].includes("DetermineComponentFrameRoot");)g++;if(f===R.length||g===G.length)for(f=R.length-1,g=G.length-1;1<=f&&0<=g&&R[f]!==G[g];)g--;for(;1<=f&&0<=g;f--,g--)if(R[f]!==G[g]){if(f!==1||g!==1)do if(f--,g--,0>g||R[f]!==G[g]){var W=`
|
|
6
|
+
`+R[f].replace(" at new "," at ");return r.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",r.displayName)),W}while(1<=f&&0<=g);break}}}finally{St=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?Je(l):""}function rt(r,i){switch(r.tag){case 26:case 27:case 5:return Je(r.type);case 16:return Je("Lazy");case 13:return r.child!==i&&i!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Ze(r.type,!1);case 11:return Ze(r.type.render,!1);case 1:return Ze(r.type,!0);case 31:return Je("Activity");default:return""}}function ft(r){try{var i="",l=null;do i+=rt(r,l),l=r,r=r.return;while(r);return i}catch(f){return`
|
|
7
|
+
Error generating stack: `+f.message+`
|
|
8
|
+
`+f.stack}}var lt=Object.prototype.hasOwnProperty,rn=e.unstable_scheduleCallback,nr=e.unstable_cancelCallback,$t=e.unstable_shouldYield,Kt=e.unstable_requestPaint,bt=e.unstable_now,Qi=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Ke=e.unstable_IdlePriority,kn=e.log,Fn=e.unstable_setDisableYieldValue,wn=null,Xt=null;function An(r){if(typeof kn=="function"&&Fn(r),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(wn,r)}catch{}}var ht=Math.clz32?Math.clz32:XN,ya=Math.log,kr=Math.LN2;function XN(r){return r>>>=0,r===0?32:31-(ya(r)/kr|0)|0}var kc=256,wc=262144,Sc=4194304;function mi(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 zc(r,i,l){var f=r.pendingLanes;if(f===0)return 0;var g=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var T=f&134217727;return T!==0?(f=T&~y,f!==0?g=mi(f):(k&=T,k!==0?g=mi(k):l||(l=T&~r,l!==0&&(g=mi(l))))):(T=f&~y,T!==0?g=mi(T):k!==0?g=mi(k):l||(l=f&~r,l!==0&&(g=mi(l)))),g===0?0:i!==0&&i!==g&&(i&y)===0&&(y=g&-g,l=i&-i,y>=l||y===32&&(l&4194048)!==0)?i:g}function Eo(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function QN(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 cy(){var r=Sc;return Sc<<=1,(Sc&62914560)===0&&(Sc=4194304),r}function of(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Ao(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function WN(r,i,l,f,g,y){var k=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var T=r.entanglements,R=r.expirationTimes,G=r.hiddenUpdates;for(l=k&~l;0<l;){var W=31-ht(l),ie=1<<W;T[W]=0,R[W]=-1;var J=G[W];if(J!==null)for(G[W]=null,W=0;W<J.length;W++){var Q=J[W];Q!==null&&(Q.lane&=-536870913)}l&=~ie}f!==0&&uy(r,f,0),y!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function uy(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var f=31-ht(i);r.entangledLanes|=i,r.entanglements[f]=r.entanglements[f]|1073741824|l&261930}function dy(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var f=31-ht(l),g=1<<f;g&i|r[f]&i&&(r[f]|=i),l&=~g}}function fy(r,i){var l=i&-i;return l=(l&42)!==0?1:lf(l),(l&(r.suspendedLanes|i))!==0?0:l}function lf(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 cf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function hy(){var r=B.p;return r!==0?r:(r=window.event,r===void 0?32:Qv(r.type))}function my(r,i){var l=B.p;try{return B.p=r,i()}finally{B.p=l}}var ba=Math.random().toString(36).slice(2),on="__reactFiber$"+ba,On="__reactProps$"+ba,Wi="__reactContainer$"+ba,uf="__reactEvents$"+ba,eC="__reactListeners$"+ba,tC="__reactHandles$"+ba,py="__reactResources$"+ba,Oo="__reactMarker$"+ba;function df(r){delete r[on],delete r[On],delete r[uf],delete r[eC],delete r[tC]}function es(r){var i=r[on];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Wi]||l[on]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=$v(r);r!==null;){if(l=r[on])return l;r=$v(r)}return i}r=l,l=r.parentNode}return null}function ts(r){if(r=r[on]||r[Wi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Mo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function ns(r){var i=r[py];return i||(i=r[py]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function an(r){r[Oo]=!0}var xy=new Set,gy={};function pi(r,i){rs(r,i),rs(r+"Capture",i)}function rs(r,i){for(gy[r]=i,r=0;r<i.length;r++)xy.add(i[r])}var nC=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yy={},by={};function rC(r){return lt.call(by,r)?!0:lt.call(yy,r)?!1:nC.test(r)?by[r]=!0:(yy[r]=!0,!1)}function jc(r,i,l){if(rC(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function _c(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function Hr(r,i,l,f){if(f===null)r.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+f)}}function rr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function vy(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function aC(r,i,l){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,y=f.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return g.call(this)},set:function(k){l=""+k,y.call(this,k)}}),Object.defineProperty(r,i,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(k){l=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function ff(r){if(!r._valueTracker){var i=vy(r)?"checked":"value";r._valueTracker=aC(r,i,""+r[i])}}function ky(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),f="";return r&&(f=vy(r)?r.checked?"true":"false":r.value),r=f,r!==l?(i.setValue(r),!0):!1}function Nc(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 iC=/[\n"\\]/g;function ar(r){return r.replace(iC,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function hf(r,i,l,f,g,y,k,T){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=""+rr(i)):r.value!==""+rr(i)&&(r.value=""+rr(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?mf(r,k,rr(i)):l!=null?mf(r,k,rr(l)):f!=null&&r.removeAttribute("value"),g==null&&y!=null&&(r.defaultChecked=!!y),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.name=""+rr(T):r.removeAttribute("name")}function wy(r,i,l,f,g,y,k,T){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){ff(r);return}l=l!=null?""+rr(l):"",i=i!=null?""+rr(i):l,T||i===r.value||(r.value=i),r.defaultValue=i}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=T?r.checked:!!f,r.defaultChecked=!!f,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),ff(r)}function mf(r,i,l){i==="number"&&Nc(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function as(r,i,l,f){if(r=r.options,i){i={};for(var g=0;g<l.length;g++)i["$"+l[g]]=!0;for(l=0;l<r.length;l++)g=i.hasOwnProperty("$"+r[l].value),r[l].selected!==g&&(r[l].selected=g),g&&f&&(r[l].defaultSelected=!0)}else{for(l=""+rr(l),i=null,g=0;g<r.length;g++){if(r[g].value===l){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}i!==null||r[g].disabled||(i=r[g])}i!==null&&(i.selected=!0)}}function Sy(r,i,l){if(i!=null&&(i=""+rr(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+rr(l):""}function zy(r,i,l,f){if(i==null){if(f!=null){if(l!=null)throw Error(a(92));if(se(f)){if(1<f.length)throw Error(a(93));f=f[0]}l=f}l==null&&(l=""),i=l}l=rr(i),r.defaultValue=l,f=r.textContent,f===l&&f!==""&&f!==null&&(r.value=f),ff(r)}function is(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var sC=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 jy(r,i,l){var f=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?f?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":f?r.setProperty(i,l):typeof l!="number"||l===0||sC.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function _y(r,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,l!=null){for(var f in l)!l.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var g in i)f=i[g],i.hasOwnProperty(g)&&l[g]!==f&&jy(r,g,f)}else for(var y in i)i.hasOwnProperty(y)&&jy(r,y,i[y])}function pf(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 oC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),lC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Cc(r){return lC.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function qr(){}var xf=null;function gf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ss=null,os=null;function Ny(r){var i=ts(r);if(i&&(r=i.stateNode)){var l=r[On]||null;e:switch(r=i.stateNode,i.type){case"input":if(hf(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ar(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var f=l[i];if(f!==r&&f.form===r.form){var g=f[On]||null;if(!g)throw Error(a(90));hf(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<l.length;i++)f=l[i],f.form===r.form&&ky(f)}break e;case"textarea":Sy(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&as(r,!!l.multiple,i,!1)}}}var yf=!1;function Cy(r,i,l){if(yf)return r(i,l);yf=!0;try{var f=r(i);return f}finally{if(yf=!1,(ss!==null||os!==null)&&(pu(),ss&&(i=ss,r=os,os=ss=null,Ny(i),r)))for(i=0;i<r.length;i++)Ny(r[i])}}function Do(r,i){var l=r.stateNode;if(l===null)return null;var f=l[On]||null;if(f===null)return null;l=f[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":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bf=!1;if(Gr)try{var Ro={};Object.defineProperty(Ro,"passive",{get:function(){bf=!0}}),window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{bf=!1}var va=null,vf=null,Tc=null;function Ty(){if(Tc)return Tc;var r,i=vf,l=i.length,f,g="value"in va?va.value:va.textContent,y=g.length;for(r=0;r<l&&i[r]===g[r];r++);var k=l-r;for(f=1;f<=k&&i[l-f]===g[y-f];f++);return Tc=g.slice(r,1<f?1-f:void 0)}function Ec(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 Ac(){return!0}function Ey(){return!1}function Mn(r){function i(l,f,g,y,k){this._reactName=l,this._targetInst=g,this.type=f,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(l=r[T],this[T]=l?l(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ac:Ey,this.isPropagationStopped=Ey,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ac)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ac)},persist:function(){},isPersistent:Ac}),i}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oc=Mn(xi),$o=p({},xi,{view:0,detail:0}),cC=Mn($o),kf,wf,Lo,Mc=p({},$o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zf,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!==Lo&&(Lo&&r.type==="mousemove"?(kf=r.screenX-Lo.screenX,wf=r.screenY-Lo.screenY):wf=kf=0,Lo=r),kf)},movementY:function(r){return"movementY"in r?r.movementY:wf}}),Ay=Mn(Mc),uC=p({},Mc,{dataTransfer:0}),dC=Mn(uC),fC=p({},$o,{relatedTarget:0}),Sf=Mn(fC),hC=p({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),mC=Mn(hC),pC=p({},xi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),xC=Mn(pC),gC=p({},xi,{data:0}),Oy=Mn(gC),yC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bC={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kC(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=vC[r])?!!i[r]:!1}function zf(){return kC}var wC=p({},$o,{key:function(r){if(r.key){var i=yC[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ec(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?bC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zf,charCode:function(r){return r.type==="keypress"?Ec(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ec(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),SC=Mn(wC),zC=p({},Mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),My=Mn(zC),jC=p({},$o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zf}),_C=Mn(jC),NC=p({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),CC=Mn(NC),TC=p({},Mc,{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}),EC=Mn(TC),AC=p({},xi,{newState:0,oldState:0}),OC=Mn(AC),MC=[9,13,27,32],jf=Gr&&"CompositionEvent"in window,Po=null;Gr&&"documentMode"in document&&(Po=document.documentMode);var DC=Gr&&"TextEvent"in window&&!Po,Dy=Gr&&(!jf||Po&&8<Po&&11>=Po),Ry=" ",$y=!1;function Ly(r,i){switch(r){case"keyup":return MC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Py(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ls=!1;function RC(r,i){switch(r){case"compositionend":return Py(i);case"keypress":return i.which!==32?null:($y=!0,Ry);case"textInput":return r=i.data,r===Ry&&$y?null:r;default:return null}}function $C(r,i){if(ls)return r==="compositionend"||!jf&&Ly(r,i)?(r=Ty(),Tc=vf=va=null,ls=!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 Dy&&i.locale!=="ko"?null:i.data;default:return null}}var LC={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 Uy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!LC[r.type]:i==="textarea"}function Iy(r,i,l,f){ss?os?os.push(f):os=[f]:ss=f,i=wu(i,"onChange"),0<i.length&&(l=new Oc("onChange","change",null,l,f),r.push({event:l,listeners:i}))}var Uo=null,Io=null;function PC(r){wv(r,0)}function Dc(r){var i=Mo(r);if(ky(i))return r}function By(r,i){if(r==="change")return i}var Vy=!1;if(Gr){var _f;if(Gr){var Nf="oninput"in document;if(!Nf){var Zy=document.createElement("div");Zy.setAttribute("oninput","return;"),Nf=typeof Zy.oninput=="function"}_f=Nf}else _f=!1;Vy=_f&&(!document.documentMode||9<document.documentMode)}function Fy(){Uo&&(Uo.detachEvent("onpropertychange",Hy),Io=Uo=null)}function Hy(r){if(r.propertyName==="value"&&Dc(Io)){var i=[];Iy(i,Io,r,gf(r)),Cy(PC,i)}}function UC(r,i,l){r==="focusin"?(Fy(),Uo=i,Io=l,Uo.attachEvent("onpropertychange",Hy)):r==="focusout"&&Fy()}function IC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Dc(Io)}function BC(r,i){if(r==="click")return Dc(i)}function VC(r,i){if(r==="input"||r==="change")return Dc(i)}function ZC(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Hn=typeof Object.is=="function"?Object.is:ZC;function Bo(r,i){if(Hn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var g=l[f];if(!lt.call(i,g)||!Hn(r[g],i[g]))return!1}return!0}function qy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Gy(r,i){var l=qy(r);r=0;for(var f;l;){if(l.nodeType===3){if(f=r+l.textContent.length,r<=i&&f>=i)return{node:l,offset:i-r};r=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=qy(l)}}function Yy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Yy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Jy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Nc(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Nc(r.document)}return i}function Cf(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 FC=Gr&&"documentMode"in document&&11>=document.documentMode,cs=null,Tf=null,Vo=null,Ef=!1;function Ky(r,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ef||cs==null||cs!==Nc(f)||(f=cs,"selectionStart"in f&&Cf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Vo&&Bo(Vo,f)||(Vo=f,f=wu(Tf,"onSelect"),0<f.length&&(i=new Oc("onSelect","select",null,i,l),r.push({event:i,listeners:f}),i.target=cs)))}function gi(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var us={animationend:gi("Animation","AnimationEnd"),animationiteration:gi("Animation","AnimationIteration"),animationstart:gi("Animation","AnimationStart"),transitionrun:gi("Transition","TransitionRun"),transitionstart:gi("Transition","TransitionStart"),transitioncancel:gi("Transition","TransitionCancel"),transitionend:gi("Transition","TransitionEnd")},Af={},Xy={};Gr&&(Xy=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function yi(r){if(Af[r])return Af[r];if(!us[r])return r;var i=us[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Xy)return Af[r]=i[l];return r}var Qy=yi("animationend"),Wy=yi("animationiteration"),eb=yi("animationstart"),HC=yi("transitionrun"),qC=yi("transitionstart"),GC=yi("transitioncancel"),tb=yi("transitionend"),nb=new Map,Of="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(" ");Of.push("scrollEnd");function wr(r,i){nb.set(r,i),pi(i,[r])}var Rc=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)},ir=[],ds=0,Mf=0;function $c(){for(var r=ds,i=Mf=ds=0;i<r;){var l=ir[i];ir[i++]=null;var f=ir[i];ir[i++]=null;var g=ir[i];ir[i++]=null;var y=ir[i];if(ir[i++]=null,f!==null&&g!==null){var k=f.pending;k===null?g.next=g:(g.next=k.next,k.next=g),f.pending=g}y!==0&&rb(l,g,y)}}function Lc(r,i,l,f){ir[ds++]=r,ir[ds++]=i,ir[ds++]=l,ir[ds++]=f,Mf|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Df(r,i,l,f){return Lc(r,i,l,f),Pc(r)}function bi(r,i){return Lc(r,null,null,i),Pc(r)}function rb(r,i,l){r.lanes|=l;var f=r.alternate;f!==null&&(f.lanes|=l);for(var g=!1,y=r.return;y!==null;)y.childLanes|=l,f=y.alternate,f!==null&&(f.childLanes|=l),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(g=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,g&&i!==null&&(g=31-ht(l),r=y.hiddenUpdates,f=r[g],f===null?r[g]=[i]:f.push(i),i.lane=l|536870912),y):null}function Pc(r){if(50<ul)throw ul=0,Zh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var fs={};function YC(r,i,l,f){this.tag=r,this.key=l,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=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(r,i,l,f){return new YC(r,i,l,f)}function Rf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Yr(r,i){var l=r.alternate;return l===null?(l=qn(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function ab(r,i){r.flags&=65011714;var l=r.alternate;return l===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=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Uc(r,i,l,f,g,y){var k=0;if(f=r,typeof r=="function")Rf(r)&&(k=1);else if(typeof r=="string")k=W4(r,l,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case K:return r=qn(31,l,i,g),r.elementType=K,r.lanes=y,r;case z:return vi(l.children,g,y,i);case A:k=8,g|=24;break;case _:return r=qn(12,l,i,g|2),r.elementType=_,r.lanes=y,r;case D:return r=qn(13,l,i,g),r.elementType=D,r.lanes=y,r;case M:return r=qn(19,l,i,g),r.elementType=M,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:k=10;break e;case E:k=9;break e;case P:k=11;break e;case V:k=14;break e;case U:k=16,f=null;break e}k=29,l=Error(a(130,r===null?"null":typeof r,"")),f=null}return i=qn(k,l,i,g),i.elementType=r,i.type=f,i.lanes=y,i}function vi(r,i,l,f){return r=qn(7,r,f,i),r.lanes=l,r}function $f(r,i,l){return r=qn(6,r,null,i),r.lanes=l,r}function ib(r){var i=qn(18,null,null,0);return i.stateNode=r,i}function Lf(r,i,l){return i=qn(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var sb=new WeakMap;function sr(r,i){if(typeof r=="object"&&r!==null){var l=sb.get(r);return l!==void 0?l:(i={value:r,source:i,stack:ft(i)},sb.set(r,i),i)}return{value:r,source:i,stack:ft(i)}}var hs=[],ms=0,Ic=null,Zo=0,or=[],lr=0,ka=null,Or=1,Mr="";function Jr(r,i){hs[ms++]=Zo,hs[ms++]=Ic,Ic=r,Zo=i}function ob(r,i,l){or[lr++]=Or,or[lr++]=Mr,or[lr++]=ka,ka=r;var f=Or;r=Mr;var g=32-ht(f)-1;f&=~(1<<g),l+=1;var y=32-ht(i)+g;if(30<y){var k=g-g%5;y=(f&(1<<k)-1).toString(32),f>>=k,g-=k,Or=1<<32-ht(i)+g|l<<g|f,Mr=y+r}else Or=1<<y|l<<g|f,Mr=r}function Pf(r){r.return!==null&&(Jr(r,1),ob(r,1,0))}function Uf(r){for(;r===Ic;)Ic=hs[--ms],hs[ms]=null,Zo=hs[--ms],hs[ms]=null;for(;r===ka;)ka=or[--lr],or[lr]=null,Mr=or[--lr],or[lr]=null,Or=or[--lr],or[lr]=null}function lb(r,i){or[lr++]=Or,or[lr++]=Mr,or[lr++]=ka,Or=i.id,Mr=i.overflow,ka=r}var ln=null,vt=null,Ge=!1,wa=null,cr=!1,If=Error(a(519));function Sa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fo(sr(i,r)),If}function cb(r){var i=r.stateNode,l=r.type,f=r.memoizedProps;switch(i[on]=r,i[On]=f,l){case"dialog":Be("cancel",i),Be("close",i);break;case"iframe":case"object":case"embed":Be("load",i);break;case"video":case"audio":for(l=0;l<fl.length;l++)Be(fl[l],i);break;case"source":Be("error",i);break;case"img":case"image":case"link":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"input":Be("invalid",i),wy(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Be("invalid",i);break;case"textarea":Be("invalid",i),zy(i,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||f.suppressHydrationWarning===!0||_v(i.textContent,l)?(f.popover!=null&&(Be("beforetoggle",i),Be("toggle",i)),f.onScroll!=null&&Be("scroll",i),f.onScrollEnd!=null&&Be("scrollend",i),f.onClick!=null&&(i.onclick=qr),i=!0):i=!1,i||Sa(r,!0)}function ub(r){for(ln=r.return;ln;)switch(ln.tag){case 5:case 31:case 13:cr=!1;return;case 27:case 3:cr=!0;return;default:ln=ln.return}}function ps(r){if(r!==ln)return!1;if(!Ge)return ub(r),Ge=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||am(r.type,r.memoizedProps)),l=!l),l&&vt&&Sa(r),ub(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vt=Rv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vt=Rv(r)}else i===27?(i=vt,La(r.type)?(r=cm,cm=null,vt=r):vt=i):vt=ln?dr(r.stateNode.nextSibling):null;return!0}function ki(){vt=ln=null,Ge=!1}function Bf(){var r=wa;return r!==null&&(Ln===null?Ln=r:Ln.push.apply(Ln,r),wa=null),r}function Fo(r){wa===null?wa=[r]:wa.push(r)}var Vf=C(null),wi=null,Kr=null;function za(r,i,l){w(Vf,i._currentValue),i._currentValue=l}function Xr(r){r._currentValue=Vf.current,H(Vf)}function Zf(r,i,l){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===l)break;r=r.return}}function Ff(r,i,l,f){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var y=g.dependencies;if(y!==null){var k=g.child;y=y.firstContext;e:for(;y!==null;){var T=y;y=g;for(var R=0;R<i.length;R++)if(T.context===i[R]){y.lanes|=l,T=y.alternate,T!==null&&(T.lanes|=l),Zf(y.return,l,r),f||(k=null);break e}y=T.next}}else if(g.tag===18){if(k=g.return,k===null)throw Error(a(341));k.lanes|=l,y=k.alternate,y!==null&&(y.lanes|=l),Zf(k,l,r),k=null}else k=g.child;if(k!==null)k.return=g;else for(k=g;k!==null;){if(k===r){k=null;break}if(g=k.sibling,g!==null){g.return=k.return,k=g;break}k=k.return}g=k}}function xs(r,i,l,f){r=null;for(var g=i,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var k=g.alternate;if(k===null)throw Error(a(387));if(k=k.memoizedProps,k!==null){var T=g.type;Hn(g.pendingProps.value,k.value)||(r!==null?r.push(T):r=[T])}}else if(g===ge.current){if(k=g.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(gl):r=[gl])}g=g.return}r!==null&&Ff(i,r,l,f),i.flags|=262144}function Bc(r){for(r=r.firstContext;r!==null;){if(!Hn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Si(r){wi=r,Kr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function cn(r){return db(wi,r)}function Vc(r,i){return wi===null&&Si(r),db(r,i)}function db(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Kr===null){if(r===null)throw Error(a(308));Kr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Kr=Kr.next=i;return l}var JC=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,f){r.push(f)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},KC=e.unstable_scheduleCallback,XC=e.unstable_NormalPriority,Ut={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hf(){return{controller:new JC,data:new Map,refCount:0}}function Ho(r){r.refCount--,r.refCount===0&&KC(XC,function(){r.controller.abort()})}var qo=null,qf=0,gs=0,ys=null;function QC(r,i){if(qo===null){var l=qo=[];qf=0,gs=Jh(),ys={status:"pending",value:void 0,then:function(f){l.push(f)}}}return qf++,i.then(fb,fb),i}function fb(){if(--qf===0&&qo!==null){ys!==null&&(ys.status="fulfilled");var r=qo;qo=null,gs=0,ys=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function WC(r,i){var l=[],f={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return r.then(function(){f.status="fulfilled",f.value=i;for(var g=0;g<l.length;g++)(0,l[g])(i)},function(g){for(f.status="rejected",f.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),f}var hb=Z.S;Z.S=function(r,i){K0=bt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&QC(r,i),hb!==null&&hb(r,i)};var zi=C(null);function Gf(){var r=zi.current;return r!==null?r:mt.pooledCache}function Zc(r,i){i===null?w(zi,zi.current):w(zi,i.pool)}function mb(){var r=Gf();return r===null?null:{parent:Ut._currentValue,pool:r}}var bs=Error(a(460)),Yf=Error(a(474)),Fc=Error(a(542)),Hc={then:function(){}};function pb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function xb(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then(qr,qr),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,yb(r),r;default:if(typeof i.status=="string")i.then(qr,qr);else{if(r=mt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(f){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=f}},function(f){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,yb(r),r}throw _i=i,bs}}function ji(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(_i=l,bs):l}}var _i=null;function gb(){if(_i===null)throw Error(a(459));var r=_i;return _i=null,r}function yb(r){if(r===bs||r===Fc)throw Error(a(483))}var vs=null,Go=0;function qc(r){var i=Go;return Go+=1,vs===null&&(vs=[]),xb(vs,r,i)}function Yo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Gc(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function bb(r){function i(F,L){if(r){var q=F.deletions;q===null?(F.deletions=[L],F.flags|=16):q.push(L)}}function l(F,L){if(!r)return null;for(;L!==null;)i(F,L),L=L.sibling;return null}function f(F){for(var L=new Map;F!==null;)F.key!==null?L.set(F.key,F):L.set(F.index,F),F=F.sibling;return L}function g(F,L){return F=Yr(F,L),F.index=0,F.sibling=null,F}function y(F,L,q){return F.index=q,r?(q=F.alternate,q!==null?(q=q.index,q<L?(F.flags|=67108866,L):q):(F.flags|=67108866,L)):(F.flags|=1048576,L)}function k(F){return r&&F.alternate===null&&(F.flags|=67108866),F}function T(F,L,q,ae){return L===null||L.tag!==6?(L=$f(q,F.mode,ae),L.return=F,L):(L=g(L,q),L.return=F,L)}function R(F,L,q,ae){var je=q.type;return je===z?W(F,L,q.props.children,ae,q.key):L!==null&&(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===U&&ji(je)===L.type)?(L=g(L,q.props),Yo(L,q),L.return=F,L):(L=Uc(q.type,q.key,q.props,null,F.mode,ae),Yo(L,q),L.return=F,L)}function G(F,L,q,ae){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=Lf(q,F.mode,ae),L.return=F,L):(L=g(L,q.children||[]),L.return=F,L)}function W(F,L,q,ae,je){return L===null||L.tag!==7?(L=vi(q,F.mode,ae,je),L.return=F,L):(L=g(L,q),L.return=F,L)}function ie(F,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=$f(""+L,F.mode,q),L.return=F,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case v:return q=Uc(L.type,L.key,L.props,null,F.mode,q),Yo(q,L),q.return=F,q;case S:return L=Lf(L,F.mode,q),L.return=F,L;case U:return L=ji(L),ie(F,L,q)}if(se(L)||le(L))return L=vi(L,F.mode,q,null),L.return=F,L;if(typeof L.then=="function")return ie(F,qc(L),q);if(L.$$typeof===N)return ie(F,Vc(F,L),q);Gc(F,L)}return null}function J(F,L,q,ae){var je=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:T(F,L,""+q,ae);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return q.key===je?R(F,L,q,ae):null;case S:return q.key===je?G(F,L,q,ae):null;case U:return q=ji(q),J(F,L,q,ae)}if(se(q)||le(q))return je!==null?null:W(F,L,q,ae,null);if(typeof q.then=="function")return J(F,L,qc(q),ae);if(q.$$typeof===N)return J(F,L,Vc(F,q),ae);Gc(F,q)}return null}function Q(F,L,q,ae,je){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return F=F.get(q)||null,T(L,F,""+ae,je);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:return F=F.get(ae.key===null?q:ae.key)||null,R(L,F,ae,je);case S:return F=F.get(ae.key===null?q:ae.key)||null,G(L,F,ae,je);case U:return ae=ji(ae),Q(F,L,q,ae,je)}if(se(ae)||le(ae))return F=F.get(q)||null,W(L,F,ae,je,null);if(typeof ae.then=="function")return Q(F,L,q,qc(ae),je);if(ae.$$typeof===N)return Q(F,L,q,Vc(L,ae),je);Gc(L,ae)}return null}function ye(F,L,q,ae){for(var je=null,et=null,Se=L,De=L=0,He=null;Se!==null&&De<q.length;De++){Se.index>De?(He=Se,Se=null):He=Se.sibling;var tt=J(F,Se,q[De],ae);if(tt===null){Se===null&&(Se=He);break}r&&Se&&tt.alternate===null&&i(F,Se),L=y(tt,L,De),et===null?je=tt:et.sibling=tt,et=tt,Se=He}if(De===q.length)return l(F,Se),Ge&&Jr(F,De),je;if(Se===null){for(;De<q.length;De++)Se=ie(F,q[De],ae),Se!==null&&(L=y(Se,L,De),et===null?je=Se:et.sibling=Se,et=Se);return Ge&&Jr(F,De),je}for(Se=f(Se);De<q.length;De++)He=Q(Se,F,De,q[De],ae),He!==null&&(r&&He.alternate!==null&&Se.delete(He.key===null?De:He.key),L=y(He,L,De),et===null?je=He:et.sibling=He,et=He);return r&&Se.forEach(function(Va){return i(F,Va)}),Ge&&Jr(F,De),je}function Ne(F,L,q,ae){if(q==null)throw Error(a(151));for(var je=null,et=null,Se=L,De=L=0,He=null,tt=q.next();Se!==null&&!tt.done;De++,tt=q.next()){Se.index>De?(He=Se,Se=null):He=Se.sibling;var Va=J(F,Se,tt.value,ae);if(Va===null){Se===null&&(Se=He);break}r&&Se&&Va.alternate===null&&i(F,Se),L=y(Va,L,De),et===null?je=Va:et.sibling=Va,et=Va,Se=He}if(tt.done)return l(F,Se),Ge&&Jr(F,De),je;if(Se===null){for(;!tt.done;De++,tt=q.next())tt=ie(F,tt.value,ae),tt!==null&&(L=y(tt,L,De),et===null?je=tt:et.sibling=tt,et=tt);return Ge&&Jr(F,De),je}for(Se=f(Se);!tt.done;De++,tt=q.next())tt=Q(Se,F,De,tt.value,ae),tt!==null&&(r&&tt.alternate!==null&&Se.delete(tt.key===null?De:tt.key),L=y(tt,L,De),et===null?je=tt:et.sibling=tt,et=tt);return r&&Se.forEach(function(uT){return i(F,uT)}),Ge&&Jr(F,De),je}function dt(F,L,q,ae){if(typeof q=="object"&&q!==null&&q.type===z&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case v:e:{for(var je=q.key;L!==null;){if(L.key===je){if(je=q.type,je===z){if(L.tag===7){l(F,L.sibling),ae=g(L,q.props.children),ae.return=F,F=ae;break e}}else if(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===U&&ji(je)===L.type){l(F,L.sibling),ae=g(L,q.props),Yo(ae,q),ae.return=F,F=ae;break e}l(F,L);break}else i(F,L);L=L.sibling}q.type===z?(ae=vi(q.props.children,F.mode,ae,q.key),ae.return=F,F=ae):(ae=Uc(q.type,q.key,q.props,null,F.mode,ae),Yo(ae,q),ae.return=F,F=ae)}return k(F);case S:e:{for(je=q.key;L!==null;){if(L.key===je)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){l(F,L.sibling),ae=g(L,q.children||[]),ae.return=F,F=ae;break e}else{l(F,L);break}else i(F,L);L=L.sibling}ae=Lf(q,F.mode,ae),ae.return=F,F=ae}return k(F);case U:return q=ji(q),dt(F,L,q,ae)}if(se(q))return ye(F,L,q,ae);if(le(q)){if(je=le(q),typeof je!="function")throw Error(a(150));return q=je.call(q),Ne(F,L,q,ae)}if(typeof q.then=="function")return dt(F,L,qc(q),ae);if(q.$$typeof===N)return dt(F,L,Vc(F,q),ae);Gc(F,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(l(F,L.sibling),ae=g(L,q),ae.return=F,F=ae):(l(F,L),ae=$f(q,F.mode,ae),ae.return=F,F=ae),k(F)):l(F,L)}return function(F,L,q,ae){try{Go=0;var je=dt(F,L,q,ae);return vs=null,je}catch(Se){if(Se===bs||Se===Fc)throw Se;var et=qn(29,Se,null,F.mode);return et.lanes=ae,et.return=F,et}}}var Ni=bb(!0),vb=bb(!1),ja=!1;function Jf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(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 _a(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Na(r,i,l){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(nt&2)!==0){var g=f.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),f.pending=i,i=Pc(r),rb(r,null,l),i}return Lc(r,f,i,l),Pc(r)}function Jo(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,dy(r,l)}}function Xf(r,i){var l=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var g=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var k={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?g=y=k:y=y.next=k,l=l.next}while(l!==null);y===null?g=y=i:y=y.next=i}else g=y=i;l={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var Qf=!1;function Ko(){if(Qf){var r=ys;if(r!==null)throw r}}function Xo(r,i,l,f){Qf=!1;var g=r.updateQueue;ja=!1;var y=g.firstBaseUpdate,k=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var R=T,G=R.next;R.next=null,k===null?y=G:k.next=G,k=R;var W=r.alternate;W!==null&&(W=W.updateQueue,T=W.lastBaseUpdate,T!==k&&(T===null?W.firstBaseUpdate=G:T.next=G,W.lastBaseUpdate=R))}if(y!==null){var ie=g.baseState;k=0,W=G=R=null,T=y;do{var J=T.lane&-536870913,Q=J!==T.lane;if(Q?(Fe&J)===J:(f&J)===J){J!==0&&J===gs&&(Qf=!0),W!==null&&(W=W.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ye=r,Ne=T;J=i;var dt=l;switch(Ne.tag){case 1:if(ye=Ne.payload,typeof ye=="function"){ie=ye.call(dt,ie,J);break e}ie=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ne.payload,J=typeof ye=="function"?ye.call(dt,ie,J):ye,J==null)break e;ie=p({},ie,J);break e;case 2:ja=!0}}J=T.callback,J!==null&&(r.flags|=64,Q&&(r.flags|=8192),Q=g.callbacks,Q===null?g.callbacks=[J]:Q.push(J))}else Q={lane:J,tag:T.tag,payload:T.payload,callback:T.callback,next:null},W===null?(G=W=Q,R=ie):W=W.next=Q,k|=J;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;Q=T,T=Q.next,Q.next=null,g.lastBaseUpdate=Q,g.shared.pending=null}}while(!0);W===null&&(R=ie),g.baseState=R,g.firstBaseUpdate=G,g.lastBaseUpdate=W,y===null&&(g.shared.lanes=0),Oa|=k,r.lanes=k,r.memoizedState=ie}}function kb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function wb(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)kb(l[r],i)}var ks=C(null),Yc=C(0);function Sb(r,i){r=sa,w(Yc,r),w(ks,i),sa=r|i.baseLanes}function Wf(){w(Yc,sa),w(ks,ks.current)}function eh(){sa=Yc.current,H(ks),H(Yc)}var Gn=C(null),ur=null;function Ca(r){var i=r.alternate;w(Lt,Lt.current&1),w(Gn,r),ur===null&&(i===null||ks.current!==null||i.memoizedState!==null)&&(ur=r)}function th(r){w(Lt,Lt.current),w(Gn,r),ur===null&&(ur=r)}function zb(r){r.tag===22?(w(Lt,Lt.current),w(Gn,r),ur===null&&(ur=r)):Ta()}function Ta(){w(Lt,Lt.current),w(Gn,Gn.current)}function Yn(r){H(Gn),ur===r&&(ur=null),H(Lt)}var Lt=C(0);function Jc(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||om(l)||lm(l)))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 Qr=0,Me=null,ct=null,It=null,Kc=!1,ws=!1,Ci=!1,Xc=0,Qo=0,Ss=null,e4=0;function Mt(){throw Error(a(321))}function nh(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Hn(r[l],i[l]))return!1;return!0}function rh(r,i,l,f,g,y){return Qr=y,Me=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?o0:yh,Ci=!1,y=l(f,g),Ci=!1,ws&&(y=_b(i,l,f,g)),jb(r),y}function jb(r){Z.H=tl;var i=ct!==null&&ct.next!==null;if(Qr=0,It=ct=Me=null,Kc=!1,Qo=0,Ss=null,i)throw Error(a(300));r===null||Bt||(r=r.dependencies,r!==null&&Bc(r)&&(Bt=!0))}function _b(r,i,l,f){Me=r;var g=0;do{if(ws&&(Ss=null),Qo=0,ws=!1,25<=g)throw Error(a(301));if(g+=1,It=ct=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}Z.H=l0,y=i(l,f)}while(ws);return y}function t4(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Wo(i):i,r=r.useState()[0],(ct!==null?ct.memoizedState:null)!==r&&(Me.flags|=1024),i}function ah(){var r=Xc!==0;return Xc=0,r}function ih(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function sh(r){if(Kc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Kc=!1}Qr=0,It=ct=Me=null,ws=!1,Qo=Xc=0,Ss=null}function Sn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Me.memoizedState=It=r:It=It.next=r,It}function Pt(){if(ct===null){var r=Me.alternate;r=r!==null?r.memoizedState:null}else r=ct.next;var i=It===null?Me.memoizedState:It.next;if(i!==null)It=i,ct=r;else{if(r===null)throw Me.alternate===null?Error(a(467)):Error(a(310));ct=r,r={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},It===null?Me.memoizedState=It=r:It=It.next=r}return It}function Qc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(r){var i=Qo;return Qo+=1,Ss===null&&(Ss=[]),r=xb(Ss,r,i),i=Me,(It===null?i.memoizedState:It.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?o0:yh),r}function Wc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Wo(r);if(r.$$typeof===N)return cn(r)}throw Error(a(438,String(r)))}function oh(r){var i=null,l=Me.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var f=Me.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Qc(),Me.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),f=0;f<r;f++)l[f]=I;return i.index++,l}function Wr(r,i){return typeof i=="function"?i(r):i}function eu(r){var i=Pt();return lh(i,ct,r)}function lh(r,i,l){var f=r.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=l;var g=r.baseQueue,y=f.pending;if(y!==null){if(g!==null){var k=g.next;g.next=y.next,y.next=k}i.baseQueue=g=y,f.pending=null}if(y=r.baseState,g===null)r.memoizedState=y;else{i=g.next;var T=k=null,R=null,G=i,W=!1;do{var ie=G.lane&-536870913;if(ie!==G.lane?(Fe&ie)===ie:(Qr&ie)===ie){var J=G.revertLane;if(J===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ie===gs&&(W=!0);else if((Qr&J)===J){G=G.next,J===gs&&(W=!0);continue}else ie={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(T=R=ie,k=y):R=R.next=ie,Me.lanes|=J,Oa|=J;ie=G.action,Ci&&l(y,ie),y=G.hasEagerState?G.eagerState:l(y,ie)}else J={lane:ie,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(T=R=J,k=y):R=R.next=J,Me.lanes|=ie,Oa|=ie;G=G.next}while(G!==null&&G!==i);if(R===null?k=y:R.next=T,!Hn(y,r.memoizedState)&&(Bt=!0,W&&(l=ys,l!==null)))throw l;r.memoizedState=y,r.baseState=k,r.baseQueue=R,f.lastRenderedState=y}return g===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function ch(r){var i=Pt(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var f=l.dispatch,g=l.pending,y=i.memoizedState;if(g!==null){l.pending=null;var k=g=g.next;do y=r(y,k.action),k=k.next;while(k!==g);Hn(y,i.memoizedState)||(Bt=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),l.lastRenderedState=y}return[y,f]}function Nb(r,i,l){var f=Me,g=Pt(),y=Ge;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=i();var k=!Hn((ct||g).memoizedState,l);if(k&&(g.memoizedState=l,Bt=!0),g=g.queue,fh(Eb.bind(null,f,g,r),[r]),g.getSnapshot!==i||k||It!==null&&It.memoizedState.tag&1){if(f.flags|=2048,zs(9,{destroy:void 0},Tb.bind(null,f,g,l,i),null),mt===null)throw Error(a(349));y||(Qr&127)!==0||Cb(f,i,l)}return l}function Cb(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=Me.updateQueue,i===null?(i=Qc(),Me.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function Tb(r,i,l,f){i.value=l,i.getSnapshot=f,Ab(i)&&Ob(r)}function Eb(r,i,l){return l(function(){Ab(i)&&Ob(r)})}function Ab(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Hn(r,l)}catch{return!0}}function Ob(r){var i=bi(r,2);i!==null&&Pn(i,r,2)}function uh(r){var i=Sn();if(typeof r=="function"){var l=r;if(r=l(),Ci){An(!0);try{l()}finally{An(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:r},i}function Mb(r,i,l,f){return r.baseState=l,lh(r,ct,typeof f=="function"?f:Wr)}function n4(r,i,l,f,g){if(ru(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};Z.T!==null?l(!0):y.isTransition=!1,f(y),l=i.pending,l===null?(y.next=i.pending=y,Db(i,y)):(y.next=l.next,i.pending=l.next=y)}}function Db(r,i){var l=i.action,f=i.payload,g=r.state;if(i.isTransition){var y=Z.T,k={};Z.T=k;try{var T=l(g,f),R=Z.S;R!==null&&R(k,T),Rb(r,i,T)}catch(G){dh(r,i,G)}finally{y!==null&&k.types!==null&&(y.types=k.types),Z.T=y}}else try{y=l(g,f),Rb(r,i,y)}catch(G){dh(r,i,G)}}function Rb(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(f){$b(r,i,f)},function(f){return dh(r,i,f)}):$b(r,i,l)}function $b(r,i,l){i.status="fulfilled",i.value=l,Lb(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,Db(r,l)))}function dh(r,i,l){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=l,Lb(i),i=i.next;while(i!==f)}r.action=null}function Lb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Pb(r,i){return i}function Ub(r,i){if(Ge){var l=mt.formState;if(l!==null){e:{var f=Me;if(Ge){if(vt){t:{for(var g=vt,y=cr;g.nodeType!==8;){if(!y){g=null;break t}if(g=dr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){vt=dr(g.nextSibling),f=g.data==="F!";break e}}Sa(f)}f=!1}f&&(i=l[0])}}return l=Sn(),l.memoizedState=l.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pb,lastRenderedState:i},l.queue=f,l=a0.bind(null,Me,f),f.dispatch=l,f=uh(!1),y=gh.bind(null,Me,!1,f.queue),f=Sn(),g={state:i,dispatch:null,action:r,pending:null},f.queue=g,l=n4.bind(null,Me,g,y,l),g.dispatch=l,f.memoizedState=r,[i,l,!1]}function Ib(r){var i=Pt();return Bb(i,ct,r)}function Bb(r,i,l){if(i=lh(r,i,Pb)[0],r=eu(Wr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Wo(i)}catch(k){throw k===bs?Fc:k}else f=i;i=Pt();var g=i.queue,y=g.dispatch;return l!==i.memoizedState&&(Me.flags|=2048,zs(9,{destroy:void 0},r4.bind(null,g,l),null)),[f,y,r]}function r4(r,i){r.action=i}function Vb(r){var i=Pt(),l=ct;if(l!==null)return Bb(i,l,r);Pt(),i=i.memoizedState,l=Pt();var f=l.queue.dispatch;return l.memoizedState=r,[i,f,!1]}function zs(r,i,l,f){return r={tag:r,create:l,deps:f,inst:i,next:null},i=Me.updateQueue,i===null&&(i=Qc(),Me.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(f=l.next,l.next=r,r.next=f,i.lastEffect=r),r}function Zb(){return Pt().memoizedState}function tu(r,i,l,f){var g=Sn();Me.flags|=r,g.memoizedState=zs(1|i,{destroy:void 0},l,f===void 0?null:f)}function nu(r,i,l,f){var g=Pt();f=f===void 0?null:f;var y=g.memoizedState.inst;ct!==null&&f!==null&&nh(f,ct.memoizedState.deps)?g.memoizedState=zs(i,y,l,f):(Me.flags|=r,g.memoizedState=zs(1|i,y,l,f))}function Fb(r,i){tu(8390656,8,r,i)}function fh(r,i){nu(2048,8,r,i)}function a4(r){Me.flags|=4;var i=Me.updateQueue;if(i===null)i=Qc(),Me.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function Hb(r){var i=Pt().memoizedState;return a4({ref:i,nextImpl:r}),function(){if((nt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function qb(r,i){return nu(4,2,r,i)}function Gb(r,i){return nu(4,4,r,i)}function Yb(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Jb(r,i,l){l=l!=null?l.concat([r]):null,nu(4,4,Yb.bind(null,i,r),l)}function hh(){}function Kb(r,i){var l=Pt();i=i===void 0?null:i;var f=l.memoizedState;return i!==null&&nh(i,f[1])?f[0]:(l.memoizedState=[r,i],r)}function Xb(r,i){var l=Pt();i=i===void 0?null:i;var f=l.memoizedState;if(i!==null&&nh(i,f[1]))return f[0];if(f=r(),Ci){An(!0);try{r()}finally{An(!1)}}return l.memoizedState=[f,i],f}function mh(r,i,l){return l===void 0||(Qr&1073741824)!==0&&(Fe&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=Q0(),Me.lanes|=r,Oa|=r,l)}function Qb(r,i,l,f){return Hn(l,i)?l:ks.current!==null?(r=mh(r,l,f),Hn(r,i)||(Bt=!0),r):(Qr&42)===0||(Qr&1073741824)!==0&&(Fe&261930)===0?(Bt=!0,r.memoizedState=l):(r=Q0(),Me.lanes|=r,Oa|=r,i)}function Wb(r,i,l,f,g){var y=B.p;B.p=y!==0&&8>y?y:8;var k=Z.T,T={};Z.T=T,gh(r,!1,i,l);try{var R=g(),G=Z.S;if(G!==null&&G(T,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var W=WC(R,f);el(r,i,W,Xn(r))}else el(r,i,f,Xn(r))}catch(ie){el(r,i,{then:function(){},status:"rejected",reason:ie},Xn())}finally{B.p=y,k!==null&&T.types!==null&&(k.types=T.types),Z.T=k}}function i4(){}function ph(r,i,l,f){if(r.tag!==5)throw Error(a(476));var g=e0(r).queue;Wb(r,g,i,Y,l===null?i4:function(){return t0(r),l(f)})}function e0(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:Y},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function t0(r){var i=e0(r);i.next===null&&(i=r.alternate.memoizedState),el(r,i.next.queue,{},Xn())}function xh(){return cn(gl)}function n0(){return Pt().memoizedState}function r0(){return Pt().memoizedState}function s4(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Xn();r=_a(l);var f=Na(i,r,l);f!==null&&(Pn(f,i,l),Jo(f,i,l)),i={cache:Hf()},r.payload=i;return}i=i.return}}function o4(r,i,l){var f=Xn();l={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ru(r)?i0(i,l):(l=Df(r,i,l,f),l!==null&&(Pn(l,r,f),s0(l,i,f)))}function a0(r,i,l){var f=Xn();el(r,i,l,f)}function el(r,i,l,f){var g={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ru(r))i0(i,g);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var k=i.lastRenderedState,T=y(k,l);if(g.hasEagerState=!0,g.eagerState=T,Hn(T,k))return Lc(r,i,g,0),mt===null&&$c(),!1}catch{}if(l=Df(r,i,g,f),l!==null)return Pn(l,r,f),s0(l,i,f),!0}return!1}function gh(r,i,l,f){if(f={lane:2,revertLane:Jh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},ru(r)){if(i)throw Error(a(479))}else i=Df(r,l,f,2),i!==null&&Pn(i,r,2)}function ru(r){var i=r.alternate;return r===Me||i!==null&&i===Me}function i0(r,i){ws=Kc=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function s0(r,i,l){if((l&4194048)!==0){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,dy(r,l)}}var tl={readContext:cn,use:Wc,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};tl.useEffectEvent=Mt;var o0={readContext:cn,use:Wc,useCallback:function(r,i){return Sn().memoizedState=[r,i===void 0?null:i],r},useContext:cn,useEffect:Fb,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,tu(4194308,4,Yb.bind(null,i,r),l)},useLayoutEffect:function(r,i){return tu(4194308,4,r,i)},useInsertionEffect:function(r,i){tu(4,2,r,i)},useMemo:function(r,i){var l=Sn();i=i===void 0?null:i;var f=r();if(Ci){An(!0);try{r()}finally{An(!1)}}return l.memoizedState=[f,i],f},useReducer:function(r,i,l){var f=Sn();if(l!==void 0){var g=l(i);if(Ci){An(!0);try{l(i)}finally{An(!1)}}}else g=i;return f.memoizedState=f.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},f.queue=r,r=r.dispatch=o4.bind(null,Me,r),[f.memoizedState,r]},useRef:function(r){var i=Sn();return r={current:r},i.memoizedState=r},useState:function(r){r=uh(r);var i=r.queue,l=a0.bind(null,Me,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:hh,useDeferredValue:function(r,i){var l=Sn();return mh(l,r,i)},useTransition:function(){var r=uh(!1);return r=Wb.bind(null,Me,r.queue,!0,!1),Sn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var f=Me,g=Sn();if(Ge){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),mt===null)throw Error(a(349));(Fe&127)!==0||Cb(f,i,l)}g.memoizedState=l;var y={value:l,getSnapshot:i};return g.queue=y,Fb(Eb.bind(null,f,y,r),[r]),f.flags|=2048,zs(9,{destroy:void 0},Tb.bind(null,f,y,l,i),null),l},useId:function(){var r=Sn(),i=mt.identifierPrefix;if(Ge){var l=Mr,f=Or;l=(f&~(1<<32-ht(f)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Xc++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=e4++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:xh,useFormState:Ub,useActionState:Ub,useOptimistic:function(r){var i=Sn();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=gh.bind(null,Me,!0,l),l.dispatch=i,[r,i]},useMemoCache:oh,useCacheRefresh:function(){return Sn().memoizedState=s4.bind(null,Me)},useEffectEvent:function(r){var i=Sn(),l={impl:r};return i.memoizedState=l,function(){if((nt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},yh={readContext:cn,use:Wc,useCallback:Kb,useContext:cn,useEffect:fh,useImperativeHandle:Jb,useInsertionEffect:qb,useLayoutEffect:Gb,useMemo:Xb,useReducer:eu,useRef:Zb,useState:function(){return eu(Wr)},useDebugValue:hh,useDeferredValue:function(r,i){var l=Pt();return Qb(l,ct.memoizedState,r,i)},useTransition:function(){var r=eu(Wr)[0],i=Pt().memoizedState;return[typeof r=="boolean"?r:Wo(r),i]},useSyncExternalStore:Nb,useId:n0,useHostTransitionStatus:xh,useFormState:Ib,useActionState:Ib,useOptimistic:function(r,i){var l=Pt();return Mb(l,ct,r,i)},useMemoCache:oh,useCacheRefresh:r0};yh.useEffectEvent=Hb;var l0={readContext:cn,use:Wc,useCallback:Kb,useContext:cn,useEffect:fh,useImperativeHandle:Jb,useInsertionEffect:qb,useLayoutEffect:Gb,useMemo:Xb,useReducer:ch,useRef:Zb,useState:function(){return ch(Wr)},useDebugValue:hh,useDeferredValue:function(r,i){var l=Pt();return ct===null?mh(l,r,i):Qb(l,ct.memoizedState,r,i)},useTransition:function(){var r=ch(Wr)[0],i=Pt().memoizedState;return[typeof r=="boolean"?r:Wo(r),i]},useSyncExternalStore:Nb,useId:n0,useHostTransitionStatus:xh,useFormState:Vb,useActionState:Vb,useOptimistic:function(r,i){var l=Pt();return ct!==null?Mb(l,ct,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:oh,useCacheRefresh:r0};l0.useEffectEvent=Hb;function bh(r,i,l,f){i=r.memoizedState,l=l(f,i),l=l==null?i:p({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var vh={enqueueSetState:function(r,i,l){r=r._reactInternals;var f=Xn(),g=_a(f);g.payload=i,l!=null&&(g.callback=l),i=Na(r,g,f),i!==null&&(Pn(i,r,f),Jo(i,r,f))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var f=Xn(),g=_a(f);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=Na(r,g,f),i!==null&&(Pn(i,r,f),Jo(i,r,f))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Xn(),f=_a(l);f.tag=2,i!=null&&(f.callback=i),i=Na(r,f,l),i!==null&&(Pn(i,r,l),Jo(i,r,l))}};function c0(r,i,l,f,g,y,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,y,k):i.prototype&&i.prototype.isPureReactComponent?!Bo(l,f)||!Bo(g,y):!0}function u0(r,i,l,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==r&&vh.enqueueReplaceState(i,i.state,null)}function Ti(r,i){var l=i;if("ref"in i){l={};for(var f in i)f!=="ref"&&(l[f]=i[f])}if(r=r.defaultProps){l===i&&(l=p({},l));for(var g in r)l[g]===void 0&&(l[g]=r[g])}return l}function d0(r){Rc(r)}function f0(r){console.error(r)}function h0(r){Rc(r)}function au(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function m0(r,i,l){try{var f=r.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function kh(r,i,l){return l=_a(l),l.tag=3,l.payload={element:null},l.callback=function(){au(r,i)},l}function p0(r){return r=_a(r),r.tag=3,r}function x0(r,i,l,f){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var y=f.value;r.payload=function(){return g(y)},r.callback=function(){m0(i,l,f)}}var k=l.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){m0(i,l,f),typeof g!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var T=f.stack;this.componentDidCatch(f.value,{componentStack:T!==null?T:""})})}function l4(r,i,l,f,g){if(l.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=l.alternate,i!==null&&xs(i,l,g,!0),l=Gn.current,l!==null){switch(l.tag){case 31:case 13:return ur===null?xu():l.alternate===null&&Dt===0&&(Dt=3),l.flags&=-257,l.flags|=65536,l.lanes=g,f===Hc?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([f]):i.add(f),qh(r,f,g)),!1;case 22:return l.flags|=65536,f===Hc?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([f]):l.add(f)),qh(r,f,g)),!1}throw Error(a(435,l.tag))}return qh(r,f,g),xu(),!1}if(Ge)return i=Gn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,f!==If&&(r=Error(a(422),{cause:f}),Fo(sr(r,l)))):(f!==If&&(i=Error(a(423),{cause:f}),Fo(sr(i,l))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,f=sr(f,l),g=kh(r.stateNode,f,g),Xf(r,g),Dt!==4&&(Dt=2)),!1;var y=Error(a(520),{cause:f});if(y=sr(y,l),cl===null?cl=[y]:cl.push(y),Dt!==4&&(Dt=2),i===null)return!0;f=sr(f,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=g&-g,l.lanes|=r,r=kh(l.stateNode,f,r),Xf(l,r),!1;case 1:if(i=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ma===null||!Ma.has(y))))return l.flags|=65536,g&=-g,l.lanes|=g,g=p0(g),x0(g,r,l,f),Xf(l,g),!1}l=l.return}while(l!==null);return!1}var wh=Error(a(461)),Bt=!1;function un(r,i,l,f){i.child=r===null?vb(i,null,l,f):Ni(i,r.child,l,f)}function g0(r,i,l,f,g){l=l.render;var y=i.ref;if("ref"in f){var k={};for(var T in f)T!=="ref"&&(k[T]=f[T])}else k=f;return Si(i),f=rh(r,i,l,k,y,g),T=ah(),r!==null&&!Bt?(ih(r,i,g),ea(r,i,g)):(Ge&&T&&Pf(i),i.flags|=1,un(r,i,f,g),i.child)}function y0(r,i,l,f,g){if(r===null){var y=l.type;return typeof y=="function"&&!Rf(y)&&y.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=y,b0(r,i,y,f,g)):(r=Uc(l.type,null,f,i,i.mode,g),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Eh(r,g)){var k=y.memoizedProps;if(l=l.compare,l=l!==null?l:Bo,l(k,f)&&r.ref===i.ref)return ea(r,i,g)}return i.flags|=1,r=Yr(y,f),r.ref=i.ref,r.return=i,i.child=r}function b0(r,i,l,f,g){if(r!==null){var y=r.memoizedProps;if(Bo(y,f)&&r.ref===i.ref)if(Bt=!1,i.pendingProps=f=y,Eh(r,g))(r.flags&131072)!==0&&(Bt=!0);else return i.lanes=r.lanes,ea(r,i,g)}return Sh(r,i,l,f,g)}function v0(r,i,l,f){var g=f.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,r!==null){for(f=i.child=r.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~y}else f=0,i.child=null;return k0(r,i,y,l,f)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Zc(i,y!==null?y.cachePool:null),y!==null?Sb(i,y):Wf(),zb(i);else return f=i.lanes=536870912,k0(r,i,y!==null?y.baseLanes|l:l,l,f)}else y!==null?(Zc(i,y.cachePool),Sb(i,y),Ta(),i.memoizedState=null):(r!==null&&Zc(i,null),Wf(),Ta());return un(r,i,g,l),i.child}function nl(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function k0(r,i,l,f,g){var y=Gf();return y=y===null?null:{parent:Ut._currentValue,pool:y},i.memoizedState={baseLanes:l,cachePool:y},r!==null&&Zc(i,null),Wf(),zb(i),r!==null&&xs(r,i,f,!0),i.childLanes=g,null}function iu(r,i){return i=ou({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function w0(r,i,l){return Ni(i,r.child,null,l),r=iu(i,i.pendingProps),r.flags|=2,Yn(i),i.memoizedState=null,r}function c4(r,i,l){var f=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ge){if(f.mode==="hidden")return r=iu(i,f),i.lanes=536870912,nl(null,r);if(th(i),(r=vt)?(r=Dv(r,cr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ka!==null?{id:Or,overflow:Mr}:null,retryLane:536870912,hydrationErrors:null},l=ib(r),l.return=i,i.child=l,ln=i,vt=null)):r=null,r===null)throw Sa(i);return i.lanes=536870912,null}return iu(i,f)}var y=r.memoizedState;if(y!==null){var k=y.dehydrated;if(th(i),g)if(i.flags&256)i.flags&=-257,i=w0(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Bt||xs(r,i,l,!1),g=(l&r.childLanes)!==0,Bt||g){if(f=mt,f!==null&&(k=fy(f,l),k!==0&&k!==y.retryLane))throw y.retryLane=k,bi(r,k),Pn(f,r,k),wh;xu(),i=w0(r,i,l)}else r=y.treeContext,vt=dr(k.nextSibling),ln=i,Ge=!0,wa=null,cr=!1,r!==null&&lb(i,r),i=iu(i,f),i.flags|=4096;return i}return r=Yr(r.child,{mode:f.mode,children:f.children}),r.ref=i.ref,i.child=r,r.return=i,r}function su(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function Sh(r,i,l,f,g){return Si(i),l=rh(r,i,l,f,void 0,g),f=ah(),r!==null&&!Bt?(ih(r,i,g),ea(r,i,g)):(Ge&&f&&Pf(i),i.flags|=1,un(r,i,l,g),i.child)}function S0(r,i,l,f,g,y){return Si(i),i.updateQueue=null,l=_b(i,f,l,g),jb(r),f=ah(),r!==null&&!Bt?(ih(r,i,y),ea(r,i,y)):(Ge&&f&&Pf(i),i.flags|=1,un(r,i,l,y),i.child)}function z0(r,i,l,f,g){if(Si(i),i.stateNode===null){var y=fs,k=l.contextType;typeof k=="object"&&k!==null&&(y=cn(k)),y=new l(f,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=vh,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=f,y.state=i.memoizedState,y.refs={},Jf(i),k=l.contextType,y.context=typeof k=="object"&&k!==null?cn(k):fs,y.state=i.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(bh(i,l,k,f),y.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&vh.enqueueReplaceState(y,y.state,null),Xo(i,f,y,g),Ko(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(r===null){y=i.stateNode;var T=i.memoizedProps,R=Ti(l,T);y.props=R;var G=y.context,W=l.contextType;k=fs,typeof W=="object"&&W!==null&&(k=cn(W));var ie=l.getDerivedStateFromProps;W=typeof ie=="function"||typeof y.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,W||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T||G!==k)&&u0(i,y,f,k),ja=!1;var J=i.memoizedState;y.state=J,Xo(i,f,y,g),Ko(),G=i.memoizedState,T||J!==G||ja?(typeof ie=="function"&&(bh(i,l,ie,f),G=i.memoizedState),(R=ja||c0(i,l,R,f,J,G,k))?(W||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=G),y.props=f,y.state=G,y.context=k,f=R):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{y=i.stateNode,Kf(r,i),k=i.memoizedProps,W=Ti(l,k),y.props=W,ie=i.pendingProps,J=y.context,G=l.contextType,R=fs,typeof G=="object"&&G!==null&&(R=cn(G)),T=l.getDerivedStateFromProps,(G=typeof T=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==ie||J!==R)&&u0(i,y,f,R),ja=!1,J=i.memoizedState,y.state=J,Xo(i,f,y,g),Ko();var Q=i.memoizedState;k!==ie||J!==Q||ja||r!==null&&r.dependencies!==null&&Bc(r.dependencies)?(typeof T=="function"&&(bh(i,l,T,f),Q=i.memoizedState),(W=ja||c0(i,l,W,f,J,Q,R)||r!==null&&r.dependencies!==null&&Bc(r.dependencies))?(G||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,Q,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,Q,R)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=Q),y.props=f,y.state=Q,y.context=R,f=W):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),f=!1)}return y=f,su(r,i),f=(i.flags&128)!==0,y||f?(y=i.stateNode,l=f&&typeof l.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&f?(i.child=Ni(i,r.child,null,g),i.child=Ni(i,null,l,g)):un(r,i,l,g),i.memoizedState=y.state,r=i.child):r=ea(r,i,g),r}function j0(r,i,l,f){return ki(),i.flags|=256,un(r,i,l,f),i.child}var zh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jh(r){return{baseLanes:r,cachePool:mb()}}function _h(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=Kn),r}function _0(r,i,l){var f=i.pendingProps,g=!1,y=(i.flags&128)!==0,k;if((k=y)||(k=r!==null&&r.memoizedState===null?!1:(Lt.current&2)!==0),k&&(g=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ge){if(g?Ca(i):Ta(),(r=vt)?(r=Dv(r,cr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ka!==null?{id:Or,overflow:Mr}:null,retryLane:536870912,hydrationErrors:null},l=ib(r),l.return=i,i.child=l,ln=i,vt=null)):r=null,r===null)throw Sa(i);return lm(r)?i.lanes=32:i.lanes=536870912,null}var T=f.children;return f=f.fallback,g?(Ta(),g=i.mode,T=ou({mode:"hidden",children:T},g),f=vi(f,g,l,null),T.return=i,f.return=i,T.sibling=f,i.child=T,f=i.child,f.memoizedState=jh(l),f.childLanes=_h(r,k,l),i.memoizedState=zh,nl(null,f)):(Ca(i),Nh(i,T))}var R=r.memoizedState;if(R!==null&&(T=R.dehydrated,T!==null)){if(y)i.flags&256?(Ca(i),i.flags&=-257,i=Ch(r,i,l)):i.memoizedState!==null?(Ta(),i.child=r.child,i.flags|=128,i=null):(Ta(),T=f.fallback,g=i.mode,f=ou({mode:"visible",children:f.children},g),T=vi(T,g,l,null),T.flags|=2,f.return=i,T.return=i,f.sibling=T,i.child=f,Ni(i,r.child,null,l),f=i.child,f.memoizedState=jh(l),f.childLanes=_h(r,k,l),i.memoizedState=zh,i=nl(null,f));else if(Ca(i),lm(T)){if(k=T.nextSibling&&T.nextSibling.dataset,k)var G=k.dgst;k=G,f=Error(a(419)),f.stack="",f.digest=k,Fo({value:f,source:null,stack:null}),i=Ch(r,i,l)}else if(Bt||xs(r,i,l,!1),k=(l&r.childLanes)!==0,Bt||k){if(k=mt,k!==null&&(f=fy(k,l),f!==0&&f!==R.retryLane))throw R.retryLane=f,bi(r,f),Pn(k,r,f),wh;om(T)||xu(),i=Ch(r,i,l)}else om(T)?(i.flags|=192,i.child=r.child,i=null):(r=R.treeContext,vt=dr(T.nextSibling),ln=i,Ge=!0,wa=null,cr=!1,r!==null&&lb(i,r),i=Nh(i,f.children),i.flags|=4096);return i}return g?(Ta(),T=f.fallback,g=i.mode,R=r.child,G=R.sibling,f=Yr(R,{mode:"hidden",children:f.children}),f.subtreeFlags=R.subtreeFlags&65011712,G!==null?T=Yr(G,T):(T=vi(T,g,l,null),T.flags|=2),T.return=i,f.return=i,f.sibling=T,i.child=f,nl(null,f),f=i.child,T=r.child.memoizedState,T===null?T=jh(l):(g=T.cachePool,g!==null?(R=Ut._currentValue,g=g.parent!==R?{parent:R,pool:R}:g):g=mb(),T={baseLanes:T.baseLanes|l,cachePool:g}),f.memoizedState=T,f.childLanes=_h(r,k,l),i.memoizedState=zh,nl(r.child,f)):(Ca(i),l=r.child,r=l.sibling,l=Yr(l,{mode:"visible",children:f.children}),l.return=i,l.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=l,i.memoizedState=null,l)}function Nh(r,i){return i=ou({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function ou(r,i){return r=qn(22,r,null,i),r.lanes=0,r}function Ch(r,i,l){return Ni(i,r.child,null,l),r=Nh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function N0(r,i,l){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),Zf(r.return,i,l)}function Th(r,i,l,f,g,y){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:g,treeForkCount:y}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=f,k.tail=l,k.tailMode=g,k.treeForkCount=y)}function C0(r,i,l){var f=i.pendingProps,g=f.revealOrder,y=f.tail;f=f.children;var k=Lt.current,T=(k&2)!==0;if(T?(k=k&1|2,i.flags|=128):k&=1,w(Lt,k),un(r,i,f,l),f=Ge?Zo:0,!T&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&N0(r,l,i);else if(r.tag===19)N0(r,l,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(g){case"forwards":for(l=i.child,g=null;l!==null;)r=l.alternate,r!==null&&Jc(r)===null&&(g=l),l=l.sibling;l=g,l===null?(g=i.child,i.child=null):(g=l.sibling,l.sibling=null),Th(i,!1,g,l,y,f);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=i.child,i.child=null;g!==null;){if(r=g.alternate,r!==null&&Jc(r)===null){i.child=g;break}r=g.sibling,g.sibling=l,l=g,g=r}Th(i,!0,l,null,y,f);break;case"together":Th(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function ea(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Oa|=i.lanes,(l&i.childLanes)===0)if(r!==null){if(xs(r,i,l,!1),(l&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,l=Yr(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=Yr(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function Eh(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Bc(r)))}function u4(r,i,l){switch(i.tag){case 3:Pe(i,i.stateNode.containerInfo),za(i,Ut,r.memoizedState.cache),ki();break;case 27:case 5:yt(i);break;case 4:Pe(i,i.stateNode.containerInfo);break;case 10:za(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,th(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Ca(i),i.flags|=128,null):(l&i.child.childLanes)!==0?_0(r,i,l):(Ca(i),r=ea(r,i,l),r!==null?r.sibling:null);Ca(i);break;case 19:var g=(r.flags&128)!==0;if(f=(l&i.childLanes)!==0,f||(xs(r,i,l,!1),f=(l&i.childLanes)!==0),g){if(f)return C0(r,i,l);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),w(Lt,Lt.current),f)break;return null;case 22:return i.lanes=0,v0(r,i,l,i.pendingProps);case 24:za(i,Ut,r.memoizedState.cache)}return ea(r,i,l)}function T0(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)Bt=!0;else{if(!Eh(r,l)&&(i.flags&128)===0)return Bt=!1,u4(r,i,l);Bt=(r.flags&131072)!==0}else Bt=!1,Ge&&(i.flags&1048576)!==0&&ob(i,Zo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(r=ji(i.elementType),i.type=r,typeof r=="function")Rf(r)?(f=Ti(r,f),i.tag=1,i=z0(null,i,r,f,l)):(i.tag=0,i=Sh(null,i,r,f,l));else{if(r!=null){var g=r.$$typeof;if(g===P){i.tag=11,i=g0(null,i,r,f,l);break e}else if(g===V){i.tag=14,i=y0(null,i,r,f,l);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return Sh(r,i,i.type,i.pendingProps,l);case 1:return f=i.type,g=Ti(f,i.pendingProps),z0(r,i,f,g,l);case 3:e:{if(Pe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));f=i.pendingProps;var y=i.memoizedState;g=y.element,Kf(r,i),Xo(i,f,null,l);var k=i.memoizedState;if(f=k.cache,za(i,Ut,f),f!==y.cache&&Ff(i,[Ut],l,!0),Ko(),f=k.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=j0(r,i,f,l);break e}else if(f!==g){g=sr(Error(a(424)),i),Fo(g),i=j0(r,i,f,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,vt=dr(r.firstChild),ln=i,Ge=!0,wa=null,cr=!0,l=vb(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ki(),f===g){i=ea(r,i,l);break e}un(r,i,f,l)}i=i.child}return i;case 26:return su(r,i),r===null?(l=Iv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ge||(l=i.type,r=i.pendingProps,f=Su(pe.current).createElement(l),f[on]=i,f[On]=r,dn(f,l,r),an(f),i.stateNode=f):i.memoizedState=Iv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return yt(i),r===null&&Ge&&(f=i.stateNode=Lv(i.type,i.pendingProps,pe.current),ln=i,cr=!0,g=vt,La(i.type)?(cm=g,vt=dr(f.firstChild)):vt=g),un(r,i,i.pendingProps.children,l),su(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ge&&((g=f=vt)&&(f=I4(f,i.type,i.pendingProps,cr),f!==null?(i.stateNode=f,ln=i,vt=dr(f.firstChild),cr=!1,g=!0):g=!1),g||Sa(i)),yt(i),g=i.type,y=i.pendingProps,k=r!==null?r.memoizedProps:null,f=y.children,am(g,y)?f=null:k!==null&&am(g,k)&&(i.flags|=32),i.memoizedState!==null&&(g=rh(r,i,t4,null,null,l),gl._currentValue=g),su(r,i),un(r,i,f,l),i.child;case 6:return r===null&&Ge&&((r=l=vt)&&(l=B4(l,i.pendingProps,cr),l!==null?(i.stateNode=l,ln=i,vt=null,r=!0):r=!1),r||Sa(i)),null;case 13:return _0(r,i,l);case 4:return Pe(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=Ni(i,null,f,l):un(r,i,f,l),i.child;case 11:return g0(r,i,i.type,i.pendingProps,l);case 7:return un(r,i,i.pendingProps,l),i.child;case 8:return un(r,i,i.pendingProps.children,l),i.child;case 12:return un(r,i,i.pendingProps.children,l),i.child;case 10:return f=i.pendingProps,za(i,i.type,f.value),un(r,i,f.children,l),i.child;case 9:return g=i.type._context,f=i.pendingProps.children,Si(i),g=cn(g),f=f(g),i.flags|=1,un(r,i,f,l),i.child;case 14:return y0(r,i,i.type,i.pendingProps,l);case 15:return b0(r,i,i.type,i.pendingProps,l);case 19:return C0(r,i,l);case 31:return c4(r,i,l);case 22:return v0(r,i,l,i.pendingProps);case 24:return Si(i),f=cn(Ut),r===null?(g=Gf(),g===null&&(g=mt,y=Hf(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=l),g=y),i.memoizedState={parent:f,cache:g},Jf(i),za(i,Ut,g)):((r.lanes&l)!==0&&(Kf(r,i),Xo(i,null,null,l),Ko()),g=r.memoizedState,y=i.memoizedState,g.parent!==f?(g={parent:f,cache:f},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),za(i,Ut,f)):(f=y.cache,za(i,Ut,f),f!==g.cache&&Ff(i,[Ut],l,!0))),un(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ta(r){r.flags|=4}function Ah(r,i,l,f,g){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(g&335544128)===g)if(r.stateNode.complete)r.flags|=8192;else if(nv())r.flags|=8192;else throw _i=Hc,Yf}else r.flags&=-16777217}function E0(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Hv(i))if(nv())r.flags|=8192;else throw _i=Hc,Yf}function lu(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?cy():536870912,r.lanes|=i,Cs|=i)}function rl(r,i){if(!Ge)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function kt(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,f=0;if(i)for(var g=r.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=l,i}function d4(r,i,l){var f=i.pendingProps;switch(Uf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return l=i.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Xr(Ut),Ee(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(ps(i)?ta(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Bf())),kt(i),null;case 26:var g=i.type,y=i.memoizedState;return r===null?(ta(i),y!==null?(kt(i),E0(i,y)):(kt(i),Ah(i,g,null,f,l))):y?y!==r.memoizedState?(ta(i),kt(i),E0(i,y)):(kt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==f&&ta(i),kt(i),Ah(i,g,r,f,l)),null;case 27:if($(i),l=pe.current,g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&ta(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return kt(i),null}r=X.current,ps(i)?cb(i):(r=Lv(g,f,l),i.stateNode=r,ta(i))}return kt(i),null;case 5:if($(i),g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&ta(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return kt(i),null}if(y=X.current,ps(i))cb(i);else{var k=Su(pe.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?k.createElement("select",{is:f.is}):k.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?k.createElement(g,{is:f.is}):k.createElement(g)}}y[on]=i,y[On]=f;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===i)break e;for(;k.sibling===null;){if(k.return===null||k.return===i)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}i.stateNode=y;e:switch(dn(y,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ta(i)}}return kt(i),Ah(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==f&&ta(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(a(166));if(r=pe.current,ps(i)){if(r=i.stateNode,l=i.memoizedProps,f=null,g=ln,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}r[on]=i,r=!!(r.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||_v(r.nodeValue,l)),r||Sa(i,!0)}else r=Su(r).createTextNode(f),r[on]=i,i.stateNode=r}return kt(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(f=ps(i),l!==null){if(r===null){if(!f)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[on]=i}else ki(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),r=!1}else l=Bf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(Yn(i),i):(Yn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return kt(i),null;case 13:if(f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=ps(i),f!==null&&f.dehydrated!==null){if(r===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[on]=i}else ki(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),g=!1}else g=Bf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Yn(i),i):(Yn(i),null)}return Yn(i),(i.flags&128)!==0?(i.lanes=l,i):(l=f!==null,r=r!==null&&r.memoizedState!==null,l&&(f=i.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==g&&(f.flags|=2048)),l!==r&&l&&(i.child.flags|=8192),lu(i,i.updateQueue),kt(i),null);case 4:return Ee(),r===null&&Wh(i.stateNode.containerInfo),kt(i),null;case 10:return Xr(i.type),kt(i),null;case 19:if(H(Lt),f=i.memoizedState,f===null)return kt(i),null;if(g=(i.flags&128)!==0,y=f.rendering,y===null)if(g)rl(f,!1);else{if(Dt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=Jc(r),y!==null){for(i.flags|=128,rl(f,!1),r=y.updateQueue,i.updateQueue=r,lu(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)ab(l,r),l=l.sibling;return w(Lt,Lt.current&1|2),Ge&&Jr(i,f.treeForkCount),i.child}r=r.sibling}f.tail!==null&&bt()>hu&&(i.flags|=128,g=!0,rl(f,!1),i.lanes=4194304)}else{if(!g)if(r=Jc(y),r!==null){if(i.flags|=128,g=!0,r=r.updateQueue,i.updateQueue=r,lu(i,r),rl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Ge)return kt(i),null}else 2*bt()-f.renderingStartTime>hu&&l!==536870912&&(i.flags|=128,g=!0,rl(f,!1),i.lanes=4194304);f.isBackwards?(y.sibling=i.child,i.child=y):(r=f.last,r!==null?r.sibling=y:i.child=y,f.last=y)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=bt(),r.sibling=null,l=Lt.current,w(Lt,g?l&1|2:l&1),Ge&&Jr(i,f.treeForkCount),r):(kt(i),null);case 22:case 23:return Yn(i),eh(),f=i.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(l&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),l=i.updateQueue,l!==null&&lu(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==l&&(i.flags|=2048),r!==null&&H(zi),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Xr(Ut),kt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function f4(r,i){switch(Uf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Xr(Ut),Ee(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return $(i),null;case 31:if(i.memoizedState!==null){if(Yn(i),i.alternate===null)throw Error(a(340));ki()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Yn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ki()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return H(Lt),null;case 4:return Ee(),null;case 10:return Xr(i.type),null;case 22:case 23:return Yn(i),eh(),r!==null&&H(zi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Xr(Ut),null;case 25:return null;default:return null}}function A0(r,i){switch(Uf(i),i.tag){case 3:Xr(Ut),Ee();break;case 26:case 27:case 5:$(i);break;case 4:Ee();break;case 31:i.memoizedState!==null&&Yn(i);break;case 13:Yn(i);break;case 19:H(Lt);break;case 10:Xr(i.type);break;case 22:case 23:Yn(i),eh(),r!==null&&H(zi);break;case 24:Xr(Ut)}}function al(r,i){try{var l=i.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var g=f.next;l=g;do{if((l.tag&r)===r){f=void 0;var y=l.create,k=l.inst;f=y(),k.destroy=f}l=l.next}while(l!==g)}}catch(T){st(i,i.return,T)}}function Ea(r,i,l){try{var f=i.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var y=g.next;f=y;do{if((f.tag&r)===r){var k=f.inst,T=k.destroy;if(T!==void 0){k.destroy=void 0,g=i;var R=l,G=T;try{G()}catch(W){st(g,R,W)}}}f=f.next}while(f!==y)}}catch(W){st(i,i.return,W)}}function O0(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{wb(i,l)}catch(f){st(r,r.return,f)}}}function M0(r,i,l){l.props=Ti(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(f){st(r,i,f)}}function il(r,i){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof l=="function"?r.refCleanup=l(f):l.current=f}}catch(g){st(r,i,g)}}function Dr(r,i){var l=r.ref,f=r.refCleanup;if(l!==null)if(typeof f=="function")try{f()}catch(g){st(r,i,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){st(r,i,g)}else l.current=null}function D0(r){var i=r.type,l=r.memoizedProps,f=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&f.focus();break e;case"img":l.src?f.src=l.src:l.srcSet&&(f.srcset=l.srcSet)}}catch(g){st(r,r.return,g)}}function Oh(r,i,l){try{var f=r.stateNode;D4(f,r.type,l,i),f[On]=i}catch(g){st(r,r.return,g)}}function R0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&La(r.type)||r.tag===4}function Mh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||R0(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&&La(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 Dh(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=qr));else if(f!==4&&(f===27&&La(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(Dh(r,i,l),r=r.sibling;r!==null;)Dh(r,i,l),r=r.sibling}function cu(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(f!==4&&(f===27&&La(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(cu(r,i,l),r=r.sibling;r!==null;)cu(r,i,l),r=r.sibling}function $0(r){var i=r.stateNode,l=r.memoizedProps;try{for(var f=r.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);dn(i,f,l),i[on]=r,i[On]=l}catch(y){st(r,r.return,y)}}var na=!1,Vt=!1,Rh=!1,L0=typeof WeakSet=="function"?WeakSet:Set,sn=null;function h4(r,i){if(r=r.containerInfo,nm=Eu,r=Jy(r),Cf(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var g=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var k=0,T=-1,R=-1,G=0,W=0,ie=r,J=null;t:for(;;){for(var Q;ie!==l||g!==0&&ie.nodeType!==3||(T=k+g),ie!==y||f!==0&&ie.nodeType!==3||(R=k+f),ie.nodeType===3&&(k+=ie.nodeValue.length),(Q=ie.firstChild)!==null;)J=ie,ie=Q;for(;;){if(ie===r)break t;if(J===l&&++G===g&&(T=k),J===y&&++W===f&&(R=k),(Q=ie.nextSibling)!==null)break;ie=J,J=ie.parentNode}ie=Q}l=T===-1||R===-1?null:{start:T,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(rm={focusedElem:r,selectionRange:l},Eu=!1,sn=i;sn!==null;)if(i=sn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,sn=r;else for(;sn!==null;){switch(i=sn,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)g=r[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,l=i,g=y.memoizedProps,y=y.memoizedState,f=l.stateNode;try{var ye=Ti(l.type,g);r=f.getSnapshotBeforeUpdate(ye,y),f.__reactInternalSnapshotBeforeUpdate=r}catch(Ne){st(l,l.return,Ne)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)sm(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":sm(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,sn=r;break}sn=i.return}}function P0(r,i,l){var f=l.flags;switch(l.tag){case 0:case 11:case 15:aa(r,l),f&4&&al(5,l);break;case 1:if(aa(r,l),f&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(k){st(l,l.return,k)}else{var g=Ti(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(g,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){st(l,l.return,k)}}f&64&&O0(l),f&512&&il(l,l.return);break;case 3:if(aa(r,l),f&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{wb(r,i)}catch(k){st(l,l.return,k)}}break;case 27:i===null&&f&4&&$0(l);case 26:case 5:aa(r,l),i===null&&f&4&&D0(l),f&512&&il(l,l.return);break;case 12:aa(r,l);break;case 31:aa(r,l),f&4&&B0(r,l);break;case 13:aa(r,l),f&4&&V0(r,l),f&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=w4.bind(null,l),V4(r,l))));break;case 22:if(f=l.memoizedState!==null||na,!f){i=i!==null&&i.memoizedState!==null||Vt,g=na;var y=Vt;na=f,(Vt=i)&&!y?ia(r,l,(l.subtreeFlags&8772)!==0):aa(r,l),na=g,Vt=y}break;case 30:break;default:aa(r,l)}}function U0(r){var i=r.alternate;i!==null&&(r.alternate=null,U0(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&df(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 zt=null,Dn=!1;function ra(r,i,l){for(l=l.child;l!==null;)I0(r,i,l),l=l.sibling}function I0(r,i,l){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(wn,l)}catch{}switch(l.tag){case 26:Vt||Dr(l,i),ra(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Vt||Dr(l,i);var f=zt,g=Dn;La(l.type)&&(zt=l.stateNode,Dn=!1),ra(r,i,l),ml(l.stateNode),zt=f,Dn=g;break;case 5:Vt||Dr(l,i);case 6:if(f=zt,g=Dn,zt=null,ra(r,i,l),zt=f,Dn=g,zt!==null)if(Dn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(l.stateNode)}catch(y){st(l,i,y)}else try{zt.removeChild(l.stateNode)}catch(y){st(l,i,y)}break;case 18:zt!==null&&(Dn?(r=zt,Ov(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),$s(r)):Ov(zt,l.stateNode));break;case 4:f=zt,g=Dn,zt=l.stateNode.containerInfo,Dn=!0,ra(r,i,l),zt=f,Dn=g;break;case 0:case 11:case 14:case 15:Ea(2,l,i),Vt||Ea(4,l,i),ra(r,i,l);break;case 1:Vt||(Dr(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"&&M0(l,i,f)),ra(r,i,l);break;case 21:ra(r,i,l);break;case 22:Vt=(f=Vt)||l.memoizedState!==null,ra(r,i,l),Vt=f;break;default:ra(r,i,l)}}function B0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{$s(r)}catch(l){st(i,i.return,l)}}}function V0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{$s(r)}catch(l){st(i,i.return,l)}}function m4(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new L0),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new L0),i;default:throw Error(a(435,r.tag))}}function uu(r,i){var l=m4(r);i.forEach(function(f){if(!l.has(f)){l.add(f);var g=S4.bind(null,r,f);f.then(g,g)}})}function Rn(r,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var g=l[f],y=r,k=i,T=k;e:for(;T!==null;){switch(T.tag){case 27:if(La(T.type)){zt=T.stateNode,Dn=!1;break e}break;case 5:zt=T.stateNode,Dn=!1;break e;case 3:case 4:zt=T.stateNode.containerInfo,Dn=!0;break e}T=T.return}if(zt===null)throw Error(a(160));I0(y,k,g),zt=null,Dn=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Z0(i,r),i=i.sibling}var Sr=null;function Z0(r,i){var l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Rn(i,r),$n(r),f&4&&(Ea(3,r,r.return),al(3,r),Ea(5,r,r.return));break;case 1:Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),f&64&&na&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?f:l.concat(f))));break;case 26:var g=Sr;if(Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),f&4){var y=l!==null?l.memoizedState:null;if(f=r.memoizedState,l===null)if(f===null)if(r.stateNode===null){e:{f=r.type,l=r.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Oo]||y[on]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(f),g.head.insertBefore(y,g.querySelector("head > title"))),dn(y,f,l),y[on]=r,an(y),f=y;break e;case"link":var k=Zv("link","href",g).get(f+(l.href||""));if(k){for(var T=0;T<k.length;T++)if(y=k[T],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){k.splice(T,1);break t}}y=g.createElement(f),dn(y,f,l),g.head.appendChild(y);break;case"meta":if(k=Zv("meta","content",g).get(f+(l.content||""))){for(T=0;T<k.length;T++)if(y=k[T],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){k.splice(T,1);break t}}y=g.createElement(f),dn(y,f,l),g.head.appendChild(y);break;default:throw Error(a(468,f))}y[on]=r,an(y),f=y}r.stateNode=f}else Fv(g,r.type,r.stateNode);else r.stateNode=Vv(g,f,r.memoizedProps);else y!==f?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,f===null?Fv(g,r.type,r.stateNode):Vv(g,f,r.memoizedProps)):f===null&&r.stateNode!==null&&Oh(r,r.memoizedProps,l.memoizedProps)}break;case 27:Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),l!==null&&f&4&&Oh(r,r.memoizedProps,l.memoizedProps);break;case 5:if(Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),r.flags&32){g=r.stateNode;try{is(g,"")}catch(ye){st(r,r.return,ye)}}f&4&&r.stateNode!=null&&(g=r.memoizedProps,Oh(r,g,l!==null?l.memoizedProps:g)),f&1024&&(Rh=!0);break;case 6:if(Rn(i,r),$n(r),f&4){if(r.stateNode===null)throw Error(a(162));f=r.memoizedProps,l=r.stateNode;try{l.nodeValue=f}catch(ye){st(r,r.return,ye)}}break;case 3:if(_u=null,g=Sr,Sr=zu(i.containerInfo),Rn(i,r),Sr=g,$n(r),f&4&&l!==null&&l.memoizedState.isDehydrated)try{$s(i.containerInfo)}catch(ye){st(r,r.return,ye)}Rh&&(Rh=!1,F0(r));break;case 4:f=Sr,Sr=zu(r.stateNode.containerInfo),Rn(i,r),$n(r),Sr=f;break;case 12:Rn(i,r),$n(r);break;case 31:Rn(i,r),$n(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,uu(r,f)));break;case 13:Rn(i,r),$n(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(fu=bt()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,uu(r,f)));break;case 22:g=r.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,G=na,W=Vt;if(na=G||g,Vt=W||R,Rn(i,r),Vt=W,na=G,$n(r),f&8192)e:for(i=r.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(l===null||R||na||Vt||Ei(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){R=l=i;try{if(y=R.stateNode,g)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{T=R.stateNode;var ie=R.memoizedProps.style,J=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;T.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ye){st(R,R.return,ye)}}}else if(i.tag===6){if(l===null){R=i;try{R.stateNode.nodeValue=g?"":R.memoizedProps}catch(ye){st(R,R.return,ye)}}}else if(i.tag===18){if(l===null){R=i;try{var Q=R.stateNode;g?Mv(Q,!0):Mv(R.stateNode,!1)}catch(ye){st(R,R.return,ye)}}}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;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=r.updateQueue,f!==null&&(l=f.retryQueue,l!==null&&(f.retryQueue=null,uu(r,l))));break;case 19:Rn(i,r),$n(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,uu(r,f)));break;case 30:break;case 21:break;default:Rn(i,r),$n(r)}}function $n(r){var i=r.flags;if(i&2){try{for(var l,f=r.return;f!==null;){if(R0(f)){l=f;break}f=f.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var g=l.stateNode,y=Mh(r);cu(r,y,g);break;case 5:var k=l.stateNode;l.flags&32&&(is(k,""),l.flags&=-33);var T=Mh(r);cu(r,T,k);break;case 3:case 4:var R=l.stateNode.containerInfo,G=Mh(r);Dh(r,G,R);break;default:throw Error(a(161))}}catch(W){st(r,r.return,W)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function F0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;F0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function aa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)P0(r,i.alternate,i),i=i.sibling}function Ei(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ea(4,i,i.return),Ei(i);break;case 1:Dr(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&M0(i,i.return,l),Ei(i);break;case 27:ml(i.stateNode);case 26:case 5:Dr(i,i.return),Ei(i);break;case 22:i.memoizedState===null&&Ei(i);break;case 30:Ei(i);break;default:Ei(i)}r=r.sibling}}function ia(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,g=r,y=i,k=y.flags;switch(y.tag){case 0:case 11:case 15:ia(g,y,l),al(4,y);break;case 1:if(ia(g,y,l),f=y,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(G){st(f,f.return,G)}if(f=y,g=f.updateQueue,g!==null){var T=f.stateNode;try{var R=g.shared.hiddenCallbacks;if(R!==null)for(g.shared.hiddenCallbacks=null,g=0;g<R.length;g++)kb(R[g],T)}catch(G){st(f,f.return,G)}}l&&k&64&&O0(y),il(y,y.return);break;case 27:$0(y);case 26:case 5:ia(g,y,l),l&&f===null&&k&4&&D0(y),il(y,y.return);break;case 12:ia(g,y,l);break;case 31:ia(g,y,l),l&&k&4&&B0(g,y);break;case 13:ia(g,y,l),l&&k&4&&V0(g,y);break;case 22:y.memoizedState===null&&ia(g,y,l),il(y,y.return);break;case 30:break;default:ia(g,y,l)}i=i.sibling}}function $h(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Ho(l))}function Lh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Ho(r))}function zr(r,i,l,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)H0(r,i,l,f),i=i.sibling}function H0(r,i,l,f){var g=i.flags;switch(i.tag){case 0:case 11:case 15:zr(r,i,l,f),g&2048&&al(9,i);break;case 1:zr(r,i,l,f);break;case 3:zr(r,i,l,f),g&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Ho(r)));break;case 12:if(g&2048){zr(r,i,l,f),r=i.stateNode;try{var y=i.memoizedProps,k=y.id,T=y.onPostCommit;typeof T=="function"&&T(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){st(i,i.return,R)}}else zr(r,i,l,f);break;case 31:zr(r,i,l,f);break;case 13:zr(r,i,l,f);break;case 23:break;case 22:y=i.stateNode,k=i.alternate,i.memoizedState!==null?y._visibility&2?zr(r,i,l,f):sl(r,i):y._visibility&2?zr(r,i,l,f):(y._visibility|=2,js(r,i,l,f,(i.subtreeFlags&10256)!==0||!1)),g&2048&&$h(k,i);break;case 24:zr(r,i,l,f),g&2048&&Lh(i.alternate,i);break;default:zr(r,i,l,f)}}function js(r,i,l,f,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,k=i,T=l,R=f,G=k.flags;switch(k.tag){case 0:case 11:case 15:js(y,k,T,R,g),al(8,k);break;case 23:break;case 22:var W=k.stateNode;k.memoizedState!==null?W._visibility&2?js(y,k,T,R,g):sl(y,k):(W._visibility|=2,js(y,k,T,R,g)),g&&G&2048&&$h(k.alternate,k);break;case 24:js(y,k,T,R,g),g&&G&2048&&Lh(k.alternate,k);break;default:js(y,k,T,R,g)}i=i.sibling}}function sl(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,f=i,g=f.flags;switch(f.tag){case 22:sl(l,f),g&2048&&$h(f.alternate,f);break;case 24:sl(l,f),g&2048&&Lh(f.alternate,f);break;default:sl(l,f)}i=i.sibling}}var ol=8192;function _s(r,i,l){if(r.subtreeFlags&ol)for(r=r.child;r!==null;)q0(r,i,l),r=r.sibling}function q0(r,i,l){switch(r.tag){case 26:_s(r,i,l),r.flags&ol&&r.memoizedState!==null&&eT(l,Sr,r.memoizedState,r.memoizedProps);break;case 5:_s(r,i,l);break;case 3:case 4:var f=Sr;Sr=zu(r.stateNode.containerInfo),_s(r,i,l),Sr=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=ol,ol=16777216,_s(r,i,l),ol=f):_s(r,i,l));break;default:_s(r,i,l)}}function G0(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 ll(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];sn=f,J0(f,r)}G0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Y0(r),r=r.sibling}function Y0(r){switch(r.tag){case 0:case 11:case 15:ll(r),r.flags&2048&&Ea(9,r,r.return);break;case 3:ll(r);break;case 12:ll(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,du(r)):ll(r);break;default:ll(r)}}function du(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];sn=f,J0(f,r)}G0(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ea(8,i,i.return),du(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,du(i));break;default:du(i)}r=r.sibling}}function J0(r,i){for(;sn!==null;){var l=sn;switch(l.tag){case 0:case 11:case 15:Ea(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var f=l.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Ho(l.memoizedState.cache)}if(f=l.child,f!==null)f.return=l,sn=f;else e:for(l=r;sn!==null;){f=sn;var g=f.sibling,y=f.return;if(U0(f),f===l){sn=null;break e}if(g!==null){g.return=y,sn=g;break e}sn=y}}}var p4={getCacheForType:function(r){var i=cn(Ut),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return cn(Ut).controller.signal}},x4=typeof WeakMap=="function"?WeakMap:Map,nt=0,mt=null,Ie=null,Fe=0,it=0,Jn=null,Aa=!1,Ns=!1,Ph=!1,sa=0,Dt=0,Oa=0,Ai=0,Uh=0,Kn=0,Cs=0,cl=null,Ln=null,Ih=!1,fu=0,K0=0,hu=1/0,mu=null,Ma=null,Qt=0,Da=null,Ts=null,oa=0,Bh=0,Vh=null,X0=null,ul=0,Zh=null;function Xn(){return(nt&2)!==0&&Fe!==0?Fe&-Fe:Z.T!==null?Jh():hy()}function Q0(){if(Kn===0)if((Fe&536870912)===0||Ge){var r=wc;wc<<=1,(wc&3932160)===0&&(wc=262144),Kn=r}else Kn=536870912;return r=Gn.current,r!==null&&(r.flags|=32),Kn}function Pn(r,i,l){(r===mt&&(it===2||it===9)||r.cancelPendingCommit!==null)&&(Es(r,0),Ra(r,Fe,Kn,!1)),Ao(r,l),((nt&2)===0||r!==mt)&&(r===mt&&((nt&2)===0&&(Ai|=l),Dt===4&&Ra(r,Fe,Kn,!1)),Rr(r))}function W0(r,i,l){if((nt&6)!==0)throw Error(a(327));var f=!l&&(i&127)===0&&(i&r.expiredLanes)===0||Eo(r,i),g=f?b4(r,i):Hh(r,i,!0),y=f;do{if(g===0){Ns&&!f&&Ra(r,i,0,!1);break}else{if(l=r.current.alternate,y&&!g4(l)){g=Hh(r,i,!1),y=!1;continue}if(g===2){if(y=i,r.errorRecoveryDisabledLanes&y)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var T=r;g=cl;var R=T.current.memoizedState.isDehydrated;if(R&&(Es(T,k).flags|=256),k=Hh(T,k,!1),k!==2){if(Ph&&!R){T.errorRecoveryDisabledLanes|=y,Ai|=y,g=4;break e}y=Ln,Ln=g,y!==null&&(Ln===null?Ln=y:Ln.push.apply(Ln,y))}g=k}if(y=!1,g!==2)continue}}if(g===1){Es(r,0),Ra(r,i,0,!0);break}e:{switch(f=r,y=g,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ra(f,i,Kn,!Aa);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(g=fu+300-bt(),10<g)){if(Ra(f,i,Kn,!Aa),zc(f,0,!0)!==0)break e;oa=i,f.timeoutHandle=Ev(ev.bind(null,f,l,Ln,mu,Ih,i,Kn,Ai,Cs,Aa,y,"Throttled",-0,0),g);break e}ev(f,l,Ln,mu,Ih,i,Kn,Ai,Cs,Aa,y,null,-0,0)}}break}while(!0);Rr(r)}function ev(r,i,l,f,g,y,k,T,R,G,W,ie,J,Q){if(r.timeoutHandle=-1,ie=i.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},q0(i,y,ie);var ye=(y&62914560)===y?fu-bt():(y&4194048)===y?K0-bt():0;if(ye=tT(ie,ye),ye!==null){oa=y,r.cancelPendingCommit=ye(lv.bind(null,r,i,y,l,f,g,k,T,R,W,ie,null,J,Q)),Ra(r,y,k,!G);return}}lv(r,i,y,l,f,g,k,T,R)}function g4(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var g=l[f],y=g.getSnapshot;g=g.value;try{if(!Hn(y(),g))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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 Ra(r,i,l,f){i&=~Uh,i&=~Ai,r.suspendedLanes|=i,r.pingedLanes&=~i,f&&(r.warmLanes|=i),f=r.expirationTimes;for(var g=i;0<g;){var y=31-ht(g),k=1<<y;f[y]=-1,g&=~k}l!==0&&uy(r,l,i)}function pu(){return(nt&6)===0?(dl(0),!1):!0}function Fh(){if(Ie!==null){if(it===0)var r=Ie.return;else r=Ie,Kr=wi=null,sh(r),vs=null,Go=0,r=Ie;for(;r!==null;)A0(r.alternate,r),r=r.return;Ie=null}}function Es(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,L4(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),oa=0,Fh(),mt=r,Ie=l=Yr(r.current,null),Fe=i,it=0,Jn=null,Aa=!1,Ns=Eo(r,i),Ph=!1,Cs=Kn=Uh=Ai=Oa=Dt=0,Ln=cl=null,Ih=!1,(i&8)!==0&&(i|=i&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=i;0<f;){var g=31-ht(f),y=1<<g;i|=r[g],f&=~y}return sa=i,$c(),l}function tv(r,i){Me=null,Z.H=tl,i===bs||i===Fc?(i=gb(),it=3):i===Yf?(i=gb(),it=4):it=i===wh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Jn=i,Ie===null&&(Dt=1,au(r,sr(i,r.current)))}function nv(){var r=Gn.current;return r===null?!0:(Fe&4194048)===Fe?ur===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?r===ur:!1}function rv(){var r=Z.H;return Z.H=tl,r===null?tl:r}function av(){var r=Z.A;return Z.A=p4,r}function xu(){Dt=4,Aa||(Fe&4194048)!==Fe&&Gn.current!==null||(Ns=!0),(Oa&134217727)===0&&(Ai&134217727)===0||mt===null||Ra(mt,Fe,Kn,!1)}function Hh(r,i,l){var f=nt;nt|=2;var g=rv(),y=av();(mt!==r||Fe!==i)&&(mu=null,Es(r,i)),i=!1;var k=Dt;e:do try{if(it!==0&&Ie!==null){var T=Ie,R=Jn;switch(it){case 8:Fh(),k=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(i=!0);var G=it;if(it=0,Jn=null,As(r,T,R,G),l&&Ns){k=0;break e}break;default:G=it,it=0,Jn=null,As(r,T,R,G)}}y4(),k=Dt;break}catch(W){tv(r,W)}while(!0);return i&&r.shellSuspendCounter++,Kr=wi=null,nt=f,Z.H=g,Z.A=y,Ie===null&&(mt=null,Fe=0,$c()),k}function y4(){for(;Ie!==null;)iv(Ie)}function b4(r,i){var l=nt;nt|=2;var f=rv(),g=av();mt!==r||Fe!==i?(mu=null,hu=bt()+500,Es(r,i)):Ns=Eo(r,i);e:do try{if(it!==0&&Ie!==null){i=Ie;var y=Jn;t:switch(it){case 1:it=0,Jn=null,As(r,i,y,1);break;case 2:case 9:if(pb(y)){it=0,Jn=null,sv(i);break}i=function(){it!==2&&it!==9||mt!==r||(it=7),Rr(r)},y.then(i,i);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:pb(y)?(it=0,Jn=null,sv(i)):(it=0,Jn=null,As(r,i,y,7));break;case 5:var k=null;switch(Ie.tag){case 26:k=Ie.memoizedState;case 5:case 27:var T=Ie;if(k?Hv(k):T.stateNode.complete){it=0,Jn=null;var R=T.sibling;if(R!==null)Ie=R;else{var G=T.return;G!==null?(Ie=G,gu(G)):Ie=null}break t}}it=0,Jn=null,As(r,i,y,5);break;case 6:it=0,Jn=null,As(r,i,y,6);break;case 8:Fh(),Dt=6;break e;default:throw Error(a(462))}}v4();break}catch(W){tv(r,W)}while(!0);return Kr=wi=null,Z.H=f,Z.A=g,nt=l,Ie!==null?0:(mt=null,Fe=0,$c(),Dt)}function v4(){for(;Ie!==null&&!$t();)iv(Ie)}function iv(r){var i=T0(r.alternate,r,sa);r.memoizedProps=r.pendingProps,i===null?gu(r):Ie=i}function sv(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=S0(l,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=S0(l,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:sh(i);default:A0(l,i),i=Ie=ab(i,sa),i=T0(l,i,sa)}r.memoizedProps=r.pendingProps,i===null?gu(r):Ie=i}function As(r,i,l,f){Kr=wi=null,sh(i),vs=null,Go=0;var g=i.return;try{if(l4(r,g,i,l,Fe)){Dt=1,au(r,sr(l,r.current)),Ie=null;return}}catch(y){if(g!==null)throw Ie=g,y;Dt=1,au(r,sr(l,r.current)),Ie=null;return}i.flags&32768?(Ge||f===1?r=!0:Ns||(Fe&536870912)!==0?r=!1:(Aa=r=!0,(f===2||f===9||f===3||f===6)&&(f=Gn.current,f!==null&&f.tag===13&&(f.flags|=16384))),ov(i,r)):gu(i)}function gu(r){var i=r;do{if((i.flags&32768)!==0){ov(i,Aa);return}r=i.return;var l=d4(i.alternate,i,sa);if(l!==null){Ie=l;return}if(i=i.sibling,i!==null){Ie=i;return}Ie=i=r}while(i!==null);Dt===0&&(Dt=5)}function ov(r,i){do{var l=f4(r.alternate,r);if(l!==null){l.flags&=32767,Ie=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){Ie=r;return}Ie=r=l}while(r!==null);Dt=6,Ie=null}function lv(r,i,l,f,g,y,k,T,R){r.cancelPendingCommit=null;do yu();while(Qt!==0);if((nt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Mf,WN(r,l,y,k,T,R),r===mt&&(Ie=mt=null,Fe=0),Ts=i,Da=r,oa=l,Bh=y,Vh=g,X0=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,z4(we,function(){return hv(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=Z.T,Z.T=null,g=B.p,B.p=2,k=nt,nt|=4;try{h4(r,i,l)}finally{nt=k,B.p=g,Z.T=f}}Qt=1,cv(),uv(),dv()}}function cv(){if(Qt===1){Qt=0;var r=Da,i=Ts,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=Z.T,Z.T=null;var f=B.p;B.p=2;var g=nt;nt|=4;try{Z0(i,r);var y=rm,k=Jy(r.containerInfo),T=y.focusedElem,R=y.selectionRange;if(k!==T&&T&&T.ownerDocument&&Yy(T.ownerDocument.documentElement,T)){if(R!==null&&Cf(T)){var G=R.start,W=R.end;if(W===void 0&&(W=G),"selectionStart"in T)T.selectionStart=G,T.selectionEnd=Math.min(W,T.value.length);else{var ie=T.ownerDocument||document,J=ie&&ie.defaultView||window;if(J.getSelection){var Q=J.getSelection(),ye=T.textContent.length,Ne=Math.min(R.start,ye),dt=R.end===void 0?Ne:Math.min(R.end,ye);!Q.extend&&Ne>dt&&(k=dt,dt=Ne,Ne=k);var F=Gy(T,Ne),L=Gy(T,dt);if(F&&L&&(Q.rangeCount!==1||Q.anchorNode!==F.node||Q.anchorOffset!==F.offset||Q.focusNode!==L.node||Q.focusOffset!==L.offset)){var q=ie.createRange();q.setStart(F.node,F.offset),Q.removeAllRanges(),Ne>dt?(Q.addRange(q),Q.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),Q.addRange(q))}}}}for(ie=[],Q=T;Q=Q.parentNode;)Q.nodeType===1&&ie.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ie.length;T++){var ae=ie[T];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Eu=!!nm,rm=nm=null}finally{nt=g,B.p=f,Z.T=l}}r.current=i,Qt=2}}function uv(){if(Qt===2){Qt=0;var r=Da,i=Ts,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=Z.T,Z.T=null;var f=B.p;B.p=2;var g=nt;nt|=4;try{P0(r,i.alternate,i)}finally{nt=g,B.p=f,Z.T=l}}Qt=3}}function dv(){if(Qt===4||Qt===3){Qt=0,Kt();var r=Da,i=Ts,l=oa,f=X0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Qt=5:(Qt=0,Ts=Da=null,fv(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(Ma=null),cf(l),i=i.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(wn,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=Z.T,g=B.p,B.p=2,Z.T=null;try{for(var y=r.onRecoverableError,k=0;k<f.length;k++){var T=f[k];y(T.value,{componentStack:T.stack})}}finally{Z.T=i,B.p=g}}(oa&3)!==0&&yu(),Rr(r),g=r.pendingLanes,(l&261930)!==0&&(g&42)!==0?r===Zh?ul++:(ul=0,Zh=r):ul=0,dl(0)}}function fv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Ho(i)))}function yu(){return cv(),uv(),dv(),hv()}function hv(){if(Qt!==5)return!1;var r=Da,i=Bh;Bh=0;var l=cf(oa),f=Z.T,g=B.p;try{B.p=32>l?32:l,Z.T=null,l=Vh,Vh=null;var y=Da,k=oa;if(Qt=0,Ts=Da=null,oa=0,(nt&6)!==0)throw Error(a(331));var T=nt;if(nt|=4,Y0(y.current),H0(y,y.current,k,l),nt=T,dl(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(wn,y)}catch{}return!0}finally{B.p=g,Z.T=f,fv(r,i)}}function mv(r,i,l){i=sr(l,i),i=kh(r.stateNode,i,2),r=Na(r,i,2),r!==null&&(Ao(r,2),Rr(r))}function st(r,i,l){if(r.tag===3)mv(r,r,l);else for(;i!==null;){if(i.tag===3){mv(i,r,l);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ma===null||!Ma.has(f))){r=sr(l,r),l=p0(2),f=Na(i,l,2),f!==null&&(x0(l,f,i,r),Ao(f,2),Rr(f));break}}i=i.return}}function qh(r,i,l){var f=r.pingCache;if(f===null){f=r.pingCache=new x4;var g=new Set;f.set(i,g)}else g=f.get(i),g===void 0&&(g=new Set,f.set(i,g));g.has(l)||(Ph=!0,g.add(l),r=k4.bind(null,r,i,l),i.then(r,r))}function k4(r,i,l){var f=r.pingCache;f!==null&&f.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,mt===r&&(Fe&l)===l&&(Dt===4||Dt===3&&(Fe&62914560)===Fe&&300>bt()-fu?(nt&2)===0&&Es(r,0):Uh|=l,Cs===Fe&&(Cs=0)),Rr(r)}function pv(r,i){i===0&&(i=cy()),r=bi(r,i),r!==null&&(Ao(r,i),Rr(r))}function w4(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),pv(r,l)}function S4(r,i){var l=0;switch(r.tag){case 31:case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(l=g.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(i),pv(r,l)}function z4(r,i){return rn(r,i)}var bu=null,Os=null,Gh=!1,vu=!1,Yh=!1,$a=0;function Rr(r){r!==Os&&r.next===null&&(Os===null?bu=Os=r:Os=Os.next=r),vu=!0,Gh||(Gh=!0,_4())}function dl(r,i){if(!Yh&&vu){Yh=!0;do for(var l=!1,f=bu;f!==null;){if(r!==0){var g=f.pendingLanes;if(g===0)var y=0;else{var k=f.suspendedLanes,T=f.pingedLanes;y=(1<<31-ht(42|r)+1)-1,y&=g&~(k&~T),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,bv(f,y))}else y=Fe,y=zc(f,f===mt?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Eo(f,y)||(l=!0,bv(f,y));f=f.next}while(l);Yh=!1}}function j4(){xv()}function xv(){vu=Gh=!1;var r=0;$a!==0&&$4()&&(r=$a);for(var i=bt(),l=null,f=bu;f!==null;){var g=f.next,y=gv(f,i);y===0?(f.next=null,l===null?bu=g:l.next=g,g===null&&(Os=l)):(l=f,(r!==0||(y&3)!==0)&&(vu=!0)),f=g}Qt!==0&&Qt!==5||dl(r),$a!==0&&($a=0)}function gv(r,i){for(var l=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var k=31-ht(y),T=1<<k,R=g[k];R===-1?((T&l)===0||(T&f)!==0)&&(g[k]=QN(T,i)):R<=i&&(r.expiredLanes|=T),y&=~T}if(i=mt,l=Fe,l=zc(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,l===0||r===i&&(it===2||it===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&nr(f),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Eo(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(f!==null&&nr(f),cf(l)){case 2:case 8:l=fe;break;case 32:l=we;break;case 268435456:l=Ke;break;default:l=we}return f=yv.bind(null,r),l=rn(l,f),r.callbackPriority=i,r.callbackNode=l,i}return f!==null&&f!==null&&nr(f),r.callbackPriority=2,r.callbackNode=null,2}function yv(r,i){if(Qt!==0&&Qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(yu()&&r.callbackNode!==l)return null;var f=Fe;return f=zc(r,r===mt?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(W0(r,f,i),gv(r,bt()),r.callbackNode!=null&&r.callbackNode===l?yv.bind(null,r):null)}function bv(r,i){if(yu())return null;W0(r,i,!0)}function _4(){P4(function(){(nt&6)!==0?rn(ee,j4):xv()})}function Jh(){if($a===0){var r=gs;r===0&&(r=kc,kc<<=1,(kc&261888)===0&&(kc=256)),$a=r}return $a}function vv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Cc(""+r)}function kv(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function N4(r,i,l,f,g){if(i==="submit"&&l&&l.stateNode===g){var y=vv((g[On]||null).action),k=f.submitter;k&&(i=(i=k[On]||null)?vv(i.formAction):k.getAttribute("formAction"),i!==null&&(y=i,k=null));var T=new Oc("action","action",null,f,g);r.push({event:T,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if($a!==0){var R=k?kv(g,k):new FormData(g);ph(l,{pending:!0,data:R,method:g.method,action:y},null,R)}}else typeof y=="function"&&(T.preventDefault(),R=k?kv(g,k):new FormData(g),ph(l,{pending:!0,data:R,method:g.method,action:y},y,R))},currentTarget:g}]})}}for(var Kh=0;Kh<Of.length;Kh++){var Xh=Of[Kh],C4=Xh.toLowerCase(),T4=Xh[0].toUpperCase()+Xh.slice(1);wr(C4,"on"+T4)}wr(Qy,"onAnimationEnd"),wr(Wy,"onAnimationIteration"),wr(eb,"onAnimationStart"),wr("dblclick","onDoubleClick"),wr("focusin","onFocus"),wr("focusout","onBlur"),wr(HC,"onTransitionRun"),wr(qC,"onTransitionStart"),wr(GC,"onTransitionCancel"),wr(tb,"onTransitionEnd"),rs("onMouseEnter",["mouseout","mouseover"]),rs("onMouseLeave",["mouseout","mouseover"]),rs("onPointerEnter",["pointerout","pointerover"]),rs("onPointerLeave",["pointerout","pointerover"]),pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),E4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fl));function wv(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var f=r[l],g=f.event;f=f.listeners;e:{var y=void 0;if(i)for(var k=f.length-1;0<=k;k--){var T=f[k],R=T.instance,G=T.currentTarget;if(T=T.listener,R!==y&&g.isPropagationStopped())break e;y=T,g.currentTarget=G;try{y(g)}catch(W){Rc(W)}g.currentTarget=null,y=R}else for(k=0;k<f.length;k++){if(T=f[k],R=T.instance,G=T.currentTarget,T=T.listener,R!==y&&g.isPropagationStopped())break e;y=T,g.currentTarget=G;try{y(g)}catch(W){Rc(W)}g.currentTarget=null,y=R}}}}function Be(r,i){var l=i[uf];l===void 0&&(l=i[uf]=new Set);var f=r+"__bubble";l.has(f)||(Sv(i,r,2,!1),l.add(f))}function Qh(r,i,l){var f=0;i&&(f|=4),Sv(l,r,f,i)}var ku="_reactListening"+Math.random().toString(36).slice(2);function Wh(r){if(!r[ku]){r[ku]=!0,xy.forEach(function(l){l!=="selectionchange"&&(E4.has(l)||Qh(l,!1,r),Qh(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[ku]||(i[ku]=!0,Qh("selectionchange",!1,i))}}function Sv(r,i,l,f){switch(Qv(i)){case 2:var g=aT;break;case 8:g=iT;break;default:g=mm}l=g.bind(null,i,l,r),g=void 0,!bf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(i,l,{capture:!0,passive:g}):r.addEventListener(i,l,!0):g!==void 0?r.addEventListener(i,l,{passive:g}):r.addEventListener(i,l,!1)}function em(r,i,l,f,g){var y=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var k=f.tag;if(k===3||k===4){var T=f.stateNode.containerInfo;if(T===g)break;if(k===4)for(k=f.return;k!==null;){var R=k.tag;if((R===3||R===4)&&k.stateNode.containerInfo===g)return;k=k.return}for(;T!==null;){if(k=es(T),k===null)return;if(R=k.tag,R===5||R===6||R===26||R===27){f=y=k;continue e}T=T.parentNode}}f=f.return}Cy(function(){var G=y,W=gf(l),ie=[];e:{var J=nb.get(r);if(J!==void 0){var Q=Oc,ye=r;switch(r){case"keypress":if(Ec(l)===0)break e;case"keydown":case"keyup":Q=SC;break;case"focusin":ye="focus",Q=Sf;break;case"focusout":ye="blur",Q=Sf;break;case"beforeblur":case"afterblur":Q=Sf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Ay;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=dC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=_C;break;case Qy:case Wy:case eb:Q=mC;break;case tb:Q=CC;break;case"scroll":case"scrollend":Q=cC;break;case"wheel":Q=EC;break;case"copy":case"cut":case"paste":Q=xC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=My;break;case"toggle":case"beforetoggle":Q=OC}var Ne=(i&4)!==0,dt=!Ne&&(r==="scroll"||r==="scrollend"),F=Ne?J!==null?J+"Capture":null:J;Ne=[];for(var L=G,q;L!==null;){var ae=L;if(q=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||q===null||F===null||(ae=Do(L,F),ae!=null&&Ne.push(hl(L,ae,q))),dt)break;L=L.return}0<Ne.length&&(J=new Q(J,ye,null,l,W),ie.push({event:J,listeners:Ne}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",Q=r==="mouseout"||r==="pointerout",J&&l!==xf&&(ye=l.relatedTarget||l.fromElement)&&(es(ye)||ye[Wi]))break e;if((Q||J)&&(J=W.window===W?W:(J=W.ownerDocument)?J.defaultView||J.parentWindow:window,Q?(ye=l.relatedTarget||l.toElement,Q=G,ye=ye?es(ye):null,ye!==null&&(dt=c(ye),Ne=ye.tag,ye!==dt||Ne!==5&&Ne!==27&&Ne!==6)&&(ye=null)):(Q=null,ye=G),Q!==ye)){if(Ne=Ay,ae="onMouseLeave",F="onMouseEnter",L="mouse",(r==="pointerout"||r==="pointerover")&&(Ne=My,ae="onPointerLeave",F="onPointerEnter",L="pointer"),dt=Q==null?J:Mo(Q),q=ye==null?J:Mo(ye),J=new Ne(ae,L+"leave",Q,l,W),J.target=dt,J.relatedTarget=q,ae=null,es(W)===G&&(Ne=new Ne(F,L+"enter",ye,l,W),Ne.target=q,Ne.relatedTarget=dt,ae=Ne),dt=ae,Q&&ye)t:{for(Ne=A4,F=Q,L=ye,q=0,ae=F;ae;ae=Ne(ae))q++;ae=0;for(var je=L;je;je=Ne(je))ae++;for(;0<q-ae;)F=Ne(F),q--;for(;0<ae-q;)L=Ne(L),ae--;for(;q--;){if(F===L||L!==null&&F===L.alternate){Ne=F;break t}F=Ne(F),L=Ne(L)}Ne=null}else Ne=null;Q!==null&&zv(ie,J,Q,Ne,!1),ye!==null&&dt!==null&&zv(ie,dt,ye,Ne,!0)}}e:{if(J=G?Mo(G):window,Q=J.nodeName&&J.nodeName.toLowerCase(),Q==="select"||Q==="input"&&J.type==="file")var et=By;else if(Uy(J))if(Vy)et=VC;else{et=IC;var Se=UC}else Q=J.nodeName,!Q||Q.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?G&&pf(G.elementType)&&(et=By):et=BC;if(et&&(et=et(r,G))){Iy(ie,et,l,W);break e}Se&&Se(r,J,G),r==="focusout"&&G&&J.type==="number"&&G.memoizedProps.value!=null&&mf(J,"number",J.value)}switch(Se=G?Mo(G):window,r){case"focusin":(Uy(Se)||Se.contentEditable==="true")&&(cs=Se,Tf=G,Vo=null);break;case"focusout":Vo=Tf=cs=null;break;case"mousedown":Ef=!0;break;case"contextmenu":case"mouseup":case"dragend":Ef=!1,Ky(ie,l,W);break;case"selectionchange":if(FC)break;case"keydown":case"keyup":Ky(ie,l,W)}var De;if(jf)e:{switch(r){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else ls?Ly(r,l)&&(He="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(He="onCompositionStart");He&&(Dy&&l.locale!=="ko"&&(ls||He!=="onCompositionStart"?He==="onCompositionEnd"&&ls&&(De=Ty()):(va=W,vf="value"in va?va.value:va.textContent,ls=!0)),Se=wu(G,He),0<Se.length&&(He=new Oy(He,r,null,l,W),ie.push({event:He,listeners:Se}),De?He.data=De:(De=Py(l),De!==null&&(He.data=De)))),(De=DC?RC(r,l):$C(r,l))&&(He=wu(G,"onBeforeInput"),0<He.length&&(Se=new Oy("onBeforeInput","beforeinput",null,l,W),ie.push({event:Se,listeners:He}),Se.data=De)),N4(ie,r,G,l,W)}wv(ie,i)})}function hl(r,i,l){return{instance:r,listener:i,currentTarget:l}}function wu(r,i){for(var l=i+"Capture",f=[];r!==null;){var g=r,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Do(r,l),g!=null&&f.unshift(hl(r,g,y)),g=Do(r,i),g!=null&&f.push(hl(r,g,y))),r.tag===3)return f;r=r.return}return[]}function A4(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function zv(r,i,l,f,g){for(var y=i._reactName,k=[];l!==null&&l!==f;){var T=l,R=T.alternate,G=T.stateNode;if(T=T.tag,R!==null&&R===f)break;T!==5&&T!==26&&T!==27||G===null||(R=G,g?(G=Do(l,y),G!=null&&k.unshift(hl(l,G,R))):g||(G=Do(l,y),G!=null&&k.push(hl(l,G,R)))),l=l.return}k.length!==0&&r.push({event:i,listeners:k})}var O4=/\r\n?/g,M4=/\u0000|\uFFFD/g;function jv(r){return(typeof r=="string"?r:""+r).replace(O4,`
|
|
9
|
+
`).replace(M4,"")}function _v(r,i){return i=jv(i),jv(r)===i}function ut(r,i,l,f,g,y){switch(l){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||is(r,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&is(r,""+f);break;case"className":_c(r,"class",f);break;case"tabIndex":_c(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":_c(r,l,f);break;case"style":_y(r,f,y);break;case"data":if(i!=="object"){_c(r,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=Cc(""+f),r.setAttribute(l,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(i!=="input"&&ut(r,i,"name",g.name,g,null),ut(r,i,"formEncType",g.formEncType,g,null),ut(r,i,"formMethod",g.formMethod,g,null),ut(r,i,"formTarget",g.formTarget,g,null)):(ut(r,i,"encType",g.encType,g,null),ut(r,i,"method",g.method,g,null),ut(r,i,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=Cc(""+f),r.setAttribute(l,f);break;case"onClick":f!=null&&(r.onclick=qr);break;case"onScroll":f!=null&&Be("scroll",r);break;case"onScrollEnd":f!=null&&Be("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}l=Cc(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""+f):r.removeAttribute(l);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":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":f===!0?r.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,f):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(l,f):r.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(l):r.setAttribute(l,f);break;case"popover":Be("beforetoggle",r),Be("toggle",r),jc(r,"popover",f);break;case"xlinkActuate":Hr(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Hr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Hr(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Hr(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Hr(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Hr(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Hr(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Hr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Hr(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":jc(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=oC.get(l)||l,jc(r,l,f))}}function tm(r,i,l,f,g,y){switch(l){case"style":_y(r,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof f=="string"?is(r,f):(typeof f=="number"||typeof f=="bigint")&&is(r,""+f);break;case"onScroll":f!=null&&Be("scroll",r);break;case"onScrollEnd":f!=null&&Be("scrollend",r);break;case"onClick":f!=null&&(r.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gy.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),i=l.slice(2,g?l.length-7:void 0),y=r[On]||null,y=y!=null?y[l]:null,typeof y=="function"&&r.removeEventListener(i,y,g),typeof f=="function")){typeof y!="function"&&y!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,f,g);break e}l in r?r[l]=f:f===!0?r.setAttribute(l,""):jc(r,l,f)}}}function dn(r,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",r),Be("load",r);var f=!1,g=!1,y;for(y in l)if(l.hasOwnProperty(y)){var k=l[y];if(k!=null)switch(y){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ut(r,i,y,k,l,null)}}g&&ut(r,i,"srcSet",l.srcSet,l,null),f&&ut(r,i,"src",l.src,l,null);return;case"input":Be("invalid",r);var T=y=k=g=null,R=null,G=null;for(f in l)if(l.hasOwnProperty(f)){var W=l[f];if(W!=null)switch(f){case"name":g=W;break;case"type":k=W;break;case"checked":R=W;break;case"defaultChecked":G=W;break;case"value":y=W;break;case"defaultValue":T=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:ut(r,i,f,W,l,null)}}wy(r,y,T,R,G,k,g,!1);return;case"select":Be("invalid",r),f=k=y=null;for(g in l)if(l.hasOwnProperty(g)&&(T=l[g],T!=null))switch(g){case"value":y=T;break;case"defaultValue":k=T;break;case"multiple":f=T;default:ut(r,i,g,T,l,null)}i=y,l=k,r.multiple=!!f,i!=null?as(r,!!f,i,!1):l!=null&&as(r,!!f,l,!0);return;case"textarea":Be("invalid",r),y=g=f=null;for(k in l)if(l.hasOwnProperty(k)&&(T=l[k],T!=null))switch(k){case"value":f=T;break;case"defaultValue":g=T;break;case"children":y=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:ut(r,i,k,T,l,null)}zy(r,f,g,y);return;case"option":for(R in l)l.hasOwnProperty(R)&&(f=l[R],f!=null)&&(R==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":ut(r,i,R,f,l,null));return;case"dialog":Be("beforetoggle",r),Be("toggle",r),Be("cancel",r),Be("close",r);break;case"iframe":case"object":Be("load",r);break;case"video":case"audio":for(f=0;f<fl.length;f++)Be(fl[f],r);break;case"image":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"embed":case"source":case"link":Be("error",r),Be("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in l)if(l.hasOwnProperty(G)&&(f=l[G],f!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ut(r,i,G,f,l,null)}return;default:if(pf(i)){for(W in l)l.hasOwnProperty(W)&&(f=l[W],f!==void 0&&tm(r,i,W,f,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(f=l[T],f!=null&&ut(r,i,T,f,l,null))}function D4(r,i,l,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,k=null,T=null,R=null,G=null,W=null;for(Q in l){var ie=l[Q];if(l.hasOwnProperty(Q)&&ie!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":R=ie;default:f.hasOwnProperty(Q)||ut(r,i,Q,null,f,ie)}}for(var J in f){var Q=f[J];if(ie=l[J],f.hasOwnProperty(J)&&(Q!=null||ie!=null))switch(J){case"type":y=Q;break;case"name":g=Q;break;case"checked":G=Q;break;case"defaultChecked":W=Q;break;case"value":k=Q;break;case"defaultValue":T=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:Q!==ie&&ut(r,i,J,Q,f,ie)}}hf(r,k,T,R,G,W,y,g);return;case"select":Q=k=T=J=null;for(y in l)if(R=l[y],l.hasOwnProperty(y)&&R!=null)switch(y){case"value":break;case"multiple":Q=R;default:f.hasOwnProperty(y)||ut(r,i,y,null,f,R)}for(g in f)if(y=f[g],R=l[g],f.hasOwnProperty(g)&&(y!=null||R!=null))switch(g){case"value":J=y;break;case"defaultValue":T=y;break;case"multiple":k=y;default:y!==R&&ut(r,i,g,y,f,R)}i=T,l=k,f=Q,J!=null?as(r,!!l,J,!1):!!f!=!!l&&(i!=null?as(r,!!l,i,!0):as(r,!!l,l?[]:"",!1));return;case"textarea":Q=J=null;for(T in l)if(g=l[T],l.hasOwnProperty(T)&&g!=null&&!f.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ut(r,i,T,null,f,g)}for(k in f)if(g=f[k],y=l[k],f.hasOwnProperty(k)&&(g!=null||y!=null))switch(k){case"value":J=g;break;case"defaultValue":Q=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==y&&ut(r,i,k,g,f,y)}Sy(r,J,Q);return;case"option":for(var ye in l)J=l[ye],l.hasOwnProperty(ye)&&J!=null&&!f.hasOwnProperty(ye)&&(ye==="selected"?r.selected=!1:ut(r,i,ye,null,f,J));for(R in f)J=f[R],Q=l[R],f.hasOwnProperty(R)&&J!==Q&&(J!=null||Q!=null)&&(R==="selected"?r.selected=J&&typeof J!="function"&&typeof J!="symbol":ut(r,i,R,J,f,Q));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 l)J=l[Ne],l.hasOwnProperty(Ne)&&J!=null&&!f.hasOwnProperty(Ne)&&ut(r,i,Ne,null,f,J);for(G in f)if(J=f[G],Q=l[G],f.hasOwnProperty(G)&&J!==Q&&(J!=null||Q!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:ut(r,i,G,J,f,Q)}return;default:if(pf(i)){for(var dt in l)J=l[dt],l.hasOwnProperty(dt)&&J!==void 0&&!f.hasOwnProperty(dt)&&tm(r,i,dt,void 0,f,J);for(W in f)J=f[W],Q=l[W],!f.hasOwnProperty(W)||J===Q||J===void 0&&Q===void 0||tm(r,i,W,J,f,Q);return}}for(var F in l)J=l[F],l.hasOwnProperty(F)&&J!=null&&!f.hasOwnProperty(F)&&ut(r,i,F,null,f,J);for(ie in f)J=f[ie],Q=l[ie],!f.hasOwnProperty(ie)||J===Q||J==null&&Q==null||ut(r,i,ie,J,f,Q)}function Nv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function R4(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var g=l[f],y=g.transferSize,k=g.initiatorType,T=g.duration;if(y&&T&&Nv(k)){for(k=0,T=g.responseEnd,f+=1;f<l.length;f++){var R=l[f],G=R.startTime;if(G>T)break;var W=R.transferSize,ie=R.initiatorType;W&&Nv(ie)&&(R=R.responseEnd,k+=W*(R<T?1:(T-G)/(R-G)))}if(--f,i+=8*(y+k)/(g.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 nm=null,rm=null;function Su(r){return r.nodeType===9?r:r.ownerDocument}function Cv(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 Tv(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 am(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 im=null;function $4(){var r=window.event;return r&&r.type==="popstate"?r===im?!1:(im=r,!0):(im=null,!1)}var Ev=typeof setTimeout=="function"?setTimeout:void 0,L4=typeof clearTimeout=="function"?clearTimeout:void 0,Av=typeof Promise=="function"?Promise:void 0,P4=typeof queueMicrotask=="function"?queueMicrotask:typeof Av<"u"?function(r){return Av.resolve(null).then(r).catch(U4)}:Ev;function U4(r){setTimeout(function(){throw r})}function La(r){return r==="head"}function Ov(r,i){var l=i,f=0;do{var g=l.nextSibling;if(r.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(f===0){r.removeChild(g),$s(i);return}f--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")f++;else if(l==="html")ml(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,ml(l);for(var y=l.firstChild;y;){var k=y.nextSibling,T=y.nodeName;y[Oo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=k}}else l==="body"&&ml(r.ownerDocument.body);l=g}while(l);$s(i)}function Mv(r,i){var l=r;r=0;do{var f=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=f}while(l)}function sm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":sm(l),df(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function I4(r,i,l,f){for(;r.nodeType===1;){var g=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Oo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=dr(r.nextSibling),r===null)break}return null}function B4(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=dr(r.nextSibling),r===null))return null;return r}function Dv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=dr(r.nextSibling),r===null))return null;return r}function om(r){return r.data==="$?"||r.data==="$~"}function lm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function V4(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var f=function(){i(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function dr(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 cm=null;function Rv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return dr(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function $v(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function Lv(r,i,l){switch(i=Su(l),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 ml(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);df(r)}var fr=new Map,Pv=new Set;function zu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var la=B.d;B.d={f:Z4,r:F4,D:H4,C:q4,L:G4,m:Y4,X:K4,S:J4,M:X4};function Z4(){var r=la.f(),i=pu();return r||i}function F4(r){var i=ts(r);i!==null&&i.tag===5&&i.type==="form"?t0(i):la.r(r)}var Ms=typeof document>"u"?null:document;function Uv(r,i,l){var f=Ms;if(f&&typeof i=="string"&&i){var g=ar(i);g='link[rel="'+r+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),Pv.has(g)||(Pv.add(g),r={rel:r,crossOrigin:l,href:i},f.querySelector(g)===null&&(i=f.createElement("link"),dn(i,"link",r),an(i),f.head.appendChild(i)))}}function H4(r){la.D(r),Uv("dns-prefetch",r,null)}function q4(r,i){la.C(r,i),Uv("preconnect",r,i)}function G4(r,i,l){la.L(r,i,l);var f=Ms;if(f&&r&&i){var g='link[rel="preload"][as="'+ar(i)+'"]';i==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+ar(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+ar(l.imageSizes)+'"]')):g+='[href="'+ar(r)+'"]';var y=g;switch(i){case"style":y=Ds(r);break;case"script":y=Rs(r)}fr.has(y)||(r=p({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),fr.set(y,r),f.querySelector(g)!==null||i==="style"&&f.querySelector(pl(y))||i==="script"&&f.querySelector(xl(y))||(i=f.createElement("link"),dn(i,"link",r),an(i),f.head.appendChild(i)))}}function Y4(r,i){la.m(r,i);var l=Ms;if(l&&r){var f=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+ar(f)+'"][href="'+ar(r)+'"]',y=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Rs(r)}if(!fr.has(y)&&(r=p({rel:"modulepreload",href:r},i),fr.set(y,r),l.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(xl(y)))return}f=l.createElement("link"),dn(f,"link",r),an(f),l.head.appendChild(f)}}}function J4(r,i,l){la.S(r,i,l);var f=Ms;if(f&&r){var g=ns(f).hoistableStyles,y=Ds(r);i=i||"default";var k=g.get(y);if(!k){var T={loading:0,preload:null};if(k=f.querySelector(pl(y)))T.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},l),(l=fr.get(y))&&um(r,l);var R=k=f.createElement("link");an(R),dn(R,"link",r),R._p=new Promise(function(G,W){R.onload=G,R.onerror=W}),R.addEventListener("load",function(){T.loading|=1}),R.addEventListener("error",function(){T.loading|=2}),T.loading|=4,ju(k,i,f)}k={type:"stylesheet",instance:k,count:1,state:T},g.set(y,k)}}}function K4(r,i){la.X(r,i);var l=Ms;if(l&&r){var f=ns(l).hoistableScripts,g=Rs(r),y=f.get(g);y||(y=l.querySelector(xl(g)),y||(r=p({src:r,async:!0},i),(i=fr.get(g))&&dm(r,i),y=l.createElement("script"),an(y),dn(y,"link",r),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function X4(r,i){la.M(r,i);var l=Ms;if(l&&r){var f=ns(l).hoistableScripts,g=Rs(r),y=f.get(g);y||(y=l.querySelector(xl(g)),y||(r=p({src:r,async:!0,type:"module"},i),(i=fr.get(g))&&dm(r,i),y=l.createElement("script"),an(y),dn(y,"link",r),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function Iv(r,i,l,f){var g=(g=pe.current)?zu(g):null;if(!g)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Ds(l.href),l=ns(g).hoistableStyles,f=l.get(i),f||(f={type:"style",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=Ds(l.href);var y=ns(g).hoistableStyles,k=y.get(r);if(k||(g=g.ownerDocument||g,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,k),(y=g.querySelector(pl(r)))&&!y._p&&(k.instance=y,k.state.loading=5),fr.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},fr.set(r,l),y||Q4(g,r,l,k.state))),i&&f===null)throw Error(a(528,""));return k}if(i&&f!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Rs(l),l=ns(g).hoistableScripts,f=l.get(i),f||(f={type:"script",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Ds(r){return'href="'+ar(r)+'"'}function pl(r){return'link[rel="stylesheet"]['+r+"]"}function Bv(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function Q4(r,i,l,f){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=r.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),dn(i,"link",l),an(i),r.head.appendChild(i))}function Rs(r){return'[src="'+ar(r)+'"]'}function xl(r){return"script[async]"+r}function Vv(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var f=r.querySelector('style[data-href~="'+ar(l.href)+'"]');if(f)return i.instance=f,an(f),f;var g=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),an(f),dn(f,"style",g),ju(f,l.precedence,r),i.instance=f;case"stylesheet":g=Ds(l.href);var y=r.querySelector(pl(g));if(y)return i.state.loading|=4,i.instance=y,an(y),y;f=Bv(l),(g=fr.get(g))&&um(f,g),y=(r.ownerDocument||r).createElement("link"),an(y);var k=y;return k._p=new Promise(function(T,R){k.onload=T,k.onerror=R}),dn(y,"link",f),i.state.loading|=4,ju(y,l.precedence,r),i.instance=y;case"script":return y=Rs(l.src),(g=r.querySelector(xl(y)))?(i.instance=g,an(g),g):(f=l,(g=fr.get(y))&&(f=p({},l),dm(f,g)),r=r.ownerDocument||r,g=r.createElement("script"),an(g),dn(g,"link",f),r.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,ju(f,l.precedence,r));return i.instance}function ju(r,i,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,y=g,k=0;k<f.length;k++){var T=f[k];if(T.dataset.precedence===i)y=T;else if(y!==g)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function um(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function dm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var _u=null;function Zv(r,i,l){if(_u===null){var f=new Map,g=_u=new Map;g.set(l,f)}else g=_u,f=g.get(l),f||(f=new Map,g.set(l,f));if(f.has(r))return f;for(f.set(r,null),l=l.getElementsByTagName(r),g=0;g<l.length;g++){var y=l[g];if(!(y[Oo]||y[on]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(i)||"";k=r+k;var T=f.get(k);T?T.push(y):f.set(k,[y])}}return f}function Fv(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function W4(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Hv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function eT(r,i,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=Ds(f.href),y=i.querySelector(pl(g));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Nu.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=y,an(y);return}y=i.ownerDocument||i,f=Bv(f),(g=fr.get(g))&&um(f,g),y=y.createElement("link"),an(y);var k=y;k._p=new Promise(function(T,R){k.onload=T,k.onerror=R}),dn(y,"link",f),l.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=Nu.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var fm=0;function tT(r,i){return r.stylesheets&&r.count===0&&Tu(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var f=setTimeout(function(){if(r.stylesheets&&Tu(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&fm===0&&(fm=62500*R4());var g=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Tu(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>fm?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function Nu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Cu=null;function Tu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Cu=new Map,i.forEach(nT,r),Cu=null,Nu.call(r))}function nT(r,i){if(!(i.state.loading&4)){var l=Cu.get(r);if(l)var f=l.get(null);else{l=new Map,Cu.set(r,l);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var k=g[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(l.set(k.dataset.precedence,k),f=k)}f&&l.set(null,f)}g=i.instance,k=g.getAttribute("data-precedence"),y=l.get(k)||f,y===f&&l.set(null,g),l.set(k,g),this.count++,f=Nu.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),y?y.parentNode.insertBefore(g,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),i.state.loading|=4}}var gl={$$typeof:N,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function rT(r,i,l,f,g,y,k,T,R){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=of(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=of(0),this.hiddenUpdates=of(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function qv(r,i,l,f,g,y,k,T,R,G,W,ie){return r=new rT(r,i,l,k,R,G,W,ie,T),i=1,y===!0&&(i|=24),y=qn(3,null,null,i),r.current=y,y.stateNode=r,i=Hf(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:f,isDehydrated:l,cache:i},Jf(y),r}function Gv(r){return r?(r=fs,r):fs}function Yv(r,i,l,f,g,y){g=Gv(g),f.context===null?f.context=g:f.pendingContext=g,f=_a(i),f.payload={element:l},y=y===void 0?null:y,y!==null&&(f.callback=y),l=Na(r,f,i),l!==null&&(Pn(l,r,i),Jo(l,r,i))}function Jv(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function hm(r,i){Jv(r,i),(r=r.alternate)&&Jv(r,i)}function Kv(r){if(r.tag===13||r.tag===31){var i=bi(r,67108864);i!==null&&Pn(i,r,67108864),hm(r,67108864)}}function Xv(r){if(r.tag===13||r.tag===31){var i=Xn();i=lf(i);var l=bi(r,i);l!==null&&Pn(l,r,i),hm(r,i)}}var Eu=!0;function aT(r,i,l,f){var g=Z.T;Z.T=null;var y=B.p;try{B.p=2,mm(r,i,l,f)}finally{B.p=y,Z.T=g}}function iT(r,i,l,f){var g=Z.T;Z.T=null;var y=B.p;try{B.p=8,mm(r,i,l,f)}finally{B.p=y,Z.T=g}}function mm(r,i,l,f){if(Eu){var g=pm(f);if(g===null)em(r,i,f,Au,l),Wv(r,f);else if(oT(g,r,i,l,f))f.stopPropagation();else if(Wv(r,f),i&4&&-1<sT.indexOf(r)){for(;g!==null;){var y=ts(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=mi(y.pendingLanes);if(k!==0){var T=y;for(T.pendingLanes|=2,T.entangledLanes|=2;k;){var R=1<<31-ht(k);T.entanglements[1]|=R,k&=~R}Rr(y),(nt&6)===0&&(hu=bt()+500,dl(0))}}break;case 31:case 13:T=bi(y,2),T!==null&&Pn(T,y,2),pu(),hm(y,2)}if(y=pm(f),y===null&&em(r,i,f,Au,l),y===g)break;g=y}g!==null&&f.stopPropagation()}else em(r,i,f,null,l)}}function pm(r){return r=gf(r),xm(r)}var Au=null;function xm(r){if(Au=null,r=es(r),r!==null){var i=c(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=o(i),r!==null)return r;r=null}else if(l===31){if(r=d(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Au=r,null}function Qv(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(Qi()){case ee:return 2;case fe:return 8;case we:case Ce:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var gm=!1,Pa=null,Ua=null,Ia=null,yl=new Map,bl=new Map,Ba=[],sT="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 Wv(r,i){switch(r){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":yl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":bl.delete(i.pointerId)}}function vl(r,i,l,f,g,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:y,targetContainers:[g]},i!==null&&(i=ts(i),i!==null&&Kv(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),r)}function oT(r,i,l,f,g){switch(i){case"focusin":return Pa=vl(Pa,r,i,l,f,g),!0;case"dragenter":return Ua=vl(Ua,r,i,l,f,g),!0;case"mouseover":return Ia=vl(Ia,r,i,l,f,g),!0;case"pointerover":var y=g.pointerId;return yl.set(y,vl(yl.get(y)||null,r,i,l,f,g)),!0;case"gotpointercapture":return y=g.pointerId,bl.set(y,vl(bl.get(y)||null,r,i,l,f,g)),!0}return!1}function e1(r){var i=es(r.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=o(l),i!==null){r.blockedOn=i,my(r.priority,function(){Xv(l)});return}}else if(i===31){if(i=d(l),i!==null){r.blockedOn=i,my(r.priority,function(){Xv(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ou(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=pm(r.nativeEvent);if(l===null){l=r.nativeEvent;var f=new l.constructor(l.type,l);xf=f,l.target.dispatchEvent(f),xf=null}else return i=ts(l),i!==null&&Kv(i),r.blockedOn=l,!1;i.shift()}return!0}function t1(r,i,l){Ou(r)&&l.delete(i)}function lT(){gm=!1,Pa!==null&&Ou(Pa)&&(Pa=null),Ua!==null&&Ou(Ua)&&(Ua=null),Ia!==null&&Ou(Ia)&&(Ia=null),yl.forEach(t1),bl.forEach(t1)}function Mu(r,i){r.blockedOn===i&&(r.blockedOn=null,gm||(gm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,lT)))}var Du=null;function n1(r){Du!==r&&(Du=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Du===r&&(Du=null);for(var i=0;i<r.length;i+=3){var l=r[i],f=r[i+1],g=r[i+2];if(typeof f!="function"){if(xm(f||l)===null)continue;break}var y=ts(l);y!==null&&(r.splice(i,3),i-=3,ph(y,{pending:!0,data:g,method:l.method,action:f},f,g))}}))}function $s(r){function i(R){return Mu(R,r)}Pa!==null&&Mu(Pa,r),Ua!==null&&Mu(Ua,r),Ia!==null&&Mu(Ia,r),yl.forEach(i),bl.forEach(i);for(var l=0;l<Ba.length;l++){var f=Ba[l];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Ba.length&&(l=Ba[0],l.blockedOn===null);)e1(l),l.blockedOn===null&&Ba.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var g=l[f],y=l[f+1],k=g[On]||null;if(typeof y=="function")k||n1(l);else if(k){var T=null;if(y&&y.hasAttribute("formAction")){if(g=y,k=y[On]||null)T=k.formAction;else if(xm(g)!==null)continue}else T=k.action;typeof T=="function"?l[f+1]=T:(l.splice(f,3),f-=3),n1(l)}}}function r1(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return g=k})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),f||setTimeout(l,20)}function l(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,g=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function ym(r){this._internalRoot=r}Ru.prototype.render=ym.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,f=Xn();Yv(l,f,r,i,null,null)},Ru.prototype.unmount=ym.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Yv(r.current,2,null,r,null,null),pu(),i[Wi]=null}};function Ru(r){this._internalRoot=r}Ru.prototype.unstable_scheduleHydration=function(r){if(r){var i=hy();r={blockedOn:null,target:r,priority:i};for(var l=0;l<Ba.length&&i!==0&&i<Ba[l].priority;l++);Ba.splice(l,0,r),l===0&&e1(r)}};var a1=t.version;if(a1!=="19.2.4")throw Error(a(527,a1,"19.2.4"));B.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?x(r):null,r=r===null?null:r.stateNode,r};var cT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{wn=$u.inject(cT),Xt=$u}catch{}}return wl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var l=!1,f="",g=d0,y=f0,k=h0;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=qv(r,1,!1,null,null,l,f,null,g,y,k,r1),r[Wi]=i.current,Wh(r),new ym(i)},wl.hydrateRoot=function(r,i,l){if(!s(r))throw Error(a(299));var f=!1,g="",y=d0,k=f0,T=h0,R=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(k=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),i=qv(r,1,!0,i,l??null,f,g,R,y,k,T,r1),i.context=Gv(null),l=i.current,f=Xn(),f=lf(f),g=_a(f),g.callback=null,Na(l,g,f),l=f,i.current.lanes=l,Ao(i,l),Rr(i),r[Wi]=i.current,Wh(r),new Ru(i)},wl.version="19.2.4",wl}var m1;function bT(){if(m1)return km.exports;m1=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(),km.exports=yT(),km.exports}var vT=bT();var p1="popstate";function kT(e={}){function t(a,s){let{pathname:c,search:o,hash:d}=a.location;return Tp("",{pathname:c,search:o,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:Hl(s)}return ST(t,n,null,e)}function jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wT(){return Math.random().toString(36).substring(2,10)}function x1(e,t){return{usr:e.state,key:e.key,idx:t}}function Tp(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?po(t):t,state:n,key:t&&t.key||a||wT()}}function Hl({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 po(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 ST(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:c=!1}=a,o=s.history,d="POP",h=null,m=x();m==null&&(m=0,o.replaceState({...o.state,idx:m},""));function x(){return(o.state||{idx:null}).idx}function p(){d="POP";let A=x(),_=A==null?null:A-m;m=A,h&&h({action:d,location:z.location,delta:_})}function b(A,_){d="PUSH";let E=Tp(z.location,A,_);m=x()+1;let N=x1(E,m),P=z.createHref(E);try{o.pushState(N,"",P)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(P)}c&&h&&h({action:d,location:z.location,delta:1})}function v(A,_){d="REPLACE";let E=Tp(z.location,A,_);m=x();let N=x1(E,m),P=z.createHref(E);o.replaceState(N,"",P),c&&h&&h({action:d,location:z.location,delta:0})}function S(A){return zT(A)}let z={get action(){return d},get location(){return e(s,o)},listen(A){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(p1,p),h=A,()=>{s.removeEventListener(p1,p),h=null}},createHref(A){return t(s,A)},createURL:S,encodeLocation(A){let _=S(A);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:b,replace:v,go(A){return o.go(A)}};return z}function zT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),jt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Hl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function ez(e,t,n="/"){return jT(e,t,n,!1)}function jT(e,t,n,a){let s=typeof t=="string"?po(t):t,c=ma(s.pathname||"/",n);if(c==null)return null;let o=tz(e);_T(o);let d=null;for(let h=0;d==null&&h<o.length;++h){let m=LT(c);d=RT(o[h],m,a)}return d}function tz(e,t=[],n=[],a="",s=!1){let c=(o,d,h=s,m)=>{let x={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:d,route:o};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(a)&&h)return;jt(x.relativePath.startsWith(a),`Absolute route path "${x.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(a.length)}let p=fa([a,x.relativePath]),b=n.concat(x);o.children&&o.children.length>0&&(jt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),tz(o.children,t,b,p,h)),!(o.path==null&&!o.index)&&t.push({path:p,score:MT(p,o.index),routesMeta:b})};return e.forEach((o,d)=>{if(o.path===""||!o.path?.includes("?"))c(o,d);else for(let h of nz(o.path))c(o,d,!0,h)}),t}function nz(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),c=n.replace(/\?$/,"");if(a.length===0)return s?[c,""]:[c];let o=nz(a.join("/")),d=[];return d.push(...o.map(h=>h===""?c:[c,h].join("/"))),s&&d.push(...o),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function _T(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:DT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var NT=/^:[\w-]+$/,CT=3,TT=2,ET=1,AT=10,OT=-2,g1=e=>e==="*";function MT(e,t){let n=e.split("/"),a=n.length;return n.some(g1)&&(a+=OT),t&&(a+=TT),n.filter(s=>!g1(s)).reduce((s,c)=>s+(NT.test(c)?CT:c===""?ET:AT),a)}function DT(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 RT(e,t,n=!1){let{routesMeta:a}=e,s={},c="/",o=[];for(let d=0;d<a.length;++d){let h=a[d],m=d===a.length-1,x=c==="/"?t:t.slice(c.length)||"/",p=yd({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},x),b=h.route;if(!p&&m&&n&&!a[a.length-1].route.index&&(p=yd({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},x)),!p)return null;Object.assign(s,p.params),o.push({params:s,pathname:fa([c,p.pathname]),pathnameBase:BT(fa([c,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(c=fa([c,p.pathnameBase]))}return o}function yd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=$T(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let c=s[0],o=c.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:a.reduce((m,{paramName:x,isOptional:p},b)=>{if(x==="*"){let S=d[b]||"";o=c.slice(0,c.length-S.length).replace(/(.)\/+$/,"$1")}const v=d[b];return p&&!v?m[x]=void 0:m[x]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:o,pattern:e}}function $T(e,t=!1,n=!0){Tr(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,(o,d,h)=>(a.push({paramName:d,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 LT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tr(!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 ma(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 PT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function UT(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?po(e):e,c;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?c=y1(n.substring(1),"/"):c=y1(n,t)):c=t,{pathname:c,search:VT(a),hash:ZT(s)}}function y1(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 jm(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 IT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Lx(e){let t=IT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Px(e,t,n,a=!1){let s;typeof e=="string"?s=po(e):(s={...e},jt(!s.pathname||!s.pathname.includes("?"),jm("?","pathname","search",s)),jt(!s.pathname||!s.pathname.includes("#"),jm("#","pathname","hash",s)),jt(!s.search||!s.search.includes("#"),jm("#","search","hash",s)));let c=e===""||s.pathname==="",o=c?"/":s.pathname,d;if(o==null)d=n;else{let p=t.length-1;if(!a&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),p-=1;s.pathname=b.join("/")}d=p>=0?t[p]:"/"}let h=UT(s,d),m=o&&o!=="/"&&o.endsWith("/"),x=(c||o===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||x)&&(h.pathname+="/"),h}var fa=e=>e.join("/").replace(/\/\/+/g,"/"),BT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),VT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,FT=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 HT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function qT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var rz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function az(e,t){let n=e;if(typeof n!="string"||!PT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(rz)try{let c=new URL(window.location.href),o=n.startsWith("//")?new URL(c.protocol+n):new URL(n),d=ma(o.pathname,t);o.origin===c.origin&&d!=null?n=d+o.search+o.hash:s=!0}catch{Tr(!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 iz=["POST","PUT","PATCH","DELETE"];new Set(iz);var GT=["GET",...iz];new Set(GT);var xo=j.createContext(null);xo.displayName="DataRouter";var Bd=j.createContext(null);Bd.displayName="DataRouterState";var YT=j.createContext(!1),sz=j.createContext({isTransitioning:!1});sz.displayName="ViewTransition";var JT=j.createContext(new Map);JT.displayName="Fetchers";var KT=j.createContext(null);KT.displayName="Await";var tr=j.createContext(null);tr.displayName="Navigation";var sc=j.createContext(null);sc.displayName="Location";var Er=j.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var Ux=j.createContext(null);Ux.displayName="RouteError";var oz="REACT_ROUTER_ERROR",XT="REDIRECT",QT="ROUTE_ERROR_RESPONSE";function WT(e){if(e.startsWith(`${oz}:${XT}:{`))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 eE(e){if(e.startsWith(`${oz}:${QT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new FT(t.status,t.statusText,t.data)}catch{}}function tE(e,{relative:t}={}){jt(go(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=j.useContext(tr),{hash:s,pathname:c,search:o}=lc(e,{relative:t}),d=c;return n!=="/"&&(d=c==="/"?n:fa([n,c])),a.createHref({pathname:d,search:o,hash:s})}function go(){return j.useContext(sc)!=null}function Ar(){return jt(go(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(sc).location}var lz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cz(e){j.useContext(tr).static||j.useLayoutEffect(e)}function oc(){let{isDataRoute:e}=j.useContext(Er);return e?pE():nE()}function nE(){jt(go(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(xo),{basename:t,navigator:n}=j.useContext(tr),{matches:a}=j.useContext(Er),{pathname:s}=Ar(),c=JSON.stringify(Lx(a)),o=j.useRef(!1);return cz(()=>{o.current=!0}),j.useCallback((h,m={})=>{if(Tr(o.current,lz),!o.current)return;if(typeof h=="number"){n.go(h);return}let x=Px(h,JSON.parse(c),s,m.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:fa([t,x.pathname])),(m.replace?n.replace:n.push)(x,m.state,m)},[t,n,c,s,e])}j.createContext(null);function rE(){let{matches:e}=j.useContext(Er),t=e[e.length-1];return t?t.params:{}}function lc(e,{relative:t}={}){let{matches:n}=j.useContext(Er),{pathname:a}=Ar(),s=JSON.stringify(Lx(n));return j.useMemo(()=>Px(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function aE(e,t){return uz(e,t)}function uz(e,t,n,a,s){jt(go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=j.useContext(tr),{matches:o}=j.useContext(Er),d=o[o.length-1],h=d?d.params:{},m=d?d.pathname:"/",x=d?d.pathnameBase:"/",p=d&&d.route;{let E=p&&p.path||"";fz(m,!p||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let b=Ar(),v;if(t){let E=typeof t=="string"?po(t):t;jt(x==="/"||E.pathname?.startsWith(x),`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 "${x}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=b;let S=v.pathname||"/",z=S;if(x!=="/"){let E=x.replace(/^\//,"").split("/");z="/"+S.replace(/^\//,"").split("/").slice(E.length).join("/")}let A=ez(e,{pathname:z});Tr(p||A!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Tr(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=cE(A&&A.map(E=>Object.assign({},E,{params:Object.assign({},h,E.params),pathname:fa([x,c.encodeLocation?c.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?x:fa([x,c.encodeLocation?c.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,n,a,s);return t&&_?j.createElement(sc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},_):_}function iE(){let e=mE(),t=HT(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},c={padding:"2px 4px",backgroundColor:a},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:c},"ErrorBoundary")," or"," ",j.createElement("code",{style:c},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:s},n):null,o)}var sE=j.createElement(iE,null),dz=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=eE(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Er.Provider,{value:this.props.routeContext},j.createElement(Ux.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(oE,{error:e},t):t}};dz.contextType=YT;var _m=new WeakMap;function oE({children:e,error:t}){let{basename:n}=j.useContext(tr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=WT(t.digest);if(a){let s=_m.get(t);if(s)throw s;let c=az(a.location,n);if(rz&&!_m.get(t))if(c.isExternal||a.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:a.replace}));throw _m.set(t,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function lE({routeContext:e,match:t,children:n}){let a=j.useContext(xo);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Er.Provider,{value:e},n)}function cE(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 c=e,o=n?.errors;if(o!=null){let x=c.findIndex(p=>p.route.id&&o?.[p.route.id]!==void 0);jt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let d=!1,h=-1;if(n)for(let x=0;x<c.length;x++){let p=c[x];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=x),p.route.id){let{loaderData:b,errors:v}=n,S=p.route.loader&&!b.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||S){d=!0,h>=0?c=c.slice(0,h+1):c=[c[0]];break}}}let m=n&&a?(x,p)=>{a(x,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:qT(n.matches),errorInfo:p})}:void 0;return c.reduceRight((x,p,b)=>{let v,S=!1,z=null,A=null;n&&(v=o&&p.route.id?o[p.route.id]:void 0,z=p.route.errorElement||sE,d&&(h<0&&b===0?(fz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,A=null):h===b&&(S=!0,A=p.route.hydrateFallbackElement||null)));let _=t.concat(c.slice(0,b+1)),E=()=>{let N;return v?N=z:S?N=A:p.route.Component?N=j.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=x,j.createElement(lE,{match:p,routeContext:{outlet:x,matches:_,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?j.createElement(dz,{location:n.location,revalidation:n.revalidation,component:z,error:v,children:E(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:m}):E()},null)}function Ix(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uE(e){let t=j.useContext(xo);return jt(t,Ix(e)),t}function dE(e){let t=j.useContext(Bd);return jt(t,Ix(e)),t}function fE(e){let t=j.useContext(Er);return jt(t,Ix(e)),t}function Bx(e){let t=fE(e),n=t.matches[t.matches.length-1];return jt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function hE(){return Bx("useRouteId")}function mE(){let e=j.useContext(Ux),t=dE("useRouteError"),n=Bx("useRouteError");return e!==void 0?e:t.errors?.[n]}function pE(){let{router:e}=uE("useNavigate"),t=Bx("useNavigate"),n=j.useRef(!1);return cz(()=>{n.current=!0}),j.useCallback(async(s,c={})=>{Tr(n.current,lz),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...c}))},[e,t])}var b1={};function fz(e,t,n){!t&&!b1[e]&&(b1[e]=!0,Tr(!1,n))}j.memo(xE);function xE({routes:e,future:t,state:n,onError:a}){return uz(e,void 0,n,a,t)}function hz({to:e,replace:t,state:n,relative:a}){jt(go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=j.useContext(tr);Tr(!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:c}=j.useContext(Er),{pathname:o}=Ar(),d=oc(),h=Px(e,Lx(c),o,a==="path"),m=JSON.stringify(h);return j.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:a})},[d,m,a,t,n]),null}function Zt(e){jt(!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 gE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:c=!1,unstable_useTransitions:o}){jt(!go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=j.useMemo(()=>({basename:d,navigator:s,static:c,unstable_useTransitions:o,future:{}}),[d,s,c,o]);typeof n=="string"&&(n=po(n));let{pathname:m="/",search:x="",hash:p="",state:b=null,key:v="default"}=n,S=j.useMemo(()=>{let z=ma(m,d);return z==null?null:{location:{pathname:z,search:x,hash:p,state:b,key:v},navigationType:a}},[d,m,x,p,b,v,a]);return Tr(S!=null,`<Router basename="${d}"> is not able to match the URL "${m}${x}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:j.createElement(tr.Provider,{value:h},j.createElement(sc.Provider,{children:t,value:S}))}function v1({children:e,location:t}){return aE(Ep(e),t)}function Ep(e,t=[]){let n=[];return j.Children.forEach(e,(a,s)=>{if(!j.isValidElement(a))return;let c=[...t,s];if(a.type===j.Fragment){n.push.apply(n,Ep(a.props.children,c));return}jt(a.type===Zt,`[${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>`),jt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let o={id:a.props.id||c.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&&(o.children=Ep(a.props.children,c)),n.push(o)}),n}var sd="get",od="application/x-www-form-urlencoded";function Vd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function yE(e){return Vd(e)&&e.tagName.toLowerCase()==="button"}function bE(e){return Vd(e)&&e.tagName.toLowerCase()==="form"}function vE(e){return Vd(e)&&e.tagName.toLowerCase()==="input"}function kE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wE(e,t){return e.button===0&&(!t||t==="_self")&&!kE(e)}var Lu=null;function SE(){if(Lu===null)try{new FormData(document.createElement("form"),0),Lu=!1}catch{Lu=!0}return Lu}var zE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Nm(e){return e!=null&&!zE.has(e)?(Tr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${od}"`),null):e}function jE(e,t){let n,a,s,c,o;if(bE(e)){let d=e.getAttribute("action");a=d?ma(d,t):null,n=e.getAttribute("method")||sd,s=Nm(e.getAttribute("enctype"))||od,c=new FormData(e)}else if(yE(e)||vE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?ma(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||sd,s=Nm(e.getAttribute("formenctype"))||Nm(d.getAttribute("enctype"))||od,c=new FormData(d,e),!SE()){let{name:m,type:x,value:p}=e;if(x==="image"){let b=m?`${m}.`:"";c.append(`${b}x`,"0"),c.append(`${b}y`,"0")}else m&&c.append(m,p)}}else{if(Vd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sd,a=null,s=od,o=e}return c&&s==="text/plain"&&(o=c,c=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:c,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _E(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&&ma(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function NE(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 CE(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 TE(e,t,n){let a=await Promise.all(e.map(async s=>{let c=t.routes[s.route.id];if(c){let o=await NE(c,n);return o.links?o.links():[]}return[]}));return ME(a.flat(1).filter(CE).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function k1(e,t,n,a,s,c){let o=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return c==="assets"?t.filter((h,m)=>o(h,m)||d(h,m)):c==="data"?t.filter((h,m)=>{let x=a.routes[h.route.id];if(!x||!x.hasLoader)return!1;if(o(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let p=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 p=="boolean")return p}return!0}):[]}function EE(e,t,{includeHydrateFallback:n}={}){return AE(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let c=[s.module];return s.clientActionModule&&(c=c.concat(s.clientActionModule)),s.clientLoaderModule&&(c=c.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(c=c.concat(s.hydrateFallbackModule)),s.imports&&(c=c.concat(s.imports)),c}).flat(1))}function AE(e){return[...new Set(e)]}function OE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function ME(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let c=JSON.stringify(OE(s));return n.has(c)||(n.add(c),a.push({key:c,link:s})),a},[])}function mz(){let e=j.useContext(xo);return Vx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function DE(){let e=j.useContext(Bd);return Vx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Zx=j.createContext(void 0);Zx.displayName="FrameworkContext";function pz(){let e=j.useContext(Zx);return Vx(e,"You must render this element inside a <HydratedRouter> element"),e}function RE(e,t){let n=j.useContext(Zx),[a,s]=j.useState(!1),[c,o]=j.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:x,onTouchStart:p}=t,b=j.useRef(null);j.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let z=_=>{_.forEach(E=>{o(E.isIntersecting)})},A=new IntersectionObserver(z,{threshold:.5});return b.current&&A.observe(b.current),()=>{A.disconnect()}}},[e]),j.useEffect(()=>{if(a){let z=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(z)}}},[a]);let v=()=>{s(!0)},S=()=>{s(!1),o(!1)};return n?e!=="intent"?[c,b,{}]:[c,b,{onFocus:Sl(d,v),onBlur:Sl(h,S),onMouseEnter:Sl(m,v),onMouseLeave:Sl(x,S),onTouchStart:Sl(p,v)}]:[!1,b,{}]}function Sl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function $E({page:e,...t}){let{router:n}=mz(),a=j.useMemo(()=>ez(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?j.createElement(PE,{page:e,matches:a,...t}):null}function LE(e){let{manifest:t,routeModules:n}=pz(),[a,s]=j.useState([]);return j.useEffect(()=>{let c=!1;return TE(e,t,n).then(o=>{c||s(o)}),()=>{c=!0}},[e,t,n]),a}function PE({page:e,matches:t,...n}){let a=Ar(),{future:s,manifest:c,routeModules:o}=pz(),{basename:d}=mz(),{loaderData:h,matches:m}=DE(),x=j.useMemo(()=>k1(e,t,m,c,a,"data"),[e,t,m,c,a]),p=j.useMemo(()=>k1(e,t,m,c,a,"assets"),[e,t,m,c,a]),b=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let z=new Set,A=!1;if(t.forEach(E=>{let N=c.routes[E.route.id];!N||!N.hasLoader||(!x.some(P=>P.route.id===E.route.id)&&E.route.id in h&&o[E.route.id]?.shouldRevalidate||N.hasClientLoader?A=!0:z.add(E.route.id))}),z.size===0)return[];let _=_E(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return A&&z.size>0&&_.searchParams.set("_routes",t.filter(E=>z.has(E.route.id)).map(E=>E.route.id).join(",")),[_.pathname+_.search]},[d,s.unstable_trailingSlashAwareDataRequests,h,a,c,x,t,e,o]),v=j.useMemo(()=>EE(p,c),[p,c]),S=LE(p);return j.createElement(j.Fragment,null,b.map(z=>j.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...n})),v.map(z=>j.createElement("link",{key:z,rel:"modulepreload",href:z,...n})),S.map(({key:z,link:A})=>j.createElement("link",{key:z,nonce:n.nonce,...A,crossOrigin:A.crossOrigin??n.crossOrigin})))}function UE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var IE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{IE&&(window.__reactRouterVersion="7.13.0")}catch{}function BE({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=j.useRef();s.current==null&&(s.current=kT({window:a,v5Compat:!0}));let c=s.current,[o,d]=j.useState({action:c.action,location:c.location}),h=j.useCallback(m=>{n===!1?d(m):j.startTransition(()=>d(m))},[n]);return j.useLayoutEffect(()=>c.listen(h),[c,h]),j.createElement(gE,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:c,unstable_useTransitions:n})}var xz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wa=j.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:c,replace:o,state:d,target:h,to:m,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},S){let{basename:z,unstable_useTransitions:A}=j.useContext(tr),_=typeof m=="string"&&xz.test(m),E=az(m,z);m=E.to;let N=tE(m,{relative:s}),[P,D,M]=RE(a,v),V=HE(m,{replace:o,state:d,target:h,preventScrollReset:x,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:b,unstable_useTransitions:A});function U(I){t&&t(I),I.defaultPrevented||V(I)}let K=j.createElement("a",{...v,...M,href:E.absoluteURL||N,onClick:E.isExternal||c?t:U,ref:UE(S,D),target:h,"data-discover":!_&&n==="render"?"true":void 0});return P&&!_?j.createElement(j.Fragment,null,K,j.createElement($E,{page:N})):K});Wa.displayName="Link";var VE=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:c,to:o,viewTransition:d,children:h,...m},x){let p=lc(o,{relative:m.relative}),b=Ar(),v=j.useContext(Bd),{navigator:S,basename:z}=j.useContext(tr),A=v!=null&&KE(p)&&d===!0,_=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,E=b.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(E=E.toLowerCase(),N=N?N.toLowerCase():null,_=_.toLowerCase()),N&&z&&(N=ma(N,z)||N);const P=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let D=E===_||!s&&E.startsWith(_)&&E.charAt(P)==="/",M=N!=null&&(N===_||!s&&N.startsWith(_)&&N.charAt(_.length)==="/"),V={isActive:D,isPending:M,isTransitioning:A},U=D?t:void 0,K;typeof a=="function"?K=a(V):K=[a,D?"active":null,M?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let I=typeof c=="function"?c(V):c;return j.createElement(Wa,{...m,"aria-current":U,className:K,ref:x,style:I,to:o,viewTransition:d},typeof h=="function"?h(V):h)});VE.displayName="NavLink";var ZE=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:c,method:o=sd,action:d,onSubmit:h,relative:m,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},S)=>{let{unstable_useTransitions:z}=j.useContext(tr),A=YE(),_=JE(d,{relative:m}),E=o.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&xz.test(d),P=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let M=D.nativeEvent.submitter,V=M?.getAttribute("formmethod")||o,U=()=>A(M||D.currentTarget,{fetcherKey:t,method:V,navigate:n,replace:s,state:c,relative:m,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b});z&&n!==!1?j.startTransition(()=>U()):U()};return j.createElement("form",{ref:S,method:E,action:_,onSubmit:a?h:P,...v,"data-discover":!N&&e==="render"?"true":void 0})});ZE.displayName="Form";function FE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gz(e){let t=j.useContext(xo);return jt(t,FE(e)),t}function HE(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:c,viewTransition:o,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let m=oc(),x=Ar(),p=lc(e,{relative:c});return j.useCallback(b=>{if(wE(b,t)){b.preventDefault();let v=n!==void 0?n:Hl(x)===Hl(p),S=()=>m(e,{replace:v,state:a,preventScrollReset:s,relative:c,viewTransition:o,unstable_defaultShouldRevalidate:d});h?j.startTransition(()=>S()):S()}},[x,m,p,n,a,t,e,s,c,o,d,h])}var qE=0,GE=()=>`__${String(++qE)}__`;function YE(){let{router:e}=gz("useSubmit"),{basename:t}=j.useContext(tr),n=hE(),a=e.fetch,s=e.navigate;return j.useCallback(async(c,o={})=>{let{action:d,method:h,encType:m,formData:x,body:p}=jE(c,t);if(o.navigate===!1){let b=o.fetcherKey||GE();await a(b,n,o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:x,body:p,formMethod:o.method||h,formEncType:o.encType||m,flushSync:o.flushSync})}else await s(o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:x,body:p,formMethod:o.method||h,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[a,s,t,n])}function JE(e,{relative:t}={}){let{basename:n}=j.useContext(tr),a=j.useContext(Er);jt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),c={...lc(e||".",{relative:t})},o=Ar();if(e==null){c.search=o.search;let d=new URLSearchParams(c.search),h=d.getAll("index");if(h.some(x=>x==="")){d.delete("index"),h.filter(p=>p).forEach(p=>d.append("index",p));let x=d.toString();c.search=x?`?${x}`:""}}return(!e||e===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(c.pathname=c.pathname==="/"?n:fa([n,c.pathname])),Hl(c)}function KE(e,{relative:t}={}){let n=j.useContext(sz);jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=gz("useViewTransitionState"),s=lc(e,{relative:t});if(!n.isTransitioning)return!1;let c=ma(n.currentLocation.pathname,a)||n.currentLocation.pathname,o=ma(n.nextLocation.pathname,a)||n.nextLocation.pathname;return yd(s.pathname,o)!=null||yd(s.pathname,c)!=null}const yz=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const XE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const QE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const w1=e=>{const t=QE(e);return t.charAt(0).toUpperCase()+t.slice(1)};var WE={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 eA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const tA=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:c,iconNode:o,...d},h)=>j.createElement("svg",{ref:h,...WE,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:yz("lucide",s),...!c&&!eA(d)&&{"aria-hidden":"true"},...d},[...o.map(([m,x])=>j.createElement(m,x)),...Array.isArray(c)?c:[c]]));const he=(e,t)=>{const n=j.forwardRef(({className:a,...s},c)=>j.createElement(tA,{ref:c,iconNode:t,className:yz(`lucide-${XE(w1(e))}`,`lucide-${e}`,a),...s}));return n.displayName=w1(e),n};const nA=[["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"}]],Pi=he("activity",nA);const rA=[["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"}]],aA=he("archive",rA);const iA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],bz=he("arrow-left",iA);const sA=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],oA=he("ban",sA);const lA=[["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"}]],ql=he("bell",lA);const cA=[["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"}]],ld=he("bot",cA);const uA=[["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"}]],dA=he("box",uA);const fA=[["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"}]],hA=he("brain",fA);const mA=[["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"}]],vz=he("calendar",mA);const pA=[["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"}]],Ap=he("chart-column",pA);const xA=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],gA=he("chart-no-axes-column",xA);const yA=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],bA=he("check-check",yA);const vA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Op=he("check",vA);const kA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],yo=he("chevron-down",kA);const wA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],SA=he("chevron-left",wA);const zA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zd=he("chevron-right",zA);const jA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kz=he("chevron-up",jA);const _A=[["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"}]],Gi=he("circle-alert",_A);const NA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],bo=he("circle-check-big",NA);const CA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Fx=he("circle-check",CA);const TA=[["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"}]],ei=he("circle-x",TA);const EA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],er=he("clock",EA);const AA=[["path",{d:"M13 16a3 3 0 0 1 0 6H7a5 5 0 1 1 4.9-6z",key:"ie2ih4"}],["path",{d:"M18.376 14.512a6 6 0 0 0 3.461-4.127c.148-.625-.659-.97-1.248-.714a4 4 0 0 1-5.259-5.26c.255-.589-.09-1.395-.716-1.248a6 6 0 0 0-4.594 5.36",key:"zwnc1e"}]],OA=he("cloud-moon",AA);const MA=[["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"}]],DA=he("copy",MA);const RA=[["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"}]],wz=he("cpu",RA);const $A=[["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"}]],Qs=he("database",$A);const LA=[["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"}]],io=he("dollar-sign",LA);const PA=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],UA=he("download",PA);const IA=[["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"}]],cc=he("eye",IA);const BA=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],VA=he("file-braces",BA);const ZA=[["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"}]],Mp=he("file-text",ZA);const FA=[["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"}]],HA=he("folder-open",FA);const qA=[["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"}]],GA=he("funnel",qA);const YA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Sz=he("globe",YA);const JA=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],KA=he("hard-drive",JA);const XA=[["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"}]],QA=he("hash",XA);const WA=[["path",{d:"M14 18a2 2 0 0 0-4 0",key:"1v8fkw"}],["path",{d:"m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11",key:"1fkr7p"}],["path",{d:"M2 11h20",key:"3eubbj"}],["circle",{cx:"17",cy:"18",r:"3",key:"82mm0e"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],so=he("hat-glasses",WA);const e5=[["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"}]],t5=he("history",e5);const n5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],r5=he("info",n5);const a5=[["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"}]],Dp=he("layout-dashboard",a5);const i5=[["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"}]],Gl=he("list-checks",i5);const s5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uc=he("loader-circle",s5);const o5=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],l5=he("lock",o5);const c5=[["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"}]],S1=he("log-out",c5);const u5=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],zz=he("menu",u5);const d5=[["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"}]],z1=he("message-square-plus",d5);const f5=[["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"}]],Rp=he("message-square",f5);const h5=[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["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"}]],m5=he("moon-star",h5);const p5=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],x5=he("monitor",p5);const g5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],y5=he("panel-left-close",g5);const b5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],v5=he("panel-left",b5);const k5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],w5=he("panel-right",k5);const S5=[["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"}]],z5=he("pause",S5);const j5=[["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"}]],_5=he("pen",j5);const N5=[["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"}]],dc=he("pencil",N5);const C5=[["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"}]],jz=he("play",C5);const T5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oo=he("plus",T5);const E5=[["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"}]],bd=he("puzzle",E5);const A5=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],_z=he("radio",A5);const O5=[["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"}]],Ka=he("refresh-cw",O5);const M5=[["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"}]],j1=he("rotate-ccw",M5);const D5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],R5=he("search",D5);const $5=[["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"}]],L5=he("send",$5);const P5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],U5=he("server",P5);const I5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],_1=he("settings-2",I5);const B5=[["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"}]],$p=he("settings",B5);const V5=[["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"}]],Lp=he("shield-check",V5);const Z5=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],F5=he("shield-off",Z5);const H5=[["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"}]],q5=he("sun",H5);const G5=[["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"}]],Hx=he("tag",G5);const Y5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ll=he("terminal",Y5);const J5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],qx=he("toggle-left",J5);const K5=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Gx=he("toggle-right",K5);const X5=[["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"}]],pa=he("trash-2",X5);const Q5=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],W5=he("trending-up",Q5);const e3=[["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"}]],Pu=he("upload",e3);const t3=[["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"}]],Yx=he("user",t3);const n3=[["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"}]],Zi=he("wand-sparkles",n3);const r3=[["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"}]],Pp=he("webhook",r3);const a3=[["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"}]],Nz=he("wifi-off",a3);const i3=[["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"}]],cd=he("wifi",i3);const s3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],fc=he("wrench",s3);const o3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yi=he("x",o3);const l3=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Cz=he("zap",l3);var Cm={exports:{}},Tm={};var N1;function c3(){if(N1)return Tm;N1=1;var e=Id();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,c=e.useLayoutEffect,o=e.useDebugValue;function d(p,b){var v=b(),S=a({inst:{value:v,getSnapshot:b}}),z=S[0].inst,A=S[1];return c(function(){z.value=v,z.getSnapshot=b,h(z)&&A({inst:z})},[p,v,b]),s(function(){return h(z)&&A({inst:z}),p(function(){h(z)&&A({inst:z})})},[p]),o(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!n(p,v)}catch{return!0}}function m(p,b){return b()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Tm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,Tm}var C1;function u3(){return C1||(C1=1,Cm.exports=c3()),Cm.exports}var T1=u3();const Tz=0,Ez=1,Az=2,E1=3;var A1=Object.prototype.hasOwnProperty;function Up(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--&&Up(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(A1.call(e,n)&&++a&&!A1.call(t,n)||!(n in t)||!Up(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const ua=new WeakMap,da=()=>{},xn=da(),Ip=Object,Qe=e=>e===xn,Lr=e=>typeof e=="function",ti=(e,t)=>({...e,...t}),Oz=e=>Lr(e.then),Em={},Uu={},Jx="undefined",hc=typeof window!=Jx,Bp=typeof document!=Jx,d3=hc&&"Deno"in window,f3=()=>hc&&typeof window.requestAnimationFrame!=Jx,Mz=(e,t)=>{const n=ua.get(e);return[()=>!Qe(t)&&e.get(t)||Em,a=>{if(!Qe(t)){const s=e.get(t);t in Uu||(Uu[t]=s),n[5](t,ti(s,a),s||Em)}},n[6],()=>!Qe(t)&&t in Uu?Uu[t]:!Qe(t)&&e.get(t)||Em]};let Vp=!0;const h3=()=>Vp,[Zp,Fp]=hc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[da,da],m3=()=>{const e=Bp&&document.visibilityState;return Qe(e)||e!=="hidden"},p3=e=>(Bp&&document.addEventListener("visibilitychange",e),Zp("focus",e),()=>{Bp&&document.removeEventListener("visibilitychange",e),Fp("focus",e)}),x3=e=>{const t=()=>{Vp=!0,e()},n=()=>{Vp=!1};return Zp("online",t),Zp("offline",n),()=>{Fp("online",t),Fp("offline",n)}},g3={isOnline:h3,isVisible:m3},y3={initFocus:p3,initReconnect:x3},O1=!$x.useId,Ws=!hc||d3,b3=e=>f3()?window.requestAnimationFrame(e):setTimeout(e,1),Am=Ws?j.useEffect:j.useLayoutEffect,Om=typeof navigator<"u"&&navigator.connection,M1=!Ws&&Om&&(["slow-2g","2g"].includes(Om.effectiveType)||Om.saveData),Iu=new WeakMap,v3=e=>Ip.prototype.toString.call(e),Mm=(e,t)=>e===`[object ${t}]`;let k3=0;const Hp=e=>{const t=typeof e,n=v3(e),a=Mm(n,"Date"),s=Mm(n,"RegExp"),c=Mm(n,"Object");let o,d;if(Ip(e)===e&&!a&&!s){if(o=Iu.get(e),o)return o;if(o=++k3+"~",Iu.set(e,o),Array.isArray(e)){for(o="@",d=0;d<e.length;d++)o+=Hp(e[d])+",";Iu.set(e,o)}if(c){o="#";const h=Ip.keys(e).sort();for(;!Qe(d=h.pop());)Qe(e[d])||(o+=d+":"+Hp(e[d])+",");Iu.set(e,o)}}else o=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Kx=e=>{if(Lr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Hp(e):"",[e,t]};let w3=0;const qp=()=>++w3;async function Dz(...e){const[t,n,a,s]=e,c=ti({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=c.populateCache;const d=c.rollbackOnError;let h=c.optimisticData;const m=b=>typeof d=="function"?d(b):d!==!1,x=c.throwOnError;if(Lr(n)){const b=n,v=[],S=t.keys();for(const z of S)!/^\$(inf|sub)\$/.test(z)&&b(t.get(z)._k)&&v.push(z);return Promise.all(v.map(p))}return p(n);async function p(b){const[v]=Kx(b);if(!v)return;const[S,z]=Mz(t,v),[A,_,E,N]=ua.get(t),P=()=>{const oe=A[v];return(Lr(c.revalidate)?c.revalidate(S().data,b):c.revalidate!==!1)&&(delete E[v],delete N[v],oe&&oe[0])?oe[0](Az).then(()=>S().data):S().data};if(e.length<3)return P();let D=a,M,V=!1;const U=qp();_[v]=[U,0];const K=!Qe(h),I=S(),te=I.data,le=I._c,ne=Qe(le)?te:le;if(K&&(h=Lr(h)?h(ne,te):h,z({data:h,_c:ne})),Lr(D))try{D=D(ne)}catch(oe){M=oe,V=!0}if(D&&Oz(D))if(D=await D.catch(oe=>{M=oe,V=!0}),U!==_[v][0]){if(V)throw M;return D}else V&&K&&m(M)&&(o=!0,z({data:ne,_c:xn}));if(o&&!V)if(Lr(o)){const oe=o(D,ne);z({data:oe,error:xn,_c:xn})}else z({data:D,error:xn,_c:xn});if(_[v][1]=qp(),Promise.resolve(P()).then(()=>{z({_c:xn})}),V){if(x)throw M;return}return D}}const D1=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},S3=(e,t)=>{if(!ua.has(e)){const n=ti(y3,t),a=Object.create(null),s=Dz.bind(xn,e);let c=da;const o=Object.create(null),d=(x,p)=>{const b=o[x]||[];return o[x]=b,b.push(p),()=>b.splice(b.indexOf(p),1)},h=(x,p,b)=>{e.set(x,p);const v=o[x];if(v)for(const S of v)S(p,b)},m=()=>{if(!ua.has(e)&&(ua.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,d]),!Ws)){const x=n.initFocus(setTimeout.bind(xn,D1.bind(xn,a,Tz))),p=n.initReconnect(setTimeout.bind(xn,D1.bind(xn,a,Ez)));c=()=>{x&&x(),p&&p(),ua.delete(e)}}};return m(),[e,s,m,c]}return[e,ua.get(e)[4]]},z3=(e,t,n,a,s)=>{const c=n.errorRetryCount,o=s.retryCount,d=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Qe(c)&&o>c||setTimeout(a,d,s)},j3=Up,[Rz,Bn]=S3(new Map),_3=ti({onLoadingSlow:da,onSuccess:da,onError:da,onErrorRetry:z3,onDiscarded:da,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:M1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:M1?5e3:3e3,compare:j3,isPaused:()=>!1,cache:Rz,mutate:Bn,fallback:{}},g3),N3=(e,t)=>{const n=ti(e,t);if(t){const{use:a,fallback:s}=e,{use:c,fallback:o}=t;a&&c&&(n.use=a.concat(c)),s&&o&&(n.fallback=ti(s,o))}return n},C3=j.createContext({}),T3="$inf$",$z=hc&&window.__SWR_DEVTOOLS_USE__,E3=$z?window.__SWR_DEVTOOLS_USE__:[],A3=()=>{$z&&(window.__SWR_DEVTOOLS_REACT__=$x)},O3=e=>Lr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],M3=()=>{const e=j.useContext(C3);return j.useMemo(()=>ti(_3,e),[e])},D3=e=>(t,n,a)=>e(t,n&&((...c)=>{const[o]=Kx(t),[,,,d]=ua.get(Rz);if(o.startsWith(T3))return n(...c);const h=d[o];return Qe(h)?n(...c):(delete d[o],h)}),a),R3=E3.concat(D3),$3=e=>function(...n){const a=M3(),[s,c,o]=O3(n),d=N3(a,o);let h=e;const{use:m}=d,x=(m||[]).concat(R3);for(let p=x.length;p--;)h=x[p](h);return h(s,c||d.fetcher||null,d)},L3=(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())}};A3();const Dm=$x.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}}),Rm={dedupe:!0},R1=Promise.resolve(xn),P3=(e,t,n)=>{const{cache:a,compare:s,suspense:c,fallbackData:o,revalidateOnMount:d,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:x,refreshWhenOffline:p,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[S,z,A,_]=ua.get(a),[E,N]=Kx(e),P=j.useRef(!1),D=j.useRef(!1),M=j.useRef(E),V=j.useRef(t),U=j.useRef(n),K=()=>U.current,I=()=>K().isVisible()&&K().isOnline(),[te,le,ne,oe]=Mz(a,E),se=j.useRef({}).current,Z=Qe(o)?Qe(n.fallback)?xn:n.fallback[E]:o,B=(Ze,rt)=>{for(const ft in se){const lt=ft;if(lt==="data"){if(!s(Ze[lt],rt[lt])&&(!Qe(Ze[lt])||!s(pe,rt[lt])))return!1}else if(rt[lt]!==Ze[lt])return!1}return!0},Y=j.useMemo(()=>{const Ze=!E||!t?!1:Qe(d)?K().isPaused()||c?!1:h!==!1:d,rt=Kt=>{const bt=ti(Kt);return delete bt._k,Ze?{isValidating:!0,isLoading:!0,...bt}:bt},ft=te(),lt=oe(),rn=rt(ft),nr=ft===lt?rn:rt(lt);let $t=rn;return[()=>{const Kt=rt(te());return B(Kt,$t)?($t.data=Kt.data,$t.isLoading=Kt.isLoading,$t.isValidating=Kt.isValidating,$t.error=Kt.error,$t):($t=Kt,Kt)},()=>nr]},[a,E]),ue=T1.useSyncExternalStore(j.useCallback(Ze=>ne(E,(rt,ft)=>{B(ft,rt)||Ze()}),[a,E]),Y[0],Y[1]),O=!P.current,C=S[E]&&S[E].length>0,H=ue.data,w=Qe(H)?Z&&Oz(Z)?Dm(Z):Z:H,X=ue.error,me=j.useRef(w),pe=b?Qe(H)?Qe(me.current)?w:me.current:H:w,ge=E&&Qe(w),Pe=!Ws&&T1.useSyncExternalStore(()=>da,()=>!1,()=>!0);v&&Pe&&!c&&ge&&console.warn(`Missing pre-initiated data for serialized key "${E}" 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 Ee=C&&!Qe(X)?!1:O&&!Qe(d)?d:K().isPaused()?!1:c?Qe(w)?!1:h:Qe(w)||h,yt=!!(E&&t&&O&&Ee),$=Qe(ue.isValidating)?yt:ue.isValidating,Oe=Qe(ue.isLoading)?yt:ue.isLoading,Ue=j.useCallback(async Ze=>{const rt=V.current;if(!E||!rt||D.current||K().isPaused())return!1;let ft,lt,rn=!0;const nr=Ze||{},$t=!A[E]||!nr.dedupe,Kt=()=>O1?!D.current&&E===M.current&&P.current:E===M.current,bt={isValidating:!1,isLoading:!1},Qi=()=>{le(bt)},ee=()=>{const we=A[E];we&&we[1]===lt&&delete A[E]},fe={isValidating:!0};Qe(te().data)&&(fe.isLoading=!0);try{if($t&&(le(fe),n.loadingTimeout&&Qe(te().data)&&setTimeout(()=>{rn&&Kt()&&K().onLoadingSlow(E,n)},n.loadingTimeout),A[E]=[rt(N),qp()]),[ft,lt]=A[E],ft=await ft,$t&&setTimeout(ee,n.dedupingInterval),!A[E]||A[E][1]!==lt)return $t&&Kt()&&K().onDiscarded(E),!1;bt.error=xn;const we=z[E];if(!Qe(we)&&(lt<=we[0]||lt<=we[1]||we[1]===0))return Qi(),$t&&Kt()&&K().onDiscarded(E),!1;const Ce=te().data;bt.data=s(Ce,ft)?Ce:ft,$t&&Kt()&&K().onSuccess(ft,E,n)}catch(we){ee();const Ce=K(),{shouldRetryOnError:Ke}=Ce;Ce.isPaused()||(bt.error=we,$t&&Kt()&&(Ce.onError(we,E,Ce),(Ke===!0||Lr(Ke)&&Ke(we))&&(!K().revalidateOnFocus||!K().revalidateOnReconnect||I())&&Ce.onErrorRetry(we,E,Ce,kn=>{const Fn=S[E];Fn&&Fn[0]&&Fn[0](E1,kn)},{retryCount:(nr.retryCount||0)+1,dedupe:!0})))}return rn=!1,Qi(),!0},[E,a]),Je=j.useCallback((...Ze)=>Dz(a,M.current,...Ze),[]);if(Am(()=>{V.current=t,U.current=n,Qe(H)||(me.current=H)}),Am(()=>{if(!E)return;const Ze=Ue.bind(xn,Rm);let rt=0;K().revalidateOnFocus&&(rt=Date.now()+K().focusThrottleInterval);const lt=L3(E,S,(rn,nr={})=>{if(rn==Tz){const $t=Date.now();K().revalidateOnFocus&&$t>rt&&I()&&(rt=$t+K().focusThrottleInterval,Ze())}else if(rn==Ez)K().revalidateOnReconnect&&I()&&Ze();else{if(rn==Az)return Ue();if(rn==E1)return Ue(nr)}});return D.current=!1,M.current=E,P.current=!0,le({_k:N}),Ee&&(A[E]||(Qe(w)||Ws?Ze():b3(Ze))),()=>{D.current=!0,lt()}},[E]),Am(()=>{let Ze;function rt(){const lt=Lr(m)?m(te().data):m;lt&&Ze!==-1&&(Ze=setTimeout(ft,lt))}function ft(){!te().error&&(x||K().isVisible())&&(p||K().isOnline())?Ue(Rm).then(rt):rt()}return rt(),()=>{Ze&&(clearTimeout(Ze),Ze=-1)}},[m,x,p,E]),j.useDebugValue(pe),c){if(!O1&&Ws&&ge)throw new Error("Fallback data is required when using Suspense in SSR.");ge&&(V.current=t,U.current=n,D.current=!1);const Ze=_[E],rt=!Qe(Ze)&&ge?Je(Ze):R1;if(Dm(rt),!Qe(X)&&ge)throw X;const ft=ge?Ue(Rm):R1;!Qe(pe)&&ge&&(ft.status="fulfilled",ft.value=!0),Dm(ft)}return{mutate:Je,get data(){return se.data=!0,pe},get error(){return se.error=!0,X},get isValidating(){return se.isValidating=!0,$},get isLoading(){return se.isLoading=!0,Oe}}},We=$3(P3),U3="x-architect-pass",Ls="/api";class Xa{static instance;constructor(){}static getInstance(){return Xa.instance||(Xa.instance=new Xa),Xa.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[U3]=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(`${Ls}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${Ls}${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(`${Ls}${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(`${Ls}${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(`${Ls}${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 c=await fetch(`${Ls}${t}`,{method:"POST",headers:this.getHeaders(),body:s});return this.handleResponse(c)}}const xe=Xa.getInstance(),Yl="/api",Xx=e=>{const t=e.startsWith(Yl)?e.substring(Yl.length):e;return xe.get(t)};function Lz(){return We(`${Yl}/status`,Xx,{refreshInterval:5e3})}function I3(){return We(`${Yl}/logs`,Xx)}function B3(e){return We(e?`${Yl}/logs/${e}?limit=1000`:null,Xx,{refreshInterval:2e3})}function Pz(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 V3(){const{data:e}=Lz();return u.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:[u.jsxs("div",{className:"flex gap-4",children:[u.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),u.jsxs("span",{children:["PID: ",e?.pid||"-"]}),u.jsxs("span",{children:["UPTIME: ",e?Pz(e.uptimeSeconds):"-"]})]}),u.jsxs("div",{className:"flex gap-4 opacity-70",children:[u.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),u.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const Qx=j.createContext({});function Wx(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const Uz=typeof window<"u",Iz=Uz?j.useLayoutEffect:j.useEffect,Fd=j.createContext(null);function eg(e,t){e.indexOf(t)===-1&&e.push(t)}function tg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ur=(e,t,n)=>n>t?t:n<e?e:n;let ng=()=>{};const xa={},Bz=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Vz(e){return typeof e=="object"&&e!==null}const Zz=e=>/^0[^.\s]+$/u.test(e);function rg(e){let t;return()=>(t===void 0&&(t=e()),t)}const yr=e=>e,Z3=(e,t)=>n=>t(e(n)),mc=(...e)=>e.reduce(Z3),Jl=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class ag{constructor(){this.subscriptions=[]}add(t){return eg(this.subscriptions,t),()=>tg(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 c=0;c<s;c++){const o=this.subscriptions[c];o&&o(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ha=e=>e*1e3,gr=e=>e/1e3;function Fz(e,t){return t?e*(1e3/t):0}const Hz=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,F3=1e-7,H3=12;function q3(e,t,n,a,s){let c,o,d=0;do o=t+(n-t)/2,c=Hz(o,a,s)-e,c>0?n=o:t=o;while(Math.abs(c)>F3&&++d<H3);return o}function pc(e,t,n,a){if(e===t&&n===a)return yr;const s=c=>q3(c,0,1,e,n);return c=>c===0||c===1?c:Hz(s(c),t,a)}const qz=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Gz=e=>t=>1-e(1-t),Yz=pc(.33,1.53,.69,.99),ig=Gz(Yz),Jz=qz(ig),Kz=e=>(e*=2)<1?.5*ig(e):.5*(2-Math.pow(2,-10*(e-1))),sg=e=>1-Math.sin(Math.acos(e)),Xz=Gz(sg),Qz=qz(sg),G3=pc(.42,0,1,1),Y3=pc(0,0,.58,1),Wz=pc(.42,0,.58,1),J3=e=>Array.isArray(e)&&typeof e[0]!="number",ej=e=>Array.isArray(e)&&typeof e[0]=="number",K3={linear:yr,easeIn:G3,easeInOut:Wz,easeOut:Y3,circIn:sg,circInOut:Qz,circOut:Xz,backIn:ig,backInOut:Jz,backOut:Yz,anticipate:Kz},X3=e=>typeof e=="string",$1=e=>{if(ej(e)){ng(e.length===4);const[t,n,a,s]=e;return pc(t,n,a,s)}else if(X3(e))return K3[e];return e},Bu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Q3(e,t){let n=new Set,a=new Set,s=!1,c=!1;const o=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(x){o.has(x)&&(m.schedule(x),e()),x(d)}const m={schedule:(x,p=!1,b=!1)=>{const S=b&&s?n:a;return p&&o.add(x),S.has(x)||S.add(x),x},cancel:x=>{a.delete(x),o.delete(x)},process:x=>{if(d=x,s){c=!0;return}s=!0,[n,a]=[a,n],n.forEach(h),n.clear(),s=!1,c&&(c=!1,m.process(x))}};return m}const W3=40;function tj(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},c=()=>n=!0,o=Bu.reduce((N,P)=>(N[P]=Q3(c),N),{}),{setup:d,read:h,resolveKeyframes:m,preUpdate:x,update:p,preRender:b,render:v,postRender:S}=o,z=()=>{const N=xa.useManualTiming?s.timestamp:performance.now();n=!1,xa.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(N-s.timestamp,W3),1)),s.timestamp=N,s.isProcessing=!0,d.process(s),h.process(s),m.process(s),x.process(s),p.process(s),b.process(s),v.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(z))},A=()=>{n=!0,a=!0,s.isProcessing||e(z)};return{schedule:Bu.reduce((N,P)=>{const D=o[P];return N[P]=(M,V=!1,U=!1)=>(n||A(),D.schedule(M,V,U)),N},{}),cancel:N=>{for(let P=0;P<Bu.length;P++)o[Bu[P]].cancel(N)},state:s,steps:o}}const{schedule:wt,cancel:ni,state:fn,steps:$m}=tj(typeof requestAnimationFrame<"u"?requestAnimationFrame:yr,!0);let ud;function eO(){ud=void 0}const Cn={now:()=>(ud===void 0&&Cn.set(fn.isProcessing||xa.useManualTiming?fn.timestamp:performance.now()),ud),set:e=>{ud=e,queueMicrotask(eO)}},nj=e=>t=>typeof t=="string"&&t.startsWith(e),rj=nj("--"),tO=nj("var(--"),og=e=>tO(e)?nO.test(e.split("/*")[0].trim()):!1,nO=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function L1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const vo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Kl={...vo,transform:e=>Ur(0,1,e)},Vu={...vo,default:1},Pl=e=>Math.round(e*1e5)/1e5,lg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rO(e){return e==null}const aO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,cg=(e,t)=>n=>!!(typeof n=="string"&&aO.test(n)&&n.startsWith(e)||t&&!rO(n)&&Object.prototype.hasOwnProperty.call(n,t)),aj=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,c,o,d]=a.match(lg);return{[e]:parseFloat(s),[t]:parseFloat(c),[n]:parseFloat(o),alpha:d!==void 0?parseFloat(d):1}},iO=e=>Ur(0,255,e),Lm={...vo,transform:e=>Math.round(iO(e))},Ui={test:cg("rgb","red"),parse:aj("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Lm.transform(e)+", "+Lm.transform(t)+", "+Lm.transform(n)+", "+Pl(Kl.transform(a))+")"};function sO(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 Gp={test:cg("#"),parse:sO,transform:Ui.transform},xc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ga=xc("deg"),Pr=xc("%"),ke=xc("px"),oO=xc("vh"),lO=xc("vw"),P1={...Pr,parse:e=>Pr.parse(e)/100,transform:e=>Pr.transform(e*100)},Hs={test:cg("hsl","hue"),parse:aj("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Pr.transform(Pl(t))+", "+Pr.transform(Pl(n))+", "+Pl(Kl.transform(a))+")"},qt={test:e=>Ui.test(e)||Gp.test(e)||Hs.test(e),parse:e=>Ui.test(e)?Ui.parse(e):Hs.test(e)?Hs.parse(e):Gp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ui.transform(e):Hs.transform(e),getAnimatableNone:e=>{const t=qt.parse(e);return t.alpha=0,qt.transform(t)}},cO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uO(e){return isNaN(e)&&typeof e=="string"&&(e.match(lg)?.length||0)+(e.match(cO)?.length||0)>0}const ij="number",sj="color",dO="var",fO="var(",U1="${}",hO=/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 Xl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let c=0;const d=t.replace(hO,h=>(qt.test(h)?(a.color.push(c),s.push(sj),n.push(qt.parse(h))):h.startsWith(fO)?(a.var.push(c),s.push(dO),n.push(h)):(a.number.push(c),s.push(ij),n.push(parseFloat(h))),++c,U1)).split(U1);return{values:n,split:d,indexes:a,types:s}}function oj(e){return Xl(e).values}function lj(e){const{split:t,types:n}=Xl(e),a=t.length;return s=>{let c="";for(let o=0;o<a;o++)if(c+=t[o],s[o]!==void 0){const d=n[o];d===ij?c+=Pl(s[o]):d===sj?c+=qt.transform(s[o]):c+=s[o]}return c}}const mO=e=>typeof e=="number"?0:qt.test(e)?qt.getAnimatableNone(e):e;function pO(e){const t=oj(e);return lj(e)(t.map(mO))}const ri={test:uO,parse:oj,createTransformer:lj,getAnimatableNone:pO};function Pm(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 xO({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,c=0,o=0;if(!t)s=c=o=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;s=Pm(h,d,e+1/3),c=Pm(h,d,e),o=Pm(h,d,e-1/3)}return{red:Math.round(s*255),green:Math.round(c*255),blue:Math.round(o*255),alpha:a}}function vd(e,t){return n=>n>0?t:e}const Ct=(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)},gO=[Gp,Ui,Hs],yO=e=>gO.find(t=>t.test(e));function I1(e){const t=yO(e);if(!t)return!1;let n=t.parse(e);return t===Hs&&(n=xO(n)),n}const B1=(e,t)=>{const n=I1(e),a=I1(t);if(!n||!a)return vd(e,t);const s={...n};return c=>(s.red=Um(n.red,a.red,c),s.green=Um(n.green,a.green,c),s.blue=Um(n.blue,a.blue,c),s.alpha=Ct(n.alpha,a.alpha,c),Ui.transform(s))},Yp=new Set(["none","hidden"]);function bO(e,t){return Yp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function vO(e,t){return n=>Ct(e,t,n)}function ug(e){return typeof e=="number"?vO:typeof e=="string"?og(e)?vd:qt.test(e)?B1:SO:Array.isArray(e)?cj:typeof e=="object"?qt.test(e)?B1:kO:vd}function cj(e,t){const n=[...e],a=n.length,s=e.map((c,o)=>ug(c)(c,t[o]));return c=>{for(let o=0;o<a;o++)n[o]=s[o](c);return n}}function kO(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=ug(e[s])(e[s],t[s]));return s=>{for(const c in a)n[c]=a[c](s);return n}}function wO(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const c=t.types[s],o=e.indexes[c][a[c]],d=e.values[o]??0;n[s]=d,a[c]++}return n}const SO=(e,t)=>{const n=ri.createTransformer(t),a=Xl(e),s=Xl(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?Yp.has(e)&&!s.values.length||Yp.has(t)&&!a.values.length?bO(e,t):mc(cj(wO(a,s),s.values),n):vd(e,t)};function uj(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ct(e,t,n):ug(e)(e,t)}const zO=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>wt.update(t,n),stop:()=>ni(t),now:()=>fn.isProcessing?fn.timestamp:Cn.now()}},dj=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let c=0;c<s;c++)a+=Math.round(e(c/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},kd=2e4;function dg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<kd;)t+=n,a=e.next(t);return t>=kd?1/0:t}function jO(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(dg(a),kd);return{type:"keyframes",ease:c=>a.next(s*c).value/t,duration:gr(s)}}const _O=5;function fj(e,t,n){const a=Math.max(t-_O,0);return Fz(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},Im=.001;function NO({duration:e=Rt.duration,bounce:t=Rt.bounce,velocity:n=Rt.velocity,mass:a=Rt.mass}){let s,c,o=1-t;o=Ur(Rt.minDamping,Rt.maxDamping,o),e=Ur(Rt.minDuration,Rt.maxDuration,gr(e)),o<1?(s=m=>{const x=m*o,p=x*e,b=x-n,v=Jp(m,o),S=Math.exp(-p);return Im-b/v*S},c=m=>{const p=m*o*e,b=p*n+n,v=Math.pow(o,2)*Math.pow(m,2)*e,S=Math.exp(-p),z=Jp(Math.pow(m,2),o);return(-s(m)+Im>0?-1:1)*((b-v)*S)/z}):(s=m=>{const x=Math.exp(-m*e),p=(m-n)*e+1;return-Im+x*p},c=m=>{const x=Math.exp(-m*e),p=(n-m)*(e*e);return x*p});const d=5/e,h=TO(s,c,d);if(e=ha(e),isNaN(h))return{stiffness:Rt.stiffness,damping:Rt.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:o*2*Math.sqrt(a*m),duration:e}}}const CO=12;function TO(e,t,n){let a=n;for(let s=1;s<CO;s++)a=a-e(a)/t(a);return a}function Jp(e,t){return e*Math.sqrt(1-t*t)}const EO=["duration","bounce"],AO=["stiffness","damping","mass"];function V1(e,t){return t.some(n=>e[n]!==void 0)}function OO(e){let t={velocity:Rt.velocity,stiffness:Rt.stiffness,damping:Rt.damping,mass:Rt.mass,isResolvedFromDuration:!1,...e};if(!V1(e,AO)&&V1(e,EO))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,c=2*Ur(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Rt.mass,stiffness:s,damping:c}}else{const n=NO(e);t={...t,...n,mass:Rt.mass},t.isResolvedFromDuration=!0}return t}function wd(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 c=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],d={done:!1,value:c},{stiffness:h,damping:m,mass:x,duration:p,velocity:b,isResolvedFromDuration:v}=OO({...n,velocity:-gr(n.velocity||0)}),S=b||0,z=m/(2*Math.sqrt(h*x)),A=o-c,_=gr(Math.sqrt(h/x)),E=Math.abs(A)<5;a||(a=E?Rt.restSpeed.granular:Rt.restSpeed.default),s||(s=E?Rt.restDelta.granular:Rt.restDelta.default);let N;if(z<1){const D=Jp(_,z);N=M=>{const V=Math.exp(-z*_*M);return o-V*((S+z*_*A)/D*Math.sin(D*M)+A*Math.cos(D*M))}}else if(z===1)N=D=>o-Math.exp(-_*D)*(A+(S+_*A)*D);else{const D=_*Math.sqrt(z*z-1);N=M=>{const V=Math.exp(-z*_*M),U=Math.min(D*M,300);return o-V*((S+z*_*A)*Math.sinh(U)+D*A*Math.cosh(U))/D}}const P={calculatedDuration:v&&p||null,next:D=>{const M=N(D);if(v)d.done=D>=p;else{let V=D===0?S:0;z<1&&(V=D===0?ha(S):fj(N,D,M));const U=Math.abs(V)<=a,K=Math.abs(o-M)<=s;d.done=U&&K}return d.value=d.done?o:M,d},toString:()=>{const D=Math.min(dg(P),kd),M=dj(V=>P.next(D*V).value,D,30);return D+"ms "+M},toTransition:()=>{}};return P}wd.applyToOptions=e=>{const t=jO(e,100,wd);return e.ease=t.ease,e.duration=ha(t.duration),e.type="keyframes",e};function Kp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:c=500,modifyTarget:o,min:d,max:h,restDelta:m=.5,restSpeed:x}){const p=e[0],b={done:!1,value:p},v=U=>d!==void 0&&U<d||h!==void 0&&U>h,S=U=>d===void 0?h:h===void 0||Math.abs(d-U)<Math.abs(h-U)?d:h;let z=n*t;const A=p+z,_=o===void 0?A:o(A);_!==A&&(z=_-p);const E=U=>-z*Math.exp(-U/a),N=U=>_+E(U),P=U=>{const K=E(U),I=N(U);b.done=Math.abs(K)<=m,b.value=b.done?_:I};let D,M;const V=U=>{v(b.value)&&(D=U,M=wd({keyframes:[b.value,S(b.value)],velocity:fj(N,U,b.value),damping:s,stiffness:c,restDelta:m,restSpeed:x}))};return V(0),{calculatedDuration:null,next:U=>{let K=!1;return!M&&D===void 0&&(K=!0,P(U),V(U)),D!==void 0&&U>=D?M.next(U-D):(!K&&P(U),b)}}}function MO(e,t,n){const a=[],s=n||xa.mix||uj,c=e.length-1;for(let o=0;o<c;o++){let d=s(e[o],e[o+1]);if(t){const h=Array.isArray(t)?t[o]||yr:t;d=mc(h,d)}a.push(d)}return a}function DO(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const c=e.length;if(ng(c===t.length),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=MO(t,a,s),h=d.length,m=x=>{if(o&&x<e[0])return t[0];let p=0;if(h>1)for(;p<e.length-2&&!(x<e[p+1]);p++);const b=Jl(e[p],e[p+1],x);return d[p](b)};return n?x=>m(Ur(e[0],e[c-1],x)):m}function RO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Jl(0,t,a);e.push(Ct(n,1,s))}}function $O(e){const t=[0];return RO(t,e.length-1),t}function LO(e,t){return e.map(n=>n*t)}function PO(e,t){return e.map(()=>t||Wz).splice(0,e.length-1)}function Ul({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=J3(a)?a.map($1):$1(a),c={done:!1,value:t[0]},o=LO(n&&n.length===t.length?n:$O(t),e),d=DO(o,t,{ease:Array.isArray(s)?s:PO(t,s)});return{calculatedDuration:e,next:h=>(c.value=d(h),c.done=h>=e,c)}}const UO=e=>e!==null;function fg(e,{repeat:t,repeatType:n="loop"},a,s=1){const c=e.filter(UO),d=s<0||t&&n!=="loop"&&t%2===1?0:c.length-1;return!d||a===void 0?c[d]:a}const IO={decay:Kp,inertia:Kp,tween:Ul,keyframes:Ul,spring:wd};function hj(e){typeof e.type=="string"&&(e.type=IO[e.type])}class hg{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 BO=e=>e/100;class mg extends hg{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!==Cn.now()&&this.tick(Cn.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;hj(t);const{type:n=Ul,repeat:a=0,repeatDelay:s=0,repeatType:c,velocity:o=0}=t;let{keyframes:d}=t;const h=n||Ul;h!==Ul&&typeof d[0]!="number"&&(this.mixKeyframes=mc(BO,uj(d[0],d[1])),d=[0,100]);const m=h({...t,keyframes:d});c==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-o})),m.calculatedDuration===null&&(m.calculatedDuration=dg(m));const{calculatedDuration:x}=m;this.calculatedDuration=x,this.resolvedDuration=x+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:c,mirroredGenerator:o,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:x,repeat:p,repeatType:b,repeatDelay:v,type:S,onUpdate:z,finalKeyframe:A}=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 _=this.currentTime-m*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?_<0:_>s;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,P=a;if(p){const U=Math.min(this.currentTime,s)/d;let K=Math.floor(U),I=U%1;!I&&U>=1&&(I=1),I===1&&K--,K=Math.min(K,p+1),K%2&&(b==="reverse"?(I=1-I,v&&(I-=v/d)):b==="mirror"&&(P=o)),N=Ur(0,1,I)*d}const D=E?{done:!1,value:x[0]}:P.next(N);c&&(D.value=c(D.value));let{done:M}=D;!E&&h!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return V&&S!==Kp&&(D.value=fg(x,this.options,A,this.speed)),z&&z(D.value),V&&this.finish(),D}then(t,n){return this.finished.then(t,n)}get duration(){return gr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+gr(t)}get time(){return gr(this.currentTime)}set time(t){t=ha(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(Cn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=gr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=zO,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(Cn.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 VO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ii=e=>e*180/Math.PI,Xp=e=>{const t=Ii(Math.atan2(e[1],e[0]));return Qp(t)},ZO={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Xp,rotateZ:Xp,skewX:e=>Ii(Math.atan(e[1])),skewY:e=>Ii(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Qp=e=>(e=e%360,e<0&&(e+=360),e),Z1=Xp,F1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),H1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),FO={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:F1,scaleY:H1,scale:e=>(F1(e)+H1(e))/2,rotateX:e=>Qp(Ii(Math.atan2(e[6],e[5]))),rotateY:e=>Qp(Ii(Math.atan2(-e[2],e[0]))),rotateZ:Z1,rotate:Z1,skewX:e=>Ii(Math.atan(e[4])),skewY:e=>Ii(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Wp(e){return e.includes("scale")?1:0}function ex(e,t){if(!e||e==="none")return Wp(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=FO,s=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=ZO,s=d}if(!s)return Wp(t);const c=a[t],o=s[1].split(",").map(qO);return typeof c=="function"?c(o):o[c]}const HO=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ex(n,t)};function qO(e){return parseFloat(e.trim())}const ko=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wo=new Set(ko),q1=e=>e===vo||e===ke,GO=new Set(["x","y","z"]),YO=ko.filter(e=>!GO.has(e));function JO(e){const t=[];return YO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Qa={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})=>ex(t,"x"),y:(e,{transform:t})=>ex(t,"y")};Qa.translateX=Qa.x;Qa.translateY=Qa.y;const Bi=new Set;let tx=!1,nx=!1,rx=!1;function mj(){if(nx){const e=Array.from(Bi).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=JO(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(([c,o])=>{a.getValue(c)?.set(o)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}nx=!1,tx=!1,Bi.forEach(e=>e.complete(rx)),Bi.clear()}function pj(){Bi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(nx=!0)})}function KO(){rx=!0,pj(),mj(),rx=!1}class pg{constructor(t,n,a,s,c,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=s,this.element=c,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Bi.add(this),tx||(tx=!0,wt.read(pj),wt.resolveKeyframes(mj))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const c=s?.get(),o=t[t.length-1];if(c!==void 0)t[0]=c;else if(a&&n){const d=a.readValue(n,o);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=o),s&&c===void 0&&s.set(t[0])}VO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Bi.delete(this)}cancel(){this.state==="scheduled"&&(Bi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const XO=e=>e.startsWith("--");function QO(e,t,n){XO(t)?e.style.setProperty(t,n):e.style[t]=n}const WO=rg(()=>window.ScrollTimeline!==void 0),eM={};function tM(e,t){const n=rg(e);return()=>eM[t]??n()}const xj=tM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ml=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,G1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ml([0,.65,.55,1]),circOut:Ml([.55,0,1,.45]),backIn:Ml([.31,.01,.66,-.59]),backOut:Ml([.33,1.53,.69,.99])};function gj(e,t){if(e)return typeof e=="function"?xj()?dj(e,t):"ease-out":ej(e)?Ml(e):Array.isArray(e)?e.map(n=>gj(n,t)||G1.easeOut):G1[e]}function nM(e,t,n,{delay:a=0,duration:s=300,repeat:c=0,repeatType:o="loop",ease:d="easeOut",times:h}={},m=void 0){const x={[t]:n};h&&(x.offset=h);const p=gj(d,s);Array.isArray(p)&&(x.easing=p);const b={delay:a,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:c+1,direction:o==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(x,b)}function yj(e){return typeof e=="function"&&"applyToOptions"in e}function rM({type:e,...t}){return yj(e)&&xj()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class aM extends hg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:c,allowFlatten:o=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!c,this.allowFlatten=o,this.options=t,ng(typeof t.type!="string");const m=rM(t);this.animation=nM(n,a,s,m,c),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const x=fg(s,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(x):QO(n,a,x),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 gr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+gr(t)}get time(){return gr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ha(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&&WO()?(this.animation.timeline=t,yr):n(this)}}const bj={anticipate:Kz,backInOut:Jz,circInOut:Qz};function iM(e){return e in bj}function sM(e){typeof e.ease=="string"&&iM(e.ease)&&(e.ease=bj[e.ease])}const Bm=10;class oM extends aM{constructor(t){sM(t),hj(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:c,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new mg({...o,autoplay:!1}),h=Math.max(Bm,Cn.now()-this.startTime),m=Ur(0,Bm,h-Bm);n.setWithVelocity(d.sample(Math.max(0,h-m)).value,d.sample(h).value,m),d.stop()}}const Y1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ri.test(e)||e==="0")&&!e.startsWith("url("));function lM(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 cM(e,t,n,a){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],o=Y1(s,t),d=Y1(c,t);return!o||!d?!1:lM(e)||(n==="spring"||yj(n))&&a}function ax(e){e.duration=0,e.type="keyframes"}const uM=new Set(["opacity","clipPath","filter","transform"]),dM=rg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fM(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:c,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return dM()&&n&&uM.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&c!==0&&o!=="inertia"}const hM=40;class mM extends hg{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:o="loop",keyframes:d,name:h,motionValue:m,element:x,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Cn.now();const b={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:c,repeatType:o,name:h,motionValue:m,element:x,...p},v=x?.KeyframeResolver||pg;this.keyframeResolver=new v(d,(S,z,A)=>this.onKeyframesResolved(S,z,b,!A),h,m,x),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:c,type:o,velocity:d,delay:h,isHandoff:m,onUpdate:x}=a;this.resolvedAt=Cn.now(),cM(t,c,o,d)||((xa.instantAnimations||!h)&&x?.(fg(t,a,n)),t[0]=t[t.length-1],ax(a),a.repeat=0);const b={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>hM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&fM(b),S=b.motionValue?.owner?.current,z=v?new oM({...b,element:S}):new mg(b);z.finished.then(()=>{this.notifyFinished()}).catch(yr),this.pendingTimeline&&(this.stopTimeline=z.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=z}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(),KO()),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 vj(e,t,n,a=0,s=1){const c=Array.from(e).sort((m,x)=>m.sortNodePosition(x)).indexOf(t),o=e.size,d=(o-1)*a;return typeof n=="function"?n(c,o):s===1?c*a:d-c*a}const pM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xM(e){const t=pM.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function kj(e,t,n=1){const[a,s]=xM(e);if(!a)return;const c=window.getComputedStyle(t).getPropertyValue(a);if(c){const o=c.trim();return Bz(o)?parseFloat(o):o}return og(s)?kj(s,t,n+1):s}const gM={type:"spring",stiffness:500,damping:25,restSpeed:10},yM=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),bM={type:"keyframes",duration:.8},vM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kM=(e,{keyframes:t})=>t.length>2?bM:wo.has(e)?e.startsWith("scale")?yM(t[1]):gM:vM,wM=e=>e!==null;function SM(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(wM),c=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[c]}function xg(e,t){return e?.[t]??e?.default??e}function zM({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:s,repeat:c,repeatType:o,repeatDelay:d,from:h,elapsed:m,...x}){return!!Object.keys(x).length}const gg=(e,t,n,a={},s,c)=>o=>{const d=xg(a,e)||{},h=d.delay||a.delay||0;let{elapsed:m=0}=a;m=m-ha(h);const x={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{o(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:c?void 0:s};zM(d)||Object.assign(x,kM(e,x)),x.duration&&(x.duration=ha(x.duration)),x.repeatDelay&&(x.repeatDelay=ha(x.repeatDelay)),x.from!==void 0&&(x.keyframes[0]=x.from);let p=!1;if((x.type===!1||x.duration===0&&!x.repeatDelay)&&(ax(x),x.delay===0&&(p=!0)),(xa.instantAnimations||xa.skipAnimations)&&(p=!0,ax(x),x.delay=0),x.allowFlatten=!d.type&&!d.ease,p&&!c&&t.get()!==void 0){const b=SM(x.keyframes,d);if(b!==void 0){wt.update(()=>{x.onUpdate(b),x.onComplete()});return}}return d.isSync?new mg(x):new mM(x)};function J1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function yg(e,t,n,a){if(typeof t=="function"){const[s,c]=J1(a);t=t(n!==void 0?n:e.custom,s,c)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,c]=J1(a);t=t(n!==void 0?n:e.custom,s,c)}return t}function eo(e,t,n){const a=e.getProps();return yg(a,t,n!==void 0?n:a.custom,e)}const wj=new Set(["width","height","top","left","right","bottom",...ko]),K1=30,jM=e=>!isNaN(parseFloat(e));class _M{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=Cn.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 c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Cn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=jM(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 ag);const a=this.events[t].add(n);return t==="change"?()=>{a(),wt.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=Cn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>K1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,K1);return Fz(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 lo(e,t){return new _M(e,t)}const ix=e=>Array.isArray(e);function NM(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,lo(n))}function CM(e){return ix(e)?e[e.length-1]||0:e}function TM(e,t){const n=eo(e,t);let{transitionEnd:a={},transition:s={},...c}=n||{};c={...c,...a};for(const o in c){const d=CM(c[o]);NM(e,o,d)}}const yn=e=>!!(e&&e.getVelocity);function EM(e){return!!(yn(e)&&e.add)}function sx(e,t){const n=e.getValue("willChange");if(EM(n))return n.add(t);if(!n&&xa.WillChange){const a=new xa.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function bg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const AM="framerAppearId",Sj="data-"+bg(AM);function zj(e){return e.props[Sj]}function OM({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function jj(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:c=e.getDefaultTransition(),transitionEnd:o,...d}=t;const h=c?.reduceMotion;a&&(c=a);const m=[],x=s&&e.animationState&&e.animationState.getState()[s];for(const p in d){const b=e.getValue(p,e.latestValues[p]??null),v=d[p];if(v===void 0||x&&OM(x,p))continue;const S={delay:n,...xg(c||{},p)},z=b.get();if(z!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===z&&!S.velocity)continue;let A=!1;if(window.MotionHandoffAnimation){const N=zj(e);if(N){const P=window.MotionHandoffAnimation(N,p,wt);P!==null&&(S.startTime=P,A=!0)}}sx(e,p);const _=h??e.shouldReduceMotion;b.start(gg(p,b,v,_&&wj.has(p)?{type:!1}:S,e,A));const E=b.animation;E&&m.push(E)}return o&&Promise.all(m).then(()=>{wt.update(()=>{o&&TM(e,o)})}),m}function ox(e,t,n={}){const a=eo(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const c=a?()=>Promise.all(jj(e,a,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:x,staggerDirection:p}=s;return MM(e,t,h,m,x,p,n)}:()=>Promise.resolve(),{when:d}=s;if(d){const[h,m]=d==="beforeChildren"?[c,o]:[o,c];return h().then(()=>m())}else return Promise.all([c(),o(n.delay)])}function MM(e,t,n=0,a=0,s=0,c=1,o){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(ox(h,t,{...o,delay:n+(typeof a=="function"?0:a)+vj(e.variantChildren,h,a,s,c)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function DM(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(c=>ox(e,c,n));a=Promise.all(s)}else if(typeof t=="string")a=ox(e,t,n);else{const s=typeof t=="function"?eo(e,t,n.custom):t;a=Promise.all(jj(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const RM={test:e=>e==="auto",parse:e=>e},_j=e=>t=>t.test(e),Nj=[vo,ke,Pr,Ga,lO,oO,RM],X1=e=>Nj.find(_j(e));function $M(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zz(e):!0}const LM=new Set(["brightness","contrast","saturate","opacity"]);function PM(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(lg)||[];if(!a)return e;const s=n.replace(a,"");let c=LM.has(t)?1:0;return a!==n&&(c*=100),t+"("+c+s+")"}const UM=/\b([a-z-]*)\(.*?\)/gu,lx={...ri,getAnimatableNone:e=>{const t=e.match(UM);return t?t.map(PM).join(" "):e}},Q1={...vo,transform:Math.round},IM={rotate:Ga,rotateX:Ga,rotateY:Ga,rotateZ:Ga,scale:Vu,scaleX:Vu,scaleY:Vu,scaleZ:Vu,skew:Ga,skewX:Ga,skewY:Ga,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Kl,originX:P1,originY:P1,originZ:ke},vg={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,...IM,zIndex:Q1,fillOpacity:Kl,strokeOpacity:Kl,numOctaves:Q1},BM={...vg,color:qt,backgroundColor:qt,outlineColor:qt,fill:qt,stroke:qt,borderColor:qt,borderTopColor:qt,borderRightColor:qt,borderBottomColor:qt,borderLeftColor:qt,filter:lx,WebkitFilter:lx},Cj=e=>BM[e];function Tj(e,t){let n=Cj(e);return n!==lx&&(n=ri),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const VM=new Set(["auto","none","0"]);function ZM(e,t,n){let a=0,s;for(;a<e.length&&!s;){const c=e[a];typeof c=="string"&&!VM.has(c)&&Xl(c).values.length&&(s=e[a]),a++}if(s&&n)for(const c of t)e[c]=Tj(n,s)}class FM extends pg{constructor(t,n,a,s,c){super(t,n,a,s,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let x=0;x<t.length;x++){let p=t[x];if(typeof p=="string"&&(p=p.trim(),og(p))){const b=kj(p,n.current);b!==void 0&&(t[x]=b),x===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!wj.has(a)||t.length!==2)return;const[s,c]=t,o=X1(s),d=X1(c),h=L1(s),m=L1(c);if(h!==m&&Qa[a]){this.needsMeasurement=!0;return}if(o!==d)if(q1(o)&&q1(d))for(let x=0;x<t.length;x++){const p=t[x];typeof p=="string"&&(t[x]=parseFloat(p))}else Qa[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||$M(t[s]))&&a.push(s);a.length&&ZM(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=Qa[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 c=a.length-1,o=a[c];a[c]=Qa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function HM(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 Ej=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function cx(e){return Vz(e)&&"offsetHeight"in e}const{schedule:kg}=tj(queueMicrotask,!1),Nr={x:!1,y:!1};function Aj(){return Nr.x||Nr.y}function qM(e){return e==="x"||e==="y"?Nr[e]?null:(Nr[e]=!0,()=>{Nr[e]=!1}):Nr.x||Nr.y?null:(Nr.x=Nr.y=!0,()=>{Nr.x=Nr.y=!1})}function Oj(e,t){const n=HM(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function W1(e){return!(e.pointerType==="touch"||Aj())}function GM(e,t,n={}){const[a,s,c]=Oj(e,n),o=d=>{if(!W1(d))return;const{target:h}=d,m=t(h,d);if(typeof m!="function"||!h)return;const x=p=>{W1(p)&&(m(p),h.removeEventListener("pointerleave",x))};h.addEventListener("pointerleave",x,s)};return a.forEach(d=>{d.addEventListener("pointerenter",o,s)}),c}const Mj=(e,t)=>t?e===t?!0:Mj(e,t.parentElement):!1,wg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,YM=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Dj(e){return YM.has(e.tagName)||e.isContentEditable===!0}const dd=new WeakSet;function ek(e){return t=>{t.key==="Enter"&&e(t)}}function Vm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const JM=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=ek(()=>{if(dd.has(n))return;Vm(n,"down");const s=ek(()=>{Vm(n,"up")}),c=()=>Vm(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",c,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function tk(e){return wg(e)&&!Aj()}function KM(e,t,n={}){const[a,s,c]=Oj(e,n),o=d=>{const h=d.currentTarget;if(!tk(d))return;dd.add(h);const m=t(h,d),x=(v,S)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",b),dd.has(h)&&dd.delete(h),tk(v)&&typeof m=="function"&&m(v,{success:S})},p=v=>{x(v,h===window||h===document||n.useGlobalTarget||Mj(h,v.target))},b=v=>{x(v,!1)};window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",b,s)};return a.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",o,s),cx(d)&&(d.addEventListener("focus",m=>JM(m,s)),!Dj(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),c}function Rj(e){return Vz(e)&&"ownerSVGElement"in e}function XM(e){return Rj(e)&&e.tagName==="svg"}const QM=[...Nj,qt,ri],WM=e=>QM.find(_j(e)),nk=()=>({translate:0,scale:1,origin:0,originPoint:0}),qs=()=>({x:nk(),y:nk()}),rk=()=>({min:0,max:0}),en=()=>({x:rk(),y:rk()}),ux={current:null},$j={current:!1},eD=typeof window<"u";function tD(){if($j.current=!0,!!eD)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ux.current=e.matches;e.addEventListener("change",t),t()}else ux.current=!1}const nD=new WeakMap;function Hd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ql(e){return typeof e=="string"||Array.isArray(e)}const Sg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zg=["initial",...Sg];function qd(e){return Hd(e.animate)||zg.some(t=>Ql(e[t]))}function Lj(e){return!!(qd(e)||e.variants)}function rD(e,t,n){for(const a in t){const s=t[a],c=n[a];if(yn(s))e.addValue(a,s);else if(yn(c))e.addValue(a,lo(s,{owner:e}));else if(c!==s)if(e.hasValue(a)){const o=e.getValue(a);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(a);e.addValue(a,lo(o!==void 0?o:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const ak=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Sd={};function Pj(e){Sd=e}function aD(){return Sd}class iD{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:c,visualState:o},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=Cn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,wt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=o;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=d,this.blockInitialAnimation=!!c,this.isControllingVariants=qd(n),this.isVariantNode=Lj(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in p){const v=p[b];h[b]!==void 0&&yn(v)&&v.set(h[b])}}mount(t){this.current=t,nD.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:($j.current||tD(),this.shouldReduceMotion=ux.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ni(this.notifyUpdate),ni(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=wo.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&wt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),c&&c(),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 Sd){const n=Sd[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 c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):en()}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<ak.length;a++){const s=ak[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const c="on"+s,o=t[c];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=rD(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=lo(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"&&(Bz(a)||Zz(a))?a=parseFloat(a):!WM(a)&&ri.test(n)&&(a=Tj(t,n)),this.setBaseTarget(t,yn(a)?a.get():a)),yn(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 c=yg(this.props,n,this.presenceContext?.custom);c&&(a=c[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!yn(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 ag),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){kg.render(this.render)}}class Uj extends iD{constructor(){super(...arguments),this.KeyframeResolver=FM}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;yn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class oi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ij({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function sD({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function oD(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 Zm(e){return e===void 0||e===1}function dx({scale:e,scaleX:t,scaleY:n}){return!Zm(e)||!Zm(t)||!Zm(n)}function $i(e){return dx(e)||Bj(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Bj(e){return ik(e.x)||ik(e.y)}function ik(e){return e&&e!=="0%"}function zd(e,t,n){const a=e-n,s=t*a;return n+s}function sk(e,t,n,a,s){return s!==void 0&&(e=zd(e,s,a)),zd(e,n,a)+t}function fx(e,t=0,n=1,a,s){e.min=sk(e.min,t,n,a,s),e.max=sk(e.max,t,n,a,s)}function Vj(e,{x:t,y:n}){fx(e.x,t.translate,t.scale,t.originPoint),fx(e.y,n.translate,n.scale,n.originPoint)}const ok=.999999999999,lk=1.0000000000001;function lD(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let c,o;for(let d=0;d<s;d++){c=n[d],o=c.projectionDelta;const{visualElement:h}=c.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Ys(e,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Vj(e,o)),a&&$i(c.latestValues)&&Ys(e,c.latestValues))}t.x<lk&&t.x>ok&&(t.x=1),t.y<lk&&t.y>ok&&(t.y=1)}function Gs(e,t){e.min=e.min+t,e.max=e.max+t}function ck(e,t,n,a,s=.5){const c=Ct(e.min,e.max,s);fx(e,t,n,c,a)}function Ys(e,t){ck(e.x,t.x,t.scaleX,t.scale,t.originX),ck(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zj(e,t){return Ij(oD(e.getBoundingClientRect(),t))}function cD(e,t,n){const a=Zj(e,n),{scroll:s}=t;return s&&(Gs(a.x,s.offset.x),Gs(a.y,s.offset.y)),a}const uD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dD=ko.length;function fD(e,t,n){let a="",s=!0;for(let c=0;c<dD;c++){const o=ko[c],d=e[o];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(o.startsWith("scale")?1:0);else{const m=parseFloat(d);h=o.startsWith("scale")?m===1:m===0}if(!h||n){const m=Ej(d,vg[o]);if(!h){s=!1;const x=uD[o]||o;a+=`${x}(${m}) `}n&&(t[o]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function jg(e,t,n){const{style:a,vars:s,transformOrigin:c}=e;let o=!1,d=!1;for(const h in t){const m=t[h];if(wo.has(h)){o=!0;continue}else if(rj(h)){s[h]=m;continue}else{const x=Ej(m,vg[h]);h.startsWith("origin")?(d=!0,c[h]=x):a[h]=x}}if(t.transform||(o||n?a.transform=fD(t,e.transform,n):a.transform&&(a.transform="none")),d){const{originX:h="50%",originY:m="50%",originZ:x=0}=c;a.transformOrigin=`${h} ${m} ${x}`}}function Fj(e,{style:t,vars:n},a,s){const c=e.style;let o;for(o in t)c[o]=t[o];s?.applyProjectionStyles(c,a);for(o in n)c.setProperty(o,n[o])}function uk(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=uk(e,t.target.x),a=uk(e,t.target.y);return`${n}% ${a}%`}},hD={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=ri.parse(e);if(s.length>5)return a;const c=ri.createTransformer(e),o=typeof s[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;s[0+o]/=d,s[1+o]/=h;const m=Ct(d,h,.5);return typeof s[2+o]=="number"&&(s[2+o]/=m),typeof s[3+o]=="number"&&(s[3+o]/=m),c(s)}},hx={borderRadius:{...zl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zl,borderTopRightRadius:zl,borderBottomLeftRadius:zl,borderBottomRightRadius:zl,boxShadow:hD};function Hj(e,{layout:t,layoutId:n}){return wo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!hx[e]||e==="opacity")}function _g(e,t,n){const a=e.style,s=t?.style,c={};if(!a)return c;for(const o in a)(yn(a[o])||s&&yn(s[o])||Hj(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(c[o]=a[o]);return c}function mD(e){return window.getComputedStyle(e)}class pD extends Uj{constructor(){super(...arguments),this.type="html",this.renderInstance=Fj}readValueFromInstance(t,n){if(wo.has(n))return this.projection?.isProjecting?Wp(n):HO(t,n);{const a=mD(t),s=(rj(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zj(t,n)}build(t,n,a){jg(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return _g(t,n,a)}}const xD={offset:"stroke-dashoffset",array:"stroke-dasharray"},gD={offset:"strokeDashoffset",array:"strokeDasharray"};function yD(e,t,n=1,a=0,s=!0){e.pathLength=1;const c=s?xD:gD;e[c.offset]=`${-a}`,e[c.array]=`${t} ${n}`}const bD=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qj(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:c=1,pathOffset:o=0,...d},h,m,x){if(jg(e,d,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:b}=e;p.transform&&(b.transform=p.transform,delete p.transform),(b.transform||p.transformOrigin)&&(b.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),b.transform&&(b.transformBox=x?.transformBox??"fill-box",delete p.transformBox);for(const v of bD)p[v]!==void 0&&(b[v]=p[v],delete p[v]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),a!==void 0&&(p.scale=a),s!==void 0&&yD(p,s,c,o,!1)}const Gj=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"]),Yj=e=>typeof e=="string"&&e.toLowerCase()==="svg";function vD(e,t,n,a){Fj(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(Gj.has(s)?s:bg(s),t.attrs[s])}function Jj(e,t,n){const a=_g(e,t,n);for(const s in e)if(yn(e[s])||yn(t[s])){const c=ko.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[c]=e[s]}return a}class kD extends Uj{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=en}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wo.has(n)){const a=Cj(n);return a&&a.default||0}return n=Gj.has(n)?n:bg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Jj(t,n,a)}build(t,n,a){qj(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){vD(t,n,a,s)}mount(t){this.isSVGTag=Yj(t.tagName),super.mount(t)}}const wD=zg.length;function Kj(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Kj(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wD;n++){const a=zg[n],s=e.props[a];(Ql(s)||s===!1)&&(t[a]=s)}return t}function Xj(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 SD=[...Sg].reverse(),zD=Sg.length;function jD(e){return t=>Promise.all(t.map(({animation:n,options:a})=>DM(e,n,a)))}function _D(e){let t=jD(e),n=dk(),a=!0;const s=h=>(m,x)=>{const p=eo(e,x,h==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:b,transitionEnd:v,...S}=p;m={...m,...S,...v}}return m};function c(h){t=h(e)}function o(h){const{props:m}=e,x=Kj(e.parent)||{},p=[],b=new Set;let v={},S=1/0;for(let A=0;A<zD;A++){const _=SD[A],E=n[_],N=m[_]!==void 0?m[_]:x[_],P=Ql(N),D=_===h?E.isActive:null;D===!1&&(S=A);let M=N===x[_]&&N!==m[_]&&P;if(M&&a&&e.manuallyAnimateOnMount&&(M=!1),E.protectedKeys={...v},!E.isActive&&D===null||!N&&!E.prevProp||Hd(N)||typeof N=="boolean")continue;const V=ND(E.prevProp,N);let U=V||_===h&&E.isActive&&!M&&P||A>S&&P,K=!1;const I=Array.isArray(N)?N:[N];let te=I.reduce(s(_),{});D===!1&&(te={});const{prevResolvedValues:le={}}=E,ne={...le,...te},oe=B=>{U=!0,b.has(B)&&(K=!0,b.delete(B)),E.needsAnimating[B]=!0;const Y=e.getValue(B);Y&&(Y.liveStyle=!1)};for(const B in ne){const Y=te[B],ue=le[B];if(v.hasOwnProperty(B))continue;let O=!1;ix(Y)&&ix(ue)?O=!Xj(Y,ue):O=Y!==ue,O?Y!=null?oe(B):b.add(B):Y!==void 0&&b.has(B)?oe(B):E.protectedKeys[B]=!0}E.prevProp=N,E.prevResolvedValues=te,E.isActive&&(v={...v,...te}),a&&e.blockInitialAnimation&&(U=!1);const se=M&&V;U&&(!se||K)&&p.push(...I.map(B=>{const Y={type:_};if(typeof B=="string"&&a&&!se&&e.manuallyAnimateOnMount&&e.parent){const{parent:ue}=e,O=eo(ue,B);if(ue.enteringChildren&&O){const{delayChildren:C}=O.transition||{};Y.delay=vj(ue.enteringChildren,e,C)}}return{animation:B,options:Y}}))}if(b.size){const A={};if(typeof m.initial!="boolean"){const _=eo(e,Array.isArray(m.initial)?m.initial[0]:m.initial);_&&_.transition&&(A.transition=_.transition)}b.forEach(_=>{const E=e.getBaseTarget(_),N=e.getValue(_);N&&(N.liveStyle=!0),A[_]=E??null}),p.push({animation:A})}let z=!!p.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(z=!1),a=!1,z?t(p):Promise.resolve()}function d(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(h,m)),n[h].isActive=m;const x=o(h);for(const p in n)n[p].protectedKeys={};return x}return{animateChanges:o,setActive:d,setAnimateFunction:c,getState:()=>n,reset:()=>{n=dk()}}}function ND(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Xj(t,e):!1}function Oi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dk(){return{animate:Oi(!0),whileInView:Oi(),whileHover:Oi(),whileTap:Oi(),whileDrag:Oi(),whileFocus:Oi(),exit:Oi()}}function fk(e,t){e.min=t.min,e.max=t.max}function jr(e,t){fk(e.x,t.x),fk(e.y,t.y)}function hk(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Qj=1e-4,CD=1-Qj,TD=1+Qj,Wj=.01,ED=0-Wj,AD=0+Wj;function Tn(e){return e.max-e.min}function OD(e,t,n){return Math.abs(e-t)<=n}function mk(e,t,n,a=.5){e.origin=a,e.originPoint=Ct(t.min,t.max,e.origin),e.scale=Tn(n)/Tn(t),e.translate=Ct(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CD&&e.scale<=TD||isNaN(e.scale))&&(e.scale=1),(e.translate>=ED&&e.translate<=AD||isNaN(e.translate))&&(e.translate=0)}function Il(e,t,n,a){mk(e.x,t.x,n.x,a?a.originX:void 0),mk(e.y,t.y,n.y,a?a.originY:void 0)}function pk(e,t,n){e.min=n.min+t.min,e.max=e.min+Tn(t)}function MD(e,t,n){pk(e.x,t.x,n.x),pk(e.y,t.y,n.y)}function xk(e,t,n){e.min=t.min-n.min,e.max=e.min+Tn(t)}function jd(e,t,n){xk(e.x,t.x,n.x),xk(e.y,t.y,n.y)}function gk(e,t,n,a,s){return e-=t,e=zd(e,1/n,a),s!==void 0&&(e=zd(e,1/s,a)),e}function DD(e,t=0,n=1,a=.5,s,c=e,o=e){if(Pr.test(t)&&(t=parseFloat(t),t=Ct(o.min,o.max,t/100)-o.min),typeof t!="number")return;let d=Ct(c.min,c.max,a);e===c&&(d-=t),e.min=gk(e.min,t,n,d,s),e.max=gk(e.max,t,n,d,s)}function yk(e,t,[n,a,s],c,o){DD(e,t[n],t[a],t[s],t.scale,c,o)}const RD=["x","scaleX","originX"],$D=["y","scaleY","originY"];function bk(e,t,n,a){yk(e.x,t,RD,n?n.x:void 0,a?a.x:void 0),yk(e.y,t,$D,n?n.y:void 0,a?a.y:void 0)}function vk(e){return e.translate===0&&e.scale===1}function e_(e){return vk(e.x)&&vk(e.y)}function kk(e,t){return e.min===t.min&&e.max===t.max}function LD(e,t){return kk(e.x,t.x)&&kk(e.y,t.y)}function wk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function t_(e,t){return wk(e.x,t.x)&&wk(e.y,t.y)}function Sk(e){return Tn(e.x)/Tn(e.y)}function zk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function mr(e){return[e("x"),e("y")]}function PD(e,t,n){let a="";const s=e.x.translate/t.x,c=e.y.translate/t.y,o=n?.z||0;if((s||c||o)&&(a=`translate3d(${s}px, ${c}px, ${o}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:x,rotateX:p,rotateY:b,skewX:v,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),x&&(a+=`rotate(${x}deg) `),p&&(a+=`rotateX(${p}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),S&&(a+=`skewY(${S}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(a+=`scale(${d}, ${h})`),a||"none"}const n_=["TopLeft","TopRight","BottomLeft","BottomRight"],UD=n_.length,jk=e=>typeof e=="string"?parseFloat(e):e,_k=e=>typeof e=="number"||ke.test(e);function ID(e,t,n,a,s,c){s?(e.opacity=Ct(0,n.opacity??1,BD(a)),e.opacityExit=Ct(t.opacity??1,0,VD(a))):c&&(e.opacity=Ct(t.opacity??1,n.opacity??1,a));for(let o=0;o<UD;o++){const d=`border${n_[o]}Radius`;let h=Nk(t,d),m=Nk(n,d);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||_k(h)===_k(m)?(e[d]=Math.max(Ct(jk(h),jk(m),a),0),(Pr.test(m)||Pr.test(h))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=Ct(t.rotate||0,n.rotate||0,a))}function Nk(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const BD=r_(0,.5,Xz),VD=r_(.5,.95,yr);function r_(e,t,n){return a=>a<e?0:a>t?1:n(Jl(e,t,a))}function ZD(e,t,n){const a=yn(e)?e:lo(e);return a.start(gg("",a,t,n)),a.animation}function Wl(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const FD=(e,t)=>e.depth-t.depth;class HD{constructor(){this.children=[],this.isDirty=!1}add(t){eg(this.children,t),this.isDirty=!0}remove(t){tg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(FD),this.isDirty=!1,this.children.forEach(t)}}function qD(e,t){const n=Cn.now(),a=({timestamp:s})=>{const c=s-n;c>=t&&(ni(a),e(c-t))};return wt.setup(a,!0),()=>ni(a)}function fd(e){return yn(e)?e.get():e}class GD{constructor(){this.members=[]}add(t){eg(this.members,t),t.scheduleRender()}remove(t){if(tg(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 c=this.members[s];if(c.isPresent!==!1){a=c;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,c=t.options.layoutDependency;s!==void 0&&c!==void 0&&s===c||(t.resumeFrom=a,n&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:d}=t.options;d===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:a}=t;n.onExitComplete&&n.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const hd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Fm=["","X","Y","Z"],YD=1e3;let JD=0;function Hm(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=zj(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(s||c))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&a_(a)}function i_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(o={},d=t?.()){this.id=JD++,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(QD),this.nodes.forEach(nR),this.nodes.forEach(rR),this.nodes.forEach(WD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new HD)}addEventListener(o,d){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ag),this.eventHandlers.get(o).add(d)}notifyListeners(o,...d){const h=this.eventHandlers.get(o);h&&h.notify(...d)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Rj(o)&&!XM(o),this.instance=o;const{layoutId:d,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let x,p=0;const b=()=>this.root.updateBlockedByResize=!1;wt.read(()=>{p=window.innerWidth}),e(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,x&&x(),x=qD(b,250),hd.hasAnimatedSinceResize&&(hd.hasAnimatedSinceResize=!1,this.nodes.forEach(Ek)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||h)&&this.addEventListener("didUpdate",({delta:x,hasLayoutChanged:p,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||lR,{onLayoutAnimationStart:z,onLayoutAnimationComplete:A}=m.getProps(),_=!this.targetLayout||!t_(this.targetLayout,v),E=!p&&b;if(this.options.layoutRoot||this.resumeFrom||E||p&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...xg(S,"layout"),onPlay:z,onComplete:A};(m.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(x,E)}else p||Ek(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ni(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(aR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!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 x=0;x<this.path.length;x++){const p=this.path[x];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ck);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Tk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(tR),this.nodes.forEach(KD),this.nodes.forEach(XD)):this.nodes.forEach(Tk),this.clearAllSnapshots();const d=Cn.now();fn.delta=Ur(0,1e3/60,d-fn.timestamp),fn.timestamp=d,fn.isProcessing=!0,$m.update.process(fn),$m.preRender.process(fn),$m.render.process(fn),fn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,kg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eR),this.sharedNodes.forEach(iR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Tn(this.snapshot.measuredBox.x)&&!Tn(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 o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=en(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(d=!1),d&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!e_(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,x=m!==this.prevTransformTemplateValue;o&&this.instance&&(d||$i(this.latestValues)||x)&&(s(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return o&&(h=this.removeTransform(h)),cR(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return en();const d=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(uR))){const{scroll:m}=this.root;m&&(Gs(d.x,m.offset.x),Gs(d.y,m.offset.y))}return d}removeElementScroll(o){const d=en();if(jr(d,o),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:x,options:p}=m;m!==this.root&&x&&p.layoutScroll&&(x.wasRoot&&jr(d,o),Gs(d.x,x.offset.x),Gs(d.y,x.offset.y))}return d}applyTransform(o,d=!1){const h=en();jr(h,o);for(let m=0;m<this.path.length;m++){const x=this.path[m];!d&&x.options.layoutScroll&&x.scroll&&x!==x.root&&Ys(h,{x:-x.scroll.offset.x,y:-x.scroll.offset.y}),$i(x.latestValues)&&Ys(h,x.latestValues)}return $i(this.latestValues)&&Ys(h,this.latestValues),h}removeTransform(o){const d=en();jr(d,o);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!$i(m.latestValues))continue;dx(m.latestValues)&&m.updateSnapshot();const x=en(),p=m.measurePageBox();jr(x,p),bk(d,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,x)}return $i(this.latestValues)&&bk(d,this.latestValues),d}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==fn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(o||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:x,layoutId:p}=this.options;if(!this.layout||!(x||p))return;this.resolvedRelativeTargetAt=fn.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=en(),this.targetWithTransforms=en()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),MD(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jr(this.target,this.layout.layoutBox),Vj(this.target,this.targetDelta)):jr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||dx(this.parent.latestValues)||Bj(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,d,h){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=en(),this.relativeTargetOrigin=en(),jd(this.relativeTargetOrigin,d,h),jr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),d=!!this.resumingFrom||this!==o;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===fn.timestamp&&(h=!1),h)return;const{layout:m,layoutId:x}=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||x))return;jr(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,b=this.treeScale.y;lD(this.layoutCorrected,this.treeScale,this.path,d),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=en());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(hk(this.prevProjectionDelta.x,this.projectionDelta.x),hk(this.prevProjectionDelta.y,this.projectionDelta.y)),Il(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==b||!zk(this.projectionDelta.x,this.prevProjectionDelta.x)||!zk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qs(),this.projectionDelta=qs(),this.projectionDeltaWithTransform=qs()}setAnimationOrigin(o,d=!1){const h=this.snapshot,m=h?h.latestValues:{},x={...this.latestValues},p=qs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const b=en(),v=h?h.source:void 0,S=this.layout?this.layout.source:void 0,z=v!==S,A=this.getStack(),_=!A||A.members.length<=1,E=!!(z&&!_&&this.options.crossfade===!0&&!this.path.some(oR));this.animationProgress=0;let N;this.mixTargetDelta=P=>{const D=P/1e3;Ak(p.x,o.x,D),Ak(p.y,o.y,D),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jd(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sR(this.relativeTarget,this.relativeTargetOrigin,b,D),N&&LD(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=en()),jr(N,this.relativeTarget)),z&&(this.animationValues=x,ID(x,m,this.latestValues,D,E,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ni(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{hd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=lo(0)),this.currentAnimation=ZD(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:d,target:h,layout:m,latestValues:x}=o;if(!(!d||!h||!m)){if(this!==o&&this.layout&&m&&s_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||en();const p=Tn(this.layout.layoutBox.x);h.x.min=o.target.x.min,h.x.max=h.x.min+p;const b=Tn(this.layout.layoutBox.y);h.y.min=o.target.y.min,h.y.max=h.y.min+b}jr(d,h),Ys(d,x),Il(this.projectionDeltaWithTransform,this.layoutCorrected,d,x)}}registerSharedNode(o,d){this.sharedNodes.has(o)||this.sharedNodes.set(o,new GD),this.sharedNodes.get(o).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:d,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),o&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let d=!1;const{latestValues:h}=o;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const m={};h.z&&Hm("z",o,m,this.animationValues);for(let x=0;x<Fm.length;x++)Hm(`rotate${Fm[x]}`,o,m,this.animationValues),Hm(`skew${Fm[x]}`,o,m,this.animationValues);o.render();for(const x in m)o.setStaticValue(x,m[x]),this.animationValues&&(this.animationValues[x]=m[x]);o.scheduleRender()}applyProjectionStyles(o,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=fd(d?.pointerEvents)||"",o.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=fd(d?.pointerEvents)||""),this.hasProjected&&!$i(this.latestValues)&&(o.transform=h?h({},""):"none",this.hasProjected=!1);return}o.visibility="";const x=m.animationValues||m.latestValues;this.applyTransformsToTarget();let p=PD(this.projectionDeltaWithTransform,this.treeScale,x);h&&(p=h(x,p)),o.transform=p;const{x:b,y:v}=this.projectionDelta;o.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?o.opacity=m===this?x.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:o.opacity=m===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const S in hx){if(x[S]===void 0)continue;const{correct:z,applyTo:A,isCSSVariable:_}=hx[S],E=p==="none"?x[S]:z(x[S],m);if(A){const N=A.length;for(let P=0;P<N;P++)o[A[P]]=E}else _?this.options.visualElement.renderState.vars[S]=E:o[S]=E}this.options.layoutId&&(o.pointerEvents=m===this?fd(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Ck),this.root.sharedNodes.clear()}}}function KD(e){e.updateLayout()}function XD(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,c=t.source!==e.layout.source;s==="size"?mr(x=>{const p=c?t.measuredBox[x]:t.layoutBox[x],b=Tn(p);p.min=n[x].min,p.max=p.min+b}):s_(s,t.layoutBox,n)&&mr(x=>{const p=c?t.measuredBox[x]:t.layoutBox[x],b=Tn(n[x]);p.max=p.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[x].max=e.relativeTarget[x].min+b)});const o=qs();Il(o,n,t.layoutBox);const d=qs();c?Il(d,e.applyTransform(a,!0),t.measuredBox):Il(d,n,t.layoutBox);const h=!e_(o);let m=!1;if(!e.resumeFrom){const x=e.getClosestProjectingParent();if(x&&!x.resumeFrom){const{snapshot:p,layout:b}=x;if(p&&b){const v=en();jd(v,t.layoutBox,p.layoutBox);const S=en();jd(S,n,b.layoutBox),t_(v,S)||(m=!0),x.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=v,e.relativeParent=x)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:o,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function QD(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 WD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eR(e){e.clearSnapshot()}function Ck(e){e.clearMeasurements()}function Tk(e){e.isLayoutDirty=!1}function tR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ek(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nR(e){e.resolveTargetDelta()}function rR(e){e.calcProjection()}function aR(e){e.resetSkewAndRotation()}function iR(e){e.removeLeadSnapshot()}function Ak(e,t,n){e.translate=Ct(t.translate,0,n),e.scale=Ct(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ok(e,t,n,a){e.min=Ct(t.min,n.min,a),e.max=Ct(t.max,n.max,a)}function sR(e,t,n,a){Ok(e.x,t.x,n.x,a),Ok(e.y,t.y,n.y,a)}function oR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lR={duration:.45,ease:[.4,0,.1,1]},Mk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Dk=Mk("applewebkit/")&&!Mk("chrome/")?Math.round:yr;function Rk(e){e.min=Dk(e.min),e.max=Dk(e.max)}function cR(e){Rk(e.x),Rk(e.y)}function s_(e,t,n){return e==="position"||e==="preserve-aspect"&&!OD(Sk(t),Sk(n),.2)}function uR(e){return e!==e.root&&e.scroll?.wasRoot}const dR=i_({attachResizeListener:(e,t)=>Wl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qm={current:void 0},o_=i_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qm.current){const e=new dR({});e.mount(window),e.setOptions({layoutScroll:!0}),qm.current=e}return qm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ng=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function $k(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fR(...e){return t=>{let n=!1;const a=e.map(s=>{const c=$k(s,t);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let s=0;s<a.length;s++){const c=a[s];typeof c=="function"?c():$k(e[s],null)}}}}function hR(...e){return j.useCallback(fR(...e),e)}class mR extends j.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=cx(a)&&a.offsetWidth||0,c=cx(a)&&a.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left,o.bottom=c-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function pR({children:e,isPresent:t,anchorX:n,anchorY:a,root:s}){const c=j.useId(),o=j.useRef(null),d=j.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=j.useContext(Ng),m=e.props?.ref??e?.ref,x=hR(o,m);return j.useInsertionEffect(()=>{const{width:p,height:b,top:v,left:S,right:z,bottom:A}=d.current;if(t||!o.current||!p||!b)return;const _=n==="left"?`left: ${S}`:`right: ${z}`,E=a==="bottom"?`bottom: ${A}`:`top: ${v}`;o.current.dataset.motionPopId=c;const N=document.createElement("style");h&&(N.nonce=h);const P=s??document.head;return P.appendChild(N),N.sheet&&N.sheet.insertRule(`
|
|
12
|
+
[data-motion-pop-id="${c}"] {
|
|
13
|
+
position: absolute !important;
|
|
14
|
+
width: ${p}px !important;
|
|
15
|
+
height: ${b}px !important;
|
|
16
|
+
${_}px !important;
|
|
17
|
+
${E}px !important;
|
|
18
|
+
}
|
|
19
|
+
`),()=>{P.contains(N)&&P.removeChild(N)}},[t]),u.jsx(mR,{isPresent:t,childRef:o,sizeRef:d,children:j.cloneElement(e,{ref:x})})}const xR=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:c,mode:o,anchorX:d,anchorY:h,root:m})=>{const x=Wx(gR),p=j.useId();let b=!0,v=j.useMemo(()=>(b=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:S=>{x.set(S,!0);for(const z of x.values())if(!z)return;a&&a()},register:S=>(x.set(S,!1),()=>x.delete(S))}),[n,x,a]);return c&&b&&(v={...v}),j.useMemo(()=>{x.forEach((S,z)=>x.set(z,!1))},[n]),j.useEffect(()=>{!n&&!x.size&&a&&a()},[n]),o==="popLayout"&&(e=u.jsx(pR,{isPresent:n,anchorX:d,anchorY:h,root:m,children:e})),u.jsx(Fd.Provider,{value:v,children:e})};function gR(){return new Map}function l_(e=!0){const t=j.useContext(Fd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,c=j.useId();j.useEffect(()=>{if(e)return s(c)},[e]);const o=j.useCallback(()=>e&&a&&a(c),[c,a,e]);return!n&&a?[!1,o]:[!0]}const Zu=e=>e.key||"";function Lk(e){const t=[];return j.Children.forEach(e,n=>{j.isValidElement(n)&&t.push(n)}),t}const Cg=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:c="sync",propagate:o=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[x,p]=l_(o),b=j.useMemo(()=>Lk(e),[e]),v=o&&!x?[]:b.map(Zu),S=j.useRef(!0),z=j.useRef(b),A=Wx(()=>new Map),_=j.useRef(new Set),[E,N]=j.useState(b),[P,D]=j.useState(b);Iz(()=>{S.current=!1,z.current=b;for(let U=0;U<P.length;U++){const K=Zu(P[U]);v.includes(K)?(A.delete(K),_.current.delete(K)):A.get(K)!==!0&&A.set(K,!1)}},[P,v.length,v.join("-")]);const M=[];if(b!==E){let U=[...b];for(let K=0;K<P.length;K++){const I=P[K],te=Zu(I);v.includes(te)||(U.splice(K,0,I),M.push(I))}return c==="wait"&&M.length&&(U=M),D(Lk(U)),N(b),null}const{forceRender:V}=j.useContext(Qx);return u.jsx(u.Fragment,{children:P.map(U=>{const K=Zu(U),I=o&&!x?!1:b===P||v.includes(K),te=()=>{if(_.current.has(K))return;if(_.current.add(K),A.has(K))A.set(K,!0);else return;let le=!0;A.forEach(ne=>{ne||(le=!1)}),le&&(V?.(),D(z.current),o&&p?.(),a&&a())};return u.jsx(xR,{isPresent:I,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:c,root:m,onExitComplete:I?void 0:te,anchorX:d,anchorY:h,children:U},K)})})},c_=j.createContext({strict:!1}),Pk={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 Uk=!1;function yR(){if(Uk)return;const e={};for(const t in Pk)e[t]={isEnabled:n=>Pk[t].some(a=>!!n[a])};Pj(e),Uk=!0}function u_(){return yR(),aD()}function bR(e){const t=u_();for(const n in e)t[n]={...t[n],...e[n]};Pj(t)}const vR=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 _d(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||vR.has(e)}let d_=e=>!_d(e);function kR(e){typeof e=="function"&&(d_=t=>t.startsWith("on")?!_d(t):e(t))}try{kR(require("@emotion/is-prop-valid").default)}catch{}function wR(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(d_(s)||n===!0&&_d(s)||!t&&!_d(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Gd=j.createContext({});function SR(e,t){if(qd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Ql(n)?n:void 0,animate:Ql(a)?a:void 0}}return e.inherit!==!1?t:{}}function zR(e){const{initial:t,animate:n}=SR(e,j.useContext(Gd));return j.useMemo(()=>({initial:t,animate:n}),[Ik(t),Ik(n)])}function Ik(e){return Array.isArray(e)?e.join(" "):e}const Tg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function f_(e,t,n){for(const a in t)!yn(t[a])&&!Hj(a,n)&&(e[a]=t[a])}function jR({transformTemplate:e},t){return j.useMemo(()=>{const n=Tg();return jg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _R(e,t){const n=e.style||{},a={};return f_(a,n,e),Object.assign(a,jR(e,t)),a}function NR(e,t){const n={},a=_R(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_=()=>({...Tg(),attrs:{}});function CR(e,t,n,a){const s=j.useMemo(()=>{const c=h_();return qj(c,t,Yj(a),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};f_(c,e.style,e),s.style={...c,...s.style}}return s}const TR=["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 Eg(e){return typeof e!="string"||e.includes("-")?!1:!!(TR.indexOf(e)>-1||/[A-Z]/u.test(e))}function ER(e,t,n,{latestValues:a},s,c=!1,o){const h=(o??Eg(e)?CR:NR)(t,a,s,e),m=wR(t,typeof e=="string",c),x=e!==j.Fragment?{...m,...h,ref:n}:{},{children:p}=t,b=j.useMemo(()=>yn(p)?p.get():p,[p]);return j.createElement(e,{...x,children:b})}function AR({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:OR(n,a,s,e),renderState:t()}}function OR(e,t,n,a){const s={},c=a(e,{});for(const b in c)s[b]=fd(c[b]);let{initial:o,animate:d}=e;const h=qd(e),m=Lj(e);t&&m&&!h&&e.inherit!==!1&&(o===void 0&&(o=t.initial),d===void 0&&(d=t.animate));let x=n?n.initial===!1:!1;x=x||o===!1;const p=x?d:o;if(p&&typeof p!="boolean"&&!Hd(p)){const b=Array.isArray(p)?p:[p];for(let v=0;v<b.length;v++){const S=yg(e,b[v]);if(S){const{transitionEnd:z,transition:A,..._}=S;for(const E in _){let N=_[E];if(Array.isArray(N)){const P=x?N.length-1:0;N=N[P]}N!==null&&(s[E]=N)}for(const E in z)s[E]=z[E]}}}return s}const m_=e=>(t,n)=>{const a=j.useContext(Gd),s=j.useContext(Fd),c=()=>AR(e,t,a,s);return n?c():Wx(c)},MR=m_({scrapeMotionValuesFromProps:_g,createRenderState:Tg}),DR=m_({scrapeMotionValuesFromProps:Jj,createRenderState:h_}),RR=Symbol.for("motionComponentSymbol");function $R(e,t,n){const a=j.useRef(n);j.useInsertionEffect(()=>{a.current=n});const s=j.useRef(null);return j.useCallback(c=>{c&&e.onMount?.(c),t&&(c?t.mount(c):t.unmount());const o=a.current;if(typeof o=="function")if(c){const d=o(c);typeof d=="function"&&(s.current=d)}else s.current?(s.current(),s.current=null):o(c);else o&&(o.current=c)},[t])}const p_=j.createContext({});function Dl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function LR(e,t,n,a,s,c){const{visualElement:o}=j.useContext(Gd),d=j.useContext(c_),h=j.useContext(Fd),m=j.useContext(Ng).reducedMotion,x=j.useRef(null),p=j.useRef(!1);a=a||d.renderer,!x.current&&a&&(x.current=a(e,{visualState:t,parent:o,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,isSVG:c}),p.current&&x.current&&(x.current.manuallyAnimateOnMount=!0));const b=x.current,v=j.useContext(p_);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&PR(x.current,n,s,v);const S=j.useRef(!1);j.useInsertionEffect(()=>{b&&S.current&&b.update(n,h)});const z=n[Sj],A=j.useRef(!!z&&!window.MotionHandoffIsComplete?.(z)&&window.MotionHasOptimisedAnimation?.(z));return Iz(()=>{p.current=!0,b&&(S.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),A.current&&b.animationState&&b.animationState.animateChanges())}),j.useEffect(()=>{b&&(!A.current&&b.animationState&&b.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(z)}),A.current=!1),b.enteringChildren=void 0)}),b}function PR(e,t,n,a){const{layoutId:s,layout:c,drag:o,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutCrossfade:x}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:x_(e.parent)),e.projection.setOptions({layoutId:s,layout:c,alwaysMeasureLayout:!!o||d&&Dl(d),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:a,crossfade:x,layoutScroll:h,layoutRoot:m})}function x_(e){if(e)return e.options.allowProjection!==!1?e.projection:x_(e.parent)}function Gm(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&bR(a);const c=n?n==="svg":Eg(e),o=c?DR:MR;function d(m,x){let p;const b={...j.useContext(Ng),...m,layoutId:UR(m)},{isStatic:v}=b,S=zR(m),z=o(m,v);if(!v&&Uz){IR();const A=BR(b);p=A.MeasureLayout,S.visualElement=LR(e,z,b,s,A.ProjectionNode,c)}return u.jsxs(Gd.Provider,{value:S,children:[p&&S.visualElement?u.jsx(p,{visualElement:S.visualElement,...b}):null,ER(e,m,$R(z,S.visualElement,x),z,v,t,c)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=j.forwardRef(d);return h[RR]=e,h}function UR({layoutId:e}){const t=j.useContext(Qx).id;return t&&e!==void 0?t+"-"+e:e}function IR(e,t){j.useContext(c_).strict}function BR(e){const t=u_(),{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 VR(e,t){if(typeof Proxy>"u")return Gm;const n=new Map,a=(c,o)=>Gm(c,o,e,t),s=(c,o)=>a(c,o);return new Proxy(s,{get:(c,o)=>o==="create"?a:(n.has(o)||n.set(o,Gm(o,void 0,e,t)),n.get(o))})}const ZR=(e,t)=>t.isSVG??Eg(e)?new kD(t):new pD(t,{allowProjection:e!==j.Fragment});class FR extends oi{constructor(t){super(t),t.animationState||(t.animationState=_D(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Hd(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 HR=0;class qR extends oi{constructor(){super(...arguments),this.id=HR++}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 GR={animation:{Feature:FR},exit:{Feature:qR}};function gc(e){return{point:{x:e.pageX,y:e.pageY}}}const YR=e=>t=>wg(t)&&e(t,gc(t));function Bl(e,t,n,a){return Wl(e,t,YR(n),a)}const g_=({current:e})=>e?e.ownerDocument.defaultView:null,Bk=(e,t)=>Math.abs(e-t);function JR(e,t){const n=Bk(e.x,t.x),a=Bk(e.y,t.y);return Math.sqrt(n**2+a**2)}const Vk=new Set(["auto","scroll"]);class y_{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:c=!1,distanceThreshold:o=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Jm(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,z=JR(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!z)return;const{point:A}=v,{timestamp:_}=fn;this.history.push({...A,timestamp:_});const{onStart:E,onMove:N}=this.handlers;S||(E&&E(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Ym(S,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:z,onSessionEnd:A,resumeAnimation:_}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=Jm(v.type==="pointercancel"?this.lastMoveEventInfo:Ym(S,this.transformPagePoint),this.history);this.startEvent&&z&&z(v,E),A&&A(v,E)},!wg(t))return;this.dragSnapToOrigin=c,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=o,this.contextWindow=s||window;const h=gc(t),m=Ym(h,this.transformPagePoint),{point:x}=m,{timestamp:p}=fn;this.history=[{...x,timestamp:p}];const{onSessionStart:b}=n;b&&b(t,Jm(m,this.history)),this.removeListeners=mc(Bl(this.contextWindow,"pointermove",this.handlePointerMove),Bl(this.contextWindow,"pointerup",this.handlePointerUp),Bl(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(Vk.has(a.overflowX)||Vk.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},c={x:s.x-n.x,y:s.y-n.y};c.x===0&&c.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,s),wt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ni(this.updatePoint)}}function Ym(e,t){return t?{point:t(e.point)}:e}function Zk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jm({point:e},t){return{point:e,delta:Zk(e,b_(t)),offset:Zk(e,KR(t)),velocity:XR(t,.1)}}function KR(e){return e[0]}function b_(e){return e[e.length-1]}function XR(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>ha(t)));)n--;if(!a)return{x:0,y:0};const c=gr(s.timestamp-a.timestamp);if(c===0)return{x:0,y:0};const o={x:(s.x-a.x)/c,y:(s.y-a.y)/c};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function QR(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?Ct(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?Ct(n,e,a.max):Math.min(e,n)),e}function Fk(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 WR(e,{top:t,left:n,bottom:a,right:s}){return{x:Fk(e.x,n,s),y:Fk(e.y,t,a)}}function Hk(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 e$(e,t){return{x:Hk(e.x,t.x),y:Hk(e.y,t.y)}}function t$(e,t){let n=.5;const a=Tn(e),s=Tn(t);return s>a?n=Jl(t.min,t.max-a,e.min):a>s&&(n=Jl(e.min,e.max-s,t.min)),Ur(0,1,n)}function n$(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 mx=.35;function r$(e=mx){return e===!1?e=0:e===!0&&(e=mx),{x:qk(e,"left","right"),y:qk(e,"top","bottom")}}function qk(e,t,n){return{min:Gk(e,t),max:Gk(e,n)}}function Gk(e,t){return typeof e=="number"?e:e[t]||0}const a$=new WeakMap;class i${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=en(),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 c=p=>{n?(this.stopAnimation(),this.snapToCursor(gc(p).point)):this.pauseAnimation()},o=(p,b)=>{this.stopAnimation();const{drag:v,dragPropagation:S,onDragStart:z}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qM(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mr(_=>{let E=this.getAxisMotionValue(_).get()||0;if(Pr.test(E)){const{projection:N}=this.visualElement;if(N&&N.layout){const P=N.layout.layoutBox[_];P&&(E=Tn(P)*(parseFloat(E)/100))}}this.originPoint[_]=E}),z&&wt.postRender(()=>z(p,b)),sx(this.visualElement,"transform");const{animationState:A}=this.visualElement;A&&A.setActive("whileDrag",!0)},d=(p,b)=>{this.latestPointerEvent=p,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:z,onDrag:A}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:_}=b;if(S&&this.currentDirection===null){this.currentDirection=s$(_),this.currentDirection!==null&&z&&z(this.currentDirection);return}this.updateAxis("x",b.point,_),this.updateAxis("y",b.point,_),this.visualElement.render(),A&&A(p,b)},h=(p,b)=>{this.latestPointerEvent=p,this.latestPanInfo=b,this.stop(p,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>mr(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:x}=this.getProps();this.panSession=new y_(t,{onSessionStart:c,onStart:o,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:x,distanceThreshold:a,contextWindow:g_(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!s||!a)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:d}=this.getProps();d&&wt.postRender(()=>d(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||!Fu(t,s,this.currentDirection))return;const c=this.getAxisMotionValue(t);let o=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(o=QR(o,this.constraints[t],this.elastic[t])),c.set(o)}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&&Dl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=WR(a.layoutBox,t):this.constraints=!1,this.elastic=r$(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&mr(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=n$(a.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Dl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const c=cD(a,s.root,this.visualElement.getTransformPagePoint());let o=e$(s.layout.layoutBox,c);if(n){const d=n(sD(o));this.hasMutatedConstraints=!!d,d&&(o=Ij(d))}return o}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:c,dragSnapToOrigin:o,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=mr(x=>{if(!Fu(x,n,this.currentDirection))return;let p=h&&h[x]||{};o&&(p={min:0,max:0});const b=s?200:1e6,v=s?40:1e7,S={type:"inertia",velocity:a?t[x]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...c,...p};return this.startAxisValueAnimation(x,S)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return sx(this.visualElement,t),a.start(gg(t,a,0,n,this.visualElement,!1))}stopAnimation(){mr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){mr(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){mr(n=>{const{drag:a}=this.getProps();if(!Fu(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,c=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:d}=s.layout.layoutBox[n],h=c.get()||0;c.set(t[n]-Ct(o,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!Dl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};mr(o=>{const d=this.getAxisMotionValue(o);if(d&&this.constraints!==!1){const h=d.get();s[o]=t$({min:h,max:h},this.constraints[o])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),mr(o=>{if(!Fu(o,t,null))return;const d=this.getAxisMotionValue(o),{min:h,max:m}=this.constraints[o];d.set(Ct(h,m,s[o]))})}addListeners(){if(!this.visualElement.current)return;a$.set(this.visualElement,this);const t=this.visualElement.current,n=Bl(t,"pointerdown",h=>{const{drag:m,dragListener:x=!0}=this.getProps(),p=h.target,b=p!==t&&Dj(p);m&&x&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();Dl(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,c=s.addEventListener("measure",a);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),wt.read(a);const o=Wl(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(mr(x=>{const p=this.getAxisMotionValue(x);p&&(this.originPoint[x]+=h[x].translate,p.set(p.get()+h[x].translate))}),this.visualElement.render())}));return()=>{o(),n(),c(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:c=!1,dragElastic:o=mx,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:c,dragElastic:o,dragMomentum:d}}}function Fu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function s$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class o$ extends oi{constructor(t){super(t),this.removeGroupControls=yr,this.removeListeners=yr,this.controls=new i$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yr}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 Yk=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class l$ extends oi{constructor(){super(...arguments),this.removePointerDownListener=yr}onPointerDown(t){this.session=new y_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:g_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yk(t),onStart:Yk(n),onMove:a,onEnd:(c,o)=>{delete this.session,s&&wt.postRender(()=>s(c,o))}}}mount(){this.removePointerDownListener=Bl(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 Km=!1;class c$ extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:c}=t;c&&(n.group&&n.group.add(c),a&&a.register&&s&&a.register(c),Km&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),hd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:c}=this.props,{projection:o}=a;return o&&(o.isPresent=c,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Km=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==c?o.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?o.promote():o.relegate()||wt.postRender(()=>{const d=o.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),kg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;Km=!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=j.useContext(Qx);return u.jsx(c$,{...e,layoutGroup:a,switchLayoutGroup:j.useContext(p_),isPresent:t,safeToRemove:n})}const u$={pan:{Feature:l$},drag:{Feature:o$,ProjectionNode:o_,MeasureLayout:v_}};function Jk(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,c=a[s];c&&wt.postRender(()=>c(t,gc(t)))}class d$ extends oi{mount(){const{current:t}=this.node;t&&(this.unmount=GM(t,(n,a)=>(Jk(this.node,a,"Start"),s=>Jk(this.node,s,"End"))))}unmount(){}}class f$ extends oi{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=mc(Wl(this.node.current,"focus",()=>this.onFocus()),Wl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Kk(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),c=a[s];c&&wt.postRender(()=>c(t,gc(t)))}class h$ extends oi{mount(){const{current:t}=this.node;t&&(this.unmount=KM(t,(n,a)=>(Kk(this.node,a,"Start"),(s,{success:c})=>Kk(this.node,s,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const px=new WeakMap,Xm=new WeakMap,m$=e=>{const t=px.get(e.target);t&&t(e)},p$=e=>{e.forEach(m$)};function x$({root:e,...t}){const n=e||document;Xm.has(n)||Xm.set(n,{});const a=Xm.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(p$,{root:e,...t})),a[s]}function g$(e,t,n){const a=x$(t);return px.set(e,n),a.observe(e),()=>{px.delete(e),a.unobserve(e)}}const y$={some:0,all:1};class b$ extends oi{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:c}=t,o={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:y$[s]},d=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,c&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:x,onViewportLeave:p}=this.node.getProps(),b=m?x:p;b&&b(h)};return g$(this.node.current,o,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(v$(t,n))&&this.startObserver()}unmount(){}}function v$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const k$={inView:{Feature:b$},tap:{Feature:h$},focus:{Feature:f$},hover:{Feature:d$}},w$={layout:{ProjectionNode:o_,MeasureLayout:v_}},S$={...GR,...k$,...u$,...w$},$e=VR(S$,ZR),k_=()=>{const[e,t]=j.useState(!!localStorage.getItem("morpheus.auth.token"));return j.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 z$({onMenuClick:e,themeIcon:t,themeLabel:n,onThemeToggle:a}){return u.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:[u.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Pi,{className:"w-6 h-6"}),"MORPHEUS"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:a,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":`Tema: ${n}`,title:n,children:u.jsx(t,{className:"w-5 h-5"})}),u.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:u.jsx(zz,{className:"w-6 h-6"})})]})]})}const Ya={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})},Ir=({open:e,onOpenChange:t,children:n})=>e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),u.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,co=({className:e,children:t})=>u.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:u.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),Br=({children:e})=>u.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}),Vr=({className:e,children:t})=>u.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),j$=({className:e,children:t})=>u.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),xr=({className:e,variant:t="default",size:n="default",...a})=>{const d=`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 ${t==="destructive"?"bg-red-500 text-zinc-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90":t==="outline"?"border border-azure-border dark:border-matrix-primary bg-transparent hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="secondary"?"bg-azure-surface dark:bg-zinc-800 hover:bg-azure-hover dark:hover:bg-zinc-700/80 text-azure-text-primary dark:text-matrix-secondary":t==="ghost"?"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="link"?"text-azure-primary dark:text-matrix-highlight underline-offset-4 hover:underline":"bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black hover:bg-azure-primary/90 dark:hover:bg-matrix-highlight/90"} ${n==="sm"?"h-9 px-3 rounded-md":n==="lg"?"h-11 px-8 rounded-md":n==="icon"?"h-10 w-10":"h-10 px-4 py-2"} ${e||""}`;return u.jsx("button",{className:d,...a})};function _$({isOpen:e,onClose:t,onConfirm:n}){return u.jsx(Ir,{open:e,onOpenChange:t,children:u.jsxs(co,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[u.jsx(Br,{children:u.jsx(Vr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),u.jsxs("div",{children:[u.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."}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[u.jsx(xr,{variant:"outline",onClick:t,children:"Cancel"}),u.jsx(xr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Ja={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`,{})},md=["matrix","dark-soft","azure","azure-dark"],N$=new Set(["matrix","dark-soft","azure-dark"]),C$={matrix:x5,"dark-soft":OA,azure:q5,"azure-dark":m5},Xk={matrix:"Matrix","dark-soft":"Dark Soft",azure:"Azure","azure-dark":"Azure Dark"};function T$(){const e=localStorage.getItem("theme");return e==="dark"?"matrix":e==="light"?"azure":e&&md.includes(e)?e:"matrix"}function E$({children:e}){const t=Ar(),[n,a]=j.useState(T$),[s,c]=j.useState(!1),[o,d]=j.useState(!1),{logout:h}=k_(),m=()=>a(E=>md[(md.indexOf(E)+1)%md.length]),x=C$[n],{data:p}=We("/webhooks/notifications/unread-count",()=>Ya.unreadCount(),{refreshInterval:1e4}),b=p?.count??0,{data:v}=We("/tasks/stats",()=>Ja.stats(),{refreshInterval:5e3}),S=(v?.pending??0)+(v?.running??0),z=async()=>{try{await xe.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(E){console.error("Failed to restart:",E),alert("Failed to restart the agent. Please try again.")}};j.useEffect(()=>{const E=N$.has(n);document.documentElement.classList.toggle("dark",E),document.documentElement.setAttribute("data-theme",n),localStorage.setItem("theme",n)},[n]),j.useEffect(()=>{c(!1)},[t.pathname]);const A=[{icon:Dp,label:"Dashboard",path:"/"},{icon:Rp,label:"Chat",path:"/chat"},{icon:$p,label:"Zaion",path:"/zaion"},{icon:so,label:"Smiths",path:"/smiths"},{icon:bd,label:"MCP Servers",path:"/mcp-servers"},{icon:Zi,label:"Skills",path:"/skills"},{icon:Ap,label:"Usage Stats",path:"/stats"},{icon:Pi,label:"Sati Memories",path:"/sati-memories"},{icon:Pp,label:"Webhooks",path:"/webhooks"},{icon:ql,label:"Notifications",path:"/notifications"},{icon:Gl,label:"Tasks",path:"/tasks"},{icon:Qs,label:"Trinity DBs",path:"/trinity-databases"},{icon:er,label:"Chronos",path:"/chronos"},{icon:Ll,label:"Logs",path:"/logs"},{icon:io,label:"Model Pricing",path:"/model-pricing"}],_=[{icon:Dp,label:"Dashboard",path:"/"},{icon:Rp,label:"Chat",path:"/chat"},{icon:$p,label:"Zaion",path:"/zaion"},{icon:so,label:"Smiths",path:"/smiths"},{icon:bd,label:"MCP Servers",path:"/mcp-servers"},{icon:Zi,label:"Skills",path:"/skills"},{icon:Ap,label:"Usage Stats",path:"/stats"},{icon:Pi,label:"Sati Memories",path:"/sati-memories"},{icon:Pp,label:"Webhooks",path:"/webhooks"},{icon:ql,label:"Notifications",path:"/notifications"},{icon:Gl,label:"Tasks",path:"/tasks"},{icon:Qs,label:"Trinity DBs",path:"/trinity-databases"},{icon:er,label:"Chronos",path:"/chronos"},{icon:Ll,label:"Logs",path:"/logs"},{icon:io,label:"Model Pricing",path:"/model-pricing"},{icon:Ll,label:"Logs",path:"/logs"}];return u.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:[u.jsx(z$,{onMenuClick:()=>c(!0),themeIcon:x,themeLabel:Xk[n],onThemeToggle:m}),u.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",u.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:[u.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[u.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Pi,{className:"w-6 h-6"}),"MORPHEUS"]}),u.jsx("button",{onClick:m,className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors",title:Xk[n],children:u.jsx(x,{className:"w-4 h-4"})})]}),u.jsx("nav",{className:"flex-1 p-2 space-y-0.5",children:A.map(E=>{const N=t.pathname===E.path;return u.jsxs(Wa,{to:E.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[E.path==="/notifications"?u.jsxs("div",{className:"relative shrink-0",children:[u.jsx(E.icon,{className:"w-4 h-4"}),b>0&&u.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:b>9?"9+":b})]}):u.jsx(E.icon,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:E.label}),E.path==="/tasks"&&S>0&&u.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:S>99?"99+":S}),E.path==="/notifications"&&b>0&&u.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:b>99?"99+":b})]},E.path)})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>d(!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:[u.jsx(j1,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:"Restart"})]})}),u.jsx("div",{className:"p-2",children:u.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:[u.jsx(S1,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:"Logout"})]})})]}),u.jsx(Cg,{children:s&&u.jsxs($e.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>c(!1),children:[u.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),u.jsxs($e.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:E=>E.stopPropagation(),children:[u.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[u.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Pi,{className:"w-6 h-6"}),"MORPHEUS"]}),u.jsx("button",{onClick:()=>c(!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:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsx("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:_.map(E=>{const N=t.pathname===E.path;return u.jsxs(Wa,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>c(!1),children:[E.path==="/notifications"?u.jsxs("div",{className:"relative",children:[u.jsx(E.icon,{className:"w-5 h-5"}),b>0&&u.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:b>9?"9+":b})]}):u.jsx(E.icon,{className:"w-5 h-5"}),u.jsx("span",{children:E.label}),E.path==="/tasks"&&S>0&&u.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:S>99?"99+":S}),E.path==="/notifications"&&b>0&&u.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:b>99?"99+":b})]},E.path)})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>{d(!0),c(!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:[u.jsx(j1,{className:"w-5 h-5"}),u.jsx("span",{children:"Restart"})]})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>{h(),c(!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:[u.jsx(S1,{className:"w-5 h-5"}),u.jsx("span",{children:"Logout"})]})})]})]})}),u.jsxs("main",{className:`flex-1 relative flex flex-col ${t.pathname==="/chat"||t.pathname.endsWith("/audit")?"overflow-hidden p-0 md:p-0":"overflow-auto p-4 md:p-8"}`,children:[u.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"||t.pathname.endsWith("/audit")?"h-full":"max-w-6xl"}`,children:e}),n==="matrix"&&u.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-20"})]})]}),u.jsx(V3,{}),u.jsx(_$,{isOpen:o,onClose:()=>d(!1),onConfirm:z})]})}const A$={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},Qm=({title:e,value:t,icon:n,subValue:a})=>u.jsxs($e.div,{variants:A$,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:[u.jsxs("div",{className:"flex justify-between items-start mb-4",children:[u.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),u.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"})]}),u.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&u.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),xx={fetchUsageStats:async()=>xe.get("/stats/usage"),fetchGroupedUsageStats:async()=>xe.get("/stats/usage/grouped")},Za=Xa.getInstance(),hr={fetchServers:async()=>Za.get("/mcp/servers"),addServer:async(e,t)=>Za.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>Za.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>Za.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>Za.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>Za.post("/mcp/reload",{}),fetchStatus:async()=>Za.get("/mcp/status"),fetchStats:async()=>Za.get("/mcp/stats")},Ps=Xa.getInstance(),Li={fetchSkills:async()=>Ps.get("/skills"),fetchSkill:async e=>Ps.get(`/skills/${encodeURIComponent(e)}`),reloadSkills:async()=>Ps.post("/skills/reload",{}),enableSkill:async e=>Ps.post(`/skills/${encodeURIComponent(e)}/enable`,{}),disableSkill:async e=>Ps.post(`/skills/${encodeURIComponent(e)}/disable`,{}),uploadSkill:async e=>Ps.uploadFile("/skills/upload",e)},O$={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.07}}},jl={hidden:{opacity:0,y:12},show:{opacity:1,y:0}};function _l({icon:e,title:t,to:n,children:a,status:s="neutral"}){const c=s==="ok"?"border-emerald-300/60 dark:border-emerald-700/40":s==="warn"?"border-amber-300/60 dark:border-amber-700/40":s==="error"?"border-red-300/60 dark:border-red-700/40":"border-azure-border dark:border-matrix-primary/50";return u.jsxs(Wa,{to:n,className:`group flex flex-col gap-3 rounded-lg border bg-white dark:bg-black p-4 hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors ${c}`,children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(e,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),u.jsx("span",{className:"text-sm font-semibold text-azure-text dark:text-matrix-highlight",children:t})]}),u.jsx(Zd,{className:"w-3.5 h-3.5 text-azure-text-secondary dark:text-matrix-tertiary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),u.jsx("div",{className:"space-y-1.5",children:a})]})}function Un({label:e,value:t,highlight:n}){return u.jsxs("div",{className:"flex items-center justify-between text-xs",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:e}),u.jsx("span",{className:n?"font-semibold text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary",children:t})]})}function M$({status:e}){return e==="completed"?u.jsx(Fx,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"}):e==="failed"?u.jsx(ei,{className:"w-3.5 h-3.5 text-red-500 shrink-0"}):e==="running"?u.jsx(uc,{className:"w-3.5 h-3.5 text-blue-500 animate-spin shrink-0"}):u.jsx(er,{className:"w-3.5 h-3.5 text-yellow-500 shrink-0"})}function D$(){const{data:e}=Lz(),{data:t}=We("/tasks/stats",()=>Ja.stats(),{refreshInterval:5e3}),{data:n}=We("/api/stats/usage",()=>xx.fetchUsageStats(),{refreshInterval:3e4}),{data:a}=We("/api/mcp/stats",()=>hr.fetchStats(),{refreshInterval:3e4}),{data:s}=We("/api/smiths",()=>xe.get("/api/smiths"),{refreshInterval:1e4}),{data:c=[]}=We("/api/chronos",()=>xe.get("/api/chronos"),{refreshInterval:3e4}),{data:o}=We("/api/skills",()=>Li.fetchSkills(),{refreshInterval:6e4}),{data:d=[]}=We(["/tasks",{limit:5}],()=>Ja.list({limit:5}),{refreshInterval:5e3}),h=(n?.totalInputTokens??0)+(n?.totalOutputTokens??0),m=n?.totalEstimatedCostUsd!=null,x=n?.totalEstimatedCostUsd??0,p=D=>D>=1e6?`${(D/1e6).toFixed(1)}M`:D>=1e3?`${(D/1e3).toFixed(1)}k`:String(D),b=c.filter(D=>D.enabled),v=b.filter(D=>D.next_run_at).sort((D,M)=>D.next_run_at-M.next_run_at)[0],S=v?.next_run_at?(()=>{const D=v.next_run_at-Date.now();return D<0?"due now":D<6e4?`${Math.floor(D/1e3)}s`:D<36e5?`${Math.floor(D/6e4)}m`:`${Math.floor(D/36e5)}h`})():null,z=(t?.pending??0)+(t?.running??0),A=t?.failed?"warn":z>0?"ok":"neutral",_=(a?.totalTools??0)>0?"ok":"neutral",E=(s?.online??0)>0?"ok":(s?.total??0)>0?"warn":"neutral",N=b.length>0?"ok":"neutral",P=(o?.enabled??0)>0?"ok":"neutral";return u.jsxs($e.div,{className:"space-y-6",variants:O$,initial:"hidden",animate:"show",children:[u.jsxs($e.div,{variants:jl,className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Dp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Dashboard"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Overview of the Morpheus agent runtime."})]})]}),u.jsxs($e.div,{variants:jl,className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[u.jsx(Qm,{title:"Agent Status",value:e?.status.toUpperCase()??"CONNECTING...",icon:Pi,subValue:e?`PID: ${e.pid}`:""}),u.jsx(Qm,{title:"Uptime",value:e?Pz(e.uptimeSeconds):"-",icon:er,subValue:e?`${e.uptimeSeconds.toFixed(0)}s elapsed`:""}),u.jsx(Qm,{title:"Version",value:e?.projectVersion??"-",icon:wz,subValue:`Node ${e?.nodeVersion??"-"}`})]}),u.jsxs($e.div,{variants:jl,className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Provider"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(hA,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight shrink-0"}),u.jsx("p",{className:"text-base font-bold text-azure-text dark:text-matrix-highlight truncate",children:e?.llmProvider?.toUpperCase()??"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Model"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(dA,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight shrink-0"}),u.jsx("p",{className:"text-sm font-bold text-azure-text dark:text-matrix-highlight truncate leading-tight",children:e?.llmModel??"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Total Tokens"}),u.jsx("p",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:h>0?p(h):"—"}),u.jsxs("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:[p(n?.totalInputTokens??0)," in · ",p(n?.totalOutputTokens??0)," out"]})]}),u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Est. Cost"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(io,{className:"w-4 h-4 text-emerald-500 shrink-0"}),u.jsx("p",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:m?`$${x.toFixed(4)}`:"—"})]}),u.jsx("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:m?"accumulated total":"configure pricing to track"})]})]}),u.jsxs($e.div,{variants:jl,children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-3",children:"Platform"}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:[u.jsxs(_l,{icon:Zi,title:"Skills",to:"/skills",status:P,children:[u.jsx(Un,{label:"Enabled",value:o?`${o.enabled} / ${o.total}`:"—",highlight:(o?.enabled??0)>0}),u.jsx(Un,{label:"Total",value:o?.total??"—"})]}),u.jsxs(_l,{icon:bd,title:"MCP Servers",to:"/mcp-servers",status:_,children:[u.jsx(Un,{label:"Tools loaded",value:a?.totalTools??"—",highlight:!!a?.totalTools}),u.jsx(Un,{label:"Servers",value:a?.servers?.length??"—"}),a?.lastLoadedAt&&u.jsx(Un,{label:"Last loaded",value:new Date(a.lastLoadedAt).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),u.jsxs(_l,{icon:so,title:"Smiths",to:"/smiths",status:E,children:[u.jsx(Un,{label:"Online",value:s?`${s.online} / ${s.total}`:"—",highlight:(s?.online??0)>0}),u.jsx(Un,{label:"System",value:s?.enabled?"enabled":"disabled"})]}),u.jsxs(_l,{icon:Gl,title:"Tasks",to:"/tasks",status:A,children:[u.jsx(Un,{label:"Running",value:t?.running??"—",highlight:!!t?.running}),u.jsx(Un,{label:"Pending",value:t?.pending??"—"}),u.jsx(Un,{label:"Completed",value:t?.completed??"—"}),(t?.failed??0)>0&&u.jsx(Un,{label:"Failed",value:t.failed})]}),u.jsxs(_l,{icon:er,title:"Chronos",to:"/chronos",status:N,children:[u.jsx(Un,{label:"Active jobs",value:b.length,highlight:b.length>0}),u.jsx(Un,{label:"Total jobs",value:c.length}),S&&u.jsx(Un,{label:"Next run",value:`in ${S}`})]})]})]}),d.length>0&&u.jsxs($e.div,{variants:jl,children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:"Recent Tasks"}),u.jsxs(Wa,{to:"/tasks",className:"flex items-center gap-0.5 text-xs text-azure-primary dark:text-matrix-highlight hover:underline",children:["View all ",u.jsx(Zd,{className:"w-3 h-3"})]})]}),u.jsx("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.map((D,M)=>u.jsxs("div",{className:`flex items-center gap-3 px-4 py-2.5 ${M<d.length-1?"border-b border-azure-border dark:border-matrix-primary/30":""} hover:bg-azure-surface/60 dark:hover:bg-zinc-900/50 transition-colors`,children:[u.jsx(M$,{status:D.status}),u.jsx("span",{className:"font-mono text-[10px] text-azure-text-secondary dark:text-matrix-tertiary w-16 shrink-0",children:D.id.slice(0,8)}),u.jsx("span",{className:"flex-1 text-xs text-azure-text dark:text-matrix-secondary truncate",children:D.input.slice(0,100)}),u.jsx("span",{className:"text-[10px] font-mono uppercase text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:D.agent}),u.jsx("span",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:new Date(D.created_at).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]},D.id))})]})]})}function R$(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:t<6048e5?`${Math.floor(t/864e5)}d ago`:new Date(e).toLocaleDateString()}const $$=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:c,onRenameSession:o,isOpen:d,toggleSidebar:h})=>{const m=oc(),[x,p]=j.useState(null),[b,v]=j.useState(""),S=j.useRef(null);j.useEffect(()=>{x&&S.current&&S.current.focus()},[x]);const z=(N,P)=>{N.stopPropagation(),p(P.id),v(P.title||"Untitled Session")},A=N=>{N?.stopPropagation(),x&&b.trim()&&(o(x,b.trim()),p(null))},_=N=>{N?.stopPropagation(),p(null)},E=N=>{N.key==="Enter"?A():N.key==="Escape"&&_()};return d?u.jsxs("div",{className:"w-72 bg-white dark:bg-black border-r border-gray-300 dark:border-matrix-primary flex flex-col h-full shrink-0 transition-colors duration-300",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-300 dark:border-matrix-primary shrink-0",children:[u.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),u.jsx("button",{onClick:h,className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-400 dark:text-matrix-secondary/60 transition-colors",title:"Collapse sidebar",children:u.jsx(y5,{size:16})})]}),u.jsx("div",{className:"px-3 py-2.5 shrink-0",children:u.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-xl hover:bg-azure-secondary dark:hover:bg-matrix-secondary transition-colors text-sm font-medium shadow-sm",children:[u.jsx(z1,{size:16}),"New Chat"]})}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-0.5",children:[e.length===0&&u.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/40 mt-12 text-sm px-4",children:"No sessions yet. Start a new chat!"}),e.map(N=>{const P=t===N.id,D=x===N.id;return u.jsxs("div",{onClick:()=>!D&&n(N.id),className:`
|
|
20
|
+
group relative flex items-center gap-2 px-3 py-2.5 rounded-xl cursor-pointer transition-all
|
|
21
|
+
${P?"bg-azure-primary/10 dark:bg-matrix-primary/15 text-azure-primary dark:text-matrix-highlight":"hover:bg-gray-100 dark:hover:bg-matrix-primary/10 text-gray-700 dark:text-matrix-secondary"}
|
|
22
|
+
`,children:[u.jsx("div",{className:"flex-1 min-w-0",children:D?u.jsx("div",{onClick:M=>M.stopPropagation(),children:u.jsx("input",{ref:S,type:"text",value:b,onChange:M=>v(M.target.value),onKeyDown:E,className:"w-full text-sm px-1.5 py-0.5 bg-white dark:bg-black border border-azure-primary dark:border-matrix-highlight rounded-lg focus:outline-none dark:text-matrix-highlight"})}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"text-sm font-medium truncate leading-snug",children:N.title||"Untitled Session"}),u.jsx("div",{className:"text-xs text-gray-400 dark:text-matrix-secondary/50 mt-0.5",children:R$(N.started_at)})]})}),u.jsx("div",{className:`flex items-center gap-0.5 shrink-0 transition-opacity ${P||D?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:M=>M.stopPropagation(),children:D?u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:A,className:"p-1.5 rounded-lg text-emerald-600 hover:bg-emerald-50 dark:text-emerald-400 dark:hover:bg-emerald-900/20 transition-colors",title:"Save",children:u.jsx(Op,{size:13})}),u.jsx("button",{onClick:_,className:"p-1.5 rounded-lg text-red-500 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 transition-colors",title:"Cancel",children:u.jsx(Yi,{size:13})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:M=>z(M,N),className:"p-1.5 rounded-lg text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:text-matrix-secondary/50 dark:hover:text-blue-400 dark:hover:bg-blue-900/20 transition-colors",title:"Rename",children:u.jsx(dc,{size:13})}),u.jsx("button",{onClick:()=>m(`/sessions/${N.id}/audit`),className:"p-1.5 rounded-lg text-gray-400 hover:text-violet-500 hover:bg-violet-50 dark:text-matrix-secondary/50 dark:hover:text-violet-400 dark:hover:bg-violet-900/20 transition-colors",title:"Audit",children:u.jsx(gA,{size:13})}),u.jsx("button",{onClick:()=>s(N.id),className:"p-1.5 rounded-lg text-gray-400 hover:text-amber-500 hover:bg-amber-50 dark:text-matrix-secondary/50 dark:hover:text-amber-400 dark:hover:bg-amber-900/20 transition-colors",title:"Archive",children:u.jsx(aA,{size:13})}),u.jsx("button",{onClick:()=>c(N.id),className:"p-1.5 rounded-lg text-gray-400 hover:text-red-500 hover:bg-red-50 dark:text-matrix-secondary/50 dark:hover:text-red-400 dark:hover:bg-red-900/20 transition-colors",title:"Delete",children:u.jsx(pa,{size:13})})]})})]},N.id)})]})]}):u.jsxs("div",{className:"w-14 bg-white dark:bg-black border-r border-gray-300 dark:border-matrix-primary flex flex-col items-center py-3 gap-3 shrink-0 transition-colors duration-300",children:[u.jsx("button",{onClick:h,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-400 dark:text-matrix-secondary/60 transition-colors",title:"Expand sidebar",children:u.jsx(v5,{size:18})}),u.jsx("div",{className:"w-8 h-px bg-gray-200 dark:bg-matrix-primary/20"}),u.jsx("button",{onClick:a,className:"p-2.5 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black rounded-xl hover:bg-azure-secondary dark:hover:bg-matrix-secondary shadow-sm transition-colors",title:"New chat",children:u.jsx(z1,{size:18})})]})},L$=new Set(["apoc_delegate","neo_delegate","trinity_delegate","smith_delegate"]);function P$(e){return L$.has(e)}function U$(e){const t=[],n=new Set;for(let a=0;a<e.length;a++){if(n.has(a))continue;const s=e[a];if(s.type==="ai"&&Array.isArray(s.tool_calls)&&s.tool_calls.length>0){const c=s.tool_calls.map(o=>{const d=e.findIndex((h,m)=>m>a&&h.type==="tool"&&h.tool_call_id===o.id);return d!==-1&&n.add(d),{call:{id:o.id??"",name:o.name??"",args:o.args??{}},result:d!==-1?e[d]:null}});t.push({index:a,message:s,toolGroups:c})}else t.push({index:a,message:s})}return t}const Fa={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 I$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const B$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z$={};function Qk(e,t){return(Z$.jsx?V$:B$).test(e)}const F$=/[ \t\n\f\r]/g;function H$(e){return typeof e=="object"?e.type==="text"?Wk(e.value):!1:Wk(e)}function Wk(e){return e.replace(F$,"")===""}class yc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}yc.prototype.normal={};yc.prototype.property={};yc.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 yc(n,a,t)}function gx(e){return e.toLowerCase()}class Vn{constructor(t,n){this.attribute=n,this.property=t}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let q$=0;const Re=Ji(),Ht=Ji(),yx=Ji(),de=Ji(),gt=Ji(),to=Ji(),Qn=Ji();function Ji(){return 2**++q$}const bx=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:Ht,commaOrSpaceSeparated:Qn,commaSeparated:to,number:de,overloadedBoolean:yx,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Wm=Object.keys(bx);class Ag extends Vn{constructor(t,n,a,s){let c=-1;if(super(t,n),ew(this,"space",s),typeof a=="number")for(;++c<Wm.length;){const o=Wm[c];ew(this,Wm[c],(a&bx[o])===bx[o])}}}Ag.prototype.defined=!0;function ew(e,t,n){n&&(e[t]=n)}function So(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const c=new Ag(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),t[a]=c,n[gx(a)]=a,n[gx(c.attribute)]=a}return new yc(t,n,e.space)}const S_=So({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:gt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:de,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:gt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Ht,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,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 j_(e,t){return z_(e,t.toLowerCase())}const G$=So({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:to,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:gt,autoFocus:Re,autoPlay:Re,blocking:gt,capture:null,charSet:null,checked:Re,cite:null,className:gt,cols:de,colSpan:null,content:null,contentEditable:Ht,controls:Re,controlsList:gt,coords:de|to,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:yx,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:gt,height:de,hidden:yx,high:de,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:gt,itemRef:gt,itemScope:Re,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Re,optimum:de,pattern:null,ping:gt,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:gt,required:Re,reversed:Re,rows:de,rowSpan:de,sandbox:gt,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Re,useMap:null,value:Ht,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Re,disableRemotePlayback:Re,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:j_}),Y$=So({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:Qn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:gt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Re,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:to,g2:to,glyphName:to,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:z_}),__=So({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_=So({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:j_}),C_=So({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),J$={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"},K$=/[A-Z]/g,tw=/-[a-z]/g,X$=/^data[-\w.:]+$/i;function Q$(e,t){const n=gx(t);let a=t,s=Vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&X$.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(tw,e6);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!tw.test(c)){let o=c.replace(K$,W$);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Ag}return new s(a,t)}function W$(e){return"-"+e.toLowerCase()}function e6(e){return e.charAt(1).toUpperCase()}const t6=w_([S_,G$,__,N_,C_],"html"),Og=w_([S_,Y$,__,N_,C_],"svg");function n6(e){return e.join(" ").trim()}var Us={},ep,nw;function r6(){if(nw)return ep;nw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
|
|
23
|
+
`,m="/",x="*",p="",b="comment",v="declaration";function S(A,_){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];_=_||{};var E=1,N=1;function P(oe){var se=oe.match(t);se&&(E+=se.length);var Z=oe.lastIndexOf(h);N=~Z?oe.length-Z:N+oe.length}function D(){var oe={line:E,column:N};return function(se){return se.position=new M(oe),K(),se}}function M(oe){this.start=oe,this.end={line:E,column:N},this.source=_.source}M.prototype.content=A;function V(oe){var se=new Error(_.source+":"+E+":"+N+": "+oe);if(se.reason=oe,se.filename=_.source,se.line=E,se.column=N,se.source=A,!_.silent)throw se}function U(oe){var se=oe.exec(A);if(se){var Z=se[0];return P(Z),A=A.slice(Z.length),se}}function K(){U(n)}function I(oe){var se;for(oe=oe||[];se=te();)se!==!1&&oe.push(se);return oe}function te(){var oe=D();if(!(m!=A.charAt(0)||x!=A.charAt(1))){for(var se=2;p!=A.charAt(se)&&(x!=A.charAt(se)||m!=A.charAt(se+1));)++se;if(se+=2,p===A.charAt(se-1))return V("End of comment missing");var Z=A.slice(2,se-2);return N+=2,P(Z),A=A.slice(se),N+=2,oe({type:b,comment:Z})}}function le(){var oe=D(),se=U(a);if(se){if(te(),!U(s))return V("property missing ':'");var Z=U(c),B=oe({type:v,property:z(se[0].replace(e,p)),value:Z?z(Z[0].replace(e,p)):p});return U(o),B}}function ne(){var oe=[];I(oe);for(var se;se=le();)se!==!1&&(oe.push(se),I(oe));return oe}return K(),ne()}function z(A){return A?A.replace(d,p):p}return ep=S,ep}var rw;function a6(){if(rw)return Us;rw=1;var e=Us&&Us.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Us,"__esModule",{value:!0}),Us.default=n;const t=e(r6());function n(a,s){let c=null;if(!a||typeof a!="string")return c;const o=(0,t.default)(a),d=typeof s=="function";return o.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:x}=h;d?s(m,x,h):x&&(c=c||{},c[m]=x)}),c}return Us}var Nl={},aw;function i6(){if(aw)return Nl;aw=1,Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(m){return!m||n.test(m)||e.test(m)},o=function(m,x){return x.toUpperCase()},d=function(m,x){return"".concat(x,"-")},h=function(m,x){return x===void 0&&(x={}),c(m)?m:(m=m.toLowerCase(),x.reactCompat?m=m.replace(s,d):m=m.replace(a,d),m.replace(t,o))};return Nl.camelCase=h,Nl}var Cl,iw;function s6(){if(iw)return Cl;iw=1;var e=Cl&&Cl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(a6()),n=i6();function a(s,c){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(d,h){d&&h&&(o[(0,n.camelCase)(d,c)]=h)}),o}return a.default=a,Cl=a,Cl}var o6=s6();const l6=Rx(o6),T_=E_("end"),Mg=E_("start");function E_(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 c6(e){const t=Mg(e),n=T_(e);if(t&&n)return{start:t,end:n}}function Vl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sw(e.position):"start"in e||"end"in e?sw(e):"line"in e||"column"in e?vx(e):""}function vx(e){return ow(e&&e.line)+":"+ow(e&&e.column)}function sw(e){return vx(e&&e.start)+"-"+vx(e&&e.end)}function ow(e){return e&&typeof e=="number"?e:1}class vn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",c={},o=!1;if(n&&("line"in n&&"column"in n?c={place:n}:"start"in n&&"end"in n?c={place:n}:"type"in n?c={ancestors:[n],place:n.position}:c={...n}),typeof t=="string"?s=t:!c.cause&&t&&(o=!0,s=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?c.ruleId=a:(c.source=a.slice(0,h),c.ruleId=a.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const d=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Vl(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=o&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const Dg={}.hasOwnProperty,u6=new Map,d6=/[A-Z]/g,f6=new Set(["table","tbody","thead","tfoot","tr"]),h6=new Set(["td","th"]),A_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function m6(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=w6(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=k6(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"?Og:t6,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=O_(s,e,void 0);return c&&typeof c!="string"?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}function O_(e,t,n){if(t.type==="element")return p6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return x6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return y6(e,t,n);if(t.type==="mdxjsEsm")return g6(e,t);if(t.type==="root")return b6(e,t,n);if(t.type==="text")return v6(e,t)}function p6(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Og,e.schema=s),e.ancestors.push(t);const c=D_(e,t.tagName,!1),o=S6(e,t);let d=$g(e,t);return f6.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!H$(h):!0})),M_(e,o,c,t),Rg(o,d),e.ancestors.pop(),e.schema=a,e.create(t,c,o,n)}function x6(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)}ec(e,t.position)}function g6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ec(e,t.position)}function y6(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Og,e.schema=s),e.ancestors.push(t);const c=t.name===null?e.Fragment:D_(e,t.name,!0),o=z6(e,t),d=$g(e,t);return M_(e,o,c,t),Rg(o,d),e.ancestors.pop(),e.schema=a,e.create(t,c,o,n)}function b6(e,t,n){const a={};return Rg(a,$g(e,t)),e.create(t,e.Fragment,a,n)}function v6(e,t){return t.value}function M_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Rg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function k6(e,t,n){return a;function a(s,c,o,d){const m=Array.isArray(o.children)?n:t;return d?m(c,o,d):m(c,o)}}function w6(e,t){return n;function n(a,s,c,o){const d=Array.isArray(c.children),h=Mg(a);return t(s,c,o,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function S6(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&Dg.call(t.properties,s)){const c=j6(e,s,t.properties[s]);if(c){const[o,d]=c;e.tableCellAlignToStyle&&o==="align"&&typeof d=="string"&&h6.has(t.tagName)?a=d:n[o]=d}}if(a){const c=n.style||(n.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function z6(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const c=a.data.estree.body[0];c.type;const o=c.expression;o.type;const d=o.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ec(e,t.position);else{const s=a.name;let c;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,c=e.evaluater.evaluateExpression(d.expression)}else ec(e,t.position);else c=a.value===null?!0:a.value;n[s]=c}return n}function $g(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:u6;for(;++a<t.children.length;){const c=t.children[a];let o;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const m=s.get(h)||0;o=h+"-"+m,s.set(h,m+1)}}const d=O_(e,c,o);d!==void 0&&n.push(d)}return n}function j6(e,t,n){const a=Q$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?I$(n):n6(n)),a.property==="style"){let s=typeof n=="object"?n:_6(e,String(n));return e.stylePropertyNameCase==="css"&&(s=N6(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?J$[a.property]||a.property:a.attribute,n]}}function _6(e,t){try{return l6(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new vn("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 c=-1,o;for(;++c<s.length;){const d=Qk(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};o=o?{type:"MemberExpression",object:o,property:d,computed:!!(c&&d.type==="Literal"),optional:!1}:d}a=o}else a=Qk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Dg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);ec(e)}function ec(e,t){const n=new vn("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 N6(e){const t={};let n;for(n in e)Dg.call(e,n)&&(t[C6(n)]=e[n]);return t}function C6(e){let t=e.replace(d6,T6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function T6(e){return"-"+e.toLowerCase()}const tp={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"]},E6={};function Lg(e,t){const n=E6,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return R_(e,a,s)}function R_(e,t,n){if(A6(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 lw(e.children,t,n)}return Array.isArray(e)?lw(e,t,n):""}function lw(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=R_(e[s],t,n);return a.join("")}function A6(e){return!!(e&&typeof e=="object")}const cw=document.createElement("i");function Pg(e){const t="&"+e+";";cw.innerHTML=t;const n=cw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wn(e,t,n,a){const s=e.length;let c=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)o=Array.from(a),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);c<a.length;)o=a.slice(c,c+1e4),o.unshift(t,0),e.splice(...o),c+=1e4,t+=1e4}function pr(e,t){return e.length>0?(Wn(e,e.length,0,t),e):t}const uw={}.hasOwnProperty;function $_(e){const t={};let n=-1;for(;++n<e.length;)O6(t,e[n]);return t}function O6(e,t){let n;for(n in t){const s=(uw.call(e,n)?e[n]:void 0)||(e[n]={}),c=t[n];let o;if(c)for(o in c){uw.call(s,o)||(s[o]=[]);const d=c[o];M6(s[o],Array.isArray(d)?d:d?[d]:[])}}}function M6(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Wn(e,0,0,a)}function L_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=li(/[A-Za-z]/),bn=li(/[\dA-Za-z]/),D6=li(/[#-'*+\--9=?A-Z^-~]/);function Nd(e){return e!==null&&(e<32||e===127)}const kx=li(/\d/),R6=li(/[\dA-Fa-f]/),$6=li(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function pt(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const Yd=li(new RegExp("\\p{P}|\\p{S}","u")),Fi=li(/\s/);function li(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const c=e.charCodeAt(n);let o="";if(c===37&&bn(e.charCodeAt(n+1))&&bn(e.charCodeAt(n+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(o=String.fromCharCode(c));else if(c>55295&&c<57344){const d=e.charCodeAt(n+1);c<56320&&d>56319&&d<57344?(o=String.fromCharCode(c,d),s=1):o="�"}else o=String.fromCharCode(c);o&&(t.push(e.slice(a,n),encodeURIComponent(o)),a=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Xe(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let c=0;return o;function o(h){return Ve(h)?(e.enter(n),d(h)):t(h)}function d(h){return Ve(h)&&c++<s?(e.consume(h),d):(e.exit(n),t(h))}}const L6={tokenize:P6};function P6(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Xe(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),c(d)}function c(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,o(d)}function o(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return _e(d)?(e.consume(d),e.exit("chunkText"),c):(e.consume(d),o)}}const U6={tokenize:I6},dw={tokenize:B6};function I6(e){const t=this,n=[];let a=0,s,c,o;return d;function d(N){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,h,m)(N)}return m(N)}function h(N){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&E();const P=t.events.length;let D=P,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}_(a);let V=P;for(;V<t.events.length;)t.events[V][1].end={...M},V++;return Wn(t.events,D+1,0,t.events.slice(P)),t.events.length=V,m(N)}return d(N)}function m(N){if(a===n.length){if(!s)return b(N);if(s.currentConstruct&&s.currentConstruct.concrete)return S(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dw,x,p)(N)}function x(N){return s&&E(),_(a),b(N)}function p(N){return t.parser.lazy[t.now().line]=a!==n.length,o=t.now().offset,S(N)}function b(N){return t.containerState={},e.attempt(dw,v,S)(N)}function v(N){return a++,n.push([t.currentConstruct,t.containerState]),b(N)}function S(N){if(N===null){s&&E(),_(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),z(N)}function z(N){if(N===null){A(e.exit("chunkFlow"),!0),_(0),e.consume(N);return}return _e(N)?(e.consume(N),A(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(N),z)}function A(N,P){const D=t.sliceStream(N);if(P&&D.push(null),N.previous=c,c&&(c.next=N),c=N,s.defineSkip(N.start),s.write(D),t.parser.lazy[N.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<o&&(!s.events[M][1].end||s.events[M][1].end.offset>o))return;const V=t.events.length;let U=V,K,I;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(K){I=t.events[U][1].end;break}K=!0}for(_(a),M=V;M<t.events.length;)t.events[M][1].end={...I},M++;Wn(t.events,U+1,0,t.events.slice(V)),t.events.length=M}}function _(N){let P=n.length;for(;P-- >N;){const D=n[P];t.containerState=D[1],D[0].exit.call(t,e)}n.length=N}function E(){s.write([null]),c=void 0,s=void 0,t.containerState._closeFlow=void 0}}function B6(e,t,n){return Xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function uo(e){if(e===null||pt(e)||Fi(e))return 1;if(Yd(e))return 2}function Jd(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const c=e[s].resolveAll;c&&!a.includes(c)&&(t=c(t,n),a.push(c))}return t}const wx={name:"attention",resolveAll:V6,tokenize:Z6};function V6(e,t){let n=-1,a,s,c,o,d,h,m,x;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 p={...e[a][1].end},b={...e[n][1].start};fw(p,-h),fw(b,h),o={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},c={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...o.start},end:{...d.end}},e[a][1].end={...o.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=pr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=pr(m,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",c,t]]),m=pr(m,Jd(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=pr(m,[["exit",c,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(x=2,m=pr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):x=0,Wn(e,a-1,n-a+3,m),n=a+m.length-x-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Z6(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=uo(a);let c;return o;function o(h){return c=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===c)return e.consume(h),d;const m=e.exit("attentionSequence"),x=uo(h),p=!x||x===2&&s||n.includes(h),b=!s||s===2&&x||n.includes(a);return m._open=!!(c===42?p:p&&(s||!b)),m._close=!!(c===42?b:b&&(x||!p)),t(h)}}function fw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const F6={name:"autolink",tokenize:H6};function H6(e,t,n){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(v){return Nn(v)?(e.consume(v),o):v===64?n(v):m(v)}function o(v){return v===43||v===45||v===46||bn(v)?(a=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||bn(v))&&a++<32?(e.consume(v),d):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Nd(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),x):D6(v)?(e.consume(v),m):n(v)}function x(v){return bn(v)?p(v):n(v)}function p(v){return v===46?(e.consume(v),a=0,x):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||bn(v))&&a++<63){const S=v===45?b:p;return e.consume(v),S}return n(v)}}const bc={partial:!0,tokenize:q6};function q6(e,t,n){return a;function a(c){return Ve(c)?Xe(e,s,"linePrefix")(c):s(c)}function s(c){return c===null||_e(c)?t(c):n(c)}}const P_={continuation:{tokenize:Y6},exit:J6,name:"blockQuote",tokenize:G6};function G6(e,t,n){const a=this;return s;function s(o){if(o===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),c}return n(o)}function c(o){return Ve(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Y6(e,t,n){const a=this;return s;function s(o){return Ve(o)?Xe(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):c(o)}function c(o){return e.attempt(P_,t,n)(o)}}function J6(e){e.exit("blockQuote")}const U_={name:"characterEscape",tokenize:K6};function K6(e,t,n){return a;function a(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),s}function s(c){return $6(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(c)}}const I_={name:"characterReference",tokenize:X6};function X6(e,t,n){const a=this;let s=0,c,o;return d;function d(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,o=bn,x(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,o=R6,x):(e.enter("characterReferenceValue"),c=7,o=kx,x(p))}function x(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return o===bn&&!Pg(a.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&s++<c?(e.consume(p),x):n(p)}}const hw={partial:!0,tokenize:W6},mw={concrete:!0,name:"codeFenced",tokenize:Q6};function Q6(e,t,n){const a=this,s={partial:!0,tokenize:D};let c=0,o=0,d;return h;function h(M){return m(M)}function m(M){const V=a.events[a.events.length-1];return c=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(M)}function x(M){return M===d?(o++,e.consume(M),x):o<3?n(M):(e.exit("codeFencedFenceSequence"),Ve(M)?Xe(e,p,"whitespace")(M):p(M))}function p(M){return M===null||_e(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(hw,z,P)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||_e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(M)):Ve(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(e,v,"whitespace")(M)):M===96&&M===d?n(M):(e.consume(M),b)}function v(M){return M===null||_e(M)?p(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(M))}function S(M){return M===null||_e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(M)):M===96&&M===d?n(M):(e.consume(M),S)}function z(M){return e.attempt(s,P,A)(M)}function A(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),_}function _(M){return c>0&&Ve(M)?Xe(e,E,"linePrefix",c+1)(M):E(M)}function E(M){return M===null||_e(M)?e.check(hw,z,P)(M):(e.enter("codeFlowValue"),N(M))}function N(M){return M===null||_e(M)?(e.exit("codeFlowValue"),E(M)):(e.consume(M),N)}function P(M){return e.exit("codeFenced"),t(M)}function D(M,V,U){let K=0;return I;function I(se){return M.enter("lineEnding"),M.consume(se),M.exit("lineEnding"),te}function te(se){return M.enter("codeFencedFence"),Ve(se)?Xe(M,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):le(se)}function le(se){return se===d?(M.enter("codeFencedFenceSequence"),ne(se)):U(se)}function ne(se){return se===d?(K++,M.consume(se),ne):K>=o?(M.exit("codeFencedFenceSequence"),Ve(se)?Xe(M,oe,"whitespace")(se):oe(se)):U(se)}function oe(se){return se===null||_e(se)?(M.exit("codeFencedFence"),V(se)):U(se)}}}function W6(e,t,n){const a=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c)}function c(o){return a.parser.lazy[a.now().line]?n(o):t(o)}}const np={name:"codeIndented",tokenize:t9},e9={partial:!0,tokenize:n9};function t9(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),Xe(e,c,"linePrefix",5)(m)}function c(m){const x=a.events[a.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?h(m):_e(m)?e.attempt(e9,o,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||_e(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function n9(e,t,n){const a=this;return s;function s(o){return a.parser.lazy[a.now().line]?n(o):_e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Xe(e,c,"linePrefix",5)(o)}function c(o){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(o):_e(o)?s(o):n(o)}}const r9={name:"codeText",previous:i9,resolve:a9,tokenize:s9};function a9(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 i9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function s9(e,t,n){let a=0,s,c;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),d(p)}function d(p){return p===96?(e.consume(p),a++,d):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(c=e.enter("codeTextSequence"),s=0,x(p)):_e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||_e(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),m)}function x(p){return p===96?(e.consume(p),s++,x):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(c.type="codeTextData",m(p))}}class o9{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 c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Tl(this.left,a),c.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),Tl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Tl(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);Tl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Tl(this.left,n.reverse())}}}function Tl(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 B_(e){const t={};let n=-1,a,s,c,o,d,h,m;const x=new o9(e);for(;++n<x.length;){for(;n in t;)n=t[n];if(a=x.get(n),n&&a[1].type==="chunkFlow"&&x.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,l9(x,n)),n=t[n],m=!0);else if(a[1]._container){for(c=n,s=void 0;c--;)if(o=x.get(c),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(x.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=c);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(a[1].end={...x.get(s)[1].start},d=x.slice(s,n),d.unshift(a),x.splice(s,n-s+1,d))}}return Wn(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!m}function l9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const c=[];let o=n._tokenizer;o||(o=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const d=o.events,h=[],m={};let x,p,b=-1,v=n,S=0,z=0;const A=[z];for(;v;){for(;e.get(++s)[1]!==v;);c.push(s),v._tokenizer||(x=a.sliceStream(v),v.next||x.push(null),p&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(x),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=n;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(z=b+1,A.push(z),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):A.pop(),b=A.length;b--;){const _=d.slice(A[b],A[b+1]),E=c.pop();h.push([E,E+_.length-1]),e.splice(E,2,_)}for(h.reverse(),b=-1;++b<h.length;)m[S+h[b][0]]=S+h[b][1],S+=h[b][1]-h[b][0]-1;return m}const c9={resolve:d9,tokenize:f9},u9={partial:!0,tokenize:h9};function d9(e){return B_(e),e}function f9(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?c(d):_e(d)?e.check(u9,o,c)(d):(e.consume(d),s)}function c(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function o(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function h9(e,t,n){const a=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Xe(e,c,"linePrefix")}function c(o){if(o===null||_e(o))return n(o);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(o):e.interrupt(a.parser.constructs.flow,n,t)(o)}}function V_(e,t,n,a,s,c,o,d,h){const m=h||Number.POSITIVE_INFINITY;let x=0;return p;function p(_){return _===60?(e.enter(a),e.enter(s),e.enter(c),e.consume(_),e.exit(c),b):_===null||_===32||_===41||Nd(_)?n(_):(e.enter(a),e.enter(o),e.enter(d),e.enter("chunkString",{contentType:"string"}),z(_))}function b(_){return _===62?(e.enter(c),e.consume(_),e.exit(c),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(d),b(_)):_===null||_===60||_e(_)?n(_):(e.consume(_),_===92?S:v)}function S(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function z(_){return!x&&(_===null||_===41||pt(_))?(e.exit("chunkString"),e.exit(d),e.exit(o),e.exit(a),t(_)):x<m&&_===40?(e.consume(_),x++,z):_===41?(e.consume(_),x--,z):_===null||_===32||_===40||Nd(_)?n(_):(e.consume(_),_===92?A:z)}function A(_){return _===40||_===41||_===92?(e.consume(_),z):z(_)}}function Z_(e,t,n,a,s,c){const o=this;let d=0,h;return m;function m(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(c),x}function x(v){return d>999||v===null||v===91||v===93&&!h||v===94&&!d&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(c),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):_e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||_e(v)||d++>999?(e.exit("chunkString"),x(v)):(e.consume(v),h||(h=!Ve(v)),v===92?b:p)}function b(v){return v===91||v===92||v===93?(e.consume(v),d++,p):p(v)}}function F_(e,t,n,a,s,c){let o;return d;function d(b){return b===34||b===39||b===40?(e.enter(a),e.enter(s),e.consume(b),e.exit(s),o=b===40?41:b,h):n(b)}function h(b){return b===o?(e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):(e.enter(c),m(b))}function m(b){return b===o?(e.exit(c),h(o)):b===null?n(b):_e(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Xe(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===o||b===null||_e(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?p:x)}function p(b){return b===o||b===92?(e.consume(b),x):x(b)}}function Zl(e,t){let n;return a;function a(s){return _e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Ve(s)?Xe(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const m9={name:"definition",tokenize:x9},p9={partial:!0,tokenize:g9};function x9(e,t,n){const a=this;let s;return c;function c(v){return e.enter("definition"),o(v)}function o(v){return Z_.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return s=Cr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return pt(v)?Zl(e,m)(v):m(v)}function m(v){return V_(e,x,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function x(v){return e.attempt(p9,p,p)(v)}function p(v){return Ve(v)?Xe(e,b,"whitespace")(v):b(v)}function b(v){return v===null||_e(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function g9(e,t,n){return a;function a(d){return pt(d)?Zl(e,s)(d):n(d)}function s(d){return F_(e,c,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function c(d){return Ve(d)?Xe(e,o,"whitespace")(d):o(d)}function o(d){return d===null||_e(d)?t(d):n(d)}}const y9={name:"hardBreakEscape",tokenize:b9};function b9(e,t,n){return a;function a(c){return e.enter("hardBreakEscape"),e.consume(c),s}function s(c){return _e(c)?(e.exit("hardBreakEscape"),t(c)):n(c)}}const v9={name:"headingAtx",resolve:k9,tokenize:w9};function k9(e,t){let n=e.length-2,a=3,s,c;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},c={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Wn(e,a,n-a+1,[["enter",s,t],["enter",c,t],["exit",c,t],["exit",s,t]])),e}function w9(e,t,n){let a=0;return s;function s(x){return e.enter("atxHeading"),c(x)}function c(x){return e.enter("atxHeadingSequence"),o(x)}function o(x){return x===35&&a++<6?(e.consume(x),o):x===null||pt(x)?(e.exit("atxHeadingSequence"),d(x)):n(x)}function d(x){return x===35?(e.enter("atxHeadingSequence"),h(x)):x===null||_e(x)?(e.exit("atxHeading"),t(x)):Ve(x)?Xe(e,d,"whitespace")(x):(e.enter("atxHeadingText"),m(x))}function h(x){return x===35?(e.consume(x),h):(e.exit("atxHeadingSequence"),d(x))}function m(x){return x===null||x===35||pt(x)?(e.exit("atxHeadingText"),d(x)):(e.consume(x),m)}}const S9=["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"],pw=["pre","script","style","textarea"],z9={concrete:!0,name:"htmlFlow",resolveTo:N9,tokenize:C9},j9={partial:!0,tokenize:E9},_9={partial:!0,tokenize:T9};function N9(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 C9(e,t,n){const a=this;let s,c,o,d,h;return m;function m(w){return x(w)}function x(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),p}function p(w){return w===33?(e.consume(w),b):w===47?(e.consume(w),c=!0,z):w===63?(e.consume(w),s=3,a.interrupt?t:O):Nn(w)?(e.consume(w),o=String.fromCharCode(w),A):n(w)}function b(w){return w===45?(e.consume(w),s=2,v):w===91?(e.consume(w),s=5,d=0,S):Nn(w)?(e.consume(w),s=4,a.interrupt?t:O):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:O):n(w)}function S(w){const X="CDATA[";return w===X.charCodeAt(d++)?(e.consume(w),d===X.length?a.interrupt?t:le:S):n(w)}function z(w){return Nn(w)?(e.consume(w),o=String.fromCharCode(w),A):n(w)}function A(w){if(w===null||w===47||w===62||pt(w)){const X=w===47,me=o.toLowerCase();return!X&&!c&&pw.includes(me)?(s=1,a.interrupt?t(w):le(w)):S9.includes(o.toLowerCase())?(s=6,X?(e.consume(w),_):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):c?E(w):N(w))}return w===45||bn(w)?(e.consume(w),o+=String.fromCharCode(w),A):n(w)}function _(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function E(w){return Ve(w)?(e.consume(w),E):I(w)}function N(w){return w===47?(e.consume(w),I):w===58||w===95||Nn(w)?(e.consume(w),P):Ve(w)?(e.consume(w),N):I(w)}function P(w){return w===45||w===46||w===58||w===95||bn(w)?(e.consume(w),P):D(w)}function D(w){return w===61?(e.consume(w),M):Ve(w)?(e.consume(w),D):N(w)}function M(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,V):Ve(w)?(e.consume(w),M):U(w)}function V(w){return w===h?(e.consume(w),h=null,K):w===null||_e(w)?n(w):(e.consume(w),V)}function U(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||pt(w)?D(w):(e.consume(w),U)}function K(w){return w===47||w===62||Ve(w)?N(w):n(w)}function I(w){return w===62?(e.consume(w),te):n(w)}function te(w){return w===null||_e(w)?le(w):Ve(w)?(e.consume(w),te):n(w)}function le(w){return w===45&&s===2?(e.consume(w),Z):w===60&&s===1?(e.consume(w),B):w===62&&s===4?(e.consume(w),C):w===63&&s===3?(e.consume(w),O):w===93&&s===5?(e.consume(w),ue):_e(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(j9,H,ne)(w)):w===null||_e(w)?(e.exit("htmlFlowData"),ne(w)):(e.consume(w),le)}function ne(w){return e.check(_9,oe,H)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),se}function se(w){return w===null||_e(w)?ne(w):(e.enter("htmlFlowData"),le(w))}function Z(w){return w===45?(e.consume(w),O):le(w)}function B(w){return w===47?(e.consume(w),o="",Y):le(w)}function Y(w){if(w===62){const X=o.toLowerCase();return pw.includes(X)?(e.consume(w),C):le(w)}return Nn(w)&&o.length<8?(e.consume(w),o+=String.fromCharCode(w),Y):le(w)}function ue(w){return w===93?(e.consume(w),O):le(w)}function O(w){return w===62?(e.consume(w),C):w===45&&s===2?(e.consume(w),O):le(w)}function C(w){return w===null||_e(w)?(e.exit("htmlFlowData"),H(w)):(e.consume(w),C)}function H(w){return e.exit("htmlFlow"),t(w)}}function T9(e,t,n){const a=this;return s;function s(o){return _e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c):n(o)}function c(o){return a.parser.lazy[a.now().line]?n(o):t(o)}}function E9(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(bc,t,n)}}const A9={name:"htmlText",tokenize:O9};function O9(e,t,n){const a=this;let s,c,o;return d;function d(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),D):O===63?(e.consume(O),N):Nn(O)?(e.consume(O),U):n(O)}function m(O){return O===45?(e.consume(O),x):O===91?(e.consume(O),c=0,S):Nn(O)?(e.consume(O),E):n(O)}function x(O){return O===45?(e.consume(O),v):n(O)}function p(O){return O===null?n(O):O===45?(e.consume(O),b):_e(O)?(o=p,B(O)):(e.consume(O),p)}function b(O){return O===45?(e.consume(O),v):p(O)}function v(O){return O===62?Z(O):O===45?b(O):p(O)}function S(O){const C="CDATA[";return O===C.charCodeAt(c++)?(e.consume(O),c===C.length?z:S):n(O)}function z(O){return O===null?n(O):O===93?(e.consume(O),A):_e(O)?(o=z,B(O)):(e.consume(O),z)}function A(O){return O===93?(e.consume(O),_):z(O)}function _(O){return O===62?Z(O):O===93?(e.consume(O),_):z(O)}function E(O){return O===null||O===62?Z(O):_e(O)?(o=E,B(O)):(e.consume(O),E)}function N(O){return O===null?n(O):O===63?(e.consume(O),P):_e(O)?(o=N,B(O)):(e.consume(O),N)}function P(O){return O===62?Z(O):N(O)}function D(O){return Nn(O)?(e.consume(O),M):n(O)}function M(O){return O===45||bn(O)?(e.consume(O),M):V(O)}function V(O){return _e(O)?(o=V,B(O)):Ve(O)?(e.consume(O),V):Z(O)}function U(O){return O===45||bn(O)?(e.consume(O),U):O===47||O===62||pt(O)?K(O):n(O)}function K(O){return O===47?(e.consume(O),Z):O===58||O===95||Nn(O)?(e.consume(O),I):_e(O)?(o=K,B(O)):Ve(O)?(e.consume(O),K):Z(O)}function I(O){return O===45||O===46||O===58||O===95||bn(O)?(e.consume(O),I):te(O)}function te(O){return O===61?(e.consume(O),le):_e(O)?(o=te,B(O)):Ve(O)?(e.consume(O),te):K(O)}function le(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,ne):_e(O)?(o=le,B(O)):Ve(O)?(e.consume(O),le):(e.consume(O),oe)}function ne(O){return O===s?(e.consume(O),s=void 0,se):O===null?n(O):_e(O)?(o=ne,B(O)):(e.consume(O),ne)}function oe(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||pt(O)?K(O):(e.consume(O),oe)}function se(O){return O===47||O===62||pt(O)?K(O):n(O)}function Z(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function B(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return Ve(O)?Xe(e,ue,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):ue(O)}function ue(O){return e.enter("htmlTextData"),o(O)}}const Ug={name:"labelEnd",resolveAll:$9,resolveTo:L9,tokenize:P9},M9={tokenize:U9},D9={tokenize:I9},R9={tokenize:B9};function $9(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&&Wn(e,0,e.length,n),e}function L9(e,t){let n=e.length,a=0,s,c,o,d;for(;n--;)if(s=e[n][1],c){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(c=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(o=n);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[o][1].end}},x={type:"labelText",start:{...e[c+a+2][1].end},end:{...e[o-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=pr(d,e.slice(c+1,c+a+3)),d=pr(d,[["enter",x,t]]),d=pr(d,Jd(t.parser.constructs.insideSpan.null,e.slice(c+a+4,o-3),t)),d=pr(d,[["exit",x,t],e[o-2],e[o-1],["exit",m,t]]),d=pr(d,e.slice(o+1)),d=pr(d,[["exit",h,t]]),Wn(e,c,e.length,d),e}function P9(e,t,n){const a=this;let s=a.events.length,c,o;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){c=a.events[s][1];break}return d;function d(b){return c?c._inactive?p(b):(o=a.parser.defined.includes(Cr(a.sliceSerialize({start:c.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt(M9,x,o?x:p)(b):b===91?e.attempt(D9,x,o?m:p)(b):o?x(b):p(b)}function m(b){return e.attempt(R9,x,p)(b)}function x(b){return t(b)}function p(b){return c._balanced=!0,n(b)}}function U9(e,t,n){return a;function a(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return pt(p)?Zl(e,c)(p):c(p)}function c(p){return p===41?x(p):V_(e,o,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return pt(p)?Zl(e,h)(p):x(p)}function d(p){return n(p)}function h(p){return p===34||p===39||p===40?F_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):x(p)}function m(p){return pt(p)?Zl(e,x)(p):x(p)}function x(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function I9(e,t,n){const a=this;return s;function s(d){return Z_.call(a,e,c,o,"reference","referenceMarker","referenceString")(d)}function c(d){return a.parser.defined.includes(Cr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function o(d){return n(d)}}function B9(e,t,n){return a;function a(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),s}function s(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):n(c)}}const V9={name:"labelStartImage",resolveAll:Ug.resolveAll,tokenize:Z9};function Z9(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),c}function c(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),o):n(d)}function o(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const F9={name:"labelStartLink",resolveAll:Ug.resolveAll,tokenize:H9};function H9(e,t,n){const a=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),c}function c(o){return o===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(o):t(o)}}const rp={name:"lineEnding",tokenize:q9};function q9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Xe(e,t,"linePrefix")}}const pd={name:"thematicBreak",tokenize:G9};function G9(e,t,n){let a=0,s;return c;function c(m){return e.enter("thematicBreak"),o(m)}function o(m){return s=m,d(m)}function d(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||_e(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Ve(m)?Xe(e,d,"whitespace")(m):d(m))}}const In={continuation:{tokenize:X9},exit:W9,name:"list",tokenize:K9},Y9={partial:!0,tokenize:eL},J9={partial:!0,tokenize:Q9};function K9(e,t,n){const a=this,s=a.events[a.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return d;function d(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:kx(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(pd,n,m)(v):m(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return kx(v)&&++o<10?(e.consume(v),h):(!a.interrupt||o<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(bc,a.interrupt?n:x,e.attempt(Y9,b,p))}function x(v){return a.containerState.initialBlankLine=!0,c++,b(v)}function p(v){return Ve(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return a.containerState.size=c+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function X9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(bc,s,c);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Xe(e,t,"listItemIndent",a.containerState.size+1)(d)}function c(d){return a.containerState.furtherBlankLines||!Ve(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,o(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(J9,t,o)(d))}function o(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Xe(e,e.attempt(In,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function Q9(e,t,n){const a=this;return Xe(e,s,"listItemIndent",a.containerState.size+1);function s(c){const o=a.events[a.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===a.containerState.size?t(c):n(c)}}function W9(e){e.exit(this.containerState.type)}function eL(e,t,n){const a=this;return Xe(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const o=a.events[a.events.length-1];return!Ve(c)&&o&&o[1].type==="listItemPrefixWhitespace"?t(c):n(c)}}const xw={name:"setextUnderline",resolveTo:tL,tokenize:nL};function tL(e,t){let n=e.length,a,s,c;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),!c&&e[n][1].type==="definition"&&(c=n);const o={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",c?(e.splice(s,0,["enter",o,t]),e.splice(c+1,0,["exit",e[a][1],t]),e[a][1].end={...e[c][1].end}):e[a][1]=o,e.push(["exit",o,t]),e}function nL(e,t,n){const a=this;let s;return c;function c(m){let x=a.events.length,p;for(;x--;)if(a.events[x][1].type!=="lineEnding"&&a.events[x][1].type!=="linePrefix"&&a.events[x][1].type!=="content"){p=a.events[x][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||p)?(e.enter("setextHeadingLine"),s=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===s?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Ve(m)?Xe(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||_e(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const rL={tokenize:aL};function aL(e){const t=this,n=e.attempt(bc,a,e.attempt(this.parser.constructs.flowInitial,s,Xe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(c9,s)),"linePrefix")));return n;function a(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const iL={resolveAll:q_()},sL=H_("string"),oL=H_("text");function H_(e){return{resolveAll:q_(e==="text"?lL:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],c=n.attempt(s,o,d);return o;function o(x){return m(x)?c(x):d(x)}function d(x){if(x===null){n.consume(x);return}return n.enter("data"),n.consume(x),h}function h(x){return m(x)?(n.exit("data"),c(x)):(n.consume(x),h)}function m(x){if(x===null)return!0;const p=s[x];let b=-1;if(p)for(;++b<p.length;){const v=p[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function q_(e){return t;function t(n,a){let s=-1,c;for(;++s<=n.length;)c===void 0?n[s]&&n[s][1].type==="data"&&(c=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==c+2&&(n[c][1].end=n[s-1][1].end,n.splice(c+2,s-c-2),s=c+2),c=void 0);return e?e(n,a):n}}function lL(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 c=s.length,o=-1,d=0,h;for(;c--;){const m=s[c];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)d++,o--;if(o)break;o=-1}else if(m===-2)h=!0,d++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?o:a.start._bufferIndex+o,_index:a.start._index+c,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const cL={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:P_},uL={91:m9},dL={[-2]:np,[-1]:np,32:np},fL={35:v9,42:pd,45:[xw,pd],60:z9,61:xw,95:pd,96:mw,126:mw},hL={38:I_,92:U_},mL={[-5]:rp,[-4]:rp,[-3]:rp,33:V9,38:I_,42:wx,60:[F6,A9],91:F9,92:[y9,U_],93:Ug,95:wx,96:r9},pL={null:[wx,iL]},xL={null:[42,95]},gL={null:[]},yL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:xL,contentInitial:uL,disable:gL,document:cL,flow:fL,flowInitial:dL,insideSpan:pL,string:hL,text:mL},Symbol.toStringTag,{value:"Module"}));function bL(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={},c=[];let o=[],d=[];const h={attempt:V(D),check:V(M),consume:E,enter:N,exit:P,interrupt:V(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:z,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:p};let x=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function p(te){return o=pr(o,te),A(),o[o.length-1]!==null?[]:(U(t,0),m.events=Jd(c,m.events,m),m.events)}function b(te,le){return kL(v(te),le)}function v(te){return vL(o,te)}function S(){const{_bufferIndex:te,_index:le,line:ne,column:oe,offset:se}=a;return{_bufferIndex:te,_index:le,line:ne,column:oe,offset:se}}function z(te){s[te.line]=te.column,I()}function A(){let te;for(;a._index<o.length;){const le=o[a._index];if(typeof le=="string")for(te=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===te&&a._bufferIndex<le.length;)_(le.charCodeAt(a._bufferIndex));else _(le)}}function _(te){x=x(te)}function E(te){_e(te)?(a.line++,a.column=1,a.offset+=te===-3?2:1,I()):te!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=te}function N(te,le){const ne=le||{};return ne.type=te,ne.start=S(),m.events.push(["enter",ne,m]),d.push(ne),ne}function P(te){const le=d.pop();return le.end=S(),m.events.push(["exit",le,m]),le}function D(te,le){U(te,le.from)}function M(te,le){le.restore()}function V(te,le){return ne;function ne(oe,se,Z){let B,Y,ue,O;return Array.isArray(oe)?H(oe):"tokenize"in oe?H([oe]):C(oe);function C(pe){return ge;function ge(Pe){const Ee=Pe!==null&&pe[Pe],yt=Pe!==null&&pe.null,$=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(yt)?yt:yt?[yt]:[]];return H($)(Pe)}}function H(pe){return B=pe,Y=0,pe.length===0?Z:w(pe[Y])}function w(pe){return ge;function ge(Pe){return O=K(),ue=pe,pe.partial||(m.currentConstruct=pe),pe.name&&m.parser.constructs.disable.null.includes(pe.name)?me():pe.tokenize.call(le?Object.assign(Object.create(m),le):m,h,X,me)(Pe)}}function X(pe){return te(ue,O),se}function me(pe){return O.restore(),++Y<B.length?w(B[Y]):Z}}}function U(te,le){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Wn(m.events,le,m.events.length-le,te.resolve(m.events.slice(le),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function K(){const te=S(),le=m.previous,ne=m.currentConstruct,oe=m.events.length,se=Array.from(d);return{from:oe,restore:Z};function Z(){a=te,m.previous=le,m.currentConstruct=ne,m.events.length=oe,d=se,I()}}function I(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function vL(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,c=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(a,c)];else{if(o=e.slice(n,s),a>-1){const d=o[0];typeof d=="string"?o[0]=d.slice(a):o.shift()}c>0&&o.push(e[s].slice(0,c))}return o}function kL(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const c=e[n];let o;if(typeof c=="string")o=c;else switch(c){case-5:{o="\r";break}case-4:{o=`
|
|
24
|
+
`;break}case-3:{o=`\r
|
|
25
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(c)}s=c===-2,a.push(o)}return a.join("")}function wL(e){const a={constructs:$_([yL,...(e||{}).extensions||[]]),content:s(L6),defined:[],document:s(U6),flow:s(rL),lazy:{},string:s(sL),text:s(oL)};return a;function s(c){return o;function o(d){return bL(a,c,d)}}}function SL(e){for(;!B_(e););return e}const gw=/[\0\t\n\r]/g;function zL(){let e=1,t="",n=!0,a;return s;function s(c,o,d){const h=[];let m,x,p,b,v;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(o||void 0).decode(c)),p=0,t="",n&&(c.charCodeAt(0)===65279&&p++,n=void 0);p<c.length;){if(gw.lastIndex=p,m=gw.exec(c),b=m&&m.index!==void 0?m.index:c.length,v=c.charCodeAt(b),!m){t=c.slice(p);break}if(v===10&&p===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),p<b&&(h.push(c.slice(p,b)),e+=b-p),v){case 0:{h.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,h.push(-2);e++<x;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}p=b+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const jL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _L(e){return e.replace(jL,NL)}function NL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),c=s===120||s===88;return L_(n.slice(c?2:1),c?16:10)}return Pg(n)||e}const G_={}.hasOwnProperty;function CL(e,t,n){return typeof t!="string"&&(n=t,t=void 0),TL(n)(SL(wL(n).document().write(zL()(e,t,!0))))}function TL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(lt),autolinkProtocol:K,autolinkEmail:K,atxHeading:c(St),blockQuote:c(yt),characterEscape:K,characterReference:K,codeFenced:c($),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:c($,o),codeText:c(Oe,o),codeTextData:K,data:K,codeFlowValue:K,definition:c(Ue),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:c(Je),hardBreakEscape:c(Ze),hardBreakTrailing:c(Ze),htmlFlow:c(rt,o),htmlFlowData:K,htmlText:c(rt,o),htmlTextData:K,image:c(ft),label:o,link:c(lt),listItem:c(nr),listItemValue:b,listOrdered:c(rn,p),listUnordered:c(rn),paragraph:c($t),reference:w,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:c(St),strong:c(Kt),thematicBreak:c(Qi)},exit:{atxHeading:h(),atxHeadingSequence:D,autolink:h(),autolinkEmail:Ee,autolinkProtocol:Pe,blockQuote:h(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:pe,characterReference:ge,codeFenced:h(A),codeFencedFence:z,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:I,codeIndented:h(_),codeText:h(se),codeTextData:I,data:I,definition:h(),definitionDestinationString:P,definitionLabelString:E,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ne),htmlFlowData:I,htmlText:h(oe),htmlTextData:I,image:h(B),label:ue,labelText:Y,lineEnding:te,link:h(Z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:X,resourceDestinationString:O,resourceTitleString:C,resource:H,setextHeading:h(U),setextHeadingLineSequence:V,setextHeadingText:M,strong:h(),thematicBreak:h()}};Y_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ee){let fe={type:"root",children:[]};const we={stack:[fe],tokenStack:[],config:t,enter:d,exit:m,buffer:o,resume:x,data:n},Ce=[];let Ke=-1;for(;++Ke<ee.length;)if(ee[Ke][1].type==="listOrdered"||ee[Ke][1].type==="listUnordered")if(ee[Ke][0]==="enter")Ce.push(Ke);else{const kn=Ce.pop();Ke=s(ee,kn,Ke)}for(Ke=-1;++Ke<ee.length;){const kn=t[ee[Ke][0]];G_.call(kn,ee[Ke][1].type)&&kn[ee[Ke][1].type].call(Object.assign({sliceSerialize:ee[Ke][2].sliceSerialize},we),ee[Ke][1])}if(we.tokenStack.length>0){const kn=we.tokenStack[we.tokenStack.length-1];(kn[1]||yw).call(we,void 0,kn[0])}for(fe.position={start:Ha(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:Ha(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)fe=t.transforms[Ke](fe)||fe;return fe}function s(ee,fe,we){let Ce=fe-1,Ke=-1,kn=!1,Fn,wn,Xt,An;for(;++Ce<=we;){const ht=ee[Ce];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?Ke++:Ke--,An=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(Fn&&!An&&!Ke&&!Xt&&(Xt=Ce),An=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:An=void 0}if(!Ke&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||Ke===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(Fn){let ya=Ce;for(wn=void 0;ya--;){const kr=ee[ya];if(kr[1].type==="lineEnding"||kr[1].type==="lineEndingBlank"){if(kr[0]==="exit")continue;wn&&(ee[wn][1].type="lineEndingBlank",kn=!0),kr[1].type="lineEnding",wn=ya}else if(!(kr[1].type==="linePrefix"||kr[1].type==="blockQuotePrefix"||kr[1].type==="blockQuotePrefixWhitespace"||kr[1].type==="blockQuoteMarker"||kr[1].type==="listItemIndent"))break}Xt&&(!wn||Xt<wn)&&(Fn._spread=!0),Fn.end=Object.assign({},wn?ee[wn][1].start:ht[1].end),ee.splice(wn||Ce,0,["exit",Fn,ht[2]]),Ce++,we++}if(ht[1].type==="listItemPrefix"){const ya={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};Fn=ya,ee.splice(Ce,0,["enter",ya,ht[2]]),Ce++,we++,Xt=void 0,An=!0}}}return ee[fe][1]._spread=kn,we}function c(ee,fe){return we;function we(Ce){d.call(this,ee(Ce),Ce),fe&&fe.call(this,Ce)}}function o(){this.stack.push({type:"fragment",children:[]})}function d(ee,fe,we){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([fe,we||void 0]),ee.position={start:Ha(fe.start),end:void 0}}function h(ee){return fe;function fe(we){ee&&ee.call(this,we),m.call(this,we)}}function m(ee,fe){const we=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==ee.type&&(fe?fe.call(this,ee,Ce[0]):(Ce[1]||yw).call(this,ee,Ce[0]));else throw new Error("Cannot close `"+ee.type+"` ("+Vl({start:ee.start,end:ee.end})+"): it’s not open");we.position.end=Ha(ee.end)}function x(){return Lg(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(ee){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=ee}function S(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=ee}function z(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee.replace(/(\r?\n|\r)$/g,"")}function E(ee){const fe=this.resume(),we=this.stack[this.stack.length-1];we.label=fe,we.identifier=Cr(this.sliceSerialize(ee)).toLowerCase()}function N(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.title=ee}function P(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.url=ee}function D(ee){const fe=this.stack[this.stack.length-1];if(!fe.depth){const we=this.sliceSerialize(ee).length;fe.depth=we}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function V(ee){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function K(ee){const we=this.stack[this.stack.length-1].children;let Ce=we[we.length-1];(!Ce||Ce.type!=="text")&&(Ce=bt(),Ce.position={start:Ha(ee.start),end:void 0},we.push(Ce)),this.stack.push(Ce)}function I(ee){const fe=this.stack.pop();fe.value+=this.sliceSerialize(ee),fe.position.end=Ha(ee.end)}function te(ee){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=fe.children[fe.children.length-1];we.position.end=Ha(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(K.call(this,ee),I.call(this,ee))}function le(){this.data.atHardBreak=!0}function ne(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee}function oe(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee}function se(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee}function Z(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=fe,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function B(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=fe,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function Y(ee){const fe=this.sliceSerialize(ee),we=this.stack[this.stack.length-2];we.label=_L(fe),we.identifier=Cr(fe).toLowerCase()}function ue(){const ee=this.stack[this.stack.length-1],fe=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ce=ee.children;we.children=Ce}else we.alt=fe}function O(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.url=ee}function C(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.title=ee}function H(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function X(ee){const fe=this.resume(),we=this.stack[this.stack.length-1];we.label=fe,we.identifier=Cr(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function me(ee){this.data.characterReferenceType=ee.type}function pe(ee){const fe=this.sliceSerialize(ee),we=this.data.characterReferenceType;let Ce;we?(Ce=L_(fe,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Pg(fe);const Ke=this.stack[this.stack.length-1];Ke.value+=Ce}function ge(ee){const fe=this.stack.pop();fe.position.end=Ha(ee.end)}function Pe(ee){I.call(this,ee);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(ee)}function Ee(ee){I.call(this,ee);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(ee)}function yt(){return{type:"blockquote",children:[]}}function $(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Je(){return{type:"emphasis",children:[]}}function St(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function rt(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function lt(){return{type:"link",title:null,url:"",children:[]}}function rn(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function nr(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function $t(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function bt(){return{type:"text",value:""}}function Qi(){return{type:"thematicBreak"}}}function Ha(e){return{line:e.line,column:e.column,offset:e.offset}}function Y_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?Y_(e,a):EL(e,a)}}function EL(e,t){let n;for(n in t)if(G_.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 yw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vl({start:t.start,end:t.end})+") is still open")}function AL(e){const t=this;t.parser=n;function n(a){return CL(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function OL(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 ML(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
26
|
+
`}]}function DL(e,t){const n=t.value?t.value+`
|
|
27
|
+
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let c={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function RL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $L(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=zo(a.toLowerCase()),c=e.footnoteOrder.indexOf(a);let o,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),o=e.footnoteOrder.length):o=c+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function PL(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 UL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function J_(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),c=s[0];c&&c.type==="text"?c.value="["+c.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=a:s.push({type:"text",value:a}),s}function IL(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return J_(e,t);const s={src:zo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const c={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,c),e.applyData(t,c)}function BL(e,t){const n={src:zo(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 VL(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 ZL(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return J_(e,t);const s={href:zo(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const c={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function FL(e,t){const n={href:zo(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 HL(e,t,n){const a=e.all(t),s=n?qL(n):K_(t),c={},o=[];if(typeof t.checked=="boolean"){const x=a[0];let p;x&&x.type==="element"&&x.tagName==="p"?p=x:(p={type:"element",tagName:"p",properties:{},children:[]},a.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const x=a[d];(s||d!==0||x.type!=="element"||x.tagName!=="p")&&o.push({type:"text",value:`
|
|
28
|
+
`}),x.type==="element"&&x.tagName==="p"&&!s?o.push(...x.children):o.push(x)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
|
|
29
|
+
`});const m={type:"element",tagName:"li",properties:c,children:o};return e.patch(t,m),e.applyData(t,m)}function qL(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 GL(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 o=a[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,c),e.applyData(t,c)}function YL(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JL(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function KL(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XL(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Mg(t.children[1]),h=T_(t.children[t.children.length-1]);d&&h&&(o.position={start:d,end:h}),s.push(o)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)}function QL(e,t,n){const a=n?n.children:void 0,c=(a?a.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,d=o?o.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const p=t.children[h],b={},v=o?o[h]:void 0;v&&(b.align=v);let S={type:"element",tagName:c,properties:b,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),m.push(S)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,x),e.applyData(t,x)}function WL(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const bw=9,vw=32;function e8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const c=[];for(;a;)c.push(kw(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return c.push(kw(t.slice(s),s>0,!1)),c.join("")}function kw(e,t,n){let a=0,s=e.length;if(t){let c=e.codePointAt(a);for(;c===bw||c===vw;)a++,c=e.codePointAt(a)}if(n){let c=e.codePointAt(s-1);for(;c===bw||c===vw;)s--,c=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function t8(e,t){const n={type:"text",value:e8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function n8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const r8={blockquote:OL,break:ML,code:DL,delete:RL,emphasis:$L,footnoteReference:LL,heading:PL,html:UL,imageReference:IL,image:BL,inlineCode:VL,linkReference:ZL,link:FL,listItem:HL,list:GL,paragraph:YL,root:JL,strong:KL,table:XL,tableCell:WL,tableRow:QL,text:t8,thematicBreak:n8,toml:Hu,yaml:Hu,definition:Hu,footnoteDefinition:Hu};function Hu(){}const X_=-1,Kd=0,Fl=1,Cd=2,Ig=3,Bg=4,Vg=5,Zg=6,Q_=7,W_=8,ww=typeof self=="object"?self:globalThis,a8=(e,t)=>{const n=(s,c)=>(e.set(c,s),s),a=s=>{if(e.has(s))return e.get(s);const[c,o]=t[s];switch(c){case Kd:case X_:return n(o,s);case Fl:{const d=n([],s);for(const h of o)d.push(a(h));return d}case Cd:{const d=n({},s);for(const[h,m]of o)d[a(h)]=a(m);return d}case Ig:return n(new Date(o),s);case Bg:{const{source:d,flags:h}=o;return n(new RegExp(d,h),s)}case Vg:{const d=n(new Map,s);for(const[h,m]of o)d.set(a(h),a(m));return d}case Zg:{const d=n(new Set,s);for(const h of o)d.add(a(h));return d}case Q_:{const{name:d,message:h}=o;return n(new ww[d](h),s)}case W_:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:d}=new Uint8Array(o);return n(new DataView(d),o)}}return n(new ww[c](o),s)};return a},Sw=e=>a8(new Map,e)(0),Is="",{toString:i8}={},{keys:s8}=Object,El=e=>{const t=typeof e;if(t!=="object"||!e)return[Kd,t];const n=i8.call(e).slice(8,-1);switch(n){case"Array":return[Fl,Is];case"Object":return[Cd,Is];case"Date":return[Ig,Is];case"RegExp":return[Bg,Is];case"Map":return[Vg,Is];case"Set":return[Zg,Is];case"DataView":return[Fl,n]}return n.includes("Array")?[Fl,n]:n.includes("Error")?[Q_,n]:[Cd,n]},qu=([e,t])=>e===Kd&&(t==="function"||t==="symbol"),o8=(e,t,n,a)=>{const s=(o,d)=>{const h=a.push(o)-1;return n.set(d,h),h},c=o=>{if(n.has(o))return n.get(o);let[d,h]=El(o);switch(d){case Kd:{let x=o;switch(h){case"bigint":d=W_,x=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);x=null;break;case"undefined":return s([X_],o)}return s([d,x],o)}case Fl:{if(h){let b=o;return h==="DataView"?b=new Uint8Array(o.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(o)),s([h,[...b]],o)}const x=[],p=s([d,x],o);for(const b of o)x.push(c(b));return p}case Cd:{if(h)switch(h){case"BigInt":return s([h,o.toString()],o);case"Boolean":case"Number":case"String":return s([h,o.valueOf()],o)}if(t&&"toJSON"in o)return c(o.toJSON());const x=[],p=s([d,x],o);for(const b of s8(o))(e||!qu(El(o[b])))&&x.push([c(b),c(o[b])]);return p}case Ig:return s([d,o.toISOString()],o);case Bg:{const{source:x,flags:p}=o;return s([d,{source:x,flags:p}],o)}case Vg:{const x=[],p=s([d,x],o);for(const[b,v]of o)(e||!(qu(El(b))||qu(El(v))))&&x.push([c(b),c(v)]);return p}case Zg:{const x=[],p=s([d,x],o);for(const b of o)(e||!qu(El(b)))&&x.push(c(b));return p}}const{message:m}=o;return s([d,{name:h,message:m}],o)};return c},zw=(e,{json:t,lossy:n}={})=>{const a=[];return o8(!(t||n),!!t,new Map,a)(e),a},Td=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Sw(zw(e,t)):structuredClone(e):(e,t)=>Sw(zw(e,t));function l8(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 c8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function u8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||l8,a=e.options.footnoteBackLabel||c8,s=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const x=e.all(m),p=String(m.identifier).toUpperCase(),b=zo(p.toLowerCase());let v=0;const S=[],z=e.footnoteCounts.get(p);for(;z!==void 0&&++v<=z;){S.length>0&&S.push({type:"text",value:" "});let E=typeof n=="string"?n:n(h,v);typeof E=="string"&&(E={type:"text",value:E}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const A=x[x.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const E=A.children[A.children.length-1];E&&E.type==="text"?E.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...S)}else x.push(...S);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(x,!0)};e.patch(m,_),d.push(_)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Td(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
30
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
31
|
+
`}]}}const Xd=(function(e){if(e==null)return m8;if(typeof e=="function")return Qd(e);if(typeof e=="object")return Array.isArray(e)?d8(e):f8(e);if(typeof e=="string")return h8(e);throw new Error("Expected function, string, or object as test")});function d8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xd(e[n]);return Qd(a);function a(...s){let c=-1;for(;++c<t.length;)if(t[c].apply(this,s))return!0;return!1}}function f8(e){const t=e;return Qd(n);function n(a){const s=a;let c;for(c in e)if(s[c]!==t[c])return!1;return!0}}function h8(e){return Qd(t);function t(n){return n&&n.type===e}}function Qd(e){return t;function t(n,a,s){return!!(p8(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function m8(){return!0}function p8(e){return e!==null&&typeof e=="object"&&"type"in e}const e2=[],x8=!0,Sx=!1,g8="skip";function t2(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const c=Xd(s),o=a?-1:1;d(e,void 0,[])();function d(h,m,x){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=e2,S,z,A;if((!t||c(h,m,x[x.length-1]||void 0))&&(v=y8(n(h,x)),v[0]===Sx))return v;if("children"in h&&h.children){const _=h;if(_.children&&v[0]!==g8)for(z=(a?_.children.length:-1)+o,A=x.concat(_);z>-1&&z<_.children.length;){const E=_.children[z];if(S=d(E,z,A)(),S[0]===Sx)return S;z=typeof S[1]=="number"?S[1]:z+o}}return v}}}function y8(e){return Array.isArray(e)?e:typeof e=="number"?[x8,e]:e==null?e2:[e]}function Fg(e,t,n,a){let s,c,o;typeof t=="function"&&typeof n!="function"?(c=void 0,o=t,s=n):(c=t,o=n,s=a),t2(e,c,d,s);function d(h,m){const x=m[m.length-1],p=x?x.children.indexOf(h):void 0;return o(h,p,x)}}const zx={}.hasOwnProperty,b8={};function v8(e,t){const n=t||b8,a=new Map,s=new Map,c=new Map,o={...r8,...n.handlers},d={all:m,applyData:w8,definitionById:a,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:o,one:h,options:n,patch:k8,wrap:z8};return Fg(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const p=x.type==="definition"?a:s,b=String(x.identifier).toUpperCase();p.has(b)||p.set(b,x)}}),d;function h(x,p){const b=x.type,v=d.handlers[b];if(zx.call(d.handlers,b)&&v)return v(d,x,p);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in x){const{children:z,...A}=x,_=Td(A);return _.children=d.all(x),_}return Td(x)}return(d.options.unknownHandler||S8)(d,x,p)}function m(x){const p=[];if("children"in x){const b=x.children;let v=-1;for(;++v<b.length;){const S=d.one(b[v],x);if(S){if(v&&b[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=jw(S.value)),!Array.isArray(S)&&S.type==="element")){const z=S.children[0];z&&z.type==="text"&&(z.value=jw(z.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function k8(e,t){e.position&&(t.position=c6(e))}function w8(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,c=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const o="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:o}}n.type==="element"&&c&&Object.assign(n.properties,Td(c)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function S8(e,t){const n=t.data||{},a="value"in t&&!(zx.call(n,"hProperties")||zx.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 z8(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
32
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
33
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
34
|
+
`}),n}function jw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _w(e,t){const n=v8(e,t),a=n.one(e,void 0),s=u8(n),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
|
|
35
|
+
`},s),c}function j8(e,t){return e&&"run"in e?async function(n,a){const s=_w(n,{file:a,...t});await e.run(s,a)}:function(n,a){return _w(n,{file:a,...e||t})}}function Nw(e){if(e)throw e}var ap,Cw;function _8(){if(Cw)return ap;Cw=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]"},c=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var x=e.call(m,"constructor"),p=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!x&&!p)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},o=function(m,x){n&&x.name==="__proto__"?n(m,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):m[x.name]=x.newValue},d=function(m,x){if(x==="__proto__")if(e.call(m,x)){if(a)return a(m,x).value}else return;return m[x]};return ap=function h(){var m,x,p,b,v,S,z=arguments[0],A=1,_=arguments.length,E=!1;for(typeof z=="boolean"&&(E=z,z=arguments[1]||{},A=2),(z==null||typeof z!="object"&&typeof z!="function")&&(z={});A<_;++A)if(m=arguments[A],m!=null)for(x in m)p=d(z,x),b=d(m,x),z!==b&&(E&&b&&(c(b)||(v=s(b)))?(v?(v=!1,S=p&&s(p)?p:[]):S=p&&c(p)?p:{},o(z,{name:x,newValue:h(E,S,b)})):typeof b<"u"&&o(z,{name:x,newValue:b}));return z},ap}var N8=_8();const ip=Rx(N8);function jx(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 C8(){const e=[],t={run:n,use:a};return t;function n(...s){let c=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);d(null,...s);function d(h,...m){const x=e[++c];let p=-1;if(h){o(h);return}for(;++p<s.length;)(m[p]===null||m[p]===void 0)&&(m[p]=s[p]);s=m,x?T8(x,d)(...m):o(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 T8(e,t){let n;return a;function a(...o){const d=e.length>o.length;let h;d&&o.push(s);try{h=e.apply(this,o)}catch(m){const x=m;if(d&&n)throw x;return s(x)}d||(h&&h.then&&typeof h.then=="function"?h.then(c,s):h instanceof Error?s(h):c(h))}function s(o,...d){n||(n=!0,t(o,...d))}function c(o){s(null,o)}}const $r={basename:E8,dirname:A8,extname:O8,join:M8,sep:"/"};function E8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vc(e);let n=0,a=-1,s=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(c){n=s+1;break}}else a<0&&(c=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let o=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(c){n=s+1;break}}else o<0&&(c=!0,o=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=o));return n===a?a=o:a<0&&(a=e.length),e.slice(n,a)}function A8(e){if(vc(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 O8(e){vc(e);let t=e.length,n=-1,a=0,s=-1,c=0,o;for(;t--;){const d=e.codePointAt(t);if(d===47){if(o){a=t+1;break}continue}n<0&&(o=!0,n=t+1),d===46?s<0?s=t:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||n<0||c===0||c===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function M8(...e){let t=-1,n;for(;++t<e.length;)vc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":D8(n)}function D8(e){vc(e);const t=e.codePointAt(0)===47;let n=R8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function R8(e,t){let n="",a=0,s=-1,c=0,o=-1,d,h;for(;++o<=e.length;){if(o<e.length)d=e.codePointAt(o);else{if(d===47)break;d=47}if(d===47){if(!(s===o-1||c===1))if(s!==o-1&&c===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=o,c=0;continue}}else if(n.length>0){n="",a=0,s=o,c=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),a=o-s-1;s=o,c=0}else d===46&&c>-1?c++:c=-1}return n}function vc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $8={cwd:L8};function L8(){return"/"}function _x(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function P8(e){if(typeof e=="string")e=new URL(e);else if(!_x(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 U8(e)}function U8(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 sp=["history","path","basename","stem","extname","dirname"];class n2{constructor(t){let n;t?_x(t)?n={path:t}:typeof t=="string"||I8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<sp.length;){const c=sp[a];c in n&&n[c]!==void 0&&n[c]!==null&&(this[c]=c==="history"?[...n[c]]:n[c])}let s;for(s in n)sp.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?$r.basename(this.path):void 0}set basename(t){lp(t,"basename"),op(t,"basename"),this.path=$r.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$r.dirname(this.path):void 0}set dirname(t){Tw(this.basename,"dirname"),this.path=$r.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$r.extname(this.path):void 0}set extname(t){if(op(t,"extname"),Tw(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=$r.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_x(t)&&(t=P8(t)),lp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$r.basename(this.path,this.extname):void 0}set stem(t){lp(t,"stem"),op(t,"stem"),this.path=$r.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 vn(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 op(e,t){if(e&&e.includes($r.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$r.sep+"`")}function lp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Tw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function I8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const B8=(function(e){const a=this.constructor.prototype,s=a[e],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),V8={}.hasOwnProperty;class Hg extends B8{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=C8()}copy(){const t=new Hg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(ip(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(dp("data",this.frozen),this.namespace[t]=n,this):V8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dp("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=Gu(t),a=this.parser||this.Parser;return cp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),cp("process",this.parser||this.Parser),up("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(c,o){const d=Gu(t),h=a.parse(d);a.run(h,d,function(x,p,b){if(x||!p||!b)return m(x);const v=p,S=a.stringify(v,b);H8(S)?b.value=S:b.result=S,m(x,b)});function m(x,p){x||!p?o(x):c?c(p):n(void 0,p)}}}processSync(t){let n=!1,a;return this.freeze(),cp("processSync",this.parser||this.Parser),up("processSync",this.compiler||this.Compiler),this.process(t,s),Aw("processSync","process",n),a;function s(c,o){n=!0,Nw(c),a=o}}run(t,n,a){Ew(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?c(void 0,a):new Promise(c);function c(o,d){const h=Gu(n);s.run(t,h,m);function m(x,p,b){const v=p||t;x?d(x):o?o(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,s;return this.run(t,n,c),Aw("runSync","run",a),s;function c(o,d){Nw(o),s=d,a=!0}}stringify(t,n){this.freeze();const a=Gu(n),s=this.compiler||this.Compiler;return up("stringify",s),Ew(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(dp("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[x,...p]=m;h(x,p)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(m.plugins),m.settings&&(s.settings=ip(!0,s.settings,m.settings))}function d(m){let x=-1;if(m!=null)if(Array.isArray(m))for(;++x<m.length;){const p=m[x];c(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,x){let p=-1,b=-1;for(;++p<a.length;)if(a[p][0]===m){b=p;break}if(b===-1)a.push([m,...x]);else if(x.length>0){let[v,...S]=x;const z=a[b][1];jx(z)&&jx(v)&&(v=ip(!0,z,v)),a[b]=[m,v,...S]}}}}const Z8=new Hg().freeze();function cp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function up(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dp(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 Ew(e){if(!jx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Aw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gu(e){return F8(e)?e:new n2(e)}function F8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function H8(e){return typeof e=="string"||q8(e)}function q8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const G8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ow=[],Mw={allowDangerousHtml:!0},Y8=/^(https?|ircs?|mailto|xmpp)$/i,J8=[{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 K8(e){const t=X8(e),n=Q8(e);return W8(t.runSync(t.parse(n),n),e)}function X8(e){const t=e.rehypePlugins||Ow,n=e.remarkPlugins||Ow,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mw}:Mw;return Z8().use(AL).use(n).use(j8,a).use(t)}function Q8(e){const t=e.children||"",n=new n2;return typeof t=="string"&&(n.value=t),n}function W8(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,c=t.disallowedElements,o=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||eP;for(const x of J8)Object.hasOwn(t,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+G8+x.id,void 0);return Fg(e,m),m6(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(x,p,b){if(x.type==="raw"&&b&&typeof p=="number")return o?b.children.splice(p,1):b.children[p]={type:"text",value:x.value},p;if(x.type==="element"){let v;for(v in tp)if(Object.hasOwn(tp,v)&&Object.hasOwn(x.properties,v)){const S=x.properties[v],z=tp[v];(z===null||z.includes(x.tagName))&&(x.properties[v]=h(String(S||""),v,x))}}if(x.type==="element"){let v=n?!n.includes(x.tagName):c?c.includes(x.tagName):!1;if(!v&&a&&typeof p=="number"&&(v=!a(x,p,b)),v&&b&&typeof p=="number")return d&&x.children?b.children.splice(p,1,...x.children):b.children.splice(p,1),p}}}function eP(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||Y8.test(e.slice(0,t))?e:""}function Dw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function tP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nP(e,t,n){const s=Xd((n||{}).ignore||[]),c=rP(t);let o=-1;for(;++o<c.length;)t2(e,"text",d);function d(m,x){let p=-1,b;for(;++p<x.length;){const v=x[p],S=b?b.children:void 0;if(s(v,S?S.indexOf(v):void 0,b))return;b=v}if(b)return h(m,x)}function h(m,x){const p=x[x.length-1],b=c[o][0],v=c[o][1];let S=0;const A=p.children.indexOf(m);let _=!1,E=[];b.lastIndex=0;let N=b.exec(m.value);for(;N;){const P=N.index,D={index:N.index,input:N.input,stack:[...x,m]};let M=v(...N,D);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?b.lastIndex=P+1:(S!==P&&E.push({type:"text",value:m.value.slice(S,P)}),Array.isArray(M)?E.push(...M):M&&E.push(M),S=P+N[0].length,_=!0),!b.global)break;N=b.exec(m.value)}return _?(S<m.value.length&&E.push({type:"text",value:m.value.slice(S)}),p.children.splice(A,1,...E)):E=[m],A+E.length}}function rP(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const s=n[a];t.push([aP(s[0]),iP(s[1])])}return t}function aP(e){return typeof e=="string"?new RegExp(tP(e),"g"):e}function iP(e){return typeof e=="function"?e:function(){return e}}const fp="phrasing",hp=["autolink","link","image","label"];function sP(){return{transforms:[hP],enter:{literalAutolink:lP,literalAutolinkEmail:mp,literalAutolinkHttp:mp,literalAutolinkWww:mp},exit:{literalAutolink:fP,literalAutolinkEmail:dP,literalAutolinkHttp:cP,literalAutolinkWww:uP}}}function oP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fp,notInConstruct:hp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fp,notInConstruct:hp},{character:":",before:"[ps]",after:"\\/",inConstruct:fp,notInConstruct:hp}]}}function lP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mp(e){this.config.enter.autolinkProtocol.call(this,e)}function cP(e){this.config.exit.autolinkProtocol.call(this,e)}function uP(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function dP(e){this.config.exit.autolinkEmail.call(this,e)}function fP(e){this.exit(e)}function hP(e){nP(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,mP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),pP]],{ignore:["link","linkReference"]})}function mP(e,t,n,a,s){let c="";if(!r2(s)||(/^w/i.test(t)&&(n=t+n,t="",c="http://"),!xP(n)))return!1;const o=gP(n+a);if(!o[0])return!1;const d={type:"link",title:null,url:c+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[d,{type:"text",value:o[1]}]:d}function pP(e,t,n,a){return!r2(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gP(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=Dw(e,"(");let c=Dw(e,")");for(;a!==-1&&s>c;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),c++;return[e,n]}function r2(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fi(n)||Yd(n))&&(!t||n!==47)}a2.peek=_P;function yP(){this.buffer()}function bP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vP(){this.buffer()}function kP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function wP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function SP(e){this.exit(e)}function zP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jP(e){this.exit(e)}function _P(){return"["}function a2(e,t,n,a){const s=n.createTracker(a);let c=s.move("[^");const o=n.enter("footnoteReference"),d=n.enter("reference");return c+=s.move(n.safe(n.associationId(e),{after:"]",before:c})),d(),o(),c+=s.move("]"),c}function NP(){return{enter:{gfmFootnoteCallString:yP,gfmFootnoteCall:bP,gfmFootnoteDefinitionLabelString:vP,gfmFootnoteDefinition:kP},exit:{gfmFootnoteCallString:wP,gfmFootnoteCall:SP,gfmFootnoteDefinitionLabelString:zP,gfmFootnoteDefinition:jP}}}function CP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:a2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,c,o){const d=c.createTracker(o);let h=d.move("[^");const m=c.enter("footnoteDefinition"),x=c.enter("label");return h+=d.move(c.safe(c.associationId(a),{before:h,after:"]"})),x(),h+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),h+=d.move((t?`
|
|
36
|
+
`:" ")+c.indentLines(c.containerFlow(a,d.current()),t?i2:TP))),m(),h}}function TP(e,t,n){return t===0?e:i2(e,t,n)}function i2(e,t,n){return(n?"":" ")+e}const EP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];s2.peek=RP;function AP(){return{canContainEols:["delete"],enter:{strikethrough:MP},exit:{strikethrough:DP}}}function OP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EP}],handlers:{delete:s2}}}function MP(e){this.enter({type:"delete",children:[]},e)}function DP(e){this.exit(e)}function s2(e,t,n,a){const s=n.createTracker(a),c=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),c(),o}function RP(){return"~"}function $P(e){return e.length}function LP(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||$P,c=[],o=[],d=[],h=[];let m=0,x=-1;for(;++x<e.length;){const z=[],A=[];let _=-1;for(e[x].length>m&&(m=e[x].length);++_<e[x].length;){const E=PP(e[x][_]);if(n.alignDelimiters!==!1){const N=s(E);A[_]=N,(h[_]===void 0||N>h[_])&&(h[_]=N)}z.push(E)}o[x]=z,d[x]=A}let p=-1;if(typeof a=="object"&&"length"in a)for(;++p<m;)c[p]=Rw(a[p]);else{const z=Rw(a);for(;++p<m;)c[p]=z}p=-1;const b=[],v=[];for(;++p<m;){const z=c[p];let A="",_="";z===99?(A=":",_=":"):z===108?A=":":z===114&&(_=":");let E=n.alignDelimiters===!1?1:Math.max(1,h[p]-A.length-_.length);const N=A+"-".repeat(E)+_;n.alignDelimiters!==!1&&(E=A.length+E+_.length,E>h[p]&&(h[p]=E),v[p]=E),b[p]=N}o.splice(1,0,b),d.splice(1,0,v),x=-1;const S=[];for(;++x<o.length;){const z=o[x],A=d[x];p=-1;const _=[];for(;++p<m;){const E=z[p]||"";let N="",P="";if(n.alignDelimiters!==!1){const D=h[p]-(A[p]||0),M=c[p];M===114?N=" ".repeat(D):M===99?D%2?(N=" ".repeat(D/2+.5),P=" ".repeat(D/2-.5)):(N=" ".repeat(D/2),P=N):P=" ".repeat(D)}n.delimiterStart!==!1&&!p&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||p)&&_.push(" "),n.alignDelimiters!==!1&&_.push(N),_.push(E),n.alignDelimiters!==!1&&_.push(P),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||p!==m-1)&&_.push("|")}S.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return S.join(`
|
|
37
|
+
`)}function PP(e){return e==null?"":String(e)}function Rw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function UP(e,t,n,a){const s=n.enter("blockquote"),c=n.createTracker(a);c.move("> "),c.shift(2);const o=n.indentLines(n.containerFlow(e,c.current()),IP);return s(),o}function IP(e,t,n){return">"+(n?"":" ")+e}function BP(e,t){return $w(e,t.inConstruct,!0)&&!$w(e,t.notInConstruct,!1)}function $w(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Lw(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
38
|
+
`&&BP(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
39
|
+
`}function VP(e,t){const n=String(e);let a=n.indexOf(t),s=a,c=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++c>o&&(o=c):c=1,s=a+t.length,a=n.indexOf(t,s);return o}function ZP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function FP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function HP(e,t,n,a){const s=FP(n),c=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(ZP(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(c,qP);return p(),b}const d=n.createTracker(a),h=s.repeat(Math.max(VP(c,s)+1,3)),m=n.enter("codeFenced");let x=d.move(h);if(e.lang){const p=n.enter(`codeFencedLang${o}`);x+=d.move(n.safe(e.lang,{before:x,after:" ",encode:["`"],...d.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);x+=d.move(" "),x+=d.move(n.safe(e.meta,{before:x,after:`
|
|
40
|
+
`,encode:["`"],...d.current()})),p()}return x+=d.move(`
|
|
41
|
+
`),c&&(x+=d.move(c+`
|
|
42
|
+
`)),x+=d.move(h),m(),x}function qP(e,t,n){return(n?"":" ")+e}function qg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function GP(e,t,n,a){const s=qg(n),c=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("[");return m+=h.move(n.safe(n.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
|
43
|
+
`,...h.current()}))),d(),e.title&&(d=n.enter(`title${c}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),o(),m}function YP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function tc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ed(e,t,n){const a=uo(e),s=uo(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}o2.peek=JP;function o2(e,t,n,a){const s=YP(n),c=n.enter("emphasis"),o=n.createTracker(a),d=o.move(s);let h=o.move(n.containerPhrasing(e,{after:s,before:d,...o.current()}));const m=h.charCodeAt(0),x=Ed(a.before.charCodeAt(a.before.length-1),m,s);x.inside&&(h=tc(m)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Ed(a.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+tc(p));const v=o.move(s);return c(),n.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+h+v}function JP(e,t,n){return n.options.emphasis||"*"}function KP(e,t){let n=!1;return Fg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Sx}),!!((!e.depth||e.depth<3)&&Lg(e)&&(t.options.setext||n))}function XP(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),c=n.createTracker(a);if(KP(e,n)){const x=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...c.current(),before:`
|
|
44
|
+
`,after:`
|
|
45
|
+
`});return p(),x(),b+`
|
|
46
|
+
`+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
47
|
+
`))+1))}const o="#".repeat(s),d=n.enter("headingAtx"),h=n.enter("phrasing");c.move(o+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
|
48
|
+
`,...c.current()});return/^[\t ]/.test(m)&&(m=tc(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),h(),d(),m}l2.peek=QP;function l2(e){return e.value||""}function QP(){return"<"}c2.peek=WP;function c2(e,t,n,a){const s=qg(n),c=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("![");return m+=h.move(n.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),d(),e.title&&(d=n.enter(`title${c}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),m+=h.move(")"),o(),m}function WP(){return"!"}u2.peek=eU;function u2(e,t,n,a){const s=e.referenceType,c=n.enter("imageReference");let o=n.enter("label");const d=n.createTracker(a);let h=d.move("![");const m=n.safe(e.alt,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),o();const x=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return o(),n.stack=x,c(),s==="full"||!m||m!==p?h+=d.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function eU(){return"!"}d2.peek=tU;function d2(e,t,n){let a=e.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++c<n.unsafe.length;){const o=n.unsafe[c],d=n.compilePattern(o);let h;if(o.atBreak)for(;h=d.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return s+a+s}function tU(){return"`"}function f2(e,t){const n=Lg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}h2.peek=nU;function h2(e,t,n,a){const s=qg(n),c=s==='"'?"Quote":"Apostrophe",o=n.createTracker(a);let d,h;if(f2(e,n)){const x=n.stack;n.stack=[],d=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),d(),n.stack=x,p}d=n.enter("link"),h=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,{before:m,after:"](",...o.current()})),m+=o.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,{before:m,after:">",...o.current()})),m+=o.move(">")):(h=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,{before:m,after:e.title?" ":")",...o.current()}))),h(),e.title&&(h=n.enter(`title${c}`),m+=o.move(" "+s),m+=o.move(n.safe(e.title,{before:m,after:s,...o.current()})),m+=o.move(s),h()),m+=o.move(")"),d(),m}function nU(e,t,n){return f2(e,n)?"<":"["}m2.peek=rU;function m2(e,t,n,a){const s=e.referenceType,c=n.enter("linkReference");let o=n.enter("label");const d=n.createTracker(a);let h=d.move("[");const m=n.containerPhrasing(e,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),o();const x=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return o(),n.stack=x,c(),s==="full"||!m||m!==p?h+=d.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function rU(){return"["}function Gg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function aU(e){const t=Gg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function iU(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function p2(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function sU(e,t,n,a){const s=n.enter("list"),c=n.bulletCurrent;let o=e.ordered?iU(n):Gg(n);const d=e.ordered?o==="."?")":".":aU(n);let h=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&x&&(!x.children||!x.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),p2(n)===o&&x){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(o=d),n.bulletCurrent=o;const m=n.containerFlow(e,a);return n.bulletLastUsed=o,n.bulletCurrent=c,s(),m}function oU(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function lU(e,t,n,a){const s=oU(n);let c=n.bulletCurrent||Gg(n);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let o=c.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const d=n.createTracker(a);d.move(c+" ".repeat(o-c.length)),d.shift(o);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,d.current()),x);return h(),m;function x(p,b,v){return b?(v?"":" ".repeat(o))+p:(v?c:c+" ".repeat(o-c.length))+p}}function cU(e,t,n,a){const s=n.enter("paragraph"),c=n.enter("phrasing"),o=n.containerPhrasing(e,a);return c(),s(),o}const uU=Xd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function dU(e,t,n,a){return(e.children.some(function(o){return uU(o)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function fU(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}x2.peek=hU;function x2(e,t,n,a){const s=fU(n),c=n.enter("strong"),o=n.createTracker(a),d=o.move(s+s);let h=o.move(n.containerPhrasing(e,{after:s,before:d,...o.current()}));const m=h.charCodeAt(0),x=Ed(a.before.charCodeAt(a.before.length-1),m,s);x.inside&&(h=tc(m)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Ed(a.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+tc(p));const v=o.move(s+s);return c(),n.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+h+v}function hU(e,t,n){return n.options.strong||"*"}function mU(e,t,n,a){return n.safe(e.value,a)}function pU(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function xU(e,t,n){const a=(p2(n)+(n.options.ruleSpaces?" ":"")).repeat(pU(n));return n.options.ruleSpaces?a.slice(0,-1):a}const g2={blockquote:UP,break:Lw,code:HP,definition:GP,emphasis:o2,hardBreak:Lw,heading:XP,html:l2,image:c2,imageReference:u2,inlineCode:d2,link:h2,linkReference:m2,list:sU,listItem:lU,paragraph:cU,root:dU,strong:x2,text:mU,thematicBreak:xU};function gU(){return{enter:{table:yU,tableData:Pw,tableHeader:Pw,tableRow:vU},exit:{codeText:kU,table:bU,tableData:pp,tableHeader:pp,tableRow:pp}}}function yU(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function bU(e){this.exit(e),this.data.inTable=void 0}function vU(e){this.enter({type:"tableRow",children:[]},e)}function pp(e){this.exit(e)}function Pw(e){this.enter({type:"tableCell",children:[]},e)}function kU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,wU));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function wU(e,t){return t==="|"?t:e}function SU(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,c=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
49
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:o,tableCell:h,tableRow:d}};function o(v,S,z,A){return m(x(v,z,A),v.align)}function d(v,S,z,A){const _=p(v,z,A),E=m([_]);return E.slice(0,E.indexOf(`
|
|
50
|
+
`))}function h(v,S,z,A){const _=z.enter("tableCell"),E=z.enter("phrasing"),N=z.containerPhrasing(v,{...A,before:c,after:c});return E(),_(),N}function m(v,S){return LP(v,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function x(v,S,z){const A=v.children;let _=-1;const E=[],N=S.enter("table");for(;++_<A.length;)E[_]=p(A[_],S,z);return N(),E}function p(v,S,z){const A=v.children;let _=-1;const E=[],N=S.enter("tableRow");for(;++_<A.length;)E[_]=h(A[_],v,S,z);return N(),E}function b(v,S,z){let A=g2.inlineCode(v,S,z);return z.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function zU(){return{exit:{taskListCheckValueChecked:Uw,taskListCheckValueUnchecked:Uw,paragraph:_U}}}function jU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NU}}}function Uw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function _U(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let c=-1,o;for(;++c<s.length;){const d=s[c];if(d.type==="paragraph"){o=d;break}}o===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function NU(e,t,n,a){const s=e.children[0],c=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);c&&d.move(o);let h=g2.listItem(e,t,n,{...a,...d.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(x){return x+o}}function CU(){return[sP(),NP(),AP(),gU(),zU()]}function TU(e){return{extensions:[oP(),CP(e),OP(),SU(e),jU()]}}const EU={tokenize:$U,partial:!0},y2={tokenize:LU,partial:!0},b2={tokenize:PU,partial:!0},v2={tokenize:UU,partial:!0},AU={tokenize:IU,partial:!0},k2={name:"wwwAutolink",tokenize:DU,previous:S2},w2={name:"protocolAutolink",tokenize:RU,previous:z2},ga={name:"emailAutolink",tokenize:MU,previous:j2},Zr={};function OU(){return{text:Zr}}let Mi=48;for(;Mi<123;)Zr[Mi]=ga,Mi++,Mi===58?Mi=65:Mi===91&&(Mi=97);Zr[43]=ga;Zr[45]=ga;Zr[46]=ga;Zr[95]=ga;Zr[72]=[ga,w2];Zr[104]=[ga,w2];Zr[87]=[ga,k2];Zr[119]=[ga,k2];function MU(e,t,n){const a=this;let s,c;return o;function o(p){return!Nx(p)||!j2.call(a,a.previous)||Yg(a.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(p))}function d(p){return Nx(p)?(e.consume(p),d):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(AU,x,m)(p):p===45||p===95||bn(p)?(c=!0,e.consume(p),h):x(p)}function m(p){return e.consume(p),s=!0,h}function x(p){return c&&s&&Nn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function DU(e,t,n){const a=this;return s;function s(o){return o!==87&&o!==119||!S2.call(a,a.previous)||Yg(a.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(EU,e.attempt(y2,e.attempt(b2,c),n),n)(o))}function c(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function RU(e,t,n){const a=this;let s="",c=!1;return o;function o(p){return(p===72||p===104)&&z2.call(a,a.previous)&&!Yg(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),d):n(p)}function d(p){if(Nn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),d;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),c?m:(c=!0,h)):n(p)}function m(p){return p===null||Nd(p)||pt(p)||Fi(p)||Yd(p)?n(p):e.attempt(y2,e.attempt(b2,x),n)(p)}function x(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function $U(e,t,n){let a=0;return s;function s(o){return(o===87||o===119)&&a<3?(a++,e.consume(o),s):o===46&&a===3?(e.consume(o),c):n(o)}function c(o){return o===null?n(o):t(o)}}function LU(e,t,n){let a,s,c;return o;function o(m){return m===46||m===95?e.check(v2,h,d)(m):m===null||pt(m)||Fi(m)||m!==45&&Yd(m)?h(m):(c=!0,e.consume(m),o)}function d(m){return m===95?a=!0:(s=a,a=void 0),e.consume(m),o}function h(m){return s||a||!c?n(m):t(m)}}function PU(e,t){let n=0,a=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&a<n?c(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(v2,t,c)(o):o===null||pt(o)||Fi(o)?t(o):(e.consume(o),s)}function c(o){return o===41&&a++,e.consume(o),s}}function UU(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),c):d===93?(e.consume(d),s):d===60||d===null||pt(d)||Fi(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||pt(d)||Fi(d)?t(d):a(d)}function c(d){return Nn(d)?o(d):n(d)}function o(d){return d===59?(e.consume(d),a):Nn(d)?(e.consume(d),o):n(d)}}function IU(e,t,n){return a;function a(c){return e.consume(c),s}function s(c){return bn(c)?n(c):t(c)}}function S2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pt(e)}function z2(e){return!Nn(e)}function j2(e){return!(e===47||Nx(e))}function Nx(e){return e===43||e===45||e===46||e===95||bn(e)}function Yg(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const BU={tokenize:JU,partial:!0};function VU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:qU,continuation:{tokenize:GU},exit:YU}},text:{91:{name:"gfmFootnoteCall",tokenize:HU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZU,resolveTo:FU}}}}function ZU(e,t,n){const a=this;let s=a.events.length;const c=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){o=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!o||!o._balanced)return n(h);const m=Cr(a.sliceSerialize({start:o.end,end:a.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function FU(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",c,t],["enter",o,t],["exit",o,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function HU(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c=0,o;return d;function d(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(c>999||p===93&&!o||p===null||p===91||pt(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Cr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return pt(p)||(o=!0),c++,e.consume(p),p===92?x:m}function x(p){return p===91||p===92||p===93?(e.consume(p),c++,m):m(p)}}function qU(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,o=0,d;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):n(S)}function x(S){if(o>999||S===93&&!d||S===null||S===91||pt(S))return n(S);if(S===93){e.exit("chunkString");const z=e.exit("gfmFootnoteDefinitionLabelString");return c=Cr(a.sliceSerialize(z)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return pt(S)||(d=!0),o++,e.consume(S),S===92?p:x}function p(S){return S===91||S===92||S===93?(e.consume(S),o++,x):x(S)}function b(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(c)||s.push(c),Xe(e,v,"gfmFootnoteDefinitionWhitespace")):n(S)}function v(S){return t(S)}}function GU(e,t,n){return e.check(bc,t,e.attempt(BU,t,n))}function YU(e){e.exit("gfmFootnoteDefinition")}function JU(e,t,n){const a=this;return Xe(e,s,"gfmFootnoteDefinitionIndent",5);function s(c){const o=a.events[a.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(c):n(c)}}function KU(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:c,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(o,d){let h=-1;for(;++h<o.length;)if(o[h][0]==="enter"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._close){let m=h;for(;m--;)if(o[m][0]==="exit"&&o[m][1].type==="strikethroughSequenceTemporary"&&o[m][1]._open&&o[h][1].end.offset-o[h][1].start.offset===o[m][1].end.offset-o[m][1].start.offset){o[h][1].type="strikethroughSequence",o[m][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},o[m][1].start),end:Object.assign({},o[h][1].end)},p={type:"strikethroughText",start:Object.assign({},o[m][1].end),end:Object.assign({},o[h][1].start)},b=[["enter",x,d],["enter",o[m][1],d],["exit",o[m][1],d],["enter",p,d]],v=d.parser.constructs.insideSpan.null;v&&Wn(b,b.length,0,Jd(v,o.slice(m+1,h),d)),Wn(b,b.length,0,[["exit",p,d],["enter",o[h][1],d],["exit",o[h][1],d],["exit",x,d]]),Wn(o,m-1,h-m+3,b),h=m+b.length-2;break}}for(h=-1;++h<o.length;)o[h][1].type==="strikethroughSequenceTemporary"&&(o[h][1].type="data");return o}function c(o,d,h){const m=this.previous,x=this.events;let p=0;return b;function b(S){return m===126&&x[x.length-1][1].type!=="characterEscape"?h(S):(o.enter("strikethroughSequenceTemporary"),v(S))}function v(S){const z=uo(m);if(S===126)return p>1?h(S):(o.consume(S),p++,v);if(p<2&&!n)return h(S);const A=o.exit("strikethroughSequenceTemporary"),_=uo(S);return A._open=!_||_===2&&!!z,A._close=!z||z===2&&!!_,d(S)}}}class XU{constructor(){this.map=[]}add(t,n,a){QU(this,t,n,a)}consume(t){if(this.map.sort(function(c,o){return c[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const c of s)t.push(c);s=a.pop()}this.map.length=0}}function QU(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function WU(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=a.length-1;a[c]=a[c]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function e7(){return{flow:{null:{name:"table",tokenize:t7,resolveAll:n7}}}}function t7(e,t,n){const a=this;let s=0,c=0,o;return d;function d(I){let te=a.events.length-1;for(;te>-1;){const oe=a.events[te][1].type;if(oe==="lineEnding"||oe==="linePrefix")te--;else break}const le=te>-1?a.events[te][1].type:null,ne=le==="tableHead"||le==="tableRow"?M:h;return ne===M&&a.parser.lazy[a.now().line]?n(I):ne(I)}function h(I){return e.enter("tableHead"),e.enter("tableRow"),m(I)}function m(I){return I===124||(o=!0,c+=1),x(I)}function x(I){return I===null?n(I):_e(I)?c>1?(c=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),v):n(I):Ve(I)?Xe(e,x,"whitespace")(I):(c+=1,o&&(o=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,x):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||pt(I)?(e.exit("data"),x(I)):(e.consume(I),I===92?b:p)}function b(I){return I===92||I===124?(e.consume(I),p):p(I)}function v(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,Ve(I)?Xe(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):S(I))}function S(I){return I===45||I===58?A(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),z):D(I)}function z(I){return Ve(I)?Xe(e,A,"whitespace")(I):A(I)}function A(I){return I===58?(c+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):I===45?(c+=1,_(I)):I===null||_e(I)?P(I):D(I)}function _(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):D(I)}function E(I){return I===45?(e.consume(I),E):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(I))}function N(I){return Ve(I)?Xe(e,P,"whitespace")(I):P(I)}function P(I){return I===124?S(I):I===null||_e(I)?!o||s!==c?D(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):D(I)}function D(I){return n(I)}function M(I){return e.enter("tableRow"),V(I)}function V(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),V):I===null||_e(I)?(e.exit("tableRow"),t(I)):Ve(I)?Xe(e,V,"whitespace")(I):(e.enter("data"),U(I))}function U(I){return I===null||I===124||pt(I)?(e.exit("data"),V(I)):(e.consume(I),I===92?K:U)}function K(I){return I===92||I===124?(e.consume(I),U):U(I)}}function n7(e,t){let n=-1,a=!0,s=0,c=[0,0,0,0],o=[0,0,0,0],d=!1,h=0,m,x,p;const b=new XU;for(;++n<e.length;){const v=e[n],S=v[1];v[0]==="enter"?S.type==="tableHead"?(d=!1,h!==0&&(Iw(b,t,h,m,x),x=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(n,0,[["enter",m,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,p=void 0,c=[0,0,0,0],o=[0,n+1,0,0],d&&(d=!1,x={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(n,0,[["enter",x,t]])),s=S.type==="tableDelimiterRow"?2:x?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,o[2]===0&&(c[1]!==0&&(o[0]=o[1],p=Yu(b,t,c,s,void 0,p),c=[0,0,0,0]),o[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(c[1]!==0&&(o[0]=o[1],p=Yu(b,t,c,s,void 0,p)),c=o,o=[c[1],n,0,0])):S.type==="tableHead"?(d=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,c[1]!==0?(o[0]=o[1],p=Yu(b,t,c,s,n,p)):o[1]!==0&&(p=Yu(b,t,o,s,n,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(o[3]=n)}for(h!==0&&Iw(b,t,h,m,x),b.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=WU(t.events,n))}return e}function Yu(e,t,n,a,s,c){const o=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(c.end=Object.assign({},Fs(t.events,n[0])),e.add(n[0],0,[["exit",c,t]]));const h=Fs(t.events,n[1]);if(c={type:o,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",c,t]]),n[2]!==0){const m=Fs(t.events,n[2]),x=Fs(t.events,n[3]),p={type:d,start:Object.assign({},m),end:Object.assign({},x)};if(e.add(n[2],0,[["enter",p,t]]),a!==2){const b=t.events[n[2]],v=t.events[n[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,z=n[3]-n[2]-1;e.add(S,z,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(c.end=Object.assign({},Fs(t.events,s)),e.add(s,0,[["exit",c,t]]),c=void 0),c}function Iw(e,t,n,a,s){const c=[],o=Fs(t.events,n);s&&(s.end=Object.assign({},o),c.push(["exit",s,t])),a.end=Object.assign({},o),c.push(["exit",a,t]),e.add(n+1,0,c)}function Fs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const r7={name:"tasklistCheck",tokenize:i7};function a7(){return{text:{91:r7}}}function i7(e,t,n){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return pt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),o):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),o):n(h)}function o(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(h)}function d(h){return _e(h)?t(h):Ve(h)?e.check({tokenize:s7},t,n)(h):n(h)}}function s7(e,t,n){return Xe(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function o7(e){return $_([OU(),VU(),KU(e),e7(),a7()])}const l7={};function c7(e){const t=this,n=e||l7,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),c=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(o7(n)),c.push(CU()),o.push(TU(n))}function Bw(e){if(e==null)return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}const u7=({group:e})=>{const[t,n]=j.useState(!1),a=e.result!==null,s=e.result?.content??"",c=s.startsWith("Error")||s.startsWith("❌");return u.jsxs("div",{className:"rounded-lg border border-gray-300 dark:border-matrix-primary/70 bg-white dark:bg-black overflow-hidden text-sm mb-1",children:[u.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors",children:[u.jsx(fc,{size:12,className:"text-amber-500 dark:text-amber-400/80 flex-shrink-0"}),u.jsx("span",{className:"flex-1 font-mono text-xs text-gray-600 dark:text-matrix-secondary/80 truncate",children:e.call.name}),a?c?u.jsx(ei,{size:12,className:"text-red-500 dark:text-red-400 flex-shrink-0"}):u.jsx(bo,{size:12,className:"text-emerald-500 dark:text-emerald-400 flex-shrink-0"}):u.jsx(uc,{size:12,className:"text-gray-400 animate-spin flex-shrink-0"}),u.jsx(yo,{size:12,className:`text-gray-400 dark:text-matrix-secondary/40 flex-shrink-0 transition-transform duration-200 ${t?"rotate-180":""}`})]}),u.jsx(Cg,{initial:!1,children:t&&u.jsx($e.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15,ease:"easeInOut"},className:"overflow-hidden",children:u.jsxs("div",{className:"px-3 pb-2.5 pt-1 border-t border-gray-100 dark:border-matrix-primary/20 space-y-2",children:[Object.keys(e.call.args??{}).length>0&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"args"}),u.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 whitespace-pre-wrap break-all bg-gray-50 dark:bg-zinc-900 rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 max-h-36 overflow-y-auto",children:Bw(e.call.args)})]}),a&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"result"}),u.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 whitespace-pre-wrap break-all bg-gray-50 dark:bg-zinc-900 rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 max-h-44 overflow-y-auto",children:Bw(s)})]})]})})})]})},d7={apoc_delegate:{label:"Apoc",emoji:"🧑🔬",colorClass:"text-amber-600 dark:text-amber-400",bgClass:"bg-amber-50 dark:bg-amber-900/10"},neo_delegate:{label:"Neo",emoji:"🥷",colorClass:"text-violet-600 dark:text-violet-400",bgClass:"bg-violet-50 dark:bg-violet-900/10"},trinity_delegate:{label:"Trinity",emoji:"👩💻",colorClass:"text-teal-600 dark:text-teal-400",bgClass:"bg-teal-50 dark:bg-teal-900/10"},smith_delegate:{label:"Smith",emoji:"🕶️",colorClass:"text-gray-500 dark:text-gray-400",bgClass:"bg-gray-50 dark:bg-zinc-900"}};function xp(e){return e?.task??e?.prompt??""}function f7(e){if(typeof e!="string")return String(e);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const h7=({group:e})=>{const[t,n]=j.useState(!1),a=d7[e.call.name]??{label:e.call.name,emoji:"🤖",colorClass:"text-gray-500",bgClass:"bg-gray-50 dark:bg-zinc-900"},s=e.result!==null,c=e.result?.content??"",o=c.startsWith("❌")||c.toLowerCase().startsWith("error"),d=xp(e.call.args).slice(0,100),h=e.call.args?.smith??null;return u.jsxs("div",{className:`rounded-lg border border-gray-300 dark:border-matrix-primary/70 overflow-hidden text-sm mb-1 ${a.bgClass}`,children:[u.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:brightness-95 dark:hover:brightness-110 transition-all",children:[u.jsx("span",{className:"text-base flex-shrink-0 leading-none",children:a.emoji}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:`text-xs font-semibold ${a.colorClass}`,children:[a.label,h?` · ${h}`:""]}),d&&u.jsx("div",{className:"text-xs text-gray-500 dark:text-matrix-secondary/60 truncate mt-0.5",children:d})]}),s?o?u.jsx(ei,{size:14,className:"text-red-500 dark:text-red-400 flex-shrink-0"}):u.jsx(bo,{size:14,className:"text-emerald-500 dark:text-emerald-400 flex-shrink-0"}):u.jsx(uc,{size:14,className:"text-gray-400 animate-spin flex-shrink-0"}),u.jsx(yo,{size:13,className:`text-gray-400 dark:text-matrix-secondary/40 flex-shrink-0 transition-transform duration-200 ${t?"rotate-180":""}`})]}),u.jsx(Cg,{initial:!1,children:t&&u.jsx($e.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeInOut"},className:"overflow-hidden",children:u.jsxs("div",{className:"px-3 pb-2.5 pt-1 border-t border-gray-200 dark:border-matrix-primary/20 space-y-2",children:[xp(e.call.args)&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"task"}),u.jsx("p",{className:"text-xs text-gray-600 dark:text-matrix-secondary/80 bg-white dark:bg-black rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 whitespace-pre-wrap",children:xp(e.call.args)})]}),s&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"result"}),u.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 whitespace-pre-wrap break-all bg-white dark:bg-black rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 max-h-56 overflow-y-auto",children:f7(c)})]})]})})})]})};function m7(e){return e==null||e===0?null:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Vw(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const p7=({message:e})=>{const t=e.usage_metadata,n=t?.input_tokens??t?.prompt_tokens??0,a=t?.output_tokens??t?.completion_tokens??0,s=n>0||a>0,c=m7(e.duration_ms),o=e.model;if(!s&&!c&&!o)return null;const d=o?(o.includes(":")?o.split(":").pop():o)?.split("-").slice(0,4).join("-")??o:null;return u.jsxs("div",{className:"mt-2 pt-1.5 border-t border-gray-100 dark:border-matrix-primary/20 flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[d&&u.jsx("span",{className:"text-[11px] font-mono text-gray-400 dark:text-matrix-secondary/40 truncate max-w-[180px]",title:o??"",children:d}),s&&u.jsxs("span",{className:"text-[11px] font-mono text-gray-400 dark:text-matrix-secondary/40",children:["↑",Vw(n)," ↓",Vw(a)]}),c&&u.jsx("span",{className:"text-[11px] font-mono text-gray-400 dark:text-matrix-secondary/40",children:c})]})};function x7(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function g7(e){return e.session_id?.startsWith("sati-evaluation-")===!0||e.tool_name?.toLowerCase().includes("sati")===!0}const y7=({message:e})=>{const[t,n]=j.useState(!1),a=g7(e),s=a?e.tool_name==="sati_evaluation_output"?"Sati · memory update":"Sati · analysis":e.tool_name??"tool result";return u.jsxs("details",{open:t,onToggle:c=>n(c.target.open),className:"w-full",children:[u.jsxs("summary",{className:"list-none cursor-pointer select-none flex items-center gap-2 text-xs text-gray-400 dark:text-matrix-secondary/40 hover:text-gray-500 dark:hover:text-matrix-secondary/60 transition-colors py-0.5",children:[u.jsx("div",{className:"flex-1 h-px bg-gray-200 dark:bg-matrix-primary/20"}),u.jsxs("span",{className:"flex items-center gap-1.5 whitespace-nowrap px-2",children:[u.jsx("span",{children:a?"🧠":"🔧"}),u.jsx("span",{children:s}),u.jsx(yo,{size:11,className:`transition-transform duration-200 ${t?"rotate-180":""}`})]}),u.jsx("div",{className:"flex-1 h-px bg-gray-200 dark:bg-matrix-primary/20"})]}),t&&u.jsx("pre",{className:"mt-2 px-3 py-2.5 whitespace-pre-wrap break-all text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 border border-gray-300 dark:border-matrix-primary/60 rounded-lg bg-gray-50 dark:bg-zinc-900 max-h-48 overflow-y-auto",children:x7(e.content)})]})},b7={table:({children:e})=>u.jsx("div",{className:"my-2 overflow-x-auto rounded-lg border border-gray-200 dark:border-matrix-primary/60",children:u.jsx("table",{className:"min-w-full text-xs border-collapse",children:e})}),thead:({children:e})=>u.jsx("thead",{className:"bg-gray-100 dark:bg-zinc-900 text-gray-600 dark:text-matrix-secondary/70",children:e}),tbody:({children:e})=>u.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-matrix-primary/20",children:e}),tr:({children:e})=>u.jsx("tr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors",children:e}),th:({children:e})=>u.jsx("th",{className:"px-3 py-2 text-left font-semibold whitespace-nowrap border-b border-gray-200 dark:border-matrix-primary/40",children:e}),td:({children:e})=>u.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-matrix-secondary align-top",children:e})},v7=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a,activeSession:s,onToggleSidebar:c})=>{const[o,d]=j.useState(""),h=j.useRef(null),m=j.useRef(null);j.useEffect(()=>{h.current?.scrollIntoView({behavior:"smooth"})},[e,n]),j.useEffect(()=>{const b=m.current;b&&(b.style.height="auto",b.style.height=b.scrollHeight+"px")},[o]);const x=()=>{!o.trim()||n||(t(o.trim()),d(""),m.current&&(m.current.style.height="auto"))},p=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),x())};return u.jsxs("div",{className:"flex-1 flex flex-col h-full bg-white dark:bg-black overflow-hidden transition-colors duration-300",children:[c&&u.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 shrink-0 bg-white dark:bg-black border-b border-gray-300 dark:border-matrix-primary",children:[u.jsx("button",{onClick:c,className:"p-2 -ml-1 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary transition-colors","aria-label":"Open sessions",children:u.jsx(zz,{size:20})}),u.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-matrix-highlight truncate flex-1",children:s?.title??(a?"Chat":"Morpheus")})]}),a?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-4 py-5 space-y-4",children:[U$(e).map(b=>{const{message:v,toolGroups:S}=b;if(v.type==="tool")return u.jsx("div",{className:"px-2 py-0.5",children:u.jsx(y7,{message:v})},b.index);const z=v.type==="human";return u.jsxs("div",{className:`flex items-end gap-2.5 ${z?"justify-end":"justify-start"}`,children:[!z&&u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight mb-0.5",children:u.jsx(ld,{size:14})}),u.jsxs("div",{className:`
|
|
51
|
+
max-w-[85%] md:max-w-[72%] min-w-0
|
|
52
|
+
${z?"bg-azure-primary text-white dark:bg-matrix-primary dark:text-black rounded-2xl rounded-br-sm px-4 py-2.5":"bg-gray-50 dark:bg-zinc-900 border border-gray-300 dark:border-matrix-primary/60 text-gray-800 dark:text-matrix-secondary rounded-2xl rounded-bl-sm px-4 py-3"}
|
|
53
|
+
`,children:[z&&u.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:v.content}),v.type==="ai"&&u.jsxs(u.Fragment,{children:[S&&S.length>0&&u.jsx("div",{className:"mb-2.5 space-y-1",children:S.map(A=>P$(A.call.name)?u.jsx(h7,{group:A},A.call.id):u.jsx(u7,{group:A},A.call.id))}),v.content&&u.jsx("div",{className:`
|
|
54
|
+
prose prose-sm dark:prose-invert max-w-none
|
|
55
|
+
prose-p:my-1.5 prose-p:leading-relaxed
|
|
56
|
+
prose-headings:my-2 prose-headings:font-semibold
|
|
57
|
+
prose-ul:my-1.5 prose-ol:my-1.5 prose-li:my-0.5
|
|
58
|
+
prose-pre:my-2 prose-pre:rounded-lg prose-pre:text-xs
|
|
59
|
+
prose-code:text-[0.8em] prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:font-mono
|
|
60
|
+
prose-table:my-0 prose-thead:border-0 prose-tbody:border-0
|
|
61
|
+
prose-tr:border-0 prose-th:p-0 prose-td:p-0
|
|
62
|
+
dark:prose-p:text-matrix-secondary
|
|
63
|
+
dark:prose-headings:text-matrix-highlight
|
|
64
|
+
dark:prose-strong:text-matrix-highlight
|
|
65
|
+
dark:prose-li:text-matrix-secondary
|
|
66
|
+
dark:prose-code:text-matrix-highlight dark:prose-code:bg-black/60
|
|
67
|
+
dark:prose-pre:bg-black dark:prose-pre:border dark:prose-pre:border-matrix-primary/30
|
|
68
|
+
`,children:u.jsx(K8,{remarkPlugins:[c7],components:b7,children:v.content})}),u.jsx(p7,{message:v})]})]}),z&&u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center bg-gray-200 dark:bg-matrix-primary/30 text-gray-500 dark:text-matrix-secondary mb-0.5",children:u.jsx(Yx,{size:14})})]},b.index)}),n&&u.jsxs("div",{className:"flex items-end gap-2.5 justify-start",children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight mb-0.5",children:u.jsx(ld,{size:14})}),u.jsxs("div",{className:"bg-gray-50 dark:bg-zinc-900 border border-gray-300 dark:border-matrix-primary/60 rounded-2xl rounded-bl-sm px-4 py-3 flex items-center gap-1.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-azure-primary dark:bg-matrix-highlight animate-bounce",style:{animationDelay:"0ms"}}),u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-azure-primary dark:bg-matrix-highlight animate-bounce",style:{animationDelay:"160ms"}}),u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-azure-primary dark:bg-matrix-highlight animate-bounce",style:{animationDelay:"320ms"}})]})]}),u.jsx("div",{ref:h})]}),u.jsxs("div",{className:"shrink-0 px-4 pt-3 pb-4 bg-white dark:bg-black border-t border-gray-300 dark:border-matrix-primary",children:[u.jsxs("form",{onSubmit:b=>{b.preventDefault(),x()},className:"max-w-3xl mx-auto flex items-end gap-2",children:[u.jsx("textarea",{ref:m,value:o,onChange:b=>d(b.target.value),onKeyDown:p,placeholder:"Message Morpheus…",rows:1,disabled:n,className:`
|
|
69
|
+
flex-1 resize-none max-h-40 overflow-y-auto
|
|
70
|
+
bg-gray-100 dark:bg-zinc-900
|
|
71
|
+
border border-gray-300 dark:border-matrix-primary/60
|
|
72
|
+
rounded-xl px-4 py-3
|
|
73
|
+
text-sm leading-relaxed
|
|
74
|
+
text-gray-800 dark:text-matrix-secondary
|
|
75
|
+
placeholder-gray-400 dark:placeholder-matrix-secondary/40
|
|
76
|
+
focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-transparent
|
|
77
|
+
disabled:opacity-50
|
|
78
|
+
transition-all duration-200
|
|
79
|
+
`}),u.jsx("button",{type:"submit",disabled:!o.trim()||n,className:"flex-shrink-0 p-3 rounded-xl bg-azure-primary text-white dark:bg-matrix-secondary dark:text-black hover:bg-azure-secondary dark:hover:bg-matrix-highlight disabled:opacity-40 disabled:cursor-not-allowed transition-colors shadow-sm",children:u.jsx(L5,{size:18})})]}),u.jsx("p",{className:"mt-1.5 text-center text-[11px] text-gray-300 dark:text-matrix-secondary/25 select-none",children:"Enter to send · Shift+Enter for newline"})]})]}):u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-5 p-8 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-2xl bg-azure-primary/10 dark:bg-matrix-primary/10 flex items-center justify-center",children:u.jsx(ld,{size:30,className:"text-azure-primary/60 dark:text-matrix-highlight/50"})}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("h3",{className:"text-base font-semibold text-gray-700 dark:text-matrix-highlight",children:"Morpheus is ready"}),u.jsx("p",{className:"text-sm text-gray-400 dark:text-matrix-secondary/60 max-w-[240px] leading-relaxed",children:"Select a session from the sidebar or start a new chat."})]})]})]})};function _2({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:c="Confirm",variant:o="default"}){return u.jsx(Ir,{open:e,onOpenChange:t,children:u.jsxs(co,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[u.jsx(Br,{children:u.jsx(Vr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),u.jsx("div",{className:"py-4",children:u.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:s})}),u.jsxs(j$,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[u.jsx(xr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),u.jsx(xr,{variant:o,onClick:()=>{n(),t()},className:o==="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:c})]})]})})}const k7=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(null),[s,c]=j.useState([]),[o,d]=j.useState(!1),[h,m]=j.useState(()=>typeof window<"u"?window.innerWidth>=768:!0),x=j.useRef(!1);j.useEffect(()=>{x.current=o},[o]),j.useEffect(()=>{if(!n)return;const M=setInterval(async()=>{if(!x.current)try{const U=(await Fa.getMessages(n)).filter(K=>K.type!=="system");c(K=>{if(U.length!==K.length)return U;const I=U.at(-1)?.created_at??0,te=K.at(-1)?.created_at??0;return I>te?U:K})}catch{}},3e3);return()=>clearInterval(M)},[n]);const[p,b]=j.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const M=await Fa.getSessions();t(M)}catch(M){console.error("Failed to load sessions:",M)}};j.useEffect(()=>{v()},[]),j.useEffect(()=>{n?S(n):c([])},[n]);const S=async M=>{try{const V=await Fa.getMessages(M);c(V.filter(U=>U.type!=="system"))}catch(V){console.error("Failed to load messages:",V)}},z=async()=>{try{const M=await Fa.createSession();await v(),a(M.id),window.innerWidth<768&&m(!1)}catch(M){console.error("Failed to create session:",M)}},A=M=>{a(M),window.innerWidth<768&&m(!1)},_=async M=>{if(!n)return;const V={type:"human",content:M};c(U=>[...U,V]),d(!0);try{await Fa.sendMessage(n,M),await S(n),await v()}catch(U){console.error("Failed to send message:",U)}finally{d(!1)}},E=M=>{b({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await Fa.archiveSession(M),n===M&&a(null),await v()}catch(V){console.error("Failed to archive session:",V)}}})},N=M=>{b({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await Fa.deleteSession(M),n===M&&a(null),await v()}catch(V){console.error("Failed to delete session:",V)}}})},P=async(M,V)=>{try{await Fa.renameSession(M,V),await v()}catch(U){console.error("Failed to rename session:",U)}},D=e.find(M=>M.id===n)??null;return u.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-white dark:bg-black relative",children:[h&&u.jsx("div",{className:"fixed inset-0 bg-black/40 z-20 md:hidden",onClick:()=>m(!1)}),u.jsx("div",{className:`
|
|
80
|
+
fixed top-16 bottom-0 left-0 z-40 flex
|
|
81
|
+
md:relative md:inset-auto md:z-auto md:translate-x-0
|
|
82
|
+
transition-transform duration-300 ease-out
|
|
83
|
+
${h?"translate-x-0":"-translate-x-full"}
|
|
84
|
+
`,children:u.jsx($$,{sessions:e,activeSessionId:n,onSelectSession:A,onCreateSession:z,onArchiveSession:E,onDeleteSession:N,onRenameSession:P,isOpen:h,toggleSidebar:()=>m(!h)})}),u.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden min-w-0",children:u.jsx(v7,{messages:s,onSendMessage:_,isLoading:o,activeSessionId:n,activeSession:D,onToggleSidebar:()=>m(!h)})}),u.jsx(_2,{isOpen:p.isOpen,onClose:()=>b(M=>({...M,isOpen:!1})),onConfirm:p.onConfirm,title:p.title,description:p.description,confirmJson:p.confirmJson,variant:p.variant})]})};function w7(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return We(`/chronos${n}`,()=>xe.get(`/chronos${n}`))}function S7(e,t=50){return We(e?`/chronos/${e}/executions?limit=${t}`:null,()=>xe.get(`/chronos/${e}/executions?limit=${t}`))}function N2(){return We("/config/chronos",()=>xe.get("/config/chronos"))}const Vi={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 zn({title:e,description:t,children:n}){return u.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:[u.jsxs("div",{className:"mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),u.jsx("div",{className:"space-y-4",children:n})]})}const z7=(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},j7=(e,t)=>({classGroupId:e,validator:t}),C2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ad="-",Zw=[],_7="arbitrary..",N7=e=>{const t=T7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return C7(o);const d=o.split(Ad),h=d[0]===""&&d.length>1?1:0;return T2(d,h,t)},getConflictingClassGroupIds:(o,d)=>{if(d){const h=a[o],m=n[o];return h?m?z7(m,h):h:m||Zw}return n[o]||Zw}}},T2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],c=n.nextPart.get(s);if(c){const m=T2(e,t+1,c);if(m)return m}const o=n.validators;if(o===null)return;const d=t===0?e.join(Ad):e.slice(t).join(Ad),h=o.length;for(let m=0;m<h;m++){const x=o[m];if(x.validator(d))return x.classGroupId}},C7=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?_7+a:void 0})(),T7=e=>{const{theme:t,classGroups:n}=e;return E7(n,t)},E7=(e,t)=>{const n=C2();for(const a in e){const s=e[a];Jg(s,n,a,t)}return n},Jg=(e,t,n,a)=>{const s=e.length;for(let c=0;c<s;c++){const o=e[c];A7(o,t,n,a)}},A7=(e,t,n,a)=>{if(typeof e=="string"){O7(e,t,n);return}if(typeof e=="function"){M7(e,t,n,a);return}D7(e,t,n,a)},O7=(e,t,n)=>{const a=e===""?t:E2(t,e);a.classGroupId=n},M7=(e,t,n,a)=>{if(R7(e)){Jg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(j7(n,e))},D7=(e,t,n,a)=>{const s=Object.entries(e),c=s.length;for(let o=0;o<c;o++){const[d,h]=s[o];Jg(h,E2(t,d),n,a)}},E2=(e,t)=>{let n=e;const a=t.split(Ad),s=a.length;for(let c=0;c<s;c++){const o=a[c];let d=n.nextPart.get(o);d||(d=C2(),n.nextPart.set(o,d)),n=d}return n},R7=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(c,o)=>{n[c]=o,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(c){let o=n[c];if(o!==void 0)return o;if((o=a[c])!==void 0)return s(c,o),o},set(c,o){c in n?n[c]=o:s(c,o)}}},Cx="!",Fw=":",L7=[],Hw=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),P7=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const c=[];let o=0,d=0,h=0,m;const x=s.length;for(let z=0;z<x;z++){const A=s[z];if(o===0&&d===0){if(A===Fw){c.push(s.slice(h,z)),h=z+1;continue}if(A==="/"){m=z;continue}}A==="["?o++:A==="]"?o--:A==="("?d++:A===")"&&d--}const p=c.length===0?s:s.slice(h);let b=p,v=!1;p.endsWith(Cx)?(b=p.slice(0,-1),v=!0):p.startsWith(Cx)&&(b=p.slice(1),v=!0);const S=m&&m>h?m-h:void 0;return Hw(c,v,b,S)};if(t){const s=t+Fw,c=a;a=o=>o.startsWith(s)?c(o.slice(s.length)):Hw(L7,!1,o,void 0,!0)}if(n){const s=a;a=c=>n({className:c,parseClassName:s})}return a},U7=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let c=0;c<n.length;c++){const o=n[c],d=o[0]==="[",h=t.has(o);d||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(o)):s.push(o)}return s.length>0&&(s.sort(),a.push(...s)),a}},I7=e=>({cache:$7(e.cacheSize),parseClassName:P7(e),sortModifiers:U7(e),...N7(e)}),B7=/\s+/,V7=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:c}=t,o=[],d=e.trim().split(B7);let h="";for(let m=d.length-1;m>=0;m-=1){const x=d[m],{isExternal:p,modifiers:b,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:z}=n(x);if(p){h=x+(h.length>0?" "+h:h);continue}let A=!!z,_=a(A?S.substring(0,z):S);if(!_){if(!A){h=x+(h.length>0?" "+h:h);continue}if(_=a(S),!_){h=x+(h.length>0?" "+h:h);continue}A=!1}const E=b.length===0?"":b.length===1?b[0]:c(b).join(":"),N=v?E+Cx:E,P=N+_;if(o.indexOf(P)>-1)continue;o.push(P);const D=s(_,A);for(let M=0;M<D.length;++M){const V=D[M];o.push(N+V)}h=x+(h.length>0?" "+h:h)}return h},Z7=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=A2(n))&&(s&&(s+=" "),s+=a);return s},A2=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=A2(e[a]))&&(n&&(n+=" "),n+=t);return n},F7=(e,...t)=>{let n,a,s,c;const o=h=>{const m=t.reduce((x,p)=>p(x),e());return n=I7(m),a=n.cache.get,s=n.cache.set,c=d,d(h)},d=h=>{const m=a(h);if(m)return m;const x=V7(h,n);return s(h,x),x};return c=o,(...h)=>c(Z7(...h))},H7=[],Wt=e=>{const t=n=>n[e]||H7;return t.isThemeGetter=!0,t},O2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,q7=/^\d+\/\d+$/,G7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y7=/\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$/,J7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bs=e=>q7.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),qa=e=>!!e&&Number.isInteger(Number(e)),gp=e=>e.endsWith("%")&&Le(e.slice(0,-1)),ca=e=>G7.test(e),Q7=()=>!0,W7=e=>Y7.test(e)&&!J7.test(e),D2=()=>!1,eI=e=>K7.test(e),tI=e=>X7.test(e),nI=e=>!be(e)&&!ve(e),rI=e=>jo(e,L2,D2),be=e=>O2.test(e),Di=e=>jo(e,P2,W7),yp=e=>jo(e,lI,Le),qw=e=>jo(e,R2,D2),aI=e=>jo(e,$2,tI),Ju=e=>jo(e,U2,eI),ve=e=>M2.test(e),Al=e=>_o(e,P2),iI=e=>_o(e,cI),Gw=e=>_o(e,R2),sI=e=>_o(e,L2),oI=e=>_o(e,$2),Ku=e=>_o(e,U2,!0),jo=(e,t,n)=>{const a=O2.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},_o=(e,t,n=!1)=>{const a=M2.exec(e);return a?a[1]?t(a[1]):n:!1},R2=e=>e==="position"||e==="percentage",$2=e=>e==="image"||e==="url",L2=e=>e==="length"||e==="size"||e==="bg-size",P2=e=>e==="length",lI=e=>e==="number",cI=e=>e==="family-name",U2=e=>e==="shadow",uI=()=>{const e=Wt("color"),t=Wt("font"),n=Wt("text"),a=Wt("font-weight"),s=Wt("tracking"),c=Wt("leading"),o=Wt("breakpoint"),d=Wt("container"),h=Wt("spacing"),m=Wt("radius"),x=Wt("shadow"),p=Wt("inset-shadow"),b=Wt("text-shadow"),v=Wt("drop-shadow"),S=Wt("blur"),z=Wt("perspective"),A=Wt("aspect"),_=Wt("ease"),E=Wt("animate"),N=()=>["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"],D=()=>[...P(),ve,be],M=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],U=()=>[ve,be,h],K=()=>[Bs,"full","auto",...U()],I=()=>[qa,"none","subgrid",ve,be],te=()=>["auto",{span:["full",qa,ve,be]},qa,ve,be],le=()=>[qa,"auto",ve,be],ne=()=>["auto","min","max","fr",ve,be],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...U()],B=()=>[Bs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],Y=()=>[e,ve,be],ue=()=>[...P(),Gw,qw,{position:[ve,be]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",sI,rI,{size:[ve,be]}],H=()=>[gp,Al,Di],w=()=>["","none","full",m,ve,be],X=()=>["",Le,Al,Di],me=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Le,gp,Gw,qw],Pe=()=>["","none",S,ve,be],Ee=()=>["none",Le,ve,be],yt=()=>["none",Le,ve,be],$=()=>[Le,ve,be],Oe=()=>[Bs,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ca],breakpoint:[ca],color:[Q7],container:[ca],"drop-shadow":[ca],ease:["in","out","in-out"],font:[nI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ca],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ca],shadow:[ca],spacing:["px",Le],text:[ca],"text-shadow":[ca],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bs,be,ve,A]}],container:["container"],columns:[{columns:[Le,be,ve,d]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[qa,"auto",ve,be]}],basis:[{basis:[Bs,"full","auto",d,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Bs,"auto","initial","none",be]}],grow:[{grow:["",Le,ve,be]}],shrink:[{shrink:["",Le,ve,be]}],order:[{order:[qa,"first","last","none",ve,be]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:te()}],"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":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[d,"screen",...B()]}],"min-w":[{"min-w":[d,"screen","none",...B()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[o]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,Al,Di]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ve,yp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gp,be]}],"font-family":[{font:[iI,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,yp]}],leading:[{leading:[c,...U()]}],"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:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",ve,Di]}],"text-decoration-color":[{decoration:Y()}],"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:U()}],"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:ue()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qa,ve,be],radial:["",ve,be],conic:[qa,ve,be]},oI,aI]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],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:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,ve,be]}],"outline-w":[{outline:["",Le,Al,Di]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",x,Ku,Ju]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",p,Ku,Ju]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Le,Di]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",b,Ku,Ju]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Le,ve,be]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"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":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[ve,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:C()}],"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",v,Ku,Ju]}],"drop-shadow-color":[{"drop-shadow":Y()}],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":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"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",_,ve,be]}],delay:[{delay:[Le,ve,be]}],animate:[{animate:["none",E,ve,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[z,ve,be]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:yt()}],"scale-x":[{"scale-x":yt()}],"scale-y":[{"scale-y":yt()}],"scale-z":[{"scale-z":yt()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[ve,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",...Y()]}],"stroke-w":[{stroke:[Le,Al,Di,yp]}],stroke:[{stroke:["none",...Y()]}],"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"]}},no=F7(uI);function Ye({label:e,error:t,helperText:n,className:a,...s}){return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),u.jsx("input",{className:no("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&&u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&u.jsx("p",{className:"text-xs text-red-500",children:t})]})}function pn({label:e,options:t,error:n,helperText:a,className:s,...c}){return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),u.jsx("select",{className:no("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),...c,children:t.map(o=>u.jsx("option",{value:o.value,className:"bg-azure-bg dark:bg-black",children:o.label},o.value))}),a&&!n&&u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&u.jsx("p",{className:"text-xs text-red-500",children:n})]})}function Ft({label:e,error:t,helperText:n,className:a,...s}){return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),u.jsx("input",{type:"number",className:no("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&&u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&u.jsx("p",{className:"text-xs text-red-500",children:t})]})}function _r({label:e,checked:t,onChange:n,helperText:a,disabled:s}){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:no("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",s&&"opacity-50"),children:e}),a&&u.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),u.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!s&&n(!t),className:no("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:u.jsx("span",{className:no("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const tn={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"),getSmithsConfig:async()=>await xe.get("/smiths/config"),updateSmithsConfig:async e=>xe.put("/smiths/config",e),getSmithsList:async()=>xe.get("/smiths"),pingSmith:async e=>xe.post(`/smiths/${e}/ping`,{}),removeSmith:async e=>xe.delete(`/smiths/${e}`)};function re(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:o,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=o.prototype,x=Object.keys(m);for(let p=0;p<x.length;p++){const b=x[p];b in d||(d[b]=m[b].bind(d))}}const s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function o(d){var h;const m=n?.Parent?new c:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const x of m._zod.deferred)x();return m}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}let ro=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},I2=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const B2={};function ai(e){return B2}function V2(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 Tx(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 Kg(e){return e==null}function Xg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function dI(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 c=n>s?n:s,o=Number.parseInt(e.toFixed(c).replace(".","")),d=Number.parseInt(t.toFixed(c).replace(".",""));return o%d/10**c}const Yw=Symbol("evaluating");function at(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Yw)return a===void 0&&(a=Yw,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ki(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ci(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Jw(e){return JSON.stringify(e)}function fI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const hI=Wd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function fo(e){if(nc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(nc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function F2(e){return fo(e)?{...e}:Array.isArray(e)?[...e]:e}const mI=new Set(["string","number","symbol"]);function ho(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ui(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 pI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const xI={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 gI(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 c=ci(e._zod.def,{get shape(){const o={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(o[d]=n.shape[d])}return Ki(this,"shape",o),o},checks:[]});return ui(e,c)}function yI(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 c=ci(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete o[d]}return Ki(this,"shape",o),o},checks:[]});return ui(e,c)}function bI(e,t){if(!fo(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const c=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(c,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=ci(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ki(this,"shape",c),c}});return ui(e,s)}function vI(e,t){if(!fo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ci(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ki(this,"shape",a),a}});return ui(e,n)}function kI(e,t){const n=ci(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ki(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ui(e,n)}function wI(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 o=ci(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Ki(this,"shape",h),h},checks:[]});return ui(t,o)}function SI(e,t,n){const a=ci(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const o in n){if(!(o in c))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(c[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)c[o]=new e({type:"nonoptional",innerType:s[o]});return Ki(this,"shape",c),c}});return ui(t,a)}function Js(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 Ks(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Xu(e){return typeof e=="string"?e:e?.message}function ii(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Xu(e.inst?._zod.def?.error?.(e))??Xu(t?.error?.(e))??Xu(n.customError?.(e))??Xu(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Qg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const H2=(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,Tx,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},q2=re("$ZodError",H2),G2=re("$ZodError",H2,{Parent:Error});function zI(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 jI(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(o=>a({issues:o}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)n._errors.push(t(c));else{let o=n,d=0;for(;d<c.path.length;){const h=c.path[d];d===c.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(c))):o[h]=o[h]||{_errors:[]},o=o[h],d++}}};return a(e),n}const Wg=e=>(t,n,a,s)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new ro;if(o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>ii(h,c,ai())));throw Z2(d,s?.callee),d}return o.value},ey=e=>async(t,n,a,s)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise&&(o=await o),o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>ii(h,c,ai())));throw Z2(d,s?.callee),d}return o.value},ef=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new ro;return c.issues.length?{success:!1,error:new(e??q2)(c.issues.map(o=>ii(o,s,ai())))}:{success:!0,data:c.value}},_I=ef(G2),tf=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},s);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(o=>ii(o,s,ai())))}:{success:!0,data:c.value}},NI=tf(G2),CI=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Wg(e)(t,n,s)},TI=e=>(t,n,a)=>Wg(e)(t,n,a),EI=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ey(e)(t,n,s)},AI=e=>async(t,n,a)=>ey(e)(t,n,a),OI=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ef(e)(t,n,s)},MI=e=>(t,n,a)=>ef(e)(t,n,a),DI=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return tf(e)(t,n,s)},RI=e=>async(t,n,a)=>tf(e)(t,n,a),$I=/^[cC][^\s-]{8,}$/,LI=/^[0-9a-z]+$/,PI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,UI=/^[0-9a-vA-V]{20}$/,II=/^[A-Za-z0-9]{27}$/,BI=/^[a-zA-Z0-9_-]{21}$/,VI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ZI=/^([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})$/,Kw=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)$/,FI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qI(){return new RegExp(HI,"u")}const GI=/^(?:(?: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])$/,YI=/^(([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}|:))$/,JI=/^((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])$/,KI=/^(([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])$/,XI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Y2=/^[A-Za-z0-9_-]*$/,QI=/^\+[1-9]\d{6,14}$/,J2="(?:(?:\\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])))",WI=new RegExp(`^${J2}$`);function K2(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 eB(e){return new RegExp(`^${K2(e)}$`)}function tB(e){const t=K2({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(`^${J2}T(?:${a})$`)}const nB=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},rB=/^-?\d+$/,X2=/^-?\d+(?:\.\d+)?$/,aB=/^(?:true|false)$/i,iB=/^[^A-Z]*$/,sB=/^[^a-z]*$/,Zn=re("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Q2={number:"number",bigint:"bigint",object:"date"},W2=re("$ZodCheckLessThan",(e,t)=>{Zn.init(e,t);const n=Q2[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,c=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(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})}}),eN=re("$ZodCheckGreaterThan",(e,t)=>{Zn.init(e,t);const n=Q2[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,c=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(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})}}),oB=re("$ZodCheckMultipleOf",(e,t)=>{Zn.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):dI(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})}}),lB=re("$ZodCheckNumberFormat",(e,t)=>{Zn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,c]=xI[t.format];e._zod.onattach.push(o=>{const d=o._zod.bag;d.format=t.format,d.minimum=s,d.maximum=c,n&&(d.pattern=rB)}),e._zod.check=o=>{const d=o.value;if(n){if(!Number.isInteger(d)){o.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?o.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):o.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}d<s&&o.issues.push({origin:"number",input:d,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),d>c&&o.issues.push({origin:"number",input:d,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),cB=re("$ZodCheckMaxLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Kg(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 o=Qg(s);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),uB=re("$ZodCheckMinLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Kg(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 o=Qg(s);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),dB=re("$ZodCheckLengthEquals",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Kg(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,c=s.length;if(c===t.length)return;const o=Qg(s),d=c>t.length;a.issues.push({origin:o,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),nf=re("$ZodCheckStringFormat",(e,t)=>{var n,a;Zn.init(e,t),e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.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=()=>{})}),fB=re("$ZodCheckRegex",(e,t)=>{nf.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})}}),hB=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iB),nf.init(e,t)}),mB=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=sB),nf.init(e,t)}),pB=re("$ZodCheckIncludes",(e,t)=>{Zn.init(e,t);const n=ho(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.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})}}),xB=re("$ZodCheckStartsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`^${ho(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})}}),gB=re("$ZodCheckEndsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`.*${ho(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})}}),yB=re("$ZodCheckOverwrite",(e,t)=>{Zn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let bB=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(`
|
|
85
|
+
`).filter(o=>o),s=Math.min(...a.map(o=>o.length-o.trimStart().length)),c=a.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of c)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,s.join(`
|
|
86
|
+
`))}};const vB={major:4,minor:3,patch:6},Tt=re("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vB;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const c of s._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,d,h)=>{let m=Js(o),x;for(const p of d){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(m)continue;const b=o.issues.length,v=p._zod.check(o);if(v instanceof Promise&&h?.async===!1)throw new ro;if(x||v instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await v,o.issues.length!==b&&(m||(m=Js(o,b)))});else{if(o.issues.length===b)continue;m||(m=Js(o,b))}}return x?x.then(()=>o):o},c=(o,d,h)=>{if(Js(o))return o.aborted=!0,o;const m=s(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new ro;return m.then(x=>e._zod.parse(x,h))}return e._zod.parse(m,h)};e._zod.run=(o,d)=>{if(d.skipChecks)return e._zod.parse(o,d);if(d.direction==="backward"){const m=e._zod.parse({value:o.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(x=>c(x,o,d)):c(m,o,d)}const h=e._zod.parse(o,d);if(h instanceof Promise){if(d.async===!1)throw new ro;return h.then(m=>s(m,a,d))}return s(h,a,d)}}at(e,"~standard",()=>({validate:s=>{try{const c=_I(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return NI(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ty=re("$ZodString",(e,t)=>{Tt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nB(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}}),_t=re("$ZodStringFormat",(e,t)=>{nf.init(e,t),ty.init(e,t)}),kB=re("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ZI),_t.init(e,t)}),wB=re("$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=Kw(a))}else t.pattern??(t.pattern=Kw());_t.init(e,t)}),SB=re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=FI),_t.init(e,t)}),zB=re("$ZodURL",(e,t)=>{_t.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})}}}),jB=re("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qI()),_t.init(e,t)}),_B=re("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=BI),_t.init(e,t)}),NB=re("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$I),_t.init(e,t)}),CB=re("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=LI),_t.init(e,t)}),TB=re("$ZodULID",(e,t)=>{t.pattern??(t.pattern=PI),_t.init(e,t)}),EB=re("$ZodXID",(e,t)=>{t.pattern??(t.pattern=UI),_t.init(e,t)}),AB=re("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=II),_t.init(e,t)}),OB=re("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tB(t)),_t.init(e,t)}),MB=re("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=WI),_t.init(e,t)}),DB=re("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eB(t)),_t.init(e,t)}),RB=re("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=VI),_t.init(e,t)}),$B=re("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=GI),_t.init(e,t),e._zod.bag.format="ipv4"}),LB=re("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=YI),_t.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})}}}),PB=re("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=JI),_t.init(e,t)}),UB=re("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=KI),_t.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,c]=a;if(!c)throw new Error;const o=Number(c);if(`${o}`!==c)throw new Error;if(o<0||o>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 tN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const IB=re("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=XI),_t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{tN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function BB(e){if(!Y2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return tN(n)}const VB=re("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Y2),_t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{BB(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ZB=re("$ZodE164",(e,t)=>{t.pattern??(t.pattern=QI),_t.init(e,t)});function FB(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 HB=re("$ZodJWT",(e,t)=>{_t.init(e,t),e._zod.check=n=>{FB(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),nN=re("$ZodNumber",(e,t)=>{Tt.init(e,t),e._zod.pattern=e._zod.bag.pattern??X2,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 c=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,...c?{received:c}:{}}),n}}),qB=re("$ZodNumberFormat",(e,t)=>{lB.init(e,t),nN.init(e,t)}),GB=re("$ZodBoolean",(e,t)=>{Tt.init(e,t),e._zod.pattern=aB,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}}),YB=re("$ZodUnknown",(e,t)=>{Tt.init(e,t),e._zod.parse=n=>n}),JB=re("$ZodNever",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Xw(e,t,n){e.issues.length&&t.issues.push(...Ks(n,e.issues)),t.value[n]=e.value}const KB=re("$ZodArray",(e,t)=>{Tt.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 c=[];for(let o=0;o<s.length;o++){const d=s[o],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?c.push(h.then(m=>Xw(m,n,o))):Xw(h,n,o)}return c.length?Promise.all(c).then(()=>n):n}});function Od(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Ks(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function rN(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=pI(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function aN(e,t,n,a,s,c){const o=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,x=h.optout==="optional";for(const p in t){if(d.has(p))continue;if(m==="never"){o.push(p);continue}const b=h.run({value:t[p],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Od(v,n,p,t,x))):Od(b,n,p,t,x)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const XB=re("$ZodObject",(e,t)=>{if(Tt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=Wd(()=>rN(t));at(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const x=d[m]._zod;if(x.values){h[m]??(h[m]=new Set);for(const p of x.values)h[m].add(p)}}return h});const s=nc,c=t.catchall;let o;e._zod.parse=(d,h)=>{o??(o=a.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const x=[],p=o.shape;for(const b of o.keys){const v=p[b],S=v._zod.optout==="optional",z=v._zod.run({value:m[b],issues:[]},h);z instanceof Promise?x.push(z.then(A=>Od(A,d,b,m,S))):Od(z,d,b,m,S)}return c?aN(x,m,d,h,a.value,e):x.length?Promise.all(x).then(()=>d):d}}),QB=re("$ZodObjectJIT",(e,t)=>{XB.init(e,t);const n=e._zod.parse,a=Wd(()=>rN(t)),s=b=>{const v=new bB(["shape","payload","ctx"]),S=a.value,z=N=>{const P=Jw(N);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};v.write("const input = payload.value;");const A=Object.create(null);let _=0;for(const N of S.keys)A[N]=`key_${_++}`;v.write("const newResult = {};");for(const N of S.keys){const P=A[N],D=Jw(N),V=b[N]?._zod?.optout==="optional";v.write(`const ${P} = ${z(N)};`),V?v.write(`
|
|
87
|
+
if (${P}.issues.length) {
|
|
88
|
+
if (${D} in input) {
|
|
89
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
90
|
+
...iss,
|
|
91
|
+
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
92
|
+
})));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (${P}.value === undefined) {
|
|
97
|
+
if (${D} in input) {
|
|
98
|
+
newResult[${D}] = undefined;
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
newResult[${D}] = ${P}.value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
`):v.write(`
|
|
105
|
+
if (${P}.issues.length) {
|
|
106
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
107
|
+
...iss,
|
|
108
|
+
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
109
|
+
})));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (${P}.value === undefined) {
|
|
113
|
+
if (${D} in input) {
|
|
114
|
+
newResult[${D}] = undefined;
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
newResult[${D}] = ${P}.value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(N,P)=>E(b,N,P)};let c;const o=nc,d=!B2.jitless,m=d&&hI.value,x=t.catchall;let p;e._zod.parse=(b,v)=>{p??(p=a.value);const S=b.value;return o(S)?d&&m&&v?.async===!1&&v.jitless!==!0?(c||(c=s(t.shape)),b=c(b,v),x?aN([],S,b,v,p,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function Qw(e,t,n,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const s=e.filter(c=>!Js(c));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(c=>c.issues.map(o=>ii(o,a,ai())))}),t)}const iN=re("$ZodUnion",(e,t)=>{Tt.init(e,t),at(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),at(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),at(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),at(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${s.map(c=>Xg(c.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,c)=>{if(n)return a(s,c);let o=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},c);if(m instanceof Promise)d.push(m),o=!0;else{if(m.issues.length===0)return m;d.push(m)}}return o?Promise.all(d).then(h=>Qw(h,s,e,c)):Qw(d,s,e,c)}}),WB=re("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,iN.init(e,t);const n=e._zod.parse;at(e._zod,"propValues",()=>{const s={};for(const c of t.options){const o=c._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(const[d,h]of Object.entries(o)){s[d]||(s[d]=new Set);for(const m of h)s[d].add(m)}}return s});const a=Wd(()=>{const s=t.options,c=new Map;for(const o of s){const d=o._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const h of d){if(c.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);c.set(h,o)}}return c});e._zod.parse=(s,c)=>{const o=s.value;if(!nc(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const d=a.value.get(o?.[t.discriminator]);return d?d._zod.run(s,c):t.unionFallback?n(s,c):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),eV=re("$ZodIntersection",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,c=t.left._zod.run({value:s,issues:[]},a),o=t.right._zod.run({value:s,issues:[]},a);return c instanceof Promise||o instanceof Promise?Promise.all([c,o]).then(([h,m])=>Ww(n,h,m)):Ww(n,c,o)}});function Ex(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(fo(e)&&fo(t)){const n=Object.keys(t),a=Object.keys(e).filter(c=>n.indexOf(c)!==-1),s={...e,...t};for(const c of a){const o=Ex(e[c],t[c]);if(!o.valid)return{valid:!1,mergeErrorPath:[c,...o.mergeErrorPath]};s[c]=o.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],c=t[a],o=Ex(s,c);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ww(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const c=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(c.length&&s&&e.issues.push({...s,keys:c}),Js(e))return e;const o=Ex(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const tV=re("$ZodRecord",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!fo(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const c=[],o=t.keyType._zod.values;if(o){n.value={};const d=new Set;for(const m of o)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);const x=t.valueType._zod.run({value:s[m],issues:[]},a);x instanceof Promise?c.push(x.then(p=>{p.issues.length&&n.issues.push(...Ks(m,p.issues)),n.value[m]=p.value})):(x.issues.length&&n.issues.push(...Ks(m,x.issues)),n.value[m]=x.value)}let h;for(const m in s)d.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 d of Reflect.ownKeys(s)){if(d==="__proto__")continue;let h=t.keyType._zod.run({value:d,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&X2.test(d)&&h.issues.length){const p=t.keyType._zod.run({value:Number(d),issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(h=p)}if(h.issues.length){t.mode==="loose"?n.value[d]=s[d]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(p=>ii(p,a,ai())),input:d,path:[d],inst:e});continue}const x=t.valueType._zod.run({value:s[d],issues:[]},a);x instanceof Promise?c.push(x.then(p=>{p.issues.length&&n.issues.push(...Ks(d,p.issues)),n.value[h.value]=p.value})):(x.issues.length&&n.issues.push(...Ks(d,x.issues)),n.value[h.value]=x.value)}}return c.length?Promise.all(c).then(()=>n):n}}),nV=re("$ZodEnum",(e,t)=>{Tt.init(e,t);const n=V2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>mI.has(typeof s)).map(s=>typeof s=="string"?ho(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const o=s.value;return a.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),rV=re("$ZodLiteral",(e,t)=>{if(Tt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?ho(a):a?ho(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const c=a.value;return n.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),aV=re("$ZodTransform",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new I2(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new ro;return n.value=s,n}});function eS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const sN=re("$ZodOptional",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",at(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),at(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Xg(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(c=>eS(c,n.value)):eS(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),iV=re("$ZodExactOptional",(e,t)=>{sN.init(e,t),at(e._zod,"values",()=>t.innerType._zod.values),at(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),sV=re("$ZodNullable",(e,t)=>{Tt.init(e,t),at(e._zod,"optin",()=>t.innerType._zod.optin),at(e._zod,"optout",()=>t.innerType._zod.optout),at(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Xg(n.source)}|null)$`):void 0}),at(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)}),oV=re("$ZodDefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",at(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(c=>tS(c,t)):tS(s,t)}});function tS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const lV=re("$ZodPrefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",at(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))}),cV=re("$ZodNonOptional",(e,t)=>{Tt.init(e,t),at(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(c=>nS(c,e)):nS(s,e)}});function nS(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 uV=re("$ZodCatch",(e,t)=>{Tt.init(e,t),at(e._zod,"optin",()=>t.innerType._zod.optin),at(e._zod,"optout",()=>t.innerType._zod.optout),at(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(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(o=>ii(o,a,ai()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(c=>ii(c,a,ai()))},input:n.value}),n.issues=[]),n)}}),dV=re("$ZodPipe",(e,t)=>{Tt.init(e,t),at(e._zod,"values",()=>t.in._zod.values),at(e._zod,"optin",()=>t.in._zod.optin),at(e._zod,"optout",()=>t.out._zod.optout),at(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(n,a);return c instanceof Promise?c.then(o=>Qu(o,t.in,a)):Qu(c,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(c=>Qu(c,t.out,a)):Qu(s,t.out,a)}});function Qu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const fV=re("$ZodReadonly",(e,t)=>{Tt.init(e,t),at(e._zod,"propValues",()=>t.innerType._zod.propValues),at(e._zod,"values",()=>t.innerType._zod.values),at(e._zod,"optin",()=>t.innerType?._zod?.optin),at(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(rS):rS(s)}});function rS(e){return e.value=Object.freeze(e.value),e}const hV=re("$ZodCustom",(e,t)=>{Zn.init(e,t),Tt.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(c=>aS(c,n,a,e));aS(s,n,a,e)}});function aS(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(rc(s))}}var iS;let mV=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 pV(){return new mV}(iS=globalThis).__zod_globalRegistry??(iS.__zod_globalRegistry=pV());const Rl=globalThis.__zod_globalRegistry;function xV(e,t){return new e({type:"string",...ze(t)})}function gV(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function sS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function yV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function bV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function vV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function kV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function wV(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function SV(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function zV(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function jV(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function _V(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function NV(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function CV(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function TV(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function EV(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function AV(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function OV(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function MV(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function DV(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function RV(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function $V(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function LV(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function PV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function UV(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function IV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function BV(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function VV(e,t){return new e({type:"number",checks:[],...ze(t)})}function ZV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function FV(e,t){return new e({type:"boolean",...ze(t)})}function HV(e){return new e({type:"unknown"})}function qV(e,t){return new e({type:"never",...ze(t)})}function oS(e,t){return new W2({check:"less_than",...ze(t),value:e,inclusive:!1})}function bp(e,t){return new W2({check:"less_than",...ze(t),value:e,inclusive:!0})}function lS(e,t){return new eN({check:"greater_than",...ze(t),value:e,inclusive:!1})}function vp(e,t){return new eN({check:"greater_than",...ze(t),value:e,inclusive:!0})}function cS(e,t){return new oB({check:"multiple_of",...ze(t),value:e})}function oN(e,t){return new cB({check:"max_length",...ze(t),maximum:e})}function Md(e,t){return new uB({check:"min_length",...ze(t),minimum:e})}function lN(e,t){return new dB({check:"length_equals",...ze(t),length:e})}function GV(e,t){return new fB({check:"string_format",format:"regex",...ze(t),pattern:e})}function YV(e){return new hB({check:"string_format",format:"lowercase",...ze(e)})}function JV(e){return new mB({check:"string_format",format:"uppercase",...ze(e)})}function KV(e,t){return new pB({check:"string_format",format:"includes",...ze(t),includes:e})}function XV(e,t){return new xB({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function QV(e,t){return new gB({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function No(e){return new yB({check:"overwrite",tx:e})}function WV(e){return No(t=>t.normalize(e))}function eZ(){return No(e=>e.trim())}function tZ(){return No(e=>e.toLowerCase())}function nZ(){return No(e=>e.toUpperCase())}function rZ(){return No(e=>fI(e))}function aZ(e,t,n){return new e({type:"array",element:t,...ze(n)})}function iZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function sZ(e){const t=oZ(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(rc(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(rc(s))}},e(n.value,n)));return t}function oZ(e,t){const n=new Zn({check:"custom",...ze(t)});return n._zod.check=e,n}function cN(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??Rl,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 Gt(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const d=e._zod.toJSONSchema?.();if(d)o.schema=d;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,x);else{const b=o.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,x)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),Gt(p,t,x),t.seen.get(p).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(o.schema,h),t.io==="input"&&jn(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function uN(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 o of e.seen.entries()){const d=e.metadataRegistry.get(o[0])?.id;if(d){const h=a.get(d);if(h&&h!==o[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,o[0])}}const s=o=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,b=e.external.uri??(S=>S);if(p)return{ref:b(p)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(o[1]===n)return{ref:"#"};const m=`#/${d}/`,x=o[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:m+x}},c=o=>{if(o[1].schema.$ref)return;const d=o[1],{ref:h,defId:m}=s(o);d.def={...d.schema},m&&(d.defId=m);const x=d.schema;for(const p in x)delete x[p];x.$ref=h};if(e.cycles==="throw")for(const o of e.seen.entries()){const d=o[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
121
|
+
|
|
122
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const d=o[1];if(t===o[0]){c(o);continue}if(e.external){const m=e.external.registry.get(o[0])?.id;if(t!==o[0]&&m){c(o);continue}}if(e.metadataRegistry.get(o[0])?.id){c(o);continue}if(d.cycle){c(o);continue}if(d.count>1&&e.reused==="ref"){c(o);continue}}}function dN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const d=e.seen.get(o);if(d.ref===null)return;const h=d.def??d.schema,m={...h},x=d.ref;if(d.ref=null,x){a(x);const b=e.seen.get(x),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),o._zod.parent===x)for(const z in h)z==="$ref"||z==="allOf"||z in m||delete h[z];if(v.$ref&&b.def)for(const z in h)z==="$ref"||z==="allOf"||z in b.def&&JSON.stringify(h[z])===JSON.stringify(b.def[z])&&delete h[z]}const p=o._zod.parent;if(p&&p!==x){a(p);const b=e.seen.get(p);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:o,jsonSchema:h,path:d.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[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 o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const c=e.external?.defs??{};for(const o of e.seen.entries()){const d=o[1];d.def&&d.defId&&(c[d.defId]=d.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Dd(t,"input",e.processors),output:Dd(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function jn(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 jn(a.element,n);if(a.type==="set")return jn(a.valueType,n);if(a.type==="lazy")return jn(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 jn(a.innerType,n);if(a.type==="intersection")return jn(a.left,n)||jn(a.right,n);if(a.type==="record"||a.type==="map")return jn(a.keyType,n)||jn(a.valueType,n);if(a.type==="pipe")return jn(a.in,n)||jn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(jn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(jn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(jn(s,n))return!0;return!!(a.rest&&jn(a.rest,n))}return!1}const lZ=(e,t={})=>n=>{const a=cN({...n,processors:t});return Gt(e,a),uN(a,e),dN(a,e)},Dd=(e,t,n={})=>a=>{const{libraryOptions:s,target:c}=a??{},o=cN({...s??{},target:c,io:t,processors:n});return Gt(e,o),uN(o,e),dN(o,e)},cZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uZ=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:c,maximum:o,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof o=="number"&&(s.maxLength=o),d&&(s.format=cZ[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},dZ=(e,t,n,a)=>{const s=n,{minimum:c,maximum:o,format:d,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:x}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number",typeof x=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=x,s.exclusiveMinimum=!0):s.exclusiveMinimum=x),typeof c=="number"&&(s.minimum=c,typeof x=="number"&&t.target!=="draft-04"&&(x>=c?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 o=="number"&&(s.maximum=o,typeof m=="number"&&t.target!=="draft-04"&&(m<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof h=="number"&&(s.multipleOf=h)},fZ=(e,t,n,a)=>{n.type="boolean"},hZ=(e,t,n,a)=>{n.not={}},mZ=(e,t,n,a)=>{},pZ=(e,t,n,a)=>{const s=e._zod.def,c=V2(s.entries);c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),n.enum=c},xZ=(e,t,n,a)=>{const s=e._zod.def,c=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(o))}else c.push(o);if(c.length!==0)if(c.length===1){const o=c[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),c.every(o=>typeof o=="boolean")&&(n.type="boolean"),c.every(o=>o===null)&&(n.type="null"),n.enum=c},gZ=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},yZ=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},bZ=(e,t,n,a)=>{const s=n,c=e._zod.def,{minimum:o,maximum:d}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Gt(c.element,t,{...a,path:[...a.path,"items"]})},vZ=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object",s.properties={};const o=c.shape;for(const m in o)s.properties[m]=Gt(o[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(o)),h=new Set([...d].filter(m=>{const x=c.shape[m]._zod;return t.io==="input"?x.optin===void 0:x.optout===void 0}));h.size>0&&(s.required=Array.from(h)),c.catchall?._zod.def.type==="never"?s.additionalProperties=!1:c.catchall?c.catchall&&(s.additionalProperties=Gt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},kZ=(e,t,n,a)=>{const s=e._zod.def,c=s.inclusive===!1,o=s.options.map((d,h)=>Gt(d,t,{...a,path:[...a.path,c?"oneOf":"anyOf",h]}));c?n.oneOf=o:n.anyOf=o},wZ=(e,t,n,a)=>{const s=e._zod.def,c=Gt(s.left,t,{...a,path:[...a.path,"allOf",0]}),o=Gt(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(c)?c.allOf:[c],...d(o)?o.allOf:[o]];n.allOf=h},SZ=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object";const o=c.keyType,h=o._zod.bag?.patterns;if(c.mode==="loose"&&h&&h.size>0){const x=Gt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const p of h)s.patternProperties[p.source]=x}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Gt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Gt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=o._zod.values;if(m){const x=[...m].filter(p=>typeof p=="string"||typeof p=="number");x.length>0&&(s.required=x)}},zZ=(e,t,n,a)=>{const s=e._zod.def,c=Gt(s.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},jZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},_Z=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},NZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},CZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},TZ=(e,t,n,a)=>{const s=e._zod.def,c=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Gt(c,t,a);const o=t.seen.get(e);o.ref=c},EZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.readOnly=!0},fN=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},AZ=re("ZodISODateTime",(e,t)=>{OB.init(e,t),At.init(e,t)});function OZ(e){return PV(AZ,e)}const MZ=re("ZodISODate",(e,t)=>{MB.init(e,t),At.init(e,t)});function DZ(e){return UV(MZ,e)}const RZ=re("ZodISOTime",(e,t)=>{DB.init(e,t),At.init(e,t)});function $Z(e){return IV(RZ,e)}const LZ=re("ZodISODuration",(e,t)=>{RB.init(e,t),At.init(e,t)});function PZ(e){return BV(LZ,e)}const UZ=(e,t)=>{q2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>jI(e,n)},flatten:{value:n=>zI(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Tx,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Tx,2)}},isEmpty:{get(){return e.issues.length===0}}})},br=re("ZodError",UZ,{Parent:Error}),IZ=Wg(br),BZ=ey(br),VZ=ef(br),ZZ=tf(br),FZ=CI(br),HZ=TI(br),qZ=EI(br),GZ=AI(br),YZ=OI(br),JZ=MI(br),KZ=DI(br),XZ=RI(br),Et=re("ZodType",(e,t)=>(Tt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Dd(e,"input"),output:Dd(e,"output")}}),e.toJSONSchema=lZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ci(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>ui(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>IZ(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>VZ(e,n,a),e.parseAsync=async(n,a)=>BZ(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>ZZ(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>FZ(e,n,a),e.decode=(n,a)=>HZ(e,n,a),e.encodeAsync=async(n,a)=>qZ(e,n,a),e.decodeAsync=async(n,a)=>GZ(e,n,a),e.safeEncode=(n,a)=>YZ(e,n,a),e.safeDecode=(n,a)=>JZ(e,n,a),e.safeEncodeAsync=async(n,a)=>KZ(e,n,a),e.safeDecodeAsync=async(n,a)=>XZ(e,n,a),e.refine=(n,a)=>e.check(HF(n,a)),e.superRefine=n=>e.check(qF(n)),e.overwrite=n=>e.check(No(n)),e.optional=()=>mS(e),e.exactOptional=()=>OF(e),e.nullable=()=>pS(e),e.nullish=()=>mS(pS(e)),e.nonoptional=n=>PF(e,n),e.array=()=>si(e),e.or=n=>xN([e,n]),e.and=n=>_F(e,n),e.transform=n=>xS(e,EF(n)),e.default=n=>RF(e,n),e.prefault=n=>LF(e,n),e.catch=n=>IF(e,n),e.pipe=n=>xS(e,n),e.readonly=()=>ZF(e),e.describe=n=>{const a=e.clone();return Rl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return Rl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Rl.get(e);const a=e.clone();return Rl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),hN=re("_ZodString",(e,t)=>{ty.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,c)=>uZ(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(GV(...a)),e.includes=(...a)=>e.check(KV(...a)),e.startsWith=(...a)=>e.check(XV(...a)),e.endsWith=(...a)=>e.check(QV(...a)),e.min=(...a)=>e.check(Md(...a)),e.max=(...a)=>e.check(oN(...a)),e.length=(...a)=>e.check(lN(...a)),e.nonempty=(...a)=>e.check(Md(1,...a)),e.lowercase=a=>e.check(YV(a)),e.uppercase=a=>e.check(JV(a)),e.trim=()=>e.check(eZ()),e.normalize=(...a)=>e.check(WV(...a)),e.toLowerCase=()=>e.check(tZ()),e.toUpperCase=()=>e.check(nZ()),e.slugify=()=>e.check(rZ())}),QZ=re("ZodString",(e,t)=>{ty.init(e,t),hN.init(e,t),e.email=n=>e.check(gV(WZ,n)),e.url=n=>e.check(wV(eF,n)),e.jwt=n=>e.check(LV(pF,n)),e.emoji=n=>e.check(SV(tF,n)),e.guid=n=>e.check(sS(uS,n)),e.uuid=n=>e.check(yV(Wu,n)),e.uuidv4=n=>e.check(bV(Wu,n)),e.uuidv6=n=>e.check(vV(Wu,n)),e.uuidv7=n=>e.check(kV(Wu,n)),e.nanoid=n=>e.check(zV(nF,n)),e.guid=n=>e.check(sS(uS,n)),e.cuid=n=>e.check(jV(rF,n)),e.cuid2=n=>e.check(_V(aF,n)),e.ulid=n=>e.check(NV(iF,n)),e.base64=n=>e.check(DV(fF,n)),e.base64url=n=>e.check(RV(hF,n)),e.xid=n=>e.check(CV(sF,n)),e.ksuid=n=>e.check(TV(oF,n)),e.ipv4=n=>e.check(EV(lF,n)),e.ipv6=n=>e.check(AV(cF,n)),e.cidrv4=n=>e.check(OV(uF,n)),e.cidrv6=n=>e.check(MV(dF,n)),e.e164=n=>e.check($V(mF,n)),e.datetime=n=>e.check(OZ(n)),e.date=n=>e.check(DZ(n)),e.time=n=>e.check($Z(n)),e.duration=n=>e.check(PZ(n))});function qe(e){return xV(QZ,e)}const At=re("ZodStringFormat",(e,t)=>{_t.init(e,t),hN.init(e,t)}),WZ=re("ZodEmail",(e,t)=>{SB.init(e,t),At.init(e,t)}),uS=re("ZodGUID",(e,t)=>{kB.init(e,t),At.init(e,t)}),Wu=re("ZodUUID",(e,t)=>{wB.init(e,t),At.init(e,t)}),eF=re("ZodURL",(e,t)=>{zB.init(e,t),At.init(e,t)}),tF=re("ZodEmoji",(e,t)=>{jB.init(e,t),At.init(e,t)}),nF=re("ZodNanoID",(e,t)=>{_B.init(e,t),At.init(e,t)}),rF=re("ZodCUID",(e,t)=>{NB.init(e,t),At.init(e,t)}),aF=re("ZodCUID2",(e,t)=>{CB.init(e,t),At.init(e,t)}),iF=re("ZodULID",(e,t)=>{TB.init(e,t),At.init(e,t)}),sF=re("ZodXID",(e,t)=>{EB.init(e,t),At.init(e,t)}),oF=re("ZodKSUID",(e,t)=>{AB.init(e,t),At.init(e,t)}),lF=re("ZodIPv4",(e,t)=>{$B.init(e,t),At.init(e,t)}),cF=re("ZodIPv6",(e,t)=>{LB.init(e,t),At.init(e,t)}),uF=re("ZodCIDRv4",(e,t)=>{PB.init(e,t),At.init(e,t)}),dF=re("ZodCIDRv6",(e,t)=>{UB.init(e,t),At.init(e,t)}),fF=re("ZodBase64",(e,t)=>{IB.init(e,t),At.init(e,t)}),hF=re("ZodBase64URL",(e,t)=>{VB.init(e,t),At.init(e,t)}),mF=re("ZodE164",(e,t)=>{ZB.init(e,t),At.init(e,t)}),pF=re("ZodJWT",(e,t)=>{HB.init(e,t),At.init(e,t)}),mN=re("ZodNumber",(e,t)=>{nN.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,c)=>dZ(e,a,s),e.gt=(a,s)=>e.check(lS(a,s)),e.gte=(a,s)=>e.check(vp(a,s)),e.min=(a,s)=>e.check(vp(a,s)),e.lt=(a,s)=>e.check(oS(a,s)),e.lte=(a,s)=>e.check(bp(a,s)),e.max=(a,s)=>e.check(bp(a,s)),e.int=a=>e.check(dS(a)),e.safe=a=>e.check(dS(a)),e.positive=a=>e.check(lS(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(oS(0,a)),e.nonpositive=a=>e.check(bp(0,a)),e.multipleOf=(a,s)=>e.check(cS(a,s)),e.step=(a,s)=>e.check(cS(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 En(e){return VV(mN,e)}const xF=re("ZodNumberFormat",(e,t)=>{qB.init(e,t),mN.init(e,t)});function dS(e){return ZV(xF,e)}const gF=re("ZodBoolean",(e,t)=>{GB.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fZ(e,n,a)});function gn(e){return FV(gF,e)}const yF=re("ZodUnknown",(e,t)=>{YB.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mZ()});function fS(){return HV(yF)}const bF=re("ZodNever",(e,t)=>{JB.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hZ(e,n,a)});function vF(e){return qV(bF,e)}const kF=re("ZodArray",(e,t)=>{KB.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>bZ(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(Md(n,a)),e.nonempty=n=>e.check(Md(1,n)),e.max=(n,a)=>e.check(oN(n,a)),e.length=(n,a)=>e.check(lN(n,a)),e.unwrap=()=>e.element});function si(e,t){return aZ(kF,e,t)}const wF=re("ZodObject",(e,t)=>{QB.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vZ(e,n,a,s),at(e,"shape",()=>t.shape),e.keyof=()=>di(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fS()}),e.loose=()=>e.clone({...e._zod.def,catchall:fS()}),e.strict=()=>e.clone({...e._zod.def,catchall:vF()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>bI(e,n),e.safeExtend=n=>vI(e,n),e.merge=n=>kI(e,n),e.pick=n=>gI(e,n),e.omit=n=>yI(e,n),e.partial=(...n)=>wI(gN,e,n[0]),e.required=(...n)=>SI(yN,e,n[0])});function nn(e,t){const n={type:"object",shape:e??{},...ze(t)};return new wF(n)}const pN=re("ZodUnion",(e,t)=>{iN.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>kZ(e,n,a,s),e.options=t.options});function xN(e,t){return new pN({type:"union",options:e,...ze(t)})}const SF=re("ZodDiscriminatedUnion",(e,t)=>{pN.init(e,t),WB.init(e,t)});function zF(e,t,n){return new SF({type:"union",options:t,discriminator:e,...ze(n)})}const jF=re("ZodIntersection",(e,t)=>{eV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>wZ(e,n,a,s)});function _F(e,t){return new jF({type:"intersection",left:e,right:t})}const NF=re("ZodRecord",(e,t)=>{tV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>SZ(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function xd(e,t,n){return new NF({type:"record",keyType:e,valueType:t,...ze(n)})}const Ax=re("ZodEnum",(e,t)=>{nV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,c)=>pZ(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 c={};for(const o of a)if(n.has(o))c[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Ax({...t,checks:[],...ze(s),entries:c})},e.exclude=(a,s)=>{const c={...t.entries};for(const o of a)if(n.has(o))delete c[o];else throw new Error(`Key ${o} not found in enum`);return new Ax({...t,checks:[],...ze(s),entries:c})}});function di(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Ax({type:"enum",entries:n,...ze(t)})}const CF=re("ZodLiteral",(e,t)=>{rV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xZ(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 hS(e,t){return new CF({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const TF=re("ZodTransform",(e,t)=>{aV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>yZ(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new I2(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(rc(c,n.value,t));else{const o=c;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(rc(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(c=>(n.value=c,n)):(n.value=s,n)}});function EF(e){return new TF({type:"transform",transform:e})}const gN=re("ZodOptional",(e,t)=>{sN.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function mS(e){return new gN({type:"optional",innerType:e})}const AF=re("ZodExactOptional",(e,t)=>{iV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function OF(e){return new AF({type:"optional",innerType:e})}const MF=re("ZodNullable",(e,t)=>{sV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>zZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function pS(e){return new MF({type:"nullable",innerType:e})}const DF=re("ZodDefault",(e,t)=>{oV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_Z(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RF(e,t){return new DF({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():F2(t)}})}const $F=re("ZodPrefault",(e,t)=>{lV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>NZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function LF(e,t){return new $F({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():F2(t)}})}const yN=re("ZodNonOptional",(e,t)=>{cV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>jZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function PF(e,t){return new yN({type:"nonoptional",innerType:e,...ze(t)})}const UF=re("ZodCatch",(e,t)=>{uV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>CZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function IF(e,t){return new UF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const BF=re("ZodPipe",(e,t)=>{dV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>TZ(e,n,a,s),e.in=t.in,e.out=t.out});function xS(e,t){return new BF({type:"pipe",in:e,out:t})}const VF=re("ZodReadonly",(e,t)=>{fV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>EZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function ZF(e){return new VF({type:"readonly",innerType:e})}const FF=re("ZodCustom",(e,t)=>{hV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gZ(e,n)});function HF(e,t={}){return iZ(FF,e,t)}function qF(e){return sZ(e)}const xt={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}},GF=nn({provider:di(["google","openai","openrouter","ollama"]).default(xt.audio.provider),model:qe().min(1).default(xt.audio.model),enabled:gn().default(xt.audio.enabled),apiKey:qe().optional(),base_url:qe().optional(),maxDurationSeconds:En().default(xt.audio.maxDurationSeconds),supportedMimeTypes:si(qe()).default(xt.audio.supportedMimeTypes)}),Co=nn({provider:di(["openai","anthropic","openrouter","ollama","gemini"]).default(xt.llm.provider),model:qe().min(1).default(xt.llm.model),temperature:En().min(0).max(1).default(xt.llm.temperature),max_tokens:En().int().positive().optional(),api_key:qe().optional(),base_url:qe().optional(),context_window:En().int().positive().optional()}),YF=Co.extend({memory_limit:En().int().positive().optional(),enabled_archived_sessions:gn().default(!0)}),JF=Co.extend({working_dir:qe().optional(),timeout_ms:En().int().positive().optional(),execution_mode:di(["sync","async"]).default("async")}),KF=Co.extend({execution_mode:di(["sync","async"]).default("async")}),XF=Co.extend({execution_mode:di(["sync","async"]).default("async")}),QF=Co.extend({skills_dir:qe().optional()}),WF=nn({telegram_notify_all:gn().optional()}).optional(),eH=nn({timezone:qe().default("UTC"),check_interval_ms:En().min(6e4).default(6e4),max_active_jobs:En().min(1).max(1e3).default(100)}),tH=nn({sandbox_dir:qe().optional(),readonly_mode:gn().default(!1),allowed_shell_commands:si(qe()).default([]),enable_filesystem:gn().default(!0),enable_shell:gn().default(!0),enable_git:gn().default(!0),enable_network:gn().default(!0),timeout_ms:En().int().positive().default(3e4)}),nH=nn({name:qe().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/,"Smith name must be lowercase alphanumeric with hyphens/underscores"),host:qe().min(1),port:En().int().min(1).max(65535).default(7900),auth_token:qe().min(1),tls:gn().default(!1)}),rH=nn({enabled:gn().default(!1),execution_mode:di(["sync","async"]).default("async"),heartbeat_interval_ms:En().int().min(5e3).default(3e4),connection_timeout_ms:En().int().min(1e3).default(1e4),task_timeout_ms:En().int().min(1e3).default(6e4),entries:si(nH).default([])}),aH=nn({agent:nn({name:qe().default(xt.agent.name),personality:qe().default(xt.agent.personality)}).default(xt.agent),llm:Co.default(xt.llm),sati:YF.optional(),neo:KF.optional(),apoc:JF.optional(),trinity:XF.optional(),keymaker:QF.optional(),webhooks:WF,audio:GF.default(xt.audio),memory:nn({limit:En().int().positive().optional()}).default(xt.memory),runtime:nn({async_tasks:nn({enabled:gn().default(xt.runtime?.async_tasks.enabled)}).default(xt.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:eH.optional(),devkit:tH.optional(),smiths:rH.optional(),verbose_mode:gn().default(!0),channels:nn({telegram:nn({enabled:gn().default(!1),token:qe().optional(),allowedUsers:si(qe()).default([])}).default(xt.channels.telegram),discord:nn({enabled:gn().default(!1),token:qe().optional(),allowedUsers:si(qe()).default([])}).default(xt.channels.discord)}).default(xt.channels),ui:nn({enabled:gn().default(xt.ui.enabled),port:En().default(xt.ui.port)}).default(xt.ui),logging:nn({enabled:gn().default(xt.logging.enabled),level:di(["debug","info","warn","error"]).default(xt.logging.level),retention:qe().default(xt.logging.retention)}).default(xt.logging)}),iH=zF("transport",[nn({transport:hS("stdio"),command:qe().min(1,"Command is required for stdio transport"),args:si(qe()).optional().default([]),env:xd(qe(),qe()).optional().default({}),_comment:qe().optional()}),nn({transport:hS("http"),url:qe().url("Valid URL is required for http transport"),headers:xd(qe(),qe()).optional().default({}),args:si(qe()).optional().default([]),env:xd(qe(),qe()).optional().default({}),_comment:qe().optional()})]);xd(qe(),xN([iH,qe()]));function ce(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:o,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=o.prototype,x=Object.keys(m);for(let p=0;p<x.length;p++){const b=x[p];b in d||(d[b]=m[b].bind(d))}}const s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function o(d){var h;const m=n?.Parent?new c:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const x of m._zod.deferred)x();return m}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class ao extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bN extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const vN={};function Hi(e){return vN}function kN(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 Ox(e,t){return typeof t=="bigint"?t.toString():t}function ny(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ry(e){return e==null}function ay(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const gS=Symbol("evaluating");function ot(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==gS)return a===void 0&&(a=gS,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Xi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function yS(e){return JSON.stringify(e)}function sH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Rd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const oH=ny(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ac(e){if(Rd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Rd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function SN(e){return ac(e)?{...e}:Array.isArray(e)?[...e]:e}const lH=new Set(["string","number","symbol"]);function mo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hi(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 cH(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function uH(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 c=fi(e._zod.def,{get shape(){const o={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(o[d]=n.shape[d])}return Xi(this,"shape",o),o},checks:[]});return hi(e,c)}function dH(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 c=fi(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete o[d]}return Xi(this,"shape",o),o},checks:[]});return hi(e,c)}function fH(e,t){if(!ac(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const c=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(c,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=fi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Xi(this,"shape",c),c}});return hi(e,s)}function hH(e,t){if(!ac(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Xi(this,"shape",a),a}});return hi(e,n)}function mH(e,t){const n=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Xi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return hi(e,n)}function pH(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 o=fi(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Xi(this,"shape",h),h},checks:[]});return hi(t,o)}function xH(e,t,n){const a=fi(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const o in n){if(!(o in c))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(c[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)c[o]=new e({type:"nonoptional",innerType:s[o]});return Xi(this,"shape",c),c}});return hi(t,a)}function Xs(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 zN(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function ed(e){return typeof e=="string"?e:e?.message}function qi(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=ed(e.inst?._zod.def?.error?.(e))??ed(t?.error?.(e))??ed(n.customError?.(e))??ed(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function iy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ic(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const jN=(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,Ox,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_N=ce("$ZodError",jN),NN=ce("$ZodError",jN,{Parent:Error});function gH(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 yH(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(o=>a({issues:o}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)n._errors.push(t(c));else{let o=n,d=0;for(;d<c.path.length;){const h=c.path[d];d===c.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(c))):o[h]=o[h]||{_errors:[]},o=o[h],d++}}};return a(e),n}const sy=e=>(t,n,a,s)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new ao;if(o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>qi(h,c,Hi())));throw wN(d,s?.callee),d}return o.value},oy=e=>async(t,n,a,s)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise&&(o=await o),o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>qi(h,c,Hi())));throw wN(d,s?.callee),d}return o.value},rf=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new ao;return c.issues.length?{success:!1,error:new(e??_N)(c.issues.map(o=>qi(o,s,Hi())))}:{success:!0,data:c.value}},bH=rf(NN),af=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},s);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(o=>qi(o,s,Hi())))}:{success:!0,data:c.value}},vH=af(NN),kH=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return sy(e)(t,n,s)},wH=e=>(t,n,a)=>sy(e)(t,n,a),SH=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return oy(e)(t,n,s)},zH=e=>async(t,n,a)=>oy(e)(t,n,a),jH=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return rf(e)(t,n,s)},_H=e=>(t,n,a)=>rf(e)(t,n,a),NH=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return af(e)(t,n,s)},CH=e=>async(t,n,a)=>af(e)(t,n,a),TH=/^[cC][^\s-]{8,}$/,EH=/^[0-9a-z]+$/,AH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,OH=/^[0-9a-vA-V]{20}$/,MH=/^[A-Za-z0-9]{27}$/,DH=/^[a-zA-Z0-9_-]{21}$/,RH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$H=/^([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})$/,bS=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)$/,LH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,PH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function UH(){return new RegExp(PH,"u")}const IH=/^(?:(?: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])$/,BH=/^(([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}|:))$/,VH=/^((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])$/,ZH=/^(([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])$/,FH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,CN=/^[A-Za-z0-9_-]*$/,HH=/^\+[1-9]\d{6,14}$/,TN="(?:(?:\\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])))",qH=new RegExp(`^${TN}$`);function EN(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 GH(e){return new RegExp(`^${EN(e)}$`)}function YH(e){const t=EN({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(`^${TN}T(?:${a})$`)}const JH=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},KH=/^[^A-Z]*$/,XH=/^[^a-z]*$/,Fr=ce("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),QH=ce("$ZodCheckMaxLength",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ry(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 o=iy(s);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),WH=ce("$ZodCheckMinLength",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ry(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 o=iy(s);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),eq=ce("$ZodCheckLengthEquals",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ry(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,c=s.length;if(c===t.length)return;const o=iy(s),d=c>t.length;a.issues.push({origin:o,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),sf=ce("$ZodCheckStringFormat",(e,t)=>{var n,a;Fr.init(e,t),e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.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=()=>{})}),tq=ce("$ZodCheckRegex",(e,t)=>{sf.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})}}),nq=ce("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=KH),sf.init(e,t)}),rq=ce("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=XH),sf.init(e,t)}),aq=ce("$ZodCheckIncludes",(e,t)=>{Fr.init(e,t);const n=mo(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.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})}}),iq=ce("$ZodCheckStartsWith",(e,t)=>{Fr.init(e,t);const n=new RegExp(`^${mo(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})}}),sq=ce("$ZodCheckEndsWith",(e,t)=>{Fr.init(e,t);const n=new RegExp(`.*${mo(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})}}),oq=ce("$ZodCheckOverwrite",(e,t)=>{Fr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class lq{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(`
|
|
123
|
+
`).filter(o=>o),s=Math.min(...a.map(o=>o.length-o.trimStart().length)),c=a.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of c)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,s.join(`
|
|
124
|
+
`))}}const cq={major:4,minor:3,patch:6},Yt=ce("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cq;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const c of s._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,d,h)=>{let m=Xs(o),x;for(const p of d){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(m)continue;const b=o.issues.length,v=p._zod.check(o);if(v instanceof Promise&&h?.async===!1)throw new ao;if(x||v instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await v,o.issues.length!==b&&(m||(m=Xs(o,b)))});else{if(o.issues.length===b)continue;m||(m=Xs(o,b))}}return x?x.then(()=>o):o},c=(o,d,h)=>{if(Xs(o))return o.aborted=!0,o;const m=s(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new ao;return m.then(x=>e._zod.parse(x,h))}return e._zod.parse(m,h)};e._zod.run=(o,d)=>{if(d.skipChecks)return e._zod.parse(o,d);if(d.direction==="backward"){const m=e._zod.parse({value:o.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(x=>c(x,o,d)):c(m,o,d)}const h=e._zod.parse(o,d);if(h instanceof Promise){if(d.async===!1)throw new ao;return h.then(m=>s(m,a,d))}return s(h,a,d)}}ot(e,"~standard",()=>({validate:s=>{try{const c=bH(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return vH(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ly=ce("$ZodString",(e,t)=>{Yt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??JH(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}}),Nt=ce("$ZodStringFormat",(e,t)=>{sf.init(e,t),ly.init(e,t)}),uq=ce("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$H),Nt.init(e,t)}),dq=ce("$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=bS(a))}else t.pattern??(t.pattern=bS());Nt.init(e,t)}),fq=ce("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=LH),Nt.init(e,t)}),hq=ce("$ZodURL",(e,t)=>{Nt.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})}}}),mq=ce("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=UH()),Nt.init(e,t)}),pq=ce("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=DH),Nt.init(e,t)}),xq=ce("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=TH),Nt.init(e,t)}),gq=ce("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=EH),Nt.init(e,t)}),yq=ce("$ZodULID",(e,t)=>{t.pattern??(t.pattern=AH),Nt.init(e,t)}),bq=ce("$ZodXID",(e,t)=>{t.pattern??(t.pattern=OH),Nt.init(e,t)}),vq=ce("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=MH),Nt.init(e,t)}),kq=ce("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=YH(t)),Nt.init(e,t)}),wq=ce("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qH),Nt.init(e,t)}),Sq=ce("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=GH(t)),Nt.init(e,t)}),zq=ce("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=RH),Nt.init(e,t)}),jq=ce("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=IH),Nt.init(e,t),e._zod.bag.format="ipv4"}),_q=ce("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=BH),Nt.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})}}}),Nq=ce("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=VH),Nt.init(e,t)}),Cq=ce("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ZH),Nt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,c]=a;if(!c)throw new Error;const o=Number(c);if(`${o}`!==c)throw new Error;if(o<0||o>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 AN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Tq=ce("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=FH),Nt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{AN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Eq(e){if(!CN.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return AN(n)}const Aq=ce("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=CN),Nt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Eq(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Oq=ce("$ZodE164",(e,t)=>{t.pattern??(t.pattern=HH),Nt.init(e,t)});function Mq(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 Dq=ce("$ZodJWT",(e,t)=>{Nt.init(e,t),e._zod.check=n=>{Mq(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Rq=ce("$ZodUnknown",(e,t)=>{Yt.init(e,t),e._zod.parse=n=>n}),$q=ce("$ZodNever",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function vS(e,t,n){e.issues.length&&t.issues.push(...zN(n,e.issues)),t.value[n]=e.value}const Lq=ce("$ZodArray",(e,t)=>{Yt.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 c=[];for(let o=0;o<s.length;o++){const d=s[o],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?c.push(h.then(m=>vS(m,n,o))):vS(h,n,o)}return c.length?Promise.all(c).then(()=>n):n}});function $d(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...zN(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function ON(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=cH(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function MN(e,t,n,a,s,c){const o=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,x=h.optout==="optional";for(const p in t){if(d.has(p))continue;if(m==="never"){o.push(p);continue}const b=h.run({value:t[p],issues:[]},a);b instanceof Promise?e.push(b.then(v=>$d(v,n,p,t,x))):$d(b,n,p,t,x)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const Pq=ce("$ZodObject",(e,t)=>{if(Yt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=ny(()=>ON(t));ot(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const x=d[m]._zod;if(x.values){h[m]??(h[m]=new Set);for(const p of x.values)h[m].add(p)}}return h});const s=Rd,c=t.catchall;let o;e._zod.parse=(d,h)=>{o??(o=a.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const x=[],p=o.shape;for(const b of o.keys){const v=p[b],S=v._zod.optout==="optional",z=v._zod.run({value:m[b],issues:[]},h);z instanceof Promise?x.push(z.then(A=>$d(A,d,b,m,S))):$d(z,d,b,m,S)}return c?MN(x,m,d,h,a.value,e):x.length?Promise.all(x).then(()=>d):d}}),Uq=ce("$ZodObjectJIT",(e,t)=>{Pq.init(e,t);const n=e._zod.parse,a=ny(()=>ON(t)),s=b=>{const v=new lq(["shape","payload","ctx"]),S=a.value,z=N=>{const P=yS(N);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};v.write("const input = payload.value;");const A=Object.create(null);let _=0;for(const N of S.keys)A[N]=`key_${_++}`;v.write("const newResult = {};");for(const N of S.keys){const P=A[N],D=yS(N),V=b[N]?._zod?.optout==="optional";v.write(`const ${P} = ${z(N)};`),V?v.write(`
|
|
125
|
+
if (${P}.issues.length) {
|
|
126
|
+
if (${D} in input) {
|
|
127
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
128
|
+
...iss,
|
|
129
|
+
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
130
|
+
})));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (${P}.value === undefined) {
|
|
135
|
+
if (${D} in input) {
|
|
136
|
+
newResult[${D}] = undefined;
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
newResult[${D}] = ${P}.value;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
`):v.write(`
|
|
143
|
+
if (${P}.issues.length) {
|
|
144
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
145
|
+
...iss,
|
|
146
|
+
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
147
|
+
})));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (${P}.value === undefined) {
|
|
151
|
+
if (${D} in input) {
|
|
152
|
+
newResult[${D}] = undefined;
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
newResult[${D}] = ${P}.value;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(N,P)=>E(b,N,P)};let c;const o=Rd,d=!vN.jitless,m=d&&oH.value,x=t.catchall;let p;e._zod.parse=(b,v)=>{p??(p=a.value);const S=b.value;return o(S)?d&&m&&v?.async===!1&&v.jitless!==!0?(c||(c=s(t.shape)),b=c(b,v),x?MN([],S,b,v,p,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function kS(e,t,n,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const s=e.filter(c=>!Xs(c));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(c=>c.issues.map(o=>qi(o,a,Hi())))}),t)}const Iq=ce("$ZodUnion",(e,t)=>{Yt.init(e,t),ot(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),ot(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${s.map(c=>ay(c.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,c)=>{if(n)return a(s,c);let o=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},c);if(m instanceof Promise)d.push(m),o=!0;else{if(m.issues.length===0)return m;d.push(m)}}return o?Promise.all(d).then(h=>kS(h,s,e,c)):kS(d,s,e,c)}}),Bq=ce("$ZodIntersection",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,c=t.left._zod.run({value:s,issues:[]},a),o=t.right._zod.run({value:s,issues:[]},a);return c instanceof Promise||o instanceof Promise?Promise.all([c,o]).then(([h,m])=>wS(n,h,m)):wS(n,c,o)}});function Mx(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(ac(e)&&ac(t)){const n=Object.keys(t),a=Object.keys(e).filter(c=>n.indexOf(c)!==-1),s={...e,...t};for(const c of a){const o=Mx(e[c],t[c]);if(!o.valid)return{valid:!1,mergeErrorPath:[c,...o.mergeErrorPath]};s[c]=o.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],c=t[a],o=Mx(s,c);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wS(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const c=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(c.length&&s&&e.issues.push({...s,keys:c}),Xs(e))return e;const o=Mx(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Vq=ce("$ZodEnum",(e,t)=>{Yt.init(e,t);const n=kN(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>lH.has(typeof s)).map(s=>typeof s=="string"?mo(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const o=s.value;return a.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),Zq=ce("$ZodLiteral",(e,t)=>{if(Yt.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"?mo(a):a?mo(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const c=a.value;return n.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),Fq=ce("$ZodTransform",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new bN(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new ao;return n.value=s,n}});function SS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const DN=ce("$ZodOptional",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ay(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(c=>SS(c,n.value)):SS(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),Hq=ce("$ZodExactOptional",(e,t)=>{DN.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),qq=ce("$ZodNullable",(e,t)=>{Yt.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ay(n.source)}|null)$`):void 0}),ot(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)}),Gq=ce("$ZodDefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",ot(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(c=>zS(c,t)):zS(s,t)}});function zS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Yq=ce("$ZodPrefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",ot(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))}),Jq=ce("$ZodNonOptional",(e,t)=>{Yt.init(e,t),ot(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(c=>jS(c,e)):jS(s,e)}});function jS(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 Kq=ce("$ZodCatch",(e,t)=>{Yt.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(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(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(o=>qi(o,a,Hi()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(c=>qi(c,a,Hi()))},input:n.value}),n.issues=[]),n)}}),Xq=ce("$ZodPipe",(e,t)=>{Yt.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(n,a);return c instanceof Promise?c.then(o=>td(o,t.in,a)):td(c,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(c=>td(c,t.out,a)):td(s,t.out,a)}});function td(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Qq=ce("$ZodReadonly",(e,t)=>{Yt.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>t.innerType?._zod?.optin),ot(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(_S):_S(s)}});function _S(e){return e.value=Object.freeze(e.value),e}const Wq=ce("$ZodCustom",(e,t)=>{Fr.init(e,t),Yt.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(c=>NS(c,n,a,e));NS(s,n,a,e)}});function NS(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(ic(s))}}var CS;class eG{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 tG(){return new eG}(CS=globalThis).__zod_globalRegistry??(CS.__zod_globalRegistry=tG());const $l=globalThis.__zod_globalRegistry;function nG(e,t){return new e({type:"string",...Te(t)})}function rG(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function TS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function aG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function iG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}function sG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}function oG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}function lG(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}function cG(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}function uG(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}function dG(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}function fG(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}function hG(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}function mG(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}function pG(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}function xG(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}function gG(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}function yG(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}function bG(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}function vG(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}function kG(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}function wG(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}function SG(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}function zG(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}function jG(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}function _G(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}function NG(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}function CG(e){return new e({type:"unknown"})}function TG(e,t){return new e({type:"never",...Te(t)})}function RN(e,t){return new QH({check:"max_length",...Te(t),maximum:e})}function Ld(e,t){return new WH({check:"min_length",...Te(t),minimum:e})}function $N(e,t){return new eq({check:"length_equals",...Te(t),length:e})}function EG(e,t){return new tq({check:"string_format",format:"regex",...Te(t),pattern:e})}function AG(e){return new nq({check:"string_format",format:"lowercase",...Te(e)})}function OG(e){return new rq({check:"string_format",format:"uppercase",...Te(e)})}function MG(e,t){return new aq({check:"string_format",format:"includes",...Te(t),includes:e})}function DG(e,t){return new iq({check:"string_format",format:"starts_with",...Te(t),prefix:e})}function RG(e,t){return new sq({check:"string_format",format:"ends_with",...Te(t),suffix:e})}function To(e){return new oq({check:"overwrite",tx:e})}function $G(e){return To(t=>t.normalize(e))}function LG(){return To(e=>e.trim())}function PG(){return To(e=>e.toLowerCase())}function UG(){return To(e=>e.toUpperCase())}function IG(){return To(e=>sH(e))}function BG(e,t,n){return new e({type:"array",element:t,...Te(n)})}function VG(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}function ZG(e){const t=FG(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(ic(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(ic(s))}},e(n.value,n)));return t}function FG(e,t){const n=new Fr({check:"custom",...Te(t)});return n._zod.check=e,n}function LN(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??$l,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 hn(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const d=e._zod.toJSONSchema?.();if(d)o.schema=d;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,x);else{const b=o.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,x)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),hn(p,t,x),t.seen.get(p).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(o.schema,h),t.io==="input"&&_n(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function PN(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 o of e.seen.entries()){const d=e.metadataRegistry.get(o[0])?.id;if(d){const h=a.get(d);if(h&&h!==o[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,o[0])}}const s=o=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,b=e.external.uri??(S=>S);if(p)return{ref:b(p)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(o[1]===n)return{ref:"#"};const m=`#/${d}/`,x=o[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:m+x}},c=o=>{if(o[1].schema.$ref)return;const d=o[1],{ref:h,defId:m}=s(o);d.def={...d.schema},m&&(d.defId=m);const x=d.schema;for(const p in x)delete x[p];x.$ref=h};if(e.cycles==="throw")for(const o of e.seen.entries()){const d=o[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
159
|
+
|
|
160
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const d=o[1];if(t===o[0]){c(o);continue}if(e.external){const m=e.external.registry.get(o[0])?.id;if(t!==o[0]&&m){c(o);continue}}if(e.metadataRegistry.get(o[0])?.id){c(o);continue}if(d.cycle){c(o);continue}if(d.count>1&&e.reused==="ref"){c(o);continue}}}function UN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const d=e.seen.get(o);if(d.ref===null)return;const h=d.def??d.schema,m={...h},x=d.ref;if(d.ref=null,x){a(x);const b=e.seen.get(x),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),o._zod.parent===x)for(const z in h)z==="$ref"||z==="allOf"||z in m||delete h[z];if(v.$ref&&b.def)for(const z in h)z==="$ref"||z==="allOf"||z in b.def&&JSON.stringify(h[z])===JSON.stringify(b.def[z])&&delete h[z]}const p=o._zod.parent;if(p&&p!==x){a(p);const b=e.seen.get(p);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:o,jsonSchema:h,path:d.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[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 o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const c=e.external?.defs??{};for(const o of e.seen.entries()){const d=o[1];d.def&&d.defId&&(c[d.defId]=d.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Pd(t,"input",e.processors),output:Pd(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function _n(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 _n(a.element,n);if(a.type==="set")return _n(a.valueType,n);if(a.type==="lazy")return _n(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 _n(a.innerType,n);if(a.type==="intersection")return _n(a.left,n)||_n(a.right,n);if(a.type==="record"||a.type==="map")return _n(a.keyType,n)||_n(a.valueType,n);if(a.type==="pipe")return _n(a.in,n)||_n(a.out,n);if(a.type==="object"){for(const s in a.shape)if(_n(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(_n(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(_n(s,n))return!0;return!!(a.rest&&_n(a.rest,n))}return!1}const HG=(e,t={})=>n=>{const a=LN({...n,processors:t});return hn(e,a),PN(a,e),UN(a,e)},Pd=(e,t,n={})=>a=>{const{libraryOptions:s,target:c}=a??{},o=LN({...s??{},target:c,io:t,processors:n});return hn(e,o),PN(o,e),UN(o,e)},qG={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},GG=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:c,maximum:o,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof o=="number"&&(s.maxLength=o),d&&(s.format=qG[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},YG=(e,t,n,a)=>{n.not={}},JG=(e,t,n,a)=>{},KG=(e,t,n,a)=>{const s=e._zod.def,c=kN(s.entries);c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),n.enum=c},XG=(e,t,n,a)=>{const s=e._zod.def,c=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(o))}else c.push(o);if(c.length!==0)if(c.length===1){const o=c[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),c.every(o=>typeof o=="boolean")&&(n.type="boolean"),c.every(o=>o===null)&&(n.type="null"),n.enum=c},QG=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},WG=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},eY=(e,t,n,a)=>{const s=n,c=e._zod.def,{minimum:o,maximum:d}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=hn(c.element,t,{...a,path:[...a.path,"items"]})},tY=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object",s.properties={};const o=c.shape;for(const m in o)s.properties[m]=hn(o[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(o)),h=new Set([...d].filter(m=>{const x=c.shape[m]._zod;return t.io==="input"?x.optin===void 0:x.optout===void 0}));h.size>0&&(s.required=Array.from(h)),c.catchall?._zod.def.type==="never"?s.additionalProperties=!1:c.catchall?c.catchall&&(s.additionalProperties=hn(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},nY=(e,t,n,a)=>{const s=e._zod.def,c=s.inclusive===!1,o=s.options.map((d,h)=>hn(d,t,{...a,path:[...a.path,c?"oneOf":"anyOf",h]}));c?n.oneOf=o:n.anyOf=o},rY=(e,t,n,a)=>{const s=e._zod.def,c=hn(s.left,t,{...a,path:[...a.path,"allOf",0]}),o=hn(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(c)?c.allOf:[c],...d(o)?o.allOf:[o]];n.allOf=h},aY=(e,t,n,a)=>{const s=e._zod.def,c=hn(s.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},iY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},sY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},oY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},lY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},cY=(e,t,n,a)=>{const s=e._zod.def,c=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;hn(c,t,a);const o=t.seen.get(e);o.ref=c},uY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.readOnly=!0},IN=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},dY=ce("ZodISODateTime",(e,t)=>{kq.init(e,t),Ot.init(e,t)});function fY(e){return zG(dY,e)}const hY=ce("ZodISODate",(e,t)=>{wq.init(e,t),Ot.init(e,t)});function mY(e){return jG(hY,e)}const pY=ce("ZodISOTime",(e,t)=>{Sq.init(e,t),Ot.init(e,t)});function xY(e){return _G(pY,e)}const gY=ce("ZodISODuration",(e,t)=>{zq.init(e,t),Ot.init(e,t)});function yY(e){return NG(gY,e)}const BN=(e,t)=>{_N.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>yH(e,n)},flatten:{value:n=>gH(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ox,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ox,2)}},isEmpty:{get(){return e.issues.length===0}}})},bY=ce("ZodError",BN),vr=ce("ZodError",BN,{Parent:Error}),vY=sy(vr),kY=oy(vr),wY=rf(vr),SY=af(vr),zY=kH(vr),jY=wH(vr),_Y=SH(vr),NY=zH(vr),CY=jH(vr),TY=_H(vr),EY=NH(vr),AY=CH(vr),Jt=ce("ZodType",(e,t)=>(Yt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Pd(e,"input"),output:Pd(e,"output")}}),e.toJSONSchema=HG(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(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)=>hi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>vY(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>wY(e,n,a),e.parseAsync=async(n,a)=>kY(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>SY(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>zY(e,n,a),e.decode=(n,a)=>jY(e,n,a),e.encodeAsync=async(n,a)=>_Y(e,n,a),e.decodeAsync=async(n,a)=>NY(e,n,a),e.safeEncode=(n,a)=>CY(e,n,a),e.safeDecode=(n,a)=>TY(e,n,a),e.safeEncodeAsync=async(n,a)=>EY(e,n,a),e.safeDecodeAsync=async(n,a)=>AY(e,n,a),e.refine=(n,a)=>e.check(zJ(n,a)),e.superRefine=n=>e.check(jJ(n)),e.overwrite=n=>e.check(To(n)),e.optional=()=>MS(e),e.exactOptional=()=>dJ(e),e.nullable=()=>DS(e),e.nullish=()=>MS(DS(e)),e.nonoptional=n=>gJ(e,n),e.array=()=>eJ(e),e.or=n=>ZN([e,n]),e.and=n=>iJ(e,n),e.transform=n=>RS(e,cJ(n)),e.default=n=>mJ(e,n),e.prefault=n=>xJ(e,n),e.catch=n=>bJ(e,n),e.pipe=n=>RS(e,n),e.readonly=()=>wJ(e),e.describe=n=>{const a=e.clone();return $l.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return $l.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return $l.get(e);const a=e.clone();return $l.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),VN=ce("_ZodString",(e,t)=>{ly.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>GG(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(EG(...a)),e.includes=(...a)=>e.check(MG(...a)),e.startsWith=(...a)=>e.check(DG(...a)),e.endsWith=(...a)=>e.check(RG(...a)),e.min=(...a)=>e.check(Ld(...a)),e.max=(...a)=>e.check(RN(...a)),e.length=(...a)=>e.check($N(...a)),e.nonempty=(...a)=>e.check(Ld(1,...a)),e.lowercase=a=>e.check(AG(a)),e.uppercase=a=>e.check(OG(a)),e.trim=()=>e.check(LG()),e.normalize=(...a)=>e.check($G(...a)),e.toLowerCase=()=>e.check(PG()),e.toUpperCase=()=>e.check(UG()),e.slugify=()=>e.check(IG())}),OY=ce("ZodString",(e,t)=>{ly.init(e,t),VN.init(e,t),e.email=n=>e.check(rG(MY,n)),e.url=n=>e.check(lG(DY,n)),e.jwt=n=>e.check(SG(JY,n)),e.emoji=n=>e.check(cG(RY,n)),e.guid=n=>e.check(TS(ES,n)),e.uuid=n=>e.check(aG(nd,n)),e.uuidv4=n=>e.check(iG(nd,n)),e.uuidv6=n=>e.check(sG(nd,n)),e.uuidv7=n=>e.check(oG(nd,n)),e.nanoid=n=>e.check(uG($Y,n)),e.guid=n=>e.check(TS(ES,n)),e.cuid=n=>e.check(dG(LY,n)),e.cuid2=n=>e.check(fG(PY,n)),e.ulid=n=>e.check(hG(UY,n)),e.base64=n=>e.check(vG(qY,n)),e.base64url=n=>e.check(kG(GY,n)),e.xid=n=>e.check(mG(IY,n)),e.ksuid=n=>e.check(pG(BY,n)),e.ipv4=n=>e.check(xG(VY,n)),e.ipv6=n=>e.check(gG(ZY,n)),e.cidrv4=n=>e.check(yG(FY,n)),e.cidrv6=n=>e.check(bG(HY,n)),e.e164=n=>e.check(wG(YY,n)),e.datetime=n=>e.check(fY(n)),e.date=n=>e.check(mY(n)),e.time=n=>e.check(xY(n)),e.duration=n=>e.check(yY(n))});function kp(e){return nG(OY,e)}const Ot=ce("ZodStringFormat",(e,t)=>{Nt.init(e,t),VN.init(e,t)}),MY=ce("ZodEmail",(e,t)=>{fq.init(e,t),Ot.init(e,t)}),ES=ce("ZodGUID",(e,t)=>{uq.init(e,t),Ot.init(e,t)}),nd=ce("ZodUUID",(e,t)=>{dq.init(e,t),Ot.init(e,t)}),DY=ce("ZodURL",(e,t)=>{hq.init(e,t),Ot.init(e,t)}),RY=ce("ZodEmoji",(e,t)=>{mq.init(e,t),Ot.init(e,t)}),$Y=ce("ZodNanoID",(e,t)=>{pq.init(e,t),Ot.init(e,t)}),LY=ce("ZodCUID",(e,t)=>{xq.init(e,t),Ot.init(e,t)}),PY=ce("ZodCUID2",(e,t)=>{gq.init(e,t),Ot.init(e,t)}),UY=ce("ZodULID",(e,t)=>{yq.init(e,t),Ot.init(e,t)}),IY=ce("ZodXID",(e,t)=>{bq.init(e,t),Ot.init(e,t)}),BY=ce("ZodKSUID",(e,t)=>{vq.init(e,t),Ot.init(e,t)}),VY=ce("ZodIPv4",(e,t)=>{jq.init(e,t),Ot.init(e,t)}),ZY=ce("ZodIPv6",(e,t)=>{_q.init(e,t),Ot.init(e,t)}),FY=ce("ZodCIDRv4",(e,t)=>{Nq.init(e,t),Ot.init(e,t)}),HY=ce("ZodCIDRv6",(e,t)=>{Cq.init(e,t),Ot.init(e,t)}),qY=ce("ZodBase64",(e,t)=>{Tq.init(e,t),Ot.init(e,t)}),GY=ce("ZodBase64URL",(e,t)=>{Aq.init(e,t),Ot.init(e,t)}),YY=ce("ZodE164",(e,t)=>{Oq.init(e,t),Ot.init(e,t)}),JY=ce("ZodJWT",(e,t)=>{Dq.init(e,t),Ot.init(e,t)}),KY=ce("ZodUnknown",(e,t)=>{Rq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>JG()});function AS(){return CG(KY)}const XY=ce("ZodNever",(e,t)=>{$q.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>YG(e,n,a)});function QY(e){return TG(XY,e)}const WY=ce("ZodArray",(e,t)=>{Lq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eY(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(RN(n,a)),e.length=(n,a)=>e.check($N(n,a)),e.unwrap=()=>e.element});function eJ(e,t){return BG(WY,e,t)}const tJ=ce("ZodObject",(e,t)=>{Uq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tY(e,n,a,s),ot(e,"shape",()=>t.shape),e.keyof=()=>sJ(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:AS()}),e.loose=()=>e.clone({...e._zod.def,catchall:AS()}),e.strict=()=>e.clone({...e._zod.def,catchall:QY()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>fH(e,n),e.safeExtend=n=>hH(e,n),e.merge=n=>mH(e,n),e.pick=n=>uH(e,n),e.omit=n=>dH(e,n),e.partial=(...n)=>pH(FN,e,n[0]),e.required=(...n)=>xH(HN,e,n[0])});function nJ(e,t){const n={type:"object",shape:e??{},...Te(t)};return new tJ(n)}const rJ=ce("ZodUnion",(e,t)=>{Iq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nY(e,n,a,s),e.options=t.options});function ZN(e,t){return new rJ({type:"union",options:e,...Te(t)})}const aJ=ce("ZodIntersection",(e,t)=>{Bq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rY(e,n,a,s)});function iJ(e,t){return new aJ({type:"intersection",left:e,right:t})}const Dx=ce("ZodEnum",(e,t)=>{Vq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>KG(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 c={};for(const o of a)if(n.has(o))c[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Dx({...t,checks:[],...Te(s),entries:c})},e.exclude=(a,s)=>{const c={...t.entries};for(const o of a)if(n.has(o))delete c[o];else throw new Error(`Key ${o} not found in enum`);return new Dx({...t,checks:[],...Te(s),entries:c})}});function sJ(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Dx({type:"enum",entries:n,...Te(t)})}const oJ=ce("ZodLiteral",(e,t)=>{Zq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>XG(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 OS(e,t){return new oJ({type:"literal",values:Array.isArray(e)?e:[e],...Te(t)})}const lJ=ce("ZodTransform",(e,t)=>{Fq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>WG(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new bN(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(ic(c,n.value,t));else{const o=c;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ic(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(c=>(n.value=c,n)):(n.value=s,n)}});function cJ(e){return new lJ({type:"transform",transform:e})}const FN=ce("ZodOptional",(e,t)=>{DN.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>IN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function MS(e){return new FN({type:"optional",innerType:e})}const uJ=ce("ZodExactOptional",(e,t)=>{Hq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>IN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function dJ(e){return new uJ({type:"optional",innerType:e})}const fJ=ce("ZodNullable",(e,t)=>{qq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>aY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function DS(e){return new fJ({type:"nullable",innerType:e})}const hJ=ce("ZodDefault",(e,t)=>{Gq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function mJ(e,t){return new hJ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():SN(t)}})}const pJ=ce("ZodPrefault",(e,t)=>{Yq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function xJ(e,t){return new pJ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():SN(t)}})}const HN=ce("ZodNonOptional",(e,t)=>{Jq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>iY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function gJ(e,t){return new HN({type:"nonoptional",innerType:e,...Te(t)})}const yJ=ce("ZodCatch",(e,t)=>{Kq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bJ(e,t){return new yJ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vJ=ce("ZodPipe",(e,t)=>{Xq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cY(e,n,a,s),e.in=t.in,e.out=t.out});function RS(e,t){return new vJ({type:"pipe",in:e,out:t})}const kJ=ce("ZodReadonly",(e,t)=>{Qq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function wJ(e){return new kJ({type:"readonly",innerType:e})}const SJ=ce("ZodCustom",(e,t)=>{Wq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>QG(e,n)});function zJ(e,t={}){return VG(SJ,e,t)}function jJ(e){return ZG(e)}const _J=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"devkit",label:"DevKit"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"chronos",label:"Chronos"}],NJ=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],Ol=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function CJ(){const{data:e,error:t}=We("/api/config",tn.fetchConfig),{data:n}=We("/api/config/sati",tn.getSatiConfig),{data:a}=We("/api/config/apoc",tn.getApocConfig),{data:s}=We("/api/config/neo",tn.getNeoConfig),{data:c}=We("/api/config/trinity",tn.getTrinityConfig),{data:o}=We("/api/config/encryption-status",()=>tn.getEncryptionStatus()),{data:d}=We("/api/config/env-overrides",()=>tn.getEnvOverrides()),{data:h}=N2(),[m,x]=j.useState(null),[p,b]=j.useState(null),[v,S]=j.useState(null),[z,A]=j.useState(null),[_,E]=j.useState(null),[N,P]=j.useState(null),[D,M]=j.useState("general"),[V,U]=j.useState("oracle"),[K,I]=j.useState(!1),[te,le]=j.useState({}),[ne,oe]=j.useState(null);j.useEffect(()=>{e&&!p&&b(e)},[e]),j.useEffect(()=>{n&&!v&&S(n)},[n]),j.useEffect(()=>{a&&!_?E(a):!a&&!_&&p&&E({...p.apoc??p.llm,temperature:p.apoc?.temperature??.2,timeout_ms:p.apoc?.timeout_ms??3e4})},[a,p]),j.useEffect(()=>{s&&!z?A(s):!s&&!z&&p&&A({...p.neo??p.llm,temperature:p.neo?.temperature??.2})},[s,p]),j.useEffect(()=>{c&&!N?P(c):!c&&!N&&p&&P({...p.trinity??p.llm,temperature:p.trinity?.temperature??.2})},[c,p]),j.useEffect(()=>{h&&!m&&x(h)},[h]);const se=JSON.stringify(e)!==JSON.stringify(p)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(z)||JSON.stringify(a)!==JSON.stringify(_)||JSON.stringify(c)!==JSON.stringify(N)||JSON.stringify(h)!==JSON.stringify(m),Z={general:JSON.stringify(e?.agent)!==JSON.stringify(p?.agent)||e?.verbose_mode!==p?.verbose_mode,agents:JSON.stringify(e?.llm)!==JSON.stringify(p?.llm)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(z)||JSON.stringify(a)!==JSON.stringify(_)||JSON.stringify(c)!==JSON.stringify(N),devkit:JSON.stringify(e?.devkit)!==JSON.stringify(p?.devkit),audio:JSON.stringify(e?.audio)!==JSON.stringify(p?.audio),channels:JSON.stringify(e?.channels?.telegram)!==JSON.stringify(p?.channels?.telegram)||JSON.stringify(e?.channels?.discord)!==JSON.stringify(p?.channels?.discord)||JSON.stringify(e?.webhooks)!==JSON.stringify(p?.webhooks),ui:JSON.stringify(e?.ui)!==JSON.stringify(p?.ui),logging:JSON.stringify(e?.logging)!==JSON.stringify(p?.logging),chronos:JSON.stringify(h)!==JSON.stringify(m)},B=($,Oe)=>{if(!o?.apiKeysEncrypted)return null;const{morpheusSecretSet:Ue,apiKeysEncrypted:Je}=o,St=Je[$];return!Oe?u.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"}):d&&d[Y($)]?null:Ue?St?u.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"}):u.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"}):u.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"})},Y=$=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[$],ue=$=>!d||!d[$]?null:u.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"}),O=$=>!!(d&&d[$]),C=($,Oe)=>{if(!p)return;const Ue=JSON.parse(JSON.stringify(p));let Je=Ue;for(let St=0;St<$.length-1;St++)(Je[$[St]]===void 0||Je[$[St]]===null)&&(Je[$[St]]={}),Je=Je[$[St]];Je[$[$.length-1]]=Oe,b(Ue);try{aH.parse(Ue),le({})}catch(St){if(St instanceof bY){const Ze={};St.errors.forEach(rt=>{const ft=rt.path.join(".");Ze[ft]=rt.message}),le(Ze)}}},H=($,Oe)=>{v&&S({...v,[$]:Oe})},w=($,Oe)=>{_&&E({..._,[$]:Oe})},X=($,Oe)=>{z&&A({...z,[$]:Oe})},me=($,Oe)=>{N&&P({...N,[$]:Oe})},pe=()=>{!p||!N||P({...N,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},ge=()=>{!p||!v||S({...v,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},Pe=()=>{!p||!_||E({..._,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},Ee=()=>{!p||!z||A({...z,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},yt=async()=>{if(p){I(!0),oe(null);try{const $=await tn.updateConfig(p);v&&await tn.updateSatiConfig(v),z&&await tn.updateNeoConfig(z),_&&await tn.updateApocConfig(_),N&&await tn.updateTrinityConfig(N),m&&await Vi.updateConfig(m),Bn("/api/config"),Bn("/api/config/sati"),Bn("/api/config/neo"),Bn("/api/config/apoc"),Bn("/api/config/trinity"),Bn("/api/config/chronos"),le({});const Oe=$._restartRequired||[],Ue=Oe.length>0?`Settings saved and applied. Some changes require restart: ${Oe.join(", ")}`:"Settings saved and applied successfully.";oe({type:"success",message:Ue}),setTimeout(()=>oe(null),5e3)}catch($){if(oe({type:"error",message:$.message}),$.details&&Array.isArray($.details)){const Oe={};$.details.forEach(Ue=>{const Je=Ue.path.join(".");Oe[Je]=Ue.message}),le(Oe)}}finally{I(!1)}}};return t?u.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):p?u.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[u.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx($p,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Zaion Settings"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Configure agents, models, channels, and runtime behavior."})]})]}),u.jsx("button",{onClick:yt,disabled:!se||Object.keys(te).length>0||K,className:`px-4 py-2 rounded font-medium transition-colors ${se&&Object.keys(te).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:K?"Saving...":"Save Changes"})]}),ne&&u.jsxs("div",{className:`flex items-start justify-between gap-3 p-4 rounded border ${ne.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:[u.jsx("span",{className:"text-sm",children:ne.message}),u.jsx("button",{type:"button",onClick:()=>oe(null),className:"shrink-0 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:u.jsx(Yi,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:u.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:_J.map($=>u.jsxs("button",{onClick:()=>M($.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 flex items-center gap-1.5 ${D===$.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,Z[$.id]&&u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0"})]},$.id))})}),u.jsxs("div",{className:"space-y-6",children:[D==="general"&&u.jsxs(zn,{title:"Agent Identity",children:[u.jsx(Ye,{label:"Agent Name",value:p.agent.name,onChange:$=>C(["agent","name"],$.target.value),error:te["agent.name"]}),u.jsx(Ye,{label:"Personality",value:p.agent.personality,onChange:$=>C(["agent","personality"],$.target.value),error:te["agent.personality"]}),u.jsx(pn,{label:"Verbose Mode",value:p.verbose_mode!==!1?"true":"false",onChange:$=>C(["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."})]}),D==="agents"&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:NJ.map($=>u.jsx("button",{onClick:()=>U($.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${V===$.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))}),V==="oracle"&&u.jsxs(zn,{title:"Oracle Agent",children:[u.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"}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ue("llm.provider")]}),u.jsx(pn,{label:"",value:p.llm.provider,onChange:$=>C(["llm","provider"],$.target.value),options:Ol,error:te["llm.provider"],disabled:O("llm.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ue("llm.model")]}),u.jsx(Ye,{label:"",value:p.llm.model,onChange:$=>C(["llm","model"],$.target.value),disabled:O("llm.model")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ue("llm.temperature")]}),u.jsx(Ft,{label:"",value:p.llm.temperature,onChange:$=>C(["llm","temperature"],parseFloat($.target.value)),step:.1,min:0,max:1,error:te["llm.temperature"],disabled:O("llm.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),ue("llm.max_tokens")]}),u.jsx(Ft,{label:"",value:p.llm.max_tokens??"",onChange:$=>C(["llm","max_tokens"],$.target.value?parseInt($.target.value):void 0),min:1,error:te["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:O("llm.max_tokens")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),ue("llm.context_window")]}),u.jsx(Ft,{label:"",value:p.llm.context_window??100,onChange:$=>C(["llm","context_window"],parseInt($.target.value)),min:1,step:1,error:te["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:O("llm.context_window")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ue("llm.api_key"),B("oracle",p.llm.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:p.llm.api_key||"",onChange:$=>C(["llm","api_key"],$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("llm.api_key")}),p.llm.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:p.llm.base_url||"https://openrouter.ai/api/v1",onChange:$=>C(["llm","base_url"],$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),V==="sati"&&u.jsxs(zn,{title:"Sati Agent",children:[u.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"}),u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{type:"button",onClick:ge,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"}),u.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"})]}),v&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ue("sati.provider")]}),u.jsx(pn,{label:"",value:v.provider,onChange:$=>H("provider",$.target.value),options:Ol,disabled:O("sati.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ue("sati.model")]}),u.jsx(Ye,{label:"",value:v.model,onChange:$=>H("model",$.target.value),disabled:O("sati.model")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ue("sati.api_key"),B("sati",v.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:v.api_key||"",onChange:$=>H("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("sati.api_key")}),v.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:v.base_url||"https://openrouter.ai/api/v1",onChange:$=>H("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),u.jsx(Ft,{label:"Memory Limit",value:v.memory_limit??10,onChange:$=>H("memory_limit",parseInt($.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),u.jsx(_r,{label:"Enable Archived Sessions in Memory Retrieval",checked:v.enabled_archived_sessions??!0,onChange:$=>H("enabled_archived_sessions",$)})]})]}),V==="neo"&&u.jsxs(zn,{title:"Neo Agent",children:[u.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"}),u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{type:"button",onClick:Ee,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"}),u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),z&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ue("neo.provider")]}),u.jsx(pn,{label:"",value:z.provider,onChange:$=>X("provider",$.target.value),options:Ol,disabled:O("neo.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ue("neo.model")]}),u.jsx(Ye,{label:"",value:z.model,onChange:$=>X("model",$.target.value),disabled:O("neo.model")}),u.jsx(Ye,{label:"Personality",value:z.personality||"analytical_engineer",onChange:$=>X("personality",$.target.value),placeholder:"analytical_engineer",helperText:"e.g., analytical_engineer, meticulous_auditor, systems_thinker"}),u.jsx(pn,{label:"Execution Mode",value:z.execution_mode||"async",onChange:$=>X("execution_mode",$.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ue("neo.temperature")]}),u.jsx(Ft,{label:"",value:z.temperature,onChange:$=>X("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:O("neo.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),ue("neo.max_tokens")]}),u.jsx(Ft,{label:"",value:z.max_tokens??"",onChange:$=>X("max_tokens",$.target.value?parseInt($.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:O("neo.max_tokens")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),ue("neo.context_window")]}),u.jsx(Ft,{label:"",value:z.context_window??100,onChange:$=>X("context_window",parseInt($.target.value)),min:1,step:1,disabled:O("neo.context_window")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ue("neo.api_key"),B("neo",z.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:z.api_key||"",onChange:$=>X("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("neo.api_key")}),z.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:z.base_url||"https://openrouter.ai/api/v1",onChange:$=>X("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),V==="trinity"&&u.jsxs(zn,{title:"Trinity Agent",children:[u.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)"}),u.jsxs("div",{className:"mb-4",children:[u.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"}),u.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&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ue("trinity.provider")]}),u.jsx(pn,{label:"",value:N.provider,onChange:$=>me("provider",$.target.value),options:Ol,disabled:O("trinity.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ue("trinity.model")]}),u.jsx(Ye,{label:"",value:N.model,onChange:$=>me("model",$.target.value),disabled:O("trinity.model")}),u.jsx(Ye,{label:"Personality",value:N.personality||"data_specialist",onChange:$=>me("personality",$.target.value),placeholder:"data_specialist",helperText:"e.g., data_specialist, query_optimizer, db_architect"}),u.jsx(pn,{label:"Execution Mode",value:N.execution_mode||"async",onChange:$=>me("execution_mode",$.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ue("trinity.temperature")]}),u.jsx(Ft,{label:"",value:N.temperature,onChange:$=>me("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:O("trinity.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),ue("trinity.max_tokens")]}),u.jsx(Ft,{label:"",value:N.max_tokens??"",onChange:$=>me("max_tokens",$.target.value?parseInt($.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:O("trinity.max_tokens")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ue("trinity.api_key"),B("trinity",N.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:N.api_key||"",onChange:$=>me("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("trinity.api_key")}),N.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:N.base_url||"https://openrouter.ai/api/v1",onChange:$=>me("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),V==="apoc"&&u.jsxs(zn,{title:"Apoc Agent",children:[u.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"}),u.jsxs("div",{className:"mb-4",children:[u.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"}),u.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"})]}),_&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ue("apoc.provider")]}),u.jsx(pn,{label:"",value:_.provider,onChange:$=>w("provider",$.target.value),options:Ol,disabled:O("apoc.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ue("apoc.model")]}),u.jsx(Ye,{label:"",value:_.model,onChange:$=>w("model",$.target.value),disabled:O("apoc.model")}),u.jsx(Ye,{label:"Personality",value:_.personality||"pragmatic_dev",onChange:$=>w("personality",$.target.value),placeholder:"pragmatic_dev",helperText:"e.g., pragmatic_dev, cautious_admin, automation_specialist"}),u.jsx(pn,{label:"Execution Mode",value:_.execution_mode||"async",onChange:$=>w("execution_mode",$.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ue("apoc.temperature")]}),u.jsx(Ft,{label:"",value:_.temperature,onChange:$=>w("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:O("apoc.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ue("apoc.api_key"),B("apoc",_.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:_.api_key||"",onChange:$=>w("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("apoc.api_key")}),_.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:_.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"}),u.jsx(Ft,{label:"Timeout (ms)",value:_.timeout_ms??3e4,onChange:$=>w("timeout_ms",parseInt($.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),D==="devkit"&&u.jsxs(u.Fragment,{children:[u.jsxs(zn,{title:"DevKit Security",children:[u.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."}),u.jsx(Ye,{label:"Sandbox Directory",value:p.devkit?.sandbox_dir||"",onChange:$=>C(["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:O("devkit.sandbox_dir")}),u.jsx(pn,{label:"Read-Only Mode",value:p.devkit?.readonly_mode?"true":"false",onChange:$=>C(["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:O("devkit.readonly_mode")}),u.jsx(Ft,{label:"Timeout (ms)",value:p.devkit?.timeout_ms??3e4,onChange:$=>C(["devkit","timeout_ms"],parseInt($.target.value)),min:1e3,step:1e3,helperText:"Default timeout for shell and system operations in milliseconds.",disabled:O("devkit.timeout_ms")})]}),u.jsxs(zn,{title:"Tool Categories",children:[u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Enable or disable entire categories of DevKit tools."}),u.jsx(_r,{label:"Filesystem (read, write, list, copy, move, delete files)",checked:p.devkit?.enable_filesystem!==!1,onChange:$=>C(["devkit","enable_filesystem"],$)}),u.jsx(_r,{label:"Shell (run_command, run_script, which)",checked:p.devkit?.enable_shell!==!1,onChange:$=>C(["devkit","enable_shell"],$)}),u.jsx(_r,{label:"Git (status, diff, commit, push, pull, clone, branch)",checked:p.devkit?.enable_git!==!1,onChange:$=>C(["devkit","enable_git"],$)}),u.jsx(_r,{label:"Network (http_request, ping, dns_lookup, download_file)",checked:p.devkit?.enable_network!==!1,onChange:$=>C(["devkit","enable_network"],$)})]}),u.jsxs(zn,{title:"Shell Command Allowlist",children:[u.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)."}),u.jsx(Ye,{label:"Allowed Commands",value:(p.devkit?.allowed_shell_commands||[]).join(", "),onChange:$=>C(["devkit","allowed_shell_commands"],$.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),placeholder:"e.g. node, npm, git, python, cargo",helperText:"Comma-separated list of allowed binary names. Empty = all commands allowed.",disabled:O("devkit.allowed_shell_commands")})]})]}),D==="audio"&&u.jsxs(zn,{title:"Audio Transcription",children:[u.jsx(_r,{label:"Enable Audio",checked:p.audio.enabled,onChange:$=>C(["audio","enabled"],$)}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ue("audio.provider")]}),u.jsx(pn,{label:"",value:p.audio.provider||"google",onChange:$=>C(["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:te["audio.provider"],disabled:O("audio.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model"}),ue("audio.model")]}),u.jsx(Ye,{label:"",value:p.audio.model,onChange:$=>C(["audio","model"],$.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:te["audio.model"],disabled:O("audio.model")}),p.audio.provider==="ollama"&&u.jsx(Ye,{label:"Base URL",value:p.audio.base_url||"",onChange:$=>C(["audio","base_url"],$.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ue("audio.apiKey"),B("audio",p.audio.apiKey)]})]}),u.jsx(Ye,{label:"",type:"password",value:p.audio.apiKey||"",onChange:$=>C(["audio","apiKey"],$.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:O("audio.apiKey")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Duration (Seconds)"}),ue("audio.maxDurationSeconds")]}),u.jsx(Ft,{label:"",value:p.audio.maxDurationSeconds,onChange:$=>C(["audio","maxDurationSeconds"],parseInt($.target.value)),min:1,disabled:O("audio.maxDurationSeconds")}),u.jsx(Ye,{label:"Supported Mime Types",value:p.audio.supportedMimeTypes.join(", "),onChange:$=>C(["audio","supportedMimeTypes"],$.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),D==="channels"&&u.jsxs(u.Fragment,{children:[u.jsxs(zn,{title:"Telegram",children:[u.jsx(_r,{label:"Enable Telegram",checked:p.channels.telegram.enabled,onChange:$=>C(["channels","telegram","enabled"],$)}),p.channels.telegram.enabled&&u.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[u.jsx(Ye,{label:"Bot Token",type:"password",value:p.channels.telegram.token||"",onChange:$=>C(["channels","telegram","token"],$.target.value)}),u.jsx(Ye,{label:"Allowed Users (comma separated)",value:p.channels.telegram.allowedUsers.join(", "),onChange:$=>C(["channels","telegram","allowedUsers"],$.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),u.jsxs(zn,{title:"Discord",children:[u.jsx(_r,{label:"Enable Discord",checked:p.channels.discord.enabled,onChange:$=>C(["channels","discord","enabled"],$)}),p.channels.discord.enabled&&u.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[u.jsx(Ye,{label:"Bot Token",type:"password",value:p.channels.discord.token||"",onChange:$=>C(["channels","discord","token"],$.target.value)}),u.jsx(Ye,{label:"Allowed Users (comma separated)",value:(p.channels.discord.allowedUsers??[]).join(", "),onChange:$=>C(["channels","discord","allowedUsers"],$.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),D==="ui"&&u.jsxs(zn,{title:"Dashboard",children:[u.jsx(_r,{label:"Enable Web UI",checked:p.ui.enabled,onChange:$=>C(["ui","enabled"],$)}),u.jsx(Ft,{label:"Port",value:p.ui.port,onChange:$=>C(["ui","port"],parseInt($.target.value)),disabled:!0,helperText:"Port changes require daemon restart."})]}),D==="logging"&&u.jsxs(zn,{title:"Logging",children:[u.jsx(_r,{label:"Enable Logging",checked:p.logging.enabled,onChange:$=>C(["logging","enabled"],$)}),u.jsx(pn,{label:"Log Level",value:p.logging.level,onChange:$=>C(["logging","level"],$.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),D==="chronos"&&m&&u.jsxs(zn,{title:"Chronos — Temporal Intent Engine",children:[u.jsx(pn,{label:"Timezone",value:m.timezone,onChange:$=>x({...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"}]}),u.jsx(Ft,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:$=>x({...m,check_interval_ms:Number($.target.value)*1e3}),min:60}),u.jsx(Ft,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:$=>x({...m,max_active_jobs:Number($.target.value)}),min:1,max:1e3})]})]})]}):u.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function TJ(){const{data:e}=I3(),[t,n]=j.useState(null),{data:a,mutate:s}=B3(t),c=j.useRef(null);return j.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),j.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[a]),u.jsxs($e.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:[u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Mp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Logs"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"View runtime logs."})]})]}),u.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:[u.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:[u.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(o=>u.jsxs("button",{onClick:()=>n(o.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===o.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:[u.jsx(Mp,{className:"w-4 h-4 shrink-0"}),u.jsxs("div",{className:"flex flex-col overflow-hidden",children:[u.jsx("span",{className:"truncate font-bold",children:o.name}),u.jsxs("span",{className:"text-xs opacity-70",children:[(o.size/1024).toFixed(1)," KB"]})]})]},o.name))]}),u.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:[u.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:[u.jsx("select",{value:t??"",onChange:o=>n(o.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(o=>u.jsx("option",{value:o.name,children:o.name},o.name))}),u.jsx("span",{className:"hidden md:block text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm truncate",children:t}),u.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:u.jsx(Ka,{className:"w-4 h-4"})})]}),u.jsx("div",{ref:c,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((o,d)=>{const h=o.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s?(.*)/s);return h?u.jsxs("div",{children:[u.jsxs("span",{className:"hidden md:inline opacity-50",children:[h[1]," "]}),u.jsx("span",{children:h[2]})]},d):u.jsx("div",{children:o},d)}):u.jsx("span",{className:"opacity-50",children:"Select a log file to view content..."})})]})]})]})}function EJ(){const[e,t]=j.useState(null),[n,a]=j.useState([]),[s,c]=j.useState(!0),[o,d]=j.useState("");if(j.useEffect(()=>{async function x(){try{const[p,b]=await Promise.all([xx.fetchUsageStats(),xx.fetchGroupedUsageStats()]);t(p),a(b)}catch(p){d("Failed to load usage statistics"),console.error(p)}finally{c(!1)}}x()},[]),s)return u.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(o)return u.jsxs("div",{className:"p-4 bg-red-900/20 border border-red-500/50 text-red-500 font-mono rounded",children:["ERROR_ACCESSING_DATABASE: ",o]});const h={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},m={hidden:{y:20,opacity:0},show:{y:0,opacity:1}};return u.jsxs($e.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:m,className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Ap,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Usage Stats"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Resource consumption tracking and cost metrics."})]})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs($e.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:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[u.jsx(Rp,{className:"w-5 h-5"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),u.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),u.jsxs($e.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:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[u.jsx(Qs,{className:"w-5 h-5"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),u.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),u.jsxs($e.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:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[u.jsx(io,{className:"w-5 h-5"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),u.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),u.jsxs($e.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:[u.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:u.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[u.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:u.jsxs("tr",{children:[u.jsx("th",{className:"p-4",children:"Provider"}),u.jsx("th",{className:"p-4",children:"Model"}),u.jsx("th",{className:"p-4 text-right",children:"Messages"}),u.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),u.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),u.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),u.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),u.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),u.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:8,className:"p-8 text-center text-azure-text-muted dark:text-matrix-secondary italic",children:"NO_DATA_AVAILABLE"})}):n.map((x,p)=>u.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[u.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:x.provider}),u.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:x.model}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.messageCount.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.totalInputTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.totalOutputTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:x.totalTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.totalAudioSeconds>0?x.totalAudioSeconds.toLocaleString():"—"}),u.jsx("td",{className:"p-4 text-right font-bold text-green-600 dark:text-green-400",children:x.estimatedCostUsd!=null?`$${x.estimatedCostUsd.toFixed(4)}`:"—"})]},`${x.provider}-${x.model}-${p}`))})]})})]})]})}const AJ=()=>{const[e,t]=j.useState(""),[n,a]=j.useState(""),s=oc(),c=Ar(),o=d=>{d.preventDefault(),e&&(a(""),fetch("/api/config",{headers:{"x-architect-pass":e}}).then(async h=>{if(h.ok){localStorage.setItem("morpheus.auth.token",e);const m=c.state?.from?.pathname||"/";s(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return u.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:u.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:[u.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"}),u.jsxs("form",{onSubmit:o,className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),u.jsx("input",{type:"password",value:e,onChange:d=>t(d.target.value),className:"w-full bg-azure-bg dark:bg-black border border-azure-border dark:border-green-800 p-2 focus:outline-none focus:border-azure-primary dark:focus:border-green-500 text-azure-text-primary dark:text-green-500 placeholder-azure-text-secondary/50 dark:placeholder-green-900 rounded dark:rounded-none",placeholder:"••••••••",autoFocus:!0})]}),n&&u.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),u.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"})]}),u.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."})]})})},OJ=({children:e})=>{const{isAuthenticated:t}=k_(),n=Ar();return t?u.jsx(u.Fragment,{children:e}):u.jsx(hz,{to:"/login",state:{from:n},replace:!0})},MJ=({className:e,...t})=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),DJ=({...e})=>u.jsx("thead",{...e}),RJ=({...e})=>u.jsx("tbody",{...e}),wp=({...e})=>u.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}),Vs=({className:e,...t})=>u.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}),Ri=({className:e,...t})=>u.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),$S=({checked:e,onCheckedChange:t,className:n,...a})=>{const s=c=>{t&&t(c.target.checked),a.onChange&&a.onChange(c)};return u.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})},Ud=({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 u.jsx("div",{className:s,...n})},Sp=({className:e,...t})=>u.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}),LS=({className:e,...t})=>u.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),$J=({className:e,...t})=>u.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),zp=({className:e,...t})=>u.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),LJ=({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 u.jsx("div",{className:s,...n})},PJ=({className:e,...t})=>u.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),qN=({isOpen:e,onClose:t,title:n,children:a,size:s="md"})=>{if(!e)return null;const c={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),u.jsxs("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full ${c[s]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&u.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&u.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:u.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:u.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),u.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},UJ=({isOpen:e,onClose:t,memory:n})=>n?u.jsx(qN,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Hx,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),u.jsx("div",{children:u.jsx(Ud,{variant:"outline",children:n.category})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(W5,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),u.jsx("div",{children:u.jsx(Ud,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vz,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(er,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(cc,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(QA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(r5,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),u.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&&u.jsxs("div",{children:[u.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),u.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})]}),u.jsx("div",{className:"flex justify-end pt-4",children:u.jsx(xr,{onClick:t,children:"Close"})})]})}):null,GN=({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:c="Delete",cancelButtonText:o="Cancel"})=>u.jsx(qN,{isOpen:e,onClose:t,title:a,size:"md",children:u.jsxs("div",{className:"space-y-6",children:[u.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(xr,{variant:"outline",onClick:t,children:o}),u.jsx(xr,{variant:"destructive",onClick:()=>{n(),t()},children:c})]})]})}),IJ=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),s=j.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)})),[]),c=j.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(x=>x).catch(x=>{throw a(x.message||"An error occurred"),x}).finally(()=>{t(!1)})),[]),o=j.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(x=>x).catch(x=>{throw a(x.message||"An error occurred"),x}).finally(()=>{t(!1)})),[]),d=j.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:c,put:o,del:d,loading:e,error:n}},BJ=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(!0),[s,c]=j.useState([]),[o,d]=j.useState(""),[h,m]=j.useState("all"),[x,p]=j.useState("all"),[b,v]=j.useState(null),[S,z]=j.useState(!1),[A,_]=j.useState(null),[E,N]=j.useState(!1),[P,D]=j.useState(null),[M,V]=j.useState(!1),{get:U,del:K,post:I}=IJ();j.useEffect(()=>{te()},[]);const te=async()=>{try{a(!0);const C=await U("/sati/memories");t(C),v(null)}catch(C){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",C)}finally{a(!1)}},le=()=>{s.length===Y.length?c([]):c(Y.map(C=>C.id))},ne=C=>{s.includes(C)?c(s.filter(H=>H!==C)):c([...s,C])},oe=async()=>{if(s.length!==0)try{await I("/sati/memories/bulk-delete",{ids:s}),await te(),c([]),z(!1)}catch(C){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",C)}},se=C=>{D(C),V(!0)},Z=async()=>{if(P)try{await K(`/sati/memories/${P}`),await te()}catch(C){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",C)}finally{D(null),V(!1)}},B=C=>{_(C),N(!0)},Y=e.filter(C=>{const H=C.summary.toLowerCase().includes(o.toLowerCase())||C.details?.toLowerCase().includes(o.toLowerCase())||C.category.toLowerCase().includes(o.toLowerCase()),w=h==="all"||C.category===h,X=x==="all"||C.importance===x;return H&&w&&X&&!C.archived}),ue=Array.from(new Set(e.map(C=>C.category))),O=Array.from(new Set(e.map(C=>C.importance)));return n?u.jsx(Sp,{className:"w-full",children:u.jsx(zp,{className:"flex justify-center items-center h-64",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Pi,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Sati Memories"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"View and manage long-term memories stored by Sati."})]})]}),s.length>0&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[s.length," selected"]}),u.jsxs(xr,{variant:"destructive",size:"sm",onClick:()=>z(!0),disabled:s.length===0,children:[u.jsx(pa,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&u.jsx(LJ,{variant:"destructive",children:u.jsx(PJ,{children:b})}),u.jsxs(Sp,{children:[u.jsx(LS,{className:"border-b border-azure-border dark:border-matrix-primary",children:u.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[u.jsxs("div",{className:"flex flex-col relative w-full",children:[u.jsx(R5,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),u.jsx("input",{type:"text",placeholder:"Search memories...",value:o,onChange:C=>d(C.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"})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[u.jsxs("select",{value:h,onChange:C=>m(C.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:[u.jsx("option",{value:"all",children:"All Categories"}),ue.map(C=>u.jsx("option",{value:C,children:C},C))]}),u.jsxs("select",{value:x,onChange:C=>p(C.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:[u.jsx("option",{value:"all",children:"All Importance"}),O.map(C=>u.jsx("option",{value:C,children:C},C))]})]})]})}),u.jsx(zp,{className:"p-0",children:u.jsxs(MJ,{children:[u.jsx(DJ,{children:u.jsxs(wp,{className:"hover:bg-transparent",children:[u.jsx(Vs,{className:"w-12",children:u.jsx($S,{checked:Y.length>0&&s.length===Y.length,onCheckedChange:le})}),u.jsx(Vs,{children:"Summary"}),u.jsx(Vs,{children:"Category"}),u.jsx(Vs,{children:"Importance"}),u.jsx(Vs,{children:"Created"}),u.jsx(Vs,{className:"w-32",children:"Actions"})]})}),u.jsx(RJ,{children:Y.length===0?u.jsx(wp,{children:u.jsx(Ri,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):Y.map(C=>u.jsxs(wp,{children:[u.jsx(Ri,{children:u.jsx($S,{checked:s.includes(C.id),onCheckedChange:()=>ne(C.id)})}),u.jsx(Ri,{className:"font-medium max-w-xs truncate",children:C.summary}),u.jsx(Ri,{children:u.jsx(Ud,{variant:"outline",children:C.category})}),u.jsx(Ri,{children:u.jsx(Ud,{variant:C.importance==="critical"?"destructive":C.importance==="high"?"default":C.importance==="medium"?"secondary":"outline",children:C.importance})}),u.jsx(Ri,{children:u.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[u.jsx(vz,{className:"w-4 h-4"}),new Date(C.created_at).toLocaleDateString()]})}),u.jsx(Ri,{children:u.jsxs("div",{className:"flex gap-1",children:[u.jsx(xr,{variant:"ghost",size:"sm",onClick:()=>B(C),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:u.jsx(cc,{className:"w-4 h-4"})}),u.jsx(xr,{variant:"ghost",size:"sm",onClick:()=>se(C.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:u.jsx(pa,{className:"w-4 h-4"})})]})})]},C.id))})]})})]}),S&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsxs(Sp,{className:"w-full max-w-md mx-4",children:[u.jsx(LS,{children:u.jsx($J,{children:"Delete Memories"})}),u.jsxs(zp,{children:[u.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",s.length," ","memory(ies)? This action cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(xr,{variant:"outline",onClick:()=>z(!1),children:"Cancel"}),u.jsx(xr,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),u.jsx(UJ,{isOpen:E,onClose:()=>N(!1),memory:A}),u.jsx(GN,{isOpen:M,onClose:()=>V(!1),onConfirm:Z,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},VJ=({label:e,values:t,onChange:n,placeholder:a})=>{const s=t.length>0?t:[""],c=(h,m)=>{const x=[...s];x[h]=m,n(x.filter(p=>p.trim().length>0))},o=()=>n([...s,""]),d=h=>{const m=s.filter((x,p)=>p!==h);n(m.filter(x=>x.trim().length>0))};return u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),s.map((h,m)=>u.jsxs("div",{className:"flex gap-2",children:[u.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:x=>c(m,x.target.value)}),u.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>d(m),children:"Remove"})]},`${e}-${m}`)),u.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:o,children:"Add argument"})]})},PS=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const c=j.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),o=(m,x,p)=>{const b=[...c];b[m]={...b[m],[x]:p},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},d=()=>n([...c,{key:"",value:""}]),h=m=>{const x=c.filter((p,b)=>b!==m);n(x.filter(p=>p.key.trim().length>0||p.value.trim().length>0))};return u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),c.map((m,x)=>u.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[u.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:p=>o(x,"key",p.target.value)}),u.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:p=>o(x,"value",p.target.value)}),u.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(x),children:"Remove"})]},`${e}-${x}`)),u.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:d,children:"Add entry"})]})},ZJ=({transport:e,command:t,url:n,args:a,env:s,headers:c,onCommandChange:o,onUrlChange:d,onArgsChange:h,onEnvChange:m,onHeadersChange:x})=>u.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",u.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:p=>o(p.target.value),placeholder:"npx"})]}),u.jsx(VJ,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",u.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:p=>d(p.target.value),placeholder:"https://example.com/mcp"})]}),u.jsx(PS,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&u.jsx(PS,{label:"Headers",values:c,onChange:x,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),FJ=nJ({name:kp().min(1,"Name is required"),transport:ZN([OS("stdio"),OS("http")]),command:kp().optional(),url:kp().optional()}),rd=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],jp=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),HJ=({open:e,mode:t,initial:n,onClose:a,onSubmit:s})=>{const[c,o]=j.useState(n?.name??""),[d,h]=j.useState(n?.config.transport??"stdio"),[m,x]=j.useState(n?.config.transport==="stdio"?n.config.command:""),[p,b]=j.useState(n?.config.transport==="http"?n.config.url:""),[v,S]=j.useState(n?.config.args??[]),[z,A]=j.useState(rd(n?.config.env)),[_,E]=j.useState(n?.config.transport==="http"?rd(n.config.headers):[]),[N,P]=j.useState(null);j.useEffect(()=>{e&&(o(n?.name??""),h(n?.config.transport??"stdio"),x(n?.config.transport==="stdio"?n.config.command:""),b(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),A(rd(n?.config.env)),E(n?.config.transport==="http"?rd(n.config.headers):[]),P(null))},[e,n]);const D=t==="create",M=async()=>{const U=FJ.safeParse({name:c,transport:d,command:m,url:p});if(!U.success){P(U.error.issues[0]?.message??"Invalid form");return}if(d==="stdio"&&(!m||m.trim().length===0)){P("Command is required for stdio transport.");return}if(d==="http"&&(!p||p.trim().length===0)){P("URL is required for http transport.");return}const K=d==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:z.length>0?jp(z):void 0}:{transport:"http",url:p.trim(),headers:_.length>0?jp(_):void 0,env:z.length>0?jp(z):void 0};P(null),await s(c.trim(),K)},V=j.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return u.jsx(Ir,{open:e,onOpenChange:a,children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{children:V})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",u.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:c,onChange:U=>o(U.target.value),placeholder:"coolify",disabled:!D})]}),u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",u.jsxs("select",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:d,onChange:U=>h(U.target.value),children:[u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"})]})]}),u.jsx(ZJ,{transport:d,command:m,url:p,args:v,env:z,headers:_,onCommandChange:x,onUrlChange:b,onArgsChange:S,onEnvChange:A,onHeadersChange:E}),N&&u.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:N}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.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"}),u.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:M,children:"Save"})]})]})]})})};function qJ({transport:e}){return e==="stdio"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium border rounded px-1.5 py-0.5 text-amber-500 bg-amber-500/10 border-amber-500/30",children:[u.jsx(Ll,{className:"w-2.5 h-2.5"}),"stdio"]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium border rounded px-1.5 py-0.5 text-cyan-500 bg-cyan-500/10 border-cyan-500/30",children:[u.jsx(Sz,{className:"w-2.5 h-2.5"}),"http"]})}function GJ({result:e}){return e?e.ok?u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-500",children:[u.jsx(bo,{className:"w-3 h-3"}),e.toolCount," tool",e.toolCount!==1?"s":""]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-red-500",children:[u.jsx(ei,{className:"w-3 h-3"}),"failed"]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-zinc-400 dark:text-zinc-600",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-400 dark:bg-zinc-600"}),"unchecked"]})}const YJ=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:s})=>{const c=t?.ok,o=t&&!t.ok,d=e.config.env?Object.entries(e.config.env):[];return u.jsxs("div",{className:`rounded-lg border flex flex-col bg-white dark:bg-black transition-all ${e.enabled?o?"border-red-400/40 dark:border-red-500/30":c?"border-emerald-400/50 dark:border-emerald-500/30":"border-azure-primary/40 dark:border-matrix-primary":"border-azure-border dark:border-matrix-primary/30"}`,children:[u.jsxs("div",{className:"p-4 flex items-start gap-3",children:[u.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${e.enabled?c?"bg-emerald-500/10":o?"bg-red-500/10":"bg-azure-primary/10 dark:bg-matrix-highlight/10":"bg-azure-surface dark:bg-zinc-900"}`,children:u.jsx(fc,{className:`w-4 h-4 ${e.enabled?c?"text-emerald-500":o?"text-red-500":"text-azure-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-tertiary"}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h3",{className:`font-semibold truncate ${e.enabled?"text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary"}`,children:e.name}),u.jsx(qJ,{transport:e.config.transport}),!e.enabled&&u.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded px-1.5 py-0.5 shrink-0",children:"disabled"})]}),u.jsx("div",{className:"mt-1",children:u.jsx(GJ,{result:t})})]})]}),u.jsxs("div",{className:"px-4 pb-4 space-y-2",children:[e.config.transport==="stdio"&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-1",children:"Command"}),u.jsxs("code",{className:"block text-xs font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2.5 py-1.5 break-all",children:[e.config.command,e.config.args&&e.config.args.length>0&&u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:[" ",e.config.args.join(" ")]})]})]}),e.config.transport==="http"&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-1",children:"URL"}),u.jsx("code",{className:"block text-xs font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2.5 py-1.5 break-all",children:e.config.url})]}),d.length>0&&u.jsxs("div",{children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-1",children:["Env vars (",d.length,")"]}),u.jsx("div",{className:"flex flex-wrap gap-1",children:d.map(([h])=>u.jsx("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/30 rounded px-1.5 py-0.5",children:h},h))})]}),o&&t.error&&u.jsxs("div",{className:"flex items-start gap-2 text-xs text-red-500 bg-red-500/10 border border-red-500/20 rounded p-2",children:[u.jsx(Gi,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{className:"break-all line-clamp-2",title:t.error,children:t.error})]})]}),u.jsxs("div",{className:"mt-auto px-4 py-3 border-t border-azure-border dark:border-matrix-primary/30 flex items-center justify-between gap-2",children:[e.config._comment?u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary truncate min-w-0",children:e.config._comment}):u.jsx("div",{}),u.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u.jsx("button",{type:"button",onClick:()=>n(e),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"Edit",children:u.jsx(dc,{className:"w-3.5 h-3.5"})}),u.jsx("button",{type:"button",onClick:()=>s(e,!e.enabled),className:`p-1.5 rounded border transition-colors ${e.enabled?"border-emerald-300 dark:border-emerald-700/60 text-emerald-500 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20":"border-azure-border dark:border-matrix-primary/40 text-zinc-400 dark:text-zinc-600 hover:text-azure-text dark:hover:text-matrix-secondary hover:border-azure-border dark:hover:border-matrix-primary"}`,title:e.enabled?"Disable":"Enable",children:e.enabled?u.jsx(Gx,{className:"w-4 h-4"}):u.jsx(qx,{className:"w-4 h-4"})}),u.jsx("button",{type:"button",onClick:()=>a(e),className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Delete",children:u.jsx(pa,{className:"w-3.5 h-3.5"})})]})]})]})},JJ=()=>{const{data:e,error:t,mutate:n,isLoading:a}=We("/api/mcp/servers",()=>hr.fetchServers()),[s,c]=j.useState(""),[o,d]=j.useState("all"),[h,m]=j.useState(!1),[x,p]=j.useState(null),[b,v]=j.useState(!1),[S,z]=j.useState(null),[A,_]=j.useState(null),[E,N]=j.useState({}),[P,D]=j.useState(!1),[M,V]=j.useState(!1),[U,K]=j.useState(null),I=e?.servers??[];j.useEffect(()=>{hr.fetchStats().then(C=>{K(C);const H={};for(const w of C.servers)H[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};N(H)}).catch(()=>{})},[]);const te=j.useMemo(()=>I.filter(C=>{const H=C.name.toLowerCase().includes(s.toLowerCase()),w=o==="all"||C.config.transport===o;return H&&w}),[I,s,o]),le=()=>{p(null),m(!0)},ne=C=>{p(C),m(!0)},oe=async()=>{const C=await hr.fetchStats();K(C);const H={};for(const w of C.servers)H[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};return N(H),C},se=async(C,H)=>{try{x?await hr.updateServer(x.name,H):await hr.addServer(C,H),m(!1),p(null),await n(),await hr.reloadTools();const w=await oe();_({type:"success",message:`MCP server saved. Tools reloaded: ${w.totalTools} total.`})}catch(w){_({type:"error",message:w.message||"Failed to save MCP server."})}},Z=async C=>{z(C),v(!0)},B=async()=>{if(S)try{await hr.deleteServer(S.name),await n(),v(!1),z(null),await hr.reloadTools();const C=await oe();_({type:"success",message:`MCP server deleted. Tools reloaded: ${C.totalTools} total.`})}catch(C){_({type:"error",message:C.message||"Failed to delete MCP server."})}},Y=async()=>{D(!0);try{const C=await oe();_({type:"success",message:`Status checked: ${C.totalTools} tools from ${C.servers.length} servers.`})}catch(C){_({type:"error",message:C.message||"Failed to check MCP status."})}finally{D(!1)}},ue=async()=>{V(!0);try{await hr.reloadTools();const C=await oe();_({type:"success",message:`MCP tools reloaded: ${C.totalTools} tools from ${C.servers.length} servers.`})}catch(C){_({type:"error",message:C.message||"Failed to reload MCP tools."})}finally{V(!1)}},O=async(C,H)=>{try{await hr.toggleServer(C.name,H),await n(),await hr.reloadTools();const w=await oe();_({type:"success",message:`MCP server ${H?"enabled":"disabled"}. Tools reloaded: ${w.totalTools} total.`})}catch(w){_({type:"error",message:w.message||"Failed to toggle MCP server."})}};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(bd,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"MCP Servers"}),U&&U.totalTools>0&&u.jsxs("span",{className:"rounded-full bg-azure-primary/10 px-2.5 py-0.5 text-xs font-semibold text-azure-primary dark:bg-matrix-highlight/20 dark:text-matrix-highlight",children:[U.totalTools," tools cached"]})]}),u.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:["Manage MCP servers stored in mcps.json."," ",U?.lastLoadedAt&&u.jsxs("span",{className:"dark:text-matrix-tertiary",children:["Last loaded: ",new Date(U.lastLoadedAt).toLocaleTimeString()]})]})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.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:Y,children:P?"Checking…":"Check Status"}),u.jsx("button",{type:"button",disabled:M,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:ue,children:M?"Reloading…":"Reload MCPs"}),u.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"})]})]}),A&&u.jsx("div",{className:`p-4 rounded border ${A.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:A.message}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[u.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:C=>c(C.target.value),placeholder:"Search by name"}),u.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:o,onChange:C=>d(C.target.value),children:[u.jsx("option",{value:"all",children:"All"}),u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"})]})]}),a&&u.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&u.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&te.length===0&&u.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."}),u.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:te.map(C=>u.jsx(YJ,{server:C,probeResult:E[C.name],onEdit:ne,onDelete:Z,onToggle:O},`${C.name}-${C.enabled?"on":"off"}`))}),u.jsx(HJ,{open:h,mode:x?"edit":"create",initial:x??void 0,onClose:()=>m(!1),onSubmit:se}),u.jsx(Ir,{open:b,onOpenChange:v,children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{children:"Confirm Deletion"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",u.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',S?.name,'"']}),"? This action cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>v(!1),children:"Cancel"}),u.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:B,children:"Delete"})]})]})]})})]})},_p={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)}`)},KJ={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},US={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},XJ=["anthropic","openai","google","openrouter","ollama","other"],IS=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),QJ=()=>{const{data:e=[],mutate:t}=We("/api/model-pricing",()=>_p.list()),[n,a]=j.useState(!1),[s,c]=j.useState(null),[o,d]=j.useState(IS()),[h,m]=j.useState(null),[x,p]=j.useState(null),[b,v]=j.useState(!1),S=(N,P)=>{p({type:N,message:P}),setTimeout(()=>p(null),3e3)},z=()=>{c(null),d(IS()),a(!0)},A=N=>{c(N),d({...N}),a(!0)},_=async()=>{if(!(!o.provider.trim()||!o.model.trim())){v(!0);try{await _p.upsert(o),await t(),a(!1),S("success",s?"Pricing updated.":"Pricing created.")}catch{S("error","Failed to save pricing entry.")}finally{v(!1)}}},E=async()=>{if(h)try{await _p.delete(h.provider,h.model),await t(),m(null),S("success","Pricing entry deleted.")}catch{S("error","Failed to delete pricing entry.")}};return u.jsxs($e.div,{variants:KJ,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:US,className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(io,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Model Pricing"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Manage per-model pricing to estimate LLM costs in Usage Stats."})]})]}),u.jsxs("button",{onClick:z,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:[u.jsx(oo,{className:"w-4 h-4"})," Add Pricing"]})]}),x&&u.jsx($e.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${x.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:x.message}),u.jsx($e.div,{variants:US,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(N=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:N},N))})}),u.jsx("tbody",{children:e.length===0?u.jsx("tr",{children:u.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(N=>u.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:[u.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:N.provider}),u.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:N.model}),u.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.input_price_per_1m.toFixed(4)]}),u.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.output_price_per_1m.toFixed(4)]}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>A(N),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:u.jsx(dc,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>m(N),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:u.jsx(pa,{className:"w-4 h-4"})})]})})]},`${N.provider}/${N.model}`))})]})}),u.jsx(Ir,{open:n,onOpenChange:a,children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{children:s?"Edit Pricing":"Add Pricing"})}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),s?u.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:o.provider}):u.jsxs("select",{value:o.provider,onChange:N=>d({...o,provider:N.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:[u.jsx("option",{value:"",children:"Select provider..."}),XJ.map(N=>u.jsx("option",{value:N,children:N},N))]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),s?u.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:o.model}):u.jsx("input",{type:"text",value:o.model,onChange:N=>d({...o,model:N.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"})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),u.jsx("input",{type:"number",min:0,step:.001,value:o.input_price_per_1m,onChange:N=>d({...o,input_price_per_1m:parseFloat(N.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"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),u.jsx("input",{type:"number",min:0,step:.001,value:o.output_price_per_1m,onChange:N=>d({...o,output_price_per_1m:parseFloat(N.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"})]})]}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.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"}),u.jsx("button",{onClick:_,disabled:b||!o.provider.trim()||!o.model.trim(),className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving...":"Save"})]})]})]})}),u.jsx(Ir,{open:!!h,onOpenChange:N=>!N&&m(null),children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{children:"Delete Pricing Entry"})}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",u.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.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"}),u.jsx("button",{onClick:E,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},WJ={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},BS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},eK=["ui","telegram","discord"],VS=()=>({name:"",prompt:"",notification_channels:["ui"]}),tK=()=>{const{data:e=[],mutate:t}=We("/webhooks",()=>Ya.list(),{refreshInterval:1e4}),[n,a]=j.useState(!1),[s,c]=j.useState(null),[o,d]=j.useState(VS()),[h,m]=j.useState(null),[x,p]=j.useState(null),[b,v]=j.useState(!1),[S,z]=j.useState(null),[A,_]=j.useState(null),E=(ne,oe)=>{p({type:ne,message:oe}),setTimeout(()=>p(null),3500)},N=()=>{c(null),d(VS()),_(null),a(!0)},P=ne=>{c(ne),d({name:ne.name,prompt:ne.prompt,notification_channels:ne.notification_channels}),_(null),a(!0)},D=ne=>/^[a-z0-9-_]+$/.test(ne),M=async()=>{if(!(!o.name.trim()||!o.prompt.trim())){if(!D(o.name)){_("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(o.notification_channels.length===0){_("Select at least one notification channel.");return}_(null),v(!0);try{s?(await Ya.update(s.id,o),E("success","Webhook updated.")):(await Ya.create(o),E("success","Webhook created.")),await t(),a(!1)}catch(ne){const oe=ne?.message||"Failed to save webhook.";_(oe)}finally{v(!1)}}},V=async ne=>{try{await Ya.update(ne.id,{enabled:!ne.enabled}),await t()}catch{E("error","Failed to toggle webhook.")}},U=async()=>{if(h)try{await Ya.delete(h.id),await t(),m(null),E("success","Webhook deleted.")}catch{E("error","Failed to delete webhook.")}},K=ne=>`${window.location.origin}/api/webhooks/trigger/${ne}`,I=ne=>`curl -X POST ${K(ne.name)} \\
|
|
161
|
+
-H "x-api-key: ${ne.api_key}" \\
|
|
162
|
+
-H "Content-Type: application/json" \\
|
|
163
|
+
-d '{"event":"your_payload"}'`,te=async(ne,oe)=>{await navigator.clipboard.writeText(ne),z(oe),setTimeout(()=>z(null),2e3)},le=ne=>{const oe=o.notification_channels.includes(ne);d({...o,notification_channels:oe?o.notification_channels.filter(se=>se!==ne):[...o.notification_channels,ne]})};return u.jsxs($e.div,{variants:WJ,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:BS,className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Pp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Webhooks"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs(Wa,{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:[u.jsx(ql,{className:"w-4 h-4"}),"Notifications"]}),u.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:[u.jsx(oo,{className:"w-4 h-4"}),"New Webhook"]})]})]}),x&&u.jsx($e.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${x.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:x.message}),u.jsx($e.div,{variants:BS,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(ne=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ne},ne))})}),u.jsx("tbody",{children:e.length===0?u.jsx("tr",{children:u.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",u.jsx("button",{onClick:N,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ne=>u.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:[u.jsx("td",{className:"px-4 py-3",children:u.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:ne.name})}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[ne.api_key.slice(0,16),"…"]}),u.jsx("button",{onClick:()=>te(I(ne),`curl-${ne.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-${ne.id}`?u.jsx(Op,{className:"w-3.5 h-3.5 text-green-500"}):u.jsx(Ll,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>te(ne.api_key,`key-${ne.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-${ne.id}`?u.jsx(Op,{className:"w-3.5 h-3.5 text-green-500"}):u.jsx(DA,{className:"w-3.5 h-3.5"})})]})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx("div",{className:"flex gap-1 flex-wrap",children:ne.notification_channels.map(oe=>u.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))})}),u.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ne.trigger_count}),u.jsx("td",{className:"px-4 py-3",children:u.jsx("button",{onClick:()=>V(ne),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ne.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:ne.enabled?u.jsxs(u.Fragment,{children:[u.jsx(Gx,{className:"w-3.5 h-3.5"})," Enabled"]}):u.jsxs(u.Fragment,{children:[u.jsx(qx,{className:"w-3.5 h-3.5"})," Disabled"]})})}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>P(ne),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:u.jsx(dc,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>m(ne),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:u.jsx(pa,{className:"w-4 h-4"})})]})})]},ne.id))})]})})}),u.jsxs(Ir,{open:n,onOpenChange:a,children:[u.jsx(Br,{children:u.jsx(Vr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Webhook":"New Webhook"})}),u.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",u.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),u.jsx("input",{type:"text",value:o.name,onChange:ne=>{d({...o,name:ne.target.value.toLowerCase().replace(/\s+/g,"-")}),_(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"}),o.name&&u.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",u.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",o.name]})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),u.jsx("textarea",{rows:5,value:o.prompt,onChange:ne=>d({...o,prompt:ne.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"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),u.jsx("div",{className:"flex gap-4",children:eK.map(ne=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:o.notification_channels.includes(ne),onChange:()=>le(ne),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),u.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:ne})]},ne))})]}),A&&u.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:A}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.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"}),u.jsx("button",{onClick:M,disabled:b||!o.name.trim()||!o.prompt.trim()||o.notification_channels.length===0,className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving…":s?"Update":"Create"})]})]})]}),u.jsxs(Ir,{open:!!h,onOpenChange:ne=>!ne&&m(null),children:[u.jsx(Br,{children:u.jsx(Vr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),u.jsxs("div",{className:"p-6 space-y-4",children:[u.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",u.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.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"}),u.jsx("button",{onClick:U,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},nK={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},ZS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},FS=({status:e})=>e==="completed"?u.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[u.jsx(Fx,{className:"w-4 h-4"}),u.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?u.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[u.jsx(ei,{className:"w-4 h-4"}),u.jsx("span",{className:"text-xs",children:"Failed"})]}):u.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[u.jsx(er,{className:"w-4 h-4 animate-pulse"}),u.jsx("span",{className:"text-xs",children:"Pending"})]}),ad=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),rK=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},aK=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),{data:s=[],mutate:c}=We(["/webhooks/notifications",e],()=>Ya.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),o=s.filter(x=>!x.read).length,d=async x=>{x.length!==0&&(await Ya.markRead(x),await c())},h=()=>{const x=s.filter(p=>!p.read).map(p=>p.id);d(x)},m=async x=>{a(x),x.read||await d([x.id])};return u.jsxs($e.div,{variants:nK,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:ZS,className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:"relative w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:[u.jsx(ql,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"}),o>0&&u.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:o>9?"9+":o})]}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Notifications"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),u.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[u.jsxs(Wa,{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:[u.jsx(bz,{className:"w-4 h-4"}),"Back to Webhooks"]}),u.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:[u.jsx(GA,{className:"w-4 h-4"}),"Unread only"]}),o>0&&u.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:[u.jsx(bA,{className:"w-4 h-4"}),"Mark all read"]})]})]}),u.jsx($e.div,{variants:ZS,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(x=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:x},x))})}),u.jsx("tbody",{children:s.length===0?u.jsx("tr",{children:u.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(x=>u.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 ${x.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[u.jsx("td",{className:"px-4 py-3 w-6",children:!x.read&&u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),u.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:x.webhook_name}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(FS,{status:x.status})}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:ad(x.created_at)}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:x.completed_at?ad(x.completed_at):"—"}),u.jsx("td",{className:"px-4 py-3",children:u.jsx("button",{onClick:()=>m(x),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:u.jsx(cc,{className:"w-4 h-4"})})})]},x.id))})]})})}),u.jsxs(Ir,{open:!!n,onOpenChange:x=>!x&&a(null),children:[u.jsx(Br,{children:u.jsxs(Vr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(ql,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&u.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[u.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[u.jsx(FS,{status:n.status}),u.jsx("span",{children:ad(n.created_at)}),n.completed_at&&u.jsxs("span",{children:["→ ",ad(n.completed_at)]})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),u.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:rK(n.payload)})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),u.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??u.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),u.jsx("div",{className:"flex justify-end pt-2",children:u.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"})})]})]})]})},iK={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},id={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},sK={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function YN({status:e}){const t="inline-flex items-center gap-1 text-xs font-medium rounded-full px-2 py-0.5 border";return e==="completed"?u.jsxs("span",{className:`${t} text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20 border-emerald-200 dark:border-emerald-700/50`,children:[u.jsx(Fx,{className:"w-3 h-3"}),"Completed"]}):e==="failed"?u.jsxs("span",{className:`${t} text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-700/50`,children:[u.jsx(ei,{className:"w-3 h-3"}),"Failed"]}):e==="running"?u.jsxs("span",{className:`${t} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-700/50`,children:[u.jsx(uc,{className:"w-3 h-3 animate-spin"}),"Running"]}):e==="cancelled"?u.jsxs("span",{className:`${t} text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-900 border-zinc-200 dark:border-zinc-700`,children:[u.jsx(ei,{className:"w-3 h-3"}),"Cancelled"]}):u.jsxs("span",{className:`${t} text-yellow-600 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-700/50`,children:[u.jsx(er,{className:"w-3 h-3"}),"Pending"]})}function JN({agent:e}){return u.jsx("span",{className:"inline-flex items-center text-[10px] font-medium font-mono rounded px-1.5 py-0.5 border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary uppercase",children:e})}function KN({channel:e}){return u.jsx("span",{className:"inline-flex items-center text-[10px] font-medium rounded px-1.5 py-0.5 border border-zinc-200 dark:border-zinc-700 bg-zinc-100 dark:bg-zinc-900 text-zinc-500 dark:text-zinc-400 uppercase",children:e})}const HS=e=>e?new Date(e).toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",qS=e=>e?new Date(e).toLocaleString():"—";function oK({task:e,onClose:t,onCancel:n,onRetry:a}){const s=e.status==="pending"||e.status==="running",c=e.status==="failed";return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),u.jsxs("div",{className:"relative bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-azure-border dark:border-matrix-primary shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx("div",{className:"w-9 h-9 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 flex items-center justify-center shrink-0",children:u.jsx(Gl,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight",children:"Task Details"}),u.jsx(YN,{status:e.status})]}),u.jsx("p",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-tertiary mt-0.5 truncate",children:e.id})]})]}),u.jsx("button",{onClick:t,className:"p-1.5 rounded text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight hover:bg-azure-surface dark:hover:bg-zinc-900 transition-colors shrink-0",children:u.jsx(Yi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"overflow-y-auto flex-1 p-5 space-y-5",children:[u.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-sm",children:[{label:"Agent",value:u.jsx(JN,{agent:e.agent})},{label:"Channel",value:u.jsx(KN,{channel:e.origin_channel})},{label:"Attempts",value:`${e.attempt_count} / ${e.max_attempts}`},{label:"Session",value:u.jsx("span",{className:"font-mono text-xs",children:e.session_id})},{label:"Created",value:qS(e.created_at)},{label:"Finished",value:qS(e.finished_at)}].map(({label:o,value:d})=>u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:o}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary",children:d})]},o))}),u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Input"}),u.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed font-mono",children:e.input})]}),e.output&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Output"}),u.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-64 whitespace-pre-wrap leading-relaxed font-mono",children:e.output})]}),e.error&&u.jsxs("div",{children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-red-500 mb-2 flex items-center gap-1",children:[u.jsx(Gi,{className:"w-3 h-3"})," Error"]}),u.jsx("pre",{className:"rounded-lg bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800/50 p-4 text-xs text-red-600 dark:text-red-400 overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed font-mono",children:e.error})]})]}),(s||c)&&u.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t border-azure-border dark:border-matrix-primary shrink-0",children:[s&&u.jsx("button",{onClick:n,className:"px-4 py-2 rounded text-sm border border-red-300 dark:border-red-700/60 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:"Cancel Task"}),c&&u.jsx("button",{onClick:a,className:"px-4 py-2 rounded text-sm font-medium bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors",children:"Retry Task"})]})]})]})}const lK={Pending:"text-yellow-600 dark:text-yellow-400",Running:"text-blue-600 dark:text-blue-400",Completed:"text-emerald-600 dark:text-emerald-400",Failed:"text-red-600 dark:text-red-400",Cancelled:"text-zinc-500 dark:text-zinc-400",Total:"text-azure-text dark:text-matrix-highlight"};function Zs({label:e,value:t}){return u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black px-4 py-3",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:e}),u.jsx("p",{className:`text-2xl font-bold mt-0.5 ${lK[e]??"text-azure-text dark:text-matrix-secondary"}`,children:t})]})}function cK(){const[e,t]=j.useState(""),[n,a]=j.useState(""),[s,c]=j.useState(""),[o,d]=j.useState(""),[h,m]=j.useState(null),x=j.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:s||void 0,session_id:o.trim()||void 0,limit:200}),[e,n,s,o]),{data:p}=We("/tasks/stats",()=>Ja.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=We(["/tasks",x],()=>Ja.list(x),{refreshInterval:3e3}),S="px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-white dark:bg-black text-azure-text dark:text-matrix-secondary text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight";return u.jsxs($e.div,{variants:iK,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:id,className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Gl,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Tasks"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),u.jsxs($e.div,{variants:id,className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[u.jsx(Zs,{label:"Pending",value:p?.pending??0}),u.jsx(Zs,{label:"Running",value:p?.running??0}),u.jsx(Zs,{label:"Completed",value:p?.completed??0}),u.jsx(Zs,{label:"Failed",value:p?.failed??0}),u.jsx(Zs,{label:"Cancelled",value:p?.cancelled??0}),u.jsx(Zs,{label:"Total",value:p?.total??0})]}),u.jsxs($e.div,{variants:id,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-white dark:bg-black grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[u.jsxs("select",{className:S,value:e,onChange:z=>t(z.target.value||""),children:[u.jsx("option",{value:"",children:"All status"}),Object.entries(sK).map(([z,A])=>u.jsx("option",{value:z,children:A},z))]}),u.jsxs("select",{className:S,value:n,onChange:z=>a(z.target.value||""),children:[u.jsx("option",{value:"",children:"All agents"}),u.jsx("option",{value:"apoc",children:"Apoc"}),u.jsx("option",{value:"neo",children:"Neo"}),u.jsx("option",{value:"smith",children:"Smith"}),u.jsx("option",{value:"trinit",children:"Trinity"})]}),u.jsxs("select",{className:S,value:s,onChange:z=>c(z.target.value||""),children:[u.jsx("option",{value:"",children:"All channels"}),u.jsx("option",{value:"telegram",children:"Telegram"}),u.jsx("option",{value:"discord",children:"Discord"}),u.jsx("option",{value:"ui",children:"UI"}),u.jsx("option",{value:"api",children:"API"}),u.jsx("option",{value:"webhook",children:"Webhook"}),u.jsx("option",{value:"cli",children:"CLI"})]}),u.jsx("input",{className:`${S} placeholder:text-azure-text-secondary/50 dark:placeholder:text-matrix-secondary/40`,value:o,onChange:z=>d(z.target.value),placeholder:"Filter by session ID"})]}),u.jsx($e.div,{variants:id,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm min-w-[820px]",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:[{label:"ID",cls:"w-24"},{label:"Status",cls:"w-32"},{label:"Agent",cls:"w-24"},{label:"Channel",cls:"w-24"},{label:"Session",cls:"w-28"},{label:"Attempts",cls:"w-20"},{label:"Created",cls:"w-36"},{label:"Finished",cls:"w-36"},{label:"",cls:"w-16"}].map(z=>u.jsx("th",{className:`text-left px-4 py-3 text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary ${z.cls}`,children:z.label},z.label))})}),u.jsx("tbody",{children:b.length===0?u.jsx("tr",{children:u.jsxs("td",{colSpan:9,className:"px-4 py-12 text-center text-azure-text-secondary dark:text-matrix-tertiary",children:[u.jsx(Ka,{className:"w-5 h-5 mx-auto mb-2 opacity-40"}),"No tasks found."]})}):b.map(z=>u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/60 dark:hover:bg-zinc-900/50 transition-colors",children:[u.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:z.id.slice(0,8)}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(YN,{status:z.status})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(JN,{agent:z.agent})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(KN,{channel:z.origin_channel})}),u.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:z.session_id?z.session_id.slice(0,10):"—"}),u.jsxs("td",{className:"px-4 py-3 text-center text-azure-text-secondary dark:text-matrix-secondary text-xs",children:[z.attempt_count,"/",z.max_attempts]}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:HS(z.created_at)}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:HS(z.finished_at)}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>m(z),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"View details",children:u.jsx(cc,{className:"w-3.5 h-3.5"})}),(z.status==="pending"||z.status==="running")&&u.jsx("button",{onClick:async()=>{await Ja.cancel(z.id),v()},className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Cancel task",children:u.jsx(oA,{className:"w-3.5 h-3.5"})})]})})]},z.id))})]})})}),h&&u.jsx(oK,{task:h,onClose:()=>m(null),onCancel:async()=>{await Ja.cancel(h.id),m(null),v()},onRetry:async()=>{await Ja.retry(h.id),m(null),v()}})]})}const Np={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},GS={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},uK={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 dK(){return xe.get("/trinity/databases")}function fK(){const{data:e,error:t}=We("/trinity/databases",dK,{refreshInterval:3e4}),[n,a]=j.useState(!1),[s,c]=j.useState(null),[o,d]=j.useState(GS),[h,m]=j.useState(!1),[x,p]=j.useState(null),[b,v]=j.useState({}),[S,z]=j.useState(null),[A,_]=j.useState({}),[E,N]=j.useState(null),[P,D]=j.useState(null),[M,V]=j.useState(null),[U,K]=j.useState(!1),I=()=>{c(null),d(GS),K(!1),p(null),a(!0)},te=w=>{c(w),d({name:w.name,type:w.type,host:w.host||"",port:w.port?String(w.port):"",database_name:w.database_name||"",username:w.username||"",password:"",connection_string:"",allow_read:w.allow_read,allow_insert:w.allow_insert,allow_update:w.allow_update,allow_delete:w.allow_delete,allow_ddl:w.allow_ddl}),K(!!w.connection_string),p(null),a(!0)},le=async()=>{if(m(!0),p(null),!U&&!o.database_name.trim()){p(o.type==="sqlite"?"File path is required.":"Database name is required."),m(!1);return}try{const w={name:o.name,type:o.type,allow_read:o.allow_read,allow_insert:o.allow_insert,allow_update:o.allow_update,allow_delete:o.allow_delete,allow_ddl:o.allow_ddl};U?(!s||o.connection_string)&&(w.connection_string=o.connection_string||null):(w.host=o.host||null,w.port=o.port?parseInt(o.port):null,w.database_name=o.database_name||null,w.username=o.username||null,(!s||o.password)&&(w.password=o.password||null)),s?await xe.put(`/trinity/databases/${s.id}`,w):await xe.post("/trinity/databases",w),await Bn("/trinity/databases"),a(!1)}catch(w){p(w.message||"Failed to save database")}finally{m(!1)}},ne=w=>{V(w)},oe=async()=>{if(!M)return;const w=M.id;D(w);try{await xe.delete(`/trinity/databases/${w}`),await Bn("/trinity/databases")}catch(X){alert(`Delete failed: ${X.message}`)}finally{D(null),V(null)}},se=async w=>{z(w);try{const X=await xe.post(`/trinity/databases/${w}/test`,{});_(me=>({...me,[w]:X.success}))}catch{_(X=>({...X,[w]:!1}))}finally{z(null)}},Z=async w=>{N(w);try{await xe.post(`/trinity/databases/${w}/refresh-schema`,{}),await Bn("/trinity/databases")}catch(X){alert(`Schema refresh failed: ${X.message}`)}finally{N(null)}},B=w=>{v(X=>({...X,[w]:!X[w]}))},Y=w=>{w!=="mongodb"&&K(!1),d(X=>({...X,type:w,port:Np[w]?String(Np[w]):""}))},ue=w=>{d(X=>({...X,[w]:!X[w]}))};if(t)return u.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const O="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",C="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",H=w=>[{key:"allow_read",badge:"R"},{key:"allow_insert",badge:"I"},{key:"allow_update",badge:"U"},{key:"allow_delete",badge:"D"},{key:"allow_ddl",badge:"DDL"}].filter(me=>w[me.key]).map(me=>me.badge);return u.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Qs,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Trinity Databases"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Register databases for Trinity to access and query."})]})]}),u.jsxs("button",{onClick:I,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:[u.jsx(oo,{className:"w-4 h-4"}),"Register Database"]})]}),e?e.length===0?u.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:[u.jsx(Qs,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),u.jsx("p",{className:"font-medium",children:"No databases registered"}),u.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):u.jsx("div",{className:"space-y-4",children:e.map(w=>{const X=w.schema_json?JSON.parse(w.schema_json):null,me=!!X?.databases,pe=me?X.databases.reduce((Ue,Je)=>Ue+Je.tables.length,0):X?.tables?.length??0,ge=me?X.databases.length:0,Pe=w.type==="mongodb"?"collection":"table",Ee=w.type==="mongodb"?"collections":"tables",yt=A[w.id],$=b[w.id],Oe=H(w);return u.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[u.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[u.jsx(Qs,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),u.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}),yt===!0&&u.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[u.jsx(cd,{className:"w-3 h-3"})," Connected"]}),yt===!1&&u.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[u.jsx(Nz,{className:"w-3 h-3"})," Failed"]}),Oe.length>0&&u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Lp,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),Oe.map(Ue=>u.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:Ue},Ue))]})]}),u.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",me&&ge>0&&u.jsxs("span",{className:"ml-2 opacity-70",children:["· ",ge," database",ge!==1?"s":""," · ",pe," ",pe!==1?Ee:Pe]}),!me&&pe>0&&u.jsxs("span",{className:"ml-2 opacity-70",children:["· ",pe," ",pe!==1?Ee:Pe]}),w.schema_updated_at&&u.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),u.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[u.jsx("button",{onClick:()=>se(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?u.jsx(cd,{className:"w-4 h-4 animate-pulse"}):u.jsx(cd,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>Z(w.id),disabled:E===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:u.jsx(Ka,{className:`w-4 h-4 ${E===w.id?"animate-spin":""}`})}),u.jsx("button",{onClick:()=>te(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"}),u.jsx("button",{onClick:()=>ne(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:u.jsx(pa,{className:"w-4 h-4"})}),X&&u.jsx("button",{onClick:()=>B(w.id),title:$?"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:$?u.jsx(yo,{className:"w-4 h-4"}):u.jsx(Zd,{className:"w-4 h-4"})})]})]}),$&&X&&u.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[u.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:me?`${ge} database${ge!==1?"s":""} — ${pe} ${pe!==1?Ee:Pe} total`:`Schema — ${pe} ${pe!==1?Ee:Pe}`}),u.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:me?X.databases?.map(Ue=>u.jsxs("div",{className:"text-xs",children:[u.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[u.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:Ue.name}),u.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",Ue.tables.length," ",Ue.tables.length!==1?Ee:Pe,")"]})]}),u.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[Ue.tables.map(Je=>u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:Je.name}),u.jsx("div",{className:"pl-3 space-y-0.5",children:Je.columns?.map(St=>u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[u.jsx("span",{children:St.name}),u.jsx("span",{className:"opacity-50 ml-2",children:St.type}),St.nullable===!1&&u.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},St.name))})]},Je.name)),Ue.tables.length===0&&u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ee]})]})]},Ue.name)):X.tables?.map(Ue=>u.jsxs("div",{className:"text-xs",children:[u.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:Ue.name}),u.jsx("div",{className:"pl-3 space-y-0.5",children:Ue.columns?.map(Je=>u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[u.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:Je.name}),u.jsx("span",{className:"opacity-50 ml-2",children:Je.type}),Je.nullable===!1&&u.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},Je.name))})]},Ue.name))})]})]},w.id)})}):u.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),u.jsx(_2,{isOpen:!!M,onClose:()=>V(null),onConfirm:oe,title:"Delete database",description:`Remove "${M?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),u.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:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[u.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Database":"Register Database"}),u.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:u.jsx(Yi,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Name *"}),u.jsx("input",{className:O,value:o.name,onChange:w=>d(X=>({...X,name:w.target.value})),placeholder:"My Production DB"})]}),u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Type *"}),u.jsxs("select",{className:O,value:o.type,onChange:w=>Y(w.target.value),children:[u.jsx("option",{value:"postgresql",children:"PostgreSQL"}),u.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),u.jsx("option",{value:"sqlite",children:"SQLite"}),u.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),o.type==="mongodb"&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{type:"button",onClick:()=>K(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${U?"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"}),u.jsx("button",{type:"button",onClick:()=>K(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${U?"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"})]}),o.type==="mongodb"&&U?u.jsxs("div",{children:[u.jsxs("label",{className:C,children:["Connection String ",s&&u.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),u.jsx("input",{className:O,type:"password",value:o.connection_string,onChange:w=>d(X=>({...X,connection_string:w.target.value})),placeholder:s?"unchanged":"mongodb://user:pass@host:27017/dbname"}),u.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."})]}):u.jsxs(u.Fragment,{children:[o.type!=="sqlite"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Host"}),u.jsx("input",{className:O,value:o.host,onChange:w=>d(X=>({...X,host:w.target.value})),placeholder:"localhost"})]}),u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Port"}),u.jsx("input",{className:O,type:"number",value:o.port,onChange:w=>d(X=>({...X,port:w.target.value})),placeholder:String(Np[o.type]||"")})]})]}),u.jsxs("div",{children:[u.jsxs("label",{className:C,children:[o.type==="sqlite"?"File Path":"Database Name"," *"]}),u.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 ${x&&!o.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:o.database_name,onChange:w=>d(X=>({...X,database_name:w.target.value})),placeholder:o.type==="sqlite"?"/path/to/database.db":"mydb"})]}),o.type!=="sqlite"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Username"}),u.jsx("input",{className:O,value:o.username,onChange:w=>d(X=>({...X,username:w.target.value})),placeholder:"postgres"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:C,children:["Password ",s&&u.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),u.jsx("input",{className:O,type:"password",value:o.password,onChange:w=>d(X=>({...X,password:w.target.value})),placeholder:s?"unchanged":"••••••••"}),u.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."})]})]})]}),u.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(Lp,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),u.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),u.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."}),u.jsx("div",{className:"space-y-2",children:uK[o.type]?.map(({key:w,label:X,description:me})=>u.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[u.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[u.jsx("input",{type:"checkbox",checked:!!o[w],onChange:()=>ue(w),className:"sr-only"}),u.jsx("div",{className:`w-4 h-4 rounded border transition-colors flex items-center justify-center ${o[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:o[w]&&u.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:u.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:X}),u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:me})]})]},w))})]}),x&&u.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:x})]}),u.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[u.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"}),u.jsx("button",{onClick:le,disabled:h||!o.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 hK={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 mK({jobId:e}){const{data:t,isLoading:n}=S7(e,50);return n?u.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?u.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary italic",children:"No executions yet."}):u.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary dark:bg-zinc-900 overflow-hidden",children:u.jsxs("table",{className:"w-full text-xs font-mono",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary",children:[u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Triggered At"}),u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Completed At"}),u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Status"}),u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Error"})]})}),u.jsx("tbody",{children:t.map(a=>u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0",children:[u.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:new Date(a.triggered_at).toLocaleString()}),u.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:a.completed_at?new Date(a.completed_at).toLocaleString():"—"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold uppercase ${hK[a.status]}`,children:a.status})}),u.jsx("td",{className:"px-3 py-2 dark:text-red-400 max-w-xs truncate",children:a.error??"—"})]},a.id))})]})})}function pK({enabled:e}){return u.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 YS(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function JS(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function xK({onEdit:e}){const{data:t,isLoading:n}=w7(),[a,s]=j.useState(null),[c,o]=j.useState(null),[d,h]=j.useState(null),m=async p=>{o(p.id);try{p.enabled?await Vi.disableJob(p.id):await Vi.enableJob(p.id),await Bn(b=>typeof b=="string"&&b.startsWith("/chronos"))}finally{o(null)}},x=async()=>{if(d){o(d.id);try{await Vi.deleteJob(d.id),await Bn(p=>typeof p=="string"&&p.startsWith("/chronos"))}finally{o(null),h(null)}}};return n?u.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?u.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 ",u.jsx("strong",{className:"dark:text-matrix-highlight",children:"New Job"})," to get started."]}):u.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary overflow-hidden",children:[u.jsxs("table",{className:"w-full text-sm font-mono",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900",children:[u.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Prompt"}),u.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"}),u.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"}),u.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"}),u.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Status"}),u.jsx("th",{className:"px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium text-right",children:"Actions"})]})}),u.jsx("tbody",{children:t.map(p=>u.jsxs(u.Fragment,{children:[u.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:[u.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary max-w-xs",children:[u.jsx("span",{title:p.prompt,children:YS(p.prompt,50)}),u.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:p.created_by})]}),u.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden md:table-cell text-xs",children:[u.jsx("div",{className:"capitalize",children:p.schedule_type}),u.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:p.schedule_expression,children:p.schedule_expression})]}),u.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:JS(p.next_run_at)}),u.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:JS(p.last_run_at)}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(pK,{enabled:p.enabled})}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center justify-end gap-1",children:[u.jsx("button",{title:a===p.id?"Hide history":"View history",onClick:()=>s(a===p.id?null:p.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===p.id?u.jsx(kz,{className:"w-4 h-4"}):u.jsx(t5,{className:"w-4 h-4"})}),u.jsx("button",{title:"Edit",onClick:()=>e(p),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:u.jsx(_5,{className:"w-4 h-4"})}),u.jsx("button",{title:p.enabled?"Disable":"Enable",onClick:()=>m(p),disabled:c===p.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:p.enabled?u.jsx(z5,{className:"w-4 h-4"}):u.jsx(jz,{className:"w-4 h-4"})}),u.jsx("button",{title:"Delete",onClick:()=>h(p),disabled:c===p.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:u.jsx(pa,{className:"w-4 h-4"})})]})})]},p.id),a===p.id&&u.jsx("tr",{className:"bg-azure-surface dark:bg-zinc-900/50",children:u.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[u.jsx("div",{className:"text-xs font-bold dark:text-matrix-highlight mb-2",children:"Execution History"}),u.jsx(mK,{jobId:p.id})]})},`${p.id}-history`)]}))})]}),u.jsx(GN,{isOpen:!!d,onClose:()=>h(null),onConfirm:x,title:"Delete Chronos Job",message:d?`Delete job "${YS(d.prompt,60)}"? This action cannot be undone.`:""})]})}function gK({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=j.useState(null),[c,o]=j.useState(null),d=j.useRef(null);if(j.useEffect(()=>{if(!e.trim()){s(null),o(null);return}return d.current&&clearTimeout(d.current),d.current=setTimeout(async()=>{try{const m=await Vi.preview(e,t,n);s(m),o(null)}catch(m){o(m.message??"Invalid expression"),s(null)}},500),()=>{d.current&&clearTimeout(d.current)}},[e,t,n]),!e.trim())return null;const h=(m,x)=>{try{return new Date(m).toLocaleString("pt-BR",{timeZone:x,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return new Date(m).toLocaleString()}};return u.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:c?u.jsxs("p",{className:"text-red-500 dark:text-red-400 flex items-center gap-1.5",children:[u.jsx("span",{children:"⚠"})," ",c]}):a?u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-azure-text-secondary dark:text-matrix-secondary",children:[u.jsx(er,{className:"w-3.5 h-3.5 text-azure-primary dark:text-matrix-highlight shrink-0"}),u.jsx("span",{className:"font-medium dark:text-matrix-highlight",children:"Next run:"}),u.jsx("span",{children:h(a.next_run_at,n||"UTC")})]}),a.human_readable&&u.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary/70 pl-5",children:a.human_readable}),a.next_occurrences.length>0&&u.jsx("div",{className:"pl-5 space-y-0.5",children:a.next_occurrences.map((m,x)=>u.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",x+2,": ",m]},x))})]}):u.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})})}const yK=["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"],bK=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],vK=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],kK={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 wK({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:c}=N2(),[o,d]=j.useState(""),[h,m]=j.useState("once"),[x,p]=j.useState(""),[b,v]=j.useState("UTC"),[S,z]=j.useState([]),[A,_]=j.useState(null),[E,N]=j.useState(!1),P=M=>{z(V=>V.includes(M)?V.filter(U=>U!==M):[...V,M])};j.useEffect(()=>{a?(d(a.prompt),m(a.schedule_type),p(a.schedule_expression),v(a.timezone),z(a.notify_channels??[])):(d(""),m("once"),p(""),v(c?.timezone??"UTC"),z([])),_(null)},[a,e,c?.timezone]);const D=async()=>{if(_(null),!o.trim()){_("Prompt is required");return}if(!x.trim()){_("Schedule expression is required");return}N(!0);try{if(s&&a){const M={prompt:o,schedule_expression:x,timezone:b,notify_channels:S};await Vi.updateJob(a.id,M)}else{const M={prompt:o,schedule_type:h,schedule_expression:x,timezone:b,notify_channels:S};await Vi.createJob(M)}await Bn(M=>typeof M=="string"&&M.startsWith("/chronos")),n(),t()}catch(M){_(M.message??"Failed to save job")}finally{N(!1)}};return e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),u.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:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[u.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"}),u.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:u.jsx(Yi,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Ye,{label:"Prompt",value:o,onChange:M=>d(M.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&u.jsx(pn,{label:"Schedule Type",value:h,onChange:M=>m(M.target.value),options:vK}),u.jsxs("div",{children:[u.jsx(Ye,{label:"Schedule Expression",value:x,onChange:M=>p(M.target.value),placeholder:kK[h]}),u.jsx(gK,{scheduleExpression:x,scheduleType:h,timezone:b})]}),u.jsx(pn,{label:"Timezone",value:b,onChange:M=>v(M.target.value),options:yK.map(M=>({value:M,label:M}))}),u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:["Notify Channels ",u.jsx("span",{className:"text-xs font-normal opacity-60",children:"(empty = all active channels)"})]}),u.jsx("div",{className:"flex gap-4",children:bK.map(({value:M,label:V})=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:S.includes(M),onChange:()=>P(M),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),u.jsx("span",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary capitalize",children:V})]},M))})]}),A&&u.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:A})]}),u.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-azure-border dark:border-matrix-primary",children:[u.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"}),u.jsx("button",{onClick:D,disabled:E,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:E?"Saving…":s?"Update":"Create"})]})]})]}):null}function SK(){const[e,t]=j.useState(!1),[n,a]=j.useState(null),s=d=>{a(d),t(!0)},c=()=>{t(!1),a(null)},o=()=>{Bn(d=>typeof d=="string"&&d.startsWith("/chronos"))};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(er,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Chronos"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Temporal Intent Engine — schedule prompts for the Oracle."})]})]}),u.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:[u.jsx(oo,{className:"w-4 h-4"}),"New Job"]})]}),u.jsx(xK,{onEdit:s}),u.jsx(wK,{isOpen:e,onClose:c,onCreated:o,editJob:n})]})}const KS={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},gd={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function zK({skill:e,onToggle:t,onView:n}){return u.jsxs($e.div,{variants:gd,className:`rounded-lg border flex flex-col transition-all ${e.enabled?"border-azure-primary/50 dark:border-matrix-primary bg-white dark:bg-black":"border-azure-border dark:border-matrix-primary/30 bg-azure-surface/50 dark:bg-black"}`,children:[u.jsxs("div",{className:"p-4 flex items-start gap-3 flex-1",children:[u.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${e.enabled?"bg-azure-primary/10 dark:bg-matrix-highlight/10":"bg-azure-surface dark:bg-zinc-900"}`,children:u.jsx(Zi,{className:`w-4 h-4 ${e.enabled?"text-azure-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-tertiary"}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h3",{className:`font-semibold truncate ${e.enabled?"text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary"}`,children:e.name}),e.version&&u.jsxs("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-1.5 py-0.5 shrink-0",children:["v",e.version]}),!e.enabled&&u.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded px-1.5 py-0.5 shrink-0",children:"disabled"})]}),u.jsx("p",{className:`text-sm mt-1.5 line-clamp-2 leading-relaxed ${e.enabled?"text-azure-text-secondary dark:text-matrix-secondary":"text-azure-text-secondary/70 dark:text-matrix-tertiary"}`,children:e.description}),e.tags&&e.tags.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:e.tags.map(a=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary",children:[u.jsx(Hx,{className:"w-2.5 h-2.5"}),a]},a))})]})]}),u.jsxs("div",{className:"px-4 py-3 border-t border-azure-border dark:border-matrix-primary/30 flex items-center justify-between gap-2",children:[e.author?u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-azure-text-secondary dark:text-matrix-tertiary min-w-0",children:[u.jsx(Yx,{className:"w-3 h-3 shrink-0"}),u.jsx("span",{className:"truncate",children:e.author})]}):u.jsx("div",{}),u.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u.jsx("button",{onClick:n,className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"View details",children:u.jsx(cc,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:t,className:`p-1.5 rounded border transition-colors ${e.enabled?"border-emerald-300 dark:border-emerald-700/60 text-emerald-500 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20":"border-azure-border dark:border-matrix-primary/40 text-zinc-400 dark:text-zinc-600 hover:text-azure-text dark:hover:text-matrix-secondary hover:border-azure-border dark:hover:border-matrix-primary"}`,title:e.enabled?"Disable skill":"Enable skill",children:e.enabled?u.jsx(Gx,{className:"w-4 h-4"}):u.jsx(qx,{className:"w-4 h-4"})})]})]})]})}function jK({skill:e,open:t,onOpenChange:n}){return!t||!e?null:u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>n(!1)}),u.jsxs("div",{className:"relative bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-azure-border dark:border-matrix-primary shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx("div",{className:"w-9 h-9 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 flex items-center justify-center shrink-0",children:u.jsx(Zi,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight truncate",children:e.name}),e.version&&u.jsxs("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-1.5 py-0.5 shrink-0",children:["v",e.version]})]}),e.author&&u.jsxs("div",{className:"flex items-center gap-1 mt-0.5 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:[u.jsx(Yx,{className:"w-3 h-3 shrink-0"}),e.author]})]})]}),u.jsx("button",{onClick:()=>n(!1),className:"p-1.5 rounded text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight hover:bg-azure-surface dark:hover:bg-zinc-900 transition-colors shrink-0",children:u.jsx(Yi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"overflow-y-auto flex-1 p-5 space-y-5",children:[e.description&&u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary leading-relaxed",children:e.description}),u.jsx("div",{className:"flex flex-col gap-2",children:u.jsxs("div",{className:"flex items-start gap-2 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:[u.jsx(HA,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{className:"break-all font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2 py-0.5",children:e.path})]})}),e.tags&&e.tags.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Tags"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.tags.map(a=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary",children:[u.jsx(Hx,{className:"w-2.5 h-2.5"}),a]},a))})]}),e.examples&&e.examples.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Examples"}),u.jsx("ul",{className:"space-y-1.5",children:e.examples.map((a,s)=>u.jsxs("li",{className:"flex items-start gap-2 text-sm text-azure-text-secondary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/30 rounded px-3 py-2",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary font-mono text-xs mt-0.5 shrink-0",children:[s+1,"."]}),a]},s))})]}),e.content&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"SKILL.md"}),u.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-72 whitespace-pre-wrap leading-relaxed font-mono",children:e.content})]})]})]})]})}function _K(){const[e,t]=j.useState(null),[n,a]=j.useState(!1),[s,c]=j.useState(!1),[o,d]=j.useState(!1),[h,m]=j.useState(null),[x,p]=j.useState(null),b=j.useRef(null),{data:v,mutate:S,isLoading:z}=We("/skills",()=>Li.fetchSkills(),{refreshInterval:1e4}),A=v?.skills??[],_=v?.enabled??0,E=async()=>{await Li.reloadSkills(),S()},N=async V=>{V.enabled?await Li.disableSkill(V.name):await Li.enableSkill(V.name),S()},P=async V=>{a(!0);try{const U=await Li.fetchSkill(V.name);t(U)}finally{a(!1)}},D=async V=>{const U=V.target.files?.[0];if(U){m(null),p(null),d(!0);try{const K=await Li.uploadSkill(U);p(`Skill "${K.skill.name}" uploaded successfully!`),S(),b.current&&(b.current.value="")}catch(K){m({error:K.message||"Upload failed",details:K.details})}finally{d(!1)}}},M=()=>{m(null),p(null),c(!0)};return u.jsxs($e.div,{variants:KS,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:gd,className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Zi,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Skills"}),u.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:[A.length," skill",A.length!==1?"s":"",", ",_," enabled"]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:M,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:[u.jsx(Pu,{className:"w-4 h-4"}),"Upload"]}),u.jsxs("button",{onClick:E,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:[u.jsx(Ka,{className:"w-4 h-4"}),"Reload"]})]})]}),z?u.jsxs($e.div,{variants:gd,className:"text-center py-12",children:[u.jsx(Ka,{className:"w-8 h-8 animate-spin mx-auto text-azure-text-secondary dark:text-matrix-dim"}),u.jsx("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-dim",children:"Loading skills..."})]}):A.length===0?u.jsxs($e.div,{variants:gd,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[u.jsx(Zi,{className:"w-12 h-12 mx-auto text-azure-text-tertiary dark:text-matrix-dim"}),u.jsx("h3",{className:"mt-4 text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:"No skills found"}),u.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"," ",u.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"~/.morpheus/skills/"}),". Each skill folder must contain a"," ",u.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file with frontmatter."]}),u.jsxs("button",{onClick:M,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:[u.jsx(Pu,{className:"w-4 h-4"}),"Upload Skill"]})]}):u.jsx($e.div,{variants:KS,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:A.map(V=>u.jsx(zK,{skill:V,onToggle:()=>N(V),onView:()=>P(V)},V.name))}),u.jsx(jK,{skill:e,open:!!e,onOpenChange:V=>!V&&t(null)}),u.jsxs(Ir,{open:s,onOpenChange:c,children:[u.jsx(Br,{children:u.jsx(Vr,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Pu,{className:"w-5 h-5"}),"Upload Skill"]})})}),u.jsxs("div",{className:"space-y-4",children:[u.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 ",u.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file."]}),u.jsxs("div",{className:"border-2 border-dashed border-azure-border dark:border-matrix-primary rounded-lg p-6",children:[u.jsx("input",{ref:b,type:"file",accept:".zip,application/zip,application/x-zip-compressed",onChange:D,disabled:o,className:"hidden",id:"skill-upload-input"}),u.jsxs("label",{htmlFor:"skill-upload-input",className:`flex flex-col items-center gap-2 cursor-pointer ${o?"opacity-50 cursor-not-allowed":""}`,children:[o?u.jsx(Ka,{className:"w-8 h-8 animate-spin text-azure-primary dark:text-matrix-primary"}):u.jsx(Pu,{className:"w-8 h-8 text-azure-text-tertiary dark:text-matrix-dim"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:o?"Uploading...":"Click to select ZIP file"})]})]}),h&&u.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:[u.jsx(Gi,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:h.error}),h.details&&u.jsx("p",{className:"text-xs text-red-600 dark:text-red-300 mt-1",children:h.details})]})]}),x&&u.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:[u.jsx(bo,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),u.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:x})]}),u.jsxs("div",{className:"rounded-lg bg-azure-hover dark:bg-zinc-900 p-3",children:[u.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"ZIP Structure Example"}),u.jsx("pre",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:`my-skill.zip
|
|
164
|
+
└── my-skill/
|
|
165
|
+
├── SKILL.md (required)
|
|
166
|
+
├── scripts/ (optional)
|
|
167
|
+
│ └── script.js
|
|
168
|
+
└── examples/ (optional)
|
|
169
|
+
└── output.txt`})]})]})]}),n&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsx(Ka,{className:"w-8 h-8 animate-spin text-white"})})]})}const NK={name:"",host:"",port:7900,auth_token:"",tls:!1};function CK(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),a=Math.floor(e%3600/60);return t>0?`${t}d ${n}h`:n>0?`${n}h ${a}m`:`${a}m`}function TK(e,t){const n=e>=1024?`${(e/1024).toFixed(1)}GB`:`${Math.round(e)}MB`,a=t>=1024?`${(t/1024).toFixed(1)}GB`:`${Math.round(t)}MB`;return`${n} / ${a}`}function EK({state:e}){return e==="online"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-emerald-500 bg-emerald-500/10 border border-emerald-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),"online"]}):e==="connecting"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-amber-500 bg-amber-500/10 border border-amber-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),"connecting"]}):e==="error"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-500 bg-red-500/10 border border-red-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),"error"]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-zinc-500 bg-zinc-500/10 border border-zinc-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-500"}),"offline"]})}function AK({cap:e}){const n={filesystem:"text-blue-400 bg-blue-400/10 border-blue-400/30",shell:"text-yellow-400 bg-yellow-400/10 border-yellow-400/30",git:"text-orange-400 bg-orange-400/10 border-orange-400/30",browser:"text-purple-400 bg-purple-400/10 border-purple-400/30",network:"text-cyan-400 bg-cyan-400/10 border-cyan-400/30",packages:"text-green-400 bg-green-400/10 border-green-400/30",processes:"text-pink-400 bg-pink-400/10 border-pink-400/30",system:"text-indigo-400 bg-indigo-400/10 border-indigo-400/30"}[e]??"text-zinc-400 bg-zinc-400/10 border-zinc-400/30";return u.jsx("span",{className:`text-[10px] font-medium border rounded px-1.5 py-0.5 ${n}`,children:e})}function OK({status:e,entry:t,onPing:n,onEdit:a,onDelete:s}){const[c,o]=j.useState(!1),d=e.state==="online";return u.jsxs("div",{className:`rounded-lg border bg-white dark:bg-black transition-all ${d?"border-emerald-500/40 dark:border-emerald-500/30":e.state==="error"?"border-red-500/40 dark:border-red-500/30":e.state==="connecting"?"border-amber-500/40 dark:border-amber-500/30":"border-azure-border dark:border-matrix-primary"}`,children:[u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${d?"bg-emerald-500/10":"bg-zinc-100 dark:bg-zinc-900"}`,children:u.jsx(U5,{className:`w-4 h-4 ${d?"text-emerald-500":"text-zinc-400 dark:text-matrix-tertiary"}`})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"font-semibold text-azure-text dark:text-matrix-highlight truncate",children:e.name}),u.jsx(EK,{state:e.state}),t?.tls&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-500 bg-emerald-500/10 border border-emerald-500/30 rounded px-1.5 py-0.5",children:[u.jsx(l5,{className:"w-2.5 h-2.5"}),"TLS"]})]}),u.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:[e.host,":",e.port]})]})]}),u.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u.jsx("button",{onClick:()=>n(e.name),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"Ping",children:u.jsx(_z,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>a(t??{name:e.name,host:e.host,port:e.port,auth_token:"",tls:!1}),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"Edit",children:u.jsx(dc,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>s(e.name),className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Remove",children:u.jsx(pa,{className:"w-3.5 h-3.5"})})]})]}),e.error&&u.jsxs("div",{className:"mt-3 flex items-start gap-2 text-xs text-red-500 bg-red-500/10 border border-red-500/20 rounded p-2",children:[u.jsx(Gi,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{children:e.error})]}),d&&e.stats&&u.jsx("div",{className:"mt-3 space-y-2",children:u.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"OS"}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:e.stats.os})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"Hostname"}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono truncate max-w-[120px]",children:e.stats.hostname})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary flex items-center gap-1",children:[u.jsx(wz,{className:"w-3 h-3"})," CPU"]}),u.jsxs("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:[e.stats.cpu_percent.toFixed(1),"%"]})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary flex items-center gap-1",children:[u.jsx(KA,{className:"w-3 h-3"})," RAM"]}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:TK(e.stats.memory_used_mb,e.stats.memory_total_mb)})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary flex items-center gap-1",children:[u.jsx(er,{className:"w-3 h-3"})," Uptime"]}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:CK(e.stats.uptime_seconds)})]}),e.config?.sandbox_dir&&u.jsxs("div",{className:"flex justify-between col-span-2",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:"Sandbox"}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono truncate text-right ml-2",children:e.config.sandbox_dir})]}),e.config&&u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"Read-only"}),u.jsx("span",{className:`font-medium ${e.config.readonly_mode?"text-amber-500":"text-emerald-500"}`,children:e.config.readonly_mode?"yes":"no"})]})]})}),!d&&e.lastSeen&&u.jsxs("div",{className:"mt-2 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:["Last seen: ",new Date(e.lastSeen).toLocaleString()]})]}),e.capabilities.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:()=>o(!c),className:"w-full flex items-center justify-between px-4 py-2 border-t border-azure-border dark:border-matrix-primary/30 text-xs text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-secondary hover:bg-azure-surface/50 dark:hover:bg-zinc-900/50 transition-colors",children:[u.jsxs("span",{children:["Capabilities (",e.capabilities.length,")"]}),c?u.jsx(kz,{className:"w-3.5 h-3.5"}):u.jsx(yo,{className:"w-3.5 h-3.5"})]}),c&&u.jsxs("div",{className:"px-4 pb-4 pt-3 border-t border-azure-border dark:border-matrix-primary/30 bg-azure-surface/30 dark:bg-zinc-900/30",children:[u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.capabilities.map(h=>u.jsx(AK,{cap:h},h))}),e.lastSeen&&u.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary mt-3",children:["Last seen: ",new Date(e.lastSeen).toLocaleString()]})]})]})]})}function XS({title:e,initial:t,isEdit:n,onSave:a,onClose:s,saving:c,error:o}){const[d,h]=j.useState(t),[m,x]=j.useState(null),p=()=>{if(!d.name.trim()){x("Name is required.");return}if(!d.host.trim()){x("Host is required.");return}if(!n&&!d.auth_token.trim()){x("Auth token is required.");return}x(null),a(d)};return u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:u.jsxs("div",{className:"bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-md",children:[u.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-azure-border dark:border-matrix-primary",children:[u.jsxs("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(so,{className:"w-4 h-4"}),e]}),u.jsx("button",{onClick:s,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight transition-colors",children:u.jsx(Yi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"p-5 space-y-3",children:[(m||o)&&u.jsxs("div",{className:"flex items-start gap-2 text-sm text-red-500 bg-red-500/10 border border-red-500/20 rounded p-3",children:[u.jsx(Gi,{className:"w-4 h-4 shrink-0 mt-0.5"}),u.jsx("span",{children:m||o})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx("div",{className:"col-span-2",children:u.jsx(Ye,{label:"Name",value:d.name,onChange:b=>h({...d,name:b.target.value}),disabled:n,helperText:n?"Name cannot be changed after creation.":"Unique identifier (lowercase, hyphens ok)."})}),u.jsx(Ye,{label:"Host",value:d.host,onChange:b=>h({...d,host:b.target.value}),placeholder:"localhost"}),u.jsx(Ft,{label:"Port",value:d.port,onChange:b=>h({...d,port:Number(b.target.value)}),min:1,max:65535}),u.jsx("div",{className:"col-span-2",children:u.jsx(Ye,{label:"Auth Token",value:d.auth_token,onChange:b=>h({...d,auth_token:b.target.value}),placeholder:n?"Leave blank to keep existing token":"Shared secret",helperText:n?"Leave blank to keep the current token.":void 0})})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx("input",{type:"checkbox",id:"smith-tls",checked:d.tls??!1,onChange:b=>h({...d,tls:b.target.checked}),className:"w-4 h-4 accent-azure-primary dark:accent-matrix-highlight"}),u.jsxs("label",{htmlFor:"smith-tls",className:"text-sm text-azure-text-secondary dark:text-matrix-secondary cursor-pointer",children:["Use TLS (",u.jsx("code",{className:"text-xs font-mono",children:"wss://"}),")"]})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t border-azure-border dark:border-matrix-primary",children:[u.jsx("button",{onClick:s,className:"px-4 py-2 rounded text-sm text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight transition-colors",children:"Cancel"}),u.jsx("button",{onClick:p,disabled:c,className:"px-4 py-2 rounded text-sm 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:c?"Saving…":n?"Update Smith":"Add Smith"})]})]})})}function MK(){const{data:e,mutate:t}=We("/api/smiths",tn.getSmithsList,{refreshInterval:1e4}),{data:n,mutate:a}=We("/api/smiths/config",tn.getSmithsConfig),[s,c]=j.useState(null),[o,d]=j.useState(!1),[h,m]=j.useState(!1),[x,p]=j.useState(!1),[b,v]=j.useState(null),[S,z]=j.useState(!1),[A,_]=j.useState(null),[E,N]=j.useState(null),[P,D]=j.useState(!1);n&&!s&&c(n);const M=(B,Y)=>{N({type:B,message:Y}),setTimeout(()=>N(null),4e3)},V=async B=>{try{const Y=await tn.pingSmith(B);M("success",`Ping ${B}: ${Y.latency_ms}ms`)}catch(Y){M("error",`Ping failed: ${Y.message}`)}},U=async B=>{if(confirm(`Remove Smith "${B}" from the registry?`))try{await tn.removeSmith(B),t(),a(),c(null),M("success",`Smith "${B}" removed.`)}catch(Y){M("error",`Failed to remove: ${Y.message}`)}},K=async B=>{if(s){if(s.entries.some(Y=>Y.name===B.name)){_(`Smith "${B.name}" already exists.`);return}z(!0),_(null);try{const Y={...s,entries:[...s.entries,B]};await tn.updateSmithsConfig(Y),p(!1),c(null),t(),a(),M("success",`Smith "${B.name}" added.`)}catch(Y){_(Y.message)}finally{z(!1)}}},I=async B=>{if(s){z(!0),_(null);try{const Y={...s,entries:s.entries.map(ue=>ue.name===B.name?B:ue)};await tn.updateSmithsConfig(Y),v(null),c(null),t(),a(),M("success",`Smith "${B.name}" updated.`)}catch(Y){_(Y.message)}finally{z(!1)}}},te=async()=>{if(s){m(!0);try{await tn.updateSmithsConfig(s),t(),a(),M("success","Settings saved."),d(!1)}catch(B){M("error",B.message)}finally{m(!1)}}},le=e?.smiths??[],ne=le.filter(B=>B.state==="online").length,oe=le.filter(B=>B.state==="offline"||B.state==="error").length,se=le.filter(B=>B.state==="connecting").length,Z={};return(s??n)?.entries?.forEach(B=>{Z[B.name]=B}),u.jsxs("div",{className:"space-y-6",children:[E&&u.jsxs("div",{className:`fixed top-4 right-4 z-50 flex items-center gap-2 px-4 py-3 rounded-lg shadow-xl text-sm border ${E.type==="success"?"bg-emerald-50 dark:bg-emerald-900/30 border-emerald-300 dark:border-emerald-500/50 text-emerald-700 dark:text-emerald-400":"bg-red-50 dark:bg-red-900/30 border-red-300 dark:border-red-500/50 text-red-700 dark:text-red-400"}`,children:[E.type==="success"?u.jsx(Lp,{className:"w-4 h-4"}):u.jsx(Gi,{className:"w-4 h-4"}),E.message]}),u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(so,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Smiths"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Remote DevKit agents via WebSocket"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:async()=>{D(!0),await Promise.all([t(),a(),new Promise(B=>setTimeout(B,500))]),D(!1)},className:"p-2 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Refresh",children:u.jsx(Ka,{className:`w-4 h-4 transition-transform ${P?"animate-spin":""}`})}),u.jsxs("button",{onClick:()=>{d(!o),!s&&n&&c(n)},className:`flex items-center gap-1.5 px-3 py-2 rounded border text-sm transition-colors ${o?"bg-azure-primary/10 border-azure-primary dark:bg-matrix-highlight/10 dark:border-matrix-highlight text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight"}`,children:[u.jsx(_1,{className:"w-4 h-4"}),"Settings"]}),u.jsxs("button",{onClick:()=>{p(!0),_(null)},className:"flex items-center gap-1.5 px-3 py-2 rounded bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 text-sm font-medium transition-colors",children:[u.jsx(oo,{className:"w-4 h-4"}),"Add Smith"]})]})]}),e&&u.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"Total"}),u.jsx("span",{className:"font-semibold text-azure-text dark:text-matrix-secondary",children:e.total})]}),ne>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(cd,{className:"w-3.5 h-3.5 text-emerald-500"}),u.jsxs("span",{className:"font-semibold text-emerald-500",children:[ne," online"]})]}),se>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(_z,{className:"w-3.5 h-3.5 text-amber-500"}),u.jsxs("span",{className:"font-semibold text-amber-500",children:[se," connecting"]})]}),oe>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(Nz,{className:"w-3.5 h-3.5 text-zinc-400 dark:text-matrix-tertiary"}),u.jsxs("span",{className:"font-semibold text-zinc-500 dark:text-matrix-tertiary",children:[oe," offline"]})]}),!e.enabled&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-amber-500 bg-amber-500/10 border border-amber-500/30 rounded-full px-2.5 py-0.5",children:[u.jsx(F5,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"Smiths subsystem disabled"})]})]}),o&&s&&u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-5 space-y-4",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("h2",{className:"text-sm font-semibold text-azure-text dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(_1,{className:"w-4 h-4"}),"Global Settings"]})}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsx("div",{className:"sm:col-span-2",children:u.jsx(_r,{label:"Enable Smiths",checked:s.enabled,onChange:B=>c({...s,enabled:B}),helperText:"Master switch — disabling stops all Smith connections."})}),u.jsx(pn,{label:"Execution Mode",value:s.execution_mode,onChange:B=>c({...s,execution_mode:B.target.value}),options:[{label:"Sync — inline result",value:"sync"},{label:"Async — background task",value:"async"}]}),u.jsx(Ft,{label:"Heartbeat Interval (s)",value:Math.round(s.heartbeat_interval_ms/1e3),onChange:B=>c({...s,heartbeat_interval_ms:Number(B.target.value)*1e3}),min:5}),u.jsx(Ft,{label:"Connection Timeout (s)",value:Math.round(s.connection_timeout_ms/1e3),onChange:B=>c({...s,connection_timeout_ms:Number(B.target.value)*1e3}),min:1}),u.jsx(Ft,{label:"Task Timeout (s)",value:Math.round(s.task_timeout_ms/1e3),onChange:B=>c({...s,task_timeout_ms:Number(B.target.value)*1e3}),min:5})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx("button",{onClick:te,disabled:h,className:"px-4 py-2 rounded text-sm 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:h?"Saving…":"Save Settings"})})]}),le.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-full bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary flex items-center justify-center mb-4",children:u.jsx(so,{className:"w-7 h-7 text-azure-text-secondary dark:text-matrix-tertiary"})}),u.jsx("h3",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight mb-1",children:"No Smiths configured"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mb-4",children:"Add a remote agent to delegate DevKit tasks to isolated environments."}),u.jsxs("button",{onClick:()=>{p(!0),_(null)},className:"flex items-center gap-2 px-4 py-2 rounded bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black text-sm font-medium transition-colors",children:[u.jsx(oo,{className:"w-4 h-4"}),"Add First Smith"]})]}):u.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:le.map(B=>u.jsx(OK,{status:B,entry:Z[B.name],onPing:V,onEdit:Y=>{v({...Y,auth_token:""}),_(null)},onDelete:U},B.name))}),x&&u.jsx(XS,{title:"Add Smith",initial:NK,onSave:K,onClose:()=>p(!1),saving:S,error:A}),b&&u.jsx(XS,{title:"Edit Smith",initial:b,isEdit:!0,onSave:I,onClose:()=>v(null),saving:S,error:A})]})}function DK(e,t=0,n=100){const a=n,s=t*n,{data:c,error:o,isLoading:d}=We(e?`/sessions/${e}/audit?limit=${a}&offset=${s}`:null,h=>xe.get(h),{revalidateOnFocus:!1});return{data:c,error:o,isLoading:d}}const RK={llm_call:u.jsx(Cz,{size:14}),tool_call:u.jsx(fc,{size:14}),mcp_tool:u.jsx(Sz,{size:14}),task_created:u.jsx(jz,{size:14}),task_completed:u.jsx(bo,{size:14}),skill_executed:u.jsx(ld,{size:14}),chronos_job:u.jsx(er,{size:14})},$K={llm_call:"text-blue-400 dark:text-blue-400",tool_call:"text-amber-500 dark:text-amber-400",mcp_tool:"text-purple-500 dark:text-purple-400",task_created:"text-gray-500 dark:text-matrix-secondary",task_completed:"text-green-600 dark:text-matrix-highlight",skill_executed:"text-teal-600 dark:text-teal-400",chronos_job:"text-orange-500 dark:text-orange-400"},LK={oracle:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300",apoc:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",neo:"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",trinity:"bg-teal-100 text-teal-700 dark:bg-teal-900/40 dark:text-teal-300",smith:"bg-gray-200 text-gray-700 dark:bg-gray-700/60 dark:text-gray-300",keymaker:"bg-pink-100 text-pink-700 dark:bg-pink-900/40 dark:text-pink-300",chronos:"bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-300"};function PK(e){return e==null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function UK(e){return e==null||e===0?"—":e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}function IK(e,t){if(e==null&&t==null)return"";const n=e??0,a=t??0;return`↑${n.toLocaleString()} ↓${a.toLocaleString()}`}const QS=({event:e})=>{const t=RK[e.event_type]??u.jsx(fc,{size:14}),n=$K[e.event_type]??"text-gray-500",a=e.agent?LK[e.agent]??"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300":null,s=e.tool_name??e.model??e.event_type,c=IK(e.input_tokens,e.output_tokens),o=UK(e.estimated_cost_usd),d=PK(e.duration_ms),h=e.status==="error"?u.jsx(ei,{size:14,className:"text-red-500 flex-shrink-0"}):e.status==="success"?u.jsx(bo,{size:14,className:"text-green-500 dark:text-matrix-highlight flex-shrink-0"}):null;return u.jsxs("div",{className:"py-2 px-3 rounded-lg hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors border-b border-gray-100 dark:border-matrix-primary/20 last:border-0",children:[u.jsxs("div",{className:"flex flex-col gap-0.5 md:hidden",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:`flex-shrink-0 ${n}`,children:t}),a&&u.jsx("span",{className:`flex-shrink-0 text-xs font-semibold px-1.5 py-0.5 rounded ${a}`,children:e.agent}),u.jsx("span",{className:"flex-1 text-sm text-gray-700 dark:text-matrix-secondary font-mono break-all leading-snug",children:s}),h]}),u.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0 pl-5 text-[11px] text-gray-400 dark:text-matrix-secondary/60 font-mono",children:[c&&u.jsx("span",{children:c}),u.jsx("span",{children:d}),o!=="—"&&u.jsx("span",{className:"text-gray-600 dark:text-matrix-secondary",children:o})]})]}),u.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[u.jsx("span",{className:`flex-shrink-0 ${n}`,children:t}),a&&u.jsx("span",{className:`flex-shrink-0 text-xs font-semibold px-1.5 py-0.5 rounded ${a}`,children:e.agent}),u.jsx("span",{className:"flex-1 text-sm truncate text-gray-700 dark:text-matrix-secondary font-mono",children:s}),c&&u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono whitespace-nowrap",children:c}),u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono w-16 text-right whitespace-nowrap",children:d}),h,u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono w-20 text-right whitespace-nowrap",children:o})]})]})},BK=({events:e,page:t,pageSize:n,totalCount:a,onPageChange:s})=>{const c=Math.ceil(a/n),o=t*n+1,d=Math.min(t*n+e.length,a);if(e.length===0)return u.jsx("div",{className:"flex items-center justify-center h-40 text-gray-400 dark:text-matrix-secondary/50 text-sm",children:"No audit events for this session."});const h=[],m=new Map;for(const p of e)if(p.task_id){const b=m.get(p.task_id)??[];b.push(p),m.set(p.task_id,b)}const x=new Set;for(const p of e)p.task_id?x.has(p.task_id)||(x.add(p.task_id),h.push({taskId:p.task_id,events:m.get(p.task_id)})):h.push({taskId:null,events:[p]});return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"hidden md:flex items-center gap-3 px-3 py-1 text-xs text-gray-400 dark:text-matrix-secondary/60 border-b border-gray-200 dark:border-matrix-primary/30 font-mono",children:[u.jsx("span",{className:"w-4"}),u.jsx("span",{className:"w-14 flex-shrink-0",children:"agent"}),u.jsx("span",{className:"flex-1",children:"event / tool / model"}),u.jsx("span",{className:"w-28 text-right",children:"tokens ↑↓"}),u.jsx("span",{className:"w-16 text-right",children:"duration"}),u.jsx("span",{className:"w-4"}),u.jsx("span",{className:"w-20 text-right",children:"cost"})]}),u.jsx("div",{className:"flex flex-col",children:h.map(p=>p.taskId?u.jsxs("div",{className:"mb-1",children:[u.jsxs("div",{className:"px-3 py-1 text-xs text-gray-400 dark:text-matrix-secondary/50 font-mono border-l-2 border-blue-300 dark:border-matrix-primary/60 ml-1 mb-0.5",children:["task: ",p.taskId.slice(0,8),"…"]}),u.jsx("div",{className:"pl-4",children:p.events.map(b=>u.jsx(QS,{event:b},b.id))})]},p.taskId):u.jsx(QS,{event:p.events[0]},p.events[0].id))}),c>1&&u.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-200 dark:border-matrix-primary/30 mt-2",children:[u.jsxs("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60",children:[o,"–",d," of ",a," events"]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{onClick:()=>s(t-1),disabled:t===0,className:"p-1 rounded text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight disabled:opacity-30 transition-colors",children:u.jsx(SA,{size:16})}),u.jsxs("span",{className:"text-xs self-center text-gray-500 dark:text-matrix-secondary font-mono px-2",children:[t+1," / ",c]}),u.jsx("button",{onClick:()=>s(t+1),disabled:t>=c-1,className:"p-1 rounded text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight disabled:opacity-30 transition-colors",children:u.jsx(Zd,{size:16})})]})]})]})};function Cp(e){return e===0?"$0.00":e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}function VK(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}const ZK=({summary:e})=>u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-matrix-primary p-4 bg-white dark:bg-black",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-700 dark:text-matrix-highlight mb-3 flex items-center gap-2",children:[u.jsx(io,{size:14})," Total Cost"]}),u.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-matrix-highlight font-mono",children:Cp(e.totalCostUsd)}),u.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs text-gray-500 dark:text-matrix-secondary",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Cz,{size:12,className:"text-blue-400"}),u.jsxs("span",{children:[e.llmCallCount," LLM calls"]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(fc,{size:12,className:"text-amber-400"}),u.jsxs("span",{children:[e.toolCallCount," tool calls"]})]}),u.jsxs("div",{className:"flex items-center gap-1.5 col-span-2",children:[u.jsx(er,{size:12,className:"text-gray-400"}),u.jsxs("span",{children:[VK(e.totalDurationMs)," total duration"]})]})]})]}),e.byAgent.length>0&&u.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-matrix-primary p-4 bg-white dark:bg-black",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-matrix-highlight mb-3",children:"By Agent"}),u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-gray-400 dark:text-matrix-secondary/60 border-b border-gray-100 dark:border-matrix-primary/30",children:[u.jsx("th",{className:"text-left pb-1.5",children:"Agent"}),u.jsx("th",{className:"text-right pb-1.5",children:"Calls"}),u.jsx("th",{className:"text-right pb-1.5",children:"Tokens"}),u.jsx("th",{className:"text-right pb-1.5",children:"Cost"})]})}),u.jsx("tbody",{children:e.byAgent.map(t=>u.jsxs("tr",{className:"border-b border-gray-50 dark:border-matrix-primary/10 last:border-0",children:[u.jsx("td",{className:"py-1.5 text-gray-700 dark:text-matrix-secondary font-semibold",children:t.agent}),u.jsx("td",{className:"py-1.5 text-right text-gray-500 dark:text-matrix-secondary/70 font-mono",children:t.llmCalls}),u.jsx("td",{className:"py-1.5 text-right text-gray-500 dark:text-matrix-secondary/70 font-mono",children:(t.inputTokens+t.outputTokens).toLocaleString()}),u.jsx("td",{className:"py-1.5 text-right text-gray-700 dark:text-matrix-highlight font-mono",children:Cp(t.estimatedCostUsd)})]},t.agent))})]})]}),e.byModel.length>0&&u.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-matrix-primary p-4 bg-white dark:bg-black",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-matrix-highlight mb-3",children:"By Model"}),u.jsx("div",{className:"flex flex-col gap-2",children:e.byModel.map(t=>u.jsxs("div",{className:"border-b border-gray-50 dark:border-matrix-primary/10 last:border-0 pb-2 last:pb-0",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2 mb-0.5",children:[u.jsx("span",{className:"text-xs font-mono text-gray-700 dark:text-matrix-secondary break-all leading-snug",children:t.model}),u.jsx("span",{className:"text-xs font-mono text-gray-700 dark:text-matrix-highlight whitespace-nowrap shrink-0",children:Cp(t.estimatedCostUsd)})]}),u.jsxs("div",{className:"text-[11px] text-gray-400 dark:text-matrix-secondary/60 font-mono flex flex-wrap gap-x-3",children:[u.jsxs("span",{children:[t.calls," calls"]}),u.jsxs("span",{children:["in ",t.inputTokens.toLocaleString()]}),u.jsxs("span",{children:["out ",t.outputTokens.toLocaleString()]})]})]},`${t.provider}/${t.model}`))})]})]});function FK(e,t){const n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download=`audit-${e.slice(0,8)}.json`,s.click(),URL.revokeObjectURL(a)}function HK(e,t){const n=["id","created_at","event_type","agent","tool_name","provider","model","input_tokens","output_tokens","duration_ms","status","estimated_cost_usd"],a=t.events.map(h=>[h.id,new Date(h.created_at).toISOString(),h.event_type,h.agent??"",h.tool_name??"",h.provider??"",h.model??"",h.input_tokens??"",h.output_tokens??"",h.duration_ms??"",h.status??"",h.estimated_cost_usd??""].map(m=>`"${String(m).replace(/"/g,'""')}"`).join(",")),s=[n.join(","),...a].join(`
|
|
170
|
+
`),c=new Blob([s],{type:"text/csv"}),o=URL.createObjectURL(c),d=document.createElement("a");d.href=o,d.download=`audit-${e.slice(0,8)}.csv`,d.click(),URL.revokeObjectURL(o)}const qK=({sessionId:e,data:t})=>{const[n,a]=j.useState(!1);return t?u.jsxs("div",{className:"relative",children:[u.jsxs("button",{onClick:()=>a(!n),className:"flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg border border-gray-200 dark:border-matrix-primary text-gray-600 dark:text-matrix-secondary hover:text-gray-900 dark:hover:text-matrix-highlight hover:border-gray-300 dark:hover:border-matrix-highlight transition-colors",children:[u.jsx(UA,{size:14}),"Export",u.jsx(yo,{size:12})]}),n&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),u.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 bg-white dark:bg-black border border-gray-200 dark:border-matrix-primary rounded-lg shadow-xl min-w-[140px] py-1",children:[u.jsxs("button",{onClick:()=>{FK(e,t),a(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-matrix-secondary hover:bg-gray-50 dark:hover:bg-zinc-900 transition-colors",children:[u.jsx(VA,{size:14,className:"text-blue-500"}),"Export JSON"]}),u.jsxs("button",{onClick:()=>{HK(e,t),a(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-matrix-secondary hover:bg-gray-50 dark:hover:bg-zinc-900 transition-colors",children:[u.jsx(Mp,{size:14,className:"text-green-500"}),"Export CSV"]})]})]})]}):null},WS=100,GK=()=>{const{id:e}=rE(),t=oc(),[n,a]=j.useState(0),{data:s,error:c,isLoading:o}=DK(e??null,n,WS),d=j.useRef(null),[h,m]=j.useState(()=>typeof window<"u"?window.innerWidth>=768:!0);return j.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[s]),u.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-black",children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-matrix-primary bg-white dark:bg-black flex-shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{onClick:()=>t(-1),className:"p-1.5 rounded-lg text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:u.jsx(bz,{size:18})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold text-gray-900 dark:text-matrix-highlight",children:"Session Audit"}),u.jsx("p",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono",children:e})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>m(x=>!x),className:"p-1.5 rounded-lg text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors md:hidden",title:"Toggle summary panel",children:u.jsx(w5,{size:18})}),u.jsx(qK,{sessionId:e??"",data:s})]})]}),u.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[h&&u.jsx("div",{className:"fixed inset-0 bg-black/40 z-20 md:hidden",onClick:()=>m(!1)}),u.jsxs("div",{ref:d,className:"flex-[6] overflow-y-auto p-6 custom-scrollbar",children:[o&&u.jsxs("div",{className:"flex items-center justify-center h-40 gap-2 text-gray-400 dark:text-matrix-secondary",children:[u.jsx(uc,{size:18,className:"animate-spin"}),"Loading audit events…"]}),c&&u.jsxs("div",{className:"flex items-center gap-2 text-red-500 dark:text-red-400 p-4 rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:[u.jsx(Gi,{size:16}),"Failed to load audit events: ",c.message]}),s&&u.jsx(BK,{events:s.events,page:n,pageSize:WS,totalCount:s.summary.llmCallCount+s.summary.toolCallCount,onPageChange:a})]}),u.jsx("div",{className:`
|
|
171
|
+
fixed top-16 bottom-0 right-0 z-40 w-72
|
|
172
|
+
md:relative md:inset-auto md:z-auto md:w-auto md:flex-[4] md:translate-x-0
|
|
173
|
+
transition-transform duration-300 ease-out
|
|
174
|
+
overflow-y-auto p-6 border-l border-gray-200 dark:border-matrix-primary
|
|
175
|
+
bg-white dark:bg-black custom-scrollbar
|
|
176
|
+
${h?"translate-x-0":"translate-x-full"}
|
|
177
|
+
`,children:s?u.jsx(ZK,{summary:s.summary}):!o&&u.jsx("div",{className:"text-sm text-gray-400 dark:text-matrix-secondary/50 text-center mt-10",children:"No summary available."})})]})]})};function YK(){return u.jsx(BE,{children:u.jsxs(v1,{children:[u.jsx(Zt,{path:"/login",element:u.jsx(AJ,{})}),u.jsx(Zt,{path:"/*",element:u.jsx(OJ,{children:u.jsx(E$,{children:u.jsxs(v1,{children:[u.jsx(Zt,{path:"/",element:u.jsx(D$,{})}),u.jsx(Zt,{path:"/chat",element:u.jsx(k7,{})}),u.jsx(Zt,{path:"/zaion",element:u.jsx(CJ,{})}),u.jsx(Zt,{path:"/logs",element:u.jsx(TJ,{})}),u.jsx(Zt,{path:"/stats",element:u.jsx(EJ,{})}),u.jsx(Zt,{path:"/sati-memories",element:u.jsx(BJ,{})}),u.jsx(Zt,{path:"/mcp-servers",element:u.jsx(JJ,{})}),u.jsx(Zt,{path:"/model-pricing",element:u.jsx(QJ,{})}),u.jsx(Zt,{path:"/webhooks",element:u.jsx(tK,{})}),u.jsx(Zt,{path:"/notifications",element:u.jsx(aK,{})}),u.jsx(Zt,{path:"/tasks",element:u.jsx(cK,{})}),u.jsx(Zt,{path:"/trinity-databases",element:u.jsx(fK,{})}),u.jsx(Zt,{path:"/chronos",element:u.jsx(SK,{})}),u.jsx(Zt,{path:"/skills",element:u.jsx(_K,{})}),u.jsx(Zt,{path:"/smiths",element:u.jsx(MK,{})}),u.jsx(Zt,{path:"/sessions/:id/audit",element:u.jsx(GK,{})}),u.jsx(Zt,{path:"*",element:u.jsx(hz,{to:"/",replace:!0})})]})})})})]})})}vT.createRoot(document.getElementById("root")).render(u.jsx(j.StrictMode,{children:u.jsx(YK,{})}));
|