@bibobonking/opensol 3.1.0 → 3.1.1
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/CHANGELOG.md +4 -1
- package/README.md +2 -2
- package/desktop/src-tauri/Cargo.toml +1 -1
- package/dist/assets/index-CeN54A2N.css +1 -0
- package/dist/assets/index-fhIO9a7_.js +318 -0
- package/dist/index.html +4 -4
- package/index.html +2 -2
- package/package.json +1 -1
- package/server/README.md +2 -2
- package/server/daemon.mjs +74 -0
- package/server/lib/mcp-oauth.mjs +219 -0
- package/server/lib/mcp-oauth.test.mjs +175 -0
- package/server/lib/mcp.mjs +404 -37
- package/src/App.tsx +2 -0
- package/src/components/CommandPalette.tsx +14 -1
- package/src/components/Logo.tsx +1 -1
- package/src/components/McpPanel.tsx +687 -0
- package/src/components/ModelDeck.tsx +12 -3
- package/src/components/SettingsModal.tsx +43 -5
- package/src/components/Sidebar.tsx +2 -1
- package/src/components/Splash.tsx +1 -1
- package/src/data/providers.ts +1 -1
- package/src/lib/daemon.ts +10 -1
- package/src/lib/mcp-config.test.mjs +47 -0
- package/src/lib/mcp-config.ts +203 -0
- package/src/store/mcp.ts +28 -1
- package/src/store/settings.ts +1 -1
- package/src/store/ui.ts +4 -0
- package/src/types.ts +14 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/assets/index-DdI1_iPD.css +0 -1
- package/dist/assets/index-egG5Bgfo.js +0 -312
- package/src/components/McpTab.tsx +0 -337
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function ad(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var em={exports:{}},oo={};var U1;function OS(){if(U1)return oo;U1=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:e,type:r,key:d,ref:o!==void 0?o:null,props:u}}return oo.Fragment=i,oo.jsx=a,oo.jsxs=a,oo}var B1;function MS(){return B1||(B1=1,em.exports=OS()),em.exports}var c=MS(),tm={exports:{}},Xe={};var $1;function RS(){if($1)return Xe;$1=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.for("react.view_transition"),y=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function M(I,se,he){this.props=I,this.context=se,this.refs=N,this.updater=he||_}M.prototype.isReactComponent={},M.prototype.setState=function(I,se){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,se,"setState")},M.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function j(){}j.prototype=M.prototype;function D(I,se,he){this.props=I,this.context=se,this.refs=N,this.updater=he||_}var P=D.prototype=new j;P.constructor=D,S(P,M.prototype),P.isPureReactComponent=!0;var L=Array.isArray;function T(){}var R={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function z(I,se,he){var ke=he.ref;return{$$typeof:e,type:I,key:se,ref:ke!==void 0?ke:null,props:he}}function $(I,se){return z(I.type,se,I.props)}function W(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function de(I){var se={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(he){return se[he]})}var ce=/\/+/g;function ae(I,se){return typeof I=="object"&&I!==null&&I.key!=null?de(""+I.key):se.toString(36)}function O(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(T,T):(I.status="pending",I.then(function(se){I.status==="pending"&&(I.status="fulfilled",I.value=se)},function(se){I.status==="pending"&&(I.status="rejected",I.reason=se)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function te(I,se,he,ke,ze){var He=typeof I;(He==="undefined"||He==="boolean")&&(I=null);var $e=!1;if(I===null)$e=!0;else switch(He){case"bigint":case"string":case"number":$e=!0;break;case"object":switch(I.$$typeof){case e:case i:$e=!0;break;case x:return $e=I._init,te($e(I._payload),se,he,ke,ze)}}if($e)return ze=ze(I),$e=ke===""?"."+ae(I,0):ke,L(ze)?(he="",$e!=null&&(he=$e.replace(ce,"$&/")+"/"),te(ze,se,he,"",function(Te){return Te})):ze!=null&&(W(ze)&&(ze=$(ze,he+(ze.key==null||I&&I.key===ze.key?"":(""+ze.key).replace(ce,"$&/")+"/")+$e)),se.push(ze)),1;$e=0;var X=ke===""?".":ke+":";if(L(I))for(var Z=0;Z<I.length;Z++)ke=I[Z],He=X+ae(ke,Z),$e+=te(ke,se,he,He,ze);else if(Z=k(I),typeof Z=="function")for(I=Z.call(I),Z=0;!(ke=I.next()).done;)ke=ke.value,He=X+ae(ke,Z++),$e+=te(ke,se,he,He,ze);else if(He==="object"){if(typeof I.then=="function")return te(O(I),se,he,ke,ze);throw se=String(I),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return $e}function ne(I,se,he){if(I==null)return I;var ke=[],ze=0;return te(I,ke,"","",function(He){return se.call(he,He,ze++)}),ke}function G(I){if(I._status===-1){var se=I._result,he=se();he.then(function(ke){(I._status===0||I._status===-1)&&(I._status=1,I._result=ke,he.status===void 0&&(he.status="fulfilled",he.value=ke))},function(ke){(I._status===0||I._status===-1)&&(I._status=2,I._result=ke,he.status===void 0&&(he.status="rejected",he.reason=ke))}),I._status===-1&&(I._status=0,I._result=he)}if(I._status===1)return I._result.default;throw I._result}var A=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function Se(I){var se=R.T,he={};he.types=se!==null?se.types:null,R.T=he;try{var ke=I(),ze=R.S;ze!==null&&ze(he,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(T,A)}catch(He){A(He)}finally{se!==null&&he.types!==null&&(se.types=he.types),R.T=se}}function pe(I){var se=R.T;if(se!==null){var he=se.types;he===null?se.types=[I]:he.indexOf(I)===-1&&he.push(I)}else Se(pe.bind(null,I))}var C={map:ne,forEach:function(I,se,he){ne(I,function(){se.apply(this,arguments)},he)},count:function(I){var se=0;return ne(I,function(){se++}),se},toArray:function(I){return ne(I,function(se){return se})||[]},only:function(I){if(!W(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Xe.Activity=b,Xe.Children=C,Xe.Component=M,Xe.Fragment=a,Xe.Profiler=o,Xe.PureComponent=D,Xe.StrictMode=r,Xe.Suspense=h,Xe.ViewTransition=v,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return R.H.useMemoCache(I)}},Xe.addTransitionType=pe,Xe.cache=function(I){return function(){return I.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(I,se,he){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ke=S({},I.props),ze=I.key;if(se!=null)for(He in se.key!==void 0&&(ze=""+se.key),se)!K.call(se,He)||He==="key"||He==="__self"||He==="__source"||He==="ref"&&se.ref===void 0||(ke[He]=se[He]);var He=arguments.length-2;if(He===1)ke.children=he;else if(1<He){for(var $e=Array(He),X=0;X<He;X++)$e[X]=arguments[X+2];ke.children=$e}return z(I.type,ze,ke)},Xe.createContext=function(I){return I={$$typeof:d,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:u,_context:I},I},Xe.createElement=function(I,se,he){var ke,ze={},He=null;if(se!=null)for(ke in se.key!==void 0&&(He=""+se.key),se)K.call(se,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(ze[ke]=se[ke]);var $e=arguments.length-2;if($e===1)ze.children=he;else if(1<$e){for(var X=Array($e),Z=0;Z<$e;Z++)X[Z]=arguments[Z+2];ze.children=X}if(I&&I.defaultProps)for(ke in $e=I.defaultProps,$e)ze[ke]===void 0&&(ze[ke]=$e[ke]);return z(I,He,ze)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(I){return{$$typeof:p,render:I}},Xe.isValidElement=W,Xe.lazy=function(I){return{$$typeof:x,_payload:{_status:-1,_result:I},_init:G}},Xe.memo=function(I,se){return{$$typeof:g,type:I,compare:se===void 0?null:se}},Xe.startTransition=Se,Xe.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Xe.use=function(I){return R.H.use(I)},Xe.useActionState=function(I,se,he){return R.H.useActionState(I,se,he)},Xe.useCallback=function(I,se){return R.H.useCallback(I,se)},Xe.useContext=function(I){return R.H.useContext(I)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(I,se){return R.H.useDeferredValue(I,se)},Xe.useEffect=function(I,se){return R.H.useEffect(I,se)},Xe.useEffectEvent=function(I){return R.H.useEffectEvent(I)},Xe.useId=function(){return R.H.useId()},Xe.useImperativeHandle=function(I,se,he){return R.H.useImperativeHandle(I,se,he)},Xe.useInsertionEffect=function(I,se){return R.H.useInsertionEffect(I,se)},Xe.useLayoutEffect=function(I,se){return R.H.useLayoutEffect(I,se)},Xe.useMemo=function(I,se){return R.H.useMemo(I,se)},Xe.useOptimistic=function(I,se){return R.H.useOptimistic(I,se)},Xe.useReducer=function(I,se,he){return R.H.useReducer(I,se,he)},Xe.useRef=function(I){return R.H.useRef(I)},Xe.useState=function(I){return R.H.useState(I)},Xe.useSyncExternalStore=function(I,se,he){return R.H.useSyncExternalStore(I,se,he)},Xe.useTransition=function(){return R.H.useTransition()},Xe.version="19.3.1",Xe}var H1;function Ih(){return H1||(H1=1,tm.exports=RS()),tm.exports}var B=Ih();const nm=ad(B);var im={exports:{}},co={},am={exports:{}},rm={};var P1;function DS(){return P1||(P1=1,(function(e){function i(O,te){var ne=O.length;O.push(te);e:for(;0<ne;){var G=ne-1>>>1,A=O[G];if(0<o(A,te))O[G]=te,O[ne]=A,ne=G;else break e}}function a(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var te=O[0],ne=O.pop();if(ne!==te){O[0]=ne;e:for(var G=0,A=O.length,Se=A>>>1;G<Se;){var pe=2*(G+1)-1,C=O[pe],I=pe+1,se=O[I];if(0>o(C,ne))I<A&&0>o(se,C)?(O[G]=se,O[I]=ne,G=I):(O[G]=C,O[pe]=ne,G=pe);else if(I<A&&0>o(se,ne))O[G]=se,O[I]=ne,G=I;else break e}}return te}function o(O,te){var ne=O.sortIndex-te.sortIndex;return ne!==0?ne:O.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var h=[],g=[],x=1,b=null,v=3,y=!1,k=!1,_=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function D(O){for(var te=a(g);te!==null;){if(te.callback===null)r(g);else if(te.startTime<=O)r(g),te.sortIndex=te.expirationTime,i(h,te);else break;te=a(g)}}function P(O){if(_=!1,D(O),!k)if(a(h)!==null)k=!0,L||(L=!0,W());else{var te=a(g);te!==null&&ae(P,te.startTime-O)}}var L=!1,T=-1,R=5,K=-1;function z(){return S?!0:!(e.unstable_now()-K<R)}function $(){if(S=!1,L){var O=e.unstable_now();K=O;var te=!0;try{e:{k=!1,_&&(_=!1,M(T),T=-1),y=!0;var ne=v;try{t:{for(D(O),b=a(h);b!==null&&!(b.expirationTime>O&&z());){var G=b.callback;if(typeof G=="function"){b.callback=null,v=b.priorityLevel;var A=G(b.expirationTime<=O);if(O=e.unstable_now(),typeof A=="function"){b.callback=A,D(O),te=!0;break t}b===a(h)&&r(h),D(O)}else r(h);b=a(h)}if(b!==null)te=!0;else{var Se=a(g);Se!==null&&ae(P,Se.startTime-O),te=!1}}break e}finally{b=null,v=ne,y=!1}te=void 0}}finally{te?W():L=!1}}}var W;if(typeof j=="function")W=function(){j($)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,ce=de.port2;de.port1.onmessage=$,W=function(){ce.postMessage(null)}}else W=function(){N($,0)};function ae(O,te){T=N(function(){O(e.unstable_now())},te)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var ne=v;v=te;try{return O()}finally{v=ne}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(O,te){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var ne=v;v=O;try{return te()}finally{v=ne}},e.unstable_scheduleCallback=function(O,te,ne){var G=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?G+ne:G):ne=G,O){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=ne+A,O={id:x++,callback:te,priorityLevel:O,startTime:ne,expirationTime:A,sortIndex:-1},ne>G?(O.sortIndex=ne,i(g,O),a(h)===null&&O===a(g)&&(_?(M(T),T=-1):_=!0,ae(P,ne-G))):(O.sortIndex=A,i(h,O),k||y||(k=!0,L||(L=!0,W()))),O},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(O){var te=v;return function(){var ne=v;v=te;try{return O.apply(this,arguments)}finally{v=ne}}}})(rm)),rm}var F1;function zS(){return F1||(F1=1,am.exports=DS()),am.exports}var sm={exports:{}},Sn={};var q1;function LS(){if(q1)return Sn;q1=1;var e=Ih();function i(x){var b="https://react.dev/errors/"+x;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)b+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+x+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function p(x,b,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:y===d?d:""+y,children:x,containerInfo:b,implementation:v}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(x,b){if(x==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Sn.browser=function(x){return{$$typeof:u,_reason:x}},Sn.createPortal=function(x,b){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(i(299));return p(x,b,null,v)},Sn.flushSync=function(x){var b=h.T,v=r.p;try{if(h.T=null,r.p=2,x)return x()}finally{h.T=b,r.p=v,r.d.f()}},Sn.preconnect=function(x,b){typeof x=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,r.d.C(x,b))},Sn.prefetchDNS=function(x){typeof x=="string"&&r.d.D(x)},Sn.preinit=function(x,b){if(typeof x=="string"&&b&&typeof b.as=="string"){var v=b.as,y=g(v,b.crossOrigin),k=typeof b.integrity=="string"?b.integrity:void 0,_=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;v==="style"?r.d.S(x,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:y,integrity:k,fetchPriority:_}):v==="script"&&r.d.X(x,{crossOrigin:y,integrity:k,fetchPriority:_,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Sn.preinitModule=function(x,b){if(typeof x=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var v=g(b.as,b.crossOrigin);r.d.M(x,{crossOrigin:v,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&r.d.M(x)},Sn.preload=function(x,b){if(typeof x=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var v=b.as,y=g(v,b.crossOrigin);r.d.L(x,v,{crossOrigin:y,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Sn.preloadModule=function(x,b){if(typeof x=="string")if(b){var v=g(b.as,b.crossOrigin);r.d.m(x,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:v,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else r.d.m(x)},Sn.requestFormReset=function(x){r.d.r(x)},Sn.unstable_batchedUpdates=function(x,b){return x(b)},Sn.useFormState=function(x,b,v){return h.H.useFormState(x,b,v)},Sn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Sn.version="19.3.1",Sn}var G1;function Pv(){if(G1)return sm.exports;G1=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(i){console.error(i)}}return e(),sm.exports=LS(),sm.exports}var Y1;function IS(){if(Y1)return co;Y1=1;var e=zS(),i=Ih(),a=Pv();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){for(var n=t,s=n;s&&!s.alternate;)n=s,(n.flags&4098)!==0&&(t=n.return),s=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(u(t)!==t)throw Error(r(188))}function g(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(r(188));return n!==t?null:t}for(var s=t,l=n;;){var f=s.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){s=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===s)return h(f),t;if(m===l)return h(f),n;m=m.sibling}throw Error(r(188))}if(s.return!==l.return)s=f,l=m;else{for(var w=!1,E=f.child;E;){if(E===s){w=!0,s=f,l=m;break}if(E===l){w=!0,l=f,s=m;break}E=E.sibling}if(!w){for(E=m.child;E;){if(E===s){w=!0,s=m,l=f;break}if(E===l){w=!0,l=m,s=f;break}E=E.sibling}if(!w)throw Error(r(189))}}if(s.alternate!==l)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:n}function x(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=x(t),n!==null)return n;t=t.sibling}return null}function b(t,n,s,l,f,m){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&s(t,l,f,m)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&b(t.child,n,s,l,f,m))return!0;t=t.sibling}return!1}function v(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function y(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function k(t){var n=[null,null],s=v(t);return s===null||_(n,t,s.child,{foundSelf:!1}),n}function _(t,n,s,l){for(;s!==null;){if(s===n)l.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(l.foundSelf)return t[1]=s,!0;t[0]=s}else if((s.tag!==22||s.memoizedState===null)&&_(t,n,s.child,l))return!0;s=s.sibling}return!1}function S(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(r(559))}}var N=null,M=null;function j(t,n,s){return t===s?!0:t===n?(N=t,!0):!1}function D(t,n,s){return t===s?(M=t,!1):t===n?(M!==null&&(N=t),!0):!1}function P(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function L(t,n,s){for(var l=0,f=t;f;f=s(f))l++;f=0;for(var m=n;m;m=s(m))f++;for(;0<l-f;)t=s(t),l--;for(;0<f-l;)n=s(n),f--;for(;l--;){if(t===n||n!==null&&t===n.alternate)return t;t=s(t),n=s(n)}return null}var T=Object.assign,R=Symbol.for("react.element"),K=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),Se=Symbol.for("react.activity"),pe=Symbol.for("react.legacy_hidden"),C=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),se=Symbol.for("react.recoverable"),he=Symbol.iterator;function ke(t){return t===null||typeof t!="object"?null:(t=he&&t[he]||t["@@iterator"],typeof t=="function"?t:null)}var ze=Symbol.for("react.client.reference");function He(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ze?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $:return"Fragment";case de:return"Profiler";case W:return"StrictMode";case te:return"Suspense";case ne:return"SuspenseList";case Se:return"Activity";case I:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case ae:return t.displayName||"Context";case ce:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case G:return n=t.displayName||null,n!==null?n:He(t.type)||"Memo";case A:n=t._payload,t=t._init;try{return He(t(n))}catch{}}return null}var $e=Array.isArray,X=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},rt=[],ct=-1;function Le(t){return{current:t}}function mt(t){0>ct||(t.current=rt[ct],rt[ct]=null,ct--)}function Je(t,n){ct++,rt[ct]=t.current,t.current=n}var Gt=Le(null),An=Le(null),xn=Le(null),fe=Le(null);function qe(t,n){switch(Je(xn,n),Je(An,t),Je(Gt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Ky(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Ky(n),t=Vy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}mt(Gt),Je(Gt,t)}function ht(){mt(Gt),mt(An),mt(xn)}function xt(t){var n=t.memoizedState;n!==null&&(Ys._currentValue=n.memoizedState,Je(fe,t)),n=Gt.current;var s=Vy(n,t.type);n!==s&&(Je(An,t),Je(Gt,s))}function ln(t){An.current===t&&(mt(Gt),mt(An)),fe.current===t&&(mt(fe),Ys._currentValue=Te)}var re,ye;function Ue(t){if(re===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);re=n&&n[1]||"",ye=-1<s.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+re+t+ye}var Ke=!1;function Xt(t,n){if(!t||Ke)return"";Ke=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(we){var q=we}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(we){q=we}oe=!1;try{var J=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),oe=!0,new t}finally{oe&&(J!==void 0?Object.defineProperty(t.prototype,"props",J):delete t.prototype.props)}}}else{try{throw Error()}catch(we){q=we}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(we){if(we&&q&&typeof we.stack=="string")return[we.stack,q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),w=m[0],E=m[1];if(w&&E){var U=w.split(`
|
|
4
|
+
`),V=E.split(`
|
|
5
|
+
`);for(f=l=0;l<U.length&&!U[l].includes("DetermineComponentFrameRoot");)l++;for(;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;if(l===U.length||f===V.length)for(l=U.length-1,f=V.length-1;1<=l&&0<=f&&U[l]!==V[f];)f--;for(;1<=l&&0<=f;l--,f--)if(U[l]!==V[f]){if(l!==1||f!==1)do if(l--,f--,0>f||U[l]!==V[f]){var ee=`
|
|
6
|
+
`+U[l].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),ee}while(1<=l&&0<=f);break}}}finally{Ke=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ue(s):""}function Nt(t,n){switch(t.tag){case 26:case 27:case 5:return Ue(t.type);case 16:return Ue("Lazy");case 13:return t.child!==n&&n!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return Xt(t.type,!1);case 11:return Xt(t.type.render,!1);case 1:return Xt(t.type,!0);case 31:return Ue("Activity");case 30:return Ue("ViewTransition");default:return""}}function on(t){try{var n="",s=null;do n+=Nt(t,s),s=t,t=t.return;while(t);return n}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var bn=Object.prototype.hasOwnProperty,ki=e.unstable_scheduleCallback,Ei=e.unstable_cancelCallback,oa=e.unstable_shouldYield,Ia=e.unstable_requestPaint,Zt=e.unstable_now,dn=e.unstable_getCurrentPriorityLevel,Ni=e.unstable_ImmediatePriority,zn=e.unstable_UserBlockingPriority,_i=e.unstable_NormalPriority,H=e.unstable_LowPriority,ue=e.unstable_IdlePriority,Ne=e.log,Ve=e.unstable_setDisableYieldValue,Rt=null,ft=null;function Ce(t){if(typeof Ne=="function"&&Ve(t),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Rt,t)}catch{}}var Ee=Math.clz32?Math.clz32:Ht,Ge=Math.log,Qt=Math.LN2;function Ht(t){return t>>>=0,t===0?32:31-(Ge(t)/Qt|0)|0}var Hi=256,Ua=262144,Ba=4194304;function ca(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function $a(t,n,s){var l=t.pendingLanes;if(l===0)return 0;var f=0,m=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var E=l&134217727;return E!==0?(l=E&~m,l!==0?f=ca(l):(w&=E,w!==0?f=ca(w):s||(s=E&~t,s!==0&&(f=ca(s))))):(E=l&~m,E!==0?f=ca(E):w!==0?f=ca(w):s||(s=l&~t,s!==0&&(f=ca(s)))),f===0?0:n!==0&&n!==f&&(n&m)===0&&(m=f&-f,s=n&-n,m>=s||m===32&&(s&4194048)!==0)?n:f}function Sr(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Yo(t,n){(n&8)!==0&&(n|=n&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=n;0<s;){var l=31-Ee(s),f=1<<l;n|=t[l],s&=~f}return n}function jd(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 gl(){var t=Ba;return Ba<<=1,(Ba&62914560)===0&&(Ba=4194304),t}function Ha(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function Tr(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Od(t,n,s,l,f,m){var w=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var E=t.entanglements,U=t.expirationTimes,V=t.hiddenUpdates;for(s=w&~s;0<s;){var ee=31-Ee(s),oe=1<<ee;E[ee]=0,U[ee]=-1;var q=V[ee];if(q!==null)for(V[ee]=null,ee=0;ee<q.length;ee++){var J=q[ee];J!==null&&(J.lane&=-536870913)}s&=~oe}l!==0&&Ko(t,l,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(w&~n))}function Ko(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var l=31-Ee(n);t.entangledLanes|=n,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function Si(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var l=31-Ee(s),f=1<<l;f&n|t[l]&n&&(t[l]|=n),s&=~f}}function xl(t,n){var s=n&-n;return s=(s&42)!==0?1:ls(s),(s&(t.suspendedLanes|n))!==0?0:s}function ls(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function bl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Vo(){var t=Z.p;return t!==0?t:(t=window.event,t===void 0?32:O1(t.type))}function Xo(t,n){var s=Z.p;try{return Z.p=t,n()}finally{Z.p=s}}var Pn=Math.random().toString(36).slice(2),cn="__reactFiber$"+Pn,ge="__reactProps$"+Pn,Re="__reactContainer$"+Pn,st="__reactEvents$"+Pn,At="__reactListeners$"+Pn,Yt="__reactHandles$"+Pn,Fn="__reactResources$"+Pn,qn="__reactMarker$"+Pn,ua="__reactLoad$"+Pn;function fn(t){delete t[cn],delete t[ge],delete t[At],delete t[Yt]}function pn(t){var n;if(n=t[cn])return n;for(var s=t.parentNode;s;){if(n=s[Re]||s[cn]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=d1(t);t!==null;){if(s=t[cn])return s;t=d1(t)}return n}t=s,s=t.parentNode}return null}function da(t){if(t=t[cn]||t[Re]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Pa(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function fa(t){var n=t[Fn];return n||(n=t[Fn]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Jt(t){t[qn]=!0}function Zo(t){t[ua]=void 0}var Qo=new Set,Jo={};function oi(t,n){pa(t,n),pa(t+"Capture",n)}function pa(t,n){for(Jo[t]=n,t=0;t<n.length;t++)Qo.add(n[t])}var ci=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]*$"),Wo={},os={};function Ze(t){return bn.call(os,t)?!0:bn.call(Wo,t)?!1:ci.test(t)?os[t]=!0:(Wo[t]=!0,!1)}var pt=!1;function Wt(){var t=pt;return pt=!1,t}function yt(t,n,s){if(Ze(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,s)}}function ma(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,s)}}function yn(t,n,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,l)}}function vn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function cs(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _e(t,n,s){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,m=l.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(w){s=""+w,m.call(this,w)}}),Object.defineProperty(t,n,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function De(t){if(!t._valueTracker){var n=cs(t)?"checked":"value";t._valueTracker=_e(t,n,""+t[n])}}function We(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),l="";return t&&(l=cs(t)?t.checked?"true":"false":t.value),t=l,t!==s?(n.setValue(t),!0):!1}var vt=/[\n"\\]/g;function _t(t){return t.replace(vt,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Jn(t,n,s,l,f,m,w,E){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),n!=null?w==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+vn(n)):t.value!==""+vn(n)&&(t.value=""+vn(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?w==="number"&&t.value==n?yl(t,vn(t.value)):yl(t,vn(n)):s!=null?yl(t,vn(s)):l!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+vn(E):t.removeAttribute("name")}function ec(t,n,s,l,f,m,w,E){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),n!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){De(t);return}s=s!=null?""+vn(s):"",n=n!=null?""+vn(n):s,E||n===t.value||(t.value=n),t.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=E?t.checked:!!l,t.defaultChecked=!!l,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),De(t)}function yl(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function us(t,n,s,l){if(t=t.options,n){n={};for(var f=0;f<s.length;f++)n["$"+s[f]]=!0;for(s=0;s<t.length;s++)f=n.hasOwnProperty("$"+t[s].value),t[s].selected!==f&&(t[s].selected=f),f&&l&&(t[s].defaultSelected=!0)}else{for(s=""+vn(s),n=null,f=0;f<t.length;f++){if(t[f].value===s){t[f].selected=!0,l&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function Ig(t,n,s){if(n!=null&&(n=""+vn(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+vn(s):""}function Ug(t,n,s,l){if(n==null){if(l!=null){if(s!=null)throw Error(r(92));if($e(l)){if(1<l.length)throw Error(r(93));l=l[0]}s=l}s==null&&(s=""),n=s}s=vn(n),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),De(t)}function ds(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var WE=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 Bg(t,n,s){var l=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":l?t.setProperty(n,s):typeof s!="number"||s===0||WE.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function $g(t,n,s){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="",pt=!0);for(var f in n)l=n[f],n.hasOwnProperty(f)&&s[f]!==l&&(Bg(t,f,l),pt=!0)}else for(var m in n)n.hasOwnProperty(m)&&Bg(t,m,n[m])}function Md(t){if(t.indexOf("-")===-1)return!1;switch(t){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 eN=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"],["maskType","mask-type"],["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"]]),tN=/^[\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 tc(t){return tN.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Pi(){}var Rd=null;function Dd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var fs=null,ps=null;function Hg(t){var n=da(t);if(n&&(t=n.stateNode)){var s=t[ge]||null;e:switch(t=n.stateNode,n.type){case"input":if(Jn(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+_t(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var l=s[n];if(l!==t&&l.form===t.form){var f=l[ge]||null;if(!f)throw Error(r(90));Jn(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)l=s[n],l.form===t.form&&We(l)}break e;case"textarea":Ig(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&us(t,!!s.multiple,n,!1)}}}var zd=!1;function Pg(t,n,s){if(zd)return t(n,s);zd=!0;try{var l=t(n);return l}finally{if(zd=!1,(fs!==null||ps!==null)&&(tu(),fs&&(n=fs,t=ps,ps=fs=null,Hg(n),t)))for(n=0;n<t.length;n++)Hg(t[n])}}function vl(t,n){var s=t.stateNode;if(s===null)return null;var l=s[ge]||null;if(l===null)return null;s=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,n,typeof s));return s}var ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(ha)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{Ld=!1}var Fa=null,Id=null,nc=null;function Fg(){if(nc)return nc;var t,n=Id,s=n.length,l,f="value"in Fa?Fa.value:Fa.textContent,m=f.length;for(t=0;t<s&&n[t]===f[t];t++);var w=s-t;for(l=1;l<=w&&n[s-l]===f[m-l];l++);return nc=f.slice(t,1<l?1-l:void 0)}function ic(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function ac(){return!0}function qg(){return!1}function Ln(t){function n(s,l,f,m,w){this._reactName=s,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=w,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(s=t[E],this[E]=s?s(m):m[E]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?ac:qg,this.isPropagationStopped=qg,this}return T(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ac)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ac)},persist:function(){},isPersistent:ac}),n}var qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rc=Ln(qa),kl=T({},qa,{view:0,detail:0}),nN=Ln(kl),Ud,Bd,El,sc=T({},kl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==El&&(El&&t.type==="mousemove"?(Ud=t.screenX-El.screenX,Bd=t.screenY-El.screenY):Bd=Ud=0,El=t),Ud)},movementY:function(t){return"movementY"in t?t.movementY:Bd}}),Gg=Ln(sc),iN=T({},sc,{dataTransfer:0}),aN=Ln(iN),rN=T({},kl,{relatedTarget:0}),$d=Ln(rN),sN=T({},qa,{animationName:0,elapsedTime:0,pseudoElement:0}),lN=Ln(sN),oN=T({},qa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cN=Ln(oN),uN=T({},qa,{data:0}),Yg=Ln(uN),dN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fN={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"},pN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mN(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=pN[t])?!!n[t]:!1}function Hd(){return mN}var hN=T({},kl,{key:function(t){if(t.key){var n=dN[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=ic(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?fN[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hd,charCode:function(t){return t.type==="keypress"?ic(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ic(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gN=Ln(hN),xN=T({},sc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kg=Ln(xN),bN=T({},qa,{submitter:0}),yN=Ln(bN),vN=T({},kl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hd}),wN=Ln(vN),kN=T({},qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),EN=Ln(kN),NN=T({},sc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),_N=Ln(NN),SN=T({},qa,{newState:0,oldState:0,source:0}),TN=Ln(SN),CN=[9,13,27,32],Pd=ha&&"CompositionEvent"in window,Nl=null;ha&&"documentMode"in document&&(Nl=document.documentMode);var AN=ha&&"TextEvent"in window&&!Nl,Vg=ha&&(!Pd||Nl&&8<Nl&&11>=Nl),Xg=" ",Zg=!1;function Qg(t,n){switch(t){case"keyup":return CN.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ms=!1;function jN(t,n){switch(t){case"compositionend":return Jg(n);case"keypress":return n.which!==32?null:(Zg=!0,Xg);case"textInput":return t=n.data,t===Xg&&Zg?null:t;default:return null}}function ON(t,n){if(ms)return t==="compositionend"||!Pd&&Qg(t,n)?(t=Fg(),nc=Id=Fa=null,ms=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Vg&&n.locale!=="ko"?null:n.data;default:return null}}var MN={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 Wg(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!MN[t.type]:n==="textarea"}function ex(t,n,s,l){fs?ps?ps.push(l):ps=[l]:fs=l,n=lu(n,"onChange"),0<n.length&&(s=new rc("onChange","change",null,s,l),t.push({event:s,listeners:n}))}var _l=null,Sl=null;function RN(t){Hy(t,0)}function lc(t){var n=Pa(t);if(We(n))return t}function tx(t,n){if(t==="change")return n}var nx=!1;if(ha){var Fd;if(ha){var qd="oninput"in document;if(!qd){var ix=document.createElement("div");ix.setAttribute("oninput","return;"),qd=typeof ix.oninput=="function"}Fd=qd}else Fd=!1;nx=Fd&&(!document.documentMode||9<document.documentMode)}function ax(){_l&&(_l.detachEvent("onpropertychange",rx),Sl=_l=null)}function rx(t){if(t.propertyName==="value"&&lc(Sl)){var n=[];ex(n,Sl,t,Dd(t)),Pg(RN,n)}}function DN(t,n,s){t==="focusin"?(ax(),_l=n,Sl=s,_l.attachEvent("onpropertychange",rx)):t==="focusout"&&ax()}function zN(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return lc(Sl)}function LN(t,n){if(t==="click")return lc(n)}function IN(t,n){if(t==="input"||t==="change")return lc(n)}function UN(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Wn=typeof Object.is=="function"?Object.is:UN;function Tl(t,n){if(Wn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),l=Object.keys(n);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var f=s[l];if(!bn.call(n,f)||!Wn(t[f],n[f]))return!1}return!0}function Gd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function sx(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lx(t,n){var s=sx(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=n&&l>=n)return{node:s,offset:n-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=sx(s)}}function ox(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?ox(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function cx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Gd(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=Gd(t.document)}return n}function Yd(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var BN=ha&&"documentMode"in document&&11>=document.documentMode,hs=null,Kd=null,Cl=null,Vd=!1;function ux(t,n,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Vd||hs==null||hs!==Gd(l)||(l=hs,"selectionStart"in l&&Yd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Cl&&Tl(Cl,l)||(Cl=l,l=lu(Kd,"onSelect"),0<l.length&&(n=new rc("onSelect","select",null,n,s),t.push({event:n,listeners:l}),n.target=hs)))}function Cr(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var gs={animationend:Cr("Animation","AnimationEnd"),animationiteration:Cr("Animation","AnimationIteration"),animationstart:Cr("Animation","AnimationStart"),transitionrun:Cr("Transition","TransitionRun"),transitionstart:Cr("Transition","TransitionStart"),transitioncancel:Cr("Transition","TransitionCancel"),transitionend:Cr("Transition","TransitionEnd")},Xd={},dx={};ha&&(dx=document.createElement("div").style,"AnimationEvent"in window||(delete gs.animationend.animation,delete gs.animationiteration.animation,delete gs.animationstart.animation),"TransitionEvent"in window||delete gs.transitionend.transition);function Ar(t){if(Xd[t])return Xd[t];if(!gs[t])return t;var n=gs[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in dx)return Xd[t]=n[s];return t}var fx=Ar("animationend"),px=Ar("animationiteration"),mx=Ar("animationstart"),$N=Ar("transitionrun"),HN=Ar("transitionstart"),PN=Ar("transitioncancel"),hx=Ar("transitionend"),gx=new Map,Zd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Zd.push("scrollEnd");function Ti(t,n){gx.set(t,n),oi(n,[t])}var FN=0;function ga(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=Oi.identifierPrefix;var s=FN++;return t="_"+t+"t_"+s.toString(32)+"_",n.autoName=t}function xx(t){if(t==null||typeof t=="string")return t;var n=null,s=Ls;if(s!==null)for(var l=0;l<s.length;l++){var f=t[s[l]];if(f!=null){if(f==="none")return"none";n=n==null?f:n+(" "+f)}}return n??t.default}function xa(t,n){return t=xx(t),n=xx(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var oc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ui=[],xs=0,Qd=0;function cc(){for(var t=xs,n=Qd=xs=0;n<t;){var s=ui[n];ui[n++]=null;var l=ui[n];ui[n++]=null;var f=ui[n];ui[n++]=null;var m=ui[n];if(ui[n++]=null,l!==null&&f!==null){var w=l.pending;w===null?f.next=f:(f.next=w.next,w.next=f),l.pending=f}m!==0&&bx(s,f,m)}}function uc(t,n,s,l){ui[xs++]=t,ui[xs++]=n,ui[xs++]=s,ui[xs++]=l,Qd|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Jd(t,n,s,l){return uc(t,n,s,l),dc(t)}function jr(t,n){return uc(t,null,null,n),dc(t)}function bx(t,n,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var f=!1,m=t.return;m!==null;)m.childLanes|=s,l=m.alternate,l!==null&&(l.childLanes|=s),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&n!==null&&(f=31-Ee(s),t=m.hiddenUpdates,l=t[f],l===null?t[f]=[n]:l.push(n),n.lane=s|536870912),m):null}function dc(t){if(50<Zl)throw Zl=0,eu=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var bs={};function qN(t,n,s,l){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(t,n,s,l){return new qN(t,n,s,l)}function Wd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ba(t,n){var s=t.alternate;return s===null?(s=Gn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&1206910976,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function yx(t,n){t.flags&=1206910978;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function fc(t,n,s,l,f,m){var w=0;if(l=t,typeof l=="function")Wd(l)&&(w=1);else if(typeof l=="string")w=bS(t,s,Gt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(l){case Se:return t=Gn(31,s,n,f),t.elementType=Se,t.lanes=m,t;case $:return Or(s.children,f,m,n);case W:w=8,f|=24;break;case de:return t=Gn(12,s,n,f|2),t.elementType=de,t.lanes=m,t;case te:return t=Gn(13,s,n,f),t.elementType=te,t.lanes=m,t;case ne:return t=Gn(19,s,n,f),t.elementType=ne,t.lanes=m,t;case pe:case I:return t=f|32,t=Gn(30,s,n,t),t.elementType=I,t.lanes=m,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case ae:w=10;break e;case ce:w=9;break e;case O:w=11;break e;case G:w=14;break e;case A:w=16,l=null;break e}w=29,s=Error(r(130,t===null?"null":typeof t,"")),l=null}return n=Gn(w,s,n,f),n.elementType=t,n.type=l,n.lanes=m,n}function Or(t,n,s,l){return t=Gn(7,t,l,n),t.lanes=s,t}function ef(t,n,s){return t=Gn(6,t,null,n),t.lanes=s,t}function vx(t){var n=Gn(18,null,null,0);return n.stateNode=t,n}function tf(t,n,s){return n=Gn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var wx=new WeakMap;function di(t,n){if(typeof t=="object"&&t!==null){var s=wx.get(t);return s!==void 0?s:(n={value:t,source:n,stack:on(n)},wx.set(t,n),n)}return{value:t,source:n,stack:on(n)}}var ys=[],vs=0,pc=null,Al=0,fi=[],pi=0,Ga=null,Fi=1,qi="";function ya(t,n){ys[vs++]=Al,ys[vs++]=pc,pc=t,Al=n}function kx(t,n,s){fi[pi++]=Fi,fi[pi++]=qi,fi[pi++]=Ga,Ga=t;var l=Fi;t=qi;var f=32-Ee(l)-1;l&=~(1<<f),s+=1;var m=32-Ee(n)+f;if(30<m){var w=f-f%5;m=(l&(1<<w)-1).toString(32),l>>=w,f-=w,Fi=1<<32-Ee(n)+f|s<<f|l,qi=m+t}else Fi=1<<m|s<<f|l,qi=t}function mc(t){t.return!==null&&(ya(t,1),kx(t,1,0))}function nf(t){for(;t===pc;)pc=ys[--vs],ys[vs]=null,Al=ys[--vs],ys[vs]=null;for(;t===Ga;)Ga=fi[--pi],fi[pi]=null,qi=fi[--pi],fi[pi]=null,Fi=fi[--pi],fi[pi]=null}function Ex(t,n){fi[pi++]=Fi,fi[pi++]=qi,fi[pi++]=Ga,Fi=n.id,qi=n.overflow,Ga=t}var mn=null,It=null,it=!1,Ya=null,mi=!1,af=Error(r(519));function Ka(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jl(di(n,t)),af}function Nx(t){var n=t.stateNode,s=t.type,l=t.memoizedProps;switch(n[cn]=t,n[ge]=l,s){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(s=0;s<Jl.length;s++)ot(Jl[s],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":ot("invalid",n),ec(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ot("invalid",n);break;case"textarea":ot("invalid",n),Ug(n,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||l.suppressHydrationWarning===!0||Gy(n.textContent,s)?(l.popover!=null&&(ot("beforetoggle",n),ot("toggle",n)),l.onScroll!=null&&ot("scroll",n),l.onScrollEnd!=null&&ot("scrollend",n),l.onClick!=null&&(n.onclick=Pi),n=!0):n=!1,n||Ka(t,!0)}function hc(t){for(mn=t.return;mn;)switch(mn.tag){case 5:case 31:case 13:mi=!1;return;case 27:case 3:mi=!0;return;default:mn=mn.return}}function ws(t){if(t!==mn)return!1;if(!it)return hc(t),it=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Dp(t.type,t.memoizedProps)),s=!s),s&&It&&Ka(t),hc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));It=u1(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));It=u1(t)}else n===27?(n=It,cr(t.type)?(t=Fp,Fp=null,It=t):It=n):It=mn?gi(t.stateNode.nextSibling):null;return!0}function Mr(){It=mn=null,it=!1}function rf(){var t=Ya;return t!==null&&(Vn===null?Vn=t:Vn.push.apply(Vn,t),Ya=null),t}function jl(t){Ya===null?Ya=[t]:Ya.push(t)}var sf=Le(null),Rr=null,va=null;function Va(t,n,s){Je(sf,n._currentValue),n._currentValue=s}function wa(t){t._currentValue=sf.current,mt(sf)}function gc(t,n,s){for(;t!==null;){var l=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),t===s)break;t=t.return}}function lf(t,n,s,l){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var w=f.child;m=m.firstContext;e:for(;m!==null;){var E=m;m=f;for(var U=0;U<n.length;U++)if(E.context===n[U]){m.lanes|=s,E=m.alternate,E!==null&&(E.lanes|=s),gc(m.return,s,t),l||(w=null);break e}m=E.next}}else if(f.tag===18){if(w=f.return,w===null)throw Error(r(341));w.lanes|=s,m=w.alternate,m!==null&&(m.lanes|=s),gc(w,s,t),w=null}else f.tag===13&&f.memoizedState!==null&&f.memoizedState.dehydrated===null?(f.lanes|=s,w=f.alternate,w!==null&&(w.lanes|=s),gc(f.return,s,t),w=f.child,w=w!==null?w.sibling:null):w=f.child;if(w!==null)w.return=f;else for(w=f;w!==null;){if(w===t){w=null;break}if(f=w.sibling,f!==null){f.return=w.return,w=f;break}w=w.return}f=w}}function Dr(t,n,s,l){t=null;for(var f=n,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var w=f.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var E=f.type;Wn(f.pendingProps.value,w.value)||(t!==null?t.push(E):t=[E])}}else if(f===fe.current){if(w=f.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Ys):t=[Ys])}f=f.return}return t!==null&&lf(n,t,s,l),n.flags|=262144,t!==null}function xc(t){for(t=t.firstContext;t!==null;){if(!Wn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zr(t){Rr=t,va=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function wn(t){return _x(Rr,t)}function bc(t,n){return Rr===null&&zr(t),_x(t,n)}function _x(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},va===null){if(t===null)throw Error(r(308));va=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else va=va.next=n;return s}var GN=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,l){t.push(l)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},YN=e.unstable_scheduleCallback,KN=e.unstable_NormalPriority,en={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function of(){return{controller:new GN,data:new Map,refCount:0}}function Ol(t){t.refCount--,t.refCount===0&&YN(KN,function(){t.controller.abort()})}function Sx(t,n){if((t.pendingLanes&4194048)!==0){var s=t.transitionTypes;for(s===null&&(s=t.transitionTypes=[]),t=0;t<n.length;t++){var l=n[t];s.indexOf(l)===-1&&s.push(l)}}}var Ml=null;function VN(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Rl=null,cf=0,Lr=0,ks=null;function XN(t,n){if(Rl===null){var s=Rl=[];cf=0,Lr=_p(),ks={status:"pending",value:void 0,then:function(l){s.push(l)}}}return cf++,n.then(Tx,Tx),n}function Tx(){if(--cf===0&&(Ml=null,Rl!==null)){ks!==null&&(ks.status="fulfilled");var t=Rl;Rl=null,Lr=0,ks=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function ZN(t,n){var s=[],l={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return t.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),l}var Cx=X.S;X.S=function(t,n){if(vy=Zt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&XN(t,n),Ml!==null)for(var s=$s;s!==null;)Sx(s,Ml),s=s.next;if(s=t.types,s!==null){for(var l=$s;l!==null;)Sx(l,s),l=l.next;if(Lr!==0){l=Ml,l===null&&(l=Ml=[]);for(var f=0;f<s.length;f++){var m=s[f];l.indexOf(m)===-1&&l.push(m)}}}Cx!==null&&Cx(t,n)};var Ir=Le(null);function uf(){var t=Ir.current;return t!==null?t:Dt.pooledCache}function yc(t,n){n===null?Je(Ir,Ir.current):Je(Ir,n.pool)}function Ax(){var t=uf();return t===null?null:{parent:en._currentValue,pool:t}}var Es=Error(r(460)),df=Error(r(474)),vc=Error(r(542)),wc={then:function(){}};function jx(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ox(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Pi,Pi),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Rx(t),t===void 0&&!("reason"in n)?Error(r(600)):t;default:if(typeof n.status=="string")n.then(Pi,Pi);else{if(t=Dt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(l){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Rx(t),t}throw Br=n,Es}}function Ur(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Br=s,Es):s}}var Br=null;function Mx(){if(Br===null)throw Error(r(459));var t=Br;return Br=null,t}function Rx(t){if(t===Es||t===vc)throw Error(r(483))}var Ns=null,Dl=0;function kc(t){var n=Dl;return Dl+=1,Ns===null&&(Ns=[]),Ox(Ns,t,n)}function Xa(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Ec(t,n){throw n.$$typeof===R?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Dx(t){function n(Y,F){if(t){var Q=Y.deletions;Q===null?(Y.deletions=[F],Y.flags|=16):Q.push(F)}}function s(Y,F){if(!t)return null;for(;F!==null;)n(Y,F),F=F.sibling;return null}function l(Y){for(var F=new Map;Y!==null;)Y.key===null?F.set(Y.index,Y):F.set(Y.key,Y),Y=Y.sibling;return F}function f(Y,F){return Y=ba(Y,F),Y.index=0,Y.sibling=null,Y}function m(Y,F,Q){return Y.index=Q,t?(Q=Y.alternate,Q!==null?(Q=Q.index,Q<F?(Y.flags|=2,F):Q):(Y.flags|=134217730,F)):(Y.flags|=1048576,F)}function w(Y){return t&&Y.alternate===null&&(Y.flags|=134217730),Y}function E(Y,F,Q,le){return F===null||F.tag!==6?(F=ef(Q,Y.mode,le),F.return=Y,F):(F=f(F,Q),F.return=Y,F)}function U(Y,F,Q,le){var Ae=Q.type;return Ae===$?(Y=ee(Y,F,Q.props.children,le,Q.key),Xa(Y,Q),Y):F!==null&&(F.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===A&&Ur(Ae)===F.type)?(F=f(F,Q.props),Xa(F,Q),F.return=Y,F):(F=fc(Q.type,Q.key,Q.props,null,Y.mode,le),Xa(F,Q),F.return=Y,F)}function V(Y,F,Q,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=tf(Q,Y.mode,le),F.return=Y,F):(F=f(F,Q.children||[]),F.return=Y,F)}function ee(Y,F,Q,le,Ae){return F===null||F.tag!==7?(F=Or(Q,Y.mode,le,Ae),F.return=Y,F):(F=f(F,Q),F.return=Y,F)}function oe(Y,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=ef(""+F,Y.mode,Q),F.return=Y,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case K:return Q=fc(F.type,F.key,F.props,null,Y.mode,Q),Xa(Q,F),Q.return=Y,Q;case z:return F=tf(F,Y.mode,Q),F.return=Y,F;case A:return F=Ur(F),oe(Y,F,Q)}if($e(F)||ke(F))return F=Or(F,Y.mode,Q,null),F.return=Y,F;if(typeof F.then=="function")return oe(Y,kc(F),Q);if(F.$$typeof===ae)return oe(Y,bc(Y,F),Q);Ec(Y,F)}return null}function q(Y,F,Q,le){var Ae=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ae!==null?null:E(Y,F,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:return Q.key===Ae?U(Y,F,Q,le):null;case z:return Q.key===Ae?V(Y,F,Q,le):null;case A:return Q=Ur(Q),q(Y,F,Q,le)}if($e(Q)||ke(Q))return Ae!==null?null:ee(Y,F,Q,le,null);if(typeof Q.then=="function")return q(Y,F,kc(Q),le);if(Q.$$typeof===ae)return q(Y,F,bc(Y,Q),le);Ec(Y,Q)}return null}function J(Y,F,Q,le,Ae){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Y=Y.get(Q)||null,E(F,Y,""+le,Ae);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case K:return Y=Y.get(le.key===null?Q:le.key)||null,U(F,Y,le,Ae);case z:return Y=Y.get(le.key===null?Q:le.key)||null,V(F,Y,le,Ae);case A:return le=Ur(le),J(Y,F,Q,le,Ae)}if($e(le)||ke(le))return Y=Y.get(Q)||null,ee(F,Y,le,Ae,null);if(typeof le.then=="function")return J(Y,F,Q,kc(le),Ae);if(le.$$typeof===ae)return J(Y,F,Q,bc(F,le),Ae);Ec(F,le)}return null}function we(Y,F,Q,le){for(var Ae=null,dt=null,Ie=F,Fe=F=0,an=null;Ie!==null&&Fe<Q.length;Fe++){Ie.index>Fe?(an=Ie,Ie=null):an=Ie.sibling;var gt=q(Y,Ie,Q[Fe],le);if(gt===null){Ie===null&&(Ie=an);break}t&&Ie&>.alternate===null&&n(Y,Ie),F=m(gt,F,Fe),dt===null?Ae=gt:dt.sibling=gt,dt=gt,Ie=an}if(Fe===Q.length)return s(Y,Ie),it&&ya(Y,Fe),Ae;if(Ie===null){for(;Fe<Q.length;Fe++)Ie=oe(Y,Q[Fe],le),Ie!==null&&(F=m(Ie,F,Fe),dt===null?Ae=Ie:dt.sibling=Ie,dt=Ie);return it&&ya(Y,Fe),Ae}for(Ie=l(Ie);Fe<Q.length;Fe++)an=J(Ie,Y,Fe,Q[Fe],le),an!==null&&(t&&(gt=an.alternate,gt!==null&&Ie.delete(gt.key===null?Fe:gt.key)),F=m(an,F,Fe),dt===null?Ae=an:dt.sibling=an,dt=an);return t&&Ie.forEach(function(mr){return n(Y,mr)}),it&&ya(Y,Fe),Ae}function Me(Y,F,Q,le){if(Q==null)throw Error(r(151));for(var Ae=null,dt=null,Ie=F,Fe=F=0,an=null,gt=Q.next();Ie!==null&&!gt.done;Fe++,gt=Q.next()){Ie.index>Fe?(an=Ie,Ie=null):an=Ie.sibling;var mr=q(Y,Ie,gt.value,le);if(mr===null){Ie===null&&(Ie=an);break}t&&Ie&&mr.alternate===null&&n(Y,Ie),F=m(mr,F,Fe),dt===null?Ae=mr:dt.sibling=mr,dt=mr,Ie=an}if(gt.done)return s(Y,Ie),it&&ya(Y,Fe),Ae;if(Ie===null){for(;!gt.done;Fe++,gt=Q.next())gt=oe(Y,gt.value,le),gt!==null&&(F=m(gt,F,Fe),dt===null?Ae=gt:dt.sibling=gt,dt=gt);return it&&ya(Y,Fe),Ae}for(Ie=l(Ie);!gt.done;Fe++,gt=Q.next())gt=J(Ie,Y,Fe,gt.value,le),gt!==null&&(t&&(an=gt.alternate,an!==null&&Ie.delete(an.key===null?Fe:an.key)),F=m(gt,F,Fe),dt===null?Ae=gt:dt.sibling=gt,dt=gt);return t&&Ie.forEach(function(jS){return n(Y,jS)}),it&&ya(Y,Fe),Ae}function tt(Y,F,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===$&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:e:{for(var Ae=Q.key;F!==null;){if(F.key===Ae){if(Ae=Q.type,Ae===$){if(F.tag===7){s(Y,F.sibling),le=f(F,Q.props.children),Xa(le,Q),le.return=Y,Y=le;break e}}else if(F.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===A&&Ur(Ae)===F.type){s(Y,F.sibling),le=f(F,Q.props),Xa(le,Q),le.return=Y,Y=le;break e}s(Y,F);break}else n(Y,F);F=F.sibling}Q.type===$?(le=Or(Q.props.children,Y.mode,le,Q.key),Xa(le,Q),le.return=Y,Y=le):(le=fc(Q.type,Q.key,Q.props,null,Y.mode,le),Xa(le,Q),le.return=Y,Y=le)}return w(Y);case z:e:{for(Ae=Q.key;F!==null;){if(F.key===Ae)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){s(Y,F.sibling),le=f(F,Q.children||[]),le.return=Y,Y=le;break e}else{s(Y,F);break}else n(Y,F);F=F.sibling}le=tf(Q,Y.mode,le),le.return=Y,Y=le}return w(Y);case A:return Q=Ur(Q),tt(Y,F,Q,le)}if($e(Q))return we(Y,F,Q,le);if(ke(Q)){if(Ae=ke(Q),typeof Ae!="function")throw Error(r(150));return Q=Ae.call(Q),Me(Y,F,Q,le)}if(typeof Q.then=="function")return tt(Y,F,kc(Q),le);if(Q.$$typeof===ae)return tt(Y,F,bc(Y,Q),le);Ec(Y,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(s(Y,F.sibling),le=f(F,Q),le.return=Y,Y=le):(s(Y,F),le=ef(Q,Y.mode,le),le.return=Y,Y=le),w(Y)):s(Y,F)}return function(Y,F,Q,le){try{Dl=0;var Ae=tt(Y,F,Q,le);return Ns=null,Ae}catch(Ie){if(Ie===Es||Ie===vc)throw Ie;var dt=Gn(29,Ie,null,Y.mode);return dt.lanes=le,dt.return=Y,dt}}}var $r=Dx(!0),zx=Dx(!1),Za=!1;function ff(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Qa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ja(t,n,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(wt&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=dc(t),bx(t,null,s),n}return uc(t,l,n,s),dc(t)}function zl(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var l=n.lanes;l&=t.pendingLanes,s|=l,n.lanes=s,Si(t,s)}}function mf(t,n){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var f=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?f=m=w:m=m.next=w,s=s.next}while(s!==null);m===null?f=m=n:m=m.next=n}else f=m=n;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var hf=!1;function Ll(){if(hf){var t=ks;if(t!==null)throw t}}function Il(t,n,s,l){hf=!1;var f=t.updateQueue;Za=!1;var m=f.firstBaseUpdate,w=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var U=E,V=U.next;U.next=null,w===null?m=V:w.next=V,w=U;var ee=t.alternate;ee!==null&&(ee=ee.updateQueue,E=ee.lastBaseUpdate,E!==w&&(E===null?ee.firstBaseUpdate=V:E.next=V,ee.lastBaseUpdate=U))}if(m!==null){var oe=f.baseState;w=0,ee=V=U=null,E=m;do{var q=E.lane&-536870913,J=q!==E.lane;if(J?(ut&q)===q:(l&q)===q){q!==0&&q===Lr&&(hf=!0),ee!==null&&(ee=ee.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var we=t,Me=E;q=n;var tt=s;switch(Me.tag){case 1:if(we=Me.payload,typeof we=="function"){oe=we.call(tt,oe,q);break e}oe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Me.payload,q=typeof we=="function"?we.call(tt,oe,q):we,q==null)break e;oe=T({},oe,q);break e;case 2:Za=!0}}q=E.callback,q!==null&&(t.flags|=64,J&&(t.flags|=8192),J=f.callbacks,J===null?f.callbacks=[q]:J.push(q))}else J={lane:q,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ee===null?(V=ee=J,U=oe):ee=ee.next=J,w|=q;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;J=E,E=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);ee===null&&(U=oe),f.baseState=U,f.firstBaseUpdate=V,f.lastBaseUpdate=ee,m===null&&(f.shared.lanes=0),rr|=w,t.lanes=w,t.memoizedState=oe}}function Lx(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Ix(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Lx(s[t],n)}var Wa=Le(null),Nc=Le(0);function Ux(t,n){t=Sa,Je(Nc,t),Je(Wa,n),Sa=t|n.baseLanes}function gf(){Je(Nc,Sa),Je(Wa,Wa.current)}function xf(){Sa=Nc.current,mt(Wa),mt(Nc)}var kn=Le(null),jn=null;function er(t){var n=t.alternate;Je(En,En.current&1),Je(kn,t),jn===null&&(n===null||Wa.current!==null||n.memoizedState!==null)&&(jn=t)}function bf(t){Je(En,En.current),Je(kn,t),jn===null&&(jn=t)}function Bx(t){t.tag===22?(Je(En,En.current),Je(kn,t),jn===null&&(jn=t)):tr()}function tr(){Je(En,En.current),Je(kn,kn.current)}function ei(t){mt(kn),jn===t&&(jn=null),mt(En)}var En=Le(0);function Ul(t,n){Je(kn,kn.current),Je(En,n)}function yf(t){mt(En),mt(kn),jn===t&&(jn=null)}function _c(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Hp(s)||Pp(s)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ka=0,et=null,jt=null,tn=null,Sc=!1,_s=!1,Hr=!1,Tc=0,Bl=0,Ss=null,QN=0;function Pt(){throw Error(r(321))}function vf(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Wn(t[s],n[s]))return!1;return!0}function wf(t,n,s,l,f,m){return ka=m,et=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,X.H=t===null||t.memoizedState===null?kb:Eb,Hr=!1,m=s(l,f),Hr=!1,_s&&(m=Hx(n,s,l,f)),$x(t),m}function $x(t){X.H=Dc;var n=jt!==null&&jt.next!==null;if(ka=0,tn=jt=et=null,Sc=!1,Bl=0,Ss=null,n)throw Error(r(300));t===null||nn||(t=t.dependencies,t!==null&&xc(t)&&(nn=!0))}function Hx(t,n,s,l){et=t;var f=0;do{if(_s&&(Ss=null),Bl=0,_s=!1,25<=f)throw Error(r(301));if(f+=1,tn=jt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}X.H=r_,m=n(s,l)}while(_s);return m}function JN(){var t=X.H,n=t.useState()[0];return n=typeof n.then=="function"?$l(n):n,t=t.useState()[0],(jt!==null?jt.memoizedState:null)!==t&&(et.flags|=1024),n}function kf(){var t=Tc!==0;return Tc=0,t}function Ef(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Nf(t){if(Sc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Sc=!1}ka=0,tn=jt=et=null,_s=!1,Bl=Tc=0,Ss=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?et.memoizedState=tn=t:tn=tn.next=t,tn}function Kt(){if(jt===null){var t=et.alternate;t=t!==null?t.memoizedState:null}else t=jt.next;var n=tn===null?et.memoizedState:tn.next;if(n!==null)tn=n,jt=t;else{if(t===null)throw et.alternate===null?Error(r(467)):Error(r(310));jt=t,t={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},tn===null?et.memoizedState=tn=t:tn=tn.next=t}return tn}function Cc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $l(t){var n=Bl;return Bl+=1,Ss===null&&(Ss=[]),t=Ox(Ss,t,n),n=et,(tn===null?n.memoizedState:tn.next)===null&&(n=n.alternate,X.H=n===null||n.memoizedState===null?kb:Eb),t}function Ac(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return $l(t);if(t.$$typeof===se)return;if(t.$$typeof===ae)return wn(t)}throw Error(r(438,String(t)))}function _f(t){var n=null,s=et.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var l=et.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Cc(),et.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),l=0;l<t;l++)s[l]=C;return n.index++,s}function Ea(t,n){return typeof n=="function"?n(t):n}function jc(t){var n=Kt();return Sf(n,jt,t)}function Sf(t,n,s){var l=t.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=s;var f=t.baseQueue,m=l.pending;if(m!==null){if(f!==null){var w=f.next;f.next=m.next,m.next=w}n.baseQueue=f=m,l.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{n=f.next;var E=w=null,U=null,V=n,ee=!1;do{var oe=V.lane&-536870913;if(oe!==V.lane?(ut&oe)===oe:(ka&oe)===oe){var q=V.revertLane;if(q===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),oe===Lr&&(ee=!0);else if((ka&q)===q){V=V.next,q===Lr&&(ee=!0);continue}else oe={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},U===null?(E=U=oe,w=m):U=U.next=oe,et.lanes|=q,rr|=q;oe=V.action,Hr&&s(m,oe),m=V.hasEagerState?V.eagerState:s(m,oe)}else q={lane:oe,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},U===null?(E=U=q,w=m):U=U.next=q,et.lanes|=oe,rr|=oe;V=V.next}while(V!==null&&V!==n);if(U===null?w=m:U.next=E,!Wn(m,t.memoizedState)&&(nn=!0,ee&&(s=ks,s!==null)))throw s;t.memoizedState=m,t.baseState=w,t.baseQueue=U,l.lastRenderedState=m}return f===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Tf(t){var n=Kt(),s=n.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var l=s.dispatch,f=s.pending,m=n.memoizedState;if(f!==null){s.pending=null;var w=f=f.next;do m=t(m,w.action),w=w.next;while(w!==f);Wn(m,n.memoizedState)||(nn=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),s.lastRenderedState=m}return[m,l]}function Px(t,n,s){var l=et,f=Kt(),m=it;if(m){if(s===void 0)throw Error(r(407));s=s()}else s=n();var w=!Wn((jt||f).memoizedState,s);if(w&&(f.memoizedState=s,nn=!0),f=f.queue,jf(Gx.bind(null,l,f,t),[t]),t=f.getSnapshot!==n||w||tn!==null&&(tn.memoizedState.tag&1)!==0,Ts(t?9:8,{destroy:void 0},qx.bind(null,l,f,s,n),null),t){if(l.flags|=2048,Dt===null)throw Error(r(349));m||(ka&127)!==0||Fx(l,n,s)}return s}function Fx(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=et.updateQueue,n===null?(n=Cc(),et.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function qx(t,n,s,l){n.value=s,n.getSnapshot=l,Yx(n)&&Kx(t)}function Gx(t,n,s){return s(function(){Yx(n)&&Kx(t)})}function Yx(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Wn(t,s)}catch{return!0}}function Kx(t){var n=jr(t,2);n!==null&&Xn(n,t,2)}function Cf(t){var n=In();if(typeof t=="function"){var s=t;if(t=s(),Hr){Ce(!0);try{s()}finally{Ce(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:t},n}function Vx(t,n,s,l){return t.baseState=s,Sf(t,jt,typeof l=="function"?l:Ea)}function WN(t,n,s,l,f){if(Rc(t))throw Error(r(485));if(t=n.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){m.listeners.push(w)}};X.T!==null?s(!0):m.isTransition=!1,l(m),s=n.pending,s===null?(m.next=n.pending=m,Xx(n,m)):(m.next=s.next,n.pending=s.next=m)}}function Xx(t,n){var s=n.action,l=n.payload,f=t.state;if(n.isTransition){var m=X.T,w={};w.types=m!==null?m.types:null,X.T=w;try{var E=s(f,l),U=X.S;U!==null&&U(w,E),Zx(t,n,E)}catch(V){Af(t,n,V)}finally{m!==null&&w.types!==null&&(m.types=w.types),X.T=m}}else try{m=s(f,l),Zx(t,n,m)}catch(V){Af(t,n,V)}}function Zx(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Qx(t,n,l)},function(l){return Af(t,n,l)}):Qx(t,n,s)}function Qx(t,n,s){n.status="fulfilled",n.value=s,Jx(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Xx(t,s)))}function Af(t,n,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=s,Jx(n),n=n.next;while(n!==l)}t.action=null}function Jx(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Wx(t,n){return n}function eb(t,n){if(it){var s=Dt.formState;if(s!==null){e:{var l=et;if(it){if(It){t:{for(var f=It,m=mi;f.nodeType!==8;){if(!m){f=null;break t}if(f=gi(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){It=gi(f.nextSibling),l=f.data==="F!";break e}}Ka(l)}l=!1}l&&(n=s[0])}}return s=In(),s.memoizedState=s.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wx,lastRenderedState:n},s.queue=l,s=yb.bind(null,et,l),l.dispatch=s,l=Cf(!1),m=zf.bind(null,et,!1,l.queue),l=In(),f={state:n,dispatch:null,action:t,pending:null},l.queue=f,s=WN.bind(null,et,f,m,s),f.dispatch=s,l.memoizedState=t,[n,s,!1]}function tb(t){var n=Kt();return nb(n,jt,t)}function nb(t,n,s){if(n=Sf(t,n,Wx)[0],t=jc(Ea)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=$l(n)}catch(w){throw w===Es?vc:w}else l=n;n=Kt();var f=n.queue,m=f.dispatch;return s!==n.memoizedState&&(et.flags|=2048,Ts(9,{destroy:void 0},e_.bind(null,f,s),null)),[l,m,t]}function e_(t,n){t.action=n}function ib(t){var n=Kt(),s=jt;if(s!==null)return nb(n,s,t);Kt(),n=n.memoizedState,s=Kt();var l=s.queue.dispatch;return s.memoizedState=t,[n,l,!1]}function Ts(t,n,s,l){return t={tag:t,create:s,deps:l,inst:n,next:null},n=et.updateQueue,n===null&&(n=Cc(),et.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(l=s.next,s.next=t,t.next=l,n.lastEffect=t),t}function ab(){return Kt().memoizedState}function Oc(t,n,s,l){var f=In();et.flags|=t,f.memoizedState=Ts(1|n,{destroy:void 0},s,l===void 0?null:l)}function Mc(t,n,s,l){var f=Kt();l=l===void 0?null:l;var m=f.memoizedState.inst;jt!==null&&l!==null&&vf(l,jt.memoizedState.deps)?f.memoizedState=Ts(n,m,s,l):(et.flags|=t,f.memoizedState=Ts(1|n,m,s,l))}function rb(t,n){Oc(8390656,8,t,n)}function jf(t,n){Mc(2048,8,t,n)}function t_(t){et.flags|=4;var n=et.updateQueue;if(n===null)n=Cc(),et.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function sb(t){var n=Kt().memoizedState;return t_({ref:n,nextImpl:t}),function(){if((wt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function lb(t,n){return Mc(4,2,t,n)}function ob(t,n){return Mc(4,4,t,n)}function cb(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function ub(t,n,s){s=s!=null?s.concat([t]):null,Mc(4,4,cb.bind(null,n,t),s)}function Of(){}function db(t,n){var s=Kt();n=n===void 0?null:n;var l=s.memoizedState;return n!==null&&vf(n,l[1])?l[0]:(s.memoizedState=[t,n],t)}function fb(t,n){var s=Kt();n=n===void 0?null:n;var l=s.memoizedState;if(n!==null&&vf(n,l[1]))return l[0];if(l=t(),Hr){Ce(!0);try{t()}finally{Ce(!1)}}return s.memoizedState=[l,n],l}function Mf(t,n,s){return s===void 0||(ka&1073741824)!==0&&(ut&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=ky(),et.lanes|=t,rr|=t,s)}function pb(t,n,s,l){return Wn(s,n)?s:Wa.current!==null?(t=Mf(t,s,l),Wn(t,n)||(nn=!0),t):(ka&106)===0||(ka&1073741824)!==0&&(ut&261930)===0?(nn=!0,t.memoizedState=s):(t=ky(),et.lanes|=t,rr|=t,n)}function mb(t,n,s,l,f){var m=Z.p;Z.p=m!==0&&8>m?m:8;var w=X.T,E={};E.types=w!==null?w.types:null,X.T=E,zf(t,!1,n,s);try{var U=f(),V=X.S;if(V!==null&&V(E,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ee=ZN(U,l);Hl(t,n,ee,ai(t))}else Hl(t,n,l,ai(t))}catch(oe){Hl(t,n,{then:function(){},status:"rejected",reason:oe},ai())}finally{Z.p=m,w!==null&&E.types!==null&&(w.types=E.types),X.T=w}}function n_(){}function Rf(t,n,s,l){if(t.tag!==5)throw Error(r(476));var f=hb(t).queue;mb(t,f,n,Te,s===null?n_:function(){return gb(t),s(l)})}function hb(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:Te},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function gb(t){var n=hb(t);n.next===null&&(n=t.alternate.memoizedState),Hl(t,n.next.queue,{},ai())}function Df(){return wn(Ys)}function xb(){return Kt().memoizedState}function bb(){return Kt().memoizedState}function i_(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=ai();t=Qa(s);var l=Ja(n,t,s);l!==null&&(Xn(l,n,s),zl(l,n,s)),n={cache:of()},t.payload=n;return}n=n.return}}function a_(t,n,s){var l=ai();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Rc(t)?vb(n,s):(s=Jd(t,n,s,l),s!==null&&(Xn(s,t,l),wb(s,n,l)))}function yb(t,n,s){var l=ai();Hl(t,n,s,l)}function Hl(t,n,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Rc(t))vb(n,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var w=n.lastRenderedState,E=m(w,s);if(f.hasEagerState=!0,f.eagerState=E,Wn(E,w))return uc(t,n,f,0),Dt===null&&cc(),!1}catch{}if(s=Jd(t,n,f,l),s!==null)return Xn(s,t,l),wb(s,n,l),!0}return!1}function zf(t,n,s,l){if(l={lane:2,revertLane:_p(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Rc(t)){if(n)throw Error(r(479))}else n=Jd(t,s,l,2),n!==null&&Xn(n,t,2)}function Rc(t){var n=t.alternate;return t===et||n!==null&&n===et}function vb(t,n){_s=Sc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function wb(t,n,s){if((s&4194048)!==0){var l=n.lanes;l&=t.pendingLanes,s|=l,n.lanes=s,Si(t,s)}}var Dc={readContext:wn,use:Ac,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt,useEffectEvent:Pt},kb={readContext:wn,use:Ac,useCallback:function(t,n){return In().memoizedState=[t,n===void 0?null:n],t},useContext:wn,useEffect:rb,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,Oc(4194308,4,cb.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Oc(4194308,4,t,n)},useInsertionEffect:function(t,n){Oc(4,2,t,n)},useMemo:function(t,n){var s=In();n=n===void 0?null:n;var l=t();if(Hr){Ce(!0);try{t()}finally{Ce(!1)}}return s.memoizedState=[l,n],l},useReducer:function(t,n,s){var l=In();if(s!==void 0){var f=s(n);if(Hr){Ce(!0);try{s(n)}finally{Ce(!1)}}}else f=n;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=a_.bind(null,et,t),[l.memoizedState,t]},useRef:function(t){var n=In();return t={current:t},n.memoizedState=t},useState:function(t){t=Cf(t);var n=t.queue,s=yb.bind(null,et,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:Of,useDeferredValue:function(t,n){var s=In();return Mf(s,t,n)},useTransition:function(){var t=Cf(!1);return t=mb.bind(null,et,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var l=et,f=In();if(it){if(s===void 0)throw Error(r(407));s=s()}else{if(s=n(),Dt===null)throw Error(r(349));(ut&127)!==0||Fx(l,n,s)}f.memoizedState=s;var m={value:s,getSnapshot:n};return f.queue=m,rb(Gx.bind(null,l,m,t),[t]),l.flags|=2048,Ts(9,{destroy:void 0},qx.bind(null,l,m,s,n),null),s},useId:function(){var t=In(),n=Dt.identifierPrefix;if(it){var s=qi,l=Fi;s=(l&~(1<<32-Ee(l)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Tc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=QN++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Df,useFormState:eb,useActionState:eb,useOptimistic:function(t){var n=In();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=zf.bind(null,et,!0,s),s.dispatch=n,[t,n]},useMemoCache:_f,useCacheRefresh:function(){return In().memoizedState=i_.bind(null,et)},useEffectEvent:function(t){var n=In(),s={impl:t};return n.memoizedState=s,function(){if((wt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Eb={readContext:wn,use:Ac,useCallback:db,useContext:wn,useEffect:jf,useImperativeHandle:ub,useInsertionEffect:lb,useLayoutEffect:ob,useMemo:fb,useReducer:jc,useRef:ab,useState:function(){return jc(Ea)},useDebugValue:Of,useDeferredValue:function(t,n){var s=Kt();return pb(s,jt.memoizedState,t,n)},useTransition:function(){var t=jc(Ea)[0],n=Kt().memoizedState;return[typeof t=="boolean"?t:$l(t),n]},useSyncExternalStore:Px,useId:xb,useHostTransitionStatus:Df,useFormState:tb,useActionState:tb,useOptimistic:function(t,n){var s=Kt();return Vx(s,jt,t,n)},useMemoCache:_f,useCacheRefresh:bb,useEffectEvent:sb},r_={readContext:wn,use:Ac,useCallback:db,useContext:wn,useEffect:jf,useImperativeHandle:ub,useInsertionEffect:lb,useLayoutEffect:ob,useMemo:fb,useReducer:Tf,useRef:ab,useState:function(){return Tf(Ea)},useDebugValue:Of,useDeferredValue:function(t,n){var s=Kt();return jt===null?Mf(s,t,n):pb(s,jt.memoizedState,t,n)},useTransition:function(){var t=Tf(Ea)[0],n=Kt().memoizedState;return[typeof t=="boolean"?t:$l(t),n]},useSyncExternalStore:Px,useId:xb,useHostTransitionStatus:Df,useFormState:ib,useActionState:ib,useOptimistic:function(t,n){var s=Kt();return jt!==null?Vx(s,jt,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:_f,useCacheRefresh:bb,useEffectEvent:sb};function Lf(t,n,s,l){n=t.memoizedState,s=s(l,n),s=s==null?n:T({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var If={enqueueSetState:function(t,n,s){t=t._reactInternals;var l=ai(),f=Qa(l);f.payload=n,s!=null&&(f.callback=s),n=Ja(t,f,l),n!==null&&(Xn(n,t,l),zl(n,t,l))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var l=ai(),f=Qa(l);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Ja(t,f,l),n!==null&&(Xn(n,t,l),zl(n,t,l))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=ai(),l=Qa(s);l.tag=2,n!=null&&(l.callback=n),n=Ja(t,l,s),n!==null&&(Xn(n,t,s),zl(n,t,s))}};function Nb(t,n,s,l,f,m,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,m,w):n.prototype&&n.prototype.isPureReactComponent?!Tl(s,l)||!Tl(f,m):!0}function _b(t,n,s,l){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,l),n.state!==t&&If.enqueueReplaceState(n,n.state,null)}function Pr(t,n){var s=n;if("ref"in n){s={};for(var l in n)l!=="ref"&&(s[l]=n[l])}if(t=t.defaultProps){s===n&&(s=T({},s));for(var f in t)s[f]===void 0&&(s[f]=t[f])}return s}function Sb(t){oc(t)}function Tb(t){console.error(t)}function Cb(t){oc(t)}function zc(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function Ab(t,n,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Uf(t,n,s){return s=Qa(s),s.tag=3,s.payload={element:null},s.callback=function(){zc(t,n)},s}function jb(t){return t=Qa(t),t.tag=3,t}function Ob(t,n,s,l){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;t.payload=function(){return f(m)},t.callback=function(){Ab(n,s,l)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){Ab(n,s,l),typeof f!="function"&&(sr===null?sr=new Set([this]):sr.add(this));var E=l.stack;this.componentDidCatch(l.value,{componentStack:E!==null?E:""})})}function s_(t,n,s,l,f){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=s.alternate,n!==null&&Dr(n,s,f,!0),s=kn.current,s!==null){switch(s.tag){case 31:case 13:case 19:return jn===null?nu():s.alternate===null&&Ft===0&&(Ft=3),s.flags&=-257,s.flags|=65536,s.lanes=f,l===wc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([l]):n.add(l),kp(t,l,f)),!1;case 22:return s.flags|=65536,l===wc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([l]):s.add(l)),kp(t,l,f)),!1}throw Error(r(435,s.tag))}return kp(t,l,f),nu(),!1}if(it)return n=kn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==af&&(t=Error(r(422),{cause:l}),jl(di(t,s)))):(l!==af&&(n=Error(r(423),{cause:l}),jl(di(n,s))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,l=di(l,s),f=Uf(t.stateNode,l,f),mf(t,f),Ft!==4&&(Ft=2)),!1;var m=Error(r(520),{cause:l});if(m=di(m,s),Xl===null?Xl=[m]:Xl.push(m),Ft!==4&&(Ft=2),n===null)return!0;l=di(l,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=f&-f,s.lanes|=t,t=Uf(s.stateNode,l,t),mf(s,t),!1;case 1:if(n=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(sr===null||!sr.has(m))))return s.flags|=65536,f&=-f,s.lanes|=f,f=jb(f),Ob(f,t,s,l),mf(s,f),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var Bf=Error(r(461)),nn=!1;function un(t,n,s,l){n.child=t===null?zx(n,null,s,l):$r(n,t.child,s,l)}function Mb(t,n,s,l,f){s=s.render;var m=n.ref;if("ref"in l){var w={};for(var E in l)E!=="ref"&&(w[E]=l[E])}else w=l;return zr(n),l=wf(t,n,s,w,m,f),E=kf(),t!==null&&!nn?(Ef(t,n,f),Na(t,n,f)):(it&&E&&mc(n),n.flags|=1,un(t,n,l,f),n.child)}function Rb(t,n,s,l,f){if(t===null){var m=s.type;return typeof m=="function"&&!Wd(m)&&m.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=m,Db(t,n,m,l,f)):(t=fc(s.type,null,l,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,!Kf(t,f)){var w=m.memoizedProps;if(s=s.compare,s=s!==null?s:Tl,s(w,l)&&t.ref===n.ref)return Na(t,n,f)}return n.flags|=1,t=ba(m,l),t.ref=n.ref,t.return=n,n.child=t}function Db(t,n,s,l,f){if(t!==null){var m=t.memoizedProps;if(Tl(m,l)&&t.ref===n.ref)if(nn=!1,n.pendingProps=l=m,Kf(t,f))(t.flags&131072)!==0&&(nn=!0);else return n.lanes=t.lanes,Na(t,n,f)}return $f(t,n,s,l,f)}function zb(t,n,s,l){var f=l.children,m=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,t!==null){for(l=n.child=t.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~m}else l=0,n.child=null;return Lb(t,n,m,s,l)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&yc(n,m!==null?m.cachePool:null),m!==null?Ux(n,m):gf(),Bx(n);else return l=n.lanes=536870912,Lb(t,n,m!==null?m.baseLanes|s:s,s,l)}else m!==null?(yc(n,m.cachePool),Ux(n,m),tr(),n.memoizedState=null):(t!==null&&yc(n,null),gf(),tr());return un(t,n,f,s),n.child}function Pl(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Lb(t,n,s,l,f){var m=uf();return m=m===null?null:{parent:en._currentValue,pool:m},n.memoizedState={baseLanes:s,cachePool:m},t!==null&&yc(n,null),gf(),Bx(n),t!==null&&Dr(t,n,l,!0),n.childLanes=f,null}function Lc(t,n){return n=Ic({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Ib(t,n,s){return $r(n,t.child,null,s),t=Lc(n,n.pendingProps),t.flags|=2,ei(n),n.memoizedState=null,t}function l_(t,n,s){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(it){if(l.mode==="hidden")return t=Lc(n,l),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Pl(null,t);if(bf(n),(t=It)?(t=c1(t,mi),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ga!==null?{id:Fi,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},s=vx(t),s.return=n,n.child=s,mn=n,It=null)):t=null,t===null)throw Ka(n);return n.lanes=536870912,null}return Lc(n,l)}var m=t.memoizedState;if(m!==null){var w=m.dehydrated;if(bf(n),f)if(n.flags&256)n.flags&=-257,n=Ib(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(nn||Dr(t,n,s,!1),f=(s&t.childLanes)!==0,nn||f){if(Wa.current===null){if(l=Dt,l!==null&&(w=xl(l,s),w!==0&&w!==m.retryLane))throw m.retryLane=w,jr(t,w),Xn(l,t,w),Bf;nu()}n=Ib(t,n,s)}else t=m.treeContext,It=gi(w.nextSibling),mn=n,it=!0,Ya=null,mi=!1,t!==null&&Ex(n,t),n=Lc(n,l),n.flags|=134221824;return n}return t=ba(t.child,{mode:l.mode,children:l.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Cs(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function $f(t,n,s,l,f){return zr(n),s=wf(t,n,s,l,void 0,f),l=kf(),t!==null&&!nn?(Ef(t,n,f),Na(t,n,f)):(it&&l&&mc(n),n.flags|=1,un(t,n,s,f),n.child)}function Ub(t,n,s,l,f,m){return zr(n),n.updateQueue=null,s=Hx(n,l,s,f),$x(t),l=kf(),t!==null&&!nn?(Ef(t,n,m),Na(t,n,m)):(it&&l&&mc(n),n.flags|=1,un(t,n,s,m),n.child)}function Bb(t,n,s,l,f){if(zr(n),n.stateNode===null){var m=bs,w=s.contextType;typeof w=="object"&&w!==null&&(m=wn(w)),m=new s(l,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=If,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=l,m.state=n.memoizedState,m.refs={},ff(n),w=s.contextType,m.context=typeof w=="object"&&w!==null?wn(w):bs,m.state=n.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Lf(n,s,w,l),m.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(w=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),w!==m.state&&If.enqueueReplaceState(m,m.state,null),Il(n,l,m,f),Ll(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(t===null){m=n.stateNode;var E=n.memoizedProps,U=Pr(s,E);m.props=U;var V=m.context,ee=s.contextType;w=bs,typeof ee=="object"&&ee!==null&&(w=wn(ee));var oe=s.getDerivedStateFromProps;ee=typeof oe=="function"||typeof m.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,ee||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(E||V!==w)&&_b(n,m,l,w),Za=!1;var q=n.memoizedState;m.state=q,Il(n,l,m,f),Ll(),V=n.memoizedState,E||q!==V||Za?(typeof oe=="function"&&(Lf(n,s,oe,l),V=n.memoizedState),(U=Za||Nb(n,s,U,l,q,V,w))?(ee||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(n.flags|=4194308)):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=V),m.props=l,m.state=V,m.context=w,l=U):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{m=n.stateNode,pf(t,n),w=n.memoizedProps,ee=Pr(s,w),m.props=ee,oe=n.pendingProps,q=m.context,V=s.contextType,U=bs,typeof V=="object"&&V!==null&&(U=wn(V)),E=s.getDerivedStateFromProps,(V=typeof E=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w!==oe||q!==U)&&_b(n,m,l,U),Za=!1,q=n.memoizedState,m.state=q,Il(n,l,m,f),Ll();var J=n.memoizedState;w!==oe||q!==J||Za||t!==null&&t.dependencies!==null&&xc(t.dependencies)?(typeof E=="function"&&(Lf(n,s,E,l),J=n.memoizedState),(ee=Za||Nb(n,s,ee,l,q,J,U)||t!==null&&t.dependencies!==null&&xc(t.dependencies))?(V||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,J,U),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,J,U)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof m.componentDidUpdate!="function"||w===t.memoizedProps&&q===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&q===t.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=J),m.props=l,m.state=J,m.context=U,l=ee):(typeof m.componentDidUpdate!="function"||w===t.memoizedProps&&q===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&q===t.memoizedState||(n.flags|=1024),l=!1)}return m=l,Cs(t,n),l=(n.flags&128)!==0,m||l?(m=n.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,t!==null&&l?(n.child=$r(n,t.child,null,f),n.child=$r(n,null,s,f)):un(t,n,s,f),n.memoizedState=m.state,t=n.child):t=Na(t,n,f),t}function $b(t,n,s,l){return Mr(),n.flags|=256,un(t,n,s,l),n.child}var Hf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pf(t){return{baseLanes:t,cachePool:Ax()}}function Ff(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=ii),t}function Hb(t,n,s){var l=n.pendingProps,f=!1,m=(n.flags&128)!==0,w;if((w=m)||(w=t!==null&&t.memoizedState===null?!1:(En.current&2)!==0),w&&(f=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,t===null){if(it){if(f?er(n):tr(),(t=It)?(t=c1(t,mi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ga!==null?{id:Fi,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},s=vx(t),s.return=n,n.child=s,mn=n,It=null)):t=null,t===null)throw Ka(n);return Pp(t)?n.lanes=32:n.lanes=536870912,null}return m=l.children,l=l.fallback,f?(tr(),f=n.mode,m=Ic({mode:"hidden",children:m},f),l=Or(l,f,s,null),m.return=n,l.return=n,m.sibling=l,n.child=m,l=n.child,l.memoizedState=Pf(s),l.childLanes=Ff(t,w,s),n.memoizedState=Hf,Pl(null,l)):(er(n),qf(n,m))}var E=t.memoizedState;if(E!==null){var U=E.dehydrated;if(U!==null)return o_(t,n,m,w,l,U,E,s)}return f?(tr(),f=l.fallback,m=n.mode,E=t.child,U=E.sibling,l=ba(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&1206910976,U!==null?f=ba(U,f):(f=Or(f,m,s,null),f.flags|=2),f.return=n,l.return=n,l.sibling=f,n.child=l,Pl(null,l),l=n.child,f=t.child.memoizedState,f===null?f=Pf(s):(m=f.cachePool,m!==null?(E=en._currentValue,m=m.parent!==E?{parent:E,pool:E}:m):m=Ax(),f={baseLanes:f.baseLanes|s,cachePool:m}),l.memoizedState=f,l.childLanes=Ff(t,w,s),n.memoizedState=Hf,Pl(t.child,l)):(er(n),s=t.child,t=s.sibling,s=ba(s,{mode:"visible",children:l.children}),s.return=n,s.sibling=null,t!==null&&(w=n.deletions,w===null?(n.deletions=[t],n.flags|=16):w.push(t)),n.child=s,n.memoizedState=null,s)}function qf(t,n){return n=Ic({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Ic(t,n){return t=Gn(22,t,null,n),t.lanes=0,t}function Uc(t,n,s){return $r(n,t.child,null,s),t=qf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function o_(t,n,s,l,f,m,w,E){if(s)return n.flags&256?(er(n),n.flags&=-257,Uc(t,n,E)):n.memoizedState!==null?(tr(),n.child=t.child,n.flags|=128,null):(tr(),m=f.fallback,w=n.mode,f=Ic({mode:"visible",children:f.children},w),m=Or(m,w,E,null),m.flags|=2,f.return=n,m.return=n,f.sibling=m,n.child=f,$r(n,t.child,null,E),f=n.child,f.memoizedState=Pf(E),f.childLanes=Ff(t,l,E),n.memoizedState=Hf,Pl(null,f));if(er(n),Pp(m)){if(l=m.nextSibling&&m.nextSibling.dataset,l)var U=l.dgst;return l=U,l!==""&&(f=Error(r(419)),f.stack="",f.digest=l,jl({value:f,source:null,stack:null})),Uc(t,n,E)}if(nn||Dr(t,n,E,!1),l=(E&t.childLanes)!==0,nn||l){if(Wa.current!==null)return Uc(t,n,E);if(l=Dt,l!==null&&(f=xl(l,E),f!==0&&f!==w.retryLane))throw w.retryLane=f,jr(t,f),Xn(l,t,f),Bf;return Hp(m)||nu(),Uc(t,n,E)}return Hp(m)?(n.flags|=192,n.child=t.child,null):(t=w.treeContext,It=gi(m.nextSibling),mn=n,it=!0,Ya=null,mi=!1,t!==null&&Ex(n,t),n=qf(n,f.children),n.flags|=134221824,n)}function Pb(t,n,s){t.lanes|=n;var l=t.alternate;l!==null&&(l.lanes|=n),gc(t.return,n,s)}function Fb(t){for(var n=null;t!==null;){var s=t.alternate;s!==null&&_c(s)===null&&(n=t),t=t.sibling}return n}function Bc(t,n,s,l,f,m){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:f,treeForkCount:m}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=l,w.tail=s,w.tailMode=f,w.treeForkCount=m)}function Gf(t){var n=t.child;for(t.child=null;n!==null;){var s=n.sibling;n.sibling=t.child,t.child=n,n=s}}function Yf(t,n,s){var l=n.pendingProps,f=l.revealOrder,m=l.tail;l=l.children;var w=En.current;if(n.flags&128)return Ul(n,w),null;var E=(w&2)!==0;if(E?(w=w&1|2,n.flags|=128):w&=1,Ul(n,w),f==="backwards"&&t!==null?(Gf(t),un(t,n,l,s),Gf(t)):un(t,n,l,s),l=it?Al:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Pb(t,s,n);else if(t.tag===19)Pb(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"backwards":s=Fb(n.child),s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null,Gf(n)),Bc(n,!0,f,null,m,l);break;case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&_c(t)===null){n.child=f;break}t=f.sibling,f.sibling=s,s=f,f=t}Bc(n,!0,s,null,m,l);break;case"together":Bc(n,!1,null,null,void 0,l);break;case"independent":n.memoizedState=null;break;default:s=Fb(n.child),s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),Bc(n,!1,f,s,m,l)}return n.child}function qb(t,n,s){var l=n.pendingProps;return Va(n,n.type,l.value),un(t,n,l.children,s),n.child}function Na(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),rr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(Dr(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,s=ba(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=ba(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Kf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&xc(t)))}function c_(t,n,s){switch(n.tag){case 3:qe(n,n.stateNode.containerInfo),Va(n,en,t.memoizedState.cache),Mr();break;case 27:case 5:xt(n);break;case 4:qe(n,n.stateNode.containerInfo);break;case 10:Va(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,bf(n),null;break;case 13:var l=n.memoizedState;if(l!==null){if(l.dehydrated!==null)return er(n),n.flags|=128,null;l=Dr(t,n,s,!1);var f=n.child.childLanes;return l||(s&f)!==0?Hb(t,n,s):(er(n),t=Na(t,n,s),t!==null?t.sibling:null)}er(n);break;case 19:if(n.flags&128)return Yf(t,n,s);if(f=(t.flags&128)!==0,l=(s&n.childLanes)!==0,l||(Dr(t,n,s,!1),l=(s&n.childLanes)!==0),f){if(l)return Yf(t,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ul(n,En.current),l)break;return null;case 22:return n.lanes=0,zb(t,n,s,n.pendingProps);case 24:Va(n,en,t.memoizedState.cache)}return Na(t,n,s)}function Gb(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)nn=!0;else{if(!Kf(t,s)&&(n.flags&128)===0)return nn=!1,c_(t,n,s);nn=(t.flags&131072)!==0}else nn=!1,it&&(n.flags&1048576)!==0&&kx(n,Al,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(t=Ur(n.elementType),n.type=t,typeof t=="function")Wd(t)?(l=Pr(t,l),n.tag=1,n=Bb(null,n,t,l,s)):(n.tag=0,n=$f(null,n,t,l,s));else{if(t!=null){var f=t.$$typeof;if(f===O){n.tag=11,n=Mb(null,n,t,l,s);break e}else if(f===G){n.tag=14,n=Rb(null,n,t,l,s);break e}else if(f===ae){n.tag=10,n.type=t,n=qb(null,n,s);break e}}throw n=He(t)||t,Error(r(306,n,""))}}return n;case 0:return $f(t,n,n.type,n.pendingProps,s);case 1:return l=n.type,f=Pr(l,n.pendingProps),Bb(t,n,l,f,s);case 3:e:{if(qe(n,n.stateNode.containerInfo),t===null)throw Error(r(387));l=n.pendingProps;var m=n.memoizedState;f=m.element,pf(t,n),Il(n,l,null,s);var w=n.memoizedState;if(l=w.cache,Va(n,en,l),l!==m.cache&&lf(n,[en],s,!0),Ll(),l=w.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=$b(t,n,l,s);break e}else if(l!==f){f=di(Error(r(424)),n),jl(f),n=$b(t,n,l,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,It=gi(t.firstChild),mn=n,it=!0,Ya=null,mi=!0,s=zx(n,null,l,s),n.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling;else{if(Mr(),l===f){n=Na(t,n,s);break e}un(t,n,l,s)}n=n.child}return n;case 26:return Cs(t,n),t===null?(s=g1(n.type,null,n.pendingProps,null))?n.memoizedState=s:it||(n.stateNode=Xy(n.type,n.pendingProps,xn.current,n)):n.memoizedState=g1(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return xt(n),t===null&&it&&(l=n.stateNode=f1(n.type,n.pendingProps,xn.current),mn=n,mi=!0,f=It,cr(n.type)?(Fp=f,It=gi(l.firstChild)):It=f),un(t,n,n.pendingProps.children,s),Cs(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&it&&((f=l=It)&&(l=iS(l,n.type,n.pendingProps,mi),l!==null?(n.stateNode=l,mn=n,It=gi(l.firstChild),mi=!1,f=!0):f=!1),f||Ka(n)),xt(n),f=n.type,m=n.pendingProps,w=t!==null?t.memoizedProps:null,l=m.children,Dp(f,m)?l=null:w!==null&&Dp(f,w)&&(n.flags|=32),n.memoizedState!==null&&(f=wf(t,n,JN,null,null,s),Ys._currentValue=f),Cs(t,n),un(t,n,l,s),n.child;case 6:return t===null&&it&&((t=s=It)&&(s=aS(s,n.pendingProps,mi),s!==null?(n.stateNode=s,mn=n,It=null,t=!0):t=!1),t||Ka(n)),null;case 13:return Hb(t,n,s);case 4:return qe(n,n.stateNode.containerInfo),l=n.pendingProps,t===null?n.child=$r(n,null,l,s):un(t,n,l,s),n.child;case 11:return Mb(t,n,n.type,n.pendingProps,s);case 7:return l=n.pendingProps,Cs(t,n),un(t,n,l,s),n.child;case 8:return un(t,n,n.pendingProps.children,s),n.child;case 12:return un(t,n,n.pendingProps.children,s),n.child;case 10:return qb(t,n,s);case 9:return f=n.type._context,l=n.pendingProps.children,zr(n),f=wn(f),l=l(f),n.flags|=1,un(t,n,l,s),n.child;case 14:return Rb(t,n,n.type,n.pendingProps,s);case 15:return Db(t,n,n.type,n.pendingProps,s);case 19:return Yf(t,n,s);case 31:return l_(t,n,s);case 22:return zb(t,n,s,n.pendingProps);case 24:return zr(n),l=wn(en),t===null?(f=uf(),f===null&&(f=Dt,m=of(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=s),f=m),n.memoizedState={parent:l,cache:f},ff(n),Va(n,en,f)):((t.lanes&s)!==0&&(pf(t,n),Il(n,null,null,s),Ll()),f=t.memoizedState,m=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Va(n,en,l)):(l=m.cache,Va(n,en,l),l!==f.cache&&lf(n,[en],s,!0))),un(t,n,n.pendingProps.children,s),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=n.pendingProps,l.name!=null&&l.name!=="auto"?n.flags|=t===null?18882560:18874368:it&&mc(n),t!==null&&t.memoizedProps.name!==l.name?n.flags|=4194816:Cs(t,n),un(t,n,l.children,s),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function _a(t){t.flags|=4}function Vf(t,n,s,l,f){var m;if((m=(t.mode&32)!==0)&&(m=s===null?v1(n,l):v1(n,l)&&(l.src!==s.src||l.srcSet!==s.srcSet)),m){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(Sy())t.flags|=8192;else throw Br=wc,df}else t.flags&=-16777217}function Yb(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!w1(n))if(Sy())t.flags|=8192;else throw Br=wc,df}function $c(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?gl():536870912,t.lanes|=n,Rs|=n)}function Fl(t,n){if(!it)switch(t.tailMode){case"visible":break;case"collapsed":for(var s=t.tail,l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null;break;default:for(n=t.tail,s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null}}function Ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(n)for(var f=t.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags&1206910976,l|=f.flags&1206910976,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=l,t.childLanes=s,n}function u_(t,n,s){var l=n.pendingProps;switch(nf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(n),null;case 1:return Ut(n),null;case 3:return s=n.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),wa(en),ht(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ws(n)?_a(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,rf())),Ut(n),null;case 26:var f=n.type,m=n.memoizedState;return t===null?(_a(n),m!==null?(Ut(n),Yb(n,m)):(Ut(n),Vf(n,f,null,l,s))):m?m!==t.memoizedState?(_a(n),Ut(n),Yb(n,m)):(Ut(n),n.flags&=-16777217):(t=t.memoizedProps,t!==l&&_a(n),Ut(n),Vf(n,f,t,l,s)),null;case 27:if(ln(n),s=xn.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==l&&_a(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return Ut(n),n.subtreeFlags&=-33554433,null}t=Gt.current,ws(n)?Nx(n):(t=f1(f,l,s),n.stateNode=t,_a(n))}return Ut(n),n.subtreeFlags&=-33554433,null;case 5:if(ln(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==l&&_a(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return Ut(n),n.subtreeFlags&=-33554433,null}if(m=Gt.current,ws(n))Nx(n);else{var w=eo(xn.current);switch(m){case 1:m=w.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=w.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=w.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?w.createElement("select",{is:l.is}):w.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?w.createElement(f,{is:l.is}):w.createElement(f)}}m[cn]=n,m[ge]=l;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)m.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=m;e:switch(_n(m,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&_a(n)}}return Ut(n),n.subtreeFlags&=-33554433,Vf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==l&&_a(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(t=xn.current,ws(n)){if(t=n.stateNode,s=n.memoizedProps,l=null,f=mn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[cn]=n,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Gy(t.nodeValue,s)),t||Ka(n,!0)}else t=eo(t).createTextNode(l),t[cn]=n,n.stateNode=t}return Ut(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(l=ws(n),s!==null){if(t===null){if(!l)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[cn]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),t=!1}else s=rf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(ei(n),n):(ei(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Ut(n),null;case 13:if(l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ws(n),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[cn]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),f=!1}else f=rf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(ei(n),n):(ei(n),null)}return ei(n),(n.flags&128)!==0?(n.lanes=s,n):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),$c(n,n.updateQueue),Ut(n),null);case 4:return ht(),t===null&&Ap(n.stateNode.containerInfo),n.flags|=67108864,Ut(n),null;case 10:return wa(n.type),Ut(n),null;case 19:if(yf(n),l=n.memoizedState,l===null)return Ut(n),null;if(f=(n.flags&128)!==0,m=l.rendering,m===null)if(f)Fl(l,!1);else{if(Ft!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=_c(t),m!==null){for(n.flags|=128,Fl(l,!1),t=m.updateQueue,n.updateQueue=t,$c(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)yx(s,t),s=s.sibling;return Ul(n,En.current&1|2),it&&ya(n,l.treeForkCount),n.child}t=t.sibling}l.tail!==null&&Zt()>Jc&&(n.flags|=128,f=!0,Fl(l,!1),n.lanes=4194304)}else{if(!f)if(t=_c(m),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,$c(n,t),Fl(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!m.alternate&&!it)return Ut(n),null}else 2*Zt()-l.renderingStartTime>Jc&&s!==536870912&&(n.flags|=128,f=!0,Fl(l,!1),n.lanes=4194304);l.isBackwards?(m.sibling=n.child,n.child=m):(t=l.last,t!==null?t.sibling=m:n.child=m,l.last=m)}if(l.tail!==null){t=l.tail;e:{for(s=t;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Zt(),t.sibling=null,m=En.current,m=f?m&1|2:m&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!s||it?Ul(n,m):(s=m,Je(kn,n),Je(En,s),jn===null&&(jn=n)),it&&ya(n,l.treeForkCount),t}return Ut(n),null;case 22:case 23:return ei(n),xf(),l=n.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(s&536870912)!==0&&(n.flags&128)===0&&(Ut(n),n.subtreeFlags&6&&(n.flags|=8192)):Ut(n),s=n.updateQueue,s!==null&&$c(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==s&&(n.flags|=2048),t!==null&&mt(Ir),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),wa(en),Ut(n),null;case 25:return null;case 30:return n.flags|=33554432,Ut(n),null}throw Error(r(156,n.tag))}function d_(t,n){switch(nf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return wa(en),ht(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return ln(n),null;case 31:if(n.memoizedState!==null){if(ei(n),n.alternate===null)throw Error(r(340));Mr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(ei(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Mr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return yf(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return ht(),null;case 10:return wa(n.type),null;case 22:case 23:return ei(n),xf(),t!==null&&mt(Ir),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return wa(en),null;case 25:return null;default:return null}}function Kb(t,n){switch(nf(n),n.tag){case 3:wa(en),ht();break;case 26:case 27:case 5:ln(n);break;case 4:ht();break;case 31:n.memoizedState!==null&&ei(n);break;case 13:ei(n);break;case 19:yf(n);break;case 10:wa(n.type);break;case 22:case 23:ei(n),xf(),t!==null&&mt(Ir);break;case 24:wa(en)}}function ql(t,n){try{var s=n.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&t)===t){l=void 0;var m=s.create,w=s.inst;l=m(),w.destroy=l}s=s.next}while(s!==f)}}catch(E){Tt(n,n.return,E)}}function nr(t,n,s){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&t)===t){var w=l.inst,E=w.destroy;if(E!==void 0){w.destroy=void 0,f=n;var U=s,V=E;try{V()}catch(ee){Tt(f,U,ee)}}}l=l.next}while(l!==m)}}catch(ee){Tt(n,n.return,ee)}}function Vb(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Ix(n,s)}catch(l){Tt(t,t.return,l)}}}function Xb(t,n,s){s.props=Pr(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){Tt(t,n,l)}}function Gi(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:var f=t.stateNode,m=ga(t.memoizedProps,f);(f.ref===null||f.ref.name!==m)&&(f.ref=n1(m)),l=f.ref;break;case 7:if(t.stateNode===null){var w=new ri(t);b(t.child,!1,tS,w,void 0,void 0),t.stateNode=w}l=t.stateNode;break;default:l=t.stateNode}typeof s=="function"?t.refCleanup=s(l):s.current=l}}catch(E){Tt(t,n,E)}}function Nn(t,n){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){Tt(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Tt(t,n,f)}else s.current=null}function Hc(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var s=0;s<n.length;s++)o1(t.stateNode,n[s])}function Zb(t){for(var n=t.return;n!==null&&(Zf(n)&&o1(t.stateNode,n.stateNode),!Xf(n));)n=n.return}function Gl(t){for(var n=t.return;n!==null&&(Zf(n)&&nS(t.stateNode,n.stateNode),!Xf(n));)n=n.return}function Xf(t){return t.tag===5||t.tag===3||t.tag===27}function Zf(t){return t&&t.tag===7&&t.stateNode!==null}function Qf(t){var n=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){Tt(t,t.return,f)}}function Jf(t,n,s){try{var l=t.stateNode;I_(l,t.type,s,n),l[ge]=n}catch(f){Tt(t,t.return,f)}}function Qb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cr(t.type)||t.tag===4}function Wf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&cr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ep(t,n,s,l){var f=t.tag;if(f===5||f===6)f=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(f,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(f),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Pi)),Hc(t,l),pt=!0;else if(f!==4&&(f===27&&(Hc(t,l),l=null,cr(t.type)&&(s=t.stateNode,n=null)),t=t.child,t!==null))for(ep(t,n,s,l),t=t.sibling;t!==null;)ep(t,n,s,l),t=t.sibling}function Pc(t,n,s,l){var f=t.tag;if(f===5||f===6)f=t.stateNode,n?s.insertBefore(f,n):s.appendChild(f),Hc(t,l),pt=!0;else if(f!==4&&(f===27&&(Hc(t,l),l=null,cr(t.type)&&(s=t.stateNode)),t=t.child,t!==null))for(Pc(t,n,s,l),t=t.sibling;t!==null;)Pc(t,n,s,l),t=t.sibling}function Jb(t){var n=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);_n(n,l,s),n[cn]=t,n[ge]=s}catch(m){Tt(t,t.return,m)}}var Fc=!1,ti=null;function Wb(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(Fc=!0)}var Yi=null;function ey(){var t=Yi;return Yi=null,t}var Yn=0;function As(t,n,s,l,f){return Yn=0,ty(t.child,n,s,l,f)}function ty(t,n,s,l,f){for(var m=!1;t!==null;){if(t.tag===5){var w=t.stateNode;if(l!==null){var E=Ip(w);l.push(E),E.view&&(m=!0)}else m||Ip(w).view&&(m=!0);Fc=!0,e1(w,Yn===0?n:n+"_"+Yn,s),Yn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f||ty(t.child,n,s,l,f)&&(m=!0));t=t.sibling}return m}function Ki(t,n){for(;t!==null;)t.tag===5?t1(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Ki(t.child,n)),t=t.sibling}function qc(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(qc(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(r(544));var s=n.name;n=xa(n.default,n.share),n!=="none"&&(As(t,s,n,null,!1)||Ki(t.child,!1))}t=t.sibling}}function tp(t,n){if(t.tag===30){var s=t.stateNode,l=t.memoizedProps,f=ga(l,s),m=xa(l.default,s.paired?l.share:l.enter);m!=="none"?As(t,f,m,null,!1)?(qc(t),s.paired||n||Is(t,l.onEnter)):Ki(t.child,!1):qc(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)tp(t,n),t=t.sibling;else qc(t)}function np(t){if(ti!==null&&ti.size!==0){var n=ti;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var s=t.memoizedProps,l=s.name;if(l!=null&&l!=="auto"){var f=n.get(l);if(f!==void 0){var m=xa(s.default,s.share);if(m!=="none"&&(As(t,l,m,null,!1)?(m=t.stateNode,f.paired=m,m.paired=f,Is(t,s.onShare)):Ki(t.child,!1)),n.delete(l),n.size===0)break}}}np(t)}t=t.sibling}}}function ip(t){if(t.tag===30){var n=t.memoizedProps,s=ga(n,t.stateNode),l=ti!==null?ti.get(s):void 0,f=xa(n.default,l!==void 0?n.share:n.exit);f!=="none"&&(As(t,s,f,null,!1)?l!==void 0?(f=t.stateNode,l.paired=f,f.paired=l,ti.delete(s),Is(t,n.onShare)):Is(t,n.onExit):Ki(t.child,!1)),ti!==null&&np(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)ip(t),t=t.sibling;else ti!==null&&np(t)}function ny(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,s=ga(n,t.stateNode);n=xa(n.default,n.update),t.flags&=-5,n!=="none"&&As(t,s,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&ny(t);t=t.sibling}}function ap(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,Ki(t.child,!1))}ap(t)}t=t.sibling}}function Gc(t){if(t.tag===30)t.stateNode.paired=null,Ki(t.child,!1),ap(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Gc(t),t=t.sibling;else ap(t)}function iy(t){for(t=t.child;t!==null;)t.tag===30?Ki(t.child,!1):(t.subtreeFlags&33554432)!==0&&iy(t),t=t.sibling}function rp(t,n,s,l,f,m,w){for(var E=!1;n!==null;){if(n.tag===5){var U=n.stateNode;if(m!==null&&Yn<m.length){var V=m[Yn],ee=Ip(U);(V.view||ee.view)&&(E=!0);var oe;if(oe=(t.flags&4)===0)if(ee.clip)oe=!0;else{oe=V.rect;var q=ee.rect;oe=oe.y!==q.y||oe.x!==q.x||oe.height!==q.height||oe.width!==q.width}oe&&(t.flags|=4),ee.abs?ee=!V.abs:(V=V.rect,ee=ee.rect,ee=V.height!==ee.height||V.width!==ee.width),ee&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&e1(U,Yn===0?s:s+"_"+Yn,f),E&&(t.flags&4)!==0||(Yi===null&&(Yi=[]),Yi.push(U,Yn===0?l:l+"_"+Yn,n.memoizedProps)),Yn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&w?t.flags|=n.flags&32:rp(t,n.child,s,l,f,m,w)&&(E=!0));n=n.sibling}return E}function ay(t,n){for(t=t.child;t!==null;){if(t.tag===30){var s=t.memoizedProps,l=t.stateNode,f=ga(s,l),m=xa(s.default,s.update),w;w=t.memoizedState,t.memoizedState=null,l=t;var E=t.child;Yn=0,f=rp(l,E,f,f,m,w,!1),(t.flags&4)!==0&&f&&Is(t,s.onUpdate)}else(t.subtreeFlags&33554432)!==0&&ay(t);t=t.sibling}}var hn=!1,Et=!1,Vi=!1,sp=!1,ry=typeof WeakSet=="function"?WeakSet:Set,gn=null,Xi=!1,Yl=!1,Yc=!1,lp=!1;function f_(t,n,s){if(t=t.containerInfo,Mp=Ks,t=cx(t),Yd(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var m=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{l.nodeType,w.nodeType}catch{l=null;break e}var E=0,U=-1,V=-1,ee=0,oe=0,q=t,J=null;t:for(;;){for(var we;q!==l||m!==0&&q.nodeType!==3||(U=E+m),q!==w||f!==0&&q.nodeType!==3||(V=E+f),q.nodeType===3&&(E+=q.nodeValue.length),(we=q.firstChild)!==null;)J=q,q=we;for(;;){if(q===t)break t;if(J===l&&++ee===m&&(U=E),J===w&&++oe===f&&(V=E),(we=q.nextSibling)!==null)break;q=J,J=q.parentNode}q=we}l=U===-1||V===-1?null:{start:U,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(Rp={focusedElem:t,selectionRange:l},Ks=!1,s=(s&335544064)===s,gn=n,n=s?9270:1024;gn!==null;){if(t=gn,s&&(l=t.deletions,l!==null))for(m=0;m<l.length;m++)s&&ip(l[m]);if(t.alternate===null&&(t.flags&2)!==0)s&&Wb(t),Kc(s);else{if(t.tag===22){if(l=t.alternate,t.memoizedState!==null){l!==null&&l.memoizedState===null&&s&&ip(l),Kc(s);continue}else if(l!==null&&l.memoizedState!==null){s&&Wb(t),Kc(s);continue}}l=t.child,(t.subtreeFlags&n)!==0&&l!==null?(l.return=t,gn=l):(s&&ny(t),Kc(s))}}ti=null}function Kc(t){for(;gn!==null;){var n=gn,s=t,l=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&l!==null){s=void 0,f=l.memoizedProps,l=l.memoizedState;var m=n.stateNode;try{var w=Pr(n.type,f);s=m.getSnapshotBeforeUpdate(w,l),m.__reactInternalSnapshotBeforeUpdate=s}catch(E){Tt(n,n.return,E)}}break;case 3:if((f&1024)!==0){if(l=n.stateNode.containerInfo,s=l.nodeType,s===9)$p(l);else if(s===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":$p(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&l!==null&&(s=ga(l.memoizedProps,l.stateNode),f=n.memoizedProps,f=xa(f.default,f.update),f!=="none"&&As(l,s,f,l.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(r(163))}if(l=n.sibling,l!==null){l.return=n.return,gn=l;break}gn=n.return}}function sy(t,n,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Zi(t,s),l&4&&ql(5,s);break;case 1:if(Zi(t,s),l&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(w){Tt(s,s.return,w)}else{var f=Pr(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(w){Tt(s,s.return,w)}}l&64&&Vb(s),l&512&&Gi(s,s.return);break;case 3:if(Zi(t,s),l&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Ix(t,n)}catch(w){Tt(s,s.return,w)}}break;case 27:n===null&&l&4&&Jb(s);case 26:case 5:Zi(t,s),n===null&&l&4&&Qf(s),l&512&&Gi(s,s.return);break;case 12:Zi(t,s);break;case 31:Zi(t,s),l&4&&uy(t,s);break;case 13:Zi(t,s),l&4&&dy(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=N_.bind(null,s),rS(t,s))));break;case 22:if(l=s.memoizedState!==null||hn,!l){var m=n!==null&&n.memoizedState!==null||Et;n=hn,f=Et,hn=l,(Et=m)&&!f?(l=2,(s.subtreeFlags&8772)!==0&&(l|=1),ji(t,s,l)):Zi(t,s),hn=n,Et=f}break;case 30:Zi(t,s),l&512&&Gi(s,s.return);break;case 7:l&512&&Gi(s,s.return);default:Zi(t,s)}}function op(t,n){for(t=t.child;t!==null;)ly(t,n),t=t.sibling}function ly(t,n){switch(t.tag){case 5:case 26:try{var s=t.stateNode;if(n){var l=s.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var f=t.stateNode,m=t.memoizedProps.style,w=m!=null&&m.hasOwnProperty("display")?m.display:null;f.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(U){Tt(t,t.return,U)}cp(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,pt=!0}catch(U){Tt(t,t.return,U)}break;case 18:try{var E=t.stateNode;n?Wy(E,!0):Wy(t.stateNode,!1)}catch(U){Tt(t,t.return,U)}break;case 22:case 23:t.memoizedState===null&&op(t,n);break;default:op(t,n)}}function cp(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var s=t,l=n;switch(s.tag){case 4:ly(s,l);break e;case 22:s.memoizedState===null&&cp(s,l);break e;default:cp(s,l)}}t=t.sibling}}function oy(t){var n=t.alternate;n!==null&&(t.alternate=null,oy(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&fn(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Bt=null,Kn=!1;function Ci(t,n,s){for(s=s.child;s!==null;)cy(t,n,s),s=s.sibling}function cy(t,n,s){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Rt,s)}catch{}switch(s.tag){case 26:Et||Nn(s,n),Ci(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Et&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Et||Nn(s,n),Gl(s);var l=Bt,f=Kn;cr(s.type)&&(Bt=s.stateNode,Kn=!1),Ci(t,n,s),p1(s.stateNode,s.type,s.memoizedProps),Bt=l,Kn=f;break;case 5:Et||Nn(s,n),Gl(s);case 6:if(s.tag===6&&Gl(s),l=Bt,f=Kn,Bt=null,Ci(t,n,s),Bt=l,Kn=f,Bt!==null)if(Kn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(s.stateNode),pt=!0}catch(m){Tt(s,n,m)}else try{Bt.removeChild(s.stateNode),pt=!0}catch(m){Tt(s,n,m)}break;case 18:Bt!==null&&(Kn?(t=Bt,Jy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Vs(t)):Jy(Bt,s.stateNode));break;case 4:l=Bt,f=Kn,Bt=s.stateNode.containerInfo,Kn=!0,Ci(t,n,s),Bt=l,Kn=f;break;case 0:case 11:case 14:case 15:nr(2,s,n),Et||nr(4,s,n),Ci(t,n,s);break;case 1:Et||(Nn(s,n),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Xb(s,n,l)),Ci(t,n,s);break;case 21:Ci(t,n,s);break;case 22:Et=(l=Et)||s.memoizedState!==null,Ci(t,n,s),Et=l;break;case 30:Nn(s,n),Ci(t,n,s);break;case 7:Et||Nn(s,n),Ci(t,n,s);break;default:Ci(t,n,s)}}function uy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vs(t)}catch(s){Tt(n,n.return,s)}}}function dy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vs(t)}catch(s){Tt(n,n.return,s)}}function p_(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new ry),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new ry),n;default:throw Error(r(435,t.tag))}}function Vc(t,n){var s=p_(t);n.forEach(function(l){if(!s.has(l)){s.add(l);var f=__.bind(null,t,l);l.then(f,f)}})}function Un(t,n,s){var l=n.deletions;if(l!==null)for(var f=0;f<l.length;f++){var m=l[f],w=t,E=n,U=E;e:for(;U!==null;){switch(U.tag){case 27:if(cr(U.type)){Bt=U.stateNode,Kn=!1;break e}break;case 5:Bt=U.stateNode,Kn=!1;break e;case 3:case 4:Bt=U.stateNode.containerInfo,Kn=!0;break e}U=U.return}if(Bt===null)throw Error(r(160));cy(w,E,m),Bt=null,Kn=!1,w=m.alternate,w!==null&&(w.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)fy(n,t,s),n=n.sibling}var Ai=null;function fy(t,n,s){var l=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(f&4&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(var m=0;m<l.length;m++){var w=l[m];w.ref.impl=w.nextImpl}Un(n,t,s),Bn(t),f&4&&(nr(3,t,t.return),ql(3,t),nr(5,t,t.return));break;case 1:Un(n,t,s),Bn(t),f&512&&(Et||l===null||Nn(l,l.return)),f&64&&hn&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:if(m=Ai,Un(n,t,s),Bn(t),f&512&&(Et||l===null||Nn(l,l.return)),f&4)if(f=l!==null?l.memoizedState:null,s=t.memoizedState,l===null)if(s===null)if(t.stateNode===null)if(hn)t.stateNode=Xy(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,s=t.memoizedProps,f=m.ownerDocument||m;t:switch(n){case"title":l=f.getElementsByTagName("title")[0],(!l||l[qn]||l[cn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=f.createElement(n),f.head.insertBefore(l,f.querySelector("head > title"))),_n(l,n,s),l[cn]=t,Jt(l),n=l;break e;case"link":if(m=y1("link","href",f).get(n+(s.href||""))){for(w=0;w<m.length;w++)if(l=m[w],l.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&l.getAttribute("rel")===(s.rel==null?null:s.rel)&&l.getAttribute("title")===(s.title==null?null:s.title)&&l.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){m.splice(w,1);break t}}l=f.createElement(n),_n(l,n,s),f.head.appendChild(l);break;case"meta":if(m=y1("meta","content",f).get(n+(s.content||""))){for(w=0;w<m.length;w++)if(l=m[w],l.getAttribute("content")===(s.content==null?null:""+s.content)&&l.getAttribute("name")===(s.name==null?null:s.name)&&l.getAttribute("property")===(s.property==null?null:s.property)&&l.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&l.getAttribute("charset")===(s.charSet==null?null:s.charSet)){m.splice(w,1);break t}}l=f.createElement(n),_n(l,n,s),f.head.appendChild(l);break;default:throw Error(r(468,n))}l[cn]=t,Jt(l),n=l}t.stateNode=n}else hn||Kp(m,t.type,t.stateNode);else t.stateNode=b1(m,s,t.memoizedProps);else f!==s?(f===null?(n=l.stateNode,n===null||Et||n.parentNode.removeChild(n)):f.count--,s===null?hn||Kp(m,t.type,t.stateNode):b1(m,s,t.memoizedProps)):s===null&&t.stateNode!==null&&Jf(t,t.memoizedProps,l.memoizedProps);break;case 27:Un(n,t,s),Bn(t),f&512&&(Et||l===null||Nn(l,l.return)),l!==null&&f&4&&Jf(t,t.memoizedProps,l.memoizedProps);break;case 5:if(m=Vi,Vi=!1,Un(n,t,s),Vi=m,Bn(t),f&512&&(Et||l===null||Nn(l,l.return)),t.flags&32){n=t.stateNode;try{ds(n,""),pt=!0}catch(ee){Tt(t,t.return,ee)}}f&4&&t.stateNode!=null&&(n=t.memoizedProps,Jf(t,n,l!==null?l.memoizedProps:n)),f&1024&&(sp=!0);break;case 6:if(Un(n,t,s),Bn(t),f&4){if(t.stateNode===null)throw Error(r(162));n=t.memoizedProps,s=t.stateNode;try{s.nodeValue=n,pt=!0}catch(ee){Tt(t,t.return,ee)}}break;case 3:if(pt=!1,cu=null,m=Ai,Ai=to(n.containerInfo),Un(n,t,s),Ai=m,Bn(t),f&4&&l!==null&&l.memoizedState.isDehydrated)try{Vs(n.containerInfo)}catch(ee){Tt(t,t.return,ee)}sp&&(sp=!1,py(t)),pt=!1;break;case 4:f=Vi,Vi=hn,l=Wt(),m=Ai,Ai=to(t.stateNode.containerInfo),Un(n,t,s),Bn(t),Ai=m,pt&&Yl&&(Yc=!0),pt=l,Vi=f;break;case 12:Un(n,t,s),Bn(t);break;case 31:Un(n,t,s),Bn(t),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Vc(t,n)));break;case 13:Un(n,t,s),Bn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Qc=Zt()),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Vc(t,n)));break;case 22:m=t.memoizedState!==null,w=l!==null&&l.memoizedState!==null;var E=hn,U=Et,V=Vi;hn=E||m,Vi=V||m,Et=U||w,Un(n,t,s),Et=U,Vi=V,hn=E,Bn(t),f&8192&&(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,!m||l===null||w||hn||Et||(n=w||Et,s=hn,l=Et,hn=m||hn,Et=n,ir(t,2),hn=s,Et=l),!m&&Vi||op(t,m)),f&4&&(n=t.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Vc(t,s))));break;case 19:Un(n,t,s),Bn(t),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Vc(t,n)));break;case 30:f&512&&(Et||l===null||Nn(l,l.return)),f=Wt(),m=Yl,w=(s&335544064)===s,E=t.memoizedProps,Yl=w&&xa(E.default,E.update)!=="none",Un(n,t,s),Bn(t),w&&l!==null&&pt&&(t.flags|=4),Yl=m,pt=f;break;case 21:break;case 7:f&512&&(Et||l===null||Nn(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=t);default:Un(n,t,s),Bn(t)}}function Bn(t){var n=t.flags;if(n&2){try{for(var s,l=t.return;l!==null;){if(Qb(l)){s=l;break}l=l.return}l=null;for(var f=t.return;f!==null;){if(Zf(f)){var m=f.stateNode;l===null?l=[m]:l.push(m)}if(Xf(f))break;f=f.return}var w=l;if(s==null)throw Error(r(160));switch(s.tag){case 27:var E=s.stateNode,U=Wf(t);Pc(t,U,E,w);break;case 5:var V=s.stateNode;s.flags&32&&(ds(V,""),s.flags&=-33);var ee=Wf(t);Pc(t,ee,V,w);break;case 3:case 4:var oe=s.stateNode.containerInfo,q=Wf(t);ep(t,q,oe,w);break;default:throw Error(r(161))}}catch(J){Tt(t,t.return,J)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function py(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;py(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Ks=!0,n.reset(),Ks=!1),t=t.sibling}}function js(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)my(n,t),n=n.sibling;else ay(n)}function my(t,n){var s=t.alternate;if(s===null)tp(t,!1);else switch(t.tag){case 3:if(lp=Xi=!1,ey(),js(n,t),!Xi&&!Yc){if(t=Yi,t!==null)for(var l=0;l<t.length;l+=3){s=t[l];var f=t[l+1];t1(s,t[l+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+f+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),lp=!0}Yi=null;break;case 5:js(n,t);break;case 4:l=Xi,Xi=!1,js(n,t),Xi&&(Yc=!0),Xi=l;break;case 22:t.memoizedState===null&&(s.memoizedState!==null?tp(t,!1):js(n,t));break;case 30:l=Xi,f=ey(),Xi=!1,js(n,t),Xi&&(t.flags|=4);var m=t.memoizedProps,w=t.stateNode;n=ga(m,w),w=ga(s.memoizedProps,w);var E=xa(m.default,m.update);E==="none"?n=!1:(m=s.memoizedState,s.memoizedState=null,s=t.child,Yn=0,n=rp(t,s,n,w,E,m,!0),Yn!==(m===null?0:m.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(Is(t,t.memoizedProps.onUpdate),Yi=f):f!==null&&(f.push.apply(f,Yi),Yi=f),Xi=(t.flags&32)!==0?!0:l;break;default:js(n,t)}}function Zi(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)sy(t,n.alternate,n),n=n.sibling}function ir(t,n){for(t=t.child;t!==null;){var s=t,l=n;switch(s.tag){case 0:case 11:case 14:case 15:nr(4,s,s.return),ir(s,l);break;case 1:Nn(s,s.return);var f=s.stateNode;typeof f.componentWillUnmount=="function"&&Xb(s,s.return,f),ir(s,l);break;case 27:(l&2)!==0&&p1(s.stateNode,s.type,s.memoizedProps);case 5:Nn(s,s.return),s.tag!==5&&s.tag!==27||Gl(s),ir(s,l);break;case 6:Gl(s);break;case 26:Nn(s,s.return),f=s.stateNode,s.memoizedState!==null||f===null||Et||f.parentNode.removeChild(f),ir(s,l);break;case 22:s.memoizedState===null&&ir(s,l);break;case 30:Nn(s,s.return),ir(s,l);break;case 7:Nn(s,s.return);default:ir(s,l)}t=t.sibling}}function ji(t,n,s){for(s=(n.subtreeFlags&8772)!==0?s:s&-2,n=n.child;n!==null;){var l=n.alternate,f=t,m=n,w=m.flags,E=(s&1)!==0;switch(m.tag){case 0:case 11:case 15:ji(f,m,s),ql(4,m);break;case 1:if(ji(f,m,s),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ee){Tt(l,l.return,ee)}if(l=m,f=l.updateQueue,f!==null){var U=l.stateNode;try{var V=f.shared.hiddenCallbacks;if(V!==null)for(f.shared.hiddenCallbacks=null,f=0;f<V.length;f++)Lx(V[f],U)}catch(ee){Tt(l,l.return,ee)}}E&&w&64&&Vb(m),Gi(m,m.return);break;case 27:(s&2)!==0&&Jb(m);case 5:m.tag!==5&&m.tag!==27||Zb(m),ji(f,m,s),E&&l===null&&w&4&&Qf(m),Gi(m,m.return);break;case 6:Zb(m);break;case 26:U=m.stateNode,m.memoizedState!==null||U===null||hn||Kp(to(U.ownerDocument),m.type,U),ji(f,m,s),E&&l===null&&w&4&&Qf(m),Gi(m,m.return);break;case 12:ji(f,m,s);break;case 31:ji(f,m,s),E&&w&4&&uy(f,m);break;case 13:ji(f,m,s),E&&w&4&&dy(f,m);break;case 22:m.memoizedState===null&&ji(f,m,s),Gi(m,m.return);break;case 30:ji(f,m,s),Gi(m,m.return);break;case 7:Gi(m,m.return);default:ji(f,m,s)}n=n.sibling}}function up(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Ol(s))}function dp(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ol(t))}function hi(t,n,s,l){var f=(s&335544064)===s;if(n.subtreeFlags&(f?10262:10256))for(n=n.child;n!==null;)hy(t,n,s,l),n=n.sibling;else f&&iy(n)}function hy(t,n,s,l){var f=(s&335544064)===s;f&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Gc(n);var m=n.flags;switch(n.tag){case 0:case 11:case 15:hi(t,n,s,l),m&2048&&ql(9,n);break;case 1:hi(t,n,s,l);break;case 3:hi(t,n,s,l),f&&lp&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),m&2048&&(m=null,n.alternate!==null&&(m=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==m&&(n.refCount++,m!=null&&Ol(m)));break;case 12:if(m&2048){hi(t,n,s,l),m=n.stateNode;try{var w=n.memoizedProps,E=w.id,U=w.onPostCommit;typeof U=="function"&&U(E,n.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(V){Tt(n,n.return,V)}}else hi(t,n,s,l);break;case 31:hi(t,n,s,l);break;case 13:hi(t,n,s,l);break;case 23:break;case 22:w=n.stateNode,E=n.alternate,n.memoizedState!==null?(f&&E!==null&&E.memoizedState===null&&Gc(E),w._visibility&2?hi(t,n,s,l):Kl(t,n)):(f&&E!==null&&E.memoizedState!==null&&Gc(n),w._visibility&2?hi(t,n,s,l):(w._visibility|=2,Os(t,n,s,l,(n.subtreeFlags&10256)!==0||!1))),m&2048&&up(E,n);break;case 24:hi(t,n,s,l),m&2048&&dp(n.alternate,n);break;case 30:f&&(m=n.alternate,m!==null&&(Ki(m.child,!0),Ki(n.child,!0))),hi(t,n,s,l);break;default:hi(t,n,s,l)}}function Os(t,n,s,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=t,w=n,E=s,U=l,V=w.flags;switch(w.tag){case 0:case 11:case 15:Os(m,w,E,U,f),ql(8,w);break;case 23:break;case 22:var ee=w.stateNode;w.memoizedState!==null?ee._visibility&2?Os(m,w,E,U,f):Kl(m,w):(ee._visibility|=2,Os(m,w,E,U,f)),f&&V&2048&&up(w.alternate,w);break;case 24:Os(m,w,E,U,f),f&&V&2048&&dp(w.alternate,w);break;default:Os(m,w,E,U,f)}n=n.sibling}}function Kl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,l=n,f=l.flags;switch(l.tag){case 22:Kl(s,l),f&2048&&up(l.alternate,l);break;case 24:Kl(s,l),f&2048&&dp(l.alternate,l);break;default:Kl(s,l)}n=n.sibling}}var Fr=8192;function qr(t,n,s){if(t.subtreeFlags&Fr)for(t=t.child;t!==null;)gy(t,n,s),t=t.sibling}function gy(t,n,s){switch(t.tag){case 26:qr(t,n,s),t.flags&Fr&&(t.memoizedState!==null?yS(s,Ai,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&E1(s,t)));break;case 5:qr(t,n,s),t.flags&Fr&&(t=t.stateNode,(n&335544128)===n&&E1(s,t));break;case 3:case 4:var l=Ai;Ai=to(t.stateNode.containerInfo),qr(t,n,s),Ai=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Fr,Fr=16777216,qr(t,n,s),Fr=l):qr(t,n,s));break;case 30:if((t.flags&Fr)!==0&&(l=t.memoizedProps.name,l!=null&&l!=="auto")){var f=t.stateNode;f.paired=null,ti===null&&(ti=new Map),ti.set(l,f)}qr(t,n,s);break;default:qr(t,n,s)}}function xy(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Vl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];gn=l,yy(l,t)}xy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)by(t),t=t.sibling}function by(t){switch(t.tag){case 0:case 11:case 15:Vl(t),t.flags&2048&&nr(9,t,t.return);break;case 3:Vl(t);break;case 12:Vl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Xc(t)):Vl(t);break;default:Vl(t)}}function Xc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];gn=l,yy(l,t)}xy(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:nr(8,n,n.return),Xc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Xc(n));break;default:Xc(n)}t=t.sibling}}function yy(t,n){for(;gn!==null;){var s=gn;switch(s.tag){case 0:case 11:case 15:nr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ol(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,gn=l;else e:for(s=t;gn!==null;){l=gn;var f=l.sibling,m=l.return;if(oy(l),l===s){gn=null;break e}if(f!==null){f.return=m,gn=f;break e}gn=m}}}var m_={getCacheForType:function(t){var n=wn(en),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return wn(en).controller.signal}},h_=typeof WeakMap=="function"?WeakMap:Map,wt=0,Dt=null,lt=null,ut=0,St=0,ni=null,ar=!1,Ms=!1,fp=!1,Sa=0,Ft=0,rr=0,Gr=0,Zc=0,ii=0,Rs=0,Xl=null,Vn=null,pp=!1,Qc=0,vy=0,Jc=1/0,Wc=null,sr=null,$t=0,Oi=null,Yr=null,Qi=0,mp=0,hp=null,wy=null,Ds=null,zs=null,Ls=null,Zl=0,eu=null;function ai(){return(wt&2)!==0&&ut!==0?ut&-ut:X.T!==null?_p():Vo()}function ky(){if(ii===0)if((ut&536870912)===0||it){var t=Ua;Ua<<=1,(Ua&3932160)===0&&(Ua=262144),ii=t}else ii=536870912;return t=kn.current,t!==null&&(t.flags|=32),ii}function Is(t,n){if(n!=null){var s=t.stateNode,l=s.ref;l===null&&(l=s.ref=n1(ga(t.memoizedProps,s))),zs===null&&(zs=[]),zs.push(n.bind(null,l))}}function Xn(t,n,s){(t===Dt&&(St===2||St===9)||t.cancelPendingCommit!==null)&&(Us(t,0),lr(t,ut,ii,!1)),Tr(t,s),((wt&2)===0||t!==Dt)&&(t===Dt&&((wt&2)===0&&(Gr|=s),Ft===4&&lr(t,ut,ii,!1)),Ji(t))}function Ey(t,n,s){if((wt&6)!==0)throw Error(r(327));var l=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Sr(t,n),f=l?b_(t,n):xp(t,n,!0),m=l;do{if(f===0){Ms&&!l&&lr(t,n,0,!1);break}else{if(s=t.current.alternate,m&&!g_(s)){f=xp(t,n,!1),m=!1;continue}if(f===2){if(m=n,t.errorRecoveryDisabledLanes&m)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var E=t;f=Xl;var U=E.current.memoizedState.isDehydrated;if(U&&(Us(E,w).flags|=256),w=xp(E,w,!1),w!==2&&w!==6){if(fp&&!U){E.errorRecoveryDisabledLanes|=m,Gr|=m,f=4;break e}m=Vn,Vn=f,m!==null&&(Vn===null?Vn=m:Vn.push.apply(Vn,m))}f=w}if(m=!1,f!==2)continue}}if(f===1){Us(t,0),lr(t,n,0,!0);break}e:{switch(l=t,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:lr(l,n,ii,!ar);break e;case 2:Vn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Qc+300-Zt(),10<f)){if(lr(l,n,ii,!ar),$a(l,0,!0)!==0)break e;Qi=n,l.timeoutHandle=Lp(Ny.bind(null,l,s,Vn,Wc,pp,n,ii,Gr,Rs,ar,m,"Throttled",-0,0),f);break e}Ny(l,s,Vn,Wc,pp,n,ii,Gr,Rs,ar,m,null,-0,0)}}break}while(!0);Ji(t)}function Ny(t,n,s,l,f,m,w,E,U,V,ee,oe,q,J){t.timeoutHandle=-1;var we=n.subtreeFlags,Me=(m&335544064)===m;if(oe=null,(Me||we&8192||(we&16785408)===16785408)&&(oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pi},ti=null,gy(n,m,oe),Me&&(we=oe,Me=t.containerInfo,Me=(Me.nodeType===9?Me:Me.ownerDocument).__reactViewTransition,Me!=null&&(we.count++,we.waitingForViewTransition=!0,we=ao.bind(we),Me.finished.then(we,we))),we=(m&62914560)===m?Qc-Zt():(m&4194048)===m?vy-Zt():0,we=vS(oe,we),we!==null)){Qi=m,t.cancelPendingCommit=we(My.bind(null,t,n,m,s,l,f,w,E,U,V,ee,oe,null,q,J)),lr(t,m,w,!V);return}My(t,n,m,s,l,f,w,E,U,V,ee,oe)}function g_(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var f=s[l],m=f.getSnapshot;f=f.value;try{if(!Wn(m(),f))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function lr(t,n,s,l){n=Yo(t,n),n&=~Zc,n&=~Gr,t.suspendedLanes|=n,t.pingedLanes&=~n,l&&(t.warmLanes|=n),l=t.expirationTimes;for(var f=n;0<f;){var m=31-Ee(f),w=1<<m;l[m]=-1,f&=~w}s!==0&&Ko(t,s,n)}function tu(){return(wt&6)===0?(Ql(0),!1):!0}function gp(){if(lt!==null){if(St===0)var t=lt.return;else t=lt,va=Rr=null,Nf(t),Ns=null,Dl=0,t=lt;for(;t!==null;)Kb(t.alternate,t),t=t.return;lt=null}}function Us(t,n){var s=t.timeoutHandle;return s!==-1&&(t.timeoutHandle=-1,$_(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Qi=0,gp(),Dt=t,lt=s=ba(t.current,null),ut=n,St=0,ni=null,ar=!1,Ms=Sr(t,n),fp=!1,Rs=ii=Zc=Gr=rr=Ft=0,Vn=Xl=null,pp=!1,Sa=Yo(t,n),cc(),s}function _y(t,n){et=null,X.H=Dc,n===Es||n===vc?(n=Mx(),St=3):n===df?(n=Mx(),St=4):St=n===Bf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ni=n,lt===null&&(Ft=1,zc(t,di(n,t.current)))}function Sy(){var t=kn.current;return t===null?!0:(ut&4194048)===ut?jn===null:(ut&62914560)===ut||(ut&536870912)!==0?t===jn:!1}function Ty(){var t=X.H;return X.H=Dc,t===null?Dc:t}function Cy(){var t=X.A;return X.A=m_,t}function nu(){Ft=4,ar||(ut&4194048)!==ut&&kn.current!==null||(Ms=!0),(rr&134217727)===0&&(Gr&134217727)===0||Dt===null||lr(Dt,ut,ii,!1)}function xp(t,n,s){var l=wt;wt|=2;var f=Ty(),m=Cy();(Dt!==t||ut!==n)&&(Wc=null,Us(t,n)),n=!1;var w=Ft;e:do try{if(St!==0&<!==null){var E=lt,U=ni;switch(St){case 8:gp(),w=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(n=!0);var V=St;if(St=0,ni=null,Bs(t,E,U,V),s&&Ms){w=0;break e}break;default:V=St,St=0,ni=null,Bs(t,E,U,V)}}x_(),w=Ft;break}catch(ee){_y(t,ee)}while(!0);return n&&t.shellSuspendCounter++,va=Rr=null,wt=l,X.H=f,X.A=m,lt===null&&(Dt=null,ut=0,cc()),w}function x_(){for(;lt!==null;)Ay(lt)}function b_(t,n){var s=wt;wt|=2;var l=Ty(),f=Cy();Dt!==t||ut!==n?(Wc=null,Jc=Zt()+500,Us(t,n)):Ms=Sr(t,n);e:do try{if(St!==0&<!==null){n=lt;var m=ni;t:switch(St){case 1:St=0,ni=null,Bs(t,n,m,1);break;case 2:case 9:if(jx(m)){St=0,ni=null,jy(n);break}n=function(){St!==2&&St!==9||Dt!==t||(St=7),Ji(t)},m.then(n,n);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:jx(m)?(St=0,ni=null,jy(n)):(St=0,ni=null,Bs(t,n,m,7));break;case 5:var w=null;switch(lt.tag){case 26:w=lt.memoizedState;case 5:case 27:var E=lt;if(w?w1(w):E.stateNode.complete){St=0,ni=null;var U=E.sibling;if(U!==null)lt=U;else{var V=E.return;V!==null?(lt=V,iu(V)):lt=null}break t}}St=0,ni=null,Bs(t,n,m,5);break;case 6:St=0,ni=null,Bs(t,n,m,6);break;case 8:gp(),Ft=6;break e;default:throw Error(r(462))}}y_();break}catch(ee){_y(t,ee)}while(!0);return va=Rr=null,X.H=l,X.A=f,wt=s,lt!==null?0:(Dt=null,ut=0,cc(),Ft)}function y_(){for(;lt!==null&&!oa();)Ay(lt)}function Ay(t){var n=Gb(t.alternate,t,Sa);t.memoizedProps=t.pendingProps,n===null?iu(t):lt=n}function jy(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Ub(s,n,n.pendingProps,n.type,void 0,ut);break;case 11:n=Ub(s,n,n.pendingProps,n.type.render,n.ref,ut);break;case 5:Nf(n);var l=n;l===mn&&(it?(hc(l),l.tag===5&&l.stateNode!=null&&(It=l.stateNode)):(hc(l),it=!0));default:Kb(s,n),n=lt=yx(n,Sa),n=Gb(s,n,Sa)}t.memoizedProps=t.pendingProps,n===null?iu(t):lt=n}function Bs(t,n,s,l){va=Rr=null,Nf(n),Ns=null,Dl=0;var f=n.return;try{if(s_(t,f,n,s,ut)){Ft=1,zc(t,di(s,t.current)),lt=null;return}}catch(m){if(f!==null)throw lt=f,m;Ft=1,zc(t,di(s,t.current)),lt=null;return}n.flags&32768?(it||l===1?t=!0:Ms||(ut&536870912)!==0?t=!1:(ar=t=!0,(l===2||l===9||l===3||l===6)&&(l=kn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Oy(n,t)):iu(n)}function iu(t){var n=t;do{if((n.flags&32768)!==0){Oy(n,ar);return}t=n.return;var s=u_(n.alternate,n,Sa);if(s!==null){lt=s;return}if(n=n.sibling,n!==null){lt=n;return}lt=n=t}while(n!==null);Ft===0&&(Ft=5)}function Oy(t,n){do{var s=d_(t.alternate,t);if(s!==null){s.flags&=32767,lt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){lt=t;return}lt=t=s}while(t!==null);Ft=6,lt=null}function My(t,n,s,l,f,m,w,E,U,V,ee,oe){t.cancelPendingCommit=null;do au();while($t!==0);if((wt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));t===Dt&&(lt=Dt=null,ut=0),Yr=n,Oi=t,Qi=s,hp=f,wy=l,v_(t,n,s,w,E,U,oe)}}function v_(t,n,s,l,f,m,w){var E=n.lanes|n.childLanes;if(mp=E,E|=Qd,Od(t,s,E,l,f,m),zs=null,(s&335544064)===s?(Ls=VN(t),l=10262):(Ls=null,l=10256),(n.subtreeFlags&l)!==0||(n.flags&l)!==0?(t.callbackNode=null,t.callbackPriority=0,S_(_i,function(){return wp(),null})):(t.callbackNode=null,t.callbackPriority=0),Fc=!1,l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=X.T,X.T=null,f=Z.p,Z.p=2,m=wt,wt|=4;try{f_(t,n,s)}finally{wt=m,Z.p=f,X.T=l}}$t=1,Fc?Ds=Y_(w,t.containerInfo,Ls,bp,yp,k_,vp,wp,w_):(bp(),yp(),vp())}function w_(t){if($t!==0){var n=Oi.onRecoverableError;n(t,{componentStack:null})}}function k_(){$t===3&&($t=0,my(Yr,Oi),$t=4)}function bp(){if($t===1){$t=0;var t=Oi,n=Yr,s=Qi,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=X.T,X.T=null;var f=Z.p;Z.p=2;var m=wt;wt|=4;try{Yl=Yc=!1,fy(n,t,s),s=Rp;var w=cx(t.containerInfo),E=s.focusedElem,U=s.selectionRange;if(w!==E&&E&&E.ownerDocument&&ox(E.ownerDocument.documentElement,E)){if(U!==null&&Yd(E)){var V=U.start,ee=U.end;if(ee===void 0&&(ee=V),"selectionStart"in E)E.selectionStart=V,E.selectionEnd=Math.min(ee,E.value.length);else{var oe=E.ownerDocument||document,q=oe&&oe.defaultView||window;if(q.getSelection){var J=q.getSelection(),we=E.textContent.length,Me=Math.min(U.start,we),tt=U.end===void 0?Me:Math.min(U.end,we);!J.extend&&Me>tt&&(w=tt,tt=Me,Me=w);var Y=lx(E,Me),F=lx(E,tt);if(Y&&F&&(J.rangeCount!==1||J.anchorNode!==Y.node||J.anchorOffset!==Y.offset||J.focusNode!==F.node||J.focusOffset!==F.offset)){var Q=oe.createRange();Q.setStart(Y.node,Y.offset),J.removeAllRanges(),Me>tt?(J.addRange(Q),J.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),J.addRange(Q))}}}}for(oe=[],J=E;J=J.parentNode;)J.nodeType===1&&oe.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<oe.length;E++){var le=oe[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Ks=!!Mp,Rp=Mp=null}finally{wt=m,Z.p=f,X.T=l}}t.current=n,$t=2}}function yp(){if($t===2){$t=0;var t=Oi,n=Yr,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=X.T,X.T=null;var l=Z.p;Z.p=2;var f=wt;wt|=4;try{sy(t,n.alternate,n)}finally{wt=f,Z.p=l,X.T=s}}$t=3}}function vp(){if($t===4||$t===3){$t=0;var t=Ds;Ds=null,Ia();var n=Oi,s=Yr,l=Qi,f=wy,m=(l&335544064)===l?10262:10256;if((s.subtreeFlags&m)!==0||(s.flags&m)!==0?$t=5:($t=0,Yr=Oi=null,Ry(n,n.pendingLanes)),m=n.pendingLanes,m===0&&(sr=null),bl(l),s=s.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Rt,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=X.T,m=Z.p,Z.p=2,X.T=null;try{for(var w=n.onRecoverableError,E=0;E<f.length;E++){var U=f[E];w(U.value,{componentStack:U.stack})}}finally{X.T=s,Z.p=m}}if(f=zs,w=Ls,Ls=null,f!==null&&(zs=null,w===null&&(w=[]),t!==null))for(U=0;U<f.length;U++)s=(0,f[U])(w),s!==void 0&&t.finished.finally(s);(Qi&3)!==0&&au(),Ji(n),m=n.pendingLanes,(l&261930)!==0&&(m&42)!==0?n===eu?Zl++:(Zl=0,eu=n):(Zl=0,eu=null),Ql(0)}}function Ry(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ol(n)))}function au(){return Ds!==null&&(Ds.skipTransition(),Ds=null),bp(),yp(),vp(),wp()}function wp(){if($t!==5)return!1;var t=Oi,n=mp;mp=0;var s=bl(Qi),l=X.T,f=Z.p;try{Z.p=32>s?32:s,X.T=null,s=hp,hp=null;var m=Oi,w=Qi;if($t=0,Yr=Oi=null,Qi=0,(wt&6)!==0)throw Error(r(331));var E=wt;if(wt|=4,by(m.current),hy(m,m.current,w,s),wt=E,Ql(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Rt,m)}catch{}return!0}finally{Z.p=f,X.T=l,Ry(t,n)}}function Dy(t,n,s){n=di(s,n),n=Uf(t.stateNode,n,2),t=Ja(t,n,2),t!==null&&(Tr(t,2),Ji(t))}function Tt(t,n,s){if(t.tag===3)Dy(t,t,s);else for(;n!==null;){if(n.tag===3){Dy(n,t,s);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(sr===null||!sr.has(l))){t=di(s,t),s=jb(2),l=Ja(n,s,2),l!==null&&(Ob(s,l,n,t),Tr(l,2),Ji(l));break}}n=n.return}}function kp(t,n,s){var l=t.pingCache;if(l===null){l=t.pingCache=new h_;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(s)||(fp=!0,f.add(s),t=E_.bind(null,t,n,s),n.then(t,t))}function E_(t,n,s){var l=t.pingCache;l!==null&&l.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Dt===t&&(ut&s)===s&&((Ft===4||Ft===3&&(ut&62914560)===ut&&300>Zt()-Qc)&&(wt&2)===0?Us(t,0):Zc|=s,Rs===ut&&(Rs=0)),Ji(t)}function zy(t,n){n===0&&(n=gl()),t=jr(t,n),t!==null&&(Tr(t,n),Ji(t))}function N_(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),zy(t,s)}function __(t,n){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(n),zy(t,s)}function S_(t,n){return ki(t,n)}var $s=null,Hs=null,Ep=!1,ru=!1,Np=!1,or=0;function Ji(t){t!==Hs&&t.next===null&&(Hs===null?$s=Hs=t:Hs=Hs.next=t),ru=!0,Ep||(Ep=!0,C_())}function Ql(t,n){if(!Np&&ru){Np=!0;do for(var s=!1,l=$s;l!==null;){if(t!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var w=l.suspendedLanes,E=l.pingedLanes;m=(1<<31-Ee(42|t)+1)-1,m&=f&~(w&~E),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,By(l,m))}else m=ut,m=$a(l,l===Dt?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Sr(l,m)||(s=!0,By(l,m));l=l.next}while(s);Np=!1}}function T_(){Ly()}function Ly(){ru=Ep=!1;var t=0;or!==0&&B_()&&(t=or);for(var n=Zt(),s=null,l=$s;l!==null;){var f=l.next,m=Iy(l,n);m===0?(l.next=null,s===null?$s=f:s.next=f,f===null&&(Hs=s)):(s=l,(t!==0||(m&3)!==0)&&(ru=!0)),l=f}$t!==0&&$t!==5||Ql(t),or!==0&&(or=0)}function Iy(t,n){for(var s=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var w=31-Ee(m),E=1<<w,U=f[w];U===-1?((E&s)===0||(E&l)!==0)&&(f[w]=jd(E,n)):U<=n&&(t.expiredLanes|=E),m&=~E}if(n=Dt,s=ut,s=$a(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===n&&(St===2||St===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&Ei(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Sr(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(l!==null&&Ei(l),bl(s)){case 2:case 8:s=zn;break;case 32:s=_i;break;case 268435456:s=ue;break;default:s=_i}return l=Uy.bind(null,t),s=ki(s,l),t.callbackPriority=n,t.callbackNode=s,n}return l!==null&&l!==null&&Ei(l),t.callbackPriority=2,t.callbackNode=null,2}function Uy(t,n){if($t!==0&&$t!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(au()&&t.callbackNode!==s)return null;var l=ut;return l=$a(t,t===Dt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Ey(t,l,n),Iy(t,Zt()),t.callbackNode!=null&&t.callbackNode===s?Uy.bind(null,t):null)}function By(t,n){if(au())return null;Ey(t,n,!0)}function C_(){H_(function(){(wt&6)!==0?ki(Ni,T_):Ly()})}function _p(){if(or===0){var t=Lr;t===0&&(t=Hi,Hi<<=1,(Hi&261888)===0&&(Hi=256)),or=t}return or}function $y(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:tc(t)}function A_(t,n,s,l,f){if(n==="submit"&&s&&s.stateNode===f){var m=$y((f[ge]||null).action),w=l.submitter;w&&(n=(n=w[ge]||null)?$y(n.formAction):w.getAttribute("formAction"),n!==null&&(m=n,w=null));var E=new rc("action","action",null,l,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(or!==0){var U=new FormData(f,w);Rf(s,{pending:!0,data:U,method:f.method,action:m},null,U)}}else typeof m=="function"&&(E.preventDefault(),U=new FormData(f,w),Rf(s,{pending:!0,data:U,method:f.method,action:m},m,U))},currentTarget:f}]})}}for(var Sp=0;Sp<Zd.length;Sp++){var Tp=Zd[Sp],j_=Tp.toLowerCase(),O_=Tp[0].toUpperCase()+Tp.slice(1);Ti(j_,"on"+O_)}Ti(fx,"onAnimationEnd"),Ti(px,"onAnimationIteration"),Ti(mx,"onAnimationStart"),Ti("dblclick","onDoubleClick"),Ti("focusin","onFocus"),Ti("focusout","onBlur"),Ti($N,"onTransitionRun"),Ti(HN,"onTransitionStart"),Ti(PN,"onTransitionCancel"),Ti(hx,"onTransitionEnd"),pa("onMouseEnter",["mouseout","mouseover"]),pa("onMouseLeave",["mouseout","mouseover"]),pa("onPointerEnter",["pointerout","pointerover"]),pa("onPointerLeave",["pointerout","pointerover"]),oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),M_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function Hy(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],f=l.event;l=l.listeners;e:{var m=void 0;if(n)for(var w=l.length-1;0<=w;w--){var E=l[w],U=E.instance,V=E.currentTarget;if(E=E.listener,U!==m&&f.isPropagationStopped())break e;m=E,f.currentTarget=V;try{m(f)}catch(ee){oc(ee)}f.currentTarget=null,m=U}else for(w=0;w<l.length;w++){if(E=l[w],U=E.instance,V=E.currentTarget,E=E.listener,U!==m&&f.isPropagationStopped())break e;m=E,f.currentTarget=V;try{m(f)}catch(ee){oc(ee)}f.currentTarget=null,m=U}}}}function ot(t,n){var s=n[st];s===void 0&&(s=n[st]=new Set);var l=t+"__bubble";s.has(l)||(Py(n,t,2,!1),s.add(l))}function Cp(t,n,s){var l=0;n&&(l|=4),Py(s,t,l,n)}var su="_reactListening"+Math.random().toString(36).slice(2);function Ap(t){if(!t[su]){t[su]=!0,Qo.forEach(function(s){s!=="selectionchange"&&(M_.has(s)||Cp(s,!1,t),Cp(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[su]||(n[su]=!0,Cp("selectionchange",!1,n))}}function Py(t,n,s,l){switch(O1(n)){case 2:var f=NS;break;case 8:f=_S;break;default:f=Xp}s=f.bind(null,n,s,t),f=void 0,!Ld||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?t.addEventListener(n,s,{capture:!0,passive:f}):t.addEventListener(n,s,!0):f!==void 0?t.addEventListener(n,s,{passive:f}):t.addEventListener(n,s,!1)}function jp(t,n,s,l,f){var m=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var E=l.stateNode.containerInfo;if(E===f)break;if(w===4)for(w=l.return;w!==null;){var U=w.tag;if((U===3||U===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;E!==null;){if(w=pn(E),w===null)return;if(U=w.tag,U===5||U===6||U===26||U===27){l=m=w;continue e}E=E.parentNode}}l=l.return}Pg(function(){var V=m,ee=Dd(s),oe=[];e:{var q=gx.get(t);if(q!==void 0){var J=rc,we=t;switch(t){case"keypress":if(ic(s)===0)break e;case"keydown":case"keyup":J=gN;break;case"focusin":we="focus",J=$d;break;case"focusout":we="blur",J=$d;break;case"beforeblur":case"afterblur":J=$d;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Gg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=aN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=wN;break;case fx:case px:case mx:J=lN;break;case hx:J=EN;break;case"scroll":case"scrollend":J=nN;break;case"wheel":J=_N;break;case"copy":case"cut":case"paste":J=cN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Kg;break;case"submit":J=yN;break;case"toggle":case"beforetoggle":J=TN}var Me=(n&4)!==0,tt=!Me&&(t==="scroll"||t==="scrollend"),Y=Me?q!==null?q+"Capture":null:q;Me=[];for(var F=V,Q;F!==null;){var le=F;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||Y===null||(le=vl(F,Y),le!=null&&Me.push(Wl(F,le,Q))),tt)break;F=F.return}0<Me.length&&(q=new J(q,we,null,s,ee),oe.push({event:q,listeners:Me}))}}if((n&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",q=t==="mouseout"||t==="pointerout",J&&s!==Rd&&(we=s.relatedTarget||s.fromElement)&&(pn(we)||we[Re]))break e;(q||J)&&(we=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,q?(J=s.relatedTarget||s.toElement,q=V,J=J?pn(J):null,J!==null&&(tt=u(J),Me=J.tag,J!==tt||Me!==5&&Me!==27&&Me!==6)&&(J=null)):(q=null,J=V),q!==J&&(Me=Gg,le="onMouseLeave",Y="onMouseEnter",F="mouse",(t==="pointerout"||t==="pointerover")&&(Me=Kg,le="onPointerLeave",Y="onPointerEnter",F="pointer"),tt=q==null?we:Pa(q),Q=J==null?we:Pa(J),we=new Me(le,F+"leave",q,s,ee),we.target=tt,we.relatedTarget=Q,le=null,pn(ee)===V&&(Me=new Me(Y,F+"enter",J,s,ee),Me.target=Q,Me.relatedTarget=tt,le=Me),tt=le,Me=q&&J?L(q,J,R_):null,q!==null&&Fy(oe,we,q,Me,!1),J!==null&&tt!==null&&Fy(oe,tt,J,Me,!0)))}e:{if(q=V?Pa(V):window,J=q.nodeName&&q.nodeName.toLowerCase(),J==="select"||J==="input"&&q.type==="file")var Ae=tx;else if(Wg(q))if(nx)Ae=IN;else{Ae=zN;var dt=DN}else J=q.nodeName,!J||J.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?V&&Md(V.elementType)&&(Ae=tx):Ae=LN;if(Ae&&(Ae=Ae(t,V))){ex(oe,Ae,s,ee);break e}dt&&dt(t,q,V)}switch(dt=V?Pa(V):window,t){case"focusin":(Wg(dt)||dt.contentEditable==="true")&&(hs=dt,Kd=V,Cl=null);break;case"focusout":Cl=Kd=hs=null;break;case"mousedown":Vd=!0;break;case"contextmenu":case"mouseup":case"dragend":Vd=!1,ux(oe,s,ee);break;case"selectionchange":if(BN)break;case"keydown":case"keyup":ux(oe,s,ee)}var Ie;if(Pd)e:{switch(t){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else ms?Qg(t,s)&&(Fe="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Fe="onCompositionStart");Fe&&(Vg&&s.locale!=="ko"&&(ms||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&ms&&(Ie=Fg()):(Fa=ee,Id="value"in Fa?Fa.value:Fa.textContent,ms=!0)),dt=lu(V,Fe),0<dt.length&&(Fe=new Yg(Fe,t,null,s,ee),oe.push({event:Fe,listeners:dt}),Ie?Fe.data=Ie:(Ie=Jg(s),Ie!==null&&(Fe.data=Ie)))),(Ie=AN?jN(t,s):ON(t,s))&&(Fe=lu(V,"onBeforeInput"),0<Fe.length&&(dt=new Yg("onBeforeInput","beforeinput",null,s,ee),oe.push({event:dt,listeners:Fe}),dt.data=Ie)),A_(oe,t,V,s,ee)}Hy(oe,n)})}function Wl(t,n,s){return{instance:t,listener:n,currentTarget:s}}function lu(t,n){for(var s=n+"Capture",l=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=vl(t,s),f!=null&&l.unshift(Wl(t,f,m)),f=vl(t,n),f!=null&&l.push(Wl(t,f,m))),t.tag===3)return l;t=t.return}return[]}function R_(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Fy(t,n,s,l,f){for(var m=n._reactName,w=[];s!==null&&s!==l;){var E=s,U=E.alternate,V=E.stateNode;if(E=E.tag,U!==null&&U===l)break;E!==5&&E!==26&&E!==27||V===null||(U=V,f?(V=vl(s,m),V!=null&&w.unshift(Wl(s,V,U))):f||(V=vl(s,m),V!=null&&w.push(Wl(s,V,U)))),s=s.return}w.length!==0&&t.push({event:n,listeners:w})}var D_=/\r\n?/g,z_=/\u0000|\uFFFD/g;function qy(t){return(typeof t=="string"?t:""+t).replace(D_,`
|
|
9
|
+
`).replace(z_,"")}function Gy(t,n){return n=qy(n),qy(t)===n}function Ct(t,n,s,l,f,m){switch(s){case"children":if(typeof l=="string")n==="body"||n==="textarea"&&l===""||ds(t,l);else if(typeof l=="number"||typeof l=="bigint")n!=="body"&&ds(t,""+l);else return;break;case"className":ma(t,"class",l);break;case"tabIndex":ma(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ma(t,s,l);break;case"style":$g(t,l,m);return;case"data":if(n!=="object"){ma(t,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=tc(l),t.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(s==="formAction"?(n!=="input"&&Ct(t,n,"name",f.name,f,null),Ct(t,n,"formEncType",f.formEncType,f,null),Ct(t,n,"formMethod",f.formMethod,f,null),Ct(t,n,"formTarget",f.formTarget,f,null)):(Ct(t,n,"encType",f.encType,f,null),Ct(t,n,"method",f.method,f,null),Ct(t,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=tc(l),t.setAttribute(s,l);break;case"onClick":l!=null&&(t.onclick=Pi);return;case"onScroll":l!=null&&ot("scroll",t);return;case"onScrollEnd":l!=null&&ot("scrollend",t);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(r(60));m?.__html!==s&&(t.innerHTML=s)}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}s=tc(l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":l===!0?t.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(s,l):t.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(s):t.setAttribute(s,l);break;case"popover":ot("beforetoggle",t),ot("toggle",t),yt(t,"popover",l);break;case"xlinkActuate":yn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":yn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":yn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":yn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":yn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":yn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":yn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":yn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":yn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":yt(t,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=eN.get(s)||s,yt(t,s,l);else return}pt=!0}function Op(t,n,s,l,f,m){switch(s){case"style":$g(t,l,m);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(r(60));m?.__html!==s&&(t.innerHTML=s)}}break;case"children":if(typeof l=="string")ds(t,l);else if(typeof l=="number"||typeof l=="bigint")ds(t,""+l);else return;break;case"onScroll":l!=null&&ot("scroll",t);return;case"onScrollEnd":l!=null&&ot("scrollend",t);return;case"onClick":l!=null&&(t.onclick=Pi);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Jo.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),m=s.slice(2,f?s.length-7:void 0),n=t[ge]||null,n=n!=null?n[s]:null,typeof n=="function"&&t.removeEventListener(m,n,f),typeof l=="function")){typeof n!="function"&&n!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(m,l,f);break e}pt=!0,s in t?t[s]=l:l===!0?t.setAttribute(s,""):yt(t,s,l)}return}pt=!0}function _n(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",t),ot("load",t);var l=!1,f=!1,m;for(m in s)if(s.hasOwnProperty(m)){var w=s[m];if(w!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Ct(t,n,m,w,s,null)}}f&&Ct(t,n,"srcSet",s.srcSet,s,null),l&&Ct(t,n,"src",s.src,s,null);return;case"input":ot("invalid",t);var E=m=w=f=null,U=null,V=null;for(l in s)if(s.hasOwnProperty(l)){var ee=s[l];if(ee!=null)switch(l){case"name":f=ee;break;case"type":w=ee;break;case"checked":U=ee;break;case"defaultChecked":V=ee;break;case"value":m=ee;break;case"defaultValue":E=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:Ct(t,n,l,ee,s,null)}}ec(t,m,E,U,V,w,f,!1);return;case"select":ot("invalid",t),l=w=m=null;for(f in s)if(s.hasOwnProperty(f)&&(E=s[f],E!=null))switch(f){case"value":m=E;break;case"defaultValue":w=E;break;case"multiple":l=E;default:Ct(t,n,f,E,s,null)}n=m,s=w,t.multiple=!!l,n!=null?us(t,!!l,n,!1):s!=null&&us(t,!!l,s,!0);return;case"textarea":ot("invalid",t),m=f=l=null;for(w in s)if(s.hasOwnProperty(w)&&(E=s[w],E!=null))switch(w){case"value":l=E;break;case"defaultValue":f=E;break;case"children":m=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:Ct(t,n,w,E,s,null)}Ug(t,l,f,m);return;case"option":for(U in s)s.hasOwnProperty(U)&&(l=s[U],l!=null)&&(U==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Ct(t,n,U,l,s,null));return;case"dialog":ot("beforetoggle",t),ot("toggle",t),ot("cancel",t),ot("close",t);break;case"iframe":case"object":ot("load",t);break;case"video":case"audio":for(l=0;l<Jl.length;l++)ot(Jl[l],t);break;case"image":ot("error",t),ot("load",t);break;case"details":ot("toggle",t);break;case"embed":case"source":case"link":ot("error",t),ot("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in s)if(s.hasOwnProperty(V)&&(l=s[V],l!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Ct(t,n,V,l,s,null)}return;default:if(Md(n)){for(ee in s)s.hasOwnProperty(ee)&&(l=s[ee],l!==void 0&&Op(t,n,ee,l,s,void 0));return}}for(E in s)s.hasOwnProperty(E)&&(l=s[E],l!=null&&Ct(t,n,E,l,s,null))}var L_={};function I_(t,n,s,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,w=null,E=null,U=null,V=null,ee=null;for(J in s){var oe=s[J];if(s.hasOwnProperty(J)&&oe!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":U=oe;default:l.hasOwnProperty(J)||Ct(t,n,J,null,l,oe)}}for(var q in l){var J=l[q];if(oe=s[q],l.hasOwnProperty(q)&&(J!=null||oe!=null))switch(q){case"type":J!==oe&&(pt=!0),m=J;break;case"name":J!==oe&&(pt=!0),f=J;break;case"checked":J!==oe&&(pt=!0),V=J;break;case"defaultChecked":J!==oe&&(pt=!0),ee=J;break;case"value":J!==oe&&(pt=!0),w=J;break;case"defaultValue":J!==oe&&(pt=!0),E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:J!==oe&&Ct(t,n,q,J,l,oe)}}Jn(t,w,E,U,V,ee,m,f);return;case"select":J=w=E=q=null;for(m in s)if(U=s[m],s.hasOwnProperty(m)&&U!=null)switch(m){case"value":break;case"multiple":J=U;default:l.hasOwnProperty(m)||Ct(t,n,m,null,l,U)}for(f in l)if(m=l[f],U=s[f],l.hasOwnProperty(f)&&(m!=null||U!=null))switch(f){case"value":m!==U&&(pt=!0),q=m;break;case"defaultValue":m!==U&&(pt=!0),E=m;break;case"multiple":m!==U&&(pt=!0),w=m;default:m!==U&&Ct(t,n,f,m,l,U)}n=E,s=w,l=J,q!=null?us(t,!!s,q,!1):!!l!=!!s&&(n!=null?us(t,!!s,n,!0):us(t,!!s,s?[]:"",!1));return;case"textarea":J=q=null;for(E in s)if(f=s[E],s.hasOwnProperty(E)&&f!=null&&!l.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ct(t,n,E,null,l,f)}for(w in l)if(f=l[w],m=s[w],l.hasOwnProperty(w)&&(f!=null||m!=null))switch(w){case"value":f!==m&&(pt=!0),q=f;break;case"defaultValue":f!==m&&(pt=!0),J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&Ct(t,n,w,f,l,m)}Ig(t,q,J);return;case"option":for(var we in s)q=s[we],s.hasOwnProperty(we)&&q!=null&&!l.hasOwnProperty(we)&&(we==="selected"?t.selected=!1:Ct(t,n,we,null,l,q));for(U in l)q=l[U],J=s[U],l.hasOwnProperty(U)&&q!==J&&(q!=null||J!=null)&&(U==="selected"?(q!==J&&(pt=!0),t.selected=q&&typeof q!="function"&&typeof q!="symbol"):Ct(t,n,U,q,l,J));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 Me in s)q=s[Me],s.hasOwnProperty(Me)&&q!=null&&!l.hasOwnProperty(Me)&&Ct(t,n,Me,null,l,q);for(V in l)if(q=l[V],J=s[V],l.hasOwnProperty(V)&&q!==J&&(q!=null||J!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,n));break;default:Ct(t,n,V,q,l,J)}return;default:if(Md(n)){for(var tt in s)q=s[tt],s.hasOwnProperty(tt)&&q!==void 0&&!l.hasOwnProperty(tt)&&Op(t,n,tt,void 0,l,q);for(ee in l)q=l[ee],J=s[ee],!l.hasOwnProperty(ee)||q===J||q===void 0&&J===void 0||Op(t,n,ee,q,l,J);return}}for(var Y in s)q=s[Y],s.hasOwnProperty(Y)&&q!=null&&!l.hasOwnProperty(Y)&&Ct(t,n,Y,null,l,q);for(oe in l)q=l[oe],J=s[oe],!l.hasOwnProperty(oe)||q===J||q==null&&J==null||Ct(t,n,oe,q,l,J)}function Yy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function U_(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var f=s[l],m=f.transferSize,w=f.initiatorType,E=f.duration;if(m&&E&&Yy(w)){for(w=0,E=f.responseEnd,l+=1;l<s.length;l++){var U=s[l],V=U.startTime;if(V>E)break;var ee=U.transferSize,oe=U.initiatorType;ee&&Yy(oe)&&(U=U.responseEnd,w+=ee*(U<E?1:(E-V)/(U-V)))}if(--l,n+=8*(m+w)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Mp=null,Rp=null;function eo(t){return t.nodeType===9?t:t.ownerDocument}function Ky(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Vy(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Xy(t,n,s,l){return s=eo(s).createElement(t),s[cn]=l,s[ge]=n,_n(s,t,n),Jt(s),s}function Dp(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var zp=null;function B_(){var t=window.event;return t&&t.type==="popstate"?t===zp?!1:(zp=t,!0):(zp=null,!1)}var Lp=typeof setTimeout=="function"?setTimeout:void 0,$_=typeof clearTimeout=="function"?clearTimeout:void 0,Zy=typeof Promise=="function"?Promise:void 0,Qy=typeof requestAnimationFrame=="function"?requestAnimationFrame:Lp,H_=typeof queueMicrotask=="function"?queueMicrotask:typeof Zy<"u"?function(t){return Zy.resolve(null).then(t).catch(P_)}:Lp;function P_(t){setTimeout(function(){throw t})}function cr(t){return t==="head"}function Jy(t,n){var s=n,l=0;do{var f=s.nextSibling;if(t.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(f),Vs(n);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")qp(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,qp(s);for(var m=s.firstChild;m;){var w=m.nextSibling,E=m.nodeName;m[qn]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=w}}else s==="body"&&qp(t.ownerDocument.body);s=f}while(s);Vs(n)}function Wy(t,n){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function e1(t,n,s){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,s!=null&&(t.style.viewTransitionClass=s),s=getComputedStyle(t),s.display==="inline"){if(n=t.getClientRects(),n.length===1)var l=1;else for(var f=l=0;f<n.length;f++){var m=n[f];0<m.width&&0<m.height&&l++}l===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+s.paddingTop,t.marginBottom="-"+s.paddingBottom)}}function t1(t,n){t=t.style,n=n.style;var s=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(s=n.display,t.display=s==null||typeof s=="boolean"?"":s,s=n.margin,s!=null?t.margin=s:(s=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=s==null||typeof s=="boolean"?"":s,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function F_(t,n,s){return s=s.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=s.innerHeight&&t.left<=s.innerWidth}}function Ip(t){var n=t.getBoundingClientRect(),s=getComputedStyle(t);return F_(n,s,t)}function q_(t){return t.documentElement.clientHeight}function G_(t){this.addEventListener("load",t),this.addEventListener("error",t)}function Y_(t,n,s,l,f,m,w,E,U){var V=n.nodeType===9?n:n.ownerDocument;try{var ee=V.startViewTransition({update:function(){var q=V.defaultView,J=q.navigation&&q.navigation.transition,we=V.fonts.status;l();var Me=[];if(we==="loaded"&&(q_(V),V.fonts.status==="loading"&&Me.push(V.fonts.ready)),we=Me.length,t!==null)for(var tt=t.suspenseyImages,Y=0,F=0;F<tt.length;F++){var Q=tt[F];if(!Q.complete){var le=Q.getBoundingClientRect();if(0<le.bottom&&0<le.right&&le.top<q.innerHeight&&le.left<q.innerWidth){if(Y+=k1(Q),Y>uu){Me.length=we;break}Q=new Promise(G_.bind(Q)),Me.push(Q)}}}if(0<Me.length)return q=Promise.race([Promise.all(Me),new Promise(function(Ae){return setTimeout(Ae,500)})]).then(f,f),(J?Promise.allSettled([J.finished,q]):q).then(m,m);if(f(),J)return J.finished.then(m,m);m()},types:s});V.__reactViewTransition=ee;var oe=[];return ee.ready.then(function(){for(var q=V.documentElement.getAnimations({subtree:!0}),J=0;J<q.length;J++){var we=q[J],Me=we.effect,tt=Me.pseudoElement;if(tt!=null&&tt.startsWith("::view-transition")){oe.push(we),we=Me.getKeyframes();for(var Y=tt=void 0,F=!0,Q=0;Q<we.length;Q++){var le=we[Q],Ae=le.width;if(tt===void 0)tt=Ae;else if(tt!==Ae){F=!1;break}if(Ae=le.height,Y===void 0)Y=Ae;else if(Y!==Ae){F=!1;break}delete le.width,delete le.height,le.transform==="none"&&delete le.transform}F&&tt!==void 0&&Y!==void 0&&(Me.setKeyframes(we),F=getComputedStyle(Me.target,Me.pseudoElement),F.width!==tt||F.height!==Y)&&(F=we[0],F.width=tt,F.height=Y,F=we[we.length-1],F.width=tt,F.height=Y,Me.setKeyframes(we))}}w()},function(q){V.__reactViewTransition===ee&&(V.__reactViewTransition=null);try{typeof q=="object"&&q!==null&&q.name==="InvalidStateError"&&(q.message==="View transition was skipped because document visibility state is hidden."||q.message==="Skipping view transition because document visibility state has become hidden."||q.message==="Skipping view transition because viewport size changed."||q.message==="Transition was aborted because of invalid state")&&(q=null),q!==null&&U(q)}finally{l(),f(),w()}}),ee.finished.finally(function(){for(var q=0;q<oe.length;q++)oe[q].cancel();V.__reactViewTransition===ee&&(V.__reactViewTransition=null),E()}),ee}catch{return l(),f(),w(),null}}function Kr(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}Kr.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:T({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},Kr.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,s=t.getAnimations({subtree:!0}),l=[],f=0;f<s.length;f++){var m=s[f].effect;m!==null&&m.target===t&&m.pseudoElement===n&&l.push(s[f])}return l},Kr.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function n1(t){return{name:t,group:new Kr("group",t),imagePair:new Kr("image-pair",t),old:new Kr("old",t),new:new Kr("new",t)}}function ri(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}ri.prototype.addEventListener=function(t,n,s){var l=null,f=null;if(!(s!=null&&typeof s!="boolean"&&(l=s.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var m=this._eventListeners;if(a1(m,t,n,s)===-1){var w=this,E=n;s!=null&&typeof s!="boolean"&&s.once===!0&&(E=function(U){w.removeEventListener(t,n,s),typeof n=="function"?n.call(this,U):n.handleEvent(U)}),l!==null&&(f=w.removeEventListener.bind(w,t,n,s),l.addEventListener("abort",f,{once:!0}),f=l.removeEventListener.bind(l,"abort",f)),l=Ps(s),m.push({type:t,listener:n,optionsOrUseCapture:s,attachedListener:E,cleanup:f}),b(this._fragmentFiber.child,!1,K_,t,E,l)}this._eventListeners=m}};function K_(t,n,s,l){return S(t).addEventListener(n,s,l),!1}ri.prototype.removeEventListener=function(t,n,s){var l=this._eventListeners;if(l!==null&&(n=a1(l,t,n,s),n!==-1)){var f=l[n];s=f.attachedListener;var m=f.cleanup;f=Ps(f.optionsOrUseCapture),b(this._fragmentFiber.child,!1,V_,t,s,f),l.splice(n,1),m!==null&&m()}};function V_(t,n,s,l){return S(t).removeEventListener(n,s,l),!1}function Ps(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function i1(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function a1(t,n,s,l){if(t.length===0)return-1;l=i1(l);for(var f=0;f<t.length;f++){var m=t[f];if(m.type===n&&m.listener===s&&i1(m.optionsOrUseCapture)===l)return f}return-1}ri.prototype.dispatchEvent=function(t){var n=v(this._fragmentFiber);if(n===null)return!0;n=S(n);var s=this._eventListeners;if(s!==null&&0<s.length||!t.bubbles){var l=n.nodeType===9?n.createComment(""):document.createTextNode("");if(s)for(var f=0;f<s.length;f++){var m=s[f];l.addEventListener(m.type,m.attachedListener,Ps(m.optionsOrUseCapture))}if(n.appendChild(l),t=l.dispatchEvent(t),s)for(f=0;f<s.length;f++)m=s[f],l.removeEventListener(m.type,m.attachedListener,Ps(m.optionsOrUseCapture));return n.removeChild(l),t}return n.dispatchEvent(t)},ri.prototype.focus=function(t){b(this._fragmentFiber.child,!0,r1,t,void 0,void 0)};function r1(t,n){return t.tag===6?!1:(t=S(t),sS(t,n))}ri.prototype.focusLast=function(t){var n=[];b(this._fragmentFiber.child,!0,Up,n,void 0,void 0);for(var s=n.length-1;0<=s&&!r1(n[s],t);s--);};function Up(t,n){return n.push(t),!1}ri.prototype.blur=function(){var t=v(this._fragmentFiber);t!==null&&(t=S(t),t=eo(t).activeElement,t!==null&&b(this._fragmentFiber.child,!1,X_,t,void 0,void 0))};function X_(t,n){return t.tag===6?!1:(t=S(t),t===n||t.contains(n)?(n.blur(),!0):!1)}ri.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),b(this._fragmentFiber.child,!1,Z_,t,void 0,void 0)};function Z_(t,n){return t.tag===6||(t=S(t),n.observe(t)),!1}ri.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),b(this._fragmentFiber.child,!1,Q_,t,void 0,void 0);for(var s=n=0;s<Mi.length;s++){var l=Mi[s];l.fragmentInstance===this&&l.observer===t?t.unobserve(l.instance):Mi[n++]=l}Mi.length=n}};function Q_(t,n){return t.tag===6||(t=S(t),n.unobserve(t)),!1}var Mi=[],Bp=!1;function J_(t,n,s){Mi.push({fragmentInstance:t,observer:n,instance:s}),Bp||(Bp=!0,lS(function(){Bp=!1;var l=Mi;Mi=[];for(var f=0;f<l.length;f++){var m=l[f];m.observer.unobserve(m.instance)}}))}ri.prototype.getClientRects=function(){var t=[];return b(this._fragmentFiber.child,!1,W_,t,void 0,void 0),t};function W_(t,n){if(t.tag===6){t=t.stateNode;var s=t.ownerDocument.createRange();s.selectNodeContents(t),n.push.apply(n,s.getClientRects())}else t=S(t),n.push.apply(n,t.getClientRects());return!1}ri.prototype.getRootNode=function(t){var n=v(this._fragmentFiber);return n===null?this:S(n).getRootNode(t)},ri.prototype.compareDocumentPosition=function(t){var n=v(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];b(this._fragmentFiber.child,!1,Up,s,void 0,void 0);var l=S(n);if(s.length===0){if(s=l,y(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(s=n)}n=this._fragmentFiber;var f=l=s.compareDocumentPosition(t);return s===t?f=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=k(n)[1],s===null?f=Node.DOCUMENT_POSITION_PRECEDING:(t=S(s).compareDocumentPosition(t),f=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=S(s[0]),f=S(s[s.length-1]);var m=y(this._fragmentFiber)?n.parentElement:l;if(m==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=m.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,m=m.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var w=n.compareDocumentPosition(t),E=f.compareDocumentPosition(t),U=w&Node.DOCUMENT_POSITION_CONTAINED_BY||E&Node.DOCUMENT_POSITION_CONTAINED_BY;return E=l&&m&&w&Node.DOCUMENT_POSITION_FOLLOWING&&E&Node.DOCUMENT_POSITION_PRECEDING,n=l&&n===t||m&&f===t||U||E?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&n===t||!m&&f===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:w,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||eS(n,this._fragmentFiber,s[0],s[s.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function eS(t,n,s,l,f){var m=pn(f);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!m)e:{for(;m!==null;){if(m.tag===7&&(m===n||m.alternate===n)){s=!0;break e}m=m.return}s=!1}return s}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(m===null)return m=f.ownerDocument,f===m||f===m.documentElement||f===m.body;e:{for(m=n,n=v(n);m!==null;){if(!(m.tag!==5&&m.tag!==3&&m.tag!==27||m!==n&&m.alternate!==n)){m=!0;break e}m=m.return}m=!1}return m}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!m)&&!(n=m===s)&&(n=L(s,m,P),n===null?n=!1:(b(n,!0,j,m,s),m=N,N=null,n=m!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!m)&&!(n=m===l)&&(n=L(l,m,P),n===null?n=!1:(b(n,!0,D,m,l),m=N,M=N=null,n=m!==null)),n):!1}function s1(t,n){var s=t.ownerDocument.createRange();s.selectNodeContents(t),t=s.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}ri.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(r(566));var n=[];b(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var s=t!==!1;if(n.length===0){var l=k(this._fragmentFiber);if(l=s?l[1]||l[0]||v(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){t=S(l),s1(t,s);return}if(l=S(l),l.nodeType!==9){if(l.nodeType===11){s="host"in l?l.host:null,s!==null&&s.scrollIntoView(t);return}l.scrollIntoView(t)}}for(l=s?n.length-1:0;l!==(s?-1:n.length);){var f=n[l];f.tag===6?(f=S(f),s1(f,s)):S(f).scrollIntoView(t),l+=s?-1:1}};function tS(t,n){return t=S(t),l1(t,n),!1}function l1(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function o1(t,n){var s=n._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l];t.addEventListener(f.type,f.attachedListener,Ps(f.optionsOrUseCapture))}t.nodeType!==3&&(s=n._observers,s!==null&&s.forEach(function(m){for(var w=0,E=0;E<Mi.length;E++){var U=Mi[E];(U.fragmentInstance!==n||U.observer!==m||U.instance!==t)&&(Mi[w++]=U)}Mi.length=w,m.observe(t)}),l1(t,n))}function nS(t,n){var s=n._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l];t.removeEventListener(f.type,f.attachedListener,Ps(f.optionsOrUseCapture))}t.nodeType!==3&&(s=n._observers,s!==null&&s.forEach(function(m){typeof m.rootMargin=="string"?J_(n,m,t):m.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function $p(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":$p(s),fn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function iS(t,n,s,l){for(;t.nodeType===1;){var f=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[qn])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=gi(t.nextSibling),t===null)break}return null}function aS(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=gi(t.nextSibling),t===null))return null;return t}function c1(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=gi(t.nextSibling),t===null))return null;return t}function Hp(t){return t.data==="$?"||t.data==="$~"}function Pp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rS(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var l=function(){n(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function gi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Fp=null;function u1(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return gi(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function d1(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function sS(t,n){function s(){l=!0}if(t.ownerDocument.activeElement===t)return!0;var l=!1;try{t.ownerDocument.addEventListener("focus",s,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",s,!0)}return l}function lS(t){Qy(function(){Qy(function(n){return t(n)})})}function f1(t,n,s){switch(n=eo(s),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function p1(t,n,s){for(var l in s){var f=s[l];s.hasOwnProperty(l)&&f!=null&&Ct(t,n,l,null,L_,f)}s.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Pi&&(t.onclick=null),fn(t)}function qp(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);fn(t)}var xi=new Map,m1=new Set;function to(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var Ta=Z.d;Z.d={f:oS,r:cS,D:uS,C:dS,L:fS,m:pS,X:hS,S:mS,M:gS};function oS(){var t=Ta.f(),n=tu();return t||n}function cS(t){var n=da(t);n!==null&&n.tag===5&&n.type==="form"?gb(n):Ta.r(t)}var Fs=typeof document>"u"?null:document;function h1(t,n,s){var l=Fs;if(l&&typeof n=="string"&&n){var f=_t(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),m1.has(f)||(m1.add(f),t={rel:t,crossOrigin:s,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),_n(n,"link",t),Jt(n),l.head.appendChild(n)))}}function uS(t){Ta.D(t),h1("dns-prefetch",t,null)}function dS(t,n){Ta.C(t,n),h1("preconnect",t,n)}function fS(t,n,s){Ta.L(t,n,s);var l=Fs;if(l&&t&&n){var f='link[rel="preload"][as="'+_t(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+_t(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+_t(s.imageSizes)+'"]')):f+='[href="'+_t(t)+'"]';var m=f;switch(n){case"style":m=qs(t);break;case"script":m=Gs(t)}if(!(xi.has(m)||(t=T({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),xi.set(m,t),l.querySelector(f)!==null||n==="style"&&l.querySelector(no(m))||n==="script"&&l.querySelector(io(m))))){var w=l.createElement("link");_n(w,"link",t),n==="style"&&(w[ua]=!0,w.onload=w.onerror=function(){Zo(w)}),Jt(w),l.head.appendChild(w)}}}function pS(t,n){Ta.m(t,n);var s=Fs;if(s&&t){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+_t(l)+'"][href="'+_t(t)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Gs(t)}if(!xi.has(m)&&(t=T({rel:"modulepreload",href:t},n),xi.set(m,t),s.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(io(m)))return}l=s.createElement("link"),_n(l,"link",t),Jt(l),s.head.appendChild(l)}}}function mS(t,n,s){Ta.S(t,n,s);var l=Fs;if(l&&t){var f=fa(l).hoistableStyles,m=qs(t);n=n||"default";var w=f.get(m);if(!w){var E={loading:0,preload:null};if(w=l.querySelector(no(m)))E.loading=5;else{t=T({rel:"stylesheet",href:t,"data-precedence":n},s),(s=xi.get(m))&&Gp(t,s);var U=w=l.createElement("link");Jt(U),_n(U,"link",t),U._p=new Promise(function(V,ee){U.onload=V,U.onerror=ee}),U.addEventListener("load",function(){E.loading|=1}),U.addEventListener("error",function(){E.loading|=2}),E.loading|=4,ou(w,n,l)}w={type:"stylesheet",instance:w,count:1,state:E},f.set(m,w)}}}function hS(t,n){Ta.X(t,n);var s=Fs;if(s&&t){var l=fa(s).hoistableScripts,f=Gs(t),m=l.get(f);m||(m=s.querySelector(io(f)),m||(t=T({src:t,async:!0},n),(n=xi.get(f))&&Yp(t,n),m=s.createElement("script"),Jt(m),_n(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function gS(t,n){Ta.M(t,n);var s=Fs;if(s&&t){var l=fa(s).hoistableScripts,f=Gs(t),m=l.get(f);m||(m=s.querySelector(io(f)),m||(t=T({src:t,async:!0,type:"module"},n),(n=xi.get(f))&&Yp(t,n),m=s.createElement("script"),Jt(m),_n(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function g1(t,n,s,l){var f=(f=xn.current)?to(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=qs(s.href),n=fa(f).hoistableStyles,l=n.get(s),l||(l={type:"style",instance:null,count:0,state:null},n.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=qs(s.href);var m=fa(f).hoistableStyles,w=m.get(t);if(w||(f=f.ownerDocument||f,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,w),(m=f.querySelector(no(t)))?m._p||(w.instance=m,w.state.loading=5):(m=xi.get(t),m||(m={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xi.set(t,m)),xS(f,t,m,w.state))),n&&l===null)throw Error(r(528,""));return w}if(n&&l!==null)throw Error(r(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(s=Gs(s),n=fa(f).hoistableScripts,l=n.get(s),l||(l={type:"script",instance:null,count:0,state:null},n.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function qs(t){return'href="'+_t(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function x1(t){return T({},t,{"data-precedence":t.precedence,precedence:null})}function xS(t,n,s,l){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[ua]!==!0){l.loading=1;return}}else n=t.createElement("link"),n[ua]=!0,n.onload=n.onerror=Zo.bind(null,n),_n(n,"link",s),Jt(n),t.head.appendChild(n);l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2})}function Gs(t){return'[src="'+_t(t)+'"]'}function io(t){return"script[async]"+t}function b1(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var l=t.querySelector('style[data-href~="'+_t(s.href)+'"]');if(l)return n.instance=l,Jt(l),l;var f=T({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Jt(l),_n(l,"style",f),ou(l,s.precedence,t),n.instance=l;case"stylesheet":f=qs(s.href);var m=t.querySelector(no(f));if(m)return n.state.loading|=4,n.instance=m,Jt(m),m;l=x1(s),(f=xi.get(f))&&Gp(l,f),m=(t.ownerDocument||t).createElement("link"),Jt(m);var w=m;return w._p=new Promise(function(E,U){w.onload=E,w.onerror=U}),_n(m,"link",l),n.state.loading|=4,ou(m,s.precedence,t),n.instance=m;case"script":return m=Gs(s.src),(f=t.querySelector(io(m)))?(n.instance=f,Jt(f),f):(l=s,(f=xi.get(m))&&(l=T({},s),Yp(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),Jt(f),_n(f,"link",l),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,ou(l,s.precedence,t));return n.instance}function ou(t,n,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,w=0;w<l.length;w++){var E=l[w];if(E.dataset.precedence===n)m=E;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function Gp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Yp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var cu=null;function y1(t,n,s){if(cu===null){var l=new Map,f=cu=new Map;f.set(s,l)}else f=cu,l=f.get(s),l||(l=new Map,f.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),f=0;f<s.length;f++){var m=s[f];if(!(m[qn]||m[cn]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var w=m.getAttribute(n)||"";w=t+w;var E=l.get(w);E?E.push(m):l.set(w,[m])}}return l}function Kp(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function bS(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function v1(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function w1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function k1(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function E1(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=k1(n),t.suspenseyImages.push(n)),t=wS.bind(t),n.decode().then(t,t))}function yS(t,n,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=qs(l.href),m=n.querySelector(no(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ao.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=m,Jt(m);return}m=n.ownerDocument||n,l=x1(l),(f=xi.get(f))&&Gp(l,f),m=m.createElement("link"),Jt(m);var w=m;w._p=new Promise(function(E,U){w.onload=E,w.onerror=U}),_n(m,"link",l),s.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=ao.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var uu=0;function vS(t,n){return t.stylesheets&&t.count===0&&fu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&fu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+n);0<t.imgBytes&&uu===0&&(uu=62500*U_());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&fu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>uu?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function N1(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)fu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function ao(){this.count--,N1(this)}function wS(){this.imgCount--,N1(this)}var du=null;function fu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,du=new Map,n.forEach(kS,t),du=null,ao.call(t))}function kS(t,n){if(!(n.state.loading&4)){var s=du.get(t);if(s)var l=s.get(null);else{s=new Map,du.set(t,s);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var w=f[m];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),l=w)}l&&s.set(null,l)}f=n.instance,w=f.getAttribute("data-precedence"),m=s.get(w)||l,m===l&&s.set(null,f),s.set(w,f),this.count++,l=ao.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var Ys={$$typeof:ae,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function ES(t,n,s,l,f,m,w,E,U){this.tag=1,this.containerInfo=t,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=Ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ha(0),this.hiddenUpdates=Ha(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.transitionTypes=null,this.incompleteTransitions=new Map}function _1(t,n,s,l,f,m,w,E,U,V,ee,oe){return t=new ES(t,n,s,w,U,V,ee,oe,E),n=1,m===!0&&(n|=24),m=Gn(3,null,null,n),t.current=m,m.stateNode=t,n=of(),n.refCount++,t.pooledCache=n,n.refCount++,m.memoizedState={element:l,isDehydrated:s,cache:n},ff(m),t}function S1(t){return t?(t=bs,t):bs}function T1(t,n,s,l,f,m){f=S1(f),l.context===null?l.context=f:l.pendingContext=f,l=Qa(n),l.payload={element:s},m=m===void 0?null:m,m!==null&&(l.callback=m),s=Ja(t,l,n),s!==null&&(Xn(s,t,n),zl(s,t,n))}function C1(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Vp(t,n){C1(t,n),(t=t.alternate)&&C1(t,n)}function A1(t){if(t.tag===13||t.tag===31){var n=jr(t,67108864);n!==null&&Xn(n,t,67108864),Vp(t,67108864)}}function j1(t){if(t.tag===13||t.tag===31){var n=ai();n=ls(n);var s=jr(t,n);s!==null&&Xn(s,t,n),Vp(t,n)}}var Ks=!0;function NS(t,n,s,l){var f=X.T;X.T=null;var m=Z.p;try{Z.p=2,Xp(t,n,s,l)}finally{Z.p=m,X.T=f}}function _S(t,n,s,l){var f=X.T;X.T=null;var m=Z.p;try{Z.p=8,Xp(t,n,s,l)}finally{Z.p=m,X.T=f}}function Xp(t,n,s,l){if(Ks){var f=Zp(l);if(f===null)jp(t,n,l,pu,s),M1(t,l);else if(TS(f,t,n,s,l))l.stopPropagation();else if(M1(t,l),n&4&&-1<SS.indexOf(t)){for(;f!==null;){var m=da(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var w=ca(m.pendingLanes);if(w!==0){var E=m;for(E.pendingLanes|=2,E.entangledLanes|=2;w;){var U=1<<31-Ee(w);E.entanglements[1]|=U,w&=~U}Ji(m),(wt&6)===0&&(Jc=Zt()+500,Ql(0))}}break;case 31:case 13:E=jr(m,2),E!==null&&Xn(E,m,2),tu(),Vp(m,2)}if(m=Zp(l),m===null&&jp(t,n,l,pu,s),m===f)break;f=m}f!==null&&l.stopPropagation()}else jp(t,n,l,null,s)}}function Zp(t){return t=Dd(t),Qp(t)}var pu=null;function Qp(t){if(pu=null,t=pn(t),t!==null){var n=u(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=d(n),t!==null)return t;t=null}else if(s===31){if(t=p(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return pu=t,null}function O1(t){switch(t){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dn()){case Ni:return 2;case zn:return 8;case _i:case H:return 32;case ue:return 268435456;default:return 32}default:return 32}}var Jp=!1,ur=null,dr=null,fr=null,ro=new Map,so=new Map,pr=[],SS="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 M1(t,n){switch(t){case"focusin":case"focusout":ur=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":fr=null;break;case"pointerover":case"pointerout":ro.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(n.pointerId)}}function lo(t,n,s,l,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:s,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},n!==null&&(n=da(n),n!==null&&A1(n)),t):(t.eventSystemFlags|=l,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function TS(t,n,s,l,f){switch(n){case"focusin":return ur=lo(ur,t,n,s,l,f),!0;case"dragenter":return dr=lo(dr,t,n,s,l,f),!0;case"mouseover":return fr=lo(fr,t,n,s,l,f),!0;case"pointerover":var m=f.pointerId;return ro.set(m,lo(ro.get(m)||null,t,n,s,l,f)),!0;case"gotpointercapture":return m=f.pointerId,so.set(m,lo(so.get(m)||null,t,n,s,l,f)),!0}return!1}function R1(t){var n=pn(t.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){t.blockedOn=n,Xo(t.priority,function(){j1(s)});return}}else if(n===31){if(n=p(s),n!==null){t.blockedOn=n,Xo(t.priority,function(){j1(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function mu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=Zp(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Rd=l,s.target.dispatchEvent(l),Rd=null}else return n=da(s),n!==null&&A1(n),t.blockedOn=s,!1;n.shift()}return!0}function D1(t,n,s){mu(t)&&s.delete(n)}function CS(){Jp=!1,ur!==null&&mu(ur)&&(ur=null),dr!==null&&mu(dr)&&(dr=null),fr!==null&&mu(fr)&&(fr=null),ro.forEach(D1),so.forEach(D1)}function hu(t,n){t.blockedOn===n&&(t.blockedOn=null,Jp||(Jp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,CS)))}var gu=null;function z1(t){gu!==t&&(gu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gu===t&&(gu=null);for(var n=0;n<t.length;n+=3){var s=t[n],l=t[n+1],f=t[n+2];if(typeof l!="function"){if(Qp(l||s)===null)continue;break}var m=da(s);m!==null&&(t.splice(n,3),n-=3,Rf(m,{pending:!0,data:f,method:s.method,action:l},l,f))}}))}function Vs(t){function n(U){return hu(U,t)}ur!==null&&hu(ur,t),dr!==null&&hu(dr,t),fr!==null&&hu(fr,t),ro.forEach(n),so.forEach(n);for(var s=0;s<pr.length;s++){var l=pr[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<pr.length&&(s=pr[0],s.blockedOn===null);)R1(s),s.blockedOn===null&&pr.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var f=s[l],m=s[l+1],w=f[ge]||null;if(typeof m=="function")w||z1(s);else if(w){var E=null;if(m&&m.hasAttribute("formAction")){if(f=m,w=m[ge]||null)E=w.formAction;else if(Qp(f)!==null)continue}else E=w.action;typeof E=="function"?s[l+1]=E:(s.splice(l,3),l-=3),z1(s)}}}function L1(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(w){return f=w})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Wp(t){this._internalRoot=t}xu.prototype.render=Wp.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var s=n.current,l=ai();T1(s,l,t,n,null,null)},xu.prototype.unmount=Wp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;T1(t.current,2,null,t,null,null),tu(),n[Re]=null}};function xu(t){this._internalRoot=t}xu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Vo();t={blockedOn:null,target:t,priority:n};for(var s=0;s<pr.length&&n!==0&&n<pr[s].priority;s++);pr.splice(s,0,t),s===0&&R1(t)}};var I1=i.version;if(I1!=="19.3.1")throw Error(r(527,I1,"19.3.1"));Z.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=g(n),t=t!==null?x(t):null,t=t===null?null:t.stateNode,t};var AS={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bu.isDisabled&&bu.supportsFiber)try{Rt=bu.inject(AS),ft=bu}catch{}}return co.createRoot=function(t,n){if(!o(t))throw Error(r(299));var s=!1,l="",f=Sb,m=Tb,w=Cb;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=_1(t,1,!1,null,null,s,l,null,f,m,w,L1),t[Re]=n.current,Ap(t),new Wp(n)},co.hydrateRoot=function(t,n,s){if(!o(t))throw Error(r(299));var l=!1,f="",m=Sb,w=Tb,E=Cb,U=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),n=_1(t,1,!0,n,s??null,l,f,U,m,w,E,L1),n.context=S1(null),s=n.current,l=ai(),l=ls(l),f=Qa(l),f.callback=null,Ja(s,f,l),s=l,n.current.lanes=s,Tr(n,s),Ji(n),t[Re]=n.current,Ap(t),new xu(n)},co.version="19.3.1",co}var K1;function US(){if(K1)return im.exports;K1=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(i){console.error(i)}}return e(),im.exports=IS(),im.exports}var BS=US();const $S=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),HS=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,r)=>r?r.toUpperCase():a.toLowerCase()),V1=e=>{const i=HS(e);return i.charAt(0).toUpperCase()+i.slice(1)},Fv=(...e)=>e.filter((i,a,r)=>!!i&&i.trim()!==""&&r.indexOf(i)===a).join(" ").trim(),PS=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};var FS={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 qS=B.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:u,iconNode:d,...p},h)=>B.createElement("svg",{ref:h,...FS,width:i,height:i,stroke:e,strokeWidth:r?Number(a)*24/Number(i):a,className:Fv("lucide",o),...!u&&!PS(p)&&{"aria-hidden":"true"},...p},[...d.map(([g,x])=>B.createElement(g,x)),...Array.isArray(u)?u:[u]]));const xe=(e,i)=>{const a=B.forwardRef(({className:r,...o},u)=>B.createElement(qS,{ref:u,iconNode:i,className:Fv(`lucide-${$S(V1(e))}`,`lucide-${e}`,r),...o}));return a.displayName=V1(e),a};const GS=[["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"}]],YS=xe("activity",GS);const KS=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],qv=xe("arrow-down-to-line",KS);const VS=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],XS=xe("arrow-left",VS);const ZS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],rd=xe("arrow-right",ZS);const QS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],JS=xe("arrow-up-right",QS);const WS=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],e2=xe("arrow-up",WS);const t2=[["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"}]],n2=xe("bot",t2);const i2=[["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"}]],X1=xe("brain",i2);const a2=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],r2=xe("bug",a2);const s2=[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],l2=xe("calendar-days",s2);const o2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Cn=xe("check",o2);const c2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Do=xe("chevron-down",c2);const u2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],d2=xe("chevron-left",u2);const f2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gv=xe("chevron-right",f2);const p2=[["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"}]],sd=xe("circle-alert",p2);const m2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h2=xe("circle-check",m2);const g2=[["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"}]],x2=xe("circle-x",g2);const b2=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],y2=xe("clock-3",b2);const v2=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Zm=xe("cloud",v2);const w2=[["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"}]],ld=xe("copy",w2);const k2=[["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"}]],Uu=xe("cpu",k2);const E2=[["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"}]],Yv=xe("download",E2);const N2=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],is=xe("earth",N2);const _2=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],S2=xe("ellipsis",_2);const T2=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Uh=xe("external-link",T2);const C2=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],A2=xe("eye-off",C2);const j2=[["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"}]],Bh=xe("eye",j2);const O2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["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"}]],Z1=xe("file-json",O2);const M2=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],Qm=xe("file-pen-line",M2);const R2=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]],Kv=xe("file-plus-2",R2);const D2=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]],z2=xe("file-search",D2);const L2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ma=xe("file-text",L2);const I2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],U2=xe("file-up",I2);const B2=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],$2=xe("flask-conical",B2);const H2=[["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"}]],es=xe("folder-open",H2);const P2=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],F2=xe("folder-plus",P2);const q2=[["path",{d:"M10.7 20H4a2 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.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],G2=xe("folder-search",q2);const Y2=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Vv=xe("folder-tree",Y2);const K2=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],rl=xe("folder",K2);const V2=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],X2=xe("gamepad-2",V2);const Z2=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Xv=xe("git-branch",Z2);const Q2=[["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"}]],J2=xe("globe",Q2);const W2=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],eT=xe("hammer",W2);const tT=[["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"}]],od=xe("hard-drive",tT);const nT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$h=xe("info",nT);const iT=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],zo=xe("key-round",iT);const aT=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],rT=xe("layout-template",aT);const sT=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Hh=xe("link-2",sT);const lT=[["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"}]],Ph=xe("list-checks",lT);const oT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Fh=xe("loader-circle",oT);const cT=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],cd=xe("lock-keyhole",cT);const uT=[["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"}]],dT=xe("log-out",uT);const fT=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],pT=xe("maximize-2",fT);const mT=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],hT=xe("menu",mT);const gT=[["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"}]],Zv=xe("message-square",gT);const xT=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],bT=xe("messages-square",xT);const yT=[["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"}]],qh=xe("monitor",yT);const vT=[["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"}]],Gh=xe("moon",vT);const wT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Yh=xe("package",wT);const kT=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Qv=xe("palette",kT);const ET=[["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"}]],NT=xe("panel-left-close",ET);const _T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],ST=xe("panel-left-open",_T);const TT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],CT=xe("paperclip",TT);const AT=[["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"}]],Lo=xe("pencil",AT);const jT=[["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"}]],OT=xe("play",jT);const MT=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],Kh=xe("plug",MT);const RT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vr=xe("plus",RT);const DT=[["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"}]],zT=xe("radio",DT);const LT=[["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"}]],zi=xe("refresh-cw",LT);const IT=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],wr=xe("rocket",IT);const UT=[["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"}]],Jv=xe("rotate-ccw",UT);const BT=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Wv=xe("rotate-cw",BT);const $T=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],HT=xe("save",$T);const PT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],as=xe("search",PT);const FT=[["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"}]],ew=xe("settings",FT);const qT=[["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"}]],tw=xe("settings-2",qT);const GT=[["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:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],YT=xe("shield-alert",GT);const KT=[["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"}]],kr=xe("shield-check",KT);const VT=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],XT=xe("slash",VT);const ZT=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],QT=xe("sliders-horizontal",ZT);const JT=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],WT=xe("smartphone",JT);const eC=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ui=xe("sparkles",eC);const tC=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],nw=xe("square-terminal",tC);const nC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Vh=xe("square",nC);const iC=[["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"}]],Xh=xe("sun",iC);const aC=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],rC=xe("tablet",aC);const sC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Zh=xe("terminal",sC);const lC=[["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"}]],sa=xe("trash-2",lC);const oC=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],cC=xe("triangle-alert",oC);const uC=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],dC=xe("triangle",uC);const fC=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],pC=xe("unplug",fC);const mC=[["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"}]],Qh=xe("upload",mC);const hC=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],gC=xe("user-round",hC);const xC=[["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"}]],Co=xe("wrench",xC);const bC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bi=xe("x",bC);const yC=[["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"}]],vC=xe("zap",yC),Q1=e=>{let i;const a=new Set,r=(g,x)=>{const b=typeof g=="function"?g(i):g;if(!Object.is(b,i)){const v=i;i=x??(typeof b!="object"||b===null)?b:Object.assign({},i,b),a.forEach(y=>y(i,v))}},o=()=>i,p={setState:r,getState:o,getInitialState:()=>h,subscribe:g=>(a.add(g),()=>a.delete(g))},h=i=e(r,o,p);return p},wC=(e=>e?Q1(e):Q1),kC=e=>e;function EC(e,i=kC){const a=nm.useSyncExternalStore(e.subscribe,nm.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return nm.useDebugValue(a),a}const NC=e=>{const i=wC(e),a=r=>EC(i,r);return Object.assign(a,i),a},Er=(e=>NC);class ts extends Error{status;code;constructor(i,a=0,r="daemon_error"){super(i),this.name="DaemonError",this.status=a,this.code=r}}let Io="",uo=null;function _C(){return Io}async function ud(e){const i=await e.text().catch(()=>"");if(i)try{const a=JSON.parse(i);if(a.error?.message)return new ts(a.error.message,a.error.status??e.status,a.error.code??"daemon_error")}catch{}return new ts(i.trim().slice(0,400)||`The local daemon returned ${e.status}.`,e.status,"daemon_error")}async function cl(e=!1){return uo&&!e||(uo=(async()=>{let i;try{i=await fetch("/api/session",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin"})}catch{throw new ts("OpenSol’s local daemon is not reachable. Start it with “npm start” in the OpenSol folder, then reload this page.",0,"daemon_unreachable")}if(!i.ok)throw await ud(i);const a=await i.json();Io=typeof a.csrf=="string"?a.csrf:""})().catch(i=>{throw uo=null,i})),uo}async function nt(e,i={},a=!0){await cl();const r=(i.method??"GET").toUpperCase(),o=new Headers(i.headers);i.body&&!o.has("Content-Type")&&o.set("Content-Type","application/json"),["GET","HEAD"].includes(r)||o.set("x-maxcode-csrf",Io);let u;try{u=await fetch(e,{...i,method:r,headers:o,credentials:"same-origin"})}catch{throw new ts("Lost the connection to the local daemon. Check that it is still running.",0,"daemon_unreachable")}if(u.status===401&&a)return await cl(!0),nt(e,i,!1);if(!u.ok)throw await ud(u);return u.status===204?void 0:(u.headers.get("content-type")??"").includes("application/json")?await u.json():await u.text()}function dd(e){return{method:"POST",body:JSON.stringify(e)}}function SC(){return nt("/api/state")}function iw(){return nt("/api/plugins")}function TC(e){const i=atob(e),a=new Uint8Array(i.length);for(let r=0;r<i.length;r+=1)a[r]=i.charCodeAt(r);return a}async function aw(e){const i=await nt(`/api/plugins/${encodeURIComponent(e)}/package`);return TC(i.archive)}function CC(e){let i="";for(let a=0;a<e.length;a+=32768)i+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(i)}function rw(e){return nt("/api/plugins",{method:"POST",body:JSON.stringify({archive:CC(e)})})}function AC(e,i){return nt(`/api/plugins/${encodeURIComponent(e)}/grants`,{method:"PUT",body:JSON.stringify(i)})}function J1(e,i){return nt(`/api/plugins/${encodeURIComponent(e)}/safe`,{method:"PUT",body:JSON.stringify({safe:i})})}function jC(e,i){return nt(`/api/plugins/${encodeURIComponent(e)}/enabled`,{method:"PUT",body:JSON.stringify({enabled:i})})}function OC(e){return nt(`/api/plugins/${encodeURIComponent(e)}`,{method:"DELETE"})}function MC(e,i){return nt(`/api/plugins/${encodeURIComponent(e)}/network`,{method:"POST",body:JSON.stringify(i)})}function RC(e){return nt("/api/settings",{method:"PATCH",body:JSON.stringify(e)})}function sw(e){return nt("/api/chats",{method:"PUT",body:JSON.stringify(e)})}function DC(e){return nt("/api/migrate",dd(e))}function zC(){return nt("/api/providers")}function LC(e){return nt(`/api/models?provider=${encodeURIComponent(e)}`)}function IC(e,i){return i?nt(`/api/providers/${e}/key`,{method:"PUT",body:JSON.stringify({apiKey:i})}):nt(`/api/providers/${e}/key`,{method:"DELETE"})}function UC(e){return nt("/api/search/key",{method:"PUT",body:JSON.stringify({apiKey:e})})}function BC(e,i){return nt(`/api/deploy/credentials/${e}`,{method:"PUT",body:JSON.stringify(i)})}function $C(e){return nt("/api/reset",dd({scope:e}))}function HC(e){return nt("/api/workspaces",dd({path:e}))}function PC(){return nt("/api/workspaces",{method:"DELETE"})}function FC(e){return nt(`/api/workspaces?path=${encodeURIComponent(e)}`,{method:"DELETE"})}function qC(){return nt("/api/mcp")}function GC(e){return nt("/api/mcp",{method:"PUT",body:JSON.stringify({servers:e})})}function YC(e,i){return nt(`/api/mcp/${encodeURIComponent(e)}/${i}`,{method:"POST",body:"{}"})}function KC(e){return nt(`/api/mcp/${encodeURIComponent(e)}/authorize`,{method:"POST",body:"{}"})}function VC(e){return nt(`/api/mcp/${encodeURIComponent(e)}/logout`,{method:"POST",body:"{}"})}function XC(e,i,a,r){return nt("/api/mcp/call",{method:"POST",body:JSON.stringify({server:e,tool:i,args:a}),signal:r})}function ZC(e){return nt(`/api/workspaces/browse?path=${encodeURIComponent(e)}`)}function lw(e="",i=6){return nt(`/api/workspace/tree?depth=${i}&path=${encodeURIComponent(e)}`)}function Jm(e){return nt(`/api/workspace/file?path=${encodeURIComponent(e)}`)}function Wm(e,i){return nt("/api/workspace/file",{method:"PUT",body:JSON.stringify({path:e,content:i})})}function QC(e,i){return nt("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"create",path:e,type:i})})}function JC(e,i){return nt("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"rename",from:e,to:i})})}function WC(e){return nt("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"delete",path:e})})}function eA(){return nt("/api/git")}function sn(e,i,a,r,o){return nt("/api/tools/execute",{...dd({name:e,args:i,mode:a,checkpoint:o}),signal:r})}function tA(){return nt("/api/preview/token")}function nA(){return nt("/api/workspace/instructions")}function iA(e){return nt(`/api/checkpoints/${encodeURIComponent(e)}/restore`,{method:"POST",body:JSON.stringify({})})}async function Uo(e,i,a,r,o,u=!0){await cl();let d;try{d=await fetch("/api/llm",{method:"POST",headers:{"Content-Type":"application/json","x-maxcode-csrf":Io},body:JSON.stringify({provider:e,kind:i,model:a,body:r}),signal:o,credentials:"same-origin"})}catch(p){throw p instanceof DOMException&&p.name==="AbortError"?p:new ts("Lost the connection to the local daemon while calling the model.",0,"daemon_unreachable")}if(d.status===401&&u)return await cl(!0),Uo(e,i,a,r,o,!1);if(!d.ok)throw await ud(d);return d}async function*aA(e,i){await cl();let a;try{a=await fetch("/api/deploy",{method:"POST",headers:{"Content-Type":"application/json","x-maxcode-csrf":Io},body:JSON.stringify(e),signal:i,credentials:"same-origin"})}catch(d){throw d instanceof DOMException&&d.name==="AbortError"?d:new ts("Lost the connection to the local daemon while deploying.",0,"daemon_unreachable")}if(!a.ok)throw await ud(a);if(!a.body)throw new ts("The deploy stream was empty.",502,"empty_stream");const r=a.body.getReader(),o=new TextDecoder;let u="";try{for(;;){const{done:p,value:h}=await r.read();if(p)break;u+=o.decode(h,{stream:!0});let g=u.indexOf(`
|
|
10
|
+
`);for(;g!==-1;){const x=u.slice(0,g).trim();if(u=u.slice(g+1),x)try{yield JSON.parse(x)}catch{yield{type:"log",stream:"meta",text:x}}g=u.indexOf(`
|
|
11
|
+
`)}}const d=u.trim();if(d)try{yield JSON.parse(d)}catch{yield{type:"log",stream:"meta",text:d}}}finally{r.releaseLock()}}const Da=Er()(e=>({titling:{},setTitling:(i,a)=>e(r=>{if(!!r.titling[i]===a)return r;const o={...r.titling};return a?o[i]=!0:delete o[i],{titling:o}}),streaming:{},setStreaming:(i,a)=>e(r=>{if(!!r.streaming[i]===a)return r;const o={...r.streaming};return a?o[i]=!0:delete o[i],{streaming:o}})}));function rA(){try{return localStorage.getItem("maxcode.sidebar-collapsed")==="1"}catch{return!1}}function sA(e){try{localStorage.setItem("maxcode.sidebar-collapsed",e?"1":"0")}catch{}}const me=Er()((e,i)=>({sidebarCollapsed:rA(),toggleSidebar:()=>e(a=>{const r=!a.sidebarCollapsed;return sA(r),{sidebarCollapsed:r}}),mobileSidebarOpen:!1,setMobileSidebarOpen:a=>e({mobileSidebarOpen:a}),workspaceOpen:!1,setWorkspaceOpen:a=>e({workspaceOpen:a}),mcpOpen:!1,setMcpOpen:a=>e({mcpOpen:a,...a?{mobileSidebarOpen:!1,settingsOpen:!1}:{}}),settingsOpen:!1,settingsTab:"general",openSettings:(a="general")=>e({settingsOpen:!0,settingsTab:a,mobileSidebarOpen:!1}),closeSettings:()=>e({settingsOpen:!1}),deployOpen:!1,setDeployOpen:a=>e({deployOpen:a}),paletteOpen:!1,setPaletteOpen:a=>e({paletteOpen:a}),composerFocus:0,focusComposer:()=>e(a=>({composerFocus:a.composerFocus+1})),toast:null,notify:(a,r="info")=>e({toast:{id:Date.now()+Math.random(),message:a,tone:r}}),dismissToast:a=>e(r=>r.toast?.id===a?{toast:null}:r),confirm:null,askConfirm:a=>new Promise(r=>{i().confirm&&i().confirm?.resolve(!1),e({confirm:{...a,resolve:r}})}),resolveConfirm:a=>{const r=i().confirm;e({confirm:null}),r?.resolve(a)}}));window.addEventListener("maxcode:notice",e=>{const i=e.detail;i?.message&&me.getState().notify(i.message,i.tone??"info")});const lA={root:"",name:"",available:!1,error:"",workspaces:[]},fo={available:!1,root:"",branch:"",entries:[],error:""};function W1(e,i){return!!(e&&(e===i||e.startsWith(`${i}/`)))}const Be=Er()((e,i)=>({info:lA,root:"",entries:[],truncated:!1,loadingTree:!1,treeError:"",activeFile:null,file:null,content:"",dirty:!1,saving:!1,openingFile:!1,git:fo,gitLoading:!1,instructions:{file:"",content:"",truncated:!1},hydrate:async a=>{e({info:a,root:a.root,treeError:a.available?"":a.error,entries:a.available?i().entries:[],activeFile:a.available?i().activeFile:null,file:a.available?i().file:null,content:a.available?i().content:"",dirty:!1,git:a.available?i().git:fo}),a.available?(await i().loadTree(),i().loadGit(),i().loadInstructions()):e({instructions:{file:"",content:"",truncated:!1}})},loadInstructions:async()=>{if(i().info.available)try{e({instructions:await nA()})}catch{e({instructions:{file:"",content:"",truncated:!1}})}},loadTree:async()=>{const a=i().info;if(!a.available||!a.root){e({entries:[],loadingTree:!1,treeError:a.error});return}e({loadingTree:!0,treeError:""});try{const r=await lw("",7);e({entries:r.entries,truncated:r.truncated,loadingTree:!1,root:r.root,info:r.workspace}),i().loadInstructions()}catch(r){e({loadingTree:!1,treeError:r instanceof Error?r.message:"Could not read the workspace."})}},refresh:async({treeOnly:a=!1}={})=>{if(await i().loadTree(),a)return;const r=i().activeFile;if(!r||i().dirty)return;if(!i().entries.some(u=>u.path===r&&u.type==="file")){e({activeFile:null,file:null,content:"",dirty:!1});return}try{await i().openFile(r,{force:!0})}catch{}},openFile:async(a,{force:r=!1}={})=>{if(!(!a||i().openingFile)&&!(!r&&i().activeFile===a&&i().file)&&!(i().dirty&&!await i().saveFile())){e({openingFile:!0,treeError:""});try{const o=await Jm(a);e({activeFile:a,file:o,content:o.content,dirty:!1,openingFile:!1})}catch(o){e({openingFile:!1,treeError:o instanceof Error?o.message:"Could not open that file."}),me.getState().notify(o instanceof Error?o.message:"Could not open that file.","error")}}},closeFile:()=>e({activeFile:null,file:null,content:"",dirty:!1}),setContent:a=>{i().file?.binary||a!==i().content&&e({content:a,dirty:!0})},saveFile:async()=>{const{activeFile:a,content:r,dirty:o,file:u,saving:d}=i();if(!a||!o||d||u?.binary)return!0;e({saving:!0});try{const p=await Wm(a,r);return e({saving:!1,dirty:!1,file:u&&{...u,size:p.size,mtime:p.mtime,hash:p.hash,truncated:!1}}),me.getState().notify(`Saved ${a}`,"success"),!0}catch(p){return e({saving:!1}),me.getState().notify(p instanceof Error?p.message:"Could not save that file.","error"),!1}},createEntry:async(a,r)=>{await QC(a,r),await i().loadTree(),r==="file"&&await i().openFile(a),me.getState().notify(`${r==="dir"?"Folder":"File"} created: ${a}`,"success")},renameEntry:async(a,r)=>{if(await JC(a,r),await i().loadTree(),W1(i().activeFile,a)){const o=i().activeFile===a?r:`${r}${i().activeFile?.slice(a.length)??""}`;e({activeFile:null,file:null,content:"",dirty:!1}),await i().openFile(o)}me.getState().notify(`Renamed to ${r}`,"success")},deleteEntry:async a=>{await WC(a),W1(i().activeFile,a)&&e({activeFile:null,file:null,content:"",dirty:!1}),await i().loadTree(),me.getState().notify(`Deleted ${a}`,"success")},addWorkspace:async a=>{const r=await HC(a);e({activeFile:null,file:null,content:"",dirty:!1,entries:[]}),await i().hydrate(r.workspace),me.getState().notify(`Workspace set to ${r.entry.name}`,"success")},forgetWorkspace:async()=>{if(i().dirty&&!await i().saveFile())return;const a=await PC();e({info:a,root:"",entries:[],activeFile:null,file:null,content:"",dirty:!1,git:fo,instructions:{file:"",content:"",truncated:!1}})},removeWorkspace:async a=>{const r=i().info.root===a;if(r&&i().dirty&&!await i().saveFile())return;const o=await FC(a);if(!r){e({info:o});return}e({info:o,root:"",entries:[],activeFile:null,file:null,content:"",dirty:!1,git:fo,instructions:{file:"",content:"",truncated:!1}})},loadGit:async()=>{if(i().info.available){e({gitLoading:!0});try{const a=await eA();e({git:{...a},gitLoading:!1})}catch(a){e({git:{...fo,error:a instanceof Error?a.message:"Git status failed."},gitLoading:!1})}}},setActiveFile:a=>{a?i().openFile(a):i().closeFile()}}));function vi(e){const i=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,9)}`;return`${e}_${i}`}function ow(e){if(!e||typeof e!="object")return!1;const i=e;return typeof i.id=="string"&&typeof i.title=="string"&&Array.isArray(i.messages)}function cw(e){let i=0;const a=e.messages.filter(r=>!!(r&&typeof r=="object")).map((r,o)=>{if(r.role==="user")return o>0&&(i+=1),r;const u=typeof r.round=="number"?r.round:i;return r.role==="assistant"?{...r,content:typeof r.content=="string"?r.content:"",reasoning:typeof r.reasoning=="string"?r.reasoning:"",toolCalls:Array.isArray(r.toolCalls)?r.toolCalls:[],round:u}:{...r,round:u}});return{...e,title:e.title.trim()||"New conversation",messages:a,createdAt:typeof e.createdAt=="number"?e.createdAt:Date.now(),updatedAt:typeof e.updatedAt=="number"?e.updatedAt:Date.now(),mode:e.mode==="plan"?"plan":e.mode==="build"?"build":void 0,workspace:typeof e.workspace=="string"?e.workspace:void 0,titleSource:e.titleSource==="ai"||e.titleSource==="user"||e.titleSource==="auto"?e.titleSource:void 0}}function oA(e){const i=e.replace(/\s+/g," ").trim();return i?i.length>56?`${i.slice(0,56).trim()}…`:i:"New conversation"}const Ye=Er()((e,i)=>({sessions:[],activeId:null,hydrated:!1,hydrate:a=>{const r=(a.sessions??[]).filter(ow).map(cw).sort((u,d)=>d.updatedAt-u.updatedAt),o=typeof a.activeId=="string"&&r.some(u=>u.id===a.activeId)?a.activeId:r[0]?.id??null;e({sessions:r,activeId:o,hydrated:!0})},setActive:a=>e({activeId:a}),newChat:()=>e({activeId:null}),createSession:(a,r,o)=>{const u=vi("chat"),d=Date.now(),p={id:u,title:"New conversation",createdAt:d,updatedAt:d,messages:[],provider:a,model:r,mode:o,workspace:Be.getState().info.root||void 0,titleSource:"auto"};return e(h=>({sessions:[p,...h.sessions],activeId:u})),u},addMessage:(a,r)=>{e(o=>({sessions:o.sessions.map(u=>{if(u.id!==a)return u;const d={messages:[...u.messages,r],updatedAt:Date.now()};return r.role==="user"&&u.messages.length===0&&(d.title=oA(r.content)),{...u,...d}})}))},updateMessage:(a,r,o)=>{e(u=>({sessions:u.sessions.map(d=>{if(d.id!==a)return d;let p=!1;const h=d.messages.map(g=>{if(g.id!==r)return g;const x=typeof o=="function"?o(g):o;return!x||Object.keys(x).length===0?g:(p=!0,{...g,...x})});return p?{...d,messages:h,updatedAt:Date.now()}:d})}))},updateSession:(a,r)=>{e(o=>({sessions:o.sessions.map(u=>u.id===a?{...u,...r,updatedAt:Date.now()}:u)}))},renameSession:(a,r)=>{const o=r.trim();o&&i().updateSession(a,{title:o,titleSource:"user"})},deleteSession:a=>{e(r=>{const o=r.sessions.filter(u=>u.id!==a);return{sessions:o,activeId:r.activeId===a?o[0]?.id??null:r.activeId}})},clearAll:()=>e({sessions:[],activeId:null}),persistNow:async()=>{const{sessions:a,activeId:r}=i();await sw({sessions:a,activeId:r})}}));let fd=!1,Jr,sl;function cA(){fd=!0}function uA(){!fd||typeof window>"u"||(Jr!==void 0&&window.clearTimeout(Jr),Jr=window.setTimeout(()=>{Jr=void 0,e0()},900),sl===void 0&&(sl=window.setTimeout(()=>{sl=void 0,e0()},6e3)))}async function e0(){if(!fd)return;Jr!==void 0&&(window.clearTimeout(Jr),Jr=void 0),sl!==void 0&&(window.clearTimeout(sl),sl=void 0);const{sessions:e,activeId:i}=Ye.getState();try{await sw({sessions:e,activeId:i})}catch(a){window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:a instanceof Error?a.message:"Could not save conversations to the local daemon.",tone:"error"}}))}}Ye.subscribe(uA);if(typeof window<"u"){const e=()=>{if(!fd)return;const{sessions:i,activeId:a}=Ye.getState();try{const r=JSON.stringify({sessions:i,activeId:a});if(r.length>6e4)return;fetch("/api/chats",{method:"PUT",keepalive:!0,headers:{"Content-Type":"application/json","x-maxcode-csrf":_C()},body:r}).catch(()=>{})}catch{}};window.addEventListener("beforeunload",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()})}function uw(){const e=Ye.getState().sessions,i=new Blob([JSON.stringify({app:"OpenSol",exportedAt:new Date().toISOString(),sessions:e},null,2)],{type:"application/json"}),a=URL.createObjectURL(i),r=document.createElement("a");r.href=a,r.download=`maxcode-history-${new Date().toISOString().slice(0,10)}.json`,r.click(),URL.revokeObjectURL(a)}function dA(e){return e.text().then(i=>{const a=JSON.parse(i);if(!Array.isArray(a.sessions))throw new Error("This file does not contain a OpenSol history.");const r=a.sessions.filter(ow).map(cw);if(r.length===0)throw new Error("No valid conversations were found in this file.");const o=new Set(Ye.getState().sessions.map(d=>d.id)),u=r.filter(d=>!o.has(d.id));return Ye.setState(d=>({sessions:[...u,...d.sessions],activeId:u[0]?.id??d.activeId})),u.length})}const dw=[{id:"skill-debugger",name:"Systematic debugger",description:"Reproduce, isolate and verify a bug before fixing it.",enabled:!1,builtIn:!0,instructions:`When debugging:
|
|
12
|
+
1. Reproduce the failure and capture the exact output.
|
|
13
|
+
2. Read the relevant source before changing anything.
|
|
14
|
+
3. Form one hypothesis at a time. Prove or disprove it with a command or a focused test.
|
|
15
|
+
4. Fix the root cause, not the symptom. Add a regression test when a test setup exists.
|
|
16
|
+
5. Re-run the reproduction and report the real result. Never claim a fix without evidence.`},{id:"skill-reviewer",name:"Code reviewer",description:"Review changes for correctness, regressions and clarity.",enabled:!1,builtIn:!0,instructions:`Act as a rigorous senior reviewer. Inspect the whole change, then report only issues that matter:
|
|
17
|
+
- correctness and edge cases
|
|
18
|
+
- security and data loss risks
|
|
19
|
+
- broken public behavior or missing migrations
|
|
20
|
+
- needless abstraction, duplicated logic and swallowed errors
|
|
21
|
+
Order findings by severity and cite the file and line. Do not rewrite code unless asked. If you find nothing substantive, say so plainly.`},{id:"skill-brainstorm",name:"Brainstorm",description:"Explore the problem space before committing to a design.",enabled:!1,builtIn:!0,instructions:`When brainstorming:
|
|
22
|
+
1. Restate the real problem and the constraints that cannot move. Ask one short question only if a decision genuinely blocks progress.
|
|
23
|
+
2. Produce several genuinely different directions, not variations of the first idea. Name the trade-off each one makes.
|
|
24
|
+
3. Look for the smallest version that proves the idea. Prefer reversible steps.
|
|
25
|
+
4. Stress-test the leading option against failure modes, cost, maintenance and the user's actual workflow.
|
|
26
|
+
5. Finish with a recommendation, the assumptions behind it, and what would change your mind.
|
|
27
|
+
Do not start editing until the direction is chosen.`},{id:"skill-frontend",name:"Frontend craftsman",description:"Build interfaces with considered typography, spacing and states.",enabled:!1,builtIn:!0,instructions:`For interface work:
|
|
28
|
+
- Establish a small token system: base palette, one accent, type scale, spacing rhythm.
|
|
29
|
+
- Prefer one distinctive, purposeful moment over scattered decoration.
|
|
30
|
+
- Design empty, loading, error, disabled and mobile states, not just the happy path.
|
|
31
|
+
- Keep contrast accessible, focus rings visible, and respect reduced motion.
|
|
32
|
+
- Use real copy that names things by what people understand. No filler labels.`}],fA=`# Skill name
|
|
33
|
+
|
|
34
|
+
Describe what this skill is for in one sentence.
|
|
35
|
+
|
|
36
|
+
## Instructions
|
|
37
|
+
|
|
38
|
+
- What the agent should do
|
|
39
|
+
- Constraints it must respect
|
|
40
|
+
- How to verify the result
|
|
41
|
+
`,Bu=[{id:"openai",name:"OpenAI",format:"openai",baseUrl:"https://api.openai.com/v1",keyHint:"sk-…",note:"GPT and Codex models. Requests are made by your local daemon, never by OpenSoftX."},{id:"anthropic",name:"Anthropic",format:"anthropic",baseUrl:"https://api.anthropic.com/v1",keyHint:"sk-ant-…",note:"Claude models, including extended thinking where the model supports it."},{id:"google",name:"Google",format:"gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta",keyHint:"AIza…",note:"Gemini models through the Generative Language API."},{id:"opencode",name:"OpenCode",format:"openai",baseUrl:"https://opencode.ai/inference/v1",keyHint:"OpenCode API key",note:"OpenCode routes each model to its native API. Free-tier models only work inside OpenCode and are hidden."},{id:"deepseek",name:"DeepSeek",format:"openai",baseUrl:"https://api.deepseek.com",keyHint:"sk-…",note:"DeepSeek chat and reasoning models."},{id:"openrouter",name:"OpenRouter",format:"openai",baseUrl:"https://openrouter.ai/api/v1",keyHint:"sk-or-…",note:"One key for hundreds of models and providers."},{id:"groq",name:"Groq",format:"openai",baseUrl:"https://api.groq.com/openai/v1",keyHint:"gsk_…"},{id:"mistral",name:"Mistral",format:"openai",baseUrl:"https://api.mistral.ai/v1",keyHint:"…"},{id:"xai",name:"xAI",format:"openai",baseUrl:"https://api.x.ai/v1",keyHint:"xai-…"},{id:"together",name:"Together AI",format:"openai",baseUrl:"https://api.together.xyz/v1",keyHint:"…"},{id:"ollama",name:"Ollama",format:"openai",baseUrl:"http://localhost:11434/v1",keyless:!0,keyHint:"Not required",note:"Runs on your machine. The daemon reaches it at localhost; no data leaves your computer."},{id:"custom",name:"Custom endpoint",format:"openai",baseUrl:"",keyHint:"Optional",note:"Any OpenAI-compatible endpoint or proxy you control."}],aa=Object.fromEntries(Bu.map(e=>[e.id,e]));function Jh(e){return aa[e]?.name??e}const t0=["none","minimal","low","medium","high","xhigh","max"],Wh={none:{label:"None",description:"Disable extra reasoning"},minimal:{label:"Minimal",description:"Very light reasoning"},low:{label:"Low",description:"Fast, lighter reasoning"},medium:{label:"Medium",description:"Balanced reasoning"},high:{label:"High",description:"Deeper reasoning, slower"},xhigh:{label:"Extra high",description:"Very deep reasoning"},max:{label:"Max",description:"Maximum effort the model allows"}};function $u(e){return Wh[e]?.label??e}function Nr(e){return e?.reasoningOptions.find(a=>a.type==="effort")?.values??[]}function fw(e){return e?.reasoningOptions.find(i=>i.type==="budget_tokens")}function Hu(e){return!!fw(e)}function pw(e){return!!e?.reasoningOptions.some(i=>i.type==="toggle")}function mw(e){const i=Nr(e);if(i.length===0)return"medium";for(const a of["medium","high","low"])if(i.includes(a))return a;return i[0]}function ul(e,i){const a=Nr(i);return a.length===0||a.includes(e)?e:mw(i)}function pA(e,i){const a=fw(i),r=Math.max(0,a?.min??1024),o=Math.max(r,a?.max??32768);return Math.max(r,Math.min(o,e))}const mA={none:1024,minimal:1024,low:2048,medium:8192,high:16384,xhigh:24576,max:32768};function hw(e,i){return pA(mA[e]??8192,i)}function Ao(e){return[...Nr(e)].sort((a,r)=>t0.indexOf(a)-t0.indexOf(r))}function eh(e){if(!e)return"Choose a model to see live reasoning controls.";const i=Nr(e);return i.length>0?`Effort levels from this model: ${i.join(", ")}.`:Hu(e)?"This model accepts a thinking token budget, derived from the effort level.":pw(e)?"This model controls reasoning itself; no effort value is sent.":"This model advertises no reasoning controls, so effort does not apply."}const gw=[{id:"light",label:"Light",dark:!1},{id:"dark",label:"Dark",dark:!0},{id:"night-owl",label:"Night Owl",dark:!0},{id:"claude-code",label:"Claude Code",dark:!0},{id:"flame",label:"Flame",dark:!0}],hA=/^[a-z0-9][a-z0-9:_-]{0,79}$/,eg=new Map(gw.map(e=>[e.id,e]));function xw(e){eg.set(e.id,e)}function bw(e){gw.some(i=>i.id===e)||eg.delete(e)}function yw(e){return typeof e=="string"&&hA.test(e)}function vw(e,i){return e==="system"?i?"dark":"light":yw(e)?e:"light"}function th(e,i){return eg.get(vw(e,i))?.dark??!1}function gA(e){return e==="system"?"system":yw(e)?e:"system"}const Pu=`You are OpenSol, a senior web engineer and coding agent built by OpenSoftX.
|
|
42
|
+
|
|
43
|
+
You work directly in the user's open folder through a local daemon. The shell, file, git, search and deploy tools are real. Never describe tool output you did not receive.
|
|
44
|
+
|
|
45
|
+
Engineering standard:
|
|
46
|
+
- Read every file you change. Match the existing stack, style, naming and conventions. Never invent APIs, versions, flags, package names or paths.
|
|
47
|
+
- Make the smallest correct change. One concern per edit. No speculative abstraction, dead code, placeholder TODOs or swallowed errors.
|
|
48
|
+
- Keep public behavior stable unless the task explicitly changes it.
|
|
49
|
+
- Security: never expose secrets, never weaken auth, CSRF, CSP or validation to make something pass, and validate untrusted input at boundaries.
|
|
50
|
+
- Accessibility: semantic HTML, keyboard paths, visible focus, sufficient contrast.
|
|
51
|
+
- Performance: avoid needless work; measure before optimizing.
|
|
52
|
+
- Every bug fix gets a regression test when a test setup exists. Tests assert behavior, not implementation.
|
|
53
|
+
|
|
54
|
+
Working loop:
|
|
55
|
+
1. Inspect before editing: list files, read the relevant source, grep for call sites, check git status.
|
|
56
|
+
2. For non-trivial work, state a short plan.
|
|
57
|
+
3. Edit in small, coherent steps.
|
|
58
|
+
4. Verify with the project's real commands (typecheck, lint, tests, build) and read the output.
|
|
59
|
+
5. Report what changed, which files, and what was verified. If a check fails or cannot run, say so plainly and explain why.
|
|
60
|
+
|
|
61
|
+
Never claim a check passed without running it. Ask only when a decision is genuinely ambiguous or destructive. Answer in the user's language. Cite web sources as links, and only when you actually read them.`,nh={shell:{enabled:!0,approval:"ask"},read_file:{enabled:!0,approval:"auto"},list_files:{enabled:!0,approval:"auto"},write_file:{enabled:!0,approval:"auto"},edit_file:{enabled:!0,approval:"auto"},rewrite_file:{enabled:!0,approval:"auto"},grep:{enabled:!0,approval:"auto"},web_search:{enabled:!0,approval:"auto"},read_url:{enabled:!0,approval:"auto"},git:{enabled:!0,approval:"ask"},subagent:{enabled:!0,approval:"ask"}},Aa={provider:"openai",model:"",effort:"medium",webSearchEnabled:!0,temperature:.4,maxTokens:8192,systemPrompt:Pu,providers:{},searchProvider:"duckduckgo",tools:nh,skills:dw,theme:"system",showTokenEstimate:!0,mode:"build",chatFontSize:15,workDetail:"detailed",autoCollapseWork:!0,aiSessionTitles:!0},xA=new Set(["none","minimal","low","medium","high","xhigh","max"]);function ww(e,i="error"){typeof window>"u"||window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:e,tone:i}}))}function bA(e){const i={};for(const a of Object.keys(nh))i[a]={...nh[a],...e?.[a]??{}};return i}function yA(e){const i=new Map;for(const a of dw)i.set(a.id,a);for(const a of e??[])!a||typeof a.id!="string"||i.set(a.id,{...i.get(a.id)??{},...a,builtIn:a.builtIn??i.has(a.id)});return[...i.values()]}function vA(e){return typeof e!="string"||!e.trim()||/sandboxed workspace stored in the user's browser/i.test(e)||/There is no node, npm, git or network in the shell/i.test(e)||/workspace root is \/workspace/i.test(e)?Pu:e}function wA(e){const i={};for(const[a,r]of Object.entries(e??{}))!(a in aa)||!r||typeof r!="object"||typeof r.baseUrl=="string"&&r.baseUrl.trim()&&(i[a]={baseUrl:r.baseUrl.trim()});return i}function kA(e){const i=e??{},a=typeof i.provider=="string"&&i.provider in aa?i.provider:Aa.provider,r=i.mode==="plan"?"plan":i.mode==="build"?"build":Aa.mode;return{...Aa,...i,provider:a,model:typeof i.model=="string"?i.model.trim():"",mode:r,effort:typeof i.effort=="string"&&xA.has(i.effort)?i.effort:Aa.effort,webSearchEnabled:i.webSearchEnabled!==!1,showTokenEstimate:i.showTokenEstimate!==!1,temperature:typeof i.temperature=="number"&&Number.isFinite(i.temperature)?Math.max(0,Math.min(2,i.temperature)):Aa.temperature,maxTokens:typeof i.maxTokens=="number"&&Number.isFinite(i.maxTokens)?Math.max(256,Math.min(2e5,Math.round(i.maxTokens))):Aa.maxTokens,systemPrompt:vA(i.systemPrompt),providers:wA(i.providers),searchProvider:i.searchProvider&&["duckduckgo","tavily","brave","serper"].includes(i.searchProvider)?i.searchProvider:Aa.searchProvider,tools:bA(i.tools),skills:yA(i.skills),theme:gA(i.theme),chatFontSize:typeof i.chatFontSize=="number"&&Number.isFinite(i.chatFontSize)?Math.max(12,Math.min(20,Math.round(i.chatFontSize))):Aa.chatFontSize,workDetail:i.workDetail==="concise"?"concise":"detailed",autoCollapseWork:i.autoCollapseWork!==!1,aiSessionTitles:i.aiSessionTitles!==!1}}let tg=!1,ll={},ol,ko;function kw(e){const i={},a=["provider","model","effort","webSearchEnabled","temperature","maxTokens","systemPrompt","providers","searchProvider","tools","skills","theme","showTokenEstimate","mode","chatFontSize","workDetail","autoCollapseWork","aiSessionTitles"];for(const r of a)r in e&&(i[r]=e[r]);return i}function ih(){if(!tg||Object.keys(ll).length===0)return Promise.resolve();const e=kw(ll);return ll={},ol!==void 0&&window.clearTimeout(ol),ko!==void 0&&window.clearTimeout(ko),ol=void 0,ko=void 0,RC(e).then(()=>{}).catch(i=>{ww(i instanceof Error?i.message:"Could not save settings to the local daemon.")})}function ja(e){tg&&(ll={...ll,...kw(e)},ol!==void 0&&window.clearTimeout(ol),ol=window.setTimeout(()=>{ih()},550),ko===void 0&&(ko=window.setTimeout(()=>{ih()},4e3)))}function EA(){tg=!0,Object.keys(ll).length>0&&ja({})}const Oe=Er()((e,i)=>({...Aa,hydrated:!1,daemon:null,secretStatus:null,providerStatus:[],deployTools:null,deploySecrets:null,secretsError:"",hydrate:a=>{const r=kA(a.settings),o=a.providers,u=o.filter(d=>d.configured);!ah(r,o,r.provider)&&u.length>0&&(r.provider=u[0].id,r.model=""),ah(r,o,r.provider)||(r.model=""),e({...r,hydrated:!0,daemon:a,secretStatus:a.secrets,providerStatus:o,deployTools:a.deployTools,deploySecrets:a.deploySecrets,secretsError:a.secretsError})},update:a=>{e(a),ja(a)},selectModel:(a,r,o)=>{const u=o??i().effort,d={provider:a,model:r.trim(),effort:u};e(d),ja(d)},updateProvider:(a,r)=>{const o={providers:{...i().providers,[a]:{...i().providers[a]??{},...r}}};e(o),ja(o)},saveProviderKey:async(a,r)=>{const o=await IC(a,r.trim()),u=pd(i(),a);e(d=>{const p=d.secretStatus?{...d.secretStatus,providers:{...d.secretStatus.providers,[a]:{configured:o.configured,hint:o.hint}}}:d.secretStatus,h=d.providerStatus.map(v=>v.id===a?{...v,configured:o.configured,hint:o.hint}:v),g=o.configured?!dl(d)||d.provider===a:!1,x=d.provider===a&&!o.configured,b={};return g&&(b.provider=a),x&&(b.model=""),{secretStatus:p,providerStatus:h,...b}}),!u&&o.configured&&ww(`${aa[a]?.name??a} is connected.`,"success")},saveSearchKey:async a=>{const r=await UC(a.trim());e(o=>({secretStatus:o.secretStatus?{...o.secretStatus,search:{configured:r.configured,hint:r.hint}}:o.secretStatus}))},saveDeployCredentials:async(a,r)=>{const o=await BC(a,r);e(u=>({secretStatus:u.secretStatus?{...u.secretStatus,deploy:{...u.secretStatus.deploy,[a]:o}}:u.secretStatus,deploySecrets:u.deploySecrets?{...u.deploySecrets,[a]:o}:u.deploySecrets}))},refreshProviders:async()=>{const a=await zC();e({providerStatus:a.providers})},updateTool:(a,r)=>{const o={tools:{...i().tools,[a]:{...i().tools[a],...r}}};e(o),ja(o)},addSkill:a=>{const r={skills:[...i().skills,a]};e(r),ja(r)},updateSkill:(a,r)=>{const o={skills:i().skills.map(u=>u.id===a?{...u,...r}:u)};e(o),ja(o)},removeSkill:a=>{const r={skills:i().skills.filter(o=>o.id!==a)};e(r),ja(r)},setMode:a=>{const r={mode:a};e(r),ja(r)},flush:()=>ih()}));function li(e){return e.model.trim()}function pd(e,i){return ah(e,Oe.getState().providerStatus,i)}function ah(e,i,a){const r=aa[a];if(!r)return!1;const o=i.find(u=>u.id===a);return o?o.configured:a==="custom"?!!e.providers.custom?.baseUrl?.trim():!!r.keyless}function dl(e){return pd(e,e.provider)}typeof window<"u"&&(window.addEventListener("beforeunload",()=>{Oe.getState().flush()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Oe.getState().flush()}));function Fu(e){return e==null}function za(e,i,a){return Object.defineProperty(e,i,{writable:!0,value:a,enumerable:!1})}function rh(e,i){return arguments.length===1?a=>rh(e,a):e in globalThis&&i instanceof globalThis[e]||Object.prototype.toString.call(i).slice(8,-1)===e}function Ew(e){return rh("ArrayBuffer",e)||rh("SharedArrayBuffer",e)}function NA(e){return Ew(e)||ArrayBuffer.isView(e)}var fl;(e=>{e.is=Ew,e.isSource=NA;function i(d){return ArrayBuffer.isView(d)?d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength):d}e.fromSource=i;function a(d){if(d=i(d),typeof Buffer<"u")return Buffer.from(d).toString("base64");let p="";const h=new Uint8Array(d);for(let g=0;g<h.byteLength;g++)p+=String.fromCharCode(h[g]);return btoa(p)}e.toBase64=a;function r(d){return typeof Buffer<"u"?i(Buffer.from(d,"base64")):Uint8Array.from(atob(d),p=>p.charCodeAt(0))}e.fromBase64=r;function o(d){return d=i(d),typeof Buffer<"u"?Buffer.from(d).toString("hex"):Array.from(new Uint8Array(d),p=>p.toString(16).padStart(2,"0")).join("")}e.toHex=o;function u(d){if(typeof Buffer<"u")return i(Buffer.from(d,"hex"));const p=d.length%2===0?d:d.slice(0,d.length-1),h=[];for(let g=0;g<p.length;g+=2)h.push(parseInt(`${p[g]}${p[g+1]}`,16));return Uint8Array.from(h).buffer}e.fromHex=u})(fl||(fl={}));fl.fromBase64;fl.toBase64;fl.fromHex;fl.toHex;function _A(e,i,a){const r=[];let o=0;for(let u=0;u<e.length;u++){const d=e.charCodeAt(u);if(d>=65&&d<=90){if(o===1){const p=e.charCodeAt(u+1);p>=97&&p<=122&&r.push(a),r.push(d+32)}else o!==0&&r.push(a),r.push(d+32);o=1}else d>=97&&d<=122?(r.push(d),o=2):i.includes(d)?(o!==0&&r.push(a),o=0):r.push(d)}return String.fromCharCode(...r)}function SA(e){return _A(e,[45,95],45)}var TA=SA,n0;(e=>{e.millisecond=1,e.second=1e3,e.minute=e.second*60,e.hour=e.minute*60,e.day=e.hour*24,e.week=e.day*7;let i=new Date().getTimezoneOffset();function a(y){i=y}e.setTimezoneOffset=a;function r(){return i}e.getTimezoneOffset=r;function o(y=new Date,k){return typeof y=="number"&&(y=new Date(y)),k===void 0&&(k=i),Math.floor((y.valueOf()/e.minute-k)/1440)}e.getDateNumber=o;function u(y,k){const _=new Date(y*e.day);return k===void 0&&(k=i),new Date(+_+k*e.minute)}e.fromDateNumber=u;const d=/\d+(?:\.\d+)?/.source,p=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(y=>`(${d}${y})?`).join("")}$`);function h(y){const k=p.exec(y);return k?(parseFloat(k[1])*e.week||0)+(parseFloat(k[2])*e.day||0)+(parseFloat(k[3])*e.hour||0)+(parseFloat(k[4])*e.minute||0)+(parseFloat(k[5])*e.second||0):0}e.parseTime=h;function g(y){const k=h(y);return k?y=Date.now()+k:/^\d{1,2}(:\d{1,2}){1,2}$/.test(y)?y=`${new Date().toLocaleDateString()}-${y}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(y)&&(y=`${new Date().getFullYear()}-${y}`),y?new Date(y):new Date}e.parseDate=g;function x(y){const k=Math.abs(y);return k>=e.day-e.hour/2?Math.round(y/e.day)+"d":k>=e.hour-e.minute/2?Math.round(y/e.hour)+"h":k>=e.minute-e.second/2?Math.round(y/e.minute)+"m":k>=e.second?Math.round(y/e.second)+"s":y+"ms"}e.format=x;function b(y,k=2){return y.toString().padStart(k,"0")}e.toDigits=b;function v(y,k=new Date){return y.replace("yyyy",k.getFullYear().toString()).replace("yy",k.getFullYear().toString().slice(2)).replace("MM",b(k.getMonth()+1)).replace("dd",b(k.getDate())).replace("hh",b(k.getHours())).replace("mm",b(k.getMinutes())).replace("ss",b(k.getSeconds())).replace("SSS",b(k.getMilliseconds(),3))}e.template=v})(n0||(n0={}));var CA=Object.defineProperty,je=(e,i)=>CA(e,"name",{value:i,configurable:!0}),ng=class{static{je(this,"DisposableList")}sn=0;map=new Map;weak=new WeakMap;get length(){return this.map.size}push(e){const i=++this.sn;return this.map.set(i,e),this.weak.set(e,i),()=>this.map.delete(i)}delete(e){const i=this.weak.get(e);return i?this.map.delete(i):!1}clear(){const e=[...this.map.values()];return this.map.clear(),e.reverse()}[Symbol.iterator](){return this.map.values()}[Symbol.for("nodejs.util.inspect.custom")](){return[...this]}},ve={shadow:Symbol.for("cordis.shadow"),caller:Symbol.for("cordis.caller"),receiver:Symbol.for("cordis.receiver"),original:Symbol.for("cordis.original"),decorator:Symbol.for("cordis.decorator"),initHooks:Symbol.for("cordis.initHooks"),checkProto:Symbol.for("cordis.checkProto"),root:Symbol.for("cordis.root"),effect:Symbol.for("cordis.effect"),filter:Symbol.for("cordis.filter"),isolate:Symbol.for("cordis.isolate"),intercept:Symbol.for("cordis.intercept"),init:Symbol.for("cordis.init"),check:Symbol.for("cordis.check"),invoke:Symbol.for("cordis.invoke"),metadata:Symbol.for("cordis.metadata"),extend:Symbol.for("cordis.extend"),tracker:Symbol.for("cordis.tracker"),mergeIntercept:Symbol.for("cordis.mergeIntercept"),resolveIntercept:Symbol.for("cordis.resolveIntercept")},AA=function*(){}.constructor,i0=async function*(){}.constructor;function Nw(e){return!(!e.prototype||e instanceof AA||i0!==Function&&e instanceof i0)}je(Nw,"isConstructor");function md(e,i){if(e===Object.prototype)return i;const a=Object.create(md(Object.getPrototypeOf(e),i));for(const r of Reflect.ownKeys(e))Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(e,r));return a}je(md,"joinPrototype");function jo(e){return e&&(typeof e=="object"||typeof e=="function")}je(jo,"isObject");function ig(e,i){let a=e;for(;a;){const r=Reflect.getOwnPropertyDescriptor(a,i);if(r)return r;a=Object.getPrototypeOf(a)}}je(ig,"getPropertyDescriptor");function yr(e,i){if(!jo(i))return i;if(Object.hasOwn(i,ve.shadow))return Object.getPrototypeOf(i);const a=i[ve.tracker];return a?hd(e,i,a):i}je(yr,"getTraceable");function Oo(e,i){return i?new Proxy(e,{get:je((a,r,o)=>r in i&&r!=="constructor"?Reflect.get(i,r,o):Reflect.get(a,r,o),"get"),set:je((a,r,o,u)=>r in i&&r!=="constructor"?Reflect.set(i,r,o,u):Reflect.set(a,r,o,u),"set")}):e}je(Oo,"withProps");function qu(e,i,a){return Oo(e,Object.defineProperty(Object.create(null),i,{value:a,writable:!1}))}je(qu,"withProp");function vo(e,i,a,r){if(!a)return r;const o=ig(i,a)?.value;if(!o)return r;const u=o[ve.shadow]??o;return qu(r,a,e.extend({[ve.shadow]:u}))}je(vo,"createShadow");function _w(e,i,a,r){return new Proxy(i,{apply:je((o,u,d)=>(u===a&&(u=r),yr(e,Reflect.apply(o,u,d))),"apply")})}je(_w,"createShadowMethod");function hd(e,i,a){const r=e[ve.shadow]??e,o=e[ve.shadow]?Object.getPrototypeOf(e):e,u=new Proxy(i,{get:je((d,p,h)=>{if(p===ve.original)return d;if(p===ve.caller)return r;if(p===a.property)return o;if(typeof p=="symbol")return Reflect.get(d,p,h);if(a.associate&&o.reflect.props[`${a.associate}.${p}`])return Reflect.get(e,`${a.associate}.${p}`,qu(e,ve.receiver,h));let g,x;const b=ig(d,p);b&&"value"in b?x=b.value:(g=vo(o,d,a.property,h),x=Reflect.get(d,p,g));const v=x?.[ve.tracker];return v?hd(o,x,v):!a.noShadow&&typeof x=="function"?(g??=vo(o,d,a.property,h),_w(o,x,h,g)):x},"get"),set:je((d,p,h,g)=>{if(p===ve.original||p===ve.caller||p===a.property)return!1;if(typeof p=="symbol")return Reflect.set(d,p,h,g);if(a.associate&&o.reflect.props[`${a.associate}.${p}`])return Reflect.set(e,`${a.associate}.${p}`,h,qu(e,ve.receiver,g));const x=vo(o,d,a.property,g);return Reflect.set(d,p,h,x)},"set"),apply:je((d,p,h)=>{const g=a.noShadow?u:vo(o,d,a.property,u);return Sw(g,d,p,h)},"apply")});return u}je(hd,"createTraceable");function Sw(e,i,a,r){return i[ve.invoke]?i[ve.invoke].apply(e,r):Reflect.apply(i,a,r)}je(Sw,"applyTraceable");function Gu(e,i,a){const r=je(function(...o){const u=hd(r.ctx,r,a);return Reflect.apply(u,this,o)},"self");return za(r,"name",e),Object.setPrototypeOf(r,i)}je(Gu,"createCallable");function sh(e,i,a){const r=e.error.stack.split(`
|
|
62
|
+
`);if(typeof i?.stack!="string"){const d=new Error(i),p=d.stack.split(`
|
|
63
|
+
`);throw p.splice(1,1/0,...a()),d.stack=p.join(`
|
|
64
|
+
`),d}const o=i.stack.split(`
|
|
65
|
+
`);let u=o.indexOf(r[2]);if(u===-1)throw i;for(u-=e.offset;u>0&&o[u-1].endsWith(" (<anonymous>)");)u-=1;throw o.splice(u,1/0,...a()),i.stack=o.join(`
|
|
66
|
+
`),i}je(sh,"handleError");function lh(e,i=gd()){const a={offset:1,error:new Error};try{const r=e(a);return jo(r)&&"then"in r?r.then(void 0,o=>sh(a,o,i)):r}catch(r){sh(a,r,i)}}je(lh,"composeError");function gd(e=0){const i=new Error;return()=>i.stack.split(`
|
|
67
|
+
`).slice(3+e)}je(gd,"buildOuterStack");var Tw=Symbol.for("ValidationError"),Cw=class oh extends TypeError{constructor(i){super(`invalid config:
|
|
68
|
+
`+i.map(a=>a.path?.length?` - ${a.message} (at ${oh.formatPath(a.path)})`:` - ${a.message}`).join(`
|
|
69
|
+
`)),this.issues=i}issues;static{je(this,"ValidationError")}name="ValidationError";static is(i){return!!i?.[Tw]}static normalizePath(i=[]){return i.map(a=>typeof a=="object"?a.key:a)}static formatPath(i){return oh.normalizePath(i).map(String).join(".")}};Object.defineProperty(Cw.prototype,Tw,{value:!0});function Aw(e,i){if(!e.Config)return i;const a=e.Config["~standard"].validate(i);if("then"in a)throw new TypeError("Async config validation is not supported");if(a.issues)throw new Cw(a.issues);return a.value}je(Aw,"resolveConfig");var ch=class jw extends Error{constructor(i,a){super(a??jw.Code[i]),this.code=i}code;static{je(this,"CordisError")}};(e=>{e.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(ch||(ch={}));var Ca="__INACTIVE__",Ow=class{constructor(e,i,a,r,o){this.parent=e,this.config=i,this.inject=a,this.runtime=r;const u=je(d=>{this._disposables.push(d)},"collect");if(r){this.uid=e.registry.counter,this.ctx=this.context=e.extend({fiber:this}),this._runner={epoch:Ca,getOuterStack:o,execute:je(function(){const d=this._resolve(this.config);if(Nw(r.callback)){const p=new r.callback(this.ctx,d);for(const h of p?.[ve.initHooks]??[])h();return p?.[ve.init]?.()}else return r.callback(this.ctx,d)},"execute"),collect:u},this.context.emit("internal/plugin",this);for(const d of Object.keys(this.inject))this._checkImpl(d);this.dispose=e.fiber.effect(()=>{const d=r.fibers.push(this);try{this._refresh()}catch(p){this.ctx.logger.error(p),this._error=p}return async()=>{for(this.uid=null,this.context.emit("internal/plugin",this),this.ctx.registry.has(r.callback)&&(d(),r.fibers.length||this.ctx.registry.delete(r.callback)),this._setEpoch(Ca);this.inertia;)await this.inertia;this._updateState(()=>{})}},"ctx.plugin()")}else this.uid=0,this.ctx=this.context=e,this.state=2,this.committed=Object.create(null),this._runner={epoch:"0",getOuterStack:o,execute:je(()=>{},"execute"),collect:u},this.dispose=()=>this.restart()}parent;config;inject;runtime;static{je(this,"Fiber")}uid;ctx;state=0;dispose;committed;provisions=new Set;inertia;_hooks=Object.create(null);_disposables=new ng;context;_error;_revision=0;_runner;_store=Object.create(null);_release;get name(){let e=this;do{if(e.runtime?.name)return e.runtime.name;e=e.parent.fiber}while(e!==e.parent.fiber);return"root"}assertActive(){if(this.uid===null)throw new ch("INACTIVE_EFFECT")}_resolve(e){return this.context.waterfall("internal/config",this,()=>e)}_execute(e){const i=e.epoch;return lh(a=>{const r=je(u=>{if(typeof u=="function")e.collect(u);else if(!Fu(u))throw new TypeError("Invalid effect")},"safeCollect"),o=e.execute.call(this);if(typeof o=="function")return e.collect(o);if(!Fu(o))if(jo(o)){if("then"in o)return o.then(r);if(Symbol.iterator in o){a.error=new Error;const u=o[Symbol.iterator]();for(;;){const d=u.next();if(r(d.value),d.done)return}}else if(Symbol.asyncIterator in o){const u=o[Symbol.asyncIterator]();return(async()=>{for(await Promise.resolve(),a.error=new Error;;){if(e.epoch!==i)return;const d=await u.next();if(r(d.value),d.done)return}})()}else throw new TypeError("Invalid effect")}else throw new TypeError("Invalid effect")},e.getOuterStack)}effect(e,i="anonymous"){this.assertActive();const a=[],r=je(()=>{let g;for(const x of a.splice(0).reverse())if(g)g=g.then(x);else{const b=x();jo(b)&&"then"in b&&(g=b)}return g},"dispose"),o={label:i,children:[]},u={execute:e,epoch:!0,collect:je(g=>{a.push(g),this._disposables.delete(g),g[ve.effect]&&o.children.push(g[ve.effect])},"collect"),getOuterStack:gd()};let d;try{d=this._execute(u)}catch(g){throw r(),g}d?.catch(r).catch(g=>this.ctx.logger.error(g));const p=za(()=>{if(u.epoch)return u.epoch=!1,d?d.then(r):r()},ve.effect,o),h=je(()=>{if(u.epoch)return u.epoch=!1,r()},"disposeAsync");return p.then=async(g,x)=>Promise.resolve(d).then(()=>h).then(g,x),a.push(this._disposables.push(p)),p}getEffects(){return[...this._disposables].map(e=>e[ve.effect]).filter(Boolean)}_getState(){return this.uid===null?4:this._error?3:this._runner.epoch!==Ca?2:0}_updateState(e){const i=this.state;if(this.state=e()??this._getState(),i!==this.state&&(this.context.emit("internal/status",this,i),!(i!==2&&this.state!==2)))for(const a of Reflect.ownKeys(this.ctx.reflect.store)){const r=this.ctx.reflect.store[a];r.ctx.fiber===this&&this.ctx.isolate(r.name,r.isolate).reflect.notify([r.name])}}_checkImpl(e){const i=this.ctx.reflect._getImpl(e,!0);if(!i)return delete this._store[e];try{if(i.check&&!i.check.call(yr(this.ctx,i.value)))return delete this._store[e]}catch(a){return i.ctx.logger.error(a),delete this._store[e]}this._store[e]=i}_refresh(){let e=`${this._revision}`;for(const i of Object.keys(this.inject)){const a=this._store[i];if(!a){e=Ca;break}e+=":"+a.uid}this._setEpoch(e)}_setEpoch(e){const i=this._runner.epoch;e!==i&&(this._error||(this._runner.epoch=e,!this.inertia&&this._updateState(()=>e!==Ca&&i===Ca?(this.inertia=this._reload(),1):(this.inertia=this._unload(),5))))}async _reload(){this.committed={...this._store};for(const i of Object.values(this.committed))i.ctx.fiber!==this&&i.dependents.add(this);const e=this._runner.epoch;try{await Promise.resolve(),this._runner.epoch===e&&await this._execute(this._runner)}catch(i){this.ctx.logger.error(i),this._runner.epoch===e&&(this._error=i,this._runner.epoch=Ca)}this._updateState(()=>{if(this._runner.epoch===e)this.inertia=void 0;else return this.inertia=this._unload(),5})}async _unload(){for(;[...this.provisions].some(e=>e.dependents.size);)await new Promise(e=>this._release=e);this._release=void 0,await Promise.all(this._disposables.clear().map(async e=>{try{await lh(async i=>{await Promise.resolve(),i.error=new Error,await e()},this._runner.getOuterStack)}catch(i){this.ctx.logger.error(i)}}));for(const e of Object.values(this.committed??{}))!e.dependents.delete(this)||e.dependents.size||(e.release?.(),e.ctx.fiber._release?.());this.committed=void 0,this._updateState(()=>{if(this._runner.epoch===Ca)this.inertia=void 0;else return this.inertia=this._reload(),1})}async await(){for(;this.inertia;)await this.inertia;if(this._error)throw this._error;return this}async restart(){const e=this.ctx.fiber;e.assertActive(),e._revision++,e._refresh(),await e.await()}update(e,i=!1){const a=this.ctx.fiber;a.assertActive();const r=a._runner.epoch!==Ca,o=r?a._resolve(e):void 0;i||a.context.emit("internal/commit",a,e),a.config=e,a._error=void 0;const u=je(()=>a.restart(),"restart"),d=r?a.context.waterfall(a,"internal/update",o,u):u();if(d===void 0)return;const p=Promise.resolve(d);return p.catch(()=>{}),p}};function uh(e){return e!==null&&e!==!1&&e!==void 0}je(uh,"isBailed");var jA=class{constructor(e){this.ctx=e,za(this,ve.tracker,{property:"ctx",noShadow:!0}),this.on("internal/listener",function(i,a,r){if(i==="internal/update"&&!r.global){const o=this.fiber._hooks["internal/update"]??=new ng,u=r.prepend?"unshift":"push";return this.fiber.effect(()=>o[u](a),'ctx.on("internal/update")')}}),this.on("internal/update",function(i,a){const r=[...this._hooks["internal/update"]||[]],o=je(()=>(r.shift()??a).call(this,i,o),"_next");return o()},{global:!0,prepend:!0}),this.on("internal/config",(i,a)=>Aw(i.runtime,a()))}ctx;static{je(this,"EventsService")}_hooks=Object.create(null);_resolve(e,i){const a=typeof i[0]=="object"||typeof i[0]=="function"?i.shift():null,r=i.shift();(typeof r!="string"||!r.startsWith("internal/"))&&this._hooks["internal/dispatch"]?.length&&this.emit("internal/dispatch",e,r,i,a);const o=a?.[rg.filter],u=(this._hooks[r]||[]).filter(d=>d.global||!o||o.call(a,d.ctx)).map(d=>d.callback);return[a,u,r]}dispatch(e,i){const[a,r]=this._resolve(e,i);return r.map(o=>o.bind(a))}async parallel(...e){const[i,a,r]=this._resolve("parallel",e),u=(await Promise.allSettled(a.map(async p=>Reflect.apply(p,i,e)))).filter(p=>p.status==="rejected");if(!u.length)return;const d=typeof r=="symbol"?String(r):`"${r}"`;throw new AggregateError(u.map(p=>p.reason),`one or more listeners of event ${d} failed`)}emit(...e){const[i,a]=this._resolve("emit",e);for(const r of a)Reflect.apply(r,i,e)}async serial(...e){const[i,a]=this._resolve("serial",e);for(const r of a){const o=await Reflect.apply(r,i,e);if(uh(o))return o}}bail(...e){const[i,a]=this._resolve("bail",e);for(const r of a){const o=Reflect.apply(r,i,e);if(uh(o))return o}}waterfall(...e){const[i,a]=this._resolve("waterfall",e),r=e.pop(),o=je(()=>{const u=a.shift();if(!u)return r();let d=!1;const p=je(()=>{if(d)throw new Error("next() called multiple times");return d=!0,o()},"next");return Reflect.apply(u,i,[...e,p])},"dispatch");return o()}register(e,i,a,r){const o=r.prepend?"unshift":"push";return this.ctx.fiber.effect(()=>((this._hooks[i]??=[])[o]({ctx:this.ctx,callback:a,...r}),()=>this.unregister(i,a)),e)}unregister(e,i){const a=this._hooks[e];if(!a)return;const r=a.findIndex(o=>o.callback===i);if(r>=0)return a.splice(r,1),a.length||delete this._hooks[e],!0}on(e,i,a){typeof a!="object"&&(a={prepend:a}),this.ctx.fiber.assertActive(),i=this.ctx.reflect.bind(i);const r=this.bail(this.ctx,"internal/listener",e,i,a);if(r)return r;const o=`ctx.on(${typeof e=="string"?JSON.stringify(e):e.toString()})`;return this.register(o,e,i,a)}once(e,i,a){const r=this.on(e,function(...o){return r(),i.apply(this,o)},a);return r}};function Ou(e){const i=e.stack.split(`
|
|
70
|
+
`);return i.splice(0,2,`Error: ${e.message}`),e.stack=i.join(`
|
|
71
|
+
`),e}je(Ou,"enhanceError");var OA=["prototype","then"];function Mu(e){return typeof e=="symbol"||OA.includes(e)||parseInt(e).toString()===e||e.startsWith("_")}je(Mu,"isSpecialProperty");function ag(e,i){const a=e[ve.isolate][i];let r=e[ve.isolate],o=e.fiber;for(;;){let u;for(const d of o.provisions)d.name===i&&d.ctx[ve.isolate][i]===a&&(u=d);if(u)return{impl:u};for(;r!==o.ctx[ve.isolate];){if(!r||Object.hasOwn(r,i))return;r=Object.getPrototypeOf(r)}if(u=o.committed?.[i],u||i in o.inject)return{fiber:o,impl:u};if(!o.runtime)return;o=o.parent.fiber}}je(ag,"locate");var a0=class{constructor(e){this.ctx=e,za(this,ve.tracker,{property:"ctx",noShadow:!0}),this.mixin("reflect",["get","set","provide","accessor","mixin"]),this.mixin("fiber",["runtime","effect"]),this.mixin("registry",["inject","plugin"]),this.mixin("events",["on","once","parallel","emit","serial","bail","waterfall"])}ctx;static{je(this,"ReflectService")}static handler={get:je((e,i,a)=>{if(Mu(i))return Reflect.get(e,i,a);if(Reflect.has(e,i))return yr(a,Reflect.get(e,i,a));const r=new Error(`cannot get property "${i}" without inject`);try{const o=e.reflect.props[i];if(o?.type==="accessor")return o.get.call(a,a[ve.receiver],r);const u=a[ve.shadow]??a;return u.fiber.runtime?a.events.waterfall("internal/get",a,i,r,()=>{const d=ag(u,i);if(!d)throw r;if(d.impl)return yr(a,d.impl.value);throw r.message=`cannot get required service "${i}" in inactive context`,r}):a.reflect.get(i,!1)}catch(o){throw o===r?Ou(o):o}},"get"),set:je((e,i,a,r)=>{if(Mu(i))return Reflect.set(e,i,a,r);const o=new Error(`cannot set property "${i}" without provide`),u=e.reflect.props[i];if(!u){if(!r.fiber.runtime)return Reflect.set(e,i,a,r);throw Ou(o)}try{return u.type==="accessor"?u.set?u.set.call(r,a,r[ve.receiver],o):!1:r.events.waterfall("internal/set",r,i,a,o,()=>r.reflect.set(i,a,o))}catch(d){throw d===o?Ou(d):d}},"set"),has:je((e,i)=>Mu(i)?Reflect.has(e,i):Reflect.has(e,i)?!0:!!e.reflect.props[i],"has")};store=Object.create(null);props=Object.create(null);_implCounter=0;get(e,i=!0){return yr(this.ctx,this._getImpl(e,i)?.value)}_getImpl(e,i=!0){const a=this.ctx[ve.isolate][e],r=a&&this.store[a];if(r&&!(i&&r.ctx.fiber.state!==2))return r}set(e,i,a){const r=this.ctx[ve.isolate][e],o=this.store[r];if(!o)throw new Error(`cannot set property "${e}" without provide`);if(o.ctx.fiber!==this.ctx.fiber)throw new Error(`cannot set property "${e}" in multiple fibers`);return o.value=i,!0}provide(e,i,a){return this.ctx.fiber.effect(()=>{if(!this.props[e])this.props[e]??={type:"service"};else if(this.props[e].type!=="service")throw new Error(`property "${e}" is already declared as ${this.props[e].type}`);this.props[e]={type:"service"},this.ctx[ve.root][ve.isolate][e]??=Symbol(e);const r=this.ctx[ve.isolate][e],o={uid:++this._implCounter,name:e,value:i,ctx:this.ctx,check:a,isolate:r,dependents:new Set};if(this.store[r])throw new Error(`service "${e}" has been registered at <${this.store[r].ctx.fiber.name}>`);return this.store[r]=o,this.ctx.fiber.provisions.add(o),this.ctx.fiber.state===2&&this.notify([e]),async()=>{this.store[o.isolate]===o&&delete this.store[o.isolate],this.ctx.isolate(e,o.isolate).reflect.notify([e]),await new Promise(u=>{o.release=u,o.dependents.size||u()}),o.release=void 0,this.ctx.fiber.provisions.delete(o)}},`ctx.provide(${JSON.stringify(e)})`)}notify(e,i=(a,r)=>a[ve.isolate][r]===this.ctx[ve.isolate][r]){for(const a of this.ctx.registry.values())for(const r of a.fibers){let o=!1;for(const u of e)u in r.inject&&i(r.ctx,u)&&(o=!0,r._checkImpl(u));o&&r._refresh()}for(const a of e){const r=Object.create(this.ctx);r[ve.filter]=o=>i(o,a),this.ctx.events.emit(r,"internal/service",a,this._getImpl(a,!1)?.value)}}accessor(e,i){return this.ctx.fiber.effect(()=>{if(e in this.props)throw new Error(`property "${e}" is already declared as ${this.props[e].type}`);return this.props[e]={type:"accessor",...i},()=>delete this.props[e]},`ctx.accessor(${JSON.stringify(e)})`)}mixin(e,i){const a=this;return this.ctx.fiber.effect(function*(){const r=Array.isArray(i)?i.map(u=>[u,u]):Object.entries(i),o=je((u,d)=>u[e],"getTarget");for(const[u,d]of r)yield a.accessor(d,{get(p,h){const g=o(this,h);if(Fu(g))return g;const x=p?Oo(p,g):g,b=Reflect.get(g,u,x);return typeof b!="function"?b:b.bind(x??g)},set(p,h,g){const x=o(this,g),b=h?Oo(h,x):x;return Reflect.set(x,u,p,b)}})},`ctx.mixin(${JSON.stringify(e)})`)}trace(e){return yr(this.ctx,e)}bind(e){return new Proxy(e,{apply:je((i,a,r)=>Reflect.apply(i,this.trace(a),r.map(o=>this.trace(o))),"apply"),construct:je((i,a,r)=>Reflect.construct(i,a.map(o=>this.trace(o)),r),"construct")})}},wi=class dh{constructor(i,a){this.ctx=i,a??=this.constructor.provide;let r=this;const o={associate:a,property:"ctx"};return r[ve.invoke]&&(r=Gu(a,md(Object.getPrototypeOf(this),Function.prototype),o)),r.ctx=i,r.name=a,za(r,ve.tracker,o),r.ctx.reflect.provide(a,r,this[ve.check]),r}ctx;static{je(this,"Service")}static init=ve.init;static check=ve.check;static invoke=ve.invoke;static metadata=ve.metadata;static extend=ve.extend;static tracker=ve.tracker;static mergeIntercept=ve.mergeIntercept;static resolveIntercept=ve.resolveIntercept;name;[ve.filter](i){return i[ve.isolate][this.name]===this.ctx[ve.isolate][this.name]}[ve.extend](i){let a;return this[dh.invoke]?a=Gu(this.name,this,this[ve.tracker]):a=Object.create(this),Object.assign(a,i)}[ve.mergeIntercept](...i){return Object.assign({},...i)}[ve.resolveIntercept](){const i=[];let a=this.ctx[rg.intercept];for(;this.name in a;)Object.hasOwn(a,this.name)&&i.unshift(a[this.name]),a=Object.getPrototypeOf(a);const r=ag(this[ve.caller]??this.ctx,this.name)?.fiber?.inject[this.name];return Fu(r)||i.unshift(r),(this[ve.mergeIntercept]??dh.prototype[ve.mergeIntercept]).apply(this,i)}static[Symbol.hasInstance](i){if(!i)return!1;let a=i.constructor;for(;a;){if(a=a.prototype?.constructor,a===this)return!0;a&&=Object.getPrototypeOf(a)}return!1}},r0={s:je(e=>String(e),"s"),d:je(e=>Math.trunc(Number(e)),"d"),i:je(e=>Math.trunc(Number(e)),"i"),f:je(e=>Number(e),"f"),o:je(e=>JSON.stringify(e),"o"),O:je(e=>JSON.stringify(e),"O"),c:je(()=>"","c"),C:je((e,i,a)=>fh.color(i,fh.code(a.name,i.colors),e),"C")};function Mw(e){return e instanceof Error&&Array.isArray(e.errors)}je(Mw,"isAggregateError");var fh=class{constructor(e,i){this.service=i,Object.assign(this,e),this.error=this._method("error",0),this.info=this._method("info",2),this.warn=this._method("warn",1),this.debug=this._method("debug",3)}service;static{je(this,"Logger")}static color(e,i,a,r=""){return e.colors?`\x1B[3${i<8?i:"8;5;"+i}${e.colors>=2?r:""}m${a}\x1B[0m`:""+a}static code(e,i){let a=0;for(let o=0;o<e.length;o++)a=(a<<3)-a+e.charCodeAt(o)+13,a|=0;const r=i?i>=2?RA:MA:[];return r[Math.abs(a)%r.length]}static format(e,i){const a=i.args.slice();a[0]instanceof Error?(a[0]=a[0].stack||a[0].message,a.unshift("%s")):typeof a[0]!="string"&&a.unshift("%o");let r=a.shift();r=r.replace(/%([a-zA-Z%])/g,(d,p)=>{if(d==="%%")return"%";const h=e.formatters?.[p]??r0[p];if(typeof h=="function"){const g=a.shift();return h(g,e,i)}return d});const o=e.formatters?.o??r0.o;for(let d of a)typeof d=="object"&&d&&(d=o(d,e,i)),r+=" "+d;const{maxLength:u=10240}=e;return r.split(/\r?\n/g).map(d=>d.slice(0,u)+(d.length>u?"...":"")).join(`
|
|
72
|
+
`)}_method(e,i){return(...a)=>{if(a.length===1&&a[0]instanceof Error){if(a[0].cause)this[e](a[0].cause);else if(Mw(a[0])&&a[0].errors.length){a[0].errors.forEach(u=>this[e](u));return}}const r=++this.service._snMessage,o=Date.now();for(const u of this.service.exporters.values()){if((u.levels?.[this.name]??u.levels?.default??this.level??2)<i)continue;const p={sn:r,ts:o,type:e,level:i,name:this.name,...this.meta,args:a};u.export(p)}}}},MA=[6,2,3,4,5,1],RA=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221],DA=class Rw{static{je(this,"LoggerService")}bufferSize=1e3;buffer=[];ctx;_snMessage=0;_snExporter=0;exporters=new Map;constructor(i){const a={property:"ctx",noShadow:!0},r=Gu("logger",md(Object.getPrototypeOf(this),Function.prototype),a);return Object.assign(r,this),r.ctx=i,za(r,ve.tracker,a),r.exporter({colors:3,export:je(o=>{r.buffer.push(o);const u=r.buffer.length-r.bufferSize;u===1?r.buffer.shift():u>1&&r.buffer.splice(0,u)},"export")}),r}exporter(i){return this.ctx.effect(()=>{const a=++this._snExporter;return this.exporters.set(a,i),()=>this.exporters.delete(a)},"ctx.logger.exporter()")}[ve.invoke](i){const a=this[ve.caller],r=wi.prototype[wi.resolveIntercept].call(this),o=(a??this.ctx).fiber;return i??=r.name,i??=TA(o.name),new fh({name:i,level:r.level,meta:{fiber:new WeakRef(o)}},this)}static{for(const i of["error","info","warn","debug"])Rw.prototype[i]=function(...a){return this()[i](...a)}}};function Dw(e){return e&&typeof e=="object"&&typeof e.apply=="function"}je(Dw,"isApplicable");function Yu(e,i){return function(a,r){if(r.kind==="class")Object.hasOwn(a,"inject")||(za(a,"inject",Object.create(Object.getPrototypeOf(a).inject??null)),za(a.inject,ve.checkProto,!0)),a.inject[e]=i;else if(r.kind==="method"){const o=(a[ve.decorator]??={}).inject??=Object.create(null);o[e]=i,r.addInitializer(function(){const u=this[ve.tracker]?.property;(this[ve.initHooks]??=[]).push(()=>{this.ctx.inject(o,d=>a.call(u?Oo(this,{[u]:d}):this))})})}else throw new Error("@Inject() can only be used on class or class methods")}}je(Yu,"Inject");(e=>{function i(a,r=Object.create(null)){if(!a)return r;if(Array.isArray(a))for(const o of a)r[o]=null;else if(Reflect.has(a,ve.checkProto)){Object.assign(r,i(Object.getPrototypeOf(a)));for(const o of Object.keys(a))r[o]=a[o]??null}else for(const o of Object.keys(a))r[o]=a[o]??null;return r}e.resolve=i,je(i,"resolve")})(Yu||(Yu={}));var zA=class{constructor(e){this.ctx=e,za(this,ve.tracker,{property:"ctx",noShadow:!0})}ctx;static{je(this,"RegistryService")}_counter=0;_internal=new Map;get counter(){return++this._counter}get size(){return this._internal.size}resolve(e){try{if(typeof e=="function")return e;if(Dw(e))return e.apply}catch{}}get(e){const i=this.resolve(e);return i&&this._internal.get(i)}has(e){const i=this.resolve(e);return!!i&&this._internal.has(i)}delete(e){const i=this.resolve(e),a=i&&this._internal.get(i);if(a){this._internal.delete(i);for(const r of a.fibers)r.dispose();return a}}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}inject(e,i){return this.plugin({inject:e,apply:i,name:i.name})}plugin(e,i,a=gd()){const r=this.resolve(e);if(!r)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e);this.ctx.fiber.assertActive();let o=this._internal.get(r);if(!o){let p=e.name;p==="apply"&&(p=void 0),o={name:p,callback:r,fibers:new ng,Config:e.Config},this._internal.set(r,o)}const u=new Ow(this.ctx,i,Yu.resolve(e.inject),o,a),d=Object.create(u);return d.then=(p,h)=>u.await().then(p,h),d}},rg=class wo{static{je(this,"Context")}static root=ve.root;static effect=ve.effect;static filter=ve.filter;static isolate=ve.isolate;static intercept=ve.intercept;static is(i){return!!i?.[wo.is]}static{wo.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),wo.prototype[wo.is]=!0}constructor(){this[ve.isolate]=Object.create(null),this[ve.intercept]=Object.create(null);const i=new Proxy(this,a0.handler);return this[ve.root]=i,this.baseUrl=void 0,this.fiber=new Ow(i,{},Object.create(null),null,()=>[]),this.reflect=new a0(i),this.registry=new zA(i),this.events=new jA(i),this.logger=new DA(i),this.fiber._disposables.clear(),i}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.fiber.name}>`}extend(i={}){const a=Reflect.getOwnPropertyDescriptor(this,ve.shadow)?.value,r=Object.create(yr(this,this));for(const o of Reflect.ownKeys(i))Object.defineProperty(r,o,Reflect.getOwnPropertyDescriptor(i,o));return a?Object.assign(Object.create(r),{[ve.shadow]:a}):r}isolate(i,a){const r=Object.create(this[ve.isolate]);return r[i]=a??Symbol(i),this.extend({[ve.isolate]:r})}intercept(i,a){const r=Object.create(this[ve.intercept]);return r[i]=a,this.extend({[ve.intercept]:r})}};function LA(e,i){const a=e.findIndex(r=>r.id===i);if(a===-1)return null;for(let r=a+1;r<e.length;r+=1)if(e[r].role==="user")return e.slice(0,r);return e.slice()}function lm(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.role==="user")return a.id}return null}function IA(e){const i=new Map;return{isBusy:a=>i.has(a),isIdle:()=>i.size===0,clear(a){const r=i.get(a);r&&i.set(a,{chain:r.chain,token:{}})},clearAll(){for(const[a,r]of i)i.set(a,{chain:r.chain,token:{}})},push(a,r){const o=i.get(a)??{chain:Promise.resolve(),token:{}},u=o.token,p=o.chain.then(()=>i.get(a)?.token===u?e(a,r):void 0,()=>i.get(a)?.token===u?e(a,r):void 0).then(()=>{},()=>{});return i.set(a,{chain:p,token:u}),p.then(()=>{i.get(a)?.chain===p&&i.delete(a)}),p}}}class UA extends wi{static provide="sessions";constructor(i){super(i,"sessions")}current(i){return Ye.getState().sessions.find(a=>a.id===i)}all(){return Ye.getState().sessions}getMessages(i){return this.current(i)?.messages??[]}addMessage(i,a){Ye.getState().addMessage(i,a),this.flush(i)}updateMessage(i,a,r){Ye.getState().updateMessage(i,a,r),this.flush(i)}updateSession(i,a){Ye.getState().updateSession(i,a),this.flush(i)}turnHistory(i,a){return LA(i,a)}async flush(i){await this.ctx.events.parallel("session/flush",i).catch(()=>{})}}function BA(){const e=Be.getState(),i=e.root||e.info.root;if(!i)return"No folder is open yet. Ask the user to choose a workspace folder in the Workspace panel before using file, shell or git tools.";const a=e.entries.filter(o=>!o.path.includes("/")).slice(0,40).map(o=>`${o.path}${o.type==="dir"?"/":""}`),r=e.git.available?`${e.git.branch||"detached HEAD"} · ${e.git.entries.length} changed file${e.git.entries.length===1?"":"s"}`:"not a git repository";return[`Root: ${i}`,`Git: ${r}`,a.length>0?`Top level: ${a.join(", ")}`:"The folder is empty.",e.truncated?"The file tree was truncated; use list_files or grep for deeper paths.":""].filter(Boolean).join(`
|
|
73
|
+
`)}class $A extends wi{static provide="systemPrompt";customSections=new Map;constructor(i){super(i,"systemPrompt")}registerSection(i,a){return this.customSections.set(i,a),()=>this.customSections.delete(i)}assemble(i,a=i.mode){const r=[];i.systemPrompt?.trim()&&r.push({name:"base",priority:10,content:i.systemPrompt.trim()});const o=i.skills.filter(d=>d.enabled);o.length>0&&r.push({name:"skills",priority:20,content:["## Loaded skills","Apply these skills when the task matches their purpose. They refine the working rules above; they never override safety, tool permissions or plan mode.",...o.map(d=>`<skill name="${d.name}">
|
|
74
|
+
Purpose: ${d.description}
|
|
75
|
+
${d.instructions.trim()}
|
|
76
|
+
</skill>`)].join(`
|
|
77
|
+
|
|
78
|
+
`)}),r.push({name:"workspace",priority:30,content:["## Workspace","You operate on the real folder below through the local OpenSol daemon. Tools return real output; never invent file contents, command results, URLs or deployments.",BA()].join(`
|
|
79
|
+
|
|
80
|
+
`)});const u=Be.getState().instructions;u.content.trim()&&r.push({name:"project-instructions",priority:35,content:[`## Project instructions (${u.file})`,"The owner of this project wrote the notes below. Follow them for conventions, commands and style. They never override safety, tool permissions or plan mode.",`<project-instructions file="${u.file}">
|
|
81
|
+
${u.content.trim()}${u.truncated?`
|
|
82
|
+
… (file clipped)`:""}
|
|
83
|
+
</project-instructions>`].join(`
|
|
84
|
+
|
|
85
|
+
`)}),r.push({name:"mode",priority:40,content:a==="plan"?["## Mode: Plan (read-only)","Investigate and design. Do not modify anything.","- Allowed: read_file, list_files, grep, web_search, read_url, read-only shell commands and read-only git actions.","- Forbidden: write_file, edit_file, rewrite_file, git add/commit/init/checkout, and shell commands that change files, install packages or change system state. The daemon rejects these.","- Read the relevant source before proposing changes. Grep for call sites and inspect the real files.","- Finish with a concrete, ordered implementation plan naming files and functions. State assumptions and open questions plainly.","- Never pretend an edit was made or a check was run."].join(`
|
|
86
|
+
`):["## Mode: Build","You may inspect and change the real workspace.","- Inspect before editing: list files, read the source, grep for call sites, check git status.","- Make the smallest coherent change. Do not reformat unrelated code, add speculative abstractions or invent APIs.","- After a mutation, inspect the result. Run the project’s real typecheck, lint, tests and build when they exist, and read the output.","- Never claim a check passed without running it. If a check cannot run, say why.","- Ask before destructive actions, force pushes, credential changes or anything that leaves the workspace."].join(`
|
|
87
|
+
`)}),r.push({name:"vibe-coding",priority:45,content:["## Vibe coding","- For a game, demo, landing page or visual prototype that does not need a project folder, reply with ONE self-contained HTML file in a single ```html code block (inline CSS and JS). OpenSol renders that block as a live, sandboxed preview, so it must run with no build step and no calls to localhost. Load libraries only from https://cdnjs.cloudflare.com or https://cdn.jsdelivr.net with a pinned version.","- With a folder open in Build mode, write real files with the tools instead of pasting large code into the chat, then say how to run them.","- Deliver something that runs first, then improve it in small steps based on what the user sees. Keep explanations to a few sentences; the code is the answer.","- If something needs an API key, a server or an asset you cannot create, say so plainly instead of faking it."].join(`
|
|
88
|
+
`)}),r.push({name:"session-context",priority:50,content:["## Session context",`- Model: ${li(i)||"unset"}`,`- Date: ${new Date().toISOString().slice(0,10)}`,`- Mode: ${a}`,i.webSearchEnabled?"- Web search is enabled. Use it when facts may be current or when the user asks for sources.":"- Web search is turned off for this session.","- Use relative paths from the workspace root. Do not use /workspace paths."].join(`
|
|
89
|
+
`)});for(const d of this.customSections.values()){const p=d(i,a);p&&p.content&&r.push(p)}return this.ctx.events.waterfall("system-prompt/assemble",r,a,()=>(r.sort((d,p)=>d.priority-p.priority),r.map(d=>d.content).filter(Boolean).join(`
|
|
90
|
+
|
|
91
|
+
`)))}buildSubagentPrompt(i){return[this.assemble(i,"plan"),["## Subagent","You are a focused read-only investigator. Work only on the assigned task.","- Inspect the real workspace with read-only file, grep, shell and web tools.","- Do not edit files, change git state or run commands that mutate the machine. The daemon enforces this.","- Be concise: return findings, exact file paths and line references, and any uncertainty.","- Do not repeat the task back. Do not invent evidence. If something cannot be verified, say so."].join(`
|
|
92
|
+
`)].join(`
|
|
93
|
+
|
|
94
|
+
`)}}let yu;const Tn=Er()((e,i)=>{const a=r=>{e({servers:r,loaded:!0,loading:!1,error:""}),yu!==void 0&&window.clearTimeout(yu),yu=void 0,r.some(o=>o.status==="connecting")&&(yu=window.setTimeout(()=>{i().load()},1200))};return{servers:[],loaded:!1,loading:!1,error:"",load:async()=>{e({loading:!0});try{a((await qC()).servers)}catch(r){e({loading:!1,loaded:!0,error:r instanceof Error?r.message:"Could not load MCP servers."})}},save:async r=>{const o=await GC(r);a(o.servers)},act:async(r,o)=>{o!=="disconnect"&&e(d=>({servers:d.servers.map(p=>p.id===r?{...p,status:"connecting",error:""}:p)}));const u=await YC(r,o);a(u.servers)},authorize:async r=>{const{url:o}=await KC(r),u=window.open(o,"opensol-mcp-oauth","popup=yes,width=520,height=720");if(!u)throw new Error("The browser blocked the sign-in window. Allow pop-ups for OpenSol and try again.");const d=Date.now(),p=window.setInterval(()=>{i().load();const h=i().servers.find(g=>g.id===r);(u.closed||h?.oauth?.authorized||Date.now()-d>5*6e4)&&(window.clearInterval(p),i().load())},1500)},logout:async r=>{a((await VC(r)).servers)},lookup:r=>{for(const o of i().servers){const u=o.tools.find(d=>d.fn===r);if(u)return{server:o,tool:u}}return null}}});function zw(e){return e.startsWith("mcp__")}try{new BroadcastChannel("opensol-mcp-oauth").onmessage=()=>{Tn.getState().load()}}catch{}const om=28e3;function HA(e){const i=e.properties&&typeof e.properties=="object"?e.properties:{},a=Array.isArray(e.required)?e.required.filter(r=>typeof r=="string"):void 0;return{type:"object",properties:i,...a?.length?{required:a}:{}}}function Lw(e){if(!zw(e))return;const i=Tn.getState().lookup(e);if(!i)return;const{server:a,tool:r}=i;if(!(!a.enabled||a.status!=="connected"||a.disabledTools.includes(r.name)))return{name:e,description:`[MCP server “${a.name}”] ${r.description||r.name}`.slice(0,1200),parameters:HA(r.inputSchema),allowedInMode:o=>o==="build"||r.readOnly,async execute(o,u){const{result:d}=await XC(a.id,r.name,o,u.signal),p=d.text.trim()||"(the tool returned no output)";return{output:p.length>om?`${p.slice(0,om)}
|
|
95
|
+
… truncated (${p.length-om} more characters)`:p,isError:d.isError}}}}function PA(){const e=[];for(const i of Tn.getState().servers)for(const a of i.tools){const r=Lw(a.fn);r&&e.push(r)}return e}function Ku(e,i){if(!zw(i))return e.tools[i];const a=Tn.getState().lookup(i);if(!a)return;const{server:r,tool:o}=a;return{enabled:r.enabled&&r.status==="connected"&&!r.disabledTools.includes(o.name),approval:r.approval}}const FA=new Set(["read_file","list_files","grep","web_search","read_url"]);function s0(e,i){return i==="build"?!0:FA.has(e)||e==="shell"||e==="git"||e==="subagent"}class qA extends wi{static provide="tools";definitions=new Map;constructor(i){super(i,"tools")}register(i){return this.definitions.set(i.name,i),()=>{this.definitions.get(i.name)===i&&this.definitions.delete(i.name)}}get(i){return this.definitions.get(i)??Lw(i)}list(){return[...this.definitions.values(),...PA()]}schemas(i,a="build",{subagent:r=!1}={}){const o=[],u=r?[...this.definitions.values()]:this.list();for(const d of u)d.name==="subagent"&&r||!Ku(i,d.name)?.enabled||!(d.allowedInMode?d.allowedInMode(a):s0(d.name,a))||(d.name==="web_search"||d.name==="read_url")&&!i.webSearchEnabled||o.push({name:d.name,description:d.description,parameters:d.parameters});return o}async execute(i,a,r,o,u,d,p){const h={name:i,args:a,settings:r,mode:o,signal:u,callId:d,turnId:p},g=await this.ctx.events.waterfall("tools/pre-execute",h,async()=>{if(!Ku(r,i)?.enabled)return{decision:"deny",reason:"This tool is disabled or its MCP server is not connected (Settings → Tools / MCP)."};const v=this.get(i);return(v?.allowedInMode?v.allowedInMode(o):s0(i,o))?(i==="web_search"||i==="read_url")&&!r.webSearchEnabled?{decision:"deny",reason:"Web access is turned off for this session."}:{decision:"allow"}:{decision:"deny",reason:"Plan mode is read-only. Do not edit files or change git state. Finish with an implementation plan instead."}});if(g.decision==="deny"){const v={output:g.reason??"Tool call denied.",isError:!0};return this.ctx.events.emit("tools/result",v,h),v}if(u.aborted)throw new DOMException("Aborted","AbortError");const x=await this.ctx.events.waterfall("tools/execute",h,async()=>{const v=this.get(i);return v?await v.execute(a,h):{output:`Tool "${i}" is not registered.`,isError:!0}}),b=await this.ctx.events.waterfall("tools/post-execute",x,h,async()=>x);return this.ctx.events.emit("tools/result",b,h),b}}const Ru=new Map;class GA extends wi{static provide="approval";static inject=["tools"];constructor(i){super(i,"approval"),this.ctx.on("tools/pre-execute",async(a,r)=>Ku(a.settings,a.name)?.approval==="ask"&&a.callId&&!await this.waitForApproval(a.callId,a.signal)?{decision:"deny",reason:a.signal.aborted?"Stopped before the tool ran.":"You denied this tool call."}:r())}waitForApproval(i,a){return YA(i,a)}resolveApproval(i,a){Iw(i,a)}}function YA(e,i){return i.aborted?Promise.resolve(!1):new Promise(a=>{const r=u=>{const d=Ru.get(e);d&&(d.cleanup(),Ru.delete(e),a(u))},o=()=>r(!1);i.addEventListener("abort",o,{once:!0}),Ru.set(e,{toolCallId:e,resolve:r,cleanup:()=>i.removeEventListener("abort",o)})})}function Iw(e,i){Ru.get(e)?.resolve(i)}async function*xd(e){if(!e.body)throw new Error("The provider returned an empty response body.");const i=e.body.getReader(),a=new TextDecoder;let r="";try{for(;;){const{done:o,value:u}=await i.read();if(o)break;r+=a.decode(u,{stream:!0}),r=r.replace(/\r\n/g,`
|
|
96
|
+
`);let d=r.indexOf(`
|
|
97
|
+
|
|
98
|
+
`);for(;d!==-1;){const p=r.slice(0,d);r=r.slice(d+2);for(const h of p.split(`
|
|
99
|
+
`)){if(!h.startsWith("data:"))continue;const g=h.slice(5).trim();g&&(yield g)}d=r.indexOf(`
|
|
100
|
+
|
|
101
|
+
`)}}for(const o of r.split(`
|
|
102
|
+
`))if(o.startsWith("data:")){const u=o.slice(5).trim();u&&(yield u)}}finally{i.releaseLock()}}function KA(e,i){return e instanceof DOMException&&e.name==="AbortError"?"Stopped.":e instanceof Error?/daemon is not reachable|lost the connection/i.test(e.message)?"The local OpenSol daemon is not reachable. Start it with “npm start”, then try again.":/failed to fetch|networkerror|load failed/i.test(e.message)?`The local daemon could not reach ${i}. Check the network and the provider base URL, then try again.`:/401|403/.test(e.message)&&/key|auth|permission|refus|reject/i.test(e.message)?`${e.message} Check the API key in Settings → Models, or choose a model this key can access.`:e.message:"The request failed for an unknown reason."}const VA=28e3,XA=new Set(["read_file","list_files","grep","web_search","read_url"]);function Xs(e,i=VA){return e.length<=i?e:`${e.slice(0,i)}
|
|
103
|
+
… truncated (${e.length-i} more characters)`}function bi(e){return e&&typeof e=="object"?e:{}}function Mt(e){return typeof e=="string"?e:""}function Ri(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Wi(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function l0(e,i){const a=e[i];return typeof a=="string"?a:void 0}function po(e,i,a){const r=e[i];return typeof r=="number"&&Number.isFinite(r)?r:typeof r=="string"&&Number.isFinite(Number(r))?Number(r):a}function Uw(e,i){return i==="build"?!0:XA.has(e)||e==="shell"||e==="git"||e==="subagent"}function bd(e,i="build",{subagent:a=!1}={}){if(qt.tools)return qt.tools.schemas(e,i,{subagent:a});const r=[{name:"shell",description:"Run a shell command in the workspace root. The working directory resets between calls. Prefer dedicated file and git tools for edits. In Plan mode only read-only commands are accepted.",parameters:{type:"object",properties:{command:{type:"string",description:"The shell command to run."},timeoutMs:{type:"number",description:"Timeout in milliseconds (max 600000)."}},required:["command"],additionalProperties:!1}},{name:"read_file",description:"Read a text file from the workspace. Use offset and limit for large files.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative path from the workspace root."},offset:{type:"number",description:"1-based first line. Defaults to 1."},limit:{type:"number",description:"Maximum lines. Defaults to 400."}},required:["path"],additionalProperties:!1}},{name:"list_files",description:"List files and folders below a workspace path.",parameters:{type:"object",properties:{path:{type:"string",description:"Folder path. Defaults to the workspace root."},depth:{type:"number",description:"Recursion depth, 1–8. Defaults to 3."}},additionalProperties:!1}},{name:"write_file",description:"Create a file or replace its full contents. Prefer edit_file for small changes.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},content:{type:"string",description:"Complete file content."}},required:["path","content"],additionalProperties:!1}},{name:"edit_file",description:"Replace an exact text occurrence in a file. oldText must match whitespace exactly and be unique unless replaceAll is true.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},oldText:{type:"string",description:"Exact text to replace."},newText:{type:"string",description:"Replacement text."},replaceAll:{type:"boolean",description:"Replace every occurrence. Defaults to false."}},required:["path","oldText","newText"],additionalProperties:!1}},{name:"rewrite_file",description:"Replace the complete contents of an existing file. Use when most of the file changes.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},content:{type:"string",description:"The new complete file content."}},required:["path","content"],additionalProperties:!1}},{name:"grep",description:"Search workspace contents with a regular expression. Returns path, line and matching text.",parameters:{type:"object",properties:{pattern:{type:"string",description:"Regular expression to search for."},path:{type:"string",description:"File or folder. Defaults to the workspace root."},ignoreCase:{type:"boolean",description:"Case-insensitive search. Defaults to false."},maxResults:{type:"number",description:"Maximum matches. Defaults to 80."}},required:["pattern"],additionalProperties:!1}},{name:"web_search",description:"Search the web for current information. Returns titles, URLs and snippets. Cite URLs you use.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."}},required:["query"],additionalProperties:!1}},{name:"read_url",description:"Read a public web page as plain text.",parameters:{type:"object",properties:{url:{type:"string",description:"The http(s) URL to read."}},required:["url"],additionalProperties:!1}},{name:"git",description:"Inspect or change git state. In Plan mode only status, diff, log, show and branch are accepted.",parameters:{type:"object",properties:{action:{type:"string",enum:["status","diff","log","show","branch","add","commit","init","checkout"]},path:{type:"string",description:"Limit diff to this file."},staged:{type:"boolean",description:"Diff the staged changes."},ref:{type:"string",description:"Commit or ref for show."},limit:{type:"number",description:"Log limit."},paths:{type:"array",items:{type:"string"},description:"Files to stage."},message:{type:"string",description:"Commit message."},branch:{type:"string",description:"Branch to create or check out."},create:{type:"boolean",description:"Create a new branch. Defaults to true."}},required:["action"],additionalProperties:!1}}];return a||r.push({name:"subagent",description:"Delegate a focused investigation to a read-only subagent. Use it to explore a large area, trace a bug or verify assumptions without changing files. The subagent returns a concise report.",parameters:{type:"object",properties:{task:{type:"string",description:"The specific question or investigation to perform."},context:{type:"string",description:"Optional context, constraints or files to start from."}},required:["task"],additionalProperties:!1}}),r.filter(o=>!(!e.tools[o.name]?.enabled||!Uw(o.name,i)||(o.name==="web_search"||o.name==="read_url")&&!e.webSearchEnabled))}async function ZA(){await Be.getState().refresh({treeOnly:!0}).catch(()=>{})}async function o0(){await Be.getState().refresh().catch(()=>{})}function QA(e){const i=Array.isArray(e.entries)?e.entries:[];if(i.length===0)return"This folder is empty.";const a=i.map(o=>{const u=bi(o),d=Mt(u.path);return u.type==="dir"?`${d}/`:u.type==="link"?`${d} -> link`:`${d}${Ri(u.size)!==void 0?` (${Ri(u.size)} B)`:""}`}),r=e.truncated===!0?`
|
|
104
|
+
… listing truncated. Narrow the path or reduce depth.`:"";return`${Mt(e.root)?`Root: ${Mt(e.root)}
|
|
105
|
+
`:""}${a.join(`
|
|
106
|
+
`)}${r}`}function JA(e,i){const a=[`$ ${i}`,Mt(e.stdout)];Mt(e.stderr)&&a.push(`stderr:
|
|
107
|
+
${Mt(e.stderr)}`);const r=Ri(e.code);return r!==void 0&&r!==0&&a.push(`exit code: ${r}`),e.timedOut===!0&&a.push("The command timed out."),a.filter(o=>o!=="").join(`
|
|
108
|
+
`)}function WA(e,i){const a=Array.isArray(e.matches)?e.matches:[];if(a.length===0)return`No matches for ${i}.`;const r=a.map(u=>{const d=bi(u);return`${Mt(d.file)}:${Ri(d.line)??0}: ${Mt(d.text)}`}),o=e.truncated===!0?`
|
|
109
|
+
… more matches exist. Narrow the pattern or path.`:"";return r.join(`
|
|
110
|
+
`)+o}function ej(e){const i=[];Mt(e.current)&&i.push(`Current branch: ${Mt(e.current)}`),Mt(e.branches)&&i.push(Mt(e.branches)),Mt(e.stdout)&&i.push(Mt(e.stdout)),Mt(e.stderr)&&i.push(`stderr:
|
|
111
|
+
${Mt(e.stderr)}`);const a=Ri(e.code);return a!==void 0&&a!==0&&i.push(`exit code: ${a}`),i.filter(Boolean).join(`
|
|
112
|
+
`)||"Git completed with no output."}async function tj(e,i,a,r,o){if(o.aborted)throw new DOMException("Aborted","AbortError");if(e==="read_file"){const h=Wi(i,"path"),g=bi((await sn("read_file",{path:h},r,o)).result);if(g.binary===!0)return{output:`${h} is binary (${Ri(g.size)??0} bytes).`,isError:!1};const x=Math.max(1,Math.round(po(i,"offset",1))),b=Math.min(Math.max(1,Math.round(po(i,"limit",400))),2e3),v=Mt(g.content).split(`
|
|
113
|
+
`),y=v.slice(x-1,x-1+b),k=v.length-(x-1+b),_=`${Mt(g.path)||h} · ${v.length} lines${g.truncated===!0?" · file clipped by daemon":""}`,S=k>0?`
|
|
114
|
+
… ${k} more lines. Read again with offset ${x+b}.`:"";return{output:Xs(`${_}
|
|
115
|
+
────
|
|
116
|
+
${y.join(`
|
|
117
|
+
`)}${S}`),isError:!1}}if(e==="list_files"){const h=bi((await sn("list_files",{path:l0(i,"path")??"",depth:Math.min(Math.max(1,po(i,"depth",3)),8)},r,o)).result);return{output:QA(h),isError:!1}}if(e==="write_file"||e==="rewrite_file"){const h=Wi(i,"path"),g=Wi(i,"content"),x=bi((await sn(e,{path:h,content:g},r,o)).result);return await o0(),{output:`${x.created===!0?"Created":e==="rewrite_file"?"Rewrote":"Updated"} ${Mt(x.path)||h} · ${g.split(`
|
|
118
|
+
`).length} lines, ${Ri(x.size)??g.length} bytes.`,isError:!1}}if(e==="edit_file"){const h=Wi(i,"path"),g=Wi(i,"oldText"),x=typeof i.newText=="string"?i.newText:"",b=bi((await sn("edit_file",{path:h,oldText:g,newText:x,replaceAll:i.replaceAll===!0},r,o)).result);return await o0(),{output:`Edited ${Mt(b.path)||h} · ${Ri(b.replacements)??1} replacement${Ri(b.replacements)===1?"":"s"}.`,isError:!1}}if(e==="shell"){const h=Wi(i,"command"),g=bi((await sn("shell",{command:h,timeoutMs:po(i,"timeoutMs",12e4)},r,o)).result);return ZA(),{output:Xs(JA(g,h)),isError:(Ri(g.code)??0)!==0||g.timedOut===!0}}if(e==="grep"){const h=Wi(i,"pattern"),g=bi((await sn("grep",{pattern:h,path:l0(i,"path")??"",ignoreCase:i.ignoreCase===!0},r,o)).result),x=Math.min(Math.max(1,Math.round(po(i,"maxResults",80))),200),b=Array.isArray(g.matches)?g.matches.slice(0,x):[],v={...g,matches:b,truncated:g.truncated===!0||Array.isArray(g.matches)&&g.matches.length>x};return{output:Xs(WA(v,h)),isError:!1}}if(e==="web_search"){const h=Wi(i,"query"),g=bi((await sn("web_search",{query:h,provider:a.searchProvider},r,o)).result),x=Array.isArray(g.results)?g.results:[];if(x.length===0)return{output:"No results found.",isError:!1};const b=x.map((v,y)=>{const k=bi(v);return`${y+1}. ${Mt(k.title)}
|
|
119
|
+
${Mt(k.url)}${Mt(k.snippet)?`
|
|
120
|
+
${Mt(k.snippet)}`:""}`}).join(`
|
|
121
|
+
|
|
122
|
+
`);return{output:Xs(`Search: ${h}
|
|
123
|
+
Provider: ${Mt(g.provider)||"web"}
|
|
124
|
+
|
|
125
|
+
${b}`),isError:!1}}if(e==="read_url"){const h=Wi(i,"url"),g=bi((await sn("read_url",{url:h},r,o)).result),x=Mt(g.title);return{output:Xs(`Source: ${Mt(g.url)||h}${x?`
|
|
126
|
+
Title: ${x}`:""}
|
|
127
|
+
|
|
128
|
+
${Mt(g.content)}${g.truncated===!0?`
|
|
129
|
+
|
|
130
|
+
… page truncated.`:""}`),isError:!1}}const u=Wi(i,"action"),d={...i};delete d.action;const p=bi((await sn("git",{action:u,...d},r,o)).result);return(u==="add"||u==="commit"||u==="init"||u==="checkout")&&await Be.getState().loadGit().catch(()=>{}),{output:Xs(ej(p)),isError:(Ri(p.code)??0)!==0}}async function nj(e,i,a,r,o){if(qt.tools)return await qt.tools.execute(e,i,a,r,o);if(!a.tools[e]?.enabled)return{output:"This tool is disabled in Settings → Tools.",isError:!0};if(!Uw(e,r))return{output:"Plan mode is read-only. Do not edit files or change git state. Finish with an implementation plan instead.",isError:!0};if((e==="web_search"||e==="read_url")&&!a.webSearchEnabled)return{output:"Web access is turned off for this session.",isError:!0};if(e==="subagent")return{output:"Subagents are handled by the agent loop.",isError:!0};try{return await tj(e,i,a,r,o)}catch(u){if(u instanceof DOMException&&u.name==="AbortError")throw u;return{output:u instanceof Error?u.message:"The tool failed.",isError:!0}}}function sg(e){return e.startsWith("mcp__")?e.split("__").slice(2).join(" ").replace(/_/g," ")||"MCP tool":{shell:"Shell",read_file:"Read file",list_files:"List files",write_file:"Write file",edit_file:"Edit file",rewrite_file:"Rewrite file",grep:"Grep",web_search:"Web search",read_url:"Read URL",git:"Git",subagent:"Subagent"}[e]??"Tool"}function Bw(e,i){const a=e==="shell"?i.command:e==="grep"?i.pattern:e==="web_search"?i.query:e==="read_url"?i.url:e==="git"?i.action:e==="subagent"?i.task:i.path??"";return typeof a=="string"?a:""}const $w={onText:()=>{},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}};function Mo(e){const i=[e.content];for(const a of e.attachments??[])a.kind==="text"&&a.text&&i.push(`
|
|
131
|
+
|
|
132
|
+
--- Attached file: ${a.name} ---
|
|
133
|
+
${a.text}`);return i.filter(Boolean).join("")}function yd(e){return!!(e.content.trim()||e.toolCalls.length>0)}function vd(e){return(e.attachments??[]).filter(i=>i.kind==="image"&&i.dataUrl)}function lg(e,i){if(!e.trim())return{};try{const a=JSON.parse(e);if(a&&typeof a=="object"&&!Array.isArray(a))return a;throw new Error("arguments must be a JSON object")}catch(a){throw new Error(`The model returned invalid arguments for ${i}: ${a.message}`)}}function wd(e,i){return i==="done"?e??"(no output)":i==="denied"?"The user denied this tool call.":i==="error"?`Tool error: ${e??"unknown error"}`:i==="awaiting"?"The tool call was interrupted before approval.":e??"(no output)"}function ij(e){const i=[],a=(r,o)=>{if(o.length===0)return;const u=i[i.length-1];u?.role===r?u.content.push(...o):i.push({role:r,content:o})};for(const r of e){if(r.role==="user"){const o=[];for(const d of vd(r)){const p=/^data:(image\/[a-z0-9.+-]+);base64,(.+)$/i.exec(d.dataUrl??"");p&&o.push({type:"image",source:{type:"base64",media_type:p[1],data:p[2]}})}const u=Mo(r);u.trim()&&o.push({type:"text",text:u}),o.length===0&&o.push({type:"text",text:"(empty message)"}),a("user",o);continue}if(r.role==="assistant"){if(!yd(r))continue;const o=[];for(const u of r.thinkingBlocks??[])u.signature&&o.push({type:"thinking",thinking:u.text,signature:u.signature});r.content.trim()&&o.push({type:"text",text:r.content});for(const u of r.toolCalls)o.push({type:"tool_use",id:u.id,name:u.name,input:u.args});a("assistant",o);continue}a("user",[{type:"tool_result",tool_use_id:r.call.id,content:wd(r.result,r.status),is_error:r.status==="error"||r.status==="denied"}])}return i}async function Hw(e){const{settings:i,model:a,history:r,system:o,mode:u,signal:d,handlers:p}=e,h=i.model.trim();if(!h)throw new Error("Choose a model before sending a message.");const g=Nr(a),x=ul(i.effort,a),b=x!=="none"&&(g.length>0||Hu(a));let v=i.maxTokens,y=0;b&&g.length===0&&Hu(a)&&(y=hw(x,a),v=Math.max(i.maxTokens,y+1024),a?.maxOutput&&(v=Math.min(v,a.maxOutput)),y=Math.min(y,v-1024),y<1024&&(y=0));const k=bd(i,u).map(R=>({name:R.name,description:R.description,input_schema:R.parameters})),_={model:h,max_tokens:v,system:o,messages:ij(r),stream:!0};if(k.length>0&&(_.tools=k),b&&g.length>0){const R=x==="minimal"?"low":x;_.output_config={effort:R}}else y>0?_.thinking={type:"enabled",budget_tokens:y}:b||(!a||a.temperature)&&(_.temperature=i.temperature);const S=await Uo(i.provider,"anthropic",h,_,d);let N="",M="",j={};const D=new Map;for await(const R of xd(S)){let K;try{K=JSON.parse(R)}catch{continue}const z=K.type;if(z==="error"){const $=K.error;throw new Error(typeof $=="string"?$:$?.message??"Anthropic returned an error.")}if(z==="message_start"){const $=K.message;j={...j,input:$?.usage?.input_tokens};continue}if(z==="content_block_start"){const $=Number(K.index??D.size),W=K.content_block;D.set($,{type:String(W.type??""),text:typeof W.text=="string"?W.text:typeof W.thinking=="string"?W.thinking:"",signature:typeof W.signature=="string"?W.signature:"",id:typeof W.id=="string"?W.id:"",name:typeof W.name=="string"?W.name:"",json:"",input:W.input});continue}if(z==="content_block_delta"){const $=Number(K.index??0),W=D.get($),de=K.delta;if(!W||!de)continue;de.type==="text_delta"&&typeof de.text=="string"?(W.text+=de.text,N+=de.text,p.onText(de.text)):de.type==="thinking_delta"&&typeof de.thinking=="string"?(W.text+=de.thinking,M+=de.thinking,p.onReasoning(de.thinking)):de.type==="signature_delta"&&typeof de.signature=="string"?W.signature+=de.signature:de.type==="input_json_delta"&&typeof de.partial_json=="string"&&(W.json+=de.partial_json);continue}if(z==="message_delta"){const $=K.usage;j={...j,output:$?.output_tokens??j.output},p.onUsage(j);continue}if(z==="message_stop")break}const P=new Set(k.map(R=>R.name)),L=[],T=[];for(const[,R]of[...D.entries()].sort((K,z)=>K[0]-z[0])){if(R.type==="tool_use"&&R.name){if(!P.has(R.name))throw new Error(`The model requested a tool that is not enabled: ${R.name}`);const K=R.json?lg(R.json,R.name):R.input&&typeof R.input=="object"?R.input:{};L.push({id:R.id||`call_${Date.now().toString(36)}_${L.length}`,name:R.name,args:K})}R.type==="thinking"&&R.text&&T.push({text:R.text,signature:R.signature||void 0})}return L.length>0&&p.onToolCalls(L),{content:N,reasoning:M,toolCalls:L,thinkingBlocks:T,usage:j}}function aj(e){const i=[],a=(r,o)=>{if(o.length===0)return;const u=i[i.length-1];u?.role===r?u.parts.push(...o):i.push({role:r,parts:o})};for(const r of e){if(r.role==="user"){const o=[];for(const d of vd(r)){const p=/^data:([^;]+);base64,(.+)$/i.exec(d.dataUrl??"");p&&o.push({inlineData:{mimeType:p[1],data:p[2]}})}const u=Mo(r);u.trim()&&o.push({text:u}),o.length===0&&o.push({text:"(empty message)"}),a("user",o);continue}if(r.role==="assistant"){if(!yd(r))continue;const o=[];r.content.trim()&&o.push({text:r.content});for(const u of r.toolCalls)o.push({functionCall:{name:u.name,args:u.args},...u.thoughtSignature?{thoughtSignature:u.thoughtSignature}:{}});a("model",o);continue}a("user",[{functionResponse:{name:r.call.name,response:{result:wd(r.result,r.status),...r.status==="error"||r.status==="denied"?{isError:!0}:{}}}}])}return i}function ph(e){if(Array.isArray(e))return e.map(ph);if(!e||typeof e!="object")return e;const i={};for(const[a,r]of Object.entries(e))a==="additionalProperties"||a==="$schema"||(i[a]=ph(r));return i}async function Pw(e){const{settings:i,model:a,history:r,system:o,mode:u,signal:d,handlers:p}=e,h=i.model.trim();if(!h)throw new Error("Choose a model before sending a message.");const g=Nr(a),x=ul(i.effort,a),b=Hu(a)?hw(x,a):0,v=x!=="none"&&(g.length>0||b>0);let y=i.maxTokens;v&&b>0&&(y=Math.max(y,b+2048),a?.maxOutput&&(y=Math.min(y,a.maxOutput)));const k=bd(i,u),_={maxOutputTokens:y};(!a||a.temperature)&&(_.temperature=i.temperature),v&&g.length>0?_.thinkingConfig={thinkingLevel:x.toUpperCase(),includeThoughts:!0}:v&&b>0?_.thinkingConfig={thinkingBudget:Math.min(b,Math.max(1024,y-1024)),includeThoughts:!0}:v&&pw(a)&&(_.thinkingConfig={includeThoughts:!0});const S={systemInstruction:{parts:[{text:o}]},contents:aj(r),generationConfig:_};k.length>0&&(S.tools=[{functionDeclarations:k.map(z=>({name:z.name,description:z.description,parameters:ph(z.parameters)}))}],S.toolConfig={functionCallingConfig:{mode:"AUTO"}});const N=await Uo(i.provider,"gemini",h,S,d);let M="",j="",D={},P="";const L=[],T=new Set(k.map(z=>z.name));let R;for await(const z of xd(N)){let $;try{$=JSON.parse(z)}catch{continue}const W=$.error;if(W?.message)throw new Error(W.message);const de=$.promptFeedback;if(de?.blockReason)throw new Error(`Gemini blocked this request (${de.blockReason}).`);const ce=$.usageMetadata;ce&&(D={input:ce.promptTokenCount,output:(ce.candidatesTokenCount??0)+(ce.thoughtsTokenCount??0)||ce.candidatesTokenCount},p.onUsage(D));const O=$.candidates?.[0];O?.finishReason&&(P=O.finishReason);for(const te of O?.content?.parts??[]){const ne=typeof te.thoughtSignature=="string"?te.thoughtSignature:void 0;ne&&(R=ne),typeof te.text=="string"&&te.text&&(te.thought===!0?(j+=te.text,p.onReasoning(te.text)):(M+=te.text,p.onText(te.text)));const G=te.functionCall;if(G?.name){if(!T.has(G.name))throw new Error(`Gemini requested a tool that is not enabled: ${G.name}`);L.push({name:G.name,args:G.args??{},signature:ne??R}),R=void 0}}}if(P==="SAFETY"||P==="RECITATION")throw new Error(`Gemini stopped the response (${P.toLowerCase()}).`);const K=L.map((z,$)=>({id:`gemini_${Date.now().toString(36)}_${$}`,name:z.name,args:z.args,thoughtSignature:z.signature}));return K.length>0&&p.onToolCalls(K),{content:M,reasoning:j,toolCalls:K,usage:D}}function rj(e){const i=[];for(const a of e){if(a.role==="user"){const r=vd(a);if(r.length>0){const o=[{type:"text",text:Mo(a)||"See the attached image."}];for(const u of r)o.push({type:"image_url",image_url:{url:u.dataUrl,detail:"auto"}});i.push({role:"user",content:o})}else{const o=Mo(a);o.trim()&&i.push({role:"user",content:o})}continue}if(a.role==="assistant"){if(!yd(a))continue;const r={role:"assistant",content:a.content||null};a.toolCalls.length>0&&(r.tool_calls=a.toolCalls.map(o=>({id:o.id,type:"function",function:{name:o.name,arguments:JSON.stringify(o.args)}}))),i.push(r);continue}i.push({role:"tool",tool_call_id:a.call.id,content:wd(a.result,a.status)})}return i}function c0(e,i){return e!=="openai"?!1:/^(gpt-5|o[1-9]|codex)/i.test(i)}async function Fw(e){const{settings:i,model:a,history:r,system:o,mode:u,signal:d,handlers:p}=e,h=i.model.trim();if(!h)throw new Error("Choose a model before sending a message.");const g=bd(i,u),x=new Set(g.map(L=>L.name)),b=g.map(L=>({type:"function",function:{name:L.name,description:L.description,parameters:L.parameters}})),v={model:h,messages:[{role:"system",content:o},...rj(r)],stream:!0};b.length>0&&(v.tools=b,v.tool_choice="auto"),(i.provider==="openai"||i.provider==="openrouter")&&(v.stream_options={include_usage:!0}),c0(i.provider,h)?v.max_completion_tokens=i.maxTokens:v.max_tokens=i.maxTokens;let k=Nr(a).length>0?ul(i.effort,a):"";k==="none"&&(k=""),k&&(i.provider==="openrouter"?v.reasoning={effort:k}:v.reasoning_effort=k);const _=a?a.temperature:!c0(i.provider,h);!k&&_&&(v.temperature=i.temperature);const S=await Uo(i.provider,"openai-chat",h,v,d);let N="",M="",j={};const D=new Map;for await(const L of xd(S)){if(L==="[DONE]")break;let T;try{T=JSON.parse(L)}catch{continue}if(T.error){const $=T.error;throw new Error(typeof $=="string"?$:$.message??"The provider returned an error.")}if(T.usage&&typeof T.usage=="object"){const $=T.usage;j={input:$.prompt_tokens,output:$.completion_tokens},p.onUsage(j)}const K=T.choices?.[0]?.delta;if(!K)continue;typeof K.content=="string"&&K.content&&(N+=K.content,p.onText(K.content));const z=typeof K.reasoning_content=="string"?K.reasoning_content:typeof K.reasoning=="string"?K.reasoning:(K.reasoning_details??[]).map($=>$.text??"").join("");z&&(M+=z,p.onReasoning(z));for(const[$,W]of(K.tool_calls??[]).entries()){const de=typeof W.index=="number"?W.index:$,ce=D.get(de)??{id:"",name:"",arguments:""};W.id&&(ce.id=W.id),W.function?.name&&(ce.name=W.function.name),W.function?.arguments&&(ce.arguments+=W.function.arguments),D.set(de,ce)}}const P=[];for(const[L,T]of[...D.entries()].sort((R,K)=>R[0]-K[0]))if(T.name){if(!x.has(T.name))throw new Error(`The model requested a tool that is not enabled: ${T.name}`);P.push({id:T.id||`call_${Date.now().toString(36)}_${L}`,name:T.name,args:lg(T.arguments,T.name)})}return P.length>0&&p.onToolCalls(P),{content:N,reasoning:M,toolCalls:P,usage:j}}function sj(e){const i=[];for(const a of e){if(a.role==="user"){const r=vd(a),o=Mo(a)||(r.length>0?"See the attached image.":"");if(!o.trim()&&r.length===0)continue;if(r.length===0){i.push({role:"user",content:o});continue}const u=[{type:"input_text",text:o}];for(const d of r)u.push({type:"input_image",image_url:d.dataUrl,detail:"auto"});i.push({role:"user",content:u});continue}if(a.role==="assistant"){if(!yd(a))continue;a.content.trim()&&i.push({role:"assistant",content:a.content});for(const r of a.toolCalls)i.push({type:"function_call",call_id:r.id,name:r.name,arguments:JSON.stringify(r.args)});continue}i.push({type:"function_call_output",call_id:a.call.id,output:wd(a.result,a.status)})}return i}function Zs(e){return e&&typeof e=="object"?e:{}}async function qw(e){const{settings:i,model:a,history:r,system:o,mode:u,signal:d,handlers:p}=e,h=i.model.trim();if(!h)throw new Error("Choose a model before sending a message.");const g=bd(i,u),x=new Set(g.map(T=>T.name)),b={model:h,instructions:o,input:sj(r),max_output_tokens:i.maxTokens,tool_choice:"auto"};g.length>0&&(b.tools=g.map(T=>({type:"function",name:T.name,description:T.description,parameters:T.parameters,strict:!1})));const y=Nr(a).length>0?ul(i.effort,a):"none";y!=="none"&&(b.reasoning={effort:y});const k=await Uo(i.provider,"openai-responses",h,b,d);let _="",S="",N={};const M=new Map;let j=0;const D=(T,R)=>{const K=M.get(T),z=typeof R.call_id=="string"?R.call_id:K?.id||T,$=typeof R.name=="string"?R.name:K?.name||"",W=typeof R.arguments=="string"?R.arguments:K?.args||"";M.set(T,{id:z,name:$,args:W,order:K?.order??j++})};for await(const T of xd(k)){if(T==="[DONE]")break;let R;try{R=JSON.parse(T)}catch{continue}const K=typeof R.type=="string"?R.type:"";if(K==="error"||K==="response.failed"){const z=Zs(R.response).error??R.error??R.message,$=Zs(z);throw new Error(typeof z=="string"?z:typeof $.message=="string"?$.message:"The model request failed.")}if(K==="response.output_text.delta"&&typeof R.delta=="string"){_+=R.delta,p.onText(R.delta);continue}if((K==="response.reasoning_summary_text.delta"||K==="response.reasoning_text.delta")&&typeof R.delta=="string"){S+=R.delta,p.onReasoning(R.delta);continue}if(K==="response.output_item.added"){const z=Zs(R.item);if(z.type==="function_call"){const $=typeof z.id=="string"?z.id:typeof z.call_id=="string"?z.call_id:"";$&&D($,z)}continue}if(K==="response.function_call_arguments.delta"){const z=typeof R.item_id=="string"?R.item_id:"",$=z?M.get(z):void 0;$&&typeof R.delta=="string"&&($.args+=R.delta);continue}if(K==="response.function_call_arguments.done"){const z=typeof R.item_id=="string"?R.item_id:"",$=z?M.get(z):void 0;$&&typeof R.arguments=="string"&&($.args=R.arguments);continue}if(K==="response.output_item.done"){const z=Zs(R.item);if(z.type==="function_call"){const $=typeof z.id=="string"?z.id:typeof z.call_id=="string"?z.call_id:"";$&&D($,z)}continue}if(K==="response.completed"){const z=Zs(R.response),$=Zs(z.usage);(typeof $.input_tokens=="number"||typeof $.output_tokens=="number")&&(N={input:Number($.input_tokens)||void 0,output:Number($.output_tokens)||void 0},p.onUsage(N))}}const P=[],L=[...M.entries()].sort((T,R)=>T[1].order-R[1].order);for(const[T,R]of L)if(R.name){if(!x.has(R.name))throw new Error(`The model requested a tool that is not enabled: ${R.name}`);P.push({id:R.id||T,name:R.name,args:lg(R.args,R.name)})}return P.length>0&&p.onToolCalls(P),{content:_,reasoning:S,toolCalls:P,usage:N}}const Eo=[],Gw=600*1e3,On=Er()((e,i)=>({byProvider:{},loading:{},errors:{},notes:{},source:{},fetchedAt:{},fetchModels:async(a,r=!1)=>{if(i().loading[a])return i().byProvider[a]??Eo;if(!r){const o=i().byProvider[a]??Eo,u=i().fetchedAt[a]??0;if(o.length>0&&Date.now()-u<Gw)return o}e(o=>({loading:{...o.loading,[a]:!0},errors:{...o.errors,[a]:""}}));try{const o=await LC(a);return e(u=>({byProvider:{...u.byProvider,[a]:o.models},loading:{...u.loading,[a]:!1},errors:{...u.errors,[a]:""},notes:{...u.notes,[a]:o.note||o.catalogError||""},source:{...u.source,[a]:o.source},fetchedAt:{...u.fetchedAt,[a]:o.fetchedAt||Date.now()}})),o.models}catch(o){const u=o instanceof Error?o.message:"Could not load models from this provider.";return e(d=>({loading:{...d.loading,[a]:!1},errors:{...d.errors,[a]:u},source:{...d.source,[a]:""}})),i().byProvider[a]??Eo}}}));function lj(e){return On(i=>i.byProvider[e])??Eo}function kd(){const e=Oe(a=>a.provider),i=Oe(a=>a.model);return On(a=>i?a.byProvider[e]?.find(r=>r.id===i)??null:null)}function Bo(e,i){return i?On.getState().byProvider[e]?.find(a=>a.id===i)??null:null}function oj(){const e=Oe(a=>a.hydrated),i=Oe(a=>a.provider);B.useEffect(()=>{if(!e)return;const a=Oe.getState();if(!dl(a))return;const r=On.getState(),o=r.byProvider[i]??Eo,u=r.fetchedAt[i]??0;o.length>0&&Date.now()-u<Gw||r.fetchModels(i)},[e,i])}function Yw(e,i,a){if(a?.apiKind)return a.apiKind;const r=aa[e];if(e!=="opencode")return r?.format==="anthropic"?"anthropic":r?.format==="gemini"?"gemini":"openai-chat";const o=i.toLowerCase();return/gemini|gemma/.test(o)?"gemini":/claude|qwen.*(flash|plus)/.test(o)?"anthropic":/gpt|grok|muse|codex/.test(o)?"openai-responses":"openai-chat"}class cj extends wi{static provide="llm";constructor(i){super(i,"llm")}async stream(i){return await this.ctx.events.waterfall("agent/request",i,async()=>{switch(Yw(i.settings.provider,i.settings.model,i.model)){case"anthropic":return await Hw(i);case"gemini":return await Pw(i);case"openai-responses":return await qw(i);default:return await Fw(i)}})}}function Kw(e){switch(Yw(e.settings.provider,e.settings.model,e.model)){case"anthropic":return Hw(e);case"gemini":return Pw(e);case"openai-responses":return qw(e);default:return Fw(e)}}const uj=`You are a session compactor. Your ONLY job is to produce a detailed, structured summary of the conversation you are given. This summary will replace the original messages so the AI agent can continue the task without losing important context.
|
|
134
|
+
|
|
135
|
+
The summary MUST include, in clear sections:
|
|
136
|
+
|
|
137
|
+
## Task & Goal
|
|
138
|
+
What the user originally asked for. The full scope, requirements, and any constraints they stated.
|
|
139
|
+
|
|
140
|
+
## Work Completed So Far
|
|
141
|
+
Every meaningful action taken: files read, files created or modified (list each file path and what changed), commands run (and their output), API calls made, decisions reached, bugs found and fixed.
|
|
142
|
+
|
|
143
|
+
## Current State
|
|
144
|
+
What is the exact state of the workspace right now? Which files are in what state? What has been verified to work? What is broken or incomplete?
|
|
145
|
+
|
|
146
|
+
## Open Tasks & Next Steps
|
|
147
|
+
What remains to be done? List concrete next actions with enough detail that the agent can pick up exactly where things left off.
|
|
148
|
+
|
|
149
|
+
## Key Facts & Decisions
|
|
150
|
+
Important technical facts discovered during the session: library versions, APIs used, architectural decisions made, pitfalls encountered.
|
|
151
|
+
|
|
152
|
+
## Files Modified or Created
|
|
153
|
+
An exhaustive list of every file path that was touched and a one-line description of what was done.
|
|
154
|
+
|
|
155
|
+
Be exhaustive and precise. Do not summarize tool output vaguely — include actual file paths, function names, error messages, command outputs. The agent continuing the work must be able to act on this summary without access to the original messages.`,Du=new Set;function Vw(e){return Du.has(e)}async function dj(e){if(Du.has(e))return!1;Du.add(e);try{const i=Ye.getState().sessions.find(k=>k.id===e);if(!i||i.messages.length<4)return!1;const a=Oe.getState(),r=li(a);if(!r)return!1;const o=Bo(a.provider,r),u=fj(i.messages),d=[{id:vi("msg"),role:"user",content:`Below is a complete transcript of a coding session. Produce the detailed summary as instructed.
|
|
156
|
+
|
|
157
|
+
${u}`,createdAt:Date.now()}];let p="";try{const k=await Kw({settings:a,model:o,history:d,system:uj,mode:"build",signal:new AbortController().signal,handlers:{...$w,onText:_=>{p+=_}}});k.content.trim()&&(p=k.content)}catch(k){return window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:`Auto-compact failed: ${k instanceof Error?k.message:"Unknown error"}. Continuing with full context.`,tone:"error"}})),!1}if(!p.trim())return!1;const h=i.messages.find(k=>k.role==="user"),g=Date.now(),x=[];h&&x.push({...h});const b={id:vi("msg"),role:"assistant",content:p.trim(),reasoning:"",toolCalls:[],round:0,model:r,provider:a.provider,createdAt:g,durationMs:0};x.push(b);const v=pj(i.messages),y={id:vi("msg"),role:"user",content:v,createdAt:g};return x.push(y),Ye.getState().updateSession(e,{messages:x}),window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:"✦ Context compacted — session summary saved, continuing with fresh context.",tone:"success"}})),!0}finally{Du.delete(e)}}function fj(e){const i=[];for(const a of e)if(a.role==="user"){const r=a.attachments&&a.attachments.length>0?`
|
|
158
|
+
[Attachments: ${a.attachments.map(o=>o.name).join(", ")}]`:"";i.push(`[USER]
|
|
159
|
+
${a.content}${r}`)}else if(a.role==="assistant"){const r=[];a.reasoning.trim()&&r.push(`<thinking>
|
|
160
|
+
${a.reasoning.trim()}
|
|
161
|
+
</thinking>`),a.content.trim()&&r.push(a.content.trim());for(const o of a.toolCalls)r.push(`<tool_call name="${o.name}">
|
|
162
|
+
${JSON.stringify(o.args,null,2)}
|
|
163
|
+
</tool_call>`);r.length>0&&i.push(`[ASSISTANT]
|
|
164
|
+
${r.join(`
|
|
165
|
+
|
|
166
|
+
`)}`)}else if(a.role==="tool"){const r=a.status==="done"?"OK":a.status.toUpperCase(),o=(a.result??"").slice(0,8e3),u=(a.result??"").length>8e3?`
|
|
167
|
+
… (truncated)`:"";i.push(`[TOOL: ${a.call.name} — ${r}]
|
|
168
|
+
${o}${u}`)}return i.join(`
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
`)}function pj(e){const r=[...e].reverse().find(d=>d.role==="user")?.content?.trim()??"",o=e.filter(d=>d.role==="tool").length;return[`[CONTEXT COMPACTED — ${e.filter(d=>d.role==="user").length} user turns, ${o} tool calls summarised above]`,"","The summary above contains the full record of work done so far. Please:","1. Read the summary carefully before acting — it contains critical state information.","2. Continue exactly where you left off.","3. Do not repeat work already marked as completed in the summary.",r?`
|
|
173
|
+
The most recent task/request was:
|
|
174
|
+
${r}`:""].filter(d=>d!==void 0).join(`
|
|
175
|
+
`)}const cm=3;function mj(e){if(e.role==="user"){const i=(e.attachments??[]).reduce((a,r)=>a+(r.text?.length??0),0);return Math.ceil((e.content.length+i)/cm)+4}if(e.role==="assistant"){const i=e.toolCalls.reduce((a,r)=>a+JSON.stringify(r.args).length+r.name.length+10,0);return Math.ceil((e.content.length+e.reasoning.length+i)/cm)+4}return Math.ceil((e.result??"").length/cm)+4}function Xw(e){return e.reduce((i,a)=>i+mj(a),0)}function Zw(e){return e?.context??128e3}function hj(e,i){const r=Xw(e)+2e3,o=Zw(i);return Math.min(r/o,1)}function Qw(e,i){const r=Xw(e)+2e3,o=Zw(i),u=Math.min(r/o,1);return{used:r,limit:o,ratio:u,pct:Math.round(u*100)}}const Jw=.85;class gj extends wi{static provide="compaction";static inject=["sessions","llm"];constructor(i){super(i,"compaction")}isCompacting(i){return Vw(i)}async compact(i){return await dj(i)}async checkAutoCompact(i){const a=Ye.getState().sessions.find(d=>d.id===i);if(!a||a.messages.length<4||this.isCompacting(i))return!1;const r=Oe.getState(),o=Bo(r.provider,li(r)),u=hj(a.messages,o);return u>=Jw?(window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:`Context at ${Math.round(u*100)}% — compacting session before next request…`,tone:"info"}})),await this.compact(i)):!1}}function xj(){const e=Be.getState(),i=e.root||e.info.root;if(!i)return"No folder is open yet. Ask the user to choose a workspace folder in the Workspace panel before using file, shell or git tools.";const a=e.entries.filter(o=>!o.path.includes("/")).slice(0,40).map(o=>`${o.path}${o.type==="dir"?"/":""}`),r=e.git.available?`${e.git.branch||"detached HEAD"} · ${e.git.entries.length} changed file${e.git.entries.length===1?"":"s"}`:"not a git repository";return[`Root: ${i}`,`Git: ${r}`,a.length>0?`Top level: ${a.join(", ")}`:"The folder is empty.",e.truncated?"The file tree was truncated; use list_files or grep for deeper paths.":""].filter(Boolean).join(`
|
|
176
|
+
`)}function bj(e,i=e.mode){if(qt.systemPrompt)return qt.systemPrompt.assemble(e,i);const a=[e.systemPrompt.trim()],r=e.skills.filter(o=>o.enabled);return r.length>0&&a.push(["## Loaded skills","Apply these skills when the task matches their purpose. They refine the working rules above; they never override safety, tool permissions or plan mode.",...r.map(o=>`<skill name="${o.name}">
|
|
177
|
+
Purpose: ${o.description}
|
|
178
|
+
${o.instructions.trim()}
|
|
179
|
+
</skill>`)].join(`
|
|
180
|
+
|
|
181
|
+
`)),a.push(["## Workspace","You operate on the real folder below through the local OpenSol daemon. Tools return real output; never invent file contents, command results, URLs or deployments.",xj()].join(`
|
|
182
|
+
|
|
183
|
+
`)),a.push(i==="plan"?["## Mode: Plan (read-only)","Investigate and design. Do not modify anything.","- Allowed: read_file, list_files, grep, web_search, read_url, read-only shell commands and read-only git actions.","- Forbidden: write_file, edit_file, rewrite_file, git add/commit/init/checkout, and shell commands that change files, install packages or change system state. The daemon rejects these.","- Read the relevant source before proposing changes. Grep for call sites and inspect the real files.","- Finish with a concrete, ordered implementation plan naming files and functions. State assumptions and open questions plainly.","- Never pretend an edit was made or a check was run."].join(`
|
|
184
|
+
`):["## Mode: Build","You may inspect and change the real workspace.","- Inspect before editing: list files, read the source, grep for call sites, check git status.","- Make the smallest coherent change. Do not reformat unrelated code, add speculative abstractions or invent APIs.","- After a mutation, inspect the result. Run the project’s real typecheck, lint, tests and build when they exist, and read the output.","- Never claim a check passed without running it. If a check cannot run, say why.","- Ask before destructive actions, force pushes, credential changes or anything that leaves the workspace."].join(`
|
|
185
|
+
`)),a.push(["## Session context",`- Model: ${li(e)||"unset"}`,`- Date: ${new Date().toISOString().slice(0,10)}`,`- Mode: ${i}`,e.webSearchEnabled?"- Web search is enabled. Use it when facts may be current or when the user asks for sources.":"- Web search is turned off for this session.","- Use relative paths from the workspace root. Do not use /workspace paths."].join(`
|
|
186
|
+
`)),a.filter(Boolean).join(`
|
|
187
|
+
|
|
188
|
+
`)}function yj(e){return[bj(e,"plan"),["## Subagent","You are a focused read-only investigator. Work only on the assigned task.","- Inspect the real workspace with read-only file, grep, shell and web tools.","- Do not edit files, change git state or run commands that mutate the machine. The daemon enforces this.","- Be concise: return findings, exact file paths and line references, and any uncertainty.","- Do not repeat the task back. Do not invent evidence. If something cannot be verified, say so."].join(`
|
|
189
|
+
`)].join(`
|
|
190
|
+
|
|
191
|
+
`)}const u0=6;function um(e){const i=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,9)}`;return`${e}_${i}`}function dm(){return new DOMException("Aborted","AbortError")}async function vj(e,i,a){const r=e.trim();if(!r)return"The subagent was not given a task.";if(a.aborted)throw dm();const o=Oe.getState(),u=Bo(o.provider,o.model),d=yj(o),p=Date.now(),g=[{id:um("sub"),role:"user",content:[`Task: ${r}`,i.trim()?`
|
|
192
|
+
Context from the main agent:
|
|
193
|
+
${i.trim()}`:"",`
|
|
194
|
+
Investigate now. Return a concise report with file paths and evidence.`].filter(Boolean).join(`
|
|
195
|
+
`),createdAt:p}];let x="";for(let b=0;b<u0;b+=1){if(a.aborted)throw dm();const v=await Kw({settings:o,model:u,history:g,system:d,mode:"plan",signal:a,handlers:$w});v.content.trim()&&(x=v.content.trim());const y={id:um("submsg"),role:"assistant",content:v.content,reasoning:v.reasoning,thinkingBlocks:v.thinkingBlocks,toolCalls:v.toolCalls,round:b,createdAt:Date.now()};if(g.push(y),v.toolCalls.length===0)return y.content.trim()||"The subagent returned no report.";if(a.aborted)throw dm();for(const k of v.toolCalls){const _=await nj(k.name,k.args,o,"plan",a),S={id:um("subtool"),role:"tool",call:k,status:_.isError?"error":"done",result:_.output,round:b,createdAt:Date.now()};g.push(S)}}return[x,`The subagent stopped after ${u0} investigation rounds. Continue with the evidence above or ask a narrower question.`].filter(Boolean).join(`
|
|
196
|
+
|
|
197
|
+
`)}class wj extends wi{static provide="subagents";static inject=["tools","llm","systemPrompt"];constructor(i){super(i,"subagents")}async run(i,a,r){return await vj(i,a,r)}}const mh=e=>`maxcode-plugin-theme-${e}`;function kj(e){return Object.entries(e).filter(([i,a])=>/^[a-z][a-z0-9-]*$/.test(i)&&/^[\d\s.]+$/.test(a))}function Ej(e){const i=(e.canvas??"").trim().split(/\s+/).map(Number),[a,r,o]=i.length===3?i:[255,255,255];return .2126*a+.7152*r+.0722*o<110}function Nj(e,i){const a=kj(i).map(([r,o])=>`--${r}:${o.trim()}`);return a.length===0?"":`[data-theme='${e}']{${a.join(";")}}`}function _j(e,i){if(typeof document>"u")return;let a=document.getElementById(mh(e));a||(a=document.createElement("style"),a.id=mh(e),document.head.append(a)),a.textContent=i}function Sj(e){typeof document>"u"||document.getElementById(mh(e))?.remove()}class Tj extends wi{static provide="ui";_commands=new Map;_panels=new Map;_themes=new Map;constructor(i){super(i,"ui")}registerCommand(i,a,r){const o={id:i,label:a,run:r};return this._commands.set(i,o),()=>{this._commands.get(i)===o&&this._commands.delete(i)}}registerPanel(i,a,r){const o={id:i,label:a,render:r};return this._panels.set(i,o),()=>{this._panels.get(i)===o&&this._panels.delete(i)}}registerTheme(i,a,r){const o={id:i,label:a,palette:r};return this._themes.set(i,o),xw({id:i,label:a,dark:Ej(r)}),_j(i,Nj(i,r)),()=>{this._themes.get(i)===o&&(this._themes.delete(i),bw(i),Sj(i))}}commands(){return[...this._commands.values()]}panels(){return[...this._panels.values()]}themes(){return[...this._themes.values()].map(i=>({id:i.id,label:i.label}))}}const fm=16,d0=2,Cj=/\b(429|500|502|503|504|529)\b|rate.?limit|overloaded|temporar|timed out|could not be reached|lost the connection|failed to fetch|networkerror/i;function Aj(e,i){return new Promise(a=>{const r=()=>{window.clearTimeout(o),i.removeEventListener("abort",r),a()},o=window.setTimeout(r,e);i.addEventListener("abort",r,{once:!0})})}function f0(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function jj(e,i=4e4){return e.length<=i?e:`${e.slice(0,i)}
|
|
198
|
+
… truncated (${e.length-i} more characters)`}class Oj extends wi{static provide="agentLoop";static inject=["sessions","systemPrompt","tools","llm","approval","compaction","subagents"];controllers=new Map;queue=IA((i,a)=>this.runTurn(i,a));constructor(i){super(i,"agentLoop")}isBusy(i){return this.queue.isBusy(i)}stopRun(i){this.queue.clear(i),this.controllers.get(i)?.abort(),this.ctx.events.serial("agent/turn-stopping",i)}stopAllRuns(){this.queue.clearAll(),this.controllers.forEach((i,a)=>{i.abort(),this.ctx.events.serial("agent/turn-stopping",a)})}runAgent(i,a){const r=this.ctx.sessions.current(i);if(!r)return;const o=a??lm(r.messages);o&&this.queue.push(i,o)}regenerateLastTurn(i){const a=this.ctx.sessions.current(i);if(!a||this.queue.isBusy(i))return!1;let r=-1;for(let u=a.messages.length-1;u>=0;u-=1)if(a.messages[u].role==="user"){r=u;break}if(r<0)return!1;const o=a.messages[r].id;return this.ctx.sessions.updateSession(i,{messages:a.messages.slice(0,r+1)}),this.runAgent(i,o),!0}async runTurn(i,a){const r=this.ctx.sessions.current(i);if(!r||!this.ctx.sessions.turnHistory(r.messages,a))return;const o=new AbortController;this.controllers.set(i,o),Da.getState().setStreaming(i,!0);const u=Oe.getState(),d=Jh(u.provider),p=r.mode??u.mode,h=Date.now();let g=0,x;try{e:for(let v=0;v<fm&&(g=v+1,!o.signal.aborted);v+=1){let y=this.ctx.sessions.current(i);if(!y)break;if(v===0&&lm(y.messages)===a&&await this.ctx.compaction.checkAutoCompact(i)){const W=this.ctx.sessions.current(i);if(!W)break;const de=lm(W.messages);if(!de)break;a=de,y=W}const k=this.ctx.sessions.turnHistory(y.messages,a);if(!k)break;const _=vi("msg"),S={id:_,role:"assistant",content:"",reasoning:"",toolCalls:[],round:v,model:li(u),provider:u.provider,createdAt:Date.now()};this.ctx.sessions.addMessage(i,S);let N="",M="",j,D={};const P=()=>{j===void 0&&(j=window.setTimeout(()=>{j=void 0,this.ctx.sessions.updateMessage(i,_,{content:N,reasoning:M})},40))},L={sessionId:i,round:v,history:k,settings:u,mode:p,signal:o.signal,assistantId:_};await this.ctx.events.waterfall("agent/pre-step",L,()=>{});let T,R=0;for(;;)try{T=await this.ctx.llm.stream({settings:u,model:Bo(u.provider,li(u)),history:k,system:this.ctx.systemPrompt.assemble(u,p),mode:p,signal:o.signal,handlers:{onText:$=>{N+=$,P()},onReasoning:$=>{M+=$,P()},onToolCalls:()=>{},onUsage:$=>{D=$}}});break}catch($){const W=f0($)||o.signal.aborted;if(!W&&R<d0&&!N&&!M&&Cj.test($ instanceof Error?$.message:"")){if(R+=1,window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:`${d} is busy. Retrying (${R}/${d0})…`,tone:"info"}})),await Aj(1200*R*R,o.signal),o.signal.aborted)continue;continue}j!==void 0&&window.clearTimeout(j),x=W?void 0:KA($,d),this.ctx.sessions.updateMessage(i,_,{content:N,reasoning:M,stopped:W,durationMs:Date.now()-h,error:x}),await this.ctx.events.waterfall("agent/request-error",$,L,()=>{});break e}if(j!==void 0&&window.clearTimeout(j),this.ctx.sessions.updateMessage(i,_,{content:T.content,reasoning:T.reasoning,thinkingBlocks:T.thinkingBlocks,toolCalls:T.toolCalls,usage:D.input||D.output?D:T.usage,durationMs:Date.now()-h,stopped:o.signal.aborted||void 0}),this.ctx.sessions.updateSession(i,{provider:u.provider,model:li(u),mode:p}),o.signal.aborted)break;if(T.toolCalls.length===0){const $={sessionId:i,round:v,assistant:S,toolResults:[],stopped:o.signal.aborted};this.ctx.events.emit("agent/step-finish",$);break}const K=[];for(const $ of T.toolCalls){if(o.signal.aborted)break;const W=Ku(u,$.name);if(!W?.enabled){const te={id:vi("tool"),role:"tool",call:$,status:"error",result:"This tool is disabled in Settings → Tools.",round:v,createdAt:Date.now()};this.ctx.sessions.addMessage(i,te),K.push(te);continue}const de=vi("tool"),ce=W.approval==="ask",ae={id:de,role:"tool",call:$,status:ce?"awaiting":"running",round:v,createdAt:Date.now()};this.ctx.sessions.addMessage(i,ae);const O=Date.now();try{const te=$.name==="subagent"?{output:jj(await this.ctx.subagents.run(typeof $.args.task=="string"?$.args.task:"",typeof $.args.context=="string"?$.args.context:"",o.signal)),isError:!1}:await this.ctx.tools.execute($.name,$.args,u,p,o.signal,$.id,a),ne={...ae,status:te.isError?"error":"done",result:te.output,durationMs:Date.now()-O,diff:te.diff};this.ctx.sessions.updateMessage(i,de,ne),K.push(ne)}catch(te){const ne=f0(te),G={...ae,status:"error",result:ne?"Stopped.":te instanceof Error?te.message:"The tool failed.",durationMs:Date.now()-O};if(this.ctx.sessions.updateMessage(i,de,G),K.push(G),ne)break}}const z={sessionId:i,round:v,assistant:S,toolResults:K,stopped:o.signal.aborted};if(this.ctx.events.emit("agent/step-finish",z),o.signal.aborted){const $=this.ctx.sessions.current(i);if($){const W=new Set($.messages.filter(de=>de.role==="tool").map(de=>de.call.id));for(const de of T.toolCalls)W.has(de.id)||this.ctx.sessions.addMessage(i,{id:vi("tool"),role:"tool",call:de,status:"error",result:"Stopped before the tool ran.",round:v,createdAt:Date.now()})}break}}const b=this.ctx.sessions.current(i);if(!o.signal.aborted&&b&&b.messages[b.messages.length-1]?.role==="tool"){const y={id:vi("msg"),role:"assistant",content:"",reasoning:"",toolCalls:[],round:fm,createdAt:Date.now(),error:`Stopped after ${fm} tool rounds. Send another message to continue.`};this.ctx.sessions.addMessage(i,y)}}finally{this.controllers.delete(i),Da.getState().setStreaming(i,!1);const b={sessionId:i,userMessageId:a,rounds:g,durationMs:Date.now()-h,stopped:o.signal.aborted,error:x};this.ctx.events.emit("agent/turn-finish",b)}}}const Mj="You name chat sessions for a coding assistant. Reply with the title only: 2 to 6 words, in the same language as the user, no quotes, no markdown, no trailing punctuation.";function p0(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a}function Rj(e){const i=e.replace(/<think>[\s\S]*?<\/think>/gi,"").split(`
|
|
199
|
+
`).map(r=>r.trim()).find(Boolean);if(!i)return"";const a=i.replace(/^(title|tiêu đề)\s*[::-]\s*/i,"").replace(/^[#>*\-\s"'“”‘’`]+|[\s"'“”‘’`.。!]+$/g,"").trim();return a.length>64?`${a.slice(0,63).trim()}…`:a}function Dj(e){const i=e.find(r=>r.role==="user"),a=[...e].reverse().find(r=>r.role==="assistant"&&r.content.trim());return{user:i&&i.role==="user"?p0(i.content,700):"",assistant:a&&a.role==="assistant"?p0(a.content,700):""}}class zj extends wi{static provide="titles";static inject=["llm","sessions"];inflight=new Set;constructor(i){super(i,"titles"),this.ctx.on("agent/turn-finish",a=>{if(a.error||a.stopped||!Oe.getState().aiSessionTitles)return;const o=this.ctx.sessions.current(a.sessionId);!o||(o.titleSource??"auto")!=="auto"||this.generate(a.sessionId)})}async generate(i,{force:a=!1}={}){if(this.inflight.has(i))return null;const r=this.ctx.sessions.current(i);if(!r||!a&&(r.titleSource??"auto")!=="auto")return null;const{user:o,assistant:u}=Dj(r.messages);if(!o)return null;const d=Oe.getState(),p=Bo(d.provider,li(d)),h=Object.fromEntries(Object.entries(d.tools).map(([v,y])=>[v,{...y,enabled:!1}])),g=Ao(p),x={...d,tools:h,webSearchEnabled:!1,temperature:.3,maxTokens:512,effort:g[0]??d.effort},b=[{id:vi("title"),role:"user",createdAt:Date.now(),content:`Name this conversation.
|
|
200
|
+
|
|
201
|
+
User: ${o}
|
|
202
|
+
|
|
203
|
+
Assistant: ${u||"(no answer yet)"}`}];this.inflight.add(i),Da.getState().setTitling(i,!0);try{const v=new AbortController,y=window.setTimeout(()=>v.abort(),25e3);let k="";const _=await this.ctx.llm.stream({settings:x,model:p,history:b,system:Mj,mode:"plan",signal:v.signal,handlers:{onText:M=>{k+=M},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}}}).finally(()=>window.clearTimeout(y)),S=Rj(_.content||k),N=this.ctx.sessions.current(i);return!S||!N||!a&&(N.titleSource??"auto")!=="auto"?null:(this.ctx.sessions.updateSession(i,{title:S,titleSource:"ai"}),S)}catch{return null}finally{this.inflight.delete(i),Da.getState().setTitling(i,!1)}}}const Lj=28e3;function Ij(e,i=Lj){return e.length<=i?e:`${e.slice(0,i)}
|
|
204
|
+
… truncated (${e.length-i} more characters)`}function Qr(e){return e&&typeof e=="object"?e:{}}function br(e){return typeof e=="string"?e:""}function Di(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Vr(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function Uj(e,i){const a=e[i];return typeof a=="string"?a:void 0}function pm(e,i,a){const r=e[i];return typeof r=="number"&&Number.isFinite(r)?r:typeof r=="string"&&Number.isFinite(Number(r))?Number(r):a}function Bj(e){const i=Array.isArray(e.entries)?e.entries:[];if(i.length===0)return"This folder is empty.";const a=i.map(o=>{const u=Qr(o),d=br(u.path);return u.type==="dir"?`${d}/`:u.type==="link"?`${d} -> link`:`${d}${Di(u.size)!==void 0?` (${Di(u.size)} B)`:""}`}),r=e.truncated===!0?`
|
|
205
|
+
… listing truncated. Narrow the path or reduce depth.`:"";return`${br(e.root)?`Root: ${br(e.root)}
|
|
206
|
+
`:""}${a.join(`
|
|
207
|
+
`)}${r}`}function mm(e){const i=Qr(e.diff),a=Di(i.added),r=Di(i.removed);if(!(a===void 0||r===void 0))return{added:a,removed:r,line:Di(i.line),column:Di(i.column)}}function hm(e){if(!e)return"";const i=e.line?` at L${e.line}${e.column?`:${e.column}`:""}`:"";return` · +${e.added} −${e.removed}${i}`}async function gm(){await Be.getState().refresh().catch(()=>{})}const $j="tool-fs",Hj=["tools"];function Pj(e){const i=[e.tools.register({name:"read_file",description:"Read a text file from the workspace. Use offset and limit for large files.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative path from the workspace root."},offset:{type:"number",description:"1-based first line. Defaults to 1."},limit:{type:"number",description:"Maximum lines. Defaults to 400."}},required:["path"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=Vr(a,"path"),u=Qr((await sn("read_file",{path:o},r.mode,r.signal)).result);if(u.binary===!0)return{output:`${o} is binary (${Di(u.size)??0} bytes).`,isError:!1};const d=Math.max(1,Math.round(pm(a,"offset",1))),p=Math.min(Math.max(1,Math.round(pm(a,"limit",400))),2e3),h=br(u.content).split(`
|
|
208
|
+
`),g=h.slice(d-1,d-1+p),x=h.length-(d-1+p),b=`${br(u.path)||o} · ${h.length} lines${u.truncated===!0?" · file clipped by daemon":""}`,v=x>0?`
|
|
209
|
+
… ${x} more lines. Read again with offset ${d+p}.`:"";return{output:Ij(`${b}
|
|
210
|
+
────
|
|
211
|
+
${g.join(`
|
|
212
|
+
`)}${v}`),isError:!1}}}),e.tools.register({name:"list_files",description:"List files and folders below a workspace path.",parameters:{type:"object",properties:{path:{type:"string",description:"Folder path. Defaults to the workspace root."},depth:{type:"number",description:"Recursion depth, 1–8. Defaults to 3."}},additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=Qr((await sn("list_files",{path:Uj(a,"path")??"",depth:Math.min(Math.max(1,pm(a,"depth",3)),8)},r.mode,r.signal)).result);return{output:Bj(o),isError:!1}}}),e.tools.register({name:"write_file",description:"Create a file or replace its full contents. Prefer edit_file for small changes.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},content:{type:"string",description:"Complete file content."}},required:["path","content"],additionalProperties:!1},allowedInMode:a=>a==="build",async execute(a,r){const o=Vr(a,"path"),u=Vr(a,"content"),d=Qr((await sn("write_file",{path:o,content:u},r.mode,r.signal,r.turnId)).result);await gm();const p=d.created===!0?"Created":"Updated",h=mm(d);return{output:`${p} ${br(d.path)||o} · ${u.split(`
|
|
213
|
+
`).length} lines, ${Di(d.size)??u.length} bytes${hm(h)}.`,isError:!1,diff:h}}}),e.tools.register({name:"rewrite_file",description:"Replace the complete contents of an existing file. Use when most of the file changes.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},content:{type:"string",description:"The new complete file content."}},required:["path","content"],additionalProperties:!1},allowedInMode:a=>a==="build",async execute(a,r){const o=Vr(a,"path"),u=Vr(a,"content"),d=Qr((await sn("rewrite_file",{path:o,content:u},r.mode,r.signal,r.turnId)).result);await gm();const p=mm(d);return{output:`Rewrote ${br(d.path)||o} · ${u.split(`
|
|
214
|
+
`).length} lines, ${Di(d.size)??u.length} bytes${hm(p)}.`,isError:!1,diff:p}}}),e.tools.register({name:"edit_file",description:"Replace an exact text occurrence in a file. oldText must match whitespace exactly and be unique unless replaceAll is true.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},oldText:{type:"string",description:"Exact text to replace."},newText:{type:"string",description:"Replacement text."},replaceAll:{type:"boolean",description:"Replace every occurrence. Defaults to false."}},required:["path","oldText","newText"],additionalProperties:!1},allowedInMode:a=>a==="build",async execute(a,r){const o=Vr(a,"path"),u=Vr(a,"oldText"),d=typeof a.newText=="string"?a.newText:"",p=Qr((await sn("edit_file",{path:o,oldText:u,newText:d,replaceAll:a.replaceAll===!0},r.mode,r.signal,r.turnId)).result);await gm();const h=mm(p);return{output:`Edited ${br(p.path)||o} · ${Di(p.replacements)??1} replacement${Di(p.replacements)===1?"":"s"}${hm(h)}.`,isError:!1,diff:h}}})];return()=>i.forEach(a=>a())}const Fj=Object.freeze(Object.defineProperty({__proto__:null,apply:Pj,inject:Hj,name:$j},Symbol.toStringTag,{value:"Module"})),qj=28e3;function Gj(e,i=qj){return e.length<=i?e:`${e.slice(0,i)}
|
|
215
|
+
… truncated (${e.length-i} more characters)`}function Yj(e){return e&&typeof e=="object"?e:{}}function xm(e){return typeof e=="string"?e:""}function Ww(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Kj(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function Vj(e,i,a){const r=e[i];return typeof r=="number"&&Number.isFinite(r)?r:typeof r=="string"&&Number.isFinite(Number(r))?Number(r):a}function Xj(e,i){const a=[`$ ${i}`,xm(e.stdout)];xm(e.stderr)&&a.push(`stderr:
|
|
216
|
+
${xm(e.stderr)}`);const r=Ww(e.code);return r!==void 0&&r!==0&&a.push(`exit code: ${r}`),e.timedOut===!0&&a.push("The command timed out."),a.filter(o=>o!=="").join(`
|
|
217
|
+
`)}async function Zj(){await Be.getState().refresh({treeOnly:!0}).catch(()=>{})}const Qj="tool-shell",Jj=["tools"];function Wj(e){return e.tools.register({name:"shell",description:"Run a shell command in the workspace root. The working directory resets between calls. Prefer dedicated file and git tools for edits. In Plan mode only read-only commands are accepted.",parameters:{type:"object",properties:{command:{type:"string",description:"The shell command to run."},timeoutMs:{type:"number",description:"Timeout in milliseconds (max 600000)."}},required:["command"],additionalProperties:!1},allowedInMode:()=>!0,async execute(i,a){const r=Kj(i,"command"),o=Yj((await sn("shell",{command:r,timeoutMs:Vj(i,"timeoutMs",12e4)},a.mode,a.signal)).result);return Zj(),{output:Gj(Xj(o,r)),isError:(Ww(o.code)??0)!==0||o.timedOut===!0}}})}const eO=Object.freeze(Object.defineProperty({__proto__:null,apply:Wj,inject:Jj,name:Qj},Symbol.toStringTag,{value:"Module"})),tO=28e3;function nO(e,i=tO){return e.length<=i?e:`${e.slice(0,i)}
|
|
218
|
+
… truncated (${e.length-i} more characters)`}function ek(e){return e&&typeof e=="object"?e:{}}function m0(e){return typeof e=="string"?e:""}function iO(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function aO(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function rO(e,i){const a=e[i];return typeof a=="string"?a:void 0}function sO(e,i,a){const r=e[i];return typeof r=="number"&&Number.isFinite(r)?r:typeof r=="string"&&Number.isFinite(Number(r))?Number(r):a}function lO(e,i){const a=Array.isArray(e.matches)?e.matches:[];if(a.length===0)return`No matches for ${i}.`;const r=a.map(u=>{const d=ek(u);return`${m0(d.file)}:${iO(d.line)??0}: ${m0(d.text)}`}),o=e.truncated===!0?`
|
|
219
|
+
… more matches exist. Narrow the pattern or path.`:"";return r.join(`
|
|
220
|
+
`)+o}const oO="tool-grep",cO=["tools"];function uO(e){return e.tools.register({name:"grep",description:"Search workspace contents with a regular expression. Returns path, line and matching text.",parameters:{type:"object",properties:{pattern:{type:"string",description:"Regular expression to search for."},path:{type:"string",description:"File or folder. Defaults to the workspace root."},ignoreCase:{type:"boolean",description:"Case-insensitive search. Defaults to false."},maxResults:{type:"number",description:"Maximum matches. Defaults to 80."}},required:["pattern"],additionalProperties:!1},allowedInMode:()=>!0,async execute(i,a){const r=aO(i,"pattern"),o=ek((await sn("grep",{pattern:r,path:rO(i,"path")??"",ignoreCase:i.ignoreCase===!0},a.mode,a.signal)).result),u=Math.min(Math.max(1,Math.round(sO(i,"maxResults",80))),200),d=Array.isArray(o.matches)?o.matches.slice(0,u):[],p={...o,matches:d,truncated:o.truncated===!0||Array.isArray(o.matches)&&o.matches.length>u};return{output:nO(lO(p,r)),isError:!1}}})}const dO=Object.freeze(Object.defineProperty({__proto__:null,apply:uO,inject:cO,name:oO},Symbol.toStringTag,{value:"Module"})),fO=28e3;function pO(e,i=fO){return e.length<=i?e:`${e.slice(0,i)}
|
|
221
|
+
… truncated (${e.length-i} more characters)`}function mO(e){return e&&typeof e=="object"?e:{}}function hr(e){return typeof e=="string"?e:""}function tk(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function hO(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function gO(e){const i=[];hr(e.current)&&i.push(`Current branch: ${hr(e.current)}`),hr(e.branches)&&i.push(hr(e.branches)),hr(e.stdout)&&i.push(hr(e.stdout)),hr(e.stderr)&&i.push(`stderr:
|
|
222
|
+
${hr(e.stderr)}`);const a=tk(e.code);return a!==void 0&&a!==0&&i.push(`exit code: ${a}`),i.filter(Boolean).join(`
|
|
223
|
+
`)||"Git completed with no output."}const xO="tool-git",bO=["tools"];function yO(e){return e.tools.register({name:"git",description:"Inspect or change git state. In Plan mode only status, diff, log, show and branch are accepted.",parameters:{type:"object",properties:{action:{type:"string",enum:["status","diff","log","show","branch","add","commit","init","checkout"]},path:{type:"string",description:"Limit diff to this file."},staged:{type:"boolean",description:"Diff the staged changes."},ref:{type:"string",description:"Commit or ref for show."},limit:{type:"number",description:"Log limit."},paths:{type:"array",items:{type:"string"},description:"Files to stage."},message:{type:"string",description:"Commit message."},branch:{type:"string",description:"Branch to create or check out."},create:{type:"boolean",description:"Create a new branch. Defaults to true."}},required:["action"],additionalProperties:!1},allowedInMode:()=>!0,async execute(i,a){const r=hO(i,"action"),o={...i};delete o.action;const u=mO((await sn("git",{action:r,...o},a.mode,a.signal)).result);return(r==="add"||r==="commit"||r==="init"||r==="checkout")&&await Be.getState().loadGit().catch(()=>{}),{output:pO(gO(u)),isError:(tk(u.code)??0)!==0}}})}const vO=Object.freeze(Object.defineProperty({__proto__:null,apply:yO,inject:bO,name:xO},Symbol.toStringTag,{value:"Module"})),wO=28e3;function h0(e,i=wO){return e.length<=i?e:`${e.slice(0,i)}
|
|
224
|
+
… truncated (${e.length-i} more characters)`}function bm(e){return e&&typeof e=="object"?e:{}}function gr(e){return typeof e=="string"?e:""}function g0(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}const kO="tool-web",EO=["tools"];function NO(e){const i=[e.tools.register({name:"web_search",description:"Search the web for current information. Returns titles, URLs and snippets. Cite URLs you use.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."}},required:["query"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=g0(a,"query"),u=bm((await sn("web_search",{query:o,provider:r.settings.searchProvider},r.mode,r.signal)).result),d=Array.isArray(u.results)?u.results:[];if(d.length===0)return{output:"No results found.",isError:!1};const p=d.map((h,g)=>{const x=bm(h);return`${g+1}. ${gr(x.title)}
|
|
225
|
+
${gr(x.url)}${gr(x.snippet)?`
|
|
226
|
+
${gr(x.snippet)}`:""}`}).join(`
|
|
227
|
+
|
|
228
|
+
`);return{output:h0(`Search: ${o}
|
|
229
|
+
Provider: ${gr(u.provider)||"web"}
|
|
230
|
+
|
|
231
|
+
${p}`),isError:!1}}}),e.tools.register({name:"read_url",description:"Read a public web page as plain text.",parameters:{type:"object",properties:{url:{type:"string",description:"The http(s) URL to read."}},required:["url"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=g0(a,"url"),u=bm((await sn("read_url",{url:o},r.mode,r.signal)).result),d=gr(u.title);return{output:h0(`Source: ${gr(u.url)||o}${d?`
|
|
232
|
+
Title: ${d}`:""}
|
|
233
|
+
|
|
234
|
+
${gr(u.content)}${u.truncated===!0?`
|
|
235
|
+
|
|
236
|
+
… page truncated.`:""}`),isError:!1}}})];return()=>i.forEach(a=>a())}const _O=Object.freeze(Object.defineProperty({__proto__:null,apply:NO,inject:EO,name:kO},Symbol.toStringTag,{value:"Module"})),SO=28e3;function TO(e,i=SO){return e.length<=i?e:`${e.slice(0,i)}
|
|
237
|
+
… truncated (${e.length-i} more characters)`}const CO="tool-subagent",AO=["tools","subagents"];function jO(e){return e.tools.register({name:"subagent",description:"Delegate a focused investigation to a read-only subagent. Use it to explore a large area, trace a bug or verify assumptions without changing files. The subagent returns a concise report.",parameters:{type:"object",properties:{task:{type:"string",description:"The specific question or investigation to perform."},context:{type:"string",description:"Optional context, constraints or files to start from."}},required:["task"],additionalProperties:!1},allowedInMode:()=>!0,async execute(i,a){const r=typeof i.task=="string"?i.task:"",o=typeof i.context=="string"?i.context:"",u=await e.subagents.run(r,o,a.signal);return{output:TO(u),isError:!1}}})}const OO=Object.freeze(Object.defineProperty({__proto__:null,apply:jO,inject:AO,name:CO},Symbol.toStringTag,{value:"Module"}));function MO(){const e=new rg;return e.plugin(UA),e.plugin($A),e.plugin(qA),e.plugin(GA),e.plugin(cj),e.plugin(gj),e.plugin(wj),e.plugin(Tj),e.plugin(Oj),e.plugin(zj),e.plugin(Fj),e.plugin(eO),e.plugin(dO),e.plugin(vO),e.plugin(_O),e.plugin(OO),e}const qt=MO();function Vu(e){qt.agentLoop?qt.agentLoop.stopRun(e):queueMicrotask(()=>qt.agentLoop?.stopRun(e))}function RO(){qt.agentLoop?qt.agentLoop.stopAllRuns():queueMicrotask(()=>qt.agentLoop?.stopAllRuns())}function nk(e,i){qt.agentLoop?qt.agentLoop.runAgent(e,i):queueMicrotask(()=>qt.agentLoop?.runAgent(e,i))}function ym(e){return qt.agentLoop?qt.agentLoop.regenerateLastTurn(e):!1}function ik(e){var i,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(i=0;i<o;i++)e[i]&&(a=ik(e[i]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function DO(){for(var e,i,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(i=ik(e))&&(r&&(r+=" "),r+=i);return r}function ie(...e){return DO(e)}function $o(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Xu(e){const i=Math.round((Date.now()-e)/1e3);return i<60?"now":i<3600?`${Math.floor(i/60)}m`:i<86400?`${Math.floor(i/3600)}h`:i<604800?`${Math.floor(i/86400)}d`:new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function zO(e){const i=new Date,a=new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),r=a-864e5,o=a-6*864e5,u=a-29*864e5,d=[{label:"Today",items:[]},{label:"Yesterday",items:[]},{label:"Previous 7 days",items:[]},{label:"Previous 30 days",items:[]},{label:"Older",items:[]}],p=[...e].sort((h,g)=>g.updatedAt-h.updatedAt);for(const h of p){let g=4;h.updatedAt>=a?g=0:h.updatedAt>=r?g=1:h.updatedAt>=o?g=2:h.updatedAt>=u&&(g=3),d[g].items.push(h)}return d.filter(h=>h.items.length>0)}function LO(e){return new Promise((i,a)=>{const r=new FileReader;r.onload=()=>i(String(r.result)),r.onerror=()=>a(r.error??new Error("Could not read this file.")),r.readAsDataURL(e)})}function ak(e){return new Promise((i,a)=>{const r=new FileReader;r.onload=()=>i(String(r.result)),r.onerror=()=>a(r.error??new Error("Could not read this file.")),r.readAsText(e)})}function hh(e,i,a="text/plain"){const r=new Blob([i],{type:a}),o=URL.createObjectURL(r),u=document.createElement("a");u.href=o,u.download=e,u.click(),URL.revokeObjectURL(o)}function pl({size:e=28,className:i,spin:a=!1}){return c.jsx("span",{className:ie("inline-flex shrink-0 items-center justify-center text-accent",i),style:{width:e,height:e},"aria-hidden":"true",children:c.jsxs("svg",{viewBox:"0 0 32 32",width:e,height:e,fill:"none",className:ie(a&&"animate-spin-slow"),children:[c.jsx("circle",{cx:"16",cy:"16",r:"6.2",fill:"currentColor"}),c.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[c.jsx("path",{d:"M16 3.6v3.2M16 25.2v3.2M3.6 16h3.2M25.2 16h3.2"}),c.jsx("path",{d:"M7.2 7.2l2.2 2.2M22.6 22.6l2.2 2.2M7.2 24.8l2.2-2.2M22.6 9.4l2.2-2.2",opacity:"0.55"})]})]})})}function IO({compact:e=!1}){return c.jsxs("div",{className:"group/logo flex items-center gap-2",children:[c.jsx(pl,{size:e?20:22,className:"transition-transform duration-500 ease-out group-hover/logo:rotate-90"}),!e&&c.jsxs("span",{className:"text-[15px] font-semibold leading-none tracking-[-0.025em] text-ink",children:["Open",c.jsx("span",{className:"text-accent",children:"Sol"})]})]})}function UO(){return c.jsxs("p",{className:"text-[11px] tracking-[0.01em] text-faint",children:["OpenSol ",c.jsx("span",{className:"px-1 text-line",children:"/"})," by OpenSoftX"]})}function BO(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function $O(){const e=Ye(Z=>Z.sessions),i=Ye(Z=>Z.activeId),a=Ye(Z=>Z.setActive),r=Ye(Z=>Z.newChat),o=Ye(Z=>Z.renameSession),u=Ye(Z=>Z.deleteSession),d=Oe(),p=Be(Z=>Z.info),h=Be(Z=>Z.addWorkspace),g=Be(Z=>Z.removeWorkspace),x=me(Z=>Z.sidebarCollapsed),b=me(Z=>Z.toggleSidebar),v=me(Z=>Z.mobileSidebarOpen),y=me(Z=>Z.setMobileSidebarOpen),k=me(Z=>Z.openSettings),_=me(Z=>Z.setWorkspaceOpen),S=me(Z=>Z.setDeployOpen),N=me(Z=>Z.setMcpOpen),M=me(Z=>Z.askConfirm),j=me(Z=>Z.notify),D=me(Z=>Z.focusComposer),P=Da(Z=>Z.streaming),L=Da(Z=>Z.titling),[T,R]=B.useState(""),[K,z]=B.useState(null),[$,W]=B.useState(null),[de,ce]=B.useState(""),[ae,O]=B.useState(""),te=B.useMemo(()=>{const Z=T.trim().toLowerCase();return Z?e.filter(Te=>Te.title.toLowerCase().includes(Z)):e},[e,T]),ne=B.useMemo(()=>zO(te),[te]),G=B.useMemo(()=>[...p.workspaces].sort((Z,Te)=>Te.lastOpened-Z.lastOpened),[p.workspaces]),A=dl(d),Se=(d.daemon?.home??"").split(/[\\/]/).filter(Boolean).pop()||p.name||"Local",pe=()=>{r(),y(!1),z(null),D()},C=Z=>{a(Z),y(!1),z(null)},I=async Z=>{if(Z===p.root){_(!0),y(!1);return}O(Z);try{await h(Z),y(!1)}catch(Te){j(Te instanceof Error?Te.message:"Could not open that folder.","error")}finally{O("")}},se=async(Z,Te)=>{if(await M({title:"Remove this workspace?",body:`“${Te}” is removed from OpenSol's list. The folder and its files stay on your disk; conversations started there are kept.`,confirmLabel:"Remove workspace",tone:"danger"}))try{await g(Z),j(`Removed ${Te} from your workspaces.`,"success")}catch(ct){j(ct instanceof Error?ct.message:"Could not remove that workspace.","error")}},he=async Z=>{z(null),await qt.titles?.generate(Z,{force:!0})||j("The model could not suggest a title right now.","error")},ke=(Z,Te)=>{W(Z),ce(Te),z(null)},ze=()=>{$&&(de.trim()&&o($,de),W(null),ce(""))},He=async(Z,Te)=>{z(null),await M({title:"Delete this conversation?",body:`“${Te}” and its messages will be removed from this computer. This cannot be undone.`,confirmLabel:"Delete conversation",tone:"danger"})&&(Vu(Z),u(Z))},$e=Z=>{const Te=e.find(ct=>ct.id===Z);if(!Te)return;z(null);const rt=Te.messages.flatMap(ct=>ct.role==="user"?[`## You
|
|
238
|
+
|
|
239
|
+
${ct.content}`]:ct.role==="assistant"&&ct.content.trim()?[`## OpenSol
|
|
240
|
+
|
|
241
|
+
${ct.content.trim()}`]:[]).join(`
|
|
242
|
+
|
|
243
|
+
`);hh(`opensol-${Te.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,40)||"conversation"}.md`,`# ${Te.title}
|
|
244
|
+
|
|
245
|
+
${rt}
|
|
246
|
+
`,"text/markdown"),j("Conversation exported as Markdown.","success")},X=Z=>{const Te=e.find(rt=>rt.id===Z);Te&&(z(null),hh(`opensol-${Te.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,40)||"conversation"}.json`,JSON.stringify({app:"OpenSol",exportedAt:new Date().toISOString(),session:Te},null,2),"application/json"),j("Conversation exported.","success"))};return c.jsxs("aside",{className:ie("fixed inset-y-0 left-0 z-50 flex h-dvh w-[264px] shrink-0 flex-col bg-canvas shadow-float transition-transform duration-300 ease-out lg:static lg:z-auto lg:shadow-none",v?"translate-x-0":"-translate-x-full lg:translate-x-0",x&&"lg:hidden"),children:[c.jsxs("div",{className:"flex h-12 items-center gap-1 pl-3 pr-2",children:[c.jsx(IO,{}),c.jsx("button",{type:"button",className:"icon-button ml-auto hidden lg:inline-flex",onClick:b,title:"Collapse sidebar (Ctrl B)","aria-label":"Collapse sidebar",children:c.jsx(NT,{size:16,strokeWidth:1.7})}),c.jsx("button",{type:"button",className:"icon-button ml-auto lg:hidden",onClick:()=>y(!1),"aria-label":"Close menu",children:c.jsx(Bi,{size:17})})]}),c.jsxs("nav",{className:"space-y-0.5 px-2 pt-1",children:[c.jsxs("button",{type:"button",onClick:pe,className:"group/new mb-2 flex h-9 w-full items-center gap-2 rounded-lg border border-line bg-panel px-2.5 text-left text-[13px] font-medium text-ink shadow-pill transition-all duration-150 hover:border-accent/40 hover:shadow-composer active:scale-[0.985]",children:[c.jsx(vr,{size:15,strokeWidth:2,className:"text-accent transition-transform duration-300 group-hover/new:rotate-90"}),"New chat"]}),c.jsxs("button",{type:"button",onClick:()=>{y(!1),k("skills")},className:"nav-item",children:[c.jsx(Ui,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Skills"]}),c.jsxs("button",{type:"button",onClick:()=>{y(!1),k("plugins")},className:"nav-item",children:[c.jsx(Yh,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Plugins"]}),c.jsxs("button",{type:"button",onClick:()=>{y(!1),N(!0)},className:"nav-item",children:[c.jsx(Kh,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"MCP"]}),c.jsxs("button",{type:"button",onClick:()=>{y(!1),S(!0)},className:"nav-item",children:[c.jsx(wr,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Deploy"]}),c.jsxs("div",{className:"relative",children:[c.jsx(as,{size:15,strokeWidth:1.7,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-faint"}),c.jsx("input",{value:T,onChange:Z=>R(Z.target.value),placeholder:"Search",className:"mt-1 h-8 w-full rounded-lg border border-transparent bg-transparent pl-[34px] pr-2.5 text-[13px] text-ink outline-none transition-colors placeholder:text-muted hover:bg-raised/80 focus:border-line focus:bg-panel","aria-label":"Search conversations"})]})]}),c.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2 pb-2 pt-5",children:[c.jsxs("div",{className:"mb-5",children:[c.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-1.5",children:[c.jsx("p",{className:"eyebrow",children:"Workspaces"}),c.jsx("button",{type:"button",onClick:()=>{y(!1),_(!0)},className:"flex h-6 w-6 items-center justify-center rounded-md text-faint transition-colors hover:bg-raised hover:text-ink",title:"Open another folder","aria-label":"Open another folder",children:c.jsx(vr,{size:13})})]}),G.length===0?c.jsxs("button",{type:"button",onClick:()=>{y(!1),_(!0)},className:"flex w-full items-center gap-2 rounded-lg border border-dashed border-line px-2.5 py-2.5 text-left text-[13px] text-muted transition-colors hover:border-faint/50 hover:text-ink",children:[c.jsx(rl,{size:15,strokeWidth:1.6,className:"text-faint"}),"Open a project folder"]}):c.jsx("div",{className:"space-y-0.5",children:G.map(Z=>{const Te=Z.path===p.root;return c.jsxs("div",{className:"group/ws relative",children:[c.jsxs("button",{type:"button",onClick:()=>{I(Z.path)},title:Z.path,className:ie("flex h-8 w-full items-center gap-2.5 rounded-lg px-2.5 pr-8 text-left text-[13px] transition-all duration-150 active:scale-[0.985]",Te?"bg-raised text-ink":"text-muted hover:bg-raised/80 hover:text-ink"),children:[c.jsx(rl,{size:15,strokeWidth:1.6,className:ie("shrink-0 transition-transform duration-200 group-hover/ws:-rotate-6 group-hover/ws:scale-110",Te?"text-accent":"text-faint")}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:Z.name}),ae===Z.path?c.jsx(Fh,{size:11,className:"shrink-0 animate-spin text-faint"}):Te?c.jsx(Cn,{size:11,className:"shrink-0 text-accent"}):c.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-faint transition-opacity group-hover/ws:opacity-0",children:Xu(Z.lastOpened)})]}),c.jsx("button",{type:"button",onClick:()=>{se(Z.path,Z.name)},className:"absolute right-1 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-faint opacity-0 transition-all hover:bg-danger/10 hover:text-danger focus:opacity-100 group-hover/ws:opacity-100",title:"Remove workspace from the list","aria-label":`Remove workspace ${Z.name}`,children:c.jsx(sa,{size:12})})]},Z.path)})})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-1.5",children:[c.jsx("p",{className:"eyebrow",children:"Recents"}),c.jsx("span",{className:"text-[11px] tabular-nums text-faint",children:te.length})]}),ne.length===0&&c.jsxs("div",{className:"px-2 py-7 text-center",children:[c.jsx("p",{className:"text-[13px] font-medium text-muted",children:T?"No conversations match":"No conversations yet"}),c.jsx("p",{className:"mt-1 text-[11.5px] leading-relaxed text-faint",children:T?"Try a shorter search.":"Start with a task, a question or a file."})]}),ne.map((Z,Te)=>c.jsxs("div",{className:"mb-3",children:[c.jsx("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-medium text-faint/80",children:Z.label}),c.jsx("div",{className:"space-y-0.5",children:Z.items.map((rt,ct)=>c.jsx("div",{className:"group/item relative animate-slideleft",style:{animationDelay:`${Math.min(Te*40+ct*18,320)}ms`},children:$===rt.id?c.jsx("input",{value:de,onChange:Le=>ce(Le.target.value),onBlur:ze,onKeyDown:Le=>{Le.key==="Enter"&&ze(),Le.key==="Escape"&&(W(null),ce(""))},autoFocus:!0,className:"h-8 w-full rounded-lg border border-accent/50 bg-panel px-2.5 text-[13px] text-ink outline-none","aria-label":"Rename conversation"}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>C(rt.id),onDoubleClick:()=>ke(rt.id,rt.title),title:`${rt.title} · ${Xu(rt.updatedAt)}`,className:ie("sidebar-item pr-9",i===rt.id&&"sidebar-item-active"),children:[c.jsx("span",{className:ie("min-w-0 flex-1 truncate",L[rt.id]&&"text-shimmer"),children:rt.title}),P[rt.id]&&c.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10.5px] font-medium text-accent group-hover/item:hidden",title:"Agent is running",children:[c.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent"}),"running"]})]}),c.jsx("button",{type:"button",onClick:Le=>{if(Le.stopPropagation(),K?.id===rt.id){z(null);return}const mt=Le.currentTarget.getBoundingClientRect(),Je=176,Gt=166,An=Math.max(8,Math.min(mt.right-Je,window.innerWidth-Je-8)),xn=mt.bottom+Gt+8>window.innerHeight?Math.max(8,mt.top-Gt-4):mt.bottom+4;z({id:rt.id,x:An,y:xn})},className:ie("absolute right-1 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-faint transition-all hover:bg-panel hover:text-ink",K?.id===rt.id?"flex bg-panel text-ink opacity-100":"opacity-0 group-hover/item:opacity-100 focus:opacity-100"),"aria-label":`Actions for ${rt.title}`,title:"Conversation actions",children:c.jsx(S2,{size:14})})]})},rt.id))})]},Z.label))]})]}),c.jsx("div",{className:"p-2",children:c.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg px-1.5 py-1.5 transition-colors hover:bg-raised/80",children:[c.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-ink text-[12px] font-semibold text-panel",children:Se.charAt(0).toUpperCase()}),c.jsxs("button",{type:"button",onClick:()=>{y(!1),k("models")},className:"min-w-0 flex-1 text-left",children:[c.jsx("p",{className:"truncate text-[13px] font-medium leading-tight text-ink",children:Se}),c.jsx("p",{className:"mt-0.5 truncate text-[11px] leading-tight text-faint",children:A?`${Jh(d.provider)}${d.provider==="ollama"?" · local":" · your key"}`:"Add a provider key"})]}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{y(!1),k("appearance")},title:"Preferences","aria-label":"Preferences",children:c.jsx(ew,{size:16,strokeWidth:1.7})})]})}),K&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Close conversation menu",className:"fixed inset-0 z-[60] cursor-default bg-transparent",onClick:()=>z(null)}),c.jsx("div",{className:"surface-lift fixed z-[70] w-[184px] overflow-hidden rounded-xl border border-line p-1 shadow-float",style:{left:K.x,top:K.y},children:(()=>{const Z=e.find(Te=>Te.id===K.id);return Z?c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>ke(Z.id,Z.title),className:"flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-muted hover:bg-raised hover:text-ink",children:[c.jsx(Lo,{size:12})," Rename"]}),c.jsxs("button",{type:"button",onClick:()=>{he(Z.id)},className:"flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-muted hover:bg-raised hover:text-ink",children:[c.jsx(Ui,{size:12})," Name with AI"]}),c.jsxs("button",{type:"button",onClick:()=>X(Z.id),className:"flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-muted hover:bg-raised hover:text-ink",children:[c.jsx(Yv,{size:12})," Export JSON"]}),c.jsxs("button",{type:"button",onClick:()=>$e(Z.id),className:"flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-muted hover:bg-raised hover:text-ink",children:[c.jsx(Ma,{size:12})," Export Markdown"]}),c.jsx("div",{className:"my-1 border-t border-line"}),c.jsxs("button",{type:"button",onClick:()=>{He(Z.id,Z.title)},className:"flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-danger hover:bg-danger/[0.06]",children:[c.jsx(sa,{size:12})," Delete"]}),c.jsxs("p",{className:"px-2 pb-1 pt-1.5 text-[9px] text-faint",children:["Updated ",BO(Z.updatedAt)]})]}):null})()})]})]})}const HO={wave:"Ready when you are",idle:"Standing by",thinking:"Thinking it through…",working:"Running tools…",typing:"Writing the answer…",happy:"Answer ready",alert:"Needs your approval",error:"Hit a snag",sleepy:"Waiting for the next turn",party:"All steps finished"};function PO(e,i){if(e.length===0)return"wave";const a=e[e.length-1];return a.role==="tool"?a.status==="awaiting"?"alert":a.status==="error"?"error":i||a.status==="running"?"working":"party":a.role==="assistant"?a.error?"error":i?a.reasoning.trim()&&!a.content.trim()?"thinking":"typing":a.stopped?"sleepy":a.content.trim()?"happy":"idle":i?"working":"idle"}const rk=864e5,x0=26;function og(e){const i=new Date(e);return i.setHours(0,0,0,0),i.getTime()}function sk(e){const i=new Date(e);return`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`}function FO(e,i){return e==="all"?0:og(i)-(e==="7d"?6:29)*rk}function b0(e,i){return typeof e.createdAt=="number"?e.createdAt:i}function qO(e){if(e.role!=="assistant")return 0;const i=e.usage;if(i&&(i.input||i.output))return(i.input??0)+(i.output??0);const a=`${e.content??""}${e.reasoning??""}`;return a.trim()?Math.ceil(a.length/4):0}function GO(e){return e===0?"12 AM":e===12?"12 PM":e<12?`${e} AM`:`${e-12} PM`}function YO(e,i,a=Date.now()){const r=FO(i,a),o=e.filter(S=>S.updatedAt>=r),u=[];for(const S of o)for(const N of S.messages)b0(N,S.updatedAt)>=r&&u.push({message:N,session:S});const d=new Array(24).fill(0),p=new Map,h=new Map;let g=0;for(const{message:S,session:N}of u){const M=b0(S,N.updatedAt),j=sk(M),D=p.get(j);if(D?D.count+=1:p.set(j,{key:j,count:1,date:og(M)}),d[new Date(M).getHours()]+=1,S.role!=="assistant")continue;const P=qO(S);g+=P;const L=typeof S.model=="string"?S.model.trim():"";if(!L)continue;const T=h.get(L)??{model:L,messages:0,tokens:0};T.messages+=1,T.tokens+=P,h.set(L,T)}const x=[...h.values()].sort((S,N)=>N.tokens-S.tokens||N.messages-S.messages||S.model.localeCompare(N.model)),b=x[0],v=u.filter(S=>S.message.role==="assistant").length;let y=0;for(let S=1;S<24;S+=1)d[S]>d[y]&&(y=S);const k=KO(p,a),_=k.reduce((S,N)=>Math.max(S,N.count),0);return{sessions:o.length,messages:u.length,tokens:g,activeDays:p.size,peakHour:u.length?GO(y):"—",favoriteModel:b?.model??"—",favoriteShare:b&&v?Math.round(b.messages/v*100):0,models:x,heatmap:k,busiestDay:_}}function KO(e,i){const a=new Date(og(i)),r=new Date(a);r.setDate(r.getDate()-r.getDay()-(x0-1)*7);const o=[];for(let u=0;u<x0*7;u+=1){const d=r.getTime()+u*rk,p=sk(d);o.push(e.get(p)??{key:p,count:0,date:d})}return o}function No(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function vm(e){if(!e||e==="—")return e;const i=e.split("/");return i[i.length-1]||e}function VO(e){return!!(e.content.trim()||e.reasoning.trim()||e.error||e.stopped)}function XO(e){const i=[];let a=null,r=[];const o=()=>{r.length>0&&a?.segments.push({kind:"tools",tools:r}),r=[]};for(const u of e){if(u.role==="tool"){if(!a)continue;r.push(u);continue}if(u.role==="user"){o(),a={id:u.id,user:u,segments:[]},i.push(a);continue}!VO(u)&&u.toolCalls.length>0||(a||(a={id:u.id,segments:[]},i.push(a)),o(),a.segments.push({kind:"assistant",message:u}))}return o(),i}function y0(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function ZO({messages:e,model:i,sessionId:a}){const r=B.useMemo(()=>Qw(e,i),[e,i]),o=a?Vw(a):!1;if(e.length===0)return null;const{pct:u,used:d,limit:p}=r,h=u>=Jw*100,g=u>=70&&!h;return c.jsx("div",{className:ie("hidden items-baseline gap-1.5 text-[11.5px] tabular-nums text-muted sm:flex",g&&"text-warning",h&&"text-danger"),title:`Context window: ~${d.toLocaleString()} of ${p.toLocaleString()} tokens used (${u}%)`,children:o?c.jsx("span",{className:"text-shimmer",children:"Compacting…"}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-ink/80",children:y0(d)}),c.jsxs("span",{className:"text-faint",children:["/ ",y0(p)," tokens"]}),c.jsx("span",{className:"text-faint",children:"·"}),c.jsxs("span",{children:[u,"%"]})]})})}const QO=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function JO({session:e,view:i,onViewChange:a}){const r=Oe(),o=Oe(M=>M.update),u=me(M=>M.sidebarCollapsed),d=me(M=>M.toggleSidebar),p=me(M=>M.setMobileSidebarOpen),h=me(M=>M.setPaletteOpen),g=me(M=>M.openSettings),x=me(M=>M.workspaceOpen),b=me(M=>M.setWorkspaceOpen),v=me(M=>M.setDeployOpen),y=Be(M=>M.info),k=kd(),_=th(r.theme,typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches),S=!!(e&&e.messages.length>0),N=e?.messages.filter(M=>M.role==="user").length??0;return c.jsxs("header",{className:"relative flex h-12 shrink-0 items-center gap-2 border-b border-line/60 bg-panel/80 px-3 backdrop-blur-xl sm:px-4",children:[c.jsx("button",{type:"button",className:"icon-button lg:hidden",onClick:()=>p(!0),"aria-label":"Open menu",children:c.jsx(hT,{size:18})}),u&&c.jsx("button",{type:"button",className:"icon-button hidden lg:inline-flex",onClick:d,title:"Expand sidebar","aria-label":"Expand sidebar",children:c.jsx(ST,{size:17})}),c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[!e&&c.jsx(pl,{size:19,className:"lg:hidden"}),y.available&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"hidden max-w-[120px] shrink-0 truncate text-[13px] text-faint md:inline",children:y.name}),c.jsx("span",{className:"hidden text-faint/50 md:inline",children:"/"})]}),c.jsx("h1",{className:"min-w-0 truncate text-[13.5px] font-medium tracking-[-0.01em] text-ink",children:e?.title??"New conversation"}),S&&c.jsxs("span",{className:"hidden shrink-0 items-center gap-1 rounded-md border border-line bg-canvas px-1.5 py-0.5 text-[10.5px] font-medium text-muted sm:inline-flex",children:[r.mode==="plan"?c.jsx(Ph,{size:11}):c.jsx(Ui,{size:11}),r.mode==="plan"?"Plan mode":"Build mode"]}),S&&c.jsxs("span",{className:"hidden shrink-0 text-[11.5px] tabular-nums text-faint md:inline",children:[N," turn",N===1?"":"s"]})]}),S&&c.jsx("div",{className:"absolute left-1/2 hidden -translate-x-1/2 items-center rounded-lg bg-raised p-0.5 md:inline-flex",children:["chat","trajectory"].map(M=>c.jsx("button",{type:"button",onClick:()=>a(M),"aria-pressed":i===M,className:ie("h-6 rounded-md px-3 text-[11.5px] font-medium capitalize transition-all duration-200",i===M?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:M},M))}),c.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[S&&c.jsx("div",{className:"mr-3 hidden sm:block",children:c.jsx(ZO,{messages:e?.messages??[],model:k,sessionId:e?.id??null})}),c.jsxs("button",{type:"button",onClick:()=>b(!x),title:y.available?y.root:"Choose a workspace folder",className:ie("mr-1 hidden min-w-0 items-center gap-1.5 rounded-lg border px-2.5 py-1 text-[12px] transition-all duration-150 sm:inline-flex",x?"border-accent/30 bg-accent-soft text-accent":"border-line text-muted hover:bg-raised/60 hover:text-ink"),children:[c.jsx(es,{size:13,className:"shrink-0"}),c.jsx("span",{className:"max-w-[140px] truncate",children:y.available?y.name:"No folder"})]}),c.jsx("button",{type:"button",className:"icon-button hidden sm:inline-flex",onClick:()=>v(!0),title:"Deploy the open workspace or another project","aria-label":"Deploy",children:c.jsx(wr,{size:16,strokeWidth:1.7})}),c.jsx("button",{type:"button",className:"icon-button",onClick:()=>h(!0),title:`Search and commands (${QO?"⌘":"Ctrl"} K)`,"aria-label":"Open search and commands",children:c.jsx(as,{size:16})}),c.jsx("button",{type:"button",className:"icon-button hidden sm:inline-flex",onClick:()=>o({theme:_?"light":"dark"}),title:_?"Switch to light theme":"Switch to dark theme","aria-label":"Toggle theme",children:_?c.jsx(Xh,{size:16}):c.jsx(Gh,{size:16})}),c.jsx("button",{type:"button",className:"icon-button",onClick:()=>g("general"),title:"Settings","aria-label":"Open settings",children:c.jsx(ew,{size:16})})]})]})}const cg=[{value:"ask",label:"Ask first",description:"Confirm shell commands, edits and git changes before they run."},{value:"accept-edits",label:"Accept edits",description:"Apply file edits automatically; still confirm shell and git."},{value:"full",label:"Full access",description:"Run every enabled tool without asking. Use only in trusted folders."}],gh=["write_file","edit_file","rewrite_file"],xh=["shell","git","subagent"];function lk(e){const i=gh.every(r=>e[r]?.approval==="auto"),a=xh.every(r=>e[r]?.approval==="auto");return i&&a?"full":i?"accept-edits":"ask"}function ok(e,i){const a={};for(const r of Object.keys(e)){const o=gh.includes(r)||xh.includes(r),u=i==="full"?"auto":i==="accept-edits"?gh.includes(r)?"auto":xh.includes(r)?"ask":e[r].approval:o?"ask":e[r].approval;a[r]={...e[r],approval:u}}return a}function WO(e){return cg.find(i=>i.value===e)?.label??"Ask first"}function eM(e,i,a=!0,r){const o=B.useRef(i);o.current=i,B.useEffect(()=>{if(!a)return;const u=p=>{const h=e.current;if(!h)return;const g=p.target;g instanceof Node&&(h.contains(g)||r?.current?.contains(g)||o.current())},d=p=>{p.key==="Escape"&&o.current()};return document.addEventListener("pointerdown",u,!0),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("keydown",d)}},[a,e,r])}var Ho=Pv();function Ed({open:e,onClose:i,children:a,className:r,labelledBy:o,wide:u=!1}){const d=B.useRef(null),p=B.useRef(null),h=B.useRef(i);return h.current=i,B.useEffect(()=>{if(!e)return;p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const g=d.current,x=()=>Array.from(g?.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')??[]).filter(k=>k.offsetParent!==null),b=window.setTimeout(()=>{(g?.querySelector("[data-autofocus]")??x()[0]??g)?.focus()},30),v=k=>{if(k.key==="Escape"){k.preventDefault(),h.current();return}if(k.key!=="Tab")return;const _=x();if(_.length===0)return;const S=_[0],N=_[_.length-1];k.shiftKey&&document.activeElement===S?(k.preventDefault(),N.focus()):!k.shiftKey&&document.activeElement===N&&(k.preventDefault(),S.focus())};document.addEventListener("keydown",v);const y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.clearTimeout(b),document.removeEventListener("keydown",v),document.body.style.overflow=y,p.current?.focus()}},[e]),e?Ho.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[80] flex items-end justify-center p-0 sm:items-center sm:p-6",children:[c.jsx("button",{type:"button","aria-label":"Close dialog",tabIndex:-1,onClick:i,className:"modal-scrim absolute inset-0 cursor-default bg-black/35 backdrop-blur-[3px] dark:bg-black/60"}),c.jsx("div",{ref:d,role:"dialog","aria-modal":"true","aria-labelledby":o,tabIndex:-1,className:ie("modal-panel relative flex max-h-[92dvh] w-full flex-col overflow-hidden rounded-t-2xl border border-line surface-lift shadow-float sm:max-h-[86dvh] sm:rounded-xl",u?"sm:w-[min(920px,94vw)]":"sm:w-[min(760px,94vw)]",r),children:a})]}),document.body):null}function Vt({size:e=14,className:i}){return c.jsx(Fh,{size:e,className:ie("animate-spin text-current",i),"aria-hidden":"true"})}function $i({checked:e,onChange:i,label:a,disabled:r=!1}){return c.jsx("button",{type:"button",role:"switch","aria-label":a,"aria-checked":e,disabled:r,onClick:()=>i(!e),className:ie("relative inline-flex h-[22px] w-[38px] shrink-0 items-center rounded-full border transition-colors duration-200 disabled:opacity-40",e?"border-accent bg-accent":"border-line bg-raised"),children:c.jsx("span",{className:ie("pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-sm transition-transform duration-300 ease-spring",e?"translate-x-[19px]":"translate-x-[3px]")})})}function ug({options:e,value:i,onChange:a,disabled:r,className:o,size:u="sm"}){return c.jsx("div",{className:ie("inline-flex items-center rounded-lg bg-raised p-0.5",u==="md"?"text-[12.5px]":"text-[11.5px]",r&&"opacity-50",o),children:e.map(d=>c.jsx("button",{type:"button",title:d.title,disabled:r,onClick:()=>a(d.value),className:ie("rounded-md font-medium transition-all duration-200 disabled:cursor-not-allowed",u==="md"?"px-3 py-1.5":"px-2.5 py-1",i===d.value?"bg-panel text-ink shadow-[0_1px_2px_rgba(20,22,30,0.08)]":"text-muted hover:text-ink"),children:d.label},d.value))})}const tM={info:{icon:$h,className:"text-accent"},success:{icon:h2,className:"text-success"},error:{icon:x2,className:"text-danger"}};function nM(){const e=me(o=>o.toast),i=me(o=>o.dismissToast);if(B.useEffect(()=>{if(!e)return;const o=window.setTimeout(()=>i(e.id),4500);return()=>window.clearTimeout(o)},[e,i]),!e)return null;const a=tM[e.tone],r=a.icon;return Ho.createPortal(c.jsxs("div",{className:"pointer-events-none fixed bottom-56 left-1/2 z-[100] flex w-[min(92vw,440px)] -translate-x-1/2 animate-scalein items-start gap-2.5 rounded-xl border border-line surface-lift px-3.5 py-3 text-[12.5px] text-ink shadow-float sm:bottom-48",role:"status",children:[c.jsx(r,{size:16,className:ie("mt-0.5 shrink-0",a.className)}),c.jsx("p",{className:"flex-1 leading-relaxed",children:e.message}),c.jsx("button",{type:"button",className:"pointer-events-auto icon-button -mr-1 -mt-1 h-6 w-6",onClick:()=>i(e.id),"aria-label":"Dismiss",children:c.jsx(Bi,{size:13})})]}),document.body)}function iM(){const e=me(r=>r.confirm),i=me(r=>r.resolveConfirm),a=e?.tone==="danger";return c.jsx(Ed,{open:!!e,onClose:()=>i(!1),className:"sm:w-[420px]",children:c.jsxs("div",{className:"p-5 sm:p-6",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:ie("mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full",a?"bg-danger/10 text-danger":"bg-accent-soft text-accent"),children:c.jsx(cC,{size:17})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"text-[15px] font-semibold tracking-[-0.01em]",children:e?.title}),c.jsx("p",{className:"mt-1.5 text-[12.5px] leading-relaxed text-muted",children:e?.body})]})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{type:"button",className:"chip",onClick:()=>i(!1),children:"Cancel"}),c.jsxs("button",{type:"button","data-autofocus":!0,onClick:()=>i(!0),className:ie("inline-flex h-8 items-center gap-1.5 rounded-lg px-3 text-[12.5px] font-medium text-on-accent transition-all active:scale-95",a?"bg-danger hover:bg-danger/90":"bg-accent hover:bg-accent/90"),children:[c.jsx(Cn,{size:14}),e?.confirmLabel??"Confirm"]})]})]})})}const aM=[];function v0(e){return pd(Oe.getState(),e)}function wm(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6?1:0)}M`:`${Math.round(e/1e3)}k`:""}function rM(e){return e?Math.max(.06,Math.min(1,Math.log10(e/4e3)/Math.log10(2e6/4e3))):0}function sM(e){const i=e.split(/[\s/.-]+/).filter(Boolean);return(i.length>1?i[0][0]+i[1][0]:e.slice(0,2)).toUpperCase()}function lM({efforts:e,value:i,className:a}){const r=Math.max(0,e.indexOf(i));return c.jsx("span",{className:ie("flex h-3.5 items-end gap-[2px]",a),"aria-hidden":!0,children:e.map((o,u)=>c.jsx("span",{style:{height:`${38+u/Math.max(1,e.length-1)*62}%`},className:ie("w-[3px] rounded-[1px] transition-all duration-300 ease-spring",u<=r?"bg-accent":"bg-line")},o))})}function oM({efforts:e,value:i,onChange:a,disabled:r}){const o=B.useRef(null),[u,d]=B.useState(!1),p=Math.max(1,e.length-1),h=Math.max(0,e.indexOf(i)),g=h/p*100,x=B.useCallback(b=>{const v=o.current?.getBoundingClientRect();if(!v||e.length===0)return;const y=1-Math.min(1,Math.max(0,(b-v.top)/v.height)),k=e[Math.round(y*p)];k&&k!==i&&a(k)},[e,p,a,i]);return c.jsxs("div",{className:ie("relative flex h-[280px] gap-4 select-none",r&&"pointer-events-none opacity-40"),children:[c.jsxs("div",{ref:o,role:"slider",tabIndex:r?-1:0,"aria-label":"Reasoning effort","aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":h,"aria-valuetext":$u(i),onKeyDown:b=>{b.key==="ArrowUp"||b.key==="ArrowRight"?(b.preventDefault(),a(e[Math.min(e.length-1,h+1)])):(b.key==="ArrowDown"||b.key==="ArrowLeft")&&(b.preventDefault(),a(e[Math.max(0,h-1)]))},onPointerDown:b=>{b.currentTarget.setPointerCapture(b.pointerId),d(!0),x(b.clientY)},onPointerMove:b=>u&&x(b.clientY),onPointerUp:()=>d(!1),onPointerCancel:()=>d(!1),className:"relative w-9 shrink-0 cursor-grab touch-none rounded-full outline-none focus-visible:ring-2 focus-visible:ring-accent/50 active:cursor-grabbing",children:[c.jsx("div",{className:"absolute inset-x-[13px] inset-y-1 rounded-full bg-raised shadow-[inset_0_1px_3px_rgba(0,0,0,0.12)]"}),c.jsx("div",{className:"absolute inset-x-[13px] bottom-1 rounded-full bg-gradient-to-t from-accent/40 via-accent to-accent transition-[height] duration-500 ease-spring",style:{height:`calc((100% - 8px) * ${g/100})`}}),e.map((b,v)=>c.jsx("span",{className:ie("absolute left-1/2 h-[7px] w-[7px] -translate-x-1/2 translate-y-1/2 rounded-full border transition-colors duration-300",v<=h?"border-on-accent/40 bg-on-accent/80":"border-line bg-panel"),style:{bottom:`calc(4px + (100% - 8px) * ${v/p})`}},b)),c.jsx("span",{className:ie("throttle-knob absolute left-1/2 h-6 w-6 -translate-x-1/2 translate-y-1/2 rounded-full border-2 border-accent bg-panel shadow-float transition-[bottom] duration-500 ease-spring",u&&"scale-110 !duration-75"),style:{bottom:`calc(4px + (100% - 8px) * ${h/p})`},children:c.jsx("span",{className:"absolute inset-[5px] rounded-full bg-accent"})})]}),c.jsx("div",{className:"relative min-w-0 flex-1",children:e.map((b,v)=>{const y=v===h;return c.jsxs("button",{type:"button",onClick:()=>a(b),className:ie("absolute left-0 flex -translate-y-1/2 flex-col items-start text-left transition-all duration-300",y?"text-ink":"text-faint hover:text-ink"),style:{top:`calc(4px + (100% - 8px) * ${1-v/p})`},children:[c.jsx("span",{className:ie("font-mono text-[10.5px] uppercase tracking-[0.14em]",y&&"text-accent"),children:$u(b)}),c.jsx("span",{className:ie("overflow-hidden text-[10.5px] leading-tight text-muted transition-all duration-300",y?"mt-0.5 max-h-8 opacity-100":"max-h-0 opacity-0"),children:Wh[b]?.description})]},b)})})]})}function cM({open:e,onClose:i}){const a=Oe(),r=Oe(G=>G.selectModel),o=Oe(G=>G.update),u=me(G=>G.openSettings),[d,p]=B.useState(""),[h,g]=B.useState(""),[x,b]=B.useState(!1),[v,y]=B.useState(0),k=B.useRef(null),_=B.useRef(null),S=B.useRef(null),N=a.provider,M=On(G=>G.byProvider[N])??aM,j=On(G=>!!G.loading[N]),D=On(G=>G.errors[N]??""),P=On(G=>G.notes[N]??""),L=On(G=>G.fetchModels),T=li(a),R=M.find(G=>G.id===T)??null,K=v0(N),z=!!aa[N]?.keyless||N==="custom",$=Ao(R);B.useEffect(()=>{e&&(K||z)&&L(N)},[e,N,K,z,L]),B.useEffect(()=>{if(!e){p(""),b(!1);return}const G=window.setTimeout(()=>_.current?.focus(),60),A=document.activeElement,Se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.clearTimeout(G),document.body.style.overflow=Se,A?.focus?.()}},[e]);const W=B.useMemo(()=>{const G=d.trim().toLowerCase();return G?M.filter(A=>A.name.toLowerCase().includes(G)||A.id.toLowerCase().includes(G)):M},[M,d]);B.useLayoutEffect(()=>{y(0)},[d,N]),B.useEffect(()=>{k.current?.querySelector(`[data-row="${v}"]`)?.scrollIntoView({block:"center"})},[v]);const de=G=>{const A=Ao(G),Se=A.length>0?ul(a.effort,G):a.effort;r(N,G.id,A.length>0&&!A.includes(Se)?mw(G):Se)},ce=G=>{G?.preventDefault();const A=h.trim();A&&(r(N,A,a.effort),g(""),b(!1))},ae=G=>{G!==N&&(o({provider:G,model:""}),p(""),L(G))},O=G=>{if(G.key==="ArrowDown")G.preventDefault(),y(A=>Math.min(W.length-1,A+1));else if(G.key==="ArrowUp")G.preventDefault(),y(A=>Math.max(0,A-1));else if(G.key==="Enter"){G.preventDefault();const A=W[v];A&&A.id!==T?de(A):i()}};if(B.useEffect(()=>{if(!e)return;const G=A=>{A.key==="Escape"&&(A.preventDefault(),i())};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[e,i]),B.useEffect(()=>{if(!e)return;const G=requestAnimationFrame(()=>S.current?.querySelector('[aria-pressed="true"]')?.scrollIntoView({block:"center"}));return()=>cancelAnimationFrame(G)},[e,N]),!e)return null;const te=!K&&!z,ne=Math.max(0,Bu.findIndex(G=>G.id===N));return Ho.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[90] flex items-end justify-center sm:items-center sm:p-6",children:[c.jsx("button",{type:"button","aria-label":"Close model deck",tabIndex:-1,onClick:i,className:"deck-scrim absolute inset-0 cursor-default bg-black/40 backdrop-blur-[6px] dark:bg-black/65"}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Model deck",className:"deck-panel relative flex h-[min(92dvh,640px)] w-full flex-col overflow-hidden rounded-t-[28px] border border-line bg-panel shadow-float sm:w-[min(920px,96vw)] sm:rounded-[28px]",children:[c.jsx("div",{className:"deck-aurora pointer-events-none absolute inset-x-0 top-0 h-40"}),c.jsxs("header",{className:"relative flex shrink-0 items-end gap-4 px-6 pb-4 pt-5",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.22em] text-faint",children:"Model deck"}),c.jsx("h2",{className:"mt-1 truncate font-display text-[26px] font-semibold leading-none tracking-[-0.03em] text-ink",children:R?.name||T||"Pick a model"}),c.jsxs("p",{className:"mt-1.5 flex items-center gap-2 text-[11.5px] text-muted",children:[c.jsx("span",{children:aa[N]?.name??N}),$.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-faint",children:"·"}),c.jsxs("span",{className:"text-accent",children:[$u(a.effort)," effort"]})]}),R?.context?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-faint",children:"·"}),c.jsxs("span",{children:[wm(R.context)," context"]})]}):null]})]}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{L(N,!0)},disabled:j||te,title:"Refresh live models","aria-label":"Refresh live models",children:c.jsx(zi,{size:14,className:ie(j&&"animate-spin")})}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{i(),u("models")},title:"Provider settings","aria-label":"Provider settings",children:c.jsx(tw,{size:14})}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:i,"aria-label":"Close",children:c.jsx(Bi,{size:15})})]}),c.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col border-t border-line md:flex-row",children:[c.jsxs("nav",{ref:S,"aria-label":"Providers",className:"thin-scroll relative flex shrink-0 gap-1.5 overflow-x-auto border-b border-line bg-canvas/70 p-2 md:w-[78px] md:flex-col md:overflow-y-auto md:overflow-x-hidden md:border-b-0 md:border-r md:p-2.5",children:[c.jsx("span",{"aria-hidden":!0,className:"deck-rail-glow pointer-events-none absolute left-2.5 top-2.5 hidden h-[46px] w-[calc(100%-20px)] rounded-2xl bg-accent-soft ring-1 ring-accent/40 transition-transform duration-500 ease-spring md:block",style:{transform:`translateY(${ne*52}px)`}}),Bu.map(G=>{const A=v0(G.id)||G.keyless||G.id==="custom",Se=G.id===N;return c.jsxs("button",{type:"button",onClick:()=>ae(G.id),disabled:!A,title:`${G.name}${A?"":" · connect to enable"}`,"aria-pressed":Se,className:ie("relative flex h-[46px] min-w-[58px] shrink-0 flex-col items-center justify-center gap-0.5 rounded-2xl transition-colors disabled:cursor-not-allowed disabled:opacity-40 md:min-w-0",Se?"text-accent max-md:bg-accent-soft":"text-muted hover:bg-raised hover:text-ink"),children:[c.jsx("span",{className:"font-display text-[13px] font-semibold tracking-tight",children:sM(G.name)}),c.jsx("span",{className:"max-w-full truncate px-1 text-[8.5px] leading-none text-faint",children:G.name.split(" ")[0]}),c.jsx("span",{className:ie("absolute right-1.5 top-1.5 h-1.5 w-1.5 rounded-full",A?"bg-success":"bg-warning/70")})]},G.id)})]}),c.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:te?c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-8 text-center",children:[c.jsx("span",{className:"deck-pop flex h-12 w-12 items-center justify-center rounded-2xl bg-warning/10 text-warning",children:c.jsx(zo,{size:20})}),c.jsxs("p",{className:"font-display text-[16px] font-semibold text-ink",children:["Connect ",aa[N]?.name??N]}),c.jsx("p",{className:"max-w-[320px] text-[12px] leading-relaxed text-muted",children:"Keys are encrypted by the local daemon before they touch disk and never come back to this page."}),c.jsx("button",{type:"button",onClick:()=>{i(),u("models")},className:"mt-1 inline-flex h-9 items-center gap-1.5 rounded-full bg-ink px-5 text-[12px] font-medium text-panel transition-transform active:scale-95",children:"Add API key"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"shrink-0 px-4 pb-2 pt-3.5",children:[c.jsxs("div",{className:"relative",children:[c.jsx(as,{size:14,className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-faint"}),c.jsx("input",{ref:_,value:d,onChange:G=>p(G.target.value),onKeyDown:O,placeholder:M.length>0?`Search ${M.length} models…`:"Search models…",className:"h-10 w-full rounded-full border border-line bg-canvas/70 pl-10 pr-14 text-[13px] text-ink outline-none transition-all placeholder:text-faint focus:border-accent/50 focus:bg-panel focus:shadow-[0_0_0_4px_rgb(var(--accent)/0.10)]","aria-label":"Search models"}),c.jsx("kbd",{className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-md border border-line bg-panel px-1.5 py-0.5 font-mono text-[9.5px] text-faint",children:"↑↓ ↵"})]}),D&&c.jsxs("div",{className:"mt-2 flex items-start gap-1.5 rounded-lg border border-danger/20 bg-danger/[0.04] px-2.5 py-2",children:[c.jsx(sd,{size:12,className:"mt-0.5 shrink-0 text-danger"}),c.jsx("p",{className:"min-w-0 flex-1 text-[11px] leading-relaxed text-danger",children:D}),c.jsx("button",{type:"button",onClick:()=>{L(N,!0)},className:"text-[11px] font-medium text-danger",children:"Retry"})]}),P&&!D&&c.jsx("p",{className:"mt-1.5 px-1 text-[10.5px] leading-relaxed text-faint",children:P})]}),c.jsxs("div",{ref:k,className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2.5 pb-3",children:[j&&M.length===0&&c.jsxs("p",{className:"flex items-center gap-2 px-3 py-4 text-[12px] text-faint",children:[c.jsx(Vt,{size:12})," Loading live models…"]}),W.map((G,A)=>{const Se=G.id===T,pe=A===v,C=G.reasoningOptions.length>0;return c.jsxs("button",{type:"button","data-row":A,onClick:()=>{y(A),de(G)},onMouseMove:()=>pe||y(A),style:{animationDelay:`${Math.min(A*22,260)}ms`},className:ie("deck-row group/row relative mb-1 flex w-full items-center gap-3 overflow-hidden rounded-2xl px-3 py-2.5 text-left transition-colors",Se?"bg-accent-soft":pe?"bg-raised":"hover:bg-raised/70"),children:[c.jsx("span",{className:ie("flex h-8 w-8 shrink-0 items-center justify-center rounded-xl transition-all duration-300",Se?"scale-100 bg-accent text-on-accent":"bg-raised text-faint group-hover/row:bg-panel"),children:Se?c.jsx(Cn,{size:14,strokeWidth:2.4}):c.jsx(vC,{size:13})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:ie("truncate text-[13px] font-medium",Se?"text-accent":"text-ink"),children:G.name||G.id}),G.free&&c.jsx("span",{className:"rounded-full bg-success/10 px-1.5 py-px text-[9px] font-medium text-success",children:"free"}),!G.toolCall&&c.jsx("span",{className:"rounded-full bg-warning/10 px-1.5 py-px text-[9px] font-medium text-warning",children:"no tools"})]}),c.jsx("span",{className:"mt-0.5 block truncate font-mono text-[10px] text-faint",children:G.id})]}),c.jsxs("span",{className:"hidden shrink-0 items-center gap-2.5 text-faint sm:flex",children:[C&&c.jsx(X1,{size:12,className:"text-accent/80","aria-label":"reasoning"}),G.vision&&c.jsx(Bh,{size:12,"aria-label":"vision"}),G.context?c.jsxs("span",{className:"flex w-[74px] flex-col items-end gap-1",children:[c.jsx("span",{className:"font-mono text-[10px] tabular-nums",children:wm(G.context)}),c.jsx("span",{className:"h-[3px] w-full overflow-hidden rounded-full bg-line",children:c.jsx("span",{className:ie("block h-full rounded-full",Se?"bg-accent":"bg-faint/60"),style:{width:`${rM(G.context)*100}%`}})})]}):null]})]},G.id)}),!j&&W.length===0&&M.length>0&&c.jsxs("p",{className:"px-3 py-6 text-center text-[12px] text-faint",children:["No model matches “",d,"”."]}),!j&&M.length===0&&!D&&c.jsx("p",{className:"px-3 py-6 text-center text-[12px] text-faint",children:"This provider returned no usable chat models."}),x?c.jsxs("form",{onSubmit:ce,className:"deck-row mt-1 flex items-center gap-2 px-1",children:[c.jsx("input",{autoFocus:!0,value:h,onChange:G=>g(G.target.value),placeholder:"model-id",className:"h-9 min-w-0 flex-1 rounded-full border border-line bg-panel px-4 font-mono text-[11.5px] outline-none focus:border-accent/50","aria-label":"Model ID"}),c.jsx("button",{type:"submit",disabled:!h.trim(),className:"h-9 rounded-full bg-ink px-4 text-[11.5px] font-medium text-panel transition-opacity disabled:opacity-40",children:"Use"})]}):c.jsxs("button",{type:"button",onClick:()=>b(!0),className:"mt-1 flex w-full items-center gap-2 rounded-2xl px-3 py-2.5 text-left text-[12px] text-faint transition-colors hover:bg-raised/70 hover:text-ink",children:[c.jsx(vr,{size:13})," Use a model ID that is not listed"]})]})]})}),c.jsxs("aside",{className:"deck-throttle relative shrink-0 border-t border-line bg-canvas/70 px-6 py-5 md:w-[258px] md:border-l md:border-t-0",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsx(X1,{size:13,className:"text-accent"}),c.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-muted",children:"Reasoning"})]}),$.length>1?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"hidden md:block",children:c.jsx(oM,{efforts:$,value:ul(a.effort,R),onChange:G=>R&&r(N,R.id,G),disabled:!R})}),c.jsx("div",{className:"flex gap-1 rounded-full bg-raised p-1 md:hidden",children:$.map(G=>c.jsx("button",{type:"button",onClick:()=>R&&r(N,R.id,G),className:ie("h-8 min-w-0 flex-1 rounded-full text-[10.5px] font-medium transition-all",a.effort===G?"bg-accent text-on-accent shadow-pill":"text-muted"),children:$u(G)},G))})]}):c.jsxs("div",{className:"flex h-[120px] flex-col justify-center rounded-2xl border border-dashed border-line px-4 text-center md:h-[280px]",children:[c.jsx("p",{className:"text-[12px] font-medium text-ink",children:R?"No effort dial":"Pick a model"}),c.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted",children:eh(R)})]}),$.length>1&&c.jsx("p",{className:"mt-4 hidden text-[10.5px] leading-relaxed text-faint md:block",children:eh(R)})]})]}),c.jsxs("footer",{className:"relative flex shrink-0 items-center gap-3 border-t border-line px-6 py-3 text-[10.5px] text-faint",children:[R?.maxOutput?c.jsxs("span",{children:["max output ",wm(R.maxOutput)]}):null,R?.apiKind?c.jsx("span",{className:"rounded-md border border-line px-1.5 py-px font-mono",children:R.apiKind}):null,c.jsx("span",{className:"ml-auto hidden sm:inline",children:"Esc to close"}),c.jsx("button",{type:"button",onClick:i,className:"inline-flex h-8 items-center rounded-full bg-ink px-5 text-[12px] font-medium text-panel transition-transform active:scale-95",children:"Done"})]})]})]}),document.body)}function uM({label:e,open:i,disabled:a,onClick:r,triggerRef:o,efforts:u,effort:d,title:p}){return c.jsxs("button",{ref:o,type:"button",disabled:a,onClick:r,"aria-haspopup":"dialog","aria-expanded":i,title:p,className:ie("deck-trigger group/deck flex h-8 max-w-[200px] items-center gap-2 rounded-full border border-transparent pl-2.5 pr-2.5 text-[11px] font-medium text-muted transition-all duration-200 hover:border-line hover:bg-raised hover:text-ink active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-45 sm:max-w-[270px]",i&&"border-accent/40 bg-accent-soft text-accent"),children:[c.jsx("span",{className:"truncate",children:e}),u.length>1&&c.jsx(lM,{efforts:u,value:d})]})}const ea={outline:"#6b3410",body:"#fbbf24",shade:"#f59e0b",highlight:"#fef3c7",ray:"#f59e0b",eye:"#1a0f06",mark:"#4a2508",blush:"#fb7185",sweat:"#38bdf8",mint:"#34d399",sky:"#60a5fa",rose:"#fb7185"},dM={wave:"animate-bob",idle:"animate-float-slow",thinking:"animate-float",working:"animate-bob-fast",typing:"animate-bob",happy:"animate-pop",alert:"animate-bounce",error:"animate-shake",sleepy:"animate-float-slow",party:"animate-pop"},fM=new Set(["thinking","working","typing","party","wave"]),ck=[[4,6,9],[5,5,10],[6,4,11],[7,4,11],[8,4,11],[9,4,11],[10,5,10],[11,6,9]],el=new Set;for(const[e,i,a]of ck)for(let r=i;r<=a;r++)el.add(`${r},${e}`);const uk=[];for(let e=2;e<=13;e++)for(let i=2;i<=13;i++){if(el.has(`${i},${e}`))continue;(el.has(`${i-1},${e}`)||el.has(`${i+1},${e}`)||el.has(`${i},${e-1}`)||el.has(`${i},${e+1}`))&&uk.push([i,e])}const pM=[[7,0,2,2,"ray"],[7,14,2,2,"ray"],[0,7,2,2,"ray"],[14,7,2,2,"ray"]],mM=[[2,2,1,1,"ray"],[13,2,1,1,"ray"],[2,13,1,1,"ray"],[13,13,1,1,"ray"],[3,3,1,1,"ray"],[12,3,1,1,"ray"],[3,12,1,1,"ray"],[12,12,1,1,"ray"]];function ta(e,i=0,a=0){const[r,o]=e==="sm"?[1,1]:e==="md"?[1,2]:e==="lg"?[2,2]:[2,1],u=(e==="sm"||e==="flat"?8:7)+a;return[[(e==="lg"||e==="flat"?5:6)+i,u,r,o,"eye"],[9+i,u,r,o,"eye"]]}const w0=[[4,9,1,1,"blush"],[11,9,1,1,"blush"]];function hM(e){switch(e){case"wave":return{eyes:ta("md"),extras:w0,eyeClass:"pxs-blink"};case"happy":return{eyes:ta("lg"),extras:[...w0,[13,1,1,3,"ray"],[12,2,3,1,"ray"]],clearCorner:!0};case"party":return{eyes:ta("lg"),extras:[[1,3,1,1,"rose"],[14,2,1,1,"mint"],[0,11,1,1,"sky"],[15,12,1,1,"rose"],[4,0,1,1,"mint"],[11,0,1,1,"sky"],[2,14,1,1,"mint"],[13,14,1,1,"rose"]],clearCorner:!0};case"thinking":return{eyes:ta("md",1,-1),extras:[[10,1,1,1,"mark"],[12,1,1,1,"mark"],[14,1,1,1,"mark"]],clearCorner:!0};case"working":return{eyes:ta("sm",0,1),extras:[],eyeClass:"pxs-scan"};case"typing":return{eyes:ta("md",0,1),extras:[],eyeClass:"pxs-scan"};case"alert":return{eyes:ta("lg"),extras:[[13,0,1,3,"mark"],[13,4,1,1,"mark"]],clearCorner:!0};case"error":return{eyes:ta("sm",0,1),extras:[[12,3,1,1,"sweat"],[12,4,1,2,"sweat"]],clearCorner:!0};case"sleepy":return{eyes:ta("flat"),extras:[[12,1,4,1,"mark"],[14,2,1,1,"mark"],[13,3,1,1,"mark"],[12,4,4,1,"mark"]],clearCorner:!0};default:return{eyes:ta("md"),extras:[],eyeClass:"pxs-blink"}}}function dk({mood:e="idle",size:i=40,className:a,animate:r=!0}){const o=HO[e],u=r&&fM.has(e),d=hM(e);return c.jsx("span",{className:ie("inline-flex shrink-0 select-none",r&&dM[e],a),role:"img","aria-label":`PixleSol — ${o}`,title:`PixleSol — ${o}`,children:c.jsxs("svg",{viewBox:"0 0 16 16",width:i,height:i,shapeRendering:"crispEdges","aria-hidden":"true",children:[c.jsx("g",{className:u?"pxs-a":void 0,children:pM.map(([p,h,g,x,b],v)=>c.jsx("rect",{x:p,y:h,width:g,height:x,fill:ea[b]},v))}),c.jsx("g",{className:u?"pxs-b":void 0,opacity:d.clearCorner?.35:void 0,children:mM.map(([p,h,g,x,b],v)=>c.jsx("rect",{x:p,y:h,width:g,height:x,fill:ea[b]},v))}),uk.map(([p,h])=>c.jsx("rect",{x:p,y:h,width:1,height:1,fill:ea.outline},`o${p},${h}`)),ck.map(([p,h,g])=>c.jsx("rect",{x:h,y:p,width:g-h+1,height:1,fill:ea.body},`b${p}`)),c.jsx("rect",{x:5,y:11,width:6,height:1,fill:ea.shade}),c.jsx("rect",{x:9,y:10,width:2,height:1,fill:ea.shade}),c.jsx("rect",{x:6,y:4,width:2,height:1,fill:ea.highlight}),c.jsx("rect",{x:5,y:5,width:1,height:1,fill:ea.highlight}),c.jsx("g",{className:r?d.eyeClass:void 0,children:d.eyes.map(([p,h,g,x,b],v)=>c.jsx("rect",{x:p,y:h,width:g,height:x,fill:ea[b]},v))}),d.extras.map(([p,h,g,x,b],v)=>c.jsx("rect",{x:p,y:h,width:g,height:x,fill:ea[b]},`x${v}`))]})})}const gM=/\.(txt|md|markdown|ts|tsx|js|jsx|mjs|cjs|json|css|scss|html|vue|svelte|py|go|rs|rb|java|kt|cs|c|h|cpp|hpp|php|swift|sh|bash|zsh|yml|yaml|toml|ini|sql|csv|xml|gitignore|env)$/i,km=6,xM=5*1024*1024,bM=512*1024,Em=[{name:"search",usage:"/search <query>",description:"Search the web and answer with sources",takesArgs:!0},{name:"plan",usage:"/plan [task]",description:"Read-only investigation, then a plan",takesArgs:!1},{name:"build",usage:"/build [task]",description:"Allow edits and commands",takesArgs:!1},{name:"new",usage:"/new",description:"Start a new conversation",takesArgs:!1},{name:"workspace",usage:"/workspace",description:"Open the folder panel",takesArgs:!1},{name:"deploy",usage:"/deploy",description:"Deploy a project folder",takesArgs:!1},{name:"settings",usage:"/settings",description:"Open settings",takesArgs:!1},{name:"clear",usage:"/clear",description:"Clear this conversation",takesArgs:!1}];function k0(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function E0({value:e,onChange:i,onSend:a,onStop:r,onCommand:o,streaming:u,hints:d=!1,autoFocus:p=!1,placeholder:h="How can I help you today?",contextPct:g,contextTitle:x,pixleMood:b}){const v=Oe(),y=Oe(fe=>fe.update),k=Oe(fe=>fe.setMode),_=me(fe=>fe.notify),S=me(fe=>fe.openSettings),N=me(fe=>fe.composerFocus),M=me(fe=>fe.setWorkspaceOpen),j=Be(fe=>fe.info),[D,P]=B.useState([]),[L,T]=B.useState(!1),[R,K]=B.useState(!1),[z,$]=B.useState(!1),[W,de]=B.useState(!1),[ce,ae]=B.useState(!1),[O,te]=B.useState(0),ne=B.useRef(null),G=B.useRef(null),A=B.useRef(null),Se=B.useRef(null),pe=B.useRef(null);B.useEffect(()=>{const fe=qe=>{(qe.metaKey||qe.ctrlKey)&&!qe.shiftKey&&!qe.altKey&&qe.key.toLowerCase()==="m"&&(qe.preventDefault(),$(ht=>!ht))};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[]),eM(Se,()=>de(!1),W,pe);const C=li(v),I=lj(v.provider),se=kd(),he=dl(v),ke=Ao(se),ze=v.skills.filter(fe=>fe.enabled).length,He=lk(v.tools),$e=he?C?I.find(fe=>fe.id===C)?.name??C:"Select model":"No provider",X=B.useMemo(()=>{if(!e.startsWith("/")||e.includes(`
|
|
247
|
+
`))return null;const fe=e.slice(1).split(/\s/)[0];return e.slice(1).includes(" ")?null:fe.toLowerCase()},[e]),Z=B.useMemo(()=>X===null?[]:Em.filter(fe=>fe.name.startsWith(X)),[X]);B.useEffect(()=>{te(0)},[X]),B.useLayoutEffect(()=>{const fe=ne.current;fe&&(fe.style.height="auto",fe.style.height=`${Math.min(Math.max(fe.scrollHeight,52),220)}px`)},[e]),B.useEffect(()=>{if(!p||!window.matchMedia("(pointer: fine)").matches)return;const fe=window.setTimeout(()=>ne.current?.focus(),80);return()=>window.clearTimeout(fe)},[p]),B.useEffect(()=>{N>0&&ne.current?.focus()},[N]),B.useEffect(()=>{he||$(!1)},[he]),B.useEffect(()=>{se&&!ke.length&&y({effort:"medium"})},[se,ke.length,y]);const Te=async fe=>{if(fe.length===0)return;let qe=km-D.length;if(qe<=0){_(`You can attach up to ${km} files per message.`,"error");return}const ht=[];for(const xt of fe){if(qe<=0){_(`Only ${km} attachments were added.`,"info");break}const ln=/^image\/(png|jpeg|webp|gif)$/i.test(xt.type),re=xt.type.startsWith("text/")||gM.test(xt.name);if(ln){if(xt.size>xM){_(`${xt.name} is larger than 5 MB.`,"error");continue}ht.push({id:k0(),name:xt.name,kind:"image",mime:xt.type,dataUrl:await LO(xt),size:xt.size}),qe-=1}else if(re){if(xt.size>bM){_(`${xt.name} is larger than 512 KB.`,"error");continue}ht.push({id:k0(),name:xt.name,kind:"text",mime:xt.type||"text/plain",text:await ak(xt),size:xt.size}),qe-=1}else _(`Can't attach ${xt.name}. Use an image, text or code file.`,"error")}ht.length>0&&P(xt=>[...xt,...ht])},rt=async()=>{if(u||ce)return;const fe=e.trim();if(!(!fe&&D.length===0)){if(fe.startsWith("/")&&!D.length){const[qe,...ht]=fe.slice(1).split(/\s+/),xt=Em.find(ln=>ln.name===qe.toLowerCase());if(xt){const ln=ht.join(" ").trim();if(o){ae(!0);try{await o(xt.name,ln)&&(i(""),requestAnimationFrame(()=>ne.current?.focus()))}catch(re){_(re instanceof Error?re.message:"That command failed.","error")}finally{ae(!1)}return}}}ae(!0),$(!1);try{await a(e,D)&&(i(""),P([]),requestAnimationFrame(()=>ne.current?.focus()))}catch(qe){_(qe instanceof Error?qe.message:"The message could not be sent.","error")}finally{ae(!1)}}},ct=(fe,qe)=>{if(qe){i(`/${fe} `),ne.current?.focus();return}i(`/${fe}`),window.setTimeout(()=>{Le(`/${fe}`)},0)},Le=async fe=>{const[qe]=fe.slice(1).split(/\s+/),ht=Em.find(xt=>xt.name===qe.toLowerCase());if(!(!ht||!o)){ae(!0);try{await o(ht.name,fe.slice(1).split(/\s+/).slice(1).join(" "))&&i("")}finally{ae(!1)}}},mt=fe=>{if(Z.length>0){if(fe.key==="ArrowDown"){fe.preventDefault(),te(qe=>(qe+1)%Z.length);return}if(fe.key==="ArrowUp"){fe.preventDefault(),te(qe=>(qe-1+Z.length)%Z.length);return}if(fe.key==="Enter"&&!fe.shiftKey&&!fe.nativeEvent.isComposing){fe.preventDefault();const qe=Z[O];qe&&ct(qe.name,qe.takesArgs);return}if(fe.key==="Escape"){fe.preventDefault(),i("");return}}if(fe.key==="Enter"&&!fe.shiftKey&&!fe.nativeEvent.isComposing){if(fe.preventDefault(),u)return;rt()}fe.key==="Escape"&&$(!1)},Je=fe=>{const qe=Array.from(fe.clipboardData.files);qe.length>0&&(fe.preventDefault(),Te(qe))},Gt=fe=>{fe.preventDefault(),K(!1),Te(Array.from(fe.dataTransfer.files))},An=!e.trim()&&D.length===0||ce||u,xn=g===void 0?"":g>=95?"text-danger":g>=70?"text-warning":"text-faint";return c.jsxs("div",{className:"relative w-full",children:[c.jsx(cM,{open:z&&he,onClose:()=>$(!1)}),Z.length>0&&c.jsxs("div",{className:"absolute bottom-[calc(100%+8px)] left-0 z-40 w-[min(94vw,360px)] overflow-hidden rounded-xl border border-line surface-lift shadow-float",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2 text-[10px] font-medium uppercase tracking-[0.12em] text-faint",children:[c.jsx(XT,{size:10})," Commands"]}),Z.map((fe,qe)=>c.jsxs("button",{type:"button",onMouseDown:ht=>ht.preventDefault(),onClick:()=>ct(fe.name,fe.takesArgs),className:ie("flex w-full items-center gap-2 px-3 py-2 text-left",qe===O?"bg-accent-soft":"hover:bg-raised"),children:[c.jsx("span",{className:ie("font-mono text-[10.5px]",qe===O?"text-accent":"text-ink"),children:fe.usage}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px] text-faint",children:fe.description})]},fe.name))]}),c.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>M(!0),className:"chip h-7 max-w-[220px] gap-1.5 px-2.5 text-[11px]",title:j.available?j.root:"Choose a project folder",children:[c.jsx(es,{size:12,className:"shrink-0 text-faint"}),c.jsx("span",{className:"truncate",children:j.available?j.name:"No folder"})]}),c.jsxs("button",{type:"button",onClick:()=>k(v.mode==="plan"?"build":"plan"),className:"chip h-7 gap-1.5 px-2.5 text-[11px]",title:v.mode==="plan"?"Switch to Build mode":"Switch to Plan mode (read-only)",children:[v.mode==="plan"?c.jsx(Ph,{size:12,className:"text-faint"}):c.jsx(Ui,{size:12,className:"text-faint"}),v.mode==="plan"?"Plan mode":"Build mode"]}),c.jsxs("button",{type:"button",onClick:()=>y({webSearchEnabled:!v.webSearchEnabled}),className:ie("chip h-7 gap-1.5 px-2.5 text-[11px]",v.webSearchEnabled&&"chip-active"),title:"Allow OpenSol to search the web and read pages","aria-pressed":v.webSearchEnabled,children:[c.jsx(is,{size:12}),"Search"]}),ze>0&&c.jsxs("button",{type:"button",onClick:()=>S("skills"),className:"chip h-7 gap-1 px-2.5 text-[11px]",title:"Manage loaded skills",children:[ze," skill",ze===1?"":"s"]})]}),c.jsxs("div",{onDragOver:fe=>{fe.dataTransfer.types.includes("Files")&&(fe.preventDefault(),K(!0))},onDragLeave:fe=>{fe.currentTarget.contains(fe.relatedTarget)||K(!1)},onDrop:Gt,className:ie("surface-lift composer-shadow relative rounded-2xl border transition-all duration-200",L||R?"border-accent/35":"border-line",u&&"composer-glow border-accent/30",R&&"ring-4 ring-accent/10"),children:[L&&!R&&c.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-4 ring-accent/[0.03]","aria-hidden":"true"}),c.jsxs("div",{className:"relative px-3.5 pb-1 pt-3",children:[D.length>0&&c.jsx("div",{className:"flex flex-wrap gap-2 px-1 pb-2",children:D.map(fe=>fe.kind==="image"?c.jsxs("div",{className:"relative",children:[c.jsx("img",{src:fe.dataUrl,alt:fe.name,className:"h-14 w-14 rounded-lg border border-line object-cover"}),c.jsx("button",{type:"button",onClick:()=>P(qe=>qe.filter(ht=>ht.id!==fe.id)),className:"absolute -right-1.5 -top-1.5 flex h-[18px] w-[18px] items-center justify-center rounded-full border border-line bg-panel text-muted shadow-sm transition-colors hover:text-ink","aria-label":`Remove ${fe.name}`,children:c.jsx(Bi,{size:10})})]},fe.id):c.jsxs("span",{className:"inline-flex h-8 max-w-[220px] items-center gap-1.5 rounded-lg border border-line bg-raised/70 pl-2 pr-1 text-[10.5px] text-muted",children:[c.jsx(Ma,{size:11,className:"shrink-0"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:fe.name}),c.jsx("span",{className:"shrink-0 text-faint",children:$o(fe.size)}),c.jsx("button",{type:"button",onClick:()=>P(qe=>qe.filter(ht=>ht.id!==fe.id)),className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-faint hover:bg-panel hover:text-ink","aria-label":`Remove ${fe.name}`,children:c.jsx(Bi,{size:10})})]},fe.id))}),c.jsx("textarea",{ref:ne,value:e,onChange:fe=>i(fe.target.value),onKeyDown:mt,onPaste:Je,onFocus:()=>T(!0),onBlur:()=>T(!1),placeholder:h,rows:1,"aria-label":"Message OpenSol",className:"block w-full resize-none bg-transparent px-2 py-1.5 text-[15.5px] leading-[1.6] text-ink outline-none placeholder:text-faint",style:{minHeight:52,maxHeight:220}})]}),c.jsxs("div",{className:"flex items-end justify-between gap-2 px-2.5 pb-2 pt-1",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-0.5",children:[c.jsxs("div",{className:"relative",children:[c.jsxs("button",{ref:pe,type:"button",onClick:()=>de(fe=>!fe),className:"flex h-8 items-center gap-1.5 rounded-lg px-2 text-[11px] font-medium text-muted transition-colors hover:bg-raised hover:text-ink",title:"Choose how much OpenSol can do without asking","aria-expanded":W,children:[c.jsx(kr,{size:13,className:"text-faint"}),WO(He),c.jsx(Do,{size:11,className:ie("text-faint transition-transform",W&&"rotate-180")})]}),W&&c.jsxs("div",{ref:Se,className:"surface-lift absolute bottom-[calc(100%+8px)] left-0 z-40 w-[290px] overflow-hidden rounded-2xl border border-line p-1.5 shadow-float",children:[c.jsx("p",{className:"px-2 pb-1 pt-1.5 text-[10px] font-medium uppercase tracking-[0.1em] text-faint",children:"Permissions"}),cg.map(fe=>c.jsxs("button",{type:"button",onClick:()=>{y({tools:ok(v.tools,fe.value)}),de(!1)},className:"flex w-full items-start gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-raised",children:[c.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center",children:He===fe.value?c.jsx(Cn,{size:12,className:"text-accent"}):c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-line"})}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block text-[11.5px] font-medium text-ink",children:fe.label}),c.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-faint",children:fe.description})]})]},fe.value))]})]}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>G.current?.click(),title:"Attach images or text files","aria-label":"Attach files",children:c.jsx(CT,{size:15})}),c.jsx("input",{ref:G,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp,image/gif,.md,.markdown,.txt,.ts,.tsx,.js,.jsx,.json,.css,.html,.py,.go,.rs,.rb,.java,.cs,.sh,.yml,.yaml,.toml,.sql",className:"hidden",onChange:fe=>{fe.target.files&&Te(Array.from(fe.target.files)),fe.target.value=""}})]}),c.jsxs("div",{className:"flex min-w-0 shrink-0 items-center gap-1",children:[g!==void 0&&c.jsxs("span",{className:ie("hidden items-center gap-1 px-1 text-[10.5px] tabular-nums sm:flex",xn),title:x,children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),g,"%"]}),c.jsx(uM,{triggerRef:A,label:$e,open:z,disabled:!he,onClick:()=>$(fe=>!fe),efforts:ke,effort:v.effort,title:he?"Model deck: choose model and reasoning effort (Ctrl M)":"Add a provider key in Settings first"}),u?c.jsx("button",{type:"button",onClick:r,className:"flex h-8 w-8 items-center justify-center rounded-full bg-ink text-panel transition-opacity hover:opacity-85","aria-label":"Stop generating",title:"Stop",children:c.jsx(Vh,{size:11,fill:"currentColor"})}):c.jsx("button",{type:"button",onClick:()=>{rt()},disabled:An,className:ie("flex h-8 w-8 items-center justify-center rounded-full transition-all duration-150",An?"cursor-not-allowed bg-raised text-faint":"bg-accent text-on-accent hover:brightness-110"),"aria-label":"Send message",title:"Send (Enter)",children:ce?c.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border border-current border-t-transparent"}):c.jsx(yM,{})})]})]}),R&&c.jsxs("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-1.5 rounded-2xl border-2 border-dashed border-accent/45 bg-panel/95",children:[c.jsx(Qh,{size:18,className:"text-accent"}),c.jsx("p",{className:"text-[12px] font-medium text-ink",children:"Drop files to attach"}),c.jsx("p",{className:"text-[10.5px] text-faint",children:"Images up to 5 MB · text up to 512 KB"})]}),b&&c.jsx(dk,{mood:b,size:44,className:"pointer-events-none absolute -top-[34px] right-4 z-10 hidden sm:inline-flex"})]}),d&&c.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-4 px-2 text-[11px] text-faint",children:[c.jsx("span",{className:"hidden sm:inline",children:"Enter to send · Shift + Enter for a new line · / for commands"}),c.jsxs("span",{className:"flex items-center gap-1 sm:ml-auto",children:[c.jsx(kr,{size:11}),"Local daemon · keys encrypted at rest"]})]})]})}function yM(){return c.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M8 12.5V3.5M4.2 7.2L8 3.4l3.8 3.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function vM(e,i){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const wM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EM={};function N0(e,i){return(EM.jsx?kM:wM).test(e)}const NM=/[ \t\n\f\r]/g;function _M(e){return typeof e=="object"?e.type==="text"?_0(e.value):!1:_0(e)}function _0(e){return e.replace(NM,"")===""}class Po{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}Po.prototype.normal={};Po.prototype.property={};Po.prototype.space=void 0;function fk(e,i){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new Po(a,r,i)}function bh(e){return e.toLowerCase()}class Qn{constructor(i,a){this.attribute=a,this.property=i}}Qn.prototype.attribute="";Qn.prototype.booleanish=!1;Qn.prototype.boolean=!1;Qn.prototype.commaOrSpaceSeparated=!1;Qn.prototype.commaSeparated=!1;Qn.prototype.defined=!1;Qn.prototype.mustUseProperty=!1;Qn.prototype.number=!1;Qn.prototype.overloadedBoolean=!1;Qn.prototype.property="";Qn.prototype.spaceSeparated=!1;Qn.prototype.space=void 0;let SM=0;const Qe=rs(),rn=rs(),yh=rs(),be=rs(),zt=rs(),Wr=rs(),si=rs();function rs(){return 2**++SM}const vh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qe,booleanish:rn,commaOrSpaceSeparated:si,commaSeparated:Wr,number:be,overloadedBoolean:yh,spaceSeparated:zt},Symbol.toStringTag,{value:"Module"})),Nm=Object.keys(vh);class dg extends Qn{constructor(i,a,r,o){let u=-1;if(super(i,a),S0(this,"space",o),typeof r=="number")for(;++u<Nm.length;){const d=Nm[u];S0(this,Nm[u],(r&vh[d])===vh[d])}}}dg.prototype.defined=!0;function S0(e,i,a){a&&(e[i]=a)}function ml(e){const i={},a={};for(const[r,o]of Object.entries(e.properties)){const u=new dg(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),i[r]=u,a[bh(r)]=r,a[bh(u.attribute)]=r}return new Po(i,a,e.space)}const pk=ml({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:zt,ariaCurrent:null,ariaDescribedBy:zt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:zt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:zt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zt,ariaLevel:be,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:zt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:zt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:rn,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function mk(e,i){return i in e?e[i]:i}function hk(e,i){return mk(e,i.toLowerCase())}const TM=ml({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:zt,accessKey:zt,action:null,allow:null,allowFullScreen:Qe,allowPaymentRequest:Qe,allowUserMedia:Qe,alpha:Qe,alt:null,as:null,async:Qe,autoCapitalize:null,autoComplete:zt,autoFocus:Qe,autoPlay:Qe,blocking:zt,capture:null,charSet:null,checked:Qe,cite:null,className:zt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:rn,controls:Qe,controlsList:zt,coords:be|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qe,defer:Qe,dir:null,dirName:null,disabled:Qe,download:yh,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qe,formTarget:null,headers:zt,height:be,hidden:yh,high:be,href:null,hrefLang:null,htmlFor:zt,httpEquiv:zt,id:null,imageSizes:null,imageSrcSet:null,inert:Qe,inputMode:null,integrity:null,is:null,isMap:Qe,itemId:null,itemProp:zt,itemRef:zt,itemScope:Qe,itemType:zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Qe,muted:Qe,name:null,nonce:null,noModule:Qe,noValidate:Qe,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:Qe,optimum:be,pattern:null,ping:zt,placeholder:null,playsInline:Qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qe,referrerPolicy:null,rel:zt,required:Qe,reversed:Qe,rows:be,rowSpan:be,sandbox:zt,scope:null,scoped:Qe,seamless:Qe,selected:Qe,shadowRootClonable:Qe,shadowRootCustomElementRegistry:Qe,shadowRootDelegatesFocus:Qe,shadowRootMode:null,shadowRootSerializable:Qe,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Qe,useMap:null,value:rn,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qe,declare:Qe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Qe,noHref:Qe,noShade:Qe,noWrap:Qe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Qe,disablePictureInPicture:Qe,disableRemotePlayback:Qe,exportParts:Wr,part:zt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:hk}),CM=ml({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",maskType:"mask-type",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:si,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:zt,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:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:si,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,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:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:si,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:si,rev:si,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:si,requiredFeatures:si,requiredFonts:si,requiredFormats:si,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:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:si,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:si,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:si,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mk}),gk=ml({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),xk=ml({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hk}),bk=ml({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),AM={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"},jM=/[A-Z]/g,T0=/-[a-z]/g,OM=/^data[-\w.:]+$/i;function MM(e,i){const a=bh(i);let r=i,o=Qn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&OM.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(T0,DM);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!T0.test(u)){let d=u.replace(jM,RM);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}o=dg}return new o(r,i)}function RM(e){return"-"+e.toLowerCase()}function DM(e){return e.charAt(1).toUpperCase()}const zM=fk([pk,TM,gk,xk,bk],"html"),fg=fk([pk,CM,gk,xk,bk],"svg");function LM(e){return e.join(" ").trim()}var Qs={},_m,C0;function IM(){if(C0)return _m;C0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,h=`
|
|
248
|
+
`,g="/",x="*",b="",v="comment",y="declaration";function k(S,N){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];N=N||{};var M=1,j=1;function D(ce){var ae=ce.match(i);ae&&(M+=ae.length);var O=ce.lastIndexOf(h);j=~O?ce.length-O:j+ce.length}function P(){var ce={line:M,column:j};return function(ae){return ae.position=new L(ce),K(),ae}}function L(ce){this.start=ce,this.end={line:M,column:j},this.source=N.source}L.prototype.content=S;function T(ce){var ae=new Error(N.source+":"+M+":"+j+": "+ce);if(ae.reason=ce,ae.filename=N.source,ae.line=M,ae.column=j,ae.source=S,!N.silent)throw ae}function R(ce){var ae=ce.exec(S);if(ae){var O=ae[0];return D(O),S=S.slice(O.length),ae}}function K(){R(a)}function z(ce){var ae;for(ce=ce||[];ae=$();)ae!==!1&&ce.push(ae);return ce}function $(){var ce=P();if(!(g!=S.charAt(0)||x!=S.charAt(1))){for(var ae=2;b!=S.charAt(ae)&&(x!=S.charAt(ae)||g!=S.charAt(ae+1));)++ae;if(ae+=2,b===S.charAt(ae-1))return T("End of comment missing");var O=S.slice(2,ae-2);return j+=2,D(O),S=S.slice(ae),j+=2,ce({type:v,comment:O})}}function W(){var ce=P(),ae=R(r);if(ae){if($(),!R(o))return T("property missing ':'");var O=R(u),te=ce({type:y,property:_(ae[0].replace(e,b)),value:O?_(O[0].replace(e,b)):b});return R(d),te}}function de(){var ce=[];z(ce);for(var ae;ae=W();)ae!==!1&&(ce.push(ae),z(ce));return ce}return K(),de()}function _(S){return S?S.replace(p,b):b}return _m=k,_m}var A0;function UM(){if(A0)return Qs;A0=1;var e=Qs&&Qs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.default=a;const i=e(IM());function a(r,o){let u=null;if(!r||typeof r!="string")return u;const d=(0,i.default)(r),p=typeof o=="function";return d.forEach(h=>{if(h.type!=="declaration")return;const{property:g,value:x}=h;p?o(g,x,h):x&&(u=u||{},u[g]=x)}),u}return Qs}var mo={},j0;function BM(){if(j0)return mo;j0=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(g){return!g||a.test(g)||e.test(g)},d=function(g,x){return x.toUpperCase()},p=function(g,x){return"".concat(x,"-")},h=function(g,x){return x===void 0&&(x={}),u(g)?g:(g=g.toLowerCase(),x.reactCompat?g=g.replace(o,p):g=g.replace(r,p),g.replace(i,d))};return mo.camelCase=h,mo}var ho,O0;function $M(){if(O0)return ho;O0=1;var e=ho&&ho.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},i=e(UM()),a=BM();function r(o,u){var d={};return!o||typeof o!="string"||(0,i.default)(o,function(p,h){p&&h&&(d[(0,a.camelCase)(p,u)]=h)}),d}return r.default=r,ho=r,ho}var HM=$M();const PM=ad(HM),yk=vk("end"),pg=vk("start");function vk(e){return i;function i(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function FM(e){const i=pg(e),a=yk(e);if(i&&a)return{start:i,end:a}}function _o(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?M0(e.position):"start"in e||"end"in e?M0(e):"line"in e||"column"in e?wh(e):""}function wh(e){return R0(e&&e.line)+":"+R0(e&&e.column)}function M0(e){return wh(e&&e.start)+"-"+wh(e&&e.end)}function R0(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",u={},d=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof i=="string"?o=i:!u.cause&&i&&(d=!0,o=i.message,u.cause=i),!u.ruleId&&!u.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?u.ruleId=r:(u.source=r.slice(0,h),u.ruleId=r.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const p=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=p?p.line:void 0,this.name=_o(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const mg={}.hasOwnProperty,qM=new Map,GM=/[A-Z]/g,YM=new Set(["table","tbody","thead","tfoot","tr"]),KM=new Set(["td","th"]),wk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VM(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=n5(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=t5(a,i.jsx,i.jsxs)}const o={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?fg:zM,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},u=kk(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function kk(e,i,a){if(i.type==="element")return XM(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return ZM(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return JM(e,i,a);if(i.type==="mdxjsEsm")return QM(e,i);if(i.type==="root")return WM(e,i,a);if(i.type==="text")return e5(e,i)}function XM(e,i,a){const r=e.schema;let o=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=fg,e.schema=o),e.ancestors.push(i);const u=Nk(e,i.tagName,!1),d=i5(e,i);let p=gg(e,i);return YM.has(i.tagName)&&(p=p.filter(function(h){return typeof h=="string"?!_M(h):!0})),Ek(e,d,u,i),hg(d,p),e.ancestors.pop(),e.schema=r,e.create(i,u,d,a)}function ZM(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ro(e,i.position)}function QM(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Ro(e,i.position)}function JM(e,i,a){const r=e.schema;let o=r;i.name==="svg"&&r.space==="html"&&(o=fg,e.schema=o),e.ancestors.push(i);const u=i.name===null?e.Fragment:Nk(e,i.name,!0),d=a5(e,i),p=gg(e,i);return Ek(e,d,u,i),hg(d,p),e.ancestors.pop(),e.schema=r,e.create(i,u,d,a)}function WM(e,i,a){const r={};return hg(r,gg(e,i)),e.create(i,e.Fragment,r,a)}function e5(e,i){return i.value}function Ek(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function hg(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function t5(e,i,a){return r;function r(o,u,d,p){const g=Array.isArray(d.children)?a:i;return p?g(u,d,p):g(u,d)}}function n5(e,i){return a;function a(r,o,u,d){const p=Array.isArray(u.children),h=pg(r);return i(o,u,d,p,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function i5(e,i){const a={};let r,o;for(o in i.properties)if(o!=="children"&&mg.call(i.properties,o)){const u=r5(e,o,i.properties[o]);if(u){const[d,p]=u;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&KM.has(i.tagName)?r=p:a[d]=p}}if(r){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function a5(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const u=r.data.estree.body[0];u.type;const d=u.expression;d.type;const p=d.properties[0];p.type,Object.assign(a,e.evaluater.evaluateExpression(p.argument))}else Ro(e,i.position);else{const o=r.name;let u;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,u=e.evaluater.evaluateExpression(p.expression)}else Ro(e,i.position);else u=r.value===null?!0:r.value;a[o]=u}return a}function gg(e,i){const a=[];let r=-1;const o=e.passKeys?new Map:qM;for(;++r<i.children.length;){const u=i.children[r];let d;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const g=o.get(h)||0;d=h+"-"+g,o.set(h,g+1)}}const p=kk(e,u,d);p!==void 0&&a.push(p)}return a}function r5(e,i,a){const r=MM(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?vM(a):LM(a)),r.property==="style"){let o=typeof a=="object"?a:s5(e,String(a));return e.stylePropertyNameCase==="css"&&(o=l5(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?AM[r.property]||r.property:r.attribute,a]}}function s5(e,i){try{return PM(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=wk+"#cannot-parse-style-attribute",o}}function Nk(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const o=i.split(".");let u=-1,d;for(;++u<o.length;){const p=N0(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(u&&p.type==="Literal"),optional:!1}:p}r=d}else r=N0(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const o=r.value;return mg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ro(e)}function Ro(e,i){const a=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=wk+"#cannot-handle-mdx-estrees-without-createevaluater",a}function l5(e){const i={};let a;for(a in e)mg.call(e,a)&&(i[o5(a)]=e[a]);return i}function o5(e){let i=e.replace(GM,c5);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function c5(e){return"-"+e.toLowerCase()}const Sm={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"]},u5={};function xg(e,i){const a=u5,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return _k(e,r,o)}function _k(e,i,a){if(d5(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return D0(e.children,i,a)}return Array.isArray(e)?D0(e,i,a):""}function D0(e,i,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=_k(e[o],i,a);return r.join("")}function d5(e){return!!(e&&typeof e=="object")}const z0=document.createElement("i");function bg(e){const i="&"+e+";";z0.innerHTML=i;const a=z0.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Li(e,i,a,r){const o=e.length;let u=0,d;if(i<0?i=-i>o?0:o+i:i=i>o?o:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);u<r.length;)d=r.slice(u,u+1e4),d.unshift(i,0),e.splice(...d),u+=1e4,i+=1e4}function yi(e,i){return e.length>0?(Li(e,e.length,0,i),e):i}const L0={}.hasOwnProperty;function Sk(e){const i={};let a=-1;for(;++a<e.length;)f5(i,e[a]);return i}function f5(e,i){let a;for(a in i){const o=(L0.call(e,a)?e[a]:void 0)||(e[a]={}),u=i[a];let d;if(u)for(d in u){L0.call(o,d)||(o[d]=[]);const p=u[d];p5(o[d],Array.isArray(p)?p:p?[p]:[])}}}function p5(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Li(e,0,0,r)}function Tk(e,i){const a=Number.parseInt(e,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ii(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Hn=_r(/[A-Za-z]/),Mn=_r(/[\dA-Za-z]/),m5=_r(/[#-'*+\--9=?A-Z^-~]/);function Zu(e){return e!==null&&(e<32||e===127)}const kh=_r(/\d/),h5=_r(/[\dA-Fa-f]/),g5=_r(/[!-/:-@[-`{-~]/);function Pe(e){return e!==null&&e<-2}function Lt(e){return e!==null&&(e<0||e===32)}function at(e){return e===-2||e===-1||e===32}const Nd=_r(/\p{P}|\p{S}/u),ns=_r(/\s/);function _r(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function hl(e){const i=[];let a=-1,r=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&Mn(e.charCodeAt(a+1))&&Mn(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const p=e.charCodeAt(a+1);u<56320&&p>56319&&p<57344?(d=String.fromCharCode(u,p),o=1):d="�"}else d=String.fromCharCode(u);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+o+1,d=""),o&&(a+=o,o=0)}return i.join("")+e.slice(r)}function bt(e,i,a,r){const o=r?r-1:1/0;let u=0;return d;function d(h){return at(h)?(e.enter(a),p(h)):i(h)}function p(h){return at(h)&&u++<o?(e.consume(h),p):(e.exit(a),i(h))}}function Ck(e,i,a,r,o,u){let d=0;return p;function p(x){return at(x)?(e.enter(r),h(x)):g(x)}function h(x){return at(x)&&d<u?(e.consume(x),d++,h):(e.exit(r),g(x))}function g(x){return d>=o?i(x):a(x)}}const x5={tokenize:b5};function b5(e){const i=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),bt(e,i,"linePrefix")}function o(p){return e.enter("paragraph"),u(p)}function u(p){const h=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=h),a=h,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Pe(p)?(e.consume(p),e.exit("chunkText"),u):(e.consume(p),d)}}let Qu=class{constructor(){this.index=new Map,this.map=[]}add(i,a,r){I0(this,i,a,r,!1)}addBefore(i,a,r){I0(this,i,a,r,!0)}consume(i){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let o=r.pop();for(;o;){for(const u of o)i.push(u);o=r.pop()}this.map.length=0,this.index.clear()}};function I0(e,i,a,r,o){if(a===0&&r.length===0)return;const u=e.index.get(i);if(u){u[1]+=a,o?(r.push(...u[2]),u[2]=r):u[2].push(...r);return}const d=[i,a,r];e.map.push(d),e.index.set(i,d)}const y5={tokenize:v5},U0={tokenize:w5};function v5(e){const i=this,a=[];let r=0,o,u,d;return p;function p(j){if(r<a.length){const D=a[r];return i.containerState=D[1],e.attempt(D[0].continuation,h,g)(j)}return g(j)}function h(j){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&M();const D=i.events.length;let P=D,L;for(;P--;)if(i.events[P][0]==="exit"&&i.events[P][1].type==="chunkFlow"){L=i.events[P][1].end;break}N(r);let T=D;for(;T<i.events.length;)i.events[T][1].end={...L},T++;const R=new Qu;return R.add(P+1,0,i.events.slice(D)),R.add(D,T-D,[]),R.consume(i.events),g(j)}return p(j)}function g(j){if(r===a.length){if(!o)return v(j);if(o.currentConstruct&&o.currentConstruct.concrete)return k(j);i.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(U0,x,b)(j)}function x(j){return o&&M(),N(r),v(j)}function b(j){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,k(j)}function v(j){return i.containerState={},e.attempt(U0,y,k)(j)}function y(j){return r++,a.push([i.currentConstruct,i.containerState]),v(j)}function k(j){if(j===null){o&&M(),N(0),e.consume(j);return}return o=o||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),_(j)}function _(j){if(j===null){S(e.exit("chunkFlow"),!0),N(0),e.consume(j);return}return Pe(j)?(e.consume(j),S(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(j),_)}function S(j,D){const P=i.sliceStream(j);if(D&&P.push(null),j.previous=u,u&&(u.next=j),u=j,o.defineSkip(j.start),o.write(P),i.parser.lazy[j.start.line]){let L=o.events.length;for(;L--;)if(o.events[L][1].start.offset<d&&(!o.events[L][1].end||o.events[L][1].end.offset>d))return;const T=i.events.length;let R=T,K,z;for(;R--;)if(i.events[R][0]==="exit"&&i.events[R][1].type==="chunkFlow"){if(K){z=i.events[R][1].end;break}K=!0}for(N(r),L=T;L<i.events.length;)i.events[L][1].end={...z},L++;const $=new Qu;$.add(R+1,0,i.events.slice(T)),$.add(T,L-T,[]),$.consume(i.events)}}function N(j){let D=a.length;for(;D-- >j;){const P=a[D];i.containerState=P[1],P[0].exit.call(i,e)}a.length=j}function M(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function w5(e,i,a){return bt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ju(e){if(e===null||Lt(e)||ns(e))return 1;if(Nd(e))return 2}function _d(e,i,a){const r=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!r.includes(u)&&(i=u(i,a),r.push(u))}return i}const Eh={name:"attention",resolveAll:k5,tokenize:E5};function k5(e,i){let a=-1,r;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){let o=a;for(;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&i.sliceSerialize(e[o][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[o][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;const u=e[o][1].end.offset-e[o][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1,d={...e[o][1].end},p={...e[a][1].start};B0(d,-u),B0(p,u);const h={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[o][1].end}},g={type:u>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},x={type:u>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[a][1].start}},b={type:u>1?"strong":"emphasis",start:{...h.start},end:{...g.end}};e[o][1].end={...h.start},e[a][1].start={...g.end},r=[],e[o][1].end.offset-e[o][1].start.offset&&(r=yi(r,[["enter",e[o][1],i],["exit",e[o][1],i]])),r=yi(r,[["enter",b,i],["enter",h,i],["exit",h,i],["enter",x,i]]),r=yi(r,_d(i.parser.constructs.insideSpan.null,e.slice(o+1,a),i)),r=yi(r,[["exit",x,i],["enter",g,i],["exit",g,i],["exit",b,i]]);let v=0;e[a][1].end.offset-e[a][1].start.offset&&(v=2,r=yi(r,[["enter",e[a][1],i],["exit",e[a][1],i]])),Li(e,o-1,a-o+3,r),a=o+r.length-v-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function E5(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Ju(r);let u;return d;function d(h){return u=h,e.enter("attentionSequence"),p(h)}function p(h){if(h===u)return e.consume(h),p;const g=e.exit("attentionSequence"),x=Ju(h),b=!x||x===2&&o||a.includes(h)&&h!==42&&h!==95,v=!o||o===2&&x||a.includes(r)&&r!==42&&r!==95;return g._open=!!(u===42?b:b&&(o||!v)),g._close=!!(u===42?v:v&&(x||!b)),i(h)}}function B0(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const N5={name:"autolink",tokenize:_5};function _5(e,i,a){let r=0;return o;function o(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(y){return Hn(y)?(e.consume(y),d):y===64?a(y):g(y)}function d(y){return y===43||y===45||y===46||Mn(y)?(r=1,p(y)):g(y)}function p(y){return y===58?(e.consume(y),r=0,h):(y===43||y===45||y===46||Mn(y))&&r++<32?(e.consume(y),p):(r=0,g(y))}function h(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),i):y===null||y===32||y===60||Zu(y)?a(y):(e.consume(y),h)}function g(y){return y===64?(e.consume(y),x):m5(y)?(e.consume(y),g):a(y)}function x(y){return Mn(y)?b(y):a(y)}function b(y){return y===46?(e.consume(y),r=0,x):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),i):v(y)}function v(y){if((y===45||Mn(y))&&r++<63){const k=y===45?v:b;return e.consume(y),k}return a(y)}}const Fo={partial:!0,tokenize:S5};function S5(e,i,a){return r;function r(u){return at(u)?bt(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Pe(u)?i(u):a(u)}}const Ak={continuation:{tokenize:C5},exit:A5,name:"blockQuote",tokenize:T5};function T5(e,i,a){const r=this;return o;function o(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return a(d)}function u(d){return at(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function C5(e,i,a){const r=this;return o;function o(d){return at(d)?bt(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Ak,i,a)(d)}}function A5(e){e.exit("blockQuote")}const jk={name:"characterEscape",tokenize:j5};function j5(e,i,a){return r;function r(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return g5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(u)}}const Ok={name:"characterReference",tokenize:O5};function O5(e,i,a){const r=this;let o=0,u,d;return p;function p(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),h}function h(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),g):(e.enter("characterReferenceValue"),u=31,d=Mn,x(b))}function g(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=h5,x):(e.enter("characterReferenceValue"),u=7,d=kh,x(b))}function x(b){if(b===59&&o){const v=e.exit("characterReferenceValue");return d===Mn&&!bg(r.sliceSerialize(v))?a(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(b)&&o++<u?(e.consume(b),x):a(b)}}const Nh={partial:!0,tokenize:M5};function M5(e,i,a){const r=this;return o;function o(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const $0={concrete:!0,name:"codeFenced",tokenize:R5};function R5(e,i,a){const r=this,o={partial:!0,tokenize:P};let u=0,d=0,p;return h;function h(L){return g(L)}function g(L){const T=r.events[r.events.length-1];return u=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,p=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(L)}function x(L){return L===p?(d++,e.consume(L),x):d<3?a(L):(e.exit("codeFencedFenceSequence"),at(L)?bt(e,b,"whitespace")(L):b(L))}function b(L){return L===null||Pe(L)?(e.exit("codeFencedFence"),r.interrupt?i(L):e.check(Nh,_,D)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(L))}function v(L){return L===null||Pe(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(L)):at(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),bt(e,y,"whitespace")(L)):L===96&&L===p?a(L):(e.consume(L),v)}function y(L){return L===null||Pe(L)?b(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(L))}function k(L){return L===null||Pe(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(L)):L===96&&L===p?a(L):(e.consume(L),k)}function _(L){return e.attempt(o,D,S)(L)}function S(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),N}function N(L){return u>0&&at(L)?bt(e,M,"linePrefix",u+1)(L):M(L)}function M(L){return L===null||Pe(L)?e.check(Nh,_,D)(L):(e.enter("codeFlowValue"),j(L))}function j(L){return L===null||Pe(L)?(e.exit("codeFlowValue"),M(L)):(e.consume(L),j)}function D(L){return e.exit("codeFenced"),i(L)}function P(L,T,R){let K=0;return z;function z(ae){return L.enter("lineEnding"),L.consume(ae),L.exit("lineEnding"),$}function $(ae){return L.enter("codeFencedFence"),at(ae)?bt(L,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):W(ae)}function W(ae){return ae===p?(L.enter("codeFencedFenceSequence"),de(ae)):R(ae)}function de(ae){return ae===p?(K++,L.consume(ae),de):K>=d?(L.exit("codeFencedFenceSequence"),at(ae)?bt(L,ce,"whitespace")(ae):ce(ae)):R(ae)}function ce(ae){return ae===null||Pe(ae)?(L.exit("codeFencedFence"),T(ae)):R(ae)}}}const Tm={name:"codeIndented",tokenize:z5},D5={partial:!0,tokenize:L5};function z5(e,i,a){return r;function r(p){return e.enter("codeIndented"),Ck(e,o,a,"linePrefix",4,4)(p)}function o(p){return p===null?d(p):Pe(p)?e.attempt(D5,o,d)(p):(e.enter("codeFlowValue"),u(p))}function u(p){return p===null||Pe(p)?(e.exit("codeFlowValue"),o(p)):(e.consume(p),u)}function d(p){return e.exit("codeIndented"),i(p)}}function L5(e,i,a){const r=this;return o;function o(d){return r.parser.lazy[r.now().line]?a(d):Pe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):Ck(e,i,u,"linePrefix",4,4)(d)}function u(d){return Pe(d)?o(d):a(d)}}const I5={name:"codeText",previous:B5,resolve:U5,tokenize:$5};function U5(e){let i=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)o===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(o=r):(r===i||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),i-=r-o-2,r=o+2),o=void 0);return e}function B5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $5(e,i,a){let r=0,o,u;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),p(b)}function p(b){return b===96?(e.consume(b),r++,p):(e.exit("codeTextSequence"),h(b))}function h(b){return b===null?a(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),h):b===96?(u=e.enter("codeTextSequence"),o=0,x(b)):Pe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):(e.enter("codeTextData"),g(b))}function g(b){return b===null||b===32||b===96||Pe(b)?(e.exit("codeTextData"),h(b)):(e.consume(b),g)}function x(b){return b===96?(e.consume(b),o++,x):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(b)):(u.type="codeTextData",g(b))}}class H5{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const o=a||0;this.setCursor(Math.trunc(i));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&go(this.left,r),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),go(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),go(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);go(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);go(this.left,a.reverse())}}}function go(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function Mk(e){const i={};let a=-1,r,o,u,d,p,h,g;const x=new H5(e);for(;++a<x.length;){for(;a in i;)a=i[a];if(r=x.get(a),a&&r[1].type==="chunkFlow"&&x.get(a-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,P5(x,a)),a=i[a],g=!0);else if(r[1]._container){for(u=a,o=void 0;u--;)if(d=x.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(x.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(r[1].end={...x.get(o)[1].start},p=x.slice(o,a),p.unshift(r),x.splice(o,a-o+1,p))}}return Li(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!g}function P5(e,i){const a=e.get(i)[1],r=e.get(i)[2];let o=i-1;const u=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,h=[],g={};let x,b,v=-1,y=a,k=0,_=0;const S=[_];for(;y;){for(;e.get(++o)[1]!==y;);u.push(o),y._tokenizer||(x=r.sliceStream(y),y.next||x.push(null),b&&d.defineSkip(y.start),y._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(x),y._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=y,y=y.next}for(y=a;++v<p.length;)p[v][0]==="exit"&&p[v-1][0]==="enter"&&p[v][1].type===p[v-1][1].type&&p[v][1].start.line!==p[v][1].end.line&&(_=v+1,S.push(_),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(d.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),v=S.length;v--;){const N=p.slice(S[v],S[v+1]),M=u.pop();h.push([M,M+N.length-1]),e.splice(M,2,N)}for(h.reverse(),v=-1;++v<h.length;)g[k+h[v][0]]=k+h[v][1],k+=h[v][1]-h[v][0]-1;return g}const F5={resolve:G5,tokenize:Y5},q5={partial:!0,tokenize:K5};function G5(e){return Mk(e),e}function Y5(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(p)}function o(p){return p===null?u(p):Pe(p)?e.check(q5,d,u)(p):(e.consume(p),o)}function u(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function K5(e,i,a){const r=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),bt(e,u,"linePrefix")}function u(d){if(d===null||Pe(d))return a(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function Rk(e,i,a,r,o,u,d,p,h){const g=h||Number.POSITIVE_INFINITY;let x=0;return b;function b(N){return N===60?(e.enter(r),e.enter(o),e.enter(u),e.consume(N),e.exit(u),v):N===null||N===32||N===41||Zu(N)?a(N):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),_(N))}function v(N){return N===62?(e.enter(u),e.consume(N),e.exit(u),e.exit(o),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===62?(e.exit("chunkString"),e.exit(p),v(N)):N===null||N===60||Pe(N)?a(N):(e.consume(N),N===92?k:y)}function k(N){return N===60||N===62||N===92?(e.consume(N),y):y(N)}function _(N){return!x&&(N===null||N===41||Lt(N))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(N)):x<g&&N===40?(e.consume(N),x++,_):N===41?(e.consume(N),x--,_):N===null||N===32||N===40||Zu(N)?a(N):(e.consume(N),N===92?S:_)}function S(N){return N===40||N===41||N===92?(e.consume(N),_):_(N)}}function Dk(e,i,a,r,o,u){const d=this;let p=0,h;return g;function g(y){return e.enter(r),e.enter(o),e.consume(y),e.exit(o),e.enter(u),x}function x(y){return p>999||y===null||y===91||y===93&&!h||y===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(y):y===93?(e.exit(u),e.enter(o),e.consume(y),e.exit(o),e.exit(r),i):Pe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===null||y===91||y===93||Pe(y)||p++>999?(e.exit("chunkString"),x(y)):(e.consume(y),h||(h=!at(y)),y===92?v:b)}function v(y){return y===91||y===92||y===93?(e.consume(y),p++,b):b(y)}}function zk(e,i,a,r,o,u){let d;return p;function p(v){return v===34||v===39||v===40?(e.enter(r),e.enter(o),e.consume(v),e.exit(o),d=v===40?41:v,h):a(v)}function h(v){return v===d?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),i):(e.enter(u),g(v))}function g(v){return v===d?(e.exit(u),h(d)):v===null?a(v):Pe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),bt(e,g,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===d||v===null||Pe(v)?(e.exit("chunkString"),g(v)):(e.consume(v),v===92?b:x)}function b(v){return v===d||v===92?(e.consume(v),x):x(v)}}function So(e,i){let a;return r;function r(o){return Pe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):at(o)?bt(e,r,a?"linePrefix":"lineSuffix")(o):i(o)}}const V5={name:"definition",tokenize:Z5},X5={partial:!0,tokenize:Q5};function Z5(e,i,a){const r=this;let o;return u;function u(y){return e.enter("definition"),d(y)}function d(y){return Dk.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function p(y){return o=Ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),h):a(y)}function h(y){return Lt(y)?So(e,g)(y):g(y)}function g(y){return Rk(e,x,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function x(y){return e.attempt(X5,b,b)(y)}function b(y){return at(y)?bt(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Pe(y)?(e.exit("definition"),r.parser.defined.push(o),i(y)):a(y)}}function Q5(e,i,a){return r;function r(p){return Lt(p)?So(e,o)(p):a(p)}function o(p){return zk(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function u(p){return at(p)?bt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Pe(p)?i(p):a(p)}}const J5={name:"hardBreakEscape",tokenize:W5};function W5(e,i,a){return r;function r(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Pe(u)?(e.exit("hardBreakEscape"),i(u)):a(u)}}const eR={name:"headingAtx",resolve:tR,tokenize:nR};function tR(e,i){let a=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r){const o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},u={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"};Li(e,r,a-r+1,[["enter",o,i],["enter",u,i],["exit",u,i],["exit",o,i]])}return e}function nR(e,i,a){let r=0;return o;function o(x){return e.enter("atxHeading"),u(x)}function u(x){return e.enter("atxHeadingSequence"),d(x)}function d(x){return x===35&&r++<6?(e.consume(x),d):x===null||Lt(x)?(e.exit("atxHeadingSequence"),p(x)):a(x)}function p(x){return x===35?(e.enter("atxHeadingSequence"),h(x)):x===null||Pe(x)?(e.exit("atxHeading"),i(x)):at(x)?bt(e,p,"whitespace")(x):(e.enter("atxHeadingText"),g(x))}function h(x){return x===35?(e.consume(x),h):(e.exit("atxHeadingSequence"),p(x))}function g(x){return x===null||x===35||Lt(x)?(e.exit("atxHeadingText"),p(x)):(e.consume(x),g)}}const iR=["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"],H0=["pre","script","style","textarea"],aR={concrete:!0,name:"htmlFlow",resolveTo:sR,tokenize:lR},rR={partial:!0,tokenize:oR};function sR(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function lR(e,i,a){const r=this;let o,u,d,p,h;return g;function g(C){return x(C)}function x(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),b}function b(C){return C===33?(e.consume(C),v):C===47?(e.consume(C),u=!0,_):C===63?(e.consume(C),o=3,r.interrupt?i:A):Hn(C)?(e.consume(C),d=String.fromCharCode(C),S):a(C)}function v(C){return C===45?(e.consume(C),o=2,y):C===91?(e.consume(C),o=5,p=0,k):Hn(C)?(e.consume(C),o=4,r.interrupt?i:A):a(C)}function y(C){return C===45?(e.consume(C),r.interrupt?i:A):a(C)}function k(C){const I="CDATA[";return C===I.charCodeAt(p++)?(e.consume(C),p===I.length?r.interrupt?i:W:k):a(C)}function _(C){return Hn(C)?(e.consume(C),d=String.fromCharCode(C),S):a(C)}function S(C){if(C===null||C===47||C===62||Lt(C)){const I=C===47,se=d.toLowerCase();return!I&&!u&&H0.includes(se)?(o=1,r.interrupt?i(C):W(C)):iR.includes(d.toLowerCase())?(o=6,I?(e.consume(C),N):r.interrupt?i(C):W(C)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):u?M(C):j(C))}return C===45||Mn(C)?(e.consume(C),d+=String.fromCharCode(C),S):a(C)}function N(C){return C===62?(e.consume(C),r.interrupt?i:W):a(C)}function M(C){return at(C)?(e.consume(C),M):z(C)}function j(C){return C===47?(e.consume(C),z):C===58||C===95||Hn(C)?(e.consume(C),D):at(C)?(e.consume(C),j):z(C)}function D(C){return C===45||C===46||C===58||C===95||Mn(C)?(e.consume(C),D):P(C)}function P(C){return C===61?(e.consume(C),L):at(C)?(e.consume(C),P):j(C)}function L(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),h=C,T):at(C)?(e.consume(C),L):R(C)}function T(C){return C===h?(e.consume(C),h=null,K):C===null||Pe(C)?a(C):(e.consume(C),T)}function R(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Lt(C)?P(C):(e.consume(C),R)}function K(C){return C===47||C===62||at(C)?j(C):a(C)}function z(C){return C===62?(e.consume(C),$):a(C)}function $(C){return C===null||Pe(C)?W(C):at(C)?(e.consume(C),$):a(C)}function W(C){return C===45&&o===2?(e.consume(C),O):C===60&&o===1?(e.consume(C),te):C===62&&o===4?(e.consume(C),Se):C===63&&o===3?(e.consume(C),A):C===93&&o===5?(e.consume(C),G):Pe(C)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(rR,pe,de)(C)):C===null||Pe(C)?(e.exit("htmlFlowData"),de(C)):(e.consume(C),W)}function de(C){return e.check(Nh,ce,pe)(C)}function ce(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ae}function ae(C){return C===null||Pe(C)?de(C):(e.enter("htmlFlowData"),W(C))}function O(C){return C===45?(e.consume(C),A):W(C)}function te(C){return C===47?(e.consume(C),d="",ne):W(C)}function ne(C){if(C===62){const I=d.toLowerCase();return H0.includes(I)?(e.consume(C),Se):W(C)}return Hn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),ne):W(C)}function G(C){return C===93?(e.consume(C),A):W(C)}function A(C){return C===62?(e.consume(C),Se):C===45&&o===2?(e.consume(C),A):W(C)}function Se(C){return C===null||Pe(C)?(e.exit("htmlFlowData"),pe(C)):(e.consume(C),Se)}function pe(C){return e.exit("htmlFlow"),i(C)}}function oR(e,i,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Fo,i,a)}}const cR={name:"htmlText",tokenize:uR};function uR(e,i,a){const r=this;let o,u,d;return p;function p(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),g):A===47?(e.consume(A),P):A===63?(e.consume(A),j):Hn(A)?(e.consume(A),R):a(A)}function g(A){return A===45?(e.consume(A),x):A===91?(e.consume(A),u=0,k):Hn(A)?(e.consume(A),M):a(A)}function x(A){return A===45?(e.consume(A),y):a(A)}function b(A){return A===null?a(A):A===45?(e.consume(A),v):Pe(A)?(d=b,te(A)):(e.consume(A),b)}function v(A){return A===45?(e.consume(A),y):b(A)}function y(A){return A===62?O(A):A===45?v(A):b(A)}function k(A){const Se="CDATA[";return A===Se.charCodeAt(u++)?(e.consume(A),u===Se.length?_:k):a(A)}function _(A){return A===null?a(A):A===93?(e.consume(A),S):Pe(A)?(d=_,te(A)):(e.consume(A),_)}function S(A){return A===93?(e.consume(A),N):_(A)}function N(A){return A===62?O(A):A===93?(e.consume(A),N):_(A)}function M(A){return A===null||A===62?O(A):Pe(A)?(d=M,te(A)):(e.consume(A),M)}function j(A){return A===null?a(A):A===63?(e.consume(A),D):Pe(A)?(d=j,te(A)):(e.consume(A),j)}function D(A){return A===62?O(A):j(A)}function P(A){return Hn(A)?(e.consume(A),L):a(A)}function L(A){return A===45||Mn(A)?(e.consume(A),L):T(A)}function T(A){return Pe(A)?(d=T,te(A)):at(A)?(e.consume(A),T):O(A)}function R(A){return A===45||Mn(A)?(e.consume(A),R):A===47||A===62||Lt(A)?K(A):a(A)}function K(A){return A===47?(e.consume(A),O):A===58||A===95||Hn(A)?(e.consume(A),z):Pe(A)?(d=K,te(A)):at(A)?(e.consume(A),K):O(A)}function z(A){return A===45||A===46||A===58||A===95||Mn(A)?(e.consume(A),z):$(A)}function $(A){return A===61?(e.consume(A),W):Pe(A)?(d=$,te(A)):at(A)?(e.consume(A),$):K(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?a(A):A===34||A===39?(e.consume(A),o=A,de):Pe(A)?(d=W,te(A)):at(A)?(e.consume(A),W):(e.consume(A),ce)}function de(A){return A===o?(e.consume(A),o=void 0,ae):A===null?a(A):Pe(A)?(d=de,te(A)):(e.consume(A),de)}function ce(A){return A===null||A===34||A===39||A===60||A===61||A===96?a(A):A===47||A===62||Lt(A)?K(A):(e.consume(A),ce)}function ae(A){return A===47||A===62||Lt(A)?K(A):a(A)}function O(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),i):a(A)}function te(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),ne}function ne(A){return at(A)?bt(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):G(A)}function G(A){return e.enter("htmlTextData"),d(A)}}const yg={name:"labelEnd",resolveAll:mR,resolveTo:hR,tokenize:gR},dR={tokenize:xR},fR={tokenize:bR},pR={tokenize:yR};function mR(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",i+=o}}return e.length!==a.length&&Li(e,0,e.length,a),e}function hR(e,i){let a=e.length,r=0,o,u,d;for(;a--;){const x=e[a][1];if(o){if(x.type==="link"||x.type==="labelLink"&&x._inactive)break;e[a][0]==="enter"&&x.type==="labelLink"&&(x._inactive=!0)}else if(u){if(e[a][0]==="enter"&&(x.type==="labelImage"||x.type==="labelLink")&&!x._balanced&&(o=a,x.type!=="labelLink")){r=2;break}}else x.type==="labelEnd"&&(u=a)}const p={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",p,i],["enter",h,i]],d=yi(d,e.slice(o+1,o+r+3)),d=yi(d,[["enter",g,i]]),d=yi(d,_d(i.parser.constructs.insideSpan.null,e.slice(o+r+4,u-3),i)),d=yi(d,[["exit",g,i],e[u-2],e[u-1],["exit",h,i]]),d=yi(d,e.slice(u+1)),d=yi(d,[["exit",p,i]]),Li(e,o,e.length,d),e}function gR(e,i,a){const r=this,o=r._labelStarts;let u,d;if(o){for(;o.length>0&&o[o.length-1]._balanced;)o.pop();u=o[o.length-1]}return p;function p(v){return u?u._inactive?b(v):(d=r.parser.defined.includes(Ii(r.sliceSerialize({start:u.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):a(v)}function h(v){return v===40?e.attempt(dR,x,d?x:b)(v):v===91?e.attempt(fR,x,d?g:b)(v):d?x(v):b(v)}function g(v){return e.attempt(pR,x,b)(v)}function x(v){return o.pop(),i(v)}function b(v){return u._balanced=!0,a(v)}}function xR(e,i,a){return r;function r(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),o}function o(b){return Lt(b)?So(e,u)(b):u(b)}function u(b){return b===41?x(b):Rk(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return Lt(b)?So(e,h)(b):x(b)}function p(b){return a(b)}function h(b){return b===34||b===39||b===40?zk(e,g,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):x(b)}function g(b){return Lt(b)?So(e,x)(b):x(b)}function x(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),i):a(b)}}function bR(e,i,a){const r=this;return o;function o(p){return Dk.call(r,e,u,d,"reference","referenceMarker","referenceString")(p)}function u(p){return r.parser.defined.includes(Ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function yR(e,i,a){return r;function r(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),i):a(u)}}const vR={name:"labelStartImage",resolveAll:yg.resolveAll,tokenize:wR};function wR(e,i,a){const r=this;let o;return u;function u(h){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(h),e.exit("labelImageMarker"),d}function d(h){return h===91?(e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),o=e.exit("labelImage"),p):a(h)}function p(h){return h===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(h):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(o),i(h))}}const kR={name:"labelStartLink",resolveAll:yg.resolveAll,tokenize:ER};function ER(e,i,a){const r=this;let o;return u;function u(p){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),o=e.exit("labelLink"),d}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(o),i(p))}}const Cm={name:"lineEnding",tokenize:NR};function NR(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),bt(e,i,"linePrefix")}}const zu={name:"thematicBreak",tokenize:_R};function _R(e,i,a){let r=0,o;return u;function u(g){return e.enter("thematicBreak"),d(g)}function d(g){return o=g,p(g)}function p(g){return g===o?(e.enter("thematicBreakSequence"),h(g)):r>=3&&(g===null||Pe(g))?(e.exit("thematicBreak"),i(g)):a(g)}function h(g){return g===o?(e.consume(g),r++,h):(e.exit("thematicBreakSequence"),at(g)?bt(e,p,"whitespace")(g):p(g))}}const Zn={continuation:{tokenize:AR},exit:OR,name:"list",tokenize:CR},SR={partial:!0,tokenize:MR},TR={partial:!0,tokenize:jR};function CR(e,i,a){const r=this,o=r.events[r.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return p;function p(y){const k=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:kh(y)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(zu,a,g)(y):g(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(y)}return a(y)}function h(y){return kh(y)&&++d<10?(e.consume(y),h):(!r.interrupt||d<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),g(y)):a(y)}function g(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Fo,r.interrupt?a:x,e.attempt(SR,v,b))}function x(y){return r.containerState.initialBlankLine=!0,u++,v(y)}function b(y){return at(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):a(y)}function v(y){return r.containerState.size=u+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(y)}}function AR(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Fo,o,u);function o(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,bt(e,i,"listItemIndent",r.containerState.size+1)(p)}function u(p){return r.containerState.furtherBlankLines||!at(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TR,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,bt(e,e.attempt(Zn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function jR(e,i,a){const r=this;return bt(e,o,"listItemIndent",r.containerState.size+1);function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(u):a(u)}}function OR(e){e.exit(this.containerState.type)}function MR(e,i,a){const r=this;return bt(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=r.events[r.events.length-1];return!at(u)&&d&&d[1].type==="listItemPrefixWhitespace"?i(u):a(u)}}const P0={name:"setextUnderline",resolveTo:RR,tokenize:DR};function RR(e,i){const a=new Qu;let r=e.length,o,u,d;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){o=r;break}e[r][1].type==="paragraph"&&(u=r)}else e[r][1].type==="content"&&a.add(r,1,[]),!d&&e[r][1].type==="definition"&&(d=r);const p={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",d?(a.add(u,0,[["enter",p,i]]),a.add(d+1,0,[["exit",e[o][1],i]]),e[o][1].end={...e[d][1].end}):e[o][1]=p,a.add(e.length,0,[["exit",p,i]]),a.consume(e),e}function DR(e,i,a){const r=this;let o;return u;function u(g){let x=r.events.length,b;for(;x--;)if(r.events[x][1].type!=="lineEnding"&&r.events[x][1].type!=="linePrefix"&&r.events[x][1].type!=="content"){b=r.events[x][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||b)?(e.enter("setextHeadingLine"),o=g,d(g)):a(g)}function d(g){return e.enter("setextHeadingLineSequence"),p(g)}function p(g){return g===o?(e.consume(g),p):(e.exit("setextHeadingLineSequence"),at(g)?bt(e,h,"lineSuffix")(g):h(g))}function h(g){return g===null||Pe(g)?(e.exit("setextHeadingLine"),i(g)):a(g)}}const zR={tokenize:LR};function LR(e){const i=this,a=e.attempt(Fo,r,e.attempt(this.parser.constructs.flowInitial,o,bt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(F5,o)),"linePrefix")));return a;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const IR={resolveAll:Ik()},UR=Lk("string"),BR=Lk("text");function Lk(e){return{resolveAll:Ik(e==="text"?$R:void 0),tokenize:i};function i(a){const r=this,o=this.parser.constructs[e],u=a.attempt(o,d,p);return d;function d(x){return g(x)?u(x):p(x)}function p(x){if(x===null){a.consume(x);return}return a.enter("data"),a.consume(x),h}function h(x){return g(x)?(a.exit("data"),u(x)):(a.consume(x),h)}function g(x){if(x===null)return!0;const b=o[x];let v=-1;if(b)for(;++v<b.length;){const y=b[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Ik(e){return i;function i(a,r){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,r):a}}function $R(e,i){const a=new Qu;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const o=e[r-1][1],u=i.sliceStream(o);let d=u.length,p=-1,h=0,g;for(;d--;){const x=u[d];if(typeof x=="string"){for(p=x.length;x.charCodeAt(p-1)===32;)h++,p--;if(p)break;p=-1}else if(x===-2)g=!0,h++;else if(x!==-1){d++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(h=0),h){const x={type:r===e.length||g||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?p:o.start._bufferIndex+p,_index:o.start._index+d,line:o.end.line,column:o.end.column-h,offset:o.end.offset-h},end:{...o.end}};o.end={...x.start},o.start.offset===o.end.offset?Object.assign(o,x):a.add(r,0,[["enter",x,i],["exit",x,i]])}r++}return a.consume(e),e}const HR={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:Ak},PR={91:V5},FR={[-2]:Tm,[-1]:Tm,32:Tm},qR={35:eR,42:zu,45:[P0,zu],60:aR,61:P0,95:zu,96:$0,126:$0},GR={38:Ok,92:jk},YR={[-5]:Cm,[-4]:Cm,[-3]:Cm,33:vR,38:Ok,42:Eh,60:[N5,cR],91:kR,92:[J5,jk],93:yg,95:Eh,96:I5},KR={null:[Eh,IR]},VR={null:[42,95]},XR={null:[]},ZR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:VR,contentInitial:PR,disable:XR,document:HR,flow:qR,flowInitial:FR,insideSpan:KR,string:GR,text:YR},Symbol.toStringTag,{value:"Module"}));function QR(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let d=[],p=[];const h={attempt:T(P),check:T(L),consume:M,enter:j,exit:D,interrupt:T(L,{interrupt:!0})},g={code:null,containerState:{},defineSkip:_,events:[],now:k,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:b};let x=i.tokenize.call(g,h);return i.resolveAll&&u.push(i),g;function b($){return d=yi(d,$),S(),d[d.length-1]!==null?[]:(R(i,0),g.events=_d(u,g.events,g),g.events)}function v($,W){return WR(y($),W)}function y($){return JR(d,$)}function k(){const{_bufferIndex:$,_index:W,line:de,column:ce,offset:ae}=r;return{_bufferIndex:$,_index:W,line:de,column:ce,offset:ae}}function _($){o[$.line]=$.column,z()}function S(){for(;r._index<d.length;){const $=d[r._index];if(typeof $=="string"){const W=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<$.length;)N($.charCodeAt(r._bufferIndex))}else N($)}}function N($){x=x($)}function M($){Pe($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,z()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),g.previous=$}function j($,W){const de=W||{};return de.type=$,de.start=k(),g.events.push(["enter",de,g]),p.push(de),de}function D($){const W=p.pop();return W.end=k(),g.events.push(["exit",W,g]),W}function P($,W){R($,W.from)}function L($,W){W.restore()}function T($,W){return de;function de(ce,ae,O){let te,ne,G,A;return Array.isArray(ce)?pe(ce):"tokenize"in ce?pe([ce]):Se(ce);function Se(he){return ke;function ke(ze){const He=ze!==null&&he[ze],$e=ze!==null&&he.null,X=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray($e)?$e:$e?[$e]:[]];return pe(X)(ze)}}function pe(he){return te=he,ne=0,he.length===0?O:C(he[ne])}function C(he){return ke;function ke(ze){return A=K(),G=he,he.partial||(g.currentConstruct=he),he.name&&g.parser.constructs.disable.null.includes(he.name)?se():he.tokenize.call(W?Object.assign(Object.create(g),W):g,h,I,se)(ze)}}function I(he){return $(G,A),ae}function se(he){return A.restore(),++ne<te.length?C(te[ne]):O}}}function R($,W){$.resolveAll&&!u.includes($)&&u.push($),$.resolve&&Li(g.events,W,g.events.length-W,$.resolve(g.events.slice(W),g)),$.resolveTo&&(g.events=$.resolveTo(g.events,g))}function K(){const $=k(),W=g.previous,de=g.currentConstruct,ce=g.events.length,ae=Array.from(p);return{from:ce,restore:O};function O(){r=$,g.previous=W,g.currentConstruct=de,g.events.length=ce,p=ae,z()}}function z(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function JR(e,i){const a=i.start._index,r=i.start._bufferIndex,o=i.end._index,u=i.end._bufferIndex;let d;if(a===o)d=[e[a].slice(r,u)];else{if(d=e.slice(a,o),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function WR(e,i){let a=-1;const r=[];let o;for(;++a<e.length;){const u=e[a];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
|
|
249
|
+
`;break}case-3:{d=`\r
|
|
250
|
+
`;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,r.push(d)}return r.join("")}function e3(e){const r={constructs:Sk([ZR,...(e||{}).extensions||[]]),content:o(x5),defined:[],document:o(y5),flow:o(zR),lazy:{},string:o(UR),text:o(BR)};return r;function o(u){return d;function d(p){return QR(r,u,p)}}}function t3(e){for(;!Mk(e););return e}const F0=/[\0\t\n\r]/g;function n3(){let e=1,i="",a=!0,r;return o;function o(u,d,p){u=i+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u));const h=[];let g=0;for(i="",a&&(u.charCodeAt(0)===65279&&g++,a=void 0);g<u.length;){F0.lastIndex=g;const x=F0.exec(u),b=x&&x.index!==void 0?x.index:u.length,v=u.charCodeAt(b);if(!x){i=u.slice(g);break}if(v===10&&g===b&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),g<b&&(h.push(u.slice(g,b)),e+=b-g),v){case 0:{h.push(65533),e++;break}case 9:{const y=Math.ceil(e/4)*4;for(h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}g=b+1}return p&&(r&&h.push(-5),i&&h.push(i),h.push(null)),h}}const i3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function a3(e){return e.replace(i3,r3)}function r3(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return Tk(a.slice(u?2:1),u?16:10)}return bg(a)||e}const Uk={}.hasOwnProperty;function s3(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),l3(a)(t3(e3(a).document().write(n3()(e,i,!0))))}function l3(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(An),autolinkProtocol:z,autolinkEmail:z,atxHeading:d(Le),blockQuote:d(X),characterEscape:z,characterReference:z,codeFenced:d(Z),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:d(Z,p),codeText:d(Te,p),codeTextData:z,data:z,codeFlowValue:z,definition:d(rt),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:d(ct),hardBreakEscape:d(mt),hardBreakTrailing:d(mt),htmlFlow:d(Je,p),htmlFlowData:z,htmlText:d(Je,p),htmlTextData:z,image:d(Gt),label:p,link:d(An),listItem:d(fe),listItemValue:y,listOrdered:d(xn,v),listUnordered:d(xn),paragraph:d(qe),reference:I,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:d(Le),strong:d(ht),thematicBreak:d(ln)},exit:{atxHeading:g(),atxHeadingSequence:L,autolink:g(),autolinkEmail:$e,autolinkProtocol:He,blockQuote:g(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ke,characterReference:ze,codeFenced:g(N),codeFencedFence:S,codeFencedFenceInfo:k,codeFencedFenceMeta:_,codeFlowValue:$,codeIndented:g(M),codeText:g(O),codeTextData:$,data:$,definition:g(),definitionDestinationString:P,definitionLabelString:j,definitionTitleString:D,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(ce),htmlFlowData:$,htmlText:g(ae),htmlTextData:$,image:g(ne),label:A,labelText:G,lineEnding:W,link:g(te),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:se,resourceDestinationString:Se,resourceTitleString:pe,resource:C,setextHeading:g(K),setextHeadingLineSequence:R,setextHeadingText:T,strong:g(),thematicBreak:g()}};Bk(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(re){let ye={type:"root",children:[],position:void 0};const Ue={stack:[ye],tokenStack:[],config:i,enter:h,exit:x,buffer:p,resume:b,data:a},Ke=[],Xt=[];let Nt=-1;for(;++Nt<re.length;)if(Xt.push(re[Nt]),re[Nt][1].type==="listOrdered"||re[Nt][1].type==="listUnordered")if(re[Nt][0]==="enter")Ke.push(Xt.length-1);else{const on=Ke.pop();u(Xt,on)}for(re=Xt,Nt=-1;++Nt<re.length;){const on=i[re[Nt][0]];re[Nt][0]==="enter"&&i.beforeEnter.length>0&&o(i.beforeEnter,{...Ue,sliceSerialize:re[Nt][2].sliceSerialize},re[Nt][1]),Uk.call(on,re[Nt][1].type)&&on[re[Nt][1].type].call({...Ue,sliceSerialize:re[Nt][2].sliceSerialize},re[Nt][1]),re[Nt][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{...Ue,sliceSerialize:re[Nt][2].sliceSerialize},re[Nt][1])}if(Ue.tokenStack.length>0){const on=Ue.tokenStack[Ue.tokenStack.length-1];(on[1]||q0).call(Ue,void 0,on[0])}for(ye.position={start:xr(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:xr(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Nt=-1;++Nt<i.transforms.length;)ye=i.transforms[Nt](ye)||ye;return ye}function o(re,ye,Ue){let Ke=-1;for(;++Ke<re.length;)re[Ke].call(ye,Ue)}function u(re,ye){const Ue=re.length-1;let Ke=ye-1,Xt=-1,Nt=!1,on,bn,ki,Ei;const oa=[];for(;++Ke<=Ue;){const dn=re[Ke];switch(dn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dn[0]==="enter"?Xt++:Xt--,Ei=void 0;break}case"lineEndingBlank":{dn[0]==="enter"&&(on&&!Ei&&!Xt&&!ki&&(ki=Ke),Ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ei=void 0}if(!Xt&&dn[0]==="enter"&&dn[1].type==="listItemPrefix"||Xt===-1&&dn[0]==="exit"&&(dn[1].type==="listUnordered"||dn[1].type==="listOrdered")){if(on){let Ni=Ke;for(bn=void 0;Ni--;){const zn=re[Ni];if(zn[1].type==="lineEnding"||zn[1].type==="lineEndingBlank"){if(zn[0]==="exit")continue;bn&&(re[bn][1].type="lineEndingBlank",Nt=!0),zn[1].type="lineEnding",bn=Ni}else if(!(zn[1].type==="linePrefix"||zn[1].type==="blockQuotePrefix"||zn[1].type==="blockQuotePrefixWhitespace"||zn[1].type==="blockQuoteMarker"||zn[1].type==="listItemIndent"))break}ki&&(!bn||ki<bn)&&(on._spread=!0),on.end=Object.assign({},bn?re[bn][1].start:dn[1].end),oa.push({at:bn||Ke,event:["exit",on,dn[2]]})}if(dn[1].type==="listItemPrefix"){const Ni={type:"listItem",_spread:!1,start:Object.assign({},dn[1].start),end:void 0};on=Ni,oa.push({at:Ke,event:["enter",Ni,dn[2]]}),ki=void 0,Ei=!0}}}const Ia=re.splice(ye);let Zt=0;for(Ke=-1;++Ke<Ia.length;){for(;Zt<oa.length&&oa[Zt].at===ye+Ke;)re.push(oa[Zt++].event);re.push(Ia[Ke])}re[ye][1]._spread=Nt}function d(re,ye){return Ue;function Ue(Ke){h.call(this,re(Ke),Ke),ye&&ye.call(this,Ke)}}function p(){this.stack.push({type:"fragment",children:[]})}function h(re,ye,Ue){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([ye,Ue||void 0]),re.position={start:xr(ye.start),end:void 0}}function g(re){return ye;function ye(Ue){re&&re.call(this,Ue),x.call(this,Ue)}}function x(re,ye){const Ue=this.stack.pop(),Ke=this.tokenStack.pop();if(!Ke)throw new Error("Cannot close `"+re.type+"` ("+_o({start:re.start,end:re.end})+"): it’s not open");Ke[0].type!==re.type&&(ye?ye.call(this,re,Ke[0]):(Ke[1]||q0).call(this,re,Ke[0])),Ue.position.end=xr(re.end)}function b(){return xg(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function y(re){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function k(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=re}function _(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=re}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.value=re.replace(/(\r?\n|\r)$/g,"")}function j(re){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Ii(this.sliceSerialize(re)).toLowerCase()}function D(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.title=re}function P(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.url=re}function L(re){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ue=this.sliceSerialize(re).length;ye.depth=Ue}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function R(re){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function K(){this.data.setextHeadingSlurpLineEnding=void 0}function z(re){const Ue=this.stack[this.stack.length-1].children;let Ke=Ue[Ue.length-1];(!Ke||Ke.type!=="text")&&(Ke=xt(),Ke.position={start:xr(re.start),end:void 0},Ue.push(Ke)),this.stack.push(Ke)}function $(re){const ye=this.stack.pop();ye.value+=this.sliceSerialize(re),ye.position.end=xr(re.end)}function W(re){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=ye.children[ye.children.length-1];Ue.position.end=xr(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ye.type)&&(z.call(this,re),$.call(this,re))}function de(){this.data.atHardBreak=!0}function ce(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.value=re}function ae(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.value=re}function O(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.value=re}function te(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ye,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function ne(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ye,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function G(re){const ye=this.sliceSerialize(re),Ue=this.stack[this.stack.length-2];Ue.label=a3(ye),Ue.identifier=Ii(ye).toLowerCase()}function A(){const re=this.stack[this.stack.length-1],ye=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const Ke=re.children;Ue.children=Ke}else Ue.alt=ye}function Se(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.url=re}function pe(){const re=this.resume(),ye=this.stack[this.stack.length-1];ye.title=re}function C(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function se(re){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Ii(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function he(re){this.data.characterReferenceType=re.type}function ke(re){const ye=this.sliceSerialize(re),Ue=this.data.characterReferenceType;let Ke;Ue?(Ke=Tk(ye,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=bg(ye);const Xt=this.stack[this.stack.length-1];Xt.value+=Ke}function ze(re){const ye=this.stack.pop();ye.position.end=xr(re.end)}function He(re){$.call(this,re);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(re)}function $e(re){$.call(this,re);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(re)}function X(){return{type:"blockquote",children:[],position:void 0}}function Z(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Te(){return{type:"inlineCode",value:"",position:void 0}}function rt(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function ct(){return{type:"emphasis",children:[],position:void 0}}function Le(){return{type:"heading",depth:0,children:[],position:void 0}}function mt(){return{type:"break",position:void 0}}function Je(){return{type:"html",value:"",position:void 0}}function Gt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function An(){return{type:"link",title:null,url:"",children:[],position:void 0}}function xn(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[],position:void 0}}function fe(re){return{type:"listItem",spread:re._spread,checked:null,children:[],position:void 0}}function qe(){return{type:"paragraph",children:[],position:void 0}}function ht(){return{type:"strong",children:[],position:void 0}}function xt(){return{type:"text",value:"",position:void 0}}function ln(){return{type:"thematicBreak",position:void 0}}}function xr(e){return{line:e.line,column:e.column,offset:e.offset}}function Bk(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Bk(e,r):o3(e,r)}}function o3(e,i){let a;for(a in i)if(Uk.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"afterExit":case"beforeEnter":{const r=i[a];r&&e[a].push(r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function q0(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+_o({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+_o({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+_o({start:i.start,end:i.end})+") is still open")}function c3(e){const i=this;i.parser=a;function a(r){return s3(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function u3(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function d3(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
251
|
+
`}]}function f3(e,i){const a=i.value?i.value+`
|
|
252
|
+
`:"",r={},o=i.lang?i.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(u.data={meta:i.meta}),e.patch(i,u),u=e.applyData(i,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(i,u),u}function p3(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function m3(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function h3(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),o=hl(r.toLowerCase()),u=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=u+1,p+=1,e.footnoteCounts.set(r,p);const h={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,h);const g={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(i,g),e.applyData(i,g)}function g3(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function x3(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function $k(e,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const o=e.all(i),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=r:o.push({type:"text",value:r}),o}function b3(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return $k(e,i);const o={src:hl(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(i,u),e.applyData(i,u)}function y3(e,i){const a={src:hl(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,r),e.applyData(i,r)}function v3(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,r),e.applyData(i,r)}function w3(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return $k(e,i);const o={href:hl(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"a",properties:o,children:e.all(i)};return e.patch(i,u),e.applyData(i,u)}function k3(e,i){const a={href:hl(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function E3(e,i,a){const r=e.all(i),o=a?N3(a):Hk(i),u={},d=[];if(typeof i.checked=="boolean"){const x=r[0];let b;x&&x.type==="element"&&x.tagName==="p"?b=x:(b={type:"element",tagName:"p",properties:{},children:[]},r.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const x=r[p];(o||p!==0||x.type!=="element"||x.tagName!=="p")&&d.push({type:"text",value:`
|
|
253
|
+
`}),x.type==="element"&&x.tagName==="p"&&!o?d.push(...x.children):d.push(x)}const h=r[r.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&d.push({type:"text",value:`
|
|
254
|
+
`});const g={type:"element",tagName:"li",properties:u,children:d};return e.patch(i,g),e.applyData(i,g)}function N3(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Hk(a[r])}return i}function Hk(e){const i=e.spread;return i??e.children.length>1}function _3(e,i){const a={},r=e.all(i);let o=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++o<r.length;){const d=r[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(i,u),e.applyData(i,u)}function S3(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function T3(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function C3(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function A3(e,i){const a=e.all(i),r=a.shift(),o=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),o.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=pg(i.children[1]),h=yk(i.children[i.children.length-1]);p&&h&&(d.position={start:p,end:h}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(i,u),e.applyData(i,u)}function j3(e,i,a){const r=a?a.children:void 0,u=(r?r.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,p=d?d.length:i.children.length;let h=-1;const g=[];for(;++h<p;){const b=i.children[h],v={},y=d?d[h]:void 0;y&&(v.align=y);let k={type:"element",tagName:u,properties:v,children:[]};b&&(k.children=e.all(b),e.patch(b,k),k=e.applyData(b,k)),g.push(k)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(i,x),e.applyData(i,x)}function O3(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const G0=9,Y0=32;function M3(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),o=0;const u=[];for(;r;)u.push(K0(i.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(i);return u.push(K0(i.slice(o),o>0,!1)),u.join("")}function K0(e,i,a){let r=0,o=e.length;if(i){let u=e.codePointAt(r);for(;u===G0||u===Y0;)r++,u=e.codePointAt(r)}if(a){let u=e.codePointAt(o-1);for(;u===G0||u===Y0;)o--,u=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function R3(e,i){const a={type:"text",value:M3(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function D3(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const z3={blockquote:u3,break:d3,code:f3,delete:p3,emphasis:m3,footnoteReference:h3,heading:g3,html:x3,imageReference:b3,image:y3,inlineCode:v3,linkReference:w3,link:k3,listItem:E3,list:_3,paragraph:S3,root:T3,strong:C3,table:A3,tableCell:O3,tableRow:j3,text:R3,thematicBreak:D3,toml:vu,yaml:vu,definition:vu,footnoteDefinition:vu};function vu(){}const Pk=-1,Sd=0,To=1,Wu=2,vg=3,wg=4,kg=5,Eg=6,Fk=7,qk=8,{defineProperty:L3}=Object,Gk=typeof self=="object"?self:globalThis,V0=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Gk[e](i)},I3=(e,i)=>{const a=(o,u)=>(e.set(u,o),o),r=o=>{if(e.has(o))return e.get(o);const[u,d]=i[o];switch(u){case Sd:case Pk:return a(d,o);case To:{const p=a([],o);for(const h of d)p.push(r(h));return p}case Wu:{const p=a({},o);for(const[h,g]of d){const x=r(h),b=r(g);x==="__proto__"?L3(p,x,{value:b,configurable:!0,enumerable:!0,writable:!0}):p[x]=b}return p}case vg:return a(new Date(d),o);case wg:{const{source:p,flags:h}=d;return a(new RegExp(p,h),o)}case kg:{const p=a(new Map,o);for(const[h,g]of d)p.set(r(h),r(g));return p}case Eg:{const p=a(new Set,o);for(const h of d)p.add(r(h));return p}case Fk:{const{name:p,message:h}=d;return a(typeof Gk[p]=="function"?V0(p,h):new Error(h),o)}case qk:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return a(new DataView(p),d)}case"-0":return-0}return a(V0(u,d),o)};return r},X0=e=>I3(new Map,e)(0),Zr="",{toString:U3}={},{keys:B3,is:$3}=Object,xo=e=>{const i=typeof e;if(i!=="object"||!e)return[Sd,i];const a=U3.call(e).slice(8,-1);switch(a){case"Array":return[To,Zr];case"Object":return[Wu,Zr];case"Date":return[vg,Zr];case"RegExp":return[wg,Zr];case"Map":return[kg,Zr];case"Set":return[Eg,Zr];case"DataView":return[To,a]}return a.includes("Array")?[To,a]:e instanceof Error?[Fk,e.name||"Error"]:[Wu,a]},wu=([e,i])=>e===Sd&&(i==="function"||i==="symbol"),H3=(e,i,a,r)=>{const o=(d,p)=>{const h=r.push(d)-1;return a.set(p,h),h},u=d=>{if(a.has(d))return a.get(d);let[p,h]=xo(d);switch(p){case Sd:{let x=d;switch(h){case"bigint":p=qk,x=d.toString();break;case"number":if(!d&&$3(d,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);x=null;break;case"undefined":return o([Pk],d)}return o([p,x],d)}case To:{if(h){let v=d;return h==="DataView"?v=new Uint8Array(d.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(d)),o([h,[...v]],d)}const x=[],b=o([p,x],d);for(const v of d)x.push(u(v));return b}case Wu:{if(h)switch(h){case"BigInt":return o([h,d.toString()],d);case"Boolean":case"Number":case"String":return o([h,d.valueOf()],d)}if(i&&"toJSON"in d)return u(d.toJSON());const x=[],b=o([p,x],d);for(const v of B3(d))(e||!wu(xo(d[v])))&&x.push([u(v),u(d[v])]);return b}case vg:return o([p,isNaN(d.getTime())?Zr:d.toISOString()],d);case wg:{const{source:x,flags:b}=d;return o([p,{source:x,flags:b}],d)}case kg:{const x=[],b=o([p,x],d);for(const[v,y]of d)(e||!(wu(xo(v))||wu(xo(y))))&&x.push([u(v),u(y)]);return b}case Eg:{const x=[],b=o([p,x],d);for(const v of d)(e||!wu(xo(v)))&&x.push(u(v));return b}}const{message:g}=d;return o([p,{name:h,message:g}],d)};return u},Z0=(e,{json:i,lossy:a}={})=>{const r=[];return H3(!(i||a),!!i,new Map,r)(e),r},ed=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?X0(Z0(e,i)):structuredClone(e):(e,i)=>X0(Z0(e,i));function P3(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function F3(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function q3(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||P3,r=e.options.footnoteBackLabel||F3,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let h=-1;for(;++h<e.footnoteOrder.length;){const g=e.footnoteById.get(e.footnoteOrder[h]);if(!g)continue;const x=e.all(g),b=String(g.identifier).toUpperCase(),v=hl(b.toLowerCase());let y=0;const k=[],_=e.footnoteCounts.get(b);for(;_!==void 0&&++y<=_;){k.length>0&&k.push({type:"text",value:" "});let M=typeof a=="string"?a:a(h,y);typeof M=="string"&&(M={type:"text",value:M}),k.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,y),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const S=x[x.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const M=S.children[S.children.length-1];M&&M.type==="text"?M.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...k)}else x.push(...k);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+v},children:e.wrap(x,!0)};e.patch(g,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...ed(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
255
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
|
|
256
|
+
`}]}}const qo=(function(e){if(e==null)return V3;if(typeof e=="function")return Td(e);if(typeof e=="object")return Array.isArray(e)?G3(e):Y3(e);if(typeof e=="string")return K3(e);throw new Error("Expected function, string, or object as test")});function G3(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=qo(e[a]);return Td(r);function r(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function Y3(e){const i=e;return Td(a);function a(r){const o=r;let u;for(u in e)if(o[u]!==i[u])return!1;return!0}}function K3(e){return Td(i);function i(a){return a&&a.type===e}}function Td(e){return i;function i(a,r,o){return!!(X3(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function V3(){return!0}function X3(e){return e!==null&&typeof e=="object"&&"type"in e}const Yk=[],Z3=!0,_h=!1,Q3="skip";function Kk(e,i,a,r){let o;typeof i=="function"&&typeof a!="function"?(r=a,a=i):o=i;const u=qo(o),d=r?-1:1;p(e,void 0,[])();function p(h,g,x){const b=h&&typeof h=="object"?h:{};if(typeof b.type=="string"){const y=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=Yk,k,_,S;if((!i||u(h,g,x[x.length-1]||void 0))&&(y=J3(a(h,x)),y[0]===_h))return y;if("children"in h&&h.children){const N=h;if(N.children&&y[0]!==Q3)for(_=(r?N.children.length:-1)+d,S=x.concat(N);_>-1&&_<N.children.length;){const M=N.children[_];if(k=p(M,_,S)(),k[0]===_h)return k;_=typeof k[1]=="number"?k[1]:_+d}}return y}}}function J3(e){return Array.isArray(e)?e:typeof e=="number"?[Z3,e]:e==null?Yk:[e]}function Cd(e,i,a,r){let o,u,d;typeof i=="function"&&typeof a!="function"?(u=void 0,d=i,o=a):(u=i,d=a,o=r),Kk(e,u,p,o);function p(h,g){const x=g[g.length-1],b=x?x.children.indexOf(h):void 0;return d(h,b,x)}}const Sh={}.hasOwnProperty,W3={};function eD(e,i){const a=i||W3,r=new Map,o=new Map,u=new Map,d={...z3,...a.handlers},p={all:g,applyData:nD,definitionById:r,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:h,options:a,patch:tD,wrap:aD};return Cd(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const b=x.type==="definition"?r:o,v=String(x.identifier).toUpperCase();b.has(v)||b.set(v,x)}}),p;function h(x,b){const v=x.type,y=p.handlers[v];if(Sh.call(p.handlers,v)&&y)return y(p,x,b);if(p.options.passThrough&&p.options.passThrough.includes(v)){if("children"in x){const{children:_,...S}=x,N=ed(S);return N.children=p.all(x),N}return ed(x)}return(p.options.unknownHandler||iD)(p,x,b)}function g(x){const b=[];if("children"in x){const v=x.children;let y=-1;for(;++y<v.length;){const k=p.one(v[y],x);if(k){if(y&&v[y-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Q0(k.value)),!Array.isArray(k)&&k.type==="element")){const _=k.children[0];_&&_.type==="text"&&(_.value=Q0(_.value))}Array.isArray(k)?b.push(...k):b.push(k)}}}return b}}function tD(e,i){e.position&&(i.position=FM(e))}function nD(e,i){let a=i;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const d="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:d}}a.type==="element"&&u&&Object.assign(a.properties,ed(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function iD(e,i){const a=i.data||{},r="value"in i&&!(Sh.call(a,"hProperties")||Sh.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function aD(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
257
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
258
|
+
`}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
|
|
259
|
+
`}),a}function Q0(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function J0(e,i){const a=eD(e,i),r=a.one(e,void 0),o=q3(a),u=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
|
|
260
|
+
`},o),u}function rD(e,i){return e&&"run"in e?async function(a,r){const o=J0(a,{file:r,...i});await e.run(o,r)}:function(a,r){return J0(a,{file:r,...e||i})}}function W0(e){if(e)throw e}var Am,ev;function sD(){if(ev)return Am;ev=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(g){return typeof Array.isArray=="function"?Array.isArray(g):i.call(g)==="[object Array]"},u=function(g){if(!g||i.call(g)!=="[object Object]")return!1;var x=e.call(g,"constructor"),b=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!x&&!b)return!1;var v;for(v in g);return typeof v>"u"||e.call(g,v)},d=function(g,x){a&&x.name==="__proto__"?a(g,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):g[x.name]=x.newValue},p=function(g,x){if(x==="__proto__")if(e.call(g,x)){if(r)return r(g,x).value}else return;return g[x]};return Am=function h(){var g,x,b,v,y,k,_=arguments[0],S=1,N=arguments.length,M=!1;for(typeof _=="boolean"&&(M=_,_=arguments[1]||{},S=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});S<N;++S)if(g=arguments[S],g!=null)for(x in g)b=p(_,x),v=p(g,x),_!==v&&(M&&v&&(u(v)||(y=o(v)))?(y?(y=!1,k=b&&o(b)?b:[]):k=b&&u(b)?b:{},d(_,{name:x,newValue:h(M,k,v)})):typeof v<"u"&&d(_,{name:x,newValue:v}));return _},Am}var lD=sD();const jm=ad(lD);function Th(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oD(){const e=[],i={run:a,use:r};return i;function a(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...o);function p(h,...g){const x=e[++u];let b=-1;if(h){d(h);return}for(;++b<o.length;)(g[b]===null||g[b]===void 0)&&(g[b]=o[b]);o=g,x?cD(x,p)(...g):d(null,...g)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),i}}function cD(e,i){let a;return r;function r(...d){const p=e.length>d.length;let h;p&&d.push(o);try{h=e.apply(this,d)}catch(g){const x=g;if(p&&a)throw x;return o(x)}p||(h&&h.then&&typeof h.then=="function"?h.then(u,o):h instanceof Error?o(h):u(h))}function o(d,...p){a||(a=!0,i(d,...p))}function u(d){o(null,d)}}const ia={basename:uD,dirname:dD,extname:fD,join:pD,sep:"/"};function uD(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Go(e);let a=0,r=-1,o=e.length,u;if(i===void 0||i.length===0||i.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else r<0&&(u=!0,r=o+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else d<0&&(u=!0,d=o+1),p>-1&&(e.codePointAt(o)===i.codePointAt(p--)?p<0&&(r=o):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function dD(e){if(Go(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function fD(e){Go(e);let i=e.length,a=-1,r=0,o=-1,u=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===46?o<0?o=i:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function pD(...e){let i=-1,a;for(;++i<e.length;)Go(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":mD(a)}function mD(e){Go(e);const i=e.codePointAt(0)===47;let a=hD(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function hD(e,i){let a="",r=0,o=-1,u=0,d=-1,p,h;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(h=a.lastIndexOf("/"),h!==a.length-1){h<0?(a="",r=0):(a=a.slice(0,h),r=a.length-1-a.lastIndexOf("/")),o=d,u=0;continue}}else if(a.length>0){a="",r=0,o=d,u=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,d):a=e.slice(o+1,d),r=d-o-1;o=d,u=0}else p===46&&u>-1?u++:u=-1}return a}function Go(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gD={cwd:xD};function xD(){return"/"}function Ch(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bD(e){if(typeof e=="string")e=new URL(e);else if(!Ch(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return yD(e)}function yD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(i)}const Om=["history","path","basename","stem","extname","dirname"];class Vk{constructor(i){let a;i?Ch(i)?a={path:i}:typeof i=="string"||vD(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":gD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Om.length;){const u=Om[r];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Om.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?ia.basename(this.path):void 0}set basename(i){Rm(i,"basename"),Mm(i,"basename"),this.path=ia.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?ia.dirname(this.path):void 0}set dirname(i){tv(this.basename,"dirname"),this.path=ia.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?ia.extname(this.path):void 0}set extname(i){if(Mm(i,"extname"),tv(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ia.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Ch(i)&&(i=bD(i)),Rm(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?ia.basename(this.path,this.extname):void 0}set stem(i){Rm(i,"stem"),Mm(i,"stem"),this.path=ia.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const o=this.message(i,a,r);throw o.fatal=!0,o}info(i,a,r){const o=this.message(i,a,r);return o.fatal=void 0,o}message(i,a,r){const o=new Dn(i,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Mm(e,i){if(e&&e.includes(ia.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+ia.sep+"`")}function Rm(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function tv(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function vD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wD=(function(e){const r=this.constructor.prototype,o=r[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,r),u}),kD={}.hasOwnProperty;class Ng extends wD{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=oD()}copy(){const i=new Ng;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(jm(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(Lm("data",this.frozen),this.namespace[i]=a,this):kD.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Lm("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(i,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=ku(i),r=this.parser||this.Parser;return Dm("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),Dm("process",this.parser||this.Parser),zm("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,d){const p=ku(i),h=r.parse(p);r.run(h,p,function(x,b,v){if(x||!b||!v)return g(x);const y=b,k=r.stringify(y,v);_D(k)?v.value=k:v.result=k,g(x,v)});function g(x,b){x||!b?d(x):u?u(b):a(void 0,b)}}}processSync(i){let a=!1,r;return this.freeze(),Dm("processSync",this.parser||this.Parser),zm("processSync",this.compiler||this.Compiler),this.process(i,o),iv("processSync","process",a),r;function o(u,d){a=!0,W0(u),r=d}}run(i,a,r){nv(i),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?u(void 0,r):new Promise(u);function u(d,p){const h=ku(a);o.run(i,h,g);function g(x,b,v){const y=b||i;x?p(x):d?d(y):r(void 0,y,v)}}}runSync(i,a){let r=!1,o;return this.run(i,a,u),iv("runSync","run",r),o;function u(d,p){W0(d),o=p,r=!0}}stringify(i,a){this.freeze();const r=ku(a),o=this.compiler||this.Compiler;return zm("stringify",o),nv(i),o(i,r)}use(i,...a){const r=this.attachers,o=this.namespace;if(Lm("use",this.frozen),i!=null)if(typeof i=="function")h(i,a);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function u(g){if(typeof g=="function")h(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[x,...b]=g;h(x,b)}else d(g);else throw new TypeError("Expected usable value, not `"+g+"`")}function d(g){if(!("plugins"in g)&&!("settings"in g))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");p(g.plugins),g.settings&&(o.settings=jm(!0,o.settings,g.settings))}function p(g){let x=-1;if(g!=null)if(Array.isArray(g))for(;++x<g.length;){const b=g[x];u(b)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function h(g,x){let b=-1,v=-1;for(;++b<r.length;)if(r[b][0]===g){v=b;break}if(v===-1)r.push([g,...x]);else if(x.length>0){let[y,...k]=x;const _=r[v][1];Th(_)&&Th(y)&&(y=jm(!0,_,y)),r[v]=[g,y,...k]}}}}const ED=new Ng().freeze();function Dm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function zm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lm(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nv(e){if(!Th(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iv(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function ku(e){return ND(e)?e:new Vk(e)}function ND(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _D(e){return typeof e=="string"||SD(e)}function SD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",av=[],rv={allowDangerousHtml:!0},CD=/^(https?|ircs?|mailto|xmpp)$/i,AD=[{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 jD(e){const i=OD(e),a=MD(e);return RD(i.runSync(i.parse(a),a),e)}function OD(e){const i=e.rehypePlugins||av,a=e.remarkPlugins||av,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rv}:rv;return ED().use(c3).use(a).use(rD,r).use(i)}function MD(e){const i=e.children||"",a=new Vk;return typeof i=="string"&&(a.value=i),a}function RD(e,i){const a=i.allowedElements,r=i.allowElement,o=i.components,u=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,h=i.urlTransform||DD;for(const x of AD)Object.hasOwn(i,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+TD+x.id,void 0);return Cd(e,g),VM(e,{Fragment:c.Fragment,components:o,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function g(x,b,v){if(x.type==="raw"&&v&&typeof b=="number")return d?v.children.splice(b,1):v.children[b]={type:"text",value:x.value},b;if(x.type==="element"){let y;for(y in Sm)if(Object.hasOwn(Sm,y)&&Object.hasOwn(x.properties,y)){const k=x.properties[y],_=Sm[y];(_===null||_.includes(x.tagName))&&(x.properties[y]=h(String(k||""),y,x))}}if(x.type==="element"){let y=a?!a.includes(x.tagName):u?u.includes(x.tagName):!1;if(!y&&r&&typeof b=="number"&&(y=!r(x,b,v)),y&&v&&typeof b=="number")return p&&x.children?v.children.splice(b,1,...x.children):v.children.splice(b,1),b}}}function DD(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return i===-1||o!==-1&&i>o||a!==-1&&i>a||r!==-1&&i>r||CD.test(e.slice(0,i))?e:""}function sv(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(i);for(;o!==-1;)r++,o=a.indexOf(i,o+i.length);return r}function zD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LD(e,i,a){const o=qo((a||{}).ignore||[]),u=ID(i);let d=-1;for(;++d<u.length;)Kk(e,"text",p);function p(g,x){let b=-1,v;for(;++b<x.length;){const y=x[b],k=v?v.children:void 0;if(o(y,k?k.indexOf(y):void 0,v))return;v=y}if(v)return h(g,x)}function h(g,x){const b=x[x.length-1],v=u[d][0],y=u[d][1];let k=0;const S=b.children.indexOf(g);let N=!1,M=[];v.lastIndex=0;let j=v.exec(g.value);for(;j;){const P=j.index,L={index:j.index,input:j.input,stack:[...x,g]};let T=y(...j,L);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1)v.lastIndex=P+1;else{if(k!==P&&D({type:"text",value:g.value.slice(k,P)}),Array.isArray(T))for(const R of T)D(R);else T&&D(T);k=P+j[0].length,N=!0}if(!v.global)break;j=v.exec(g.value)}return N?(k<g.value.length&&D({type:"text",value:g.value.slice(k)}),b.children.splice(S,1,...M)):M=[g],S+M.length;function D(P){const L=M[M.length-1];L&&L.type==="text"&&P.type==="text"?L.value+=P.value:M.push(P)}}}function ID(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const o=a[r];i.push([UD(o[0]),BD(o[1])])}return i}function UD(e){return typeof e=="string"?new RegExp(zD(e),"g"):e}function BD(e){return typeof e=="function"?e:function(){return e}}const Im="phrasing",Um=["autolink","link","image","label"];function $D(){return{transforms:[KD],enter:{literalAutolink:PD,literalAutolinkEmail:Bm,literalAutolinkHttp:Bm,literalAutolinkWww:Bm},exit:{literalAutolink:YD,literalAutolinkEmail:GD,literalAutolinkHttp:FD,literalAutolinkWww:qD}}}function HD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Im,notInConstruct:Um},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Im,notInConstruct:Um},{character:":",before:"[ps]",after:"\\/",inConstruct:Im,notInConstruct:Um}]}}function PD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bm(e){this.config.enter.autolinkProtocol.call(this,e)}function FD(e){this.config.exit.autolinkProtocol.call(this,e)}function qD(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function GD(e){this.config.exit.autolinkEmail.call(this,e)}function YD(e){this.exit(e)}function KD(e){LD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VD],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,XD]],{ignore:["link","linkReference"]})}function VD(e,i,a,r,o){let u="";if(!Xk(o)||(/^w/i.test(i)&&(a=i+a,i="",u="http://"),!ZD(a)))return!1;const d=QD(a+r);if(!d[0])return!1;const p={type:"link",title:null,url:u+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function XD(e,i,a,r){return!Xk(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function ZD(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function QD(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const o=sv(e,"(");let u=sv(e,")");for(;r!==-1&&o>u;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),u++;return[e,a]}function Xk(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||ns(a)||Nd(a))&&(!i||a!==47)}Zk.peek=s4;function JD(){this.buffer()}function WD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function e4(){this.buffer()}function t4(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function n4(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ii(this.sliceSerialize(e)).toLowerCase(),a.label=i}function i4(e){this.exit(e)}function a4(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ii(this.sliceSerialize(e)).toLowerCase(),a.label=i}function r4(e){this.exit(e)}function s4(){return"["}function Zk(e,i,a,r){const o=a.createTracker(r);let u=o.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),p(),d(),u+=o.move("]"),u}function l4(){return{enter:{gfmFootnoteCallString:JD,gfmFootnoteCall:WD,gfmFootnoteDefinitionLabelString:e4,gfmFootnoteDefinition:t4},exit:{gfmFootnoteCallString:n4,gfmFootnoteCall:i4,gfmFootnoteDefinitionLabelString:a4,gfmFootnoteDefinition:r4}}}function o4(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Zk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,u,d){const p=u.createTracker(d);let h=p.move("[^");const g=u.enter("footnoteDefinition"),x=u.enter("label");return h+=p.move(u.safe(u.associationId(r),{before:h,after:"]"})),x(),h+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),h+=p.move((i?`
|
|
261
|
+
`:" ")+u.indentLines(u.containerFlow(r,p.current()),i?Qk:c4))),g(),h}}function c4(e,i,a){return i===0?e:Qk(e,i,a)}function Qk(e,i,a){return(a?"":" ")+e}const u4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_g.attention=h4;_g.peek=g4;function d4(){return{canContainEols:["delete"],enter:{strikethrough:p4},exit:{strikethrough:m4}}}function f4(){return{handlers:{delete:_g},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:u4}]}}function p4(e){this.enter({type:"delete",children:[],position:void 0},e)}function m4(e){this.exit(e)}function _g(e,i,a,r){const o=a.createTracker(r),u=a.stack.includes("strikethrough")?"~":"~~",d=a.enter("strikethrough");let p=o.move(u);return p+=a.containerPhrasing(e,{...o.current(),before:p,after:"~"}),p+=o.move(u),d(),p}function h4(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function g4(){return"~"}function x4(e){return e.length}function b4(e,i){const a=i||{},r=(a.align||[]).concat(),o=a.stringLength||x4,u=[],d=[],p=[],h=[];let g=0,x=-1;for(;++x<e.length;){const _=[],S=[];let N=-1;for(e[x].length>g&&(g=e[x].length);++N<e[x].length;){const M=y4(e[x][N]);if(a.alignDelimiters!==!1){const j=o(M);S[N]=j,(h[N]===void 0||j>h[N])&&(h[N]=j)}_.push(M)}d[x]=_,p[x]=S}let b=-1;if(typeof r=="object"&&"length"in r)for(;++b<g;)u[b]=lv(r[b]);else{const _=lv(r);for(;++b<g;)u[b]=_}b=-1;const v=[],y=[];for(;++b<g;){const _=u[b];let S="",N="";_===99?(S=":",N=":"):_===108?S=":":_===114&&(N=":");let M=a.alignDelimiters===!1?1:Math.max(1,h[b]-S.length-N.length);const j=S+"-".repeat(M)+N;a.alignDelimiters!==!1&&(M=S.length+M+N.length,M>h[b]&&(h[b]=M),y[b]=M),v[b]=j}d.splice(1,0,v),p.splice(1,0,y),x=-1;const k=[];for(;++x<d.length;){const _=d[x],S=p[x];b=-1;const N=[];for(;++b<g;){const M=_[b]||"";let j="",D="";if(a.alignDelimiters!==!1){const P=h[b]-(S[b]||0),L=u[b];L===114?j=" ".repeat(P):L===99?P%2?(j=" ".repeat(P/2+.5),D=" ".repeat(P/2-.5)):(j=" ".repeat(P/2),D=j):D=" ".repeat(P)}a.delimiterStart!==!1&&!b&&N.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&M==="")&&(a.delimiterStart!==!1||b)&&N.push(" "),a.alignDelimiters!==!1&&N.push(j),N.push(M),a.alignDelimiters!==!1&&N.push(D),a.padding!==!1&&N.push(" "),(a.delimiterEnd!==!1||b!==g-1)&&N.push("|")}k.push(a.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return k.join(`
|
|
262
|
+
`)}function y4(e){return e==null?"":String(e)}function lv(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}const v4=qo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function w4(e,i,a,r){const o=a.enter("blockquote"),u=a.createTracker(r);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),k4);return o(),d}function k4(e,i,a){return">"+(a?"":" ")+e}function E4(e,i){return ov(e,i.inConstruct,!0)&&!ov(e,i.notInConstruct,!1)}function ov(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function cv(e,i,a,r){let o=-1;for(;++o<a.unsafe.length;){const u=a.unsafe[o];if(u.character===`
|
|
263
|
+
`&&!u.before&&!u.after&&E4(a.stack,u))return/[\t ]/.test(r.before)?"":" "}return`\\
|
|
264
|
+
`}function N4(e,i){const a=String(e);let r=a.indexOf(i),o=r,u=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++u>d&&(d=u):u=1,o=r+i.length,r=a.indexOf(i,o);return d}function _4(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function S4(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function T4(e,i,a,r){const o=S4(a),u=e.value||"";if(_4(e,a)){const b=a.enter("codeIndented"),v=a.indentLines(u,C4);return b(),v}const d=a.createTracker(r),p=o.repeat(Math.max(N4(u,o)+1,3)),h=a.enter("codeFenced"),g=o==="`"?"GraveAccent":"Tilde";let x=d.move(p);if(e.lang){const b=a.enter(`codeFencedLang${g}`);x+=d.move(a.safe(e.lang,{before:x,after:" ",encode:["`"],...d.current()})),b()}if(e.lang&&e.meta){const b=a.enter(`codeFencedMeta${g}`);x+=d.move(" "),x+=d.move(a.safe(e.meta,{before:x,after:`
|
|
265
|
+
`,encode:["`"],...d.current()})),b()}return x+=d.move(`
|
|
266
|
+
`),u&&(x+=d.move(u+`
|
|
267
|
+
`)),x+=d.move(p),h(),x}function C4(e,i,a){return(a?"":" ")+e}function Sg(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function A4(e,i,a,r){const o=Sg(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const h=a.createTracker(r);let g=h.move("[");return g+=h.move(a.safe(a.associationId(e),{before:g,after:"]",...h.current()})),g+=h.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(a.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(p=a.enter("destinationRaw"),g+=h.move(a.safe(e.url,{before:g,after:e.title?" ":`
|
|
268
|
+
`,...h.current()}))),p(),e.title&&(p=a.enter(`title${u}`),g+=h.move(" "+o),g+=h.move(a.safe(e.title,{before:g,after:o,...h.current()})),g+=h.move(o),p()),d(),g}function j4(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}Tg.attention=O4;Tg.peek=M4;function Tg(e,i,a,r){const o=a.enter("phrasing"),u=a.containerPhrasing({type:"root",children:[e]},r);return o(),u}function O4(e,i){return{construct:"emphasis",markers:j4(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function M4(e,i,a){return a.options.emphasis||"*"}function R4(e){return"&#x"+e.toString(16).toUpperCase()+";"}function D4(e,i){let a=!1;return Cd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,_h}),!!((!e.depth||e.depth<3)&&xg(e)&&(i.options.setext||a))}function z4(e,i,a,r){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(r);if(D4(e,a)){const b=a.enter("headingSetext"),v=a.enter("phrasing"),y=a.containerPhrasing(e,{...u.current(),before:`
|
|
269
|
+
`,after:`
|
|
270
|
+
`});return v(),b(),y+`
|
|
271
|
+
`+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
272
|
+
`))+1))}const d="#".repeat(o),p=a.enter("headingAtx"),h=a.enter("phrasing");u.move(d+" ");let g=a.containerPhrasing(e,{before:"# ",after:`
|
|
273
|
+
`,...u.current()});const x=g.charCodeAt(0);return(x===9||x===32)&&(g=R4(x)+g.slice(1)),g=g?d+" "+g:d,a.options.closeAtx&&(g+=" "+d),h(),p(),g}Jk.peek=L4;function Jk(e){return e.value||""}function L4(){return"<"}Wk.peek=I4;function Wk(e,i,a,r){const o=Sg(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const h=a.createTracker(r);let g=h.move("![");return g+=h.move(a.safe(e.alt,{before:g,after:"]",...h.current()})),g+=h.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(a.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(p=a.enter("destinationRaw"),g+=h.move(a.safe(e.url,{before:g,after:e.title?" ":")",...h.current()}))),p(),e.title&&(p=a.enter(`title${u}`),g+=h.move(" "+o),g+=h.move(a.safe(e.title,{before:g,after:o,...h.current()})),g+=h.move(o),p()),g+=h.move(")"),d(),g}function I4(){return"!"}eE.peek=U4;function eE(e,i,a,r){const o=e.referenceType,u=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let h=p.move("![");const g=a.safe(e.alt,{before:h,after:"]",...p.current()});h+=p.move(g+"]["),d();const x=a.stack;a.stack=x.filter(function(v){return v!=="phrasing"}),d=a.enter("reference");const b=a.safe(a.associationId(e),{before:h,after:"]",...p.current()});return d(),a.stack=x,u(),o==="full"||!g||g!==b?h+=p.move(b+"]"):o==="shortcut"?h=h.slice(0,-1):h+=p.move("]"),h}function U4(){return"!"}tE.peek=B4;function tE(e,i,a){let r=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++u<a.unsafe.length;){const d=a.unsafe[u],p=a.compilePattern(d);if(!d.atBreak)continue;let h;for(;h=p.exec(r);){let g=h.index;r.charCodeAt(g)===10&&r.charCodeAt(g-1)===13&&g--,r=r.slice(0,g)+" "+r.slice(h.index+1)}}return o+r+o}function B4(){return"`"}function nE(e,i){const a=xg(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}iE.peek=$4;function iE(e,i,a,r){const o=Sg(a),u=o==='"'?"Quote":"Apostrophe",d=a.createTracker(r);if(nE(e,a)){const x=a.stack;a.stack=x.filter(function(y){return y!=="phrasing"});const b=a.enter("autolink");let v=d.move("<");return v+=d.move(a.containerPhrasing(e,{before:v,after:">",...d.current()})),v+=d.move(">"),b(),a.stack=x,v}const p=a.enter("link");let h=a.enter("label"),g=d.move("[");return g+=d.move(a.containerPhrasing(e,{before:g,after:"](",...d.current()})),g+=d.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),g+=d.move("<"),g+=d.move(a.safe(e.url,{before:g,after:">",...d.current()})),g+=d.move(">")):(h=a.enter("destinationRaw"),g+=d.move(a.safe(e.url,{before:g,after:e.title?" ":")",...d.current()}))),h(),e.title&&(h=a.enter(`title${u}`),g+=d.move(" "+o),g+=d.move(a.safe(e.title,{before:g,after:o,...d.current()})),g+=d.move(o),h()),g+=d.move(")"),p(),g}function $4(e,i,a){return nE(e,a)?"<":"["}aE.peek=H4;function aE(e,i,a,r){const o=e.referenceType,u=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let h=p.move("[");const g=a.containerPhrasing(e,{before:h,after:"]",...p.current()});h+=p.move(g+"]["),d();const x=a.stack;a.stack=x.filter(function(v){return v!=="phrasing"}),d=a.enter("reference");const b=a.safe(a.associationId(e),{before:h,after:"]",...p.current()});return d(),a.stack=x,u(),o==="full"||!g||g!==b?h+=p.move(b+"]"):o==="shortcut"?h=h.slice(0,-1):h+=p.move("]"),h}function H4(){return"["}function Cg(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function P4(e){const i=Cg(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function F4(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function rE(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function q4(e,i,a,r){const o=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?F4(a):Cg(a);const p=e.ordered?d==="."?")":".":P4(a);let h=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&x&&(!x.children||!x.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(h=!0),rE(a)===d&&x){let b=-1;for(;++b<e.children.length;){const v=e.children[b];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(d=p),a.bulletCurrent=d;const g=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=u,o(),g}function G4(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function Y4(e,i,a,r){const o=G4(a);let u=a.bulletCurrent||Cg(a);i&&i.type==="list"&&i.ordered&&(u=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(u+" ".repeat(d-u.length)),p.shift(d);const h=a.enter("listItem"),g=a.indentLines(a.containerFlow(e,p.current()),x);return h(),g;function x(b,v,y){return v?(y?"":" ".repeat(d))+b:(y?u:u+" ".repeat(d-u.length))+b}}function K4(e,i,a,r){const o=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,r);return u(),o(),d}function V4(e,i,a,r){if(!e.children.some(function(p){return v4(p)}))return a.containerFlow(e,r);const u=a.enter("phrasing"),d=a.containerPhrasing(e,r);return u(),d}function X4(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Ag.attention=Z4;Ag.peek=Q4;function Ag(e,i,a,r){const o=a.enter("phrasing"),u=a.containerPhrasing({type:"root",children:[e]},r);return o(),u}function Z4(e,i){return{construct:"strong",markers:X4(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Q4(e,i,a){return a.options.strong||"*"}function J4(e,i,a,r){const o=i?i.children:[],u=o.indexOf(e);return a.safe(e.value,{...r,afterNode:o[u+1],beforeNode:o[u-1]})}function W4(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function ez(e,i,a){const r=(rE(a)+(a.options.ruleSpaces?" ":"")).repeat(W4(a));return a.options.ruleSpaces?r.slice(0,-1):r}const sE={blockquote:w4,break:cv,code:T4,definition:A4,emphasis:Tg,hardBreak:cv,heading:z4,html:Jk,image:Wk,imageReference:eE,inlineCode:tE,link:iE,linkReference:aE,list:q4,listItem:Y4,paragraph:K4,root:V4,strong:Ag,text:J4,thematicBreak:ez};function tz(){return{enter:{table:nz,tableData:uv,tableHeader:uv,tableRow:az},exit:{codeText:rz,table:iz,tableData:$m,tableHeader:$m,tableRow:$m}}}function nz(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function iz(e){this.exit(e),this.data.inTable=void 0}function az(e){this.enter({type:"tableRow",children:[]},e)}function $m(e){this.exit(e)}function uv(e){this.enter({type:"tableCell",children:[]},e)}function rz(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,sz));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function sz(e,i){return i==="|"?i:e}function lz(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,o=i.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
274
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:h,tableRow:p}};function d(y,k,_,S){return g(x(y,_,S),y.align)}function p(y,k,_,S){const N=b(y,_,S),M=g([N]);return M.slice(0,M.indexOf(`
|
|
275
|
+
`))}function h(y,k,_,S){const N=_.enter("tableCell"),M=_.enter("phrasing"),j=_.containerPhrasing(y,{...S,before:u,after:u});return M(),N(),j}function g(y,k){return b4(y,{align:k,alignDelimiters:r,padding:a,stringLength:o})}function x(y,k,_){const S=y.children;let N=-1;const M=[],j=k.enter("table");for(;++N<S.length;)M[N]=b(S[N],k,_);return j(),M}function b(y,k,_){const S=y.children;let N=-1;const M=[],j=k.enter("tableRow");for(;++N<S.length;)M[N]=h(S[N],y,k,_);return j(),M}function v(y,k,_){let S=sE.inlineCode(y,k,_);return _.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function oz(){return{exit:{taskListCheckValueChecked:dv,taskListCheckValueUnchecked:dv,paragraph:uz}}}function cz(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dz}}}function dv(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function uz(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const o=i.children;let u=-1,d;for(;++u<o.length;){const p=o[u];if(p.type==="paragraph"){d=p;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function dz(e,i,a,r){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);u&&p.move(d);let h=sE.listItem(e,i,a,{...r,...p.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),h;function g(x){return x+d}}function fz(){return[$D(),l4(),d4(),tz(),oz()]}function pz(e){return{extensions:[HD(),o4(e),f4(),lz(e),cz()]}}const mz={tokenize:vz,partial:!0},lE={tokenize:wz,partial:!0},oE={tokenize:kz,partial:!0},cE={tokenize:Ez,partial:!0},hz={tokenize:Nz,partial:!0},uE={name:"wwwAutolink",tokenize:bz,previous:fE},dE={name:"protocolAutolink",tokenize:yz,previous:pE},La={name:"emailAutolink",tokenize:xz,previous:mE},la={};function gz(){return{text:la}}let Xr=48;for(;Xr<123;)la[Xr]=La,Xr++,Xr===58?Xr=65:Xr===91&&(Xr=97);la[43]=La;la[45]=La;la[46]=La;la[95]=La;la[72]=[La,dE];la[104]=[La,dE];la[87]=[La,uE];la[119]=[La,uE];function xz(e,i,a){const r=this;let o,u;return d;function d(b){return!Ah(b)||!mE.call(r,r.previous)||jg(r.events)?a(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(b))}function p(b){return Ah(b)?(e.consume(b),p):b===64?(e.consume(b),h):a(b)}function h(b){return b===46?e.check(hz,x,g)(b):b===45||b===95||Mn(b)?(u=!0,e.consume(b),h):x(b)}function g(b){return e.consume(b),o=!0,h}function x(b){return u&&o&&Hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(b)):a(b)}}function bz(e,i,a){const r=this;return o;function o(d){return d!==87&&d!==119||!fE.call(r,r.previous)||jg(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mz,e.attempt(lE,e.attempt(oE,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function yz(e,i,a){const r=this;let o="",u=!1;return d;function d(b){return(b===72||b===104)&&pE.call(r,r.previous)&&!jg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(b),e.consume(b),p):a(b)}function p(b){if(Hn(b)&&o.length<5)return o+=String.fromCodePoint(b),e.consume(b),p;if(b===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(b),h}return a(b)}function h(b){return b===47?(e.consume(b),u?g:(u=!0,h)):a(b)}function g(b){return b===null||Zu(b)||Lt(b)||ns(b)||Nd(b)?a(b):e.attempt(lE,e.attempt(oE,x),a)(b)}function x(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(b)}}function vz(e,i,a){let r=0;return o;function o(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),o):d===46&&r===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):i(d)}}function wz(e,i,a){let r,o,u;return d;function d(g){return g===46||g===95?e.check(cE,h,p)(g):g===null||Lt(g)||ns(g)||g!==45&&Nd(g)?h(g):(u=!0,e.consume(g),d)}function p(g){return g===95?r=!0:(o=r,r=void 0),e.consume(g),d}function h(g){return o||r||!u?a(g):i(g)}}function kz(e,i){let a=0,r=0;return o;function o(d){return d===40?(a++,e.consume(d),o):d===41&&r<a?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(cE,i,u)(d):d===null||Lt(d)||ns(d)?i(d):(e.consume(d),o)}function u(d){return d===41&&r++,e.consume(d),o}}function Ez(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),u):p===93?(e.consume(p),o):p===60||p===null||Lt(p)||ns(p)?i(p):a(p)}function o(p){return p===null||p===40||p===91||Lt(p)||ns(p)?i(p):r(p)}function u(p){return Hn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):Hn(p)?(e.consume(p),d):a(p)}}function Nz(e,i,a){return r;function r(u){return e.consume(u),o}function o(u){return Mn(u)?a(u):i(u)}}function fE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Lt(e)}function pE(e){return!Hn(e)}function mE(e){return!(e===47||Ah(e))}function Ah(e){return e===43||e===45||e===46||e===95||Mn(e)}function jg(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const _z={tokenize:Rz,partial:!0};function Sz(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jz,continuation:{tokenize:Oz},exit:Mz}},text:{91:{name:"gfmFootnoteCall",tokenize:Az},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Tz,resolveTo:Cz}}}}function Tz(e,i,a){const r=this;let o=r.events.length;const u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;o--;){const h=r.events[o][1];if(h.type==="labelImage"){d=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return p;function p(h){if(!d||!d._balanced)return a(h);const g=Ii(r.sliceSerialize({start:d.end,end:r.now()}));return g.codePointAt(0)!==94||!u.includes(g.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),i(h))}}function Cz(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",o,i],["exit",o,i],["enter",u,i],["enter",d,i],["exit",d,i],["exit",u,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function Az(e,i,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u=0,d;return p;function p(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),h}function h(b){return b!==94?a(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",g)}function g(b){if(u>999||b===93&&!d||b===null||b===91||Lt(b))return a(b);if(b===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(Ii(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(b)}return Lt(b)||(d=!0),u++,e.consume(b),b===92?x:g}function x(b){return b===91||b===92||b===93?(e.consume(b),u++,g):g(b)}}function jz(e,i,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u,d=0,p;return h;function h(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):a(k)}function x(k){if(d>999||k===93&&!p||k===null||k===91||Lt(k))return a(k);if(k===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return u=Ii(r.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Lt(k)||(p=!0),d++,e.consume(k),k===92?b:x}function b(k){return k===91||k===92||k===93?(e.consume(k),d++,x):x(k)}function v(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),o.includes(u)||o.push(u),bt(e,y,"gfmFootnoteDefinitionWhitespace")):a(k)}function y(k){return i(k)}}function Oz(e,i,a){return e.check(Fo,i,e.attempt(_z,i,a))}function Mz(e){e.exit("gfmFootnoteDefinition")}function Rz(e,i,a){const r=this;return bt(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(u):a(u)}}function Dz(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(d,p){let h=-1;for(;++h<d.length;)if(d[h][0]==="enter"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._close){let g=h;for(;g--;)if(d[g][0]==="exit"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._open&&d[h][1].end.offset-d[h][1].start.offset===d[g][1].end.offset-d[g][1].start.offset){d[h][1].type="strikethroughSequence",d[g][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},d[g][1].start),end:Object.assign({},d[h][1].end)},b={type:"strikethroughText",start:Object.assign({},d[g][1].end),end:Object.assign({},d[h][1].start)},v=[["enter",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["enter",b,p]],y=p.parser.constructs.insideSpan.null;y&&Li(v,v.length,0,_d(y,d.slice(g+1,h),p)),Li(v,v.length,0,[["exit",b,p],["enter",d[h][1],p],["exit",d[h][1],p],["exit",x,p]]),Li(d,g-1,h-g+3,v),h=g+v.length-2;break}}for(h=-1;++h<d.length;)d[h][1].type==="strikethroughSequenceTemporary"&&(d[h][1].type="data");return d}function u(d,p,h){const g=this.previous,x=this.events;let b=0;return v;function v(k){return g===126&&x[x.length-1][1].type!=="characterEscape"?h(k):(d.enter("strikethroughSequenceTemporary"),y(k))}function y(k){const _=Ju(g);if(k===126)return b>1?h(k):(d.consume(k),b++,y);if(b<2&&!a)return h(k);const S=d.exit("strikethroughSequenceTemporary"),N=Ju(k);return S._open=!N||N===2&&!!_,S._close=!_||_===2&&!!N,p(k)}}}class zz{constructor(){this.map=[],this.index=new Map}add(i,a,r){Lz(this,i,a,r)}consume(i){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let o=r.pop();for(;o;){for(const u of o)i.push(u);o=r.pop()}this.map.length=0,this.index.clear()}}function Lz(e,i,a,r){if(a===0&&r.length===0)return;const o=e.index.get(i);if(o){o[1]+=a,o[2].push(...r);return}const u=[i,a,r];e.map.push(u),e.index.set(i,u)}function Iz(e,i){let a=!1;const r=[];for(;i<e.length;){const o=e[i];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const u=r.length-1;r[u]=r[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function Uz(){return{flow:{null:{name:"table",tokenize:Bz,resolveAll:$z}}}}function Bz(e,i,a){const r=this;let o=0,u=0,d;return p;function p(z){let $=r.events.length-1;for(;$>-1;){const{type:ce}=r.events[$][1];if(ce==="lineEnding"||ce==="linePrefix")$--;else break}const W=$>-1?r.events[$][1].type:null,de=W==="tableHead"||W==="tableRow"?L:h;return de===L&&r.parser.lazy[r.now().line]?a(z):de(z)}function h(z){return e.enter("tableHead"),e.enter("tableRow"),g(z)}function g(z){return z===124||(d=!0,u+=1),x(z)}function x(z){return z===null?a(z):Pe(z)?u>1?(u=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),y):a(z):at(z)?bt(e,x,"whitespace")(z):(u+=1,d&&(d=!1,o+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),d=!0,x):(e.enter("data"),b(z)))}function b(z){return z===null||z===124||Lt(z)?(e.exit("data"),x(z)):(e.consume(z),z===92?v:b)}function v(z){return z===92||z===124?(e.consume(z),b):b(z)}function y(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(z):(e.enter("tableDelimiterRow"),d=!1,at(z)?bt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?S(z):z===124?(d=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),_):P(z)}function _(z){return at(z)?bt(e,S,"whitespace")(z):S(z)}function S(z){return z===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),N):z===45?(u+=1,N(z)):z===null||Pe(z)?D(z):P(z)}function N(z){return z===45?(e.enter("tableDelimiterFiller"),M(z)):P(z)}function M(z){return z===45?(e.consume(z),M):z===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(z))}function j(z){return at(z)?bt(e,D,"whitespace")(z):D(z)}function D(z){return z===124?k(z):z===null||Pe(z)?!d||o!==u?P(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(z)):P(z)}function P(z){return a(z)}function L(z){return e.enter("tableRow"),T(z)}function T(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),T):z===null||Pe(z)?(e.exit("tableRow"),i(z)):at(z)?bt(e,T,"whitespace")(z):(e.enter("data"),R(z))}function R(z){return z===null||z===124||Lt(z)?(e.exit("data"),T(z)):(e.consume(z),z===92?K:R)}function K(z){return z===92||z===124?(e.consume(z),R):R(z)}}function $z(e,i){let a=-1,r=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],p=!1,h=0,g,x,b;const v=new zz;for(;++a<e.length;){const y=e[a],k=y[1];y[0]==="enter"?k.type==="tableHead"?(p=!1,h!==0&&(fv(v,i,h,g,x),x=void 0,h=0),g={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(a,0,[["enter",g,i]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,b=void 0,u=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,x={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(a,0,[["enter",x,i]])),o=k.type==="tableDelimiterRow"?2:x?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],b=Eu(v,i,u,o,void 0,b),u=[0,0,0,0]),d[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(u[1]!==0&&(d[0]=d[1],b=Eu(v,i,u,o,void 0,b)),u=d,d=[u[1],a,0,0])):k.type==="tableHead"?(p=!0,h=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(h=a,u[1]!==0?(d[0]=d[1],b=Eu(v,i,u,o,a,b)):d[1]!==0&&(b=Eu(v,i,d,o,a,b)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=a)}for(h!==0&&fv(v,i,h,g,x),v.consume(i.events),a=-1;++a<i.events.length;){const y=i.events[a];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=Iz(i.events,a))}return e}function Eu(e,i,a,r,o,u){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(u.end=Object.assign({},tl(i.events,a[0])),e.add(a[0],0,[["exit",u,i]]));const h=tl(i.events,a[1]);if(u={type:d,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",u,i]]),a[2]!==0){const g=tl(i.events,a[2]),x=tl(i.events,a[3]),b={type:p,start:Object.assign({},g),end:Object.assign({},x)};if(e.add(a[2],0,[["enter",b,i]]),r!==2){const v=i.events[a[2]],y=i.events[a[3]];if(v[1].end=Object.assign({},y[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,_=a[3]-a[2]-1;e.add(k,_,[])}}e.add(a[3]+1,0,[["exit",b,i]])}return o!==void 0&&(u.end=Object.assign({},tl(i.events,o)),e.add(o,0,[["exit",u,i]]),u=void 0),u}function fv(e,i,a,r,o){const u=[],d=tl(i.events,a);o&&(o.end=Object.assign({},d),u.push(["exit",o,i])),r.end=Object.assign({},d),u.push(["exit",r,i]),e.add(a+1,0,u)}function tl(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const Hz={name:"tasklistCheck",tokenize:Fz};function Pz(){return{text:{91:Hz}}}function Fz(e,i,a){const r=this;return o;function o(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),u)}function u(h){return Lt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),d):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),d):a(h)}function d(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(h)}function p(h){return Pe(h)?i(h):at(h)?e.check({tokenize:qz},i,a)(h):a(h)}}function qz(e,i,a){return bt(e,r,"whitespace");function r(o){return o===null?a(o):i(o)}}function Gz(e){return Sk([gz(),Sz(),Dz(e),Uz(),Pz()])}const Yz={};function Kz(e){const i=this,a=e||Yz,r=i.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),u=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(Gz(a)),u.push(fz()),d.push(pz(a))}const pv=(function(e,i,a){const r=qo(a);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof i=="number"){if(i<0||i===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(i=e.children.indexOf(i),i<0)throw new Error("Expected child node or index");for(;++i<e.children.length;)if(r(e.children[i],i,e))return e.children[i]}),ss=(function(e){if(e==null)return Zz;if(typeof e=="string")return Xz(e);if(typeof e=="object")return Vz(e);if(typeof e=="function")return Og(e);throw new Error("Expected function, string, or array as `test`")});function Vz(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=ss(e[a]);return Og(r);function r(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function Xz(e){return Og(i);function i(a){return a.tagName===e}}function Og(e){return i;function i(a,r,o){return!!(Qz(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function Zz(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Qz(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const mv=/\n/g,hv=/[\t ]+/g,jh=ss("br"),gv=ss(rL),Jz=ss("p"),xv=ss("tr"),Wz=ss(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",aL,sL]),hE=ss(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function eL(e,i){const a=i||{},r="children"in e?e.children:[],o=hE(e),u=bE(e,{whitespace:a.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...xE(e,{breakBefore:!0,breakAfter:!0}));let p=-1;for(;++p<r.length;)d.push(...gE(r[p],e,{whitespace:u,breakBefore:p?void 0:o,breakAfter:p<r.length-1?jh(r[p+1]):o}));const h=[];let g;for(p=-1;++p<d.length;){const x=d[p];typeof x=="number"?g!==void 0&&x>g&&(g=x):x&&(g!==void 0&&g>-1&&h.push(`
|
|
276
|
+
`.repeat(g)||" "),g=-1,h.push(x))}return h.join("")}function gE(e,i,a){return e.type==="element"?tL(e,i,a):e.type==="text"?a.whitespace==="normal"?xE(e,a):nL(e):[]}function tL(e,i,a){const r=bE(e,a),o=e.children||[];let u=-1,d=[];if(Wz(e))return d;let p,h;for(jh(e)||xv(e)&&pv(i,e,xv)?h=`
|
|
277
|
+
`:Jz(e)?(p=2,h=2):hE(e)&&(p=1,h=1);++u<o.length;)d=d.concat(gE(o[u],e,{whitespace:r,breakBefore:u?void 0:p,breakAfter:u<o.length-1?jh(o[u+1]):h}));return gv(e)&&pv(i,e,gv)&&d.push(" "),p&&d.unshift(p),h&&d.push(h),d}function xE(e,i){const a=String(e.value),r=[],o=[];let u=0;for(;u<=a.length;){mv.lastIndex=u;const h=mv.exec(a),g=h&&"index"in h?h.index:a.length;r.push(iL(a.slice(u,g).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?i.breakBefore:!0,g===a.length?i.breakAfter:!0)),u=g+1}let d=-1,p;for(;++d<r.length;)r[d].charCodeAt(r[d].length-1)===8203||d<r.length-1&&r[d+1].charCodeAt(0)===8203?(o.push(r[d]),p=void 0):r[d]?(typeof p=="number"&&o.push(p),o.push(r[d]),p=0):(d===0||d===r.length-1)&&o.push(0);return o}function nL(e){return[String(e.value)]}function iL(e,i,a){const r=[];let o=0,u;for(;o<e.length;){hv.lastIndex=o;const d=hv.exec(e);u=d?d.index:e.length,!o&&!u&&d&&!i&&r.push(""),o!==u&&r.push(e.slice(o,u)),o=d?u+d[0].length:u}return o!==u&&!a&&r.push(""),r.join(" ")}function bE(e,i){if(e.type==="element"){const a=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return a.wrap?"pre-wrap":"pre";case"td":case"th":return a.noWrap?"nowrap":i.whitespace;case"textarea":return"pre-wrap"}}return i.whitespace}function aL(e){return!!(e.properties||{}).hidden}function rL(e){return e.tagName==="td"||e.tagName==="th"}function sL(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function lL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+r+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",p={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},g={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:i.optional(o)+e.IDENT_RE,relevance:0},y=i.optional(o)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],N=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:_,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},P={className:"function.dispatch",relevance:0,keywords:{_hint:N},begin:i.concat(/\b/,`(?!${k.join("|")})`,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},L=[P,b,p,a,e.C_BLOCK_COMMENT_MODE,x,g],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:L.concat([{begin:/\(/,end:/\)/,keywords:D,contains:L.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:D,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,x]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,g,x,p,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,g,x,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,R,P,L,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",p]},{begin:e.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function oL(e){const i={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},a=lL(e),r=a.keywords;return r.type=[...r.type,...i.type],r.literal=[...r.literal,...i.literal],r.built_in=[...r.built_in,...i.built_in],r._hints=i._hints,a.name="Arduino",a.aliases=["ino"],a.supersetOf="cpp",a}function cL(e){const i=e.regex,a={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},p={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]};o.contains.push(p);const h={match:/\\"/},g={className:"string",begin:/'/,end:/'/},x={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,a]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=e.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],N={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],j=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],D=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:S,built_in:[...M,...j,"set","shopt",...D,...P]},contains:[y,e.SHEBANG(),k,b,u,d,N,p,h,g,x,a]}}function uL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+r+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",p={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},g={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:i.optional(o)+e.IDENT_RE,relevance:0},y=i.optional(o)+e.IDENT_RE+"\\s*\\(",S={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},N=[b,p,a,e.C_BLOCK_COMMENT_MODE,x,g],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:N.concat([{begin:/\(/,end:/\)/,keywords:S,contains:N.concat(["self"]),relevance:0}]),relevance:0},j={begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:y,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,g,x,p,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,g,x,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C",aliases:["h"],keywords:S,disableAutodetect:!0,illegal:"</",contains:[].concat(M,j,N,[b,{begin:e.IDENT_RE+"::",keywords:S},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:b,strings:g,keywords:S}}}function dL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+r+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",p={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},g={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:i.optional(o)+e.IDENT_RE,relevance:0},y=i.optional(o)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],N=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:_,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},P={className:"function.dispatch",relevance:0,keywords:{_hint:N},begin:i.concat(/\b/,`(?!${k.join("|")})`,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},L=[P,b,p,a,e.C_BLOCK_COMMENT_MODE,x,g],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:L.concat([{begin:/\(/,end:/\)/,keywords:D,contains:L.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:D,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,x]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,g,x,p,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,g,x,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,R,P,L,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",p]},{begin:e.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function fL(e){const i=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(u),built_in:i,literal:r},p=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},g={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},x={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=e.inherit(x,{illegal:/\n/}),v={className:"subst",begin:/\{/,end:/\}/,keywords:d},y=e.inherit(v,{illegal:/\n/}),k={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,y]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},S=e.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});v.contains=[_,k,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],y.contains=[S,k,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const N={variants:[g,_,k,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},p]},j=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},N,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},p,M,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[p,M,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+j+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[N,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},D]}}const pL=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),mL=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hL=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],gL=[...mL,...hL],xL=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bL=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yL=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vL=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function wL(e){const i=e.regex,a=pL(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",u=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",p=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,r,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+bL.join("|")+")"},{begin:":(:)?("+yL.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vL.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,a.UNICODE_RANGE,...p,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...p,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:i.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:xL.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...p,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+gL.join("|")+")\\b"}]}}function kL(e){const i=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:i.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:i.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function EL(e){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}function NL(e){const i=e.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:i.concat(a,i.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function _L(e){const i=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},p={begin:/\[/,end:/\]/,contains:[r,u,o,d,a,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,g=/"(\\"|[^"])*"/,x=/'[^']*'/,b=i.either(h,g,x),v=i.concat(b,"(\\s*\\.\\s*",b,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[r,p,u,o,d,a]}}]}}var nl="[0-9](_*[0-9])*",Nu=`\\.(${nl})`,_u="[0-9a-fA-F](_*[0-9a-fA-F])*",bv={className:"number",variants:[{begin:`(\\b(${nl})((${Nu})|\\.)?|(${Nu}))[eE][+-]?(${nl})[fFdD]?\\b`},{begin:`\\b(${nl})((${Nu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nu})[fFdD]?\\b`},{begin:`\\b(${nl})[fFdD]\\b`},{begin:`\\b0[xX]((${_u})\\.?|(${_u})?\\.(${_u}))[pP][+-]?(${nl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${_u})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function yE(e,i,a){return a===-1?"":e.replace(i,r=>yE(e,i,a-1))}function SL(e){const i=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=a+yE("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},x={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[i.concat(/(?!else)/,a),/\s+/,a,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,a],className:{1:"keyword",3:"title.class"},contains:[x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,bv,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},bv,g]}}const yv="[A-Za-z$_][0-9A-Za-z$_]*",TL=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],CL=["true","false","null","undefined","NaN","Infinity"],vE=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wE=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],kE=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],AL=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jL=[].concat(kE,vE,wE);function OL(e){const i=e.regex,a=(ne,{after:G})=>{const A="</"+ne[0].slice(1);return ne.input.indexOf(A,G)!==-1},r=yv,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,G)=>{const A=ne[0].length+ne.index,Se=ne.input[A];if(Se==="<"||Se===","){G.ignoreMatch();return}Se===">"&&(a(ne,{after:A})||G.ignoreMatch());let pe;const C=ne.input.substring(A);if(pe=C.match(/^\s*=/)){G.ignoreMatch();return}if((pe=C.match(/^\s+extends\s+/))&&pe.index===0){G.ignoreMatch();return}}},p={$pattern:yv,keyword:TL,literal:CL,built_in:jL,"variable.language":AL},h="[0-9](_?[0-9])*",g=`\\.(${h})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${g})|\\.)?|(${g}))[eE][+-]?(${h})\\b`},{begin:`\\b(${x})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:p,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},M={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,_,S,{match:/\$\d+/},b];v.contains=j.concat({begin:/\{/,end:/\}/,keywords:p,contains:["self"].concat(j)});const D=[].concat(M,v.contains),P=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:p,contains:["self"].concat(D)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:P},T={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,i.concat(r,"(",i.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vE,...wE]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},z={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(ne){return i.concat("(?!",ne.join("|"),")")}const de={match:i.concat(/\b/,W([...kE,"super","import","await"].map(ne=>`${ne}\\s*\\(`)),r,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:i.concat(/\./,i.lookahead(i.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ae={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:R},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,_,S,M,{match:/\$\d+/},b,R,{scope:"attr",match:r+i.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,e.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},de,$,T,ae,{match:/\$[(.]/}]}}const ML="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",RL={scope:"number",match:ML,relevance:0};function DL(e){const i={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[i,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,o,RL,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var il="[0-9](_*[0-9])*",Su=`\\.(${il})`,Tu="[0-9a-fA-F](_*[0-9a-fA-F])*",zL={className:"number",variants:[{begin:`(\\b(${il})((${Su})|\\.)?|(${Su}))[eE][+-]?(${il})[fFdD]?\\b`},{begin:`\\b(${il})((${Su})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Su})[fFdD]?\\b`},{begin:`\\b(${il})[fFdD]\\b`},{begin:`\\b0[xX]((${Tu})\\.?|(${Tu})?\\.(${Tu}))[pP][+-]?(${il})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Tu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function LL(e){const i={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,o]}]};o.contains.push(d);const p={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},h={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(d,{className:"string"}),"self"]}]},g=zL,x=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),b={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=b;return v.variants[1].contains=[b],b.variants[1].contains=[v],{name:"Kotlin",aliases:["kt","kts"],keywords:i,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,x,a,r,p,h,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:i,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[b,e.C_LINE_COMMENT_MODE,x],relevance:0},e.C_LINE_COMMENT_MODE,x,p,h,d,e.C_NUMBER_MODE]},x]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},p,h]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
278
|
+
`},g]}}const IL=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),UL=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],BL=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],$L=[...UL,...BL],HL=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),EE=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),NE=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),PL=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),FL=EE.concat(NE).sort().reverse();function qL(e){const i=IL(e),a=FL,r="and or not only",o="[\\w-]+",u="("+o+"|@\\{"+o+"\\})",d=[],p=[],h=function(j){return{className:"string",begin:"~?"+j+".*?"+j}},g=function(j,D,P){return{className:j,begin:D,relevance:P}},x={$pattern:/[a-z-]+/,keyword:r,attribute:HL.join(" ")},b={begin:"\\(",end:"\\)",contains:p,keywords:x,relevance:0};p.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h("'"),h('"'),i.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},i.UNICODE_RANGE,i.HEXCOLOR,b,g("variable","@@?"+o,10),g("variable","@\\{"+o+"\\}"),g("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},i.IMPORTANT,{beginKeywords:"and not"},i.FUNCTION_DISPATCH);const v=p.concat({begin:/\{/,end:/\}/,contains:d}),y={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(p)},k={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PL.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:p}}]},_={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:x,returnEnd:!0,contains:p,relevance:0}},S={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},N={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:u,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,g("keyword","all\\b"),g("variable","@\\{"+o+"\\}"),{begin:"\\b("+$L.join("|")+")\\b",className:"selector-tag"},i.CSS_NUMBER_MODE,g("selector-tag",u,0),g("selector-id","#"+u),g("selector-class","\\."+u,0),g("selector-tag","&",0),i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+EE.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+NE.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},i.FUNCTION_DISPATCH]},M={begin:o+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[N]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,S,M,k,N,y,i.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function GL(e){const i="\\[=*\\[",a="\\]=*\\]",r={begin:i,end:a,contains:["self"]},o=[e.COMMENT("--(?!"+i+")","$"),e.COMMENT("--"+i,a,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:i,end:a,contains:[r],relevance:5}])}}function YL(e){const i={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[i,a]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[i]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,i,a,r,o,u,d]}}function KL(e){const i=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},p=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:i.concat(/\[.+?\]\(/,p,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(g,{contains:[]}),v=e.inherit(x,{contains:[]});g.contains.push(v),x.contains.push(b);let y=[a,h];return[g,x,b,v].forEach(N=>{N.contains=N.contains.concat(y)}),y=y.concat(g,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},a,u,g,x,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},o,r,h,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function VL(e){const i={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,p={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:p,illegal:"</",contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function XL(e){const i=e.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},p={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:i.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[p]},g={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},x=[e.BACKSLASH_ESCAPE,u,h],b=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(_,S,N="\\1")=>{const M=N==="\\1"?N:i.concat(N,S);return i.concat(i.concat("(?:",_,")"),S,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,N,r)},y=(_,S,N)=>i.concat(i.concat("(?:",_,")"),S,/(?:\\.|[^\\\/])*?/,N,r),k=[h,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:x,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},g,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:v("s|tr|y",i.either(...b,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",i.either(...b,{capture:!0}),/\1/)},{begin:y("m|qr",/\(/,/\)/)},{begin:y("m|qr",/\[/,/\]/)},{begin:y("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,p]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,p,g]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=k,d.contains=k,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:k}}function ZL(e){const i=e.regex,a=/(?![A-Za-z0-9])(?![$])/,r=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),u=i.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+r},p={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},g=e.inherit(e.APOS_STRING_MODE,{illegal:null}),x=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(h)}),b={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(ce,ae)=>{ae.data._beginMatch=ce[1]||ce[2]},"on:end":(ce,ae)=>{ae.data._beginMatch!==ce[1]&&ae.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
279
|
+
]`,k={scope:"string",variants:[x,g,b,v]},_={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},S=["false","null","true"],N=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],M=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:N,literal:(ce=>{const ae=[];return ce.forEach(O=>{ae.push(O),O.toLowerCase()===O?ae.push(O.toUpperCase()):ae.push(O.toLowerCase())}),ae})(S),built_in:M},P=ce=>ce.map(ae=>ae.replace(/\|\d+$/,"")),L={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",P(M).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},T=i.concat(r,"\\b(?!\\()"),R={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,i.concat(/::/,i.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[o,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},K={scope:"attr",match:i.concat(r,i.lookahead(":"),i.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[K,d,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,_,L]},$={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",P(N).join("\\b|"),"|",P(M).join("\\b|"),"\\b)"),r,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push($);const W=[K,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,_,L],de={begin:i.concat(/#\[\s*\\?/,i.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...W]},...W,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:D,contains:[de,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},p,{scope:"variable.language",match:/\$this\b/},d,$,R,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},L,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",de,d,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,_]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},k,_]}}function QL(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function JL(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function WL(e){const i=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],p={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:p,illegal:/#/},x={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,x,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,x,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,x,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,x,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",y=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,k=`\\b|${r.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${y}))[eE][+-]?(${v})[jJ]?(?=${k})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${v})[jJ](?=${k})`}]},S={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:p,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},N={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:["self",h,_,b,e.HASH_COMMENT_MODE]}]};return g.contains=[b,_,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:p,illegal:/(<\/|\?)|=>/,contains:[h,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,S,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[N]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,N,b]}]}}function e6(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function t6(e){const i=e.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=i.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=i.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:i.lookahead(i.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[u,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function n6(e){const i=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=i.concat(r,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},p={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},g=[e.COMMENT("#","$",{contains:[p]}),e.COMMENT("^=begin","^=end",{contains:[p],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],x={className:"subst",begin:/#\{/,end:/\}/,keywords:d},b={className:"string",contains:[e.BACKSLASH_ESCAPE,x],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:i.concat(/<<[-~]?'?/,i.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,x]})]}]},v="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",k={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${y}))?([eE][+-]?(${y})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},L=[b,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[b,{begin:a}],relevance:0},k,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,x],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,g),relevance:0}].concat(h,g);x.contains=L,_.contains=L;const z=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:L}}];return g.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(z).concat(g).concat(L)}}function i6(e){const i=e.regex,a=/(r#)?/,r=i.concat(a,e.UNDERSCORE_IDENT_RE),o=i.concat(a,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,i.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",p=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],x=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:x,keyword:p,literal:h,built_in:g},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:x}},{className:"punctuation",begin:"->"},u]}}const a6=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),r6=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s6=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],l6=[...r6,...s6],o6=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),c6=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),u6=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d6=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function f6(e){const i=a6(e),a=u6,r=c6,o="@[a-z-]+",u="and or not only",p={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+l6.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+a.join("|")+")"},p,{begin:/\(/,end:/\)/,contains:[i.CSS_NUMBER_MODE]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d6.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[i.BLOCK_COMMENT,p,i.HEXCOLOR,i.CSS_NUMBER_MODE,i.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i.IMPORTANT,i.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:o6.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},p,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i.HEXCOLOR,i.CSS_NUMBER_MODE]},i.FUNCTION_DISPATCH]}}function p6(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function m6(e){const i=e.regex,a=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],p=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],x=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],v=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=x,k=[...g,...h].filter(P=>!x.includes(P)),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},N={match:i.concat(/\b/,i.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function M(P){return i.concat(/\b/,i.either(...P.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const j={scope:"keyword",match:M(v),relevance:0};function D(P,{exceptions:L,when:T}={}){const R=T;return L=L||[],P.map(K=>K.match(/\|\d+$/)||L.includes(K)?K:R(K)?`${K}|0`:K)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(k,{when:P=>P.length<3}),literal:u,type:p,built_in:b},contains:[{scope:"type",match:M(d)},j,N,_,r,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,S]}}function _E(e){return e?typeof e=="string"?e:e.source:null}function bo(e){return Ot("(?=",e,")")}function Ot(...e){return e.map(a=>_E(a)).join("")}function h6(e){const i=e[e.length-1];return typeof i=="object"&&i.constructor===Object?(e.splice(e.length-1,1),i):{}}function $n(...e){return"("+(h6(e).capture?"":"?:")+e.map(r=>_E(r)).join("|")+")"}const Mg=e=>Ot(/\b/,e,/\w$/.test(e)?/\b/:/\B/),g6=["Protocol","Type"].map(Mg),vv=["init","self"].map(Mg),x6=["Any","Self"],Hm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],wv=["false","nil","true"],b6=["assignment","associativity","higherThan","left","lowerThan","none","right"],y6=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],kv=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],SE=$n(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),TE=$n(SE,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Pm=Ot(SE,TE,"*"),CE=$n(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),td=$n(CE,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),na=Ot(CE,td,"*"),Cu=Ot(/[A-Z]/,td,"*"),v6=["attached","autoclosure",Ot(/convention\(/,$n("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ot(/objc\(/,na,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],w6=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function k6(e){const i={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,a],o={match:[/\./,$n(...g6,...vv)],className:{2:"keyword"}},u={match:Ot(/\./,$n(...Hm)),relevance:0},d=Hm.filter(Le=>typeof Le=="string").concat(["_|0"]),p=Hm.filter(Le=>typeof Le!="string").concat(x6).map(Mg),h={variants:[{className:"keyword",match:$n(...p,...vv)}]},g={$pattern:$n(/\b\w+/,/#\w+/),keyword:d.concat(y6),literal:wv},x=[o,u,h],b={match:Ot(/\./,$n(...kv)),relevance:0},v={className:"built_in",match:Ot(/\b/,$n(...kv),/(?=\()/)},y=[b,v],k={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:Pm},{match:`\\.(\\.|${TE})+`}]},S=[k,_],N="([0-9]_*)+",M="([0-9a-fA-F]_*)+",j={className:"number",relevance:0,variants:[{match:`\\b(${N})(\\.(${N}))?([eE][+-]?(${N}))?\\b`},{match:`\\b0x(${M})(\\.(${M}))?([pP][+-]?(${N}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(Le="")=>({className:"subst",variants:[{match:Ot(/\\/,Le,/[0\\tnr"']/)},{match:Ot(/\\/,Le,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Le="")=>({className:"subst",match:Ot(/\\/,Le,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(Le="")=>({className:"subst",label:"interpol",begin:Ot(/\\/,Le,/\(/),end:/\)/}),T=(Le="")=>({begin:Ot(Le,/"""/),end:Ot(/"""/,Le),contains:[D(Le),P(Le),L(Le)]}),R=(Le="")=>({begin:Ot(Le,/"/),end:Ot(/"/,Le),contains:[D(Le),L(Le)]}),K={className:"string",variants:[T(),T("#"),T("##"),T("###"),R(),R("#"),R("##"),R("###")]},z=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:z},W=Le=>{const mt=Ot(Le,/\//),Je=Ot(/\//,Le);return{begin:mt,end:Je,contains:[...z,{scope:"comment",begin:`#(?!.*${Je})`,end:/$/}]}},de={scope:"regexp",variants:[W("###"),W("##"),W("#"),$]},ce={match:Ot(/`/,na,/`/)},ae={className:"variable",match:/\$\d+/},O={className:"variable",match:`\\$${td}+`},te=[ce,ae,O],ne={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:w6,contains:[...S,j,K]}]}},G={scope:"keyword",match:Ot(/@/,$n(...v6),bo($n(/\(/,/\s+/)))},A={scope:"meta",match:Ot(/@/,na)},Se=[ne,G,A],pe={match:bo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ot(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,td,"+")},{className:"type",match:Cu,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ot(/\s+&\s+/,bo(Cu)),relevance:0}]},C={begin:/</,end:/>/,keywords:g,contains:[...r,...x,...Se,k,pe]};pe.contains.push(C);const I={match:Ot(na,/\s*:/),keywords:"_|0",relevance:0},se={begin:/\(/,end:/\)/,relevance:0,keywords:g,contains:["self",I,...r,de,...x,...y,...S,j,K,...te,...Se,pe]},he={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,pe]},ke={begin:$n(bo(Ot(na,/\s*:/)),bo(Ot(na,/\s+/,na,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:na}]},ze={begin:/\(/,end:/\)/,keywords:g,contains:[ke,...r,...x,...S,j,K,...Se,pe,se],endsParent:!0,illegal:/["']/},He={match:[/(func|macro)/,/\s+/,$n(ce.match,na,Pm)],className:{1:"keyword",3:"title.function"},contains:[he,ze,i],illegal:[/\[/,/%/]},$e={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[he,ze,i],illegal:/\[|%/},X={match:[/operator/,/\s+/,Pm],className:{1:"keyword",3:"title"}},Z={begin:[/precedencegroup/,/\s+/,Cu],className:{1:"keyword",3:"title"},contains:[pe],keywords:[...b6,...wv],end:/}/},Te={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},rt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ct={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,na,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:g,contains:[he,...x,{begin:/:/,end:/\{/,keywords:g,contains:[{scope:"title.class.inherited",match:Cu},...x],relevance:0}]};for(const Le of K.variants){const mt=Le.contains.find(Gt=>Gt.label==="interpol");mt.keywords=g;const Je=[...x,...y,...S,j,K,...te];mt.contains=[...Je,{begin:/\(/,end:/\)/,contains:["self",...Je]}]}return{name:"Swift",keywords:g,contains:[...r,He,$e,Te,rt,ct,X,Z,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},de,...x,...y,...S,j,K,...te,...Se,pe,se]}}const nd="[A-Za-z$_][0-9A-Za-z$_]*",AE=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],jE=["true","false","null","undefined","NaN","Infinity"],OE=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ME=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],RE=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],DE=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zE=[].concat(RE,OE,ME);function E6(e){const i=e.regex,a=(ne,{after:G})=>{const A="</"+ne[0].slice(1);return ne.input.indexOf(A,G)!==-1},r=nd,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,G)=>{const A=ne[0].length+ne.index,Se=ne.input[A];if(Se==="<"||Se===","){G.ignoreMatch();return}Se===">"&&(a(ne,{after:A})||G.ignoreMatch());let pe;const C=ne.input.substring(A);if(pe=C.match(/^\s*=/)){G.ignoreMatch();return}if((pe=C.match(/^\s+extends\s+/))&&pe.index===0){G.ignoreMatch();return}}},p={$pattern:nd,keyword:AE,literal:jE,built_in:zE,"variable.language":DE},h="[0-9](_?[0-9])*",g=`\\.(${h})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${g})|\\.)?|(${g}))[eE][+-]?(${h})\\b`},{begin:`\\b(${x})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:p,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},M={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,_,S,{match:/\$\d+/},b];v.contains=j.concat({begin:/\{/,end:/\}/,keywords:p,contains:["self"].concat(j)});const D=[].concat(M,v.contains),P=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:p,contains:["self"].concat(D)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:P},T={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,i.concat(r,"(",i.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...OE,...ME]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},z={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(ne){return i.concat("(?!",ne.join("|"),")")}const de={match:i.concat(/\b/,W([...RE,"super","import","await"].map(ne=>`${ne}\\s*\\(`)),r,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:i.concat(/\./,i.lookahead(i.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ae={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:R},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,_,S,M,{match:/\$\d+/},b,R,{scope:"attr",match:r+i.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,e.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},de,$,T,ae,{match:/\$[(.]/}]}}function N6(e){const i=e.regex,a=E6(e),r=nd,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[a.exports.CLASS_REFERENCE]},p={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:nd,keyword:AE.concat(h),literal:jE,built_in:zE.concat(o),"variable.language":DE},x={className:"meta",begin:"@"+r},b=(_,S,N)=>{const M=_.contains.findIndex(j=>j.label===S);if(M===-1)throw new Error("can not find mode to replace");_.contains.splice(M,1,N)};Object.assign(a.keywords,g),a.exports.PARAMS_CONTAINS.push(x);const v=a.contains.find(_=>_.scope==="attr"),y=Object.assign({},v,{match:i.concat(r,i.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,v,y]),a.contains=a.contains.concat([x,u,d,y]),b(a,"shebang",e.SHEBANG()),b(a,"use_strict",p);const k=a.contains.find(_=>_.label==="func.def");return k.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function _6(e){const i=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,p=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:i.concat(/# */,i.either(u,o),/ *#/)},{begin:i.concat(/# */,p,/ *#/)},{begin:i.concat(/# */,d,/ *#/)},{begin:i.concat(/# */,i.either(u,o),/ +/,i.either(d,p),/ *#/)}]},g={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},x={className:"label",begin:/^\w+:/},b=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,r,h,g,x,b,v,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[v]}]}}function S6(e){e.regex;const i=e.COMMENT(/\(;/,/;\)/);i.contains.push("self");const a=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},p={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},g={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[a,i,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,d,o,e.QUOTE_STRING_MODE,h,g,p]}}function T6(e){const i=e.regex,a=i.concat(/[\p{L}_]/u,i.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(u,{begin:/\(/,end:/\)/}),p=e.inherit(e.APOS_STRING_MODE,{className:"string"}),h=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,h,p,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,d,h,p]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:i.concat(/</,i.lookahead(i.concat(a,i.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:g}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function C6(e){const i="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},p=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},k={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},S=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:i,keywords:{literal:i}},v,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},k,_,u,d],N=[...S];return N.pop(),N.push(p),y.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}const A6={arduino:oL,bash:cL,c:uL,cpp:dL,csharp:fL,css:wL,diff:kL,go:EL,graphql:NL,ini:_L,java:SL,javascript:OL,json:DL,kotlin:LL,less:qL,lua:GL,makefile:YL,markdown:KL,objectivec:VL,perl:XL,php:ZL,"php-template":QL,plaintext:JL,python:WL,"python-repl":e6,r:t6,ruby:n6,rust:i6,scss:f6,shell:p6,sql:m6,swift:k6,typescript:N6,vbnet:_6,wasm:S6,xml:T6,yaml:C6};var Fm,Ev;function j6(){if(Ev)return Fm;Ev=1;function e(H){return H instanceof Map?H.clear=H.delete=H.set=function(){throw new Error("map is read-only")}:H instanceof Set&&(H.add=H.clear=H.delete=function(){throw new Error("set is read-only")}),Object.freeze(H),Object.getOwnPropertyNames(H).forEach(ue=>{const Ne=H[ue],Ve=typeof Ne;(Ve==="object"||Ve==="function")&&!Object.isFrozen(Ne)&&e(Ne)}),H}class i{constructor(ue){ue.data===void 0&&(ue.data={}),this.data=ue.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(H){return H.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(H,...ue){const Ne=Object.create(null);for(const Ve in H)Ne[Ve]=H[Ve];return ue.forEach(function(Ve){for(const Rt in Ve)Ne[Rt]=Ve[Rt]}),Ne}const o="</span>",u=H=>!!H.scope,d=(H,{prefix:ue})=>{if(H.startsWith("language:"))return H.replace("language:","language-");if(H.includes(".")){const Ne=H.split(".");return[`${ue}${Ne.shift()}`,...Ne.map((Ve,Rt)=>`${Ve}${"_".repeat(Rt+1)}`)].join(" ")}return`${ue}${H}`};class p{constructor(ue,Ne){this.buffer="",this.classPrefix=Ne.classPrefix,ue.walk(this)}addText(ue){this.buffer+=a(ue)}openNode(ue){if(!u(ue))return;const Ne=d(ue.scope,{prefix:this.classPrefix});this.span(Ne)}closeNode(ue){u(ue)&&(this.buffer+=o)}value(){return this.buffer}span(ue){this.buffer+=`<span class="${ue}">`}}const h=(H={})=>{const ue={children:[]};return Object.assign(ue,H),ue};class g{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ue){this.top.children.push(ue)}openNode(ue){const Ne=h({scope:ue});this.add(Ne),this.stack.push(Ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ue){return this.constructor._walk(ue,this.rootNode)}static _walk(ue,Ne){return typeof Ne=="string"?ue.addText(Ne):Ne.children&&(ue.openNode(Ne),Ne.children.forEach(Ve=>this._walk(ue,Ve)),ue.closeNode(Ne)),ue}static _collapse(ue){typeof ue!="string"&&ue.children&&(ue.children.every(Ne=>typeof Ne=="string")?ue.children=[ue.children.join("")]:ue.children.forEach(Ne=>{g._collapse(Ne)}))}}class x extends g{constructor(ue){super(),this.options=ue}addText(ue){ue!==""&&this.add(ue)}startScope(ue){this.openNode(ue)}endScope(){this.closeNode()}__addSublanguage(ue,Ne){const Ve=ue.root;Ne&&(Ve.scope=`language:${Ne}`),this.add(Ve)}toHTML(){return new p(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(H){return H?typeof H=="string"?H:H.source:null}function v(H){return _("(?=",H,")")}function y(H){return _("(?:",H,")*")}function k(H){return _("(?:",H,")?")}function _(...H){return H.map(Ne=>b(Ne)).join("")}function S(H){const ue=H[H.length-1];return typeof ue=="object"&&ue.constructor===Object?(H.splice(H.length-1,1),ue):{}}function N(...H){return"("+(S(H).capture?"":"?:")+H.map(Ve=>b(Ve)).join("|")+")"}function M(H){return new RegExp(H.toString()+"|").exec("").length-1}function j(H,ue){const Ne=H&&H.exec(ue);return Ne&&Ne.index===0}const D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(H,{joinWith:ue}){let Ne=0;return H.map(Ve=>{Ne+=1;const Rt=Ne;let ft=b(Ve),Ce="";for(;ft.length>0;){const Ee=D.exec(ft);if(!Ee){Ce+=ft;break}Ce+=ft.substring(0,Ee.index),ft=ft.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?Ce+="\\"+String(Number(Ee[1])+Rt):(Ce+=Ee[0],Ee[0]==="("&&Ne++)}return Ce}).map(Ve=>`(${Ve})`).join(ue)}const L=/\b\B/,T="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",K="\\b\\d+(\\.\\d+)?",z="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$="\\b(0b[01]+)",W="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",de=(H={})=>{const ue=/^#![ ]*\//;return H.binary&&(H.begin=_(ue,/.*\b/,H.binary,/\b.*/)),r({scope:"meta",begin:ue,end:/$/,relevance:0,"on:begin":(Ne,Ve)=>{Ne.index!==0&&Ve.ignoreMatch()}},H)},ce={begin:"\\\\[\\s\\S]",relevance:0},ae={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ce]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ce]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ne=function(H,ue,Ne={}){const Ve=r({scope:"comment",begin:H,end:ue,contains:[]},Ne);Ve.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Rt=N("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ve.contains.push({begin:_(/[ ]+/,"(",Rt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ve},G=ne("//","$"),A=ne("/\\*","\\*/"),Se=ne("#","$"),pe={scope:"number",begin:K,relevance:0},C={scope:"number",begin:z,relevance:0},I={scope:"number",begin:$,relevance:0},se={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ce,{begin:/\[/,end:/\]/,relevance:0,contains:[ce]}]},he={scope:"title",begin:T,relevance:0},ke={scope:"title",begin:R,relevance:0},ze={begin:"\\.\\s*"+R,relevance:0};var $e=Object.freeze({__proto__:null,APOS_STRING_MODE:ae,BACKSLASH_ESCAPE:ce,BINARY_NUMBER_MODE:I,BINARY_NUMBER_RE:$,COMMENT:ne,C_BLOCK_COMMENT_MODE:A,C_LINE_COMMENT_MODE:G,C_NUMBER_MODE:C,C_NUMBER_RE:z,END_SAME_AS_BEGIN:function(H){return Object.assign(H,{"on:begin":(ue,Ne)=>{Ne.data._beginMatch=ue[1]},"on:end":(ue,Ne)=>{Ne.data._beginMatch!==ue[1]&&Ne.ignoreMatch()}})},HASH_COMMENT_MODE:Se,IDENT_RE:T,MATCH_NOTHING_RE:L,METHOD_GUARD:ze,NUMBER_MODE:pe,NUMBER_RE:K,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:O,REGEXP_MODE:se,RE_STARTERS_RE:W,SHEBANG:de,TITLE_MODE:he,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:ke});function X(H,ue){H.input[H.index-1]==="."&&ue.ignoreMatch()}function Z(H,ue){H.className!==void 0&&(H.scope=H.className,delete H.className)}function Te(H,ue){ue&&H.beginKeywords&&(H.begin="\\b("+H.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",H.__beforeBegin=X,H.keywords=H.keywords||H.beginKeywords,delete H.beginKeywords,H.relevance===void 0&&(H.relevance=0))}function rt(H,ue){Array.isArray(H.illegal)&&(H.illegal=N(...H.illegal))}function ct(H,ue){if(H.match){if(H.begin||H.end)throw new Error("begin & end are not supported with match");H.begin=H.match,delete H.match}}function Le(H,ue){H.relevance===void 0&&(H.relevance=1)}const mt=(H,ue)=>{if(!H.beforeMatch)return;if(H.starts)throw new Error("beforeMatch cannot be used with starts");const Ne=Object.assign({},H);Object.keys(H).forEach(Ve=>{delete H[Ve]}),H.keywords=Ne.keywords,H.begin=_(Ne.beforeMatch,v(Ne.begin)),H.starts={relevance:0,contains:[Object.assign(Ne,{endsParent:!0})]},H.relevance=0,delete Ne.beforeMatch},Je=["of","and","for","in","not","or","if","then","parent","list","value"],Gt="keyword";function An(H,ue,Ne=Gt){const Ve=Object.create(null);return typeof H=="string"?Rt(Ne,H.split(" ")):Array.isArray(H)?Rt(Ne,H):Object.keys(H).forEach(function(ft){Object.assign(Ve,An(H[ft],ue,ft))}),Ve;function Rt(ft,Ce){ue&&(Ce=Ce.map(Ee=>Ee.toLowerCase())),Ce.forEach(function(Ee){const Ge=Ee.split("|");Ve[Ge[0]]=[ft,xn(Ge[0],Ge[1])]})}}function xn(H,ue){return ue?Number(ue):fe(H)?0:1}function fe(H){return Je.includes(H.toLowerCase())}const qe={},ht=H=>{console.error(H)},xt=(H,...ue)=>{console.log(`WARN: ${H}`,...ue)},ln=(H,ue)=>{qe[`${H}/${ue}`]||(console.log(`Deprecated as of ${H}. ${ue}`),qe[`${H}/${ue}`]=!0)},re=new Error;function ye(H,ue,{key:Ne}){let Ve=0;const Rt=H[Ne],ft={},Ce={};for(let Ee=1;Ee<=ue.length;Ee++)Ce[Ee+Ve]=Rt[Ee],ft[Ee+Ve]=!0,Ve+=M(ue[Ee-1]);H[Ne]=Ce,H[Ne]._emit=ft,H[Ne]._multi=!0}function Ue(H){if(Array.isArray(H.begin)){if(H.skip||H.excludeBegin||H.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),re;if(typeof H.beginScope!="object"||H.beginScope===null)throw ht("beginScope must be object"),re;ye(H,H.begin,{key:"beginScope"}),H.begin=P(H.begin,{joinWith:""})}}function Ke(H){if(Array.isArray(H.end)){if(H.skip||H.excludeEnd||H.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),re;if(typeof H.endScope!="object"||H.endScope===null)throw ht("endScope must be object"),re;ye(H,H.end,{key:"endScope"}),H.end=P(H.end,{joinWith:""})}}function Xt(H){H.scope&&typeof H.scope=="object"&&H.scope!==null&&(H.beginScope=H.scope,delete H.scope)}function Nt(H){Xt(H),typeof H.beginScope=="string"&&(H.beginScope={_wrap:H.beginScope}),typeof H.endScope=="string"&&(H.endScope={_wrap:H.endScope}),Ue(H),Ke(H)}function on(H){function ue(Ce,Ee){return new RegExp(b(Ce),"m"+(H.case_insensitive?"i":"")+(H.unicodeRegex?"u":"")+(Ee?"g":""))}class Ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,Ge){Ge.position=this.position++,this.matchIndexes[this.matchAt]=Ge,this.regexes.push([Ge,Ee]),this.matchAt+=M(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(Ge=>Ge[1]);this.matcherRe=ue(P(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const Ge=this.matcherRe.exec(Ee);if(!Ge)return null;const Qt=Ge.findIndex((Hi,Ua)=>Ua>0&&Hi!==void 0),Ht=this.matchIndexes[Qt];return Ge.splice(0,Qt),Object.assign(Ge,Ht)}}class Ve{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const Ge=new Ne;return this.rules.slice(Ee).forEach(([Qt,Ht])=>Ge.addRule(Qt,Ht)),Ge.compile(),this.multiRegexes[Ee]=Ge,Ge}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,Ge){this.rules.push([Ee,Ge]),Ge.type==="begin"&&this.count++}exec(Ee){const Ge=this.getMatcher(this.regexIndex);Ge.lastIndex=this.lastIndex;let Qt=Ge.exec(Ee);if(this.resumingScanAtSamePosition()&&!(Qt&&Qt.index===this.lastIndex)){const Ht=this.getMatcher(0);Ht.lastIndex=this.lastIndex+1,Qt=Ht.exec(Ee)}return Qt&&(this.regexIndex+=Qt.position+1,this.regexIndex===this.count&&this.considerAll()),Qt}}function Rt(Ce){const Ee=new Ve;return Ce.contains.forEach(Ge=>Ee.addRule(Ge.begin,{rule:Ge,type:"begin"})),Ce.terminatorEnd&&Ee.addRule(Ce.terminatorEnd,{type:"end"}),Ce.illegal&&Ee.addRule(Ce.illegal,{type:"illegal"}),Ee}function ft(Ce,Ee){const Ge=Ce;if(Ce.isCompiled)return Ge;[Z,ct,Nt,mt].forEach(Ht=>Ht(Ce,Ee)),H.compilerExtensions.forEach(Ht=>Ht(Ce,Ee)),Ce.__beforeBegin=null,[Te,rt,Le].forEach(Ht=>Ht(Ce,Ee)),Ce.isCompiled=!0;let Qt=null;return typeof Ce.keywords=="object"&&Ce.keywords.$pattern&&(Ce.keywords=Object.assign({},Ce.keywords),Qt=Ce.keywords.$pattern,delete Ce.keywords.$pattern),Qt=Qt||/\w+/,Ce.keywords&&(Ce.keywords=An(Ce.keywords,H.case_insensitive)),Ge.keywordPatternRe=ue(Qt,!0),Ee&&(Ce.begin||(Ce.begin=/\B|\b/),Ge.beginRe=ue(Ge.begin),!Ce.end&&!Ce.endsWithParent&&(Ce.end=/\B|\b/),Ce.end&&(Ge.endRe=ue(Ge.end)),Ge.terminatorEnd=b(Ge.end)||"",Ce.endsWithParent&&Ee.terminatorEnd&&(Ge.terminatorEnd+=(Ce.end?"|":"")+Ee.terminatorEnd)),Ce.illegal&&(Ge.illegalRe=ue(Ce.illegal)),Ce.contains||(Ce.contains=[]),Ce.contains=[].concat(...Ce.contains.map(function(Ht){return ki(Ht==="self"?Ce:Ht)})),Ce.contains.forEach(function(Ht){ft(Ht,Ge)}),Ce.starts&&ft(Ce.starts,Ee),Ge.matcher=Rt(Ge),Ge}if(H.compilerExtensions||(H.compilerExtensions=[]),H.contains&&H.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return H.classNameAliases=r(H.classNameAliases||{}),ft(H)}function bn(H){return H?H.endsWithParent||bn(H.starts):!1}function ki(H){return H.variants&&!H.cachedVariants&&(H.cachedVariants=H.variants.map(function(ue){return r(H,{variants:null},ue)})),H.cachedVariants?H.cachedVariants:bn(H)?r(H,{starts:H.starts?r(H.starts):null}):Object.isFrozen(H)?r(H):H}var Ei="11.11.2";class oa extends Error{constructor(ue,Ne){super(ue),this.name="HTMLInjectionError",this.html=Ne}}const Ia=a,Zt=r,dn=Symbol("nomatch"),Ni=7,zn=function(H){const ue=Object.create(null),Ne=Object.create(null),Ve=[];let Rt=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Ce={disableAutodetect:!0,name:"Plain text",contains:[]};let Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:x};function Ge(ge){return Ee.noHighlightRe.test(ge)}function Qt(ge){let Re=ge.className+" ";Re+=ge.parentNode?ge.parentNode.className:"";const st=Ee.languageDetectRe.exec(Re);if(st){const At=Si(st[1]);return At||(xt(ft.replace("{}",st[1])),xt("Falling back to no-highlight mode for this block.",ge)),At?st[1]:"no-highlight"}return Re.split(/\s+/).find(At=>Ge(At)||Si(At))}function Ht(ge,Re,st){let At="",Yt="";typeof Re=="object"?(At=ge,st=Re.ignoreIllegals,Yt=Re.language):(ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),ln("10.7.0",`Please use highlight(code, options) instead.
|
|
280
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Yt=ge,At=Re),st===void 0&&(st=!0);const Fn={code:At,language:Yt};Pn("before:highlight",Fn);const qn=Fn.result?Fn.result:Hi(Fn.language,Fn.code,st);return qn.code=Fn.code,Pn("after:highlight",qn),qn}function Hi(ge,Re,st,At){const Yt=Object.create(null);function Fn(_e,De){return _e.keywords[De]}function qn(){if(!Ze.keywords){Wt.addText(yt);return}let _e=0;Ze.keywordPatternRe.lastIndex=0;let De=Ze.keywordPatternRe.exec(yt),We="";for(;De;){We+=yt.substring(_e,De.index);const vt=ci.case_insensitive?De[0].toLowerCase():De[0],_t=Fn(Ze,vt);if(_t){const[Jn,ec]=_t;if(Wt.addText(We),We="",Yt[vt]=(Yt[vt]||0)+1,Yt[vt]<=Ni&&(ma+=ec),Jn.startsWith("_"))We+=De[0];else{const yl=ci.classNameAliases[Jn]||Jn;pn(De[0],yl)}}else We+=De[0];_e=Ze.keywordPatternRe.lastIndex,De=Ze.keywordPatternRe.exec(yt)}We+=yt.substring(_e),Wt.addText(We)}function ua(){if(yt==="")return;let _e=null;if(typeof Ze.subLanguage=="string"){if(!ue[Ze.subLanguage]){Wt.addText(yt);return}_e=Hi(Ze.subLanguage,yt,!0,pt[Ze.subLanguage]),pt[Ze.subLanguage]=_e._top}else _e=Ba(yt,Ze.subLanguage.length?Ze.subLanguage:null);Ze.relevance>0&&(ma+=_e.relevance),Wt.__addSublanguage(_e._emitter,_e.language)}function fn(){Ze.subLanguage!=null?ua():qn(),yt=""}function pn(_e,De){_e!==""&&(Wt.startScope(De),Wt.addText(_e),Wt.endScope())}function da(_e,De){let We=1;const vt=De.length-1;for(;We<=vt;){if(!_e._emit[We]){We++;continue}const _t=ci.classNameAliases[_e[We]]||_e[We],Jn=De[We];_t?pn(Jn,_t):(yt=Jn,qn(),yt=""),We++}}function Pa(_e,De){return _e.scope&&typeof _e.scope=="string"&&Wt.openNode(ci.classNameAliases[_e.scope]||_e.scope),_e.beginScope&&(_e.beginScope._wrap?(pn(yt,ci.classNameAliases[_e.beginScope._wrap]||_e.beginScope._wrap),yt=""):_e.beginScope._multi&&(da(_e.beginScope,De),yt="")),Ze=Object.create(_e,{parent:{value:Ze}}),Ze}function fa(_e,De,We){let vt=j(_e.endRe,We);if(vt){if(_e["on:end"]){const _t=new i(_e);_e["on:end"](De,_t),_t.isMatchIgnored&&(vt=!1)}if(vt){for(;_e.endsParent&&_e.parent;)_e=_e.parent;return _e}}if(_e.endsWithParent)return fa(_e.parent,De,We)}function Jt(_e){return Ze.matcher.regexIndex===0?(yt+=_e[0],1):(cs=!0,0)}function Zo(_e){const De=_e[0],We=_e.rule,vt=new i(We),_t=[We.__beforeBegin,We["on:begin"]];for(const Jn of _t)if(Jn&&(Jn(_e,vt),vt.isMatchIgnored))return Jt(De);return We.skip?yt+=De:(We.excludeBegin&&(yt+=De),fn(),!We.returnBegin&&!We.excludeBegin&&(yt=De)),Pa(We,_e),We.returnBegin?0:De.length}function Qo(_e){const De=_e[0],We=Re.substring(_e.index),vt=fa(Ze,_e,We);if(!vt)return dn;const _t=Ze;Ze.endScope&&Ze.endScope._wrap?(fn(),pn(De,Ze.endScope._wrap)):Ze.endScope&&Ze.endScope._multi?(fn(),da(Ze.endScope,_e)):_t.skip?yt+=De:(_t.returnEnd||_t.excludeEnd||(yt+=De),fn(),_t.excludeEnd&&(yt=De));do Ze.scope&&Wt.closeNode(),!Ze.skip&&!Ze.subLanguage&&(ma+=Ze.relevance),Ze=Ze.parent;while(Ze!==vt.parent);return vt.starts&&Pa(vt.starts,_e),_t.returnEnd?0:De.length}function Jo(){const _e=[];for(let De=Ze;De!==ci;De=De.parent)De.scope&&_e.unshift(De.scope);_e.forEach(De=>Wt.openNode(De))}let oi={};function pa(_e,De){const We=De&&De[0];if(yt+=_e,We==null)return fn(),0;if(oi.type==="begin"&&De.type==="end"&&oi.index===De.index&&We===""){if(yt+=Re.slice(De.index,De.index+1),!Rt){const vt=new Error(`0 width match regex (${ge})`);throw vt.languageName=ge,vt.badRule=oi.rule,vt}return 1}if(oi=De,De.type==="begin")return Zo(De);if(De.type==="illegal"&&!st){const vt=new Error('Illegal lexeme "'+We+'" for mode "'+(Ze.scope||"<unnamed>")+'"');throw vt.mode=Ze,vt}else if(De.type==="end"){const vt=Qo(De);if(vt!==dn)return vt}if(De.type==="illegal"&&We==="")return De.index===Re.length||(yt+=`
|
|
281
|
+
`),1;if(vn>1e5&&vn>De.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=We,We.length}const ci=Si(ge);if(!ci)throw ht(ft.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const Wo=on(ci);let os="",Ze=At||Wo;const pt={},Wt=new Ee.__emitter(Ee);Jo();let yt="",ma=0,yn=0,vn=0,cs=!1;try{if(ci.__emitTokens)ci.__emitTokens(Re,Wt);else{for(Ze.matcher.considerAll();;){vn++,cs?cs=!1:Ze.matcher.considerAll(),Ze.matcher.lastIndex=yn;const _e=Ze.matcher.exec(Re);if(!_e)break;const De=Re.substring(yn,_e.index),We=pa(De,_e);yn=_e.index+We}pa(Re.substring(yn))}return Wt.finalize(),os=Wt.toHTML(),{language:ge,value:os,relevance:ma,illegal:!1,_emitter:Wt,_top:Ze}}catch(_e){if(_e.message&&_e.message.includes("Illegal"))return{language:ge,value:Ia(Re),illegal:!0,relevance:0,_illegalBy:{message:_e.message,index:yn,context:Re.slice(yn-100,yn+100),mode:_e.mode,resultSoFar:os},_emitter:Wt};if(Rt)return{language:ge,value:Ia(Re),illegal:!1,relevance:0,errorRaised:_e,_emitter:Wt,_top:Ze};throw _e}}function Ua(ge){const Re={value:Ia(ge),illegal:!1,relevance:0,_top:Ce,_emitter:new Ee.__emitter(Ee)};return Re._emitter.addText(ge),Re}function Ba(ge,Re){Re=Re||Ee.languages||Object.keys(ue);const st=Ua(ge),At=Re.filter(Si).filter(ls).map(fn=>Hi(fn,ge,!1));At.unshift(st);const Yt=At.sort((fn,pn)=>{if(fn.relevance!==pn.relevance)return pn.relevance-fn.relevance;if(fn.language&&pn.language){if(Si(fn.language).supersetOf===pn.language)return 1;if(Si(pn.language).supersetOf===fn.language)return-1}return 0}),[Fn,qn]=Yt,ua=Fn;return ua.secondBest=qn,ua}function ca(ge,Re,st){const At=Re&&Ne[Re]||st;ge.classList.add("hljs"),ge.classList.add(`language-${At}`)}function $a(ge){let Re=null;const st=Qt(ge);if(Ge(st))return;if(Pn("before:highlightElement",{el:ge,language:st}),ge.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ge);return}if(ge.children.length>0&&(Ee.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ge)),Ee.throwUnescapedHTML))throw new oa("One of your code blocks includes unescaped HTML.",ge.innerHTML);Re=ge;const At=Re.textContent,Yt=st?Ht(At,{language:st,ignoreIllegals:!0}):Ba(At);ge.innerHTML=Yt.value,ge.dataset.highlighted="yes",ca(ge,st,Yt.language),ge.result={language:Yt.language,re:Yt.relevance,relevance:Yt.relevance},Yt.secondBest&&(ge.secondBest={language:Yt.secondBest.language,relevance:Yt.secondBest.relevance}),Pn("after:highlightElement",{el:ge,result:Yt,text:At})}function Sr(ge){Ee=Zt(Ee,ge)}const Yo=()=>{Ha(),ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function jd(){Ha(),ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let gl=!1;function Ha(){function ge(){Ha()}if(document.readyState==="loading"){gl||window.addEventListener("DOMContentLoaded",ge,!1),gl=!0;return}document.querySelectorAll(Ee.cssSelector).forEach($a)}function Tr(ge,Re){let st=null;try{st=Re(H)}catch(At){if(ht("Language definition for '{}' could not be registered.".replace("{}",ge)),Rt)ht(At);else throw At;st=Ce}st.name||(st.name=ge),ue[ge]=st,st.rawDefinition=Re.bind(null,H),st.aliases&&xl(st.aliases,{languageName:ge})}function Od(ge){delete ue[ge];for(const Re of Object.keys(Ne))Ne[Re]===ge&&delete Ne[Re]}function Ko(){return Object.keys(ue)}function Si(ge){return ge=(ge||"").toLowerCase(),ue[ge]||ue[Ne[ge]]}function xl(ge,{languageName:Re}){typeof ge=="string"&&(ge=[ge]),ge.forEach(st=>{Ne[st.toLowerCase()]=Re})}function ls(ge){const Re=Si(ge);return Re&&!Re.disableAutodetect}function bl(ge){ge["before:highlightBlock"]&&!ge["before:highlightElement"]&&(ge["before:highlightElement"]=Re=>{ge["before:highlightBlock"](Object.assign({block:Re.el},Re))}),ge["after:highlightBlock"]&&!ge["after:highlightElement"]&&(ge["after:highlightElement"]=Re=>{ge["after:highlightBlock"](Object.assign({block:Re.el},Re))})}function Vo(ge){bl(ge),Ve.push(ge)}function Xo(ge){const Re=Ve.indexOf(ge);Re!==-1&&Ve.splice(Re,1)}function Pn(ge,Re){const st=ge;Ve.forEach(function(At){At[st]&&At[st](Re)})}function cn(ge){return ln("10.7.0","highlightBlock will be removed entirely in v12.0"),ln("10.7.0","Please use highlightElement now."),$a(ge)}Object.assign(H,{highlight:Ht,highlightAuto:Ba,highlightAll:Ha,highlightElement:$a,highlightBlock:cn,configure:Sr,initHighlighting:Yo,initHighlightingOnLoad:jd,registerLanguage:Tr,unregisterLanguage:Od,listLanguages:Ko,getLanguage:Si,registerAliases:xl,autoDetection:ls,inherit:Zt,addPlugin:Vo,removePlugin:Xo}),H.debugMode=function(){Rt=!1},H.safeMode=function(){Rt=!0},H.versionString=Ei,H.regex={concat:_,lookahead:v,either:N,optional:k,anyNumberOfTimes:y};for(const ge in $e)typeof $e[ge]=="object"&&e($e[ge]);return Object.assign(H,$e),H},_i=zn({});return _i.newInstance=()=>zn({}),Fm=_i,_i.HighlightJS=_i,_i.default=_i,Fm}var O6=j6();const M6=ad(O6),Nv={},R6="hljs-";function D6(e){const i=M6.newInstance();return e&&u(e),{highlight:a,highlightAuto:r,listLanguages:o,register:u,registerAlias:d,registered:p};function a(h,g,x){const b=x||Nv,v=typeof b.prefix=="string"?b.prefix:R6;if(!i.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");i.configure({__emitter:z6,classPrefix:v});const y=i.highlight(g,{ignoreIllegals:!0,language:h});if(y.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:y.errorRaised});const k=y._emitter.root,_=k.data;return _.language=y.language,_.relevance=y.relevance,k}function r(h,g){const b=(g||Nv).subset||o();let v=-1,y=0,k;for(;++v<b.length;){const _=b[v];if(!i.getLanguage(_))continue;const S=a(_,h,g);S.data&&S.data.relevance!==void 0&&S.data.relevance>y&&(y=S.data.relevance,k=S)}return k||{type:"root",children:[],data:{language:void 0,relevance:y}}}function o(){return i.listLanguages()}function u(h,g){if(typeof h=="string")i.registerLanguage(h,g);else{let x;for(x in h)Object.hasOwn(h,x)&&i.registerLanguage(x,h[x])}}function d(h,g){if(typeof h=="string")i.registerAliases(typeof g=="string"?g:[...g],{languageName:h});else{let x;for(x in h)if(Object.hasOwn(h,x)){const b=h[x];i.registerAliases(typeof b=="string"?b:[...b],{languageName:x})}}}function p(h){return!!i.getLanguage(h)}}class z6{constructor(i){this.options=i,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(i){if(i==="")return;const a=this.stack[this.stack.length-1],r=a.children[a.children.length-1];r&&r.type==="text"?r.value+=i:a.children.push({type:"text",value:i})}startScope(i){this.openNode(String(i))}endScope(){this.closeNode()}__addSublanguage(i,a){const r=this.stack[this.stack.length-1],o=i.root.children;a?r.children.push({type:"element",tagName:"span",properties:{className:[a]},children:o}):r.children.push(...o)}openNode(i){const a=this,r=i.split(".").map(function(d,p){return p?d+"_".repeat(p):a.options.classPrefix+d}),o=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const L6={};function I6(e){const i=e||L6,a=i.aliases,r=i.detect||!1,o=i.languages||A6,u=i.plainText,d=i.prefix,p=i.subset;let h="hljs";const g=D6(o);if(a&&g.registerAlias(a),d){const x=d.indexOf("-");h=x===-1?d:d.slice(0,x)}return function(x,b){Cd(x,"element",function(v,y,k){if(v.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const _=U6(v);if(_===!1||!_&&!r||_&&u&&u.includes(_))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const S=eL(v,{whitespace:"pre"});let N;try{N=_?g.highlight(_,S,{prefix:d}):g.highlightAuto(S,{prefix:d,subset:p})}catch(M){const j=M;if(_&&/Unknown language/.test(j.message)){b.message("Cannot highlight as `"+_+"`, it’s not registered",{ancestors:[k,v],cause:j,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw j}!_&&N.data&&N.data.language&&v.properties.className.push("language-"+N.data.language),N.children.length>0&&(v.children=N.children)})}}function U6(e){const i=e.properties.className;let a=-1;if(!Array.isArray(i))return;let r;for(;++a<i.length;){const o=String(i[a]);if(o==="no-highlight"||o==="nohighlight")return!1;!r&&o.slice(0,5)==="lang-"&&(r=o.slice(5)),!r&&o.slice(0,9)==="language-"&&(r=o.slice(9))}return r}function B6(e){const i=Array.isArray(e)?e[0]:e;if(i&&typeof i=="object"&&"props"in i){const a=i.props,r=/language-([\w-]+)/.exec(a?.className??"");if(r)return r[1]}return""}function Oh(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Oh).join(""):B.isValidElement(e)?Oh(e.props.children):""}function $6(e,i){return e==="svg"?/<svg[\s>]/i.test(i):e==="html"||e==="htm"?/<(html|body|canvas|script|style|svg|main|section|div|h1|button)\b/i.test(i):!1}function H6(e,i){if(/<!doctype|<html[\s>]/i.test(i))return i;const a='<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">';return e==="svg"?`${a}<style>html,body{margin:0;min-height:100%}body{display:grid;place-items:center;background:#fff}svg{max-width:100%;height:auto}</style></head><body>${i}</body></html>`:`${a}</head><body>${i}</body></html>`}function LE({html:e,reloadKey:i,className:a}){const r=B.useRef(null);return B.useEffect(()=>{const o=r.current;if(!o)return;const u=d=>{d.source===o.contentWindow&&d.data?.type==="maxcode-preview-ready"&&o.contentWindow?.postMessage({type:"maxcode-preview",html:e},"*")};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[e,i]),c.jsx("iframe",{ref:r,src:"/preview-host.html",title:"Live preview",sandbox:"allow-scripts allow-pointer-lock allow-forms allow-modals",allow:"fullscreen",className:ie("block h-full w-full border-0 bg-white",a)},i)}function P6({html:e,onClose:i}){const[a,r]=B.useState(0);return B.useEffect(()=>{const o=u=>{u.key==="Escape"&&i()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[i]),Ho.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[90] flex flex-col bg-canvas/95 p-3 backdrop-blur-sm sm:p-5",role:"dialog","aria-label":"Live preview",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsx("p",{className:"text-[13.5px] font-medium text-ink",children:"Live preview"}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button",className:"icon-button",onClick:()=>r(o=>o+1),title:"Restart","aria-label":"Restart preview",children:c.jsx(Wv,{size:16})}),c.jsx("button",{type:"button",className:"icon-button",onClick:i,title:"Close (Esc)","aria-label":"Close preview",children:c.jsx(Bi,{size:18})})]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-2xl border border-line bg-white shadow-float",children:c.jsx(LE,{html:e,reloadKey:a})})]}),document.body)}function F6({children:e,streaming:i}){const[a,r]=B.useState(!1),[o,u]=B.useState("code"),[d,p]=B.useState(0),[h,g]=B.useState(!1),x=B6(e)||"text",b=B.useMemo(()=>Oh(e),[e]),v=!i&&$6(x,b),y=B.useMemo(()=>v?H6(x,b):"",[v,x,b]),k=v&&o==="preview",_=async()=>{try{await navigator.clipboard.writeText(b),r(!0),window.setTimeout(()=>r(!1),1600)}catch{}};return c.jsxs("div",{className:"code-shell group/code",children:[c.jsxs("div",{className:"code-head",children:[v?c.jsx("div",{className:"inline-flex items-center rounded-lg bg-raised/80 p-0.5",role:"tablist","aria-label":"Code or preview",children:["code","preview"].map(S=>c.jsx("button",{type:"button",role:"tab","aria-selected":o===S,onClick:()=>u(S),className:ie("h-6 rounded-md px-2.5 text-[11.5px] font-medium capitalize transition-colors",o===S?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:S},S))}):c.jsx("span",{className:"code-lang",children:x}),c.jsxs("div",{className:"flex items-center gap-0.5",children:[k&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>p(S=>S+1),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-faint transition-colors hover:bg-panel hover:text-ink",title:"Restart","aria-label":"Restart preview",children:c.jsx(Wv,{size:13})}),c.jsx("button",{type:"button",onClick:()=>g(!0),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-faint transition-colors hover:bg-panel hover:text-ink",title:"Full screen","aria-label":"Open preview full screen",children:c.jsx(pT,{size:13})})]}),v&&c.jsx("button",{type:"button",onClick:()=>hh(x==="svg"?"image.svg":"index.html",x==="svg"?b:y,x==="svg"?"image/svg+xml":"text/html"),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-faint transition-colors hover:bg-panel hover:text-ink",title:"Download file","aria-label":"Download file",children:c.jsx(Yv,{size:13})}),c.jsxs("button",{type:"button",onClick:_,className:"inline-flex h-7 items-center gap-1 rounded-md px-1.5 text-[11.5px] font-medium text-faint transition-colors hover:bg-panel hover:text-ink","aria-label":"Copy code",children:[a?c.jsx(Cn,{size:13}):c.jsx(ld,{size:13}),a?"Copied":"Copy"]})]})]}),k?c.jsx("div",{className:"h-[420px] min-h-[220px] resize-y overflow-hidden border-t border-line/60 bg-white",children:c.jsx(LE,{html:y,reloadKey:d})}):c.jsx("pre",{className:"code-pre thin-scroll",children:e}),h&&c.jsx(P6,{html:y,onClose:()=>g(!1)})]})}function q6({content:e,streaming:i}){return c.jsx("div",{className:ie("md",i&&"is-streaming"),children:c.jsx(jD,{remarkPlugins:[Kz],rehypePlugins:[[I6,{detect:!0,ignoreMissing:!0}]],components:{pre:({children:a})=>c.jsx(F6,{streaming:i,children:a}),a:({children:a,href:r})=>c.jsx("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:a})},children:e})})}const IE=B.memo(q6);function _v(e,i){qt.approval?qt.approval.resolveApproval(e,i):Iw(e,i)}function UE(e,i){const a=e===""?[]:e.split(`
|
|
282
|
+
`),r=i===""?[]:i.split(`
|
|
283
|
+
`);let o=0;for(;o<a.length&&o<r.length&&a[o]===r[o];)o+=1;let u=a.length,d=r.length;for(;u>o&&d>o&&a[u-1]===r[d-1];)u-=1,d-=1;const p=a.slice(o,u),h=r.slice(o,d),g=a.slice(0,o).map(x=>({type:"ctx",text:x}));if(p.length*h.length>2e6)p.forEach(x=>g.push({type:"del",text:x})),h.forEach(x=>g.push({type:"add",text:x}));else{const x=Array.from({length:p.length+1},()=>new Uint32Array(h.length+1));for(let y=p.length-1;y>=0;y-=1)for(let k=h.length-1;k>=0;k-=1)x[y][k]=p[y]===h[k]?x[y+1][k+1]+1:Math.max(x[y+1][k],x[y][k+1]);let b=0,v=0;for(;b<p.length&&v<h.length;)p[b]===h[v]?(g.push({type:"ctx",text:p[b]}),b+=1,v+=1):x[b+1][v]>=x[b][v+1]?(g.push({type:"del",text:p[b]}),b+=1):(g.push({type:"add",text:h[v]}),v+=1);for(;b<p.length;)g.push({type:"del",text:p[b++]});for(;v<h.length;)g.push({type:"add",text:h[v++]})}return a.slice(u).forEach(x=>g.push({type:"ctx",text:x})),g}function G6(e){let i=0,a=0;for(const r of e)r.type==="add"?i+=1:r.type==="del"&&(a+=1);return{added:i,removed:a}}const qm=120;function Y6({before:e,after:i,startLine:a=1}){const r=B.useMemo(()=>{const u=UE(e,i),d=new Array(u.length).fill(!1);u.forEach((b,v)=>{if(b.type!=="ctx")for(let y=Math.max(0,v-2);y<=Math.min(u.length-1,v+2);y+=1)d[y]=!0});let p=a,h=a;const g=[];let x=!1;return u.forEach((b,v)=>{const y=b.type==="add"?h:p;if(b.type!=="add"&&(p+=1),b.type!=="del"&&(h+=1),!d[v]){x=!0;return}x&&g.length>0&&g.push({key:-v,type:"gap",text:"",no:null,gap:!0}),x=!1,g.push({key:v,type:b.type,text:b.text,no:y})}),g},[e,i,a]),o=r.slice(0,qm);return c.jsxs("div",{className:"diff-view thin-scroll max-h-64 overflow-auto rounded-lg border border-line bg-canvas/60 font-mono text-[11px] leading-[1.6]",children:[o.map((u,d)=>u.gap?c.jsx("div",{className:"px-2 text-center text-[10px] text-faint",children:"⋯"},u.key):c.jsxs("div",{style:{animationDelay:`${Math.min(d*14,260)}ms`},className:ie("diff-row flex min-w-max",u.type==="add"&&"bg-success/[0.11] text-ink",u.type==="del"&&"bg-danger/[0.10] text-ink",u.type==="ctx"&&"text-faint"),children:[c.jsx("span",{className:"w-9 shrink-0 select-none pr-2 text-right text-[10px] tabular-nums text-faint/70",children:u.no}),c.jsx("span",{className:ie("w-4 shrink-0 select-none text-center",u.type==="add"&&"text-success",u.type==="del"&&"text-danger"),children:u.type==="add"?"+":u.type==="del"?"−":" "}),c.jsx("span",{className:"whitespace-pre pr-3",children:u.text||" "})]},u.key)),r.length>qm&&c.jsxs("div",{className:"px-3 py-1 text-[10px] text-faint",children:["… ",r.length-qm," more rows"]})]})}function Rg({added:e,removed:i,line:a,column:r,className:o}){return c.jsxs("span",{className:ie("diff-badge inline-flex items-center gap-1.5 font-mono text-[11px] tabular-nums",o),children:[c.jsxs("span",{className:"text-success",children:["+",e]}),c.jsxs("span",{className:"text-danger",children:["−",i]}),a?c.jsxs("span",{className:"text-faint",children:["L",a,r?`:${r}`:""]}):null]})}const K6=new Set(["write_file","edit_file","rewrite_file"]);function BE(e){if(e.diff)return e.diff;if(e.status!=="done"||e.call.name!=="edit_file")return;const{oldText:i,newText:a}=e.call.args;if(!(typeof i!="string"||typeof a!="string"))return G6(UE(i,a))}function V6(e){switch(e){case"awaiting":return{label:"Needs approval",className:"text-warning",dot:"bg-warning"};case"running":return{label:"Running",className:"text-accent",dot:"bg-accent"};case"done":return{label:"Done",className:"text-success",dot:"bg-success"};case"denied":return{label:"Denied",className:"text-muted",dot:"bg-faint"};default:return{label:"Failed",className:"text-danger",dot:"bg-danger"}}}function X6(e){return e===void 0?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Z6(e){switch(e){case"shell":return"OpenSol wants to run this command in the open workspace.";case"write_file":return"OpenSol wants to create or overwrite this file on disk.";case"edit_file":case"rewrite_file":return"OpenSol wants to change this file on disk.";case"git":return"OpenSol wants to change the Git state of this repository.";case"subagent":return"OpenSol wants to start a read-only subagent to investigate.";case"web_search":return"OpenSol wants to search the web.";case"read_url":return"OpenSol wants to read this public page.";default:return"OpenSol wants to use this tool."}}function $E({message:e,compact:i=!1}){const[a,r]=B.useState(!i&&e.status==="awaiting"||e.status==="error"),[o,u]=B.useState(!1),d=me(S=>S.notify),p=V6(e.status),h=Bw(e.call.name,e.call.args),g=e.call.args,x=BE(e),b=K6.has(e.call.name),v=typeof g.command=="string"?g.command:"",y=typeof g.content=="string"?g.content:typeof g.newText=="string"?g.newText:typeof g.oldText=="string"?g.oldText:"";B.useEffect(()=>{(e.status==="awaiting"||e.status==="error")&&r(!0)},[e.status]);const k=async()=>{try{await navigator.clipboard.writeText(e.result??""),u(!0),window.setTimeout(()=>u(!1),1600)}catch{d("Clipboard access was blocked by the browser.","error")}},_=e.status==="done"&&e.durationMs!==void 0?X6(e.durationMs):e.status==="done"?"":p.label.toLowerCase();return c.jsxs("div",{className:"animate-slideleft text-[12.5px]",children:[c.jsxs("button",{type:"button",onClick:()=>r(S=>!S),className:"group/row flex w-full min-w-0 items-baseline gap-1.5 py-[3px] text-left","aria-expanded":a,children:[c.jsx(rd,{size:12,strokeWidth:2,className:ie("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out group-hover/row:text-ink",a&&"rotate-90")}),c.jsx("span",{className:"shrink-0 font-medium text-ink",children:sg(e.call.name)}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] text-muted",children:h||"—"}),b&&x&&e.status==="done"?c.jsx(Rg,{added:x.added,removed:x.removed,line:x.line,column:x.column,className:"shrink-0"}):_&&c.jsx("span",{className:ie("shrink-0 text-[11px]",e.status==="running"?"text-shimmer":e.status==="done"?"text-faint":p.className),children:_})]}),e.status==="awaiting"&&c.jsxs("div",{className:"animate-fade py-1 pl-[18px]",children:[c.jsx("p",{className:"text-[12px] leading-relaxed text-warning",children:Z6(e.call.name)}),c.jsxs("p",{className:"mt-1 flex items-center gap-4 text-[12px] font-medium",children:[c.jsx("button",{type:"button",onClick:()=>_v(e.call.id,!0),className:"text-ink underline decoration-ink/30 underline-offset-[3px] transition-colors hover:decoration-ink",children:"Allow once →"}),c.jsx("button",{type:"button",onClick:()=>_v(e.call.id,!1),className:"text-muted transition-colors hover:text-ink",children:"Deny"})]})]}),a&&c.jsxs("div",{className:"animate-fade space-y-2 pb-1.5 pl-[18px] pt-0.5",children:[v&&c.jsxs("pre",{className:"thin-scroll max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed text-ink",children:["$ ",v]}),e.call.name==="edit_file"&&typeof g.oldText=="string"&&typeof g.newText=="string"&&c.jsx(Y6,{before:g.oldText,after:g.newText,startLine:x?.line??1}),y&&e.call.name!=="edit_file"&&c.jsx("pre",{className:"thin-scroll max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-muted",children:y.length>4e3?`${y.slice(0,4e3)}
|
|
284
|
+
… ${y.length-4e3} more characters`:y}),e.result!==void 0&&c.jsxs("div",{children:[c.jsxs("p",{className:"mb-1 flex items-center gap-3 text-[11px] text-faint",children:[c.jsx("span",{children:e.status==="error"?"Error":"Output"}),c.jsx("button",{type:"button",onClick:k,className:"transition-colors hover:text-ink",children:o?"Copied":"Copy"})]}),c.jsx("pre",{className:ie("thin-scroll max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-[11.5px] leading-[1.65]",e.status==="error"?"text-danger":"text-muted"),children:e.result||"(no output)"})]}),e.result===void 0&&!v&&!y&&e.status!=="awaiting"&&c.jsx("p",{className:"text-[11.5px] text-muted",children:e.status==="running"?"Working…":"No result was recorded."})]})]})}function Gm(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):""}function Ym({message:e,sessionId:i,canEdit:a}){const[r,o]=B.useState(!1),[u,d]=B.useState(e.content),p=()=>{const x=u.trim();if(!x)return;const b=Ye.getState().sessions.find(k=>k.id===i),v=b?.messages.findIndex(k=>k.id===e.id)??-1;if(!b||v<0)return;const y=vi("msg");Ye.getState().updateSession(i,{messages:b.messages.slice(0,v)}),Ye.getState().addMessage(i,{...e,id:y,content:x,createdAt:Date.now()}),o(!1),nk(i,y)},h=(e.attachments??[]).filter(x=>x.kind==="image"),g=(e.attachments??[]).filter(x=>x.kind==="text");return r?c.jsx("div",{className:"flex justify-end",children:c.jsxs("div",{className:"w-full max-w-[88%] rounded-2xl border border-accent/40 bg-canvas p-2.5 sm:max-w-[82%]",children:[c.jsx("textarea",{value:u,onChange:x=>d(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!x.shiftKey&&!x.nativeEvent.isComposing&&(x.preventDefault(),p()),x.key==="Escape"&&o(!1)},autoFocus:!0,rows:Math.min(10,Math.max(2,u.split(`
|
|
285
|
+
`).length)),className:"chat-text block w-full resize-none bg-transparent px-2 py-1 leading-[1.65] text-ink outline-none","aria-label":"Edit message"}),c.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1",children:[c.jsx("p",{className:"text-[11.5px] text-faint",children:"Sending replaces the reply below."}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",onClick:()=>o(!1),className:"h-8 rounded-full px-3 text-[12.5px] text-muted transition-colors hover:text-ink",children:"Cancel"}),c.jsx("button",{type:"button",onClick:p,disabled:!u.trim(),className:"h-8 rounded-full bg-accent px-3.5 text-[12.5px] font-medium text-on-accent transition hover:brightness-110 disabled:opacity-40",children:"Send"})]})]})]})}):c.jsxs("div",{className:"group/user flex items-start justify-end gap-1.5",children:[a&&e.content&&c.jsx("button",{type:"button",onClick:()=>{d(e.content),o(!0)},className:"mt-2 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg text-faint opacity-0 transition hover:bg-raised hover:text-ink focus-visible:opacity-100 group-hover/user:opacity-100",title:"Edit and resend","aria-label":"Edit and resend message",children:c.jsx(Lo,{size:14,strokeWidth:1.7})}),c.jsxs("div",{className:"max-w-[88%] sm:max-w-[82%]",children:[h.length>0&&c.jsx("div",{className:ie("mb-2 grid gap-2",h.length>1?"grid-cols-2":"grid-cols-1"),children:h.map(x=>c.jsx("img",{src:x.dataUrl,alt:x.name,className:"max-h-52 w-full rounded-xl border border-line object-cover"},x.id))}),c.jsxs("div",{className:"rounded-2xl rounded-br-md border border-line/70 bg-canvas px-4 py-2.5",children:[g.length>0&&c.jsx("div",{className:"mb-2 flex flex-wrap gap-1.5",children:g.map(x=>c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-line bg-panel px-2 py-1 text-[10.5px] text-muted",children:[c.jsx(Ma,{size:11}),c.jsx("span",{className:"max-w-[180px] truncate",children:x.name}),c.jsx("span",{className:"text-faint",children:$o(x.size)})]},x.id))}),e.content&&c.jsx("p",{className:"chat-text whitespace-pre-wrap break-words leading-[1.65] text-ink",children:e.content})]})]})]})}const HE=new Set(["write_file","rewrite_file","edit_file"]);function Sv(e){const i=new Set;for(const a of e){if(a.status!=="done"||!HE.has(a.call.name))continue;const r=a.call.args.path;typeof r=="string"&&r&&i.add(r)}return[...i]}function Q6({turnId:e,files:i,diff:a}){const r=me(x=>x.askConfirm),o=me(x=>x.notify),[u,d]=B.useState("idle"),p=i.slice(0,2).join(", "),h=i.length-2,g=async()=>{if(await r({title:"Undo these file changes?",body:`${i.length===1?"This file goes":`These ${i.length} files go`} back to how ${i.length===1?"it was":"they were"} before this answer. Changes made through shell commands are not affected.`,confirmLabel:"Undo changes"})){d("working");try{const b=await iA(e),v=[b.restored.length?`restored ${b.restored.length}`:"",b.removed.length?`removed ${b.removed.length}`:"",b.skipped.length?`${b.skipped.length} too large to restore`:""].filter(Boolean);o(`Undone: ${v.join(", ")||"nothing to change"}.`,"success"),d("undone"),await Be.getState().refresh().catch(()=>{})}catch(b){d("idle"),o(b instanceof Error?b.message:"Could not undo those changes.","error")}}};return c.jsxs("p",{className:"flex items-baseline gap-2 text-[12.5px] text-muted",children:[c.jsx("span",{className:"min-w-0 truncate",children:u==="undone"?"Changes undone":`Changed ${p}${h>0?` and ${h} more`:""}`}),u!=="undone"&&a&&c.jsx(Rg,{added:a.added,removed:a.removed,className:"shrink-0"}),u!=="undone"&&c.jsx("button",{type:"button",onClick:()=>{g()},disabled:u==="working",className:"shrink-0 font-medium text-ink underline decoration-ink/30 underline-offset-[3px] transition-colors hover:decoration-ink disabled:opacity-50",children:u==="working"?"Undoing…":"Undo"})]})}function J6({text:e}){const[i,a]=B.useState(!1);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>a(r=>!r),className:"group/think flex max-w-full items-baseline gap-1.5 py-0.5 text-left text-[12px]","aria-expanded":i,children:[c.jsx(rd,{size:11,strokeWidth:2,className:ie("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out",i&&"rotate-90")}),c.jsx("span",{className:"shrink-0 font-medium text-muted group-hover/think:text-ink",children:"Thought"}),!i&&c.jsx("span",{className:"min-w-0 truncate text-[11px] text-faint",children:e.replace(/\s+/g," ").trim().slice(0,100)})]}),i&&c.jsx("div",{className:"thin-scroll animate-fade max-h-40 overflow-y-auto whitespace-pre-wrap pl-[17px] font-mono text-[11px] leading-relaxed text-faint",children:e})]})}function PE(e){let i=0,a=0,r=!1;for(const o of e){if(!HE.has(o.call.name))continue;const u=BE(o);u&&(r=!0,i+=u.added,a+=u.removed)}return r?{added:i,removed:a}:null}function W6({tools:e,intermediateMessages:i=[],streaming:a=!1}){const[r,o]=B.useState(!1),u=B.useRef(!1),d=Oe(k=>k.autoCollapseWork),p=Oe(k=>k.workDetail==="detailed"),h=e.some(k=>k.status==="awaiting"),g=a||e.some(k=>k.status==="running");if(B.useEffect(()=>{h?o(!0):g?(u.current=!0,o(!0)):u.current&&d&&(u.current=!1,o(!1))},[g,h,d]),e.length===0&&i.length===0)return null;const x=[...new Set(e.map(k=>sg(k.call.name)))],b=e.filter(k=>k.status==="error"||k.status==="denied").length,v=x.length<=3?x.join(" · "):`${x.slice(0,3).join(" · ")} +${x.length-3}`,y=[...e.map(k=>({kind:"tool",tool:k,time:k.createdAt})),...i.map(k=>({kind:"assistant",message:k,time:k.createdAt}))].sort((k,_)=>k.time-_.time);return c.jsxs("div",{className:"my-1",children:[c.jsxs("button",{type:"button",onClick:()=>{u.current=!1,o(k=>!k)},className:"group/task flex max-w-full items-baseline gap-1.5 py-0.5 text-left text-[13px]","aria-expanded":r,children:[c.jsx(rd,{size:13,strokeWidth:2,className:ie("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out group-hover/task:text-ink",r&&"rotate-90")}),c.jsx("span",{className:ie("shrink-0 font-medium transition-colors",h?"text-warning":g?"text-shimmer":"text-ink/80 group-hover/task:text-ink"),children:h?"Action required":g?"Running task…":"Task completed"}),c.jsxs("span",{className:"min-w-0 truncate text-[12px] text-faint",children:[e.length>0&&`Used ${e.length} tool${e.length===1?"":"s"}`,v?` (${v})`:""]}),b>0&&c.jsxs("span",{className:"shrink-0 text-[12px] text-danger",children:["· ",b," failed"]}),(()=>{const k=PE(e);return k?c.jsx(Rg,{added:k.added,removed:k.removed,className:"shrink-0 text-[11.5px]"}):null})()]}),r&&c.jsx("div",{className:"animate-fade space-y-0.5 pb-1 pl-[19px] pt-1",children:y.map(k=>k.kind==="tool"?c.jsx($E,{message:k.tool,compact:!p},k.tool.id):c.jsxs("div",{className:"py-1",children:[k.message.reasoning.trim()&&c.jsx(J6,{text:k.message.reasoning}),k.message.content.trim()&&c.jsx("div",{className:"mt-1 text-[12.5px] leading-relaxed text-muted",children:c.jsx(IE,{content:k.message.content})})]},k.message.id))})]})}function Km({message:e,sessionId:i,streaming:a,isLastAssistant:r,showHeader:o,turnUsage:u}){const d=me(L=>L.notify),p=me(L=>L.openSettings),h=Oe(L=>L.showTokenEstimate),g=On(L=>e.provider?L.byProvider[e.provider]:void 0),[x,b]=B.useState(!1),[v,y]=B.useState(!1),k=!!(e.content.trim()||e.reasoning.trim()||e.error),_=g?.find(L=>L.id===e.model)?.name??e.model??"",S=!!(e.error&&/api key|base url|settings|credential|403|401/i.test(e.error)),N=[],M=u?.input||e.usage?.input,j=u?.output||e.usage?.output;M&&N.push(`${Gm(M)} in`),j?N.push(`${Gm(j)} out`):h&&e.content.trim()&&N.push(`~${Gm(Math.ceil(e.content.length/4))} out`);const D=[_,...N,e.durationMs?`${(e.durationMs/1e3).toFixed(1)}s`:""].filter(Boolean).join(" · "),P=async()=>{try{await navigator.clipboard.writeText(e.content),b(!0),window.setTimeout(()=>b(!1),1600)}catch{d("Clipboard access was blocked by the browser.","error")}};return!k&&!a?c.jsx("div",{className:"group",children:c.jsxs("div",{className:"min-w-0",children:[o&&c.jsxs("div",{className:"flex items-center gap-2 text-[12px] font-semibold text-ink",children:["OpenSol",_&&c.jsx("span",{className:"font-normal text-faint",children:_})]}),c.jsx("p",{className:"mt-2 text-[13px] text-muted",children:"The model returned an empty response."}),r&&c.jsxs("button",{type:"button",onClick:()=>ym(i),className:"mt-2 inline-flex items-center gap-1.5 text-[11.5px] font-medium text-accent hover:underline",children:[c.jsx(zi,{size:12})," Try again"]})]})}):c.jsx("div",{className:"group",children:c.jsxs("div",{className:"min-w-0",children:[(o||e.stopped)&&c.jsxs("div",{className:"flex min-h-[22px] items-center gap-1.5",children:[o&&c.jsxs(c.Fragment,{children:[c.jsx(pl,{size:15}),c.jsx("span",{className:"text-[12px] font-medium text-muted",children:"OpenSol"}),_&&c.jsx("span",{className:"truncate text-[11.5px] text-faint",children:_})]}),e.stopped&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-line px-1.5 py-0.5 text-[9.5px] font-medium text-muted",children:[c.jsx(Vh,{size:7,fill:"currentColor"}),"Stopped"]})]}),e.reasoning.trim()&&c.jsxs("div",{className:"mt-1",children:[c.jsxs("button",{type:"button",onClick:()=>y(L=>!L),className:"group/think flex max-w-full items-baseline gap-1.5 py-0.5 text-left text-[12.5px]","aria-expanded":v,children:[c.jsx(rd,{size:12,strokeWidth:2,className:ie("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out group-hover/think:text-ink",v&&"rotate-90")}),c.jsx("span",{className:ie("shrink-0 font-medium",a?"text-shimmer":"text-muted group-hover/think:text-ink"),children:a?"Thinking…":"Thought"}),!v&&c.jsx("span",{className:"min-w-0 truncate text-[11.5px] text-faint",children:e.reasoning.replace(/\s+/g," ").trim().slice(0,120)})]}),v&&c.jsx("div",{className:"thin-scroll animate-fade max-h-72 overflow-y-auto whitespace-pre-wrap break-words py-1 pl-[18px] font-mono text-[11px] leading-[1.65] text-faint",children:e.reasoning})]}),e.content&&c.jsx("div",{className:"mt-1.5",children:c.jsx(IE,{content:e.content,streaming:a})}),a&&!e.content&&!e.reasoning&&c.jsxs("div",{className:"mt-2 flex items-center gap-2 text-[13px] text-muted",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent"}),c.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent [animation-delay:160ms]"}),c.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent [animation-delay:320ms]"})]}),"Working"]}),e.error&&c.jsx("div",{className:"mt-3 rounded-xl border border-danger/25 bg-danger/[0.045] px-3.5 py-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(sd,{size:15,className:"mt-0.5 shrink-0 text-danger"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-[12px] font-medium text-ink",children:"The request did not finish"}),c.jsx("p",{className:"mt-1 whitespace-pre-wrap text-[11.5px] leading-relaxed text-muted",children:e.error}),c.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[S&&c.jsxs("button",{type:"button",onClick:()=>p("models"),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[11.5px] font-medium text-ink hover:bg-raised",children:[c.jsx(tw,{size:12}),"Open model settings"]}),r&&c.jsxs("button",{type:"button",onClick:()=>ym(i),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[11.5px] font-medium text-ink hover:bg-raised",children:[c.jsx(zi,{size:12}),"Try again"]})]})]})]})}),k&&!a&&c.jsxs("div",{className:"mt-2 flex min-h-[28px] flex-wrap items-center gap-0.5 text-[11.5px] text-faint",children:[e.content&&c.jsx("button",{type:"button",onClick:P,className:"inline-flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:bg-raised hover:text-ink","aria-label":"Copy response",title:x?"Copied":"Copy",children:x?c.jsx(Cn,{size:14,className:"text-success"}):c.jsx(ld,{size:14,strokeWidth:1.7})}),r&&c.jsx("button",{type:"button",onClick:()=>ym(i),className:"inline-flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:bg-raised hover:text-ink","aria-label":"Regenerate response",title:"Regenerate",children:c.jsx(zi,{size:14,strokeWidth:1.7})}),c.jsx("span",{className:"ml-2 tabular-nums text-muted",children:D})]})]})})}function eI({turn:e,sessionId:i,streaming:a,lastAssistantId:r,activeTurn:o=!1}){const u=[],d=[];for(const v of e.segments)v.kind==="tools"?u.push(...v.tools):v.kind==="assistant"&&d.push(v.message);const p=u.length>0,h=d[0]?.id,g=d[d.length-1]??null;if(o&&p)return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&c.jsx(Ym,{message:e.user,sessionId:i,canEdit:!a}),e.segments.map((v,y)=>v.kind==="tools"?c.jsx("div",{className:"space-y-0.5",children:v.tools.map(k=>c.jsx($E,{message:k},k.id))},`tools-${y}`):c.jsx(Km,{message:v.message,sessionId:i,streaming:a&&v.message.id===r,isLastAssistant:v.message.id===r,showHeader:v.message.id===h},v.message.id))]});if(!p){let v=0;return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&c.jsx(Ym,{message:e.user,sessionId:i,canEdit:!a}),d.map(y=>c.jsx(Km,{message:y,sessionId:i,streaming:a&&y.id===r,isLastAssistant:y.id===r,showHeader:v++===0},y.id))]})}const x=d.slice(0,-1),b=d.reduce((v,y)=>({input:v.input+(y.usage?.input??0),output:v.output+(y.usage?.output??0)}),{input:0,output:0});return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&c.jsx(Ym,{message:e.user,sessionId:i,canEdit:!a}),c.jsx(W6,{tools:u,intermediateMessages:x}),g&&c.jsx(Km,{message:g,sessionId:i,streaming:!1,isLastAssistant:g.id===r,showHeader:!0,turnUsage:b},g.id),e.user&&Sv(u).length>0&&c.jsx(Q6,{turnId:e.user.id,files:Sv(u),diff:PE(u)})]})}const tI=[{value:"all",label:"All"},{value:"30d",label:"30d"},{value:"7d",label:"7d"}],nI=["bg-raised","bg-accent/20","bg-accent/35","bg-accent/55","bg-accent/80"];function iI(e,i){return e<=0?0:i<=1?2:Math.min(4,1+Math.floor(e/i*3))}function Js({icon:e,label:i,value:a}){return c.jsxs("div",{className:"min-w-0 rounded-lg border border-line/70 bg-canvas px-3 py-2.5",children:[c.jsxs("p",{className:"flex items-center gap-1.5 text-[11.5px] text-muted",children:[c.jsx(e,{size:12,className:"shrink-0 text-faint"}),c.jsx("span",{className:"truncate",children:i})]}),c.jsx("p",{className:"mt-0.5 truncate text-[20px] font-semibold tracking-[-0.03em] text-ink",title:a,children:a})]})}function aI(){const e=Oe(o=>o.daemon),i=Be(o=>o.info),r=(e?.home??"").split(/[\\/]/).filter(Boolean).pop()||i.name||"there";return c.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[c.jsxs("div",{className:"relative",children:[c.jsx("span",{className:"absolute inset-0 -z-10 m-auto h-16 w-16 rounded-full bg-accent/20 blur-2xl","aria-hidden":"true"}),c.jsx(dk,{mood:"wave",size:60})]}),c.jsxs("h1",{className:"text-[28px] font-semibold leading-tight tracking-[-0.035em] text-ink sm:text-[34px]",children:["What should we build, ",c.jsx("span",{className:"text-solar",children:r}),"?"]}),c.jsx("p",{className:"-mt-2 text-[13.5px] text-muted",children:"Local-first agent. Your folder, your keys, your machine."})]})}function rI(){const e=Ye(h=>h.sessions),[i,a]=B.useState("30d"),[r,o]=B.useState("overview"),u=B.useMemo(()=>YO(e,i),[e,i]),d=B.useMemo(()=>{const h=[];for(let g=0;g<u.heatmap.length;g+=7)h.push(u.heatmap.slice(g,g+7));return h},[u.heatmap]),p=u.models[0]?.tokens??0;return c.jsx("div",{className:"relative w-full",children:c.jsxs("section",{className:"relative overflow-hidden rounded-xl border border-line bg-panel",children:[c.jsxs("div",{className:"relative flex flex-wrap items-center justify-between gap-2 border-b border-line/70 px-3 py-2.5",children:[c.jsx("div",{className:"inline-flex items-center rounded-lg bg-raised p-0.5",children:["overview","models"].map(h=>c.jsx("button",{type:"button",onClick:()=>o(h),className:ie("h-6 rounded-md px-2.5 text-[11.5px] font-medium capitalize transition-colors",r===h?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:h},h))}),c.jsx("div",{className:"inline-flex items-center gap-0.5 rounded-lg bg-raised p-0.5",children:tI.map(h=>c.jsx("button",{type:"button",onClick:()=>a(h.value),className:ie("h-6 rounded-md px-2.5 text-[11.5px] font-medium transition-colors",i===h.value?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:h.label},h.value))})]}),r==="overview"?c.jsxs("div",{className:"relative p-3",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-3",children:[c.jsx(Js,{icon:YS,label:"Sessions",value:String(u.sessions)}),c.jsx(Js,{icon:Zv,label:"Messages",value:String(u.messages)}),c.jsx(Js,{icon:Ui,label:"Total tokens",value:u.tokens?No(u.tokens):"0"}),c.jsx(Js,{icon:l2,label:"Active days",value:String(u.activeDays)}),c.jsx(Js,{icon:y2,label:"Peak hour",value:u.peakHour}),c.jsx(Js,{icon:Uu,label:"Favorite model",value:vm(u.favoriteModel)})]}),c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsx("div",{className:"flex w-max gap-[3px]",children:d.map((h,g)=>c.jsx("div",{className:"grid grid-rows-7 gap-[3px]",children:h.map(x=>c.jsx("span",{className:ie("h-[11px] w-[11px] rounded-[2px]",nI[iI(x.count,u.busiestDay)]),title:`${x.key} · ${x.count} message${x.count===1?"":"s"}`},x.key))},g))})}),c.jsxs("p",{className:"mt-2.5 text-[11px] leading-relaxed text-muted",children:[u.messages===0?"No activity in this range yet. Send a message to start the graph.":`You've used ~${No(u.tokens)} tokens across ${u.messages} messages.`,u.favoriteModel!=="—"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"px-1.5 text-line",children:"·"}),u.favoriteShare,"% on ",vm(u.favoriteModel)]})]})]}):c.jsx("div",{className:"relative p-3",children:u.models.length===0?c.jsxs("div",{className:"rounded-xl border border-dashed border-line px-4 py-8 text-center",children:[c.jsx(Uu,{size:18,className:"mx-auto text-faint"}),c.jsx("p",{className:"mt-2 text-[12px] font-medium text-ink",children:"No model usage yet"}),c.jsx("p",{className:"mt-1 text-[11px] text-muted",children:"Models appear here after you send a message."})]}):c.jsx("div",{className:"space-y-2.5",children:u.models.slice(0,6).map(h=>c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[c.jsx("span",{className:"min-w-0 truncate text-[12px] font-medium text-ink",title:h.model,children:vm(h.model)}),c.jsxs("span",{className:"shrink-0 text-[10.5px] tabular-nums text-faint",children:[No(h.tokens)," · ",h.messages," msg"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-raised",children:c.jsx("div",{className:"h-full rounded-full bg-accent/70",style:{width:`${p?Math.max(4,h.tokens/p*100):4}%`}})})]},h.model))})})]})})}function Tv(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Cv(e,i=180){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a}function sI(e){switch(e.status){case"running":return{label:"Running",className:"text-accent",dot:"bg-accent animate-pulse"};case"awaiting":return{label:"Needs approval",className:"text-warning",dot:"bg-warning"};case"done":return{label:"Done",className:"text-success",dot:"bg-success"};case"denied":return{label:"Denied",className:"text-muted",dot:"bg-faint"};default:return{label:"Failed",className:"text-danger",dot:"bg-danger"}}}function lI({session:e}){const i=B.useMemo(()=>e.messages,[e.messages]),a=i.filter(r=>r.role==="tool").length;return i.length===0?c.jsx("div",{className:"flex h-full items-center justify-center px-6",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Co,{size:20,className:"mx-auto text-faint"}),c.jsx("p",{className:"mt-2 text-[13px] font-medium text-ink",children:"No trajectory yet"}),c.jsx("p",{className:"mt-1 text-[11.5px] text-muted",children:"Send a message to see every step here."})]})}):c.jsx("div",{className:"thin-scroll h-full overflow-y-auto",children:c.jsxs("div",{className:"mx-auto w-full max-w-[800px] px-4 pb-12 pt-7 sm:px-6",children:[c.jsxs("div",{className:"mb-5 flex items-center justify-between gap-3 border-b border-line pb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[13px] font-medium text-ink",children:"Trajectory"}),c.jsxs("p",{className:"mt-0.5 text-[11px] text-muted",children:[i.length," step",i.length===1?"":"s"," · ",a," tool call",a===1?"":"s"]})]}),c.jsx("span",{className:"rounded-full border border-line px-2 py-0.5 text-[10px] text-faint",children:"Read-only view"})]}),c.jsxs("div",{className:"relative",children:[c.jsx("span",{className:"absolute bottom-3 left-[13px] top-3 w-px bg-line","aria-hidden":"true"}),c.jsx("div",{className:"space-y-4",children:i.map(r=>{if(r.role==="user")return c.jsxs("div",{className:"relative flex gap-3",children:[c.jsx("span",{className:"relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-line bg-panel text-muted",children:c.jsx(gC,{size:13})}),c.jsxs("div",{className:"min-w-0 flex-1 rounded-xl border border-line bg-panel px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:"You"}),c.jsx("span",{className:"text-[9.5px] tabular-nums text-faint",children:Tv(r.createdAt)})]}),c.jsx("p",{className:"mt-1 line-clamp-3 text-[12px] leading-relaxed text-muted",children:r.content||"Attachment only"})]})]},r.id);if(r.role==="assistant"){const h=!!(r.content.trim()||r.reasoning.trim());return c.jsxs("div",{className:"relative flex gap-3",children:[c.jsx("span",{className:"relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-line bg-panel",children:c.jsx(pl,{size:15})}),c.jsxs("div",{className:"min-w-0 flex-1 rounded-xl border border-line bg-panel px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[11.5px] font-medium text-ink",children:["OpenSol",r.model&&c.jsx("span",{className:"truncate text-[10px] font-normal text-faint",children:r.model})]}),c.jsxs("span",{className:"flex items-center gap-1.5 text-[9.5px] tabular-nums text-faint",children:[r.stopped&&c.jsx("span",{className:"text-muted",children:"Stopped"}),Tv(r.createdAt)]})]}),h?c.jsx("p",{className:"mt-1 line-clamp-4 whitespace-pre-wrap text-[12px] leading-relaxed text-muted",children:Cv(r.content||r.reasoning)}):c.jsx("p",{className:"mt-1 text-[11px] italic text-faint",children:"Model turn with no text."}),r.error&&c.jsxs("p",{className:"mt-1.5 flex items-start gap-1.5 text-[11px] leading-relaxed text-danger",children:[c.jsx(sd,{size:11,className:"mt-0.5 shrink-0"}),r.error]}),r.toolCalls.length>0&&c.jsxs("p",{className:"mt-1.5 text-[10px] text-faint",children:[r.toolCalls.length," tool call",r.toolCalls.length===1?"":"s"," in this round"]})]})]},r.id)}const o=sI(r),u=r.call.name==="shell",d=["read_file","write_file","edit_file","rewrite_file"].includes(r.call.name),p=u?nw:d?Ma:Co;return c.jsxs("div",{className:"relative flex gap-3",children:[c.jsx("span",{className:"relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-line bg-panel text-muted",children:c.jsx(p,{size:12})}),c.jsxs("div",{className:"min-w-0 flex-1 rounded-xl border border-line/80 bg-raised/25 px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:sg(r.call.name)}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-muted",children:Bw(r.call.name,r.call.args)||"—"}),c.jsxs("span",{className:ie("flex shrink-0 items-center gap-1 text-[10px] font-medium",o.className),children:[r.status==="done"?c.jsx(Cn,{size:10}):c.jsx("span",{className:ie("h-1.5 w-1.5 rounded-full",o.dot)}),o.label,r.durationMs!==void 0&&r.status==="done"?` · ${r.durationMs<1e3?`${r.durationMs}ms`:`${(r.durationMs/1e3).toFixed(1)}s`}`:""]})]}),r.result&&c.jsx("p",{className:"mt-1.5 line-clamp-2 whitespace-pre-wrap break-words font-mono text-[10.5px] leading-relaxed text-faint",children:Cv(r.result,160)})]})]},r.id)})})]}),c.jsxs("p",{className:"mt-6 flex items-center justify-center gap-1 text-[10px] text-faint",children:["End of trajectory ",c.jsx(Gv,{size:10})]})]})})}const oI=[{icon:X2,label:"Build a game",prompt:"Build a small browser game as one self-contained index.html (canvas, no build step). Make it playable with keyboard and touch, with a score and a restart button. Put the whole file in a single html code block so I can preview it."},{icon:rT,label:"Design a landing page",prompt:"Design a polished, responsive landing page for a small indie game studio. Choose a distinctive typographic style, keep it to one file, and put everything in a single html code block so I can preview it."},{icon:r2,label:"Trace a bug",prompt:"Inspect this workspace for a real bug. Explain the root cause, make the smallest correct fix, and run the project checks."},{icon:G2,label:"Audit this folder",prompt:"Audit this workspace. Read the key files first, then list the three most important improvements with file references and a short plan."},{icon:$2,label:"Write tests",prompt:"Find the least-tested, highest-risk module in this workspace, write focused tests for it, run them, and fix anything they reveal."},{icon:is,label:"Research with sources",prompt:"Search the web for the current release notes of the main framework in this project, then summarise what matters and cite the pages you read."}];function cI(){const e=Ye(pe=>pe.sessions),i=Ye(pe=>pe.activeId),a=e.find(pe=>pe.id===i)??null,r=Da(pe=>i?!!pe.streaming[i]:!1),o=Oe(),u=Oe(pe=>pe.setMode),d=Oe(pe=>pe.update),p=me(pe=>pe.notify),h=me(pe=>pe.openSettings),g=me(pe=>pe.focusComposer),x=me(pe=>pe.setWorkspaceOpen),b=me(pe=>pe.setDeployOpen),v=me(pe=>pe.askConfirm),y=Be(pe=>pe.info),k=Be(pe=>pe.git),_=kd(),[S,N]=B.useState(""),[M,j]=B.useState("chat"),D=B.useRef(null),[P,L]=B.useState(!0),T=B.useRef(i),R=B.useRef(null),K=a?.messages??[],z=K[K.length-1],$=[...K].reverse().find(pe=>pe.role==="assistant")?.id,W=dl(o),de=li(o),ce=o.skills.filter(pe=>pe.enabled).length,ae=XO(K),O=Qw(K,_),te=PO(K,r),ne=(pe="auto")=>{const C=D.current;C&&C.scrollTo({top:C.scrollHeight,behavior:pe})};B.useEffect(()=>{if(T.current!==i){T.current=i,L(!0),j("chat"),requestAnimationFrame(()=>ne("auto"));const pe=Ye.getState().sessions.find(C=>C.id===i);pe?.mode&&u(pe.mode)}},[i,u]),B.useEffect(()=>{z&&(z.id!==R.current?(R.current=z.id,z.role==="user"?(L(!0),requestAnimationFrame(()=>ne("auto"))):P&&requestAnimationFrame(()=>ne("auto"))):P&&ne("auto"))},[z,P]),B.useEffect(()=>{if(!P)return;const pe=window.setTimeout(()=>ne("auto"),40);return()=>window.clearTimeout(pe)},[K,P]);const G=async(pe,C)=>{const I=Oe.getState();if(!dl(I))return p(I.provider==="custom"?"Add a base URL for your custom endpoint in Settings → Models.":`Add an API key for ${Jh(I.provider)} in Settings → Models.`,"error"),h("models"),!1;const se=li(I);if(!se)return p("Choose a model before sending a message.","error"),h("models"),!1;let he=i;(!he||!Ye.getState().sessions.some(He=>He.id===he))&&(he=Ye.getState().createSession(I.provider,se,I.mode));const ke=pe.trim(),ze=vi("msg");return Ye.getState().addMessage(he,{id:ze,role:"user",content:ke,attachments:C.length>0?C:void 0,createdAt:Date.now()}),Ye.getState().updateSession(he,{mode:I.mode}),N(""),L(!0),nk(he,ze),!0},A=pe=>{N(pe),g()},Se=async(pe,C)=>{switch(pe){case"search":return C.trim()?(d({webSearchEnabled:!0}),G(`Use the web to research this: ${C.trim()}
|
|
286
|
+
|
|
287
|
+
Read the most useful sources, cite the URLs you actually opened, and answer for this workspace.`,[])):(N("/search "),p("Type what you want OpenSol to research.","info"),g(),!1);case"plan":return u("plan"),C.trim()?G(C.trim(),[]):(p("Plan mode is on: investigation only until you switch to Build.","info"),g(),!0);case"build":return u("build"),C.trim()?G(C.trim(),[]):(p("Build mode is on: OpenSol can edit files and run commands.","info"),g(),!0);case"new":return Ye.getState().newChat(),g(),!0;case"workspace":return x(!0),!0;case"deploy":return b(!0),!0;case"settings":return h("models"),!0;case"clear":{const I=Ye.getState().sessions.find(he=>he.id===i);return!I||I.messages.length===0||!await v({title:"Clear this conversation?",body:"The messages in this conversation will be removed from your local history. The workspace files are not touched.",confirmLabel:"Clear conversation",tone:"danger"})||(Vu(I.id),Ye.getState().updateSession(I.id,{messages:[]}),Ye.getState().updateSession(I.id,{title:"New conversation"}),p("Conversation cleared.","success")),!0}default:return!1}};return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col bg-panel",children:[c.jsx(JO,{session:a,view:M,onViewChange:j}),!a||K.length===0?c.jsxs("div",{className:"thin-scroll relative min-h-0 flex-1 overflow-y-auto",children:[c.jsx("div",{className:"hero-wash pointer-events-none absolute inset-0","aria-hidden":"true"}),c.jsx("div",{className:"bg-dots pointer-events-none absolute inset-0 opacity-70","aria-hidden":"true"}),c.jsxs("div",{className:"relative mx-auto flex min-h-full w-full max-w-[720px] flex-col justify-center px-4 py-10 sm:px-6",children:[c.jsx("div",{className:"animate-blurin",children:c.jsx(aI,{})}),c.jsxs("div",{className:"mt-8 w-full animate-rise [animation-delay:120ms]",children:[(!W||!de)&&c.jsxs("button",{type:"button",onClick:()=>h("models"),className:"mb-3 flex w-full items-center gap-2 rounded-xl border border-accent/30 bg-accent-soft px-4 py-2.5 text-left text-[12.5px] font-medium text-accent transition-all hover:border-accent/50",children:[c.jsx(zo,{size:14,className:"shrink-0"}),c.jsx("span",{className:"flex-1",children:W?"Choose a model to start":"Connect a provider to start"}),c.jsx("span",{className:"text-[11px] font-normal opacity-70",children:"Open settings →"})]}),c.jsx(E0,{value:S,onChange:N,onSend:G,onStop:()=>{},onCommand:Se,streaming:!1,hints:!0,autoFocus:!0,placeholder:W?"How can I help you today?":"Add a provider key to start",pixleMood:W?"idle":"sleepy"}),c.jsx("div",{className:"stagger mt-5 grid grid-cols-2 gap-2 sm:grid-cols-3",children:oI.slice(0,6).map(pe=>c.jsxs("button",{type:"button",onClick:()=>A(pe.prompt),className:"card-lift group/starter flex items-center gap-2.5 rounded-xl border border-line bg-panel px-3 py-2.5 text-left text-[12.5px] font-medium text-muted hover:text-ink",children:[c.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-raised text-faint transition-colors duration-200 group-hover/starter:bg-accent-soft group-hover/starter:text-accent",children:c.jsx(pe.icon,{size:14,strokeWidth:1.8})}),c.jsx("span",{className:"min-w-0 truncate",children:pe.label})]},pe.label))}),c.jsxs("div",{className:"mt-2.5 flex items-center justify-center gap-3 px-1 text-[11px] text-faint",children:[c.jsxs("span",{className:"truncate",children:[y.available?y.name:"No folder open",y.available&&k.available&&k.branch?` · ${k.branch}`:""]}),c.jsx("span",{"aria-hidden":"true",children:"·"}),c.jsxs("span",{className:"shrink-0",children:[ce," skill",ce===1?"":"s"," ·"," ",W?de?"Ready":"Model needed":"Provider needed"]})]})]}),c.jsx("div",{className:"mt-10 animate-rise [animation-delay:420ms]",children:c.jsx(rI,{})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"relative min-h-0 flex-1",children:M==="trajectory"?c.jsx(lI,{session:a}):c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:D,onScroll:pe=>{const C=pe.currentTarget,I=C.scrollHeight-C.scrollTop-C.clientHeight;L(I<90)},className:"thin-scroll h-full overflow-y-auto",children:c.jsx("div",{className:"mx-auto w-full max-w-[760px] px-4 pb-12 pt-8 sm:px-6 sm:pt-10",children:ae.map((pe,C)=>c.jsx("div",{className:C===0?"animate-rise":"mt-10 animate-rise",children:c.jsx(eI,{turn:pe,sessionId:a.id,streaming:r,lastAssistantId:$,activeTurn:r&&C===ae.length-1})},pe.id))})}),!P&&c.jsx("button",{type:"button",onClick:()=>{L(!0),ne("smooth")},className:"surface-lift absolute bottom-4 left-1/2 -translate-x-1/2 animate-scalein rounded-full border border-line px-3.5 py-1.5 text-[11.5px] font-medium text-muted shadow-composer transition-colors hover:text-ink",children:c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx(e2,{size:11}),"Jump to latest"]})})]})}),c.jsx("div",{className:"shrink-0 bg-panel px-3 pb-3 pt-1 sm:px-6 sm:pb-4",children:c.jsxs("div",{className:"mx-auto w-full max-w-[760px]",children:[c.jsx(E0,{value:S,onChange:N,onSend:G,onStop:()=>a&&Vu(a.id),onCommand:Se,streaming:r,placeholder:W?"How can I help you today?":"Add a provider key to start",contextPct:O.pct,contextTitle:`Context: ~${No(O.used)} / ${No(O.limit)} tokens`,pixleMood:te}),c.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3 px-2 text-[11px] text-faint",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[o.mode==="plan"?c.jsx(Ph,{size:10}):c.jsx(Ui,{size:10}),o.mode==="plan"?"Plan mode · read-only tools":ce>0?`${ce} skill${ce===1?"":"s"} loaded`:"Build mode · full tools"]}),c.jsx("span",{className:"hidden sm:inline",children:y.available?`Working in ${y.name}`:"No workspace open"}),c.jsx("span",{className:"sm:hidden",children:o.tools.shell.approval==="ask"?"Shell asks first":"Shell auto-runs"})]})]})})]})]})}const Av=[{id:"desktop",label:"Desktop",icon:qh,width:"100%"},{id:"tablet",label:"Tablet",icon:rC,width:"768px"},{id:"phone",label:"Phone",icon:WT,width:"390px"}];function uI(e){return e.includes("index.html")?"index.html":[...e].sort((i,a)=>i.split("/").length-a.split("/").length||i.localeCompare(a))[0]??""}function dI(){const e=Be(N=>N.entries),[i,a]=B.useState(""),[r,o]=B.useState(""),[u,d]=B.useState(""),[p,h]=B.useState("desktop"),[g,x]=B.useState(0),b=B.useMemo(()=>e.filter(N=>N.type==="file"&&/\.html?$/i.test(N.path)).map(N=>N.path),[e]),v=B.useMemo(()=>{const N=e.filter(M=>M.type==="file");return`${N.length}-${N.reduce((M,j)=>Math.max(M,j.mtime),0)}`},[e]),y=b.includes(u)?u:uI(b),k=B.useCallback(async()=>{o("");try{a((await tA()).token)}catch(N){a(""),o(N instanceof Error?N.message:"Could not start the preview.")}},[]);B.useEffect(()=>{k()},[k]);const _=i&&y?`/preview/${i}/${encodeURI(y)}?v=${v}.${g}`:"",S=Av.find(N=>N.id===p)?.width??"100%";return b.length===0?c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-8 text-center",children:[c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-raised text-faint",children:c.jsx(qh,{size:18})}),c.jsx("p",{className:"text-[13px] font-medium text-ink",children:"Nothing to preview yet"}),c.jsx("p",{className:"max-w-[260px] text-[11.5px] leading-relaxed text-muted",children:"Ask OpenSol to build a page or a game. The first HTML file it writes shows up here and reloads as it changes."})]}):c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 border-b border-line px-2.5 py-2",children:[c.jsx("select",{value:y,onChange:N=>d(N.target.value),className:"h-8 min-w-0 flex-1 truncate rounded-lg border border-line bg-transparent px-2 font-mono text-[11.5px] text-ink outline-none focus:border-accent/50","aria-label":"Page to preview",children:b.map(N=>c.jsx("option",{value:N,children:N},N))}),c.jsx("div",{className:"flex items-center rounded-lg bg-raised/70 p-0.5",children:Av.map(N=>c.jsx("button",{type:"button",onClick:()=>h(N.id),"aria-pressed":p===N.id,title:N.label,"aria-label":N.label,className:ie("flex h-7 w-7 items-center justify-center rounded-md transition-colors",p===N.id?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:c.jsx(N.icon,{size:14,strokeWidth:1.7})},N.id))}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{k(),x(N=>N+1)},title:"Reload preview","aria-label":"Reload preview",children:c.jsx(zi,{size:14,strokeWidth:1.7})}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",disabled:!_,onClick:()=>window.open(_,"_blank","noopener"),title:"Open in a new tab","aria-label":"Open in a new tab",children:c.jsx(Uh,{size:14,strokeWidth:1.7})})]}),c.jsxs("div",{className:"relative min-h-0 flex-1 overflow-auto bg-raised/40 p-2",children:[r&&c.jsxs("div",{className:"mx-auto mt-6 max-w-[300px] rounded-xl border border-danger/25 bg-danger/[0.05] px-3.5 py-3 text-center",children:[c.jsx("p",{className:"text-[12px] font-medium text-ink",children:"The preview could not start"}),c.jsx("p",{className:"mt-1 text-[11.5px] leading-relaxed text-muted",children:r}),c.jsx("button",{type:"button",onClick:()=>{k()},className:"mt-2 text-[11.5px] font-medium text-accent hover:underline",children:"Try again"})]}),!r&&!_&&c.jsxs("p",{className:"flex items-center justify-center gap-2 py-8 text-[11.5px] text-faint",children:[c.jsx(Vt,{size:12})," Starting preview…"]}),_&&c.jsx("iframe",{title:`Preview of ${y}`,src:_,sandbox:"allow-scripts allow-forms allow-modals allow-popups allow-pointer-lock",className:"mx-auto block h-full min-h-[320px] max-w-full rounded-lg border border-line bg-white shadow-pill",style:{width:S}},`${y}-${g}`)]}),c.jsx("p",{className:"shrink-0 border-t border-line px-3 py-1.5 text-[11px] text-faint",children:"Runs in a sandbox: it can load your files and public CDNs, but cannot reach OpenSol or your keys."})]})}function jv(e){return e.messages.filter(i=>i.role==="user").length}function fI(e){const i=new Set;for(const a of e.messages){if(a.role!=="tool"||a.status!=="done"||!["write_file","edit_file","rewrite_file"].includes(a.call.name))continue;const r=a.call.args.path;typeof r=="string"&&i.add(r)}return i.size}function pI(){const e=Ye(T=>T.sessions),i=Ye(T=>T.activeId),a=Ye(T=>T.setActive),r=Ye(T=>T.newChat),o=Ye(T=>T.renameSession),u=Ye(T=>T.deleteSession),d=Be(T=>T.info.root),p=Da(T=>T.streaming),h=Da(T=>T.titling),g=me(T=>T.askConfirm),x=me(T=>T.notify),b=me(T=>T.focusComposer),[v,y]=B.useState("workspace"),[k,_]=B.useState(null),[S,N]=B.useState(""),M=B.useMemo(()=>[...v==="all"?e:e.filter(R=>R.workspace===d)].sort((R,K)=>K.updatedAt-R.updatedAt),[e,v,d]),j=e.filter(T=>!T.workspace).length,D=()=>{k&&S.trim()&&o(k,S),_(null)},P=async T=>{await g({title:"Delete this session?",body:`“${T.title}” and its messages will be removed from this computer. This cannot be undone.`,confirmLabel:"Delete session",tone:"danger"})&&(Vu(T.id),u(T.id))},L=async T=>{await qt.titles?.generate(T,{force:!0})||x("The model could not suggest a title right now.","error")};return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-line px-3 py-2.5",children:[c.jsx("div",{className:"relative flex rounded-full bg-raised p-0.5 text-[10.5px] font-medium",children:["workspace","all"].map(T=>c.jsx("button",{type:"button",onClick:()=>y(T),className:ie("relative z-10 rounded-full px-2.5 py-1 transition-colors",v===T?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:T==="workspace"?"This workspace":`All · ${e.length}`},T))}),c.jsxs("button",{type:"button",onClick:()=>{r(),b()},className:"ml-auto inline-flex h-7 items-center gap-1 rounded-full bg-ink px-2.5 text-[10.5px] font-medium text-panel transition-transform active:scale-95",children:[c.jsx(vr,{size:12})," New"]})]}),c.jsx("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto p-2",children:M.length===0?c.jsxs("div",{className:"px-4 py-10 text-center",children:[c.jsx(bT,{size:22,className:"mx-auto text-faint"}),c.jsx("p",{className:"mt-2 text-[12px] font-medium text-ink",children:"No sessions here yet"}),c.jsx("p",{className:"mt-1 text-[10.5px] leading-relaxed text-faint",children:v==="workspace"&&j>0?`${j} older session${j===1?"":"s"} were started before workspaces were tracked. Switch to “All” to see them.`:"Start a conversation and it shows up here."})]}):M.map((T,R)=>{const K=!!p[T.id],z=fI(T);return c.jsxs("div",{style:{animationDelay:`${Math.min(R*30,300)}ms`},className:ie("session-card group/session animate-slideleft mb-1.5 rounded-xl border px-3 py-2.5 transition-all duration-200",i===T.id?"border-accent/40 bg-accent-soft/60":"border-transparent hover:border-line hover:bg-raised/60"),children:[k===T.id?c.jsx("input",{autoFocus:!0,value:S,onChange:$=>N($.target.value),onBlur:D,onKeyDown:$=>{$.key==="Enter"&&D(),$.key==="Escape"&&_(null)},className:"h-7 w-full rounded-md border border-accent/50 bg-panel px-2 text-[12px] text-ink outline-none","aria-label":"Rename session"}):c.jsxs("button",{type:"button",onClick:()=>a(T.id),className:"block w-full text-left",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[i===T.id&&c.jsx(Cn,{size:12,className:"shrink-0 text-accent"}),c.jsx("span",{className:ie("min-w-0 flex-1 truncate text-[12.5px] font-medium text-ink",h[T.id]&&"text-shimmer"),children:T.title}),K&&c.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-medium text-accent",children:[c.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent"})," running"]})]}),c.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10px] text-faint",children:[c.jsx("span",{children:Xu(T.updatedAt)}),c.jsxs("span",{children:["· ",jv(T)," turn",jv(T)===1?"":"s"]}),z>0&&c.jsxs("span",{children:["· ",z," file",z===1?"":"s"," edited"]}),T.model&&c.jsxs("span",{className:"max-w-[120px] truncate font-mono",children:["· ",T.model]}),T.titleSource==="ai"&&c.jsxs("span",{className:"inline-flex items-center gap-0.5 text-accent/80",children:[c.jsx(Ui,{size:9})," AI title"]})]})]}),c.jsxs("div",{className:"mt-1.5 flex items-center gap-0.5 opacity-0 transition-opacity group-hover/session:opacity-100 focus-within:opacity-100",children:[c.jsx("button",{type:"button",className:"icon-button h-6 w-6",onClick:()=>{_(T.id),N(T.title)},title:"Rename","aria-label":"Rename session",children:c.jsx(Lo,{size:11})}),c.jsx("button",{type:"button",className:"icon-button h-6 w-6",onClick:()=>{L(T.id)},disabled:!!h[T.id]||T.messages.length===0,title:"Let the model name this session","aria-label":"Name session with AI",children:c.jsx(Ui,{size:11})}),c.jsx("button",{type:"button",className:"icon-button h-6 w-6 hover:!text-danger",onClick:()=>{P(T)},title:"Delete","aria-label":"Delete session",children:c.jsx(sa,{size:11})})]})]},T.id)})})]})}function mI(e){const i=new Map;for(const u of e)i.set(u.path,{entry:u,children:[]});const a=[],r=[...e].sort((u,d)=>u.path.split("/").length-d.path.split("/").length);for(const u of r){const d=i.get(u.path);if(!d)continue;const p=u.path.lastIndexOf("/"),h=p===-1?null:i.get(u.path.slice(0,p));h?h.children.push(d):a.push(d)}const o=u=>{u.sort((d,p)=>d.entry.type===p.entry.type?d.entry.name.localeCompare(p.entry.name):d.entry.type==="dir"?-1:1),u.forEach(d=>o(d.children))};return o(a),a}function hI(e){const i=/\.([a-z0-9]+)$/i.exec(e);return i?i[1].toUpperCase():"TEXT"}function gI({onDone:e}){const i=Be(D=>D.addWorkspace),a=Be(D=>D.info.workspaces),r=me(D=>D.notify),[o,u]=B.useState(""),[d,p]=B.useState(""),[h,g]=B.useState(""),[x,b]=B.useState([]),[v,y]=B.useState(!0),[k,_]=B.useState(""),[S,N]=B.useState(!1),M=async D=>{y(!0),_("");try{const P=await ZC(D);u(P.path),p(P.parent),g(P.home),b(P.entries)}catch(P){_(P instanceof Error?P.message:"Could not read that folder.")}finally{y(!1)}};B.useEffect(()=>{M("")},[]);const j=async D=>{N(!0);try{await i(D),e?.()}catch(P){r(P instanceof Error?P.message:"Could not open that folder.","error")}finally{N(!1)}};return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"border-b border-line px-4 py-4",children:[c.jsx("p",{className:"font-display text-[19px] font-semibold tracking-[-0.02em] text-ink",children:"Choose a real folder"}),c.jsx("p",{className:"mt-1 text-[11.5px] leading-relaxed text-muted",children:"OpenSol works directly in this folder through the local daemon. Nothing is uploaded."})]}),c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{M(d)},disabled:!d||v,"aria-label":"Parent folder",children:c.jsx(XS,{size:13})}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{M(h)},disabled:!h||v,"aria-label":"Home folder",children:c.jsx(od,{size:13})}),c.jsx("p",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted",title:o,children:o||"Home"}),v&&c.jsx(Vt,{size:12}),c.jsxs("button",{type:"button",onClick:()=>{j(o)},disabled:!o||S,className:"inline-flex h-7 items-center gap-1 rounded-lg bg-ink px-2.5 text-[10.5px] font-medium text-panel disabled:opacity-40",children:[S?c.jsx(Vt,{size:11}):c.jsx(Cn,{size:11}),"Open"]})]}),a.length>0&&c.jsxs("div",{className:"border-b border-line px-3 py-2",children:[c.jsx("p",{className:"mb-1.5 text-[9px] font-semibold uppercase tracking-[0.13em] text-faint",children:"Recent"}),c.jsx("div",{className:"flex flex-wrap gap-1",children:a.slice(0,6).map(D=>c.jsx("button",{type:"button",onClick:()=>{j(D.path)},className:"max-w-full truncate rounded-md border border-line bg-raised/60 px-2 py-1 text-left text-[10px] text-muted hover:text-ink",title:D.path,children:D.name},D.path))})]}),c.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2 py-2",children:[k&&c.jsx("p",{className:"px-2 py-3 text-[11px] text-danger",children:k}),!v&&!k&&x.length===0&&c.jsx("p",{className:"px-2 py-4 text-[11px] text-faint",children:"This folder has no subfolders."}),x.map(D=>c.jsxs("div",{className:"group flex items-center gap-1",children:[c.jsxs("button",{type:"button",onClick:()=>{M(D.path)},className:"flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-muted transition-colors hover:bg-raised hover:text-ink",children:[c.jsx(rl,{size:13,className:"shrink-0 text-faint"}),c.jsx("span",{className:"truncate",children:D.name})]}),c.jsx("button",{type:"button",onClick:()=>{j(D.path)},className:"hidden h-7 rounded-md px-2 text-[10px] font-medium text-accent group-hover:block",children:"Use"})]},D.path))]})]})}function xI(){const e=me(X=>X.workspaceOpen),i=me(X=>X.setWorkspaceOpen),a=me(X=>X.notify),r=me(X=>X.askConfirm),o=Be(X=>X.info),u=Be(X=>X.root),d=Be(X=>X.entries),p=Be(X=>X.loadingTree),h=Be(X=>X.treeError),g=Be(X=>X.activeFile),x=Be(X=>X.file),b=Be(X=>X.content),v=Be(X=>X.dirty),y=Be(X=>X.saving),k=Be(X=>X.openingFile),_=Be(X=>X.git),S=Be(X=>X.gitLoading),N=Be(X=>X.setActiveFile),M=Be(X=>X.saveFile),j=Be(X=>X.setContent),D=Be(X=>X.createEntry),P=Be(X=>X.renameEntry),L=Be(X=>X.deleteEntry),T=Be(X=>X.forgetWorkspace),R=Be(X=>X.loadGit),K=Be(X=>X.refresh),[z,$]=B.useState(""),[W,de]=B.useState(new Set),ce=Ye(X=>X.sessions.length),[ae,O]=B.useState("files"),[te,ne]=B.useState(!o.available),[G,A]=B.useState(null),[Se,pe]=B.useState(!1),C=B.useRef(null),I=B.useMemo(()=>mI(d),[d]),se=B.useMemo(()=>{const X=z.trim().toLowerCase();return X?d.filter(Z=>Z.path.toLowerCase().includes(X)).slice(0,300):null},[d,z]),he=b?b.split(`
|
|
288
|
+
`).length:0;if(B.useEffect(()=>{G&&C.current?.focus()},[G]),B.useEffect(()=>{ne(!o.available)},[o.available]),B.useEffect(()=>{const X=Z=>{!(Z.metaKey||Z.ctrlKey)||Z.key.toLowerCase()!=="s"||!me.getState().workspaceOpen||!Be.getState().activeFile||(Z.preventDefault(),Be.getState().saveFile())};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[]),!e)return null;const ke=async()=>{if(!G)return;const X=G.value.trim().replace(/^\/+/,"");if(!X)return A(null);try{if(G.mode==="rename"){if(!g)return;await P(g,X)}else await D(X,G.mode==="create-dir"?"dir":"file");A(null)}catch(Z){a(Z instanceof Error?Z.message:"That change failed.","error")}},ze=async X=>{if(await r({title:"Delete this path?",body:`${X} will be deleted from disk. This cannot be undone.`,confirmLabel:"Delete",tone:"danger"}))try{await L(X)}catch(Te){a(Te instanceof Error?Te.message:"Could not delete that path.","error")}},He=async()=>{try{await navigator.clipboard.writeText(b),pe(!0),window.setTimeout(()=>pe(!1),1500)}catch{a("Clipboard access was blocked.","error")}},$e=(X,Z)=>{const Te=X.entry.path;if(X.entry.type==="dir"){const rt=W.has(Te);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>de(ct=>{const Le=new Set(ct);return Le.has(Te)?Le.delete(Te):Le.add(Te),Le}),className:"group flex h-7 w-full items-center gap-1.5 rounded-md pr-1.5 text-left text-[11.5px] font-medium text-muted transition-colors hover:bg-raised hover:text-ink",style:{paddingLeft:8+Z*13},title:Te,children:[c.jsx(Gv,{size:10,className:ie("shrink-0 text-faint transition-transform",!rt&&"rotate-90")}),rt?c.jsx(rl,{size:12,className:"shrink-0 text-faint"}):c.jsx(es,{size:12,className:"shrink-0 text-faint"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.entry.name}),c.jsx("span",{role:"button",tabIndex:0,onClick:ct=>{ct.stopPropagation(),ze(Te)},onKeyDown:ct=>{ct.key==="Enter"&&ze(Te)},className:"hidden h-5 w-5 items-center justify-center rounded text-faint hover:text-danger group-hover:flex","aria-label":`Delete ${Te}`,children:c.jsx(sa,{size:10})})]}),!rt&&X.children.map(ct=>$e(ct,Z+1))]},Te)}return c.jsxs("button",{type:"button",onClick:()=>N(Te),className:ie("flex h-7 w-full items-center gap-1.5 rounded-md pr-1.5 text-left font-mono text-[10.5px] transition-colors",g===Te?"bg-accent-soft font-medium text-accent":"text-muted hover:bg-raised hover:text-ink"),style:{paddingLeft:8+Z*13+10},title:Te,children:[c.jsx(Ma,{size:11,className:ie("shrink-0",g===Te?"text-accent":"text-faint")}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.entry.name})]},Te)};return c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","aria-label":"Close workspace",onClick:()=>i(!1),className:"fixed inset-0 z-40 cursor-default bg-ink/20 backdrop-blur-[1px] xl:hidden"}),c.jsxs("aside",{className:ie("fixed inset-y-0 right-0 z-50 flex h-dvh w-[min(96vw,440px)] flex-col border-l border-line surface-lift shadow-float transition-[width] duration-200 xl:static xl:z-auto xl:shadow-none",ae==="preview"&&o.available&&!te?"sm:w-[min(96vw,620px)] xl:w-[560px]":"xl:w-[390px]"),children:[c.jsxs("div",{className:"flex h-14 shrink-0 items-center gap-2 border-b border-line px-3",children:[c.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-accent-soft text-accent",children:c.jsx(es,{size:14})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate text-[12px] font-semibold tracking-[-0.01em] text-ink",children:o.available?o.name:"Workspace"}),c.jsx("p",{className:"truncate text-[9px] text-faint",title:u,children:o.available?u:"No folder open"})]}),o.available&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>ne(!0),title:"Change folder","aria-label":"Change folder",children:c.jsx(rl,{size:14})}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{K().catch(()=>{})},title:"Refresh tree","aria-label":"Refresh tree",children:c.jsx(zi,{size:13,className:ie(p&&"animate-spin")})})]}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>i(!1),title:"Close workspace","aria-label":"Close workspace",children:c.jsx(Bi,{size:15})})]}),te||!o.available?c.jsx(gI,{onDone:()=>ne(!1)}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-line px-2 py-1.5",children:[c.jsx("button",{type:"button",onClick:()=>O("files"),className:ie("h-7 rounded-md px-2.5 text-[11px] font-medium",ae==="files"?"bg-raised text-ink":"text-muted hover:text-ink"),children:"Files"}),c.jsx("button",{type:"button",onClick:()=>O("preview"),className:ie("h-7 rounded-md px-2.5 text-[11px] font-medium",ae==="preview"?"bg-raised text-ink":"text-muted hover:text-ink"),children:"Preview"}),c.jsxs("button",{type:"button",onClick:()=>O("sessions"),className:ie("h-7 rounded-md px-2.5 text-[11px] font-medium",ae==="sessions"?"bg-raised text-ink":"text-muted hover:text-ink"),children:["Sessions ",c.jsxs("span",{className:"text-faint",children:["· ",ce]})]}),c.jsxs("button",{type:"button",onClick:()=>O("git"),className:ie("h-7 rounded-md px-2.5 text-[11px] font-medium",ae==="git"?"bg-raised text-ink":"text-muted hover:text-ink"),children:["Git ",_.entries.length>0&&c.jsxs("span",{className:"text-warning",children:["· ",_.entries.length]})]}),c.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>A({mode:"create-file",value:""}),title:"New file","aria-label":"New file",children:c.jsx(Kv,{size:13})}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>A({mode:"create-dir",value:""}),title:"New folder","aria-label":"New folder",children:c.jsx(F2,{size:13})})]})]}),ae==="files"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"shrink-0 border-b border-line px-2.5 py-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(as,{size:11,className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-faint"}),c.jsx("input",{value:z,onChange:X=>$(X.target.value),placeholder:"Find a file",className:"h-7 w-full rounded-md border border-transparent bg-raised/60 pl-7 pr-2 text-[10.5px] text-ink outline-none transition-colors placeholder:text-faint focus:border-line focus:bg-panel","aria-label":"Find a file"})]}),G&&c.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[c.jsx("input",{ref:C,value:G.value,onChange:X=>A({...G,value:X.target.value}),onKeyDown:X=>{X.key==="Enter"&&ke(),X.key==="Escape"&&A(null)},placeholder:G.mode==="rename"?g??"new/path":"folder/file.ts",className:"h-7 min-w-0 flex-1 rounded-md border border-accent/40 bg-panel px-2 font-mono text-[10.5px] outline-none"}),c.jsx("button",{type:"button",onClick:()=>{ke()},className:"flex h-7 items-center rounded-md bg-ink px-2 text-[10px] font-medium text-panel",children:c.jsx(vr,{size:10})}),c.jsx("button",{type:"button",onClick:()=>A(null),className:"icon-button h-7 w-7",children:c.jsx(Bi,{size:12})})]})]}),c.jsxs("div",{className:"thin-scroll max-h-[32dvh] min-h-[92px] shrink-0 overflow-y-auto px-1.5 py-1.5 xl:max-h-[38%]",children:[h&&c.jsx("p",{className:"px-2 py-2 text-[10.5px] text-danger",children:h}),p&&d.length===0&&c.jsxs("p",{className:"flex items-center gap-1.5 px-2 py-3 text-[10.5px] text-faint",children:[c.jsx(Vt,{size:11})," Reading folder…"]}),se?se.map(X=>c.jsxs("button",{type:"button",onClick:()=>X.type==="file"&&N(X.path),className:ie("flex h-7 w-full items-center gap-1.5 rounded-md px-2 text-left font-mono text-[10.5px]",g===X.path?"bg-accent-soft font-medium text-accent":"text-muted hover:bg-raised hover:text-ink"),children:[X.type==="dir"?c.jsx(rl,{size:11}):c.jsx(Ma,{size:11}),c.jsx("span",{className:"truncate",children:X.path})]},X.path)):I.map(X=>$e(X,0)),!p&&!h&&d.length===0&&c.jsx("p",{className:"px-2 py-4 text-center text-[10.5px] text-faint",children:"This folder is empty."})]}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:g&&x?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 border-b border-line px-3 py-2",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate font-mono text-[10.5px] font-medium text-ink",children:g}),c.jsxs("p",{className:"mt-0.5 text-[9px] text-faint",children:[hI(g)," · ",he," lines · ",$o(x.size),v?" · unsaved":" · saved"]})]}),k&&c.jsx(Vt,{size:11}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>A({mode:"rename",value:g}),title:"Rename","aria-label":"Rename",children:c.jsx(Lo,{size:12})}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:He,title:"Copy","aria-label":"Copy",children:Se?c.jsx(Cn,{size:12,className:"text-success"}):c.jsx(ld,{size:12})}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7 hover:text-danger",onClick:()=>{ze(g)},title:"Delete","aria-label":"Delete",children:c.jsx(sa,{size:12})}),c.jsxs("button",{type:"button",onClick:()=>{M()},disabled:!v||y,className:"inline-flex h-7 items-center gap-1 rounded-md bg-ink px-2 text-[10px] font-medium text-panel disabled:opacity-35",children:[y?c.jsx(Vt,{size:10}):c.jsx(HT,{size:10}),"Save"]})]}),x.binary?c.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-[11px] text-faint",children:"This file is binary and cannot be edited here."}):c.jsx("textarea",{value:b,onChange:X=>j(X.target.value),spellCheck:!1,wrap:"off","aria-label":`Edit ${g}`,className:"thin-scroll min-h-0 flex-1 resize-none overflow-auto bg-panel p-3.5 font-mono text-[11.5px] leading-[1.75] text-ink outline-none"}),c.jsxs("div",{className:"flex h-6 shrink-0 items-center justify-between border-t border-line px-3 text-[8.5px] text-faint",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:ie("h-1 w-1 rounded-full",v?"bg-warning":"bg-success")}),v?"Unsaved changes":"Saved to disk"]}),c.jsx("span",{children:"⌘S to save · UTF-8"})]})]}):c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[c.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-raised text-faint",children:c.jsx(Ma,{size:16})}),c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"No file selected"}),c.jsx("p",{className:"max-w-[230px] text-[10px] leading-relaxed text-faint",children:"Pick a file from the tree. The agent reads and writes these same files."})]})})]}):ae==="preview"?c.jsx(dI,{}):ae==="sessions"?c.jsx(pI,{}):c.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-3",children:[c.jsx(Xv,{size:14,className:"text-faint"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate text-[11.5px] font-medium text-ink",children:_.available?_.branch||"detached HEAD":"Not a git repository"}),c.jsx("p",{className:"text-[9.5px] text-faint",children:_.available?`${_.entries.length} changed path${_.entries.length===1?"":"s"}`:_.error})]}),c.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{R()},"aria-label":"Refresh git",children:c.jsx(zi,{size:12,className:ie(S&&"animate-spin")})})]}),_.entries.length===0?c.jsx("p",{className:"px-3 py-5 text-[10.5px] text-faint",children:"The working tree is clean."}):_.entries.map(X=>c.jsxs("button",{type:"button",onClick:()=>N(X.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-[10px] hover:bg-raised",title:X.path,children:[c.jsx("span",{className:"w-6 shrink-0 text-warning",children:X.status}),c.jsx("span",{className:"truncate text-muted",children:X.path})]},`${X.status}-${X.path}`)),c.jsx("div",{className:"border-t border-line p-3",children:c.jsx("button",{type:"button",onClick:async()=>{await r({title:"Forget this workspace?",body:"The folder stays on disk. OpenSol stops showing it and closes the current file.",confirmLabel:"Forget workspace"})&&await T()},className:"text-[10.5px] font-medium text-faint hover:text-danger",children:"Forget this workspace"})})]})]}),o.available&&!te&&c.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-1.5 border-t border-line px-3 text-[9px] text-faint",children:[c.jsx(Fh,{size:10,className:ie(p&&"animate-spin")}),"Real folder · daemon-scoped access",c.jsxs("span",{className:"ml-auto",children:[d.length," entries"]})]})]})]})}const Lu={settings:"maxcode-settings-v1",chats:"maxcode-chats-v1",workspace:"maxcode-workspace-v1"},Au=Er()((e,i)=>({phase:"idle",error:"",startedAt:0,boot:async(a=!1)=>{if(i().phase!=="loading"&&!(i().phase==="ready"&&!a)){e({phase:"loading",error:"",startedAt:Date.now()});try{await cl();let r=await SC();const o=bI();o.found&&(r.migration?.migratedAt||(r=(await DC({settings:o.settings,chats:o.chats})).state),yI()),await FE(r),EA(),cA(),e({phase:"ready",error:""})}catch(r){e({phase:"error",error:r instanceof Error?r.message:"OpenSol could not reach its local daemon."})}}}}));async function FE(e){Oe.getState().hydrate(e),Ye.getState().hydrate(e.chats),await Be.getState().hydrate(e.workspace)}function Ov(e){if(e)try{return JSON.parse(e)}catch{return}}function bI(){if(typeof window>"u")return{found:!1,settings:void 0,chats:void 0};let e,i,a=!1;try{e=Ov(window.localStorage.getItem(Lu.settings)),i=Ov(window.localStorage.getItem(Lu.chats)),a=!!(e||i||window.localStorage.getItem(Lu.workspace))}catch{}return{found:a,settings:e,chats:i}}function yI(){try{for(const e of Object.values(Lu))window.localStorage.removeItem(e)}catch{}}const vI=/^[a-z0-9][a-z0-9-]{0,47}$/;function wI(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const i=Object.getPrototypeOf(e);return i!==Object.prototype&&i!==null?!1:e.type==="ready"?Object.keys(e).length===1:e.type==="command"||e.type==="panel"?Object.keys(e).every(a=>["type","id","label"].includes(a))&&typeof e.id=="string"&&vI.test(e.id)&&typeof e.label=="string"&&e.label.trim().length>0&&e.label.length<=80:e.type==="log"||e.type==="error"?Object.keys(e).every(a=>["type","message"].includes(a))&&typeof e.message=="string"&&e.message.length<=500:!1}function kI(e,i,a){const r=`
|
|
289
|
+
const send = (message) => parent.postMessage(message, '*')
|
|
290
|
+
const api = {
|
|
291
|
+
manifest: ${JSON.stringify({id:e.id,name:e.name})},
|
|
292
|
+
command: (id, label) => send({ type: 'command', id, label }),
|
|
293
|
+
panel: (id, label) => send({ type: 'panel', id, label }),
|
|
294
|
+
log: (message) => send({ type: 'log', message: String(message).slice(0, 500) }),
|
|
295
|
+
network: () => { throw new Error('The sandboxed preview has no network access.') },
|
|
296
|
+
workspace: { list: () => [], read: () => '', write: () => {}, edit: () => false },
|
|
297
|
+
}
|
|
298
|
+
try { ;(function (maxcode) { ${i} })(api) } catch (error) {
|
|
299
|
+
send({ type: 'error', message: String(error && error.message ? error.message : error).slice(0, 500) })
|
|
300
|
+
}
|
|
301
|
+
send({ type: 'ready' })
|
|
302
|
+
`;return`<!doctype html><html><head><meta charset="utf-8"><style>${a}</style></head><body><script>${r}<\/script></body></html>`}function EI(e,i){const a=r=>{r.source===e.contentWindow&&wI(r.data)&&i(r.data)};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)}const NI=5*1024*1024,_I=10*1024*1024,SI=100,TI=64*1024,CI=new Set(["workspace.list","workspace.read","workspace.write","workspace.edit","ui.commands","ui.panels","ui.themes","network.request"]),AI=new Set(["id","name","version","apiVersion","entry","stylesheet","capabilities","domains"]);function kt(e){throw new Error(`Invalid plugin package: ${e}`)}function qE(e){return typeof e=="string"?e:new TextDecoder("utf-8").decode(e)}function id(e){return new TextEncoder().encode(e)}function jI(e,i,a){if(a===2)return;const r=qE(i),o=e.endsWith(".js")?[/\b(?:import|export)\b|\b(?:fetch|XMLHttpRequest|WebSocket|EventSource|importScripts)\s*\(|\bnavigator\s*\.\s*sendBeacon\s*\(/i,"module imports and unmanaged network calls are forbidden"]:e.endsWith(".css")?[/@import\b|url\s*\(\s*(['"]?)(?!data:image\/(?:png|jpeg|gif|webp);base64,)[^)]*\)/i,"external CSS resources and imports are forbidden"]:null;if(!o)return;const u=o[0].exec(r);if(!u)return;const d=r.slice(0,u.index).split(`
|
|
303
|
+
`).length,p=u[0].length>60?`${u[0].slice(0,60)}…`:u[0];kt(`${o[1]}: found "${p}" at ${e}:${d}`)}function Mh(e){return(typeof e!="string"||!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||e.split("/").some(i=>!i||i==="."||i===".."))&&kt(`unsafe path "${String(e)}"`),e}function OI(e){(typeof e!="string"||e.length>253||e.endsWith("."))&&kt("invalid domain");const i=e.split(".");return(i.length<2||i.some(a=>!/^(?=.{1,63}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(a)))&&kt(`invalid domain "${e}"`),e.toLowerCase()}function Ad(e){(!e||typeof e!="object"||Array.isArray(e))&&kt("manifest must be an object"),Object.keys(e).some(b=>!AI.has(b))&&kt("unknown manifest field");const{id:i,name:a,version:r,apiVersion:o,entry:u,stylesheet:d,capabilities:p,domains:h}=e;(typeof i!="string"||!/^[a-z0-9][a-z0-9-]{1,63}$/.test(i))&&kt("invalid plugin id"),(typeof a!="string"||!a.trim()||a.length>100)&&kt("invalid plugin name"),(typeof r!="string"||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(r))&&kt("invalid plugin version"),o!==1&&o!==2&&kt("unsupported API version"),Mh(u),Mh(d),(!u.endsWith(".js")||!d.endsWith(".css"))&&kt("entry must be JavaScript and stylesheet must be CSS");const g=p??[];Array.isArray(g)||kt("capabilities must be an array"),o===1&&g.some(b=>!CI.has(b))&&kt("invalid capability"),h!==void 0&&!Array.isArray(h)&&kt("domains must be an array");const x=(h??[]).map(OI);return new Set(x).size!==x.length&&kt("duplicate domain"),{id:i,name:a.trim(),version:r,apiVersion:o,entry:u,stylesheet:d,capabilities:[...new Set(g)],domains:x}}function MI(e,i){(!e||typeof e!="object"||Array.isArray(e))&&kt("files must be a path-to-source object");const a=Object.keys(e);a.length>SI&&kt("too many files");const r={};let o=0;for(const u of a){const d=Mh(u);d==="manifest.json"&&kt("manifest is generated from the manifest field"),/\.(?:mjs|cjs|jsx|ts|tsx)$/i.test(d)&&d!==i.entry&&kt(`undeclared executable file "${d}"`),d!==i.entry&&d!==i.stylesheet&&/\.(?:js|css)$/i.test(d)&&kt(`undeclared executable file "${d}"`);const p=e[u];typeof p!="string"&&!(p instanceof Uint8Array)&&kt(`file "${d}" must be text or bytes`);const h=typeof p=="string"?id(p):p;o+=h.byteLength,o>_I&&kt("package is too large"),(d===i.entry||d===i.stylesheet)&&jI(d,h,i.apiVersion),r[d]=typeof p=="string"?p:qE(h)}return i.entry in r||kt("entry file is missing"),i.stylesheet in r||kt("stylesheet file is missing"),id(r[i.entry]).byteLength>2*1024*1024&&kt("entry file is too large"),r}function RI(e){const i=Ad(e?.manifest),a=MI(e?.files,i),r=JSON.stringify(i);id(r).byteLength>TI&&kt("manifest is too large");const u=id(JSON.stringify({format:"cordis-plugin",manifest:i,files:a}));return u.byteLength>NI&&kt("package is too large"),u}function Dg(e){(!e||!(e instanceof Uint8Array)||e.byteLength===0)&&kt("package archive is empty or invalid");let i;try{const o=new TextDecoder("utf-8").decode(e);i=JSON.parse(o)}catch{kt("package is not a valid JSON archive")}(!i||typeof i!="object")&&kt("invalid package format");const a=Ad(i.manifest),r=i.files;return(!r||typeof r!="object")&&kt("missing package files"),{manifest:a,files:r}}const DI=/\.(?:png|jpe?g|gif|webp|ico|woff2?|ttf|otf|eot|wasm|zip|pdf|mp3|mp4)$/i;function zI(e){return DI.test(e)}function LI(e){const i=e[0]?.indexOf("/")??-1;if(i<0)return e;const a=e[0].slice(0,i+1);return e.every(r=>r.startsWith(a))?e.map(r=>r.slice(a.length)):e}function II(e){if(typeof e!="string")throw new Error("manifest.json must be text.");let i;try{i=JSON.parse(e)}catch{throw new Error("manifest.json is not valid JSON.")}return Ad(i)}function UI(e){const i=LI(e.map(v=>v.path)),a={};let r;e.forEach((v,y)=>{const k=i[y];k==="manifest.json"?r=v.content:a[k]=v.content});const o=Object.keys(a),u=(v,y)=>v!==void 0&&v.endsWith(y)&&o.includes(v)?v:void 0,d=(v,y)=>{if(o.includes(v))return v;const k=o.filter(_=>_.endsWith(y)).sort();return k.find(_=>_.slice(_.lastIndexOf("/")+1)===v)??k[0]};let p,h;if(r!==void 0)try{p=II(r)}catch(v){h=v instanceof Error?v.message:"manifest.json could not be read."}const g=u(p?.entry,".js")??d("main.js",".js");if(!g)throw new Error("A plugin needs one .js entry file. Pick a folder that has one.");const x=u(p?.stylesheet,".css")??d("main.css",".css")??"main.css",b=o.filter(v=>v!==g&&v!==x&&/\.(?:m?js|cjs|jsx|tsx?|css)$/i.test(v));if(b.length>0)throw new Error(`A plugin package holds one script and one stylesheet. Remove or merge: ${b.join(", ")}.`);return{entry:g,stylesheet:x,files:a,manifest:p,manifestError:h}}const BI=["workspace.list","workspace.read","workspace.write","workspace.edit","ui.commands","ui.panels","ui.themes","network.request"],$I=".js,.css,.json,.txt,.html,.svg,.png,.jpg,.jpeg,.gif,.webp,.woff,.woff2",ju="h-8 w-full rounded-lg border border-line bg-panel px-2.5 text-[12px] text-ink outline-none transition-colors placeholder:text-faint focus:border-accent/50";async function HI(e){const i=e.webkitRelativePath||e.name;return{path:i,content:zI(i)?new Uint8Array(await e.arrayBuffer()):await e.text()}}function PI({onInstalled:e}){const i=me(T=>T.notify),[a,r]=B.useState("my-plugin"),[o,u]=B.useState("My plugin"),[d,p]=B.useState("1.0.0"),[h,g]=B.useState(1),[x,b]=B.useState(["ui.commands"]),[v,y]=B.useState(""),[k,_]=B.useState(null),S=B.useRef(null),N=B.useRef(null),M=async T=>{if(T?.length)try{const R=await Promise.all([...T].map(HI)),K=UI(R);_(K),K.manifest&&(r(K.manifest.id),u(K.manifest.name),p(K.manifest.version),g(K.manifest.apiVersion===2?2:1),b(K.manifest.capabilities),y(K.manifest.domains.join(", "))),i(K.manifestError?`Loaded ${Object.keys(K.files).length} file(s). Its manifest.json was ignored: ${K.manifestError}`:`Loaded ${Object.keys(K.files).length} file(s) — entry ${K.entry}.`,K.manifestError?"error":"info")}catch(R){_(null),i(R instanceof Error?R.message:"Those files are not a plugin folder.","error")}},j=()=>{try{if(!k)throw new Error("Load a plugin folder or its files first.");const T={id:a.trim(),name:o.trim(),version:d.trim(),apiVersion:h,entry:k.entry,stylesheet:k.stylesheet,capabilities:h===2?[]:x,domains:v.split(/[\s,]+/).map(K=>K.trim()).filter(Boolean)};Ad(T);const R={...k.files};return R[T.stylesheet]??="",{archive:RI({manifest:T,files:R})}}catch(T){return i(T instanceof Error?T.message:"That package could not be built.","error"),null}},D=()=>{const T=j();if(!T)return;const R=URL.createObjectURL(new Blob([T.archive],{type:"application/json"})),K=document.createElement("a");K.href=R,K.download=`${a.trim()||"plugin"}.plugin.json`,K.click(),URL.revokeObjectURL(R)},P=async()=>{const T=j();if(T)try{const{plugin:R}=await rw(T.archive);e?.(R),i(`${R.manifest.name} installed. It starts sandboxed and disabled.`,"success")}catch(R){i(R instanceof Error?R.message:"The daemon rejected this package.","error")}},L=k?Object.keys(k.files):[];return c.jsxs("details",{className:"rounded-xl border border-line bg-raised/20",children:[c.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2.5 text-[11.5px] font-medium text-ink",children:[c.jsx(eT,{size:13,className:"text-faint"}),"Build a plugin package from a folder"]}),c.jsxs("div",{className:"space-y-2.5 border-t border-line px-3 py-3",children:[c.jsxs("p",{className:"text-[10.5px] leading-relaxed text-faint",children:["Load a plugin folder, or the files themselves. One ",c.jsx("code",{className:"font-mono",children:".js"})," entry and one optional ",c.jsx("code",{className:"font-mono",children:".css"})," stylesheet become the package. A"," ",c.jsx("code",{className:"font-mono",children:"manifest.json"})," in the folder fills these fields in; the fields win."]}),c.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-panel px-2.5 py-2",children:[c.jsx($i,{checked:h===2,onChange:T=>g(T?2:1),label:"API v2"}),c.jsx("span",{className:"text-[10.5px] font-medium text-ink",children:"API v2 — free plugin (full app access)"}),h===2&&c.jsx("span",{className:"ml-auto text-[9.5px] text-accent",children:"ctx = Cordis kernel scope"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>S.current?.click(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-accent px-3 text-[10.5px] font-medium text-on-accent hover:bg-accent/90",children:[c.jsx(Vv,{size:12}),"Load folder"]}),c.jsxs("button",{type:"button",onClick:()=>N.current?.click(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-3 text-[10.5px] font-medium text-ink hover:bg-raised",children:[c.jsx(U2,{size:12}),"Load files"]}),c.jsx("input",{type:"file",multiple:!0,ref:T=>{S.current=T,T&&(T.webkitdirectory=!0)},className:"hidden",onChange:T=>{M(T.target.files),T.target.value=""}}),c.jsx("input",{ref:N,type:"file",multiple:!0,accept:$I,className:"hidden",onChange:T=>{M(T.target.files),T.target.value=""}})]}),k&&c.jsxs("div",{className:"rounded-lg border border-line bg-panel/60 px-2.5 py-2",children:[c.jsxs("p",{className:"text-[10.5px] text-muted",children:[c.jsxs("span",{className:"font-medium text-ink",children:[L.length," file(s)"]})," · entry"," ",c.jsx("code",{className:"font-mono",children:k.entry})," · stylesheet"," ",c.jsx("code",{className:"font-mono",children:k.stylesheet})]}),c.jsxs("ul",{className:"mt-1 space-y-0.5",children:[L.slice(0,6).map(T=>c.jsxs("li",{className:"truncate font-mono text-[9.5px] text-faint",children:[T," · ",$o(typeof k.files[T]=="string"?new TextEncoder().encode(k.files[T]).length:k.files[T].byteLength)]},T)),L.length>6&&c.jsxs("li",{className:"font-mono text-[9.5px] text-faint",children:["+",L.length-6," more"]})]})]}),c.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Id"}),c.jsx("input",{className:ju,value:a,onChange:T=>r(T.target.value)})]}),c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Name"}),c.jsx("input",{className:ju,value:o,onChange:T=>u(T.target.value)})]}),c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Version"}),c.jsx("input",{className:ju,value:d,onChange:T=>p(T.target.value)})]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Capabilities"}),c.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:h===2?c.jsx("p",{className:"text-[10px] text-faint",children:"Not needed — API v2 plugin has full access via the Cordis context."}):BI.map(T=>{const R=x.includes(T);return c.jsx("button",{type:"button",onClick:()=>b(K=>R?K.filter(z=>z!==T):[...K,T]),className:`rounded-full border px-2 py-1 font-mono text-[9.5px] ${R?"border-accent/40 bg-accent-soft text-ink":"border-line text-faint"}`,children:T},T)})})]}),c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Network domains (optional, comma separated)"}),c.jsx("input",{className:ju,value:v,placeholder:"Leave empty — a plugin that needs no network declares none",onChange:T=>y(T.target.value)})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("button",{type:"button",onClick:D,className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-accent px-3 text-[10.5px] font-medium text-on-accent hover:bg-accent/90",children:"Download plugin package"}),c.jsx("button",{type:"button",onClick:()=>{P()},className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-3 text-[10.5px] font-medium text-ink hover:bg-raised",children:"Build and install"})]})]})]})}function FI({plugin:e}){const i=me(x=>x.notify),[a,r]=B.useState(null),[o,u]=B.useState([]),d=B.useRef(null),[p,h]=B.useState(!1);B.useEffect(()=>{if(!(!d.current||!a))return EI(d.current,x=>{const b=x,v=b.type==="ready"?"Sandbox ready — no app access, no network.":`${b.type}: ${b.message??b.label??""}`;u(y=>[...y.slice(-5),v])})},[a]);const g=async()=>{h(!0);try{const x=await aw(e.id),{files:b,manifest:v}=Dg(x);u([]),r(kI(v,b[v.entry]??"",b[v.stylesheet]??""))}catch(x){i(x instanceof Error?x.message:"This plugin could not be previewed.","error")}finally{h(!1)}};return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",disabled:p,onClick:()=>a?r(null):void g(),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-line px-2.5 text-[10.5px] font-medium text-muted hover:text-ink disabled:opacity-40",children:[c.jsx(Bh,{size:11}),a?"Stop preview":"Preview in sandbox"]}),a&&c.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-line",children:[c.jsx("iframe",{ref:d,title:`${e.manifest.name} preview`,sandbox:"allow-scripts",srcDoc:a,className:"h-52 w-full bg-panel"}),c.jsx("div",{className:"max-h-24 overflow-y-auto border-t border-line bg-raised/40 px-2.5 py-1.5 font-mono text-[9.5px] leading-relaxed text-faint",children:o.map((x,b)=>c.jsx("p",{className:"truncate",children:x},b))})]})]})}const qI={"workspace.list":"List files in the open workspace","workspace.read":"Read workspace files","workspace.write":"Create and overwrite workspace files","workspace.edit":"Edit workspace files in place","ui.commands":"Add commands to OpenSol","ui.panels":"Add panels to OpenSol","ui.themes":"Add themes to OpenSol","network.request":"Call the HTTPS domains it declared"};function GI(){const e=me(k=>k.notify),i=me(k=>k.askConfirm),[a,r]=B.useState([]),[o,u]=B.useState(!1),[d,p]=B.useState(null),h=B.useRef(null),g=async()=>{try{r((await iw()).plugins)}catch(k){e(k instanceof Error?k.message:"Could not list plugins.","error")}};B.useEffect(()=>{g()},[]);const x=k=>{r(_=>_.map(S=>S.id===k.id?k:S))},b=async k=>{u(!0);try{Dg(new Uint8Array(await k.arrayBuffer()));const{plugin:_}=await rw(new Uint8Array(await k.arrayBuffer()));r(S=>[...S.filter(N=>N.id!==_.id),_]),p(_.id),e(`${_.manifest.name} installed. It starts sandboxed and disabled.`,"success")}catch(_){e(_ instanceof Error?_.message:"That file is not a valid plugin package.","error")}finally{u(!1)}},v=async(k,_,S)=>{try{x((await AC(k.id,{capabilities:_,domains:S})).plugin)}catch(N){e(N instanceof Error?N.message:"Could not save plugin permissions.","error")}},y=async k=>{if(k.safe){x((await J1(k.id,!1)).plugin);return}await i({title:`Run ${k.manifest.name} outside the sandbox?`,body:"Safe plugins run as real JavaScript inside OpenSol. They can do anything this app can, so only mark plugins you wrote or have reviewed.",confirmLabel:"Mark as Safe",tone:"danger"})&&x((await J1(k.id,!0)).plugin)};return c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"rounded-xl border border-line bg-raised/20 p-3",children:[c.jsx("h3",{className:"text-[12px] font-medium text-ink",children:"Install a local plugin"}),c.jsxs("p",{className:"mt-1 text-[10.5px] leading-relaxed text-faint",children:["OpenSol installs ",c.jsx("code",{className:"font-mono",children:".plugin.json"})," packages you pick from this machine. New plugins start sandboxed and disabled until you review them."]}),c.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[c.jsxs("button",{type:"button",disabled:o,onClick:()=>h.current?.click(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-accent px-3 text-[10.5px] font-medium text-on-accent hover:bg-accent/90 disabled:opacity-40",children:[c.jsx(es,{size:12}),"Choose plugin package"]}),c.jsx("input",{ref:h,type:"file",accept:".plugin.json,.pluginmax,application/json,application/zip",className:"hidden",onChange:k=>{const _=k.target.files?.[0];k.target.value="",_&&b(_)}})]})]}),a.length===0?c.jsx("p",{className:"rounded-lg border border-line bg-raised/30 px-3 py-3 text-[10.5px] text-faint",children:"No plugins installed."}):c.jsx("div",{className:"space-y-2",children:a.map(k=>{const _=d===k.id;return c.jsxs("div",{className:"overflow-hidden rounded-xl border border-line",children:[c.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[c.jsx(Yh,{size:14,className:"shrink-0 text-faint"}),c.jsxs("button",{type:"button",onClick:()=>p(_?null:k.id),className:"min-w-0 flex-1 text-left",children:[c.jsx("span",{className:"block truncate text-[11.5px] font-medium text-ink",children:k.manifest.name}),c.jsxs("span",{className:"block truncate text-[9.5px] text-faint",children:[k.id," · v",k.manifest.version," ·"," ",k.safe?"Safe — runs unsandboxed":"Sandboxed"]})]}),c.jsx($i,{checked:k.enabled,disabled:!k.safe,label:`Enable ${k.manifest.name}`,onChange:async S=>{x((await jC(k.id,S)).plugin)}})]}),_&&c.jsxs("div",{className:"space-y-2.5 border-t border-line px-3 py-3",children:[c.jsxs("div",{className:ie("flex items-start gap-2 rounded-lg px-2.5 py-2 text-[10px] leading-relaxed",k.safe?"bg-warning/10 text-ink":"bg-raised/60 text-muted"),children:[k.safe?c.jsx(YT,{size:13,className:"mt-0.5 shrink-0 text-warning"}):c.jsx(kr,{size:13,className:"mt-0.5 shrink-0 text-faint"}),c.jsx("span",{children:k.safe?"This plugin runs as real JavaScript in OpenSol with the permissions below. It is not sandboxed any more.":"This plugin is sandboxed. Mark it Safe to run its code, or preview it first."})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-[10.5px] font-medium text-ink",children:"Capabilities"}),c.jsxs("div",{className:"mt-1.5 space-y-1",children:[k.manifest.capabilities.length===0&&c.jsx("p",{className:"text-[10px] text-faint",children:"This plugin requests no capabilities."}),k.manifest.capabilities.map(S=>c.jsxs("label",{className:"flex items-center gap-2 text-[10.5px] text-muted",children:[c.jsx("input",{type:"checkbox",className:"accent-[rgb(var(--accent))]",checked:k.grants.capabilities.includes(S),onChange:N=>{v(k,N.target.checked?[...k.grants.capabilities,S]:k.grants.capabilities.filter(M=>M!==S),k.grants.domains)}}),c.jsx("span",{className:"flex-1",children:qI[S]}),c.jsx("code",{className:"font-mono text-[9.5px] text-faint",children:S})]},S))]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-[10.5px] font-medium text-ink",children:"Network domains"}),k.manifest.domains.length===0?c.jsx("p",{className:"mt-1 text-[10px] text-faint",children:"This plugin declares no network access."}):c.jsx("div",{className:"mt-1.5 space-y-1",children:k.manifest.domains.map(S=>c.jsxs("label",{className:"flex items-center gap-2 text-[10.5px] text-muted",children:[c.jsx("input",{type:"checkbox",className:"accent-[rgb(var(--accent))]",checked:k.grants.domains.includes(S),onChange:N=>{v(k,k.grants.capabilities,N.target.checked?[...k.grants.domains,S]:k.grants.domains.filter(M=>M!==S))}}),c.jsx("code",{className:"flex-1 font-mono text-[10px]",children:S})]},S))})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5",children:[c.jsx(FI,{plugin:k}),c.jsx("button",{type:"button",onClick:()=>{y(k)},className:ie("inline-flex h-7 items-center gap-1.5 rounded-lg border px-2.5 text-[10.5px] font-medium",k.safe?"border-line bg-panel text-muted hover:text-ink":"border-warning/40 bg-warning/10 text-ink"),children:k.safe?"Return to sandbox":"Mark as Safe"}),c.jsxs("button",{type:"button",onClick:async()=>{await i({title:`Uninstall ${k.manifest.name}?`,body:"Its permissions, styles and commands are removed from OpenSol.",confirmLabel:"Uninstall",tone:"danger"})&&(await OC(k.id),r(N=>N.filter(M=>M.id!==k.id)))},className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-line px-2.5 text-[10.5px] font-medium text-muted hover:text-danger",children:[c.jsx(sa,{size:11}),"Uninstall"]})]})]})]},k.id)})}),c.jsx(PI,{onInstalled:k=>r(_=>[..._.filter(S=>S.id!==k.id),k])})]})}const YI=/^[a-z0-9][a-z0-9-]{0,47}$/;function KI(e,i){return!!e?.capabilities.includes(i)}function VI(e,i,a){let r;try{const o=new URL(a);if(o.protocol!=="https:"||o.port&&o.port!=="443")return null;r=o.hostname.toLowerCase()}catch{return null}return!i.includes(r)||!e?.domains.includes(r)?null:r}function Rh(){return{commands:new Map,panels:new Map,themes:new Map}}function XI(e){throw new Error(`The plugin was not granted ${e}.`)}function ZI(e,i,a,r=Rh()){const o=d=>{KI(i,d)||XI(d)},u=d=>{if(!YI.test(d))throw new Error("A plugin contribution id must be lowercase letters, digits and dashes.")};return{manifest:Object.freeze({...e.manifest}),version:1,registerCommand(d,p,h){if(o("ui.commands"),u(d),typeof h!="function")throw new Error("A command needs a function.");r.commands.set(d,{label:String(p).slice(0,80),run:h})},registerPanel(d,p,h){if(o("ui.panels"),u(d),typeof h!="function")throw new Error("A panel needs a render function.");r.panels.set(d,{label:String(p).slice(0,80),render:h})},registerTheme(d,p,h){if(o("ui.themes"),u(d),!h||typeof h!="object")throw new Error("A theme needs a palette.");r.themes.set(d,{label:String(p).slice(0,80),palette:{...h}})},workspace:{list:async d=>(o("workspace.list"),a.workspace.list(d)),read:async d=>(o("workspace.read"),a.workspace.read(d)),write:async(d,p)=>(o("workspace.write"),a.workspace.write(d,p)),edit:async(d,p,h)=>(o("workspace.edit"),a.workspace.edit(d,p,h))},network:{request(d,p){if(o("network.request"),!VI(i,e.manifest.domains,d))throw new Error("This plugin may only call HTTPS hosts it declared and you granted.");return a.network(e.id,{url:d,...p})}},log(d){console.info(`[plugin:${e.id}]`,d)}}}const GE=e=>`maxcode-plugin-style-${e}`,Vm="plugin-";function QI(e){return Object.entries(e).filter(([i,a])=>/^[a-z][a-z0-9-]*$/.test(i)&&/^[\d\s.]+$/.test(a))}function JI(e){const i=(e.canvas??"").trim().split(/\s+/).map(Number),[a,r,o]=i.length===3?i:[255,255,255];return .2126*a+.7152*r+.0722*o<110}function WI(e,i){const a=QI(i).map(([r,o])=>`--${r}:${o.trim()}`);return a.length===0?"":`[data-theme='${e}']{${a.join(";")}}`}function YE(e){return document.getElementById(GE(e))}function Mv(e,i){let a=YE(e);a||(a=document.createElement("style"),a.id=GE(e),document.head.append(a)),a.textContent=i}function e9(e){YE(e)?.remove()}async function Rv(e,i){const a=globalThis,r=URL.createObjectURL(new Blob([`const maxcode = globalThis.__maxcodePluginApi;
|
|
304
|
+
${e}
|
|
305
|
+
`],{type:"text/javascript"}));a.__maxcodePluginApi=i;try{await import(r)}finally{delete a.__maxcodePluginApi,URL.revokeObjectURL(r)}}function t9(){const e=new Map,i=new Map,a=r=>{const o=i.get(r);o&&(i.delete(r),o.dispose());const u=e.get(r);if(u)for(const d of u.themes.keys())bw(`${Vm}${r}:${d}`);e.delete(r),e9(r)};return{contributions:e,contributionsFor:r=>e.get(r)??Rh(),themes(){const r=[];for(const[o,u]of e)for(const[d,p]of u.themes)r.push({id:`${Vm}${o}:${d}`,label:p.label});return r},commands(){const r=[];for(const[o,u]of e)for(const[d,p]of u.commands)r.push({pluginId:o,id:d,label:p.label,run:p.run});return r},async activate(r,o){if(a(r.id),!r.safe||!r.enabled)return;const{files:u,manifest:d}=Dg(await aw(r.id));if(d.apiVersion===2){let p,h;const g=new Promise((v,y)=>{p=v,h=y}),x=async v=>{const y=u[d.stylesheet]??"";y&&Mv(r.id,y);try{await Rv(u[d.entry]??"",v),p()}catch(k){h(k)}},b=qt.plugin(x);i.set(r.id,b);try{await g}catch(v){throw a(r.id),new Error(`Plugin ${r.id} failed to start: ${v instanceof Error?v.message:String(v)}`)}}else{const p=e.get(r.id)??Rh();e.set(r.id,p);const h=ZI(r,r.grants,o,p);try{await Rv(u[d.entry]??"",Object.freeze(h));const g=[...p.themes.entries()].map(([x,b])=>{const v=`${Vm}${r.id}:${x}`;return xw({id:v,label:b.label,dark:JI(b.palette)}),WI(v,b.palette)}).join(`
|
|
306
|
+
`);Mv(r.id,`${u[d.stylesheet]??""}
|
|
307
|
+
${g}`)}catch(g){throw a(r.id),new Error(`Plugin ${r.id} failed to start: ${g instanceof Error?g.message:String(g)}`)}}},deactivate:a,deactivateAll(){const r=[...new Set([...e.keys(),...i.keys()])];for(const o of r)a(o)}}}const n9={workspace:{async list(e=""){return(await lw(e)).entries.map(a=>({path:a.path,name:a.name,type:a.type}))},async read(e){return(await Jm(e)).content},async write(e,i){await Wm(e,i)},async edit(e,i,a){const r=await Jm(e);return r.content.includes(i)?(await Wm(e,r.content.replace(i,a)),!0):!1}},network:(e,i)=>MC(e,i)};let Dv=null;function KE(){return Dv??=t9(),Dv}async function i9(e){const i=new Set(e.filter(r=>r.safe&&r.enabled).map(r=>r.id)),a=KE();for(const r of[...a.contributions.keys()])i.has(r)||a.deactivate(r);for(const r of e)if(i.has(r.id))try{await a.activate(r,n9)}catch(o){console.error(o)}}const yo=[{id:"general",label:"General",icon:QT,description:"Permissions, appearance and conversation display."},{id:"models",label:"Models",icon:Uu,description:"Providers, encrypted keys, live models and reasoning defaults."},{id:"tools",label:"Tools",icon:Co,description:"What OpenSol can do on this machine, and when it must ask."},{id:"search",label:"Search",icon:is,description:"Give the agent current web results with your own key."},{id:"skills",label:"Skills",icon:Ui,description:"Instructions added to every request when enabled."},{id:"plugins",label:"Plugins",icon:Yh,description:"Install local plugin packages, review what they ask for, and run them once you trust the code."},{id:"mcp",label:"MCP",icon:Hh,description:"Model Context Protocol servers now have their own panel, with OAuth sign-in and local, HTTP and SSE connections."},{id:"deploy",label:"Deploy",icon:wr,description:"Hosting credentials and command-line tools."},{id:"appearance",label:"Appearance",icon:Qv,description:"Theme and interface preferences."},{id:"about",label:"About",icon:$h,description:"Local storage, history and reset controls."}],Ra="h-8 w-full rounded-lg border border-line bg-panel px-2.5 text-[12px] text-ink outline-none transition-colors placeholder:text-faint focus:border-accent/50 disabled:opacity-50";function ra({children:e,hint:i}){return c.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-3",children:[c.jsx("span",{className:"text-[11px] font-medium text-ink",children:e}),i&&c.jsx("span",{className:"text-[9.5px] text-faint",children:i})]})}function Rn({title:e,description:i,children:a,action:r}){return c.jsxs("section",{className:"settings-card mx-5 my-4 sm:mx-8",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h3",{className:"flex items-center gap-2 font-display text-[14px] font-semibold tracking-[-0.01em] text-ink",children:[c.jsx("span",{className:"h-3.5 w-[3px] rounded-full bg-accent"}),e]}),i&&c.jsx("p",{className:"mt-1.5 max-w-[620px] text-[11.5px] leading-relaxed text-muted",children:i})]}),r&&c.jsx("div",{className:"shrink-0",children:r})]}),c.jsx("div",{className:"mt-4",children:a})]})}function zg({value:e,onChange:i,placeholder:a,disabled:r,label:o}){const[u,d]=B.useState(!1);return c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:u?"text":"password",value:e,onChange:p=>i(p.target.value),placeholder:a,disabled:r,autoComplete:"off",spellCheck:!1,"aria-label":o,className:ie(Ra,"pr-8 font-mono text-[11px]")}),c.jsx("button",{type:"button",onClick:()=>d(p=>!p),className:"absolute right-1.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-faint hover:text-ink","aria-label":u?"Hide secret":"Show secret",tabIndex:-1,children:u?c.jsx(A2,{size:12}):c.jsx(Bh,{size:12})})]})}const a9=[];function r9(e){return e?e>=1e3?`${Math.round(e/1e3)}k`:String(e):""}const s9={openrouter:{prefix:"sk-or-",label:"OpenRouter"},anthropic:{prefix:"sk-ant-",label:"Anthropic"},google:{prefix:"AIza",label:"Google"},groq:{prefix:"gsk_",label:"Groq"},xai:{prefix:"xai-",label:"xAI"}};function l9({providerId:e,open:i,onToggle:a}){const r=Oe(),o=Oe(O=>O.selectModel),u=Oe(O=>O.updateProvider),d=Oe(O=>O.saveProviderKey),p=me(O=>O.notify),h=me(O=>O.askConfirm),g=On(O=>O.fetchModels),x=On(O=>O.byProvider[e])??a9,b=On(O=>!!O.loading[e]),v=On(O=>O.errors[e]??""),y=On(O=>O.notes[e]??""),k=On(O=>O.source[e]??""),[_,S]=B.useState(""),[N,M]=B.useState(""),[j,D]=B.useState(!1),P=aa[e],L=r.providerStatus.find(O=>O.id===e),T=pd(r,e),R=r.provider===e,K=r.providers[e]?.baseUrl??"",z=L?.hint??"",$=li(r),W=x.find(O=>O.id===$);B.useEffect(()=>{if(!i||!T)return;const O=window.setTimeout(()=>{g(e)},400);return()=>window.clearTimeout(O)},[i,T,e,K,g]);const de=async()=>{const O=_.trim();if(!O){p(`Paste a ${P.name} API key first.`,"error");return}const te=s9[e];if(te&&!O.startsWith(te.prefix)){let ne="";e==="openrouter"&&O.startsWith("sk-")&&(ne=" (looks like a DeepSeek or OpenAI key). If you are using DeepSeek, please paste it under DeepSeek instead."),p(`A key for ${te.label} must start with "${te.prefix}"${ne}`,"error");return}D(!0);try{await d(e,O),S(""),p(`${P.name} key saved and encrypted.`,"success"),g(e,!0)}catch(ne){p(ne instanceof Error?ne.message:"Could not save that key.","error")}finally{D(!1)}},ce=async()=>{if(await h({title:`Remove the ${P.name} key?`,body:"The encrypted key is deleted from this computer. You can add it again at any time.",confirmLabel:"Remove key",tone:"danger"}))try{await d(e,""),p(`${P.name} key removed.`,"success")}catch(te){p(te instanceof Error?te.message:"Could not remove that key.","error")}},ae=async()=>{if(x.length===0){const O=await g(e,!0);O[0]?o(e,O[0].id):p("No usable model was returned by this provider.","error");return}o(e,x[0].id)};return c.jsxs("div",{className:ie("rounded-xl border transition-colors",i?"border-line bg-raised/25":"border-line bg-panel"),children:[c.jsxs("button",{type:"button",onClick:a,className:"flex w-full items-center gap-3 px-3 py-2.5 text-left",children:[c.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-line bg-panel font-display text-[12px] font-semibold text-muted",children:P.name.slice(0,1)}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[12px] font-medium text-ink",children:P.name}),R&&c.jsx("span",{className:"rounded bg-accent-soft px-1.5 py-0.5 text-[8.5px] font-medium text-accent",children:"Active"})]}),c.jsxs("span",{className:ie("mt-0.5 flex items-center gap-1 text-[9.5px]",T?"text-success":"text-faint"),children:[c.jsx("span",{className:ie("h-1 w-1 rounded-full",T?"bg-success":"bg-faint")}),T?e==="custom"?"Endpoint configured":P.keyless?"No key needed":`Connected ${z}`:P.keyless?"Local endpoint":"No key"]})]}),!i&&c.jsx("span",{className:"hidden max-w-[170px] truncate text-[9.5px] text-faint sm:block",children:R&&$?W?.name??$:x.length?`${x.length} live models`:""}),c.jsx(Do,{size:14,className:ie("shrink-0 text-faint transition-transform",i&&"rotate-180")})]}),i&&c.jsxs("div",{className:"border-t border-line px-3 pb-3 pt-3",children:[!P.keyless&&c.jsxs("div",{className:"mb-2.5",children:[c.jsx(ra,{hint:T?"Saved and encrypted":"Required",children:"API key"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("div",{className:"min-w-0 flex-1",children:c.jsx(zg,{value:_,onChange:S,placeholder:T?`Replace key ${z}`:P.keyHint,label:`${P.name} API key`})}),c.jsxs("button",{type:"button",onClick:()=>{de()},disabled:!_.trim()||j,className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-lg bg-ink px-2.5 text-[10px] font-medium text-panel disabled:opacity-40",children:[j?c.jsx(Vt,{size:10}):c.jsx(cd,{size:10}),"Save"]})]}),T&&c.jsx("button",{type:"button",onClick:()=>{ce()},className:"mt-1.5 text-[9.5px] font-medium text-faint transition-colors hover:text-danger",children:"Remove saved key"})]}),c.jsxs("div",{className:"mb-2.5",children:[c.jsx(ra,{hint:e==="custom"?"Required":"Optional",children:"Base URL"}),c.jsx("input",{value:K,onChange:O=>u(e,{baseUrl:O.target.value}),placeholder:P.baseUrl||"https://example.com/v1",spellCheck:!1,className:ie(Ra,"font-mono text-[11px]")}),c.jsx("p",{className:"mt-1 text-[9px] leading-relaxed text-faint",children:e==="custom"?"Point this at an OpenAI-compatible endpoint or proxy you control.":`Leave blank for ${P.baseUrl||"the provider default"}. Useful for a gateway or local proxy.`})]}),P.note&&c.jsx("p",{className:"mb-2.5 text-[9.5px] leading-relaxed text-faint",children:P.note}),c.jsxs("div",{children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-[11px] font-medium text-ink",children:"Model"}),c.jsxs("button",{type:"button",onClick:()=>{g(e,!0)},disabled:!T||b,className:"inline-flex items-center gap-1 text-[9.5px] font-medium text-faint transition-colors hover:text-ink disabled:cursor-not-allowed disabled:opacity-40",children:[b?c.jsx(Vt,{size:10}):c.jsx(zi,{size:10}),b?"Loading":"Refresh live models"]})]}),v&&c.jsx("p",{className:"mb-1.5 rounded-md border border-danger/20 bg-danger/[0.04] px-2 py-1.5 text-[9.5px] leading-relaxed text-danger",children:v}),y&&!v&&c.jsx("p",{className:"mb-1.5 text-[9px] leading-relaxed text-faint",children:y}),x.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("select",{value:R?$:"",onChange:O=>{O.target.value&&o(e,O.target.value)},className:ie(Ra,"font-mono text-[11px]"),"aria-label":`${P.name} model`,children:[c.jsx("option",{value:"",children:"Choose a model…"}),R&&$&&!x.some(O=>O.id===$)&&c.jsxs("option",{value:$,children:[$," (not listed)"]}),x.map(O=>c.jsxs("option",{value:O.id,children:[O.name||O.id,O.context?` · ${r9(O.context)} ctx`:""]},O.id))]}),c.jsxs("p",{className:"mt-1 text-[9px] text-faint",children:[x.length," usable chat model",x.length===1?"":"s",k==="catalog"?" from the models.dev fallback":" loaded live from the provider","."]})]}):c.jsx("p",{className:"text-[9.5px] leading-relaxed text-faint",children:b?"Loading the provider’s current models…":T?"No usable models were returned. You can still enter an exact model ID.":e==="custom"?"Set a base URL, then refresh.":P.keyless?"Start the local server, then refresh.":"Add a key to load the provider’s current models."}),c.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[c.jsx("input",{value:N,onChange:O=>M(O.target.value),placeholder:"or enter a model ID",spellCheck:!1,"aria-label":`${P.name} model ID`,className:ie(Ra,"font-mono text-[10.5px]")}),c.jsx("button",{type:"button",onClick:()=>{const O=N.trim();O&&(o(e,O),M(""))},disabled:!N.trim(),className:"inline-flex h-8 shrink-0 items-center rounded-lg border border-line px-2.5 text-[10px] font-medium text-ink disabled:opacity-40",children:"Use ID"})]})]}),c.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-3",children:[c.jsx("p",{className:"text-[9px] leading-relaxed text-faint",children:P.keyless?"No key is stored for this provider.":T?"The daemon decrypts the key only when it calls the provider.":"The key never enters the page after saving."}),T&&!R&&c.jsxs("button",{type:"button",onClick:()=>{ae()},className:"shrink-0 text-[9.5px] font-medium text-accent hover:underline",children:["Use ",P.name]})]})]})]})}function o9(){const e=Oe(),i=Oe(x=>x.update),a=Oe(x=>x.refreshProviders),[r,o]=B.useState(e.provider),[u,d]=B.useState(!1),p=kd(),h=Ao(p),g=h.includes(e.effort)?e.effort:h[0];return c.jsxs(c.Fragment,{children:[c.jsxs(Rn,{title:"Providers",description:"Keys and base URLs are stored by the local daemon. Model lists are fetched live from the provider; the bundled catalog is only a fallback when the provider list cannot be reached.",action:c.jsxs("button",{type:"button",onClick:async()=>{d(!0);try{await a()}catch(x){me.getState().notify(x instanceof Error?x.message:"Could not refresh providers.","error")}finally{d(!1)}},className:"inline-flex h-7 items-center gap-1 rounded-lg border border-line px-2 text-[10px] font-medium text-muted hover:text-ink",children:[u?c.jsx(Vt,{size:10}):c.jsx(zi,{size:10}),"Refresh"]}),children:[c.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-line bg-raised/50 px-3 py-2.5",children:[c.jsx(kr,{size:14,className:"mt-0.5 shrink-0 text-success"}),c.jsxs("p",{className:"text-[10.5px] leading-relaxed text-muted",children:["Keys are encrypted with AES-256-GCM under ",c.jsx("code",{className:"font-mono text-[10px]",children:"~/.maxcode"}),". The browser only receives a masked hint; the daemon decrypts a key in memory for the provider request."]})]}),c.jsx("div",{className:"space-y-2",children:Bu.map(x=>c.jsx(l9,{providerId:x.id,open:r===x.id,onToggle:()=>o(r===x.id?null:x.id)},x.id))})]}),c.jsx(Rn,{title:"Reasoning defaults",description:"Only controls advertised by the live model are offered; an unsupported field is never sent.",children:p?c.jsx("div",{className:"space-y-2.5",children:h.length>0?c.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-line bg-raised/30 px-3 py-2.5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Effort"}),c.jsxs("p",{className:"mt-0.5 text-[9.5px] text-faint",children:["Options come from ",p.name||p.id," · ",p.apiKind]})]}),c.jsx("select",{value:g,onChange:x=>i({effort:x.target.value}),className:"h-8 rounded-lg border border-line bg-panel px-2 text-[11px] text-ink outline-none","aria-label":"Reasoning effort",children:h.map(x=>c.jsx("option",{value:x,children:Wh[x].label},x))})]}):c.jsx("p",{className:"rounded-lg border border-line bg-raised/30 px-3 py-2.5 text-[10px] leading-relaxed text-faint",children:eh(p)})}):c.jsx("p",{className:"rounded-lg border border-line bg-raised/30 px-3 py-3 text-[10.5px] leading-relaxed text-faint",children:"Choose a model in the composer to see the reasoning controls this provider actually advertises."})}),c.jsx(Rn,{title:"Advanced request settings",description:"Defaults for every provider. The adapter ignores fields the selected model cannot accept.",children:c.jsxs("details",{className:"group/advanced rounded-xl border border-line bg-raised/20",children:[c.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between px-3 py-2.5 text-[11.5px] font-medium text-ink [&::-webkit-details-marker]:hidden",children:["Request controls and system prompt",c.jsx(Do,{size:13,className:"text-faint transition-transform group-open/advanced:rotate-180"})]}),c.jsxs("div",{className:"border-t border-line px-3 py-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(ra,{hint:"0 – 2",children:"Temperature"}),c.jsx("input",{type:"number",min:0,max:2,step:.1,value:e.temperature,onChange:x=>{const b=Number(x.target.value);Number.isFinite(b)&&i({temperature:Math.min(2,Math.max(0,b))})},className:Ra})]}),c.jsxs("div",{children:[c.jsx(ra,{hint:"256 – 200,000",children:"Max output tokens"}),c.jsx("input",{type:"number",min:256,max:2e5,step:256,value:e.maxTokens,onChange:x=>{const b=Number(x.target.value);Number.isFinite(b)&&i({maxTokens:Math.min(2e5,Math.max(256,Math.round(b)))})},className:Ra})]})]}),c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-[11px] font-medium text-ink",children:"System prompt"}),c.jsxs("button",{type:"button",onClick:()=>i({systemPrompt:Pu}),className:"inline-flex items-center gap-1 text-[9.5px] font-medium text-faint hover:text-ink",children:[c.jsx(Jv,{size:10})," Restore default"]})]}),c.jsx("textarea",{value:e.systemPrompt,onChange:x=>i({systemPrompt:x.target.value}),rows:9,spellCheck:!1,className:"thin-scroll w-full resize-y rounded-lg border border-line bg-panel px-2.5 py-2 font-mono text-[10.5px] leading-relaxed text-ink outline-none focus:border-accent/50"}),c.jsx("p",{className:"mt-1 text-[9px] leading-relaxed text-faint",children:"Enabled skill instructions and the current workspace/git context are appended after this prompt."})]})]})]})})]})}const c9=[{title:"Workspace and shell",tools:["read_file","list_files","grep","write_file","edit_file","rewrite_file","shell","git"]},{title:"Web",tools:["web_search","read_url"]},{title:"Delegation",tools:["subagent"]}],u9={shell:nw,read_file:Ma,list_files:Vv,write_file:Kv,edit_file:Qm,rewrite_file:Qm,grep:z2,web_search:is,read_url:Hh,git:Xv,subagent:n2},d9={shell:{label:"Shell",description:"Run commands in the workspace root. Plan mode allows read-only commands only."},read_file:{label:"Read file",description:"Inspect a file on disk before changing it."},list_files:{label:"List files",description:"Explore the real workspace tree."},write_file:{label:"Write file",description:"Create a file or replace its complete contents."},edit_file:{label:"Edit file",description:"Replace an exact passage in a file."},rewrite_file:{label:"Rewrite file",description:"Replace the entire content of an existing file."},grep:{label:"Grep",description:"Search file contents with a regular expression."},web_search:{label:"Web search",description:"Find current pages and cite the sources."},read_url:{label:"Read URL",description:"Open a public http(s) page as plain text."},git:{label:"Git",description:"Inspect or change repository state. Plan mode is read-only."},subagent:{label:"Subagent",description:"Delegate a read-only investigation and return a concise report."}};function f9(){const e=Oe(),i=Oe(r=>r.updateTool),a=me(r=>r.openSettings);return c.jsxs(Rn,{title:"Tool permissions",description:"Ask adds an approval card to the conversation. Auto runs immediately. Disabled tools are not sent to the model at all. Plan mode always hides write tools.",children:[c.jsx("div",{className:"space-y-5",children:c9.map(r=>c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-[10px] font-medium text-faint",children:r.title}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-line",children:r.tools.map((o,u)=>{const d=e.tools[o],p=u9[o],h=d9[o];return c.jsxs("div",{className:ie("flex flex-col gap-2.5 px-3 py-3 sm:flex-row sm:items-center",u!==0&&"border-t border-line",!d.enabled&&"opacity-60"),children:[c.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-line bg-panel text-muted",children:c.jsx(p,{size:13})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:h.label}),c.jsx("span",{className:"font-mono text-[8.5px] text-faint",children:o})]}),c.jsx("p",{className:"mt-0.5 text-[9.5px] leading-relaxed text-muted",children:h.description}),r.title==="Web"&&!e.webSearchEnabled&&c.jsx("button",{type:"button",onClick:()=>a("search"),className:"mt-1 text-[9.5px] font-medium text-warning hover:underline",children:"Web access is off. Turn it on in Search."})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2 pl-9 sm:pl-0",children:[d.enabled&&c.jsx(ug,{value:d.approval,onChange:g=>i(o,{approval:g}),options:[{value:"auto",label:"Auto",title:"Run without asking"},{value:"ask",label:"Ask",title:"Ask before running"}]}),c.jsx($i,{checked:d.enabled,onChange:g=>i(o,{enabled:g}),label:`Enable ${h.label}`})]})]},o)})})]},r.title))}),c.jsxs("div",{className:"mt-3 flex items-start gap-1.5 rounded-lg border border-line bg-raised/40 px-3 py-2.5 text-[9.5px] leading-relaxed text-faint",children:[c.jsx(kr,{size:11,className:"mt-0.5 shrink-0"}),"Shell and Git approval are on by default. Approvals apply to the open workspace only; the daemon rejects paths outside it with ",c.jsx("code",{className:"font-mono",children:".."})," or absolute escapes."]})]})}const p9=[{id:"duckduckgo",name:"DuckDuckGo",description:"No key. HTML results with a Wikipedia fallback; coverage is limited.",keyless:!0},{id:"tavily",name:"Tavily",description:"Built for AI agents. Search in, clean results out."},{id:"brave",name:"Brave Search",description:"Independent web index with a free tier."},{id:"serper",name:"Serper",description:"Google results through a simple API."}];function m9(){const e=Oe(),i=Oe(M=>M.update),a=Oe(M=>M.saveSearchKey),r=me(M=>M.notify),[o,u]=B.useState(""),[d,p]=B.useState(!1),[h,g]=B.useState(!1),[x,b]=B.useState(null),v=e.secretStatus?.search,y=e.searchProvider==="duckduckgo",k=!!v?.configured,_=async()=>{if(!o.trim()){r("Paste a search API key first.","error");return}p(!0);try{await a(o.trim()),u(""),b(null),r("Search key saved and encrypted.","success")}catch(M){r(M instanceof Error?M.message:"Could not save that key.","error")}finally{p(!1)}},S=async()=>{try{await a(""),b(null),r("Search key removed.","success")}catch(M){r(M instanceof Error?M.message:"Could not remove that key.","error")}},N=async()=>{g(!0),b(null);try{const M=await sn("web_search",{query:"OpenSol local coding agent",provider:e.searchProvider},"build"),j=M.result&&typeof M.result=="object"?M.result:{},D=Array.isArray(j.results)?j.results:[];b({ok:D.length>0,message:D.length>0?`${D.length} results via ${String(j.provider??e.searchProvider)}.`:"No results were returned. Try another provider or query."})}catch(M){b({ok:!1,message:M instanceof Error?M.message:"Search failed."})}finally{g(!1)}};return c.jsxs(c.Fragment,{children:[c.jsx(Rn,{title:"Web access",description:"When enabled, the agent may search and read public pages. The daemon performs the requests; this page never sees the raw results.",children:c.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-line bg-raised/30 px-3 py-2.5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Allow web tools"}),c.jsx("p",{className:"mt-0.5 text-[9.5px] text-faint",children:"Adds web_search and read_url when they are also enabled under Tools."})]}),c.jsx($i,{checked:e.webSearchEnabled,onChange:M=>i({webSearchEnabled:M}),label:"Allow web tools"})]})}),c.jsxs(Rn,{title:"Search provider",description:"Choose where current results come from. A key is encrypted by the daemon.",children:[c.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:p9.map(M=>{const j=e.searchProvider===M.id;return c.jsxs("button",{type:"button",onClick:()=>{i({searchProvider:M.id}),b(null)},className:ie("rounded-lg border p-3 text-left transition-colors",j?"border-accent/35 bg-accent-soft/40":"border-line bg-panel hover:bg-raised/40"),children:[c.jsxs("span",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:M.name}),c.jsx("span",{className:ie("flex h-3.5 w-3.5 items-center justify-center rounded-full border",j?"border-accent bg-accent text-on-accent":"border-line"),children:j&&c.jsx(Cn,{size:8,strokeWidth:3})})]}),c.jsx("span",{className:"mt-1 block text-[9.5px] leading-relaxed text-muted",children:M.description}),M.keyless&&c.jsx("span",{className:"mt-1.5 inline-block rounded bg-raised px-1.5 py-0.5 text-[8.5px] font-medium text-faint",children:"No key"})]},M.id)})}),!y&&c.jsxs("div",{className:"mt-3",children:[c.jsx(ra,{hint:k?`Saved ${v?.hint??""}`:"Required",children:e.searchProvider==="tavily"?"Tavily API key":e.searchProvider==="brave"?"Brave Search API key":"Serper API key"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("div",{className:"min-w-0 flex-1",children:c.jsx(zg,{value:o,onChange:u,placeholder:e.searchProvider==="tavily"?"tvly-…":e.searchProvider==="brave"?"BSA…":"…",label:"Search API key"})}),c.jsxs("button",{type:"button",onClick:()=>{_()},disabled:!o.trim()||d,className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-lg bg-ink px-2.5 text-[10px] font-medium text-panel disabled:opacity-40",children:[d?c.jsx(Vt,{size:10}):c.jsx(cd,{size:10}),"Save"]})]}),k&&c.jsx("button",{type:"button",onClick:()=>{S()},className:"mt-1.5 text-[9.5px] font-medium text-faint hover:text-danger",children:"Remove saved key"}),c.jsx("p",{className:"mt-1 text-[9px] leading-relaxed text-faint",children:"One key is stored. If you switch providers, replace the key with one issued by the new provider."})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>{N()},disabled:h||!y&&!k,className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[10.5px] font-medium text-ink transition-colors hover:bg-raised disabled:cursor-not-allowed disabled:opacity-40",children:[h?c.jsx(Vt,{size:12}):c.jsx(as,{size:12}),h?"Testing…":"Test search"]}),!y&&!k&&c.jsx("span",{className:"text-[9.5px] text-faint",children:"Add a key to test."})]}),x&&c.jsx("div",{className:ie("mt-2.5 rounded-lg border px-3 py-2 text-[10px] leading-relaxed",x.ok?"border-success/25 bg-success/[0.04] text-success":"border-warning/30 bg-warning/[0.04] text-warning"),children:x.message})]})]})}function h9(){return typeof crypto<"u"&&"randomUUID"in crypto?`skill_${crypto.randomUUID()}`:`skill_${Date.now()}`}function g9(){const e=Oe(),i=Oe(y=>y.addSkill),a=Oe(y=>y.updateSkill),r=Oe(y=>y.removeSkill),o=me(y=>y.askConfirm),u=me(y=>y.notify),[d,p]=B.useState(null),h=B.useRef(null),g=e.skills.filter(y=>y.enabled).length,x=async y=>{try{const k=await ak(y),_=/^#\s+(.+)$/m.exec(k),S=_?.[1]?.trim()||y.name.replace(/\.[^.]+$/,""),M=(_?k.replace(_[0],"").trim():k.trim()).split(/\n\s*\n/).find(j=>j.trim()&&!j.trim().startsWith("#"));p({name:S,description:(M??"").replace(/[#>*`]/g,"").replace(/\s+/g," ").trim().slice(0,180),instructions:k.trim()}),u(`Loaded ${y.name}. Review it, then save the skill.`,"info")}catch(k){u(k instanceof Error?k.message:"Could not read that skill.","error")}},b=()=>{if(!d)return;const y=d.name.trim();if(!y){u("Give the skill a name.","error");return}if(!d.instructions.trim()){u("Add instructions for the skill.","error");return}d.id?(a(d.id,{name:y,description:d.description.trim(),instructions:d.instructions.trim()}),u("Skill updated.","success")):(i({id:h9(),name:y,description:d.description.trim()||"Custom skill",instructions:d.instructions.trim(),enabled:!0}),u("Skill saved and enabled.","success")),p(null)},v=async y=>{await o({title:"Delete this skill?",body:`“${y.name}” will be removed from this computer.`,confirmLabel:"Delete skill",tone:"danger"})&&r(y.id)};return c.jsxs(Rn,{title:"Loaded skills",description:`${g} of ${e.skills.length} enabled. Enabled instructions are appended to the system prompt for every request.`,children:[c.jsxs("div",{className:"mb-3 flex flex-wrap gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>p({name:"",description:"",instructions:""}),className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-ink px-2.5 text-[10.5px] font-medium text-panel",children:[c.jsx(vr,{size:12})," New skill"]}),c.jsxs("button",{type:"button",onClick:()=>h.current?.click(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[10.5px] font-medium text-ink hover:bg-raised",children:[c.jsx(Qh,{size:12})," Load skill file"]}),c.jsx("input",{ref:h,type:"file",accept:".md,.markdown,.txt",className:"hidden",onChange:y=>{const k=y.target.files?.[0];k&&x(k),y.target.value=""}})]}),d&&c.jsxs("div",{className:"mb-3 rounded-xl border border-accent/30 bg-accent-soft/20 p-3",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsx("p",{className:"text-[11px] font-medium text-ink",children:d.id?"Edit skill":"Load a skill"}),c.jsx("button",{type:"button",className:"icon-button h-6 w-6",onClick:()=>p(null),"aria-label":"Close editor",children:c.jsx(Bi,{size:12})})]}),c.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(ra,{children:"Name"}),c.jsx("input",{value:d.name,onChange:y=>p({...d,name:y.target.value}),placeholder:"API contract reviewer",className:Ra,autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx(ra,{hint:"Shown in the skills list",children:"Description"}),c.jsx("input",{value:d.description,onChange:y=>p({...d,description:y.target.value}),placeholder:"Checks a diff against an API contract",className:Ra})]})]}),c.jsxs("div",{className:"mt-2",children:[c.jsx(ra,{hint:"Markdown",children:"Instructions"}),c.jsx("textarea",{value:d.instructions,onChange:y=>p({...d,instructions:y.target.value}),placeholder:fA,rows:8,className:"thin-scroll w-full resize-y rounded-lg border border-line bg-panel px-2.5 py-2 font-mono text-[10.5px] leading-relaxed text-ink outline-none focus:border-accent/50"})]}),c.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[c.jsx("button",{type:"button",className:"chip h-7 text-[10.5px]",onClick:()=>p(null),children:"Cancel"}),c.jsxs("button",{type:"button",onClick:b,className:"inline-flex h-7 items-center gap-1 rounded-lg bg-accent px-2.5 text-[10.5px] font-medium text-on-accent hover:bg-accent/90",children:[c.jsx(Cn,{size:11})," Save skill"]})]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-line",children:e.skills.map((y,k)=>c.jsx("div",{className:ie("px-3 py-3",k!==0&&"border-t border-line"),children:c.jsxs("div",{className:"flex items-start gap-2.5",children:[c.jsx("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-accent-soft text-accent",children:c.jsx(Ui,{size:11})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:y.name}),y.builtIn&&c.jsx("span",{className:"rounded bg-raised px-1.5 py-0.5 text-[8px] font-medium text-faint",children:"Built-in"}),c.jsx("span",{className:ie("text-[8.5px]",y.enabled?"text-success":"text-faint"),children:y.enabled?"Enabled":"Off"})]}),c.jsx("p",{className:"mt-0.5 text-[9.5px] leading-relaxed text-muted",children:y.description}),c.jsxs("details",{className:"group/skill mt-1",children:[c.jsxs("summary",{className:"inline-flex cursor-pointer list-none items-center gap-1 text-[9px] font-medium text-faint hover:text-muted [&::-webkit-details-marker]:hidden",children:["View instructions",c.jsx(Do,{size:9,className:"transition-transform group-open/skill:rotate-180"})]}),c.jsx("pre",{className:"thin-scroll mt-1.5 max-h-44 overflow-auto whitespace-pre-wrap rounded-lg border border-line bg-raised/40 p-2 font-mono text-[9.5px] leading-relaxed text-muted",children:y.instructions})]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[!y.builtIn&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>p({id:y.id,name:y.name,description:y.description,instructions:y.instructions}),className:"icon-button h-7 w-7","aria-label":`Edit ${y.name}`,title:"Edit skill",children:c.jsx(Qm,{size:12})}),c.jsx("button",{type:"button",onClick:()=>{v(y)},className:"icon-button h-7 w-7 hover:text-danger","aria-label":`Delete ${y.name}`,title:"Delete skill",children:c.jsx(sa,{size:12})})]}),c.jsx($i,{checked:y.enabled,onChange:_=>a(y.id,{enabled:_}),label:`Enable ${y.name}`})]})]})},y.id))})]})}const Iu={cloudflare:{label:"Cloudflare Pages",short:"Cloudflare",icon:Zm,description:"API token + account id. Create a token with the Cloudflare Pages edit permission.",fields:[{key:"apiToken",label:"API token",secret:!0,hint:"Required",placeholder:"Cloudflare API token"},{key:"accountId",label:"Account ID",secret:!1,hint:"Required",placeholder:"a1b2c3…"}]},netlify:{label:"Netlify",short:"Netlify",icon:is,description:"Personal access token. A new site is created when no site id is set.",fields:[{key:"authToken",label:"Personal access token",secret:!0,hint:"Required",placeholder:"nfp_…"},{key:"siteId",label:"Site ID",secret:!1,hint:"Optional",placeholder:"Existing site id"}]},vercel:{label:"Vercel",short:"Vercel",icon:Zm,description:"Access token. The CLI deploys a new production build through npx when needed.",fields:[{key:"token",label:"Access token",secret:!0,hint:"Required",placeholder:"vercel token"},{key:"teamId",label:"Team / scope ID",secret:!1,hint:"Optional",placeholder:"team_…"}]}};function x9({providerId:e}){const i=Iu[e],a=Oe(D=>D.deploySecrets?.[e]),r=Oe(D=>D.deployTools?.[e]),o=Oe(D=>D.saveDeployCredentials),u=me(D=>D.notify),d=me(D=>D.askConfirm),[p,h]=B.useState(!1),[g,x]=B.useState({}),[b,v]=B.useState(""),[y,k]=B.useState(!1),_=i.fields.filter(D=>!D.secret),S=i.fields.find(D=>D.secret);B.useEffect(()=>{const D={};for(const P of _)D[P.key]=a?.fields?.[P.key]??"";x(D)},[a,_.length]);const N=async()=>{k(!0);try{const D={...g};b.trim()&&S&&(D[S.key]=b.trim()),await o(e,D),v(""),u(`${i.label} credentials saved and encrypted.`,"success")}catch(D){u(D instanceof Error?D.message:"Could not save those credentials.","error")}finally{k(!1)}},M=async()=>{if(await d({title:`Remove ${i.label} credentials?`,body:"The encrypted token and ids are deleted from this computer. Deployments for this host will stop until you add them again.",confirmLabel:"Remove credentials",tone:"danger"}))try{const P={};for(const L of i.fields)P[L.key]="";await o(e,P),v(""),u(`${i.label} credentials removed.`,"success")}catch(P){u(P instanceof Error?P.message:"Could not remove those credentials.","error")}},j=i.icon;return c.jsxs("div",{className:"rounded-xl border border-line bg-panel",children:[c.jsxs("button",{type:"button",onClick:()=>h(D=>!D),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left",children:[c.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-line bg-raised/60 text-muted",children:c.jsx(j,{size:13})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:i.label}),a?.configured?c.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-success",children:[c.jsx("span",{className:"h-1 w-1 rounded-full bg-success"})," configured"]}):c.jsx("span",{className:"text-[9px] text-faint",children:"not configured"})]}),c.jsxs("span",{className:"mt-0.5 block text-[9px] text-faint",children:[r?.installed?`${r.label} ${r.version||"installed"}`:"Uses npx on deploy",a?.hint?` · token ${a.hint}`:""]})]}),c.jsx(Do,{size:13,className:ie("shrink-0 text-faint transition-transform",p&&"rotate-180")})]}),p&&c.jsxs("div",{className:"border-t border-line px-3 py-3",children:[c.jsx("p",{className:"mb-2.5 text-[9.5px] leading-relaxed text-faint",children:i.description}),S&&c.jsxs("div",{className:"mb-2.5",children:[c.jsx(ra,{hint:a?.configured?"Saved; leave blank to keep":"Required",children:S.label}),c.jsx(zg,{value:b,onChange:v,placeholder:a?.configured?`Replace token ${a.hint}`:S.placeholder,label:`${i.label} ${S.label}`})]}),c.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:_.map(D=>c.jsxs("div",{children:[c.jsx(ra,{hint:D.hint,children:D.label}),c.jsx("input",{value:g[D.key]??"",onChange:P=>x(L=>({...L,[D.key]:P.target.value})),placeholder:D.placeholder,spellCheck:!1,className:ie(Ra,"font-mono text-[10.5px]")})]},D.key))}),c.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a?.configured?c.jsx("button",{type:"button",onClick:()=>{M()},className:"text-[9.5px] font-medium text-faint hover:text-danger",children:"Remove credentials"}):c.jsx("span",{className:"text-[9px] text-faint",children:"Values are encrypted at rest."}),c.jsxs("button",{type:"button",onClick:()=>{N()},disabled:y,className:"inline-flex h-7 items-center gap-1 rounded-lg bg-ink px-2.5 text-[10px] font-medium text-panel disabled:opacity-40",children:[y?c.jsx(Vt,{size:10}):c.jsx(Cn,{size:10}),"Save"]})]})]})]})}function b9(){const e=Oe(a=>a.deployTools),i=Oe(a=>a.secretsError);return c.jsxs(c.Fragment,{children:[c.jsxs(Rn,{title:"Hosting credentials",description:"Tokens are encrypted by the local daemon and passed to the deploy CLI through environment variables. They are never written to logs or returned to this page.",children:[i&&c.jsx("p",{className:"mb-3 rounded-lg border border-warning/30 bg-warning/[0.04] px-3 py-2 text-[10px] text-warning",children:i}),c.jsx("div",{className:"space-y-2",children:Object.keys(Iu).map(a=>c.jsx(x9,{providerId:a},a))})]}),c.jsxs(Rn,{title:"Command-line tools",description:"OpenSol uses an installed CLI when available and falls back to npx. Node.js must be on PATH.",children:[c.jsx("div",{className:"overflow-hidden rounded-xl border border-line",children:Object.keys(Iu).map((a,r)=>{const o=e?.[a],u=Iu[a];return c.jsxs("div",{className:ie("flex items-center gap-3 px-3 py-2.5",r!==0&&"border-t border-line"),children:[c.jsx(Zh,{size:13,className:"shrink-0 text-faint"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-[11px] font-medium text-ink",children:u.short}),c.jsxs("p",{className:"truncate font-mono text-[9px] text-faint",children:[o?.bin??"—"," ",o?.installed?`· ${o.version||"installed"}`:"· not installed, uses npx"]})]}),c.jsx("span",{className:ie("shrink-0 rounded-full border px-1.5 py-0.5 text-[8.5px] font-medium",o?.installed?"border-success/25 text-success":"border-line text-faint"),children:o?.installed?"installed":"npx fallback"})]},a)})}),c.jsxs("button",{type:"button",onClick:()=>me.getState().setDeployOpen(!0),className:"mt-3 inline-flex h-8 items-center gap-1.5 rounded-lg bg-accent px-3 text-[10.5px] font-medium text-on-accent hover:bg-accent/90",children:[c.jsx(wr,{size:12})," Open deploy panel"]})]})]})}function y9(){return c.jsx(Rn,{title:"Local plugins",description:"OpenSol only installs plugin packages you choose from this machine. A plugin stays sandboxed and disabled until you review its permissions and mark it Safe.",children:c.jsx(GI,{})})}function v9(){const e=Oe(),i=Oe(p=>p.update),a=me(p=>p.openSettings),r=me(p=>p.notify),o=lk(e.tools),u=[{id:"light",label:"Light",icon:Xh},{id:"dark",label:"Dark",icon:Gh},{id:"system",label:"System",icon:qh}],d=async()=>{const p=e.daemon?.dataDir??"~/.maxcode";try{await navigator.clipboard.writeText(p),r(`Copied the data folder path: ${p}`,"success")}catch{r(`Data folder: ${p}`,"info")}};return c.jsxs("div",{className:"px-5 py-2 sm:px-7",children:[c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Permission"}),c.jsx("p",{className:"settings-hint",children:"Choose the default permission mode for new sessions."})]}),c.jsx("select",{value:o,onChange:p=>i({tools:ok(e.tools,p.target.value)}),className:ie("settings-select w-full sm:w-[210px]"),"aria-label":"Default permission mode",children:cg.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Appearance"}),c.jsx("p",{className:"settings-hint",children:"Follow the system or pick a fixed theme."})]}),c.jsxs("div",{className:"w-full sm:w-[360px]",children:[c.jsx("div",{className:"grid grid-cols-3 gap-2",children:u.map(p=>{const h=p.icon,g=e.theme===p.id;return c.jsxs("button",{type:"button",onClick:()=>i({theme:p.id}),className:ie("flex flex-col items-center gap-1.5 rounded-xl border px-2 py-2.5 transition-colors",g?"border-accent/60 bg-panel text-ink ring-2 ring-accent/10":"border-line text-muted hover:border-faint/50 hover:text-ink"),children:[c.jsx(h,{size:16}),c.jsx("span",{className:"text-[11px] font-medium",children:p.label})]},p.id)})}),c.jsx("button",{type:"button",onClick:()=>a("appearance"),className:"mt-2 text-[11px] font-medium text-muted transition-colors hover:text-ink",children:"More themes and theme previews →"})]})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Font size"}),c.jsx("p",{className:"settings-hint",children:"Only affects conversation content."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("select",{value:e.chatFontSize,onChange:p=>i({chatFontSize:Number(p.target.value)}),className:ie("settings-select w-[84px] text-center"),"aria-label":"Conversation font size",children:Array.from({length:9},(p,h)=>h+12).map(p=>c.jsx("option",{value:p,children:p},p))}),c.jsx("span",{className:"text-[11px] text-faint",children:"px"})]})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Work details"}),c.jsx("p",{className:"settings-hint",children:"Choose how much detail to show for tool calls."})]}),c.jsxs("select",{value:e.workDetail,onChange:p=>i({workDetail:p.target.value==="concise"?"concise":"detailed"}),className:ie("settings-select w-full sm:w-[180px]"),"aria-label":"Work details",children:[c.jsx("option",{value:"concise",children:"Concise"}),c.jsx("option",{value:"detailed",children:"Detailed"})]})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"When to collapse work details"}),c.jsx("p",{className:"settings-hint",children:"Choose when to automatically collapse work details."})]}),c.jsxs("select",{value:e.autoCollapseWork?"completion":"never",onChange:p=>i({autoCollapseWork:p.target.value==="completion"}),className:ie("settings-select w-full sm:w-[180px]"),"aria-label":"When to collapse work details",children:[c.jsx("option",{value:"completion",children:"On completion"}),c.jsx("option",{value:"never",children:"Never"})]})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Let AI name sessions"}),c.jsx("p",{className:"settings-hint",children:"After the first answer, the model writes a short title for the session. Names you type yourself are never replaced."})]}),c.jsx($i,{checked:e.aiSessionTitles,onChange:p=>i({aiSessionTitles:p}),label:"Let AI name sessions"})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Show token estimates"}),c.jsx("p",{className:"settings-hint",children:"When a provider does not report usage, show a rough output estimate."})]}),c.jsx($i,{checked:e.showTokenEstimate,onChange:p=>i({showTokenEstimate:p}),label:"Show token estimates"})]}),c.jsxs("div",{className:"settings-row",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"settings-label",children:"Local configuration"}),c.jsx("p",{className:"settings-hint",children:"Settings, conversations and encrypted keys live in this folder."})]}),c.jsxs("button",{type:"button",onClick:()=>{d()},className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-panel px-3 text-[11.5px] font-medium text-ink transition-colors hover:bg-raised",title:e.daemon?.dataDir??"~/.maxcode",children:[c.jsx(od,{size:13}),"Copy data folder path"]})]}),c.jsx("p",{className:"py-4 text-[10.5px] text-faint",children:"Changes are saved automatically to this computer."})]})}function w9(){const e=Oe(),i=Oe(r=>r.update),a=[{id:"light",label:"Light",className:"bg-[#fcfcfc]",line:"bg-[#e2e2e5]"},{id:"dark",label:"Dark",className:"bg-[#09090b]",line:"bg-[#2a2a31]"},{id:"night-owl",label:"Night Owl",className:"bg-[#011627]",line:"bg-[#1a3e5a]"},{id:"claude-code",label:"Claude Code",className:"bg-[#262624]",line:"bg-[#42423e]"},{id:"flame",label:"Flame",className:"bg-[#130d0c]",line:"bg-[#3e2621]"},{id:"system",label:"System",className:"bg-gradient-to-br from-[#fcfcfc] to-[#09090b]",line:"bg-[#8a8a92]"},...KE().themes().map(r=>({id:r.id,label:r.label,className:"bg-gradient-to-br from-accent-soft to-panel",line:"bg-line"}))];return c.jsxs(c.Fragment,{children:[c.jsx(Rn,{title:"Theme",description:"System follows your OS preference and updates when it changes.",children:c.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:a.map(r=>{const o=e.theme===r.id;return c.jsxs("button",{type:"button",onClick:()=>i({theme:r.id}),className:ie("rounded-xl border p-2 text-left transition-all",o?"border-accent ring-2 ring-accent/10":"border-line hover:border-faint/50"),children:[c.jsxs("span",{className:ie("block h-14 w-full overflow-hidden rounded-lg border border-line/60 p-2",r.className),children:[c.jsx("span",{className:ie("block h-1.5 w-8 rounded-full",r.line)}),c.jsx("span",{className:ie("mt-1.5 block h-1.5 w-12 rounded-full opacity-60",r.line)}),c.jsx("span",{className:"mt-3 block h-2 w-5 rounded-full bg-accent"})]}),c.jsxs("span",{className:"mt-1.5 flex items-center justify-between px-0.5",children:[c.jsx("span",{className:"text-[10.5px] font-medium text-ink",children:r.label}),o&&c.jsx(Cn,{size:11,className:"text-accent"})]})]},r.id)})})}),c.jsx(Rn,{title:"Interface",children:c.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-line bg-raised/30 px-3 py-2.5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Show token estimates"}),c.jsx("p",{className:"mt-0.5 text-[9.5px] text-faint",children:"When a provider does not report usage, show a rough output estimate."})]}),c.jsx($i,{checked:e.showTokenEstimate,onChange:r=>i({showTokenEstimate:r}),label:"Show token estimates"})]})}),c.jsx(Rn,{title:"Shortcuts",children:c.jsx("div",{className:"space-y-1.5 text-[10.5px]",children:[["Search and commands","⌘ K / Ctrl K"],["Send message","Enter"],["New line","Shift Enter"],["Save file in the editor","⌘ S / Ctrl S"]].map(([r,o])=>c.jsxs("div",{className:"flex items-center justify-between rounded-lg px-1 py-1",children:[c.jsx("span",{className:"text-muted",children:r}),c.jsx("kbd",{className:"rounded border border-line bg-raised px-1.5 py-0.5 font-sans text-[9.5px] text-faint",children:o})]},r))})})]})}function k9(){const e=Ye(y=>y.sessions),i=Oe(y=>y.daemon),a=Oe(y=>y.secretStatus),r=Be(y=>y.entries),o=Be(y=>y.info),u=me(y=>y.askConfirm),d=me(y=>y.notify),p=B.useRef(null),[h,g]=B.useState(""),x=e.reduce((y,k)=>y+k.messages.length,0),b=r.filter(y=>y.type==="file").length,v=async(y,k)=>{if(await u({...k,tone:"danger",confirmLabel:k.label})){g(y);try{RO();const S=await $C(y);await FE(S),d(y==="history"?"Conversation history cleared.":y==="settings"?"Settings restored to defaults.":"OpenSol was reset.","success")}catch(S){d(S instanceof Error?S.message:"Could not reset that data.","error")}finally{g("")}}};return c.jsxs(c.Fragment,{children:[c.jsxs(Rn,{title:"About",children:[c.jsxs("div",{className:"flex items-start gap-3.5",children:[c.jsx(pl,{size:46}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[c.jsx("h3",{className:"font-display text-[20px] font-semibold tracking-[-0.03em] text-ink",children:"OpenSol"}),c.jsxs("span",{className:"text-[10px] text-faint",children:["v",i?.version??"1.0.0"]})]}),c.jsx("p",{className:"mt-0.5 text-[10.5px] font-medium text-muted",children:"An OpenSoftX product"}),c.jsx("p",{className:"mt-2 max-w-[520px] text-[10.5px] leading-relaxed text-muted",children:"A local-first coding agent with a real workspace, shell, git, web research, subagents and deploy flows. No OpenSol account and no OpenSoftX server. Your keys never leave this machine."})]})]}),c.jsx("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[["Conversations",String(e.length)],["Messages",String(x)],["Workspace files",o.available?String(b):"None"]].map(([y,k])=>c.jsxs("div",{className:"rounded-lg border border-line bg-raised/30 px-3 py-2",children:[c.jsx("p",{className:"text-[9px] text-faint",children:y}),c.jsx("p",{className:"mt-0.5 text-[15px] font-semibold tracking-[-0.02em] text-ink",children:k})]},y))})]}),c.jsxs(Rn,{title:"Local data",description:"Everything is stored under ~/.maxcode. Clearing that folder removes OpenSol’s local state.",children:[c.jsxs("div",{className:"space-y-1.5 rounded-lg border border-line bg-raised/30 px-3 py-2.5 text-[10px]",children:[c.jsxs("p",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-faint",children:"Data folder"}),c.jsx("span",{className:"min-w-0 truncate font-mono text-ink",title:i?.dataDir,children:i?.dataDir??"~/.maxcode"})]}),c.jsxs("p",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-faint",children:"Encryption"}),c.jsx("span",{className:"text-muted",children:a?.encryption??"AES-256-GCM"})]}),c.jsxs("p",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-faint",children:"Runtime"}),c.jsxs("span",{className:"truncate text-muted",children:[i?.platform??"—"," · Node ",i?.node??"—"]})]}),c.jsxs("p",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-faint",children:"Workspace"}),c.jsx("span",{className:"min-w-0 truncate font-mono text-muted",title:o.root,children:o.available?o.root:"No folder open"})]})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsxs("button",{type:"button",onClick:uw,className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[10.5px] font-medium text-ink hover:bg-raised",children:[c.jsx(qv,{size:12})," Export conversations"]}),c.jsxs("button",{type:"button",onClick:()=>p.current?.click(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[10.5px] font-medium text-ink hover:bg-raised",children:[c.jsx(Qh,{size:12})," Import conversations"]}),c.jsx("input",{ref:p,type:"file",accept:"application/json,.json",className:"hidden",onChange:y=>{const k=y.target.files?.[0];k&&(dA(k).then(_=>d(_>0?`Imported ${_} conversation${_===1?"":"s"}.`:"Those conversations are already in your history.",_>0?"success":"info")).catch(_=>d(_ instanceof Error?_.message:"Could not import that file.","error")),y.target.value="")}}),c.jsxs("button",{type:"button",onClick:()=>{v("history",{title:"Clear conversation history?",body:"Every conversation saved on this computer will be deleted. Keys, skills and workspace files are kept.",label:"Clear history"})},disabled:h==="history",className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 text-[10.5px] font-medium text-ink hover:bg-raised disabled:opacity-40",children:[h==="history"?c.jsx(Vt,{size:12}):c.jsx(sa,{size:12})," Clear history"]})]}),c.jsxs("p",{className:"mt-3 flex items-center gap-2 text-[9.5px] text-faint",children:[c.jsx(od,{size:11}),$o(new Blob([JSON.stringify(e)]).size)," of conversation history",c.jsx("span",{className:"text-line",children:"·"}),c.jsx(cd,{size:10}),"secrets encrypted at rest"]})]}),c.jsx(Rn,{title:"Danger zone",children:c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-line px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11px] font-medium text-ink",children:"Restore default settings"}),c.jsx("p",{className:"mt-0.5 text-[9.5px] text-muted",children:"Reset prompt, modes, tool permissions and skills. Keys and chats stay."})]}),c.jsxs("button",{type:"button",onClick:()=>{v("settings",{title:"Restore default settings?",body:"Your prompt, tool permissions, skills and interface settings return to their defaults. Conversations and encrypted keys are kept.",label:"Restore defaults"})},disabled:h==="settings",className:"inline-flex h-7 shrink-0 items-center gap-1 self-start rounded-lg border border-line px-2.5 text-[10px] font-medium text-muted hover:border-warning/30 hover:text-warning disabled:opacity-40 sm:self-auto",children:[h==="settings"?c.jsx(Vt,{size:11}):c.jsx(Jv,{size:11})," Restore defaults"]})]}),c.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-danger/20 bg-danger/[0.02] px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[11px] font-medium text-ink",children:"Reset OpenSol"}),c.jsx("p",{className:"mt-0.5 text-[9.5px] text-muted",children:"Delete conversations, encrypted keys, skills, settings and the remembered workspace."})]}),c.jsxs("button",{type:"button",onClick:()=>{v("all",{title:"Reset everything?",body:"Conversations, API keys, hosting credentials, skills, settings and the workspace list will be permanently removed from this computer. Files in your project folder are never deleted.",label:"Reset everything"})},disabled:h==="all",className:"inline-flex h-7 shrink-0 items-center gap-1 self-start rounded-lg bg-danger px-2.5 text-[10px] font-medium text-on-accent hover:bg-danger/90 disabled:opacity-40 sm:self-auto",children:[h==="all"?c.jsx(Vt,{size:11}):c.jsx(sa,{size:11})," Reset everything"]})]})]})})]})}function E9(){const e=Tn(d=>d.servers),i=Tn(d=>d.loaded),a=Tn(d=>d.load),r=me(d=>d.setMcpOpen);B.useEffect(()=>{a()},[a]);const o=e.filter(d=>d.status==="connected").length,u=e.filter(d=>d.status==="needs_auth").length;return c.jsx("div",{className:"space-y-5 px-5 py-6 sm:px-8",children:c.jsxs("div",{className:"settings-card flex flex-wrap items-center gap-4",children:[c.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent",children:c.jsx(Hh,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"settings-label",children:"MCP panel"}),c.jsx("p",{className:"settings-hint",children:i?e.length===0?"No servers yet. Add a local command or a remote URL, with OAuth where the service asks for it.":`${o} of ${e.length} server${e.length===1?"":"s"} connected${u?` · ${u} waiting for sign-in`:""}.`:"Loading…"})]}),c.jsx("button",{type:"button",onClick:()=>r(!0),className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-ink px-4 text-[12px] font-medium text-panel transition-transform active:scale-95",children:"Open MCP panel"})]})})}function N9(){const e=me(x=>x.settingsOpen),i=me(x=>x.settingsTab),a=me(x=>x.closeSettings),r=me(x=>x.openSettings),o=me(x=>x.notify),u=Oe(x=>x.daemon),d=B.useRef(null),p=Math.max(0,yo.findIndex(x=>x.id===i)),h=yo[p];B.useEffect(()=>{e&&d.current?.scrollTo({top:0})},[e,i]);const g=async()=>{const x=u?.dataDir??"~/.opensol";try{await navigator.clipboard.writeText(x),o(`Copied the data folder path: ${x}`,"success")}catch{o(`Data folder: ${x}`,"info")}};return c.jsx(Ed,{open:e,onClose:a,labelledBy:"settings-title",className:"settings-shell h-[94dvh] p-0 sm:h-[min(88dvh,780px)] sm:w-[min(1040px,96vw)] sm:!rounded-[28px]",children:c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col sm:flex-row",children:[c.jsxs("aside",{className:"relative hidden w-[232px] shrink-0 flex-col bg-canvas sm:flex",children:[c.jsx("div",{className:"settings-glow pointer-events-none absolute inset-x-0 top-0 h-48"}),c.jsxs("div",{className:"relative px-6 pb-4 pt-6",children:[c.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.24em] text-faint",children:"OpenSol · v3.1.0"}),c.jsx("h2",{id:"settings-title",className:"mt-1.5 font-display text-[26px] font-semibold leading-none tracking-[-0.035em] text-ink",children:"Settings"})]}),c.jsxs("nav",{className:"relative flex-1 overflow-y-auto px-3 pb-3",children:[c.jsx("span",{"aria-hidden":!0,className:"settings-pill absolute left-3 right-3 top-0 h-10 rounded-2xl bg-panel shadow-pill ring-1 ring-line transition-transform duration-500 ease-spring",style:{transform:`translateY(${p*42}px)`}}),yo.map((x,b)=>{const v=x.icon,y=i===x.id;return c.jsxs("button",{type:"button",onClick:()=>r(x.id),title:x.description,className:ie("group/tab relative mb-[2px] flex h-10 w-full items-center gap-3 rounded-2xl px-3 text-left text-[12.5px] transition-colors duration-200",y?"font-semibold text-ink":"text-muted hover:text-ink"),children:[c.jsx("span",{className:ie("w-4 font-mono text-[9.5px] tabular-nums transition-colors",y?"text-accent":"text-faint"),children:String(b+1).padStart(2,"0")}),c.jsx(v,{size:14,className:ie("transition-transform duration-300 group-hover/tab:scale-110",y?"text-accent":"text-faint")}),x.label]},x.id)})]}),c.jsx("div",{className:"relative px-6 py-4",children:c.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] text-faint",children:[c.jsx(cd,{size:10})," Keys encrypted on this machine"]})})]}),c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col bg-panel sm:border-l sm:border-line",children:[c.jsx("div",{className:"thin-scroll flex shrink-0 gap-1.5 overflow-x-auto border-b border-line px-3 py-2.5 sm:hidden",children:yo.map(x=>c.jsx("button",{type:"button",onClick:()=>r(x.id),className:ie("shrink-0 rounded-full px-3 py-1.5 text-[11px] font-medium transition-all duration-200",i===x.id?"bg-ink text-panel":"bg-raised text-muted"),children:x.label},x.id))}),c.jsxs("header",{className:"flex shrink-0 items-start justify-between gap-4 px-5 pb-3 pt-5 sm:px-8 sm:pt-7",children:[c.jsxs("div",{className:"settings-title-in min-w-0",children:[c.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.22em] text-accent",children:[String(p+1).padStart(2,"0")," / ",String(yo.length).padStart(2,"0")]}),c.jsx("h3",{className:"mt-1 font-display text-[28px] font-semibold leading-none tracking-[-0.035em] text-ink",children:h.label}),c.jsx("p",{className:"mt-2 max-w-[560px] text-[12.5px] leading-relaxed text-muted",children:h.description})]},i),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>{g()},className:"hidden h-8 items-center gap-1.5 rounded-full border border-line bg-panel px-3 text-[11px] font-medium text-ink transition-all hover:bg-raised active:scale-95 sm:inline-flex",title:u?.dataDir??"~/.opensol",children:[c.jsx(od,{size:12}),"Data folder"]}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8 rounded-full",onClick:a,"aria-label":"Close settings",children:c.jsx(Bi,{size:16})})]})]}),c.jsx("div",{ref:d,className:"thin-scroll min-h-0 flex-1 overflow-y-auto pb-6",children:c.jsxs("div",{className:"settings-enter",children:[i==="general"&&c.jsx(v9,{}),i==="models"&&c.jsx(o9,{}),i==="tools"&&c.jsx(f9,{}),i==="search"&&c.jsx(m9,{}),i==="skills"&&c.jsx(g9,{}),i==="plugins"&&c.jsx(y9,{}),i==="mcp"&&c.jsx(E9,{}),i==="deploy"&&c.jsx(b9,{}),i==="appearance"&&c.jsx(w9,{}),i==="about"&&c.jsx(k9,{})]},i)})]})]})})}const Xm=[{id:"cloudflare",label:"Cloudflare Pages",short:"Pages",icon:Zm,blurb:"Fast global hosting with a generous free tier.",needs:"API token + account id"},{id:"netlify",label:"Netlify",short:"Netlify",icon:is,blurb:"Create a site and publish a folder in one step.",needs:"Personal access token"},{id:"vercel",label:"Vercel",short:"Vercel",icon:dC,blurb:"Production deploys through the Vercel CLI.",needs:"Access token"}];function _9(){const e=me(C=>C.deployOpen),i=me(C=>C.setDeployOpen),a=me(C=>C.openSettings),r=me(C=>C.notify),o=Be(C=>C.root),u=Be(C=>C.info.name),d=Be(C=>C.info.available),p=Oe(C=>C.deployTools),h=Oe(C=>C.deploySecrets),[g,x]=B.useState("cloudflare"),[b,v]=B.useState(""),[y,k]=B.useState("dist"),[_,S]=B.useState(""),[N,M]=B.useState(""),[j,D]=B.useState(!1),[P,L]=B.useState([]),[T,R]=B.useState(null),[K,z]=B.useState(""),[$,W]=B.useState(!1),de=B.useRef(null),ce=B.useRef(null),ae=B.useRef(0),O=Xm.find(C=>C.id===g)??Xm[0],te=p?.[g],ne=!!h?.[g]?.configured;B.useEffect(()=>{e&&(v(o),R(null),z(""),L([]),D(!1),W(!1))},[e,o]),B.useEffect(()=>{if(!e)return;const C=ce.current;C&&(C.scrollTop=C.scrollHeight)},[P,e]),B.useEffect(()=>()=>de.current?.abort(),[]);const G=(C,I)=>{const se=I.trimEnd();if(!se)return;ae.current+=1;const he=ae.current;L(ke=>[...ke.slice(-500),{id:he,stream:C,text:se}])},A=()=>{de.current?.abort(),i(!1)},Se=async()=>{if(j)return;if(!b.trim()){z("Choose the project folder to deploy.");return}D(!0),R(null),z(""),L([]);const C=new AbortController;de.current=C,G("meta",`Preparing ${O.label} deploy from ${b.trim()}`);try{for await(const I of aA({provider:g,path:b.trim(),outputDir:y.trim()||void 0,buildCommand:_.trim()||void 0,projectName:N.trim()||void 0},C.signal))if(I.type==="log")G(I.stream,I.text);else if(I.type==="start")G("meta",`Deploying ${I.provider}${I.path?` · ${I.path}`:""}`);else if(I.type==="done"){R(I.result),G("meta",`Published ${I.result.url}`);break}else if(I.type==="error"){z(I.message),G("stderr",I.message);break}}catch(I){if(I instanceof DOMException&&I.name==="AbortError")G("meta","Deployment stopped.");else{const se=I instanceof Error?I.message:"The deployment failed.";z(se),G("stderr",se)}}finally{de.current=null,D(!1)}},pe=async()=>{if(T?.url)try{await navigator.clipboard.writeText(T.url),W(!0),window.setTimeout(()=>W(!1),1600)}catch{r("Clipboard access was blocked by the browser.","error")}};return c.jsxs(Ed,{open:e,onClose:A,labelledBy:"deploy-title",wide:!0,className:"h-[92dvh] p-0 sm:h-[min(90dvh,760px)]",children:[c.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-4 border-b border-line px-5 py-4 sm:px-6",children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[c.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent",children:c.jsx(wr,{size:17})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{id:"deploy-title",className:"font-display text-[20px] font-semibold tracking-[-0.02em] text-ink",children:"Deploy a site"}),c.jsx("p",{className:"mt-0.5 text-[11.5px] leading-relaxed text-muted",children:"Publish the open workspace or another project folder. Tokens stay encrypted on this machine."})]})]}),c.jsx("button",{type:"button",className:"icon-button -mr-1 shrink-0",onClick:A,"aria-label":"Close deploy panel",children:c.jsx("span",{className:"text-[18px] leading-none",children:"×"})})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 lg:grid-cols-[minmax(0,380px)_minmax(0,1fr)]",children:[c.jsx("div",{className:"thin-scroll min-h-0 overflow-y-auto border-b border-line lg:border-b-0 lg:border-r",children:c.jsxs("div",{className:"space-y-5 p-5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-faint",children:"Host"}),c.jsx("div",{className:"grid gap-1.5",children:Xm.map(C=>{const I=C.icon,se=g===C.id;return c.jsxs("button",{type:"button",onClick:()=>x(C.id),disabled:j,className:ie("flex items-start gap-2.5 rounded-xl border px-3 py-2.5 text-left transition-colors disabled:opacity-60",se?"border-accent/35 bg-accent-soft/45":"border-line bg-panel hover:bg-raised/50"),children:[c.jsx("span",{className:ie("mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg",se?"bg-accent text-on-accent":"bg-raised text-muted"),children:c.jsx(I,{size:13})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:ie("text-[12px] font-medium",se?"text-accent":"text-ink"),children:C.label}),h?.[C.id]?.configured?c.jsx(Cn,{size:11,className:"text-success"}):c.jsx("span",{className:"text-[9px] text-warning",children:"needs token"})]}),c.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-faint",children:C.blurb})]})]},C.id)})})]}),!ne&&c.jsxs("div",{className:"rounded-xl border border-warning/25 bg-warning/[0.045] p-3",children:[c.jsxs("p",{className:"flex items-start gap-1.5 text-[10.5px] leading-relaxed text-muted",children:[c.jsx(kr,{size:12,className:"mt-0.5 shrink-0 text-warning"}),O.label," needs ",O.needs,". Add it once in Settings → Deploy; it is encrypted with AES-256-GCM and never appears in the page again."]}),c.jsxs("button",{type:"button",onClick:()=>{i(!1),a("deploy")},className:"mt-2 inline-flex h-7 items-center rounded-lg bg-ink px-2.5 text-[10.5px] font-medium text-panel",children:["Add ",O.label," credentials"]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[c.jsx("label",{htmlFor:"deploy-path",className:"text-[10px] font-semibold uppercase tracking-[0.14em] text-faint",children:"Project folder"}),d&&c.jsxs("button",{type:"button",onClick:()=>v(o),disabled:j,className:"inline-flex items-center gap-1 text-[9.5px] font-medium text-accent disabled:opacity-40",children:[c.jsx(es,{size:10}),"Use open workspace"]})]}),c.jsx("input",{id:"deploy-path",value:b,onChange:C=>v(C.target.value),disabled:j,placeholder:"/absolute/path/to/project or ~/Projects/site",spellCheck:!1,className:"h-9 w-full rounded-lg border border-line bg-panel px-2.5 font-mono text-[10.5px] text-ink outline-none transition-colors placeholder:text-faint focus:border-accent/50 disabled:opacity-60"}),c.jsxs("p",{className:"mt-1 text-[9px] leading-relaxed text-faint",children:[d?`Open workspace: ${u}`:"No workspace open."," Another folder must already exist on this machine."]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"deploy-output",className:"mb-1.5 block text-[10px] font-semibold uppercase tracking-[0.14em] text-faint",children:"Output folder"}),c.jsx("input",{id:"deploy-output",value:y,onChange:C=>k(C.target.value),disabled:j,placeholder:"dist",spellCheck:!1,className:"h-8 w-full rounded-lg border border-line bg-panel px-2 font-mono text-[10.5px] text-ink outline-none focus:border-accent/50 disabled:opacity-60"})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"deploy-name",className:"mb-1.5 block text-[10px] font-semibold uppercase tracking-[0.14em] text-faint",children:"Project name"}),c.jsx("input",{id:"deploy-name",value:N,onChange:C=>M(C.target.value),disabled:j,placeholder:"my-site",spellCheck:!1,className:"h-8 w-full rounded-lg border border-line bg-panel px-2 font-mono text-[10.5px] text-ink outline-none focus:border-accent/50 disabled:opacity-60"})]})]}),c.jsx("div",{className:"flex flex-wrap gap-1",children:["dist","build","out","."].map(C=>c.jsx("button",{type:"button",onClick:()=>k(C),disabled:j,className:ie("chip h-7 px-2 text-[9.5px]",y===C&&"chip-active"),children:C},C))}),c.jsxs("div",{children:[c.jsxs("label",{htmlFor:"deploy-build",className:"mb-1.5 block text-[10px] font-semibold uppercase tracking-[0.14em] text-faint",children:["Build command ",c.jsx("span",{className:"font-normal normal-case tracking-normal text-faint",children:"optional"})]}),c.jsx("input",{id:"deploy-build",value:_,onChange:C=>S(C.target.value),disabled:j,placeholder:"npm run build",spellCheck:!1,className:"h-8 w-full rounded-lg border border-line bg-panel px-2 font-mono text-[10.5px] text-ink outline-none focus:border-accent/50 disabled:opacity-60"}),c.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[["npm run build","pnpm build","yarn build"].map(C=>c.jsx("button",{type:"button",onClick:()=>S(C),disabled:j,className:"rounded-md border border-line px-1.5 py-0.5 text-[9px] text-faint transition-colors hover:text-ink",children:C},C)),_&&c.jsx("button",{type:"button",onClick:()=>S(""),disabled:j,className:"px-1.5 py-0.5 text-[9px] text-faint hover:text-danger",children:"clear"})]})]}),c.jsxs("div",{className:"flex items-start gap-1.5 rounded-lg border border-line bg-raised/40 px-2.5 py-2 text-[9.5px] leading-relaxed text-faint",children:[c.jsx(Zh,{size:11,className:"mt-0.5 shrink-0"}),te?.installed?`${te.label} ${te.version?`(${te.version})`:""} is installed locally.`:`${te?.label??O.short} CLI is not installed; OpenSol will use npx for this deploy.`]})]})}),c.jsxs("div",{className:"flex min-h-0 flex-col",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-line px-4 py-2.5",children:[c.jsx("span",{className:ie("h-1.5 w-1.5 rounded-full",j?"animate-breathe bg-accent":T?"bg-success":"bg-faint")}),c.jsx("p",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-muted",children:j?`Deploying with ${O.label}…`:T?"Deployment complete":"Deploy output"}),j&&c.jsxs("button",{type:"button",onClick:()=>de.current?.abort(),className:"inline-flex h-7 items-center gap-1 rounded-lg border border-line px-2 text-[10px] font-medium text-muted hover:text-ink",children:[c.jsx(Vh,{size:9,fill:"currentColor"})," Stop"]}),!j&&c.jsxs("button",{type:"button",onClick:()=>{Se()},disabled:!ne||!b.trim(),className:"inline-flex h-7 items-center gap-1.5 rounded-lg bg-accent px-2.5 text-[10.5px] font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-40",children:[c.jsx(OT,{size:10,fill:"currentColor"}),"Deploy"]})]}),T&&c.jsx("div",{className:"shrink-0 border-b border-line bg-success/[0.045] px-4 py-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Cn,{size:14,className:"mt-0.5 shrink-0 text-success"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Published successfully"}),c.jsx("a",{href:T.url,target:"_blank",rel:"noreferrer",className:"mt-0.5 block truncate text-[11px] text-accent hover:underline",children:T.url})]}),c.jsx("button",{type:"button",onClick:pe,className:"icon-button h-7 w-7",title:"Copy URL","aria-label":"Copy URL",children:$?c.jsx(Cn,{size:12,className:"text-success"}):c.jsx(ld,{size:12})}),c.jsx("a",{href:T.url,target:"_blank",rel:"noreferrer",className:"icon-button h-7 w-7",title:"Open site","aria-label":"Open site",children:c.jsx(Uh,{size:12})})]})}),K&&c.jsx("div",{className:"shrink-0 border-b border-danger/20 bg-danger/[0.045] px-4 py-2.5 text-[10.5px] leading-relaxed text-danger",children:K}),c.jsx("div",{ref:ce,className:"thin-scroll min-h-0 flex-1 overflow-y-auto bg-canvas/40 px-4 py-3",children:P.length===0&&!j?c.jsxs("div",{className:"flex h-full min-h-[180px] flex-col items-center justify-center gap-2 px-6 text-center",children:[c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-raised text-faint",children:c.jsx(wr,{size:17})}),c.jsx("p",{className:"text-[11.5px] font-medium text-muted",children:"Ready when you are"}),c.jsx("p",{className:"max-w-[260px] text-[10px] leading-relaxed text-faint",children:"The build and deploy output appears here. Credentials are passed to the CLI through the environment, never printed in the log."})]}):c.jsxs("pre",{className:"whitespace-pre-wrap break-words font-mono text-[10px] leading-[1.7] text-muted",children:[P.map(C=>c.jsxs("span",{className:ie("block",C.stream==="stderr"&&"text-danger",C.stream==="meta"&&"text-accent"),children:[C.stream==="meta"?"› ":"",C.text]},C.id)),j&&c.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-accent",children:[c.jsx(Vt,{size:10})," working…"]})]})}),c.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-2 border-t border-line px-4 text-[9px] text-faint",children:[c.jsx(kr,{size:10}),"Tokens encrypted at rest",c.jsx("span",{className:"ml-auto",children:b.trim()?b.trim().split(/[\\/]/).filter(Boolean).pop():"No folder"})]})]})]})]})}const Dh={name:"",transport:"stdio",command:"",args:"",env:"",url:"",headers:"",oauth:!1,clientId:"",clientSecret:"",scope:""},S9=[{label:"Filesystem",description:"Read and write files in a folder",draft:{name:"Filesystem",command:"npx",args:"-y @modelcontextprotocol/server-filesystem ."}},{label:"Memory",description:"Knowledge-graph memory",draft:{name:"Memory",command:"npx",args:"-y @modelcontextprotocol/server-memory"}},{label:"Fetch",description:"Fetch web pages as markdown",draft:{name:"Fetch",command:"uvx",args:"mcp-server-fetch"}},{label:"Linear",description:"Issues and projects · OAuth",draft:{name:"Linear",transport:"http",url:"https://mcp.linear.app/mcp",oauth:!0}},{label:"Notion",description:"Pages and databases · OAuth",draft:{name:"Notion",transport:"http",url:"https://mcp.notion.com/mcp",oauth:!0}},{label:"Sentry",description:"Errors and traces · OAuth",draft:{name:"Sentry",transport:"http",url:"https://mcp.sentry.dev/mcp",oauth:!0}},{label:"Atlassian",description:"Jira and Confluence · SSE + OAuth",draft:{name:"Atlassian",transport:"sse",url:"https://mcp.atlassian.com/v1/sse",oauth:!0}},{label:"DeepWiki",description:"Repo docs · no sign-in",draft:{name:"DeepWiki",transport:"http",url:"https://mcp.deepwiki.com/mcp"}}];function T9(e){const i=[],a=/"([^"]*)"|'([^']*)'|(\S+)/g;let r;for(;r=a.exec(e);)i.push(r[1]??r[2]??r[3]);return i}function C9(e=[]){return e.map(i=>/\s/.test(i)?`"${i}"`:i).join(" ")}function zv(e,i){const a={};for(const r of e.split(`
|
|
308
|
+
`)){const o=r.indexOf(i);o<1||(a[r.slice(0,o).trim()]=r.slice(o+1).trim())}return a}function Lv(e,i){return Object.entries(e??{}).map(([a,r])=>`${a}${i===":"?": ":i}${r}`).join(`
|
|
309
|
+
`)}function VE(e){return{id:e.id,name:e.name,transport:e.transport,command:e.command??"",args:C9(e.args),env:Lv(e.env,"="),url:e.url??"",headers:Lv(e.headers,":"),oauth:!!e.oauth?.enabled,clientId:e.oauth?.clientId??"",clientSecret:e.oauth?.clientSecret??"",scope:e.oauth?.scope??""}}function Iv(e){return e.name.trim()?e.transport==="stdio"?!!e.command.trim():/^https?:\/\//i.test(e.url.trim()):!1}function XE(e,i){const a={...e.id?{id:e.id}:{},name:e.name.trim(),transport:e.transport,enabled:i?.enabled??!0,approval:i?.approval??"ask",disabledTools:i?.disabledTools??[]};return e.transport==="stdio"?{...a,command:e.command.trim(),args:T9(e.args),env:zv(e.env,"=")}:{...a,url:e.url.trim(),headers:zv(e.headers,":"),oauth:e.oauth?{enabled:!0,clientId:e.clientId.trim(),clientSecret:e.clientSecret.trim(),scope:e.scope.trim()}:null}}function Ws(e){return XE(VE(e),e)}const al=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Uv=e=>{const i={};if(al(e))for(const[a,r]of Object.entries(e))(typeof r=="string"||typeof r=="number")&&(i[a]=String(r));return i};function A9(e,i){const a=i.disabled!==!0,r=[i.url,i.serverUrl,i.httpUrl].find(o=>typeof o=="string");if(r){const o=String(i.type??i.transport??"").toLowerCase(),u=o.includes("sse")||!o&&/\/sse\/?$/i.test(r)?"sse":"http",d=Uv(i.headers),p=Object.keys(d).some(h=>h.toLowerCase()==="authorization");return{name:e,transport:u,enabled:a,url:r,headers:d,oauth:p?null:{enabled:!0}}}if(typeof i.command=="string"&&i.command.trim()){const o=Array.isArray(i.args)?i.args.filter(u=>typeof u=="string"):[];return{name:e,transport:"stdio",enabled:a,command:i.command,args:o,env:Uv(i.env)}}return null}const Bv=e=>al(e)&&(typeof e.command=="string"||typeof e.url=="string"||typeof e.serverUrl=="string"||typeof e.httpUrl=="string");function j9(e){let i;try{i=JSON.parse(e)}catch{throw new Error("That is not valid JSON.")}if(!al(i))throw new Error("Expected a JSON object.");let a=null;for(const u of[i.mcpServers,i.servers,al(i.mcp)?i.mcp.servers:void 0])if(al(u)){a=u;break}if(a||(Bv(i)?a={Imported:i}:Object.values(i).length>0&&Object.values(i).every(Bv)&&(a=i)),!a)throw new Error('No MCP servers found. Expect {"mcpServers": {"name": {"command": …} or {"url": …}}}.');const r=[],o=[];for(const[u,d]of Object.entries(a)){const p=al(d)?A9(u.slice(0,60),d):null;p?r.push(p):o.push(u)}if(r.length===0)throw new Error('None of those entries has a "command" or a "url".');return{servers:r,skipped:o}}const Oa="h-9 w-full rounded-xl border border-line bg-panel px-3 text-[12px] text-ink outline-none transition-all placeholder:text-faint focus:border-accent/50 focus:shadow-[0_0_0_3px_rgb(var(--accent)/0.10)] disabled:opacity-50",zh=Oa.replace("h-9 ",""),Lh=[{value:"stdio",label:"Local · stdio",hint:"Runs a command on this computer"},{value:"http",label:"Remote · HTTP",hint:"Streamable HTTP endpoint"},{value:"sse",label:"Remote · SSE",hint:"Legacy HTTP+SSE endpoint"}],O9={stdio:"stdio",http:"HTTP",sse:"SSE"};function Lg({transport:e,size:i=13}){const a=e==="stdio"?Zh:e==="sse"?zT:J2;return c.jsx(a,{size:i,strokeWidth:1.7})}function ZE({status:e}){return c.jsx("span",{className:ie("h-2 w-2 shrink-0 rounded-full",e==="connected"&&"bg-success shadow-[0_0_0_3px_rgb(var(--success)/0.18)]",e==="connecting"&&"animate-breathe bg-warning",e==="needs_auth"&&"bg-warning shadow-[0_0_0_3px_rgb(var(--warning)/0.18)]",e==="error"&&"bg-danger",(e==="disconnected"||e==="disabled")&&"bg-faint/60")})}function QE(e){switch(e.status){case"connected":return`${e.tools.length} tool${e.tools.length===1?"":"s"}${e.serverInfo?.name?` · ${e.serverInfo.name} ${e.serverInfo.version??""}`:""}`;case"connecting":return"Connecting…";case"needs_auth":return"Sign-in required";case"error":return e.error||"Connection failed";case"disabled":return"Turned off";default:return"Not connected"}}function M9(){const e=me(O=>O.mcpOpen),i=me(O=>O.setMcpOpen),a=me(O=>O.notify),r=me(O=>O.askConfirm),o=Tn(O=>O.servers),u=Tn(O=>O.loaded),d=Tn(O=>O.error),p=Tn(O=>O.load),h=Tn(O=>O.save),g=Tn(O=>O.act),x=Tn(O=>O.authorize),b=Tn(O=>O.logout),[v,y]=B.useState(null),[k,_]=B.useState(!1),[S,N]=B.useState(!1),[M,j]=B.useState(null);B.useEffect(()=>{e?p():(y(null),_(!1))},[e,p]);const D=B.useMemo(()=>v&&!(v.kind==="server"&&!o.some(O=>O.id===v.id))?v:o[0]?{kind:"server",id:o[0].id}:{kind:"new",draft:{...Dh}},[v,o]),P=D.kind==="server"?o.find(O=>O.id===D.id):void 0,L=()=>i(!1),T=O=>{y(O),_(!0)},R=async(O,te)=>{N(!0);try{return await h(O),te&&a(te,"success"),!0}catch(ne){return a(ne instanceof Error?ne.message:"Could not save MCP servers.","error"),!1}finally{N(!1)}},K=(O,te)=>R(o.map(ne=>ne.id===O?{...Ws(ne),...te}:Ws(ne))),z=async(O,te)=>{const ne=new Set(o.map(C=>C.id)),G=XE(O,o.find(C=>C.id===O.id)),A=te?[...o.map(Ws),G]:o.map(C=>C.id===O.id?G:Ws(C));if(!await R(A,te?`Added ${G.name}. Connecting…`:`Saved ${G.name}.`))return;const Se=Tn.getState().servers.find(C=>!ne.has(C.id)),pe=te?Se?.id:O.id;pe&&y({kind:"server",id:pe})},$=async O=>{const te=new Set(o.map(A=>A.id));if(!await R([...o.map(Ws),...O],`Imported ${O.length} server${O.length===1?"":"s"}.`))return;const G=Tn.getState().servers.find(A=>!te.has(A.id));y(G?{kind:"server",id:G.id}:null)},W=async O=>{await r({title:`Remove ${O.name}?`,body:"The server is disconnected, its saved sign-in is deleted and its tools disappear from the agent.",confirmLabel:"Remove server",tone:"danger"})&&await R(o.filter(ne=>ne.id!==O.id).map(Ws),`Removed ${O.name}.`)&&(y(null),_(!1))},de=async O=>{j(O.id);try{await x(O.id),a(`Finish signing in to ${O.name} in the new window.`,"info")}catch(te){a(te instanceof Error?te.message:"Could not start sign-in.","error")}finally{j(null)}},ce=o.filter(O=>O.status==="connected").length,ae=o.reduce((O,te)=>O+(te.status==="connected"?te.tools.length-te.disabledTools.length:0),0);return c.jsxs(Ed,{open:e,onClose:L,labelledBy:"mcp-title",className:"settings-shell h-[94dvh] p-0 sm:h-[min(88dvh,780px)] sm:w-[min(1080px,96vw)] sm:!rounded-[28px]",children:[c.jsxs("header",{className:"relative flex shrink-0 items-end gap-3 border-b border-line bg-canvas px-5 pb-4 pt-5 sm:px-7",children:[c.jsx("div",{className:"settings-glow pointer-events-none absolute inset-x-0 top-0 h-32"}),c.jsxs("div",{className:"relative min-w-0 flex-1",children:[c.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.22em] text-faint",children:"Model Context Protocol"}),c.jsx("h2",{id:"mcp-title",className:"mt-1 font-display text-[26px] font-semibold leading-none tracking-[-0.035em] text-ink",children:"MCP servers"}),c.jsx("p",{className:"mt-1.5 text-[11.5px] text-muted",children:o.length===0?"Give the agent new tools from local programs or remote services.":`${ce} of ${o.length} connected · ${ae} tool${ae===1?"":"s"} available to the agent`})]}),c.jsxs("div",{className:"relative flex shrink-0 items-center gap-1.5",children:[c.jsxs("button",{type:"button",className:"chip hidden h-8 rounded-full px-3.5 text-[11.5px] sm:inline-flex",onClick:()=>T({kind:"import"}),children:[c.jsx(Z1,{size:13})," Import JSON"]}),c.jsxs("button",{type:"button",className:"inline-flex h-8 items-center gap-1.5 rounded-full bg-ink px-3.5 text-[11.5px] font-medium text-panel transition-transform active:scale-95",onClick:()=>T({kind:"new",draft:{...Dh}}),children:[c.jsx(vr,{size:13})," Add server"]}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8 rounded-full",onClick:L,"aria-label":"Close MCP panel",children:c.jsx(Bi,{size:16})})]})]}),c.jsxs("div",{className:"flex min-h-0 flex-1",children:[c.jsxs("aside",{className:ie("thin-scroll min-h-0 w-full shrink-0 overflow-y-auto bg-canvas/60 p-3 md:block md:w-[300px] md:border-r md:border-line",k?"hidden":"block"),children:[d&&c.jsx("p",{className:"mb-2 rounded-xl border border-danger/25 bg-danger/[0.05] px-3 py-2 text-[11.5px] text-danger",children:d}),!u&&c.jsxs("p",{className:"flex items-center gap-2 px-2 py-3 text-[12px] text-faint",children:[c.jsx(Vt,{size:12})," Loading servers…"]}),u&&o.length===0&&c.jsx("p",{className:"rounded-2xl border border-dashed border-line px-4 py-8 text-center text-[12px] text-muted",children:"No servers yet."}),c.jsx("ul",{className:"space-y-1",children:o.map(O=>{const te=D.kind==="server"&&D.id===O.id;return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>T({kind:"server",id:O.id}),className:ie("flex w-full items-center gap-3 rounded-2xl border px-3 py-2.5 text-left transition-all",te?"border-line bg-panel shadow-pill":"border-transparent hover:bg-raised/70"),children:[c.jsx(ZE,{status:O.status}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium text-ink",children:[c.jsx("span",{className:"truncate",children:O.name}),O.oauth?.enabled&&c.jsx(zo,{size:11,className:ie("shrink-0",O.oauth.authorized?"text-success":"text-warning"),"aria-label":"OAuth"})]}),c.jsx("span",{className:ie("mt-0.5 block truncate text-[11px]",O.status==="needs_auth"?"text-warning":O.status==="error"?"text-danger":"text-muted"),children:QE(O)})]}),c.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-full bg-raised px-2 py-0.5 font-mono text-[9.5px] text-faint",children:[c.jsx(Lg,{transport:O.transport,size:10}),O9[O.transport]]})]})},O.id)})}),c.jsxs("button",{type:"button",className:"chip mt-3 h-8 w-full justify-center rounded-xl text-[11.5px] sm:hidden",onClick:()=>T({kind:"import"}),children:[c.jsx(Z1,{size:13})," Import JSON"]})]}),c.jsxs("section",{className:ie("min-w-0 flex-1 flex-col bg-panel md:flex",k?"flex":"hidden"),children:[c.jsxs("button",{type:"button",className:"flex h-10 shrink-0 items-center gap-1 border-b border-line px-3 text-[12px] text-muted md:hidden",onClick:()=>_(!1),children:[c.jsx(d2,{size:15})," All servers"]}),c.jsx("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto",children:u?D.kind==="new"?c.jsx($v,{title:"New MCP server",initial:D.draft,busy:S,presets:!0,submitLabel:"Save and connect",onCancel:o.length>0?()=>y(null):void 0,onSubmit:O=>{z(O,!0)}},`new-${JSON.stringify(D.draft)}`):D.kind==="edit"?c.jsx($v,{title:`Edit ${D.draft.name}`,initial:D.draft,busy:S,submitLabel:"Save changes",onCancel:()=>y({kind:"server",id:D.draft.id??""}),onSubmit:O=>{z(O,!1)}},`edit-${D.draft.id}`):D.kind==="import"?c.jsx(D9,{busy:S,onCancel:()=>y(null),onImport:O=>{$(O)}}):P?c.jsx(R9,{server:P,signingIn:M===P.id,onEdit:()=>T({kind:"edit",draft:VE(P)}),onPatch:O=>{K(P.id,O)},onAct:O=>{g(P.id,O)},onAuthorize:()=>{de(P)},onSignOut:()=>{b(P.id).catch(O=>a(O instanceof Error?O.message:"Could not sign out.","error"))},onRemove:()=>{W(P)}}):null:null})]})]})]})}function R9({server:e,signingIn:i,onEdit:a,onPatch:r,onAct:o,onAuthorize:u,onSignOut:d,onRemove:p}){const[h,g]=B.useState(""),x=e.status==="connected"||e.status==="connecting",b=e.tools.filter(y=>!h.trim()||`${y.name} ${y.description}`.toLowerCase().includes(h.trim().toLowerCase())),v=e.tools.length>0&&e.disabledTools.length>=e.tools.length;return c.jsxs("div",{className:"space-y-5 px-5 py-5 sm:px-7 sm:py-6",children:[c.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("h3",{className:"flex items-center gap-2.5 font-display text-[22px] font-semibold leading-tight tracking-[-0.03em] text-ink",children:[c.jsx(ZE,{status:e.status}),c.jsx("span",{className:"truncate",children:e.name})]}),c.jsx("p",{className:ie("mt-1 text-[12px]",e.status==="error"?"text-danger":e.status==="needs_auth"?"text-warning":"text-muted"),children:QE(e)})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Reload tools","aria-label":"Reload tools",onClick:()=>o("refresh"),children:c.jsx(zi,{size:14,className:ie(e.status==="connecting"&&"animate-spin")})}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Disconnect","aria-label":"Disconnect",onClick:()=>o("disconnect"),children:c.jsx(pC,{size:14})})]}):e.status!=="needs_auth"&&c.jsxs("button",{type:"button",className:"chip h-8 rounded-full px-3.5 text-[11.5px]",disabled:!e.enabled,onClick:()=>o("connect"),children:[c.jsx(Kh,{size:13})," Connect"]}),c.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Edit connection","aria-label":"Edit connection",onClick:a,children:c.jsx(Lo,{size:14})}),c.jsx($i,{checked:e.enabled,onChange:y=>r({enabled:y}),label:`Enable ${e.name}`})]})]}),e.oauth?.enabled&&c.jsxs("div",{className:ie("flex flex-wrap items-center gap-3 rounded-2xl border px-4 py-3.5",e.oauth.authorized?"border-success/25 bg-success/[0.05]":"border-warning/30 bg-warning/[0.06]"),children:[c.jsx("span",{className:ie("flex h-9 w-9 shrink-0 items-center justify-center rounded-xl",e.oauth.authorized?"bg-success/10 text-success":"bg-warning/10 text-warning"),children:e.oauth.authorized?c.jsx(kr,{size:17}):c.jsx(zo,{size:17})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-[12.5px] font-medium text-ink",children:e.oauth.authorized?"Signed in with OAuth":"Sign-in required"}),c.jsx("p",{className:"mt-0.5 text-[11.5px] leading-relaxed text-muted",children:e.oauth.authorized?"Tokens are stored encrypted by the local daemon and refreshed automatically.":"Approve access in your browser. OpenSol registers itself with the server and keeps the tokens encrypted on this machine."})]}),e.oauth.authorized?c.jsxs("button",{type:"button",className:"chip h-8 rounded-full px-3.5 text-[11.5px]",onClick:d,children:[c.jsx(dT,{size:13})," Sign out"]}):c.jsxs("button",{type:"button",disabled:i||!e.enabled,onClick:u,className:"inline-flex h-8 items-center gap-1.5 rounded-full bg-accent px-4 text-[11.5px] font-medium text-on-accent transition-transform active:scale-95 disabled:opacity-40",children:[i?c.jsx(Vt,{size:12}):c.jsx(Uh,{size:12})," Authorize"]})]}),e.status==="error"&&e.error&&c.jsx("p",{className:"rounded-xl border border-danger/25 bg-danger/[0.05] px-3 py-2 text-[11.5px] leading-relaxed text-danger",children:e.error}),c.jsxs("div",{className:"grid gap-3 rounded-2xl border border-line p-4 sm:grid-cols-[1fr_auto] sm:items-center",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted",children:[c.jsx(Lg,{transport:e.transport})," ",Lh.find(y=>y.value===e.transport)?.label]}),c.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-ink",children:e.transport==="stdio"?`${e.command} ${(e.args??[]).join(" ")}`:e.url})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[11px] text-muted",children:"Tool calls"}),c.jsx(ug,{options:[{value:"ask",label:"Ask first"},{value:"auto",label:"Auto-run"}],value:e.approval,onChange:y=>r({approval:y})})]})]}),e.tools.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsxs("p",{className:"mr-auto text-[12px] font-medium text-ink",children:["Tools ",c.jsxs("span",{className:"font-normal text-faint",children:[e.tools.length-e.disabledTools.length,"/",e.tools.length," on"]})]}),c.jsx("button",{type:"button",className:"text-[11px] font-medium text-muted transition-colors hover:text-ink",onClick:()=>r({disabledTools:v?[]:e.tools.map(y=>y.name)}),children:v?"Enable all":"Disable all"})]}),e.tools.length>6&&c.jsxs("div",{className:"relative mb-2",children:[c.jsx(as,{size:13,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-faint"}),c.jsx("input",{className:ie(Oa,"pl-8"),placeholder:"Filter tools",value:h,onChange:y=>g(y.target.value)})]}),c.jsxs("ul",{className:"divide-y divide-line rounded-xl border border-line",children:[b.map(y=>{const k=e.disabledTools.includes(y.name);return c.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[c.jsx(Co,{size:12,className:ie("shrink-0",k?"text-faint":"text-accent")}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:ie("truncate font-mono text-[11.5px]",k?"text-faint line-through":"text-ink"),children:y.name}),y.description&&c.jsx("p",{className:"truncate text-[10.5px] text-muted",children:y.description})]}),y.readOnly&&c.jsx("span",{className:"rounded-full bg-success/10 px-1.5 py-px text-[9px] text-success",children:"read-only"}),c.jsx($i,{checked:!k,label:`Enable ${y.name}`,onChange:_=>r({disabledTools:_?e.disabledTools.filter(S=>S!==y.name):[...e.disabledTools,y.name]})})]},y.name)}),b.length===0&&c.jsx("li",{className:"px-3 py-4 text-center text-[11.5px] text-faint",children:"No tools match."})]})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs("button",{type:"button",onClick:p,className:"inline-flex items-center gap-1.5 text-[11.5px] font-medium text-faint transition-colors hover:text-danger",children:[c.jsx(sa,{size:12})," Remove server"]})})]})}function $v({title:e,initial:i,busy:a,presets:r=!1,submitLabel:o,onCancel:u,onSubmit:d}){const[p,h]=B.useState(i),[g,x]=B.useState(!!(i.clientId||i.scope)),b=p.transport!=="stdio",v=y=>h(k=>({...k,...y}));return c.jsxs("form",{className:"space-y-4 px-5 py-5 sm:px-7 sm:py-6",onSubmit:y=>{y.preventDefault(),Iv(p)&&!a&&d(p)},children:[c.jsx("h3",{className:"font-display text-[22px] font-semibold leading-tight tracking-[-0.03em] text-ink",children:e}),r&&c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-[11px] font-medium text-muted",children:"Start from a template"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:S9.map(y=>c.jsxs("button",{type:"button",onClick:()=>h({...Dh,...y.draft}),className:"rounded-xl border border-line px-3 py-2 text-left transition-all hover:border-accent/40 hover:bg-raised/60 active:scale-[0.98]",children:[c.jsx("span",{className:"block text-[12px] font-medium text-ink",children:y.label}),c.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-muted",children:y.description})]},y.label))})]}),c.jsxs("div",{className:"grid gap-3",children:[c.jsx("input",{"data-autofocus":!0,className:Oa,placeholder:"Name (e.g. GitHub)",value:p.name,onChange:y=>v({name:y.target.value})}),c.jsxs("div",{children:[c.jsx(ug,{options:Lh.map(({value:y,label:k})=>({value:y,label:k})),value:p.transport,onChange:y=>v({transport:y}),size:"md"}),c.jsx("p",{className:"mt-1.5 text-[11px] text-faint",children:Lh.find(y=>y.value===p.transport)?.hint})]})]}),b?c.jsxs(c.Fragment,{children:[c.jsx("input",{className:ie(Oa,"font-mono"),placeholder:p.transport==="sse"?"https://example.com/sse":"https://example.com/mcp",value:p.url,onChange:y=>v({url:y.target.value})}),c.jsxs("div",{className:"rounded-2xl border border-line p-3.5",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent",children:c.jsx(zo,{size:14})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-[12.5px] font-medium text-ink",children:"Sign in with OAuth"}),c.jsx("p",{className:"text-[11px] text-muted",children:"For services that ask you to approve access in the browser (Linear, Notion, Sentry…)."})]}),c.jsx($i,{checked:p.oauth,onChange:y=>v({oauth:y}),label:"Sign in with OAuth"})]}),p.oauth&&c.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[c.jsxs("button",{type:"button",className:"text-[11px] font-medium text-muted transition-colors hover:text-ink",onClick:()=>x(y=>!y),children:[g?"Hide":"Show"," advanced client settings"]}),g&&c.jsxs("div",{className:"mt-2.5 grid gap-2.5 sm:grid-cols-2",children:[c.jsx("input",{className:ie(Oa,"font-mono"),placeholder:"Client ID (optional)",value:p.clientId,onChange:y=>v({clientId:y.target.value})}),c.jsx("input",{className:ie(Oa,"font-mono"),type:"password",autoComplete:"off",placeholder:"Client secret (optional)",value:p.clientSecret,onChange:y=>v({clientSecret:y.target.value})}),c.jsx("input",{className:ie(Oa,"font-mono sm:col-span-2"),placeholder:"Scopes (optional, space separated)",value:p.scope,onChange:y=>v({scope:y.target.value})}),c.jsxs("p",{className:"text-[10.5px] leading-relaxed text-faint sm:col-span-2",children:["Leave the client empty to register automatically. Redirect URI to allow: ",c.jsx("span",{className:"font-mono",children:`${window.location.origin}/oauth/mcp/callback`})]})]})]})]}),c.jsx("textarea",{className:ie(zh,"h-20 resize-none py-2 font-mono"),placeholder:`Headers, one per line (API keys, bearer tokens)
|
|
310
|
+
Authorization: Bearer …`,value:p.headers,onChange:y=>v({headers:y.target.value})})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[c.jsx("input",{className:ie(Oa,"font-mono"),placeholder:"command",value:p.command,onChange:y=>v({command:y.target.value})}),c.jsx("input",{className:ie(Oa,"font-mono"),placeholder:"arguments",value:p.args,onChange:y=>v({args:y.target.value})})]}),c.jsx("textarea",{className:ie(zh,"h-20 resize-none py-2 font-mono"),placeholder:`Environment, one per line
|
|
311
|
+
API_KEY=…`,value:p.env,onChange:y=>v({env:y.target.value})}),c.jsx("p",{className:"text-[11px] leading-relaxed text-faint",children:"Local servers run as a process on this computer with your permissions, so only add servers you trust."})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u&&c.jsx("button",{type:"button",className:"chip h-8 rounded-full px-4",onClick:u,children:"Cancel"}),c.jsxs("button",{type:"submit",disabled:a||!Iv(p),className:"inline-flex h-8 items-center gap-1.5 rounded-full bg-accent px-4 text-[11.5px] font-medium text-on-accent transition-transform active:scale-95 disabled:opacity-40",children:[a&&c.jsx(Vt,{size:11})," ",o]})]})]})}function D9({busy:e,onCancel:i,onImport:a}){const[r,o]=B.useState(""),u=B.useMemo(()=>{if(!r.trim())return null;try{return{...j9(r),error:""}}catch(d){return{servers:[],skipped:[],error:d instanceof Error?d.message:"Could not read that JSON."}}},[r]);return c.jsxs("div",{className:"space-y-4 px-5 py-5 sm:px-7 sm:py-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-display text-[22px] font-semibold leading-tight tracking-[-0.03em] text-ink",children:"Import from JSON"}),c.jsxs("p",{className:"mt-1 text-[12px] leading-relaxed text-muted",children:["Paste the ",c.jsx("span",{className:"font-mono",children:"mcpServers"})," block from Claude Desktop, Cursor or VS Code. Local commands and remote URLs (HTTP or SSE) both work."]})]}),c.jsx("textarea",{"data-autofocus":!0,className:ie(zh,"h-48 resize-none py-2.5 font-mono text-[11.5px]"),placeholder:`{
|
|
312
|
+
"mcpServers": {
|
|
313
|
+
"github": { "url": "https://api.githubcopilot.com/mcp/" },
|
|
314
|
+
"files": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] }
|
|
315
|
+
}
|
|
316
|
+
}`,value:r,onChange:d=>o(d.target.value),spellCheck:!1}),u?.error&&c.jsx("p",{className:"rounded-xl border border-danger/25 bg-danger/[0.05] px-3 py-2 text-[11.5px] text-danger",children:u.error}),u&&u.servers.length>0&&c.jsx("ul",{className:"divide-y divide-line rounded-xl border border-line",children:u.servers.map(d=>c.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[c.jsx("span",{className:"text-faint",children:c.jsx(Lg,{transport:d.transport??"stdio"})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-[12px] font-medium text-ink",children:d.name}),c.jsx("span",{className:"block truncate font-mono text-[10.5px] text-muted",children:d.transport==="stdio"?`${d.command} ${(d.args??[]).join(" ")}`:d.url})]}),d.oauth?.enabled&&c.jsx("span",{className:"rounded-full bg-accent-soft px-2 py-px text-[9.5px] text-accent",children:"OAuth"})]},d.name))}),u&&u.skipped.length>0&&c.jsxs("p",{className:"text-[11px] text-faint",children:["Skipped (no command or url): ",u.skipped.join(", ")]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx("button",{type:"button",className:"chip h-8 rounded-full px-4",onClick:i,children:"Cancel"}),c.jsxs("button",{type:"button",disabled:e||!u||u.servers.length===0,onClick:()=>u&&a(u.servers),className:"inline-flex h-8 items-center gap-1.5 rounded-full bg-accent px-4 text-[11.5px] font-medium text-on-accent transition-transform active:scale-95 disabled:opacity-40",children:[e&&c.jsx(Vt,{size:11})," Import ",u&&u.servers.length>0?`${u.servers.length} server${u.servers.length===1?"":"s"}`:""]})]})]})}function z9(){const e=me(j=>j.paletteOpen),i=me(j=>j.setPaletteOpen),a=me(j=>j.openSettings),r=me(j=>j.setMcpOpen),o=me(j=>j.setWorkspaceOpen),u=me(j=>j.setDeployOpen),d=me(j=>j.focusComposer),p=me(j=>j.notify),h=Ye(j=>j.sessions),g=Be(j=>j.entries),[x,b]=B.useState(""),[v,y]=B.useState(0),k=B.useRef(null),_=B.useRef(null);B.useEffect(()=>{if(!e)return;b(""),y(0),_.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const j=document.body.style.overflow;document.body.style.overflow="hidden";const D=window.setTimeout(()=>k.current?.focus(),30);return()=>{window.clearTimeout(D),document.body.style.overflow=j,_.current?.focus()}},[e]);const S=B.useMemo(()=>{const j=document.documentElement.classList.contains("dark"),D=()=>i(!1),P=[{id:"action-new-chat",label:"New chat",hint:"Start a clean conversation",group:"Actions",icon:vr,action:()=>{Ye.getState().newChat(),d(),D()}},{id:"action-workspace",label:"Toggle workspace panel",hint:"Browse and edit files in the open folder",group:"Actions",icon:es,action:()=>{o(!me.getState().workspaceOpen),D()}},{id:"action-deploy",label:"Deploy a page",hint:"Cloudflare Pages, Netlify or Vercel",group:"Actions",icon:wr,action:()=>{u(!0),D()}},{id:"action-theme",label:j?"Switch to light theme":"Switch to dark theme",group:"Actions",icon:j?Xh:Gh,action:()=>{Oe.getState().update({theme:j?"light":"dark"}),D()}},{id:"action-models",label:"Model settings",hint:"Providers, encrypted keys and reasoning",group:"Settings",icon:Uu,action:()=>{a("models"),D()}},{id:"action-tools",label:"Tool permissions",hint:"Approval and enablement",group:"Settings",icon:Co,action:()=>{a("tools"),D()}},{id:"action-search",label:"Search settings",hint:"Tavily, Brave, Serper, DuckDuckGo",group:"Settings",icon:is,action:()=>{a("search"),D()}},{id:"action-mcp",label:"MCP servers",hint:"Connections, OAuth sign-in and tools",group:"Settings",icon:Kh,action:()=>{D(),r(!0)}},{id:"action-skills",label:"Skills",hint:"Load and manage reusable instructions",group:"Settings",icon:Ui,action:()=>{a("skills"),D()}},{id:"action-deploy-settings",label:"Hosting credentials",hint:"Cloudflare, Netlify and Vercel tokens",group:"Settings",icon:wr,action:()=>{a("deploy"),D()}},{id:"action-appearance",label:"Appearance",hint:"Theme and token estimates",group:"Settings",icon:Qv,action:()=>{a("appearance"),D()}},{id:"action-about",label:"About OpenSol",hint:"Local storage and reset controls",group:"Settings",icon:$h,action:()=>{a("about"),D()}},{id:"action-export",label:"Export conversations",hint:"Download a JSON history file",group:"Actions",icon:qv,action:()=>{uw(),p("Conversation history exported.","success"),D()}}],L=[...h].sort((R,K)=>K.updatedAt-R.updatedAt).map(R=>({id:`chat-${R.id}`,label:R.title,hint:`${R.messages.length} messages · ${Xu(R.updatedAt)}`,group:"Conversations",icon:Zv,keywords:R.messages.filter(K=>K.role==="user").map(K=>K.content).join(" ").slice(0,1e3),action:()=>{Ye.getState().setActive(R.id),D()}})),T=g.filter(R=>R.type==="file").slice(0,1500).map(R=>({id:`file-${R.path}`,label:R.name,hint:R.path,group:"Workspace files",icon:Ma,keywords:R.path,action:()=>{Be.getState().setActiveFile(R.path),o(!0),D()}}));return[...P,...L,...T]},[h,g,d,p,a,r,i,o,u]),N=B.useMemo(()=>{const j=x.trim().toLowerCase(),D=j?40:18;if(!j){const P=new Set([...h].sort((L,T)=>T.updatedAt-L.updatedAt).slice(0,2).map(L=>`chat-${L.id}`));return S.filter(L=>L.group!=="Conversations"||P.has(L.id)).filter((L,T,R)=>R.findIndex(K=>K.id===L.id)===T).slice(0,D)}return S.filter(P=>`${P.label} ${P.hint??""} ${P.keywords??""} ${P.group}`.toLowerCase().includes(j)).slice(0,D)},[S,x,h]);if(B.useEffect(()=>{y(0)},[x]),B.useEffect(()=>{if(!e)return;document.querySelector(`[data-palette-index="${v}"]`)?.scrollIntoView({block:"nearest"})},[v,e]),B.useEffect(()=>{v>N.length-1&&y(Math.max(0,N.length-1))},[N.length,v]),!e)return null;const M=j=>{const D=N[j];D&&D.action()};return Ho.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[90] flex items-start justify-center px-3 pt-[10vh] sm:pt-[14vh]",children:[c.jsx("button",{type:"button","aria-label":"Close command palette",tabIndex:-1,className:"absolute inset-0 cursor-default bg-ink/20 backdrop-blur-[2px] dark:bg-black/45",onClick:()=>i(!1)}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Search and commands",className:"modal-panel relative flex max-h-[min(72dvh,560px)] w-full max-w-[560px] flex-col overflow-hidden rounded-2xl border border-line surface-lift shadow-float",children:[c.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2.5 border-b border-line px-3.5",children:[c.jsx(as,{size:15,className:"shrink-0 text-faint"}),c.jsx("input",{ref:k,value:x,onChange:j=>b(j.target.value),onKeyDown:j=>{j.key==="ArrowDown"?(j.preventDefault(),N.length>0&&y(D=>Math.min(D+1,N.length-1))):j.key==="ArrowUp"?(j.preventDefault(),y(D=>Math.max(D-1,0))):j.key==="Enter"?(j.preventDefault(),M(v)):j.key==="Escape"&&i(!1)},placeholder:"Search chats, files, settings, actions…",className:"h-full min-w-0 flex-1 bg-transparent text-[13px] text-ink outline-none placeholder:text-faint",role:"combobox","aria-expanded":"true","aria-controls":"palette-results","aria-activedescendant":N[v]?`palette-${N[v].id}`:void 0}),c.jsx("kbd",{className:"hidden rounded border border-line bg-raised px-1.5 py-0.5 text-[9px] text-faint sm:block",children:"Esc"})]}),c.jsxs("div",{id:"palette-results",role:"listbox",className:"thin-scroll min-h-0 flex-1 overflow-y-auto p-1.5",children:[N.length===0&&c.jsxs("div",{className:"px-4 py-10 text-center",children:[c.jsx("p",{className:"text-[12px] font-medium text-muted",children:"No matches"}),c.jsx("p",{className:"mt-1 text-[10.5px] text-faint",children:"Try a chat title, a file name or “deploy”."})]}),N.map((j,D)=>{const P=j.icon,L=D===0||N[D-1].group!==j.group;return c.jsxs(B.Fragment,{children:[L&&c.jsx("p",{className:"px-2 pb-1 pt-2 text-[9.5px] font-medium uppercase tracking-[0.08em] text-faint",children:j.group}),c.jsxs("button",{type:"button",id:`palette-${j.id}`,"data-palette-index":D,role:"option","aria-selected":v===D,onMouseMove:()=>y(D),onClick:()=>M(D),className:ie("flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors",v===D?"bg-raised":"hover:bg-raised/60"),children:[c.jsx("span",{className:ie("flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-line bg-panel",v===D?"text-accent":"text-muted"),children:c.jsx(P,{size:12})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-[11.5px] font-medium text-ink",children:j.label}),j.hint&&c.jsx("span",{className:"mt-0.5 block truncate text-[9.5px] text-faint",children:j.hint})]}),c.jsx(JS,{size:11,className:ie("shrink-0 text-faint transition-opacity",v===D?"opacity-100":"opacity-0")})]})]},j.id)})]}),c.jsxs("div",{className:"flex h-8 shrink-0 items-center justify-between border-t border-line bg-raised/30 px-3 text-[9px] text-faint",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsxs("span",{children:[c.jsx("kbd",{className:"rounded border border-line bg-panel px-1",children:"↑"})," ",c.jsx("kbd",{className:"rounded border border-line bg-panel px-1",children:"↓"})," navigate"]}),c.jsxs("span",{children:[c.jsx("kbd",{className:"rounded border border-line bg-panel px-1",children:"↵"})," open"]})]}),c.jsx("span",{children:"OpenSol"})]})]})]}),document.body)}const Hv=["Waking the local daemon","Unlocking your keys","Loading workspace","Almost there"],L9=["M32 7v8","M32 49v8","M7 32h8","M49 32h8"],I9=["M14.3 14.3l5.5 5.5","M44.2 44.2l5.5 5.5","M14.3 49.7l5.5-5.5","M44.2 19.8l5.5-5.5"];function U9({size:e=64}){return c.jsxs("div",{className:"relative",style:{width:e*1.7,height:e*1.7},children:[c.jsx("span",{className:"absolute inset-0 m-auto animate-ping rounded-full bg-accent/20",style:{width:e*.7,height:e*.7}}),c.jsx("span",{className:"absolute inset-0 m-auto rounded-full bg-accent/10 blur-2xl",style:{width:e*1.4,height:e*1.4}}),c.jsxs("svg",{viewBox:"0 0 64 64",width:e,height:e,fill:"none",className:"splash-sun absolute inset-0 m-auto text-accent",children:[c.jsx("circle",{className:"core",cx:"32",cy:"32",r:"12",fill:"currentColor"}),c.jsxs("g",{className:"rays",stroke:"currentColor",strokeWidth:"4.4",strokeLinecap:"round",children:[L9.map((i,a)=>c.jsx("path",{d:i,className:"ray",pathLength:8,style:{animationDelay:`${.35+a*.07}s`}},i)),I9.map((i,a)=>c.jsx("path",{d:i,className:"ray",pathLength:8,opacity:.55,style:{animationDelay:`${.65+a*.07}s`}},i))]})]})]})}function B9({phase:e,error:i,leaving:a,onRetry:r}){const[o,u]=B.useState(0);return B.useEffect(()=>{if(e==="error")return;const d=window.setInterval(()=>u(p=>Math.min(Hv.length-1,p+1)),650);return()=>window.clearInterval(d)},[e]),c.jsxs("div",{className:ie("splash",a&&"is-leaving"),role:"status","aria-live":"polite",children:[c.jsx("div",{className:"hero-wash pointer-events-none absolute inset-0","aria-hidden":"true"}),c.jsxs("div",{className:"relative flex w-full max-w-[400px] flex-col items-center px-6 text-center",children:[c.jsx(U9,{}),c.jsx("h1",{className:"splash-word -mt-1 text-[26px] font-semibold leading-none tracking-[-0.04em] text-ink","aria-label":"OpenSol",children:"OpenSol".split("").map((d,p)=>c.jsx("span",{style:{animationDelay:`${.5+p*.05}s`},className:p>=4?"text-accent":void 0,children:d},p))}),c.jsx("p",{className:"mt-2 animate-fade text-[11px] font-medium uppercase tracking-[0.22em] text-faint [animation-delay:1s]",children:"by OpenSoftX"}),e==="error"?c.jsxs("div",{className:"mt-8 w-full animate-rise",children:[c.jsxs("div",{className:"w-full rounded-xl border border-danger/25 bg-danger/[0.05] px-4 py-3 text-left",children:[c.jsxs("p",{className:"flex items-center gap-1.5 text-[12.5px] font-medium text-ink",children:[c.jsx(sd,{size:14,className:"text-danger"}),"The local daemon did not answer"]}),c.jsx("p",{className:"mt-1.5 whitespace-pre-wrap break-words text-[11.5px] leading-relaxed text-muted",children:i})]}),c.jsxs("button",{type:"button",onClick:r,className:"mt-4 inline-flex h-9 items-center gap-1.5 rounded-lg bg-ink px-4 text-[12.5px] font-medium text-panel transition-all hover:opacity-85 active:scale-95",children:[c.jsx(zi,{size:13}),"Try again"]}),c.jsxs("p",{className:"mt-3 text-[11px] leading-relaxed text-faint",children:["Start OpenSol with ",c.jsx("code",{className:"rounded bg-raised px-1 py-0.5 font-mono text-[10.5px]",children:"npm start"})," in the OpenSol folder, then reload this page."]})]}):c.jsxs("div",{className:"mt-9 flex animate-fade flex-col items-center gap-3 [animation-delay:0.8s]",children:[c.jsx("div",{className:"loading-bar h-[2px] w-32 rounded-full"}),c.jsxs("p",{className:"animate-rise text-[12px] text-muted",children:[Hv[o],"…"]},o)]}),c.jsx("div",{className:"mt-12 animate-fade [animation-delay:1.2s]",children:c.jsx(UO,{})})]})]})}const $9=1600;function H9(){const e=Au(b=>b.phase),i=Au(b=>b.error),a=Au(b=>b.boot),r=Oe(b=>b.theme),o=Oe(b=>b.chatFontSize),u=me(b=>b.mobileSidebarOpen),d=me(b=>b.setMobileSidebarOpen),p=me(b=>b.setPaletteOpen);oj();const[h,g]=B.useState("show");B.useEffect(()=>{if(e!=="ready"||h!=="show")return;const b=Au.getState().startedAt||Date.now(),v=Math.max(0,$9-(Date.now()-b)),y=window.setTimeout(()=>g("leaving"),v);return()=>window.clearTimeout(y)},[e,h]),B.useEffect(()=>{if(h!=="leaving")return;const b=window.setTimeout(()=>g("gone"),520);return()=>window.clearTimeout(b)},[h]),B.useEffect(()=>{a()},[a]),B.useEffect(()=>{e==="ready"&&iw().then(b=>i9(b.plugins)).catch(()=>{})},[e]),B.useEffect(()=>{const b=document.documentElement,v=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{const k=vw(r,v.matches);b.dataset.theme=k,b.classList.toggle("dark",th(r,v.matches)),document.querySelector('meta[name="theme-color"]')?.setAttribute("content",th(r,v.matches)?"#141413":"#ffffff");try{localStorage.setItem("opensol.theme",r)}catch{}};if(y(),r==="system")return v.addEventListener("change",y),()=>v.removeEventListener("change",y)},[r]),B.useEffect(()=>{document.documentElement.style.setProperty("--chat-font-size",`${o}px`)},[o]),B.useEffect(()=>{const b=v=>{const y=v.metaKey||v.ctrlKey,k=v.key.toLowerCase();if(y&&k==="k"){v.preventDefault(),p(!me.getState().paletteOpen);return}if(y&&!v.shiftKey&&!v.altKey){if(k==="b"){v.preventDefault(),me.getState().toggleSidebar();return}if(k===","){v.preventDefault(),me.getState().openSettings("general");return}if(k==="."){v.preventDefault();const _=me.getState();_.setWorkspaceOpen(!_.workspaceOpen);return}}v.key==="Escape"&&me.getState().mobileSidebarOpen&&d(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[d,p]);const x=e==="ready";return c.jsxs("div",{className:"flex h-dvh min-h-0 overflow-hidden bg-canvas text-ink",children:[x&&c.jsxs(c.Fragment,{children:[c.jsx($O,{}),u&&c.jsx("button",{type:"button","aria-label":"Close sidebar",onClick:()=>d(!1),className:"modal-scrim fixed inset-0 z-40 cursor-default bg-black/30 backdrop-blur-[2px] lg:hidden"}),c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 bg-panel lg:my-1.5 lg:mr-1.5 lg:overflow-hidden lg:rounded-xl lg:border lg:border-line lg:shadow-pill",children:[c.jsx(cI,{}),c.jsx(xI,{})]}),c.jsx(N9,{}),c.jsx(M9,{}),c.jsx(_9,{}),c.jsx(z9,{}),c.jsx(iM,{})]}),c.jsx(nM,{}),h!=="gone"&&c.jsx(B9,{phase:e,error:i,leaving:h==="leaving",onRetry:()=>{a(!0)}})]})}class P9 extends B.Component{state={error:null,copied:!1};static getDerivedStateFromError(i){return{error:i,copied:!1}}componentDidCatch(i,a){console.error("[maxcode] render error",i,a.componentStack)}details(){const{error:i}=this.state;return`${i?.name}: ${i?.message}
|
|
317
|
+
|
|
318
|
+
${i?.stack??""}`}copy=async()=>{try{await navigator.clipboard.writeText(this.details()),this.setState({copied:!0})}catch{}};render(){return this.state.error?c.jsx("div",{className:"flex h-dvh items-center justify-center bg-panel px-5 text-ink",children:c.jsxs("div",{className:"w-full max-w-[460px]",children:[c.jsx(pl,{size:34}),c.jsx("h1",{className:"mt-4 font-display text-[28px] font-normal tracking-[-0.02em]",children:"Something broke on this screen"}),c.jsx("p",{className:"mt-2 text-[14px] leading-relaxed text-muted",children:"Your conversations are saved on this computer. Try the screen again, or reload the app."}),c.jsx("pre",{className:"thin-scroll mt-4 max-h-40 overflow-auto rounded-xl border border-line bg-canvas p-3 font-mono text-[11.5px] leading-relaxed text-muted",children:this.state.error.message}),c.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>this.setState({error:null}),className:"inline-flex h-9 items-center rounded-full bg-accent px-4 text-[13px] font-medium text-on-accent transition hover:brightness-110",children:"Try again"}),c.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex h-9 items-center rounded-full border border-line px-4 text-[13px] font-medium text-ink transition-colors hover:bg-raised",children:"Reload app"}),c.jsx("button",{type:"button",onClick:()=>{this.copy()},className:"inline-flex h-9 items-center rounded-full px-3 text-[13px] text-muted transition-colors hover:text-ink",children:this.state.copied?"Copied":"Copy details"})]})]})}):this.props.children}}const JE=document.getElementById("root");if(!JE)throw new Error("Root element not found.");BS.createRoot(JE).render(c.jsx(B.StrictMode,{children:c.jsx(P9,{children:c.jsx(H9,{})})}));
|