@bibobonking/opensol 3.1.4 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -12
- package/LICENSE +21 -0
- package/desktop/src-tauri/icons/128x128.png +0 -0
- package/desktop/src-tauri/icons/128x128@2x.png +0 -0
- package/desktop/src-tauri/icons/32x32.png +0 -0
- package/desktop/src-tauri/icons/64x64.png +0 -0
- package/desktop/src-tauri/icons/Square107x107Logo.png +0 -0
- package/desktop/src-tauri/icons/Square142x142Logo.png +0 -0
- package/desktop/src-tauri/icons/Square150x150Logo.png +0 -0
- package/desktop/src-tauri/icons/Square284x284Logo.png +0 -0
- package/desktop/src-tauri/icons/Square30x30Logo.png +0 -0
- package/desktop/src-tauri/icons/Square310x310Logo.png +0 -0
- package/desktop/src-tauri/icons/Square44x44Logo.png +0 -0
- package/desktop/src-tauri/icons/Square71x71Logo.png +0 -0
- package/desktop/src-tauri/icons/Square89x89Logo.png +0 -0
- package/desktop/src-tauri/icons/StoreLogo.png +0 -0
- package/desktop/src-tauri/icons/icon.icns +0 -0
- package/desktop/src-tauri/icons/icon.ico +0 -0
- package/desktop/src-tauri/icons/icon.png +0 -0
- package/dist/assets/index-BUVnnhRH.js +281 -0
- package/dist/assets/index-CxNPLBg7.css +1 -0
- package/dist/favicon.svg +18 -15
- package/dist/index.html +2 -2
- package/package.json +6 -3
- package/public/favicon.svg +18 -15
- package/server/daemon.mjs +66 -49
- package/server/lib/deploy.mjs +222 -121
- package/server/lib/providers.mjs +23 -1
- package/server/lib/skills.mjs +385 -100
- package/server/lib/tools.mjs +0 -40
- package/src/agent/adapters/openai-responses.ts +1 -5
- package/src/agent/adapters/openai.ts +4 -11
- package/src/agent/prompt.ts +7 -14
- package/src/agent/subagent.ts +3 -14
- package/src/agent/tools.ts +2 -0
- package/src/components/ChatView.tsx +2 -1
- package/src/components/Composer.tsx +2 -1
- package/src/components/ContextBar.tsx +10 -0
- package/src/components/DeployModal.tsx +266 -252
- package/src/components/FileIcon.tsx +391 -99
- package/src/components/HomeDashboard.tsx +5 -10
- package/src/components/Logo.tsx +9 -11
- package/src/components/ModelDeck.tsx +8 -11
- package/src/components/SettingsModal.tsx +160 -122
- package/src/components/Sidebar.tsx +4 -3
- package/src/components/SystemPromptButton.tsx +198 -0
- package/src/components/ToolCallCard.tsx +2 -0
- package/src/components/TopBar.tsx +2 -19
- package/src/components/WorkspacePanel.tsx +76 -93
- package/src/core/plugins/tools/skill.ts +19 -76
- package/src/core/services/agent-loop.ts +16 -31
- package/src/core/services/subagents.ts +2 -2
- package/src/core/services/system-prompt.ts +17 -23
- package/src/core/services/tools.ts +0 -1
- package/src/lib/boot.ts +2 -0
- package/src/lib/credits.ts +33 -0
- package/src/lib/daemon.ts +40 -19
- package/src/lib/permissions.ts +1 -1
- package/src/lib/retry.test.mjs +40 -12
- package/src/lib/retry.ts +41 -8
- package/src/lib/system-prompt.ts +23 -0
- package/src/lib/usage.ts +8 -13
- package/src/store/chats.ts +0 -1
- package/src/store/settings.ts +12 -44
- package/src/store/skills.ts +79 -0
- package/src/store/ui.ts +3 -1
- package/src/types.ts +30 -15
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/assets/index-B1pQC9Fe.js +0 -288
- package/dist/assets/index-qLr4aZVC.css +0 -1
- package/src/components/SystemPromptModal.tsx +0 -168
- package/src/lib/skills.test.mjs +0 -22
- package/src/lib/skills.ts +0 -93
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const u of c)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(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(c){if(c.ep)return;c.ep=!0;const u=a(c);fetch(c.href,u)}})();function cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lm={exports:{}},po={};var V1;function K_(){if(V1)return po;V1=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,c,u){var d=null;if(u!==void 0&&(d=""+u),c.key!==void 0&&(d=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:e,type:r,key:d,ref:c!==void 0?c:null,props:u}}return po.Fragment=i,po.jsx=a,po.jsxs=a,po}var K1;function X_(){return K1||(K1=1,lm.exports=K_()),lm.exports}var l=X_(),om={exports:{}},Je={};var X1;function Z_(){if(X1)return Je;X1=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=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"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),v=Symbol.for("react.view_transition"),y=Symbol.iterator;function k(B){return B===null||typeof B!="object"?null:(B=y&&B[y]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function A(B,se,pe){this.props=B,this.context=se,this.refs=E,this.updater=pe||S}A.prototype.isReactComponent={},A.prototype.setState=function(B,se){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,se,"setState")},A.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function T(){}T.prototype=A.prototype;function R(B,se,pe){this.props=B,this.context=se,this.refs=E,this.updater=pe||S}var P=R.prototype=new T;P.constructor=R,j(P,A.prototype),P.isPureReactComponent=!0;var z=Array.isArray;function C(){}var L={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function O(B,se,pe){var Ee=pe.ref;return{$$typeof:e,type:B,key:se,ref:Ee!==void 0?Ee:null,props:pe}}function $(B,se){return O(B.type,se,B.props)}function Z(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function fe(B){var se={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(pe){return se[pe]})}var re=/\/+/g;function te(B,se){return typeof B=="object"&&B!==null&&B.key!=null?fe(""+B.key):se.toString(36)}function M(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(C,C):(B.status="pending",B.then(function(se){B.status==="pending"&&(B.status="fulfilled",B.value=se)},function(se){B.status==="pending"&&(B.status="rejected",B.reason=se)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function ae(B,se,pe,Ee,Le){var Pe=typeof B;(Pe==="undefined"||Pe==="boolean")&&(B=null);var Fe=!1;if(B===null)Fe=!0;else switch(Pe){case"bigint":case"string":case"number":Fe=!0;break;case"object":switch(B.$$typeof){case e:case i:Fe=!0;break;case b:return Fe=B._init,ae(Fe(B._payload),se,pe,Ee,Le)}}if(Fe)return Le=Le(B),Fe=Ee===""?"."+te(B,0):Ee,z(Le)?(pe="",Fe!=null&&(pe=Fe.replace(re,"$&/")+"/"),ae(Le,se,pe,"",function(K){return K})):Le!=null&&(Z(Le)&&(Le=$(Le,pe+(Le.key==null||B&&B.key===Le.key?"":(""+Le.key).replace(re,"$&/")+"/")+Fe)),se.push(Le)),1;Fe=0;var Se=Ee===""?".":Ee+":";if(z(B))for(var H=0;H<B.length;H++)Ee=B[H],Pe=Se+te(Ee,H),Fe+=ae(Ee,se,pe,Pe,Le);else if(H=k(B),typeof H=="function")for(B=H.call(B),H=0;!(Ee=B.next()).done;)Ee=Ee.value,Pe=Se+te(Ee,H++),Fe+=ae(Ee,se,pe,Pe,Le);else if(Pe==="object"){if(typeof B.then=="function")return ae(M(B),se,pe,Ee,Le);throw se=String(B),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return Fe}function ne(B,se,pe){if(B==null)return B;var Ee=[],Le=0;return ae(B,Ee,"","",function(Pe){return se.call(pe,Pe,Le++)}),Ee}function xe(B){if(B._status===-1){var se=B._result,pe=se();pe.then(function(Ee){(B._status===0||B._status===-1)&&(B._status=1,B._result=Ee,pe.status===void 0&&(pe.status="fulfilled",pe.value=Ee))},function(Ee){(B._status===0||B._status===-1)&&(B._status=2,B._result=Ee,pe.status===void 0&&(pe.status="rejected",pe.reason=Ee))}),B._status===-1&&(B._status=0,B._result=pe)}if(B._status===1)return B._result.default;throw B._result}var _=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)};function ve(B){var se=L.T,pe={};pe.types=se!==null?se.types:null,L.T=pe;try{var Ee=B(),Le=L.S;Le!==null&&Le(pe,Ee),typeof Ee=="object"&&Ee!==null&&typeof Ee.then=="function"&&Ee.then(C,_)}catch(Pe){_(Pe)}finally{se!==null&&pe.types!==null&&(se.types=pe.types),L.T=se}}function ce(B){var se=L.T;if(se!==null){var pe=se.types;pe===null?se.types=[B]:pe.indexOf(B)===-1&&pe.push(B)}else ve(ce.bind(null,B))}var D={map:ne,forEach:function(B,se,pe){ne(B,function(){se.apply(this,arguments)},pe)},count:function(B){var se=0;return ne(B,function(){se++}),se},toArray:function(B){return ne(B,function(se){return se})||[]},only:function(B){if(!Z(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Je.Activity=x,Je.Children=D,Je.Component=A,Je.Fragment=a,Je.Profiler=c,Je.PureComponent=R,Je.StrictMode=r,Je.Suspense=h,Je.ViewTransition=v,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Je.__COMPILER_RUNTIME={__proto__:null,c:function(B){return L.H.useMemoCache(B)}},Je.addTransitionType=ce,Je.cache=function(B){return function(){return B.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(B,se,pe){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var Ee=j({},B.props),Le=B.key;if(se!=null)for(Pe in se.key!==void 0&&(Le=""+se.key),se)!G.call(se,Pe)||Pe==="key"||Pe==="__self"||Pe==="__source"||Pe==="ref"&&se.ref===void 0||(Ee[Pe]=se[Pe]);var Pe=arguments.length-2;if(Pe===1)Ee.children=pe;else if(1<Pe){for(var Fe=Array(Pe),Se=0;Se<Pe;Se++)Fe[Se]=arguments[Se+2];Ee.children=Fe}return O(B.type,Le,Ee)},Je.createContext=function(B){return B={$$typeof:d,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:u,_context:B},B},Je.createElement=function(B,se,pe){var Ee,Le={},Pe=null;if(se!=null)for(Ee in se.key!==void 0&&(Pe=""+se.key),se)G.call(se,Ee)&&Ee!=="key"&&Ee!=="__self"&&Ee!=="__source"&&(Le[Ee]=se[Ee]);var Fe=arguments.length-2;if(Fe===1)Le.children=pe;else if(1<Fe){for(var Se=Array(Fe),H=0;H<Fe;H++)Se[H]=arguments[H+2];Le.children=Se}if(B&&B.defaultProps)for(Ee in Fe=B.defaultProps,Fe)Le[Ee]===void 0&&(Le[Ee]=Fe[Ee]);return O(B,Pe,Le)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(B){return{$$typeof:p,render:B}},Je.isValidElement=Z,Je.lazy=function(B){return{$$typeof:b,_payload:{_status:-1,_result:B},_init:xe}},Je.memo=function(B,se){return{$$typeof:g,type:B,compare:se===void 0?null:se}},Je.startTransition=ve,Je.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Je.use=function(B){return L.H.use(B)},Je.useActionState=function(B,se,pe){return L.H.useActionState(B,se,pe)},Je.useCallback=function(B,se){return L.H.useCallback(B,se)},Je.useContext=function(B){return L.H.useContext(B)},Je.useDebugValue=function(){},Je.useDeferredValue=function(B,se){return L.H.useDeferredValue(B,se)},Je.useEffect=function(B,se){return L.H.useEffect(B,se)},Je.useEffectEvent=function(B){return L.H.useEffectEvent(B)},Je.useId=function(){return L.H.useId()},Je.useImperativeHandle=function(B,se,pe){return L.H.useImperativeHandle(B,se,pe)},Je.useInsertionEffect=function(B,se){return L.H.useInsertionEffect(B,se)},Je.useLayoutEffect=function(B,se){return L.H.useLayoutEffect(B,se)},Je.useMemo=function(B,se){return L.H.useMemo(B,se)},Je.useOptimistic=function(B,se){return L.H.useOptimistic(B,se)},Je.useReducer=function(B,se,pe){return L.H.useReducer(B,se,pe)},Je.useRef=function(B){return L.H.useRef(B)},Je.useState=function(B){return L.H.useState(B)},Je.useSyncExternalStore=function(B,se,pe){return L.H.useSyncExternalStore(B,se,pe)},Je.useTransition=function(){return L.H.useTransition()},Je.version="19.3.1",Je}var Z1;function Vh(){return Z1||(Z1=1,om.exports=Z_()),om.exports}var U=Vh();const cm=cd(U);var um={exports:{}},mo={},dm={exports:{}},fm={};var Q1;function Q_(){return Q1||(Q1=1,(function(e){function i(M,ae){var ne=M.length;M.push(ae);e:for(;0<ne;){var xe=ne-1>>>1,_=M[xe];if(0<c(_,ae))M[xe]=ae,M[ne]=_,ne=xe;else break e}}function a(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var ae=M[0],ne=M.pop();if(ne!==ae){M[0]=ne;e:for(var xe=0,_=M.length,ve=_>>>1;xe<ve;){var ce=2*(xe+1)-1,D=M[ce],B=ce+1,se=M[B];if(0>c(D,ne))B<_&&0>c(se,D)?(M[xe]=se,M[B]=ne,xe=B):(M[xe]=D,M[ce]=ne,xe=ce);else if(B<_&&0>c(se,ne))M[xe]=se,M[B]=ne,xe=B;else break e}}return ae}function c(M,ae){var ne=M.sortIndex-ae.sortIndex;return ne!==0?ne:M.id-ae.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=[],b=1,x=null,v=3,y=!1,k=!1,S=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function R(M){for(var ae=a(g);ae!==null;){if(ae.callback===null)r(g);else if(ae.startTime<=M)r(g),ae.sortIndex=ae.expirationTime,i(h,ae);else break;ae=a(g)}}function P(M){if(S=!1,R(M),!k)if(a(h)!==null)k=!0,z||(z=!0,Z());else{var ae=a(g);ae!==null&&te(P,ae.startTime-M)}}var z=!1,C=-1,L=5,G=-1;function O(){return j?!0:!(e.unstable_now()-G<L)}function $(){if(j=!1,z){var M=e.unstable_now();G=M;var ae=!0;try{e:{k=!1,S&&(S=!1,A(C),C=-1),y=!0;var ne=v;try{t:{for(R(M),x=a(h);x!==null&&!(x.expirationTime>M&&O());){var xe=x.callback;if(typeof xe=="function"){x.callback=null,v=x.priorityLevel;var _=xe(x.expirationTime<=M);if(M=e.unstable_now(),typeof _=="function"){x.callback=_,R(M),ae=!0;break t}x===a(h)&&r(h),R(M)}else r(h);x=a(h)}if(x!==null)ae=!0;else{var ve=a(g);ve!==null&&te(P,ve.startTime-M),ae=!1}}break e}finally{x=null,v=ne,y=!1}ae=void 0}}finally{ae?Z():z=!1}}}var Z;if(typeof T=="function")Z=function(){T($)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,re=fe.port2;fe.port1.onmessage=$,Z=function(){re.postMessage(null)}}else Z=function(){E($,0)};function te(M,ae){C=E(function(){M(e.unstable_now())},ae)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var ae=3;break;default:ae=v}var ne=v;v=ae;try{return M()}finally{v=ne}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(M,ae){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ne=v;v=M;try{return ae()}finally{v=ne}},e.unstable_scheduleCallback=function(M,ae,ne){var xe=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?xe+ne:xe):ne=xe,M){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ne+_,M={id:b++,callback:ae,priorityLevel:M,startTime:ne,expirationTime:_,sortIndex:-1},ne>xe?(M.sortIndex=ne,i(g,M),a(h)===null&&M===a(g)&&(S?(A(C),C=-1):S=!0,te(P,ne-xe))):(M.sortIndex=_,i(h,M),k||y||(k=!0,z||(z=!0,Z()))),M},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(M){var ae=v;return function(){var ne=v;v=ae;try{return M.apply(this,arguments)}finally{v=ne}}}})(fm)),fm}var W1;function W_(){return W1||(W1=1,dm.exports=Q_()),dm.exports}var pm={exports:{}},Tn={};var J1;function J_(){if(J1)return Tn;J1=1;var e=Vh();function i(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)x+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+b+"; visit "+x+" 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},c=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function p(b,x,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:y===d?d:""+y,children:b,containerInfo:x,implementation:v}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Tn.browser=function(b){return{$$typeof:u,_reason:b}},Tn.createPortal=function(b,x){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return p(b,x,null,v)},Tn.flushSync=function(b){var x=h.T,v=r.p;try{if(h.T=null,r.p=2,b)return b()}finally{h.T=x,r.p=v,r.d.f()}},Tn.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,r.d.C(b,x))},Tn.prefetchDNS=function(b){typeof b=="string"&&r.d.D(b)},Tn.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var v=x.as,y=g(v,x.crossOrigin),k=typeof x.integrity=="string"?x.integrity:void 0,S=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;v==="style"?r.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:k,fetchPriority:S}):v==="script"&&r.d.X(b,{crossOrigin:y,integrity:k,fetchPriority:S,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Tn.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var v=g(x.as,x.crossOrigin);r.d.M(b,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}}else x==null&&r.d.M(b)},Tn.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var v=x.as,y=g(v,x.crossOrigin);r.d.L(b,v,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Tn.preloadModule=function(b,x){if(typeof b=="string")if(x){var v=g(x.as,x.crossOrigin);r.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}else r.d.m(b)},Tn.requestFormReset=function(b){r.d.r(b)},Tn.unstable_batchedUpdates=function(b,x){return b(x)},Tn.useFormState=function(b,x,v){return h.H.useFormState(b,x,v)},Tn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Tn.version="19.3.1",Tn}var e0;function iw(){if(e0)return pm.exports;e0=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(),pm.exports=J_(),pm.exports}var t0;function e2(){if(t0)return mo;t0=1;var e=W_(),i=Vh(),a=iw();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 c(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,o=n;;){var f=s.return;if(f===null)break;var m=f.alternate;if(m===null){if(o=f.return,o!==null){s=o;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===s)return h(f),t;if(m===o)return h(f),n;m=m.sibling}throw Error(r(188))}if(s.return!==o.return)s=f,o=m;else{for(var w=!1,N=f.child;N;){if(N===s){w=!0,s=f,o=m;break}if(N===o){w=!0,o=f,s=m;break}N=N.sibling}if(!w){for(N=m.child;N;){if(N===s){w=!0,s=m,o=f;break}if(N===o){w=!0,o=m,s=f;break}N=N.sibling}if(!w)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}function x(t,n,s,o,f,m){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&s(t,o,f,m)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&x(t.child,n,s,o,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||S(n,t,s.child,{foundSelf:!1}),n}function S(t,n,s,o){for(;s!==null;){if(s===n)o.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(o.foundSelf)return t[1]=s,!0;t[0]=s}else if((s.tag!==22||s.memoizedState===null)&&S(t,n,s.child,o))return!0;s=s.sibling}return!1}function j(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 E=null,A=null;function T(t,n,s){return t===s?!0:t===n?(E=t,!0):!1}function R(t,n,s){return t===s?(A=t,!1):t===n?(A!==null&&(E=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 z(t,n,s){for(var o=0,f=t;f;f=s(f))o++;f=0;for(var m=n;m;m=s(m))f++;for(;0<o-f;)t=s(t),o--;for(;0<f-o;)n=s(n),f--;for(;o--;){if(t===n||n!==null&&t===n.alternate)return t;t=s(t),n=s(n)}return null}var C=Object.assign,L=Symbol.for("react.element"),G=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),fe=Symbol.for("react.profiler"),re=Symbol.for("react.consumer"),te=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),xe=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),ve=Symbol.for("react.activity"),ce=Symbol.for("react.legacy_hidden"),D=Symbol.for("react.memo_cache_sentinel"),B=Symbol.for("react.view_transition"),se=Symbol.for("react.recoverable"),pe=Symbol.iterator;function Ee(t){return t===null||typeof t!="object"?null:(t=pe&&t[pe]||t["@@iterator"],typeof t=="function"?t:null)}var Le=Symbol.for("react.client.reference");function Pe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $:return"Fragment";case fe:return"Profiler";case Z:return"StrictMode";case ae:return"Suspense";case ne:return"SuspenseList";case ve:return"Activity";case B:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case O:return"Portal";case te:return t.displayName||"Context";case re:return(t._context.displayName||"Context")+".Consumer";case M:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case xe:return n=t.displayName||null,n!==null?n:Pe(t.type)||"Memo";case _:n=t._payload,t=t._init;try{return Pe(t(n))}catch{}}return null}var Fe=Array.isArray,Se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},be=[],je=-1;function Oe(t){return{current:t}}function ot(t){0>je||(t.current=be[je],be[je]=null,je--)}function Ve(t,n){je++,be[je]=t.current,t.current=n}var jt=Oe(null),fn=Oe(null),$t=Oe(null),ue=Oe(null);function qe(t,n){switch(Ve($t,n),Ve(fn,t),Ve(jt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?n1(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=n1(n),t=i1(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ot(jt),Ve(jt,t)}function ht(){ot(jt),ot(fn),ot($t)}function xt(t){var n=t.memoizedState;n!==null&&(Vs._currentValue=n.memoizedState,Ve(ue,t)),n=jt.current;var s=i1(n,t.type);n!==s&&(Ve(fn,t),Ve(jt,s))}function on(t){fn.current===t&&(ot(jt),ot(fn)),ue.current===t&&(ot(ue),Vs._currentValue=K)}var ie,we;function He(t){if(ie===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ie=n&&n[1]||"",we=-1<s.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ie+t+we}var Qe=!1;function Zt(t,n){if(!t||Qe)return"";Qe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={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(Ne){var Y=Ne}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(Ne){Y=Ne}oe=!1;try{var W=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),oe=!0,new t}finally{oe&&(W!==void 0?Object.defineProperty(t.prototype,"props",W):delete t.prototype.props)}}}else{try{throw Error()}catch(Ne){Y=Ne}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(Ne){if(Ne&&Y&&typeof Ne.stack=="string")return[Ne.stack,Y.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),w=m[0],N=m[1];if(w&&N){var I=w.split(`
|
|
4
|
+
`),X=N.split(`
|
|
5
|
+
`);for(f=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;f<X.length&&!X[f].includes("DetermineComponentFrameRoot");)f++;if(o===I.length||f===X.length)for(o=I.length-1,f=X.length-1;1<=o&&0<=f&&I[o]!==X[f];)f--;for(;1<=o&&0<=f;o--,f--)if(I[o]!==X[f]){if(o!==1||f!==1)do if(o--,f--,0>f||I[o]!==X[f]){var J=`
|
|
6
|
+
`+I[o].replace(" at new "," at ");return t.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",t.displayName)),J}while(1<=o&&0<=f);break}}}finally{Qe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?He(s):""}function Et(t,n){switch(t.tag){case 26:case 27:case 5:return He(t.type);case 16:return He("Lazy");case 13:return t.child!==n&&n!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("SuspenseList");case 0:case 15:return Zt(t.type,!1);case 11:return Zt(t.type.render,!1);case 1:return Zt(t.type,!0);case 31:return He("Activity");case 30:return He("ViewTransition");default:return""}}function cn(t){try{var n="",s=null;do n+=Et(t,s),s=t,t=t.return;while(t);return n}catch(o){return`
|
|
7
|
+
Error generating stack: `+o.message+`
|
|
8
|
+
`+o.stack}}var yn=Object.prototype.hasOwnProperty,Ni=e.unstable_scheduleCallback,Ei=e.unstable_cancelCallback,oa=e.unstable_shouldYield,za=e.unstable_requestPaint,Qt=e.unstable_now,pn=e.unstable_getCurrentPriorityLevel,Si=e.unstable_ImmediatePriority,zn=e.unstable_UserBlockingPriority,_i=e.unstable_NormalPriority,F=e.unstable_LowPriority,de=e.unstable_IdlePriority,Te=e.log,We=e.unstable_setDisableYieldValue,Dt=null,pt=null;function Ae(t){if(typeof Te=="function"&&We(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Dt,t)}catch{}}var _e=Math.clz32?Math.clz32:qt,Ke=Math.log,Wt=Math.LN2;function qt(t){return t>>>=0,t===0?32:31-(Ke(t)/Wt|0)|0}var Hi=256,La=262144,Ia=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 Ua(t,n,s){var o=t.pendingLanes;if(o===0)return 0;var f=0,m=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var N=o&134217727;return N!==0?(o=N&~m,o!==0?f=ca(o):(w&=N,w!==0?f=ca(w):s||(s=N&~t,s!==0&&(f=ca(s))))):(N=o&~m,N!==0?f=ca(N):w!==0?f=ca(w):s||(s=o&~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 Nr(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Vo(t,n){(n&8)!==0&&(n|=n&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=n;0<s;){var o=31-_e(s),f=1<<o;n|=t[o],s&=~f}return n}function Id(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 vl(){var t=Ia;return Ia<<=1,(Ia&62914560)===0&&(Ia=4194304),t}function Ba(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function Er(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ud(t,n,s,o,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 N=t.entanglements,I=t.expirationTimes,X=t.hiddenUpdates;for(s=w&~s;0<s;){var J=31-_e(s),oe=1<<J;N[J]=0,I[J]=-1;var Y=X[J];if(Y!==null)for(X[J]=null,J=0;J<Y.length;J++){var W=Y[J];W!==null&&(W.lane&=-536870913)}s&=~oe}o!==0&&Ko(t,o,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 o=31-_e(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function Ti(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var o=31-_e(s),f=1<<o;f&n|t[o]&n&&(t[o]|=n),s&=~f}}function wl(t,n){var s=n&-n;return s=(s&42)!==0?1:os(s),(s&(t.suspendedLanes|n))!==0?0:s}function os(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 kl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Xo(){var t=H.p;return t!==0?t:(t=window.event,t===void 0?32:$1(t.type))}function Zo(t,n){var s=H.p;try{return H.p=t,n()}finally{H.p=s}}var Hn=Math.random().toString(36).slice(2),un="__reactFiber$"+Hn,ge="__reactProps$"+Hn,Ie="__reactContainer$"+Hn,lt="__reactEvents$"+Hn,At="__reactListeners$"+Hn,Kt="__reactHandles$"+Hn,Fn="__reactResources$"+Hn,qn="__reactMarker$"+Hn,ua="__reactLoad$"+Hn;function mn(t){delete t[un],delete t[ge],delete t[At],delete t[Kt]}function hn(t){var n;if(n=t[un])return n;for(var s=t.parentNode;s;){if(n=s[Ie]||s[un]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=v1(t);t!==null;){if(s=t[un])return s;t=v1(t)}return n}t=s,s=t.parentNode}return null}function da(t){if(t=t[un]||t[Ie]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function $a(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 Qo(t){t[ua]=void 0}var Wo=new Set,Jo={};function ci(t,n){pa(t,n),pa(t+"Capture",n)}function pa(t,n){for(Jo[t]=n,t=0;t<n.length;t++)Wo.add(n[t])}var ui=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]*$"),ec={},cs={};function et(t){return yn.call(cs,t)?!0:yn.call(ec,t)?!1:ui.test(t)?cs[t]=!0:(ec[t]=!0,!1)}var mt=!1;function en(){var t=mt;return mt=!1,t}function yt(t,n,s){if(et(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="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 vn(t,n,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,o)}}function wn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function us(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ce(t,n,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,m=o.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:o.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ue(t){if(!t._valueTracker){var n=us(t)?"checked":"value";t._valueTracker=Ce(t,n,""+t[n])}}function nt(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),o="";return t&&(o=us(t)?t.checked?"true":"false":t.value),t=o,t!==s?(n.setValue(t),!0):!1}var vt=/[\n"\\]/g;function St(t){return t.replace(vt,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Jn(t,n,s,o,f,m,w,N){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=""+wn(n)):t.value!==""+wn(n)&&(t.value=""+wn(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?w==="number"&&t.value==n?Nl(t,wn(t.value)):Nl(t,wn(n)):s!=null?Nl(t,wn(s)):o!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.name=""+wn(N):t.removeAttribute("name")}function tc(t,n,s,o,f,m,w,N){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)){Ue(t);return}s=s!=null?""+wn(s):"",n=n!=null?""+wn(n):s,N||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=N?t.checked:!!o,t.defaultChecked=!!o,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),Ue(t)}function Nl(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function ds(t,n,s,o){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&&o&&(t[s].defaultSelected=!0)}else{for(s=""+wn(s),n=null,f=0;f<t.length;f++){if(t[f].value===s){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function Yg(t,n,s){if(n!=null&&(n=""+wn(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+wn(s):""}function Vg(t,n,s,o){if(n==null){if(o!=null){if(s!=null)throw Error(r(92));if(Fe(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),n=s}s=wn(n),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Ue(t)}function fs(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var gE=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 Kg(t,n,s){var o=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,s):typeof s!="number"||s===0||gE.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Xg(t,n,s){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="",mt=!0);for(var f in n)o=n[f],n.hasOwnProperty(f)&&s[f]!==o&&(Kg(t,f,o),mt=!0)}else for(var m in n)n.hasOwnProperty(m)&&Kg(t,m,n[m])}function Bd(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 xE=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"]]),bE=/^[\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 nc(t){return bE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Fi(){}var $d=null;function Pd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ps=null,ms=null;function Zg(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="'+St(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var o=s[n];if(o!==t&&o.form===t.form){var f=o[ge]||null;if(!f)throw Error(r(90));Jn(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)o=s[n],o.form===t.form&&nt(o)}break e;case"textarea":Yg(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&ds(t,!!s.multiple,n,!1)}}}var Hd=!1;function Qg(t,n,s){if(Hd)return t(n,s);Hd=!0;try{var o=t(n);return o}finally{if(Hd=!1,(ps!==null||ms!==null)&&(nu(),ps&&(n=ps,t=ms,ms=ps=null,Zg(n),t)))for(n=0;n<t.length;n++)Zg(t[n])}}function El(t,n){var s=t.stateNode;if(s===null)return null;var o=s[ge]||null;if(o===null)return null;s=o[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":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;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"),Fd=!1;if(ha)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){Fd=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{Fd=!1}var Pa=null,qd=null,ic=null;function Wg(){if(ic)return ic;var t,n=qd,s=n.length,o,f="value"in Pa?Pa.value:Pa.textContent,m=f.length;for(t=0;t<s&&n[t]===f[t];t++);var w=s-t;for(o=1;o<=w&&n[s-o]===f[m-o];o++);return ic=f.slice(t,1<o?1-o:void 0)}function ac(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 rc(){return!0}function Jg(){return!1}function Ln(t){function n(s,o,f,m,w){this._reactName=s,this._targetInst=f,this.type=o,this.nativeEvent=m,this.target=w,this.currentTarget=null;for(var N in t)t.hasOwnProperty(N)&&(s=t[N],this[N]=s?s(m):m[N]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?rc:Jg,this.isPropagationStopped=Jg,this}return C(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=rc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=rc)},persist:function(){},isPersistent:rc}),n}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sc=Ln(Ha),_l=C({},Ha,{view:0,detail:0}),yE=Ln(_l),Gd,Yd,Tl,lc=C({},_l,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kd,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!==Tl&&(Tl&&t.type==="mousemove"?(Gd=t.screenX-Tl.screenX,Yd=t.screenY-Tl.screenY):Yd=Gd=0,Tl=t),Gd)},movementY:function(t){return"movementY"in t?t.movementY:Yd}}),ex=Ln(lc),vE=C({},lc,{dataTransfer:0}),wE=Ln(vE),kE=C({},_l,{relatedTarget:0}),Vd=Ln(kE),NE=C({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),EE=Ln(NE),SE=C({},Ha,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),_E=Ln(SE),TE=C({},Ha,{data:0}),tx=Ln(TE),CE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jE={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"},AE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OE(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=AE[t])?!!n[t]:!1}function Kd(){return OE}var ME=C({},_l,{key:function(t){if(t.key){var n=CE[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=ac(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?jE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kd,charCode:function(t){return t.type==="keypress"?ac(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ac(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),RE=Ln(ME),DE=C({},lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nx=Ln(DE),zE=C({},Ha,{submitter:0}),LE=Ln(zE),IE=C({},_l,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kd}),UE=Ln(IE),BE=C({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),$E=Ln(BE),PE=C({},lc,{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}),HE=Ln(PE),FE=C({},Ha,{newState:0,oldState:0,source:0}),qE=Ln(FE),GE=[9,13,27,32],Xd=ha&&"CompositionEvent"in window,Cl=null;ha&&"documentMode"in document&&(Cl=document.documentMode);var YE=ha&&"TextEvent"in window&&!Cl,ix=ha&&(!Xd||Cl&&8<Cl&&11>=Cl),ax=" ",rx=!1;function sx(t,n){switch(t){case"keyup":return GE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var hs=!1;function VE(t,n){switch(t){case"compositionend":return lx(n);case"keypress":return n.which!==32?null:(rx=!0,ax);case"textInput":return t=n.data,t===ax&&rx?null:t;default:return null}}function KE(t,n){if(hs)return t==="compositionend"||!Xd&&sx(t,n)?(t=Wg(),ic=qd=Pa=null,hs=!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 ix&&n.locale!=="ko"?null:n.data;default:return null}}var XE={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 ox(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!XE[t.type]:n==="textarea"}function cx(t,n,s,o){ps?ms?ms.push(o):ms=[o]:ps=o,n=ou(n,"onChange"),0<n.length&&(s=new sc("onChange","change",null,s,o),t.push({event:s,listeners:n}))}var jl=null,Al=null;function ZE(t){Zy(t,0)}function oc(t){var n=$a(t);if(nt(n))return t}function ux(t,n){if(t==="change")return n}var dx=!1;if(ha){var Zd;if(ha){var Qd="oninput"in document;if(!Qd){var fx=document.createElement("div");fx.setAttribute("oninput","return;"),Qd=typeof fx.oninput=="function"}Zd=Qd}else Zd=!1;dx=Zd&&(!document.documentMode||9<document.documentMode)}function px(){jl&&(jl.detachEvent("onpropertychange",mx),Al=jl=null)}function mx(t){if(t.propertyName==="value"&&oc(Al)){var n=[];cx(n,Al,t,Pd(t)),Qg(ZE,n)}}function QE(t,n,s){t==="focusin"?(px(),jl=n,Al=s,jl.attachEvent("onpropertychange",mx)):t==="focusout"&&px()}function WE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oc(Al)}function JE(t,n){if(t==="click")return oc(n)}function eS(t,n){if(t==="input"||t==="change")return oc(n)}function tS(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var ei=typeof Object.is=="function"?Object.is:tS;function Ol(t,n){if(ei(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),o=Object.keys(n);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var f=s[o];if(!yn.call(n,f)||!ei(t[f],n[f]))return!1}return!0}function Wd(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 hx(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function gx(t,n){var s=hx(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=n&&o>=n)return{node:s,offset:n-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=hx(s)}}function xx(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?xx(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function bx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Wd(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=Wd(t.document)}return n}function Jd(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 nS=ha&&"documentMode"in document&&11>=document.documentMode,gs=null,ef=null,Ml=null,tf=!1;function yx(t,n,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;tf||gs==null||gs!==Wd(o)||(o=gs,"selectionStart"in o&&Jd(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ml&&Ol(Ml,o)||(Ml=o,o=ou(ef,"onSelect"),0<o.length&&(n=new sc("onSelect","select",null,n,s),t.push({event:n,listeners:o}),n.target=gs)))}function Sr(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var xs={animationend:Sr("Animation","AnimationEnd"),animationiteration:Sr("Animation","AnimationIteration"),animationstart:Sr("Animation","AnimationStart"),transitionrun:Sr("Transition","TransitionRun"),transitionstart:Sr("Transition","TransitionStart"),transitioncancel:Sr("Transition","TransitionCancel"),transitionend:Sr("Transition","TransitionEnd")},nf={},vx={};ha&&(vx=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function _r(t){if(nf[t])return nf[t];if(!xs[t])return t;var n=xs[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in vx)return nf[t]=n[s];return t}var wx=_r("animationend"),kx=_r("animationiteration"),Nx=_r("animationstart"),iS=_r("transitionrun"),aS=_r("transitionstart"),rS=_r("transitioncancel"),Ex=_r("transitionend"),Sx=new Map,af="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(" ");af.push("scrollEnd");function Ci(t,n){Sx.set(t,n),ci(n,[t])}var sS=0;function ga(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=Mi.identifierPrefix;var s=sS++;return t="_"+t+"t_"+s.toString(32)+"_",n.autoName=t}function _x(t){if(t==null||typeof t=="string")return t;var n=null,s=Is;if(s!==null)for(var o=0;o<s.length;o++){var f=t[s[o]];if(f!=null){if(f==="none")return"none";n=n==null?f:n+(" "+f)}}return n??t.default}function xa(t,n){return t=_x(t),n=_x(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var cc=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)},di=[],bs=0,rf=0;function uc(){for(var t=bs,n=rf=bs=0;n<t;){var s=di[n];di[n++]=null;var o=di[n];di[n++]=null;var f=di[n];di[n++]=null;var m=di[n];if(di[n++]=null,o!==null&&f!==null){var w=o.pending;w===null?f.next=f:(f.next=w.next,w.next=f),o.pending=f}m!==0&&Tx(s,f,m)}}function dc(t,n,s,o){di[bs++]=t,di[bs++]=n,di[bs++]=s,di[bs++]=o,rf|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function sf(t,n,s,o){return dc(t,n,s,o),fc(t)}function Tr(t,n){return dc(t,null,null,n),fc(t)}function Tx(t,n,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var f=!1,m=t.return;m!==null;)m.childLanes|=s,o=m.alternate,o!==null&&(o.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-_e(s),t=m.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=s|536870912),m):null}function fc(t){if(50<eo)throw eo=0,tu=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ys={};function lS(t,n,s,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(t,n,s,o){return new lS(t,n,s,o)}function lf(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 Cx(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 pc(t,n,s,o,f,m){var w=0;if(o=t,typeof o=="function")lf(o)&&(w=1);else if(typeof o=="string")w=z_(t,s,jt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(o){case ve:return t=Gn(31,s,n,f),t.elementType=ve,t.lanes=m,t;case $:return Cr(s.children,f,m,n);case Z:w=8,f|=24;break;case fe:return t=Gn(12,s,n,f|2),t.elementType=fe,t.lanes=m,t;case ae:return t=Gn(13,s,n,f),t.elementType=ae,t.lanes=m,t;case ne:return t=Gn(19,s,n,f),t.elementType=ne,t.lanes=m,t;case ce:case B:return t=f|32,t=Gn(30,s,n,t),t.elementType=B,t.lanes=m,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case te:w=10;break e;case re:w=9;break e;case M:w=11;break e;case xe:w=14;break e;case _:w=16,o=null;break e}w=29,s=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=Gn(w,s,n,f),n.elementType=t,n.type=o,n.lanes=m,n}function Cr(t,n,s,o){return t=Gn(7,t,o,n),t.lanes=s,t}function of(t,n,s){return t=Gn(6,t,null,n),t.lanes=s,t}function jx(t){var n=Gn(18,null,null,0);return n.stateNode=t,n}function cf(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 Ax=new WeakMap;function fi(t,n){if(typeof t=="object"&&t!==null){var s=Ax.get(t);return s!==void 0?s:(n={value:t,source:n,stack:cn(n)},Ax.set(t,n),n)}return{value:t,source:n,stack:cn(n)}}var vs=[],ws=0,mc=null,Rl=0,pi=[],mi=0,Fa=null,qi=1,Gi="";function ya(t,n){vs[ws++]=Rl,vs[ws++]=mc,mc=t,Rl=n}function Ox(t,n,s){pi[mi++]=qi,pi[mi++]=Gi,pi[mi++]=Fa,Fa=t;var o=qi;t=Gi;var f=32-_e(o)-1;o&=~(1<<f),s+=1;var m=32-_e(n)+f;if(30<m){var w=f-f%5;m=(o&(1<<w)-1).toString(32),o>>=w,f-=w,qi=1<<32-_e(n)+f|s<<f|o,Gi=m+t}else qi=1<<m|s<<f|o,Gi=t}function hc(t){t.return!==null&&(ya(t,1),Ox(t,1,0))}function uf(t){for(;t===mc;)mc=vs[--ws],vs[ws]=null,Rl=vs[--ws],vs[ws]=null;for(;t===Fa;)Fa=pi[--mi],pi[mi]=null,Gi=pi[--mi],pi[mi]=null,qi=pi[--mi],pi[mi]=null}function Mx(t,n){pi[mi++]=qi,pi[mi++]=Gi,pi[mi++]=Fa,qi=n.id,Gi=n.overflow,Fa=t}var gn=null,Ut=null,rt=!1,qa=null,hi=!1,df=Error(r(519));function Ga(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Dl(fi(n,t)),df}function Rx(t){var n=t.stateNode,s=t.type,o=t.memoizedProps;switch(n[un]=t,n[ge]=o,s){case"dialog":ut("cancel",n),ut("close",n);break;case"iframe":case"object":case"embed":ut("load",n);break;case"video":case"audio":for(s=0;s<no.length;s++)ut(no[s],n);break;case"source":ut("error",n);break;case"img":case"image":case"link":ut("error",n),ut("load",n);break;case"details":ut("toggle",n);break;case"input":ut("invalid",n),tc(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":ut("invalid",n);break;case"textarea":ut("invalid",n),Vg(n,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||o.suppressHydrationWarning===!0||e1(n.textContent,s)?(o.popover!=null&&(ut("beforetoggle",n),ut("toggle",n)),o.onScroll!=null&&ut("scroll",n),o.onScrollEnd!=null&&ut("scrollend",n),o.onClick!=null&&(n.onclick=Fi),n=!0):n=!1,n||Ga(t,!0)}function gc(t){for(gn=t.return;gn;)switch(gn.tag){case 5:case 31:case 13:hi=!1;return;case 27:case 3:hi=!0;return;default:gn=gn.return}}function ks(t){if(t!==gn)return!1;if(!rt)return gc(t),rt=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Pp(t.type,t.memoizedProps)),s=!s),s&&Ut&&Ga(t),gc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Ut=y1(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Ut=y1(t)}else n===27?(n=Ut,lr(t.type)?(t=Zp,Zp=null,Ut=t):Ut=n):Ut=gn?xi(t.stateNode.nextSibling):null;return!0}function jr(){Ut=gn=null,rt=!1}function ff(){var t=qa;return t!==null&&(Kn===null?Kn=t:Kn.push.apply(Kn,t),qa=null),t}function Dl(t){qa===null?qa=[t]:qa.push(t)}var pf=Oe(null),Ar=null,va=null;function Ya(t,n,s){Ve(pf,n._currentValue),n._currentValue=s}function wa(t){t._currentValue=pf.current,ot(pf)}function xc(t,n,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===s)break;t=t.return}}function mf(t,n,s,o){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 N=m;m=f;for(var I=0;I<n.length;I++)if(N.context===n[I]){m.lanes|=s,N=m.alternate,N!==null&&(N.lanes|=s),xc(m.return,s,t),o||(w=null);break e}m=N.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),xc(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),xc(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 Or(t,n,s,o){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 N=f.type;ei(f.pendingProps.value,w.value)||(t!==null?t.push(N):t=[N])}}else if(f===ue.current){if(w=f.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Vs):t=[Vs])}f=f.return}return t!==null&&mf(n,t,s,o),n.flags|=262144,t!==null}function bc(t){for(t=t.firstContext;t!==null;){if(!ei(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Mr(t){Ar=t,va=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kn(t){return Dx(Ar,t)}function yc(t,n){return Ar===null&&Mr(t),Dx(t,n)}function Dx(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 oS=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},cS=e.unstable_scheduleCallback,uS=e.unstable_NormalPriority,tn={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hf(){return{controller:new oS,data:new Map,refCount:0}}function zl(t){t.refCount--,t.refCount===0&&cS(uS,function(){t.controller.abort()})}function zx(t,n){if((t.pendingLanes&4194048)!==0){var s=t.transitionTypes;for(s===null&&(s=t.transitionTypes=[]),t=0;t<n.length;t++){var o=n[t];s.indexOf(o)===-1&&s.push(o)}}}var Ll=null;function dS(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Il=null,gf=0,Rr=0,Ns=null;function fS(t,n){if(Il===null){var s=Il=[];gf=0,Rr=Mp(),Ns={status:"pending",value:void 0,then:function(o){s.push(o)}}}return gf++,n.then(Lx,Lx),n}function Lx(){if(--gf===0&&(Ll=null,Il!==null)){Ns!==null&&(Ns.status="fulfilled");var t=Il;Il=null,Rr=0,Ns=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function pS(t,n){var s=[],o={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),o}var Ix=Se.S;Se.S=function(t,n){if(jy=Qt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&fS(t,n),Ll!==null)for(var s=Ps;s!==null;)zx(s,Ll),s=s.next;if(s=t.types,s!==null){for(var o=Ps;o!==null;)zx(o,s),o=o.next;if(Rr!==0){o=Ll,o===null&&(o=Ll=[]);for(var f=0;f<s.length;f++){var m=s[f];o.indexOf(m)===-1&&o.push(m)}}}Ix!==null&&Ix(t,n)};var Dr=Oe(null);function xf(){var t=Dr.current;return t!==null?t:zt.pooledCache}function vc(t,n){n===null?Ve(Dr,Dr.current):Ve(Dr,n.pool)}function Ux(){var t=xf();return t===null?null:{parent:tn._currentValue,pool:t}}var Es=Error(r(460)),bf=Error(r(474)),wc=Error(r(542)),kc={then:function(){}};function Bx(t){return t=t.status,t==="fulfilled"||t==="rejected"}function $x(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Fi,Fi),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Hx(t),t===void 0&&!("reason"in n)?Error(r(600)):t;default:if(typeof n.status=="string")n.then(Fi,Fi);else{if(t=zt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Hx(t),t}throw Lr=n,Es}}function zr(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Lr=s,Es):s}}var Lr=null;function Px(){if(Lr===null)throw Error(r(459));var t=Lr;return Lr=null,t}function Hx(t){if(t===Es||t===wc)throw Error(r(483))}var Ss=null,Ul=0;function Nc(t){var n=Ul;return Ul+=1,Ss===null&&(Ss=[]),$x(Ss,t,n)}function Va(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Ec(t,n){throw n.$$typeof===L?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Fx(t){function n(V,q){if(t){var Q=V.deletions;Q===null?(V.deletions=[q],V.flags|=16):Q.push(q)}}function s(V,q){if(!t)return null;for(;q!==null;)n(V,q),q=q.sibling;return null}function o(V){for(var q=new Map;V!==null;)V.key===null?q.set(V.index,V):q.set(V.key,V),V=V.sibling;return q}function f(V,q){return V=ba(V,q),V.index=0,V.sibling=null,V}function m(V,q,Q){return V.index=Q,t?(Q=V.alternate,Q!==null?(Q=Q.index,Q<q?(V.flags|=2,q):Q):(V.flags|=134217730,q)):(V.flags|=1048576,q)}function w(V){return t&&V.alternate===null&&(V.flags|=134217730),V}function N(V,q,Q,le){return q===null||q.tag!==6?(q=of(Q,V.mode,le),q.return=V,q):(q=f(q,Q),q.return=V,q)}function I(V,q,Q,le){var Me=Q.type;return Me===$?(V=J(V,q,Q.props.children,le,Q.key),Va(V,Q),V):q!==null&&(q.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===_&&zr(Me)===q.type)?(q=f(q,Q.props),Va(q,Q),q.return=V,q):(q=pc(Q.type,Q.key,Q.props,null,V.mode,le),Va(q,Q),q.return=V,q)}function X(V,q,Q,le){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=cf(Q,V.mode,le),q.return=V,q):(q=f(q,Q.children||[]),q.return=V,q)}function J(V,q,Q,le,Me){return q===null||q.tag!==7?(q=Cr(Q,V.mode,le,Me),q.return=V,q):(q=f(q,Q),q.return=V,q)}function oe(V,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=of(""+q,V.mode,Q),q.return=V,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case G:return Q=pc(q.type,q.key,q.props,null,V.mode,Q),Va(Q,q),Q.return=V,Q;case O:return q=cf(q,V.mode,Q),q.return=V,q;case _:return q=zr(q),oe(V,q,Q)}if(Fe(q)||Ee(q))return q=Cr(q,V.mode,Q,null),q.return=V,q;if(typeof q.then=="function")return oe(V,Nc(q),Q);if(q.$$typeof===te)return oe(V,yc(V,q),Q);Ec(V,q)}return null}function Y(V,q,Q,le){var Me=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Me!==null?null:N(V,q,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case G:return Q.key===Me?I(V,q,Q,le):null;case O:return Q.key===Me?X(V,q,Q,le):null;case _:return Q=zr(Q),Y(V,q,Q,le)}if(Fe(Q)||Ee(Q))return Me!==null?null:J(V,q,Q,le,null);if(typeof Q.then=="function")return Y(V,q,Nc(Q),le);if(Q.$$typeof===te)return Y(V,q,yc(V,Q),le);Ec(V,Q)}return null}function W(V,q,Q,le,Me){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return V=V.get(Q)||null,N(q,V,""+le,Me);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case G:return V=V.get(le.key===null?Q:le.key)||null,I(q,V,le,Me);case O:return V=V.get(le.key===null?Q:le.key)||null,X(q,V,le,Me);case _:return le=zr(le),W(V,q,Q,le,Me)}if(Fe(le)||Ee(le))return V=V.get(Q)||null,J(q,V,le,Me,null);if(typeof le.then=="function")return W(V,q,Q,Nc(le),Me);if(le.$$typeof===te)return W(V,q,Q,yc(q,le),Me);Ec(q,le)}return null}function Ne(V,q,Q,le){for(var Me=null,ft=null,$e=q,Ye=q=0,rn=null;$e!==null&&Ye<Q.length;Ye++){$e.index>Ye?(rn=$e,$e=null):rn=$e.sibling;var gt=Y(V,$e,Q[Ye],le);if(gt===null){$e===null&&($e=rn);break}t&&$e&>.alternate===null&&n(V,$e),q=m(gt,q,Ye),ft===null?Me=gt:ft.sibling=gt,ft=gt,$e=rn}if(Ye===Q.length)return s(V,$e),rt&&ya(V,Ye),Me;if($e===null){for(;Ye<Q.length;Ye++)$e=oe(V,Q[Ye],le),$e!==null&&(q=m($e,q,Ye),ft===null?Me=$e:ft.sibling=$e,ft=$e);return rt&&ya(V,Ye),Me}for($e=o($e);Ye<Q.length;Ye++)rn=W($e,V,Ye,Q[Ye],le),rn!==null&&(t&&(gt=rn.alternate,gt!==null&&$e.delete(gt.key===null?Ye:gt.key)),q=m(rn,q,Ye),ft===null?Me=rn:ft.sibling=rn,ft=rn);return t&&$e.forEach(function(fr){return n(V,fr)}),rt&&ya(V,Ye),Me}function De(V,q,Q,le){if(Q==null)throw Error(r(151));for(var Me=null,ft=null,$e=q,Ye=q=0,rn=null,gt=Q.next();$e!==null&&!gt.done;Ye++,gt=Q.next()){$e.index>Ye?(rn=$e,$e=null):rn=$e.sibling;var fr=Y(V,$e,gt.value,le);if(fr===null){$e===null&&($e=rn);break}t&&$e&&fr.alternate===null&&n(V,$e),q=m(fr,q,Ye),ft===null?Me=fr:ft.sibling=fr,ft=fr,$e=rn}if(gt.done)return s(V,$e),rt&&ya(V,Ye),Me;if($e===null){for(;!gt.done;Ye++,gt=Q.next())gt=oe(V,gt.value,le),gt!==null&&(q=m(gt,q,Ye),ft===null?Me=gt:ft.sibling=gt,ft=gt);return rt&&ya(V,Ye),Me}for($e=o($e);!gt.done;Ye++,gt=Q.next())gt=W($e,V,Ye,gt.value,le),gt!==null&&(t&&(rn=gt.alternate,rn!==null&&$e.delete(rn.key===null?Ye:rn.key)),q=m(gt,q,Ye),ft===null?Me=gt:ft.sibling=gt,ft=gt);return t&&$e.forEach(function(V_){return n(V,V_)}),rt&&ya(V,Ye),Me}function at(V,q,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 G:e:{for(var Me=Q.key;q!==null;){if(q.key===Me){if(Me=Q.type,Me===$){if(q.tag===7){s(V,q.sibling),le=f(q,Q.props.children),Va(le,Q),le.return=V,V=le;break e}}else if(q.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===_&&zr(Me)===q.type){s(V,q.sibling),le=f(q,Q.props),Va(le,Q),le.return=V,V=le;break e}s(V,q);break}else n(V,q);q=q.sibling}Q.type===$?(le=Cr(Q.props.children,V.mode,le,Q.key),Va(le,Q),le.return=V,V=le):(le=pc(Q.type,Q.key,Q.props,null,V.mode,le),Va(le,Q),le.return=V,V=le)}return w(V);case O:e:{for(Me=Q.key;q!==null;){if(q.key===Me)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){s(V,q.sibling),le=f(q,Q.children||[]),le.return=V,V=le;break e}else{s(V,q);break}else n(V,q);q=q.sibling}le=cf(Q,V.mode,le),le.return=V,V=le}return w(V);case _:return Q=zr(Q),at(V,q,Q,le)}if(Fe(Q))return Ne(V,q,Q,le);if(Ee(Q)){if(Me=Ee(Q),typeof Me!="function")throw Error(r(150));return Q=Me.call(Q),De(V,q,Q,le)}if(typeof Q.then=="function")return at(V,q,Nc(Q),le);if(Q.$$typeof===te)return at(V,q,yc(V,Q),le);Ec(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,q!==null&&q.tag===6?(s(V,q.sibling),le=f(q,Q),le.return=V,V=le):(s(V,q),le=of(Q,V.mode,le),le.return=V,V=le),w(V)):s(V,q)}return function(V,q,Q,le){try{Ul=0;var Me=at(V,q,Q,le);return Ss=null,Me}catch($e){if($e===Es||$e===wc)throw $e;var ft=Gn(29,$e,null,V.mode);return ft.lanes=le,ft.return=V,ft}}}var Ir=Fx(!0),qx=Fx(!1),Ka=!1;function yf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vf(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 Xa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Za(t,n,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(wt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=fc(t),Tx(t,null,s),n}return dc(t,o,n,s),fc(t)}function Bl(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,s|=o,n.lanes=s,Ti(t,s)}}function wf(t,n){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){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:o.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var kf=!1;function $l(){if(kf){var t=Ns;if(t!==null)throw t}}function Pl(t,n,s,o){kf=!1;var f=t.updateQueue;Ka=!1;var m=f.firstBaseUpdate,w=f.lastBaseUpdate,N=f.shared.pending;if(N!==null){f.shared.pending=null;var I=N,X=I.next;I.next=null,w===null?m=X:w.next=X,w=I;var J=t.alternate;J!==null&&(J=J.updateQueue,N=J.lastBaseUpdate,N!==w&&(N===null?J.firstBaseUpdate=X:N.next=X,J.lastBaseUpdate=I))}if(m!==null){var oe=f.baseState;w=0,J=X=I=null,N=m;do{var Y=N.lane&-536870913,W=Y!==N.lane;if(W?(dt&Y)===Y:(o&Y)===Y){Y!==0&&Y===Rr&&(kf=!0),J!==null&&(J=J.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ne=t,De=N;Y=n;var at=s;switch(De.tag){case 1:if(Ne=De.payload,typeof Ne=="function"){oe=Ne.call(at,oe,Y);break e}oe=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=De.payload,Y=typeof Ne=="function"?Ne.call(at,oe,Y):Ne,Y==null)break e;oe=C({},oe,Y);break e;case 2:Ka=!0}}Y=N.callback,Y!==null&&(t.flags|=64,W&&(t.flags|=8192),W=f.callbacks,W===null?f.callbacks=[Y]:W.push(Y))}else W={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},J===null?(X=J=W,I=oe):J=J.next=W,w|=Y;if(N=N.next,N===null){if(N=f.shared.pending,N===null)break;W=N,N=W.next,W.next=null,f.lastBaseUpdate=W,f.shared.pending=null}}while(!0);J===null&&(I=oe),f.baseState=I,f.firstBaseUpdate=X,f.lastBaseUpdate=J,m===null&&(f.shared.lanes=0),ir|=w,t.lanes=w,t.memoizedState=oe}}function Gx(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Yx(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Gx(s[t],n)}var Qa=Oe(null),Sc=Oe(0);function Vx(t,n){t=_a,Ve(Sc,t),Ve(Qa,n),_a=t|n.baseLanes}function Nf(){Ve(Sc,_a),Ve(Qa,Qa.current)}function Ef(){_a=Sc.current,ot(Qa),ot(Sc)}var Nn=Oe(null),jn=null;function Wa(t){var n=t.alternate;Ve(En,En.current&1),Ve(Nn,t),jn===null&&(n===null||Qa.current!==null||n.memoizedState!==null)&&(jn=t)}function Sf(t){Ve(En,En.current),Ve(Nn,t),jn===null&&(jn=t)}function Kx(t){t.tag===22?(Ve(En,En.current),Ve(Nn,t),jn===null&&(jn=t)):Ja()}function Ja(){Ve(En,En.current),Ve(Nn,Nn.current)}function ti(t){ot(Nn),jn===t&&(jn=null),ot(En)}var En=Oe(0);function Hl(t,n){Ve(Nn,Nn.current),Ve(En,n)}function _f(t){ot(En),ot(Nn),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||Kp(s)||Xp(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,it=null,Ot=null,nn=null,Tc=!1,_s=!1,Ur=!1,Cc=0,Fl=0,Ts=null,mS=0;function Gt(){throw Error(r(321))}function Tf(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!ei(t[s],n[s]))return!1;return!0}function Cf(t,n,s,o,f,m){return ka=m,it=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Se.H=t===null||t.memoizedState===null?Ob:Mb,Ur=!1,m=s(o,f),Ur=!1,_s&&(m=Zx(n,s,o,f)),Xx(t),m}function Xx(t){Se.H=zc;var n=Ot!==null&&Ot.next!==null;if(ka=0,nn=Ot=it=null,Tc=!1,Fl=0,Ts=null,n)throw Error(r(300));t===null||an||(t=t.dependencies,t!==null&&bc(t)&&(an=!0))}function Zx(t,n,s,o){it=t;var f=0;do{if(_s&&(Ts=null),Fl=0,_s=!1,25<=f)throw Error(r(301));if(f+=1,nn=Ot=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}Se.H=kS,m=n(s,o)}while(_s);return m}function hS(){var t=Se.H,n=t.useState()[0];return n=typeof n.then=="function"?ql(n):n,t=t.useState()[0],(Ot!==null?Ot.memoizedState:null)!==t&&(it.flags|=1024),n}function jf(){var t=Cc!==0;return Cc=0,t}function Af(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Of(t){if(Tc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Tc=!1}ka=0,nn=Ot=it=null,_s=!1,Fl=Cc=0,Ts=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?it.memoizedState=nn=t:nn=nn.next=t,nn}function Xt(){if(Ot===null){var t=it.alternate;t=t!==null?t.memoizedState:null}else t=Ot.next;var n=nn===null?it.memoizedState:nn.next;if(n!==null)nn=n,Ot=t;else{if(t===null)throw it.alternate===null?Error(r(467)):Error(r(310));Ot=t,t={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},nn===null?it.memoizedState=nn=t:nn=nn.next=t}return nn}function jc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ql(t){var n=Fl;return Fl+=1,Ts===null&&(Ts=[]),t=$x(Ts,t,n),n=it,(nn===null?n.memoizedState:nn.next)===null&&(n=n.alternate,Se.H=n===null||n.memoizedState===null?Ob:Mb),t}function Ac(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ql(t);if(t.$$typeof===se)return;if(t.$$typeof===te)return kn(t)}throw Error(r(438,String(t)))}function Mf(t){var n=null,s=it.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var o=it.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=jc(),it.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),o=0;o<t;o++)s[o]=D;return n.index++,s}function Na(t,n){return typeof n=="function"?n(t):n}function Oc(t){var n=Xt();return Rf(n,Ot,t)}function Rf(t,n,s){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=s;var f=t.baseQueue,m=o.pending;if(m!==null){if(f!==null){var w=f.next;f.next=m.next,m.next=w}n.baseQueue=f=m,o.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{n=f.next;var N=w=null,I=null,X=n,J=!1;do{var oe=X.lane&-536870913;if(oe!==X.lane?(dt&oe)===oe:(ka&oe)===oe){var Y=X.revertLane;if(Y===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),oe===Rr&&(J=!0);else if((ka&Y)===Y){X=X.next,Y===Rr&&(J=!0);continue}else oe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},I===null?(N=I=oe,w=m):I=I.next=oe,it.lanes|=Y,ir|=Y;oe=X.action,Ur&&s(m,oe),m=X.hasEagerState?X.eagerState:s(m,oe)}else Y={lane:oe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},I===null?(N=I=Y,w=m):I=I.next=Y,it.lanes|=oe,ir|=oe;X=X.next}while(X!==null&&X!==n);if(I===null?w=m:I.next=N,!ei(m,t.memoizedState)&&(an=!0,J&&(s=Ns,s!==null)))throw s;t.memoizedState=m,t.baseState=w,t.baseQueue=I,o.lastRenderedState=m}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Df(t){var n=Xt(),s=n.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var o=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);ei(m,n.memoizedState)||(an=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),s.lastRenderedState=m}return[m,o]}function Qx(t,n,s){var o=it,f=Xt(),m=rt;if(m){if(s===void 0)throw Error(r(407));s=s()}else s=n();var w=!ei((Ot||f).memoizedState,s);if(w&&(f.memoizedState=s,an=!0),f=f.queue,If(eb.bind(null,o,f,t),[t]),t=f.getSnapshot!==n||w||nn!==null&&(nn.memoizedState.tag&1)!==0,Cs(t?9:8,{destroy:void 0},Jx.bind(null,o,f,s,n),null),t){if(o.flags|=2048,zt===null)throw Error(r(349));m||(ka&127)!==0||Wx(o,n,s)}return s}function Wx(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=it.updateQueue,n===null?(n=jc(),it.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Jx(t,n,s,o){n.value=s,n.getSnapshot=o,tb(n)&&nb(t)}function eb(t,n,s){return s(function(){tb(n)&&nb(t)})}function tb(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!ei(t,s)}catch{return!0}}function nb(t){var n=Tr(t,2);n!==null&&Xn(n,t,2)}function zf(t){var n=In();if(typeof t=="function"){var s=t;if(t=s(),Ur){Ae(!0);try{s()}finally{Ae(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:t},n}function ib(t,n,s,o){return t.baseState=s,Rf(t,Ot,typeof o=="function"?o:Na)}function gS(t,n,s,o,f){if(Dc(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)}};Se.T!==null?s(!0):m.isTransition=!1,o(m),s=n.pending,s===null?(m.next=n.pending=m,ab(n,m)):(m.next=s.next,n.pending=s.next=m)}}function ab(t,n){var s=n.action,o=n.payload,f=t.state;if(n.isTransition){var m=Se.T,w={};w.types=m!==null?m.types:null,Se.T=w;try{var N=s(f,o),I=Se.S;I!==null&&I(w,N),rb(t,n,N)}catch(X){Lf(t,n,X)}finally{m!==null&&w.types!==null&&(m.types=w.types),Se.T=m}}else try{m=s(f,o),rb(t,n,m)}catch(X){Lf(t,n,X)}}function rb(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){sb(t,n,o)},function(o){return Lf(t,n,o)}):sb(t,n,s)}function sb(t,n,s){n.status="fulfilled",n.value=s,lb(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,ab(t,s)))}function Lf(t,n,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=s,lb(n),n=n.next;while(n!==o)}t.action=null}function lb(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function ob(t,n){return n}function cb(t,n){if(rt){var s=zt.formState;if(s!==null){e:{var o=it;if(rt){if(Ut){t:{for(var f=Ut,m=hi;f.nodeType!==8;){if(!m){f=null;break t}if(f=xi(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Ut=xi(f.nextSibling),o=f.data==="F!";break e}}Ga(o)}o=!1}o&&(n=s[0])}}return s=In(),s.memoizedState=s.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ob,lastRenderedState:n},s.queue=o,s=Cb.bind(null,it,o),o.dispatch=s,o=zf(!1),m=Hf.bind(null,it,!1,o.queue),o=In(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,s=gS.bind(null,it,f,m,s),f.dispatch=s,o.memoizedState=t,[n,s,!1]}function ub(t){var n=Xt();return db(n,Ot,t)}function db(t,n,s){if(n=Rf(t,n,ob)[0],t=Oc(Na)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=ql(n)}catch(w){throw w===Es?wc:w}else o=n;n=Xt();var f=n.queue,m=f.dispatch;return s!==n.memoizedState&&(it.flags|=2048,Cs(9,{destroy:void 0},xS.bind(null,f,s),null)),[o,m,t]}function xS(t,n){t.action=n}function fb(t){var n=Xt(),s=Ot;if(s!==null)return db(n,s,t);Xt(),n=n.memoizedState,s=Xt();var o=s.queue.dispatch;return s.memoizedState=t,[n,o,!1]}function Cs(t,n,s,o){return t={tag:t,create:s,deps:o,inst:n,next:null},n=it.updateQueue,n===null&&(n=jc(),it.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,n.lastEffect=t),t}function pb(){return Xt().memoizedState}function Mc(t,n,s,o){var f=In();it.flags|=t,f.memoizedState=Cs(1|n,{destroy:void 0},s,o===void 0?null:o)}function Rc(t,n,s,o){var f=Xt();o=o===void 0?null:o;var m=f.memoizedState.inst;Ot!==null&&o!==null&&Tf(o,Ot.memoizedState.deps)?f.memoizedState=Cs(n,m,s,o):(it.flags|=t,f.memoizedState=Cs(1|n,m,s,o))}function mb(t,n){Mc(8390656,8,t,n)}function If(t,n){Rc(2048,8,t,n)}function bS(t){it.flags|=4;var n=it.updateQueue;if(n===null)n=jc(),it.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function hb(t){var n=Xt().memoizedState;return bS({ref:n,nextImpl:t}),function(){if((wt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function gb(t,n){return Rc(4,2,t,n)}function xb(t,n){return Rc(4,4,t,n)}function bb(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 yb(t,n,s){s=s!=null?s.concat([t]):null,Rc(4,4,bb.bind(null,n,t),s)}function Uf(){}function vb(t,n){var s=Xt();n=n===void 0?null:n;var o=s.memoizedState;return n!==null&&Tf(n,o[1])?o[0]:(s.memoizedState=[t,n],t)}function wb(t,n){var s=Xt();n=n===void 0?null:n;var o=s.memoizedState;if(n!==null&&Tf(n,o[1]))return o[0];if(o=t(),Ur){Ae(!0);try{t()}finally{Ae(!1)}}return s.memoizedState=[o,n],o}function Bf(t,n,s){return s===void 0||(ka&1073741824)!==0&&(dt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Oy(),it.lanes|=t,ir|=t,s)}function kb(t,n,s,o){return ei(s,n)?s:Qa.current!==null?(t=Bf(t,s,o),ei(t,n)||(an=!0),t):(ka&106)===0||(ka&1073741824)!==0&&(dt&261930)===0?(an=!0,t.memoizedState=s):(t=Oy(),it.lanes|=t,ir|=t,n)}function Nb(t,n,s,o,f){var m=H.p;H.p=m!==0&&8>m?m:8;var w=Se.T,N={};N.types=w!==null?w.types:null,Se.T=N,Hf(t,!1,n,s);try{var I=f(),X=Se.S;if(X!==null&&X(N,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var J=pS(I,o);Gl(t,n,J,ri(t))}else Gl(t,n,o,ri(t))}catch(oe){Gl(t,n,{then:function(){},status:"rejected",reason:oe},ri())}finally{H.p=m,w!==null&&N.types!==null&&(w.types=N.types),Se.T=w}}function yS(){}function $f(t,n,s,o){if(t.tag!==5)throw Error(r(476));var f=Eb(t).queue;Nb(t,f,n,K,s===null?yS:function(){return Sb(t),s(o)})}function Eb(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:K},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Sb(t){var n=Eb(t);n.next===null&&(n=t.alternate.memoizedState),Gl(t,n.next.queue,{},ri())}function Pf(){return kn(Vs)}function _b(){return Xt().memoizedState}function Tb(){return Xt().memoizedState}function vS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=ri();t=Xa(s);var o=Za(n,t,s);o!==null&&(Xn(o,n,s),Bl(o,n,s)),n={cache:hf()},t.payload=n;return}n=n.return}}function wS(t,n,s){var o=ri();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dc(t)?jb(n,s):(s=sf(t,n,s,o),s!==null&&(Xn(s,t,o),Ab(s,n,o)))}function Cb(t,n,s){var o=ri();Gl(t,n,s,o)}function Gl(t,n,s,o){var f={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Dc(t))jb(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,N=m(w,s);if(f.hasEagerState=!0,f.eagerState=N,ei(N,w))return dc(t,n,f,0),zt===null&&uc(),!1}catch{}if(s=sf(t,n,f,o),s!==null)return Xn(s,t,o),Ab(s,n,o),!0}return!1}function Hf(t,n,s,o){if(o={lane:2,revertLane:Mp(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Dc(t)){if(n)throw Error(r(479))}else n=sf(t,s,o,2),n!==null&&Xn(n,t,2)}function Dc(t){var n=t.alternate;return t===it||n!==null&&n===it}function jb(t,n){_s=Tc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Ab(t,n,s){if((s&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,s|=o,n.lanes=s,Ti(t,s)}}var zc={readContext:kn,use:Ac,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt,useEffectEvent:Gt},Ob={readContext:kn,use:Ac,useCallback:function(t,n){return In().memoizedState=[t,n===void 0?null:n],t},useContext:kn,useEffect:mb,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,Mc(4194308,4,bb.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Mc(4194308,4,t,n)},useInsertionEffect:function(t,n){Mc(4,2,t,n)},useMemo:function(t,n){var s=In();n=n===void 0?null:n;var o=t();if(Ur){Ae(!0);try{t()}finally{Ae(!1)}}return s.memoizedState=[o,n],o},useReducer:function(t,n,s){var o=In();if(s!==void 0){var f=s(n);if(Ur){Ae(!0);try{s(n)}finally{Ae(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=wS.bind(null,it,t),[o.memoizedState,t]},useRef:function(t){var n=In();return t={current:t},n.memoizedState=t},useState:function(t){t=zf(t);var n=t.queue,s=Cb.bind(null,it,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:Uf,useDeferredValue:function(t,n){var s=In();return Bf(s,t,n)},useTransition:function(){var t=zf(!1);return t=Nb.bind(null,it,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var o=it,f=In();if(rt){if(s===void 0)throw Error(r(407));s=s()}else{if(s=n(),zt===null)throw Error(r(349));(dt&127)!==0||Wx(o,n,s)}f.memoizedState=s;var m={value:s,getSnapshot:n};return f.queue=m,mb(eb.bind(null,o,m,t),[t]),o.flags|=2048,Cs(9,{destroy:void 0},Jx.bind(null,o,m,s,n),null),s},useId:function(){var t=In(),n=zt.identifierPrefix;if(rt){var s=Gi,o=qi;s=(o&~(1<<32-_e(o)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Cc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=mS++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Pf,useFormState:cb,useActionState:cb,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=Hf.bind(null,it,!0,s),s.dispatch=n,[t,n]},useMemoCache:Mf,useCacheRefresh:function(){return In().memoizedState=vS.bind(null,it)},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)}}},Mb={readContext:kn,use:Ac,useCallback:vb,useContext:kn,useEffect:If,useImperativeHandle:yb,useInsertionEffect:gb,useLayoutEffect:xb,useMemo:wb,useReducer:Oc,useRef:pb,useState:function(){return Oc(Na)},useDebugValue:Uf,useDeferredValue:function(t,n){var s=Xt();return kb(s,Ot.memoizedState,t,n)},useTransition:function(){var t=Oc(Na)[0],n=Xt().memoizedState;return[typeof t=="boolean"?t:ql(t),n]},useSyncExternalStore:Qx,useId:_b,useHostTransitionStatus:Pf,useFormState:ub,useActionState:ub,useOptimistic:function(t,n){var s=Xt();return ib(s,Ot,t,n)},useMemoCache:Mf,useCacheRefresh:Tb,useEffectEvent:hb},kS={readContext:kn,use:Ac,useCallback:vb,useContext:kn,useEffect:If,useImperativeHandle:yb,useInsertionEffect:gb,useLayoutEffect:xb,useMemo:wb,useReducer:Df,useRef:pb,useState:function(){return Df(Na)},useDebugValue:Uf,useDeferredValue:function(t,n){var s=Xt();return Ot===null?Bf(s,t,n):kb(s,Ot.memoizedState,t,n)},useTransition:function(){var t=Df(Na)[0],n=Xt().memoizedState;return[typeof t=="boolean"?t:ql(t),n]},useSyncExternalStore:Qx,useId:_b,useHostTransitionStatus:Pf,useFormState:fb,useActionState:fb,useOptimistic:function(t,n){var s=Xt();return Ot!==null?ib(s,Ot,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Mf,useCacheRefresh:Tb,useEffectEvent:hb};function Ff(t,n,s,o){n=t.memoizedState,s=s(o,n),s=s==null?n:C({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var qf={enqueueSetState:function(t,n,s){t=t._reactInternals;var o=ri(),f=Xa(o);f.payload=n,s!=null&&(f.callback=s),n=Za(t,f,o),n!==null&&(Xn(n,t,o),Bl(n,t,o))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var o=ri(),f=Xa(o);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Za(t,f,o),n!==null&&(Xn(n,t,o),Bl(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=ri(),o=Xa(s);o.tag=2,n!=null&&(o.callback=n),n=Za(t,o,s),n!==null&&(Xn(n,t,s),Bl(n,t,s))}};function Rb(t,n,s,o,f,m,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,m,w):n.prototype&&n.prototype.isPureReactComponent?!Ol(s,o)||!Ol(f,m):!0}function Db(t,n,s,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,o),n.state!==t&&qf.enqueueReplaceState(n,n.state,null)}function Br(t,n){var s=n;if("ref"in n){s={};for(var o in n)o!=="ref"&&(s[o]=n[o])}if(t=t.defaultProps){s===n&&(s=C({},s));for(var f in t)s[f]===void 0&&(s[f]=t[f])}return s}function zb(t){cc(t)}function Lb(t){console.error(t)}function Ib(t){cc(t)}function Lc(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Ub(t,n,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Gf(t,n,s){return s=Xa(s),s.tag=3,s.payload={element:null},s.callback=function(){Lc(t,n)},s}function Bb(t){return t=Xa(t),t.tag=3,t}function $b(t,n,s,o){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var m=o.value;t.payload=function(){return f(m)},t.callback=function(){Ub(n,s,o)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){Ub(n,s,o),typeof f!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var N=o.stack;this.componentDidCatch(o.value,{componentStack:N!==null?N:""})})}function NS(t,n,s,o,f){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=s.alternate,n!==null&&Or(n,s,f,!0),s=Nn.current,s!==null){switch(s.tag){case 31:case 13:case 19:return jn===null?iu():s.alternate===null&&Yt===0&&(Yt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,o===kc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([o]):n.add(o),jp(t,o,f)),!1;case 22:return s.flags|=65536,o===kc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([o]):s.add(o)),jp(t,o,f)),!1}throw Error(r(435,s.tag))}return jp(t,o,f),iu(),!1}if(rt)return n=Nn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==df&&(t=Error(r(422),{cause:o}),Dl(fi(t,s)))):(o!==df&&(n=Error(r(423),{cause:o}),Dl(fi(n,s))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=fi(o,s),f=Gf(t.stateNode,o,f),wf(t,f),Yt!==4&&(Yt=2)),!1;var m=Error(r(520),{cause:o});if(m=fi(m,s),Jl===null?Jl=[m]:Jl.push(m),Yt!==4&&(Yt=2),n===null)return!0;o=fi(o,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=f&-f,s.lanes|=t,t=Gf(s.stateNode,o,t),wf(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"&&(ar===null||!ar.has(m))))return s.flags|=65536,f&=-f,s.lanes|=f,f=Bb(f),$b(f,t,s,o),wf(s,f),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var Yf=Error(r(461)),an=!1;function dn(t,n,s,o){n.child=t===null?qx(n,null,s,o):Ir(n,t.child,s,o)}function Pb(t,n,s,o,f){s=s.render;var m=n.ref;if("ref"in o){var w={};for(var N in o)N!=="ref"&&(w[N]=o[N])}else w=o;return Mr(n),o=Cf(t,n,s,w,m,f),N=jf(),t!==null&&!an?(Af(t,n,f),Ea(t,n,f)):(rt&&N&&hc(n),n.flags|=1,dn(t,n,o,f),n.child)}function Hb(t,n,s,o,f){if(t===null){var m=s.type;return typeof m=="function"&&!lf(m)&&m.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=m,Fb(t,n,m,o,f)):(t=pc(s.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,!ep(t,f)){var w=m.memoizedProps;if(s=s.compare,s=s!==null?s:Ol,s(w,o)&&t.ref===n.ref)return Ea(t,n,f)}return n.flags|=1,t=ba(m,o),t.ref=n.ref,t.return=n,n.child=t}function Fb(t,n,s,o,f){if(t!==null){var m=t.memoizedProps;if(Ol(m,o)&&t.ref===n.ref)if(an=!1,n.pendingProps=o=m,ep(t,f))(t.flags&131072)!==0&&(an=!0);else return n.lanes=t.lanes,Ea(t,n,f)}return Vf(t,n,s,o,f)}function qb(t,n,s,o){var f=o.children,m=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~m}else o=0,n.child=null;return Gb(t,n,m,s,o)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&vc(n,m!==null?m.cachePool:null),m!==null?Vx(n,m):Nf(),Kx(n);else return o=n.lanes=536870912,Gb(t,n,m!==null?m.baseLanes|s:s,s,o)}else m!==null?(vc(n,m.cachePool),Vx(n,m),Ja(),n.memoizedState=null):(t!==null&&vc(n,null),Nf(),Ja());return dn(t,n,f,s),n.child}function Yl(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Gb(t,n,s,o,f){var m=xf();return m=m===null?null:{parent:tn._currentValue,pool:m},n.memoizedState={baseLanes:s,cachePool:m},t!==null&&vc(n,null),Nf(),Kx(n),t!==null&&Or(t,n,o,!0),n.childLanes=f,null}function Ic(t,n){return n=Uc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Yb(t,n,s){return Ir(n,t.child,null,s),t=Ic(n,n.pendingProps),t.flags|=2,ti(n),n.memoizedState=null,t}function ES(t,n,s){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(rt){if(o.mode==="hidden")return t=Ic(n,o),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Yl(null,t);if(Sf(n),(t=Ut)?(t=b1(t,hi),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Fa!==null?{id:qi,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},s=jx(t),s.return=n,n.child=s,gn=n,Ut=null)):t=null,t===null)throw Ga(n);return n.lanes=536870912,null}return Ic(n,o)}var m=t.memoizedState;if(m!==null){var w=m.dehydrated;if(Sf(n),f)if(n.flags&256)n.flags&=-257,n=Yb(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(an||Or(t,n,s,!1),f=(s&t.childLanes)!==0,an||f){if(Qa.current===null){if(o=zt,o!==null&&(w=wl(o,s),w!==0&&w!==m.retryLane))throw m.retryLane=w,Tr(t,w),Xn(o,t,w),Yf;iu()}n=Yb(t,n,s)}else t=m.treeContext,Ut=xi(w.nextSibling),gn=n,rt=!0,qa=null,hi=!1,t!==null&&Mx(n,t),n=Ic(n,o),n.flags|=134221824;return n}return t=ba(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function js(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 Vf(t,n,s,o,f){return Mr(n),s=Cf(t,n,s,o,void 0,f),o=jf(),t!==null&&!an?(Af(t,n,f),Ea(t,n,f)):(rt&&o&&hc(n),n.flags|=1,dn(t,n,s,f),n.child)}function Vb(t,n,s,o,f,m){return Mr(n),n.updateQueue=null,s=Zx(n,o,s,f),Xx(t),o=jf(),t!==null&&!an?(Af(t,n,m),Ea(t,n,m)):(rt&&o&&hc(n),n.flags|=1,dn(t,n,s,m),n.child)}function Kb(t,n,s,o,f){if(Mr(n),n.stateNode===null){var m=ys,w=s.contextType;typeof w=="object"&&w!==null&&(m=kn(w)),m=new s(o,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=qf,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=o,m.state=n.memoizedState,m.refs={},yf(n),w=s.contextType,m.context=typeof w=="object"&&w!==null?kn(w):ys,m.state=n.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Ff(n,s,w,o),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&&qf.enqueueReplaceState(m,m.state,null),Pl(n,o,m,f),$l(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){m=n.stateNode;var N=n.memoizedProps,I=Br(s,N);m.props=I;var X=m.context,J=s.contextType;w=ys,typeof J=="object"&&J!==null&&(w=kn(J));var oe=s.getDerivedStateFromProps;J=typeof oe=="function"||typeof m.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,J||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(N||X!==w)&&Db(n,m,o,w),Ka=!1;var Y=n.memoizedState;m.state=Y,Pl(n,o,m,f),$l(),X=n.memoizedState,N||Y!==X||Ka?(typeof oe=="function"&&(Ff(n,s,oe,o),X=n.memoizedState),(I=Ka||Rb(n,s,I,o,Y,X,w))?(J||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=o,n.memoizedState=X),m.props=o,m.state=X,m.context=w,o=I):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{m=n.stateNode,vf(t,n),w=n.memoizedProps,J=Br(s,w),m.props=J,oe=n.pendingProps,Y=m.context,X=s.contextType,I=ys,typeof X=="object"&&X!==null&&(I=kn(X)),N=s.getDerivedStateFromProps,(X=typeof N=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w!==oe||Y!==I)&&Db(n,m,o,I),Ka=!1,Y=n.memoizedState,m.state=Y,Pl(n,o,m,f),$l();var W=n.memoizedState;w!==oe||Y!==W||Ka||t!==null&&t.dependencies!==null&&bc(t.dependencies)?(typeof N=="function"&&(Ff(n,s,N,o),W=n.memoizedState),(J=Ka||Rb(n,s,J,o,Y,W,I)||t!==null&&t.dependencies!==null&&bc(t.dependencies))?(X||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,W,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,W,I)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof m.componentDidUpdate!="function"||w===t.memoizedProps&&Y===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&Y===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=W),m.props=o,m.state=W,m.context=I,o=J):(typeof m.componentDidUpdate!="function"||w===t.memoizedProps&&Y===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&Y===t.memoizedState||(n.flags|=1024),o=!1)}return m=o,js(t,n),o=(n.flags&128)!==0,m||o?(m=n.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,t!==null&&o?(n.child=Ir(n,t.child,null,f),n.child=Ir(n,null,s,f)):dn(t,n,s,f),n.memoizedState=m.state,t=n.child):t=Ea(t,n,f),t}function Xb(t,n,s,o){return jr(),n.flags|=256,dn(t,n,s,o),n.child}var Kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xf(t){return{baseLanes:t,cachePool:Ux()}}function Zf(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=ai),t}function Zb(t,n,s){var o=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(rt){if(f?Wa(n):Ja(),(t=Ut)?(t=b1(t,hi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Fa!==null?{id:qi,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},s=jx(t),s.return=n,n.child=s,gn=n,Ut=null)):t=null,t===null)throw Ga(n);return Xp(t)?n.lanes=32:n.lanes=536870912,null}return m=o.children,o=o.fallback,f?(Ja(),f=n.mode,m=Uc({mode:"hidden",children:m},f),o=Cr(o,f,s,null),m.return=n,o.return=n,m.sibling=o,n.child=m,o=n.child,o.memoizedState=Xf(s),o.childLanes=Zf(t,w,s),n.memoizedState=Kf,Yl(null,o)):(Wa(n),Qf(n,m))}var N=t.memoizedState;if(N!==null){var I=N.dehydrated;if(I!==null)return SS(t,n,m,w,o,I,N,s)}return f?(Ja(),f=o.fallback,m=n.mode,N=t.child,I=N.sibling,o=ba(N,{mode:"hidden",children:o.children}),o.subtreeFlags=N.subtreeFlags&1206910976,I!==null?f=ba(I,f):(f=Cr(f,m,s,null),f.flags|=2),f.return=n,o.return=n,o.sibling=f,n.child=o,Yl(null,o),o=n.child,f=t.child.memoizedState,f===null?f=Xf(s):(m=f.cachePool,m!==null?(N=tn._currentValue,m=m.parent!==N?{parent:N,pool:N}:m):m=Ux(),f={baseLanes:f.baseLanes|s,cachePool:m}),o.memoizedState=f,o.childLanes=Zf(t,w,s),n.memoizedState=Kf,Yl(t.child,o)):(Wa(n),s=t.child,t=s.sibling,s=ba(s,{mode:"visible",children:o.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=Uc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Uc(t,n){return t=Gn(22,t,null,n),t.lanes=0,t}function Bc(t,n,s){return Ir(n,t.child,null,s),t=Qf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function SS(t,n,s,o,f,m,w,N){if(s)return n.flags&256?(Wa(n),n.flags&=-257,Bc(t,n,N)):n.memoizedState!==null?(Ja(),n.child=t.child,n.flags|=128,null):(Ja(),m=f.fallback,w=n.mode,f=Uc({mode:"visible",children:f.children},w),m=Cr(m,w,N,null),m.flags|=2,f.return=n,m.return=n,f.sibling=m,n.child=f,Ir(n,t.child,null,N),f=n.child,f.memoizedState=Xf(N),f.childLanes=Zf(t,o,N),n.memoizedState=Kf,Yl(null,f));if(Wa(n),Xp(m)){if(o=m.nextSibling&&m.nextSibling.dataset,o)var I=o.dgst;return o=I,o!==""&&(f=Error(r(419)),f.stack="",f.digest=o,Dl({value:f,source:null,stack:null})),Bc(t,n,N)}if(an||Or(t,n,N,!1),o=(N&t.childLanes)!==0,an||o){if(Qa.current!==null)return Bc(t,n,N);if(o=zt,o!==null&&(f=wl(o,N),f!==0&&f!==w.retryLane))throw w.retryLane=f,Tr(t,f),Xn(o,t,f),Yf;return Kp(m)||iu(),Bc(t,n,N)}return Kp(m)?(n.flags|=192,n.child=t.child,null):(t=w.treeContext,Ut=xi(m.nextSibling),gn=n,rt=!0,qa=null,hi=!1,t!==null&&Mx(n,t),n=Qf(n,f.children),n.flags|=134221824,n)}function Qb(t,n,s){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),xc(t.return,n,s)}function Wb(t){for(var n=null;t!==null;){var s=t.alternate;s!==null&&_c(s)===null&&(n=t),t=t.sibling}return n}function $c(t,n,s,o,f,m){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:f,treeForkCount:m}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=o,w.tail=s,w.tailMode=f,w.treeForkCount=m)}function Wf(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 Jf(t,n,s){var o=n.pendingProps,f=o.revealOrder,m=o.tail;o=o.children;var w=En.current;if(n.flags&128)return Hl(n,w),null;var N=(w&2)!==0;if(N?(w=w&1|2,n.flags|=128):w&=1,Hl(n,w),f==="backwards"&&t!==null?(Wf(t),dn(t,n,o,s),Wf(t)):dn(t,n,o,s),o=rt?Rl:0,!N&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Qb(t,s,n);else if(t.tag===19)Qb(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=Wb(n.child),s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null,Wf(n)),$c(n,!0,f,null,m,o);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}$c(n,!0,s,null,m,o);break;case"together":$c(n,!1,null,null,void 0,o);break;case"independent":n.memoizedState=null;break;default:s=Wb(n.child),s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),$c(n,!1,f,s,m,o)}return n.child}function Jb(t,n,s){var o=n.pendingProps;return Ya(n,n.type,o.value),dn(t,n,o.children,s),n.child}function Ea(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),ir|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(Or(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 ep(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&bc(t)))}function _S(t,n,s){switch(n.tag){case 3:qe(n,n.stateNode.containerInfo),Ya(n,tn,t.memoizedState.cache),jr();break;case 27:case 5:xt(n);break;case 4:qe(n,n.stateNode.containerInfo);break;case 10:Ya(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Sf(n),null;break;case 13:var o=n.memoizedState;if(o!==null){if(o.dehydrated!==null)return Wa(n),n.flags|=128,null;o=Or(t,n,s,!1);var f=n.child.childLanes;return o||(s&f)!==0?Zb(t,n,s):(Wa(n),t=Ea(t,n,s),t!==null?t.sibling:null)}Wa(n);break;case 19:if(n.flags&128)return Jf(t,n,s);if(f=(t.flags&128)!==0,o=(s&n.childLanes)!==0,o||(Or(t,n,s,!1),o=(s&n.childLanes)!==0),f){if(o)return Jf(t,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Hl(n,En.current),o)break;return null;case 22:return n.lanes=0,qb(t,n,s,n.pendingProps);case 24:Ya(n,tn,t.memoizedState.cache)}return Ea(t,n,s)}function ey(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)an=!0;else{if(!ep(t,s)&&(n.flags&128)===0)return an=!1,_S(t,n,s);an=(t.flags&131072)!==0}else an=!1,rt&&(n.flags&1048576)!==0&&Ox(n,Rl,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=zr(n.elementType),n.type=t,typeof t=="function")lf(t)?(o=Br(t,o),n.tag=1,n=Kb(null,n,t,o,s)):(n.tag=0,n=Vf(null,n,t,o,s));else{if(t!=null){var f=t.$$typeof;if(f===M){n.tag=11,n=Pb(null,n,t,o,s);break e}else if(f===xe){n.tag=14,n=Hb(null,n,t,o,s);break e}else if(f===te){n.tag=10,n.type=t,n=Jb(null,n,s);break e}}throw n=Pe(t)||t,Error(r(306,n,""))}}return n;case 0:return Vf(t,n,n.type,n.pendingProps,s);case 1:return o=n.type,f=Br(o,n.pendingProps),Kb(t,n,o,f,s);case 3:e:{if(qe(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var m=n.memoizedState;f=m.element,vf(t,n),Pl(n,o,null,s);var w=n.memoizedState;if(o=w.cache,Ya(n,tn,o),o!==m.cache&&mf(n,[tn],s,!0),$l(),o=w.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=Xb(t,n,o,s);break e}else if(o!==f){f=fi(Error(r(424)),n),Dl(f),n=Xb(t,n,o,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ut=xi(t.firstChild),gn=n,rt=!0,qa=null,hi=!0,s=qx(n,null,o,s),n.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling;else{if(jr(),o===f){n=Ea(t,n,s);break e}dn(t,n,o,s)}n=n.child}return n;case 26:return js(t,n),t===null?(s=S1(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(n.stateNode=a1(n.type,n.pendingProps,$t.current,n)):n.memoizedState=S1(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return xt(n),t===null&&rt&&(o=n.stateNode=w1(n.type,n.pendingProps,$t.current),gn=n,hi=!0,f=Ut,lr(n.type)?(Zp=f,Ut=xi(o.firstChild)):Ut=f),dn(t,n,n.pendingProps.children,s),js(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&rt&&((f=o=Ut)&&(o=v_(o,n.type,n.pendingProps,hi),o!==null?(n.stateNode=o,gn=n,Ut=xi(o.firstChild),hi=!1,f=!0):f=!1),f||Ga(n)),xt(n),f=n.type,m=n.pendingProps,w=t!==null?t.memoizedProps:null,o=m.children,Pp(f,m)?o=null:w!==null&&Pp(f,w)&&(n.flags|=32),n.memoizedState!==null&&(f=Cf(t,n,hS,null,null,s),Vs._currentValue=f),js(t,n),dn(t,n,o,s),n.child;case 6:return t===null&&rt&&((t=s=Ut)&&(s=w_(s,n.pendingProps,hi),s!==null?(n.stateNode=s,gn=n,Ut=null,t=!0):t=!1),t||Ga(n)),null;case 13:return Zb(t,n,s);case 4:return qe(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Ir(n,null,o,s):dn(t,n,o,s),n.child;case 11:return Pb(t,n,n.type,n.pendingProps,s);case 7:return o=n.pendingProps,js(t,n),dn(t,n,o,s),n.child;case 8:return dn(t,n,n.pendingProps.children,s),n.child;case 12:return dn(t,n,n.pendingProps.children,s),n.child;case 10:return Jb(t,n,s);case 9:return f=n.type._context,o=n.pendingProps.children,Mr(n),f=kn(f),o=o(f),n.flags|=1,dn(t,n,o,s),n.child;case 14:return Hb(t,n,n.type,n.pendingProps,s);case 15:return Fb(t,n,n.type,n.pendingProps,s);case 19:return Jf(t,n,s);case 31:return ES(t,n,s);case 22:return qb(t,n,s,n.pendingProps);case 24:return Mr(n),o=kn(tn),t===null?(f=xf(),f===null&&(f=zt,m=hf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=s),f=m),n.memoizedState={parent:o,cache:f},yf(n),Ya(n,tn,f)):((t.lanes&s)!==0&&(vf(t,n),Pl(n,null,null,s),$l()),f=t.memoizedState,m=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Ya(n,tn,o)):(o=m.cache,Ya(n,tn,o),o!==f.cache&&mf(n,[tn],s,!0))),dn(t,n,n.pendingProps.children,s),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),o=n.pendingProps,o.name!=null&&o.name!=="auto"?n.flags|=t===null?18882560:18874368:rt&&hc(n),t!==null&&t.memoizedProps.name!==o.name?n.flags|=4194816:js(t,n),dn(t,n,o.children,s),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Sa(t){t.flags|=4}function tp(t,n,s,o,f){var m;if((m=(t.mode&32)!==0)&&(m=s===null?j1(n,o):j1(n,o)&&(o.src!==s.src||o.srcSet!==s.srcSet)),m){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(zy())t.flags|=8192;else throw Lr=kc,bf}else t.flags&=-16777217}function ty(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!A1(n))if(zy())t.flags|=8192;else throw Lr=kc,bf}function Pc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?vl():536870912,t.lanes|=n,Ds|=n)}function Vl(t,n){if(!rt)switch(t.tailMode){case"visible":break;case"collapsed":for(var s=t.tail,o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.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 Bt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(n)for(var f=t.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags&1206910976,o|=f.flags&1206910976,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=s,n}function TS(t,n,s){var o=n.pendingProps;switch(uf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(n),null;case 1:return Bt(n),null;case 3:return s=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),wa(tn),ht(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ks(n)?Sa(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ff())),Bt(n),null;case 26:var f=n.type,m=n.memoizedState;return t===null?(Sa(n),m!==null?(Bt(n),ty(n,m)):(Bt(n),tp(n,f,null,o,s))):m?m!==t.memoizedState?(Sa(n),Bt(n),ty(n,m)):(Bt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Sa(n),Bt(n),tp(n,f,t,o,s)),null;case 27:if(on(n),s=$t.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Sa(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return Bt(n),n.subtreeFlags&=-33554433,null}t=jt.current,ks(n)?Rx(n):(t=w1(f,o,s),n.stateNode=t,Sa(n))}return Bt(n),n.subtreeFlags&=-33554433,null;case 5:if(on(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Sa(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return Bt(n),n.subtreeFlags&=-33554433,null}if(m=jt.current,ks(n))Rx(n);else{var w=ao($t.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 o.is=="string"?w.createElement("select",{is:o.is}):w.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?w.createElement(f,{is:o.is}):w.createElement(f)}}m[un]=n,m[ge]=o;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,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Sa(n)}}return Bt(n),n.subtreeFlags&=-33554433,tp(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Sa(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=$t.current,ks(n)){if(t=n.stateNode,s=n.memoizedProps,o=null,f=gn,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[un]=n,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||e1(t.nodeValue,s)),t||Ga(n,!0)}else t=ao(t).createTextNode(o),t[un]=n,n.stateNode=t}return Bt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(o=ks(n),s!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[un]=n}else jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Bt(n),t=!1}else s=ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(ti(n),n):(ti(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Bt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ks(n),o!==null&&o.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[un]=n}else jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Bt(n),f=!1}else f=ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(ti(n),n):(ti(n),null)}return ti(n),(n.flags&128)!==0?(n.lanes=s,n):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==f&&(o.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Pc(n,n.updateQueue),Bt(n),null);case 4:return ht(),t===null&&Lp(n.stateNode.containerInfo),n.flags|=67108864,Bt(n),null;case 10:return wa(n.type),Bt(n),null;case 19:if(_f(n),o=n.memoizedState,o===null)return Bt(n),null;if(f=(n.flags&128)!==0,m=o.rendering,m===null)if(f)Vl(o,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=_c(t),m!==null){for(n.flags|=128,Vl(o,!1),t=m.updateQueue,n.updateQueue=t,Pc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)Cx(s,t),s=s.sibling;return Hl(n,En.current&1|2),rt&&ya(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Qt()>Jc&&(n.flags|=128,f=!0,Vl(o,!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,Pc(n,t),Vl(o,!0),o.tail===null&&o.tailMode!=="collapsed"&&o.tailMode!=="visible"&&!m.alternate&&!rt)return Bt(n),null}else 2*Qt()-o.renderingStartTime>Jc&&s!==536870912&&(n.flags|=128,f=!0,Vl(o,!1),n.lanes=4194304);o.isBackwards?(m.sibling=n.child,n.child=m):(t=o.last,t!==null?t.sibling=m:n.child=m,o.last=m)}if(o.tail!==null){t=o.tail;e:{for(s=t;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qt(),t.sibling=null,m=En.current,m=f?m&1|2:m&1,o.tailMode==="visible"||o.tailMode==="collapsed"||!s||rt?Hl(n,m):(s=m,Ve(Nn,n),Ve(En,s),jn===null&&(jn=n)),rt&&ya(n,o.treeForkCount),t}return Bt(n),null;case 22:case 23:return ti(n),Ef(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(s&536870912)!==0&&(n.flags&128)===0&&(Bt(n),n.subtreeFlags&6&&(n.flags|=8192)):Bt(n),s=n.updateQueue,s!==null&&Pc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==s&&(n.flags|=2048),t!==null&&ot(Dr),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),wa(tn),Bt(n),null;case 25:return null;case 30:return n.flags|=33554432,Bt(n),null}throw Error(r(156,n.tag))}function CS(t,n){switch(uf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return wa(tn),ht(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return on(n),null;case 31:if(n.memoizedState!==null){if(ti(n),n.alternate===null)throw Error(r(340));jr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(ti(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));jr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return _f(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 ti(n),Ef(),t!==null&&ot(Dr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return wa(tn),null;case 25:return null;default:return null}}function ny(t,n){switch(uf(n),n.tag){case 3:wa(tn),ht();break;case 26:case 27:case 5:on(n);break;case 4:ht();break;case 31:n.memoizedState!==null&&ti(n);break;case 13:ti(n);break;case 19:_f(n);break;case 10:wa(n.type);break;case 22:case 23:ti(n),Ef(),t!==null&&ot(Dr);break;case 24:wa(tn)}}function Kl(t,n){try{var s=n.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var f=o.next;s=f;do{if((s.tag&t)===t){o=void 0;var m=s.create,w=s.inst;o=m(),w.destroy=o}s=s.next}while(s!==f)}}catch(N){Tt(n,n.return,N)}}function er(t,n,s){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var m=f.next;o=m;do{if((o.tag&t)===t){var w=o.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,f=n;var I=s,X=N;try{X()}catch(J){Tt(f,I,J)}}}o=o.next}while(o!==m)}}catch(J){Tt(n,n.return,J)}}function iy(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Yx(n,s)}catch(o){Tt(t,t.return,o)}}}function ay(t,n,s){s.props=Br(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Tt(t,n,o)}}function Yi(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:var f=t.stateNode,m=ga(t.memoizedProps,f);(f.ref===null||f.ref.name!==m)&&(f.ref=d1(m)),o=f.ref;break;case 7:if(t.stateNode===null){var w=new si(t);x(t.child,!1,b_,w,void 0,void 0),t.stateNode=w}o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(N){Tt(t,n,N)}}function Sn(t,n){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}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++)x1(t.stateNode,n[s])}function ry(t){for(var n=t.return;n!==null&&(ip(n)&&x1(t.stateNode,n.stateNode),!np(n));)n=n.return}function Xl(t){for(var n=t.return;n!==null&&(ip(n)&&y_(t.stateNode,n.stateNode),!np(n));)n=n.return}function np(t){return t.tag===5||t.tag===3||t.tag===27}function ip(t){return t&&t.tag===7&&t.stateNode!==null}function ap(t){var n=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(f){Tt(t,t.return,f)}}function rp(t,n,s){try{var o=t.stateNode;e_(o,t.type,s,n),o[ge]=n}catch(f){Tt(t,t.return,f)}}function sy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&lr(t.type)||t.tag===4}function sp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||sy(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&&lr(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 lp(t,n,s,o){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=Fi)),Hc(t,o),mt=!0;else if(f!==4&&(f===27&&(Hc(t,o),o=null,lr(t.type)&&(s=t.stateNode,n=null)),t=t.child,t!==null))for(lp(t,n,s,o),t=t.sibling;t!==null;)lp(t,n,s,o),t=t.sibling}function Fc(t,n,s,o){var f=t.tag;if(f===5||f===6)f=t.stateNode,n?s.insertBefore(f,n):s.appendChild(f),Hc(t,o),mt=!0;else if(f!==4&&(f===27&&(Hc(t,o),o=null,lr(t.type)&&(s=t.stateNode)),t=t.child,t!==null))for(Fc(t,n,s,o),t=t.sibling;t!==null;)Fc(t,n,s,o),t=t.sibling}function ly(t){var n=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);_n(n,o,s),n[un]=t,n[ge]=s}catch(m){Tt(t,t.return,m)}}var qc=!1,ni=null;function oy(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(qc=!0)}var Vi=null;function cy(){var t=Vi;return Vi=null,t}var Yn=0;function As(t,n,s,o,f){return Yn=0,uy(t.child,n,s,o,f)}function uy(t,n,s,o,f){for(var m=!1;t!==null;){if(t.tag===5){var w=t.stateNode;if(o!==null){var N=qp(w);o.push(N),N.view&&(m=!0)}else m||qp(w).view&&(m=!0);qc=!0,c1(w,Yn===0?n:n+"_"+Yn,s),Yn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f||uy(t.child,n,s,o,f)&&(m=!0));t=t.sibling}return m}function Ki(t,n){for(;t!==null;)t.tag===5?u1(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Ki(t.child,n)),t=t.sibling}function Gc(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(Gc(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 op(t,n){if(t.tag===30){var s=t.stateNode,o=t.memoizedProps,f=ga(o,s),m=xa(o.default,s.paired?o.share:o.enter);m!=="none"?As(t,f,m,null,!1)?(Gc(t),s.paired||n||Us(t,o.onEnter)):Ki(t.child,!1):Gc(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)op(t,n),t=t.sibling;else Gc(t)}function cp(t){if(ni!==null&&ni.size!==0){var n=ni;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,o=s.name;if(o!=null&&o!=="auto"){var f=n.get(o);if(f!==void 0){var m=xa(s.default,s.share);if(m!=="none"&&(As(t,o,m,null,!1)?(m=t.stateNode,f.paired=m,m.paired=f,Us(t,s.onShare)):Ki(t.child,!1)),n.delete(o),n.size===0)break}}}cp(t)}t=t.sibling}}}function up(t){if(t.tag===30){var n=t.memoizedProps,s=ga(n,t.stateNode),o=ni!==null?ni.get(s):void 0,f=xa(n.default,o!==void 0?n.share:n.exit);f!=="none"&&(As(t,s,f,null,!1)?o!==void 0?(f=t.stateNode,o.paired=f,f.paired=o,ni.delete(s),Us(t,n.onShare)):Us(t,n.onExit):Ki(t.child,!1)),ni!==null&&cp(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)up(t),t=t.sibling;else ni!==null&&cp(t)}function dy(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&&dy(t);t=t.sibling}}function dp(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))}dp(t)}t=t.sibling}}function Yc(t){if(t.tag===30)t.stateNode.paired=null,Ki(t.child,!1),dp(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Yc(t),t=t.sibling;else dp(t)}function fy(t){for(t=t.child;t!==null;)t.tag===30?Ki(t.child,!1):(t.subtreeFlags&33554432)!==0&&fy(t),t=t.sibling}function fp(t,n,s,o,f,m,w){for(var N=!1;n!==null;){if(n.tag===5){var I=n.stateNode;if(m!==null&&Yn<m.length){var X=m[Yn],J=qp(I);(X.view||J.view)&&(N=!0);var oe;if(oe=(t.flags&4)===0)if(J.clip)oe=!0;else{oe=X.rect;var Y=J.rect;oe=oe.y!==Y.y||oe.x!==Y.x||oe.height!==Y.height||oe.width!==Y.width}oe&&(t.flags|=4),J.abs?J=!X.abs:(X=X.rect,J=J.rect,J=X.height!==J.height||X.width!==J.width),J&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&c1(I,Yn===0?s:s+"_"+Yn,f),N&&(t.flags&4)!==0||(Vi===null&&(Vi=[]),Vi.push(I,Yn===0?o:o+"_"+Yn,n.memoizedProps)),Yn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&w?t.flags|=n.flags&32:fp(t,n.child,s,o,f,m,w)&&(N=!0));n=n.sibling}return N}function py(t,n){for(t=t.child;t!==null;){if(t.tag===30){var s=t.memoizedProps,o=t.stateNode,f=ga(s,o),m=xa(s.default,s.update),w;w=t.memoizedState,t.memoizedState=null,o=t;var N=t.child;Yn=0,f=fp(o,N,f,f,m,w,!1),(t.flags&4)!==0&&f&&Us(t,s.onUpdate)}else(t.subtreeFlags&33554432)!==0&&py(t);t=t.sibling}}var xn=!1,Nt=!1,Xi=!1,pp=!1,my=typeof WeakSet=="function"?WeakSet:Set,bn=null,Zi=!1,Zl=!1,Vc=!1,mp=!1;function jS(t,n,s){if(t=t.containerInfo,Bp=Ks,t=bx(t),Jd(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var f=o.getSelection&&o.getSelection();if(f&&f.rangeCount!==0){o=f.anchorNode;var m=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{o.nodeType,w.nodeType}catch{o=null;break e}var N=0,I=-1,X=-1,J=0,oe=0,Y=t,W=null;t:for(;;){for(var Ne;Y!==o||m!==0&&Y.nodeType!==3||(I=N+m),Y!==w||f!==0&&Y.nodeType!==3||(X=N+f),Y.nodeType===3&&(N+=Y.nodeValue.length),(Ne=Y.firstChild)!==null;)W=Y,Y=Ne;for(;;){if(Y===t)break t;if(W===o&&++J===m&&(I=N),W===w&&++oe===f&&(X=N),(Ne=Y.nextSibling)!==null)break;Y=W,W=Y.parentNode}Y=Ne}o=I===-1||X===-1?null:{start:I,end:X}}else o=null}o=o||{start:0,end:0}}else o=null;for($p={focusedElem:t,selectionRange:o},Ks=!1,s=(s&335544064)===s,bn=n,n=s?9270:1024;bn!==null;){if(t=bn,s&&(o=t.deletions,o!==null))for(m=0;m<o.length;m++)s&&up(o[m]);if(t.alternate===null&&(t.flags&2)!==0)s&&oy(t),Kc(s);else{if(t.tag===22){if(o=t.alternate,t.memoizedState!==null){o!==null&&o.memoizedState===null&&s&&up(o),Kc(s);continue}else if(o!==null&&o.memoizedState!==null){s&&oy(t),Kc(s);continue}}o=t.child,(t.subtreeFlags&n)!==0&&o!==null?(o.return=t,bn=o):(s&&dy(t),Kc(s))}}ni=null}function Kc(t){for(;bn!==null;){var n=bn,s=t,o=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&o!==null){s=void 0,f=o.memoizedProps,o=o.memoizedState;var m=n.stateNode;try{var w=Br(n.type,f);s=m.getSnapshotBeforeUpdate(w,o),m.__reactInternalSnapshotBeforeUpdate=s}catch(N){Tt(n,n.return,N)}}break;case 3:if((f&1024)!==0){if(o=n.stateNode.containerInfo,s=o.nodeType,s===9)Vp(o);else if(s===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Vp(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&o!==null&&(s=ga(o.memoizedProps,o.stateNode),f=n.memoizedProps,f=xa(f.default,f.update),f!=="none"&&As(o,s,f,o.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(r(163))}if(o=n.sibling,o!==null){o.return=n.return,bn=o;break}bn=n.return}}function hy(t,n,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Qi(t,s),o&4&&Kl(5,s);break;case 1:if(Qi(t,s),o&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(w){Tt(s,s.return,w)}else{var f=Br(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(w){Tt(s,s.return,w)}}o&64&&iy(s),o&512&&Yi(s,s.return);break;case 3:if(Qi(t,s),o&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{Yx(t,n)}catch(w){Tt(s,s.return,w)}}break;case 27:n===null&&o&4&&ly(s);case 26:case 5:Qi(t,s),n===null&&o&4&&ap(s),o&512&&Yi(s,s.return);break;case 12:Qi(t,s);break;case 31:Qi(t,s),o&4&&yy(t,s);break;case 13:Qi(t,s),o&4&&vy(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=PS.bind(null,s),k_(t,s))));break;case 22:if(o=s.memoizedState!==null||xn,!o){var m=n!==null&&n.memoizedState!==null||Nt;n=xn,f=Nt,xn=o,(Nt=m)&&!f?(o=2,(s.subtreeFlags&8772)!==0&&(o|=1),Oi(t,s,o)):Qi(t,s),xn=n,Nt=f}break;case 30:Qi(t,s),o&512&&Yi(s,s.return);break;case 7:o&512&&Yi(s,s.return);default:Qi(t,s)}}function hp(t,n){for(t=t.child;t!==null;)gy(t,n),t=t.sibling}function gy(t,n){switch(t.tag){case 5:case 26:try{var s=t.stateNode;if(n){var o=s.style;typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.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(I){Tt(t,t.return,I)}gp(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,mt=!0}catch(I){Tt(t,t.return,I)}break;case 18:try{var N=t.stateNode;n?o1(N,!0):o1(t.stateNode,!1)}catch(I){Tt(t,t.return,I)}break;case 22:case 23:t.memoizedState===null&&hp(t,n);break;default:hp(t,n)}}function gp(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var s=t,o=n;switch(s.tag){case 4:gy(s,o);break e;case 22:s.memoizedState===null&&gp(s,o);break e;default:gp(s,o)}}t=t.sibling}}function xy(t){var n=t.alternate;n!==null&&(t.alternate=null,xy(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&mn(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 Pt=null,Vn=!1;function ji(t,n,s){for(s=s.child;s!==null;)by(t,n,s),s=s.sibling}function by(t,n,s){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Dt,s)}catch{}switch(s.tag){case 26:Nt||Sn(s,n),ji(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Nt&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Nt||Sn(s,n),Xl(s);var o=Pt,f=Vn;lr(s.type)&&(Pt=s.stateNode,Vn=!1),ji(t,n,s),k1(s.stateNode,s.type,s.memoizedProps),Pt=o,Vn=f;break;case 5:Nt||Sn(s,n),Xl(s);case 6:if(s.tag===6&&Xl(s),o=Pt,f=Vn,Pt=null,ji(t,n,s),Pt=o,Vn=f,Pt!==null)if(Vn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(s.stateNode),mt=!0}catch(m){Tt(s,n,m)}else try{Pt.removeChild(s.stateNode),mt=!0}catch(m){Tt(s,n,m)}break;case 18:Pt!==null&&(Vn?(t=Pt,l1(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Xs(t)):l1(Pt,s.stateNode));break;case 4:o=Pt,f=Vn,Pt=s.stateNode.containerInfo,Vn=!0,ji(t,n,s),Pt=o,Vn=f;break;case 0:case 11:case 14:case 15:er(2,s,n),Nt||er(4,s,n),ji(t,n,s);break;case 1:Nt||(Sn(s,n),o=s.stateNode,typeof o.componentWillUnmount=="function"&&ay(s,n,o)),ji(t,n,s);break;case 21:ji(t,n,s);break;case 22:Nt=(o=Nt)||s.memoizedState!==null,ji(t,n,s),Nt=o;break;case 30:Sn(s,n),ji(t,n,s);break;case 7:Nt||Sn(s,n),ji(t,n,s);break;default:ji(t,n,s)}}function yy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xs(t)}catch(s){Tt(n,n.return,s)}}}function vy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Xs(t)}catch(s){Tt(n,n.return,s)}}function AS(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new my),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new my),n;default:throw Error(r(435,t.tag))}}function Xc(t,n){var s=AS(t);n.forEach(function(o){if(!s.has(o)){s.add(o);var f=HS.bind(null,t,o);o.then(f,f)}})}function Un(t,n,s){var o=n.deletions;if(o!==null)for(var f=0;f<o.length;f++){var m=o[f],w=t,N=n,I=N;e:for(;I!==null;){switch(I.tag){case 27:if(lr(I.type)){Pt=I.stateNode,Vn=!1;break e}break;case 5:Pt=I.stateNode,Vn=!1;break e;case 3:case 4:Pt=I.stateNode.containerInfo,Vn=!0;break e}I=I.return}if(Pt===null)throw Error(r(160));by(w,N,m),Pt=null,Vn=!1,w=m.alternate,w!==null&&(w.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)wy(n,t,s),n=n.sibling}var Ai=null;function wy(t,n,s){var o=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(f&4&&(o=t.updateQueue,o=o!==null?o.events:null,o!==null))for(var m=0;m<o.length;m++){var w=o[m];w.ref.impl=w.nextImpl}Un(n,t,s),Bn(t),f&4&&(er(3,t,t.return),Kl(3,t),er(5,t,t.return));break;case 1:Un(n,t,s),Bn(t),f&512&&(Nt||o===null||Sn(o,o.return)),f&64&&xn&&(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&&(Nt||o===null||Sn(o,o.return)),f&4)if(f=o!==null?o.memoizedState:null,s=t.memoizedState,o===null)if(s===null)if(t.stateNode===null)if(xn)t.stateNode=a1(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,s=t.memoizedProps,f=m.ownerDocument||m;t:switch(n){case"title":o=f.getElementsByTagName("title")[0],(!o||o[qn]||o[un]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=f.createElement(n),f.head.insertBefore(o,f.querySelector("head > title"))),_n(o,n,s),o[un]=t,Jt(o),n=o;break e;case"link":if(m=C1("link","href",f).get(n+(s.href||""))){for(w=0;w<m.length;w++)if(o=m[w],o.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&o.getAttribute("rel")===(s.rel==null?null:s.rel)&&o.getAttribute("title")===(s.title==null?null:s.title)&&o.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){m.splice(w,1);break t}}o=f.createElement(n),_n(o,n,s),f.head.appendChild(o);break;case"meta":if(m=C1("meta","content",f).get(n+(s.content||""))){for(w=0;w<m.length;w++)if(o=m[w],o.getAttribute("content")===(s.content==null?null:""+s.content)&&o.getAttribute("name")===(s.name==null?null:s.name)&&o.getAttribute("property")===(s.property==null?null:s.property)&&o.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&o.getAttribute("charset")===(s.charSet==null?null:s.charSet)){m.splice(w,1);break t}}o=f.createElement(n),_n(o,n,s),f.head.appendChild(o);break;default:throw Error(r(468,n))}o[un]=t,Jt(o),n=o}t.stateNode=n}else xn||em(m,t.type,t.stateNode);else t.stateNode=T1(m,s,t.memoizedProps);else f!==s?(f===null?(n=o.stateNode,n===null||Nt||n.parentNode.removeChild(n)):f.count--,s===null?xn||em(m,t.type,t.stateNode):T1(m,s,t.memoizedProps)):s===null&&t.stateNode!==null&&rp(t,t.memoizedProps,o.memoizedProps);break;case 27:Un(n,t,s),Bn(t),f&512&&(Nt||o===null||Sn(o,o.return)),o!==null&&f&4&&rp(t,t.memoizedProps,o.memoizedProps);break;case 5:if(m=Xi,Xi=!1,Un(n,t,s),Xi=m,Bn(t),f&512&&(Nt||o===null||Sn(o,o.return)),t.flags&32){n=t.stateNode;try{fs(n,""),mt=!0}catch(J){Tt(t,t.return,J)}}f&4&&t.stateNode!=null&&(n=t.memoizedProps,rp(t,n,o!==null?o.memoizedProps:n)),f&1024&&(pp=!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,mt=!0}catch(J){Tt(t,t.return,J)}}break;case 3:if(mt=!1,uu=null,m=Ai,Ai=ro(n.containerInfo),Un(n,t,s),Ai=m,Bn(t),f&4&&o!==null&&o.memoizedState.isDehydrated)try{Xs(n.containerInfo)}catch(J){Tt(t,t.return,J)}pp&&(pp=!1,ky(t)),mt=!1;break;case 4:f=Xi,Xi=xn,o=en(),m=Ai,Ai=ro(t.stateNode.containerInfo),Un(n,t,s),Bn(t),Ai=m,mt&&Zl&&(Vc=!0),mt=o,Xi=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,Xc(t,n)));break;case 13:Un(n,t,s),Bn(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Wc=Qt()),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Xc(t,n)));break;case 22:m=t.memoizedState!==null,w=o!==null&&o.memoizedState!==null;var N=xn,I=Nt,X=Xi;xn=N||m,Xi=X||m,Nt=I||w,Un(n,t,s),Nt=I,Xi=X,xn=N,Bn(t),f&8192&&(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,!m||o===null||w||xn||Nt||(n=w||Nt,s=xn,o=Nt,xn=m||xn,Nt=n,tr(t,2),xn=s,Nt=o),!m&&Xi||hp(t,m)),f&4&&(n=t.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Xc(t,s))));break;case 19:Un(n,t,s),Bn(t),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Xc(t,n)));break;case 30:f&512&&(Nt||o===null||Sn(o,o.return)),f=en(),m=Zl,w=(s&335544064)===s,N=t.memoizedProps,Zl=w&&xa(N.default,N.update)!=="none",Un(n,t,s),Bn(t),w&&o!==null&&mt&&(t.flags|=4),Zl=m,mt=f;break;case 21:break;case 7:f&512&&(Nt||o===null||Sn(o,o.return)),o&&o.stateNode!==null&&(o.stateNode._fragmentFiber=t);default:Un(n,t,s),Bn(t)}}function Bn(t){var n=t.flags;if(n&2){try{for(var s,o=t.return;o!==null;){if(sy(o)){s=o;break}o=o.return}o=null;for(var f=t.return;f!==null;){if(ip(f)){var m=f.stateNode;o===null?o=[m]:o.push(m)}if(np(f))break;f=f.return}var w=o;if(s==null)throw Error(r(160));switch(s.tag){case 27:var N=s.stateNode,I=sp(t);Fc(t,I,N,w);break;case 5:var X=s.stateNode;s.flags&32&&(fs(X,""),s.flags&=-33);var J=sp(t);Fc(t,J,X,w);break;case 3:case 4:var oe=s.stateNode.containerInfo,Y=sp(t);lp(t,Y,oe,w);break;default:throw Error(r(161))}}catch(W){Tt(t,t.return,W)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ky(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;ky(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Ks=!0,n.reset(),Ks=!1),t=t.sibling}}function Os(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)Ny(n,t),n=n.sibling;else py(n)}function Ny(t,n){var s=t.alternate;if(s===null)op(t,!1);else switch(t.tag){case 3:if(mp=Zi=!1,cy(),Os(n,t),!Zi&&!Vc){if(t=Vi,t!==null)for(var o=0;o<t.length;o+=3){s=t[o];var f=t[o+1];u1(s,t[o+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"})),mp=!0}Vi=null;break;case 5:Os(n,t);break;case 4:o=Zi,Zi=!1,Os(n,t),Zi&&(Vc=!0),Zi=o;break;case 22:t.memoizedState===null&&(s.memoizedState!==null?op(t,!1):Os(n,t));break;case 30:o=Zi,f=cy(),Zi=!1,Os(n,t),Zi&&(t.flags|=4);var m=t.memoizedProps,w=t.stateNode;n=ga(m,w),w=ga(s.memoizedProps,w);var N=xa(m.default,m.update);N==="none"?n=!1:(m=s.memoizedState,s.memoizedState=null,s=t.child,Yn=0,n=fp(t,s,n,w,N,m,!0),Yn!==(m===null?0:m.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(Us(t,t.memoizedProps.onUpdate),Vi=f):f!==null&&(f.push.apply(f,Vi),Vi=f),Zi=(t.flags&32)!==0?!0:o;break;default:Os(n,t)}}function Qi(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hy(t,n.alternate,n),n=n.sibling}function tr(t,n){for(t=t.child;t!==null;){var s=t,o=n;switch(s.tag){case 0:case 11:case 14:case 15:er(4,s,s.return),tr(s,o);break;case 1:Sn(s,s.return);var f=s.stateNode;typeof f.componentWillUnmount=="function"&&ay(s,s.return,f),tr(s,o);break;case 27:(o&2)!==0&&k1(s.stateNode,s.type,s.memoizedProps);case 5:Sn(s,s.return),s.tag!==5&&s.tag!==27||Xl(s),tr(s,o);break;case 6:Xl(s);break;case 26:Sn(s,s.return),f=s.stateNode,s.memoizedState!==null||f===null||Nt||f.parentNode.removeChild(f),tr(s,o);break;case 22:s.memoizedState===null&&tr(s,o);break;case 30:Sn(s,s.return),tr(s,o);break;case 7:Sn(s,s.return);default:tr(s,o)}t=t.sibling}}function Oi(t,n,s){for(s=(n.subtreeFlags&8772)!==0?s:s&-2,n=n.child;n!==null;){var o=n.alternate,f=t,m=n,w=m.flags,N=(s&1)!==0;switch(m.tag){case 0:case 11:case 15:Oi(f,m,s),Kl(4,m);break;case 1:if(Oi(f,m,s),o=m,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(J){Tt(o,o.return,J)}if(o=m,f=o.updateQueue,f!==null){var I=o.stateNode;try{var X=f.shared.hiddenCallbacks;if(X!==null)for(f.shared.hiddenCallbacks=null,f=0;f<X.length;f++)Gx(X[f],I)}catch(J){Tt(o,o.return,J)}}N&&w&64&&iy(m),Yi(m,m.return);break;case 27:(s&2)!==0&&ly(m);case 5:m.tag!==5&&m.tag!==27||ry(m),Oi(f,m,s),N&&o===null&&w&4&&ap(m),Yi(m,m.return);break;case 6:ry(m);break;case 26:I=m.stateNode,m.memoizedState!==null||I===null||xn||em(ro(I.ownerDocument),m.type,I),Oi(f,m,s),N&&o===null&&w&4&&ap(m),Yi(m,m.return);break;case 12:Oi(f,m,s);break;case 31:Oi(f,m,s),N&&w&4&&yy(f,m);break;case 13:Oi(f,m,s),N&&w&4&&vy(f,m);break;case 22:m.memoizedState===null&&Oi(f,m,s),Yi(m,m.return);break;case 30:Oi(f,m,s),Yi(m,m.return);break;case 7:Yi(m,m.return);default:Oi(f,m,s)}n=n.sibling}}function xp(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&&zl(s))}function bp(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&zl(t))}function gi(t,n,s,o){var f=(s&335544064)===s;if(n.subtreeFlags&(f?10262:10256))for(n=n.child;n!==null;)Ey(t,n,s,o),n=n.sibling;else f&&fy(n)}function Ey(t,n,s,o){var f=(s&335544064)===s;f&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Yc(n);var m=n.flags;switch(n.tag){case 0:case 11:case 15:gi(t,n,s,o),m&2048&&Kl(9,n);break;case 1:gi(t,n,s,o);break;case 3:gi(t,n,s,o),f&&mp&&(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&&zl(m)));break;case 12:if(m&2048){gi(t,n,s,o),m=n.stateNode;try{var w=n.memoizedProps,N=w.id,I=w.onPostCommit;typeof I=="function"&&I(N,n.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(X){Tt(n,n.return,X)}}else gi(t,n,s,o);break;case 31:gi(t,n,s,o);break;case 13:gi(t,n,s,o);break;case 23:break;case 22:w=n.stateNode,N=n.alternate,n.memoizedState!==null?(f&&N!==null&&N.memoizedState===null&&Yc(N),w._visibility&2?gi(t,n,s,o):Ql(t,n)):(f&&N!==null&&N.memoizedState!==null&&Yc(n),w._visibility&2?gi(t,n,s,o):(w._visibility|=2,Ms(t,n,s,o,(n.subtreeFlags&10256)!==0||!1))),m&2048&&xp(N,n);break;case 24:gi(t,n,s,o),m&2048&&bp(n.alternate,n);break;case 30:f&&(m=n.alternate,m!==null&&(Ki(m.child,!0),Ki(n.child,!0))),gi(t,n,s,o);break;default:gi(t,n,s,o)}}function Ms(t,n,s,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=t,w=n,N=s,I=o,X=w.flags;switch(w.tag){case 0:case 11:case 15:Ms(m,w,N,I,f),Kl(8,w);break;case 23:break;case 22:var J=w.stateNode;w.memoizedState!==null?J._visibility&2?Ms(m,w,N,I,f):Ql(m,w):(J._visibility|=2,Ms(m,w,N,I,f)),f&&X&2048&&xp(w.alternate,w);break;case 24:Ms(m,w,N,I,f),f&&X&2048&&bp(w.alternate,w);break;default:Ms(m,w,N,I,f)}n=n.sibling}}function Ql(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,o=n,f=o.flags;switch(o.tag){case 22:Ql(s,o),f&2048&&xp(o.alternate,o);break;case 24:Ql(s,o),f&2048&&bp(o.alternate,o);break;default:Ql(s,o)}n=n.sibling}}var $r=8192;function Pr(t,n,s){if(t.subtreeFlags&$r)for(t=t.child;t!==null;)Sy(t,n,s),t=t.sibling}function Sy(t,n,s){switch(t.tag){case 26:Pr(t,n,s),t.flags&$r&&(t.memoizedState!==null?L_(s,Ai,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&M1(s,t)));break;case 5:Pr(t,n,s),t.flags&$r&&(t=t.stateNode,(n&335544128)===n&&M1(s,t));break;case 3:case 4:var o=Ai;Ai=ro(t.stateNode.containerInfo),Pr(t,n,s),Ai=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=$r,$r=16777216,Pr(t,n,s),$r=o):Pr(t,n,s));break;case 30:if((t.flags&$r)!==0&&(o=t.memoizedProps.name,o!=null&&o!=="auto")){var f=t.stateNode;f.paired=null,ni===null&&(ni=new Map),ni.set(o,f)}Pr(t,n,s);break;default:Pr(t,n,s)}}function _y(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 Wl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];bn=o,Cy(o,t)}_y(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ty(t),t=t.sibling}function Ty(t){switch(t.tag){case 0:case 11:case 15:Wl(t),t.flags&2048&&er(9,t,t.return);break;case 3:Wl(t);break;case 12:Wl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Zc(t)):Wl(t);break;default:Wl(t)}}function Zc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];bn=o,Cy(o,t)}_y(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:er(8,n,n.return),Zc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Zc(n));break;default:Zc(n)}t=t.sibling}}function Cy(t,n){for(;bn!==null;){var s=bn;switch(s.tag){case 0:case 11:case 15:er(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:zl(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,bn=o;else e:for(s=t;bn!==null;){o=bn;var f=o.sibling,m=o.return;if(xy(o),o===s){bn=null;break e}if(f!==null){f.return=m,bn=f;break e}bn=m}}}var OS={getCacheForType:function(t){var n=kn(tn),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return kn(tn).controller.signal}},MS=typeof WeakMap=="function"?WeakMap:Map,wt=0,zt=null,ct=null,dt=0,_t=0,ii=null,nr=!1,Rs=!1,yp=!1,_a=0,Yt=0,ir=0,Hr=0,Qc=0,ai=0,Ds=0,Jl=null,Kn=null,vp=!1,Wc=0,jy=0,Jc=1/0,eu=null,ar=null,Ft=0,Mi=null,Fr=null,Wi=0,wp=0,kp=null,Ay=null,zs=null,Ls=null,Is=null,eo=0,tu=null;function ri(){return(wt&2)!==0&&dt!==0?dt&-dt:Se.T!==null?Mp():Xo()}function Oy(){if(ai===0)if((dt&536870912)===0||rt){var t=La;La<<=1,(La&3932160)===0&&(La=262144),ai=t}else ai=536870912;return t=Nn.current,t!==null&&(t.flags|=32),ai}function Us(t,n){if(n!=null){var s=t.stateNode,o=s.ref;o===null&&(o=s.ref=d1(ga(t.memoizedProps,s))),Ls===null&&(Ls=[]),Ls.push(n.bind(null,o))}}function Xn(t,n,s){(t===zt&&(_t===2||_t===9)||t.cancelPendingCommit!==null)&&(Bs(t,0),rr(t,dt,ai,!1)),Er(t,s),((wt&2)===0||t!==zt)&&(t===zt&&((wt&2)===0&&(Hr|=s),Yt===4&&rr(t,dt,ai,!1)),Ji(t))}function My(t,n,s){if((wt&6)!==0)throw Error(r(327));var o=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Nr(t,n),f=o?zS(t,n):Ep(t,n,!0),m=o;do{if(f===0){Rs&&!o&&rr(t,n,0,!1);break}else{if(s=t.current.alternate,m&&!RS(s)){f=Ep(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 N=t;f=Jl;var I=N.current.memoizedState.isDehydrated;if(I&&(Bs(N,w).flags|=256),w=Ep(N,w,!1),w!==2&&w!==6){if(yp&&!I){N.errorRecoveryDisabledLanes|=m,Hr|=m,f=4;break e}m=Kn,Kn=f,m!==null&&(Kn===null?Kn=m:Kn.push.apply(Kn,m))}f=w}if(m=!1,f!==2)continue}}if(f===1){Bs(t,0),rr(t,n,0,!0);break}e:{switch(o=t,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:rr(o,n,ai,!nr);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Wc+300-Qt(),10<f)){if(rr(o,n,ai,!nr),Ua(o,0,!0)!==0)break e;Wi=n,o.timeoutHandle=Fp(Ry.bind(null,o,s,Kn,eu,vp,n,ai,Hr,Ds,nr,m,"Throttled",-0,0),f);break e}Ry(o,s,Kn,eu,vp,n,ai,Hr,Ds,nr,m,null,-0,0)}}break}while(!0);Ji(t)}function Ry(t,n,s,o,f,m,w,N,I,X,J,oe,Y,W){t.timeoutHandle=-1;var Ne=n.subtreeFlags,De=(m&335544064)===m;if(oe=null,(De||Ne&8192||(Ne&16785408)===16785408)&&(oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fi},ni=null,Sy(n,m,oe),De&&(Ne=oe,De=t.containerInfo,De=(De.nodeType===9?De:De.ownerDocument).__reactViewTransition,De!=null&&(Ne.count++,Ne.waitingForViewTransition=!0,Ne=oo.bind(Ne),De.finished.then(Ne,Ne))),Ne=(m&62914560)===m?Wc-Qt():(m&4194048)===m?jy-Qt():0,Ne=I_(oe,Ne),Ne!==null)){Wi=m,t.cancelPendingCommit=Ne(Py.bind(null,t,n,m,s,o,f,w,N,I,X,J,oe,null,Y,W)),rr(t,m,w,!X);return}Py(t,n,m,s,o,f,w,N,I,X,J,oe)}function RS(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 o=0;o<s.length;o++){var f=s[o],m=f.getSnapshot;f=f.value;try{if(!ei(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 rr(t,n,s,o){n=Vo(t,n),n&=~Qc,n&=~Hr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var m=31-_e(f),w=1<<m;o[m]=-1,f&=~w}s!==0&&Ko(t,s,n)}function nu(){return(wt&6)===0?(to(0),!1):!0}function Np(){if(ct!==null){if(_t===0)var t=ct.return;else t=ct,va=Ar=null,Of(t),Ss=null,Ul=0,t=ct;for(;t!==null;)ny(t.alternate,t),t=t.return;ct=null}}function Bs(t,n){var s=t.timeoutHandle;return s!==-1&&(t.timeoutHandle=-1,i_(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Wi=0,Np(),zt=t,ct=s=ba(t.current,null),dt=n,_t=0,ii=null,nr=!1,Rs=Nr(t,n),yp=!1,Ds=ai=Qc=Hr=ir=Yt=0,Kn=Jl=null,vp=!1,_a=Vo(t,n),uc(),s}function Dy(t,n){it=null,Se.H=zc,n===Es||n===wc?(n=Px(),_t=3):n===bf?(n=Px(),_t=4):_t=n===Yf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ii=n,ct===null&&(Yt=1,Lc(t,fi(n,t.current)))}function zy(){var t=Nn.current;return t===null?!0:(dt&4194048)===dt?jn===null:(dt&62914560)===dt||(dt&536870912)!==0?t===jn:!1}function Ly(){var t=Se.H;return Se.H=zc,t===null?zc:t}function Iy(){var t=Se.A;return Se.A=OS,t}function iu(){Yt=4,nr||(dt&4194048)!==dt&&Nn.current!==null||(Rs=!0),(ir&134217727)===0&&(Hr&134217727)===0||zt===null||rr(zt,dt,ai,!1)}function Ep(t,n,s){var o=wt;wt|=2;var f=Ly(),m=Iy();(zt!==t||dt!==n)&&(eu=null,Bs(t,n)),n=!1;var w=Yt;e:do try{if(_t!==0&&ct!==null){var N=ct,I=ii;switch(_t){case 8:Np(),w=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(n=!0);var X=_t;if(_t=0,ii=null,$s(t,N,I,X),s&&Rs){w=0;break e}break;default:X=_t,_t=0,ii=null,$s(t,N,I,X)}}DS(),w=Yt;break}catch(J){Dy(t,J)}while(!0);return n&&t.shellSuspendCounter++,va=Ar=null,wt=o,Se.H=f,Se.A=m,ct===null&&(zt=null,dt=0,uc()),w}function DS(){for(;ct!==null;)Uy(ct)}function zS(t,n){var s=wt;wt|=2;var o=Ly(),f=Iy();zt!==t||dt!==n?(eu=null,Jc=Qt()+500,Bs(t,n)):Rs=Nr(t,n);e:do try{if(_t!==0&&ct!==null){n=ct;var m=ii;t:switch(_t){case 1:_t=0,ii=null,$s(t,n,m,1);break;case 2:case 9:if(Bx(m)){_t=0,ii=null,By(n);break}n=function(){_t!==2&&_t!==9||zt!==t||(_t=7),Ji(t)},m.then(n,n);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:Bx(m)?(_t=0,ii=null,By(n)):(_t=0,ii=null,$s(t,n,m,7));break;case 5:var w=null;switch(ct.tag){case 26:w=ct.memoizedState;case 5:case 27:var N=ct;if(w?A1(w):N.stateNode.complete){_t=0,ii=null;var I=N.sibling;if(I!==null)ct=I;else{var X=N.return;X!==null?(ct=X,au(X)):ct=null}break t}}_t=0,ii=null,$s(t,n,m,5);break;case 6:_t=0,ii=null,$s(t,n,m,6);break;case 8:Np(),Yt=6;break e;default:throw Error(r(462))}}LS();break}catch(J){Dy(t,J)}while(!0);return va=Ar=null,Se.H=o,Se.A=f,wt=s,ct!==null?0:(zt=null,dt=0,uc(),Yt)}function LS(){for(;ct!==null&&!oa();)Uy(ct)}function Uy(t){var n=ey(t.alternate,t,_a);t.memoizedProps=t.pendingProps,n===null?au(t):ct=n}function By(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Vb(s,n,n.pendingProps,n.type,void 0,dt);break;case 11:n=Vb(s,n,n.pendingProps,n.type.render,n.ref,dt);break;case 5:Of(n);var o=n;o===gn&&(rt?(gc(o),o.tag===5&&o.stateNode!=null&&(Ut=o.stateNode)):(gc(o),rt=!0));default:ny(s,n),n=ct=Cx(n,_a),n=ey(s,n,_a)}t.memoizedProps=t.pendingProps,n===null?au(t):ct=n}function $s(t,n,s,o){va=Ar=null,Of(n),Ss=null,Ul=0;var f=n.return;try{if(NS(t,f,n,s,dt)){Yt=1,Lc(t,fi(s,t.current)),ct=null;return}}catch(m){if(f!==null)throw ct=f,m;Yt=1,Lc(t,fi(s,t.current)),ct=null;return}n.flags&32768?(rt||o===1?t=!0:Rs||(dt&536870912)!==0?t=!1:(nr=t=!0,(o===2||o===9||o===3||o===6)&&(o=Nn.current,o!==null&&o.tag===13&&(o.flags|=16384))),$y(n,t)):au(n)}function au(t){var n=t;do{if((n.flags&32768)!==0){$y(n,nr);return}t=n.return;var s=TS(n.alternate,n,_a);if(s!==null){ct=s;return}if(n=n.sibling,n!==null){ct=n;return}ct=n=t}while(n!==null);Yt===0&&(Yt=5)}function $y(t,n){do{var s=CS(t.alternate,t);if(s!==null){s.flags&=32767,ct=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){ct=t;return}ct=t=s}while(t!==null);Yt=6,ct=null}function Py(t,n,s,o,f,m,w,N,I,X,J,oe){t.cancelPendingCommit=null;do ru();while(Ft!==0);if((wt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));t===zt&&(ct=zt=null,dt=0),Fr=n,Mi=t,Wi=s,kp=f,Ay=o,IS(t,n,s,w,N,I,oe)}}function IS(t,n,s,o,f,m,w){var N=n.lanes|n.childLanes;if(wp=N,N|=rf,Ud(t,s,N,o,f,m),Ls=null,(s&335544064)===s?(Is=dS(t),o=10262):(Is=null,o=10256),(n.subtreeFlags&o)!==0||(n.flags&o)!==0?(t.callbackNode=null,t.callbackPriority=0,FS(_i,function(){return Cp(),null})):(t.callbackNode=null,t.callbackPriority=0),qc=!1,o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=Se.T,Se.T=null,f=H.p,H.p=2,m=wt,wt|=4;try{jS(t,n,s)}finally{wt=m,H.p=f,Se.T=o}}Ft=1,qc?zs=c_(w,t.containerInfo,Is,Sp,_p,BS,Tp,Cp,US):(Sp(),_p(),Tp())}function US(t){if(Ft!==0){var n=Mi.onRecoverableError;n(t,{componentStack:null})}}function BS(){Ft===3&&(Ft=0,Ny(Fr,Mi),Ft=4)}function Sp(){if(Ft===1){Ft=0;var t=Mi,n=Fr,s=Wi,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=Se.T,Se.T=null;var f=H.p;H.p=2;var m=wt;wt|=4;try{Zl=Vc=!1,wy(n,t,s),s=$p;var w=bx(t.containerInfo),N=s.focusedElem,I=s.selectionRange;if(w!==N&&N&&N.ownerDocument&&xx(N.ownerDocument.documentElement,N)){if(I!==null&&Jd(N)){var X=I.start,J=I.end;if(J===void 0&&(J=X),"selectionStart"in N)N.selectionStart=X,N.selectionEnd=Math.min(J,N.value.length);else{var oe=N.ownerDocument||document,Y=oe&&oe.defaultView||window;if(Y.getSelection){var W=Y.getSelection(),Ne=N.textContent.length,De=Math.min(I.start,Ne),at=I.end===void 0?De:Math.min(I.end,Ne);!W.extend&&De>at&&(w=at,at=De,De=w);var V=gx(N,De),q=gx(N,at);if(V&&q&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==q.node||W.focusOffset!==q.offset)){var Q=oe.createRange();Q.setStart(V.node,V.offset),W.removeAllRanges(),De>at?(W.addRange(Q),W.extend(q.node,q.offset)):(Q.setEnd(q.node,q.offset),W.addRange(Q))}}}}for(oe=[],W=N;W=W.parentNode;)W.nodeType===1&&oe.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<oe.length;N++){var le=oe[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Ks=!!Bp,$p=Bp=null}finally{wt=m,H.p=f,Se.T=o}}t.current=n,Ft=2}}function _p(){if(Ft===2){Ft=0;var t=Mi,n=Fr,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=Se.T,Se.T=null;var o=H.p;H.p=2;var f=wt;wt|=4;try{hy(t,n.alternate,n)}finally{wt=f,H.p=o,Se.T=s}}Ft=3}}function Tp(){if(Ft===4||Ft===3){Ft=0;var t=zs;zs=null,za();var n=Mi,s=Fr,o=Wi,f=Ay,m=(o&335544064)===o?10262:10256;if((s.subtreeFlags&m)!==0||(s.flags&m)!==0?Ft=5:(Ft=0,Fr=Mi=null,Hy(n,n.pendingLanes)),m=n.pendingLanes,m===0&&(ar=null),kl(o),s=s.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Dt,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=Se.T,m=H.p,H.p=2,Se.T=null;try{for(var w=n.onRecoverableError,N=0;N<f.length;N++){var I=f[N];w(I.value,{componentStack:I.stack})}}finally{Se.T=s,H.p=m}}if(f=Ls,w=Is,Is=null,f!==null&&(Ls=null,w===null&&(w=[]),t!==null))for(I=0;I<f.length;I++)s=(0,f[I])(w),s!==void 0&&t.finished.finally(s);(Wi&3)!==0&&ru(),Ji(n),m=n.pendingLanes,(o&261930)!==0&&(m&42)!==0?n===tu?eo++:(eo=0,tu=n):(eo=0,tu=null),to(0)}}function Hy(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,zl(n)))}function ru(){return zs!==null&&(zs.skipTransition(),zs=null),Sp(),_p(),Tp(),Cp()}function Cp(){if(Ft!==5)return!1;var t=Mi,n=wp;wp=0;var s=kl(Wi),o=Se.T,f=H.p;try{H.p=32>s?32:s,Se.T=null,s=kp,kp=null;var m=Mi,w=Wi;if(Ft=0,Fr=Mi=null,Wi=0,(wt&6)!==0)throw Error(r(331));var N=wt;if(wt|=4,Ty(m.current),Ey(m,m.current,w,s),wt=N,to(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Dt,m)}catch{}return!0}finally{H.p=f,Se.T=o,Hy(t,n)}}function Fy(t,n,s){n=fi(s,n),n=Gf(t.stateNode,n,2),t=Za(t,n,2),t!==null&&(Er(t,2),Ji(t))}function Tt(t,n,s){if(t.tag===3)Fy(t,t,s);else for(;n!==null;){if(n.tag===3){Fy(n,t,s);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ar===null||!ar.has(o))){t=fi(s,t),s=Bb(2),o=Za(n,s,2),o!==null&&($b(s,o,n,t),Er(o,2),Ji(o));break}}n=n.return}}function jp(t,n,s){var o=t.pingCache;if(o===null){o=t.pingCache=new MS;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(s)||(yp=!0,f.add(s),t=$S.bind(null,t,n,s),n.then(t,t))}function $S(t,n,s){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,zt===t&&(dt&s)===s&&((Yt===4||Yt===3&&(dt&62914560)===dt&&300>Qt()-Wc)&&(wt&2)===0?Bs(t,0):Qc|=s,Ds===dt&&(Ds=0)),Ji(t)}function qy(t,n){n===0&&(n=vl()),t=Tr(t,n),t!==null&&(Er(t,n),Ji(t))}function PS(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),qy(t,s)}function HS(t,n){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(s=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),qy(t,s)}function FS(t,n){return Ni(t,n)}var Ps=null,Hs=null,Ap=!1,su=!1,Op=!1,sr=0;function Ji(t){t!==Hs&&t.next===null&&(Hs===null?Ps=Hs=t:Hs=Hs.next=t),su=!0,Ap||(Ap=!0,GS())}function to(t,n){if(!Op&&su){Op=!0;do for(var s=!1,o=Ps;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var m=0;else{var w=o.suspendedLanes,N=o.pingedLanes;m=(1<<31-_e(42|t)+1)-1,m&=f&~(w&~N),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,Ky(o,m))}else m=dt,m=Ua(o,o===zt?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||Nr(o,m)||(s=!0,Ky(o,m));o=o.next}while(s);Op=!1}}function qS(){Gy()}function Gy(){su=Ap=!1;var t=0;sr!==0&&n_()&&(t=sr);for(var n=Qt(),s=null,o=Ps;o!==null;){var f=o.next,m=Yy(o,n);m===0?(o.next=null,s===null?Ps=f:s.next=f,f===null&&(Hs=s)):(s=o,(t!==0||(m&3)!==0)&&(su=!0)),o=f}Ft!==0&&Ft!==5||to(t),sr!==0&&(sr=0)}function Yy(t,n){for(var s=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var w=31-_e(m),N=1<<w,I=f[w];I===-1?((N&s)===0||(N&o)!==0)&&(f[w]=Id(N,n)):I<=n&&(t.expiredLanes|=N),m&=~N}if(n=zt,s=dt,s=Ua(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===n&&(_t===2||_t===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Ei(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Nr(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(o!==null&&Ei(o),kl(s)){case 2:case 8:s=zn;break;case 32:s=_i;break;case 268435456:s=de;break;default:s=_i}return o=Vy.bind(null,t),s=Ni(s,o),t.callbackPriority=n,t.callbackNode=s,n}return o!==null&&o!==null&&Ei(o),t.callbackPriority=2,t.callbackNode=null,2}function Vy(t,n){if(Ft!==0&&Ft!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(ru()&&t.callbackNode!==s)return null;var o=dt;return o=Ua(t,t===zt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(My(t,o,n),Yy(t,Qt()),t.callbackNode!=null&&t.callbackNode===s?Vy.bind(null,t):null)}function Ky(t,n){if(ru())return null;My(t,n,!0)}function GS(){a_(function(){(wt&6)!==0?Ni(Si,qS):Gy()})}function Mp(){if(sr===0){var t=Rr;t===0&&(t=Hi,Hi<<=1,(Hi&261888)===0&&(Hi=256)),sr=t}return sr}function Xy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:nc(t)}function YS(t,n,s,o,f){if(n==="submit"&&s&&s.stateNode===f){var m=Xy((f[ge]||null).action),w=o.submitter;w&&(n=(n=w[ge]||null)?Xy(n.formAction):w.getAttribute("formAction"),n!==null&&(m=n,w=null));var N=new sc("action","action",null,o,f);t.push({event:N,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(sr!==0){var I=new FormData(f,w);$f(s,{pending:!0,data:I,method:f.method,action:m},null,I)}}else typeof m=="function"&&(N.preventDefault(),I=new FormData(f,w),$f(s,{pending:!0,data:I,method:f.method,action:m},m,I))},currentTarget:f}]})}}for(var Rp=0;Rp<af.length;Rp++){var Dp=af[Rp],VS=Dp.toLowerCase(),KS=Dp[0].toUpperCase()+Dp.slice(1);Ci(VS,"on"+KS)}Ci(wx,"onAnimationEnd"),Ci(kx,"onAnimationIteration"),Ci(Nx,"onAnimationStart"),Ci("dblclick","onDoubleClick"),Ci("focusin","onFocus"),Ci("focusout","onBlur"),Ci(iS,"onTransitionRun"),Ci(aS,"onTransitionStart"),Ci(rS,"onTransitionCancel"),Ci(Ex,"onTransitionEnd"),pa("onMouseEnter",["mouseout","mouseover"]),pa("onMouseLeave",["mouseout","mouseover"]),pa("onPointerEnter",["pointerout","pointerover"]),pa("onPointerLeave",["pointerout","pointerover"]),ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ci("onBeforeInput",["compositionend","keypress","textInput","paste"]),ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var no="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(" "),XS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(no));function Zy(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],f=o.event;o=o.listeners;e:{var m=void 0;if(n)for(var w=o.length-1;0<=w;w--){var N=o[w],I=N.instance,X=N.currentTarget;if(N=N.listener,I!==m&&f.isPropagationStopped())break e;m=N,f.currentTarget=X;try{m(f)}catch(J){cc(J)}f.currentTarget=null,m=I}else for(w=0;w<o.length;w++){if(N=o[w],I=N.instance,X=N.currentTarget,N=N.listener,I!==m&&f.isPropagationStopped())break e;m=N,f.currentTarget=X;try{m(f)}catch(J){cc(J)}f.currentTarget=null,m=I}}}}function ut(t,n){var s=n[lt];s===void 0&&(s=n[lt]=new Set);var o=t+"__bubble";s.has(o)||(Qy(n,t,2,!1),s.add(o))}function zp(t,n,s){var o=0;n&&(o|=4),Qy(s,t,o,n)}var lu="_reactListening"+Math.random().toString(36).slice(2);function Lp(t){if(!t[lu]){t[lu]=!0,Wo.forEach(function(s){s!=="selectionchange"&&(XS.has(s)||zp(s,!1,t),zp(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[lu]||(n[lu]=!0,zp("selectionchange",!1,n))}}function Qy(t,n,s,o){switch($1(n)){case 2:var f=P_;break;case 8:f=H_;break;default:f=nm}s=f.bind(null,n,s,t),f=void 0,!Fd||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?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 Ip(t,n,s,o,f){var m=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var w=o.tag;if(w===3||w===4){var N=o.stateNode.containerInfo;if(N===f)break;if(w===4)for(w=o.return;w!==null;){var I=w.tag;if((I===3||I===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;N!==null;){if(w=hn(N),w===null)return;if(I=w.tag,I===5||I===6||I===26||I===27){o=m=w;continue e}N=N.parentNode}}o=o.return}Qg(function(){var X=m,J=Pd(s),oe=[];e:{var Y=Sx.get(t);if(Y!==void 0){var W=sc,Ne=t;switch(t){case"keypress":if(ac(s)===0)break e;case"keydown":case"keyup":W=RE;break;case"focusin":Ne="focus",W=Vd;break;case"focusout":Ne="blur",W=Vd;break;case"beforeblur":case"afterblur":W=Vd;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":W=ex;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=wE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=UE;break;case wx:case kx:case Nx:W=EE;break;case Ex:W=$E;break;case"scroll":case"scrollend":W=yE;break;case"wheel":W=HE;break;case"copy":case"cut":case"paste":W=_E;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=nx;break;case"submit":W=LE;break;case"toggle":case"beforetoggle":W=qE}var De=(n&4)!==0,at=!De&&(t==="scroll"||t==="scrollend"),V=De?Y!==null?Y+"Capture":null:Y;De=[];for(var q=X,Q;q!==null;){var le=q;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||V===null||(le=El(q,V),le!=null&&De.push(io(q,le,Q))),at)break;q=q.return}0<De.length&&(Y=new W(Y,Ne,null,s,J),oe.push({event:Y,listeners:De}))}}if((n&7)===0){e:{if(W=t==="mouseover"||t==="pointerover",Y=t==="mouseout"||t==="pointerout",W&&s!==$d&&(Ne=s.relatedTarget||s.fromElement)&&(hn(Ne)||Ne[Ie]))break e;(Y||W)&&(Ne=J.window===J?J:(W=J.ownerDocument)?W.defaultView||W.parentWindow:window,Y?(W=s.relatedTarget||s.toElement,Y=X,W=W?hn(W):null,W!==null&&(at=u(W),De=W.tag,W!==at||De!==5&&De!==27&&De!==6)&&(W=null)):(Y=null,W=X),Y!==W&&(De=ex,le="onMouseLeave",V="onMouseEnter",q="mouse",(t==="pointerout"||t==="pointerover")&&(De=nx,le="onPointerLeave",V="onPointerEnter",q="pointer"),at=Y==null?Ne:$a(Y),Q=W==null?Ne:$a(W),Ne=new De(le,q+"leave",Y,s,J),Ne.target=at,Ne.relatedTarget=Q,le=null,hn(J)===X&&(De=new De(V,q+"enter",W,s,J),De.target=Q,De.relatedTarget=at,le=De),at=le,De=Y&&W?z(Y,W,ZS):null,Y!==null&&Wy(oe,Ne,Y,De,!1),W!==null&&at!==null&&Wy(oe,at,W,De,!0)))}e:{if(Y=X?$a(X):window,W=Y.nodeName&&Y.nodeName.toLowerCase(),W==="select"||W==="input"&&Y.type==="file")var Me=ux;else if(ox(Y))if(dx)Me=eS;else{Me=WE;var ft=QE}else W=Y.nodeName,!W||W.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?X&&Bd(X.elementType)&&(Me=ux):Me=JE;if(Me&&(Me=Me(t,X))){cx(oe,Me,s,J);break e}ft&&ft(t,Y,X)}switch(ft=X?$a(X):window,t){case"focusin":(ox(ft)||ft.contentEditable==="true")&&(gs=ft,ef=X,Ml=null);break;case"focusout":Ml=ef=gs=null;break;case"mousedown":tf=!0;break;case"contextmenu":case"mouseup":case"dragend":tf=!1,yx(oe,s,J);break;case"selectionchange":if(nS)break;case"keydown":case"keyup":yx(oe,s,J)}var $e;if(Xd)e:{switch(t){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else hs?sx(t,s)&&(Ye="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Ye="onCompositionStart");Ye&&(ix&&s.locale!=="ko"&&(hs||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&hs&&($e=Wg()):(Pa=J,qd="value"in Pa?Pa.value:Pa.textContent,hs=!0)),ft=ou(X,Ye),0<ft.length&&(Ye=new tx(Ye,t,null,s,J),oe.push({event:Ye,listeners:ft}),$e?Ye.data=$e:($e=lx(s),$e!==null&&(Ye.data=$e)))),($e=YE?VE(t,s):KE(t,s))&&(Ye=ou(X,"onBeforeInput"),0<Ye.length&&(ft=new tx("onBeforeInput","beforeinput",null,s,J),oe.push({event:ft,listeners:Ye}),ft.data=$e)),YS(oe,t,X,s,J)}Zy(oe,n)})}function io(t,n,s){return{instance:t,listener:n,currentTarget:s}}function ou(t,n){for(var s=n+"Capture",o=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=El(t,s),f!=null&&o.unshift(io(t,f,m)),f=El(t,n),f!=null&&o.push(io(t,f,m))),t.tag===3)return o;t=t.return}return[]}function ZS(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Wy(t,n,s,o,f){for(var m=n._reactName,w=[];s!==null&&s!==o;){var N=s,I=N.alternate,X=N.stateNode;if(N=N.tag,I!==null&&I===o)break;N!==5&&N!==26&&N!==27||X===null||(I=X,f?(X=El(s,m),X!=null&&w.unshift(io(s,X,I))):f||(X=El(s,m),X!=null&&w.push(io(s,X,I)))),s=s.return}w.length!==0&&t.push({event:n,listeners:w})}var QS=/\r\n?/g,WS=/\u0000|\uFFFD/g;function Jy(t){return(typeof t=="string"?t:""+t).replace(QS,`
|
|
9
|
+
`).replace(WS,"")}function e1(t,n){return n=Jy(n),Jy(t)===n}function Ct(t,n,s,o,f,m){switch(s){case"children":if(typeof o=="string")n==="body"||n==="textarea"&&o===""||fs(t,o);else if(typeof o=="number"||typeof o=="bigint")n!=="body"&&fs(t,""+o);else return;break;case"className":ma(t,"class",o);break;case"tabIndex":ma(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ma(t,s,o);break;case"style":Xg(t,o,m);return;case"data":if(n!=="object"){ma(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=nc(o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="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(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=nc(o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Fi);return;case"onScroll":o!=null&&ut("scroll",t);return;case"onScrollEnd":o!=null&&ut("scrollend",t);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(r(60));m?.__html!==s&&(t.innerHTML=s)}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=nc(o),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":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":ut("beforetoggle",t),ut("toggle",t),yt(t,"popover",o);break;case"xlinkActuate":vn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":vn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":vn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":vn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":vn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":vn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":vn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":vn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":vn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":yt(t,"is",o);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=xE.get(s)||s,yt(t,s,o);else return}mt=!0}function Up(t,n,s,o,f,m){switch(s){case"style":Xg(t,o,m);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(r(60));m?.__html!==s&&(t.innerHTML=s)}}break;case"children":if(typeof o=="string")fs(t,o);else if(typeof o=="number"||typeof o=="bigint")fs(t,""+o);else return;break;case"onScroll":o!=null&&ut("scroll",t);return;case"onScrollEnd":o!=null&&ut("scrollend",t);return;case"onClick":o!=null&&(t.onclick=Fi);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 o=="function")){typeof n!="function"&&n!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(m,o,f);break e}mt=!0,s in t?t[s]=o:o===!0?t.setAttribute(s,""):yt(t,s,o)}return}mt=!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":ut("error",t),ut("load",t);var o=!1,f=!1,m;for(m in s)if(s.hasOwnProperty(m)){var w=s[m];if(w!=null)switch(m){case"src":o=!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),o&&Ct(t,n,"src",s.src,s,null);return;case"input":ut("invalid",t);var N=m=w=f=null,I=null,X=null;for(o in s)if(s.hasOwnProperty(o)){var J=s[o];if(J!=null)switch(o){case"name":f=J;break;case"type":w=J;break;case"checked":I=J;break;case"defaultChecked":X=J;break;case"value":m=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:Ct(t,n,o,J,s,null)}}tc(t,m,N,I,X,w,f,!1);return;case"select":ut("invalid",t),o=w=m=null;for(f in s)if(s.hasOwnProperty(f)&&(N=s[f],N!=null))switch(f){case"value":m=N;break;case"defaultValue":w=N;break;case"multiple":o=N;default:Ct(t,n,f,N,s,null)}n=m,s=w,t.multiple=!!o,n!=null?ds(t,!!o,n,!1):s!=null&&ds(t,!!o,s,!0);return;case"textarea":ut("invalid",t),m=f=o=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":o=N;break;case"defaultValue":f=N;break;case"children":m=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:Ct(t,n,w,N,s,null)}Vg(t,o,f,m);return;case"option":for(I in s)s.hasOwnProperty(I)&&(o=s[I],o!=null)&&(I==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":Ct(t,n,I,o,s,null));return;case"dialog":ut("beforetoggle",t),ut("toggle",t),ut("cancel",t),ut("close",t);break;case"iframe":case"object":ut("load",t);break;case"video":case"audio":for(o=0;o<no.length;o++)ut(no[o],t);break;case"image":ut("error",t),ut("load",t);break;case"details":ut("toggle",t);break;case"embed":case"source":case"link":ut("error",t),ut("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(X in s)if(s.hasOwnProperty(X)&&(o=s[X],o!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Ct(t,n,X,o,s,null)}return;default:if(Bd(n)){for(J in s)s.hasOwnProperty(J)&&(o=s[J],o!==void 0&&Up(t,n,J,o,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(o=s[N],o!=null&&Ct(t,n,N,o,s,null))}var JS={};function e_(t,n,s,o){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,N=null,I=null,X=null,J=null;for(W in s){var oe=s[W];if(s.hasOwnProperty(W)&&oe!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":I=oe;default:o.hasOwnProperty(W)||Ct(t,n,W,null,o,oe)}}for(var Y in o){var W=o[Y];if(oe=s[Y],o.hasOwnProperty(Y)&&(W!=null||oe!=null))switch(Y){case"type":W!==oe&&(mt=!0),m=W;break;case"name":W!==oe&&(mt=!0),f=W;break;case"checked":W!==oe&&(mt=!0),X=W;break;case"defaultChecked":W!==oe&&(mt=!0),J=W;break;case"value":W!==oe&&(mt=!0),w=W;break;case"defaultValue":W!==oe&&(mt=!0),N=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:W!==oe&&Ct(t,n,Y,W,o,oe)}}Jn(t,w,N,I,X,J,m,f);return;case"select":W=w=N=Y=null;for(m in s)if(I=s[m],s.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":W=I;default:o.hasOwnProperty(m)||Ct(t,n,m,null,o,I)}for(f in o)if(m=o[f],I=s[f],o.hasOwnProperty(f)&&(m!=null||I!=null))switch(f){case"value":m!==I&&(mt=!0),Y=m;break;case"defaultValue":m!==I&&(mt=!0),N=m;break;case"multiple":m!==I&&(mt=!0),w=m;default:m!==I&&Ct(t,n,f,m,o,I)}n=N,s=w,o=W,Y!=null?ds(t,!!s,Y,!1):!!o!=!!s&&(n!=null?ds(t,!!s,n,!0):ds(t,!!s,s?[]:"",!1));return;case"textarea":W=Y=null;for(N in s)if(f=s[N],s.hasOwnProperty(N)&&f!=null&&!o.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ct(t,n,N,null,o,f)}for(w in o)if(f=o[w],m=s[w],o.hasOwnProperty(w)&&(f!=null||m!=null))switch(w){case"value":f!==m&&(mt=!0),Y=f;break;case"defaultValue":f!==m&&(mt=!0),W=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&Ct(t,n,w,f,o,m)}Yg(t,Y,W);return;case"option":for(var Ne in s)Y=s[Ne],s.hasOwnProperty(Ne)&&Y!=null&&!o.hasOwnProperty(Ne)&&(Ne==="selected"?t.selected=!1:Ct(t,n,Ne,null,o,Y));for(I in o)Y=o[I],W=s[I],o.hasOwnProperty(I)&&Y!==W&&(Y!=null||W!=null)&&(I==="selected"?(Y!==W&&(mt=!0),t.selected=Y&&typeof Y!="function"&&typeof Y!="symbol"):Ct(t,n,I,Y,o,W));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 De in s)Y=s[De],s.hasOwnProperty(De)&&Y!=null&&!o.hasOwnProperty(De)&&Ct(t,n,De,null,o,Y);for(X in o)if(Y=o[X],W=s[X],o.hasOwnProperty(X)&&Y!==W&&(Y!=null||W!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,n));break;default:Ct(t,n,X,Y,o,W)}return;default:if(Bd(n)){for(var at in s)Y=s[at],s.hasOwnProperty(at)&&Y!==void 0&&!o.hasOwnProperty(at)&&Up(t,n,at,void 0,o,Y);for(J in o)Y=o[J],W=s[J],!o.hasOwnProperty(J)||Y===W||Y===void 0&&W===void 0||Up(t,n,J,Y,o,W);return}}for(var V in s)Y=s[V],s.hasOwnProperty(V)&&Y!=null&&!o.hasOwnProperty(V)&&Ct(t,n,V,null,o,Y);for(oe in o)Y=o[oe],W=s[oe],!o.hasOwnProperty(oe)||Y===W||Y==null&&W==null||Ct(t,n,oe,Y,o,W)}function t1(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function t_(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var f=s[o],m=f.transferSize,w=f.initiatorType,N=f.duration;if(m&&N&&t1(w)){for(w=0,N=f.responseEnd,o+=1;o<s.length;o++){var I=s[o],X=I.startTime;if(X>N)break;var J=I.transferSize,oe=I.initiatorType;J&&t1(oe)&&(I=I.responseEnd,w+=J*(I<N?1:(N-X)/(I-X)))}if(--o,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 Bp=null,$p=null;function ao(t){return t.nodeType===9?t:t.ownerDocument}function n1(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 i1(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 a1(t,n,s,o){return s=ao(s).createElement(t),s[un]=o,s[ge]=n,_n(s,t,n),Jt(s),s}function Pp(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 Hp=null;function n_(){var t=window.event;return t&&t.type==="popstate"?t===Hp?!1:(Hp=t,!0):(Hp=null,!1)}var Fp=typeof setTimeout=="function"?setTimeout:void 0,i_=typeof clearTimeout=="function"?clearTimeout:void 0,r1=typeof Promise=="function"?Promise:void 0,s1=typeof requestAnimationFrame=="function"?requestAnimationFrame:Fp,a_=typeof queueMicrotask=="function"?queueMicrotask:typeof r1<"u"?function(t){return r1.resolve(null).then(t).catch(r_)}:Fp;function r_(t){setTimeout(function(){throw t})}function lr(t){return t==="head"}function l1(t,n){var s=n,o=0;do{var f=s.nextSibling;if(t.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(f),Xs(n);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;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,N=m.nodeName;m[qn]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=w}}else s==="body"&&Qp(t.ownerDocument.body);s=f}while(s);Xs(n)}function o1(t,n){var s=t;t=0;do{var o=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||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function c1(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 o=1;else for(var f=o=0;f<n.length;f++){var m=n[f];0<m.width&&0<m.height&&o++}o===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+s.paddingTop,t.marginBottom="-"+s.paddingBottom)}}function u1(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 s_(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 qp(t){var n=t.getBoundingClientRect(),s=getComputedStyle(t);return s_(n,s,t)}function l_(t){return t.documentElement.clientHeight}function o_(t){this.addEventListener("load",t),this.addEventListener("error",t)}function c_(t,n,s,o,f,m,w,N,I){var X=n.nodeType===9?n:n.ownerDocument;try{var J=X.startViewTransition({update:function(){var Y=X.defaultView,W=Y.navigation&&Y.navigation.transition,Ne=X.fonts.status;o();var De=[];if(Ne==="loaded"&&(l_(X),X.fonts.status==="loading"&&De.push(X.fonts.ready)),Ne=De.length,t!==null)for(var at=t.suspenseyImages,V=0,q=0;q<at.length;q++){var Q=at[q];if(!Q.complete){var le=Q.getBoundingClientRect();if(0<le.bottom&&0<le.right&&le.top<Y.innerHeight&&le.left<Y.innerWidth){if(V+=O1(Q),V>du){De.length=Ne;break}Q=new Promise(o_.bind(Q)),De.push(Q)}}}if(0<De.length)return Y=Promise.race([Promise.all(De),new Promise(function(Me){return setTimeout(Me,500)})]).then(f,f),(W?Promise.allSettled([W.finished,Y]):Y).then(m,m);if(f(),W)return W.finished.then(m,m);m()},types:s});X.__reactViewTransition=J;var oe=[];return J.ready.then(function(){for(var Y=X.documentElement.getAnimations({subtree:!0}),W=0;W<Y.length;W++){var Ne=Y[W],De=Ne.effect,at=De.pseudoElement;if(at!=null&&at.startsWith("::view-transition")){oe.push(Ne),Ne=De.getKeyframes();for(var V=at=void 0,q=!0,Q=0;Q<Ne.length;Q++){var le=Ne[Q],Me=le.width;if(at===void 0)at=Me;else if(at!==Me){q=!1;break}if(Me=le.height,V===void 0)V=Me;else if(V!==Me){q=!1;break}delete le.width,delete le.height,le.transform==="none"&&delete le.transform}q&&at!==void 0&&V!==void 0&&(De.setKeyframes(Ne),q=getComputedStyle(De.target,De.pseudoElement),q.width!==at||q.height!==V)&&(q=Ne[0],q.width=at,q.height=V,q=Ne[Ne.length-1],q.width=at,q.height=V,De.setKeyframes(Ne))}}w()},function(Y){X.__reactViewTransition===J&&(X.__reactViewTransition=null);try{typeof Y=="object"&&Y!==null&&Y.name==="InvalidStateError"&&(Y.message==="View transition was skipped because document visibility state is hidden."||Y.message==="Skipping view transition because document visibility state has become hidden."||Y.message==="Skipping view transition because viewport size changed."||Y.message==="Transition was aborted because of invalid state")&&(Y=null),Y!==null&&I(Y)}finally{o(),f(),w()}}),J.finished.finally(function(){for(var Y=0;Y<oe.length;Y++)oe[Y].cancel();X.__reactViewTransition===J&&(X.__reactViewTransition=null),N()}),J}catch{return o(),f(),w(),null}}function qr(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}qr.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:C({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},qr.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,s=t.getAnimations({subtree:!0}),o=[],f=0;f<s.length;f++){var m=s[f].effect;m!==null&&m.target===t&&m.pseudoElement===n&&o.push(s[f])}return o},qr.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function d1(t){return{name:t,group:new qr("group",t),imagePair:new qr("image-pair",t),old:new qr("old",t),new:new qr("new",t)}}function si(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}si.prototype.addEventListener=function(t,n,s){var o=null,f=null;if(!(s!=null&&typeof s!="boolean"&&(o=s.signal||null,o!==null&&o.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var m=this._eventListeners;if(p1(m,t,n,s)===-1){var w=this,N=n;s!=null&&typeof s!="boolean"&&s.once===!0&&(N=function(I){w.removeEventListener(t,n,s),typeof n=="function"?n.call(this,I):n.handleEvent(I)}),o!==null&&(f=w.removeEventListener.bind(w,t,n,s),o.addEventListener("abort",f,{once:!0}),f=o.removeEventListener.bind(o,"abort",f)),o=Fs(s),m.push({type:t,listener:n,optionsOrUseCapture:s,attachedListener:N,cleanup:f}),x(this._fragmentFiber.child,!1,u_,t,N,o)}this._eventListeners=m}};function u_(t,n,s,o){return j(t).addEventListener(n,s,o),!1}si.prototype.removeEventListener=function(t,n,s){var o=this._eventListeners;if(o!==null&&(n=p1(o,t,n,s),n!==-1)){var f=o[n];s=f.attachedListener;var m=f.cleanup;f=Fs(f.optionsOrUseCapture),x(this._fragmentFiber.child,!1,d_,t,s,f),o.splice(n,1),m!==null&&m()}};function d_(t,n,s,o){return j(t).removeEventListener(n,s,o),!1}function Fs(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function f1(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function p1(t,n,s,o){if(t.length===0)return-1;o=f1(o);for(var f=0;f<t.length;f++){var m=t[f];if(m.type===n&&m.listener===s&&f1(m.optionsOrUseCapture)===o)return f}return-1}si.prototype.dispatchEvent=function(t){var n=v(this._fragmentFiber);if(n===null)return!0;n=j(n);var s=this._eventListeners;if(s!==null&&0<s.length||!t.bubbles){var o=n.nodeType===9?n.createComment(""):document.createTextNode("");if(s)for(var f=0;f<s.length;f++){var m=s[f];o.addEventListener(m.type,m.attachedListener,Fs(m.optionsOrUseCapture))}if(n.appendChild(o),t=o.dispatchEvent(t),s)for(f=0;f<s.length;f++)m=s[f],o.removeEventListener(m.type,m.attachedListener,Fs(m.optionsOrUseCapture));return n.removeChild(o),t}return n.dispatchEvent(t)},si.prototype.focus=function(t){x(this._fragmentFiber.child,!0,m1,t,void 0,void 0)};function m1(t,n){return t.tag===6?!1:(t=j(t),N_(t,n))}si.prototype.focusLast=function(t){var n=[];x(this._fragmentFiber.child,!0,Gp,n,void 0,void 0);for(var s=n.length-1;0<=s&&!m1(n[s],t);s--);};function Gp(t,n){return n.push(t),!1}si.prototype.blur=function(){var t=v(this._fragmentFiber);t!==null&&(t=j(t),t=ao(t).activeElement,t!==null&&x(this._fragmentFiber.child,!1,f_,t,void 0,void 0))};function f_(t,n){return t.tag===6?!1:(t=j(t),t===n||t.contains(n)?(n.blur(),!0):!1)}si.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),x(this._fragmentFiber.child,!1,p_,t,void 0,void 0)};function p_(t,n){return t.tag===6||(t=j(t),n.observe(t)),!1}si.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),x(this._fragmentFiber.child,!1,m_,t,void 0,void 0);for(var s=n=0;s<Ri.length;s++){var o=Ri[s];o.fragmentInstance===this&&o.observer===t?t.unobserve(o.instance):Ri[n++]=o}Ri.length=n}};function m_(t,n){return t.tag===6||(t=j(t),n.unobserve(t)),!1}var Ri=[],Yp=!1;function h_(t,n,s){Ri.push({fragmentInstance:t,observer:n,instance:s}),Yp||(Yp=!0,E_(function(){Yp=!1;var o=Ri;Ri=[];for(var f=0;f<o.length;f++){var m=o[f];m.observer.unobserve(m.instance)}}))}si.prototype.getClientRects=function(){var t=[];return x(this._fragmentFiber.child,!1,g_,t,void 0,void 0),t};function g_(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=j(t),n.push.apply(n,t.getClientRects());return!1}si.prototype.getRootNode=function(t){var n=v(this._fragmentFiber);return n===null?this:j(n).getRootNode(t)},si.prototype.compareDocumentPosition=function(t){var n=v(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];x(this._fragmentFiber.child,!1,Gp,s,void 0,void 0);var o=j(n);if(s.length===0){if(s=o,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=o=s.compareDocumentPosition(t);return s===t?f=Node.DOCUMENT_POSITION_CONTAINS:o&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=k(n)[1],s===null?f=Node.DOCUMENT_POSITION_PRECEDING:(t=j(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=j(s[0]),f=j(s[s.length-1]);var m=y(this._fragmentFiber)?n.parentElement:o;if(m==null)return Node.DOCUMENT_POSITION_DISCONNECTED;o=m.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,m=m.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var w=n.compareDocumentPosition(t),N=f.compareDocumentPosition(t),I=w&Node.DOCUMENT_POSITION_CONTAINED_BY||N&Node.DOCUMENT_POSITION_CONTAINED_BY;return N=o&&m&&w&Node.DOCUMENT_POSITION_FOLLOWING&&N&Node.DOCUMENT_POSITION_PRECEDING,n=o&&n===t||m&&f===t||I||N?Node.DOCUMENT_POSITION_CONTAINED_BY:!o&&n===t||!m&&f===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:w,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||x_(n,this._fragmentFiber,s[0],s[s.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function x_(t,n,s,o,f){var m=hn(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=z(s,m,P),n===null?n=!1:(x(n,!0,T,m,s),m=E,E=null,n=m!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!m)&&!(n=m===o)&&(n=z(o,m,P),n===null?n=!1:(x(n,!0,R,m,o),m=E,A=E=null,n=m!==null)),n):!1}function h1(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)}si.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(r(566));var n=[];x(this._fragmentFiber.child,!1,Gp,n,void 0,void 0);var s=t!==!1;if(n.length===0){var o=k(this._fragmentFiber);if(o=s?o[1]||o[0]||v(this._fragmentFiber):o[0]||o[1],o===null)return;if(o.tag===6){t=j(o),h1(t,s);return}if(o=j(o),o.nodeType!==9){if(o.nodeType===11){s="host"in o?o.host:null,s!==null&&s.scrollIntoView(t);return}o.scrollIntoView(t)}}for(o=s?n.length-1:0;o!==(s?-1:n.length);){var f=n[o];f.tag===6?(f=j(f),h1(f,s)):j(f).scrollIntoView(t),o+=s?-1:1}};function b_(t,n){return t=j(t),g1(t,n),!1}function g1(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function x1(t,n){var s=n._eventListeners;if(s!==null)for(var o=0;o<s.length;o++){var f=s[o];t.addEventListener(f.type,f.attachedListener,Fs(f.optionsOrUseCapture))}t.nodeType!==3&&(s=n._observers,s!==null&&s.forEach(function(m){for(var w=0,N=0;N<Ri.length;N++){var I=Ri[N];(I.fragmentInstance!==n||I.observer!==m||I.instance!==t)&&(Ri[w++]=I)}Ri.length=w,m.observe(t)}),g1(t,n))}function y_(t,n){var s=n._eventListeners;if(s!==null)for(var o=0;o<s.length;o++){var f=s[o];t.removeEventListener(f.type,f.attachedListener,Fs(f.optionsOrUseCapture))}t.nodeType!==3&&(s=n._observers,s!==null&&s.forEach(function(m){typeof m.rootMargin=="string"?h_(n,m,t):m.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function Vp(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":Vp(s),mn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function v_(t,n,s,o){for(;t.nodeType===1;){var f=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){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=xi(t.nextSibling),t===null)break}return null}function w_(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=xi(t.nextSibling),t===null))return null;return t}function b1(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=xi(t.nextSibling),t===null))return null;return t}function Kp(t){return t.data==="$?"||t.data==="$~"}function Xp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function k_(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var o=function(){n(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function xi(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 Zp=null;function y1(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return xi(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function v1(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 N_(t,n){function s(){o=!0}if(t.ownerDocument.activeElement===t)return!0;var o=!1;try{t.ownerDocument.addEventListener("focus",s,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",s,!0)}return o}function E_(t){s1(function(){s1(function(n){return t(n)})})}function w1(t,n,s){switch(n=ao(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 k1(t,n,s){for(var o in s){var f=s[o];s.hasOwnProperty(o)&&f!=null&&Ct(t,n,o,null,JS,f)}s.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Fi&&(t.onclick=null),mn(t)}function Qp(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);mn(t)}var bi=new Map,N1=new Set;function ro(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=H.d;H.d={f:S_,r:__,D:T_,C:C_,L:j_,m:A_,X:M_,S:O_,M:R_};function S_(){var t=Ta.f(),n=nu();return t||n}function __(t){var n=da(t);n!==null&&n.tag===5&&n.type==="form"?Sb(n):Ta.r(t)}var qs=typeof document>"u"?null:document;function E1(t,n,s){var o=qs;if(o&&typeof n=="string"&&n){var f=St(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),N1.has(f)||(N1.add(f),t={rel:t,crossOrigin:s,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),_n(n,"link",t),Jt(n),o.head.appendChild(n)))}}function T_(t){Ta.D(t),E1("dns-prefetch",t,null)}function C_(t,n){Ta.C(t,n),E1("preconnect",t,n)}function j_(t,n,s){Ta.L(t,n,s);var o=qs;if(o&&t&&n){var f='link[rel="preload"][as="'+St(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+St(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+St(s.imageSizes)+'"]')):f+='[href="'+St(t)+'"]';var m=f;switch(n){case"style":m=Gs(t);break;case"script":m=Ys(t)}if(!(bi.has(m)||(t=C({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),bi.set(m,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(so(m))||n==="script"&&o.querySelector(lo(m))))){var w=o.createElement("link");_n(w,"link",t),n==="style"&&(w[ua]=!0,w.onload=w.onerror=function(){Qo(w)}),Jt(w),o.head.appendChild(w)}}}function A_(t,n){Ta.m(t,n);var s=qs;if(s&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+St(o)+'"][href="'+St(t)+'"]',m=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Ys(t)}if(!bi.has(m)&&(t=C({rel:"modulepreload",href:t},n),bi.set(m,t),s.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(lo(m)))return}o=s.createElement("link"),_n(o,"link",t),Jt(o),s.head.appendChild(o)}}}function O_(t,n,s){Ta.S(t,n,s);var o=qs;if(o&&t){var f=fa(o).hoistableStyles,m=Gs(t);n=n||"default";var w=f.get(m);if(!w){var N={loading:0,preload:null};if(w=o.querySelector(so(m)))N.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":n},s),(s=bi.get(m))&&Wp(t,s);var I=w=o.createElement("link");Jt(I),_n(I,"link",t),I._p=new Promise(function(X,J){I.onload=X,I.onerror=J}),I.addEventListener("load",function(){N.loading|=1}),I.addEventListener("error",function(){N.loading|=2}),N.loading|=4,cu(w,n,o)}w={type:"stylesheet",instance:w,count:1,state:N},f.set(m,w)}}}function M_(t,n){Ta.X(t,n);var s=qs;if(s&&t){var o=fa(s).hoistableScripts,f=Ys(t),m=o.get(f);m||(m=s.querySelector(lo(f)),m||(t=C({src:t,async:!0},n),(n=bi.get(f))&&Jp(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},o.set(f,m))}}function R_(t,n){Ta.M(t,n);var s=qs;if(s&&t){var o=fa(s).hoistableScripts,f=Ys(t),m=o.get(f);m||(m=s.querySelector(lo(f)),m||(t=C({src:t,async:!0,type:"module"},n),(n=bi.get(f))&&Jp(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},o.set(f,m))}}function S1(t,n,s,o){var f=(f=$t.current)?ro(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=Gs(s.href),n=fa(f).hoistableStyles,o=n.get(s),o||(o={type:"style",instance:null,count:0,state:null},n.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Gs(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(so(t)))?m._p||(w.instance=m,w.state.loading=5):(m=bi.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},bi.set(t,m)),D_(f,t,m,w.state))),n&&o===null)throw Error(r(528,""));return w}if(n&&o!==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=Ys(s),n=fa(f).hoistableScripts,o=n.get(s),o||(o={type:"script",instance:null,count:0,state:null},n.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Gs(t){return'href="'+St(t)+'"'}function so(t){return'link[rel="stylesheet"]['+t+"]"}function _1(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function D_(t,n,s,o){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[ua]!==!0){o.loading=1;return}}else n=t.createElement("link"),n[ua]=!0,n.onload=n.onerror=Qo.bind(null,n),_n(n,"link",s),Jt(n),t.head.appendChild(n);o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2})}function Ys(t){return'[src="'+St(t)+'"]'}function lo(t){return"script[async]"+t}function T1(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+St(s.href)+'"]');if(o)return n.instance=o,Jt(o),o;var f=C({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Jt(o),_n(o,"style",f),cu(o,s.precedence,t),n.instance=o;case"stylesheet":f=Gs(s.href);var m=t.querySelector(so(f));if(m)return n.state.loading|=4,n.instance=m,Jt(m),m;o=_1(s),(f=bi.get(f))&&Wp(o,f),m=(t.ownerDocument||t).createElement("link"),Jt(m);var w=m;return w._p=new Promise(function(N,I){w.onload=N,w.onerror=I}),_n(m,"link",o),n.state.loading|=4,cu(m,s.precedence,t),n.instance=m;case"script":return m=Ys(s.src),(f=t.querySelector(lo(m)))?(n.instance=f,Jt(f),f):(o=s,(f=bi.get(m))&&(o=C({},s),Jp(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Jt(f),_n(f,"link",o),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&&(o=n.instance,n.state.loading|=4,cu(o,s.precedence,t));return n.instance}function cu(t,n,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,m=f,w=0;w<o.length;w++){var N=o[w];if(N.dataset.precedence===n)m=N;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 Wp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Jp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var uu=null;function C1(t,n,s){if(uu===null){var o=new Map,f=uu=new Map;f.set(s,o)}else f=uu,o=f.get(s),o||(o=new Map,f.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),f=0;f<s.length;f++){var m=s[f];if(!(m[qn]||m[un]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var w=m.getAttribute(n)||"";w=t+w;var N=o.get(w);N?N.push(m):o.set(w,[m])}}return o}function em(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function z_(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 j1(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function A1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function O1(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function M1(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=O1(n),t.suspenseyImages.push(n)),t=U_.bind(t),n.decode().then(t,t))}function L_(t,n,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Gs(o.href),m=n.querySelector(so(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=oo.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=m,Jt(m);return}m=n.ownerDocument||n,o=_1(o),(f=bi.get(f))&&Wp(o,f),m=m.createElement("link"),Jt(m);var w=m;w._p=new Promise(function(N,I){w.onload=N,w.onerror=I}),_n(m,"link",o),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=oo.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var du=0;function I_(t,n){return t.stylesheets&&t.count===0&&pu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&pu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+n);0<t.imgBytes&&du===0&&(du=62500*t_());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&pu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>du?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function R1(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)pu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function oo(){this.count--,R1(this)}function U_(){this.imgCount--,R1(this)}var fu=null;function pu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,fu=new Map,n.forEach(B_,t),fu=null,oo.call(t))}function B_(t,n){if(!(n.state.loading&4)){var s=fu.get(t);if(s)var o=s.get(null);else{s=new Map,fu.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),o=w)}o&&s.set(null,o)}f=n.instance,w=f.getAttribute("data-precedence"),m=s.get(w)||o,m===o&&s.set(null,f),s.set(w,f),this.count++,o=oo.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var Vs={$$typeof:te,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function $_(t,n,s,o,f,m,w,N,I){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=Ba(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ba(0),this.hiddenUpdates=Ba(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.transitionTypes=null,this.incompleteTransitions=new Map}function D1(t,n,s,o,f,m,w,N,I,X,J,oe){return t=new $_(t,n,s,w,I,X,J,oe,N),n=1,m===!0&&(n|=24),m=Gn(3,null,null,n),t.current=m,m.stateNode=t,n=hf(),n.refCount++,t.pooledCache=n,n.refCount++,m.memoizedState={element:o,isDehydrated:s,cache:n},yf(m),t}function z1(t){return t?(t=ys,t):ys}function L1(t,n,s,o,f,m){f=z1(f),o.context===null?o.context=f:o.pendingContext=f,o=Xa(n),o.payload={element:s},m=m===void 0?null:m,m!==null&&(o.callback=m),s=Za(t,o,n),s!==null&&(Xn(s,t,n),Bl(s,t,n))}function I1(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function tm(t,n){I1(t,n),(t=t.alternate)&&I1(t,n)}function U1(t){if(t.tag===13||t.tag===31){var n=Tr(t,67108864);n!==null&&Xn(n,t,67108864),tm(t,67108864)}}function B1(t){if(t.tag===13||t.tag===31){var n=ri();n=os(n);var s=Tr(t,n);s!==null&&Xn(s,t,n),tm(t,n)}}var Ks=!0;function P_(t,n,s,o){var f=Se.T;Se.T=null;var m=H.p;try{H.p=2,nm(t,n,s,o)}finally{H.p=m,Se.T=f}}function H_(t,n,s,o){var f=Se.T;Se.T=null;var m=H.p;try{H.p=8,nm(t,n,s,o)}finally{H.p=m,Se.T=f}}function nm(t,n,s,o){if(Ks){var f=im(o);if(f===null)Ip(t,n,o,mu,s),P1(t,o);else if(q_(f,t,n,s,o))o.stopPropagation();else if(P1(t,o),n&4&&-1<F_.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 N=m;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var I=1<<31-_e(w);N.entanglements[1]|=I,w&=~I}Ji(m),(wt&6)===0&&(Jc=Qt()+500,to(0))}}break;case 31:case 13:N=Tr(m,2),N!==null&&Xn(N,m,2),nu(),tm(m,2)}if(m=im(o),m===null&&Ip(t,n,o,mu,s),m===f)break;f=m}f!==null&&o.stopPropagation()}else Ip(t,n,o,null,s)}}function im(t){return t=Pd(t),am(t)}var mu=null;function am(t){if(mu=null,t=hn(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 mu=t,null}function $1(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(pn()){case Si:return 2;case zn:return 8;case _i:case F:return 32;case de:return 268435456;default:return 32}default:return 32}}var rm=!1,or=null,cr=null,ur=null,co=new Map,uo=new Map,dr=[],F_="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 P1(t,n){switch(t){case"focusin":case"focusout":or=null;break;case"dragenter":case"dragleave":cr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":co.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":uo.delete(n.pointerId)}}function fo(t,n,s,o,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:s,eventSystemFlags:o,nativeEvent:m,targetContainers:[f]},n!==null&&(n=da(n),n!==null&&U1(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function q_(t,n,s,o,f){switch(n){case"focusin":return or=fo(or,t,n,s,o,f),!0;case"dragenter":return cr=fo(cr,t,n,s,o,f),!0;case"mouseover":return ur=fo(ur,t,n,s,o,f),!0;case"pointerover":var m=f.pointerId;return co.set(m,fo(co.get(m)||null,t,n,s,o,f)),!0;case"gotpointercapture":return m=f.pointerId,uo.set(m,fo(uo.get(m)||null,t,n,s,o,f)),!0}return!1}function H1(t){var n=hn(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,Zo(t.priority,function(){B1(s)});return}}else if(n===31){if(n=p(s),n!==null){t.blockedOn=n,Zo(t.priority,function(){B1(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 hu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=im(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);$d=o,s.target.dispatchEvent(o),$d=null}else return n=da(s),n!==null&&U1(n),t.blockedOn=s,!1;n.shift()}return!0}function F1(t,n,s){hu(t)&&s.delete(n)}function G_(){rm=!1,or!==null&&hu(or)&&(or=null),cr!==null&&hu(cr)&&(cr=null),ur!==null&&hu(ur)&&(ur=null),co.forEach(F1),uo.forEach(F1)}function gu(t,n){t.blockedOn===n&&(t.blockedOn=null,rm||(rm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,G_)))}var xu=null;function q1(t){xu!==t&&(xu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){xu===t&&(xu=null);for(var n=0;n<t.length;n+=3){var s=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(am(o||s)===null)continue;break}var m=da(s);m!==null&&(t.splice(n,3),n-=3,$f(m,{pending:!0,data:f,method:s.method,action:o},o,f))}}))}function Xs(t){function n(I){return gu(I,t)}or!==null&&gu(or,t),cr!==null&&gu(cr,t),ur!==null&&gu(ur,t),co.forEach(n),uo.forEach(n);for(var s=0;s<dr.length;s++){var o=dr[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<dr.length&&(s=dr[0],s.blockedOn===null);)H1(s),s.blockedOn===null&&dr.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var f=s[o],m=s[o+1],w=f[ge]||null;if(typeof m=="function")w||q1(s);else if(w){var N=null;if(m&&m.hasAttribute("formAction")){if(f=m,w=m[ge]||null)N=w.formAction;else if(am(f)!==null)continue}else N=w.action;typeof N=="function"?s[o+1]=N:(s.splice(o,3),o-=3),q1(s)}}}function G1(){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),o||setTimeout(s,20)}function s(){if(!o&&!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 o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function sm(t){this._internalRoot=t}bu.prototype.render=sm.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var s=n.current,o=ri();L1(s,o,t,n,null,null)},bu.prototype.unmount=sm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;L1(t.current,2,null,t,null,null),nu(),n[Ie]=null}};function bu(t){this._internalRoot=t}bu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Xo();t={blockedOn:null,target:t,priority:n};for(var s=0;s<dr.length&&n!==0&&n<dr[s].priority;s++);dr.splice(s,0,t),s===0&&H1(t)}};var Y1=i.version;if(Y1!=="19.3.1")throw Error(r(527,Y1,"19.3.1"));H.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?b(t):null,t=t===null?null:t.stateNode,t};var Y_={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Se,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yu.isDisabled&&yu.supportsFiber)try{Dt=yu.inject(Y_),pt=yu}catch{}}return mo.createRoot=function(t,n){if(!c(t))throw Error(r(299));var s=!1,o="",f=zb,m=Lb,w=Ib;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=D1(t,1,!1,null,null,s,o,null,f,m,w,G1),t[Ie]=n.current,Lp(t),new sm(n)},mo.hydrateRoot=function(t,n,s){if(!c(t))throw Error(r(299));var o=!1,f="",m=zb,w=Lb,N=Ib,I=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!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&&(N=s.onRecoverableError),s.formState!==void 0&&(I=s.formState)),n=D1(t,1,!0,n,s??null,o,f,I,m,w,N,G1),n.context=z1(null),s=n.current,o=ri(),o=os(o),f=Xa(o),f.callback=null,Za(s,f,o),s=o,n.current.lanes=s,Er(n,s),Ji(n),t[Ie]=n.current,Lp(t),new bu(n)},mo.version="19.3.1",mo}var n0;function t2(){if(n0)return um.exports;n0=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(),um.exports=e2(),um.exports}var n2=t2();const i2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,r)=>r?r.toUpperCase():a.toLowerCase()),i0=e=>{const i=a2(e);return i.charAt(0).toUpperCase()+i.slice(1)},aw=(...e)=>e.filter((i,a,r)=>!!i&&i.trim()!==""&&r.indexOf(i)===a).join(" ").trim(),r2=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};var s2={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 l2=U.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:c="",children:u,iconNode:d,...p},h)=>U.createElement("svg",{ref:h,...s2,width:i,height:i,stroke:e,strokeWidth:r?Number(a)*24/Number(i):a,className:aw("lucide",c),...!u&&!r2(p)&&{"aria-hidden":"true"},...p},[...d.map(([g,b])=>U.createElement(g,b)),...Array.isArray(u)?u:[u]]));const he=(e,i)=>{const a=U.forwardRef(({className:r,...c},u)=>U.createElement(l2,{ref:u,iconNode:i,className:aw(`lucide-${i2(i0(e))}`,`lucide-${e}`,r),...c}));return a.displayName=i0(e),a};const o2=[["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"}]],c2=he("activity",o2);const u2=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],rw=he("arrow-down-to-line",u2);const d2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],f2=he("arrow-left",d2);const p2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ud=he("arrow-right",p2);const m2=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],h2=he("arrow-up-right",m2);const g2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],x2=he("arrow-up",g2);const b2=[["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"}]],y2=he("bot",b2);const v2=[["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"}]],a0=he("brain",v2);const w2=[["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"}]],k2=he("bug",w2);const N2=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],E2=he("building-2",N2);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"}]],_2=he("calendar-days",S2);const T2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mn=he("check",T2);const C2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dd=he("chevron-down",C2);const j2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],A2=he("chevron-left",j2);const O2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sw=he("chevron-right",O2);const M2=[["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"}]],fd=he("circle-alert",M2);const R2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],D2=he("circle-check",R2);const z2=[["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"}]],L2=he("circle-x",z2);const I2=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],U2=he("clock-3",I2);const B2=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],$2=he("cloud-upload",B2);const P2=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],rh=he("cloud",P2);const H2=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],F2=he("coins",H2);const q2=[["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"}]],pd=he("copy",q2);const G2=[["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"}]],Hu=he("cpu",G2);const Y2=[["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"}]],Kh=he("download",Y2);const V2=[["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=he("earth",V2);const K2=[["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"}]],X2=he("ellipsis",K2);const Z2=[["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"}]],Xh=he("external-link",Z2);const Q2=[["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"}]],W2=he("eye-off",Q2);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"}]],Zh=he("eye",J2);const eT=[["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"}]],r0=he("file-json",eT);const tT=[["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"}]],s0=he("file-pen-line",tT);const nT=[["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"}]],lw=he("file-plus-2",nT);const iT=[["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"}]],aT=he("file-search",iT);const rT=[["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"}]],as=he("file-text",rT);const sT=[["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"}]],lT=he("file-up",sT);const oT=[["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"}]],cT=he("flask-conical",oT);const uT=[["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"}]],ml=he("folder-open",uT);const dT=[["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"}]],fT=he("folder-plus",dT);const pT=[["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"}]],mT=he("folder-search",pT);const hT=[["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"}]],ow=he("folder-tree",hT);const gT=[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],xT=he("folder-up",gT);const bT=[["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"}]],Fu=he("folder",bT);const yT=[["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"}]],vT=he("gamepad-2",yT);const wT=[["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"}]],cw=he("git-branch",wT);const kT=[["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"}]],NT=he("globe",kT);const ET=[["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"}]],uw=he("hammer",ET);const ST=[["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"}]],md=he("hard-drive",ST);const _T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Qh=he("info",_T);const TT=[["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"}]],Bo=he("key-round",TT);const CT=[["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"}]],jT=he("layout-template",CT);const AT=[["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"}]],Wh=he("link-2",AT);const OT=[["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"}]],Jh=he("list-checks",OT);const MT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],eg=he("loader-circle",MT);const RT=[["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"}]],hd=he("lock-keyhole",RT);const DT=[["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"}]],zT=he("log-out",DT);const LT=[["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"}]],IT=he("maximize-2",LT);const UT=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],BT=he("menu",UT);const $T=[["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"}]],tg=he("message-square",$T);const PT=[["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"}]],HT=he("messages-square",PT);const FT=[["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"}]],ng=he("monitor",FT);const qT=[["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"}]],ig=he("moon",qT);const GT=[["path",{d:"M12 22v-9",key:"x3hkom"}],["path",{d:"M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z",key:"2ntwy6"}],["path",{d:"M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13",key:"1pmm1c"}],["path",{d:"M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z",key:"12ttoo"}]],YT=he("package-open",GT);const VT=[["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"}]],gd=he("package",VT);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"}]],dw=he("palette",KT);const XT=[["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"}]],ZT=he("panel-left-close",XT);const QT=[["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"}]],WT=he("panel-left-open",QT);const JT=[["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"}]],eC=he("paperclip",JT);const tC=[["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"}]],$o=he("pencil",tC);const nC=[["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"}]],iC=he("play",nC);const aC=[["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"}]],ag=he("plug",aC);const rC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wr=he("plus",rC);const sC=[["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"}]],lC=he("radio",sC);const oC=[["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"}]],Ii=he("refresh-cw",oC);const cC=[["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"}]],Jr=he("rocket",cC);const uC=[["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"}]],fw=he("rotate-ccw",uC);const dC=[["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"}]],pw=he("rotate-cw",dC);const fC=[["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"}]],pC=he("save",fC);const mC=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],hC=he("scan-search",mC);const gC=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],xC=he("scroll-text",gC);const bC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],rs=he("search",bC);const yC=[["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"}]],mw=he("settings",yC);const vC=[["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"}]],hw=he("settings-2",vC);const wC=[["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"}]],kC=he("shield-alert",wC);const NC=[["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"}]],yr=he("shield-check",NC);const EC=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],SC=he("slash",EC);const _C=[["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"}]],TC=he("sliders-horizontal",_C);const CC=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],jC=he("smartphone",CC);const AC=[["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"}]],oi=he("sparkles",AC);const OC=[["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"}]],gw=he("square-terminal",OC);const MC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],rg=he("square",MC);const RC=[["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"}]],sg=he("sun",RC);const DC=[["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"}]],zC=he("tablet",DC);const LC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],lg=he("terminal",LC);const IC=[["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=he("trash-2",IC);const UC=[["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"}]],Du=he("triangle-alert",UC);const BC=[["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"}]],$C=he("triangle",BC);const PC=[["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"}]],HC=he("unplug",PC);const FC=[["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"}]],xw=he("upload",FC);const qC=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],GC=he("user-round",qC);const YC=[["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"}]],Ro=he("wrench",YC);const VC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$i=he("x",VC);const KC=[["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"}]],XC=he("zap",KC),l0=e=>{let i;const a=new Set,r=(g,b)=>{const x=typeof g=="function"?g(i):g;if(!Object.is(x,i)){const v=i;i=b??(typeof x!="object"||x===null)?x:Object.assign({},i,x),a.forEach(y=>y(i,v))}},c=()=>i,p={setState:r,getState:c,getInitialState:()=>h,subscribe:g=>(a.add(g),()=>a.delete(g))},h=i=e(r,c,p);return p},ZC=(e=>e?l0(e):l0),QC=e=>e;function WC(e,i=QC){const a=cm.useSyncExternalStore(e.subscribe,cm.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return cm.useDebugValue(a),a}const JC=e=>{const i=ZC(e),a=r=>WC(i,r);return Object.assign(a,i),a},Ra=(e=>JC);class es extends Error{status;code;constructor(i,a=0,r="daemon_error"){super(i),this.name="DaemonError",this.status=a,this.code=r}}let Po="",ho=null;function ej(){return Po}async function xd(e){const i=await e.text().catch(()=>"");if(i)try{const a=JSON.parse(i);if(a.error?.message)return new es(a.error.message,a.error.status??e.status,a.error.code??"daemon_error")}catch{}return new es(i.trim().slice(0,400)||`The local daemon returned ${e.status}.`,e.status,"daemon_error")}async function cl(e=!1){return ho&&!e||(ho=(async()=>{let i;try{i=await fetch("/api/session",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin"})}catch{throw new es("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 xd(i);const a=await i.json();Po=typeof a.csrf=="string"?a.csrf:""})().catch(i=>{throw ho=null,i})),ho}async function Ze(e,i={},a=!0){await cl();const r=(i.method??"GET").toUpperCase(),c=new Headers(i.headers);i.body&&!c.has("Content-Type")&&c.set("Content-Type","application/json"),["GET","HEAD"].includes(r)||c.set("x-maxcode-csrf",Po);let u;try{u=await fetch(e,{...i,method:r,headers:c,credentials:"same-origin"})}catch{throw new es("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),Ze(e,i,!1);if(!u.ok)throw await xd(u);return u.status===204?void 0:(u.headers.get("content-type")??"").includes("application/json")?await u.json():await u.text()}function vr(e){return{method:"POST",body:JSON.stringify(e)}}function tj(){return Ze("/api/state")}function bw(){return Ze("/api/plugins")}function nj(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 yw(e){const i=await Ze(`/api/plugins/${encodeURIComponent(e)}/package`);return nj(i.archive)}function ij(e){let i="";for(let a=0;a<e.length;a+=32768)i+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(i)}function vw(e){return Ze("/api/plugins",{method:"POST",body:JSON.stringify({archive:ij(e)})})}function aj(e,i){return Ze(`/api/plugins/${encodeURIComponent(e)}/grants`,{method:"PUT",body:JSON.stringify(i)})}function o0(e,i){return Ze(`/api/plugins/${encodeURIComponent(e)}/safe`,{method:"PUT",body:JSON.stringify({safe:i})})}function rj(e,i){return Ze(`/api/plugins/${encodeURIComponent(e)}/enabled`,{method:"PUT",body:JSON.stringify({enabled:i})})}function sj(e){return Ze(`/api/plugins/${encodeURIComponent(e)}`,{method:"DELETE"})}function lj(e,i){return Ze(`/api/plugins/${encodeURIComponent(e)}/network`,{method:"POST",body:JSON.stringify(i)})}function oj(e){return Ze("/api/settings",{method:"PATCH",body:JSON.stringify(e)})}function ww(e){return Ze("/api/chats",{method:"PUT",body:JSON.stringify(e)})}function cj(e){return Ze("/api/migrate",vr(e))}function uj(){return Ze("/api/providers")}function dj(e){return Ze(`/api/models?provider=${encodeURIComponent(e)}`)}function fj(e,i){return i?Ze(`/api/providers/${e}/key`,{method:"PUT",body:JSON.stringify({apiKey:i})}):Ze(`/api/providers/${e}/key`,{method:"DELETE"})}function pj(e){return Ze("/api/search/key",{method:"PUT",body:JSON.stringify({apiKey:e})})}function mj(e,i){return Ze(`/api/deploy/credentials/${e}`,{method:"PUT",body:JSON.stringify(i)})}function hj(e){return Ze("/api/reset",vr({scope:e}))}function gj(e){return Ze("/api/workspaces",vr({path:e}))}function xj(){return Ze("/api/workspaces",{method:"DELETE"})}function bj(e){return Ze(`/api/workspaces?path=${encodeURIComponent(e)}`,{method:"DELETE"})}function yj(){return Ze("/api/mcp")}function vj(e){return Ze("/api/mcp",{method:"PUT",body:JSON.stringify({servers:e})})}function wj(e,i){return Ze(`/api/mcp/${encodeURIComponent(e)}/${i}`,{method:"POST",body:"{}"})}function kj(e){return Ze(`/api/mcp/${encodeURIComponent(e)}/authorize`,{method:"POST",body:"{}"})}function Nj(e){return Ze(`/api/mcp/${encodeURIComponent(e)}/logout`,{method:"POST",body:"{}"})}function Ej(e,i,a,r){return Ze("/api/mcp/call",{method:"POST",body:JSON.stringify({server:e,tool:i,args:a}),signal:r})}function Sj(e){return Ze(`/api/workspaces/browse?path=${encodeURIComponent(e)}`)}function kw(e="",i=6){return Ze(`/api/workspace/tree?depth=${i}&path=${encodeURIComponent(e)}`)}function sh(e){return Ze(`/api/workspace/file?path=${encodeURIComponent(e)}`)}function lh(e,i){return Ze("/api/workspace/file",{method:"PUT",body:JSON.stringify({path:e,content:i})})}function _j(e,i){return Ze("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"create",path:e,type:i})})}function Tj(e,i){return Ze("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"rename",from:e,to:i})})}function Cj(e){return Ze("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"delete",path:e})})}function jj(){return Ze("/api/git")}function ln(e,i,a,r,c){return Ze("/api/tools/execute",{...vr({name:e,args:i,mode:a,checkpoint:c}),signal:r})}function Aj(){return Ze("/api/preview/token")}function Oj(){return Ze("/api/workspace/instructions")}function Mj(e){return Ze(`/api/checkpoints/${encodeURIComponent(e)}/restore`,{method:"POST",body:JSON.stringify({})})}async function Ho(e,i,a,r,c,u=!0){await cl();let d;try{d=await fetch("/api/llm",{method:"POST",headers:{"Content-Type":"application/json","x-maxcode-csrf":Po},body:JSON.stringify({provider:e,kind:i,model:a,body:r}),signal:c,credentials:"same-origin"})}catch(p){throw p instanceof DOMException&&p.name==="AbortError"?p:new es("Lost the connection to the local daemon while calling the model.",0,"daemon_unreachable")}if(d.status===401&&u)return await cl(!0),Ho(e,i,a,r,c,!1);if(!d.ok)throw await xd(d);return d}async function*Rj(e,i){await cl();let a;try{a=await fetch("/api/deploy",{method:"POST",headers:{"Content-Type":"application/json","x-maxcode-csrf":Po},body:JSON.stringify(e),signal:i,credentials:"same-origin"})}catch(d){throw d instanceof DOMException&&d.name==="AbortError"?d:new es("Lost the connection to the local daemon while deploying.",0,"daemon_unreachable")}if(!a.ok)throw await xd(a);if(!a.body)throw new es("The deploy stream was empty.",502,"empty_stream");const r=a.body.getReader(),c=new TextDecoder;let u="";try{for(;;){const{done:p,value:h}=await r.read();if(p)break;u+=c.decode(h,{stream:!0});let g=u.indexOf(`
|
|
10
|
+
`);for(;g!==-1;){const b=u.slice(0,g).trim();if(u=u.slice(g+1),b)try{yield JSON.parse(b)}catch{yield{type:"log",stream:"meta",text:b}}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()}}function Dj(){return Ze("/api/skills")}function zj(e){return Ze("/api/skills/upload",vr({files:e}))}function Lj(e){return Ze("/api/skills/npm",vr({spec:e}))}function Ij(e,i){return Ze(`/api/skills/${encodeURIComponent(e)}/enabled`,{method:"PUT",body:JSON.stringify({enabled:i})})}function Uj(e){return Ze(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})}function Bj(e,i){return Ze("/api/skills/read",vr({name:e,file:i}))}async function $j(e){return(await Ze("/api/deploy/detect",vr({path:e}))).project}const Oa=Ra()(e=>({titling:{},setTitling:(i,a)=>e(r=>{if(!!r.titling[i]===a)return r;const c={...r.titling};return a?c[i]=!0:delete c[i],{titling:c}}),streaming:{},setStreaming:(i,a)=>e(r=>{if(!!r.streaming[i]===a)return r;const c={...r.streaming};return a?c[i]=!0:delete c[i],{streaming:c}})}));function Pj(){try{return localStorage.getItem("maxcode.sidebar-collapsed")==="1"}catch{return!1}}function Hj(e){try{localStorage.setItem("maxcode.sidebar-collapsed",e?"1":"0")}catch{}}const me=Ra()((e,i)=>({sidebarCollapsed:Pj(),toggleSidebar:()=>e(a=>{const r=!a.sidebarCollapsed;return Hj(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==="plugins"?"general":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 Fj={root:"",name:"",available:!1,error:"",workspaces:[]},go={available:!1,root:"",branch:"",entries:[],error:""};function c0(e,i){return!!(e&&(e===i||e.startsWith(`${i}/`)))}const Be=Ra()((e,i)=>({info:Fj,root:"",entries:[],truncated:!1,loadingTree:!1,treeError:"",activeFile:null,file:null,content:"",dirty:!1,saving:!1,openingFile:!1,git:go,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:go}),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 Oj()})}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 kw("",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 c=await sh(a);e({activeFile:a,file:c,content:c.content,dirty:!1,openingFile:!1})}catch(c){e({openingFile:!1,treeError:c instanceof Error?c.message:"Could not open that file."}),me.getState().notify(c instanceof Error?c.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:c,file:u,saving:d}=i();if(!a||!c||d||u?.binary)return!0;e({saving:!0});try{const p=await lh(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 _j(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 Tj(a,r),await i().loadTree(),c0(i().activeFile,a)){const c=i().activeFile===a?r:`${r}${i().activeFile?.slice(a.length)??""}`;e({activeFile:null,file:null,content:"",dirty:!1}),await i().openFile(c)}me.getState().notify(`Renamed to ${r}`,"success")},deleteEntry:async a=>{await Cj(a),c0(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 gj(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 xj();e({info:a,root:"",entries:[],activeFile:null,file:null,content:"",dirty:!1,git:go,instructions:{file:"",content:"",truncated:!1}})},removeWorkspace:async a=>{const r=i().info.root===a;if(r&&i().dirty&&!await i().saveFile())return;const c=await bj(a);if(!r){e({info:c});return}e({info:c,root:"",entries:[],activeFile:null,file:null,content:"",dirty:!1,git:go,instructions:{file:"",content:"",truncated:!1}})},loadGit:async()=>{if(i().info.available){e({gitLoading:!0});try{const a=await jj();e({git:{...a},gitLoading:!1})}catch(a){e({git:{...go,error:a instanceof Error?a.message:"Git status failed."},gitLoading:!1})}}},setActiveFile:a=>{a?i().openFile(a):i().closeFile()}}));function Li(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 Nw(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 Ew(e){let i=0;const a=e.messages.filter(r=>!!(r&&typeof r=="object")).map((r,c)=>{if(r.role==="user")return c>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 qj(e){const i=e.replace(/\s+/g," ").trim();return i?i.length>56?`${i.slice(0,56).trim()}…`:i:"New conversation"}const Xe=Ra()((e,i)=>({sessions:[],activeId:null,hydrated:!1,hydrate:a=>{const r=(a.sessions??[]).filter(Nw).map(Ew).sort((u,d)=>d.updatedAt-u.updatedAt),c=typeof a.activeId=="string"&&r.some(u=>u.id===a.activeId)?a.activeId:r[0]?.id??null;e({sessions:r,activeId:c,hydrated:!0})},setActive:a=>e({activeId:a}),newChat:()=>e({activeId:null}),createSession:(a,r,c)=>{const u=Li("chat"),d=Date.now(),p={id:u,title:"New conversation",createdAt:d,updatedAt:d,messages:[],provider:a,model:r,mode:c,workspace:Be.getState().info.root||void 0,titleSource:"auto"};return e(h=>({sessions:[p,...h.sessions],activeId:u})),u},addMessage:(a,r)=>{e(c=>({sessions:c.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=qj(r.content)),{...u,...d}})}))},updateMessage:(a,r,c)=>{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 b=typeof c=="function"?c(g):c;return!b||Object.keys(b).length===0?g:(p=!0,{...g,...b})});return p?{...d,messages:h,updatedAt:Date.now()}:d})}))},updateSession:(a,r)=>{e(c=>({sessions:c.sessions.map(u=>u.id===a?{...u,...r,updatedAt:Date.now()}:u)}))},renameSession:(a,r)=>{const c=r.trim();c&&i().updateSession(a,{title:c,titleSource:"user"})},deleteSession:a=>{e(r=>{const c=r.sessions.filter(u=>u.id!==a);return{sessions:c,activeId:r.activeId===a?c[0]?.id??null:r.activeId}})},clearAll:()=>e({sessions:[],activeId:null}),persistNow:async()=>{const{sessions:a,activeId:r}=i();await ww({sessions:a,activeId:r})}}));let bd=!1,Zr,sl;function Gj(){bd=!0}function Yj(){!bd||typeof window>"u"||(Zr!==void 0&&window.clearTimeout(Zr),Zr=window.setTimeout(()=>{Zr=void 0,u0()},900),sl===void 0&&(sl=window.setTimeout(()=>{sl=void 0,u0()},6e3)))}async function u0(){if(!bd)return;Zr!==void 0&&(window.clearTimeout(Zr),Zr=void 0),sl!==void 0&&(window.clearTimeout(sl),sl=void 0);const{sessions:e,activeId:i}=Xe.getState();try{await ww({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"}}))}}Xe.subscribe(Yj);if(typeof window<"u"){const e=()=>{if(!bd)return;const{sessions:i,activeId:a}=Xe.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":ej()},body:r}).catch(()=>{})}catch{}};window.addEventListener("beforeunload",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()})}function Sw(){const e=Xe.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 Vj(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(Nw).map(Ew);if(r.length===0)throw new Error("No valid conversations were found in this file.");const c=new Set(Xe.getState().sessions.map(d=>d.id)),u=r.filter(d=>!c.has(d.id));return Xe.setState(d=>({sessions:[...u,...d.sessions],activeId:u[0]?.id??d.activeId})),u.length})}const qu=[{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."}],ra=Object.fromEntries(qu.map(e=>[e.id,e]));function og(e){return ra[e]?.name??e}const d0=["none","minimal","low","medium","high","xhigh","max"],cg={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 Gu(e){return cg[e]?.label??e}function wr(e){return e?.reasoningOptions.find(a=>a.type==="effort")?.values??[]}function _w(e){return e?.reasoningOptions.find(i=>i.type==="budget_tokens")}function Yu(e){return!!_w(e)}function Tw(e){return!!e?.reasoningOptions.some(i=>i.type==="toggle")}function Cw(e){const i=wr(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=wr(i);return a.length===0||a.includes(e)?e:Cw(i)}function Kj(e,i){const a=_w(i),r=Math.max(0,a?.min??1024),c=Math.max(r,a?.max??32768);return Math.max(r,Math.min(c,e))}const Xj={none:1024,minimal:1024,low:2048,medium:8192,high:16384,xhigh:24576,max:32768};function jw(e,i){return Kj(Xj[e]??8192,i)}function Do(e){return[...wr(e)].sort((a,r)=>d0.indexOf(a)-d0.indexOf(r))}function oh(e){if(!e)return"Choose a model to see live reasoning controls.";const i=wr(e);return i.length>0?`Effort levels from this model: ${i.join(", ")}.`:Yu(e)?"This model accepts a thinking token budget, derived from the effort level.":Tw(e)?"This model controls reasoning itself; no effort value is sent.":"This model advertises no reasoning controls, so effort does not apply."}const Aw=[{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}],Zj=/^[a-z0-9][a-z0-9:_-]{0,79}$/,ug=new Map(Aw.map(e=>[e.id,e]));function Ow(e){ug.set(e.id,e)}function Mw(e){Aw.some(i=>i.id===e)||ug.delete(e)}function Rw(e){return typeof e=="string"&&Zj.test(e)}function Dw(e,i){return e==="system"?i?"dark":"light":Rw(e)?e:"light"}function ch(e,i){return ug.get(Dw(e,i))?.dark??!1}function Qj(e){return e==="system"?"system":Rw(e)?e:"system"}const Vu=`You are OpenSol, a senior web engineer and coding agent built by OpenSoftX.
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
Engineering standard:
|
|
16
|
+
- Read every file you change. Match the existing stack, style, naming and conventions. Never invent APIs, versions, flags, package names or paths.
|
|
17
|
+
- Make the smallest correct change. One concern per edit. No speculative abstraction, dead code, placeholder TODOs or swallowed errors.
|
|
18
|
+
- Keep public behavior stable unless the task explicitly changes it.
|
|
19
|
+
- Security: never expose secrets, never weaken auth, CSRF, CSP or validation to make something pass, and validate untrusted input at boundaries.
|
|
20
|
+
- Accessibility: semantic HTML, keyboard paths, visible focus, sufficient contrast.
|
|
21
|
+
- Performance: avoid needless work; measure before optimizing.
|
|
22
|
+
- Every bug fix gets a regression test when a test setup exists. Tests assert behavior, not implementation.
|
|
23
|
+
|
|
24
|
+
Working loop:
|
|
25
|
+
1. Inspect before editing: list files, read the relevant source, grep for call sites, check git status.
|
|
26
|
+
2. For non-trivial work, state a short plan.
|
|
27
|
+
3. Edit in small, coherent steps.
|
|
28
|
+
4. Verify with the project's real commands (typecheck, lint, tests, build) and read the output.
|
|
29
|
+
5. Report what changed, which files, and what was verified. If a check fails or cannot run, say so plainly and explain why.
|
|
30
|
+
|
|
31
|
+
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.`,uh={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"},skill:{enabled:!0,approval:"auto"}},ja={provider:"openai",model:"",effort:"medium",webSearchEnabled:!0,temperature:.4,maxTokens:8192,systemPrompt:Vu,workspacePrompts:{},providers:{},searchProvider:"duckduckgo",tools:uh,theme:"system",showTokenEstimate:!0,mode:"build",chatFontSize:15,workDetail:"detailed",autoCollapseWork:!0,aiSessionTitles:!0},Wj=new Set(["none","minimal","low","medium","high","xhigh","max"]);function zw(e,i="error"){typeof window>"u"||window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:e,tone:i}}))}function Jj(e){const i={};for(const a of Object.keys(uh))i[a]={...uh[a],...e?.[a]??{}};return i}function eA(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)?Vu:e}function tA(e){const i={};if(!e||typeof e!="object")return i;for(const[a,r]of Object.entries(e))a&&typeof r=="string"&&(i[a]=r);return i}function nA(e){const i={};for(const[a,r]of Object.entries(e??{}))!(a in ra)||!r||typeof r!="object"||typeof r.baseUrl=="string"&&r.baseUrl.trim()&&(i[a]={baseUrl:r.baseUrl.trim()});return i}function iA(e){const i=e??{},a=typeof i.provider=="string"&&i.provider in ra?i.provider:ja.provider,r=i.mode==="plan"?"plan":i.mode==="build"?"build":ja.mode;return{...ja,...i,provider:a,model:typeof i.model=="string"?i.model.trim():"",mode:r,effort:typeof i.effort=="string"&&Wj.has(i.effort)?i.effort:ja.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)):ja.temperature,maxTokens:typeof i.maxTokens=="number"&&Number.isFinite(i.maxTokens)?Math.max(256,Math.min(2e5,Math.round(i.maxTokens))):ja.maxTokens,systemPrompt:eA(i.systemPrompt),providers:nA(i.providers),searchProvider:i.searchProvider&&["duckduckgo","tavily","brave","serper"].includes(i.searchProvider)?i.searchProvider:ja.searchProvider,tools:Jj(i.tools),theme:Qj(i.theme),chatFontSize:typeof i.chatFontSize=="number"&&Number.isFinite(i.chatFontSize)?Math.max(12,Math.min(20,Math.round(i.chatFontSize))):ja.chatFontSize,workDetail:i.workDetail==="concise"?"concise":"detailed",autoCollapseWork:i.autoCollapseWork!==!1,aiSessionTitles:i.aiSessionTitles!==!1,workspacePrompts:tA(i.workspacePrompts)}}let dg=!1,ll={},ol,To;function Lw(e){const i={},a=["provider","model","effort","webSearchEnabled","temperature","maxTokens","systemPrompt","providers","searchProvider","tools","theme","showTokenEstimate","mode","chatFontSize","workDetail","autoCollapseWork","aiSessionTitles","workspacePrompts"];for(const r of a)r in e&&(i[r]=e[r]);return i}function dh(){if(!dg||Object.keys(ll).length===0)return Promise.resolve();const e=Lw(ll);return ll={},ol!==void 0&&window.clearTimeout(ol),To!==void 0&&window.clearTimeout(To),ol=void 0,To=void 0,oj(e).then(()=>{}).catch(i=>{zw(i instanceof Error?i.message:"Could not save settings to the local daemon.")})}function el(e){dg&&(ll={...ll,...Lw(e)},ol!==void 0&&window.clearTimeout(ol),ol=window.setTimeout(()=>{dh()},550),To===void 0&&(To=window.setTimeout(()=>{dh()},4e3)))}function aA(){dg=!0,Object.keys(ll).length>0&&el({})}const ze=Ra()((e,i)=>({...ja,hydrated:!1,daemon:null,secretStatus:null,providerStatus:[],deployTools:null,deploySecrets:null,secretsError:"",hydrate:a=>{const r=iA(a.settings),c=a.providers,u=c.filter(d=>d.configured);!fh(r,c,r.provider)&&u.length>0&&(r.provider=u[0].id,r.model=""),fh(r,c,r.provider)||(r.model=""),e({...r,hydrated:!0,daemon:a,secretStatus:a.secrets,providerStatus:c,deployTools:a.deployTools,deploySecrets:a.deploySecrets,secretsError:a.secretsError})},update:a=>{e(a),el(a)},selectModel:(a,r,c)=>{const u=c??i().effort,d={provider:a,model:r.trim(),effort:u};e(d),el(d)},updateProvider:(a,r)=>{const c={providers:{...i().providers,[a]:{...i().providers[a]??{},...r}}};e(c),el(c)},saveProviderKey:async(a,r)=>{const c=await fj(a,r.trim()),u=yd(i(),a);e(d=>{const p=d.secretStatus?{...d.secretStatus,providers:{...d.secretStatus.providers,[a]:{configured:c.configured,hint:c.hint}}}:d.secretStatus,h=d.providerStatus.map(v=>v.id===a?{...v,configured:c.configured,hint:c.hint}:v),g=c.configured?!dl(d)||d.provider===a:!1,b=d.provider===a&&!c.configured,x={};return g&&(x.provider=a),b&&(x.model=""),{secretStatus:p,providerStatus:h,...x}}),!u&&c.configured&&zw(`${ra[a]?.name??a} is connected.`,"success")},saveSearchKey:async a=>{const r=await pj(a.trim());e(c=>({secretStatus:c.secretStatus?{...c.secretStatus,search:{configured:r.configured,hint:r.hint}}:c.secretStatus}))},saveDeployCredentials:async(a,r)=>{const c=await mj(a,r);e(u=>({secretStatus:u.secretStatus?{...u.secretStatus,deploy:{...u.secretStatus.deploy,[a]:c}}:u.secretStatus,deploySecrets:u.deploySecrets?{...u.deploySecrets,[a]:c}:u.deploySecrets}))},refreshProviders:async()=>{const a=await uj();e({providerStatus:a.providers})},updateTool:(a,r)=>{const c={tools:{...i().tools,[a]:{...i().tools[a],...r}}};e(c),el(c)},setMode:a=>{const r={mode:a};e(r),el(r)},flush:()=>dh()}));function Qn(e){return e.model.trim()}function yd(e,i){return fh(e,ze.getState().providerStatus,i)}function fh(e,i,a){const r=ra[a];if(!r)return!1;const c=i.find(u=>u.id===a);return c?c.configured:a==="custom"?!!e.providers.custom?.baseUrl?.trim():!!r.keyless}function dl(e){return yd(e,e.provider)}typeof window<"u"&&(window.addEventListener("beforeunload",()=>{ze.getState().flush()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze.getState().flush()}));function Ku(e){return e==null}function Ma(e,i,a){return Object.defineProperty(e,i,{writable:!0,value:a,enumerable:!1})}function ph(e,i){return arguments.length===1?a=>ph(e,a):e in globalThis&&i instanceof globalThis[e]||Object.prototype.toString.call(i).slice(8,-1)===e}function Iw(e){return ph("ArrayBuffer",e)||ph("SharedArrayBuffer",e)}function rA(e){return Iw(e)||ArrayBuffer.isView(e)}var fl;(e=>{e.is=Iw,e.isSource=rA;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 c(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=c;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 sA(e,i,a){const r=[];let c=0;for(let u=0;u<e.length;u++){const d=e.charCodeAt(u);if(d>=65&&d<=90){if(c===1){const p=e.charCodeAt(u+1);p>=97&&p<=122&&r.push(a),r.push(d+32)}else c!==0&&r.push(a),r.push(d+32);c=1}else d>=97&&d<=122?(r.push(d),c=2):i.includes(d)?(c!==0&&r.push(a),c=0):r.push(d)}return String.fromCharCode(...r)}function lA(e){return sA(e,[45,95],45)}var oA=lA,f0;(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 c(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=c;function u(y,k){const S=new Date(y*e.day);return k===void 0&&(k=i),new Date(+S+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 b(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=b;function x(y,k=2){return y.toString().padStart(k,"0")}e.toDigits=x;function v(y,k=new Date){return y.replace("yyyy",k.getFullYear().toString()).replace("yy",k.getFullYear().toString().slice(2)).replace("MM",x(k.getMonth()+1)).replace("dd",x(k.getDate())).replace("hh",x(k.getHours())).replace("mm",x(k.getMinutes())).replace("ss",x(k.getSeconds())).replace("SSS",x(k.getMilliseconds(),3))}e.template=v})(f0||(f0={}));var cA=Object.defineProperty,Re=(e,i)=>cA(e,"name",{value:i,configurable:!0}),fg=class{static{Re(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]}},ke={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")},uA=function*(){}.constructor,p0=async function*(){}.constructor;function Uw(e){return!(!e.prototype||e instanceof uA||p0!==Function&&e instanceof p0)}Re(Uw,"isConstructor");function vd(e,i){if(e===Object.prototype)return i;const a=Object.create(vd(Object.getPrototypeOf(e),i));for(const r of Reflect.ownKeys(e))Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(e,r));return a}Re(vd,"joinPrototype");function zo(e){return e&&(typeof e=="object"||typeof e=="function")}Re(zo,"isObject");function pg(e,i){let a=e;for(;a;){const r=Reflect.getOwnPropertyDescriptor(a,i);if(r)return r;a=Object.getPrototypeOf(a)}}Re(pg,"getPropertyDescriptor");function xr(e,i){if(!zo(i))return i;if(Object.hasOwn(i,ke.shadow))return Object.getPrototypeOf(i);const a=i[ke.tracker];return a?wd(e,i,a):i}Re(xr,"getTraceable");function Lo(e,i){return i?new Proxy(e,{get:Re((a,r,c)=>r in i&&r!=="constructor"?Reflect.get(i,r,c):Reflect.get(a,r,c),"get"),set:Re((a,r,c,u)=>r in i&&r!=="constructor"?Reflect.set(i,r,c,u):Reflect.set(a,r,c,u),"set")}):e}Re(Lo,"withProps");function Xu(e,i,a){return Lo(e,Object.defineProperty(Object.create(null),i,{value:a,writable:!1}))}Re(Xu,"withProp");function So(e,i,a,r){if(!a)return r;const c=pg(i,a)?.value;if(!c)return r;const u=c[ke.shadow]??c;return Xu(r,a,e.extend({[ke.shadow]:u}))}Re(So,"createShadow");function Bw(e,i,a,r){return new Proxy(i,{apply:Re((c,u,d)=>(u===a&&(u=r),xr(e,Reflect.apply(c,u,d))),"apply")})}Re(Bw,"createShadowMethod");function wd(e,i,a){const r=e[ke.shadow]??e,c=e[ke.shadow]?Object.getPrototypeOf(e):e,u=new Proxy(i,{get:Re((d,p,h)=>{if(p===ke.original)return d;if(p===ke.caller)return r;if(p===a.property)return c;if(typeof p=="symbol")return Reflect.get(d,p,h);if(a.associate&&c.reflect.props[`${a.associate}.${p}`])return Reflect.get(e,`${a.associate}.${p}`,Xu(e,ke.receiver,h));let g,b;const x=pg(d,p);x&&"value"in x?b=x.value:(g=So(c,d,a.property,h),b=Reflect.get(d,p,g));const v=b?.[ke.tracker];return v?wd(c,b,v):!a.noShadow&&typeof b=="function"?(g??=So(c,d,a.property,h),Bw(c,b,h,g)):b},"get"),set:Re((d,p,h,g)=>{if(p===ke.original||p===ke.caller||p===a.property)return!1;if(typeof p=="symbol")return Reflect.set(d,p,h,g);if(a.associate&&c.reflect.props[`${a.associate}.${p}`])return Reflect.set(e,`${a.associate}.${p}`,h,Xu(e,ke.receiver,g));const b=So(c,d,a.property,g);return Reflect.set(d,p,h,b)},"set"),apply:Re((d,p,h)=>{const g=a.noShadow?u:So(c,d,a.property,u);return $w(g,d,p,h)},"apply")});return u}Re(wd,"createTraceable");function $w(e,i,a,r){return i[ke.invoke]?i[ke.invoke].apply(e,r):Reflect.apply(i,a,r)}Re($w,"applyTraceable");function Zu(e,i,a){const r=Re(function(...c){const u=wd(r.ctx,r,a);return Reflect.apply(u,this,c)},"self");return Ma(r,"name",e),Object.setPrototypeOf(r,i)}Re(Zu,"createCallable");function mh(e,i,a){const r=e.error.stack.split(`
|
|
32
|
+
`);if(typeof i?.stack!="string"){const d=new Error(i),p=d.stack.split(`
|
|
33
|
+
`);throw p.splice(1,1/0,...a()),d.stack=p.join(`
|
|
34
|
+
`),d}const c=i.stack.split(`
|
|
35
|
+
`);let u=c.indexOf(r[2]);if(u===-1)throw i;for(u-=e.offset;u>0&&c[u-1].endsWith(" (<anonymous>)");)u-=1;throw c.splice(u,1/0,...a()),i.stack=c.join(`
|
|
36
|
+
`),i}Re(mh,"handleError");function hh(e,i=kd()){const a={offset:1,error:new Error};try{const r=e(a);return zo(r)&&"then"in r?r.then(void 0,c=>mh(a,c,i)):r}catch(r){mh(a,r,i)}}Re(hh,"composeError");function kd(e=0){const i=new Error;return()=>i.stack.split(`
|
|
37
|
+
`).slice(3+e)}Re(kd,"buildOuterStack");var Pw=Symbol.for("ValidationError"),Hw=class gh extends TypeError{constructor(i){super(`invalid config:
|
|
38
|
+
`+i.map(a=>a.path?.length?` - ${a.message} (at ${gh.formatPath(a.path)})`:` - ${a.message}`).join(`
|
|
39
|
+
`)),this.issues=i}issues;static{Re(this,"ValidationError")}name="ValidationError";static is(i){return!!i?.[Pw]}static normalizePath(i=[]){return i.map(a=>typeof a=="object"?a.key:a)}static formatPath(i){return gh.normalizePath(i).map(String).join(".")}};Object.defineProperty(Hw.prototype,Pw,{value:!0});function Fw(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 Hw(a.issues);return a.value}Re(Fw,"resolveConfig");var xh=class qw extends Error{constructor(i,a){super(a??qw.Code[i]),this.code=i}code;static{Re(this,"CordisError")}};(e=>{e.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(xh||(xh={}));var Ca="__INACTIVE__",Gw=class{constructor(e,i,a,r,c){this.parent=e,this.config=i,this.inject=a,this.runtime=r;const u=Re(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:c,execute:Re(function(){const d=this._resolve(this.config);if(Uw(r.callback)){const p=new r.callback(this.ctx,d);for(const h of p?.[ke.initHooks]??[])h();return p?.[ke.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:c,execute:Re(()=>{},"execute"),collect:u},this.dispose=()=>this.restart()}parent;config;inject;runtime;static{Re(this,"Fiber")}uid;ctx;state=0;dispose;committed;provisions=new Set;inertia;_hooks=Object.create(null);_disposables=new fg;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 xh("INACTIVE_EFFECT")}_resolve(e){return this.context.waterfall("internal/config",this,()=>e)}_execute(e){const i=e.epoch;return hh(a=>{const r=Re(u=>{if(typeof u=="function")e.collect(u);else if(!Ku(u))throw new TypeError("Invalid effect")},"safeCollect"),c=e.execute.call(this);if(typeof c=="function")return e.collect(c);if(!Ku(c))if(zo(c)){if("then"in c)return c.then(r);if(Symbol.iterator in c){a.error=new Error;const u=c[Symbol.iterator]();for(;;){const d=u.next();if(r(d.value),d.done)return}}else if(Symbol.asyncIterator in c){const u=c[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=Re(()=>{let g;for(const b of a.splice(0).reverse())if(g)g=g.then(b);else{const x=b();zo(x)&&"then"in x&&(g=x)}return g},"dispose"),c={label:i,children:[]},u={execute:e,epoch:!0,collect:Re(g=>{a.push(g),this._disposables.delete(g),g[ke.effect]&&c.children.push(g[ke.effect])},"collect"),getOuterStack:kd()};let d;try{d=this._execute(u)}catch(g){throw r(),g}d?.catch(r).catch(g=>this.ctx.logger.error(g));const p=Ma(()=>{if(u.epoch)return u.epoch=!1,d?d.then(r):r()},ke.effect,c),h=Re(()=>{if(u.epoch)return u.epoch=!1,r()},"disposeAsync");return p.then=async(g,b)=>Promise.resolve(d).then(()=>h).then(g,b),a.push(this._disposables.push(p)),p}getEffects(){return[...this._disposables].map(e=>e[ke.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(xr(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 hh(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,c=r?a._resolve(e):void 0;i||a.context.emit("internal/commit",a,e),a.config=e,a._error=void 0;const u=Re(()=>a.restart(),"restart"),d=r?a.context.waterfall(a,"internal/update",c,u):u();if(d===void 0)return;const p=Promise.resolve(d);return p.catch(()=>{}),p}};function bh(e){return e!==null&&e!==!1&&e!==void 0}Re(bh,"isBailed");var dA=class{constructor(e){this.ctx=e,Ma(this,ke.tracker,{property:"ctx",noShadow:!0}),this.on("internal/listener",function(i,a,r){if(i==="internal/update"&&!r.global){const c=this.fiber._hooks["internal/update"]??=new fg,u=r.prepend?"unshift":"push";return this.fiber.effect(()=>c[u](a),'ctx.on("internal/update")')}}),this.on("internal/update",function(i,a){const r=[...this._hooks["internal/update"]||[]],c=Re(()=>(r.shift()??a).call(this,i,c),"_next");return c()},{global:!0,prepend:!0}),this.on("internal/config",(i,a)=>Fw(i.runtime,a()))}ctx;static{Re(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 c=a?.[hg.filter],u=(this._hooks[r]||[]).filter(d=>d.global||!c||c.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(c=>c.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 c=await Reflect.apply(r,i,e);if(bh(c))return c}}bail(...e){const[i,a]=this._resolve("bail",e);for(const r of a){const c=Reflect.apply(r,i,e);if(bh(c))return c}}waterfall(...e){const[i,a]=this._resolve("waterfall",e),r=e.pop(),c=Re(()=>{const u=a.shift();if(!u)return r();let d=!1;const p=Re(()=>{if(d)throw new Error("next() called multiple times");return d=!0,c()},"next");return Reflect.apply(u,i,[...e,p])},"dispatch");return c()}register(e,i,a,r){const c=r.prepend?"unshift":"push";return this.ctx.fiber.effect(()=>((this._hooks[i]??=[])[c]({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(c=>c.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 c=`ctx.on(${typeof e=="string"?JSON.stringify(e):e.toString()})`;return this.register(c,e,i,a)}once(e,i,a){const r=this.on(e,function(...c){return r(),i.apply(this,c)},a);return r}};function zu(e){const i=e.stack.split(`
|
|
40
|
+
`);return i.splice(0,2,`Error: ${e.message}`),e.stack=i.join(`
|
|
41
|
+
`),e}Re(zu,"enhanceError");var fA=["prototype","then"];function Lu(e){return typeof e=="symbol"||fA.includes(e)||parseInt(e).toString()===e||e.startsWith("_")}Re(Lu,"isSpecialProperty");function mg(e,i){const a=e[ke.isolate][i];let r=e[ke.isolate],c=e.fiber;for(;;){let u;for(const d of c.provisions)d.name===i&&d.ctx[ke.isolate][i]===a&&(u=d);if(u)return{impl:u};for(;r!==c.ctx[ke.isolate];){if(!r||Object.hasOwn(r,i))return;r=Object.getPrototypeOf(r)}if(u=c.committed?.[i],u||i in c.inject)return{fiber:c,impl:u};if(!c.runtime)return;c=c.parent.fiber}}Re(mg,"locate");var m0=class{constructor(e){this.ctx=e,Ma(this,ke.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{Re(this,"ReflectService")}static handler={get:Re((e,i,a)=>{if(Lu(i))return Reflect.get(e,i,a);if(Reflect.has(e,i))return xr(a,Reflect.get(e,i,a));const r=new Error(`cannot get property "${i}" without inject`);try{const c=e.reflect.props[i];if(c?.type==="accessor")return c.get.call(a,a[ke.receiver],r);const u=a[ke.shadow]??a;return u.fiber.runtime?a.events.waterfall("internal/get",a,i,r,()=>{const d=mg(u,i);if(!d)throw r;if(d.impl)return xr(a,d.impl.value);throw r.message=`cannot get required service "${i}" in inactive context`,r}):a.reflect.get(i,!1)}catch(c){throw c===r?zu(c):c}},"get"),set:Re((e,i,a,r)=>{if(Lu(i))return Reflect.set(e,i,a,r);const c=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 zu(c)}try{return u.type==="accessor"?u.set?u.set.call(r,a,r[ke.receiver],c):!1:r.events.waterfall("internal/set",r,i,a,c,()=>r.reflect.set(i,a,c))}catch(d){throw d===c?zu(d):d}},"set"),has:Re((e,i)=>Lu(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 xr(this.ctx,this._getImpl(e,i)?.value)}_getImpl(e,i=!0){const a=this.ctx[ke.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[ke.isolate][e],c=this.store[r];if(!c)throw new Error(`cannot set property "${e}" without provide`);if(c.ctx.fiber!==this.ctx.fiber)throw new Error(`cannot set property "${e}" in multiple fibers`);return c.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[ke.root][ke.isolate][e]??=Symbol(e);const r=this.ctx[ke.isolate][e],c={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]=c,this.ctx.fiber.provisions.add(c),this.ctx.fiber.state===2&&this.notify([e]),async()=>{this.store[c.isolate]===c&&delete this.store[c.isolate],this.ctx.isolate(e,c.isolate).reflect.notify([e]),await new Promise(u=>{c.release=u,c.dependents.size||u()}),c.release=void 0,this.ctx.fiber.provisions.delete(c)}},`ctx.provide(${JSON.stringify(e)})`)}notify(e,i=(a,r)=>a[ke.isolate][r]===this.ctx[ke.isolate][r]){for(const a of this.ctx.registry.values())for(const r of a.fibers){let c=!1;for(const u of e)u in r.inject&&i(r.ctx,u)&&(c=!0,r._checkImpl(u));c&&r._refresh()}for(const a of e){const r=Object.create(this.ctx);r[ke.filter]=c=>i(c,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),c=Re((u,d)=>u[e],"getTarget");for(const[u,d]of r)yield a.accessor(d,{get(p,h){const g=c(this,h);if(Ku(g))return g;const b=p?Lo(p,g):g,x=Reflect.get(g,u,b);return typeof x!="function"?x:x.bind(b??g)},set(p,h,g){const b=c(this,g),x=h?Lo(h,b):b;return Reflect.set(b,u,p,x)}})},`ctx.mixin(${JSON.stringify(e)})`)}trace(e){return xr(this.ctx,e)}bind(e){return new Proxy(e,{apply:Re((i,a,r)=>Reflect.apply(i,this.trace(a),r.map(c=>this.trace(c))),"apply"),construct:Re((i,a,r)=>Reflect.construct(i,a.map(c=>this.trace(c)),r),"construct")})}},ki=class yh{constructor(i,a){this.ctx=i,a??=this.constructor.provide;let r=this;const c={associate:a,property:"ctx"};return r[ke.invoke]&&(r=Zu(a,vd(Object.getPrototypeOf(this),Function.prototype),c)),r.ctx=i,r.name=a,Ma(r,ke.tracker,c),r.ctx.reflect.provide(a,r,this[ke.check]),r}ctx;static{Re(this,"Service")}static init=ke.init;static check=ke.check;static invoke=ke.invoke;static metadata=ke.metadata;static extend=ke.extend;static tracker=ke.tracker;static mergeIntercept=ke.mergeIntercept;static resolveIntercept=ke.resolveIntercept;name;[ke.filter](i){return i[ke.isolate][this.name]===this.ctx[ke.isolate][this.name]}[ke.extend](i){let a;return this[yh.invoke]?a=Zu(this.name,this,this[ke.tracker]):a=Object.create(this),Object.assign(a,i)}[ke.mergeIntercept](...i){return Object.assign({},...i)}[ke.resolveIntercept](){const i=[];let a=this.ctx[hg.intercept];for(;this.name in a;)Object.hasOwn(a,this.name)&&i.unshift(a[this.name]),a=Object.getPrototypeOf(a);const r=mg(this[ke.caller]??this.ctx,this.name)?.fiber?.inject[this.name];return Ku(r)||i.unshift(r),(this[ke.mergeIntercept]??yh.prototype[ke.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}},h0={s:Re(e=>String(e),"s"),d:Re(e=>Math.trunc(Number(e)),"d"),i:Re(e=>Math.trunc(Number(e)),"i"),f:Re(e=>Number(e),"f"),o:Re(e=>JSON.stringify(e),"o"),O:Re(e=>JSON.stringify(e),"O"),c:Re(()=>"","c"),C:Re((e,i,a)=>vh.color(i,vh.code(a.name,i.colors),e),"C")};function Yw(e){return e instanceof Error&&Array.isArray(e.errors)}Re(Yw,"isAggregateError");var vh=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{Re(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 c=0;c<e.length;c++)a=(a<<3)-a+e.charCodeAt(c)+13,a|=0;const r=i?i>=2?mA:pA:[];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]??h0[p];if(typeof h=="function"){const g=a.shift();return h(g,e,i)}return d});const c=e.formatters?.o??h0.o;for(let d of a)typeof d=="object"&&d&&(d=c(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(`
|
|
42
|
+
`)}_method(e,i){return(...a)=>{if(a.length===1&&a[0]instanceof Error){if(a[0].cause)this[e](a[0].cause);else if(Yw(a[0])&&a[0].errors.length){a[0].errors.forEach(u=>this[e](u));return}}const r=++this.service._snMessage,c=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:c,type:e,level:i,name:this.name,...this.meta,args:a};u.export(p)}}}},pA=[6,2,3,4,5,1],mA=[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],hA=class Vw{static{Re(this,"LoggerService")}bufferSize=1e3;buffer=[];ctx;_snMessage=0;_snExporter=0;exporters=new Map;constructor(i){const a={property:"ctx",noShadow:!0},r=Zu("logger",vd(Object.getPrototypeOf(this),Function.prototype),a);return Object.assign(r,this),r.ctx=i,Ma(r,ke.tracker,a),r.exporter({colors:3,export:Re(c=>{r.buffer.push(c);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()")}[ke.invoke](i){const a=this[ke.caller],r=ki.prototype[ki.resolveIntercept].call(this),c=(a??this.ctx).fiber;return i??=r.name,i??=oA(c.name),new vh({name:i,level:r.level,meta:{fiber:new WeakRef(c)}},this)}static{for(const i of["error","info","warn","debug"])Vw.prototype[i]=function(...a){return this()[i](...a)}}};function Kw(e){return e&&typeof e=="object"&&typeof e.apply=="function"}Re(Kw,"isApplicable");function Qu(e,i){return function(a,r){if(r.kind==="class")Object.hasOwn(a,"inject")||(Ma(a,"inject",Object.create(Object.getPrototypeOf(a).inject??null)),Ma(a.inject,ke.checkProto,!0)),a.inject[e]=i;else if(r.kind==="method"){const c=(a[ke.decorator]??={}).inject??=Object.create(null);c[e]=i,r.addInitializer(function(){const u=this[ke.tracker]?.property;(this[ke.initHooks]??=[]).push(()=>{this.ctx.inject(c,d=>a.call(u?Lo(this,{[u]:d}):this))})})}else throw new Error("@Inject() can only be used on class or class methods")}}Re(Qu,"Inject");(e=>{function i(a,r=Object.create(null)){if(!a)return r;if(Array.isArray(a))for(const c of a)r[c]=null;else if(Reflect.has(a,ke.checkProto)){Object.assign(r,i(Object.getPrototypeOf(a)));for(const c of Object.keys(a))r[c]=a[c]??null}else for(const c of Object.keys(a))r[c]=a[c]??null;return r}e.resolve=i,Re(i,"resolve")})(Qu||(Qu={}));var gA=class{constructor(e){this.ctx=e,Ma(this,ke.tracker,{property:"ctx",noShadow:!0})}ctx;static{Re(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(Kw(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=kd()){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 c=this._internal.get(r);if(!c){let p=e.name;p==="apply"&&(p=void 0),c={name:p,callback:r,fibers:new fg,Config:e.Config},this._internal.set(r,c)}const u=new Gw(this.ctx,i,Qu.resolve(e.inject),c,a),d=Object.create(u);return d.then=(p,h)=>u.await().then(p,h),d}},hg=class _o{static{Re(this,"Context")}static root=ke.root;static effect=ke.effect;static filter=ke.filter;static isolate=ke.isolate;static intercept=ke.intercept;static is(i){return!!i?.[_o.is]}static{_o.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),_o.prototype[_o.is]=!0}constructor(){this[ke.isolate]=Object.create(null),this[ke.intercept]=Object.create(null);const i=new Proxy(this,m0.handler);return this[ke.root]=i,this.baseUrl=void 0,this.fiber=new Gw(i,{},Object.create(null),null,()=>[]),this.reflect=new m0(i),this.registry=new gA(i),this.events=new dA(i),this.logger=new hA(i),this.fiber._disposables.clear(),i}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.fiber.name}>`}extend(i={}){const a=Reflect.getOwnPropertyDescriptor(this,ke.shadow)?.value,r=Object.create(xr(this,this));for(const c of Reflect.ownKeys(i))Object.defineProperty(r,c,Reflect.getOwnPropertyDescriptor(i,c));return a?Object.assign(Object.create(r),{[ke.shadow]:a}):r}isolate(i,a){const r=Object.create(this[ke.isolate]);return r[i]=a??Symbol(i),this.extend({[ke.isolate]:r})}intercept(i,a){const r=Object.create(this[ke.intercept]);return r[i]=a,this.extend({[ke.intercept]:r})}};function xA(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 mm(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 bA(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 c=i.get(a)??{chain:Promise.resolve(),token:{}},u=c.token,p=c.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 yA extends ki{static provide="sessions";constructor(i){super(i,"sessions")}current(i){return Xe.getState().sessions.find(a=>a.id===i)}all(){return Xe.getState().sessions}getMessages(i){return this.current(i)?.messages??[]}addMessage(i,a){Xe.getState().addMessage(i,a),this.flush(i)}updateMessage(i,a,r){Xe.getState().updateMessage(i,a,r),this.flush(i)}updateSession(i,a){Xe.getState().updateSession(i,a),this.flush(i)}turnHistory(i,a){return xA(i,a)}async flush(i){await this.ctx.events.parallel("session/flush",i).catch(()=>{})}}const vi=Ra()(e=>({skills:[],loaded:!1,loading:!1,error:"",load:async()=>{e({loading:!0});try{const{skills:i}=await Dj();e({skills:i,loaded:!0,loading:!1,error:""})}catch(i){e({loading:!1,error:i instanceof Error?i.message:"Could not load skills."})}},upload:async i=>{const a=await zj(i);return e({skills:a.skills,loaded:!0}),a.installed},installNpm:async i=>{const a=await Lj(i);return e({skills:a.skills,loaded:!0}),a.installed},setEnabled:async(i,a)=>{e(r=>({skills:r.skills.map(c=>c.name===i?{...c,enabled:a}:c)}));try{const r=await Ij(i,a);e({skills:r.skills})}catch(r){e(c=>({skills:c.skills.map(u=>u.name===i?{...u,enabled:!a}:u),error:r instanceof Error?r.message:"Could not update the skill."}))}},remove:async i=>{const a=await Uj(i);e({skills:a.skills})}}));function vA(){return vi.getState().skills.filter(e=>e.enabled)}function Xw(){const e=vA();return e.length===0?"":["## Skills","Skills are folders of expert instructions. When a task matches a skill below, call the `skill` tool with its name BEFORE starting, then follow what it returns. Load bundled files (scripts, references) with the same tool via `file`. Do not guess a skill's contents.",...e.map(i=>`- ${i.name}: ${i.description||"No description."}`)].join(`
|
|
43
|
+
`)}function Zw(e,i){const a=i?e.workspacePrompts?.[i]:void 0;return typeof a=="string"?{text:a,source:"workspace"}:{text:e.systemPrompt,source:"app"}}function Qw(e,i,a){return typeof i?.systemPrompt=="string"?{text:i.systemPrompt,source:"session"}:Zw(e,a)}function wA(){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(c=>!c.path.includes("/")).slice(0,40).map(c=>`${c.path}${c.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(`
|
|
44
|
+
`)}class kA extends ki{static provide="systemPrompt";static inject=["sessions"];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,r){const c=[],u=Be.getState(),d=r?this.ctx.sessions.current(r):void 0,p=Qw(i,d,u.root||u.info.root);p.text.trim()&&c.push({name:"base",priority:10,content:p.text.trim()});const h=Xw();h&&i.tools.skill?.enabled!==!1&&c.push({name:"skills",priority:20,content:h}),c.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.",wA()].join(`
|
|
45
|
+
|
|
46
|
+
`)});const g=Be.getState().instructions;g.content.trim()&&c.push({name:"project-instructions",priority:35,content:[`## Project instructions (${g.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="${g.file}">
|
|
47
|
+
${g.content.trim()}${g.truncated?`
|
|
48
|
+
… (file clipped)`:""}
|
|
49
|
+
</project-instructions>`].join(`
|
|
50
|
+
|
|
51
|
+
`)}),c.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(`
|
|
52
|
+
`):["## 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(`
|
|
53
|
+
`)}),c.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(`
|
|
54
|
+
`)}),c.push({name:"session-context",priority:50,content:["## Session context",`- Model: ${Qn(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(`
|
|
55
|
+
`)});for(const b of this.customSections.values()){const x=b(i,a);x&&x.content&&c.push(x)}return this.ctx.events.waterfall("system-prompt/assemble",c,a,()=>(c.sort((b,x)=>b.priority-x.priority),c.map(b=>b.content).filter(Boolean).join(`
|
|
56
|
+
|
|
57
|
+
`)))}buildSubagentPrompt(i,a){return[this.assemble(i,"plan",a),["## 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(`
|
|
58
|
+
`)].join(`
|
|
59
|
+
|
|
60
|
+
`)}}let vu;const Cn=Ra()((e,i)=>{const a=r=>{e({servers:r,loaded:!0,loading:!1,error:""}),vu!==void 0&&window.clearTimeout(vu),vu=void 0,r.some(c=>c.status==="connecting")&&(vu=window.setTimeout(()=>{i().load()},1200))};return{servers:[],loaded:!1,loading:!1,error:"",load:async()=>{e({loading:!0});try{a((await yj()).servers)}catch(r){e({loading:!1,loaded:!0,error:r instanceof Error?r.message:"Could not load MCP servers."})}},save:async r=>{const c=await vj(r);a(c.servers)},act:async(r,c)=>{c!=="disconnect"&&e(d=>({servers:d.servers.map(p=>p.id===r?{...p,status:"connecting",error:""}:p)}));const u=await wj(r,c);a(u.servers)},authorize:async r=>{const{url:c}=await kj(r),u=window.open(c,"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 Nj(r)).servers)},lookup:r=>{for(const c of i().servers){const u=c.tools.find(d=>d.fn===r);if(u)return{server:c,tool:u}}return null}}});function Ww(e){return e.startsWith("mcp__")}try{new BroadcastChannel("opensol-mcp-oauth").onmessage=()=>{Cn.getState().load()}}catch{}const hm=28e3;function NA(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 Jw(e){if(!Ww(e))return;const i=Cn.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:NA(r.inputSchema),allowedInMode:c=>c==="build"||r.readOnly,async execute(c,u){const{result:d}=await Ej(a.id,r.name,c,u.signal),p=d.text.trim()||"(the tool returned no output)";return{output:p.length>hm?`${p.slice(0,hm)}
|
|
61
|
+
… truncated (${p.length-hm} more characters)`:p,isError:d.isError}}}}function EA(){const e=[];for(const i of Cn.getState().servers)for(const a of i.tools){const r=Jw(a.fn);r&&e.push(r)}return e}function Wu(e,i){if(!Ww(i))return e.tools[i];const a=Cn.getState().lookup(i);if(!a)return;const{server:r,tool:c}=a;return{enabled:r.enabled&&r.status==="connected"&&!r.disabledTools.includes(c.name),approval:r.approval}}const SA=new Set(["read_file","list_files","grep","web_search","read_url"]);function g0(e,i){return i==="build"?!0:SA.has(e)||e==="shell"||e==="git"||e==="subagent"}class _A extends ki{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)??Jw(i)}list(){return[...this.definitions.values(),...EA()]}schemas(i,a="build",{subagent:r=!1}={}){const c=[],u=r?[...this.definitions.values()]:this.list();for(const d of u)d.name==="subagent"&&r||!Wu(i,d.name)?.enabled||!(d.allowedInMode?d.allowedInMode(a):g0(d.name,a))||(d.name==="web_search"||d.name==="read_url")&&!i.webSearchEnabled||c.push({name:d.name,description:d.description,parameters:d.parameters});return c}async execute(i,a,r,c,u,d,p){const h={name:i,args:a,settings:r,mode:c,signal:u,callId:d,turnId:p},g=await this.ctx.events.waterfall("tools/pre-execute",h,async()=>{if(!Wu(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(c):g0(i,c))?(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 b=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}}),x=await this.ctx.events.waterfall("tools/post-execute",b,h,async()=>b);return this.ctx.events.emit("tools/result",x,h),x}}const Iu=new Map;class TA extends ki{static provide="approval";static inject=["tools"];constructor(i){super(i,"approval"),this.ctx.on("tools/pre-execute",async(a,r)=>Wu(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 CA(i,a)}resolveApproval(i,a){ek(i,a)}}function CA(e,i){return i.aborted?Promise.resolve(!1):new Promise(a=>{const r=u=>{const d=Iu.get(e);d&&(d.cleanup(),Iu.delete(e),a(u))},c=()=>r(!1);i.addEventListener("abort",c,{once:!0}),Iu.set(e,{toolCallId:e,resolve:r,cleanup:()=>i.removeEventListener("abort",c)})})}function ek(e,i){Iu.get(e)?.resolve(i)}async function*Nd(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:c,value:u}=await i.read();if(c)break;r+=a.decode(u,{stream:!0}),r=r.replace(/\r\n/g,`
|
|
62
|
+
`);let d=r.indexOf(`
|
|
63
|
+
|
|
64
|
+
`);for(;d!==-1;){const p=r.slice(0,d);r=r.slice(d+2);for(const h of p.split(`
|
|
65
|
+
`)){if(!h.startsWith("data:"))continue;const g=h.slice(5).trim();g&&(yield g)}d=r.indexOf(`
|
|
66
|
+
|
|
67
|
+
`)}}for(const c of r.split(`
|
|
68
|
+
`))if(c.startsWith("data:")){const u=c.slice(5).trim();u&&(yield u)}}finally{i.releaseLock()}}function jA(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 AA=28e3,OA=new Set(["read_file","list_files","grep","web_search","read_url"]);function Zs(e,i=AA){return e.length<=i?e:`${e.slice(0,i)}
|
|
69
|
+
… truncated (${e.length-i} more characters)`}function yi(e){return e&&typeof e=="object"?e:{}}function Rt(e){return typeof e=="string"?e:""}function Di(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ea(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function x0(e,i){const a=e[i];return typeof a=="string"?a:void 0}function xo(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 tk(e,i){return i==="build"?!0:OA.has(e)||e==="shell"||e==="git"||e==="subagent"}function Ed(e,i="build",{subagent:a=!1}={}){if(Vt.tools)return Vt.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(c=>!(!e.tools[c.name]?.enabled||!tk(c.name,i)||(c.name==="web_search"||c.name==="read_url")&&!e.webSearchEnabled))}async function MA(){await Be.getState().refresh({treeOnly:!0}).catch(()=>{})}async function b0(){await Be.getState().refresh().catch(()=>{})}function RA(e){const i=Array.isArray(e.entries)?e.entries:[];if(i.length===0)return"This folder is empty.";const a=i.map(c=>{const u=yi(c),d=Rt(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?`
|
|
70
|
+
… listing truncated. Narrow the path or reduce depth.`:"";return`${Rt(e.root)?`Root: ${Rt(e.root)}
|
|
71
|
+
`:""}${a.join(`
|
|
72
|
+
`)}${r}`}function DA(e,i){const a=[`$ ${i}`,Rt(e.stdout)];Rt(e.stderr)&&a.push(`stderr:
|
|
73
|
+
${Rt(e.stderr)}`);const r=Di(e.code);return r!==void 0&&r!==0&&a.push(`exit code: ${r}`),e.timedOut===!0&&a.push("The command timed out."),a.filter(c=>c!=="").join(`
|
|
74
|
+
`)}function zA(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=yi(u);return`${Rt(d.file)}:${Di(d.line)??0}: ${Rt(d.text)}`}),c=e.truncated===!0?`
|
|
75
|
+
… more matches exist. Narrow the pattern or path.`:"";return r.join(`
|
|
76
|
+
`)+c}function LA(e){const i=[];Rt(e.current)&&i.push(`Current branch: ${Rt(e.current)}`),Rt(e.branches)&&i.push(Rt(e.branches)),Rt(e.stdout)&&i.push(Rt(e.stdout)),Rt(e.stderr)&&i.push(`stderr:
|
|
77
|
+
${Rt(e.stderr)}`);const a=Di(e.code);return a!==void 0&&a!==0&&i.push(`exit code: ${a}`),i.filter(Boolean).join(`
|
|
78
|
+
`)||"Git completed with no output."}async function IA(e,i,a,r,c){if(c.aborted)throw new DOMException("Aborted","AbortError");if(e==="read_file"){const h=ea(i,"path"),g=yi((await ln("read_file",{path:h},r,c)).result);if(g.binary===!0)return{output:`${h} is binary (${Di(g.size)??0} bytes).`,isError:!1};const b=Math.max(1,Math.round(xo(i,"offset",1))),x=Math.min(Math.max(1,Math.round(xo(i,"limit",400))),2e3),v=Rt(g.content).split(`
|
|
79
|
+
`),y=v.slice(b-1,b-1+x),k=v.length-(b-1+x),S=`${Rt(g.path)||h} · ${v.length} lines${g.truncated===!0?" · file clipped by daemon":""}`,j=k>0?`
|
|
80
|
+
… ${k} more lines. Read again with offset ${b+x}.`:"";return{output:Zs(`${S}
|
|
81
|
+
────
|
|
82
|
+
${y.join(`
|
|
83
|
+
`)}${j}`),isError:!1}}if(e==="list_files"){const h=yi((await ln("list_files",{path:x0(i,"path")??"",depth:Math.min(Math.max(1,xo(i,"depth",3)),8)},r,c)).result);return{output:RA(h),isError:!1}}if(e==="write_file"||e==="rewrite_file"){const h=ea(i,"path"),g=ea(i,"content"),b=yi((await ln(e,{path:h,content:g},r,c)).result);return await b0(),{output:`${b.created===!0?"Created":e==="rewrite_file"?"Rewrote":"Updated"} ${Rt(b.path)||h} · ${g.split(`
|
|
84
|
+
`).length} lines, ${Di(b.size)??g.length} bytes.`,isError:!1}}if(e==="edit_file"){const h=ea(i,"path"),g=ea(i,"oldText"),b=typeof i.newText=="string"?i.newText:"",x=yi((await ln("edit_file",{path:h,oldText:g,newText:b,replaceAll:i.replaceAll===!0},r,c)).result);return await b0(),{output:`Edited ${Rt(x.path)||h} · ${Di(x.replacements)??1} replacement${Di(x.replacements)===1?"":"s"}.`,isError:!1}}if(e==="shell"){const h=ea(i,"command"),g=yi((await ln("shell",{command:h,timeoutMs:xo(i,"timeoutMs",12e4)},r,c)).result);return MA(),{output:Zs(DA(g,h)),isError:(Di(g.code)??0)!==0||g.timedOut===!0}}if(e==="grep"){const h=ea(i,"pattern"),g=yi((await ln("grep",{pattern:h,path:x0(i,"path")??"",ignoreCase:i.ignoreCase===!0},r,c)).result),b=Math.min(Math.max(1,Math.round(xo(i,"maxResults",80))),200),x=Array.isArray(g.matches)?g.matches.slice(0,b):[],v={...g,matches:x,truncated:g.truncated===!0||Array.isArray(g.matches)&&g.matches.length>b};return{output:Zs(zA(v,h)),isError:!1}}if(e==="web_search"){const h=ea(i,"query"),g=yi((await ln("web_search",{query:h,provider:a.searchProvider},r,c)).result),b=Array.isArray(g.results)?g.results:[];if(b.length===0)return{output:"No results found.",isError:!1};const x=b.map((v,y)=>{const k=yi(v);return`${y+1}. ${Rt(k.title)}
|
|
85
|
+
${Rt(k.url)}${Rt(k.snippet)?`
|
|
86
|
+
${Rt(k.snippet)}`:""}`}).join(`
|
|
87
|
+
|
|
88
|
+
`);return{output:Zs(`Search: ${h}
|
|
89
|
+
Provider: ${Rt(g.provider)||"web"}
|
|
90
|
+
|
|
91
|
+
${x}`),isError:!1}}if(e==="read_url"){const h=ea(i,"url"),g=yi((await ln("read_url",{url:h},r,c)).result),b=Rt(g.title);return{output:Zs(`Source: ${Rt(g.url)||h}${b?`
|
|
92
|
+
Title: ${b}`:""}
|
|
93
|
+
|
|
94
|
+
${Rt(g.content)}${g.truncated===!0?`
|
|
95
|
+
|
|
96
|
+
… page truncated.`:""}`),isError:!1}}const u=ea(i,"action"),d={...i};delete d.action;const p=yi((await ln("git",{action:u,...d},r,c)).result);return(u==="add"||u==="commit"||u==="init"||u==="checkout")&&await Be.getState().loadGit().catch(()=>{}),{output:Zs(LA(p)),isError:(Di(p.code)??0)!==0}}async function UA(e,i,a,r,c){if(Vt.tools)return await Vt.tools.execute(e,i,a,r,c);if(!a.tools[e]?.enabled)return{output:"This tool is disabled in Settings → Tools.",isError:!0};if(!tk(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 IA(e,i,a,r,c)}catch(u){if(u instanceof DOMException&&u.name==="AbortError")throw u;return{output:u instanceof Error?u.message:"The tool failed.",isError:!0}}}function gg(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",skill:"Skill"}[e]??"Tool"}function nk(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:e==="skill"?[i.name,i.file].filter(Boolean).join(" / "):i.path??"";return typeof a=="string"?a:""}const ik={onText:()=>{},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}};function Io(e){const i=[e.content];for(const a of e.attachments??[])a.kind==="text"&&a.text&&i.push(`
|
|
97
|
+
|
|
98
|
+
--- Attached file: ${a.name} ---
|
|
99
|
+
${a.text}`);return i.filter(Boolean).join("")}function Sd(e){return!!(e.content.trim()||e.toolCalls.length>0)}function _d(e){return(e.attachments??[]).filter(i=>i.kind==="image"&&i.dataUrl)}function xg(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 Td(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 BA(e){const i=[],a=(r,c)=>{if(c.length===0)return;const u=i[i.length-1];u?.role===r?u.content.push(...c):i.push({role:r,content:c})};for(const r of e){if(r.role==="user"){const c=[];for(const d of _d(r)){const p=/^data:(image\/[a-z0-9.+-]+);base64,(.+)$/i.exec(d.dataUrl??"");p&&c.push({type:"image",source:{type:"base64",media_type:p[1],data:p[2]}})}const u=Io(r);u.trim()&&c.push({type:"text",text:u}),c.length===0&&c.push({type:"text",text:"(empty message)"}),a("user",c);continue}if(r.role==="assistant"){if(!Sd(r))continue;const c=[];for(const u of r.thinkingBlocks??[])u.signature&&c.push({type:"thinking",thinking:u.text,signature:u.signature});r.content.trim()&&c.push({type:"text",text:r.content});for(const u of r.toolCalls)c.push({type:"tool_use",id:u.id,name:u.name,input:u.args});a("assistant",c);continue}a("user",[{type:"tool_result",tool_use_id:r.call.id,content:Td(r.result,r.status),is_error:r.status==="error"||r.status==="denied"}])}return i}async function ak(e){const{settings:i,model:a,history:r,system:c,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=wr(a),b=ul(i.effort,a),x=b!=="none"&&(g.length>0||Yu(a));let v=i.maxTokens,y=0;x&&g.length===0&&Yu(a)&&(y=jw(b,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=Ed(i,u).map(L=>({name:L.name,description:L.description,input_schema:L.parameters})),S={model:h,max_tokens:v,system:c,messages:BA(r),stream:!0};if(k.length>0&&(S.tools=k),x&&g.length>0){const L=b==="minimal"?"low":b;S.output_config={effort:L}}else y>0?S.thinking={type:"enabled",budget_tokens:y}:x||(!a||a.temperature)&&(S.temperature=i.temperature);const j=await Ho(i.provider,"anthropic",h,S,d);let E="",A="",T={};const R=new Map;for await(const L of Nd(j)){let G;try{G=JSON.parse(L)}catch{continue}const O=G.type;if(O==="error"){const $=G.error;throw new Error(typeof $=="string"?$:$?.message??"Anthropic returned an error.")}if(O==="message_start"){const $=G.message;T={...T,input:$?.usage?.input_tokens};continue}if(O==="content_block_start"){const $=Number(G.index??R.size),Z=G.content_block;R.set($,{type:String(Z.type??""),text:typeof Z.text=="string"?Z.text:typeof Z.thinking=="string"?Z.thinking:"",signature:typeof Z.signature=="string"?Z.signature:"",id:typeof Z.id=="string"?Z.id:"",name:typeof Z.name=="string"?Z.name:"",json:"",input:Z.input});continue}if(O==="content_block_delta"){const $=Number(G.index??0),Z=R.get($),fe=G.delta;if(!Z||!fe)continue;fe.type==="text_delta"&&typeof fe.text=="string"?(Z.text+=fe.text,E+=fe.text,p.onText(fe.text)):fe.type==="thinking_delta"&&typeof fe.thinking=="string"?(Z.text+=fe.thinking,A+=fe.thinking,p.onReasoning(fe.thinking)):fe.type==="signature_delta"&&typeof fe.signature=="string"?Z.signature+=fe.signature:fe.type==="input_json_delta"&&typeof fe.partial_json=="string"&&(Z.json+=fe.partial_json);continue}if(O==="message_delta"){const $=G.usage;T={...T,output:$?.output_tokens??T.output},p.onUsage(T);continue}if(O==="message_stop")break}const P=new Set(k.map(L=>L.name)),z=[],C=[];for(const[,L]of[...R.entries()].sort((G,O)=>G[0]-O[0])){if(L.type==="tool_use"&&L.name){if(!P.has(L.name))throw new Error(`The model requested a tool that is not enabled: ${L.name}`);const G=L.json?xg(L.json,L.name):L.input&&typeof L.input=="object"?L.input:{};z.push({id:L.id||`call_${Date.now().toString(36)}_${z.length}`,name:L.name,args:G})}L.type==="thinking"&&L.text&&C.push({text:L.text,signature:L.signature||void 0})}return z.length>0&&p.onToolCalls(z),{content:E,reasoning:A,toolCalls:z,thinkingBlocks:C,usage:T}}function $A(e){const i=[],a=(r,c)=>{if(c.length===0)return;const u=i[i.length-1];u?.role===r?u.parts.push(...c):i.push({role:r,parts:c})};for(const r of e){if(r.role==="user"){const c=[];for(const d of _d(r)){const p=/^data:([^;]+);base64,(.+)$/i.exec(d.dataUrl??"");p&&c.push({inlineData:{mimeType:p[1],data:p[2]}})}const u=Io(r);u.trim()&&c.push({text:u}),c.length===0&&c.push({text:"(empty message)"}),a("user",c);continue}if(r.role==="assistant"){if(!Sd(r))continue;const c=[];r.content.trim()&&c.push({text:r.content});for(const u of r.toolCalls)c.push({functionCall:{name:u.name,args:u.args},...u.thoughtSignature?{thoughtSignature:u.thoughtSignature}:{}});a("model",c);continue}a("user",[{functionResponse:{name:r.call.name,response:{result:Td(r.result,r.status),...r.status==="error"||r.status==="denied"?{isError:!0}:{}}}}])}return i}function wh(e){if(Array.isArray(e))return e.map(wh);if(!e||typeof e!="object")return e;const i={};for(const[a,r]of Object.entries(e))a==="additionalProperties"||a==="$schema"||(i[a]=wh(r));return i}async function rk(e){const{settings:i,model:a,history:r,system:c,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=wr(a),b=ul(i.effort,a),x=Yu(a)?jw(b,a):0,v=b!=="none"&&(g.length>0||x>0);let y=i.maxTokens;v&&x>0&&(y=Math.max(y,x+2048),a?.maxOutput&&(y=Math.min(y,a.maxOutput)));const k=Ed(i,u),S={maxOutputTokens:y};(!a||a.temperature)&&(S.temperature=i.temperature),v&&g.length>0?S.thinkingConfig={thinkingLevel:b.toUpperCase(),includeThoughts:!0}:v&&x>0?S.thinkingConfig={thinkingBudget:Math.min(x,Math.max(1024,y-1024)),includeThoughts:!0}:v&&Tw(a)&&(S.thinkingConfig={includeThoughts:!0});const j={systemInstruction:{parts:[{text:c}]},contents:$A(r),generationConfig:S};k.length>0&&(j.tools=[{functionDeclarations:k.map(O=>({name:O.name,description:O.description,parameters:wh(O.parameters)}))}],j.toolConfig={functionCallingConfig:{mode:"AUTO"}});const E=await Ho(i.provider,"gemini",h,j,d);let A="",T="",R={},P="";const z=[],C=new Set(k.map(O=>O.name));let L;for await(const O of Nd(E)){let $;try{$=JSON.parse(O)}catch{continue}const Z=$.error;if(Z?.message)throw new Error(Z.message);const fe=$.promptFeedback;if(fe?.blockReason)throw new Error(`Gemini blocked this request (${fe.blockReason}).`);const re=$.usageMetadata;re&&(R={input:re.promptTokenCount,output:(re.candidatesTokenCount??0)+(re.thoughtsTokenCount??0)||re.candidatesTokenCount},p.onUsage(R));const M=$.candidates?.[0];M?.finishReason&&(P=M.finishReason);for(const ae of M?.content?.parts??[]){const ne=typeof ae.thoughtSignature=="string"?ae.thoughtSignature:void 0;ne&&(L=ne),typeof ae.text=="string"&&ae.text&&(ae.thought===!0?(T+=ae.text,p.onReasoning(ae.text)):(A+=ae.text,p.onText(ae.text)));const xe=ae.functionCall;if(xe?.name){if(!C.has(xe.name))throw new Error(`Gemini requested a tool that is not enabled: ${xe.name}`);z.push({name:xe.name,args:xe.args??{},signature:ne??L}),L=void 0}}}if(P==="SAFETY"||P==="RECITATION")throw new Error(`Gemini stopped the response (${P.toLowerCase()}).`);const G=z.map((O,$)=>({id:`gemini_${Date.now().toString(36)}_${$}`,name:O.name,args:O.args,thoughtSignature:O.signature}));return G.length>0&&p.onToolCalls(G),{content:A,reasoning:T,toolCalls:G,usage:R}}function PA(e){const i=[];for(const a of e){if(a.role==="user"){const r=_d(a);if(r.length>0){const c=[{type:"text",text:Io(a)||"See the attached image."}];for(const u of r)c.push({type:"image_url",image_url:{url:u.dataUrl,detail:"auto"}});i.push({role:"user",content:c})}else{const c=Io(a);c.trim()&&i.push({role:"user",content:c})}continue}if(a.role==="assistant"){if(!Sd(a))continue;const r={role:"assistant",content:a.content||null};a.toolCalls.length>0&&(r.tool_calls=a.toolCalls.map(c=>({id:c.id,type:"function",function:{name:c.name,arguments:JSON.stringify(c.args)}}))),i.push(r);continue}i.push({role:"tool",tool_call_id:a.call.id,content:Td(a.result,a.status)})}return i}function y0(e,i){return e!=="openai"?!1:/^(gpt-5|o[1-9]|codex)/i.test(i)}async function sk(e){const{settings:i,model:a,history:r,system:c,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=Ed(i,u),b=new Set(g.map(z=>z.name)),x=g.map(z=>({type:"function",function:{name:z.name,description:z.description,parameters:z.parameters}})),v={model:h,messages:[{role:"system",content:c},...PA(r)],stream:!0};x.length>0&&(v.tools=x,v.tool_choice="auto"),(i.provider==="openai"||i.provider==="openrouter")&&(v.stream_options={include_usage:!0}),i.provider==="openrouter"&&(v.usage={include:!0}),y0(i.provider,h)?v.max_completion_tokens=i.maxTokens:v.max_tokens=i.maxTokens;let k=wr(a).length>0?ul(i.effort,a):"";k==="none"&&(k=""),k&&(i.provider==="openrouter"?v.reasoning={effort:k}:v.reasoning_effort=k);const S=a?a.temperature:!y0(i.provider,h);!k&&S&&(v.temperature=i.temperature);const j=await Ho(i.provider,"openai-chat",h,v,d);let E="",A="",T={};const R=new Map;for await(const z of Nd(j)){if(z==="[DONE]")break;let C;try{C=JSON.parse(z)}catch{continue}if(C.error){const $=C.error;throw new Error(typeof $=="string"?$:$.message??"The provider returned an error.")}if(C.usage&&typeof C.usage=="object"){const $=C.usage;T={input:$.prompt_tokens,output:$.completion_tokens,cost:typeof $.cost=="number"&&Number.isFinite($.cost)?$.cost:void 0},p.onUsage(T)}const G=C.choices?.[0]?.delta;if(!G)continue;typeof G.content=="string"&&G.content&&(E+=G.content,p.onText(G.content));const O=typeof G.reasoning_content=="string"?G.reasoning_content:typeof G.reasoning=="string"?G.reasoning:(G.reasoning_details??[]).map($=>$.text??"").join("");O&&(A+=O,p.onReasoning(O));for(const[$,Z]of(G.tool_calls??[]).entries()){const fe=typeof Z.index=="number"?Z.index:$,re=R.get(fe)??{id:"",name:"",arguments:""};Z.id&&(re.id=Z.id),Z.function?.name&&(re.name=Z.function.name),Z.function?.arguments&&(re.arguments+=Z.function.arguments),R.set(fe,re)}}const P=[];for(const[z,C]of[...R.entries()].sort((L,G)=>L[0]-G[0]))if(C.name){if(!b.has(C.name))throw new Error(`The model requested a tool that is not enabled: ${C.name}`);P.push({id:C.id||`call_${Date.now().toString(36)}_${z}`,name:C.name,args:xg(C.arguments,C.name)})}return P.length>0&&p.onToolCalls(P),{content:E,reasoning:A,toolCalls:P,usage:T}}function HA(e){const i=[];for(const a of e){if(a.role==="user"){const r=_d(a),c=Io(a)||(r.length>0?"See the attached image.":"");if(!c.trim()&&r.length===0)continue;if(r.length===0){i.push({role:"user",content:c});continue}const u=[{type:"input_text",text:c}];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(!Sd(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:Td(a.result,a.status)})}return i}function Qs(e){return e&&typeof e=="object"?e:{}}async function lk(e){const{settings:i,model:a,history:r,system:c,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=Ed(i,u),b=new Set(g.map(C=>C.name)),x={model:h,instructions:c,input:HA(r),max_output_tokens:i.maxTokens,tool_choice:"auto"};g.length>0&&(x.tools=g.map(C=>({type:"function",name:C.name,description:C.description,parameters:C.parameters,strict:!1})));const y=wr(a).length>0?ul(i.effort,a):"none";y!=="none"&&(x.reasoning={effort:y});const k=await Ho(i.provider,"openai-responses",h,x,d);let S="",j="",E={};const A=new Map;let T=0;const R=(C,L)=>{const G=A.get(C),O=typeof L.call_id=="string"?L.call_id:G?.id||C,$=typeof L.name=="string"?L.name:G?.name||"",Z=typeof L.arguments=="string"?L.arguments:G?.args||"";A.set(C,{id:O,name:$,args:Z,order:G?.order??T++})};for await(const C of Nd(k)){if(C==="[DONE]")break;let L;try{L=JSON.parse(C)}catch{continue}const G=typeof L.type=="string"?L.type:"";if(G==="error"||G==="response.failed"){const O=Qs(L.response).error??L.error??L.message,$=Qs(O);throw new Error(typeof O=="string"?O:typeof $.message=="string"?$.message:"The model request failed.")}if(G==="response.output_text.delta"&&typeof L.delta=="string"){S+=L.delta,p.onText(L.delta);continue}if((G==="response.reasoning_summary_text.delta"||G==="response.reasoning_text.delta")&&typeof L.delta=="string"){j+=L.delta,p.onReasoning(L.delta);continue}if(G==="response.output_item.added"){const O=Qs(L.item);if(O.type==="function_call"){const $=typeof O.id=="string"?O.id:typeof O.call_id=="string"?O.call_id:"";$&&R($,O)}continue}if(G==="response.function_call_arguments.delta"){const O=typeof L.item_id=="string"?L.item_id:"",$=O?A.get(O):void 0;$&&typeof L.delta=="string"&&($.args+=L.delta);continue}if(G==="response.function_call_arguments.done"){const O=typeof L.item_id=="string"?L.item_id:"",$=O?A.get(O):void 0;$&&typeof L.arguments=="string"&&($.args=L.arguments);continue}if(G==="response.output_item.done"){const O=Qs(L.item);if(O.type==="function_call"){const $=typeof O.id=="string"?O.id:typeof O.call_id=="string"?O.call_id:"";$&&R($,O)}continue}if(G==="response.completed"){const O=Qs(L.response),$=Qs(O.usage);(typeof $.input_tokens=="number"||typeof $.output_tokens=="number")&&(E={input:Number($.input_tokens)||void 0,output:Number($.output_tokens)||void 0},p.onUsage(E))}}const P=[],z=[...A.entries()].sort((C,L)=>C[1].order-L[1].order);for(const[C,L]of z)if(L.name){if(!b.has(L.name))throw new Error(`The model requested a tool that is not enabled: ${L.name}`);P.push({id:L.id||C,name:L.name,args:xg(L.args,L.name)})}return P.length>0&&p.onToolCalls(P),{content:S,reasoning:j,toolCalls:P,usage:E}}const Co=[],ok=600*1e3,An=Ra()((e,i)=>({byProvider:{},loading:{},errors:{},notes:{},source:{},fetchedAt:{},fetchModels:async(a,r=!1)=>{if(i().loading[a])return i().byProvider[a]??Co;if(!r){const c=i().byProvider[a]??Co,u=i().fetchedAt[a]??0;if(c.length>0&&Date.now()-u<ok)return c}e(c=>({loading:{...c.loading,[a]:!0},errors:{...c.errors,[a]:""}}));try{const c=await dj(a);return e(u=>({byProvider:{...u.byProvider,[a]:c.models},loading:{...u.loading,[a]:!1},errors:{...u.errors,[a]:""},notes:{...u.notes,[a]:c.note||c.catalogError||""},source:{...u.source,[a]:c.source},fetchedAt:{...u.fetchedAt,[a]:c.fetchedAt||Date.now()}})),c.models}catch(c){const u=c instanceof Error?c.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]??Co}}}));function FA(e){return An(i=>i.byProvider[e])??Co}function Cd(){const e=ze(a=>a.provider),i=ze(a=>a.model);return An(a=>i?a.byProvider[e]?.find(r=>r.id===i)??null:null)}function pl(e,i){return i?An.getState().byProvider[e]?.find(a=>a.id===i)??null:null}function qA(){const e=ze(a=>a.hydrated),i=ze(a=>a.provider);U.useEffect(()=>{if(!e)return;const a=ze.getState();if(!dl(a))return;const r=An.getState(),c=r.byProvider[i]??Co,u=r.fetchedAt[i]??0;c.length>0&&Date.now()-u<ok||r.fetchModels(i)},[e,i])}function ck(e,i,a){if(a?.apiKind)return a.apiKind;const r=ra[e];if(e!=="opencode")return r?.format==="anthropic"?"anthropic":r?.format==="gemini"?"gemini":"openai-chat";const c=i.toLowerCase();return/gemini|gemma/.test(c)?"gemini":/claude|qwen.*(flash|plus)/.test(c)?"anthropic":/gpt|grok|muse|codex/.test(c)?"openai-responses":"openai-chat"}class GA extends ki{static provide="llm";constructor(i){super(i,"llm")}async stream(i){return await this.ctx.events.waterfall("agent/request",i,async()=>{switch(ck(i.settings.provider,i.settings.model,i.model)){case"anthropic":return await ak(i);case"gemini":return await rk(i);case"openai-responses":return await lk(i);default:return await sk(i)}})}}function uk(e){switch(ck(e.settings.provider,e.settings.model,e.model)){case"anthropic":return ak(e);case"gemini":return rk(e);case"openai-responses":return lk(e);default:return sk(e)}}const YA=`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.
|
|
100
|
+
|
|
101
|
+
The summary MUST include, in clear sections:
|
|
102
|
+
|
|
103
|
+
## Task & Goal
|
|
104
|
+
What the user originally asked for. The full scope, requirements, and any constraints they stated.
|
|
105
|
+
|
|
106
|
+
## Work Completed So Far
|
|
107
|
+
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.
|
|
108
|
+
|
|
109
|
+
## Current State
|
|
110
|
+
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?
|
|
111
|
+
|
|
112
|
+
## Open Tasks & Next Steps
|
|
113
|
+
What remains to be done? List concrete next actions with enough detail that the agent can pick up exactly where things left off.
|
|
114
|
+
|
|
115
|
+
## Key Facts & Decisions
|
|
116
|
+
Important technical facts discovered during the session: library versions, APIs used, architectural decisions made, pitfalls encountered.
|
|
117
|
+
|
|
118
|
+
## Files Modified or Created
|
|
119
|
+
An exhaustive list of every file path that was touched and a one-line description of what was done.
|
|
120
|
+
|
|
121
|
+
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.`,Uu=new Set;function dk(e){return Uu.has(e)}async function VA(e){if(Uu.has(e))return!1;Uu.add(e);try{const i=Xe.getState().sessions.find(k=>k.id===e);if(!i||i.messages.length<4)return!1;const a=ze.getState(),r=Qn(a);if(!r)return!1;const c=pl(a.provider,r),u=KA(i.messages),d=[{id:Li("msg"),role:"user",content:`Below is a complete transcript of a coding session. Produce the detailed summary as instructed.
|
|
122
|
+
|
|
123
|
+
${u}`,createdAt:Date.now()}];let p="";try{const k=await uk({settings:a,model:c,history:d,system:YA,mode:"build",signal:new AbortController().signal,handlers:{...ik,onText:S=>{p+=S}}});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(),b=[];h&&b.push({...h});const x={id:Li("msg"),role:"assistant",content:p.trim(),reasoning:"",toolCalls:[],round:0,model:r,provider:a.provider,createdAt:g,durationMs:0};b.push(x);const v=XA(i.messages),y={id:Li("msg"),role:"user",content:v,createdAt:g};return b.push(y),Xe.getState().updateSession(e,{messages:b}),window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:"✦ Context compacted — session summary saved, continuing with fresh context.",tone:"success"}})),!0}finally{Uu.delete(e)}}function KA(e){const i=[];for(const a of e)if(a.role==="user"){const r=a.attachments&&a.attachments.length>0?`
|
|
124
|
+
[Attachments: ${a.attachments.map(c=>c.name).join(", ")}]`:"";i.push(`[USER]
|
|
125
|
+
${a.content}${r}`)}else if(a.role==="assistant"){const r=[];a.reasoning.trim()&&r.push(`<thinking>
|
|
126
|
+
${a.reasoning.trim()}
|
|
127
|
+
</thinking>`),a.content.trim()&&r.push(a.content.trim());for(const c of a.toolCalls)r.push(`<tool_call name="${c.name}">
|
|
128
|
+
${JSON.stringify(c.args,null,2)}
|
|
129
|
+
</tool_call>`);r.length>0&&i.push(`[ASSISTANT]
|
|
130
|
+
${r.join(`
|
|
131
|
+
|
|
132
|
+
`)}`)}else if(a.role==="tool"){const r=a.status==="done"?"OK":a.status.toUpperCase(),c=(a.result??"").slice(0,8e3),u=(a.result??"").length>8e3?`
|
|
133
|
+
… (truncated)`:"";i.push(`[TOOL: ${a.call.name} — ${r}]
|
|
134
|
+
${c}${u}`)}return i.join(`
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
`)}function XA(e){const r=[...e].reverse().find(d=>d.role==="user")?.content?.trim()??"",c=e.filter(d=>d.role==="tool").length;return[`[CONTEXT COMPACTED — ${e.filter(d=>d.role==="user").length} user turns, ${c} 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?`
|
|
139
|
+
The most recent task/request was:
|
|
140
|
+
${r}`:""].filter(d=>d!==void 0).join(`
|
|
141
|
+
`)}const gm=3;function ZA(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)/gm)+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)/gm)+4}return Math.ceil((e.result??"").length/gm)+4}function fk(e){return e.reduce((i,a)=>i+ZA(a),0)}function pk(e){return e?.context??128e3}function QA(e,i){const r=fk(e)+2e3,c=pk(i);return Math.min(r/c,1)}function mk(e,i){const r=fk(e)+2e3,c=pk(i),u=Math.min(r/c,1);return{used:r,limit:c,ratio:u,pct:Math.round(u*100)}}const hk=.85;class WA extends ki{static provide="compaction";static inject=["sessions","llm"];constructor(i){super(i,"compaction")}isCompacting(i){return dk(i)}async compact(i){return await VA(i)}async checkAutoCompact(i){const a=Xe.getState().sessions.find(d=>d.id===i);if(!a||a.messages.length<4||this.isCompacting(i))return!1;const r=ze.getState(),c=pl(r.provider,Qn(r)),u=QA(a.messages,c);return u>=hk?(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 JA(){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(c=>!c.path.includes("/")).slice(0,40).map(c=>`${c.path}${c.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(`
|
|
142
|
+
`)}function eO(e,i=e.mode,a){if(Vt.systemPrompt)return Vt.systemPrompt.assemble(e,i,a);const r=[e.systemPrompt.trim()],c=Xw();return c&&e.tools.skill?.enabled!==!1&&r.push(c),r.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.",JA()].join(`
|
|
143
|
+
|
|
144
|
+
`)),r.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(`
|
|
145
|
+
`):["## 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(`
|
|
146
|
+
`)),r.push(["## Session context",`- Model: ${Qn(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(`
|
|
147
|
+
`)),r.filter(Boolean).join(`
|
|
148
|
+
|
|
149
|
+
`)}function tO(e,i){return[eO(e,"plan",i),["## 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(`
|
|
150
|
+
`)].join(`
|
|
151
|
+
|
|
152
|
+
`)}function xm(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 bm(){return new DOMException("Aborted","AbortError")}async function nO(e,i,a,r){const c=e.trim();if(!c)return"The subagent was not given a task.";if(a.aborted)throw bm();const u=ze.getState(),d=pl(u.provider,u.model),p=tO(u,r),h=Date.now(),b=[{id:xm("sub"),role:"user",content:[`Task: ${c}`,i.trim()?`
|
|
153
|
+
Context from the main agent:
|
|
154
|
+
${i.trim()}`:"",`
|
|
155
|
+
Investigate now. Return a concise report with file paths and evidence.`].filter(Boolean).join(`
|
|
156
|
+
`),createdAt:h}];for(let x=0;;x+=1){if(a.aborted)throw bm();const v=await uk({settings:u,model:d,history:b,system:p,mode:"plan",signal:a,handlers:ik}),y={id:xm("submsg"),role:"assistant",content:v.content,reasoning:v.reasoning,thinkingBlocks:v.thinkingBlocks,toolCalls:v.toolCalls,round:x,createdAt:Date.now()};if(b.push(y),v.toolCalls.length===0)return y.content.trim()||"The subagent returned no report.";if(a.aborted)throw bm();for(const k of v.toolCalls){const S=await UA(k.name,k.args,u,"plan",a),j={id:xm("subtool"),role:"tool",call:k,status:S.isError?"error":"done",result:S.output,round:x,createdAt:Date.now()};b.push(j)}}}class iO extends ki{static provide="subagents";static inject=["tools","llm","systemPrompt"];constructor(i){super(i,"subagents")}async run(i,a,r,c){return await nO(i,a,r,c)}}const kh=e=>`maxcode-plugin-theme-${e}`;function aO(e){return Object.entries(e).filter(([i,a])=>/^[a-z][a-z0-9-]*$/.test(i)&&/^[\d\s.]+$/.test(a))}function rO(e){const i=(e.canvas??"").trim().split(/\s+/).map(Number),[a,r,c]=i.length===3?i:[255,255,255];return .2126*a+.7152*r+.0722*c<110}function sO(e,i){const a=aO(i).map(([r,c])=>`--${r}:${c.trim()}`);return a.length===0?"":`[data-theme='${e}']{${a.join(";")}}`}function lO(e,i){if(typeof document>"u")return;let a=document.getElementById(kh(e));a||(a=document.createElement("style"),a.id=kh(e),document.head.append(a)),a.textContent=i}function oO(e){typeof document>"u"||document.getElementById(kh(e))?.remove()}class cO extends ki{static provide="ui";_commands=new Map;_panels=new Map;_themes=new Map;constructor(i){super(i,"ui")}registerCommand(i,a,r){const c={id:i,label:a,run:r};return this._commands.set(i,c),()=>{this._commands.get(i)===c&&this._commands.delete(i)}}registerPanel(i,a,r){const c={id:i,label:a,render:r};return this._panels.set(i,c),()=>{this._panels.get(i)===c&&this._panels.delete(i)}}registerTheme(i,a,r){const c={id:i,label:a,palette:r};return this._themes.set(i,c),Ow({id:i,label:a,dark:rO(r)}),lO(i,sO(i,r)),()=>{this._themes.get(i)===c&&(this._themes.delete(i),Mw(i),oO(i))}}commands(){return[...this._commands.values()]}panels(){return[...this._panels.values()]}themes(){return[...this._themes.values()].map(i=>({id:i.id,label:i.label}))}}function uO(e,i){if(!e)return;if(typeof e.cost=="number"&&Number.isFinite(e.cost)&&e.cost>0)return e.cost;const a=i?.pricing;if(!a)return;const r=((e.input??0)*a.input+(e.output??0)*a.output)/1e6;return r>0?r:void 0}function dO(e){let i=0;for(const a of e)a.role==="assistant"&&typeof a.cost=="number"&&(i+=a.cost);return i}function Nh(e){return e<=0?"$0.00":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}const v0=5,fO=/quota|insufficient[_ ]?(funds|credit|balance)|out of credits?|no credits?|billing|payment required|\b402\b|credit balance|limit (has been )?(reached|exceeded)|reached (the |your )?(\w+ )?limit|exceeded (your |the )?(current )?(quota|limit|plan)|usage limit|monthly limit|daily limit|spend(ing)? limit|invalid[_ ]?(api[_ ]?)?key|incorrect api key|unauthori[sz]ed|\b401\b|\b403\b|forbidden|permission|not found|\b404\b|invalid[_ ]request|\b400\b|context (length|window)|too many tokens|maximum context|content[_ ]policy|safety|model .*(not|does not)|credentials|deprecated/i,pO=/\b(429|500|502|503|504|520|521|522|523|524|529)\b|rate.?limit|too many requests|overloaded|capacity|temporar|try again|unavailable|timed? ?out|timeout|could not be reached|lost the connection|failed to fetch|networkerror|network error|econnreset|etimedout|socket hang up|bad gateway|gateway|stream (ended|closed)|internal server error|server error/i;function mO(e){const i=e||"",a=/rate.?limit|too many requests|slow down|per[- ]minute|per[- ]second|requests? per|retry (in|after)|try again (in|later)/i.test(i),r=/quota|credit|billing|balance|usage limit|monthly|daily|spend(ing)? limit|exceeded your (current )?(plan|limit)|payment|\b402\b/i.test(i);return a&&!r&&!/invalid|unauthori|forbidden|\b40[0134]\b/i.test(i)?{retry:!0,reason:"transient"}:fO.test(i)?{retry:!1,reason:"permanent"}:pO.test(i)?{retry:!0,reason:"transient"}:{retry:!1,reason:"unknown"}}function hO(e){const i=/(?:retry[- ]after|retry in|try again in|wait)\D{0,6}(\d+(?:\.\d+)?)\s*(ms|milliseconds?|s|sec|seconds?|m|min)?/i.exec(e||"");if(!i)return;const a=Number(i[1]);if(!Number.isFinite(a))return;const r=(i[2]??"s").toLowerCase(),c=r.startsWith("ms")||r.startsWith("milli")?a:r.startsWith("m")&&r!=="ms"&&!r.startsWith("milli")?a*6e4:a*1e3;return Math.min(Math.max(c,500),6e4)}function gO(e,i="",a=Math.random){const c=Math.min(1500*2**(e-1),24e3)*(.8+a()*.4);return Math.round(Math.max(c,hO(i)??0))}function xO(e,i){return new Promise(a=>{const r=()=>{window.clearTimeout(c),i.removeEventListener("abort",r),a()},c=window.setTimeout(r,e);i.addEventListener("abort",r,{once:!0})})}function w0(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function bO(e,i=4e4){return e.length<=i?e:`${e.slice(0,i)}
|
|
157
|
+
… truncated (${e.length-i} more characters)`}class yO extends ki{static provide="agentLoop";static inject=["sessions","systemPrompt","tools","llm","approval","compaction","subagents"];controllers=new Map;queue=bA((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 c=a??mm(r.messages);c&&this.queue.push(i,c)}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 c=a.messages[r].id;return this.ctx.sessions.updateSession(i,{messages:a.messages.slice(0,r+1)}),this.runAgent(i,c),!0}async runTurn(i,a){const r=this.ctx.sessions.current(i);if(!r||!this.ctx.sessions.turnHistory(r.messages,a))return;const c=new AbortController;this.controllers.set(i,c),Oa.getState().setStreaming(i,!0);const u=ze.getState(),d=og(u.provider),p=r.mode??u.mode,h=Date.now();let g=0,b;try{e:for(let x=0;g=x+1,!c.signal.aborted;x+=1){let v=this.ctx.sessions.current(i);if(!v)break;if(x===0&&mm(v.messages)===a&&await this.ctx.compaction.checkAutoCompact(i)){const $=this.ctx.sessions.current(i);if(!$)break;const Z=mm($.messages);if(!Z)break;a=Z,v=$}const y=this.ctx.sessions.turnHistory(v.messages,a);if(!y)break;const k=Li("msg"),S={id:k,role:"assistant",content:"",reasoning:"",toolCalls:[],round:x,model:Qn(u),provider:u.provider,createdAt:Date.now()};this.ctx.sessions.addMessage(i,S);let j="",E="",A,T={};const R=()=>{A===void 0&&(A=window.setTimeout(()=>{A=void 0,this.ctx.sessions.updateMessage(i,k,{content:j,reasoning:E})},40))},P={sessionId:i,round:x,history:y,settings:u,mode:p,signal:c.signal,assistantId:k};await this.ctx.events.waterfall("agent/pre-step",P,()=>{});let z,C=0;for(;;)try{z=await this.ctx.llm.stream({settings:u,model:pl(u.provider,Qn(u)),history:y,system:this.ctx.systemPrompt.assemble(u,p,i),mode:p,signal:c.signal,handlers:{onText:O=>{j+=O,R()},onReasoning:O=>{E+=O,R()},onToolCalls:()=>{},onUsage:O=>{T=O}}});break}catch(O){const $=w0(O)||c.signal.aborted,Z=O instanceof Error?O.message:"",fe=mO(Z);if(!$&&fe.retry&&C<v0&&!j&&!E){C+=1;const te=gO(C,Z);window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:`${d} had a temporary error. Retrying in ${Math.round(te/1e3)}s (${C}/${v0})…`,tone:"info"}})),await xO(te,c.signal);continue}A!==void 0&&window.clearTimeout(A),b=$?void 0:jA(O,d),this.ctx.sessions.updateMessage(i,k,{content:j,reasoning:E,stopped:$,durationMs:Date.now()-h,error:b}),await this.ctx.events.waterfall("agent/request-error",O,P,()=>{});break e}if(A!==void 0&&window.clearTimeout(A),this.ctx.sessions.updateMessage(i,k,{content:z.content,reasoning:z.reasoning,thinkingBlocks:z.thinkingBlocks,toolCalls:z.toolCalls,usage:T.input||T.output?T:z.usage,cost:uO(T.input||T.output?T:z.usage,pl(u.provider,Qn(u))),durationMs:Date.now()-h,stopped:c.signal.aborted||void 0}),this.ctx.sessions.updateSession(i,{provider:u.provider,model:Qn(u),mode:p}),c.signal.aborted)break;if(z.toolCalls.length===0){const O={sessionId:i,round:x,assistant:S,toolResults:[],stopped:c.signal.aborted};this.ctx.events.emit("agent/step-finish",O);break}const L=[];for(const O of z.toolCalls){if(c.signal.aborted)break;const $=Wu(u,O.name);if(!$?.enabled){const M={id:Li("tool"),role:"tool",call:O,status:"error",result:"This tool is disabled in Settings → Tools.",round:x,createdAt:Date.now()};this.ctx.sessions.addMessage(i,M),L.push(M);continue}const Z=Li("tool"),fe=$.approval==="ask",re={id:Z,role:"tool",call:O,status:fe?"awaiting":"running",round:x,createdAt:Date.now()};this.ctx.sessions.addMessage(i,re);const te=Date.now();try{const M=O.name==="subagent"?{output:bO(await this.ctx.subagents.run(typeof O.args.task=="string"?O.args.task:"",typeof O.args.context=="string"?O.args.context:"",c.signal,i)),isError:!1}:await this.ctx.tools.execute(O.name,O.args,u,p,c.signal,O.id,a),ae={...re,status:M.isError?"error":"done",result:M.output,durationMs:Date.now()-te,diff:M.diff};this.ctx.sessions.updateMessage(i,Z,ae),L.push(ae)}catch(M){const ae=w0(M),ne={...re,status:"error",result:ae?"Stopped.":M instanceof Error?M.message:"The tool failed.",durationMs:Date.now()-te};if(this.ctx.sessions.updateMessage(i,Z,ne),L.push(ne),ae)break}}const G={sessionId:i,round:x,assistant:S,toolResults:L,stopped:c.signal.aborted};if(this.ctx.events.emit("agent/step-finish",G),c.signal.aborted){const O=this.ctx.sessions.current(i);if(O){const $=new Set(O.messages.filter(Z=>Z.role==="tool").map(Z=>Z.call.id));for(const Z of z.toolCalls)$.has(Z.id)||this.ctx.sessions.addMessage(i,{id:Li("tool"),role:"tool",call:Z,status:"error",result:"Stopped before the tool ran.",round:x,createdAt:Date.now()})}break}}}finally{this.controllers.delete(i),Oa.getState().setStreaming(i,!1);const x={sessionId:i,userMessageId:a,rounds:g,durationMs:Date.now()-h,stopped:c.signal.aborted,error:b};this.ctx.events.emit("agent/turn-finish",x)}}}const vO="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 k0(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a}function wO(e){const i=e.replace(/<think>[\s\S]*?<\/think>/gi,"").split(`
|
|
158
|
+
`).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 kO(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"?k0(i.content,700):"",assistant:a&&a.role==="assistant"?k0(a.content,700):""}}class NO extends ki{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||!ze.getState().aiSessionTitles)return;const c=this.ctx.sessions.current(a.sessionId);!c||(c.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:c,assistant:u}=kO(r.messages);if(!c)return null;const d=ze.getState(),p=pl(d.provider,Qn(d)),h=Object.fromEntries(Object.entries(d.tools).map(([v,y])=>[v,{...y,enabled:!1}])),g=Do(p),b={...d,tools:h,webSearchEnabled:!1,temperature:.3,maxTokens:512,effort:g[0]??d.effort},x=[{id:Li("title"),role:"user",createdAt:Date.now(),content:`Name this conversation.
|
|
159
|
+
|
|
160
|
+
User: ${c}
|
|
161
|
+
|
|
162
|
+
Assistant: ${u||"(no answer yet)"}`}];this.inflight.add(i),Oa.getState().setTitling(i,!0);try{const v=new AbortController,y=window.setTimeout(()=>v.abort(),25e3);let k="";const S=await this.ctx.llm.stream({settings:b,model:p,history:x,system:vO,mode:"plan",signal:v.signal,handlers:{onText:A=>{k+=A},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}}}).finally(()=>window.clearTimeout(y)),j=wO(S.content||k),E=this.ctx.sessions.current(i);return!j||!E||!a&&(E.titleSource??"auto")!=="auto"?null:(this.ctx.sessions.updateSession(i,{title:j,titleSource:"ai"}),j)}catch{return null}finally{this.inflight.delete(i),Oa.getState().setTitling(i,!1)}}}const EO=28e3;function SO(e,i=EO){return e.length<=i?e:`${e.slice(0,i)}
|
|
163
|
+
… truncated (${e.length-i} more characters)`}function Xr(e){return e&&typeof e=="object"?e:{}}function gr(e){return typeof e=="string"?e:""}function zi(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Gr(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function _O(e,i){const a=e[i];return typeof a=="string"?a:void 0}function ym(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 TO(e){const i=Array.isArray(e.entries)?e.entries:[];if(i.length===0)return"This folder is empty.";const a=i.map(c=>{const u=Xr(c),d=gr(u.path);return u.type==="dir"?`${d}/`:u.type==="link"?`${d} -> link`:`${d}${zi(u.size)!==void 0?` (${zi(u.size)} B)`:""}`}),r=e.truncated===!0?`
|
|
164
|
+
… listing truncated. Narrow the path or reduce depth.`:"";return`${gr(e.root)?`Root: ${gr(e.root)}
|
|
165
|
+
`:""}${a.join(`
|
|
166
|
+
`)}${r}`}function vm(e){const i=Xr(e.diff),a=zi(i.added),r=zi(i.removed);if(!(a===void 0||r===void 0))return{added:a,removed:r,line:zi(i.line),column:zi(i.column)}}function wm(e){if(!e)return"";const i=e.line?` at L${e.line}${e.column?`:${e.column}`:""}`:"";return` · +${e.added} −${e.removed}${i}`}async function km(){await Be.getState().refresh().catch(()=>{})}const CO="tool-fs",jO=["tools"];function AO(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 c=Gr(a,"path"),u=Xr((await ln("read_file",{path:c},r.mode,r.signal)).result);if(u.binary===!0)return{output:`${c} is binary (${zi(u.size)??0} bytes).`,isError:!1};const d=Math.max(1,Math.round(ym(a,"offset",1))),p=Math.min(Math.max(1,Math.round(ym(a,"limit",400))),2e3),h=gr(u.content).split(`
|
|
167
|
+
`),g=h.slice(d-1,d-1+p),b=h.length-(d-1+p),x=`${gr(u.path)||c} · ${h.length} lines${u.truncated===!0?" · file clipped by daemon":""}`,v=b>0?`
|
|
168
|
+
… ${b} more lines. Read again with offset ${d+p}.`:"";return{output:SO(`${x}
|
|
169
|
+
────
|
|
170
|
+
${g.join(`
|
|
171
|
+
`)}${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 c=Xr((await ln("list_files",{path:_O(a,"path")??"",depth:Math.min(Math.max(1,ym(a,"depth",3)),8)},r.mode,r.signal)).result);return{output:TO(c),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 c=Gr(a,"path"),u=Gr(a,"content"),d=Xr((await ln("write_file",{path:c,content:u},r.mode,r.signal,r.turnId)).result);await km();const p=d.created===!0?"Created":"Updated",h=vm(d);return{output:`${p} ${gr(d.path)||c} · ${u.split(`
|
|
172
|
+
`).length} lines, ${zi(d.size)??u.length} bytes${wm(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 c=Gr(a,"path"),u=Gr(a,"content"),d=Xr((await ln("rewrite_file",{path:c,content:u},r.mode,r.signal,r.turnId)).result);await km();const p=vm(d);return{output:`Rewrote ${gr(d.path)||c} · ${u.split(`
|
|
173
|
+
`).length} lines, ${zi(d.size)??u.length} bytes${wm(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 c=Gr(a,"path"),u=Gr(a,"oldText"),d=typeof a.newText=="string"?a.newText:"",p=Xr((await ln("edit_file",{path:c,oldText:u,newText:d,replaceAll:a.replaceAll===!0},r.mode,r.signal,r.turnId)).result);await km();const h=vm(p);return{output:`Edited ${gr(p.path)||c} · ${zi(p.replacements)??1} replacement${zi(p.replacements)===1?"":"s"}${wm(h)}.`,isError:!1,diff:h}}})];return()=>i.forEach(a=>a())}const OO=Object.freeze(Object.defineProperty({__proto__:null,apply:AO,inject:jO,name:CO},Symbol.toStringTag,{value:"Module"})),MO=28e3;function RO(e,i=MO){return e.length<=i?e:`${e.slice(0,i)}
|
|
174
|
+
… truncated (${e.length-i} more characters)`}function DO(e){return e&&typeof e=="object"?e:{}}function Nm(e){return typeof e=="string"?e:""}function gk(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function zO(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function LO(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 IO(e,i){const a=[`$ ${i}`,Nm(e.stdout)];Nm(e.stderr)&&a.push(`stderr:
|
|
175
|
+
${Nm(e.stderr)}`);const r=gk(e.code);return r!==void 0&&r!==0&&a.push(`exit code: ${r}`),e.timedOut===!0&&a.push("The command timed out."),a.filter(c=>c!=="").join(`
|
|
176
|
+
`)}async function UO(){await Be.getState().refresh({treeOnly:!0}).catch(()=>{})}const BO="tool-shell",$O=["tools"];function PO(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=zO(i,"command"),c=DO((await ln("shell",{command:r,timeoutMs:LO(i,"timeoutMs",12e4)},a.mode,a.signal)).result);return UO(),{output:RO(IO(c,r)),isError:(gk(c.code)??0)!==0||c.timedOut===!0}}})}const HO=Object.freeze(Object.defineProperty({__proto__:null,apply:PO,inject:$O,name:BO},Symbol.toStringTag,{value:"Module"})),FO=28e3;function qO(e,i=FO){return e.length<=i?e:`${e.slice(0,i)}
|
|
177
|
+
… truncated (${e.length-i} more characters)`}function xk(e){return e&&typeof e=="object"?e:{}}function N0(e){return typeof e=="string"?e:""}function GO(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function YO(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function VO(e,i){const a=e[i];return typeof a=="string"?a:void 0}function KO(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 XO(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=xk(u);return`${N0(d.file)}:${GO(d.line)??0}: ${N0(d.text)}`}),c=e.truncated===!0?`
|
|
178
|
+
… more matches exist. Narrow the pattern or path.`:"";return r.join(`
|
|
179
|
+
`)+c}const ZO="tool-grep",QO=["tools"];function WO(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=YO(i,"pattern"),c=xk((await ln("grep",{pattern:r,path:VO(i,"path")??"",ignoreCase:i.ignoreCase===!0},a.mode,a.signal)).result),u=Math.min(Math.max(1,Math.round(KO(i,"maxResults",80))),200),d=Array.isArray(c.matches)?c.matches.slice(0,u):[],p={...c,matches:d,truncated:c.truncated===!0||Array.isArray(c.matches)&&c.matches.length>u};return{output:qO(XO(p,r)),isError:!1}}})}const JO=Object.freeze(Object.defineProperty({__proto__:null,apply:WO,inject:QO,name:ZO},Symbol.toStringTag,{value:"Module"})),eM=28e3;function tM(e,i=eM){return e.length<=i?e:`${e.slice(0,i)}
|
|
180
|
+
… truncated (${e.length-i} more characters)`}function nM(e){return e&&typeof e=="object"?e:{}}function pr(e){return typeof e=="string"?e:""}function bk(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function iM(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function aM(e){const i=[];pr(e.current)&&i.push(`Current branch: ${pr(e.current)}`),pr(e.branches)&&i.push(pr(e.branches)),pr(e.stdout)&&i.push(pr(e.stdout)),pr(e.stderr)&&i.push(`stderr:
|
|
181
|
+
${pr(e.stderr)}`);const a=bk(e.code);return a!==void 0&&a!==0&&i.push(`exit code: ${a}`),i.filter(Boolean).join(`
|
|
182
|
+
`)||"Git completed with no output."}const rM="tool-git",sM=["tools"];function lM(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=iM(i,"action"),c={...i};delete c.action;const u=nM((await ln("git",{action:r,...c},a.mode,a.signal)).result);return(r==="add"||r==="commit"||r==="init"||r==="checkout")&&await Be.getState().loadGit().catch(()=>{}),{output:tM(aM(u)),isError:(bk(u.code)??0)!==0}}})}const oM=Object.freeze(Object.defineProperty({__proto__:null,apply:lM,inject:sM,name:rM},Symbol.toStringTag,{value:"Module"})),cM=28e3;function E0(e,i=cM){return e.length<=i?e:`${e.slice(0,i)}
|
|
183
|
+
… truncated (${e.length-i} more characters)`}function Em(e){return e&&typeof e=="object"?e:{}}function mr(e){return typeof e=="string"?e:""}function S0(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}const uM="tool-web",dM=["tools"];function fM(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 c=S0(a,"query"),u=Em((await ln("web_search",{query:c,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 b=Em(h);return`${g+1}. ${mr(b.title)}
|
|
184
|
+
${mr(b.url)}${mr(b.snippet)?`
|
|
185
|
+
${mr(b.snippet)}`:""}`}).join(`
|
|
186
|
+
|
|
187
|
+
`);return{output:E0(`Search: ${c}
|
|
188
|
+
Provider: ${mr(u.provider)||"web"}
|
|
189
|
+
|
|
190
|
+
${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 c=S0(a,"url"),u=Em((await ln("read_url",{url:c},r.mode,r.signal)).result),d=mr(u.title);return{output:E0(`Source: ${mr(u.url)||c}${d?`
|
|
191
|
+
Title: ${d}`:""}
|
|
192
|
+
|
|
193
|
+
${mr(u.content)}${u.truncated===!0?`
|
|
194
|
+
|
|
195
|
+
… page truncated.`:""}`),isError:!1}}})];return()=>i.forEach(a=>a())}const pM=Object.freeze(Object.defineProperty({__proto__:null,apply:fM,inject:dM,name:uM},Symbol.toStringTag,{value:"Module"})),mM=28e3;function hM(e,i=mM){return e.length<=i?e:`${e.slice(0,i)}
|
|
196
|
+
… truncated (${e.length-i} more characters)`}const gM="tool-subagent",xM=["tools","subagents"];function bM(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:"",c=typeof i.context=="string"?i.context:"",u=await e.subagents.run(r,c,a.signal);return{output:hM(u),isError:!1}}})}const yM=Object.freeze(Object.defineProperty({__proto__:null,apply:bM,inject:xM,name:gM},Symbol.toStringTag,{value:"Module"})),_0=6e4,vM="tool-skill",wM=["tools"];function kM(e){return e.tools.register({name:"skill",description:'Load an installed skill by name. With only `name` it returns the skill\'s SKILL.md instructions and the list of bundled files. Pass `file` (relative path, e.g. "references/api.md") to read one bundled file. Skill scripts can be run with the shell tool from the returned directory.',parameters:{type:"object",properties:{name:{type:"string",description:"Skill name from the Skills list in the system prompt."},file:{type:"string",description:"Optional bundled file to read, relative to the skill folder."}},required:["name"],additionalProperties:!1},allowedInMode:()=>!0,async execute(i){const a=typeof i.name=="string"?i.name.trim():"";if(!a)return{output:'Missing string argument "name".',isError:!0};try{const r=await Bj(a,typeof i.file=="string"?i.file:void 0),c=[`Skill: ${r.name} · ${r.file}`,`Directory: ${r.directory}`,"────",r.content];r.files&&r.files.length>0&&c.push("────",`Bundled files (read with this tool's "file" argument):
|
|
197
|
+
${r.files.map(d=>`- ${d}`).join(`
|
|
198
|
+
`)}`);const u=c.join(`
|
|
199
|
+
`);return{output:u.length>_0?`${u.slice(0,_0)}
|
|
200
|
+
… truncated`:u,isError:!1}}catch(r){return{output:r instanceof Error?r.message:"Could not load the skill.",isError:!0}}}})}const NM=Object.freeze(Object.defineProperty({__proto__:null,apply:kM,inject:wM,name:vM},Symbol.toStringTag,{value:"Module"}));function EM(){const e=new hg;return e.plugin(yA),e.plugin(kA),e.plugin(_A),e.plugin(TA),e.plugin(GA),e.plugin(WA),e.plugin(iO),e.plugin(cO),e.plugin(yO),e.plugin(NO),e.plugin(OO),e.plugin(HO),e.plugin(JO),e.plugin(oM),e.plugin(pM),e.plugin(yM),e.plugin(NM),e}const Vt=EM();function Ju(e){Vt.agentLoop?Vt.agentLoop.stopRun(e):queueMicrotask(()=>Vt.agentLoop?.stopRun(e))}function SM(){Vt.agentLoop?Vt.agentLoop.stopAllRuns():queueMicrotask(()=>Vt.agentLoop?.stopAllRuns())}function yk(e,i){Vt.agentLoop?Vt.agentLoop.runAgent(e,i):queueMicrotask(()=>Vt.agentLoop?.runAgent(e,i))}function Sm(e){return Vt.agentLoop?Vt.agentLoop.regenerateLastTurn(e):!1}function vk(e){var i,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var c=e.length;for(i=0;i<c;i++)e[i]&&(a=vk(e[i]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function _M(){for(var e,i,a=0,r="",c=arguments.length;a<c;a++)(e=arguments[a])&&(i=vk(e))&&(r&&(r+=" "),r+=i);return r}function ee(...e){return _M(e)}function hl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function ed(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 TM(e){const i=new Date,a=new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),r=a-864e5,c=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>=c?g=2:h.updatedAt>=u&&(g=3),d[g].items.push(h)}return d.filter(h=>h.items.length>0)}function CM(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 jM(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 Eh(e,i,a="text/plain"){const r=new Blob([i],{type:a}),c=URL.createObjectURL(r),u=document.createElement("a");u.href=c,u.download=e,u.click(),URL.revokeObjectURL(c)}function gl({size:e=28,className:i,spin:a=!1}){return l.jsx("span",{className:ee("inline-flex shrink-0 items-center justify-center text-accent",i),style:{width:e,height:e},"aria-hidden":"true",children:l.jsxs("svg",{viewBox:"0 0 32 32",width:e,height:e,fill:"none",className:ee(a&&"animate-spin-slow"),children:[l.jsx("path",{d:"M25.66 13.41A10 10 0 1 1 18.59 6.34",stroke:"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),l.jsx("circle",{cx:"23.07",cy:"8.93",r:"2.5",fill:"currentColor"}),l.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M12.6 12.8L17 16l-4.4 3.2"}),l.jsx("path",{d:"M18.8 19.6h3",opacity:"0.6"})]})]})})}function AM({compact:e=!1}){return l.jsxs("div",{className:"group/logo flex items-center gap-2",children:[l.jsx(gl,{size:e?20:22,className:"transition-transform duration-500 ease-out group-hover/logo:rotate-90"}),!e&&l.jsxs("span",{className:"text-[15px] font-semibold leading-none tracking-[-0.025em] text-ink",children:["Open",l.jsx("span",{className:"text-accent",children:"Sol"})]})]})}function OM(){return l.jsxs("p",{className:"text-[11px] tracking-[0.01em] text-faint",children:["OpenSol ",l.jsx("span",{className:"px-1 text-line",children:"/"})," by OpenSoftX"]})}function MM(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function RM(){const e=Xe(H=>H.sessions),i=Xe(H=>H.activeId),a=Xe(H=>H.setActive),r=Xe(H=>H.newChat),c=Xe(H=>H.renameSession),u=Xe(H=>H.deleteSession),d=ze(),p=Be(H=>H.info),h=Be(H=>H.addWorkspace),g=Be(H=>H.removeWorkspace),b=me(H=>H.sidebarCollapsed),x=me(H=>H.toggleSidebar),v=me(H=>H.mobileSidebarOpen),y=me(H=>H.setMobileSidebarOpen),k=me(H=>H.openSettings),S=me(H=>H.setWorkspaceOpen),j=me(H=>H.setDeployOpen),E=me(H=>H.setMcpOpen),A=me(H=>H.askConfirm),T=me(H=>H.notify),R=me(H=>H.focusComposer),P=Oa(H=>H.streaming),z=Oa(H=>H.titling),[C,L]=U.useState(""),[G,O]=U.useState(null),[$,Z]=U.useState(null),[fe,re]=U.useState(""),[te,M]=U.useState(""),ae=U.useMemo(()=>{const H=C.trim().toLowerCase();return H?e.filter(K=>K.title.toLowerCase().includes(H)):e},[e,C]),ne=U.useMemo(()=>TM(ae),[ae]),xe=U.useMemo(()=>[...p.workspaces].sort((H,K)=>K.lastOpened-H.lastOpened),[p.workspaces]),_=dl(d),ve=(d.daemon?.home??"").split(/[\\/]/).filter(Boolean).pop()||p.name||"Local",ce=()=>{r(),y(!1),O(null),R()},D=H=>{a(H),y(!1),O(null)},B=async H=>{if(H===p.root){S(!0),y(!1);return}M(H);try{await h(H),y(!1)}catch(K){T(K instanceof Error?K.message:"Could not open that folder.","error")}finally{M("")}},se=async(H,K)=>{if(await A({title:"Remove this workspace?",body:`“${K}” 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(H),T(`Removed ${K} from your workspaces.`,"success")}catch(je){T(je instanceof Error?je.message:"Could not remove that workspace.","error")}},pe=async H=>{O(null),await Vt.titles?.generate(H,{force:!0})||T("The model could not suggest a title right now.","error")},Ee=(H,K)=>{Z(H),re(K),O(null)},Le=()=>{$&&(fe.trim()&&c($,fe),Z(null),re(""))},Pe=async(H,K)=>{O(null),await A({title:"Delete this conversation?",body:`“${K}” and its messages will be removed from this computer. This cannot be undone.`,confirmLabel:"Delete conversation",tone:"danger"})&&(Ju(H),u(H))},Fe=H=>{const K=e.find(je=>je.id===H);if(!K)return;O(null);const be=K.messages.flatMap(je=>je.role==="user"?[`## You
|
|
201
|
+
|
|
202
|
+
${je.content}`]:je.role==="assistant"&&je.content.trim()?[`## OpenSol
|
|
203
|
+
|
|
204
|
+
${je.content.trim()}`]:[]).join(`
|
|
205
|
+
|
|
206
|
+
`);Eh(`opensol-${K.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,40)||"conversation"}.md`,`# ${K.title}
|
|
207
|
+
|
|
208
|
+
${be}
|
|
209
|
+
`,"text/markdown"),T("Conversation exported as Markdown.","success")},Se=H=>{const K=e.find(be=>be.id===H);K&&(O(null),Eh(`opensol-${K.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,40)||"conversation"}.json`,JSON.stringify({app:"OpenSol",exportedAt:new Date().toISOString(),session:K},null,2),"application/json"),T("Conversation exported.","success"))};return l.jsxs("aside",{className:ee("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",b&&"lg:hidden"),children:[l.jsxs("div",{className:"flex h-12 items-center gap-1 pl-3 pr-2",children:[l.jsx(AM,{}),l.jsx("button",{type:"button",className:"icon-button ml-auto hidden lg:inline-flex",onClick:x,title:"Collapse sidebar (Ctrl B)","aria-label":"Collapse sidebar",children:l.jsx(ZT,{size:16,strokeWidth:1.7})}),l.jsx("button",{type:"button",className:"icon-button ml-auto lg:hidden",onClick:()=>y(!1),"aria-label":"Close menu",children:l.jsx($i,{size:17})})]}),l.jsxs("nav",{className:"space-y-0.5 px-2 pt-1",children:[l.jsxs("button",{type:"button",onClick:ce,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:[l.jsx(Wr,{size:15,strokeWidth:2,className:"text-accent transition-transform duration-300 group-hover/new:rotate-90"}),"New chat"]}),l.jsxs("button",{type:"button",onClick:()=>{y(!1),k("skills")},className:"nav-item",children:[l.jsx(oi,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Skills"]}),l.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:"Plugins are temporarily disabled for maintenance",className:"nav-item cursor-not-allowed opacity-50",children:[l.jsx(gd,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Plugins",l.jsx("span",{className:"ml-auto rounded-full bg-warning/10 px-1.5 py-px text-[9px] font-medium text-warning",children:"Maintenance"})]}),l.jsxs("button",{type:"button",onClick:()=>{y(!1),E(!0)},className:"nav-item",children:[l.jsx(ag,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"MCP"]}),l.jsxs("button",{type:"button",onClick:()=>{y(!1),j(!0)},className:"nav-item",children:[l.jsx(Jr,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Deploy"]}),l.jsxs("div",{className:"relative",children:[l.jsx(rs,{size:15,strokeWidth:1.7,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{value:C,onChange:H=>L(H.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"})]})]}),l.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2 pb-2 pt-5",children:[l.jsxs("div",{className:"mb-5",children:[l.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-1.5",children:[l.jsx("p",{className:"eyebrow",children:"Workspaces"}),l.jsx("button",{type:"button",onClick:()=>{y(!1),S(!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:l.jsx(Wr,{size:13})})]}),xe.length===0?l.jsxs("button",{type:"button",onClick:()=>{y(!1),S(!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:[l.jsx(Fu,{size:15,strokeWidth:1.6,className:"text-faint"}),"Open a project folder"]}):l.jsx("div",{className:"space-y-0.5",children:xe.map(H=>{const K=H.path===p.root;return l.jsxs("div",{className:"group/ws relative",children:[l.jsxs("button",{type:"button",onClick:()=>{B(H.path)},title:H.path,className:ee("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]",K?"bg-raised text-ink":"text-muted hover:bg-raised/80 hover:text-ink"),children:[l.jsx(Fu,{size:15,strokeWidth:1.6,className:ee("shrink-0 transition-transform duration-200 group-hover/ws:-rotate-6 group-hover/ws:scale-110",K?"text-accent":"text-faint")}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:H.name}),te===H.path?l.jsx(eg,{size:11,className:"shrink-0 animate-spin text-faint"}):K?l.jsx(Mn,{size:11,className:"shrink-0 text-accent"}):l.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-faint transition-opacity group-hover/ws:opacity-0",children:ed(H.lastOpened)})]}),l.jsx("button",{type:"button",onClick:()=>{se(H.path,H.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 ${H.name}`,children:l.jsx(sa,{size:12})})]},H.path)})})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-1.5",children:[l.jsx("p",{className:"eyebrow",children:"Recents"}),l.jsx("span",{className:"text-[11px] tabular-nums text-faint",children:ae.length})]}),ne.length===0&&l.jsxs("div",{className:"px-2 py-7 text-center",children:[l.jsx("p",{className:"text-[13px] font-medium text-muted",children:C?"No conversations match":"No conversations yet"}),l.jsx("p",{className:"mt-1 text-[11.5px] leading-relaxed text-faint",children:C?"Try a shorter search.":"Start with a task, a question or a file."})]}),ne.map((H,K)=>l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-medium text-faint/80",children:H.label}),l.jsx("div",{className:"space-y-0.5",children:H.items.map((be,je)=>l.jsx("div",{className:"group/item relative animate-slideleft",style:{animationDelay:`${Math.min(K*40+je*18,320)}ms`},children:$===be.id?l.jsx("input",{value:fe,onChange:Oe=>re(Oe.target.value),onBlur:Le,onKeyDown:Oe=>{Oe.key==="Enter"&&Le(),Oe.key==="Escape"&&(Z(null),re(""))},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"}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>D(be.id),onDoubleClick:()=>Ee(be.id,be.title),title:`${be.title} · ${ed(be.updatedAt)}`,className:ee("sidebar-item pr-9",i===be.id&&"sidebar-item-active"),children:[l.jsx("span",{className:ee("min-w-0 flex-1 truncate",z[be.id]&&"text-shimmer"),children:be.title}),P[be.id]&&l.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:[l.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent"}),"running"]})]}),l.jsx("button",{type:"button",onClick:Oe=>{if(Oe.stopPropagation(),G?.id===be.id){O(null);return}const ot=Oe.currentTarget.getBoundingClientRect(),Ve=176,jt=166,fn=Math.max(8,Math.min(ot.right-Ve,window.innerWidth-Ve-8)),$t=ot.bottom+jt+8>window.innerHeight?Math.max(8,ot.top-jt-4):ot.bottom+4;O({id:be.id,x:fn,y:$t})},className:ee("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",G?.id===be.id?"flex bg-panel text-ink opacity-100":"opacity-0 group-hover/item:opacity-100 focus:opacity-100"),"aria-label":`Actions for ${be.title}`,title:"Conversation actions",children:l.jsx(X2,{size:14})})]})},be.id))})]},H.label))]})]}),l.jsx("div",{className:"p-2",children:l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg px-1.5 py-1.5 transition-colors hover:bg-raised/80",children:[l.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:ve.charAt(0).toUpperCase()}),l.jsxs("button",{type:"button",onClick:()=>{y(!1),k("models")},className:"min-w-0 flex-1 text-left",children:[l.jsx("p",{className:"truncate text-[13px] font-medium leading-tight text-ink",children:ve}),l.jsx("p",{className:"mt-0.5 truncate text-[11px] leading-tight text-faint",children:_?`${og(d.provider)}${d.provider==="ollama"?" · local":" · your key"}`:"Add a provider key"})]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{y(!1),k("appearance")},title:"Preferences","aria-label":"Preferences",children:l.jsx(mw,{size:16,strokeWidth:1.7})})]})}),G&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Close conversation menu",className:"fixed inset-0 z-[60] cursor-default bg-transparent",onClick:()=>O(null)}),l.jsx("div",{className:"surface-lift fixed z-[70] w-[184px] overflow-hidden rounded-xl border border-line p-1 shadow-float",style:{left:G.x,top:G.y},children:(()=>{const H=e.find(K=>K.id===G.id);return H?l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>Ee(H.id,H.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:[l.jsx($o,{size:12})," Rename"]}),l.jsxs("button",{type:"button",onClick:()=>{pe(H.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:[l.jsx(oi,{size:12})," Name with AI"]}),l.jsxs("button",{type:"button",onClick:()=>Se(H.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:[l.jsx(Kh,{size:12})," Export JSON"]}),l.jsxs("button",{type:"button",onClick:()=>Fe(H.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:[l.jsx(as,{size:12})," Export Markdown"]}),l.jsx("div",{className:"my-1 border-t border-line"}),l.jsxs("button",{type:"button",onClick:()=>{Pe(H.id,H.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:[l.jsx(sa,{size:12})," Delete"]}),l.jsxs("p",{className:"px-2 pb-1 pt-1.5 text-[9px] text-faint",children:["Updated ",MM(H.updatedAt)]})]}):null})()})]})]})}const DM={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 zM(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 wk=864e5,T0=26;function bg(e){const i=new Date(e);return i.setHours(0,0,0,0),i.getTime()}function kk(e){const i=new Date(e);return`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`}function LM(e,i){return e==="all"?0:bg(i)-(e==="7d"?6:29)*wk}function C0(e,i){return typeof e.createdAt=="number"?e.createdAt:i}function IM(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 UM(e){return e===0?"12 AM":e===12?"12 PM":e<12?`${e} AM`:`${e-12} PM`}function BM(e,i,a=Date.now()){const r=LM(i,a),c=e.filter(E=>E.updatedAt>=r),u=[];for(const E of c)for(const A of E.messages)C0(A,E.updatedAt)>=r&&u.push({message:A,session:E});const d=new Array(24).fill(0),p=new Map,h=new Map;let g=0,b=0;for(const{message:E,session:A}of u){const T=C0(E,A.updatedAt),R=kk(T),P=p.get(R);if(P?P.count+=1:p.set(R,{key:R,count:1,date:bg(T)}),d[new Date(T).getHours()]+=1,E.role!=="assistant")continue;const z=IM(E);g+=z;const C=typeof E.cost=="number"?E.cost:0;b+=C;const L=typeof E.model=="string"?E.model.trim():"";if(!L)continue;const G=h.get(L)??{model:L,messages:0,tokens:0,cost:0};G.messages+=1,G.tokens+=z,G.cost+=C,h.set(L,G)}const x=[...h.values()].sort((E,A)=>A.tokens-E.tokens||A.messages-E.messages||E.model.localeCompare(A.model)),v=x[0],y=u.filter(E=>E.message.role==="assistant").length;let k=0;for(let E=1;E<24;E+=1)d[E]>d[k]&&(k=E);const S=$M(p,a),j=S.reduce((E,A)=>Math.max(E,A.count),0);return{sessions:c.length,messages:u.length,tokens:g,cost:b,activeDays:p.size,peakHour:u.length?UM(k):"—",favoriteModel:v?.model??"—",favoriteShare:v&&y?Math.round(v.messages/y*100):0,models:x,heatmap:S,busiestDay:j}}function $M(e,i){const a=new Date(bg(i)),r=new Date(a);r.setDate(r.getDate()-r.getDay()-(T0-1)*7);const c=[];for(let u=0;u<T0*7;u+=1){const d=r.getTime()+u*wk,p=kk(d);c.push(e.get(p)??{key:p,count:0,date:d})}return c}function jo(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 _m(e){if(!e||e==="—")return e;const i=e.split("/");return i[i.length-1]||e}function PM(e){return!!(e.content.trim()||e.reasoning.trim()||e.error||e.stopped)}function HM(e){const i=[];let a=null,r=[];const c=()=>{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"){c(),a={id:u.id,user:u,segments:[]},i.push(a);continue}!PM(u)&&u.toolCalls.length>0||(a||(a={id:u.id,segments:[]},i.push(a)),c(),a.segments.push({kind:"assistant",message:u}))}return c(),i}function j0(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function FM({messages:e,model:i,sessionId:a}){const r=U.useMemo(()=>mk(e,i),[e,i]),c=U.useMemo(()=>dO(e),[e]),u=a?dk(a):!1;if(e.length===0)return null;const{pct:d,used:p,limit:h}=r,g=d>=hk*100,b=d>=70&&!g;return l.jsx("div",{className:ee("hidden items-baseline gap-1.5 text-[11.5px] tabular-nums text-muted sm:flex",b&&"text-warning",g&&"text-danger"),title:`Context window: ~${p.toLocaleString()} of ${h.toLocaleString()} tokens used (${d}%)`,children:u?l.jsx("span",{className:"text-shimmer",children:"Compacting…"}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-ink/80",children:j0(p)}),l.jsxs("span",{className:"text-faint",children:["/ ",j0(h)," tokens"]}),l.jsx("span",{className:"text-faint",children:"·"}),l.jsxs("span",{children:[d,"%"]}),c>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-faint",children:"·"}),l.jsx("span",{className:"text-ink/80",title:"Credits spent in this session (provider-reported, or tokens × model price)",children:Nh(c)})]})]})})}var xl=iw();function Nk(e,i,a=!0,r){const c=U.useRef(i);c.current=i,U.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)||c.current())},d=p=>{p.key==="Escape"&&c.current()};return document.addEventListener("pointerdown",u,!0),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("keydown",d)}},[a,e,r])}function jd({open:e,onClose:i,children:a,className:r,labelledBy:c,wide:u=!1}){const d=U.useRef(null),p=U.useRef(null),h=U.useRef(i);return h.current=i,U.useEffect(()=>{if(!e)return;p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const g=d.current,b=()=>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),x=window.setTimeout(()=>{(g?.querySelector("[data-autofocus]")??b()[0]??g)?.focus()},30),v=k=>{if(k.key==="Escape"){k.preventDefault(),h.current();return}if(k.key!=="Tab")return;const S=b();if(S.length===0)return;const j=S[0],E=S[S.length-1];k.shiftKey&&document.activeElement===j?(k.preventDefault(),E.focus()):!k.shiftKey&&document.activeElement===E&&(k.preventDefault(),j.focus())};document.addEventListener("keydown",v);const y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.clearTimeout(x),document.removeEventListener("keydown",v),document.body.style.overflow=y,p.current?.focus()}},[e]),e?xl.createPortal(l.jsxs("div",{className:"fixed inset-0 z-[80] flex items-end justify-center p-0 sm:items-center sm:p-6",children:[l.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"}),l.jsx("div",{ref:d,role:"dialog","aria-modal":"true","aria-labelledby":c,tabIndex:-1,className:ee("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 Ht({size:e=14,className:i}){return l.jsx(eg,{size:e,className:ee("animate-spin text-current",i),"aria-hidden":"true"})}function Pi({checked:e,onChange:i,label:a,disabled:r=!1}){return l.jsx("button",{type:"button",role:"switch","aria-label":a,"aria-checked":e,disabled:r,onClick:()=>i(!e),className:ee("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:l.jsx("span",{className:ee("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 Ad({options:e,value:i,onChange:a,disabled:r,className:c,size:u="sm"}){return l.jsx("div",{className:ee("inline-flex items-center rounded-lg bg-raised p-0.5",u==="md"?"text-[12.5px]":"text-[11.5px]",r&&"opacity-50",c),children:e.map(d=>l.jsx("button",{type:"button",title:d.title,disabled:r,onClick:()=>a(d.value),className:ee("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 qM={info:{icon:Qh,className:"text-accent"},success:{icon:D2,className:"text-success"},error:{icon:L2,className:"text-danger"}};function GM(){const e=me(c=>c.toast),i=me(c=>c.dismissToast);if(U.useEffect(()=>{if(!e)return;const c=window.setTimeout(()=>i(e.id),4500);return()=>window.clearTimeout(c)},[e,i]),!e)return null;const a=qM[e.tone],r=a.icon;return xl.createPortal(l.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:[l.jsx(r,{size:16,className:ee("mt-0.5 shrink-0",a.className)}),l.jsx("p",{className:"flex-1 leading-relaxed",children:e.message}),l.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:l.jsx($i,{size:13})})]}),document.body)}function YM(){const e=me(r=>r.confirm),i=me(r=>r.resolveConfirm),a=e?.tone==="danger";return l.jsx(jd,{open:!!e,onClose:()=>i(!1),className:"sm:w-[420px]",children:l.jsxs("div",{className:"p-5 sm:p-6",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:ee("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:l.jsx(Du,{size:17})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-[15px] font-semibold tracking-[-0.01em]",children:e?.title}),l.jsx("p",{className:"mt-1.5 text-[12.5px] leading-relaxed text-muted",children:e?.body})]})]}),l.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[l.jsx("button",{type:"button",className:"chip",onClick:()=>i(!1),children:"Cancel"}),l.jsxs("button",{type:"button","data-autofocus":!0,onClick:()=>i(!0),className:ee("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:[l.jsx(Mn,{size:14}),e?.confirmLabel??"Confirm"]})]})]})})}function A0({active:e,title:i,description:a,onClick:r,disabled:c}){return l.jsxs("button",{type:"button",onClick:r,disabled:c,"aria-pressed":e,className:ee("flex w-full items-start gap-2.5 rounded-xl border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50",e?"border-accent/40 bg-accent-soft/60":"border-line hover:bg-raised/60"),children:[l.jsx("span",{className:ee("mt-[3px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",e?"border-accent":"border-faint"),children:e&&l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent"})}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block text-[12px] font-medium text-ink",children:i}),l.jsx("span",{className:"mt-0.5 block text-[10.5px] leading-snug text-muted",children:a})]})]})}function VM({session:e}){const i=ze(),a=ze($=>$.update),r=Xe($=>$.updateSession),c=me($=>$.notify),u=Be($=>$.root||$.info.root),d=Be($=>$.info.name),[p,h]=U.useState(!1),[g,b]=U.useState("session"),x=U.useRef(null),v=U.useRef(null);Nk(x,()=>h(!1),p,v);const[y,k]=U.useState({top:56,right:12});U.useLayoutEffect(()=>{if(!p)return;const $=()=>{const Z=v.current?.getBoundingClientRect();Z&&k({top:Z.bottom+8,right:Math.max(8,window.innerWidth-Z.right)})};return $(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[p]);const S=Qw(i,e,u),j=typeof e?.systemPrompt=="string",E=!!u&&typeof i.workspacePrompts[u]=="string",A=j||E,T=g==="session"&&!e&&u?"workspace":g,R=T==="session",P=R?j:E,z=R?e?.systemPrompt??"":i.workspacePrompts[u]??"",C=R?Zw(i,u):{text:i.systemPrompt,source:"app"},L=R?!e:!u,G=$=>{if(R){e&&r(e.id,{systemPrompt:$});return}if(!u)return;const Z={...i.workspacePrompts};$===void 0?delete Z[u]:Z[u]=$,a({workspacePrompts:Z})},O=R&&C.source==="workspace"?"Uses this workspace’s custom prompt.":"Uses the app-wide prompt from Settings → General.";return l.jsxs("div",{className:"relative hidden sm:block",children:[l.jsxs("button",{ref:v,type:"button",onClick:()=>h($=>!$),title:`System prompt · ${S.source==="session"?"custom for this session":S.source==="workspace"?"custom for this workspace":"shared"}`,"aria-label":"Edit system prompt","aria-expanded":p,className:ee("icon-button relative",p&&"bg-raised text-ink"),children:[l.jsx(xC,{size:16,strokeWidth:1.7}),A&&l.jsx("span",{className:"absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-accent"})]}),p&&xl.createPortal(l.jsxs("div",{ref:x,role:"dialog","aria-label":"System prompt",style:{top:y.top,right:y.right},className:"fixed z-[95] max-h-[calc(100dvh-80px)] w-[min(420px,92vw)] overflow-y-auto rounded-2xl border border-line bg-panel p-3.5 shadow-float",children:[l.jsxs("div",{className:"mb-2.5 flex items-center justify-between gap-3",children:[l.jsx("p",{className:"text-[12.5px] font-semibold text-ink",children:"System prompt"}),l.jsx(Ad,{value:T,onChange:b,options:[{value:"session",label:"Session",title:"Only this conversation"},{value:"workspace",label:"Workspace",title:"Every conversation in this folder"}]})]}),l.jsxs("p",{className:"mb-2 flex items-center gap-1.5 text-[10.5px] text-muted",children:[R?l.jsx(tg,{size:11}):l.jsx(E2,{size:11}),R?e?"Applies to this conversation only.":"Send a message to start a conversation first.":u?`Applies to every conversation in ${d||"this folder"}.`:"Open a workspace folder first."]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(A0,{active:!P,disabled:L,title:"Use shared prompt",description:O,onClick:()=>G(void 0)}),l.jsx(A0,{active:P,disabled:L,title:R?"Custom for this session":"Custom for this workspace",description:"Write a prompt that replaces the shared one here.",onClick:()=>{P||(G(C.text),c("Started from the current shared prompt. Edit it below.","info"))}})]}),P&&!L&&l.jsx("textarea",{value:z,onChange:$=>G($.target.value),rows:9,spellCheck:!1,"aria-label":"Custom system prompt",className:"thin-scroll mt-2.5 w-full resize-y rounded-xl border border-line bg-canvas px-3 py-2 font-mono text-[11px] leading-relaxed text-ink outline-none focus:border-accent/50",placeholder:"You are…"}),l.jsx("p",{className:"mt-2 text-[10px] leading-relaxed text-faint",children:"Order of precedence: session, then workspace, then shared. Skills, workspace context and mode rules are always added after it."})]}),document.body)]})}const KM=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function XM({session:e,view:i,onViewChange:a}){const r=ze(),c=ze(A=>A.update),u=me(A=>A.sidebarCollapsed),d=me(A=>A.toggleSidebar),p=me(A=>A.setMobileSidebarOpen),h=me(A=>A.setPaletteOpen),g=me(A=>A.openSettings),b=me(A=>A.workspaceOpen),x=me(A=>A.setWorkspaceOpen),v=me(A=>A.setDeployOpen),y=Be(A=>A.info),k=Cd(),S=ch(r.theme,typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches),j=!!(e&&e.messages.length>0),E=e?.messages.filter(A=>A.role==="user").length??0;return l.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:[l.jsx("button",{type:"button",className:"icon-button lg:hidden",onClick:()=>p(!0),"aria-label":"Open menu",children:l.jsx(BT,{size:18})}),u&&l.jsx("button",{type:"button",className:"icon-button hidden lg:inline-flex",onClick:d,title:"Expand sidebar","aria-label":"Expand sidebar",children:l.jsx(WT,{size:17})}),l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[!e&&l.jsx(gl,{size:19,className:"lg:hidden"}),y.available&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"hidden max-w-[120px] shrink-0 truncate text-[13px] text-faint md:inline",children:y.name}),l.jsx("span",{className:"hidden text-faint/50 md:inline",children:"/"})]}),l.jsx("h1",{className:"min-w-0 truncate text-[13.5px] font-medium tracking-[-0.01em] text-ink",children:e?.title??"New conversation"}),j&&l.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"?l.jsx(Jh,{size:11}):l.jsx(oi,{size:11}),r.mode==="plan"?"Plan mode":"Build mode"]}),j&&l.jsxs("span",{className:"hidden shrink-0 text-[11.5px] tabular-nums text-faint md:inline",children:[E," turn",E===1?"":"s"]})]}),j&&l.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(A=>l.jsx("button",{type:"button",onClick:()=>a(A),"aria-pressed":i===A,className:ee("h-6 rounded-md px-3 text-[11.5px] font-medium capitalize transition-all duration-200",i===A?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:A},A))}),l.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[j&&l.jsx("div",{className:"mr-3 hidden sm:block",children:l.jsx(FM,{messages:e?.messages??[],model:k,sessionId:e?.id??null})}),l.jsxs("button",{type:"button",onClick:()=>x(!b),title:y.available?y.root:"Choose a workspace folder",className:ee("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",b?"border-accent/30 bg-accent-soft text-accent":"border-line text-muted hover:bg-raised/60 hover:text-ink"),children:[l.jsx(ml,{size:13,className:"shrink-0"}),l.jsx("span",{className:"max-w-[140px] truncate",children:y.available?y.name:"No folder"})]}),l.jsx(VM,{session:e}),l.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:l.jsx(Jr,{size:16,strokeWidth:1.7})}),l.jsx("button",{type:"button",className:"icon-button",onClick:()=>h(!0),title:`Search and commands (${KM?"⌘":"Ctrl"} K)`,"aria-label":"Open search and commands",children:l.jsx(rs,{size:16})}),l.jsx("button",{type:"button",className:"icon-button hidden sm:inline-flex",onClick:()=>c({theme:S?"light":"dark"}),title:S?"Switch to light theme":"Switch to dark theme","aria-label":"Toggle theme",children:S?l.jsx(sg,{size:16}):l.jsx(ig,{size:16})}),l.jsx("button",{type:"button",className:"icon-button",onClick:()=>g("general"),title:"Settings","aria-label":"Open settings",children:l.jsx(mw,{size:16})})]})]})}const yg=[{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."}],Sh=["write_file","edit_file","rewrite_file"],_h=["shell","git","subagent"];function Ek(e){const i=Sh.every(r=>e[r]?.approval==="auto"),a=_h.every(r=>e[r]?.approval==="auto");return i&&a?"full":i?"accept-edits":"ask"}function Sk(e,i){const a={};for(const r of Object.keys(e)){const c=Sh.includes(r)||_h.includes(r),u=i==="full"?"auto":i==="accept-edits"?Sh.includes(r)?"auto":_h.includes(r)?"ask":e[r].approval:c?"ask":e[r].approval;a[r]={...e[r],approval:u}}return a}function ZM(e){return yg.find(i=>i.value===e)?.label??"Ask first"}const QM=[];function O0(e){return yd(ze.getState(),e)}function Tm(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6?1:0)}M`:`${Math.round(e/1e3)}k`:""}function WM(e){return e?Math.max(.06,Math.min(1,Math.log10(e/4e3)/Math.log10(2e6/4e3))):0}function JM(e){const i=e.split(/[\s/.-]+/).filter(Boolean);return(i.length>1?i[0][0]+i[1][0]:e.slice(0,2)).toUpperCase()}function e5({efforts:e,value:i,className:a}){const r=Math.max(0,e.indexOf(i));return l.jsx("span",{className:ee("flex h-3.5 items-end gap-[2px]",a),"aria-hidden":!0,children:e.map((c,u)=>l.jsx("span",{style:{height:`${38+u/Math.max(1,e.length-1)*62}%`},className:ee("w-[3px] rounded-[1px] transition-all duration-300 ease-spring",u<=r?"bg-accent":"bg-line")},c))})}function t5({efforts:e,value:i,onChange:a,disabled:r}){const c=U.useRef(null),[u,d]=U.useState(!1),p=Math.max(1,e.length-1),h=Math.max(0,e.indexOf(i)),g=h/p*100,b=U.useCallback(x=>{const v=c.current?.getBoundingClientRect();if(!v||e.length===0)return;const y=1-Math.min(1,Math.max(0,(x-v.top)/v.height)),k=e[Math.round(y*p)];k&&k!==i&&a(k)},[e,p,a,i]);return l.jsxs("div",{className:ee("relative flex h-[280px] gap-4 select-none",r&&"pointer-events-none opacity-40"),children:[l.jsxs("div",{ref:c,role:"slider",tabIndex:r?-1:0,"aria-label":"Reasoning effort","aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":h,"aria-valuetext":Gu(i),onKeyDown:x=>{x.key==="ArrowUp"||x.key==="ArrowRight"?(x.preventDefault(),a(e[Math.min(e.length-1,h+1)])):(x.key==="ArrowDown"||x.key==="ArrowLeft")&&(x.preventDefault(),a(e[Math.max(0,h-1)]))},onPointerDown:x=>{x.currentTarget.setPointerCapture(x.pointerId),d(!0),b(x.clientY)},onPointerMove:x=>u&&b(x.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:[l.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)]"}),l.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((x,v)=>l.jsx("span",{className:ee("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})`}},x)),l.jsx("span",{className:ee("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:l.jsx("span",{className:"absolute inset-[5px] rounded-full bg-accent"})})]}),l.jsx("div",{className:"relative min-w-0 flex-1",children:e.map((x,v)=>{const y=v===h;return l.jsxs("button",{type:"button",onClick:()=>a(x),className:ee("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:[l.jsx("span",{className:ee("font-mono text-[10.5px] uppercase tracking-[0.14em]",y&&"text-accent"),children:Gu(x)}),l.jsx("span",{className:ee("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:cg[x]?.description})]},x)})})]})}function n5({open:e,onClose:i}){const a=ze(),r=ze(_=>_.selectModel),c=ze(_=>_.update),u=me(_=>_.openSettings),[d,p]=U.useState(""),[h,g]=U.useState(""),[b,x]=U.useState(!1),[v,y]=U.useState(0),k=U.useRef(null),S=U.useRef(!1),j=U.useRef(null),E=U.useRef(null),A=a.provider,T=An(_=>_.byProvider[A])??QM,R=An(_=>!!_.loading[A]),P=An(_=>_.errors[A]??""),z=An(_=>_.notes[A]??""),C=An(_=>_.fetchModels),L=Qn(a),G=T.find(_=>_.id===L)??null,O=O0(A),$=!!ra[A]?.keyless||A==="custom",Z=Do(G);U.useEffect(()=>{e&&(O||$)&&C(A)},[e,A,O,$,C]),U.useEffect(()=>{if(!e){p(""),x(!1);return}const _=window.setTimeout(()=>j.current?.focus(),60),ve=document.activeElement,ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.clearTimeout(_),document.body.style.overflow=ce,ve?.focus?.()}},[e]);const fe=U.useMemo(()=>{const _=d.trim().toLowerCase();return _?T.filter(ve=>ve.name.toLowerCase().includes(_)||ve.id.toLowerCase().includes(_)):T},[T,d]);U.useLayoutEffect(()=>{y(0)},[d,A]),U.useEffect(()=>{S.current&&(S.current=!1,k.current?.querySelector(`[data-row="${v}"]`)?.scrollIntoView({block:"nearest"}))},[v]);const re=_=>{const ve=Do(_),ce=ve.length>0?ul(a.effort,_):a.effort;r(A,_.id,ve.length>0&&!ve.includes(ce)?Cw(_):ce)},te=_=>{_?.preventDefault();const ve=h.trim();ve&&(r(A,ve,a.effort),g(""),x(!1))},M=_=>{_!==A&&(c({provider:_,model:""}),p(""),C(_))},ae=_=>{if(_.key==="ArrowDown")_.preventDefault(),S.current=!0,y(ve=>Math.min(fe.length-1,ve+1));else if(_.key==="ArrowUp")_.preventDefault(),S.current=!0,y(ve=>Math.max(0,ve-1));else if(_.key==="Enter"){_.preventDefault();const ve=fe[v];ve&&ve.id!==L?re(ve):i()}};if(U.useEffect(()=>{if(!e)return;const _=ve=>{ve.key==="Escape"&&(ve.preventDefault(),i())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,i]),U.useEffect(()=>{if(!e)return;const _=requestAnimationFrame(()=>E.current?.querySelector('[aria-pressed="true"]')?.scrollIntoView({block:"center"}));return()=>cancelAnimationFrame(_)},[e,A]),!e)return null;const ne=!O&&!$,xe=Math.max(0,qu.findIndex(_=>_.id===A));return xl.createPortal(l.jsxs("div",{className:"fixed inset-0 z-[90] flex items-end justify-center sm:items-center sm:p-6",children:[l.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"}),l.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:[l.jsx("div",{className:"deck-aurora pointer-events-none absolute inset-x-0 top-0 h-40"}),l.jsxs("header",{className:"relative flex shrink-0 items-end gap-4 px-6 pb-4 pt-5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.22em] text-faint",children:"Model deck"}),l.jsx("h2",{className:"mt-1 truncate font-display text-[26px] font-semibold leading-none tracking-[-0.03em] text-ink",children:G?.name||L||"Pick a model"}),l.jsxs("p",{className:"mt-1.5 flex items-center gap-2 text-[11.5px] text-muted",children:[l.jsx("span",{children:ra[A]?.name??A}),Z.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-faint",children:"·"}),l.jsxs("span",{className:"text-accent",children:[Gu(a.effort)," effort"]})]}),G?.context?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-faint",children:"·"}),l.jsxs("span",{children:[Tm(G.context)," context"]})]}):null]})]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{C(A,!0)},disabled:R||ne,title:"Refresh live models","aria-label":"Refresh live models",children:l.jsx(Ii,{size:14,className:ee(R&&"animate-spin")})}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{i(),u("models")},title:"Provider settings","aria-label":"Provider settings",children:l.jsx(hw,{size:14})}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:i,"aria-label":"Close",children:l.jsx($i,{size:15})})]}),l.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col border-t border-line md:flex-row",children:[l.jsxs("nav",{ref:E,"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:[l.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(${xe*52}px)`}}),qu.map(_=>{const ve=O0(_.id)||_.keyless||_.id==="custom",ce=_.id===A;return l.jsxs("button",{type:"button",onClick:()=>M(_.id),disabled:!ve,title:`${_.name}${ve?"":" · connect to enable"}`,"aria-pressed":ce,className:ee("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",ce?"text-accent max-md:bg-accent-soft":"text-muted hover:bg-raised hover:text-ink"),children:[l.jsx("span",{className:"font-display text-[13px] font-semibold tracking-tight",children:JM(_.name)}),l.jsx("span",{className:"max-w-full truncate px-1 text-[8.5px] leading-none text-faint",children:_.name.split(" ")[0]}),l.jsx("span",{className:ee("absolute right-1.5 top-1.5 h-1.5 w-1.5 rounded-full",ve?"bg-success":"bg-warning/70")})]},_.id)})]}),l.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:ne?l.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-8 text-center",children:[l.jsx("span",{className:"deck-pop flex h-12 w-12 items-center justify-center rounded-2xl bg-warning/10 text-warning",children:l.jsx(Bo,{size:20})}),l.jsxs("p",{className:"font-display text-[16px] font-semibold text-ink",children:["Connect ",ra[A]?.name??A]}),l.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."}),l.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"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"shrink-0 px-4 pb-2 pt-3.5",children:[l.jsxs("div",{className:"relative",children:[l.jsx(rs,{size:14,className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{ref:j,value:d,onChange:_=>p(_.target.value),onKeyDown:ae,placeholder:T.length>0?`Search ${T.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"}),l.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:"↑↓ ↵"})]}),P&&l.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:[l.jsx(fd,{size:12,className:"mt-0.5 shrink-0 text-danger"}),l.jsx("p",{className:"min-w-0 flex-1 text-[11px] leading-relaxed text-danger",children:P}),l.jsx("button",{type:"button",onClick:()=>{C(A,!0)},className:"text-[11px] font-medium text-danger",children:"Retry"})]}),z&&!P&&l.jsx("p",{className:"mt-1.5 px-1 text-[10.5px] leading-relaxed text-faint",children:z})]}),l.jsxs("div",{ref:k,className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2.5 pb-3",children:[R&&T.length===0&&l.jsxs("p",{className:"flex items-center gap-2 px-3 py-4 text-[12px] text-faint",children:[l.jsx(Ht,{size:12})," Loading live models…"]}),fe.map((_,ve)=>{const ce=_.id===L,D=ve===v,B=_.reasoningOptions.length>0;return l.jsxs("button",{type:"button","data-row":ve,onClick:()=>{y(ve),re(_)},onMouseEnter:()=>y(ve),style:{animationDelay:`${Math.min(ve*22,260)}ms`},className:ee("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",ce?"bg-accent-soft":D?"bg-raised":"hover:bg-raised/70"),children:[l.jsx("span",{className:ee("flex h-8 w-8 shrink-0 items-center justify-center rounded-xl transition-all duration-300",ce?"scale-100 bg-accent text-on-accent":"bg-raised text-faint group-hover/row:bg-panel"),children:ce?l.jsx(Mn,{size:14,strokeWidth:2.4}):l.jsx(XC,{size:13})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ee("truncate text-[13px] font-medium",ce?"text-accent":"text-ink"),children:_.name||_.id}),_.free&&l.jsx("span",{className:"rounded-full bg-success/10 px-1.5 py-px text-[9px] font-medium text-success",children:"free"}),!_.toolCall&&l.jsx("span",{className:"rounded-full bg-warning/10 px-1.5 py-px text-[9px] font-medium text-warning",children:"no tools"})]}),l.jsx("span",{className:"mt-0.5 block truncate font-mono text-[10px] text-faint",children:_.id})]}),l.jsxs("span",{className:"hidden shrink-0 items-center gap-2.5 text-faint sm:flex",children:[B&&l.jsx(a0,{size:12,className:"text-accent/80","aria-label":"reasoning"}),_.vision&&l.jsx(Zh,{size:12,"aria-label":"vision"}),_.context?l.jsxs("span",{className:"flex w-[74px] flex-col items-end gap-1",children:[l.jsx("span",{className:"font-mono text-[10px] tabular-nums",children:Tm(_.context)}),l.jsx("span",{className:"h-[3px] w-full overflow-hidden rounded-full bg-line",children:l.jsx("span",{className:ee("block h-full rounded-full",ce?"bg-accent":"bg-faint/60"),style:{width:`${WM(_.context)*100}%`}})})]}):null]})]},_.id)}),!R&&fe.length===0&&T.length>0&&l.jsxs("p",{className:"px-3 py-6 text-center text-[12px] text-faint",children:["No model matches “",d,"”."]}),!R&&T.length===0&&!P&&l.jsx("p",{className:"px-3 py-6 text-center text-[12px] text-faint",children:"This provider returned no usable chat models."}),b?l.jsxs("form",{onSubmit:te,className:"deck-row mt-1 flex items-center gap-2 px-1",children:[l.jsx("input",{autoFocus:!0,value:h,onChange:_=>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"}),l.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"})]}):l.jsxs("button",{type:"button",onClick:()=>x(!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:[l.jsx(Wr,{size:13})," Use a model ID that is not listed"]})]})]})}),l.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:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(a0,{size:13,className:"text-accent"}),l.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-muted",children:"Reasoning"})]}),Z.length>1?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"hidden md:block",children:l.jsx(t5,{efforts:Z,value:ul(a.effort,G),onChange:_=>G&&r(A,G.id,_),disabled:!G})}),l.jsx("div",{className:"flex gap-1 rounded-full bg-raised p-1 md:hidden",children:Z.map(_=>l.jsx("button",{type:"button",onClick:()=>G&&r(A,G.id,_),className:ee("h-8 min-w-0 flex-1 rounded-full text-[10.5px] font-medium transition-all",a.effort===_?"bg-accent text-on-accent shadow-pill":"text-muted"),children:Gu(_)},_))})]}):l.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:[l.jsx("p",{className:"text-[12px] font-medium text-ink",children:G?"No effort dial":"Pick a model"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted",children:oh(G)})]}),Z.length>1&&l.jsx("p",{className:"mt-4 hidden text-[10.5px] leading-relaxed text-faint md:block",children:oh(G)})]})]}),l.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:[G?.maxOutput?l.jsxs("span",{children:["max output ",Tm(G.maxOutput)]}):null,G?.apiKind?l.jsx("span",{className:"rounded-md border border-line px-1.5 py-px font-mono",children:G.apiKind}):null,l.jsx("span",{className:"ml-auto hidden sm:inline",children:"Esc to close"}),l.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 i5({label:e,open:i,disabled:a,onClick:r,triggerRef:c,efforts:u,effort:d,title:p}){return l.jsxs("button",{ref:c,type:"button",disabled:a,onClick:r,"aria-haspopup":"dialog","aria-expanded":i,title:p,className:ee("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:[l.jsx("span",{className:"truncate",children:e}),u.length>1&&l.jsx(e5,{efforts:u,value:d})]})}const ta={outline:"#6b3410",body:"#fbbf24",shade:"#f59e0b",highlight:"#fef3c7",ray:"#f59e0b",eye:"#1a0f06",mark:"#4a2508",blush:"#fb7185",sweat:"#38bdf8",mint:"#34d399",sky:"#60a5fa",rose:"#fb7185"},a5={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"},r5=new Set(["thinking","working","typing","party","wave"]),_k=[[4,6,9],[5,5,10],[6,4,11],[7,4,11],[8,4,11],[9,4,11],[10,5,10],[11,6,9]],tl=new Set;for(const[e,i,a]of _k)for(let r=i;r<=a;r++)tl.add(`${r},${e}`);const Tk=[];for(let e=2;e<=13;e++)for(let i=2;i<=13;i++){if(tl.has(`${i},${e}`))continue;(tl.has(`${i-1},${e}`)||tl.has(`${i+1},${e}`)||tl.has(`${i},${e-1}`)||tl.has(`${i},${e+1}`))&&Tk.push([i,e])}const s5=[[7,0,2,2,"ray"],[7,14,2,2,"ray"],[0,7,2,2,"ray"],[14,7,2,2,"ray"]],l5=[[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 na(e,i=0,a=0){const[r,c]=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,c,"eye"],[9+i,u,r,c,"eye"]]}const M0=[[4,9,1,1,"blush"],[11,9,1,1,"blush"]];function o5(e){switch(e){case"wave":return{eyes:na("md"),extras:M0,eyeClass:"pxs-blink"};case"happy":return{eyes:na("lg"),extras:[...M0,[13,1,1,3,"ray"],[12,2,3,1,"ray"]],clearCorner:!0};case"party":return{eyes:na("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:na("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:na("sm",0,1),extras:[],eyeClass:"pxs-scan"};case"typing":return{eyes:na("md",0,1),extras:[],eyeClass:"pxs-scan"};case"alert":return{eyes:na("lg"),extras:[[13,0,1,3,"mark"],[13,4,1,1,"mark"]],clearCorner:!0};case"error":return{eyes:na("sm",0,1),extras:[[12,3,1,1,"sweat"],[12,4,1,2,"sweat"]],clearCorner:!0};case"sleepy":return{eyes:na("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:na("md"),extras:[],eyeClass:"pxs-blink"}}}function Ck({mood:e="idle",size:i=40,className:a,animate:r=!0}){const c=DM[e],u=r&&r5.has(e),d=o5(e);return l.jsx("span",{className:ee("inline-flex shrink-0 select-none",r&&a5[e],a),role:"img","aria-label":`PixleSol — ${c}`,title:`PixleSol — ${c}`,children:l.jsxs("svg",{viewBox:"0 0 16 16",width:i,height:i,shapeRendering:"crispEdges","aria-hidden":"true",children:[l.jsx("g",{className:u?"pxs-a":void 0,children:s5.map(([p,h,g,b,x],v)=>l.jsx("rect",{x:p,y:h,width:g,height:b,fill:ta[x]},v))}),l.jsx("g",{className:u?"pxs-b":void 0,opacity:d.clearCorner?.35:void 0,children:l5.map(([p,h,g,b,x],v)=>l.jsx("rect",{x:p,y:h,width:g,height:b,fill:ta[x]},v))}),Tk.map(([p,h])=>l.jsx("rect",{x:p,y:h,width:1,height:1,fill:ta.outline},`o${p},${h}`)),_k.map(([p,h,g])=>l.jsx("rect",{x:h,y:p,width:g-h+1,height:1,fill:ta.body},`b${p}`)),l.jsx("rect",{x:5,y:11,width:6,height:1,fill:ta.shade}),l.jsx("rect",{x:9,y:10,width:2,height:1,fill:ta.shade}),l.jsx("rect",{x:6,y:4,width:2,height:1,fill:ta.highlight}),l.jsx("rect",{x:5,y:5,width:1,height:1,fill:ta.highlight}),l.jsx("g",{className:r?d.eyeClass:void 0,children:d.eyes.map(([p,h,g,b,x],v)=>l.jsx("rect",{x:p,y:h,width:g,height:b,fill:ta[x]},v))}),d.extras.map(([p,h,g,b,x],v)=>l.jsx("rect",{x:p,y:h,width:g,height:b,fill:ta[x]},`x${v}`))]})})}const c5=/\.(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,Cm=6,u5=5*1024*1024,d5=512*1024,jm=[{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 R0(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function D0({value:e,onChange:i,onSend:a,onStop:r,onCommand:c,streaming:u,hints:d=!1,autoFocus:p=!1,placeholder:h="How can I help you today?",contextPct:g,contextTitle:b,pixleMood:x}){const v=ze(),y=ze(ue=>ue.update),k=ze(ue=>ue.setMode),S=me(ue=>ue.notify),j=me(ue=>ue.openSettings),E=me(ue=>ue.composerFocus),A=me(ue=>ue.setWorkspaceOpen),T=Be(ue=>ue.info),[R,P]=U.useState([]),[z,C]=U.useState(!1),[L,G]=U.useState(!1),[O,$]=U.useState(!1),[Z,fe]=U.useState(!1),[re,te]=U.useState(!1),[M,ae]=U.useState(0),ne=U.useRef(null),xe=U.useRef(null),_=U.useRef(null),ve=U.useRef(null),ce=U.useRef(null);U.useEffect(()=>{const ue=qe=>{(qe.metaKey||qe.ctrlKey)&&!qe.shiftKey&&!qe.altKey&&qe.key.toLowerCase()==="m"&&(qe.preventDefault(),$(ht=>!ht))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[]),Nk(ve,()=>fe(!1),Z,ce);const D=Qn(v),B=FA(v.provider),se=Cd(),pe=dl(v),Ee=Do(se),Le=vi(ue=>ue.skills.filter(qe=>qe.enabled).length),Pe=Ek(v.tools),Fe=pe?D?B.find(ue=>ue.id===D)?.name??D:"Select model":"No provider",Se=U.useMemo(()=>{if(!e.startsWith("/")||e.includes(`
|
|
210
|
+
`))return null;const ue=e.slice(1).split(/\s/)[0];return e.slice(1).includes(" ")?null:ue.toLowerCase()},[e]),H=U.useMemo(()=>Se===null?[]:jm.filter(ue=>ue.name.startsWith(Se)),[Se]);U.useEffect(()=>{ae(0)},[Se]),U.useLayoutEffect(()=>{const ue=ne.current;ue&&(ue.style.height="auto",ue.style.height=`${Math.min(Math.max(ue.scrollHeight,52),220)}px`)},[e]),U.useEffect(()=>{if(!p||!window.matchMedia("(pointer: fine)").matches)return;const ue=window.setTimeout(()=>ne.current?.focus(),80);return()=>window.clearTimeout(ue)},[p]),U.useEffect(()=>{E>0&&ne.current?.focus()},[E]),U.useEffect(()=>{pe||$(!1)},[pe]),U.useEffect(()=>{se&&!Ee.length&&y({effort:"medium"})},[se,Ee.length,y]);const K=async ue=>{if(ue.length===0)return;let qe=Cm-R.length;if(qe<=0){S(`You can attach up to ${Cm} files per message.`,"error");return}const ht=[];for(const xt of ue){if(qe<=0){S(`Only ${Cm} attachments were added.`,"info");break}const on=/^image\/(png|jpeg|webp|gif)$/i.test(xt.type),ie=xt.type.startsWith("text/")||c5.test(xt.name);if(on){if(xt.size>u5){S(`${xt.name} is larger than 5 MB.`,"error");continue}ht.push({id:R0(),name:xt.name,kind:"image",mime:xt.type,dataUrl:await CM(xt),size:xt.size}),qe-=1}else if(ie){if(xt.size>d5){S(`${xt.name} is larger than 512 KB.`,"error");continue}ht.push({id:R0(),name:xt.name,kind:"text",mime:xt.type||"text/plain",text:await jM(xt),size:xt.size}),qe-=1}else S(`Can't attach ${xt.name}. Use an image, text or code file.`,"error")}ht.length>0&&P(xt=>[...xt,...ht])},be=async()=>{if(u||re)return;const ue=e.trim();if(!(!ue&&R.length===0)){if(ue.startsWith("/")&&!R.length){const[qe,...ht]=ue.slice(1).split(/\s+/),xt=jm.find(on=>on.name===qe.toLowerCase());if(xt){const on=ht.join(" ").trim();if(c){te(!0);try{await c(xt.name,on)&&(i(""),requestAnimationFrame(()=>ne.current?.focus()))}catch(ie){S(ie instanceof Error?ie.message:"That command failed.","error")}finally{te(!1)}return}}}te(!0),$(!1);try{await a(e,R)&&(i(""),P([]),requestAnimationFrame(()=>ne.current?.focus()))}catch(qe){S(qe instanceof Error?qe.message:"The message could not be sent.","error")}finally{te(!1)}}},je=(ue,qe)=>{if(qe){i(`/${ue} `),ne.current?.focus();return}i(`/${ue}`),window.setTimeout(()=>{Oe(`/${ue}`)},0)},Oe=async ue=>{const[qe]=ue.slice(1).split(/\s+/),ht=jm.find(xt=>xt.name===qe.toLowerCase());if(!(!ht||!c)){te(!0);try{await c(ht.name,ue.slice(1).split(/\s+/).slice(1).join(" "))&&i("")}finally{te(!1)}}},ot=ue=>{if(H.length>0){if(ue.key==="ArrowDown"){ue.preventDefault(),ae(qe=>(qe+1)%H.length);return}if(ue.key==="ArrowUp"){ue.preventDefault(),ae(qe=>(qe-1+H.length)%H.length);return}if(ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing){ue.preventDefault();const qe=H[M];qe&&je(qe.name,qe.takesArgs);return}if(ue.key==="Escape"){ue.preventDefault(),i("");return}}if(ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing){if(ue.preventDefault(),u)return;be()}ue.key==="Escape"&&$(!1)},Ve=ue=>{const qe=Array.from(ue.clipboardData.files);qe.length>0&&(ue.preventDefault(),K(qe))},jt=ue=>{ue.preventDefault(),G(!1),K(Array.from(ue.dataTransfer.files))},fn=!e.trim()&&R.length===0||re||u,$t=g===void 0?"":g>=95?"text-danger":g>=70?"text-warning":"text-faint";return l.jsxs("div",{className:"relative w-full",children:[l.jsx(n5,{open:O&&pe,onClose:()=>$(!1)}),H.length>0&&l.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:[l.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:[l.jsx(SC,{size:10})," Commands"]}),H.map((ue,qe)=>l.jsxs("button",{type:"button",onMouseDown:ht=>ht.preventDefault(),onClick:()=>je(ue.name,ue.takesArgs),className:ee("flex w-full items-center gap-2 px-3 py-2 text-left",qe===M?"bg-accent-soft":"hover:bg-raised"),children:[l.jsx("span",{className:ee("font-mono text-[10.5px]",qe===M?"text-accent":"text-ink"),children:ue.usage}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px] text-faint",children:ue.description})]},ue.name))]}),l.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-1.5",children:[l.jsxs("button",{type:"button",onClick:()=>A(!0),className:"chip h-7 max-w-[220px] gap-1.5 px-2.5 text-[11px]",title:T.available?T.root:"Choose a project folder",children:[l.jsx(ml,{size:12,className:"shrink-0 text-faint"}),l.jsx("span",{className:"truncate",children:T.available?T.name:"No folder"})]}),l.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"?l.jsx(Jh,{size:12,className:"text-faint"}):l.jsx(oi,{size:12,className:"text-faint"}),v.mode==="plan"?"Plan mode":"Build mode"]}),l.jsxs("button",{type:"button",onClick:()=>y({webSearchEnabled:!v.webSearchEnabled}),className:ee("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:[l.jsx(is,{size:12}),"Search"]}),Le>0&&l.jsxs("button",{type:"button",onClick:()=>j("skills"),className:"chip h-7 gap-1 px-2.5 text-[11px]",title:"Manage loaded skills",children:[Le," skill",Le===1?"":"s"]})]}),l.jsxs("div",{onDragOver:ue=>{ue.dataTransfer.types.includes("Files")&&(ue.preventDefault(),G(!0))},onDragLeave:ue=>{ue.currentTarget.contains(ue.relatedTarget)||G(!1)},onDrop:jt,className:ee("surface-lift composer-shadow relative rounded-2xl border transition-all duration-200",z||L?"border-accent/35":"border-line",u&&"composer-glow border-accent/30",L&&"ring-4 ring-accent/10"),children:[z&&!L&&l.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-4 ring-accent/[0.03]","aria-hidden":"true"}),l.jsxs("div",{className:"relative px-3.5 pb-1 pt-3",children:[R.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 px-1 pb-2",children:R.map(ue=>ue.kind==="image"?l.jsxs("div",{className:"relative",children:[l.jsx("img",{src:ue.dataUrl,alt:ue.name,className:"h-14 w-14 rounded-lg border border-line object-cover"}),l.jsx("button",{type:"button",onClick:()=>P(qe=>qe.filter(ht=>ht.id!==ue.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 ${ue.name}`,children:l.jsx($i,{size:10})})]},ue.id):l.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:[l.jsx(as,{size:11,className:"shrink-0"}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:ue.name}),l.jsx("span",{className:"shrink-0 text-faint",children:hl(ue.size)}),l.jsx("button",{type:"button",onClick:()=>P(qe=>qe.filter(ht=>ht.id!==ue.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 ${ue.name}`,children:l.jsx($i,{size:10})})]},ue.id))}),l.jsx("textarea",{ref:ne,value:e,onChange:ue=>i(ue.target.value),onKeyDown:ot,onPaste:Ve,onFocus:()=>C(!0),onBlur:()=>C(!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}})]}),l.jsxs("div",{className:"flex items-end justify-between gap-2 px-2.5 pb-2 pt-1",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-0.5",children:[l.jsxs("div",{className:"relative",children:[l.jsxs("button",{ref:ce,type:"button",onClick:()=>fe(ue=>!ue),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":Z,children:[l.jsx(yr,{size:13,className:"text-faint"}),ZM(Pe),l.jsx(dd,{size:11,className:ee("text-faint transition-transform",Z&&"rotate-180")})]}),Z&&l.jsxs("div",{ref:ve,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:[l.jsx("p",{className:"px-2 pb-1 pt-1.5 text-[10px] font-medium uppercase tracking-[0.1em] text-faint",children:"Permissions"}),yg.map(ue=>l.jsxs("button",{type:"button",onClick:()=>{y({tools:Sk(v.tools,ue.value)}),fe(!1)},className:"flex w-full items-start gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-raised",children:[l.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center",children:Pe===ue.value?l.jsx(Mn,{size:12,className:"text-accent"}):l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-line"})}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block text-[11.5px] font-medium text-ink",children:ue.label}),l.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-faint",children:ue.description})]})]},ue.value))]})]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>xe.current?.click(),title:"Attach images or text files","aria-label":"Attach files",children:l.jsx(eC,{size:15})}),l.jsx("input",{ref:xe,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:ue=>{ue.target.files&&K(Array.from(ue.target.files)),ue.target.value=""}})]}),l.jsxs("div",{className:"flex min-w-0 shrink-0 items-center gap-1",children:[g!==void 0&&l.jsxs("span",{className:ee("hidden items-center gap-1 px-1 text-[10.5px] tabular-nums sm:flex",$t),title:b,children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),g,"%"]}),l.jsx(i5,{triggerRef:_,label:Fe,open:O,disabled:!pe,onClick:()=>$(ue=>!ue),efforts:Ee,effort:v.effort,title:pe?"Model deck: choose model and reasoning effort (Ctrl M)":"Add a provider key in Settings first"}),u?l.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:l.jsx(rg,{size:11,fill:"currentColor"})}):l.jsx("button",{type:"button",onClick:()=>{be()},disabled:fn,className:ee("flex h-8 w-8 items-center justify-center rounded-full transition-all duration-150",fn?"cursor-not-allowed bg-raised text-faint":"bg-accent text-on-accent hover:brightness-110"),"aria-label":"Send message",title:"Send (Enter)",children:re?l.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border border-current border-t-transparent"}):l.jsx(f5,{})})]})]}),L&&l.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:[l.jsx(xw,{size:18,className:"text-accent"}),l.jsx("p",{className:"text-[12px] font-medium text-ink",children:"Drop files to attach"}),l.jsx("p",{className:"text-[10.5px] text-faint",children:"Images up to 5 MB · text up to 512 KB"})]}),x&&l.jsx(Ck,{mood:x,size:44,className:"pointer-events-none absolute -top-[34px] right-4 z-10 hidden sm:inline-flex"})]}),d&&l.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-4 px-2 text-[11px] text-faint",children:[l.jsx("span",{className:"hidden sm:inline",children:"Enter to send · Shift + Enter for a new line · / for commands"}),l.jsxs("span",{className:"flex items-center gap-1 sm:ml-auto",children:[l.jsx(yr,{size:11}),"Local daemon · keys encrypted at rest"]})]})]})}function f5(){return l.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:l.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 p5(e,i){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const m5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g5={};function z0(e,i){return(g5.jsx?h5:m5).test(e)}const x5=/[ \t\n\f\r]/g;function b5(e){return typeof e=="object"?e.type==="text"?L0(e.value):!1:L0(e)}function L0(e){return e.replace(x5,"")===""}class Fo{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}Fo.prototype.normal={};Fo.prototype.property={};Fo.prototype.space=void 0;function jk(e,i){const a={},r={};for(const c of e)Object.assign(a,c.property),Object.assign(r,c.normal);return new Fo(a,r,i)}function Th(e){return e.toLowerCase()}class Wn{constructor(i,a){this.attribute=a,this.property=i}}Wn.prototype.attribute="";Wn.prototype.booleanish=!1;Wn.prototype.boolean=!1;Wn.prototype.commaOrSpaceSeparated=!1;Wn.prototype.commaSeparated=!1;Wn.prototype.defined=!1;Wn.prototype.mustUseProperty=!1;Wn.prototype.number=!1;Wn.prototype.overloadedBoolean=!1;Wn.prototype.property="";Wn.prototype.spaceSeparated=!1;Wn.prototype.space=void 0;let y5=0;const tt=ss(),sn=ss(),Ch=ss(),ye=ss(),Lt=ss(),Qr=ss(),li=ss();function ss(){return 2**++y5}const jh=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:sn,commaOrSpaceSeparated:li,commaSeparated:Qr,number:ye,overloadedBoolean:Ch,spaceSeparated:Lt},Symbol.toStringTag,{value:"Module"})),Am=Object.keys(jh);class vg extends Wn{constructor(i,a,r,c){let u=-1;if(super(i,a),I0(this,"space",c),typeof r=="number")for(;++u<Am.length;){const d=Am[u];I0(this,Am[u],(r&jh[d])===jh[d])}}}vg.prototype.defined=!0;function I0(e,i,a){a&&(e[i]=a)}function bl(e){const i={},a={};for(const[r,c]of Object.entries(e.properties)){const u=new vg(r,e.transform(e.attributes||{},r),c,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),i[r]=u,a[Th(r)]=r,a[Th(u.attribute)]=r}return new Fo(i,a,e.space)}const Ak=bl({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:Lt,ariaCurrent:null,ariaDescribedBy:Lt,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:Lt,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:Lt,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Lt,ariaLevel:ye,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:Lt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:Lt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:sn,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Ok(e,i){return i in e?e[i]:i}function Mk(e,i){return Ok(e,i.toLowerCase())}const v5=bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qr,acceptCharset:Lt,accessKey:Lt,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alpha:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:Lt,autoFocus:tt,autoPlay:tt,blocking:Lt,capture:null,charSet:null,checked:tt,cite:null,className:Lt,closedBy:null,colorSpace:null,cols:ye,colSpan:ye,command:null,commandFor:null,content:null,contentEditable:sn,controls:tt,controlsList:Lt,coords:ye|Qr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:Ch,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:Lt,height:ye,hidden:Ch,high:ye,href:null,hrefLang:null,htmlFor:Lt,httpEquiv:Lt,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:Lt,itemRef:Lt,itemScope:tt,itemType:Lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,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:tt,optimum:ye,pattern:null,ping:Lt,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:Lt,required:tt,reversed:tt,rows:ye,rowSpan:ye,sandbox:Lt,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootCustomElementRegistry:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shadowRootSerializable:tt,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:sn,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Lt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:tt,disablePictureInPicture:tt,disableRemotePlayback:tt,exportParts:Qr,part:Lt,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:Mk}),w5=bl({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:li,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:Lt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Qr,g2:Qr,glyphName:Qr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:li,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:li,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:li,rev:li,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:li,requiredFeatures:li,requiredFonts:li,requiredFormats:li,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:li,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:li,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:li,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ok}),Rk=bl({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()}}),Dk=bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mk}),zk=bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),k5={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"},N5=/[A-Z]/g,U0=/-[a-z]/g,E5=/^data[-\w.:]+$/i;function S5(e,i){const a=Th(i);let r=i,c=Wn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&E5.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(U0,T5);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!U0.test(u)){let d=u.replace(N5,_5);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}c=vg}return new c(r,i)}function _5(e){return"-"+e.toLowerCase()}function T5(e){return e.charAt(1).toUpperCase()}const C5=jk([Ak,v5,Rk,Dk,zk],"html"),wg=jk([Ak,w5,Rk,Dk,zk],"svg");function j5(e){return e.join(" ").trim()}var Ws={},Om,B0;function A5(){if(B0)return Om;B0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,c=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,h=`
|
|
211
|
+
`,g="/",b="*",x="",v="comment",y="declaration";function k(j,E){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];E=E||{};var A=1,T=1;function R(re){var te=re.match(i);te&&(A+=te.length);var M=re.lastIndexOf(h);T=~M?re.length-M:T+re.length}function P(){var re={line:A,column:T};return function(te){return te.position=new z(re),G(),te}}function z(re){this.start=re,this.end={line:A,column:T},this.source=E.source}z.prototype.content=j;function C(re){var te=new Error(E.source+":"+A+":"+T+": "+re);if(te.reason=re,te.filename=E.source,te.line=A,te.column=T,te.source=j,!E.silent)throw te}function L(re){var te=re.exec(j);if(te){var M=te[0];return R(M),j=j.slice(M.length),te}}function G(){L(a)}function O(re){var te;for(re=re||[];te=$();)te!==!1&&re.push(te);return re}function $(){var re=P();if(!(g!=j.charAt(0)||b!=j.charAt(1))){for(var te=2;x!=j.charAt(te)&&(b!=j.charAt(te)||g!=j.charAt(te+1));)++te;if(te+=2,x===j.charAt(te-1))return C("End of comment missing");var M=j.slice(2,te-2);return T+=2,R(M),j=j.slice(te),T+=2,re({type:v,comment:M})}}function Z(){var re=P(),te=L(r);if(te){if($(),!L(c))return C("property missing ':'");var M=L(u),ae=re({type:y,property:S(te[0].replace(e,x)),value:M?S(M[0].replace(e,x)):x});return L(d),ae}}function fe(){var re=[];O(re);for(var te;te=Z();)te!==!1&&(re.push(te),O(re));return re}return G(),fe()}function S(j){return j?j.replace(p,x):x}return Om=k,Om}var $0;function O5(){if($0)return Ws;$0=1;var e=Ws&&Ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=a;const i=e(A5());function a(r,c){let u=null;if(!r||typeof r!="string")return u;const d=(0,i.default)(r),p=typeof c=="function";return d.forEach(h=>{if(h.type!=="declaration")return;const{property:g,value:b}=h;p?c(g,b,h):b&&(u=u||{},u[g]=b)}),u}return Ws}var bo={},P0;function M5(){if(P0)return bo;P0=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,c=/^-(ms)-/,u=function(g){return!g||a.test(g)||e.test(g)},d=function(g,b){return b.toUpperCase()},p=function(g,b){return"".concat(b,"-")},h=function(g,b){return b===void 0&&(b={}),u(g)?g:(g=g.toLowerCase(),b.reactCompat?g=g.replace(c,p):g=g.replace(r,p),g.replace(i,d))};return bo.camelCase=h,bo}var yo,H0;function R5(){if(H0)return yo;H0=1;var e=yo&&yo.__importDefault||function(c){return c&&c.__esModule?c:{default:c}},i=e(O5()),a=M5();function r(c,u){var d={};return!c||typeof c!="string"||(0,i.default)(c,function(p,h){p&&h&&(d[(0,a.camelCase)(p,u)]=h)}),d}return r.default=r,yo=r,yo}var D5=R5();const z5=cd(D5),Lk=Ik("end"),kg=Ik("start");function Ik(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 L5(e){const i=kg(e),a=Lk(e);if(i&&a)return{start:i,end:a}}function Ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?F0(e.position):"start"in e||"end"in e?F0(e):"line"in e||"column"in e?Ah(e):""}function Ah(e){return q0(e&&e.line)+":"+q0(e&&e.column)}function F0(e){return Ah(e&&e.start)+"-"+Ah(e&&e.end)}function q0(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 c="",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"?c=i:!u.cause&&i&&(d=!0,c=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=c,this.line=p?p.line:void 0,this.name=Ao(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 Ng={}.hasOwnProperty,I5=new Map,U5=/[A-Z]/g,B5=new Set(["table","tbody","thead","tfoot","tr"]),$5=new Set(["td","th"]),Uk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function P5(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=X5(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=K5(a,i.jsx,i.jsxs)}const c={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"?wg:C5,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},u=Bk(c,e,void 0);return u&&typeof u!="string"?u:c.create(e,c.Fragment,{children:u||void 0},void 0)}function Bk(e,i,a){if(i.type==="element")return H5(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return F5(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return G5(e,i,a);if(i.type==="mdxjsEsm")return q5(e,i);if(i.type==="root")return Y5(e,i,a);if(i.type==="text")return V5(e,i)}function H5(e,i,a){const r=e.schema;let c=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(c=wg,e.schema=c),e.ancestors.push(i);const u=Pk(e,i.tagName,!1),d=Z5(e,i);let p=Sg(e,i);return B5.has(i.tagName)&&(p=p.filter(function(h){return typeof h=="string"?!b5(h):!0})),$k(e,d,u,i),Eg(d,p),e.ancestors.pop(),e.schema=r,e.create(i,u,d,a)}function F5(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)}Uo(e,i.position)}function q5(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Uo(e,i.position)}function G5(e,i,a){const r=e.schema;let c=r;i.name==="svg"&&r.space==="html"&&(c=wg,e.schema=c),e.ancestors.push(i);const u=i.name===null?e.Fragment:Pk(e,i.name,!0),d=Q5(e,i),p=Sg(e,i);return $k(e,d,u,i),Eg(d,p),e.ancestors.pop(),e.schema=r,e.create(i,u,d,a)}function Y5(e,i,a){const r={};return Eg(r,Sg(e,i)),e.create(i,e.Fragment,r,a)}function V5(e,i){return i.value}function $k(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function Eg(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function K5(e,i,a){return r;function r(c,u,d,p){const g=Array.isArray(d.children)?a:i;return p?g(u,d,p):g(u,d)}}function X5(e,i){return a;function a(r,c,u,d){const p=Array.isArray(u.children),h=kg(r);return i(c,u,d,p,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Z5(e,i){const a={};let r,c;for(c in i.properties)if(c!=="children"&&Ng.call(i.properties,c)){const u=W5(e,c,i.properties[c]);if(u){const[d,p]=u;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&$5.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 Q5(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 Uo(e,i.position);else{const c=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 Uo(e,i.position);else u=r.value===null?!0:r.value;a[c]=u}return a}function Sg(e,i){const a=[];let r=-1;const c=e.passKeys?new Map:I5;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=c.get(h)||0;d=h+"-"+g,c.set(h,g+1)}}const p=Bk(e,u,d);p!==void 0&&a.push(p)}return a}function W5(e,i,a){const r=S5(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?p5(a):j5(a)),r.property==="style"){let c=typeof a=="object"?a:J5(e,String(a));return e.stylePropertyNameCase==="css"&&(c=e3(c)),["style",c]}return[e.elementAttributeNameCase==="react"&&r.space?k5[r.property]||r.property:r.attribute,a]}}function J5(e,i){try{return z5(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,c=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw c.file=e.filePath||void 0,c.url=Uk+"#cannot-parse-style-attribute",c}}function Pk(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const c=i.split(".");let u=-1,d;for(;++u<c.length;){const p=z0(c[u])?{type:"Identifier",name:c[u]}:{type:"Literal",value:c[u]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(u&&p.type==="Literal"),optional:!1}:p}r=d}else r=z0(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const c=r.value;return Ng.call(e.components,c)?e.components[c]:c}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uo(e)}function Uo(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=Uk+"#cannot-handle-mdx-estrees-without-createevaluater",a}function e3(e){const i={};let a;for(a in e)Ng.call(e,a)&&(i[t3(a)]=e[a]);return i}function t3(e){let i=e.replace(U5,n3);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function n3(e){return"-"+e.toLowerCase()}const Mm={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"]},i3={};function _g(e,i){const a=i3,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,c=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Hk(e,r,c)}function Hk(e,i,a){if(a3(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 G0(e.children,i,a)}return Array.isArray(e)?G0(e,i,a):""}function G0(e,i,a){const r=[];let c=-1;for(;++c<e.length;)r[c]=Hk(e[c],i,a);return r.join("")}function a3(e){return!!(e&&typeof e=="object")}const Y0=document.createElement("i");function Tg(e){const i="&"+e+";";Y0.innerHTML=i;const a=Y0.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Ui(e,i,a,r){const c=e.length;let u=0,d;if(i<0?i=-i>c?0:c+i:i=i>c?c: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 wi(e,i){return e.length>0?(Ui(e,e.length,0,i),e):i}const V0={}.hasOwnProperty;function Fk(e){const i={};let a=-1;for(;++a<e.length;)r3(i,e[a]);return i}function r3(e,i){let a;for(a in i){const c=(V0.call(e,a)?e[a]:void 0)||(e[a]={}),u=i[a];let d;if(u)for(d in u){V0.call(c,d)||(c[d]=[]);const p=u[d];s3(c[d],Array.isArray(p)?p:p?[p]:[])}}}function s3(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Ui(e,0,0,r)}function qk(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 Bi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pn=kr(/[A-Za-z]/),On=kr(/[\dA-Za-z]/),l3=kr(/[#-'*+\--9=?A-Z^-~]/);function td(e){return e!==null&&(e<32||e===127)}const Oh=kr(/\d/),o3=kr(/[\dA-Fa-f]/),c3=kr(/[!-/:-@[-`{-~]/);function Ge(e){return e!==null&&e<-2}function It(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const Od=kr(/\p{P}|\p{S}/u),ts=kr(/\s/);function kr(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function yl(e){const i=[];let a=-1,r=0,c=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&On(e.charCodeAt(a+1))&&On(e.charCodeAt(a+2)))c=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),c=1):d="�"}else d=String.fromCharCode(u);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+c+1,d=""),c&&(a+=c,c=0)}return i.join("")+e.slice(r)}function bt(e,i,a,r){const c=r?r-1:1/0;let u=0;return d;function d(h){return st(h)?(e.enter(a),p(h)):i(h)}function p(h){return st(h)&&u++<c?(e.consume(h),p):(e.exit(a),i(h))}}function Gk(e,i,a,r,c,u){let d=0;return p;function p(b){return st(b)?(e.enter(r),h(b)):g(b)}function h(b){return st(b)&&d<u?(e.consume(b),d++,h):(e.exit(r),g(b))}function g(b){return d>=c?i(b):a(b)}}const u3={tokenize:d3};function d3(e){const i=e.attempt(this.parser.constructs.contentInitial,r,c);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 c(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 Ge(p)?(e.consume(p),e.exit("chunkText"),u):(e.consume(p),d)}}let nd=class{constructor(){this.index=new Map,this.map=[]}add(i,a,r){K0(this,i,a,r,!1)}addBefore(i,a,r){K0(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 c=r.pop();for(;c;){for(const u of c)i.push(u);c=r.pop()}this.map.length=0,this.index.clear()}};function K0(e,i,a,r,c){if(a===0&&r.length===0)return;const u=e.index.get(i);if(u){u[1]+=a,c?(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 f3={tokenize:p3},X0={tokenize:m3};function p3(e){const i=this,a=[];let r=0,c,u,d;return p;function p(T){if(r<a.length){const R=a[r];return i.containerState=R[1],e.attempt(R[0].continuation,h,g)(T)}return g(T)}function h(T){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,c&&A();const R=i.events.length;let P=R,z;for(;P--;)if(i.events[P][0]==="exit"&&i.events[P][1].type==="chunkFlow"){z=i.events[P][1].end;break}E(r);let C=R;for(;C<i.events.length;)i.events[C][1].end={...z},C++;const L=new nd;return L.add(P+1,0,i.events.slice(R)),L.add(R,C-R,[]),L.consume(i.events),g(T)}return p(T)}function g(T){if(r===a.length){if(!c)return v(T);if(c.currentConstruct&&c.currentConstruct.concrete)return k(T);i.interrupt=!!(c.currentConstruct&&!c._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(X0,b,x)(T)}function b(T){return c&&A(),E(r),v(T)}function x(T){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,k(T)}function v(T){return i.containerState={},e.attempt(X0,y,k)(T)}function y(T){return r++,a.push([i.currentConstruct,i.containerState]),v(T)}function k(T){if(T===null){c&&A(),E(0),e.consume(T);return}return c=c||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:c,contentType:"flow",previous:u}),S(T)}function S(T){if(T===null){j(e.exit("chunkFlow"),!0),E(0),e.consume(T);return}return Ge(T)?(e.consume(T),j(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(T),S)}function j(T,R){const P=i.sliceStream(T);if(R&&P.push(null),T.previous=u,u&&(u.next=T),u=T,c.defineSkip(T.start),c.write(P),i.parser.lazy[T.start.line]){let z=c.events.length;for(;z--;)if(c.events[z][1].start.offset<d&&(!c.events[z][1].end||c.events[z][1].end.offset>d))return;const C=i.events.length;let L=C,G,O;for(;L--;)if(i.events[L][0]==="exit"&&i.events[L][1].type==="chunkFlow"){if(G){O=i.events[L][1].end;break}G=!0}for(E(r),z=C;z<i.events.length;)i.events[z][1].end={...O},z++;const $=new nd;$.add(L+1,0,i.events.slice(C)),$.add(C,z-C,[]),$.consume(i.events)}}function E(T){let R=a.length;for(;R-- >T;){const P=a[R];i.containerState=P[1],P[0].exit.call(i,e)}a.length=T}function A(){c.write([null]),u=void 0,c=void 0,i.containerState._closeFlow=void 0}}function m3(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 id(e){if(e===null||It(e)||ts(e))return 1;if(Od(e))return 2}function Md(e,i,a){const r=[];let c=-1;for(;++c<e.length;){const u=e[c].resolveAll;u&&!r.includes(u)&&(i=u(i,a),r.push(u))}return i}const Mh={name:"attention",resolveAll:h3,tokenize:g3};function h3(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 c=a;for(;c--;)if(e[c][0]==="exit"&&e[c][1].type==="attentionSequence"&&e[c][1]._open&&i.sliceSerialize(e[c][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[c][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[c][1].end.offset-e[c][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;const u=e[c][1].end.offset-e[c][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1,d={...e[c][1].end},p={...e[a][1].start};Z0(d,-u),Z0(p,u);const h={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[c][1].end}},g={type:u>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},b={type:u>1?"strongText":"emphasisText",start:{...e[c][1].end},end:{...e[a][1].start}},x={type:u>1?"strong":"emphasis",start:{...h.start},end:{...g.end}};e[c][1].end={...h.start},e[a][1].start={...g.end},r=[],e[c][1].end.offset-e[c][1].start.offset&&(r=wi(r,[["enter",e[c][1],i],["exit",e[c][1],i]])),r=wi(r,[["enter",x,i],["enter",h,i],["exit",h,i],["enter",b,i]]),r=wi(r,Md(i.parser.constructs.insideSpan.null,e.slice(c+1,a),i)),r=wi(r,[["exit",b,i],["enter",g,i],["exit",g,i],["exit",x,i]]);let v=0;e[a][1].end.offset-e[a][1].start.offset&&(v=2,r=wi(r,[["enter",e[a][1],i],["exit",e[a][1],i]])),Ui(e,c-1,a-c+3,r),a=c+r.length-v-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function g3(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,c=id(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"),b=id(h),x=!b||b===2&&c||a.includes(h)&&h!==42&&h!==95,v=!c||c===2&&b||a.includes(r)&&r!==42&&r!==95;return g._open=!!(u===42?x:x&&(c||!v)),g._close=!!(u===42?v:v&&(b||!x)),i(h)}}function Z0(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const x3={name:"autolink",tokenize:b3};function b3(e,i,a){let r=0;return c;function c(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(y){return Pn(y)?(e.consume(y),d):y===64?a(y):g(y)}function d(y){return y===43||y===45||y===46||On(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||On(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||td(y)?a(y):(e.consume(y),h)}function g(y){return y===64?(e.consume(y),b):l3(y)?(e.consume(y),g):a(y)}function b(y){return On(y)?x(y):a(y)}function x(y){return y===46?(e.consume(y),r=0,b):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||On(y))&&r++<63){const k=y===45?v:x;return e.consume(y),k}return a(y)}}const qo={partial:!0,tokenize:y3};function y3(e,i,a){return r;function r(u){return st(u)?bt(e,c,"linePrefix")(u):c(u)}function c(u){return u===null||Ge(u)?i(u):a(u)}}const Yk={continuation:{tokenize:w3},exit:k3,name:"blockQuote",tokenize:v3};function v3(e,i,a){const r=this;return c;function c(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 st(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function w3(e,i,a){const r=this;return c;function c(d){return st(d)?bt(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Yk,i,a)(d)}}function k3(e){e.exit("blockQuote")}const Vk={name:"characterEscape",tokenize:N3};function N3(e,i,a){return r;function r(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),c}function c(u){return c3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(u)}}const Kk={name:"characterReference",tokenize:E3};function E3(e,i,a){const r=this;let c=0,u,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),h}function h(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),g):(e.enter("characterReferenceValue"),u=31,d=On,b(x))}function g(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=o3,b):(e.enter("characterReferenceValue"),u=7,d=Oh,b(x))}function b(x){if(x===59&&c){const v=e.exit("characterReferenceValue");return d===On&&!Tg(r.sliceSerialize(v))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&c++<u?(e.consume(x),b):a(x)}}const Rh={partial:!0,tokenize:S3};function S3(e,i,a){const r=this;return c;function c(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 Q0={concrete:!0,name:"codeFenced",tokenize:_3};function _3(e,i,a){const r=this,c={partial:!0,tokenize:P};let u=0,d=0,p;return h;function h(z){return g(z)}function g(z){const C=r.events[r.events.length-1];return u=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,p=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(z)}function b(z){return z===p?(d++,e.consume(z),b):d<3?a(z):(e.exit("codeFencedFenceSequence"),st(z)?bt(e,x,"whitespace")(z):x(z))}function x(z){return z===null||Ge(z)?(e.exit("codeFencedFence"),r.interrupt?i(z):e.check(Rh,S,R)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(z))}function v(z){return z===null||Ge(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(z)):st(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),bt(e,y,"whitespace")(z)):z===96&&z===p?a(z):(e.consume(z),v)}function y(z){return z===null||Ge(z)?x(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||Ge(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(z)):z===96&&z===p?a(z):(e.consume(z),k)}function S(z){return e.attempt(c,R,j)(z)}function j(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),E}function E(z){return u>0&&st(z)?bt(e,A,"linePrefix",u+1)(z):A(z)}function A(z){return z===null||Ge(z)?e.check(Rh,S,R)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ge(z)?(e.exit("codeFlowValue"),A(z)):(e.consume(z),T)}function R(z){return e.exit("codeFenced"),i(z)}function P(z,C,L){let G=0;return O;function O(te){return z.enter("lineEnding"),z.consume(te),z.exit("lineEnding"),$}function $(te){return z.enter("codeFencedFence"),st(te)?bt(z,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):Z(te)}function Z(te){return te===p?(z.enter("codeFencedFenceSequence"),fe(te)):L(te)}function fe(te){return te===p?(G++,z.consume(te),fe):G>=d?(z.exit("codeFencedFenceSequence"),st(te)?bt(z,re,"whitespace")(te):re(te)):L(te)}function re(te){return te===null||Ge(te)?(z.exit("codeFencedFence"),C(te)):L(te)}}}const Rm={name:"codeIndented",tokenize:C3},T3={partial:!0,tokenize:j3};function C3(e,i,a){return r;function r(p){return e.enter("codeIndented"),Gk(e,c,a,"linePrefix",4,4)(p)}function c(p){return p===null?d(p):Ge(p)?e.attempt(T3,c,d)(p):(e.enter("codeFlowValue"),u(p))}function u(p){return p===null||Ge(p)?(e.exit("codeFlowValue"),c(p)):(e.consume(p),u)}function d(p){return e.exit("codeIndented"),i(p)}}function j3(e,i,a){const r=this;return c;function c(d){return r.parser.lazy[r.now().line]?a(d):Ge(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):Gk(e,i,u,"linePrefix",4,4)(d)}function u(d){return Ge(d)?c(d):a(d)}}const A3={name:"codeText",previous:M3,resolve:O3,tokenize:R3};function O3(e){let i=e.length-4,a=3,r,c;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;)c===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(c=r):(r===i||e[r][1].type==="lineEnding")&&(e[c][1].type="codeTextData",r!==c+2&&(e[c][1].end=e[r-1][1].end,e.splice(c+2,r-c-2),i-=r-c-2,r=c+2),c=void 0);return e}function M3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function R3(e,i,a){let r=0,c,u;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),h(x))}function h(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),h):x===96?(u=e.enter("codeTextSequence"),c=0,b(x)):Ge(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("codeTextData"),g(x))}function g(x){return x===null||x===32||x===96||Ge(x)?(e.exit("codeTextData"),h(x)):(e.consume(x),g)}function b(x){return x===96?(e.consume(x),c++,b):c===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(u.type="codeTextData",g(x))}}class D3{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 c=a||0;this.setCursor(Math.trunc(i));const u=this.right.splice(this.right.length-c,Number.POSITIVE_INFINITY);return r&&vo(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),vo(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),vo(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);vo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);vo(this.left,a.reverse())}}}function vo(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 Xk(e){const i={};let a=-1,r,c,u,d,p,h,g;const b=new D3(e);for(;++a<b.length;){for(;a in i;)a=i[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.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,z3(b,a)),a=i[a],g=!0);else if(r[1]._container){for(u=a,c=void 0;u--;)if(d=b.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(c&&(b.get(c)[1].type="lineEndingBlank"),d[1].type="lineEnding",c=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;c&&(r[1].end={...b.get(c)[1].start},p=b.slice(c,a),p.unshift(r),b.splice(c,a-c+1,p))}}return Ui(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!g}function z3(e,i){const a=e.get(i)[1],r=e.get(i)[2];let c=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 b,x,v=-1,y=a,k=0,S=0;const j=[S];for(;y;){for(;e.get(++c)[1]!==y;);u.push(c),y._tokenizer||(b=r.sliceStream(y),y.next||b.push(null),x&&d.defineSkip(y.start),y._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),y._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=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&&(S=v+1,j.push(S),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(d.events=[],y?(y._tokenizer=void 0,y.previous=void 0):j.pop(),v=j.length;v--;){const E=p.slice(j[v],j[v+1]),A=u.pop();h.push([A,A+E.length-1]),e.splice(A,2,E)}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 L3={resolve:U3,tokenize:B3},I3={partial:!0,tokenize:$3};function U3(e){return Xk(e),e}function B3(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),c(p)}function c(p){return p===null?u(p):Ge(p)?e.check(I3,d,u)(p):(e.consume(p),c)}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,c}}function $3(e,i,a){const r=this;return c;function c(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),bt(e,u,"linePrefix")}function u(d){if(d===null||Ge(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 Zk(e,i,a,r,c,u,d,p,h){const g=h||Number.POSITIVE_INFINITY;let b=0;return x;function x(E){return E===60?(e.enter(r),e.enter(c),e.enter(u),e.consume(E),e.exit(u),v):E===null||E===32||E===41||td(E)?a(E):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),S(E))}function v(E){return E===62?(e.enter(u),e.consume(E),e.exit(u),e.exit(c),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===62?(e.exit("chunkString"),e.exit(p),v(E)):E===null||E===60||Ge(E)?a(E):(e.consume(E),E===92?k:y)}function k(E){return E===60||E===62||E===92?(e.consume(E),y):y(E)}function S(E){return!b&&(E===null||E===41||It(E))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(E)):b<g&&E===40?(e.consume(E),b++,S):E===41?(e.consume(E),b--,S):E===null||E===32||E===40||td(E)?a(E):(e.consume(E),E===92?j:S)}function j(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function Qk(e,i,a,r,c,u){const d=this;let p=0,h;return g;function g(y){return e.enter(r),e.enter(c),e.consume(y),e.exit(c),e.enter(u),b}function b(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(c),e.consume(y),e.exit(c),e.exit(r),i):Ge(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(y))}function x(y){return y===null||y===91||y===93||Ge(y)||p++>999?(e.exit("chunkString"),b(y)):(e.consume(y),h||(h=!st(y)),y===92?v:x)}function v(y){return y===91||y===92||y===93?(e.consume(y),p++,x):x(y)}}function Wk(e,i,a,r,c,u){let d;return p;function p(v){return v===34||v===39||v===40?(e.enter(r),e.enter(c),e.consume(v),e.exit(c),d=v===40?41:v,h):a(v)}function h(v){return v===d?(e.enter(c),e.consume(v),e.exit(c),e.exit(r),i):(e.enter(u),g(v))}function g(v){return v===d?(e.exit(u),h(d)):v===null?a(v):Ge(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),bt(e,g,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===d||v===null||Ge(v)?(e.exit("chunkString"),g(v)):(e.consume(v),v===92?x:b)}function x(v){return v===d||v===92?(e.consume(v),b):b(v)}}function Oo(e,i){let a;return r;function r(c){return Ge(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a=!0,r):st(c)?bt(e,r,a?"linePrefix":"lineSuffix")(c):i(c)}}const P3={name:"definition",tokenize:F3},H3={partial:!0,tokenize:q3};function F3(e,i,a){const r=this;let c;return u;function u(y){return e.enter("definition"),d(y)}function d(y){return Qk.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function p(y){return c=Bi(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 It(y)?Oo(e,g)(y):g(y)}function g(y){return Zk(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function b(y){return e.attempt(H3,x,x)(y)}function x(y){return st(y)?bt(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Ge(y)?(e.exit("definition"),r.parser.defined.push(c),i(y)):a(y)}}function q3(e,i,a){return r;function r(p){return It(p)?Oo(e,c)(p):a(p)}function c(p){return Wk(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function u(p){return st(p)?bt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Ge(p)?i(p):a(p)}}const G3={name:"hardBreakEscape",tokenize:Y3};function Y3(e,i,a){return r;function r(u){return e.enter("hardBreakEscape"),e.consume(u),c}function c(u){return Ge(u)?(e.exit("hardBreakEscape"),i(u)):a(u)}}const V3={name:"headingAtx",resolve:K3,tokenize:X3};function K3(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 c={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"};Ui(e,r,a-r+1,[["enter",c,i],["enter",u,i],["exit",u,i],["exit",c,i]])}return e}function X3(e,i,a){let r=0;return c;function c(b){return e.enter("atxHeading"),u(b)}function u(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(e.consume(b),d):b===null||It(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),h(b)):b===null||Ge(b)?(e.exit("atxHeading"),i(b)):st(b)?bt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),g(b))}function h(b){return b===35?(e.consume(b),h):(e.exit("atxHeadingSequence"),p(b))}function g(b){return b===null||b===35||It(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),g)}}const Z3=["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"],W0=["pre","script","style","textarea"],Q3={concrete:!0,name:"htmlFlow",resolveTo:J3,tokenize:eR},W3={partial:!0,tokenize:tR};function J3(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 eR(e,i,a){const r=this;let c,u,d,p,h;return g;function g(D){return b(D)}function b(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),x}function x(D){return D===33?(e.consume(D),v):D===47?(e.consume(D),u=!0,S):D===63?(e.consume(D),c=3,r.interrupt?i:_):Pn(D)?(e.consume(D),d=String.fromCharCode(D),j):a(D)}function v(D){return D===45?(e.consume(D),c=2,y):D===91?(e.consume(D),c=5,p=0,k):Pn(D)?(e.consume(D),c=4,r.interrupt?i:_):a(D)}function y(D){return D===45?(e.consume(D),r.interrupt?i:_):a(D)}function k(D){const B="CDATA[";return D===B.charCodeAt(p++)?(e.consume(D),p===B.length?r.interrupt?i:Z:k):a(D)}function S(D){return Pn(D)?(e.consume(D),d=String.fromCharCode(D),j):a(D)}function j(D){if(D===null||D===47||D===62||It(D)){const B=D===47,se=d.toLowerCase();return!B&&!u&&W0.includes(se)?(c=1,r.interrupt?i(D):Z(D)):Z3.includes(d.toLowerCase())?(c=6,B?(e.consume(D),E):r.interrupt?i(D):Z(D)):(c=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(D):u?A(D):T(D))}return D===45||On(D)?(e.consume(D),d+=String.fromCharCode(D),j):a(D)}function E(D){return D===62?(e.consume(D),r.interrupt?i:Z):a(D)}function A(D){return st(D)?(e.consume(D),A):O(D)}function T(D){return D===47?(e.consume(D),O):D===58||D===95||Pn(D)?(e.consume(D),R):st(D)?(e.consume(D),T):O(D)}function R(D){return D===45||D===46||D===58||D===95||On(D)?(e.consume(D),R):P(D)}function P(D){return D===61?(e.consume(D),z):st(D)?(e.consume(D),P):T(D)}function z(D){return D===null||D===60||D===61||D===62||D===96?a(D):D===34||D===39?(e.consume(D),h=D,C):st(D)?(e.consume(D),z):L(D)}function C(D){return D===h?(e.consume(D),h=null,G):D===null||Ge(D)?a(D):(e.consume(D),C)}function L(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||It(D)?P(D):(e.consume(D),L)}function G(D){return D===47||D===62||st(D)?T(D):a(D)}function O(D){return D===62?(e.consume(D),$):a(D)}function $(D){return D===null||Ge(D)?Z(D):st(D)?(e.consume(D),$):a(D)}function Z(D){return D===45&&c===2?(e.consume(D),M):D===60&&c===1?(e.consume(D),ae):D===62&&c===4?(e.consume(D),ve):D===63&&c===3?(e.consume(D),_):D===93&&c===5?(e.consume(D),xe):Ge(D)&&(c===6||c===7)?(e.exit("htmlFlowData"),e.check(W3,ce,fe)(D)):D===null||Ge(D)?(e.exit("htmlFlowData"),fe(D)):(e.consume(D),Z)}function fe(D){return e.check(Rh,re,ce)(D)}function re(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),te}function te(D){return D===null||Ge(D)?fe(D):(e.enter("htmlFlowData"),Z(D))}function M(D){return D===45?(e.consume(D),_):Z(D)}function ae(D){return D===47?(e.consume(D),d="",ne):Z(D)}function ne(D){if(D===62){const B=d.toLowerCase();return W0.includes(B)?(e.consume(D),ve):Z(D)}return Pn(D)&&d.length<8?(e.consume(D),d+=String.fromCharCode(D),ne):Z(D)}function xe(D){return D===93?(e.consume(D),_):Z(D)}function _(D){return D===62?(e.consume(D),ve):D===45&&c===2?(e.consume(D),_):Z(D)}function ve(D){return D===null||Ge(D)?(e.exit("htmlFlowData"),ce(D)):(e.consume(D),ve)}function ce(D){return e.exit("htmlFlow"),i(D)}}function tR(e,i,a){return r;function r(c){return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),e.attempt(qo,i,a)}}const nR={name:"htmlText",tokenize:iR};function iR(e,i,a){const r=this;let c,u,d;return p;function p(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),h}function h(_){return _===33?(e.consume(_),g):_===47?(e.consume(_),P):_===63?(e.consume(_),T):Pn(_)?(e.consume(_),L):a(_)}function g(_){return _===45?(e.consume(_),b):_===91?(e.consume(_),u=0,k):Pn(_)?(e.consume(_),A):a(_)}function b(_){return _===45?(e.consume(_),y):a(_)}function x(_){return _===null?a(_):_===45?(e.consume(_),v):Ge(_)?(d=x,ae(_)):(e.consume(_),x)}function v(_){return _===45?(e.consume(_),y):x(_)}function y(_){return _===62?M(_):_===45?v(_):x(_)}function k(_){const ve="CDATA[";return _===ve.charCodeAt(u++)?(e.consume(_),u===ve.length?S:k):a(_)}function S(_){return _===null?a(_):_===93?(e.consume(_),j):Ge(_)?(d=S,ae(_)):(e.consume(_),S)}function j(_){return _===93?(e.consume(_),E):S(_)}function E(_){return _===62?M(_):_===93?(e.consume(_),E):S(_)}function A(_){return _===null||_===62?M(_):Ge(_)?(d=A,ae(_)):(e.consume(_),A)}function T(_){return _===null?a(_):_===63?(e.consume(_),R):Ge(_)?(d=T,ae(_)):(e.consume(_),T)}function R(_){return _===62?M(_):T(_)}function P(_){return Pn(_)?(e.consume(_),z):a(_)}function z(_){return _===45||On(_)?(e.consume(_),z):C(_)}function C(_){return Ge(_)?(d=C,ae(_)):st(_)?(e.consume(_),C):M(_)}function L(_){return _===45||On(_)?(e.consume(_),L):_===47||_===62||It(_)?G(_):a(_)}function G(_){return _===47?(e.consume(_),M):_===58||_===95||Pn(_)?(e.consume(_),O):Ge(_)?(d=G,ae(_)):st(_)?(e.consume(_),G):M(_)}function O(_){return _===45||_===46||_===58||_===95||On(_)?(e.consume(_),O):$(_)}function $(_){return _===61?(e.consume(_),Z):Ge(_)?(d=$,ae(_)):st(_)?(e.consume(_),$):G(_)}function Z(_){return _===null||_===60||_===61||_===62||_===96?a(_):_===34||_===39?(e.consume(_),c=_,fe):Ge(_)?(d=Z,ae(_)):st(_)?(e.consume(_),Z):(e.consume(_),re)}function fe(_){return _===c?(e.consume(_),c=void 0,te):_===null?a(_):Ge(_)?(d=fe,ae(_)):(e.consume(_),fe)}function re(_){return _===null||_===34||_===39||_===60||_===61||_===96?a(_):_===47||_===62||It(_)?G(_):(e.consume(_),re)}function te(_){return _===47||_===62||It(_)?G(_):a(_)}function M(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),i):a(_)}function ae(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ne}function ne(_){return st(_)?bt(e,xe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):xe(_)}function xe(_){return e.enter("htmlTextData"),d(_)}}const Cg={name:"labelEnd",resolveAll:lR,resolveTo:oR,tokenize:cR},aR={tokenize:uR},rR={tokenize:dR},sR={tokenize:fR};function lR(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 c=r.type==="labelImage"?4:2;r.type="data",i+=c}}return e.length!==a.length&&Ui(e,0,e.length,a),e}function oR(e,i){let a=e.length,r=0,c,u,d;for(;a--;){const b=e[a][1];if(c){if(b.type==="link"||b.type==="labelLink"&&b._inactive)break;e[a][0]==="enter"&&b.type==="labelLink"&&(b._inactive=!0)}else if(u){if(e[a][0]==="enter"&&(b.type==="labelImage"||b.type==="labelLink")&&!b._balanced&&(c=a,b.type!=="labelLink")){r=2;break}}else b.type==="labelEnd"&&(u=a)}const p={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[c][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",p,i],["enter",h,i]],d=wi(d,e.slice(c+1,c+r+3)),d=wi(d,[["enter",g,i]]),d=wi(d,Md(i.parser.constructs.insideSpan.null,e.slice(c+r+4,u-3),i)),d=wi(d,[["exit",g,i],e[u-2],e[u-1],["exit",h,i]]),d=wi(d,e.slice(u+1)),d=wi(d,[["exit",p,i]]),Ui(e,c,e.length,d),e}function cR(e,i,a){const r=this,c=r._labelStarts;let u,d;if(c){for(;c.length>0&&c[c.length-1]._balanced;)c.pop();u=c[c.length-1]}return p;function p(v){return u?u._inactive?x(v):(d=r.parser.defined.includes(Bi(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(aR,b,d?b:x)(v):v===91?e.attempt(rR,b,d?g:x)(v):d?b(v):x(v)}function g(v){return e.attempt(sR,b,x)(v)}function b(v){return c.pop(),i(v)}function x(v){return u._balanced=!0,a(v)}}function uR(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),c}function c(x){return It(x)?Oo(e,u)(x):u(x)}function u(x){return x===41?b(x):Zk(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return It(x)?Oo(e,h)(x):b(x)}function p(x){return a(x)}function h(x){return x===34||x===39||x===40?Wk(e,g,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function g(x){return It(x)?Oo(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function dR(e,i,a){const r=this;return c;function c(p){return Qk.call(r,e,u,d,"reference","referenceMarker","referenceString")(p)}function u(p){return r.parser.defined.includes(Bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function fR(e,i,a){return r;function r(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),c}function c(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),i):a(u)}}const pR={name:"labelStartImage",resolveAll:Cg.resolveAll,tokenize:mR};function mR(e,i,a){const r=this;let c;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"),c=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(c),i(h))}}const hR={name:"labelStartLink",resolveAll:Cg.resolveAll,tokenize:gR};function gR(e,i,a){const r=this;let c;return u;function u(p){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),c=e.exit("labelLink"),d}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(c),i(p))}}const Dm={name:"lineEnding",tokenize:xR};function xR(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),bt(e,i,"linePrefix")}}const Bu={name:"thematicBreak",tokenize:bR};function bR(e,i,a){let r=0,c;return u;function u(g){return e.enter("thematicBreak"),d(g)}function d(g){return c=g,p(g)}function p(g){return g===c?(e.enter("thematicBreakSequence"),h(g)):r>=3&&(g===null||Ge(g))?(e.exit("thematicBreak"),i(g)):a(g)}function h(g){return g===c?(e.consume(g),r++,h):(e.exit("thematicBreakSequence"),st(g)?bt(e,p,"whitespace")(g):p(g))}}const Zn={continuation:{tokenize:kR},exit:ER,name:"list",tokenize:wR},yR={partial:!0,tokenize:SR},vR={partial:!0,tokenize:NR};function wR(e,i,a){const r=this,c=r.events[r.events.length-1];let u=c&&c[1].type==="linePrefix"?c[2].sliceSerialize(c[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:Oh(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(Bu,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 Oh(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(qo,r.interrupt?a:b,e.attempt(yR,v,x))}function b(y){return r.containerState.initialBlankLine=!0,u++,v(y)}function x(y){return st(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 kR(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(qo,c,u);function c(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||!st(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(vR,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 NR(e,i,a){const r=this;return bt(e,c,"listItemIndent",r.containerState.size+1);function c(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 ER(e){e.exit(this.containerState.type)}function SR(e,i,a){const r=this;return bt(e,c,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function c(u){const d=r.events[r.events.length-1];return!st(u)&&d&&d[1].type==="listItemPrefixWhitespace"?i(u):a(u)}}const J0={name:"setextUnderline",resolveTo:_R,tokenize:TR};function _R(e,i){const a=new nd;let r=e.length,c,u,d;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){c=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[c][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[c][1],i]]),e[c][1].end={...e[d][1].end}):e[c][1]=p,a.add(e.length,0,[["exit",p,i]]),a.consume(e),e}function TR(e,i,a){const r=this;let c;return u;function u(g){let b=r.events.length,x;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){x=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||x)?(e.enter("setextHeadingLine"),c=g,d(g)):a(g)}function d(g){return e.enter("setextHeadingLineSequence"),p(g)}function p(g){return g===c?(e.consume(g),p):(e.exit("setextHeadingLineSequence"),st(g)?bt(e,h,"lineSuffix")(g):h(g))}function h(g){return g===null||Ge(g)?(e.exit("setextHeadingLine"),i(g)):a(g)}}const CR={tokenize:jR};function jR(e){const i=this,a=e.attempt(qo,r,e.attempt(this.parser.constructs.flowInitial,c,bt(e,e.attempt(this.parser.constructs.flow,c,e.attempt(L3,c)),"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 c(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const AR={resolveAll:eN()},OR=Jk("string"),MR=Jk("text");function Jk(e){return{resolveAll:eN(e==="text"?RR:void 0),tokenize:i};function i(a){const r=this,c=this.parser.constructs[e],u=a.attempt(c,d,p);return d;function d(b){return g(b)?u(b):p(b)}function p(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),h}function h(b){return g(b)?(a.exit("data"),u(b)):(a.consume(b),h)}function g(b){if(b===null)return!0;const x=c[b];let v=-1;if(x)for(;++v<x.length;){const y=x[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function eN(e){return i;function i(a,r){let c=-1,u;for(;++c<=a.length;)u===void 0?a[c]&&a[c][1].type==="data"&&(u=c,c++):(!a[c]||a[c][1].type!=="data")&&(c!==u+2&&(a[u][1].end=a[c-1][1].end,a.splice(u+2,c-u-2),c=u+2),u=void 0);return e?e(a,r):a}}function RR(e,i){const a=new nd;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const c=e[r-1][1],u=i.sliceStream(c);let d=u.length,p=-1,h=0,g;for(;d--;){const b=u[d];if(typeof b=="string"){for(p=b.length;b.charCodeAt(p-1)===32;)h++,p--;if(p)break;p=-1}else if(b===-2)g=!0,h++;else if(b!==-1){d++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(h=0),h){const b={type:r===e.length||g||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?p:c.start._bufferIndex+p,_index:c.start._index+d,line:c.end.line,column:c.end.column-h,offset:c.end.offset-h},end:{...c.end}};c.end={...b.start},c.start.offset===c.end.offset?Object.assign(c,b):a.add(r,0,[["enter",b,i],["exit",b,i]])}r++}return a.consume(e),e}const DR={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:Yk},zR={91:P3},LR={[-2]:Rm,[-1]:Rm,32:Rm},IR={35:V3,42:Bu,45:[J0,Bu],60:Q3,61:J0,95:Bu,96:Q0,126:Q0},UR={38:Kk,92:Vk},BR={[-5]:Dm,[-4]:Dm,[-3]:Dm,33:pR,38:Kk,42:Mh,60:[x3,nR],91:hR,92:[G3,Vk],93:Cg,95:Mh,96:A3},$R={null:[Mh,AR]},PR={null:[42,95]},HR={null:[]},FR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PR,contentInitial:zR,disable:HR,document:DR,flow:IR,flowInitial:LR,insideSpan:$R,string:UR,text:BR},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 c={},u=[];let d=[],p=[];const h={attempt:C(P),check:C(z),consume:A,enter:T,exit:R,interrupt:C(z,{interrupt:!0})},g={code:null,containerState:{},defineSkip:S,events:[],now:k,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:x};let b=i.tokenize.call(g,h);return i.resolveAll&&u.push(i),g;function x($){return d=wi(d,$),j(),d[d.length-1]!==null?[]:(L(i,0),g.events=Md(u,g.events,g),g.events)}function v($,Z){return YR(y($),Z)}function y($){return GR(d,$)}function k(){const{_bufferIndex:$,_index:Z,line:fe,column:re,offset:te}=r;return{_bufferIndex:$,_index:Z,line:fe,column:re,offset:te}}function S($){c[$.line]=$.column,O()}function j(){for(;r._index<d.length;){const $=d[r._index];if(typeof $=="string"){const Z=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===Z&&r._bufferIndex<$.length;)E($.charCodeAt(r._bufferIndex))}else E($)}}function E($){b=b($)}function A($){Ge($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,O()):$!==-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 T($,Z){const fe=Z||{};return fe.type=$,fe.start=k(),g.events.push(["enter",fe,g]),p.push(fe),fe}function R($){const Z=p.pop();return Z.end=k(),g.events.push(["exit",Z,g]),Z}function P($,Z){L($,Z.from)}function z($,Z){Z.restore()}function C($,Z){return fe;function fe(re,te,M){let ae,ne,xe,_;return Array.isArray(re)?ce(re):"tokenize"in re?ce([re]):ve(re);function ve(pe){return Ee;function Ee(Le){const Pe=Le!==null&&pe[Le],Fe=Le!==null&&pe.null,Se=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return ce(Se)(Le)}}function ce(pe){return ae=pe,ne=0,pe.length===0?M:D(pe[ne])}function D(pe){return Ee;function Ee(Le){return _=G(),xe=pe,pe.partial||(g.currentConstruct=pe),pe.name&&g.parser.constructs.disable.null.includes(pe.name)?se():pe.tokenize.call(Z?Object.assign(Object.create(g),Z):g,h,B,se)(Le)}}function B(pe){return $(xe,_),te}function se(pe){return _.restore(),++ne<ae.length?D(ae[ne]):M}}}function L($,Z){$.resolveAll&&!u.includes($)&&u.push($),$.resolve&&Ui(g.events,Z,g.events.length-Z,$.resolve(g.events.slice(Z),g)),$.resolveTo&&(g.events=$.resolveTo(g.events,g))}function G(){const $=k(),Z=g.previous,fe=g.currentConstruct,re=g.events.length,te=Array.from(p);return{from:re,restore:M};function M(){r=$,g.previous=Z,g.currentConstruct=fe,g.events.length=re,p=te,O()}}function O(){r.line in c&&r.column<2&&(r.column=c[r.line],r.offset+=c[r.line]-1)}}function GR(e,i){const a=i.start._index,r=i.start._bufferIndex,c=i.end._index,u=i.end._bufferIndex;let d;if(a===c)d=[e[a].slice(r,u)];else{if(d=e.slice(a,c),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}u>0&&d.push(e[c].slice(0,u))}return d}function YR(e,i){let a=-1;const r=[];let c;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=`
|
|
212
|
+
`;break}case-3:{d=`\r
|
|
213
|
+
`;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&c)continue;d=" ";break}default:d=String.fromCharCode(u)}c=u===-2,r.push(d)}return r.join("")}function VR(e){const r={constructs:Fk([FR,...(e||{}).extensions||[]]),content:c(u3),defined:[],document:c(f3),flow:c(CR),lazy:{},string:c(OR),text:c(MR)};return r;function c(u){return d;function d(p){return qR(r,u,p)}}}function KR(e){for(;!Xk(e););return e}const ev=/[\0\t\n\r]/g;function XR(){let e=1,i="",a=!0,r;return c;function c(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;){ev.lastIndex=g;const b=ev.exec(u),x=b&&b.index!==void 0?b.index:u.length,v=u.charCodeAt(x);if(!b){i=u.slice(g);break}if(v===10&&g===x&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),g<x&&(h.push(u.slice(g,x)),e+=x-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=x+1}return p&&(r&&h.push(-5),i&&h.push(i),h.push(null)),h}}const ZR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function QR(e){return e.replace(ZR,WR)}function WR(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const c=a.charCodeAt(1),u=c===120||c===88;return qk(a.slice(u?2:1),u?16:10)}return Tg(a)||e}const tN={}.hasOwnProperty;function JR(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),e4(a)(KR(VR(a).document().write(XR()(e,i,!0))))}function e4(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(fn),autolinkProtocol:O,autolinkEmail:O,atxHeading:d(Oe),blockQuote:d(Se),characterEscape:O,characterReference:O,codeFenced:d(H),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:d(H,p),codeText:d(K,p),codeTextData:O,data:O,codeFlowValue:O,definition:d(be),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:d(je),hardBreakEscape:d(ot),hardBreakTrailing:d(ot),htmlFlow:d(Ve,p),htmlFlowData:O,htmlText:d(Ve,p),htmlTextData:O,image:d(jt),label:p,link:d(fn),listItem:d(ue),listItemValue:y,listOrdered:d($t,v),listUnordered:d($t),paragraph:d(qe),reference:B,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:d(Oe),strong:d(ht),thematicBreak:d(on)},exit:{atxHeading:g(),atxHeadingSequence:z,autolink:g(),autolinkEmail:Fe,autolinkProtocol:Pe,blockQuote:g(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:Ee,characterReference:Le,codeFenced:g(E),codeFencedFence:j,codeFencedFenceInfo:k,codeFencedFenceMeta:S,codeFlowValue:$,codeIndented:g(A),codeText:g(M),codeTextData:$,data:$,definition:g(),definitionDestinationString:P,definitionLabelString:T,definitionTitleString:R,emphasis:g(),hardBreakEscape:g(fe),hardBreakTrailing:g(fe),htmlFlow:g(re),htmlFlowData:$,htmlText:g(te),htmlTextData:$,image:g(ne),label:_,labelText:xe,lineEnding:Z,link:g(ae),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:se,resourceDestinationString:ve,resourceTitleString:ce,resource:D,setextHeading:g(G),setextHeadingLineSequence:L,setextHeadingText:C,strong:g(),thematicBreak:g()}};nN(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ie){let we={type:"root",children:[],position:void 0};const He={stack:[we],tokenStack:[],config:i,enter:h,exit:b,buffer:p,resume:x,data:a},Qe=[],Zt=[];let Et=-1;for(;++Et<ie.length;)if(Zt.push(ie[Et]),ie[Et][1].type==="listOrdered"||ie[Et][1].type==="listUnordered")if(ie[Et][0]==="enter")Qe.push(Zt.length-1);else{const cn=Qe.pop();u(Zt,cn)}for(ie=Zt,Et=-1;++Et<ie.length;){const cn=i[ie[Et][0]];ie[Et][0]==="enter"&&i.beforeEnter.length>0&&c(i.beforeEnter,{...He,sliceSerialize:ie[Et][2].sliceSerialize},ie[Et][1]),tN.call(cn,ie[Et][1].type)&&cn[ie[Et][1].type].call({...He,sliceSerialize:ie[Et][2].sliceSerialize},ie[Et][1]),ie[Et][0]==="exit"&&i.afterExit.length>0&&c(i.afterExit,{...He,sliceSerialize:ie[Et][2].sliceSerialize},ie[Et][1])}if(He.tokenStack.length>0){const cn=He.tokenStack[He.tokenStack.length-1];(cn[1]||tv).call(He,void 0,cn[0])}for(we.position={start:hr(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:hr(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Et=-1;++Et<i.transforms.length;)we=i.transforms[Et](we)||we;return we}function c(ie,we,He){let Qe=-1;for(;++Qe<ie.length;)ie[Qe].call(we,He)}function u(ie,we){const He=ie.length-1;let Qe=we-1,Zt=-1,Et=!1,cn,yn,Ni,Ei;const oa=[];for(;++Qe<=He;){const pn=ie[Qe];switch(pn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pn[0]==="enter"?Zt++:Zt--,Ei=void 0;break}case"lineEndingBlank":{pn[0]==="enter"&&(cn&&!Ei&&!Zt&&!Ni&&(Ni=Qe),Ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ei=void 0}if(!Zt&&pn[0]==="enter"&&pn[1].type==="listItemPrefix"||Zt===-1&&pn[0]==="exit"&&(pn[1].type==="listUnordered"||pn[1].type==="listOrdered")){if(cn){let Si=Qe;for(yn=void 0;Si--;){const zn=ie[Si];if(zn[1].type==="lineEnding"||zn[1].type==="lineEndingBlank"){if(zn[0]==="exit")continue;yn&&(ie[yn][1].type="lineEndingBlank",Et=!0),zn[1].type="lineEnding",yn=Si}else if(!(zn[1].type==="linePrefix"||zn[1].type==="blockQuotePrefix"||zn[1].type==="blockQuotePrefixWhitespace"||zn[1].type==="blockQuoteMarker"||zn[1].type==="listItemIndent"))break}Ni&&(!yn||Ni<yn)&&(cn._spread=!0),cn.end=Object.assign({},yn?ie[yn][1].start:pn[1].end),oa.push({at:yn||Qe,event:["exit",cn,pn[2]]})}if(pn[1].type==="listItemPrefix"){const Si={type:"listItem",_spread:!1,start:Object.assign({},pn[1].start),end:void 0};cn=Si,oa.push({at:Qe,event:["enter",Si,pn[2]]}),Ni=void 0,Ei=!0}}}const za=ie.splice(we);let Qt=0;for(Qe=-1;++Qe<za.length;){for(;Qt<oa.length&&oa[Qt].at===we+Qe;)ie.push(oa[Qt++].event);ie.push(za[Qe])}ie[we][1]._spread=Et}function d(ie,we){return He;function He(Qe){h.call(this,ie(Qe),Qe),we&&we.call(this,Qe)}}function p(){this.stack.push({type:"fragment",children:[]})}function h(ie,we,He){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([we,He||void 0]),ie.position={start:hr(we.start),end:void 0}}function g(ie){return we;function we(He){ie&&ie.call(this,He),b.call(this,He)}}function b(ie,we){const He=this.stack.pop(),Qe=this.tokenStack.pop();if(!Qe)throw new Error("Cannot close `"+ie.type+"` ("+Ao({start:ie.start,end:ie.end})+"): it’s not open");Qe[0].type!==ie.type&&(we?we.call(this,ie,Qe[0]):(Qe[1]||tv).call(this,ie,Qe[0])),He.position.end=hr(ie.end)}function x(){return _g(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function y(ie){if(this.data.expectingFirstListItemValue){const we=this.stack[this.stack.length-2];we.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function k(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.lang=ie}function S(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.meta=ie}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.value=ie.replace(/(\r?\n|\r)$/g,"")}function T(ie){const we=this.resume(),He=this.stack[this.stack.length-1];He.label=we,He.identifier=Bi(this.sliceSerialize(ie)).toLowerCase()}function R(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.title=ie}function P(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.url=ie}function z(ie){const we=this.stack[this.stack.length-1];if(!we.depth){const He=this.sliceSerialize(ie).length;we.depth=He}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function L(ie){const we=this.stack[this.stack.length-1];we.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function O(ie){const He=this.stack[this.stack.length-1].children;let Qe=He[He.length-1];(!Qe||Qe.type!=="text")&&(Qe=xt(),Qe.position={start:hr(ie.start),end:void 0},He.push(Qe)),this.stack.push(Qe)}function $(ie){const we=this.stack.pop();we.value+=this.sliceSerialize(ie),we.position.end=hr(ie.end)}function Z(ie){const we=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=we.children[we.children.length-1];He.position.end=hr(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(we.type)&&(O.call(this,ie),$.call(this,ie))}function fe(){this.data.atHardBreak=!0}function re(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.value=ie}function te(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.value=ie}function M(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.value=ie}function ae(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=we,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ne(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=we,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function xe(ie){const we=this.sliceSerialize(ie),He=this.stack[this.stack.length-2];He.label=QR(we),He.identifier=Bi(we).toLowerCase()}function _(){const ie=this.stack[this.stack.length-1],we=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const Qe=ie.children;He.children=Qe}else He.alt=we}function ve(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.url=ie}function ce(){const ie=this.resume(),we=this.stack[this.stack.length-1];we.title=ie}function D(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function se(ie){const we=this.resume(),He=this.stack[this.stack.length-1];He.label=we,He.identifier=Bi(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function pe(ie){this.data.characterReferenceType=ie.type}function Ee(ie){const we=this.sliceSerialize(ie),He=this.data.characterReferenceType;let Qe;He?(Qe=qk(we,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Qe=Tg(we);const Zt=this.stack[this.stack.length-1];Zt.value+=Qe}function Le(ie){const we=this.stack.pop();we.position.end=hr(ie.end)}function Pe(ie){$.call(this,ie);const we=this.stack[this.stack.length-1];we.url=this.sliceSerialize(ie)}function Fe(ie){$.call(this,ie);const we=this.stack[this.stack.length-1];we.url="mailto:"+this.sliceSerialize(ie)}function Se(){return{type:"blockquote",children:[],position:void 0}}function H(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function K(){return{type:"inlineCode",value:"",position:void 0}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function je(){return{type:"emphasis",children:[],position:void 0}}function Oe(){return{type:"heading",depth:0,children:[],position:void 0}}function ot(){return{type:"break",position:void 0}}function Ve(){return{type:"html",value:"",position:void 0}}function jt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function fn(){return{type:"link",title:null,url:"",children:[],position:void 0}}function $t(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[],position:void 0}}function ue(ie){return{type:"listItem",spread:ie._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 on(){return{type:"thematicBreak",position:void 0}}}function hr(e){return{line:e.line,column:e.column,offset:e.offset}}function nN(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?nN(e,r):t4(e,r)}}function t4(e,i){let a;for(a in i)if(tN.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 tv(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Ao({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Ao({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Ao({start:i.start,end:i.end})+") is still open")}function n4(e){const i=this;i.parser=a;function a(r){return JR(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function i4(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 a4(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
214
|
+
`}]}function r4(e,i){const a=i.value?i.value+`
|
|
215
|
+
`:"",r={},c=i.lang?i.lang.split(/\s+/):[];c.length>0&&(r.className=["language-"+c[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 s4(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function l4(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function o4(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),c=yl(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-"+c,id:a+"fnref-"+c+(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 c4(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 u4(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function iN(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 c=e.all(i),u=c[0];u&&u.type==="text"?u.value="["+u.value:c.unshift({type:"text",value:"["});const d=c[c.length-1];return d&&d.type==="text"?d.value+=r:c.push({type:"text",value:r}),c}function d4(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return iN(e,i);const c={src:yl(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(c.title=r.title);const u={type:"element",tagName:"img",properties:c,children:[]};return e.patch(i,u),e.applyData(i,u)}function f4(e,i){const a={src:yl(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 p4(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 m4(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return iN(e,i);const c={href:yl(r.url||"")};r.title!==null&&r.title!==void 0&&(c.title=r.title);const u={type:"element",tagName:"a",properties:c,children:e.all(i)};return e.patch(i,u),e.applyData(i,u)}function h4(e,i){const a={href:yl(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 g4(e,i,a){const r=e.all(i),c=a?x4(a):aN(i),u={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.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 b=r[p];(c||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
|
|
216
|
+
`}),b.type==="element"&&b.tagName==="p"&&!c?d.push(...b.children):d.push(b)}const h=r[r.length-1];h&&(c||h.type!=="element"||h.tagName!=="p")&&d.push({type:"text",value:`
|
|
217
|
+
`});const g={type:"element",tagName:"li",properties:u,children:d};return e.patch(i,g),e.applyData(i,g)}function x4(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=aN(a[r])}return i}function aN(e){const i=e.spread;return i??e.children.length>1}function b4(e,i){const a={},r=e.all(i);let c=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++c<r.length;){const d=r[c];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 y4(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function v4(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function w4(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function k4(e,i){const a=e.all(i),r=a.shift(),c=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),c.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=kg(i.children[1]),h=Lk(i.children[i.children.length-1]);p&&h&&(d.position={start:p,end:h}),c.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(c,!0)};return e.patch(i,u),e.applyData(i,u)}function N4(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 x=i.children[h],v={},y=d?d[h]:void 0;y&&(v.align=y);let k={type:"element",tagName:u,properties:v,children:[]};x&&(k.children=e.all(x),e.patch(x,k),k=e.applyData(x,k)),g.push(k)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(i,b),e.applyData(i,b)}function E4(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const nv=9,iv=32;function S4(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),c=0;const u=[];for(;r;)u.push(av(i.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=a.exec(i);return u.push(av(i.slice(c),c>0,!1)),u.join("")}function av(e,i,a){let r=0,c=e.length;if(i){let u=e.codePointAt(r);for(;u===nv||u===iv;)r++,u=e.codePointAt(r)}if(a){let u=e.codePointAt(c-1);for(;u===nv||u===iv;)c--,u=e.codePointAt(c-1)}return c>r?e.slice(r,c):""}function _4(e,i){const a={type:"text",value:S4(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function T4(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const C4={blockquote:i4,break:a4,code:r4,delete:s4,emphasis:l4,footnoteReference:o4,heading:c4,html:u4,imageReference:d4,image:f4,inlineCode:p4,linkReference:m4,link:h4,listItem:g4,list:b4,paragraph:y4,root:v4,strong:w4,table:k4,tableCell:E4,tableRow:N4,text:_4,thematicBreak:T4,toml:wu,yaml:wu,definition:wu,footnoteDefinition:wu};function wu(){}const rN=-1,Rd=0,Mo=1,ad=2,jg=3,Ag=4,Og=5,Mg=6,sN=7,lN=8,{defineProperty:j4}=Object,oN=typeof self=="object"?self:globalThis,rv=(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 oN[e](i)},A4=(e,i)=>{const a=(c,u)=>(e.set(u,c),c),r=c=>{if(e.has(c))return e.get(c);const[u,d]=i[c];switch(u){case Rd:case rN:return a(d,c);case Mo:{const p=a([],c);for(const h of d)p.push(r(h));return p}case ad:{const p=a({},c);for(const[h,g]of d){const b=r(h),x=r(g);b==="__proto__"?j4(p,b,{value:x,configurable:!0,enumerable:!0,writable:!0}):p[b]=x}return p}case jg:return a(new Date(d),c);case Ag:{const{source:p,flags:h}=d;return a(new RegExp(p,h),c)}case Og:{const p=a(new Map,c);for(const[h,g]of d)p.set(r(h),r(g));return p}case Mg:{const p=a(new Set,c);for(const h of d)p.add(r(h));return p}case sN:{const{name:p,message:h}=d;return a(typeof oN[p]=="function"?rv(p,h):new Error(h),c)}case lN:return a(BigInt(d),c);case"BigInt":return a(Object(BigInt(d)),c);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(rv(u,d),c)};return r},sv=e=>A4(new Map,e)(0),Kr="",{toString:O4}={},{keys:M4,is:R4}=Object,wo=e=>{const i=typeof e;if(i!=="object"||!e)return[Rd,i];const a=O4.call(e).slice(8,-1);switch(a){case"Array":return[Mo,Kr];case"Object":return[ad,Kr];case"Date":return[jg,Kr];case"RegExp":return[Ag,Kr];case"Map":return[Og,Kr];case"Set":return[Mg,Kr];case"DataView":return[Mo,a]}return a.includes("Array")?[Mo,a]:e instanceof Error?[sN,e.name||"Error"]:[ad,a]},ku=([e,i])=>e===Rd&&(i==="function"||i==="symbol"),D4=(e,i,a,r)=>{const c=(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]=wo(d);switch(p){case Rd:{let b=d;switch(h){case"bigint":p=lN,b=d.toString();break;case"number":if(!d&&R4(d,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);b=null;break;case"undefined":return c([rN],d)}return c([p,b],d)}case Mo:{if(h){let v=d;return h==="DataView"?v=new Uint8Array(d.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(d)),c([h,[...v]],d)}const b=[],x=c([p,b],d);for(const v of d)b.push(u(v));return x}case ad:{if(h)switch(h){case"BigInt":return c([h,d.toString()],d);case"Boolean":case"Number":case"String":return c([h,d.valueOf()],d)}if(i&&"toJSON"in d)return u(d.toJSON());const b=[],x=c([p,b],d);for(const v of M4(d))(e||!ku(wo(d[v])))&&b.push([u(v),u(d[v])]);return x}case jg:return c([p,isNaN(d.getTime())?Kr:d.toISOString()],d);case Ag:{const{source:b,flags:x}=d;return c([p,{source:b,flags:x}],d)}case Og:{const b=[],x=c([p,b],d);for(const[v,y]of d)(e||!(ku(wo(v))||ku(wo(y))))&&b.push([u(v),u(y)]);return x}case Mg:{const b=[],x=c([p,b],d);for(const v of d)(e||!ku(wo(v)))&&b.push(u(v));return x}}const{message:g}=d;return c([p,{name:h,message:g}],d)};return u},lv=(e,{json:i,lossy:a}={})=>{const r=[];return D4(!(i||a),!!i,new Map,r)(e),r},rd=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?sv(lv(e,i)):structuredClone(e):(e,i)=>sv(lv(e,i));function z4(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 L4(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function I4(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||z4,r=e.options.footnoteBackLabel||L4,c=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 b=e.all(g),x=String(g.identifier).toUpperCase(),v=yl(x.toLowerCase());let y=0;const k=[],S=e.footnoteCounts.get(x);for(;S!==void 0&&++y<=S;){k.length>0&&k.push({type:"text",value:" "});let A=typeof a=="string"?a:a(h,y);typeof A=="string"&&(A={type:"text",value:A}),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(A)?A:[A]})}const j=b[b.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const A=j.children[j.children.length-1];A&&A.type==="text"?A.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...k)}else b.push(...k);const E={type:"element",tagName:"li",properties:{id:i+"fn-"+v},children:e.wrap(b,!0)};e.patch(g,E),p.push(E)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...rd(d),id:"footnote-label"},children:[{type:"text",value:c}]},{type:"text",value:`
|
|
218
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
|
|
219
|
+
`}]}}const Go=(function(e){if(e==null)return P4;if(typeof e=="function")return Dd(e);if(typeof e=="object")return Array.isArray(e)?U4(e):B4(e);if(typeof e=="string")return $4(e);throw new Error("Expected function, string, or object as test")});function U4(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=Go(e[a]);return Dd(r);function r(...c){let u=-1;for(;++u<i.length;)if(i[u].apply(this,c))return!0;return!1}}function B4(e){const i=e;return Dd(a);function a(r){const c=r;let u;for(u in e)if(c[u]!==i[u])return!1;return!0}}function $4(e){return Dd(i);function i(a){return a&&a.type===e}}function Dd(e){return i;function i(a,r,c){return!!(H4(a)&&e.call(this,a,typeof r=="number"?r:void 0,c||void 0))}}function P4(){return!0}function H4(e){return e!==null&&typeof e=="object"&&"type"in e}const cN=[],F4=!0,Dh=!1,q4="skip";function uN(e,i,a,r){let c;typeof i=="function"&&typeof a!="function"?(r=a,a=i):c=i;const u=Go(c),d=r?-1:1;p(e,void 0,[])();function p(h,g,b){const x=h&&typeof h=="object"?h:{};if(typeof x.type=="string"){const y=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=cN,k,S,j;if((!i||u(h,g,b[b.length-1]||void 0))&&(y=G4(a(h,b)),y[0]===Dh))return y;if("children"in h&&h.children){const E=h;if(E.children&&y[0]!==q4)for(S=(r?E.children.length:-1)+d,j=b.concat(E);S>-1&&S<E.children.length;){const A=E.children[S];if(k=p(A,S,j)(),k[0]===Dh)return k;S=typeof k[1]=="number"?k[1]:S+d}}return y}}}function G4(e){return Array.isArray(e)?e:typeof e=="number"?[F4,e]:e==null?cN:[e]}function zd(e,i,a,r){let c,u,d;typeof i=="function"&&typeof a!="function"?(u=void 0,d=i,c=a):(u=i,d=a,c=r),uN(e,u,p,c);function p(h,g){const b=g[g.length-1],x=b?b.children.indexOf(h):void 0;return d(h,x,b)}}const zh={}.hasOwnProperty,Y4={};function V4(e,i){const a=i||Y4,r=new Map,c=new Map,u=new Map,d={...C4,...a.handlers},p={all:g,applyData:X4,definitionById:r,footnoteById:c,footnoteCounts:u,footnoteOrder:[],handlers:d,one:h,options:a,patch:K4,wrap:Q4};return zd(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:c,v=String(b.identifier).toUpperCase();x.has(v)||x.set(v,b)}}),p;function h(b,x){const v=b.type,y=p.handlers[v];if(zh.call(p.handlers,v)&&y)return y(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(v)){if("children"in b){const{children:S,...j}=b,E=rd(j);return E.children=p.all(b),E}return rd(b)}return(p.options.unknownHandler||Z4)(p,b,x)}function g(b){const x=[];if("children"in b){const v=b.children;let y=-1;for(;++y<v.length;){const k=p.one(v[y],b);if(k){if(y&&v[y-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=ov(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=ov(S.value))}Array.isArray(k)?x.push(...k):x.push(k)}}}return x}}function K4(e,i){e.position&&(i.position=L5(e))}function X4(e,i){let a=i;if(e&&e.data){const r=e.data.hName,c=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,rd(u)),"children"in a&&a.children&&c!==null&&c!==void 0&&(a.children=c)}return a}function Z4(e,i){const a=i.data||{},r="value"in i&&!(zh.call(a,"hProperties")||zh.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 Q4(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
220
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
221
|
+
`}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
|
|
222
|
+
`}),a}function ov(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function cv(e,i){const a=V4(e,i),r=a.one(e,void 0),c=I4(a),u=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return c&&u.children.push({type:"text",value:`
|
|
223
|
+
`},c),u}function W4(e,i){return e&&"run"in e?async function(a,r){const c=cv(a,{file:r,...i});await e.run(c,r)}:function(a,r){return cv(a,{file:r,...e||i})}}function uv(e){if(e)throw e}var zm,dv;function J4(){if(dv)return zm;dv=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,c=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 b=e.call(g,"constructor"),x=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!b&&!x)return!1;var v;for(v in g);return typeof v>"u"||e.call(g,v)},d=function(g,b){a&&b.name==="__proto__"?a(g,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):g[b.name]=b.newValue},p=function(g,b){if(b==="__proto__")if(e.call(g,b)){if(r)return r(g,b).value}else return;return g[b]};return zm=function h(){var g,b,x,v,y,k,S=arguments[0],j=1,E=arguments.length,A=!1;for(typeof S=="boolean"&&(A=S,S=arguments[1]||{},j=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});j<E;++j)if(g=arguments[j],g!=null)for(b in g)x=p(S,b),v=p(g,b),S!==v&&(A&&v&&(u(v)||(y=c(v)))?(y?(y=!1,k=x&&c(x)?x:[]):k=x&&u(x)?x:{},d(S,{name:b,newValue:h(A,k,v)})):typeof v<"u"&&d(S,{name:b,newValue:v}));return S},zm}var eD=J4();const Lm=cd(eD);function Lh(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 tD(){const e=[],i={run:a,use:r};return i;function a(...c){let u=-1;const d=c.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...c);function p(h,...g){const b=e[++u];let x=-1;if(h){d(h);return}for(;++x<c.length;)(g[x]===null||g[x]===void 0)&&(g[x]=c[x]);c=g,b?nD(b,p)(...g):d(null,...g)}}function r(c){if(typeof c!="function")throw new TypeError("Expected `middelware` to be a function, not "+c);return e.push(c),i}}function nD(e,i){let a;return r;function r(...d){const p=e.length>d.length;let h;p&&d.push(c);try{h=e.apply(this,d)}catch(g){const b=g;if(p&&a)throw b;return c(b)}p||(h&&h.then&&typeof h.then=="function"?h.then(u,c):h instanceof Error?c(h):u(h))}function c(d,...p){a||(a=!0,i(d,...p))}function u(d){c(null,d)}}const aa={basename:iD,dirname:aD,extname:rD,join:sD,sep:"/"};function iD(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Yo(e);let a=0,r=-1,c=e.length,u;if(i===void 0||i.length===0||i.length>e.length){for(;c--;)if(e.codePointAt(c)===47){if(u){a=c+1;break}}else r<0&&(u=!0,r=c+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;c--;)if(e.codePointAt(c)===47){if(u){a=c+1;break}}else d<0&&(u=!0,d=c+1),p>-1&&(e.codePointAt(c)===i.codePointAt(p--)?p<0&&(r=c):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function aD(e){if(Yo(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 rD(e){Yo(e);let i=e.length,a=-1,r=0,c=-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?c<0?c=i:u!==1&&(u=1):c>-1&&(u=-1)}return c<0||a<0||u===0||u===1&&c===a-1&&c===r+1?"":e.slice(c,a)}function sD(...e){let i=-1,a;for(;++i<e.length;)Yo(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":lD(a)}function lD(e){Yo(e);const i=e.codePointAt(0)===47;let a=oD(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function oD(e,i){let a="",r=0,c=-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(!(c===d-1||u===1))if(c!==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("/")),c=d,u=0;continue}}else if(a.length>0){a="",r=0,c=d,u=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(c+1,d):a=e.slice(c+1,d),r=d-c-1;c=d,u=0}else p===46&&u>-1?u++:u=-1}return a}function Yo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cD={cwd:uD};function uD(){return"/"}function Ih(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dD(e){if(typeof e=="string")e=new URL(e);else if(!Ih(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 fD(e)}function fD(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 c=new TypeError("File URL path must not include encoded / characters");throw c.code="ERR_INVALID_FILE_URL_PATH",c}}return decodeURIComponent(i)}const Im=["history","path","basename","stem","extname","dirname"];class dN{constructor(i){let a;i?Ih(i)?a={path:i}:typeof i=="string"||pD(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":cD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Im.length;){const u=Im[r];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let c;for(c in a)Im.includes(c)||(this[c]=a[c])}get basename(){return typeof this.path=="string"?aa.basename(this.path):void 0}set basename(i){Bm(i,"basename"),Um(i,"basename"),this.path=aa.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?aa.dirname(this.path):void 0}set dirname(i){fv(this.basename,"dirname"),this.path=aa.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?aa.extname(this.path):void 0}set extname(i){if(Um(i,"extname"),fv(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=aa.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Ih(i)&&(i=dD(i)),Bm(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?aa.basename(this.path,this.extname):void 0}set stem(i){Bm(i,"stem"),Um(i,"stem"),this.path=aa.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const c=this.message(i,a,r);throw c.fatal=!0,c}info(i,a,r){const c=this.message(i,a,r);return c.fatal=void 0,c}message(i,a,r){const c=new Dn(i,a,r);return this.path&&(c.name=this.path+":"+c.name,c.file=this.path),c.fatal=!1,this.messages.push(c),c}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Um(e,i){if(e&&e.includes(aa.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+aa.sep+"`")}function Bm(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function fv(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function pD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mD=(function(e){const r=this.constructor.prototype,c=r[e],u=function(){return c.apply(u,arguments)};return Object.setPrototypeOf(u,r),u}),hD={}.hasOwnProperty;class Rg extends mD{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=tD()}copy(){const i=new Rg;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(Lm(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(Hm("data",this.frozen),this.namespace[i]=a,this):hD.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Hm("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 c=a.call(i,...r);typeof c=="function"&&this.transformers.use(c)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=Nu(i),r=this.parser||this.Parser;return $m("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),$m("process",this.parser||this.Parser),Pm("process",this.compiler||this.Compiler),a?c(void 0,a):new Promise(c);function c(u,d){const p=Nu(i),h=r.parse(p);r.run(h,p,function(b,x,v){if(b||!x||!v)return g(b);const y=x,k=r.stringify(y,v);bD(k)?v.value=k:v.result=k,g(b,v)});function g(b,x){b||!x?d(b):u?u(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),$m("processSync",this.parser||this.Parser),Pm("processSync",this.compiler||this.Compiler),this.process(i,c),mv("processSync","process",a),r;function c(u,d){a=!0,uv(u),r=d}}run(i,a,r){pv(i),this.freeze();const c=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=Nu(a);c.run(i,h,g);function g(b,x,v){const y=x||i;b?p(b):d?d(y):r(void 0,y,v)}}}runSync(i,a){let r=!1,c;return this.run(i,a,u),mv("runSync","run",r),c;function u(d,p){uv(d),c=p,r=!0}}stringify(i,a){this.freeze();const r=Nu(a),c=this.compiler||this.Compiler;return Pm("stringify",c),pv(i),c(i,r)}use(i,...a){const r=this.attachers,c=this.namespace;if(Hm("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[b,...x]=g;h(b,x)}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&&(c.settings=Lm(!0,c.settings,g.settings))}function p(g){let b=-1;if(g!=null)if(Array.isArray(g))for(;++b<g.length;){const x=g[b];u(x)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function h(g,b){let x=-1,v=-1;for(;++x<r.length;)if(r[x][0]===g){v=x;break}if(v===-1)r.push([g,...b]);else if(b.length>0){let[y,...k]=b;const S=r[v][1];Lh(S)&&Lh(y)&&(y=Lm(!0,S,y)),r[v]=[g,y,...k]}}}}const gD=new Rg().freeze();function $m(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hm(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 pv(e){if(!Lh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function mv(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Nu(e){return xD(e)?e:new dN(e)}function xD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bD(e){return typeof e=="string"||yD(e)}function yD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hv=[],gv={allowDangerousHtml:!0},wD=/^(https?|ircs?|mailto|xmpp)$/i,kD=[{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 ND(e){const i=ED(e),a=SD(e);return _D(i.runSync(i.parse(a),a),e)}function ED(e){const i=e.rehypePlugins||hv,a=e.remarkPlugins||hv,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gv}:gv;return gD().use(n4).use(a).use(W4,r).use(i)}function SD(e){const i=e.children||"",a=new dN;return typeof i=="string"&&(a.value=i),a}function _D(e,i){const a=i.allowedElements,r=i.allowElement,c=i.components,u=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,h=i.urlTransform||TD;for(const b of kD)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+vD+b.id,void 0);return zd(e,g),P5(e,{Fragment:l.Fragment,components:c,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function g(b,x,v){if(b.type==="raw"&&v&&typeof x=="number")return d?v.children.splice(x,1):v.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let y;for(y in Mm)if(Object.hasOwn(Mm,y)&&Object.hasOwn(b.properties,y)){const k=b.properties[y],S=Mm[y];(S===null||S.includes(b.tagName))&&(b.properties[y]=h(String(k||""),y,b))}}if(b.type==="element"){let y=a?!a.includes(b.tagName):u?u.includes(b.tagName):!1;if(!y&&r&&typeof x=="number"&&(y=!r(b,x,v)),y&&v&&typeof x=="number")return p&&b.children?v.children.splice(x,1,...b.children):v.children.splice(x,1),x}}}function TD(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),c=e.indexOf("/");return i===-1||c!==-1&&i>c||a!==-1&&i>a||r!==-1&&i>r||wD.test(e.slice(0,i))?e:""}function xv(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,c=a.indexOf(i);for(;c!==-1;)r++,c=a.indexOf(i,c+i.length);return r}function CD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jD(e,i,a){const c=Go((a||{}).ignore||[]),u=AD(i);let d=-1;for(;++d<u.length;)uN(e,"text",p);function p(g,b){let x=-1,v;for(;++x<b.length;){const y=b[x],k=v?v.children:void 0;if(c(y,k?k.indexOf(y):void 0,v))return;v=y}if(v)return h(g,b)}function h(g,b){const x=b[b.length-1],v=u[d][0],y=u[d][1];let k=0;const j=x.children.indexOf(g);let E=!1,A=[];v.lastIndex=0;let T=v.exec(g.value);for(;T;){const P=T.index,z={index:T.index,input:T.input,stack:[...b,g]};let C=y(...T,z);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1)v.lastIndex=P+1;else{if(k!==P&&R({type:"text",value:g.value.slice(k,P)}),Array.isArray(C))for(const L of C)R(L);else C&&R(C);k=P+T[0].length,E=!0}if(!v.global)break;T=v.exec(g.value)}return E?(k<g.value.length&&R({type:"text",value:g.value.slice(k)}),x.children.splice(j,1,...A)):A=[g],j+A.length;function R(P){const z=A[A.length-1];z&&z.type==="text"&&P.type==="text"?z.value+=P.value:A.push(P)}}}function AD(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 c=a[r];i.push([OD(c[0]),MD(c[1])])}return i}function OD(e){return typeof e=="string"?new RegExp(CD(e),"g"):e}function MD(e){return typeof e=="function"?e:function(){return e}}const Fm="phrasing",qm=["autolink","link","image","label"];function RD(){return{transforms:[$D],enter:{literalAutolink:zD,literalAutolinkEmail:Gm,literalAutolinkHttp:Gm,literalAutolinkWww:Gm},exit:{literalAutolink:BD,literalAutolinkEmail:UD,literalAutolinkHttp:LD,literalAutolinkWww:ID}}}function DD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fm,notInConstruct:qm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fm,notInConstruct:qm},{character:":",before:"[ps]",after:"\\/",inConstruct:Fm,notInConstruct:qm}]}}function zD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gm(e){this.config.enter.autolinkProtocol.call(this,e)}function LD(e){this.config.exit.autolinkProtocol.call(this,e)}function ID(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 UD(e){this.config.exit.autolinkEmail.call(this,e)}function BD(e){this.exit(e)}function $D(e){jD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,PD],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,HD]],{ignore:["link","linkReference"]})}function PD(e,i,a,r,c){let u="";if(!fN(c)||(/^w/i.test(i)&&(a=i+a,i="",u="http://"),!FD(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 HD(e,i,a,r){return!fN(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function FD(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 c=xv(e,"(");let u=xv(e,")");for(;r!==-1&&c>u;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),u++;return[e,a]}function fN(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||ts(a)||Od(a))&&(!i||a!==47)}pN.peek=JD;function GD(){this.buffer()}function YD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VD(){this.buffer()}function KD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function XD(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Bi(this.sliceSerialize(e)).toLowerCase(),a.label=i}function ZD(e){this.exit(e)}function QD(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Bi(this.sliceSerialize(e)).toLowerCase(),a.label=i}function WD(e){this.exit(e)}function JD(){return"["}function pN(e,i,a,r){const c=a.createTracker(r);let u=c.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return u+=c.move(a.safe(a.associationId(e),{after:"]",before:u})),p(),d(),u+=c.move("]"),u}function ez(){return{enter:{gfmFootnoteCallString:GD,gfmFootnoteCall:YD,gfmFootnoteDefinitionLabelString:VD,gfmFootnoteDefinition:KD},exit:{gfmFootnoteCallString:XD,gfmFootnoteCall:ZD,gfmFootnoteDefinitionLabelString:QD,gfmFootnoteDefinition:WD}}}function tz(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:pN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,c,u,d){const p=u.createTracker(d);let h=p.move("[^");const g=u.enter("footnoteDefinition"),b=u.enter("label");return h+=p.move(u.safe(u.associationId(r),{before:h,after:"]"})),b(),h+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),h+=p.move((i?`
|
|
224
|
+
`:" ")+u.indentLines(u.containerFlow(r,p.current()),i?mN:nz))),g(),h}}function nz(e,i,a){return i===0?e:mN(e,i,a)}function mN(e,i,a){return(a?"":" ")+e}const iz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Dg.attention=oz;Dg.peek=cz;function az(){return{canContainEols:["delete"],enter:{strikethrough:sz},exit:{strikethrough:lz}}}function rz(){return{handlers:{delete:Dg},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:iz}]}}function sz(e){this.enter({type:"delete",children:[],position:void 0},e)}function lz(e){this.exit(e)}function Dg(e,i,a,r){const c=a.createTracker(r),u=a.stack.includes("strikethrough")?"~":"~~",d=a.enter("strikethrough");let p=c.move(u);return p+=a.containerPhrasing(e,{...c.current(),before:p,after:"~"}),p+=c.move(u),d(),p}function oz(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function cz(){return"~"}function uz(e){return e.length}function dz(e,i){const a=i||{},r=(a.align||[]).concat(),c=a.stringLength||uz,u=[],d=[],p=[],h=[];let g=0,b=-1;for(;++b<e.length;){const S=[],j=[];let E=-1;for(e[b].length>g&&(g=e[b].length);++E<e[b].length;){const A=fz(e[b][E]);if(a.alignDelimiters!==!1){const T=c(A);j[E]=T,(h[E]===void 0||T>h[E])&&(h[E]=T)}S.push(A)}d[b]=S,p[b]=j}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<g;)u[x]=bv(r[x]);else{const S=bv(r);for(;++x<g;)u[x]=S}x=-1;const v=[],y=[];for(;++x<g;){const S=u[x];let j="",E="";S===99?(j=":",E=":"):S===108?j=":":S===114&&(E=":");let A=a.alignDelimiters===!1?1:Math.max(1,h[x]-j.length-E.length);const T=j+"-".repeat(A)+E;a.alignDelimiters!==!1&&(A=j.length+A+E.length,A>h[x]&&(h[x]=A),y[x]=A),v[x]=T}d.splice(1,0,v),p.splice(1,0,y),b=-1;const k=[];for(;++b<d.length;){const S=d[b],j=p[b];x=-1;const E=[];for(;++x<g;){const A=S[x]||"";let T="",R="";if(a.alignDelimiters!==!1){const P=h[x]-(j[x]||0),z=u[x];z===114?T=" ".repeat(P):z===99?P%2?(T=" ".repeat(P/2+.5),R=" ".repeat(P/2-.5)):(T=" ".repeat(P/2),R=T):R=" ".repeat(P)}a.delimiterStart!==!1&&!x&&E.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&A==="")&&(a.delimiterStart!==!1||x)&&E.push(" "),a.alignDelimiters!==!1&&E.push(T),E.push(A),a.alignDelimiters!==!1&&E.push(R),a.padding!==!1&&E.push(" "),(a.delimiterEnd!==!1||x!==g-1)&&E.push("|")}k.push(a.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
225
|
+
`)}function fz(e){return e==null?"":String(e)}function bv(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 pz=Go(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mz(e,i,a,r){const c=a.enter("blockquote"),u=a.createTracker(r);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),hz);return c(),d}function hz(e,i,a){return">"+(a?"":" ")+e}function gz(e,i){return yv(e,i.inConstruct,!0)&&!yv(e,i.notInConstruct,!1)}function yv(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 vv(e,i,a,r){let c=-1;for(;++c<a.unsafe.length;){const u=a.unsafe[c];if(u.character===`
|
|
226
|
+
`&&!u.before&&!u.after&&gz(a.stack,u))return/[\t ]/.test(r.before)?"":" "}return`\\
|
|
227
|
+
`}function xz(e,i){const a=String(e);let r=a.indexOf(i),c=r,u=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===c?++u>d&&(d=u):u=1,c=r+i.length,r=a.indexOf(i,c);return d}function bz(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 yz(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 vz(e,i,a,r){const c=yz(a),u=e.value||"";if(bz(e,a)){const x=a.enter("codeIndented"),v=a.indentLines(u,wz);return x(),v}const d=a.createTracker(r),p=c.repeat(Math.max(xz(u,c)+1,3)),h=a.enter("codeFenced"),g=c==="`"?"GraveAccent":"Tilde";let b=d.move(p);if(e.lang){const x=a.enter(`codeFencedLang${g}`);b+=d.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...d.current()})),x()}if(e.lang&&e.meta){const x=a.enter(`codeFencedMeta${g}`);b+=d.move(" "),b+=d.move(a.safe(e.meta,{before:b,after:`
|
|
228
|
+
`,encode:["`"],...d.current()})),x()}return b+=d.move(`
|
|
229
|
+
`),u&&(b+=d.move(u+`
|
|
230
|
+
`)),b+=d.move(p),h(),b}function wz(e,i,a){return(a?"":" ")+e}function zg(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 kz(e,i,a,r){const c=zg(a),u=c==='"'?"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?" ":`
|
|
231
|
+
`,...h.current()}))),p(),e.title&&(p=a.enter(`title${u}`),g+=h.move(" "+c),g+=h.move(a.safe(e.title,{before:g,after:c,...h.current()})),g+=h.move(c),p()),d(),g}function Nz(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}Lg.attention=Ez;Lg.peek=Sz;function Lg(e,i,a,r){const c=a.enter("phrasing"),u=a.containerPhrasing({type:"root",children:[e]},r);return c(),u}function Ez(e,i){return{construct:"emphasis",markers:Nz(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function Sz(e,i,a){return a.options.emphasis||"*"}function _z(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Tz(e,i){let a=!1;return zd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Dh}),!!((!e.depth||e.depth<3)&&_g(e)&&(i.options.setext||a))}function Cz(e,i,a,r){const c=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(r);if(Tz(e,a)){const x=a.enter("headingSetext"),v=a.enter("phrasing"),y=a.containerPhrasing(e,{...u.current(),before:`
|
|
232
|
+
`,after:`
|
|
233
|
+
`});return v(),x(),y+`
|
|
234
|
+
`+(c===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
235
|
+
`))+1))}const d="#".repeat(c),p=a.enter("headingAtx"),h=a.enter("phrasing");u.move(d+" ");let g=a.containerPhrasing(e,{before:"# ",after:`
|
|
236
|
+
`,...u.current()});const b=g.charCodeAt(0);return(b===9||b===32)&&(g=_z(b)+g.slice(1)),g=g?d+" "+g:d,a.options.closeAtx&&(g+=" "+d),h(),p(),g}hN.peek=jz;function hN(e){return e.value||""}function jz(){return"<"}gN.peek=Az;function gN(e,i,a,r){const c=zg(a),u=c==='"'?"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(" "+c),g+=h.move(a.safe(e.title,{before:g,after:c,...h.current()})),g+=h.move(c),p()),g+=h.move(")"),d(),g}function Az(){return"!"}xN.peek=Oz;function xN(e,i,a,r){const c=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 b=a.stack;a.stack=b.filter(function(v){return v!=="phrasing"}),d=a.enter("reference");const x=a.safe(a.associationId(e),{before:h,after:"]",...p.current()});return d(),a.stack=b,u(),c==="full"||!g||g!==x?h+=p.move(x+"]"):c==="shortcut"?h=h.slice(0,-1):h+=p.move("]"),h}function Oz(){return"!"}bN.peek=Mz;function bN(e,i,a){let r=e.value||"",c="`",u=-1;for(;new RegExp("(^|[^`])"+c+"([^`]|$)").test(r);)c+="`";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 c+r+c}function Mz(){return"`"}function yN(e,i){const a=_g(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))}vN.peek=Rz;function vN(e,i,a,r){const c=zg(a),u=c==='"'?"Quote":"Apostrophe",d=a.createTracker(r);if(yN(e,a)){const b=a.stack;a.stack=b.filter(function(y){return y!=="phrasing"});const x=a.enter("autolink");let v=d.move("<");return v+=d.move(a.containerPhrasing(e,{before:v,after:">",...d.current()})),v+=d.move(">"),x(),a.stack=b,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(" "+c),g+=d.move(a.safe(e.title,{before:g,after:c,...d.current()})),g+=d.move(c),h()),g+=d.move(")"),p(),g}function Rz(e,i,a){return yN(e,a)?"<":"["}wN.peek=Dz;function wN(e,i,a,r){const c=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 b=a.stack;a.stack=b.filter(function(v){return v!=="phrasing"}),d=a.enter("reference");const x=a.safe(a.associationId(e),{before:h,after:"]",...p.current()});return d(),a.stack=b,u(),c==="full"||!g||g!==x?h+=p.move(x+"]"):c==="shortcut"?h=h.slice(0,-1):h+=p.move("]"),h}function Dz(){return"["}function Ig(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 zz(e){const i=Ig(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 Lz(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 kN(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 Iz(e,i,a,r){const c=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?Lz(a):Ig(a);const p=e.ordered?d==="."?")":".":zz(a);let h=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.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),kN(a)===d&&b){let x=-1;for(;++x<e.children.length;){const v=e.children[x];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,c(),g}function Uz(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 Bz(e,i,a,r){const c=Uz(a);let u=a.bulletCurrent||Ig(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;(c==="tab"||c==="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()),b);return h(),g;function b(x,v,y){return v?(y?"":" ".repeat(d))+x:(y?u:u+" ".repeat(d-u.length))+x}}function $z(e,i,a,r){const c=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,r);return u(),c(),d}function Pz(e,i,a,r){if(!e.children.some(function(p){return pz(p)}))return a.containerFlow(e,r);const u=a.enter("phrasing"),d=a.containerPhrasing(e,r);return u(),d}function Hz(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Ug.attention=Fz;Ug.peek=qz;function Ug(e,i,a,r){const c=a.enter("phrasing"),u=a.containerPhrasing({type:"root",children:[e]},r);return c(),u}function Fz(e,i){return{construct:"strong",markers:Hz(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function qz(e,i,a){return a.options.strong||"*"}function Gz(e,i,a,r){const c=i?i.children:[],u=c.indexOf(e);return a.safe(e.value,{...r,afterNode:c[u+1],beforeNode:c[u-1]})}function Yz(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 Vz(e,i,a){const r=(kN(a)+(a.options.ruleSpaces?" ":"")).repeat(Yz(a));return a.options.ruleSpaces?r.slice(0,-1):r}const NN={blockquote:mz,break:vv,code:vz,definition:kz,emphasis:Lg,hardBreak:vv,heading:Cz,html:hN,image:gN,imageReference:xN,inlineCode:bN,link:vN,linkReference:wN,list:Iz,listItem:Bz,paragraph:$z,root:Pz,strong:Ug,text:Gz,thematicBreak:Vz};function Kz(){return{enter:{table:Xz,tableData:wv,tableHeader:wv,tableRow:Qz},exit:{codeText:Wz,table:Zz,tableData:Ym,tableHeader:Ym,tableRow:Ym}}}function Xz(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 Zz(e){this.exit(e),this.data.inTable=void 0}function Qz(e){this.enter({type:"tableRow",children:[]},e)}function Ym(e){this.exit(e)}function wv(e){this.enter({type:"tableCell",children:[]},e)}function Wz(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,Jz));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function Jz(e,i){return i==="|"?i:e}function e6(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,c=i.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
237
|
+
`,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,j){return g(b(y,S,j),y.align)}function p(y,k,S,j){const E=x(y,S,j),A=g([E]);return A.slice(0,A.indexOf(`
|
|
238
|
+
`))}function h(y,k,S,j){const E=S.enter("tableCell"),A=S.enter("phrasing"),T=S.containerPhrasing(y,{...j,before:u,after:u});return A(),E(),T}function g(y,k){return dz(y,{align:k,alignDelimiters:r,padding:a,stringLength:c})}function b(y,k,S){const j=y.children;let E=-1;const A=[],T=k.enter("table");for(;++E<j.length;)A[E]=x(j[E],k,S);return T(),A}function x(y,k,S){const j=y.children;let E=-1;const A=[],T=k.enter("tableRow");for(;++E<j.length;)A[E]=h(j[E],y,k,S);return T(),A}function v(y,k,S){let j=NN.inlineCode(y,k,S);return S.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function t6(){return{exit:{taskListCheckValueChecked:kv,taskListCheckValueUnchecked:kv,paragraph:i6}}}function n6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:a6}}}function kv(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function i6(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 c=i.children;let u=-1,d;for(;++u<c.length;){const p=c[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 a6(e,i,a,r){const c=e.children[0],u=typeof e.checked=="boolean"&&c&&c.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);u&&p.move(d);let h=NN.listItem(e,i,a,{...r,...p.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),h;function g(b){return b+d}}function r6(){return[RD(),ez(),az(),Kz(),t6()]}function s6(e){return{extensions:[DD(),tz(e),rz(),e6(e),n6()]}}const l6={tokenize:p6,partial:!0},EN={tokenize:m6,partial:!0},SN={tokenize:h6,partial:!0},_N={tokenize:g6,partial:!0},o6={tokenize:x6,partial:!0},TN={name:"wwwAutolink",tokenize:d6,previous:jN},CN={name:"protocolAutolink",tokenize:f6,previous:AN},Da={name:"emailAutolink",tokenize:u6,previous:ON},la={};function c6(){return{text:la}}let Yr=48;for(;Yr<123;)la[Yr]=Da,Yr++,Yr===58?Yr=65:Yr===91&&(Yr=97);la[43]=Da;la[45]=Da;la[46]=Da;la[95]=Da;la[72]=[Da,CN];la[104]=[Da,CN];la[87]=[Da,TN];la[119]=[Da,TN];function u6(e,i,a){const r=this;let c,u;return d;function d(x){return!Uh(x)||!ON.call(r,r.previous)||Bg(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Uh(x)?(e.consume(x),p):x===64?(e.consume(x),h):a(x)}function h(x){return x===46?e.check(o6,b,g)(x):x===45||x===95||On(x)?(u=!0,e.consume(x),h):b(x)}function g(x){return e.consume(x),c=!0,h}function b(x){return u&&c&&Pn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function d6(e,i,a){const r=this;return c;function c(d){return d!==87&&d!==119||!jN.call(r,r.previous)||Bg(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l6,e.attempt(EN,e.attempt(SN,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function f6(e,i,a){const r=this;let c="",u=!1;return d;function d(x){return(x===72||x===104)&&AN.call(r,r.previous)&&!Bg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),c+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(Pn(x)&&c.length<5)return c+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const v=c.toLowerCase();if(v==="http"||v==="https")return e.consume(x),h}return a(x)}function h(x){return x===47?(e.consume(x),u?g:(u=!0,h)):a(x)}function g(x){return x===null||td(x)||It(x)||ts(x)||Od(x)?a(x):e.attempt(EN,e.attempt(SN,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function p6(e,i,a){let r=0;return c;function c(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),c):d===46&&r===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):i(d)}}function m6(e,i,a){let r,c,u;return d;function d(g){return g===46||g===95?e.check(_N,h,p)(g):g===null||It(g)||ts(g)||g!==45&&Od(g)?h(g):(u=!0,e.consume(g),d)}function p(g){return g===95?r=!0:(c=r,r=void 0),e.consume(g),d}function h(g){return c||r||!u?a(g):i(g)}}function h6(e,i){let a=0,r=0;return c;function c(d){return d===40?(a++,e.consume(d),c):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(_N,i,u)(d):d===null||It(d)||ts(d)?i(d):(e.consume(d),c)}function u(d){return d===41&&r++,e.consume(d),c}}function g6(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),c):p===60||p===null||It(p)||ts(p)?i(p):a(p)}function c(p){return p===null||p===40||p===91||It(p)||ts(p)?i(p):r(p)}function u(p){return Pn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):Pn(p)?(e.consume(p),d):a(p)}}function x6(e,i,a){return r;function r(u){return e.consume(u),c}function c(u){return On(u)?a(u):i(u)}}function jN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||It(e)}function AN(e){return!Pn(e)}function ON(e){return!(e===47||Uh(e))}function Uh(e){return e===43||e===45||e===46||e===95||On(e)}function Bg(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 b6={tokenize:_6,partial:!0};function y6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N6,continuation:{tokenize:E6},exit:S6}},text:{91:{name:"gfmFootnoteCall",tokenize:k6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:v6,resolveTo:w6}}}}function v6(e,i,a){const r=this;let c=r.events.length;const u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;c--;){const h=r.events[c][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=Bi(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 w6(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)},c={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};c.end.column++,c.end.offset++,c.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},c.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",c,i],["exit",c,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 k6(e,i,a){const r=this,c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),h}function h(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",g)}function g(x){if(u>999||x===93&&!d||x===null||x===91||It(x))return a(x);if(x===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return c.includes(Bi(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return It(x)||(d=!0),u++,e.consume(x),x===92?b:g}function b(x){return x===91||x===92||x===93?(e.consume(x),u++,g):g(x)}}function N6(e,i,a){const r=this,c=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",b):a(k)}function b(k){if(d>999||k===93&&!p||k===null||k===91||It(k))return a(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return u=Bi(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return It(k)||(p=!0),d++,e.consume(k),k===92?x:b}function x(k){return k===91||k===92||k===93?(e.consume(k),d++,b):b(k)}function v(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),c.includes(u)||c.push(u),bt(e,y,"gfmFootnoteDefinitionWhitespace")):a(k)}function y(k){return i(k)}}function E6(e,i,a){return e.check(qo,i,e.attempt(b6,i,a))}function S6(e){e.exit("gfmFootnoteDefinition")}function _6(e,i,a){const r=this;return bt(e,c,"gfmFootnoteDefinitionIndent",5);function c(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 T6(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:u,resolveAll:c};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function c(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 b={type:"strikethrough",start:Object.assign({},d[g][1].start),end:Object.assign({},d[h][1].end)},x={type:"strikethroughText",start:Object.assign({},d[g][1].end),end:Object.assign({},d[h][1].start)},v=[["enter",b,p],["enter",d[g][1],p],["exit",d[g][1],p],["enter",x,p]],y=p.parser.constructs.insideSpan.null;y&&Ui(v,v.length,0,Md(y,d.slice(g+1,h),p)),Ui(v,v.length,0,[["exit",x,p],["enter",d[h][1],p],["exit",d[h][1],p],["exit",b,p]]),Ui(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,b=this.events;let x=0;return v;function v(k){return g===126&&b[b.length-1][1].type!=="characterEscape"?h(k):(d.enter("strikethroughSequenceTemporary"),y(k))}function y(k){const S=id(g);if(k===126)return x>1?h(k):(d.consume(k),x++,y);if(x<2&&!a)return h(k);const j=d.exit("strikethroughSequenceTemporary"),E=id(k);return j._open=!E||E===2&&!!S,j._close=!S||S===2&&!!E,p(k)}}}class C6{constructor(){this.map=[],this.index=new Map}add(i,a,r){j6(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 c=r.pop();for(;c;){for(const u of c)i.push(u);c=r.pop()}this.map.length=0,this.index.clear()}}function j6(e,i,a,r){if(a===0&&r.length===0)return;const c=e.index.get(i);if(c){c[1]+=a,c[2].push(...r);return}const u=[i,a,r];e.map.push(u),e.index.set(i,u)}function A6(e,i){let a=!1;const r=[];for(;i<e.length;){const c=e[i];if(a){if(c[0]==="enter")c[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(c[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const u=r.length-1;r[u]=r[u]==="left"?"center":"right"}}else if(c[1].type==="tableDelimiterRow")break}else c[0]==="enter"&&c[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function O6(){return{flow:{null:{name:"table",tokenize:M6,resolveAll:R6}}}}function M6(e,i,a){const r=this;let c=0,u=0,d;return p;function p(O){let $=r.events.length-1;for(;$>-1;){const{type:re}=r.events[$][1];if(re==="lineEnding"||re==="linePrefix")$--;else break}const Z=$>-1?r.events[$][1].type:null,fe=Z==="tableHead"||Z==="tableRow"?z:h;return fe===z&&r.parser.lazy[r.now().line]?a(O):fe(O)}function h(O){return e.enter("tableHead"),e.enter("tableRow"),g(O)}function g(O){return O===124||(d=!0,u+=1),b(O)}function b(O){return O===null?a(O):Ge(O)?u>1?(u=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),y):a(O):st(O)?bt(e,b,"whitespace")(O):(u+=1,d&&(d=!1,c+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(O)))}function x(O){return O===null||O===124||It(O)?(e.exit("data"),b(O)):(e.consume(O),O===92?v:x)}function v(O){return O===92||O===124?(e.consume(O),x):x(O)}function y(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(O):(e.enter("tableDelimiterRow"),d=!1,st(O)?bt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):k(O))}function k(O){return O===45||O===58?j(O):O===124?(d=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):P(O)}function S(O){return st(O)?bt(e,j,"whitespace")(O):j(O)}function j(O){return O===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),E):O===45?(u+=1,E(O)):O===null||Ge(O)?R(O):P(O)}function E(O){return O===45?(e.enter("tableDelimiterFiller"),A(O)):P(O)}function A(O){return O===45?(e.consume(O),A):O===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(O))}function T(O){return st(O)?bt(e,R,"whitespace")(O):R(O)}function R(O){return O===124?k(O):O===null||Ge(O)?!d||c!==u?P(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(O)):P(O)}function P(O){return a(O)}function z(O){return e.enter("tableRow"),C(O)}function C(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),C):O===null||Ge(O)?(e.exit("tableRow"),i(O)):st(O)?bt(e,C,"whitespace")(O):(e.enter("data"),L(O))}function L(O){return O===null||O===124||It(O)?(e.exit("data"),C(O)):(e.consume(O),O===92?G:L)}function G(O){return O===92||O===124?(e.consume(O),L):L(O)}}function R6(e,i){let a=-1,r=!0,c=0,u=[0,0,0,0],d=[0,0,0,0],p=!1,h=0,g,b,x;const v=new C6;for(;++a<e.length;){const y=e[a],k=y[1];y[0]==="enter"?k.type==="tableHead"?(p=!1,h!==0&&(Nv(v,i,h,g,b),b=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,x=void 0,u=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(a,0,[["enter",b,i]])),c=k.type==="tableDelimiterRow"?2:b?3:1):c&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],x=Eu(v,i,u,c,void 0,x),u=[0,0,0,0]),d[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(u[1]!==0&&(d[0]=d[1],x=Eu(v,i,u,c,void 0,x)),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],x=Eu(v,i,u,c,a,x)):d[1]!==0&&(x=Eu(v,i,d,c,a,x)),c=0):c&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=a)}for(h!==0&&Nv(v,i,h,g,b),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=A6(i.events,a))}return e}function Eu(e,i,a,r,c,u){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(u.end=Object.assign({},nl(i.events,a[0])),e.add(a[0],0,[["exit",u,i]]));const h=nl(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=nl(i.events,a[2]),b=nl(i.events,a[3]),x={type:p,start:Object.assign({},g),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,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,S=a[3]-a[2]-1;e.add(k,S,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return c!==void 0&&(u.end=Object.assign({},nl(i.events,c)),e.add(c,0,[["exit",u,i]]),u=void 0),u}function Nv(e,i,a,r,c){const u=[],d=nl(i.events,a);c&&(c.end=Object.assign({},d),u.push(["exit",c,i])),r.end=Object.assign({},d),u.push(["exit",r,i]),e.add(a+1,0,u)}function nl(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const D6={name:"tasklistCheck",tokenize:L6};function z6(){return{text:{91:D6}}}function L6(e,i,a){const r=this;return c;function c(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 It(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 Ge(h)?i(h):st(h)?e.check({tokenize:I6},i,a)(h):a(h)}}function I6(e,i,a){return bt(e,r,"whitespace");function r(c){return c===null?a(c):i(c)}}function U6(e){return Fk([c6(),y6(),T6(e),O6(),z6()])}const B6={};function $6(e){const i=this,a=e||B6,r=i.data(),c=r.micromarkExtensions||(r.micromarkExtensions=[]),u=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);c.push(U6(a)),u.push(r6()),d.push(s6(a))}const Ev=(function(e,i,a){const r=Go(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]}),ls=(function(e){if(e==null)return F6;if(typeof e=="string")return H6(e);if(typeof e=="object")return P6(e);if(typeof e=="function")return $g(e);throw new Error("Expected function, string, or array as `test`")});function P6(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=ls(e[a]);return $g(r);function r(...c){let u=-1;for(;++u<i.length;)if(i[u].apply(this,c))return!0;return!1}}function H6(e){return $g(i);function i(a){return a.tagName===e}}function $g(e){return i;function i(a,r,c){return!!(q6(a)&&e.call(this,a,typeof r=="number"?r:void 0,c||void 0))}}function F6(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function q6(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Sv=/\n/g,_v=/[\t ]+/g,Bh=ls("br"),Tv=ls(W6),G6=ls("p"),Cv=ls("tr"),Y6=ls(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Q6,J6]),MN=ls(["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 V6(e,i){const a=i||{},r="children"in e?e.children:[],c=MN(e),u=zN(e,{whitespace:a.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...DN(e,{breakBefore:!0,breakAfter:!0}));let p=-1;for(;++p<r.length;)d.push(...RN(r[p],e,{whitespace:u,breakBefore:p?void 0:c,breakAfter:p<r.length-1?Bh(r[p+1]):c}));const h=[];let g;for(p=-1;++p<d.length;){const b=d[p];typeof b=="number"?g!==void 0&&b>g&&(g=b):b&&(g!==void 0&&g>-1&&h.push(`
|
|
239
|
+
`.repeat(g)||" "),g=-1,h.push(b))}return h.join("")}function RN(e,i,a){return e.type==="element"?K6(e,i,a):e.type==="text"?a.whitespace==="normal"?DN(e,a):X6(e):[]}function K6(e,i,a){const r=zN(e,a),c=e.children||[];let u=-1,d=[];if(Y6(e))return d;let p,h;for(Bh(e)||Cv(e)&&Ev(i,e,Cv)?h=`
|
|
240
|
+
`:G6(e)?(p=2,h=2):MN(e)&&(p=1,h=1);++u<c.length;)d=d.concat(RN(c[u],e,{whitespace:r,breakBefore:u?void 0:p,breakAfter:u<c.length-1?Bh(c[u+1]):h}));return Tv(e)&&Ev(i,e,Tv)&&d.push(" "),p&&d.unshift(p),h&&d.push(h),d}function DN(e,i){const a=String(e.value),r=[],c=[];let u=0;for(;u<=a.length;){Sv.lastIndex=u;const h=Sv.exec(a),g=h&&"index"in h?h.index:a.length;r.push(Z6(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?(c.push(r[d]),p=void 0):r[d]?(typeof p=="number"&&c.push(p),c.push(r[d]),p=0):(d===0||d===r.length-1)&&c.push(0);return c}function X6(e){return[String(e.value)]}function Z6(e,i,a){const r=[];let c=0,u;for(;c<e.length;){_v.lastIndex=c;const d=_v.exec(e);u=d?d.index:e.length,!c&&!u&&d&&!i&&r.push(""),c!==u&&r.push(e.slice(c,u)),c=d?u+d[0].length:u}return c!==u&&!a&&r.push(""),r.join(" ")}function zN(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 Q6(e){return!!(e.properties||{}).hidden}function W6(e){return e.tagName==="td"||e.tagName==="th"}function J6(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function eL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",c="[a-zA-Z_]\\w*::",d="(?!struct)("+r+"|"+i.optional(c)+"[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})"/})]},b={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},x={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(c)+e.IDENT_RE,relevance:0},y=i.optional(c)+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"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],j=["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"],E=["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"],R={type:S,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:j},P={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:i.concat(/\b/,`(?!${k.join("|")})`,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},z=[P,x,p,a,e.C_BLOCK_COMMENT_MODE,b,g],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:z.concat([{begin:/\(/,end:/\)/,keywords:R,contains:z.concat(["self"]),relevance:0}]),relevance:0},L={className:"function",begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:R,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,g,b,p,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,g,b,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,x]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:R,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,L,P,z,[x,{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:R,contains:["self",p]},{begin:e.IDENT_RE+"::",keywords:R},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function tL(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=eL(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 nL(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 c={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,c]};c.contains.push(p);const h={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},x={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},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],j=["true","false"],E={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],R=["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:S,literal:j,built_in:[...A,...T,"set","shopt",...R,...P]},contains:[y,e.SHEBANG(),k,x,u,d,E,p,h,g,b,a]}}function iL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",c="[a-zA-Z_]\\w*::",d="("+r+"|"+i.optional(c)+"[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})"/})]},b={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},x={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(c)+e.IDENT_RE,relevance:0},y=i.optional(c)+e.IDENT_RE+"\\s*\\(",j={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"},E=[x,p,a,e.C_BLOCK_COMMENT_MODE,b,g],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:E.concat([{begin:/\(/,end:/\)/,keywords:j,contains:E.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:y,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,g,b,p,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,g,b,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,x]};return{name:"C",aliases:["h"],keywords:j,disableAutodetect:!0,illegal:"</",contains:[].concat(A,T,E,[x,{begin:e.IDENT_RE+"::",keywords:j},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:x,strings:g,keywords:j}}}function aL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",c="[a-zA-Z_]\\w*::",d="(?!struct)("+r+"|"+i.optional(c)+"[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})"/})]},b={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},x={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(c)+e.IDENT_RE,relevance:0},y=i.optional(c)+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"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],j=["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"],E=["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"],R={type:S,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:j},P={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:i.concat(/\b/,`(?!${k.join("|")})`,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},z=[P,x,p,a,e.C_BLOCK_COMMENT_MODE,b,g],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:z.concat([{begin:/\(/,end:/\)/,keywords:R,contains:z.concat(["self"]),relevance:0}]),relevance:0},L={className:"function",begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:R,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,g,b,p,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,g,b,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,x]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:R,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,L,P,z,[x,{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:R,contains:["self",p]},{begin:e.IDENT_RE+"::",keywords:R},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function rL(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"],c=["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:c.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},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},x=e.inherit(b,{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]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},j=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});v.contains=[S,k,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],y.contains=[j,k,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[g,S,k,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},p]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",R={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"}},E,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},p,A,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,A,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:"("+T+"\\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,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[E,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},R]}}const sL=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_-]*/}}),lL=["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"],oL=["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"],cL=[...lL,...oL],uL=["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(),dL=["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(),fL=["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();function mL(e){const i=e.regex,a=sL(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},c="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:":("+dL.join("|")+")"},{begin:":(:)?("+fL.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pL.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:c,attribute:uL.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...p,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+cL.join("|")+")\\b"}]}}function hL(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 gL(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 xL(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 bL(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 c={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,c,d,a,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,g=/"(\\"|[^"])*"/,b=/'[^']*'/,x=i.either(h,g,b),v=i.concat(x,"(\\s*\\.\\s*",x,")*",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,c,d,a]}}]}}var il="[0-9](_*[0-9])*",Su=`\\.(${il})`,_u="[0-9a-fA-F](_*[0-9a-fA-F])*",jv={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]((${_u})\\.?|(${_u})?\\.(${_u}))[pP][+-]?(${il})[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 LN(e,i,a){return a===-1?"":e.replace(i,r=>LN(e,i,a-1))}function yL(e){const i=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=a+LN("(?:<"+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"]}]},b={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:[b,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,jv,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},jv,g]}}const Av="[A-Za-z$_][0-9A-Za-z$_]*",vL=["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"],wL=["true","false","null","undefined","NaN","Infinity"],IN=["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"],UN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],BN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kL=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],NL=[].concat(BN,IN,UN);function EL(e){const i=e.regex,a=(ne,{after:xe})=>{const _="</"+ne[0].slice(1);return ne.input.indexOf(_,xe)!==-1},r=Av,c={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,xe)=>{const _=ne[0].length+ne.index,ve=ne.input[_];if(ve==="<"||ve===","){xe.ignoreMatch();return}ve===">"&&(a(ne,{after:_})||xe.ignoreMatch());let ce;const D=ne.input.substring(_);if(ce=D.match(/^\s*=/)){xe.ignoreMatch();return}if((ce=D.match(/^\s+extends\s+/))&&ce.index===0){xe.ignoreMatch();return}}},p={$pattern:Av,keyword:vL,literal:wL,built_in:NL,"variable.language":kL},h="[0-9](_?[0-9])*",g=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\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"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},j={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},A={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]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,{match:/\$\d+/},x];v.contains=T.concat({begin:/\{/,end:/\}/,keywords:p,contains:["self"].concat(T)});const R=[].concat(A,v.contains),P=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:p,contains:["self"].concat(R)}]),z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:P},C={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"}}]},L={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:{_:[...IN,...UN]}},G={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[z],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(ne){return i.concat("(?!",ne.join("|"),")")}const fe={match:i.concat(/\b/,Z([...BN,"super","import","await"].map(ne=>`${ne}\\s*\\(`)),r,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:i.concat(/\./,i.lookahead(i.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},z]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ae={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:L},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),G,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,A,{match:/\$\d+/},x,L,{scope:"attr",match:r+i.lookahead(":"),relevance:0},ae,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:M,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:c.begin,end:c.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"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[z,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[z]},fe,$,C,te,{match:/\$[(.]/}]}}const SL="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",_L={scope:"number",match:SL,relevance:0};function TL(e){const i={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],c={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,c,_L,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var al="[0-9](_*[0-9])*",Tu=`\\.(${al})`,Cu="[0-9a-fA-F](_*[0-9a-fA-F])*",CL={className:"number",variants:[{begin:`(\\b(${al})((${Tu})|\\.)?|(${Tu}))[eE][+-]?(${al})[fFdD]?\\b`},{begin:`\\b(${al})((${Tu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Tu})[fFdD]?\\b`},{begin:`\\b(${al})[fFdD]\\b`},{begin:`\\b0[xX]((${Cu})\\.?|(${Cu})?\\.(${Cu}))[pP][+-]?(${al})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Cu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jL(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+"@"},c={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,c]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,c]}]};c.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=CL,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),x={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=x;return v.variants[1].contains=[x],x.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,b,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:[x,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,p,h,d,e.C_NUMBER_MODE]},b]},{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:`
|
|
241
|
+
`},g]}}const AL=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_-]*/}}),OL=["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"],ML=["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"],RL=[...OL,...ML],DL=["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(),$N=["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(),PN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),zL=["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(),LL=$N.concat(PN).sort().reverse();function IL(e){const i=AL(e),a=LL,r="and or not only",c="[\\w-]+",u="("+c+"|@\\{"+c+"\\})",d=[],p=[],h=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},g=function(T,R,P){return{className:T,begin:R,relevance:P}},b={$pattern:/[a-z-]+/,keyword:r,attribute:DL.join(" ")},x={begin:"\\(",end:"\\)",contains:p,keywords:b,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,x,g("variable","@@?"+c,10),g("variable","@\\{"+c+"\\}"),g("built_in","~?`[^`]*?`"),{className:"attribute",begin:c+"\\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("+zL.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:p}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:b,returnEnd:!0,contains:p,relevance:0}},j={className:"variable",variants:[{begin:"@"+c+"\\s*:",relevance:15},{begin:"@"+c}],starts:{end:"[;}]",returnEnd:!0,contains:v}},E={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","@\\{"+c+"\\}"),{begin:"\\b("+RL.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:":("+$N.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+PN.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},i.FUNCTION_DISPATCH]},A={begin:c+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[E]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,j,A,k,E,y,i.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function UL(e){const i="\\[=*\\[",a="\\]=*\\]",r={begin:i,end:a,contains:["self"]},c=[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:c.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:c}].concat(c)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:i,end:a,contains:[r],relevance:5}])}}function BL(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]},c={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,c,u,d]}}function $L(e){const i=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},c={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}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=e.inherit(g,{contains:[]}),v=e.inherit(b,{contains:[]});g.contains.push(v),b.contains.push(x);let y=[a,h];return[g,b,x,v].forEach(E=>{E.contains=E.contains.concat(y)}),y=y.concat(g,b),{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,b,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},c,r,h,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function PL(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 HL(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}/,c={$pattern:/[\w.]+/,keyword:a.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:c},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},b=[e.BACKSLASH_ESCAPE,u,h],x=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(S,j,E="\\1")=>{const A=E==="\\1"?E:i.concat(E,j);return i.concat(i.concat("(?:",S,")"),j,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,E,r)},y=(S,j,E)=>i.concat(i.concat("(?:",S,")"),j,/(?:\\.|[^\\\/])*?/,E,r),k=[h,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:b,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(...x,{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(...x,{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:c,contains:k}}function FL(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),c=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}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(h)}),x={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(re,te)=>{te.data._beginMatch=re[1]||re[2]},"on:end":(re,te)=>{te.data._beginMatch!==re[1]&&te.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
242
|
+
]`,k={scope:"string",variants:[b,g,x,v]},S={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},j=["false","null","true"],E=["__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"],A=["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"],R={keyword:E,literal:(re=>{const te=[];return re.forEach(M=>{te.push(M),M.toLowerCase()===M?te.push(M.toUpperCase()):te.push(M.toLowerCase())}),te})(j),built_in:A},P=re=>re.map(te=>te.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",P(A).join("\\b|"),"\\b)"),c],scope:{1:"keyword",4:"title.class"}}]},C=i.concat(r,"\\b(?!\\()"),L={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[c,i.concat(/::/,i.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[c,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[c,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},G={scope:"attr",match:i.concat(r,i.lookahead(":"),i.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[G,d,L,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,S,z]},$={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",P(E).join("\\b|"),"|",P(A).join("\\b|"),"\\b)"),r,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push($);const Z=[G,L,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,S,z],fe={begin:i.concat(/#\[\s*\\?/,i.either(c,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:j,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:j,keyword:["new","array"]},contains:["self",...Z]},...Z,{scope:"meta",variants:[{match:c},{match:u}]}]};return{case_insensitive:!1,keywords:R,contains:[fe,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,$,L,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},z,{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:R,contains:["self",fe,d,L,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,S]}]},{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,S]}}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 GL(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function YL(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:/#/},b={begin:/\{\{/,relevance:0},x={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,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,b,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,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",y=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,k=`\\b|${r.join("|")}`,S={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})`}]},j={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:p,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:["self",h,S,x,e.HASH_COMMENT_MODE]}]};return g.contains=[x,S,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:p,illegal:/(<\/|\?)|=>/,contains:[h,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,j,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[E]},{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:[S,E,x]}]}}function VL(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function KL(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]?/),c=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,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:[c,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:c},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function XL(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]+/),c=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)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:d},x={className:"string",contains:[e.BACKSLASH_ESCAPE,b],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,b]})]}]},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"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},z=[x,{variants:[{match:[/class\s+/,c,/\s+<\s+/,c]},{match:[/\b(class|module)\s+/,c]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,c],scope:{2:"title.class"},keywords:d},{relevance:0,match:[c,/\.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:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[x,{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,b],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);b.contains=z,S.contains=z;const O=[{begin:/^\s*=>/,starts:{end:"$",contains:z}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:z}}];return g.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(O).concat(g).concat(z)}}function ZL(e){const i=e.regex,a=/(r#)?/,r=i.concat(a,e.UNDERSCORE_IDENT_RE),c=i.concat(a,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,c,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!"],b=["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:b,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:b}},{className:"punctuation",begin:"->"},u]}}const QL=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_-]*/}}),WL=["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"],JL=["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"],e9=[...WL,...JL],t9=["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(),n9=["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(),i9=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),a9=["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 r9(e){const i=QL(e),a=i9,r=n9,c="@[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("+e9.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("+a9.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:c,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:t9.join(" ")},contains:[{begin:c,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 s9(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function l9(e){const i=e.regex,a=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},c={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"],b=["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"],x=["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=b,k=[...g,...h].filter(P=>!b.includes(P)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},j={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:i.concat(/\b/,i.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function A(P){return i.concat(/\b/,i.either(...P.map(z=>z.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:A(v),relevance:0};function R(P,{exceptions:z,when:C}={}){const L=C;return z=z||[],P.map(G=>G.match(/\|\d+$/)||z.includes(G)?G:L(G)?`${G}|0`:G)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:R(k,{when:P=>P.length<3}),literal:u,type:p,built_in:x},contains:[{scope:"type",match:A(d)},T,E,S,r,c,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,j]}}function HN(e){return e?typeof e=="string"?e:e.source:null}function ko(e){return Mt("(?=",e,")")}function Mt(...e){return e.map(a=>HN(a)).join("")}function o9(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"("+(o9(e).capture?"":"?:")+e.map(r=>HN(r)).join("|")+")"}const Pg=e=>Mt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),c9=["Protocol","Type"].map(Pg),Ov=["init","self"].map(Pg),u9=["Any","Self"],Vm=["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"],Mv=["false","nil","true"],d9=["assignment","associativity","higherThan","left","lowerThan","none","right"],f9=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Rv=["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"],FN=$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]/),qN=$n(FN,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Km=Mt(FN,qN,"*"),GN=$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]/),sd=$n(GN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ia=Mt(GN,sd,"*"),ju=Mt(/[A-Z]/,sd,"*"),p9=["attached","autoclosure",Mt(/convention\(/,$n("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Mt(/objc\(/,ia,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],m9=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function h9(e){const i={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,a],c={match:[/\./,$n(...c9,...Ov)],className:{2:"keyword"}},u={match:Mt(/\./,$n(...Vm)),relevance:0},d=Vm.filter(Oe=>typeof Oe=="string").concat(["_|0"]),p=Vm.filter(Oe=>typeof Oe!="string").concat(u9).map(Pg),h={variants:[{className:"keyword",match:$n(...p,...Ov)}]},g={$pattern:$n(/\b\w+/,/#\w+/),keyword:d.concat(f9),literal:Mv},b=[c,u,h],x={match:Mt(/\./,$n(...Rv)),relevance:0},v={className:"built_in",match:Mt(/\b/,$n(...Rv),/(?=\()/)},y=[x,v],k={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:Km},{match:`\\.(\\.|${qN})+`}]},j=[k,S],E="([0-9]_*)+",A="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},R=(Oe="")=>({className:"subst",variants:[{match:Mt(/\\/,Oe,/[0\\tnr"']/)},{match:Mt(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Oe="")=>({className:"subst",match:Mt(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),z=(Oe="")=>({className:"subst",label:"interpol",begin:Mt(/\\/,Oe,/\(/),end:/\)/}),C=(Oe="")=>({begin:Mt(Oe,/"""/),end:Mt(/"""/,Oe),contains:[R(Oe),P(Oe),z(Oe)]}),L=(Oe="")=>({begin:Mt(Oe,/"/),end:Mt(/"/,Oe),contains:[R(Oe),z(Oe)]}),G={className:"string",variants:[C(),C("#"),C("##"),C("###"),L(),L("#"),L("##"),L("###")]},O=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},Z=Oe=>{const ot=Mt(Oe,/\//),Ve=Mt(/\//,Oe);return{begin:ot,end:Ve,contains:[...O,{scope:"comment",begin:`#(?!.*${Ve})`,end:/$/}]}},fe={scope:"regexp",variants:[Z("###"),Z("##"),Z("#"),$]},re={match:Mt(/`/,ia,/`/)},te={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${sd}+`},ae=[re,te,M],ne={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:m9,contains:[...j,T,G]}]}},xe={scope:"keyword",match:Mt(/@/,$n(...p9),ko($n(/\(/,/\s+/)))},_={scope:"meta",match:Mt(/@/,ia)},ve=[ne,xe,_],ce={match:ko(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Mt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,sd,"+")},{className:"type",match:ju,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Mt(/\s+&\s+/,ko(ju)),relevance:0}]},D={begin:/</,end:/>/,keywords:g,contains:[...r,...b,...ve,k,ce]};ce.contains.push(D);const B={match:Mt(ia,/\s*:/),keywords:"_|0",relevance:0},se={begin:/\(/,end:/\)/,relevance:0,keywords:g,contains:["self",B,...r,fe,...b,...y,...j,T,G,...ae,...ve,ce]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,ce]},Ee={begin:$n(ko(Mt(ia,/\s*:/)),ko(Mt(ia,/\s+/,ia,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ia}]},Le={begin:/\(/,end:/\)/,keywords:g,contains:[Ee,...r,...b,...j,T,G,...ve,ce,se],endsParent:!0,illegal:/["']/},Pe={match:[/(func|macro)/,/\s+/,$n(re.match,ia,Km)],className:{1:"keyword",3:"title.function"},contains:[pe,Le,i],illegal:[/\[/,/%/]},Fe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pe,Le,i],illegal:/\[|%/},Se={match:[/operator/,/\s+/,Km],className:{1:"keyword",3:"title"}},H={begin:[/precedencegroup/,/\s+/,ju],className:{1:"keyword",3:"title"},contains:[ce],keywords:[...d9,...Mv],end:/}/},K={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},be={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ia,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:g,contains:[pe,...b,{begin:/:/,end:/\{/,keywords:g,contains:[{scope:"title.class.inherited",match:ju},...b],relevance:0}]};for(const Oe of G.variants){const ot=Oe.contains.find(jt=>jt.label==="interpol");ot.keywords=g;const Ve=[...b,...y,...j,T,G,...ae];ot.contains=[...Ve,{begin:/\(/,end:/\)/,contains:["self",...Ve]}]}return{name:"Swift",keywords:g,contains:[...r,Pe,Fe,K,be,je,Se,H,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},fe,...b,...y,...j,T,G,...ae,...ve,ce,se]}}const ld="[A-Za-z$_][0-9A-Za-z$_]*",YN=["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"],VN=["true","false","null","undefined","NaN","Infinity"],KN=["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"],XN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ZN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],QN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],WN=[].concat(ZN,KN,XN);function g9(e){const i=e.regex,a=(ne,{after:xe})=>{const _="</"+ne[0].slice(1);return ne.input.indexOf(_,xe)!==-1},r=ld,c={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,xe)=>{const _=ne[0].length+ne.index,ve=ne.input[_];if(ve==="<"||ve===","){xe.ignoreMatch();return}ve===">"&&(a(ne,{after:_})||xe.ignoreMatch());let ce;const D=ne.input.substring(_);if(ce=D.match(/^\s*=/)){xe.ignoreMatch();return}if((ce=D.match(/^\s+extends\s+/))&&ce.index===0){xe.ignoreMatch();return}}},p={$pattern:ld,keyword:YN,literal:VN,built_in:WN,"variable.language":QN},h="[0-9](_?[0-9])*",g=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\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"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},j={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},A={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]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,{match:/\$\d+/},x];v.contains=T.concat({begin:/\{/,end:/\}/,keywords:p,contains:["self"].concat(T)});const R=[].concat(A,v.contains),P=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:p,contains:["self"].concat(R)}]),z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:P},C={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"}}]},L={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:{_:[...KN,...XN]}},G={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[z],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(ne){return i.concat("(?!",ne.join("|"),")")}const fe={match:i.concat(/\b/,Z([...ZN,"super","import","await"].map(ne=>`${ne}\\s*\\(`)),r,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:i.concat(/\./,i.lookahead(i.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},z]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ae={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:L},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),G,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,A,{match:/\$\d+/},x,L,{scope:"attr",match:r+i.lookahead(":"),relevance:0},ae,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:M,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:c.begin,end:c.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"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[z,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[z]},fe,$,C,te,{match:/\$[(.]/}]}}function x9(e){const i=e.regex,a=g9(e),r=ld,c=["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:c},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:ld,keyword:YN.concat(h),literal:VN,built_in:WN.concat(c),"variable.language":QN},b={className:"meta",begin:"@"+r},x=(S,j,E)=>{const A=S.contains.findIndex(T=>T.label===j);if(A===-1)throw new Error("can not find mode to replace");S.contains.splice(A,1,E)};Object.assign(a.keywords,g),a.exports.PARAMS_CONTAINS.push(b);const v=a.contains.find(S=>S.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([b,u,d,y]),x(a,"shebang",e.SHEBANG()),x(a,"use_strict",p);const k=a.contains.find(S=>S.label==="func.def");return k.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function b9(e){const i=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},c=/\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,c),/ *#/)},{begin:i.concat(/# */,p,/ *#/)},{begin:i.concat(/# */,d,/ *#/)},{begin:i.concat(/# */,i.either(u,c),/ +/,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])|[%&])?/}]},b={className:"label",begin:/^\w+:/},x=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,b,x,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 y9(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"],c={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,c,e.QUOTE_STRING_MODE,h,g,p]}}function v9(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,c={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:[c]},{begin:/'/,end:/'/,contains:[c]},{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},c,{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 w9(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]|$)/}]},c={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,c]},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},S={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},j=[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,S,u,d],E=[...j];return E.pop(),E.push(p),y.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:j}}const k9={arduino:tL,bash:nL,c:iL,cpp:aL,csharp:rL,css:mL,diff:hL,go:gL,graphql:xL,ini:bL,java:yL,javascript:EL,json:TL,kotlin:jL,less:IL,lua:UL,makefile:BL,markdown:$L,objectivec:PL,perl:HL,php:FL,"php-template":qL,plaintext:GL,python:YL,"python-repl":VL,r:KL,ruby:XL,rust:ZL,scss:r9,shell:s9,sql:l9,swift:h9,typescript:x9,vbnet:b9,wasm:y9,xml:v9,yaml:w9};var Xm,Dv;function N9(){if(Dv)return Xm;Dv=1;function e(F){return F instanceof Map?F.clear=F.delete=F.set=function(){throw new Error("map is read-only")}:F instanceof Set&&(F.add=F.clear=F.delete=function(){throw new Error("set is read-only")}),Object.freeze(F),Object.getOwnPropertyNames(F).forEach(de=>{const Te=F[de],We=typeof Te;(We==="object"||We==="function")&&!Object.isFrozen(Te)&&e(Te)}),F}class i{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(F){return F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(F,...de){const Te=Object.create(null);for(const We in F)Te[We]=F[We];return de.forEach(function(We){for(const Dt in We)Te[Dt]=We[Dt]}),Te}const c="</span>",u=F=>!!F.scope,d=(F,{prefix:de})=>{if(F.startsWith("language:"))return F.replace("language:","language-");if(F.includes(".")){const Te=F.split(".");return[`${de}${Te.shift()}`,...Te.map((We,Dt)=>`${We}${"_".repeat(Dt+1)}`)].join(" ")}return`${de}${F}`};class p{constructor(de,Te){this.buffer="",this.classPrefix=Te.classPrefix,de.walk(this)}addText(de){this.buffer+=a(de)}openNode(de){if(!u(de))return;const Te=d(de.scope,{prefix:this.classPrefix});this.span(Te)}closeNode(de){u(de)&&(this.buffer+=c)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const h=(F={})=>{const de={children:[]};return Object.assign(de,F),de};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(de){this.top.children.push(de)}openNode(de){const Te=h({scope:de});this.add(Te),this.stack.push(Te)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(de){return this.constructor._walk(de,this.rootNode)}static _walk(de,Te){return typeof Te=="string"?de.addText(Te):Te.children&&(de.openNode(Te),Te.children.forEach(We=>this._walk(de,We)),de.closeNode(Te)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(Te=>typeof Te=="string")?de.children=[de.children.join("")]:de.children.forEach(Te=>{g._collapse(Te)}))}}class b extends g{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,Te){const We=de.root;Te&&(We.scope=`language:${Te}`),this.add(We)}toHTML(){return new p(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x(F){return F?typeof F=="string"?F:F.source:null}function v(F){return S("(?=",F,")")}function y(F){return S("(?:",F,")*")}function k(F){return S("(?:",F,")?")}function S(...F){return F.map(Te=>x(Te)).join("")}function j(F){const de=F[F.length-1];return typeof de=="object"&&de.constructor===Object?(F.splice(F.length-1,1),de):{}}function E(...F){return"("+(j(F).capture?"":"?:")+F.map(We=>x(We)).join("|")+")"}function A(F){return new RegExp(F.toString()+"|").exec("").length-1}function T(F,de){const Te=F&&F.exec(de);return Te&&Te.index===0}const R=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(F,{joinWith:de}){let Te=0;return F.map(We=>{Te+=1;const Dt=Te;let pt=x(We),Ae="";for(;pt.length>0;){const _e=R.exec(pt);if(!_e){Ae+=pt;break}Ae+=pt.substring(0,_e.index),pt=pt.substring(_e.index+_e[0].length),_e[0][0]==="\\"&&_e[1]?Ae+="\\"+String(Number(_e[1])+Dt):(Ae+=_e[0],_e[0]==="("&&Te++)}return Ae}).map(We=>`(${We})`).join(de)}const z=/\b\B/,C="[a-zA-Z]\\w*",L="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",O="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",fe=(F={})=>{const de=/^#![ ]*\//;return F.binary&&(F.begin=S(de,/.*\b/,F.binary,/\b.*/)),r({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(Te,We)=>{Te.index!==0&&We.ignoreMatch()}},F)},re={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[re]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[re]},ae={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(F,de,Te={}){const We=r({scope:"comment",begin:F,end:de,contains:[]},Te);We.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 Dt=E("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 We.contains.push({begin:S(/[ ]+/,"(",Dt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),We},xe=ne("//","$"),_=ne("/\\*","\\*/"),ve=ne("#","$"),ce={scope:"number",begin:G,relevance:0},D={scope:"number",begin:O,relevance:0},B={scope:"number",begin:$,relevance:0},se={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[re,{begin:/\[/,end:/\]/,relevance:0,contains:[re]}]},pe={scope:"title",begin:C,relevance:0},Ee={scope:"title",begin:L,relevance:0},Le={begin:"\\.\\s*"+L,relevance:0};var Fe=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:re,BINARY_NUMBER_MODE:B,BINARY_NUMBER_RE:$,COMMENT:ne,C_BLOCK_COMMENT_MODE:_,C_LINE_COMMENT_MODE:xe,C_NUMBER_MODE:D,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(F){return Object.assign(F,{"on:begin":(de,Te)=>{Te.data._beginMatch=de[1]},"on:end":(de,Te)=>{Te.data._beginMatch!==de[1]&&Te.ignoreMatch()}})},HASH_COMMENT_MODE:ve,IDENT_RE:C,MATCH_NOTHING_RE:z,METHOD_GUARD:Le,NUMBER_MODE:ce,NUMBER_RE:G,PHRASAL_WORDS_MODE:ae,QUOTE_STRING_MODE:M,REGEXP_MODE:se,RE_STARTERS_RE:Z,SHEBANG:fe,TITLE_MODE:pe,UNDERSCORE_IDENT_RE:L,UNDERSCORE_TITLE_MODE:Ee});function Se(F,de){F.input[F.index-1]==="."&&de.ignoreMatch()}function H(F,de){F.className!==void 0&&(F.scope=F.className,delete F.className)}function K(F,de){de&&F.beginKeywords&&(F.begin="\\b("+F.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",F.__beforeBegin=Se,F.keywords=F.keywords||F.beginKeywords,delete F.beginKeywords,F.relevance===void 0&&(F.relevance=0))}function be(F,de){Array.isArray(F.illegal)&&(F.illegal=E(...F.illegal))}function je(F,de){if(F.match){if(F.begin||F.end)throw new Error("begin & end are not supported with match");F.begin=F.match,delete F.match}}function Oe(F,de){F.relevance===void 0&&(F.relevance=1)}const ot=(F,de)=>{if(!F.beforeMatch)return;if(F.starts)throw new Error("beforeMatch cannot be used with starts");const Te=Object.assign({},F);Object.keys(F).forEach(We=>{delete F[We]}),F.keywords=Te.keywords,F.begin=S(Te.beforeMatch,v(Te.begin)),F.starts={relevance:0,contains:[Object.assign(Te,{endsParent:!0})]},F.relevance=0,delete Te.beforeMatch},Ve=["of","and","for","in","not","or","if","then","parent","list","value"],jt="keyword";function fn(F,de,Te=jt){const We=Object.create(null);return typeof F=="string"?Dt(Te,F.split(" ")):Array.isArray(F)?Dt(Te,F):Object.keys(F).forEach(function(pt){Object.assign(We,fn(F[pt],de,pt))}),We;function Dt(pt,Ae){de&&(Ae=Ae.map(_e=>_e.toLowerCase())),Ae.forEach(function(_e){const Ke=_e.split("|");We[Ke[0]]=[pt,$t(Ke[0],Ke[1])]})}}function $t(F,de){return de?Number(de):ue(F)?0:1}function ue(F){return Ve.includes(F.toLowerCase())}const qe={},ht=F=>{console.error(F)},xt=(F,...de)=>{console.log(`WARN: ${F}`,...de)},on=(F,de)=>{qe[`${F}/${de}`]||(console.log(`Deprecated as of ${F}. ${de}`),qe[`${F}/${de}`]=!0)},ie=new Error;function we(F,de,{key:Te}){let We=0;const Dt=F[Te],pt={},Ae={};for(let _e=1;_e<=de.length;_e++)Ae[_e+We]=Dt[_e],pt[_e+We]=!0,We+=A(de[_e-1]);F[Te]=Ae,F[Te]._emit=pt,F[Te]._multi=!0}function He(F){if(Array.isArray(F.begin)){if(F.skip||F.excludeBegin||F.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ie;if(typeof F.beginScope!="object"||F.beginScope===null)throw ht("beginScope must be object"),ie;we(F,F.begin,{key:"beginScope"}),F.begin=P(F.begin,{joinWith:""})}}function Qe(F){if(Array.isArray(F.end)){if(F.skip||F.excludeEnd||F.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ie;if(typeof F.endScope!="object"||F.endScope===null)throw ht("endScope must be object"),ie;we(F,F.end,{key:"endScope"}),F.end=P(F.end,{joinWith:""})}}function Zt(F){F.scope&&typeof F.scope=="object"&&F.scope!==null&&(F.beginScope=F.scope,delete F.scope)}function Et(F){Zt(F),typeof F.beginScope=="string"&&(F.beginScope={_wrap:F.beginScope}),typeof F.endScope=="string"&&(F.endScope={_wrap:F.endScope}),He(F),Qe(F)}function cn(F){function de(Ae,_e){return new RegExp(x(Ae),"m"+(F.case_insensitive?"i":"")+(F.unicodeRegex?"u":"")+(_e?"g":""))}class Te{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_e,Ke){Ke.position=this.position++,this.matchIndexes[this.matchAt]=Ke,this.regexes.push([Ke,_e]),this.matchAt+=A(_e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _e=this.regexes.map(Ke=>Ke[1]);this.matcherRe=de(P(_e,{joinWith:"|"}),!0),this.lastIndex=0}exec(_e){this.matcherRe.lastIndex=this.lastIndex;const Ke=this.matcherRe.exec(_e);if(!Ke)return null;const Wt=Ke.findIndex((Hi,La)=>La>0&&Hi!==void 0),qt=this.matchIndexes[Wt];return Ke.splice(0,Wt),Object.assign(Ke,qt)}}class We{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_e){if(this.multiRegexes[_e])return this.multiRegexes[_e];const Ke=new Te;return this.rules.slice(_e).forEach(([Wt,qt])=>Ke.addRule(Wt,qt)),Ke.compile(),this.multiRegexes[_e]=Ke,Ke}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_e,Ke){this.rules.push([_e,Ke]),Ke.type==="begin"&&this.count++}exec(_e){const Ke=this.getMatcher(this.regexIndex);Ke.lastIndex=this.lastIndex;let Wt=Ke.exec(_e);if(this.resumingScanAtSamePosition()&&!(Wt&&Wt.index===this.lastIndex)){const qt=this.getMatcher(0);qt.lastIndex=this.lastIndex+1,Wt=qt.exec(_e)}return Wt&&(this.regexIndex+=Wt.position+1,this.regexIndex===this.count&&this.considerAll()),Wt}}function Dt(Ae){const _e=new We;return Ae.contains.forEach(Ke=>_e.addRule(Ke.begin,{rule:Ke,type:"begin"})),Ae.terminatorEnd&&_e.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&_e.addRule(Ae.illegal,{type:"illegal"}),_e}function pt(Ae,_e){const Ke=Ae;if(Ae.isCompiled)return Ke;[H,je,Et,ot].forEach(qt=>qt(Ae,_e)),F.compilerExtensions.forEach(qt=>qt(Ae,_e)),Ae.__beforeBegin=null,[K,be,Oe].forEach(qt=>qt(Ae,_e)),Ae.isCompiled=!0;let Wt=null;return typeof Ae.keywords=="object"&&Ae.keywords.$pattern&&(Ae.keywords=Object.assign({},Ae.keywords),Wt=Ae.keywords.$pattern,delete Ae.keywords.$pattern),Wt=Wt||/\w+/,Ae.keywords&&(Ae.keywords=fn(Ae.keywords,F.case_insensitive)),Ke.keywordPatternRe=de(Wt,!0),_e&&(Ae.begin||(Ae.begin=/\B|\b/),Ke.beginRe=de(Ke.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(Ke.endRe=de(Ke.end)),Ke.terminatorEnd=x(Ke.end)||"",Ae.endsWithParent&&_e.terminatorEnd&&(Ke.terminatorEnd+=(Ae.end?"|":"")+_e.terminatorEnd)),Ae.illegal&&(Ke.illegalRe=de(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(qt){return Ni(qt==="self"?Ae:qt)})),Ae.contains.forEach(function(qt){pt(qt,Ke)}),Ae.starts&&pt(Ae.starts,_e),Ke.matcher=Dt(Ke),Ke}if(F.compilerExtensions||(F.compilerExtensions=[]),F.contains&&F.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return F.classNameAliases=r(F.classNameAliases||{}),pt(F)}function yn(F){return F?F.endsWithParent||yn(F.starts):!1}function Ni(F){return F.variants&&!F.cachedVariants&&(F.cachedVariants=F.variants.map(function(de){return r(F,{variants:null},de)})),F.cachedVariants?F.cachedVariants:yn(F)?r(F,{starts:F.starts?r(F.starts):null}):Object.isFrozen(F)?r(F):F}var Ei="11.11.2";class oa extends Error{constructor(de,Te){super(de),this.name="HTMLInjectionError",this.html=Te}}const za=a,Qt=r,pn=Symbol("nomatch"),Si=7,zn=function(F){const de=Object.create(null),Te=Object.create(null),We=[];let Dt=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",Ae={disableAutodetect:!0,name:"Plain text",contains:[]};let _e={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Ke(ge){return _e.noHighlightRe.test(ge)}function Wt(ge){let Ie=ge.className+" ";Ie+=ge.parentNode?ge.parentNode.className:"";const lt=_e.languageDetectRe.exec(Ie);if(lt){const At=Ti(lt[1]);return At||(xt(pt.replace("{}",lt[1])),xt("Falling back to no-highlight mode for this block.",ge)),At?lt[1]:"no-highlight"}return Ie.split(/\s+/).find(At=>Ke(At)||Ti(At))}function qt(ge,Ie,lt){let At="",Kt="";typeof Ie=="object"?(At=ge,lt=Ie.ignoreIllegals,Kt=Ie.language):(on("10.7.0","highlight(lang, code, ...args) has been deprecated."),on("10.7.0",`Please use highlight(code, options) instead.
|
|
243
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Kt=ge,At=Ie),lt===void 0&&(lt=!0);const Fn={code:At,language:Kt};Hn("before:highlight",Fn);const qn=Fn.result?Fn.result:Hi(Fn.language,Fn.code,lt);return qn.code=Fn.code,Hn("after:highlight",qn),qn}function Hi(ge,Ie,lt,At){const Kt=Object.create(null);function Fn(Ce,Ue){return Ce.keywords[Ue]}function qn(){if(!et.keywords){en.addText(yt);return}let Ce=0;et.keywordPatternRe.lastIndex=0;let Ue=et.keywordPatternRe.exec(yt),nt="";for(;Ue;){nt+=yt.substring(Ce,Ue.index);const vt=ui.case_insensitive?Ue[0].toLowerCase():Ue[0],St=Fn(et,vt);if(St){const[Jn,tc]=St;if(en.addText(nt),nt="",Kt[vt]=(Kt[vt]||0)+1,Kt[vt]<=Si&&(ma+=tc),Jn.startsWith("_"))nt+=Ue[0];else{const Nl=ui.classNameAliases[Jn]||Jn;hn(Ue[0],Nl)}}else nt+=Ue[0];Ce=et.keywordPatternRe.lastIndex,Ue=et.keywordPatternRe.exec(yt)}nt+=yt.substring(Ce),en.addText(nt)}function ua(){if(yt==="")return;let Ce=null;if(typeof et.subLanguage=="string"){if(!de[et.subLanguage]){en.addText(yt);return}Ce=Hi(et.subLanguage,yt,!0,mt[et.subLanguage]),mt[et.subLanguage]=Ce._top}else Ce=Ia(yt,et.subLanguage.length?et.subLanguage:null);et.relevance>0&&(ma+=Ce.relevance),en.__addSublanguage(Ce._emitter,Ce.language)}function mn(){et.subLanguage!=null?ua():qn(),yt=""}function hn(Ce,Ue){Ce!==""&&(en.startScope(Ue),en.addText(Ce),en.endScope())}function da(Ce,Ue){let nt=1;const vt=Ue.length-1;for(;nt<=vt;){if(!Ce._emit[nt]){nt++;continue}const St=ui.classNameAliases[Ce[nt]]||Ce[nt],Jn=Ue[nt];St?hn(Jn,St):(yt=Jn,qn(),yt=""),nt++}}function $a(Ce,Ue){return Ce.scope&&typeof Ce.scope=="string"&&en.openNode(ui.classNameAliases[Ce.scope]||Ce.scope),Ce.beginScope&&(Ce.beginScope._wrap?(hn(yt,ui.classNameAliases[Ce.beginScope._wrap]||Ce.beginScope._wrap),yt=""):Ce.beginScope._multi&&(da(Ce.beginScope,Ue),yt="")),et=Object.create(Ce,{parent:{value:et}}),et}function fa(Ce,Ue,nt){let vt=T(Ce.endRe,nt);if(vt){if(Ce["on:end"]){const St=new i(Ce);Ce["on:end"](Ue,St),St.isMatchIgnored&&(vt=!1)}if(vt){for(;Ce.endsParent&&Ce.parent;)Ce=Ce.parent;return Ce}}if(Ce.endsWithParent)return fa(Ce.parent,Ue,nt)}function Jt(Ce){return et.matcher.regexIndex===0?(yt+=Ce[0],1):(us=!0,0)}function Qo(Ce){const Ue=Ce[0],nt=Ce.rule,vt=new i(nt),St=[nt.__beforeBegin,nt["on:begin"]];for(const Jn of St)if(Jn&&(Jn(Ce,vt),vt.isMatchIgnored))return Jt(Ue);return nt.skip?yt+=Ue:(nt.excludeBegin&&(yt+=Ue),mn(),!nt.returnBegin&&!nt.excludeBegin&&(yt=Ue)),$a(nt,Ce),nt.returnBegin?0:Ue.length}function Wo(Ce){const Ue=Ce[0],nt=Ie.substring(Ce.index),vt=fa(et,Ce,nt);if(!vt)return pn;const St=et;et.endScope&&et.endScope._wrap?(mn(),hn(Ue,et.endScope._wrap)):et.endScope&&et.endScope._multi?(mn(),da(et.endScope,Ce)):St.skip?yt+=Ue:(St.returnEnd||St.excludeEnd||(yt+=Ue),mn(),St.excludeEnd&&(yt=Ue));do et.scope&&en.closeNode(),!et.skip&&!et.subLanguage&&(ma+=et.relevance),et=et.parent;while(et!==vt.parent);return vt.starts&&$a(vt.starts,Ce),St.returnEnd?0:Ue.length}function Jo(){const Ce=[];for(let Ue=et;Ue!==ui;Ue=Ue.parent)Ue.scope&&Ce.unshift(Ue.scope);Ce.forEach(Ue=>en.openNode(Ue))}let ci={};function pa(Ce,Ue){const nt=Ue&&Ue[0];if(yt+=Ce,nt==null)return mn(),0;if(ci.type==="begin"&&Ue.type==="end"&&ci.index===Ue.index&&nt===""){if(yt+=Ie.slice(Ue.index,Ue.index+1),!Dt){const vt=new Error(`0 width match regex (${ge})`);throw vt.languageName=ge,vt.badRule=ci.rule,vt}return 1}if(ci=Ue,Ue.type==="begin")return Qo(Ue);if(Ue.type==="illegal"&&!lt){const vt=new Error('Illegal lexeme "'+nt+'" for mode "'+(et.scope||"<unnamed>")+'"');throw vt.mode=et,vt}else if(Ue.type==="end"){const vt=Wo(Ue);if(vt!==pn)return vt}if(Ue.type==="illegal"&&nt==="")return Ue.index===Ie.length||(yt+=`
|
|
244
|
+
`),1;if(wn>1e5&&wn>Ue.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=nt,nt.length}const ui=Ti(ge);if(!ui)throw ht(pt.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const ec=cn(ui);let cs="",et=At||ec;const mt={},en=new _e.__emitter(_e);Jo();let yt="",ma=0,vn=0,wn=0,us=!1;try{if(ui.__emitTokens)ui.__emitTokens(Ie,en);else{for(et.matcher.considerAll();;){wn++,us?us=!1:et.matcher.considerAll(),et.matcher.lastIndex=vn;const Ce=et.matcher.exec(Ie);if(!Ce)break;const Ue=Ie.substring(vn,Ce.index),nt=pa(Ue,Ce);vn=Ce.index+nt}pa(Ie.substring(vn))}return en.finalize(),cs=en.toHTML(),{language:ge,value:cs,relevance:ma,illegal:!1,_emitter:en,_top:et}}catch(Ce){if(Ce.message&&Ce.message.includes("Illegal"))return{language:ge,value:za(Ie),illegal:!0,relevance:0,_illegalBy:{message:Ce.message,index:vn,context:Ie.slice(vn-100,vn+100),mode:Ce.mode,resultSoFar:cs},_emitter:en};if(Dt)return{language:ge,value:za(Ie),illegal:!1,relevance:0,errorRaised:Ce,_emitter:en,_top:et};throw Ce}}function La(ge){const Ie={value:za(ge),illegal:!1,relevance:0,_top:Ae,_emitter:new _e.__emitter(_e)};return Ie._emitter.addText(ge),Ie}function Ia(ge,Ie){Ie=Ie||_e.languages||Object.keys(de);const lt=La(ge),At=Ie.filter(Ti).filter(os).map(mn=>Hi(mn,ge,!1));At.unshift(lt);const Kt=At.sort((mn,hn)=>{if(mn.relevance!==hn.relevance)return hn.relevance-mn.relevance;if(mn.language&&hn.language){if(Ti(mn.language).supersetOf===hn.language)return 1;if(Ti(hn.language).supersetOf===mn.language)return-1}return 0}),[Fn,qn]=Kt,ua=Fn;return ua.secondBest=qn,ua}function ca(ge,Ie,lt){const At=Ie&&Te[Ie]||lt;ge.classList.add("hljs"),ge.classList.add(`language-${At}`)}function Ua(ge){let Ie=null;const lt=Wt(ge);if(Ke(lt))return;if(Hn("before:highlightElement",{el:ge,language:lt}),ge.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ge);return}if(ge.children.length>0&&(_e.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)),_e.throwUnescapedHTML))throw new oa("One of your code blocks includes unescaped HTML.",ge.innerHTML);Ie=ge;const At=Ie.textContent,Kt=lt?qt(At,{language:lt,ignoreIllegals:!0}):Ia(At);ge.innerHTML=Kt.value,ge.dataset.highlighted="yes",ca(ge,lt,Kt.language),ge.result={language:Kt.language,re:Kt.relevance,relevance:Kt.relevance},Kt.secondBest&&(ge.secondBest={language:Kt.secondBest.language,relevance:Kt.secondBest.relevance}),Hn("after:highlightElement",{el:ge,result:Kt,text:At})}function Nr(ge){_e=Qt(_e,ge)}const Vo=()=>{Ba(),on("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Id(){Ba(),on("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let vl=!1;function Ba(){function ge(){Ba()}if(document.readyState==="loading"){vl||window.addEventListener("DOMContentLoaded",ge,!1),vl=!0;return}document.querySelectorAll(_e.cssSelector).forEach(Ua)}function Er(ge,Ie){let lt=null;try{lt=Ie(F)}catch(At){if(ht("Language definition for '{}' could not be registered.".replace("{}",ge)),Dt)ht(At);else throw At;lt=Ae}lt.name||(lt.name=ge),de[ge]=lt,lt.rawDefinition=Ie.bind(null,F),lt.aliases&&wl(lt.aliases,{languageName:ge})}function Ud(ge){delete de[ge];for(const Ie of Object.keys(Te))Te[Ie]===ge&&delete Te[Ie]}function Ko(){return Object.keys(de)}function Ti(ge){return ge=(ge||"").toLowerCase(),de[ge]||de[Te[ge]]}function wl(ge,{languageName:Ie}){typeof ge=="string"&&(ge=[ge]),ge.forEach(lt=>{Te[lt.toLowerCase()]=Ie})}function os(ge){const Ie=Ti(ge);return Ie&&!Ie.disableAutodetect}function kl(ge){ge["before:highlightBlock"]&&!ge["before:highlightElement"]&&(ge["before:highlightElement"]=Ie=>{ge["before:highlightBlock"](Object.assign({block:Ie.el},Ie))}),ge["after:highlightBlock"]&&!ge["after:highlightElement"]&&(ge["after:highlightElement"]=Ie=>{ge["after:highlightBlock"](Object.assign({block:Ie.el},Ie))})}function Xo(ge){kl(ge),We.push(ge)}function Zo(ge){const Ie=We.indexOf(ge);Ie!==-1&&We.splice(Ie,1)}function Hn(ge,Ie){const lt=ge;We.forEach(function(At){At[lt]&&At[lt](Ie)})}function un(ge){return on("10.7.0","highlightBlock will be removed entirely in v12.0"),on("10.7.0","Please use highlightElement now."),Ua(ge)}Object.assign(F,{highlight:qt,highlightAuto:Ia,highlightAll:Ba,highlightElement:Ua,highlightBlock:un,configure:Nr,initHighlighting:Vo,initHighlightingOnLoad:Id,registerLanguage:Er,unregisterLanguage:Ud,listLanguages:Ko,getLanguage:Ti,registerAliases:wl,autoDetection:os,inherit:Qt,addPlugin:Xo,removePlugin:Zo}),F.debugMode=function(){Dt=!1},F.safeMode=function(){Dt=!0},F.versionString=Ei,F.regex={concat:S,lookahead:v,either:E,optional:k,anyNumberOfTimes:y};for(const ge in Fe)typeof Fe[ge]=="object"&&e(Fe[ge]);return Object.assign(F,Fe),F},_i=zn({});return _i.newInstance=()=>zn({}),Xm=_i,_i.HighlightJS=_i,_i.default=_i,Xm}var E9=N9();const S9=cd(E9),zv={},_9="hljs-";function T9(e){const i=S9.newInstance();return e&&u(e),{highlight:a,highlightAuto:r,listLanguages:c,register:u,registerAlias:d,registered:p};function a(h,g,b){const x=b||zv,v=typeof x.prefix=="string"?x.prefix:_9;if(!i.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");i.configure({__emitter:C9,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,S=k.data;return S.language=y.language,S.relevance=y.relevance,k}function r(h,g){const x=(g||zv).subset||c();let v=-1,y=0,k;for(;++v<x.length;){const S=x[v];if(!i.getLanguage(S))continue;const j=a(S,h,g);j.data&&j.data.relevance!==void 0&&j.data.relevance>y&&(y=j.data.relevance,k=j)}return k||{type:"root",children:[],data:{language:void 0,relevance:y}}}function c(){return i.listLanguages()}function u(h,g){if(typeof h=="string")i.registerLanguage(h,g);else{let b;for(b in h)Object.hasOwn(h,b)&&i.registerLanguage(b,h[b])}}function d(h,g){if(typeof h=="string")i.registerAliases(typeof g=="string"?g:[...g],{languageName:h});else{let b;for(b in h)if(Object.hasOwn(h,b)){const x=h[b];i.registerAliases(typeof x=="string"?x:[...x],{languageName:b})}}}function p(h){return!!i.getLanguage(h)}}class C9{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],c=i.root.children;a?r.children.push({type:"element",tagName:"span",properties:{className:[a]},children:c}):r.children.push(...c)}openNode(i){const a=this,r=i.split(".").map(function(d,p){return p?d+"_".repeat(p):a.options.classPrefix+d}),c=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:r},children:[]};c.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const j9={};function A9(e){const i=e||j9,a=i.aliases,r=i.detect||!1,c=i.languages||k9,u=i.plainText,d=i.prefix,p=i.subset;let h="hljs";const g=T9(c);if(a&&g.registerAlias(a),d){const b=d.indexOf("-");h=b===-1?d:d.slice(0,b)}return function(b,x){zd(b,"element",function(v,y,k){if(v.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const S=O9(v);if(S===!1||!S&&!r||S&&u&&u.includes(S))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const j=V6(v,{whitespace:"pre"});let E;try{E=S?g.highlight(S,j,{prefix:d}):g.highlightAuto(j,{prefix:d,subset:p})}catch(A){const T=A;if(S&&/Unknown language/.test(T.message)){x.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[k,v],cause:T,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!S&&E.data&&E.data.language&&v.properties.className.push("language-"+E.data.language),E.children.length>0&&(v.children=E.children)})}}function O9(e){const i=e.properties.className;let a=-1;if(!Array.isArray(i))return;let r;for(;++a<i.length;){const c=String(i[a]);if(c==="no-highlight"||c==="nohighlight")return!1;!r&&c.slice(0,5)==="lang-"&&(r=c.slice(5)),!r&&c.slice(0,9)==="language-"&&(r=c.slice(9))}return r}function M9(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 $h(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map($h).join(""):U.isValidElement(e)?$h(e.props.children):""}function R9(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 D9(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 JN({html:e,reloadKey:i,className:a}){const r=U.useRef(null);return U.useEffect(()=>{const c=r.current;if(!c)return;const u=d=>{d.source===c.contentWindow&&d.data?.type==="maxcode-preview-ready"&&c.contentWindow?.postMessage({type:"maxcode-preview",html:e},"*")};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[e,i]),l.jsx("iframe",{ref:r,src:"/preview-host.html",title:"Live preview",sandbox:"allow-scripts allow-pointer-lock allow-forms allow-modals",allow:"fullscreen",className:ee("block h-full w-full border-0 bg-white",a)},i)}function z9({html:e,onClose:i}){const[a,r]=U.useState(0);return U.useEffect(()=>{const c=u=>{u.key==="Escape"&&i()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[i]),xl.createPortal(l.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:[l.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[l.jsx("p",{className:"text-[13.5px] font-medium text-ink",children:"Live preview"}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{type:"button",className:"icon-button",onClick:()=>r(c=>c+1),title:"Restart","aria-label":"Restart preview",children:l.jsx(pw,{size:16})}),l.jsx("button",{type:"button",className:"icon-button",onClick:i,title:"Close (Esc)","aria-label":"Close preview",children:l.jsx($i,{size:18})})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-2xl border border-line bg-white shadow-float",children:l.jsx(JN,{html:e,reloadKey:a})})]}),document.body)}function L9({children:e,streaming:i}){const[a,r]=U.useState(!1),[c,u]=U.useState("code"),[d,p]=U.useState(0),[h,g]=U.useState(!1),b=M9(e)||"text",x=U.useMemo(()=>$h(e),[e]),v=!i&&R9(b,x),y=U.useMemo(()=>v?D9(b,x):"",[v,b,x]),k=v&&c==="preview",S=async()=>{try{await navigator.clipboard.writeText(x),r(!0),window.setTimeout(()=>r(!1),1600)}catch{}};return l.jsxs("div",{className:"code-shell group/code",children:[l.jsxs("div",{className:"code-head",children:[v?l.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(j=>l.jsx("button",{type:"button",role:"tab","aria-selected":c===j,onClick:()=>u(j),className:ee("h-6 rounded-md px-2.5 text-[11.5px] font-medium capitalize transition-colors",c===j?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:j},j))}):l.jsx("span",{className:"code-lang",children:b}),l.jsxs("div",{className:"flex items-center gap-0.5",children:[k&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>p(j=>j+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:l.jsx(pw,{size:13})}),l.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:l.jsx(IT,{size:13})})]}),v&&l.jsx("button",{type:"button",onClick:()=>Eh(b==="svg"?"image.svg":"index.html",b==="svg"?x:y,b==="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:l.jsx(Kh,{size:13})}),l.jsxs("button",{type:"button",onClick:S,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?l.jsx(Mn,{size:13}):l.jsx(pd,{size:13}),a?"Copied":"Copy"]})]})]}),k?l.jsx("div",{className:"h-[420px] min-h-[220px] resize-y overflow-hidden border-t border-line/60 bg-white",children:l.jsx(JN,{html:y,reloadKey:d})}):l.jsx("pre",{className:"code-pre thin-scroll",children:e}),h&&l.jsx(z9,{html:y,onClose:()=>g(!1)})]})}function I9({content:e,streaming:i}){return l.jsx("div",{className:ee("md",i&&"is-streaming"),children:l.jsx(ND,{remarkPlugins:[$6],rehypePlugins:[[A9,{detect:!0,ignoreMissing:!0}]],components:{pre:({children:a})=>l.jsx(L9,{streaming:i,children:a}),a:({children:a,href:r})=>l.jsx("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:a})},children:e})})}const eE=U.memo(I9);function Lv(e,i){Vt.approval?Vt.approval.resolveApproval(e,i):ek(e,i)}function tE(e,i){const a=e===""?[]:e.split(`
|
|
245
|
+
`),r=i===""?[]:i.split(`
|
|
246
|
+
`);let c=0;for(;c<a.length&&c<r.length&&a[c]===r[c];)c+=1;let u=a.length,d=r.length;for(;u>c&&d>c&&a[u-1]===r[d-1];)u-=1,d-=1;const p=a.slice(c,u),h=r.slice(c,d),g=a.slice(0,c).map(b=>({type:"ctx",text:b}));if(p.length*h.length>2e6)p.forEach(b=>g.push({type:"del",text:b})),h.forEach(b=>g.push({type:"add",text:b}));else{const b=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)b[y][k]=p[y]===h[k]?b[y+1][k+1]+1:Math.max(b[y+1][k],b[y][k+1]);let x=0,v=0;for(;x<p.length&&v<h.length;)p[x]===h[v]?(g.push({type:"ctx",text:p[x]}),x+=1,v+=1):b[x+1][v]>=b[x][v+1]?(g.push({type:"del",text:p[x]}),x+=1):(g.push({type:"add",text:h[v]}),v+=1);for(;x<p.length;)g.push({type:"del",text:p[x++]});for(;v<h.length;)g.push({type:"add",text:h[v++]})}return a.slice(u).forEach(b=>g.push({type:"ctx",text:b})),g}function U9(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 Zm=120;function B9({before:e,after:i,startLine:a=1}){const r=U.useMemo(()=>{const u=tE(e,i),d=new Array(u.length).fill(!1);u.forEach((x,v)=>{if(x.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 b=!1;return u.forEach((x,v)=>{const y=x.type==="add"?h:p;if(x.type!=="add"&&(p+=1),x.type!=="del"&&(h+=1),!d[v]){b=!0;return}b&&g.length>0&&g.push({key:-v,type:"gap",text:"",no:null,gap:!0}),b=!1,g.push({key:v,type:x.type,text:x.text,no:y})}),g},[e,i,a]),c=r.slice(0,Zm);return l.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:[c.map((u,d)=>u.gap?l.jsx("div",{className:"px-2 text-center text-[10px] text-faint",children:"⋯"},u.key):l.jsxs("div",{style:{animationDelay:`${Math.min(d*14,260)}ms`},className:ee("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:[l.jsx("span",{className:"w-9 shrink-0 select-none pr-2 text-right text-[10px] tabular-nums text-faint/70",children:u.no}),l.jsx("span",{className:ee("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"?"−":" "}),l.jsx("span",{className:"whitespace-pre pr-3",children:u.text||" "})]},u.key)),r.length>Zm&&l.jsxs("div",{className:"px-3 py-1 text-[10px] text-faint",children:["… ",r.length-Zm," more rows"]})]})}function Hg({added:e,removed:i,line:a,column:r,className:c}){return l.jsxs("span",{className:ee("diff-badge inline-flex items-center gap-1.5 font-mono text-[11px] tabular-nums",c),children:[l.jsxs("span",{className:"text-success",children:["+",e]}),l.jsxs("span",{className:"text-danger",children:["−",i]}),a?l.jsxs("span",{className:"text-faint",children:["L",a,r?`:${r}`:""]}):null]})}const $9=new Set(["write_file","edit_file","rewrite_file"]);function nE(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 U9(tE(i,a))}function P9(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 H9(e){return e===void 0?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function F9(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"skill":return"OpenSol wants to load an installed skill.";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 iE({message:e,compact:i=!1}){const[a,r]=U.useState(!i&&e.status==="awaiting"||e.status==="error"),[c,u]=U.useState(!1),d=me(j=>j.notify),p=P9(e.status),h=nk(e.call.name,e.call.args),g=e.call.args,b=nE(e),x=$9.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:"";U.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")}},S=e.status==="done"&&e.durationMs!==void 0?H9(e.durationMs):e.status==="done"?"":p.label.toLowerCase();return l.jsxs("div",{className:"animate-slideleft text-[12.5px]",children:[l.jsxs("button",{type:"button",onClick:()=>r(j=>!j),className:"group/row flex w-full min-w-0 items-baseline gap-1.5 py-[3px] text-left","aria-expanded":a,children:[l.jsx(ud,{size:12,strokeWidth:2,className:ee("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out group-hover/row:text-ink",a&&"rotate-90")}),l.jsx("span",{className:"shrink-0 font-medium text-ink",children:gg(e.call.name)}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] text-muted",children:h||"—"}),x&&b&&e.status==="done"?l.jsx(Hg,{added:b.added,removed:b.removed,line:b.line,column:b.column,className:"shrink-0"}):S&&l.jsx("span",{className:ee("shrink-0 text-[11px]",e.status==="running"?"text-shimmer":e.status==="done"?"text-faint":p.className),children:S})]}),e.status==="awaiting"&&l.jsxs("div",{className:"animate-fade py-1 pl-[18px]",children:[l.jsx("p",{className:"text-[12px] leading-relaxed text-warning",children:F9(e.call.name)}),l.jsxs("p",{className:"mt-1 flex items-center gap-4 text-[12px] font-medium",children:[l.jsx("button",{type:"button",onClick:()=>Lv(e.call.id,!0),className:"text-ink underline decoration-ink/30 underline-offset-[3px] transition-colors hover:decoration-ink",children:"Allow once →"}),l.jsx("button",{type:"button",onClick:()=>Lv(e.call.id,!1),className:"text-muted transition-colors hover:text-ink",children:"Deny"})]})]}),a&&l.jsxs("div",{className:"animate-fade space-y-2 pb-1.5 pl-[18px] pt-0.5",children:[v&&l.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"&&l.jsx(B9,{before:g.oldText,after:g.newText,startLine:b?.line??1}),y&&e.call.name!=="edit_file"&&l.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)}
|
|
247
|
+
… ${y.length-4e3} more characters`:y}),e.result!==void 0&&l.jsxs("div",{children:[l.jsxs("p",{className:"mb-1 flex items-center gap-3 text-[11px] text-faint",children:[l.jsx("span",{children:e.status==="error"?"Error":"Output"}),l.jsx("button",{type:"button",onClick:k,className:"transition-colors hover:text-ink",children:c?"Copied":"Copy"})]}),l.jsx("pre",{className:ee("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"&&l.jsx("p",{className:"text-[11.5px] text-muted",children:e.status==="running"?"Working…":"No result was recorded."})]})]})}function Qm(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):""}function Wm({message:e,sessionId:i,canEdit:a}){const[r,c]=U.useState(!1),[u,d]=U.useState(e.content),p=()=>{const b=u.trim();if(!b)return;const x=Xe.getState().sessions.find(k=>k.id===i),v=x?.messages.findIndex(k=>k.id===e.id)??-1;if(!x||v<0)return;const y=Li("msg");Xe.getState().updateSession(i,{messages:x.messages.slice(0,v)}),Xe.getState().addMessage(i,{...e,id:y,content:b,createdAt:Date.now()}),c(!1),yk(i,y)},h=(e.attachments??[]).filter(b=>b.kind==="image"),g=(e.attachments??[]).filter(b=>b.kind==="text");return r?l.jsx("div",{className:"flex justify-end",children:l.jsxs("div",{className:"w-full max-w-[88%] rounded-2xl border border-accent/40 bg-canvas p-2.5 sm:max-w-[82%]",children:[l.jsx("textarea",{value:u,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&!b.nativeEvent.isComposing&&(b.preventDefault(),p()),b.key==="Escape"&&c(!1)},autoFocus:!0,rows:Math.min(10,Math.max(2,u.split(`
|
|
248
|
+
`).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"}),l.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1",children:[l.jsx("p",{className:"text-[11.5px] text-faint",children:"Sending replaces the reply below."}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("button",{type:"button",onClick:()=>c(!1),className:"h-8 rounded-full px-3 text-[12.5px] text-muted transition-colors hover:text-ink",children:"Cancel"}),l.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"})]})]})]})}):l.jsxs("div",{className:"group/user flex items-start justify-end gap-1.5",children:[a&&e.content&&l.jsx("button",{type:"button",onClick:()=>{d(e.content),c(!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:l.jsx($o,{size:14,strokeWidth:1.7})}),l.jsxs("div",{className:"max-w-[88%] sm:max-w-[82%]",children:[h.length>0&&l.jsx("div",{className:ee("mb-2 grid gap-2",h.length>1?"grid-cols-2":"grid-cols-1"),children:h.map(b=>l.jsx("img",{src:b.dataUrl,alt:b.name,className:"max-h-52 w-full rounded-xl border border-line object-cover"},b.id))}),l.jsxs("div",{className:"rounded-2xl rounded-br-md border border-line/70 bg-canvas px-4 py-2.5",children:[g.length>0&&l.jsx("div",{className:"mb-2 flex flex-wrap gap-1.5",children:g.map(b=>l.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:[l.jsx(as,{size:11}),l.jsx("span",{className:"max-w-[180px] truncate",children:b.name}),l.jsx("span",{className:"text-faint",children:hl(b.size)})]},b.id))}),e.content&&l.jsx("p",{className:"chat-text whitespace-pre-wrap break-words leading-[1.65] text-ink",children:e.content})]})]})]})}const aE=new Set(["write_file","rewrite_file","edit_file"]);function Iv(e){const i=new Set;for(const a of e){if(a.status!=="done"||!aE.has(a.call.name))continue;const r=a.call.args.path;typeof r=="string"&&r&&i.add(r)}return[...i]}function q9({turnId:e,files:i,diff:a}){const r=me(b=>b.askConfirm),c=me(b=>b.notify),[u,d]=U.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 x=await Mj(e),v=[x.restored.length?`restored ${x.restored.length}`:"",x.removed.length?`removed ${x.removed.length}`:"",x.skipped.length?`${x.skipped.length} too large to restore`:""].filter(Boolean);c(`Undone: ${v.join(", ")||"nothing to change"}.`,"success"),d("undone"),await Be.getState().refresh().catch(()=>{})}catch(x){d("idle"),c(x instanceof Error?x.message:"Could not undo those changes.","error")}}};return l.jsxs("p",{className:"flex items-baseline gap-2 text-[12.5px] text-muted",children:[l.jsx("span",{className:"min-w-0 truncate",children:u==="undone"?"Changes undone":`Changed ${p}${h>0?` and ${h} more`:""}`}),u!=="undone"&&a&&l.jsx(Hg,{added:a.added,removed:a.removed,className:"shrink-0"}),u!=="undone"&&l.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 G9({text:e}){const[i,a]=U.useState(!1);return l.jsxs("div",{children:[l.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:[l.jsx(ud,{size:11,strokeWidth:2,className:ee("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out",i&&"rotate-90")}),l.jsx("span",{className:"shrink-0 font-medium text-muted group-hover/think:text-ink",children:"Thought"}),!i&&l.jsx("span",{className:"min-w-0 truncate text-[11px] text-faint",children:e.replace(/\s+/g," ").trim().slice(0,100)})]}),i&&l.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 rE(e){let i=0,a=0,r=!1;for(const c of e){if(!aE.has(c.call.name))continue;const u=nE(c);u&&(r=!0,i+=u.added,a+=u.removed)}return r?{added:i,removed:a}:null}function Y9({tools:e,intermediateMessages:i=[],streaming:a=!1}){const[r,c]=U.useState(!1),u=U.useRef(!1),d=ze(k=>k.autoCollapseWork),p=ze(k=>k.workDetail==="detailed"),h=e.some(k=>k.status==="awaiting"),g=a||e.some(k=>k.status==="running");if(U.useEffect(()=>{h?c(!0):g?(u.current=!0,c(!0)):u.current&&d&&(u.current=!1,c(!1))},[g,h,d]),e.length===0&&i.length===0)return null;const b=[...new Set(e.map(k=>gg(k.call.name)))],x=e.filter(k=>k.status==="error"||k.status==="denied").length,v=b.length<=3?b.join(" · "):`${b.slice(0,3).join(" · ")} +${b.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,S)=>k.time-S.time);return l.jsxs("div",{className:"my-1",children:[l.jsxs("button",{type:"button",onClick:()=>{u.current=!1,c(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:[l.jsx(ud,{size:13,strokeWidth:2,className:ee("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out group-hover/task:text-ink",r&&"rotate-90")}),l.jsx("span",{className:ee("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"}),l.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})`:""]}),x>0&&l.jsxs("span",{className:"shrink-0 text-[12px] text-danger",children:["· ",x," failed"]}),(()=>{const k=rE(e);return k?l.jsx(Hg,{added:k.added,removed:k.removed,className:"shrink-0 text-[11.5px]"}):null})()]}),r&&l.jsx("div",{className:"animate-fade space-y-0.5 pb-1 pl-[19px] pt-1",children:y.map(k=>k.kind==="tool"?l.jsx(iE,{message:k.tool,compact:!p},k.tool.id):l.jsxs("div",{className:"py-1",children:[k.message.reasoning.trim()&&l.jsx(G9,{text:k.message.reasoning}),k.message.content.trim()&&l.jsx("div",{className:"mt-1 text-[12.5px] leading-relaxed text-muted",children:l.jsx(eE,{content:k.message.content})})]},k.message.id))})]})}function Jm({message:e,sessionId:i,streaming:a,isLastAssistant:r,showHeader:c,turnUsage:u}){const d=me(z=>z.notify),p=me(z=>z.openSettings),h=ze(z=>z.showTokenEstimate),g=An(z=>e.provider?z.byProvider[e.provider]:void 0),[b,x]=U.useState(!1),[v,y]=U.useState(!1),k=!!(e.content.trim()||e.reasoning.trim()||e.error),S=g?.find(z=>z.id===e.model)?.name??e.model??"",j=!!(e.error&&/api key|base url|settings|credential|403|401/i.test(e.error)),E=[],A=u?.input||e.usage?.input,T=u?.output||e.usage?.output;A&&E.push(`${Qm(A)} in`),T?E.push(`${Qm(T)} out`):h&&e.content.trim()&&E.push(`~${Qm(Math.ceil(e.content.length/4))} out`);const R=[S,...E,e.durationMs?`${(e.durationMs/1e3).toFixed(1)}s`:""].filter(Boolean).join(" · "),P=async()=>{try{await navigator.clipboard.writeText(e.content),x(!0),window.setTimeout(()=>x(!1),1600)}catch{d("Clipboard access was blocked by the browser.","error")}};return!k&&!a?l.jsx("div",{className:"group",children:l.jsxs("div",{className:"min-w-0",children:[c&&l.jsxs("div",{className:"flex items-center gap-2 text-[12px] font-semibold text-ink",children:["OpenSol",S&&l.jsx("span",{className:"font-normal text-faint",children:S})]}),l.jsx("p",{className:"mt-2 text-[13px] text-muted",children:"The model returned an empty response."}),r&&l.jsxs("button",{type:"button",onClick:()=>Sm(i),className:"mt-2 inline-flex items-center gap-1.5 text-[11.5px] font-medium text-accent hover:underline",children:[l.jsx(Ii,{size:12})," Try again"]})]})}):l.jsx("div",{className:"group",children:l.jsxs("div",{className:"min-w-0",children:[(c||e.stopped)&&l.jsxs("div",{className:"flex min-h-[22px] items-center gap-1.5",children:[c&&l.jsxs(l.Fragment,{children:[l.jsx(gl,{size:15}),l.jsx("span",{className:"text-[12px] font-medium text-muted",children:"OpenSol"}),S&&l.jsx("span",{className:"truncate text-[11.5px] text-faint",children:S})]}),e.stopped&&l.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:[l.jsx(rg,{size:7,fill:"currentColor"}),"Stopped"]})]}),e.reasoning.trim()&&l.jsxs("div",{className:"mt-1",children:[l.jsxs("button",{type:"button",onClick:()=>y(z=>!z),className:"group/think flex max-w-full items-baseline gap-1.5 py-0.5 text-left text-[12.5px]","aria-expanded":v,children:[l.jsx(ud,{size:12,strokeWidth:2,className:ee("relative top-[1px] shrink-0 self-center text-faint transition-transform duration-200 ease-out group-hover/think:text-ink",v&&"rotate-90")}),l.jsx("span",{className:ee("shrink-0 font-medium",a?"text-shimmer":"text-muted group-hover/think:text-ink"),children:a?"Thinking…":"Thought"}),!v&&l.jsx("span",{className:"min-w-0 truncate text-[11.5px] text-faint",children:e.reasoning.replace(/\s+/g," ").trim().slice(0,120)})]}),v&&l.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&&l.jsx("div",{className:"mt-1.5",children:l.jsx(eE,{content:e.content,streaming:a})}),a&&!e.content&&!e.reasoning&&l.jsxs("div",{className:"mt-2 flex items-center gap-2 text-[13px] text-muted",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent"}),l.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent [animation-delay:160ms]"}),l.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent [animation-delay:320ms]"})]}),"Working"]}),e.error&&l.jsx("div",{className:"mt-3 rounded-xl border border-danger/25 bg-danger/[0.045] px-3.5 py-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(fd,{size:15,className:"mt-0.5 shrink-0 text-danger"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"text-[12px] font-medium text-ink",children:"The request did not finish"}),l.jsx("p",{className:"mt-1 whitespace-pre-wrap text-[11.5px] leading-relaxed text-muted",children:e.error}),l.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[j&&l.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:[l.jsx(hw,{size:12}),"Open model settings"]}),r&&l.jsxs("button",{type:"button",onClick:()=>Sm(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:[l.jsx(Ii,{size:12}),"Try again"]})]})]})]})}),k&&!a&&l.jsxs("div",{className:"mt-2 flex min-h-[28px] flex-wrap items-center gap-0.5 text-[11.5px] text-faint",children:[e.content&&l.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:b?"Copied":"Copy",children:b?l.jsx(Mn,{size:14,className:"text-success"}):l.jsx(pd,{size:14,strokeWidth:1.7})}),r&&l.jsx("button",{type:"button",onClick:()=>Sm(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:l.jsx(Ii,{size:14,strokeWidth:1.7})}),l.jsx("span",{className:"ml-2 tabular-nums text-muted",children:R})]})]})})}function V9({turn:e,sessionId:i,streaming:a,lastAssistantId:r,activeTurn:c=!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(c&&p)return l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&l.jsx(Wm,{message:e.user,sessionId:i,canEdit:!a}),e.segments.map((v,y)=>v.kind==="tools"?l.jsx("div",{className:"space-y-0.5",children:v.tools.map(k=>l.jsx(iE,{message:k},k.id))},`tools-${y}`):l.jsx(Jm,{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 l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&l.jsx(Wm,{message:e.user,sessionId:i,canEdit:!a}),d.map(y=>l.jsx(Jm,{message:y,sessionId:i,streaming:a&&y.id===r,isLastAssistant:y.id===r,showHeader:v++===0},y.id))]})}const b=d.slice(0,-1),x=d.reduce((v,y)=>({input:v.input+(y.usage?.input??0),output:v.output+(y.usage?.output??0)}),{input:0,output:0});return l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&l.jsx(Wm,{message:e.user,sessionId:i,canEdit:!a}),l.jsx(Y9,{tools:u,intermediateMessages:b}),g&&l.jsx(Jm,{message:g,sessionId:i,streaming:!1,isLastAssistant:g.id===r,showHeader:!0,turnUsage:x},g.id),e.user&&Iv(u).length>0&&l.jsx(q9,{turnId:e.user.id,files:Iv(u),diff:rE(u)})]})}const K9=[{value:"all",label:"All"},{value:"30d",label:"30d"},{value:"7d",label:"7d"}],X9=["bg-raised","bg-accent/20","bg-accent/35","bg-accent/55","bg-accent/80"];function Z9(e,i){return e<=0?0:i<=1?2:Math.min(4,1+Math.floor(e/i*3))}function Vr({icon:e,label:i,value:a}){return l.jsxs("div",{className:"min-w-0 rounded-lg border border-line/70 bg-canvas px-3 py-2.5",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[11.5px] text-muted",children:[l.jsx(e,{size:12,className:"shrink-0 text-faint"}),l.jsx("span",{className:"truncate",children:i})]}),l.jsx("p",{className:"mt-0.5 truncate text-[20px] font-semibold tracking-[-0.03em] text-ink",title:a,children:a})]})}function Q9(){const e=ze(c=>c.daemon),i=Be(c=>c.info),r=(e?.home??"").split(/[\\/]/).filter(Boolean).pop()||i.name||"there";return l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute inset-0 -z-10 m-auto h-16 w-16 rounded-full bg-accent/20 blur-2xl","aria-hidden":"true"}),l.jsx(Ck,{mood:"wave",size:60})]}),l.jsxs("h1",{className:"text-[28px] font-semibold leading-tight tracking-[-0.035em] text-ink sm:text-[34px]",children:["What should we build, ",l.jsx("span",{className:"text-solar",children:r}),"?"]}),l.jsx("p",{className:"-mt-2 text-[13.5px] text-muted",children:"Local-first agent. Your folder, your keys, your machine."})]})}function W9(){const e=Xe(h=>h.sessions),[i,a]=U.useState("30d"),[r,c]=U.useState("overview"),u=U.useMemo(()=>BM(e,i),[e,i]),d=U.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 l.jsx("div",{className:"relative w-full",children:l.jsxs("section",{className:"relative overflow-hidden rounded-xl border border-line bg-panel",children:[l.jsxs("div",{className:"relative flex flex-wrap items-center justify-between gap-2 border-b border-line/70 px-3 py-2.5",children:[l.jsx("div",{className:"inline-flex items-center rounded-lg bg-raised p-0.5",children:["overview","models"].map(h=>l.jsx("button",{type:"button",onClick:()=>c(h),className:ee("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))}),l.jsx("div",{className:"inline-flex items-center gap-0.5 rounded-lg bg-raised p-0.5",children:K9.map(h=>l.jsx("button",{type:"button",onClick:()=>a(h.value),className:ee("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"?l.jsxs("div",{className:"relative p-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-3",children:[l.jsx(Vr,{icon:c2,label:"Sessions",value:String(u.sessions)}),l.jsx(Vr,{icon:tg,label:"Messages",value:String(u.messages)}),l.jsx(Vr,{icon:oi,label:"Total tokens",value:u.tokens?jo(u.tokens):"0"}),l.jsx(Vr,{icon:F2,label:"Credits spent",value:u.cost>0?Nh(u.cost):"—"}),l.jsx(Vr,{icon:_2,label:"Active days",value:String(u.activeDays)}),l.jsx(Vr,{icon:U2,label:"Peak hour",value:u.peakHour}),l.jsx(Vr,{icon:Hu,label:"Favorite model",value:_m(u.favoriteModel)})]}),l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsx("div",{className:"flex w-max gap-[3px]",children:d.map((h,g)=>l.jsx("div",{className:"grid grid-rows-7 gap-[3px]",children:h.map(b=>l.jsx("span",{className:ee("h-[11px] w-[11px] rounded-[2px]",X9[Z9(b.count,u.busiestDay)]),title:`${b.key} · ${b.count} message${b.count===1?"":"s"}`},b.key))},g))})}),l.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 ~${jo(u.tokens)} tokens across ${u.messages} messages.`,u.favoriteModel!=="—"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"px-1.5 text-line",children:"·"}),u.favoriteShare,"% on ",_m(u.favoriteModel)]})]})]}):l.jsx("div",{className:"relative p-3",children:u.models.length===0?l.jsxs("div",{className:"rounded-xl border border-dashed border-line px-4 py-8 text-center",children:[l.jsx(Hu,{size:18,className:"mx-auto text-faint"}),l.jsx("p",{className:"mt-2 text-[12px] font-medium text-ink",children:"No model usage yet"}),l.jsx("p",{className:"mt-1 text-[11px] text-muted",children:"Models appear here after you send a message."})]}):l.jsx("div",{className:"space-y-2.5",children:u.models.slice(0,6).map(h=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[l.jsx("span",{className:"min-w-0 truncate text-[12px] font-medium text-ink",title:h.model,children:_m(h.model)}),l.jsxs("span",{className:"shrink-0 text-[10.5px] tabular-nums text-faint",children:[jo(h.tokens)," · ",h.messages," msg",h.cost>0?` · ${Nh(h.cost)}`:""]})]}),l.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-raised",children:l.jsx("div",{className:"h-full rounded-full bg-accent/70",style:{width:`${p?Math.max(4,h.tokens/p*100):4}%`}})})]},h.model))})})]})})}function Uv(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Bv(e,i=180){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a}function J9(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 e8({session:e}){const i=U.useMemo(()=>e.messages,[e.messages]),a=i.filter(r=>r.role==="tool").length;return i.length===0?l.jsx("div",{className:"flex h-full items-center justify-center px-6",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Ro,{size:20,className:"mx-auto text-faint"}),l.jsx("p",{className:"mt-2 text-[13px] font-medium text-ink",children:"No trajectory yet"}),l.jsx("p",{className:"mt-1 text-[11.5px] text-muted",children:"Send a message to see every step here."})]})}):l.jsx("div",{className:"thin-scroll h-full overflow-y-auto",children:l.jsxs("div",{className:"mx-auto w-full max-w-[800px] px-4 pb-12 pt-7 sm:px-6",children:[l.jsxs("div",{className:"mb-5 flex items-center justify-between gap-3 border-b border-line pb-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[13px] font-medium text-ink",children:"Trajectory"}),l.jsxs("p",{className:"mt-0.5 text-[11px] text-muted",children:[i.length," step",i.length===1?"":"s"," · ",a," tool call",a===1?"":"s"]})]}),l.jsx("span",{className:"rounded-full border border-line px-2 py-0.5 text-[10px] text-faint",children:"Read-only view"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute bottom-3 left-[13px] top-3 w-px bg-line","aria-hidden":"true"}),l.jsx("div",{className:"space-y-4",children:i.map(r=>{if(r.role==="user")return l.jsxs("div",{className:"relative flex gap-3",children:[l.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:l.jsx(GC,{size:13})}),l.jsxs("div",{className:"min-w-0 flex-1 rounded-xl border border-line bg-panel px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:"You"}),l.jsx("span",{className:"text-[9.5px] tabular-nums text-faint",children:Uv(r.createdAt)})]}),l.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 l.jsxs("div",{className:"relative flex gap-3",children:[l.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:l.jsx(gl,{size:15})}),l.jsxs("div",{className:"min-w-0 flex-1 rounded-xl border border-line bg-panel px-3 py-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[11.5px] font-medium text-ink",children:["OpenSol",r.model&&l.jsx("span",{className:"truncate text-[10px] font-normal text-faint",children:r.model})]}),l.jsxs("span",{className:"flex items-center gap-1.5 text-[9.5px] tabular-nums text-faint",children:[r.stopped&&l.jsx("span",{className:"text-muted",children:"Stopped"}),Uv(r.createdAt)]})]}),h?l.jsx("p",{className:"mt-1 line-clamp-4 whitespace-pre-wrap text-[12px] leading-relaxed text-muted",children:Bv(r.content||r.reasoning)}):l.jsx("p",{className:"mt-1 text-[11px] italic text-faint",children:"Model turn with no text."}),r.error&&l.jsxs("p",{className:"mt-1.5 flex items-start gap-1.5 text-[11px] leading-relaxed text-danger",children:[l.jsx(fd,{size:11,className:"mt-0.5 shrink-0"}),r.error]}),r.toolCalls.length>0&&l.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 c=J9(r),u=r.call.name==="shell",d=["read_file","write_file","edit_file","rewrite_file"].includes(r.call.name),p=u?gw:d?as:Ro;return l.jsxs("div",{className:"relative flex gap-3",children:[l.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:l.jsx(p,{size:12})}),l.jsxs("div",{className:"min-w-0 flex-1 rounded-xl border border-line/80 bg-raised/25 px-3 py-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:gg(r.call.name)}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-muted",children:nk(r.call.name,r.call.args)||"—"}),l.jsxs("span",{className:ee("flex shrink-0 items-center gap-1 text-[10px] font-medium",c.className),children:[r.status==="done"?l.jsx(Mn,{size:10}):l.jsx("span",{className:ee("h-1.5 w-1.5 rounded-full",c.dot)}),c.label,r.durationMs!==void 0&&r.status==="done"?` · ${r.durationMs<1e3?`${r.durationMs}ms`:`${(r.durationMs/1e3).toFixed(1)}s`}`:""]})]}),r.result&&l.jsx("p",{className:"mt-1.5 line-clamp-2 whitespace-pre-wrap break-words font-mono text-[10.5px] leading-relaxed text-faint",children:Bv(r.result,160)})]})]},r.id)})})]}),l.jsxs("p",{className:"mt-6 flex items-center justify-center gap-1 text-[10px] text-faint",children:["End of trajectory ",l.jsx(sw,{size:10})]})]})})}const t8=[{icon:vT,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:jT,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:k2,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:mT,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:cT,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 n8(){const e=Xe(ce=>ce.sessions),i=Xe(ce=>ce.activeId),a=e.find(ce=>ce.id===i)??null,r=Oa(ce=>i?!!ce.streaming[i]:!1),c=ze(),u=ze(ce=>ce.setMode),d=ze(ce=>ce.update),p=me(ce=>ce.notify),h=me(ce=>ce.openSettings),g=me(ce=>ce.focusComposer),b=me(ce=>ce.setWorkspaceOpen),x=me(ce=>ce.setDeployOpen),v=me(ce=>ce.askConfirm),y=Be(ce=>ce.info),k=Be(ce=>ce.git),S=Cd(),[j,E]=U.useState(""),[A,T]=U.useState("chat"),R=U.useRef(null),[P,z]=U.useState(!0),C=U.useRef(i),L=U.useRef(null),G=a?.messages??[],O=G[G.length-1],$=[...G].reverse().find(ce=>ce.role==="assistant")?.id,Z=dl(c),fe=Qn(c),re=vi(ce=>ce.skills.filter(D=>D.enabled).length),te=HM(G),M=mk(G,S),ae=zM(G,r),ne=(ce="auto")=>{const D=R.current;D&&D.scrollTo({top:D.scrollHeight,behavior:ce})};U.useEffect(()=>{if(C.current!==i){C.current=i,z(!0),T("chat"),requestAnimationFrame(()=>ne("auto"));const ce=Xe.getState().sessions.find(D=>D.id===i);ce?.mode&&u(ce.mode)}},[i,u]),U.useEffect(()=>{O&&(O.id!==L.current?(L.current=O.id,O.role==="user"?(z(!0),requestAnimationFrame(()=>ne("auto"))):P&&requestAnimationFrame(()=>ne("auto"))):P&&ne("auto"))},[O,P]),U.useEffect(()=>{if(!P)return;const ce=window.setTimeout(()=>ne("auto"),40);return()=>window.clearTimeout(ce)},[G,P]);const xe=async(ce,D)=>{const B=ze.getState();if(!dl(B))return p(B.provider==="custom"?"Add a base URL for your custom endpoint in Settings → Models.":`Add an API key for ${og(B.provider)} in Settings → Models.`,"error"),h("models"),!1;const se=Qn(B);if(!se)return p("Choose a model before sending a message.","error"),h("models"),!1;let pe=i;(!pe||!Xe.getState().sessions.some(Pe=>Pe.id===pe))&&(pe=Xe.getState().createSession(B.provider,se,B.mode));const Ee=ce.trim(),Le=Li("msg");return Xe.getState().addMessage(pe,{id:Le,role:"user",content:Ee,attachments:D.length>0?D:void 0,createdAt:Date.now()}),Xe.getState().updateSession(pe,{mode:B.mode}),E(""),z(!0),yk(pe,Le),!0},_=ce=>{E(ce),g()},ve=async(ce,D)=>{switch(ce){case"search":return D.trim()?(d({webSearchEnabled:!0}),xe(`Use the web to research this: ${D.trim()}
|
|
249
|
+
|
|
250
|
+
Read the most useful sources, cite the URLs you actually opened, and answer for this workspace.`,[])):(E("/search "),p("Type what you want OpenSol to research.","info"),g(),!1);case"plan":return u("plan"),D.trim()?xe(D.trim(),[]):(p("Plan mode is on: investigation only until you switch to Build.","info"),g(),!0);case"build":return u("build"),D.trim()?xe(D.trim(),[]):(p("Build mode is on: OpenSol can edit files and run commands.","info"),g(),!0);case"new":return Xe.getState().newChat(),g(),!0;case"workspace":return b(!0),!0;case"deploy":return x(!0),!0;case"settings":return h("models"),!0;case"clear":{const B=Xe.getState().sessions.find(pe=>pe.id===i);return!B||B.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"})||(Ju(B.id),Xe.getState().updateSession(B.id,{messages:[]}),Xe.getState().updateSession(B.id,{title:"New conversation"}),p("Conversation cleared.","success")),!0}default:return!1}};return l.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col bg-panel",children:[l.jsx(XM,{session:a,view:A,onViewChange:T}),!a||G.length===0?l.jsxs("div",{className:"thin-scroll relative min-h-0 flex-1 overflow-y-auto",children:[l.jsx("div",{className:"hero-wash pointer-events-none absolute inset-0","aria-hidden":"true"}),l.jsx("div",{className:"bg-dots pointer-events-none absolute inset-0 opacity-70","aria-hidden":"true"}),l.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:[l.jsx("div",{className:"animate-blurin",children:l.jsx(Q9,{})}),l.jsxs("div",{className:"mt-8 w-full animate-rise [animation-delay:120ms]",children:[(!Z||!fe)&&l.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:[l.jsx(Bo,{size:14,className:"shrink-0"}),l.jsx("span",{className:"flex-1",children:Z?"Choose a model to start":"Connect a provider to start"}),l.jsx("span",{className:"text-[11px] font-normal opacity-70",children:"Open settings →"})]}),l.jsx(D0,{value:j,onChange:E,onSend:xe,onStop:()=>{},onCommand:ve,streaming:!1,hints:!0,autoFocus:!0,placeholder:Z?"How can I help you today?":"Add a provider key to start",pixleMood:Z?"idle":"sleepy"}),l.jsx("div",{className:"stagger mt-5 grid grid-cols-2 gap-2 sm:grid-cols-3",children:t8.slice(0,6).map(ce=>l.jsxs("button",{type:"button",onClick:()=>_(ce.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:[l.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:l.jsx(ce.icon,{size:14,strokeWidth:1.8})}),l.jsx("span",{className:"min-w-0 truncate",children:ce.label})]},ce.label))}),l.jsxs("div",{className:"mt-2.5 flex items-center justify-center gap-3 px-1 text-[11px] text-faint",children:[l.jsxs("span",{className:"truncate",children:[y.available?y.name:"No folder open",y.available&&k.available&&k.branch?` · ${k.branch}`:""]}),l.jsx("span",{"aria-hidden":"true",children:"·"}),l.jsxs("span",{className:"shrink-0",children:[re," skill",re===1?"":"s"," ·"," ",Z?fe?"Ready":"Model needed":"Provider needed"]})]})]}),l.jsx("div",{className:"mt-10 animate-rise [animation-delay:420ms]",children:l.jsx(W9,{})})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"relative min-h-0 flex-1",children:A==="trajectory"?l.jsx(e8,{session:a}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:R,onScroll:ce=>{const D=ce.currentTarget,B=D.scrollHeight-D.scrollTop-D.clientHeight;z(B<90)},className:"thin-scroll h-full overflow-y-auto",children:l.jsx("div",{className:"mx-auto w-full max-w-[760px] px-4 pb-12 pt-8 sm:px-6 sm:pt-10",children:te.map((ce,D)=>l.jsx("div",{className:D===0?"animate-rise":"mt-10 animate-rise",children:l.jsx(V9,{turn:ce,sessionId:a.id,streaming:r,lastAssistantId:$,activeTurn:r&&D===te.length-1})},ce.id))})}),!P&&l.jsx("button",{type:"button",onClick:()=>{z(!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:l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(x2,{size:11}),"Jump to latest"]})})]})}),l.jsx("div",{className:"shrink-0 bg-panel px-3 pb-3 pt-1 sm:px-6 sm:pb-4",children:l.jsxs("div",{className:"mx-auto w-full max-w-[760px]",children:[l.jsx(D0,{value:j,onChange:E,onSend:xe,onStop:()=>a&&Ju(a.id),onCommand:ve,streaming:r,placeholder:Z?"How can I help you today?":"Add a provider key to start",contextPct:M.pct,contextTitle:`Context: ~${jo(M.used)} / ${jo(M.limit)} tokens`,pixleMood:ae}),l.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3 px-2 text-[11px] text-faint",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[c.mode==="plan"?l.jsx(Jh,{size:10}):l.jsx(oi,{size:10}),c.mode==="plan"?"Plan mode · read-only tools":re>0?`${re} skill${re===1?"":"s"} loaded`:"Build mode · full tools"]}),l.jsx("span",{className:"hidden sm:inline",children:y.available?`Working in ${y.name}`:"No workspace open"}),l.jsx("span",{className:"sm:hidden",children:c.tools.shell.approval==="ask"?"Shell asks first":"Shell auto-runs"})]})]})})]})]})}const $v=[{id:"desktop",label:"Desktop",icon:ng,width:"100%"},{id:"tablet",label:"Tablet",icon:zC,width:"768px"},{id:"phone",label:"Phone",icon:jC,width:"390px"}];function i8(e){return e.includes("index.html")?"index.html":[...e].sort((i,a)=>i.split("/").length-a.split("/").length||i.localeCompare(a))[0]??""}function a8(){const e=Be(E=>E.entries),[i,a]=U.useState(""),[r,c]=U.useState(""),[u,d]=U.useState(""),[p,h]=U.useState("desktop"),[g,b]=U.useState(0),x=U.useMemo(()=>e.filter(E=>E.type==="file"&&/\.html?$/i.test(E.path)).map(E=>E.path),[e]),v=U.useMemo(()=>{const E=e.filter(A=>A.type==="file");return`${E.length}-${E.reduce((A,T)=>Math.max(A,T.mtime),0)}`},[e]),y=x.includes(u)?u:i8(x),k=U.useCallback(async()=>{c("");try{a((await Aj()).token)}catch(E){a(""),c(E instanceof Error?E.message:"Could not start the preview.")}},[]);U.useEffect(()=>{k()},[k]);const S=i&&y?`/preview/${i}/${encodeURI(y)}?v=${v}.${g}`:"",j=$v.find(E=>E.id===p)?.width??"100%";return x.length===0?l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-8 text-center",children:[l.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-raised text-faint",children:l.jsx(ng,{size:18})}),l.jsx("p",{className:"text-[13px] font-medium text-ink",children:"Nothing to preview yet"}),l.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."})]}):l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 border-b border-line px-2.5 py-2",children:[l.jsx("select",{value:y,onChange:E=>d(E.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:x.map(E=>l.jsx("option",{value:E,children:E},E))}),l.jsx("div",{className:"flex items-center rounded-lg bg-raised/70 p-0.5",children:$v.map(E=>l.jsx("button",{type:"button",onClick:()=>h(E.id),"aria-pressed":p===E.id,title:E.label,"aria-label":E.label,className:ee("flex h-7 w-7 items-center justify-center rounded-md transition-colors",p===E.id?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:l.jsx(E.icon,{size:14,strokeWidth:1.7})},E.id))}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{k(),b(E=>E+1)},title:"Reload preview","aria-label":"Reload preview",children:l.jsx(Ii,{size:14,strokeWidth:1.7})}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",disabled:!S,onClick:()=>window.open(S,"_blank","noopener"),title:"Open in a new tab","aria-label":"Open in a new tab",children:l.jsx(Xh,{size:14,strokeWidth:1.7})})]}),l.jsxs("div",{className:"relative min-h-0 flex-1 overflow-auto bg-raised/40 p-2",children:[r&&l.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:[l.jsx("p",{className:"text-[12px] font-medium text-ink",children:"The preview could not start"}),l.jsx("p",{className:"mt-1 text-[11.5px] leading-relaxed text-muted",children:r}),l.jsx("button",{type:"button",onClick:()=>{k()},className:"mt-2 text-[11.5px] font-medium text-accent hover:underline",children:"Try again"})]}),!r&&!S&&l.jsxs("p",{className:"flex items-center justify-center gap-2 py-8 text-[11.5px] text-faint",children:[l.jsx(Ht,{size:12})," Starting preview…"]}),S&&l.jsx("iframe",{title:`Preview of ${y}`,src:S,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:j}},`${y}-${g}`)]}),l.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."})]})}const Pv={ts:{color:"#3178c6",label:"TS"},tsx:{color:"#2d9fd8",label:"TSX"},js:{color:"#f0c808",label:"JS"},mjs:{color:"#f0c808",label:"MJS"},cjs:{color:"#f0c808",label:"CJS"},jsx:{color:"#e6b800",label:"JSX"},json:{color:"#f59e0b",glyph:"braces"},jsonc:{color:"#f59e0b",glyph:"braces"},json5:{color:"#f59e0b",glyph:"braces"},html:{color:"#e5532d",label:"HTML"},htm:{color:"#e5532d",label:"HTML"},css:{color:"#3b82f6",label:"CSS"},scss:{color:"#cf649a",label:"SCSS"},sass:{color:"#cf649a",label:"SASS"},less:{color:"#2b4c80",label:"LESS"},md:{color:"#4f8fd8",label:"MD"},mdx:{color:"#f9ac00",label:"MDX"},py:{color:"#3b78b0",label:"PY"},rb:{color:"#cc342d",label:"RB"},go:{color:"#00add8",label:"GO"},rs:{color:"#d36f3b",label:"RS"},java:{color:"#e76f00",label:"JAVA"},kt:{color:"#a97bff",label:"KT"},swift:{color:"#f05138",label:"SWIFT"},c:{color:"#5c8dbc",label:"C"},h:{color:"#8a63d2",label:"H"},cpp:{color:"#3d7fc0",label:"C++"},cs:{color:"#7a4fd0",label:"C#"},php:{color:"#777bb3",label:"PHP"},lua:{color:"#2c2d72",label:"LUA"},dart:{color:"#2bb7f6",label:"DART"},vue:{color:"#41b883",label:"VUE"},svelte:{color:"#ff3e00",label:"SVLT"},astro:{color:"#ff5d01",label:"ASTRO"},sql:{color:"#d4a017",label:"SQL"},graphql:{color:"#e535ab",label:"GQL"},gql:{color:"#e535ab",label:"GQL"},sh:{color:"#4caf50",glyph:"terminal"},bash:{color:"#4caf50",glyph:"terminal"},zsh:{color:"#4caf50",glyph:"terminal"},ps1:{color:"#4a7bd0",glyph:"terminal"},bat:{color:"#4caf50",glyph:"terminal"},yml:{color:"#cb4b4b",label:"YML"},yaml:{color:"#cb4b4b",label:"YML"},toml:{color:"#9c4221",label:"TOML"},xml:{color:"#e37933",label:"XML"},svg:{color:"#ffb13b",glyph:"image"},png:{color:"#26a69a",glyph:"image"},jpg:{color:"#26a69a",glyph:"image"},jpeg:{color:"#26a69a",glyph:"image"},gif:{color:"#26a69a",glyph:"image"},webp:{color:"#26a69a",glyph:"image"},avif:{color:"#26a69a",glyph:"image"},ico:{color:"#26a69a",glyph:"image"},bmp:{color:"#26a69a",glyph:"image"},mp4:{color:"#e05d8c",glyph:"video"},mov:{color:"#e05d8c",glyph:"video"},webm:{color:"#e05d8c",glyph:"video"},mkv:{color:"#e05d8c",glyph:"video"},mp3:{color:"#a855f7",glyph:"audio"},wav:{color:"#a855f7",glyph:"audio"},ogg:{color:"#a855f7",glyph:"audio"},flac:{color:"#a855f7",glyph:"audio"},zip:{color:"#b8860b",glyph:"archive"},tar:{color:"#b8860b",glyph:"archive"},gz:{color:"#b8860b",glyph:"archive"},tgz:{color:"#b8860b",glyph:"archive"},rar:{color:"#b8860b",glyph:"archive"},"7z":{color:"#b8860b",glyph:"archive"},pdf:{color:"#e5484d",label:"PDF"},doc:{color:"#2b6cb0",label:"DOC"},docx:{color:"#2b6cb0",label:"DOC"},xls:{color:"#1f8a4c",label:"XLS"},xlsx:{color:"#1f8a4c",label:"XLS"},csv:{color:"#1f8a4c",label:"CSV"},ppt:{color:"#d35230",label:"PPT"},pptx:{color:"#d35230",label:"PPT"},txt:{color:"#8b95a5",glyph:"text"},log:{color:"#8b95a5",glyph:"text"},env:{color:"#d4b106",glyph:"gear"},ini:{color:"#8b95a5",glyph:"gear"},conf:{color:"#8b95a5",glyph:"gear"},lock:{color:"#8b95a5",glyph:"lock"},ttf:{color:"#c2410c",glyph:"font"},otf:{color:"#c2410c",glyph:"font"},woff:{color:"#c2410c",glyph:"font"},woff2:{color:"#c2410c",glyph:"font"},db:{color:"#6b7fd7",glyph:"db"},sqlite:{color:"#6b7fd7",glyph:"db"},wasm:{color:"#7c4dff",label:"WASM"},ipynb:{color:"#f37726",label:"IPYNB"}},eh={"package.json":{color:"#8bc34a",glyph:"braces"},"package-lock.json":{color:"#8b95a5",glyph:"lock"},"tsconfig.json":{color:"#3178c6",glyph:"gear"},"jsconfig.json":{color:"#f0c808",glyph:"gear"},dockerfile:{color:"#2496ed",label:"DKR"},"docker-compose.yml":{color:"#2496ed",label:"DKR"},"docker-compose.yaml":{color:"#2496ed",label:"DKR"},makefile:{color:"#6d8086",glyph:"terminal"},".gitignore":{color:"#f05133",glyph:"tag"},".gitattributes":{color:"#f05133",glyph:"tag"},".npmignore":{color:"#cb3837",glyph:"tag"},".npmrc":{color:"#cb3837",glyph:"gear"},".env":{color:"#d4b106",glyph:"gear"},".editorconfig":{color:"#8b95a5",glyph:"gear"},".prettierrc":{color:"#56b3b4",glyph:"gear"},".eslintrc":{color:"#7c7ce0",glyph:"gear"},"vite.config.ts":{color:"#a259ff",glyph:"gear"},"vite.config.js":{color:"#a259ff",glyph:"gear"},"tailwind.config.js":{color:"#38bdf8",glyph:"gear"},"tailwind.config.ts":{color:"#38bdf8",glyph:"gear"},"readme.md":{color:"#42a5f5",label:"MD"},license:{color:"#d4b106",glyph:"text"},"changelog.md":{color:"#42a5f5",label:"MD"},"claude.md":{color:"#d97757",label:"MD"},"agents.md":{color:"#d97757",label:"MD"}},Hv={color:"#8b95a5",glyph:"text"};function r8(e){const i=e.toLowerCase();if(eh[i])return eh[i];if(i.startsWith(".env"))return eh[".env"];if(/\.(test|spec)\.[a-z]+$/.test(i)){const r=Pv[i.split(".").pop()??""];return{color:"#26b36b",label:r?.label?`${r.label.slice(0,2)}·T`:"TEST"}}if(/\.d\.m?ts$/.test(i))return{color:"#3178c6",label:"D.TS"};const a=i.lastIndexOf(".");return a>0?Pv[i.slice(a+1)]??Hv:Hv}function s8({kind:e,color:i}){const a={stroke:i,strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};switch(e){case"image":return l.jsxs("g",{...a,children:[l.jsx("circle",{cx:"6.3",cy:"8.3",r:"0.9",fill:i,stroke:"none"}),l.jsx("path",{d:"M3.8 12.4l2.7-2.7 1.6 1.6 1.8-2.3 2.3 3.4z",fill:i,fillOpacity:"0.35"})]});case"video":return l.jsx("path",{d:"M6 7.4v4l3.6-2z",fill:i,stroke:i,strokeWidth:"0.8",strokeLinejoin:"round"});case"audio":return l.jsxs("g",{...a,children:[l.jsx("path",{d:"M7.6 12V7.2l3-.8v4.6"}),l.jsx("circle",{cx:"6.5",cy:"12",r:"1.1",fill:i}),l.jsx("circle",{cx:"9.5",cy:"11",r:"1.1",fill:i})]});case"archive":return l.jsxs("g",{...a,children:[l.jsx("path",{d:"M8 3.5v9",strokeDasharray:"1.2 1.2"}),l.jsx("rect",{x:"6.8",y:"9.6",width:"2.4",height:"2.4",rx:"0.5",fill:i,fillOpacity:"0.4"})]});case"lock":return l.jsxs("g",{...a,children:[l.jsx("rect",{x:"5.4",y:"8.6",width:"5.2",height:"3.8",rx:"0.9",fill:i,fillOpacity:"0.3"}),l.jsx("path",{d:"M6.4 8.6V7.4a1.6 1.6 0 013.2 0v1.2"})]});case"gear":return l.jsxs("g",{...a,children:[l.jsx("circle",{cx:"8",cy:"9.6",r:"1.4"}),l.jsx("path",{d:"M8 6.6v.9M8 11.7v.9M5 9.6h.9M10.1 9.6H11M5.9 7.5l.6.6M9.5 11.1l.6.6M5.9 11.7l.6-.6M9.5 8.1l.6-.6"})]});case"terminal":return l.jsxs("g",{...a,children:[l.jsx("path",{d:"M5.2 7.6l2 1.8-2 1.8"}),l.jsx("path",{d:"M8.6 12h2.4"})]});case"font":return l.jsx("path",{d:"M5.2 12.4L8 6.4l2.8 6M6.1 10.6h3.8",...a});case"db":return l.jsxs("g",{...a,children:[l.jsx("ellipse",{cx:"8",cy:"7.2",rx:"2.7",ry:"1.1"}),l.jsx("path",{d:"M5.3 7.2v4.4c0 .6 1.2 1.1 2.7 1.1s2.7-.5 2.7-1.1V7.2M5.3 9.4c0 .6 1.2 1.1 2.7 1.1s2.7-.5 2.7-1.1"})]});case"braces":return l.jsxs("g",{...a,children:[l.jsx("path",{d:"M6.8 6.6c-1 0-1.3.5-1.3 1.2v.8c0 .6-.4.9-.9 1 .5.1.9.4.9 1v.8c0 .7.3 1.2 1.3 1.2"}),l.jsx("path",{d:"M9.2 6.6c1 0 1.3.5 1.3 1.2v.8c0 .6.4.9.9 1-.5.1-.9.4-.9 1v.8c0 .7-.3 1.2-1.3 1.2"})]});case"tag":return l.jsxs("g",{...a,children:[l.jsx("path",{d:"M5.6 9.2l2.4-2.4 2.9 2.9L8.5 12z",fill:i,fillOpacity:"0.3"}),l.jsx("circle",{cx:"8",cy:"8.9",r:"0.55",fill:i,stroke:"none"})]});default:return l.jsx("g",{...a,children:l.jsx("path",{d:"M5.4 7.2h5.2M5.4 9.3h5.2M5.4 11.4h3.2"})})}}function th({name:e,size:i=15,className:a}){const r=r8(e),c=U.useId(),u=r.label,d=u&&u.length>3;return l.jsxs("svg",{viewBox:"0 0 16 16",width:i,height:i,className:ee("shrink-0",a),"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:c,x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0",stopColor:r.color,stopOpacity:"0.2"}),l.jsx("stop",{offset:"1",stopColor:r.color,stopOpacity:"0.07"})]})}),l.jsx("path",{d:"M3.6 1.4h5.6l3.4 3.4v9a1.2 1.2 0 01-1.2 1.2H3.6a1.2 1.2 0 01-1.2-1.2V2.6a1.2 1.2 0 011.2-1.2z",fill:`url(#${c})`,stroke:r.color,strokeOpacity:"0.85",strokeWidth:"1"}),l.jsx("path",{d:"M9.2 1.4v2.2a1.2 1.2 0 001.2 1.2h2.2",fill:r.color,fillOpacity:"0.25",stroke:r.color,strokeOpacity:"0.85",strokeWidth:"1",strokeLinejoin:"round"}),u?l.jsxs(l.Fragment,{children:[l.jsx("rect",{x:"2.4",y:"9",width:"11.2",height:"4.4",rx:"0.9",fill:r.color}),l.jsx("text",{x:"8",y:"12.35",textAnchor:"middle",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontWeight:"800",fontSize:d?3.3:3.9,letterSpacing:d?.1:.2,fill:"#fff",children:u})]}):l.jsx(s8,{kind:r.glyph??"text",color:r.color})]})}const l8={src:{color:"#3b82f6",glyph:"src"},source:{color:"#3b82f6",glyph:"src"},app:{color:"#3b82f6",glyph:"src"},lib:{color:"#6366f1",glyph:"src"},core:{color:"#6366f1",glyph:"src"},components:{color:"#a855f7",glyph:"components"},component:{color:"#a855f7",glyph:"components"},ui:{color:"#a855f7",glyph:"components"},pages:{color:"#a855f7",glyph:"components"},views:{color:"#a855f7",glyph:"components"},styles:{color:"#ec4899",glyph:"style"},css:{color:"#ec4899",glyph:"style"},node_modules:{color:"#6aa84f",glyph:"node"},".git":{color:"#f05133",glyph:"git"},".github":{color:"#8b95a5",glyph:"github"},dist:{color:"#8b95a5",glyph:"dist"},build:{color:"#8b95a5",glyph:"dist"},out:{color:"#8b95a5",glyph:"dist"},".next":{color:"#8b95a5",glyph:"dist"},public:{color:"#14b8a6",glyph:"public"},static:{color:"#14b8a6",glyph:"public"},assets:{color:"#14b8a6",glyph:"public"},images:{color:"#14b8a6",glyph:"public"},test:{color:"#ef4444",glyph:"test"},tests:{color:"#ef4444",glyph:"test"},__tests__:{color:"#ef4444",glyph:"test"},spec:{color:"#ef4444",glyph:"test"},docs:{color:"#0ea5e9",glyph:"docs"},doc:{color:"#0ea5e9",glyph:"docs"},server:{color:"#6366f1",glyph:"server"},api:{color:"#6366f1",glyph:"server"},scripts:{color:"#22c55e",glyph:"config"},config:{color:"#f59e0b",glyph:"config"},".claude":{color:"#d97757",glyph:"config"},".vscode":{color:"#2b8ae8",glyph:"config"}},o8={color:"#e0a526"};function Fv({kind:e,color:i}){const a={stroke:"#fff",strokeWidth:1.15,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.95};switch(e){case"src":return l.jsx("path",{...a,d:"M6.6 8.4L5.2 9.8l1.4 1.4M9.4 8.4l1.4 1.4-1.4 1.4"});case"git":return l.jsxs("g",{...a,children:[l.jsx("circle",{cx:"6.2",cy:"11",r:"0.8"}),l.jsx("circle",{cx:"6.2",cy:"8.6",r:"0.8"}),l.jsx("circle",{cx:"9.8",cy:"9.4",r:"0.8"}),l.jsx("path",{d:"M6.2 9.4v.8M7 8.7c1.6 0 2.1.2 2.1.9"})]});case"node":return l.jsx("path",{...a,d:"M8 7.6l2.3 1.3v2.4L8 12.6l-2.3-1.3V8.9z"});case"dist":return l.jsx("path",{...a,d:"M8 7.6v3.6M6.4 9.8L8 11.4l1.6-1.6"});case"public":return l.jsxs("g",{...a,children:[l.jsx("circle",{cx:"8",cy:"10",r:"2.1"}),l.jsx("path",{d:"M5.9 10h4.2M8 7.9c.8.6.8 3.6 0 4.2M8 7.9c-.8.6-.8 3.6 0 4.2"})]});case"test":return l.jsx("path",{...a,d:"M7.1 7.6h1.8M7.4 7.6v1.9l-1.4 2.4h4l-1.4-2.4V7.6"});case"docs":return l.jsx("path",{...a,d:"M6.2 8h3.6M6.2 9.8h3.6M6.2 11.6h2.2"});case"config":return l.jsxs("g",{...a,children:[l.jsx("circle",{cx:"8",cy:"9.9",r:"1.2"}),l.jsx("path",{d:"M8 7.6v.7M8 11.5v.7M5.7 9.9h.7M9.6 9.9h.7"})]});case"server":return l.jsxs("g",{...a,children:[l.jsx("rect",{x:"5.7",y:"7.6",width:"4.6",height:"1.7",rx:"0.5"}),l.jsx("rect",{x:"5.7",y:"10.1",width:"4.6",height:"1.7",rx:"0.5"})]});case"components":return l.jsx("path",{...a,d:"M6 8.2h2v2H6zM8.4 10.6h2v2h-2zM8.4 8.2h2v1.6h-2z"});case"style":return l.jsx("path",{...a,d:"M8 7.6c1.6 1.4 2.3 2.4 2.3 3.3a2.3 2.3 0 01-4.6 0c0-.9.7-1.9 2.3-3.3z"});case"github":return l.jsx("circle",{...a,cx:"8",cy:"9.9",r:"2.1"});default:return null}}function Ph({name:e,open:i=!1,size:a=16,className:r}){const c=l8[e.toLowerCase()]??o8;return l.jsxs("svg",{viewBox:"0 0 16 16",width:a,height:a,className:ee("shrink-0",r),"aria-hidden":"true",children:[l.jsx("path",{d:"M1.8 3.6A1.2 1.2 0 013 2.4h3.1c.4 0 .7.1.95.4l.75.8H13a1.2 1.2 0 011.2 1.2v7.2A1.2 1.2 0 0113 13.2H3a1.2 1.2 0 01-1.2-1.2z",fill:c.color,fillOpacity:"0.55"}),i?l.jsx("path",{d:"M3.2 6.2a1 1 0 01.96-.7h10.2a.8.8 0 01.78 1l-1.4 5.7a1.2 1.2 0 01-1.17.9H3a1.2 1.2 0 01-1.2-1.2z",fill:c.color}):l.jsx("path",{d:"M1.8 5.6A1.2 1.2 0 013 4.4h10A1.2 1.2 0 0114.2 5.6V12A1.2 1.2 0 0113 13.2H3A1.2 1.2 0 011.8 12z",fill:c.color}),l.jsx("path",{d:i?"M4.3 5.9h9.6":"M2.4 5.1h11.2",stroke:"#fff",strokeOpacity:"0.35",strokeWidth:"0.7",strokeLinecap:"round"}),c.glyph&&!i&&l.jsx(Fv,{kind:c.glyph,color:c.color}),c.glyph&&i&&l.jsx("g",{transform:"translate(0.6 0)",children:l.jsx(Fv,{kind:c.glyph,color:c.color})})]})}function qv(e){return e.messages.filter(i=>i.role==="user").length}function c8(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 u8(){const e=Xe(C=>C.sessions),i=Xe(C=>C.activeId),a=Xe(C=>C.setActive),r=Xe(C=>C.newChat),c=Xe(C=>C.renameSession),u=Xe(C=>C.deleteSession),d=Be(C=>C.info.root),p=Oa(C=>C.streaming),h=Oa(C=>C.titling),g=me(C=>C.askConfirm),b=me(C=>C.notify),x=me(C=>C.focusComposer),[v,y]=U.useState("workspace"),[k,S]=U.useState(null),[j,E]=U.useState(""),A=U.useMemo(()=>[...v==="all"?e:e.filter(L=>L.workspace===d)].sort((L,G)=>G.updatedAt-L.updatedAt),[e,v,d]),T=e.filter(C=>!C.workspace).length,R=()=>{k&&j.trim()&&c(k,j),S(null)},P=async C=>{await g({title:"Delete this session?",body:`“${C.title}” and its messages will be removed from this computer. This cannot be undone.`,confirmLabel:"Delete session",tone:"danger"})&&(Ju(C.id),u(C.id))},z=async C=>{await Vt.titles?.generate(C,{force:!0})||b("The model could not suggest a title right now.","error")};return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-line px-3 py-2.5",children:[l.jsx("div",{className:"relative flex rounded-full bg-raised p-0.5 text-[10.5px] font-medium",children:["workspace","all"].map(C=>l.jsx("button",{type:"button",onClick:()=>y(C),className:ee("relative z-10 rounded-full px-2.5 py-1 transition-colors",v===C?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:C==="workspace"?"This workspace":`All · ${e.length}`},C))}),l.jsxs("button",{type:"button",onClick:()=>{r(),x()},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:[l.jsx(Wr,{size:12})," New"]})]}),l.jsx("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto p-2",children:A.length===0?l.jsxs("div",{className:"px-4 py-10 text-center",children:[l.jsx(HT,{size:22,className:"mx-auto text-faint"}),l.jsx("p",{className:"mt-2 text-[12px] font-medium text-ink",children:"No sessions here yet"}),l.jsx("p",{className:"mt-1 text-[10.5px] leading-relaxed text-faint",children:v==="workspace"&&T>0?`${T} older session${T===1?"":"s"} were started before workspaces were tracked. Switch to “All” to see them.`:"Start a conversation and it shows up here."})]}):A.map((C,L)=>{const G=!!p[C.id],O=c8(C);return l.jsxs("div",{style:{animationDelay:`${Math.min(L*30,300)}ms`},className:ee("session-card group/session animate-slideleft mb-1.5 rounded-xl border px-3 py-2.5 transition-all duration-200",i===C.id?"border-accent/40 bg-accent-soft/60":"border-transparent hover:border-line hover:bg-raised/60"),children:[k===C.id?l.jsx("input",{autoFocus:!0,value:j,onChange:$=>E($.target.value),onBlur:R,onKeyDown:$=>{$.key==="Enter"&&R(),$.key==="Escape"&&S(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"}):l.jsxs("button",{type:"button",onClick:()=>a(C.id),className:"block w-full text-left",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[i===C.id&&l.jsx(Mn,{size:12,className:"shrink-0 text-accent"}),l.jsx("span",{className:ee("min-w-0 flex-1 truncate text-[12.5px] font-medium text-ink",h[C.id]&&"text-shimmer"),children:C.title}),G&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-medium text-accent",children:[l.jsx("span",{className:"h-1.5 w-1.5 animate-breathe rounded-full bg-accent"})," running"]})]}),l.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10px] text-faint",children:[l.jsx("span",{children:ed(C.updatedAt)}),l.jsxs("span",{children:["· ",qv(C)," turn",qv(C)===1?"":"s"]}),O>0&&l.jsxs("span",{children:["· ",O," file",O===1?"":"s"," edited"]}),C.model&&l.jsxs("span",{className:"max-w-[120px] truncate font-mono",children:["· ",C.model]}),C.titleSource==="ai"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 text-accent/80",children:[l.jsx(oi,{size:9})," AI title"]})]})]}),l.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:[l.jsx("button",{type:"button",className:"icon-button h-6 w-6",onClick:()=>{S(C.id),E(C.title)},title:"Rename","aria-label":"Rename session",children:l.jsx($o,{size:11})}),l.jsx("button",{type:"button",className:"icon-button h-6 w-6",onClick:()=>{z(C.id)},disabled:!!h[C.id]||C.messages.length===0,title:"Let the model name this session","aria-label":"Name session with AI",children:l.jsx(oi,{size:11})}),l.jsx("button",{type:"button",className:"icon-button h-6 w-6 hover:!text-danger",onClick:()=>{P(C)},title:"Delete","aria-label":"Delete session",children:l.jsx(sa,{size:11})})]})]},C.id)})})]})}function d8(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 c=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=>c(d.children))};return c(a),a}function f8(e){const i=/\.([a-z0-9]+)$/i.exec(e);return i?i[1].toUpperCase():"TEXT"}function p8({onDone:e}){const i=Be(R=>R.addWorkspace),a=Be(R=>R.info.workspaces),r=me(R=>R.notify),[c,u]=U.useState(""),[d,p]=U.useState(""),[h,g]=U.useState(""),[b,x]=U.useState([]),[v,y]=U.useState(!0),[k,S]=U.useState(""),[j,E]=U.useState(!1),A=async R=>{y(!0),S("");try{const P=await Sj(R);u(P.path),p(P.parent),g(P.home),x(P.entries)}catch(P){S(P instanceof Error?P.message:"Could not read that folder.")}finally{y(!1)}};U.useEffect(()=>{A("")},[]);const T=async R=>{E(!0);try{await i(R),e?.()}catch(P){r(P instanceof Error?P.message:"Could not open that folder.","error")}finally{E(!1)}};return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs("div",{className:"border-b border-line px-4 py-4",children:[l.jsx("p",{className:"font-display text-[19px] font-semibold tracking-[-0.02em] text-ink",children:"Choose a real folder"}),l.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."})]}),l.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{A(d)},disabled:!d||v,"aria-label":"Parent folder",children:l.jsx(f2,{size:13})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{A(h)},disabled:!h||v,"aria-label":"Home folder",children:l.jsx(md,{size:13})}),l.jsx("p",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted",title:c,children:c||"Home"}),v&&l.jsx(Ht,{size:12}),l.jsxs("button",{type:"button",onClick:()=>{T(c)},disabled:!c||j,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:[j?l.jsx(Ht,{size:11}):l.jsx(Mn,{size:11}),"Open"]})]}),a.length>0&&l.jsxs("div",{className:"border-b border-line px-3 py-2",children:[l.jsx("p",{className:"mb-1.5 text-[9px] font-semibold uppercase tracking-[0.13em] text-faint",children:"Recent"}),l.jsx("div",{className:"flex flex-wrap gap-1",children:a.slice(0,6).map(R=>l.jsx("button",{type:"button",onClick:()=>{T(R.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:R.path,children:R.name},R.path))})]}),l.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2 py-2",children:[k&&l.jsx("p",{className:"px-2 py-3 text-[11px] text-danger",children:k}),!v&&!k&&b.length===0&&l.jsx("p",{className:"px-2 py-4 text-[11px] text-faint",children:"This folder has no subfolders."}),b.map(R=>l.jsxs("div",{className:"group flex items-center gap-1",children:[l.jsxs("button",{type:"button",onClick:()=>{A(R.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:[l.jsx(Fu,{size:13,className:"shrink-0 text-faint"}),l.jsx("span",{className:"truncate",children:R.name})]}),l.jsx("button",{type:"button",onClick:()=>{T(R.path)},className:"hidden h-7 rounded-md px-2 text-[10px] font-medium text-accent group-hover:block",children:"Use"})]},R.path))]})]})}function m8(){const e=me(K=>K.workspaceOpen),i=me(K=>K.setWorkspaceOpen),a=me(K=>K.notify),r=me(K=>K.askConfirm),c=Be(K=>K.info),u=Be(K=>K.root),d=Be(K=>K.entries),p=Be(K=>K.loadingTree),h=Be(K=>K.treeError),g=Be(K=>K.activeFile),b=Be(K=>K.file),x=Be(K=>K.content),v=Be(K=>K.dirty),y=Be(K=>K.saving),k=Be(K=>K.openingFile),S=Be(K=>K.git),j=Be(K=>K.gitLoading),E=Be(K=>K.setActiveFile),A=Be(K=>K.saveFile),T=Be(K=>K.setContent),R=Be(K=>K.createEntry),P=Be(K=>K.renameEntry),z=Be(K=>K.deleteEntry),C=Be(K=>K.forgetWorkspace),L=Be(K=>K.loadGit),G=Be(K=>K.refresh),[O,$]=U.useState(""),[Z,fe]=U.useState(new Set),re=Xe(K=>K.sessions.length),[te,M]=U.useState("files"),[ae,ne]=U.useState(!c.available),[xe,_]=U.useState(null),[ve,ce]=U.useState(!1),D=U.useRef(null),B=U.useMemo(()=>d8(d),[d]),se=U.useMemo(()=>{const K=O.trim().toLowerCase();return K?d.filter(be=>be.path.toLowerCase().includes(K)).slice(0,300):null},[d,O]),pe=x?x.split(`
|
|
251
|
+
`).length:0;U.useEffect(()=>{xe&&D.current?.focus()},[xe]),U.useEffect(()=>{ne(!c.available)},[c.available]),U.useEffect(()=>{const K=be=>{!(be.metaKey||be.ctrlKey)||be.key.toLowerCase()!=="s"||!me.getState().workspaceOpen||!Be.getState().activeFile||(be.preventDefault(),Be.getState().saveFile())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[]);const Ee=U.useMemo(()=>{const K=new Map,be=new Set;for(const je of S.entries){K.set(je.path,je.status.trim()||"M");let Oe=je.path.lastIndexOf("/");for(;Oe>0;)be.add(je.path.slice(0,Oe)),Oe=je.path.lastIndexOf("/",Oe-1)}return{files:K,dirs:be}},[S.entries]);if(!e)return null;const Le=async()=>{if(!xe)return;const K=xe.value.trim().replace(/^\/+/,"");if(!K)return _(null);try{if(xe.mode==="rename"){if(!g)return;await P(g,K)}else await R(K,xe.mode==="create-dir"?"dir":"file");_(null)}catch(be){a(be instanceof Error?be.message:"That change failed.","error")}},Pe=async K=>{if(await r({title:"Delete this path?",body:`${K} will be deleted from disk. This cannot be undone.`,confirmLabel:"Delete",tone:"danger"}))try{await z(K)}catch(je){a(je instanceof Error?je.message:"Could not delete that path.","error")}},Fe=async()=>{try{await navigator.clipboard.writeText(x),ce(!0),window.setTimeout(()=>ce(!1),1500)}catch{a("Clipboard access was blocked.","error")}},Se=K=>K.includes("?")||K.includes("A")?"text-success":K.includes("D")?"text-danger":"text-warning",H=(K,be)=>{const je=K.entry.path,Oe=10+be*14;if(K.entry.type==="dir"){const jt=Z.has(je),fn=Ee.dirs.has(je);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>fe($t=>{const ue=new Set($t);return ue.has(je)?ue.delete(je):ue.add(je),ue}),className:"group flex h-[26px] w-full items-center gap-1.5 rounded-md pr-1.5 text-left text-[12px] font-medium text-ink/85 transition-colors hover:bg-raised hover:text-ink",style:{paddingLeft:Oe},title:je,"aria-expanded":!jt,children:[l.jsx(sw,{size:11,strokeWidth:2.2,className:ee("shrink-0 text-faint transition-transform duration-150",!jt&&"rotate-90")}),l.jsx(Ph,{name:K.entry.name,open:!jt,size:16}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:K.entry.name}),fn&&jt&&l.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-warning",title:"Contains changes"}),jt&&K.children.length>0&&l.jsx("span",{className:"shrink-0 rounded-full bg-raised px-1.5 text-[9px] tabular-nums text-faint group-hover:hidden",children:K.children.length}),l.jsx("span",{role:"button",tabIndex:0,onClick:$t=>{$t.stopPropagation(),Pe(je)},onKeyDown:$t=>{$t.key==="Enter"&&Pe(je)},className:"hidden h-5 w-5 items-center justify-center rounded text-faint hover:text-danger group-hover:flex","aria-label":`Delete ${je}`,children:l.jsx(sa,{size:11})})]}),!jt&&K.children.length>0&&l.jsxs("div",{className:"relative",children:[l.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute bottom-0.5 top-0 w-px bg-line/70",style:{left:Oe+5}}),K.children.map($t=>H($t,be+1))]})]},je)}const ot=g===je,Ve=Ee.files.get(je);return l.jsxs("button",{type:"button",onClick:()=>E(je),className:ee("group relative flex h-[26px] w-full items-center gap-1.5 rounded-md pr-2 text-left text-[11.5px] transition-colors",ot?"bg-accent-soft font-medium text-ink":"text-muted hover:bg-raised hover:text-ink"),style:{paddingLeft:Oe+13},title:je,children:[ot&&l.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-1 left-0 w-[3px] rounded-r-full bg-accent"}),l.jsx(th,{name:K.entry.name,size:15}),l.jsx("span",{className:ee("min-w-0 flex-1 truncate",Ve&&Se(Ve)),children:K.entry.name}),Ve&&l.jsx("span",{className:ee("shrink-0 font-mono text-[9px] font-semibold",Se(Ve)),children:Ve.slice(0,1)})]},je)};return l.jsxs(l.Fragment,{children:[l.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"}),l.jsxs("aside",{className:ee("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",te==="preview"&&c.available&&!ae?"sm:w-[min(96vw,620px)] xl:w-[560px]":"xl:w-[390px]"),children:[l.jsxs("div",{className:"flex h-14 shrink-0 items-center gap-2 border-b border-line px-3",children:[l.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-accent-soft text-accent",children:l.jsx(ml,{size:14})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-[12px] font-semibold tracking-[-0.01em] text-ink",children:c.available?c.name:"Workspace"}),l.jsx("p",{className:"truncate text-[9px] text-faint",title:u,children:c.available?u:"No folder open"})]}),c.available&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>ne(!0),title:"Change folder","aria-label":"Change folder",children:l.jsx(Fu,{size:14})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{G().catch(()=>{})},title:"Refresh tree","aria-label":"Refresh tree",children:l.jsx(Ii,{size:13,className:ee(p&&"animate-spin")})})]}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>i(!1),title:"Close workspace","aria-label":"Close workspace",children:l.jsx($i,{size:15})})]}),ae||!c.available?l.jsx(p8,{onDone:()=>ne(!1)}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-line px-2 py-1.5",children:[l.jsx("button",{type:"button",onClick:()=>M("files"),className:ee("h-7 rounded-md px-2.5 text-[11px] font-medium",te==="files"?"bg-raised text-ink":"text-muted hover:text-ink"),children:"Files"}),l.jsx("button",{type:"button",onClick:()=>M("preview"),className:ee("h-7 rounded-md px-2.5 text-[11px] font-medium",te==="preview"?"bg-raised text-ink":"text-muted hover:text-ink"),children:"Preview"}),l.jsxs("button",{type:"button",onClick:()=>M("sessions"),className:ee("h-7 rounded-md px-2.5 text-[11px] font-medium",te==="sessions"?"bg-raised text-ink":"text-muted hover:text-ink"),children:["Sessions ",l.jsxs("span",{className:"text-faint",children:["· ",re]})]}),l.jsxs("button",{type:"button",onClick:()=>M("git"),className:ee("h-7 rounded-md px-2.5 text-[11px] font-medium",te==="git"?"bg-raised text-ink":"text-muted hover:text-ink"),children:["Git ",S.entries.length>0&&l.jsxs("span",{className:"text-warning",children:["· ",S.entries.length]})]}),l.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>_({mode:"create-file",value:""}),title:"New file","aria-label":"New file",children:l.jsx(lw,{size:13})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>_({mode:"create-dir",value:""}),title:"New folder","aria-label":"New folder",children:l.jsx(fT,{size:13})})]})]}),te==="files"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"shrink-0 border-b border-line px-2.5 py-2",children:[l.jsxs("div",{className:"relative",children:[l.jsx(rs,{size:11,className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{value:O,onChange:K=>$(K.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"})]}),xe&&l.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[l.jsx("input",{ref:D,value:xe.value,onChange:K=>_({...xe,value:K.target.value}),onKeyDown:K=>{K.key==="Enter"&&Le(),K.key==="Escape"&&_(null)},placeholder:xe.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"}),l.jsx("button",{type:"button",onClick:()=>{Le()},className:"flex h-7 items-center rounded-md bg-ink px-2 text-[10px] font-medium text-panel",children:l.jsx(Wr,{size:10})}),l.jsx("button",{type:"button",onClick:()=>_(null),className:"icon-button h-7 w-7",children:l.jsx($i,{size:12})})]})]}),l.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&&l.jsx("p",{className:"px-2 py-2 text-[10.5px] text-danger",children:h}),p&&d.length===0&&l.jsxs("p",{className:"flex items-center gap-1.5 px-2 py-3 text-[10.5px] text-faint",children:[l.jsx(Ht,{size:11})," Reading folder…"]}),se?se.map(K=>l.jsxs("button",{type:"button",onClick:()=>K.type==="file"&&E(K.path),className:ee("flex h-7 w-full items-center gap-1.5 rounded-md px-2 text-left font-mono text-[10.5px]",g===K.path?"bg-accent-soft font-medium text-accent":"text-muted hover:bg-raised hover:text-ink"),children:[K.type==="dir"?l.jsx(Ph,{name:K.name,size:15}):l.jsx(th,{name:K.name,size:15}),l.jsx("span",{className:"truncate",children:K.path})]},K.path)):B.map(K=>H(K,0)),!p&&!h&&d.length===0&&l.jsx("p",{className:"px-2 py-4 text-center text-[10.5px] text-faint",children:"This folder is empty."})]}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:g&&b?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 border-b border-line px-3 py-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate font-mono text-[10.5px] font-medium text-ink",children:g}),l.jsxs("p",{className:"mt-0.5 text-[9px] text-faint",children:[f8(g)," · ",pe," lines · ",hl(b.size),v?" · unsaved":" · saved"]})]}),k&&l.jsx(Ht,{size:11}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>_({mode:"rename",value:g}),title:"Rename","aria-label":"Rename",children:l.jsx($o,{size:12})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:Fe,title:"Copy","aria-label":"Copy",children:ve?l.jsx(Mn,{size:12,className:"text-success"}):l.jsx(pd,{size:12})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7 hover:text-danger",onClick:()=>{Pe(g)},title:"Delete","aria-label":"Delete",children:l.jsx(sa,{size:12})}),l.jsxs("button",{type:"button",onClick:()=>{A()},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?l.jsx(Ht,{size:10}):l.jsx(pC,{size:10}),"Save"]})]}),b.binary?l.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."}):l.jsx("textarea",{value:x,onChange:K=>T(K.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"}),l.jsxs("div",{className:"flex h-6 shrink-0 items-center justify-between border-t border-line px-3 text-[8.5px] text-faint",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:ee("h-1 w-1 rounded-full",v?"bg-warning":"bg-success")}),v?"Unsaved changes":"Saved to disk"]}),l.jsx("span",{children:"⌘S to save · UTF-8"})]})]}):l.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[l.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-raised text-faint",children:l.jsx(as,{size:16})}),l.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"No file selected"}),l.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."})]})})]}):te==="preview"?l.jsx(a8,{}):te==="sessions"?l.jsx(u8,{}):l.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-3",children:[l.jsx(cw,{size:14,className:"text-faint"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-[11.5px] font-medium text-ink",children:S.available?S.branch||"detached HEAD":"Not a git repository"}),l.jsx("p",{className:"text-[9.5px] text-faint",children:S.available?`${S.entries.length} changed path${S.entries.length===1?"":"s"}`:S.error})]}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{L()},"aria-label":"Refresh git",children:l.jsx(Ii,{size:12,className:ee(j&&"animate-spin")})})]}),S.entries.length===0?l.jsx("p",{className:"px-3 py-5 text-[10.5px] text-faint",children:"The working tree is clean."}):S.entries.map(K=>l.jsxs("button",{type:"button",onClick:()=>E(K.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-[10px] hover:bg-raised",title:K.path,children:[l.jsx("span",{className:"w-6 shrink-0 font-mono font-semibold text-warning",children:K.status}),l.jsx(th,{name:K.path.split("/").pop()??K.path,size:14}),l.jsx("span",{className:"truncate text-muted",children:K.path})]},`${K.status}-${K.path}`)),l.jsx("div",{className:"border-t border-line p-3",children:l.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 C()},className:"text-[10.5px] font-medium text-faint hover:text-danger",children:"Forget this workspace"})})]})]}),c.available&&!ae&&l.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-1.5 border-t border-line px-3 text-[9px] text-faint",children:[l.jsx(eg,{size:10,className:ee(p&&"animate-spin")}),"Real folder · daemon-scoped access",l.jsxs("span",{className:"ml-auto",children:[d.length," entries"]})]})]})]})}const $u={settings:"maxcode-settings-v1",chats:"maxcode-chats-v1",workspace:"maxcode-workspace-v1"},Au=Ra()((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 tj();const c=h8();c.found&&(r.migration?.migratedAt||(r=(await cj({settings:c.settings,chats:c.chats})).state),g8()),await sE(r),aA(),Gj(),e({phase:"ready",error:""})}catch(r){e({phase:"error",error:r instanceof Error?r.message:"OpenSol could not reach its local daemon."})}}}}));async function sE(e){ze.getState().hydrate(e),Xe.getState().hydrate(e.chats),await Be.getState().hydrate(e.workspace),vi.getState().load()}function Gv(e){if(e)try{return JSON.parse(e)}catch{return}}function h8(){if(typeof window>"u")return{found:!1,settings:void 0,chats:void 0};let e,i,a=!1;try{e=Gv(window.localStorage.getItem($u.settings)),i=Gv(window.localStorage.getItem($u.chats)),a=!!(e||i||window.localStorage.getItem($u.workspace))}catch{}return{found:a,settings:e,chats:i}}function g8(){try{for(const e of Object.values($u))window.localStorage.removeItem(e)}catch{}}const x8=/^[a-z0-9][a-z0-9-]{0,47}$/;function b8(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"&&x8.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 y8(e,i,a){const r=`
|
|
252
|
+
const send = (message) => parent.postMessage(message, '*')
|
|
253
|
+
const api = {
|
|
254
|
+
manifest: ${JSON.stringify({id:e.id,name:e.name})},
|
|
255
|
+
command: (id, label) => send({ type: 'command', id, label }),
|
|
256
|
+
panel: (id, label) => send({ type: 'panel', id, label }),
|
|
257
|
+
log: (message) => send({ type: 'log', message: String(message).slice(0, 500) }),
|
|
258
|
+
network: () => { throw new Error('The sandboxed preview has no network access.') },
|
|
259
|
+
workspace: { list: () => [], read: () => '', write: () => {}, edit: () => false },
|
|
260
|
+
}
|
|
261
|
+
try { ;(function (maxcode) { ${i} })(api) } catch (error) {
|
|
262
|
+
send({ type: 'error', message: String(error && error.message ? error.message : error).slice(0, 500) })
|
|
263
|
+
}
|
|
264
|
+
send({ type: 'ready' })
|
|
265
|
+
`;return`<!doctype html><html><head><meta charset="utf-8"><style>${a}</style></head><body><script>${r}<\/script></body></html>`}function v8(e,i){const a=r=>{r.source===e.contentWindow&&b8(r.data)&&i(r.data)};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)}const w8=5*1024*1024,k8=10*1024*1024,N8=100,E8=64*1024,S8=new Set(["workspace.list","workspace.read","workspace.write","workspace.edit","ui.commands","ui.panels","ui.themes","network.request"]),_8=new Set(["id","name","version","apiVersion","entry","stylesheet","capabilities","domains"]);function kt(e){throw new Error(`Invalid plugin package: ${e}`)}function lE(e){return typeof e=="string"?e:new TextDecoder("utf-8").decode(e)}function od(e){return new TextEncoder().encode(e)}function T8(e,i,a){if(a===2)return;const r=lE(i),c=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(!c)return;const u=c[0].exec(r);if(!u)return;const d=r.slice(0,u.index).split(`
|
|
266
|
+
`).length,p=u[0].length>60?`${u[0].slice(0,60)}…`:u[0];kt(`${c[1]}: found "${p}" at ${e}:${d}`)}function Hh(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 C8(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 Ld(e){(!e||typeof e!="object"||Array.isArray(e))&&kt("manifest must be an object"),Object.keys(e).some(x=>!_8.has(x))&&kt("unknown manifest field");const{id:i,name:a,version:r,apiVersion:c,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"),c!==1&&c!==2&&kt("unsupported API version"),Hh(u),Hh(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"),c===1&&g.some(x=>!S8.has(x))&&kt("invalid capability"),h!==void 0&&!Array.isArray(h)&&kt("domains must be an array");const b=(h??[]).map(C8);return new Set(b).size!==b.length&&kt("duplicate domain"),{id:i,name:a.trim(),version:r,apiVersion:c,entry:u,stylesheet:d,capabilities:[...new Set(g)],domains:b}}function j8(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>N8&&kt("too many files");const r={};let c=0;for(const u of a){const d=Hh(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"?od(p):p;c+=h.byteLength,c>k8&&kt("package is too large"),(d===i.entry||d===i.stylesheet)&&T8(d,h,i.apiVersion),r[d]=typeof p=="string"?p:lE(h)}return i.entry in r||kt("entry file is missing"),i.stylesheet in r||kt("stylesheet file is missing"),od(r[i.entry]).byteLength>2*1024*1024&&kt("entry file is too large"),r}function A8(e){const i=Ld(e?.manifest),a=j8(e?.files,i),r=JSON.stringify(i);od(r).byteLength>E8&&kt("manifest is too large");const u=od(JSON.stringify({format:"cordis-plugin",manifest:i,files:a}));return u.byteLength>w8&&kt("package is too large"),u}function Fg(e){(!e||!(e instanceof Uint8Array)||e.byteLength===0)&&kt("package archive is empty or invalid");let i;try{const c=new TextDecoder("utf-8").decode(e);i=JSON.parse(c)}catch{kt("package is not a valid JSON archive")}(!i||typeof i!="object")&&kt("invalid package format");const a=Ld(i.manifest),r=i.files;return(!r||typeof r!="object")&&kt("missing package files"),{manifest:a,files:r}}const O8=/\.(?:png|jpe?g|gif|webp|ico|woff2?|ttf|otf|eot|wasm|zip|pdf|mp3|mp4)$/i;function M8(e){return O8.test(e)}function R8(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 D8(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 Ld(i)}function z8(e){const i=R8(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 c=Object.keys(a),u=(v,y)=>v!==void 0&&v.endsWith(y)&&c.includes(v)?v:void 0,d=(v,y)=>{if(c.includes(v))return v;const k=c.filter(S=>S.endsWith(y)).sort();return k.find(S=>S.slice(S.lastIndexOf("/")+1)===v)??k[0]};let p,h;if(r!==void 0)try{p=D8(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 b=u(p?.stylesheet,".css")??d("main.css",".css")??"main.css",x=c.filter(v=>v!==g&&v!==b&&/\.(?:m?js|cjs|jsx|tsx?|css)$/i.test(v));if(x.length>0)throw new Error(`A plugin package holds one script and one stylesheet. Remove or merge: ${x.join(", ")}.`);return{entry:g,stylesheet:b,files:a,manifest:p,manifestError:h}}const L8=["workspace.list","workspace.read","workspace.write","workspace.edit","ui.commands","ui.panels","ui.themes","network.request"],I8=".js,.css,.json,.txt,.html,.svg,.png,.jpg,.jpeg,.gif,.webp,.woff,.woff2",Ou="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 U8(e){const i=e.webkitRelativePath||e.name;return{path:i,content:M8(i)?new Uint8Array(await e.arrayBuffer()):await e.text()}}function B8({onInstalled:e}){const i=me(C=>C.notify),[a,r]=U.useState("my-plugin"),[c,u]=U.useState("My plugin"),[d,p]=U.useState("1.0.0"),[h,g]=U.useState(1),[b,x]=U.useState(["ui.commands"]),[v,y]=U.useState(""),[k,S]=U.useState(null),j=U.useRef(null),E=U.useRef(null),A=async C=>{if(C?.length)try{const L=await Promise.all([...C].map(U8)),G=z8(L);S(G),G.manifest&&(r(G.manifest.id),u(G.manifest.name),p(G.manifest.version),g(G.manifest.apiVersion===2?2:1),x(G.manifest.capabilities),y(G.manifest.domains.join(", "))),i(G.manifestError?`Loaded ${Object.keys(G.files).length} file(s). Its manifest.json was ignored: ${G.manifestError}`:`Loaded ${Object.keys(G.files).length} file(s) — entry ${G.entry}.`,G.manifestError?"error":"info")}catch(L){S(null),i(L instanceof Error?L.message:"Those files are not a plugin folder.","error")}},T=()=>{try{if(!k)throw new Error("Load a plugin folder or its files first.");const C={id:a.trim(),name:c.trim(),version:d.trim(),apiVersion:h,entry:k.entry,stylesheet:k.stylesheet,capabilities:h===2?[]:b,domains:v.split(/[\s,]+/).map(G=>G.trim()).filter(Boolean)};Ld(C);const L={...k.files};return L[C.stylesheet]??="",{archive:A8({manifest:C,files:L})}}catch(C){return i(C instanceof Error?C.message:"That package could not be built.","error"),null}},R=()=>{const C=T();if(!C)return;const L=URL.createObjectURL(new Blob([C.archive],{type:"application/json"})),G=document.createElement("a");G.href=L,G.download=`${a.trim()||"plugin"}.plugin.json`,G.click(),URL.revokeObjectURL(L)},P=async()=>{const C=T();if(C)try{const{plugin:L}=await vw(C.archive);e?.(L),i(`${L.manifest.name} installed. It starts sandboxed and disabled.`,"success")}catch(L){i(L instanceof Error?L.message:"The daemon rejected this package.","error")}},z=k?Object.keys(k.files):[];return l.jsxs("details",{className:"rounded-xl border border-line bg-raised/20",children:[l.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2.5 text-[11.5px] font-medium text-ink",children:[l.jsx(uw,{size:13,className:"text-faint"}),"Build a plugin package from a folder"]}),l.jsxs("div",{className:"space-y-2.5 border-t border-line px-3 py-3",children:[l.jsxs("p",{className:"text-[10.5px] leading-relaxed text-faint",children:["Load a plugin folder, or the files themselves. One ",l.jsx("code",{className:"font-mono",children:".js"})," entry and one optional ",l.jsx("code",{className:"font-mono",children:".css"})," stylesheet become the package. A"," ",l.jsx("code",{className:"font-mono",children:"manifest.json"})," in the folder fills these fields in; the fields win."]}),l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-panel px-2.5 py-2",children:[l.jsx(Pi,{checked:h===2,onChange:C=>g(C?2:1),label:"API v2"}),l.jsx("span",{className:"text-[10.5px] font-medium text-ink",children:"API v2 — free plugin (full app access)"}),h===2&&l.jsx("span",{className:"ml-auto text-[9.5px] text-accent",children:"ctx = Cordis kernel scope"})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>j.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:[l.jsx(ow,{size:12}),"Load folder"]}),l.jsxs("button",{type:"button",onClick:()=>E.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:[l.jsx(lT,{size:12}),"Load files"]}),l.jsx("input",{type:"file",multiple:!0,ref:C=>{j.current=C,C&&(C.webkitdirectory=!0)},className:"hidden",onChange:C=>{A(C.target.files),C.target.value=""}}),l.jsx("input",{ref:E,type:"file",multiple:!0,accept:I8,className:"hidden",onChange:C=>{A(C.target.files),C.target.value=""}})]}),k&&l.jsxs("div",{className:"rounded-lg border border-line bg-panel/60 px-2.5 py-2",children:[l.jsxs("p",{className:"text-[10.5px] text-muted",children:[l.jsxs("span",{className:"font-medium text-ink",children:[z.length," file(s)"]})," · entry"," ",l.jsx("code",{className:"font-mono",children:k.entry})," · stylesheet"," ",l.jsx("code",{className:"font-mono",children:k.stylesheet})]}),l.jsxs("ul",{className:"mt-1 space-y-0.5",children:[z.slice(0,6).map(C=>l.jsxs("li",{className:"truncate font-mono text-[9.5px] text-faint",children:[C," · ",hl(typeof k.files[C]=="string"?new TextEncoder().encode(k.files[C]).length:k.files[C].byteLength)]},C)),z.length>6&&l.jsxs("li",{className:"font-mono text-[9.5px] text-faint",children:["+",z.length-6," more"]})]})]}),l.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Id"}),l.jsx("input",{className:Ou,value:a,onChange:C=>r(C.target.value)})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Name"}),l.jsx("input",{className:Ou,value:c,onChange:C=>u(C.target.value)})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Version"}),l.jsx("input",{className:Ou,value:d,onChange:C=>p(C.target.value)})]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Capabilities"}),l.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:h===2?l.jsx("p",{className:"text-[10px] text-faint",children:"Not needed — API v2 plugin has full access via the Cordis context."}):L8.map(C=>{const L=b.includes(C);return l.jsx("button",{type:"button",onClick:()=>x(G=>L?G.filter(O=>O!==C):[...G,C]),className:`rounded-full border px-2 py-1 font-mono text-[9.5px] ${L?"border-accent/40 bg-accent-soft text-ink":"border-line text-faint"}`,children:C},C)})})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Network domains (optional, comma separated)"}),l.jsx("input",{className:Ou,value:v,placeholder:"Leave empty — a plugin that needs no network declares none",onChange:C=>y(C.target.value)})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("button",{type:"button",onClick:R,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"}),l.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 $8({plugin:e}){const i=me(b=>b.notify),[a,r]=U.useState(null),[c,u]=U.useState([]),d=U.useRef(null),[p,h]=U.useState(!1);U.useEffect(()=>{if(!(!d.current||!a))return v8(d.current,b=>{const x=b,v=x.type==="ready"?"Sandbox ready — no app access, no network.":`${x.type}: ${x.message??x.label??""}`;u(y=>[...y.slice(-5),v])})},[a]);const g=async()=>{h(!0);try{const b=await yw(e.id),{files:x,manifest:v}=Fg(b);u([]),r(y8(v,x[v.entry]??"",x[v.stylesheet]??""))}catch(b){i(b instanceof Error?b.message:"This plugin could not be previewed.","error")}finally{h(!1)}};return l.jsxs(l.Fragment,{children:[l.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:[l.jsx(Zh,{size:11}),a?"Stop preview":"Preview in sandbox"]}),a&&l.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-line",children:[l.jsx("iframe",{ref:d,title:`${e.manifest.name} preview`,sandbox:"allow-scripts",srcDoc:a,className:"h-52 w-full bg-panel"}),l.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:c.map((b,x)=>l.jsx("p",{className:"truncate",children:b},x))})]})]})}const P8={"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 H8(){const e=me(k=>k.notify),i=me(k=>k.askConfirm),[a,r]=U.useState([]),[c,u]=U.useState(!1),[d,p]=U.useState(null),h=U.useRef(null),g=async()=>{try{r((await bw()).plugins)}catch(k){e(k instanceof Error?k.message:"Could not list plugins.","error")}};U.useEffect(()=>{g()},[]);const b=k=>{r(S=>S.map(j=>j.id===k.id?k:j))},x=async k=>{u(!0);try{Fg(new Uint8Array(await k.arrayBuffer()));const{plugin:S}=await vw(new Uint8Array(await k.arrayBuffer()));r(j=>[...j.filter(E=>E.id!==S.id),S]),p(S.id),e(`${S.manifest.name} installed. It starts sandboxed and disabled.`,"success")}catch(S){e(S instanceof Error?S.message:"That file is not a valid plugin package.","error")}finally{u(!1)}},v=async(k,S,j)=>{try{b((await aj(k.id,{capabilities:S,domains:j})).plugin)}catch(E){e(E instanceof Error?E.message:"Could not save plugin permissions.","error")}},y=async k=>{if(k.safe){b((await o0(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"})&&b((await o0(k.id,!0)).plugin)};return l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"rounded-xl border border-line bg-raised/20 p-3",children:[l.jsx("h3",{className:"text-[12px] font-medium text-ink",children:"Install a local plugin"}),l.jsxs("p",{className:"mt-1 text-[10.5px] leading-relaxed text-faint",children:["OpenSol installs ",l.jsx("code",{className:"font-mono",children:".plugin.json"})," packages you pick from this machine. New plugins start sandboxed and disabled until you review them."]}),l.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[l.jsxs("button",{type:"button",disabled:c,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:[l.jsx(ml,{size:12}),"Choose plugin package"]}),l.jsx("input",{ref:h,type:"file",accept:".plugin.json,.pluginmax,application/json,application/zip",className:"hidden",onChange:k=>{const S=k.target.files?.[0];k.target.value="",S&&x(S)}})]})]}),a.length===0?l.jsx("p",{className:"rounded-lg border border-line bg-raised/30 px-3 py-3 text-[10.5px] text-faint",children:"No plugins installed."}):l.jsx("div",{className:"space-y-2",children:a.map(k=>{const S=d===k.id;return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-line",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[l.jsx(gd,{size:14,className:"shrink-0 text-faint"}),l.jsxs("button",{type:"button",onClick:()=>p(S?null:k.id),className:"min-w-0 flex-1 text-left",children:[l.jsx("span",{className:"block truncate text-[11.5px] font-medium text-ink",children:k.manifest.name}),l.jsxs("span",{className:"block truncate text-[9.5px] text-faint",children:[k.id," · v",k.manifest.version," ·"," ",k.safe?"Safe — runs unsandboxed":"Sandboxed"]})]}),l.jsx(Pi,{checked:k.enabled,disabled:!k.safe,label:`Enable ${k.manifest.name}`,onChange:async j=>{b((await rj(k.id,j)).plugin)}})]}),S&&l.jsxs("div",{className:"space-y-2.5 border-t border-line px-3 py-3",children:[l.jsxs("div",{className:ee("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?l.jsx(kC,{size:13,className:"mt-0.5 shrink-0 text-warning"}):l.jsx(yr,{size:13,className:"mt-0.5 shrink-0 text-faint"}),l.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."})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[10.5px] font-medium text-ink",children:"Capabilities"}),l.jsxs("div",{className:"mt-1.5 space-y-1",children:[k.manifest.capabilities.length===0&&l.jsx("p",{className:"text-[10px] text-faint",children:"This plugin requests no capabilities."}),k.manifest.capabilities.map(j=>l.jsxs("label",{className:"flex items-center gap-2 text-[10.5px] text-muted",children:[l.jsx("input",{type:"checkbox",className:"accent-[rgb(var(--accent))]",checked:k.grants.capabilities.includes(j),onChange:E=>{v(k,E.target.checked?[...k.grants.capabilities,j]:k.grants.capabilities.filter(A=>A!==j),k.grants.domains)}}),l.jsx("span",{className:"flex-1",children:P8[j]}),l.jsx("code",{className:"font-mono text-[9.5px] text-faint",children:j})]},j))]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[10.5px] font-medium text-ink",children:"Network domains"}),k.manifest.domains.length===0?l.jsx("p",{className:"mt-1 text-[10px] text-faint",children:"This plugin declares no network access."}):l.jsx("div",{className:"mt-1.5 space-y-1",children:k.manifest.domains.map(j=>l.jsxs("label",{className:"flex items-center gap-2 text-[10.5px] text-muted",children:[l.jsx("input",{type:"checkbox",className:"accent-[rgb(var(--accent))]",checked:k.grants.domains.includes(j),onChange:E=>{v(k,k.grants.capabilities,E.target.checked?[...k.grants.domains,j]:k.grants.domains.filter(A=>A!==j))}}),l.jsx("code",{className:"flex-1 font-mono text-[10px]",children:j})]},j))})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5",children:[l.jsx($8,{plugin:k}),l.jsx("button",{type:"button",onClick:()=>{y(k)},className:ee("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"}),l.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 sj(k.id),r(E=>E.filter(A=>A.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:[l.jsx(sa,{size:11}),"Uninstall"]})]})]})]},k.id)})}),l.jsx(B8,{onInstalled:k=>r(S=>[...S.filter(j=>j.id!==k.id),k])})]})}const F8=/^[a-z0-9][a-z0-9-]{0,47}$/;function q8(e,i){return!!e?.capabilities.includes(i)}function G8(e,i,a){let r;try{const c=new URL(a);if(c.protocol!=="https:"||c.port&&c.port!=="443")return null;r=c.hostname.toLowerCase()}catch{return null}return!i.includes(r)||!e?.domains.includes(r)?null:r}function Fh(){return{commands:new Map,panels:new Map,themes:new Map}}function Y8(e){throw new Error(`The plugin was not granted ${e}.`)}function V8(e,i,a,r=Fh()){const c=d=>{q8(i,d)||Y8(d)},u=d=>{if(!F8.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(c("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(c("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(c("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=>(c("workspace.list"),a.workspace.list(d)),read:async d=>(c("workspace.read"),a.workspace.read(d)),write:async(d,p)=>(c("workspace.write"),a.workspace.write(d,p)),edit:async(d,p,h)=>(c("workspace.edit"),a.workspace.edit(d,p,h))},network:{request(d,p){if(c("network.request"),!G8(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 oE=e=>`maxcode-plugin-style-${e}`,nh="plugin-";function K8(e){return Object.entries(e).filter(([i,a])=>/^[a-z][a-z0-9-]*$/.test(i)&&/^[\d\s.]+$/.test(a))}function X8(e){const i=(e.canvas??"").trim().split(/\s+/).map(Number),[a,r,c]=i.length===3?i:[255,255,255];return .2126*a+.7152*r+.0722*c<110}function Z8(e,i){const a=K8(i).map(([r,c])=>`--${r}:${c.trim()}`);return a.length===0?"":`[data-theme='${e}']{${a.join(";")}}`}function cE(e){return document.getElementById(oE(e))}function Yv(e,i){let a=cE(e);a||(a=document.createElement("style"),a.id=oE(e),document.head.append(a)),a.textContent=i}function Q8(e){cE(e)?.remove()}async function Vv(e,i){const a=globalThis,r=URL.createObjectURL(new Blob([`const maxcode = globalThis.__maxcodePluginApi;
|
|
267
|
+
${e}
|
|
268
|
+
`],{type:"text/javascript"}));a.__maxcodePluginApi=i;try{await import(r)}finally{delete a.__maxcodePluginApi,URL.revokeObjectURL(r)}}function W8(){const e=new Map,i=new Map,a=r=>{const c=i.get(r);c&&(i.delete(r),c.dispose());const u=e.get(r);if(u)for(const d of u.themes.keys())Mw(`${nh}${r}:${d}`);e.delete(r),Q8(r)};return{contributions:e,contributionsFor:r=>e.get(r)??Fh(),themes(){const r=[];for(const[c,u]of e)for(const[d,p]of u.themes)r.push({id:`${nh}${c}:${d}`,label:p.label});return r},commands(){const r=[];for(const[c,u]of e)for(const[d,p]of u.commands)r.push({pluginId:c,id:d,label:p.label,run:p.run});return r},async activate(r,c){if(a(r.id),!r.safe||!r.enabled)return;const{files:u,manifest:d}=Fg(await yw(r.id));if(d.apiVersion===2){let p,h;const g=new Promise((v,y)=>{p=v,h=y}),b=async v=>{const y=u[d.stylesheet]??"";y&&Yv(r.id,y);try{await Vv(u[d.entry]??"",v),p()}catch(k){h(k)}},x=Vt.plugin(b);i.set(r.id,x);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)??Fh();e.set(r.id,p);const h=V8(r,r.grants,c,p);try{await Vv(u[d.entry]??"",Object.freeze(h));const g=[...p.themes.entries()].map(([b,x])=>{const v=`${nh}${r.id}:${b}`;return Ow({id:v,label:x.label,dark:X8(x.palette)}),Z8(v,x.palette)}).join(`
|
|
269
|
+
`);Yv(r.id,`${u[d.stylesheet]??""}
|
|
270
|
+
${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 c of r)a(c)}}}const J8={workspace:{async list(e=""){return(await kw(e)).entries.map(a=>({path:a.path,name:a.name,type:a.type}))},async read(e){return(await sh(e)).content},async write(e,i){await lh(e,i)},async edit(e,i,a){const r=await sh(e);return r.content.includes(i)?(await lh(e,r.content.replace(i,a)),!0):!1}},network:(e,i)=>lj(e,i)};let Kv=null;function uE(){return Kv??=W8(),Kv}async function eI(e){const i=new Set(e.filter(r=>r.safe&&r.enabled).map(r=>r.id)),a=uE();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,J8)}catch(c){console.error(c)}}const No=[{id:"general",label:"General",icon:TC,description:"Permissions, appearance and conversation display."},{id:"models",label:"Models",icon:Hu,description:"Providers, encrypted keys, live models and reasoning defaults."},{id:"tools",label:"Tools",icon:Ro,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:oi,description:"Skill folders the agent loads on demand: upload a folder or install from npm."},{id:"plugins",label:"Plugins",icon:gd,description:"Plugins are temporarily disabled for maintenance.",disabled:!0},{id:"mcp",label:"MCP",icon:Wh,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:Jr,description:"Hosting credentials and command-line tools."},{id:"appearance",label:"Appearance",icon:dw,description:"Theme and interface preferences."},{id:"about",label:"About",icon:Qh,description:"Local storage, history and reset controls."}],br="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 ns({children:e,hint:i}){return l.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-3",children:[l.jsx("span",{className:"text-[11px] font-medium text-ink",children:e}),i&&l.jsx("span",{className:"text-[9.5px] text-faint",children:i})]})}function Rn({title:e,description:i,children:a,action:r}){return l.jsxs("section",{className:"settings-card mx-5 my-4 sm:mx-8",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("h3",{className:"flex items-center gap-2 font-display text-[14px] font-semibold tracking-[-0.01em] text-ink",children:[l.jsx("span",{className:"h-3.5 w-[3px] rounded-full bg-accent"}),e]}),i&&l.jsx("p",{className:"mt-1.5 max-w-[620px] text-[11.5px] leading-relaxed text-muted",children:i})]}),r&&l.jsx("div",{className:"shrink-0",children:r})]}),l.jsx("div",{className:"mt-4",children:a})]})}function qg({value:e,onChange:i,placeholder:a,disabled:r,label:c}){const[u,d]=U.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:u?"text":"password",value:e,onChange:p=>i(p.target.value),placeholder:a,disabled:r,autoComplete:"off",spellCheck:!1,"aria-label":c,className:ee(br,"pr-8 font-mono text-[11px]")}),l.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?l.jsx(W2,{size:12}):l.jsx(Zh,{size:12})})]})}const tI=[];function nI(e){return e?e>=1e3?`${Math.round(e/1e3)}k`:String(e):""}const iI={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 aI({providerId:e,open:i,onToggle:a}){const r=ze(),c=ze(M=>M.selectModel),u=ze(M=>M.updateProvider),d=ze(M=>M.saveProviderKey),p=me(M=>M.notify),h=me(M=>M.askConfirm),g=An(M=>M.fetchModels),b=An(M=>M.byProvider[e])??tI,x=An(M=>!!M.loading[e]),v=An(M=>M.errors[e]??""),y=An(M=>M.notes[e]??""),k=An(M=>M.source[e]??""),[S,j]=U.useState(""),[E,A]=U.useState(""),[T,R]=U.useState(!1),P=ra[e],z=r.providerStatus.find(M=>M.id===e),C=yd(r,e),L=r.provider===e,G=r.providers[e]?.baseUrl??"",O=z?.hint??"",$=Qn(r),Z=b.find(M=>M.id===$);U.useEffect(()=>{if(!i||!C)return;const M=window.setTimeout(()=>{g(e)},400);return()=>window.clearTimeout(M)},[i,C,e,G,g]);const fe=async()=>{const M=S.trim();if(!M){p(`Paste a ${P.name} API key first.`,"error");return}const ae=iI[e];if(ae&&!M.startsWith(ae.prefix)){let ne="";e==="openrouter"&&M.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 ${ae.label} must start with "${ae.prefix}"${ne}`,"error");return}R(!0);try{await d(e,M),j(""),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{R(!1)}},re=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(ae){p(ae instanceof Error?ae.message:"Could not remove that key.","error")}},te=async()=>{if(b.length===0){const M=await g(e,!0);M[0]?c(e,M[0].id):p("No usable model was returned by this provider.","error");return}c(e,b[0].id)};return l.jsxs("div",{className:ee("rounded-xl border transition-colors",i?"border-line bg-raised/25":"border-line bg-panel"),children:[l.jsxs("button",{type:"button",onClick:a,className:"flex w-full items-center gap-3 px-3 py-2.5 text-left",children:[l.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)}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[12px] font-medium text-ink",children:P.name}),L&&l.jsx("span",{className:"rounded bg-accent-soft px-1.5 py-0.5 text-[8.5px] font-medium text-accent",children:"Active"})]}),l.jsxs("span",{className:ee("mt-0.5 flex items-center gap-1 text-[9.5px]",C?"text-success":"text-faint"),children:[l.jsx("span",{className:ee("h-1 w-1 rounded-full",C?"bg-success":"bg-faint")}),C?e==="custom"?"Endpoint configured":P.keyless?"No key needed":`Connected ${O}`:P.keyless?"Local endpoint":"No key"]})]}),!i&&l.jsx("span",{className:"hidden max-w-[170px] truncate text-[9.5px] text-faint sm:block",children:L&&$?Z?.name??$:b.length?`${b.length} live models`:""}),l.jsx(dd,{size:14,className:ee("shrink-0 text-faint transition-transform",i&&"rotate-180")})]}),i&&l.jsxs("div",{className:"border-t border-line px-3 pb-3 pt-3",children:[!P.keyless&&l.jsxs("div",{className:"mb-2.5",children:[l.jsx(ns,{hint:C?"Saved and encrypted":"Required",children:"API key"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("div",{className:"min-w-0 flex-1",children:l.jsx(qg,{value:S,onChange:j,placeholder:C?`Replace key ${O}`:P.keyHint,label:`${P.name} API key`})}),l.jsxs("button",{type:"button",onClick:()=>{fe()},disabled:!S.trim()||T,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:[T?l.jsx(Ht,{size:10}):l.jsx(hd,{size:10}),"Save"]})]}),C&&l.jsx("button",{type:"button",onClick:()=>{re()},className:"mt-1.5 text-[9.5px] font-medium text-faint transition-colors hover:text-danger",children:"Remove saved key"})]}),l.jsxs("div",{className:"mb-2.5",children:[l.jsx(ns,{hint:e==="custom"?"Required":"Optional",children:"Base URL"}),l.jsx("input",{value:G,onChange:M=>u(e,{baseUrl:M.target.value}),placeholder:P.baseUrl||"https://example.com/v1",spellCheck:!1,className:ee(br,"font-mono text-[11px]")}),l.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&&l.jsx("p",{className:"mb-2.5 text-[9.5px] leading-relaxed text-faint",children:P.note}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-[11px] font-medium text-ink",children:"Model"}),l.jsxs("button",{type:"button",onClick:()=>{g(e,!0)},disabled:!C||x,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:[x?l.jsx(Ht,{size:10}):l.jsx(Ii,{size:10}),x?"Loading":"Refresh live models"]})]}),v&&l.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&&l.jsx("p",{className:"mb-1.5 text-[9px] leading-relaxed text-faint",children:y}),b.length>0?l.jsxs(l.Fragment,{children:[l.jsxs("select",{value:L?$:"",onChange:M=>{M.target.value&&c(e,M.target.value)},className:ee(br,"font-mono text-[11px]"),"aria-label":`${P.name} model`,children:[l.jsx("option",{value:"",children:"Choose a model…"}),L&&$&&!b.some(M=>M.id===$)&&l.jsxs("option",{value:$,children:[$," (not listed)"]}),b.map(M=>l.jsxs("option",{value:M.id,children:[M.name||M.id,M.context?` · ${nI(M.context)} ctx`:""]},M.id))]}),l.jsxs("p",{className:"mt-1 text-[9px] text-faint",children:[b.length," usable chat model",b.length===1?"":"s",k==="catalog"?" from the models.dev fallback":" loaded live from the provider","."]})]}):l.jsx("p",{className:"text-[9.5px] leading-relaxed text-faint",children:x?"Loading the provider’s current models…":C?"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."}),l.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[l.jsx("input",{value:E,onChange:M=>A(M.target.value),placeholder:"or enter a model ID",spellCheck:!1,"aria-label":`${P.name} model ID`,className:ee(br,"font-mono text-[10.5px]")}),l.jsx("button",{type:"button",onClick:()=>{const M=E.trim();M&&(c(e,M),A(""))},disabled:!E.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"})]})]}),l.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-3",children:[l.jsx("p",{className:"text-[9px] leading-relaxed text-faint",children:P.keyless?"No key is stored for this provider.":C?"The daemon decrypts the key only when it calls the provider.":"The key never enters the page after saving."}),C&&!L&&l.jsxs("button",{type:"button",onClick:()=>{te()},className:"shrink-0 text-[9.5px] font-medium text-accent hover:underline",children:["Use ",P.name]})]})]})]})}function rI(){const e=ze(),i=ze(b=>b.update),a=ze(b=>b.refreshProviders),[r,c]=U.useState(e.provider),[u,d]=U.useState(!1),p=Cd(),h=Do(p),g=h.includes(e.effort)?e.effort:h[0];return l.jsxs(l.Fragment,{children:[l.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:l.jsxs("button",{type:"button",onClick:async()=>{d(!0);try{await a()}catch(b){me.getState().notify(b instanceof Error?b.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?l.jsx(Ht,{size:10}):l.jsx(Ii,{size:10}),"Refresh"]}),children:[l.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-line bg-raised/50 px-3 py-2.5",children:[l.jsx(yr,{size:14,className:"mt-0.5 shrink-0 text-success"}),l.jsxs("p",{className:"text-[10.5px] leading-relaxed text-muted",children:["Keys are encrypted with AES-256-GCM under ",l.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."]})]}),l.jsx("div",{className:"space-y-2",children:qu.map(b=>l.jsx(aI,{providerId:b.id,open:r===b.id,onToggle:()=>c(r===b.id?null:b.id)},b.id))})]}),l.jsx(Rn,{title:"Reasoning defaults",description:"Only controls advertised by the live model are offered; an unsupported field is never sent.",children:p?l.jsx("div",{className:"space-y-2.5",children:h.length>0?l.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-line bg-raised/30 px-3 py-2.5",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Effort"}),l.jsxs("p",{className:"mt-0.5 text-[9.5px] text-faint",children:["Options come from ",p.name||p.id," · ",p.apiKind]})]}),l.jsx("select",{value:g,onChange:b=>i({effort:b.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(b=>l.jsx("option",{value:b,children:cg[b].label},b))})]}):l.jsx("p",{className:"rounded-lg border border-line bg-raised/30 px-3 py-2.5 text-[10px] leading-relaxed text-faint",children:oh(p)})}):l.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."})}),l.jsx(Rn,{title:"Advanced request settings",description:"Defaults for every provider. The adapter ignores fields the selected model cannot accept.",children:l.jsxs("details",{className:"group/advanced rounded-xl border border-line bg-raised/20",children:[l.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",l.jsx(dd,{size:13,className:"text-faint transition-transform group-open/advanced:rotate-180"})]}),l.jsxs("div",{className:"border-t border-line px-3 py-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx(ns,{hint:"0 – 2",children:"Temperature"}),l.jsx("input",{type:"number",min:0,max:2,step:.1,value:e.temperature,onChange:b=>{const x=Number(b.target.value);Number.isFinite(x)&&i({temperature:Math.min(2,Math.max(0,x))})},className:br})]}),l.jsxs("div",{children:[l.jsx(ns,{hint:"256 – 200,000",children:"Max output tokens"}),l.jsx("input",{type:"number",min:256,max:2e5,step:256,value:e.maxTokens,onChange:b=>{const x=Number(b.target.value);Number.isFinite(x)&&i({maxTokens:Math.min(2e5,Math.max(256,Math.round(x)))})},className:br})]})]}),l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-[11px] font-medium text-ink",children:"System prompt"}),l.jsxs("button",{type:"button",onClick:()=>i({systemPrompt:Vu}),className:"inline-flex items-center gap-1 text-[9.5px] font-medium text-faint hover:text-ink",children:[l.jsx(fw,{size:10})," Restore default"]})]}),l.jsx("textarea",{value:e.systemPrompt,onChange:b=>i({systemPrompt:b.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"}),l.jsx("p",{className:"mt-1 text-[9px] leading-relaxed text-faint",children:"The installed skill list and the current workspace/git context are appended after this prompt."})]})]})]})})]})}const sI=[{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","skill"]}],lI={shell:gw,read_file:as,list_files:ow,write_file:lw,edit_file:s0,rewrite_file:s0,grep:aT,web_search:is,read_url:Wh,git:cw,subagent:y2,skill:oi},oI={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."},skill:{label:"Skill",description:"Load an installed skill (SKILL.md and its bundled files) when a task matches it."}};function cI(){const e=ze(),i=ze(r=>r.updateTool),a=me(r=>r.openSettings);return l.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:[l.jsx("div",{className:"space-y-5",children:sI.map(r=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 text-[10px] font-medium text-faint",children:r.title}),l.jsx("div",{className:"overflow-hidden rounded-xl border border-line",children:r.tools.map((c,u)=>{const d=e.tools[c],p=lI[c],h=oI[c];return l.jsxs("div",{className:ee("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:[l.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-line bg-panel text-muted",children:l.jsx(p,{size:13})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:h.label}),l.jsx("span",{className:"font-mono text-[8.5px] text-faint",children:c})]}),l.jsx("p",{className:"mt-0.5 text-[9.5px] leading-relaxed text-muted",children:h.description}),r.title==="Web"&&!e.webSearchEnabled&&l.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."})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2 pl-9 sm:pl-0",children:[d.enabled&&l.jsx(Ad,{value:d.approval,onChange:g=>i(c,{approval:g}),options:[{value:"auto",label:"Auto",title:"Run without asking"},{value:"ask",label:"Ask",title:"Ask before running"}]}),l.jsx(Pi,{checked:d.enabled,onChange:g=>i(c,{enabled:g}),label:`Enable ${h.label}`})]})]},c)})})]},r.title))}),l.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:[l.jsx(yr,{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 ",l.jsx("code",{className:"font-mono",children:".."})," or absolute escapes."]})]})}const uI=[{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 dI(){const e=ze(),i=ze(A=>A.update),a=ze(A=>A.saveSearchKey),r=me(A=>A.notify),[c,u]=U.useState(""),[d,p]=U.useState(!1),[h,g]=U.useState(!1),[b,x]=U.useState(null),v=e.secretStatus?.search,y=e.searchProvider==="duckduckgo",k=!!v?.configured,S=async()=>{if(!c.trim()){r("Paste a search API key first.","error");return}p(!0);try{await a(c.trim()),u(""),x(null),r("Search key saved and encrypted.","success")}catch(A){r(A instanceof Error?A.message:"Could not save that key.","error")}finally{p(!1)}},j=async()=>{try{await a(""),x(null),r("Search key removed.","success")}catch(A){r(A instanceof Error?A.message:"Could not remove that key.","error")}},E=async()=>{g(!0),x(null);try{const A=await ln("web_search",{query:"OpenSol local coding agent",provider:e.searchProvider},"build"),T=A.result&&typeof A.result=="object"?A.result:{},R=Array.isArray(T.results)?T.results:[];x({ok:R.length>0,message:R.length>0?`${R.length} results via ${String(T.provider??e.searchProvider)}.`:"No results were returned. Try another provider or query."})}catch(A){x({ok:!1,message:A instanceof Error?A.message:"Search failed."})}finally{g(!1)}};return l.jsxs(l.Fragment,{children:[l.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:l.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-line bg-raised/30 px-3 py-2.5",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Allow web tools"}),l.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."})]}),l.jsx(Pi,{checked:e.webSearchEnabled,onChange:A=>i({webSearchEnabled:A}),label:"Allow web tools"})]})}),l.jsxs(Rn,{title:"Search provider",description:"Choose where current results come from. A key is encrypted by the daemon.",children:[l.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:uI.map(A=>{const T=e.searchProvider===A.id;return l.jsxs("button",{type:"button",onClick:()=>{i({searchProvider:A.id}),x(null)},className:ee("rounded-lg border p-3 text-left transition-colors",T?"border-accent/35 bg-accent-soft/40":"border-line bg-panel hover:bg-raised/40"),children:[l.jsxs("span",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:A.name}),l.jsx("span",{className:ee("flex h-3.5 w-3.5 items-center justify-center rounded-full border",T?"border-accent bg-accent text-on-accent":"border-line"),children:T&&l.jsx(Mn,{size:8,strokeWidth:3})})]}),l.jsx("span",{className:"mt-1 block text-[9.5px] leading-relaxed text-muted",children:A.description}),A.keyless&&l.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"})]},A.id)})}),!y&&l.jsxs("div",{className:"mt-3",children:[l.jsx(ns,{hint:k?`Saved ${v?.hint??""}`:"Required",children:e.searchProvider==="tavily"?"Tavily API key":e.searchProvider==="brave"?"Brave Search API key":"Serper API key"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("div",{className:"min-w-0 flex-1",children:l.jsx(qg,{value:c,onChange:u,placeholder:e.searchProvider==="tavily"?"tvly-…":e.searchProvider==="brave"?"BSA…":"…",label:"Search API key"})}),l.jsxs("button",{type:"button",onClick:()=>{S()},disabled:!c.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?l.jsx(Ht,{size:10}):l.jsx(hd,{size:10}),"Save"]})]}),k&&l.jsx("button",{type:"button",onClick:()=>{j()},className:"mt-1.5 text-[9.5px] font-medium text-faint hover:text-danger",children:"Remove saved key"}),l.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."})]}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>{E()},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?l.jsx(Ht,{size:12}):l.jsx(rs,{size:12}),h?"Testing…":"Test search"]}),!y&&!k&&l.jsx("span",{className:"text-[9.5px] text-faint",children:"Add a key to test."})]}),b&&l.jsx("div",{className:ee("mt-2.5 rounded-lg border px-3 py-2 text-[10px] leading-relaxed",b.ok?"border-success/25 bg-success/[0.04] text-success":"border-warning/30 bg-warning/[0.04] text-warning"),children:b.message})]})]})}const fI=/(^|\/)(node_modules|\.git|__pycache__)(\/|$)/,Xv=1024*1024;async function pI(e){const i=new Uint8Array(await e.arrayBuffer());let a="";const r=32768;for(let c=0;c<i.length;c+=r)a+=String.fromCharCode(...i.subarray(c,c+r));return btoa(a)}function mI(e){return e.startsWith("npm:")?e:e==="upload"?"Folder":e==="legacy"?"Migrated":"Local"}function hI(){const e=vi(T=>T.skills),i=vi(T=>T.loading),a=vi(T=>T.error),r=vi(T=>T.load),c=vi(T=>T.upload),u=vi(T=>T.installNpm),d=vi(T=>T.setEnabled),p=vi(T=>T.remove),h=me(T=>T.askConfirm),g=me(T=>T.notify),b=U.useRef(null),[x,v]=U.useState(null),[y,k]=U.useState(""),S=e.filter(T=>T.enabled).length;U.useEffect(()=>{r()},[r]);const j=async T=>{const R=Array.from(T).map(C=>({file:C,path:C.webkitRelativePath||C.name})).filter(C=>!fI.test(C.path));if(R.length===0)return;const P=R.filter(C=>C.file.size>Xv),z=R.filter(C=>C.file.size<=Xv);if(!z.some(C=>/(^|\/)skill\.md$/i.test(C.path))){g("That folder has no SKILL.md. Choose the skill folder itself (or a folder that contains skill folders).","error");return}v("folder");try{const C=await Promise.all(z.map(async G=>({path:G.path,data:await pI(G.file)}))),L=await c(C);g(`Installed ${L.join(", ")}${P.length>0?` · skipped ${P.length} file${P.length===1?"":"s"} over 1 MB`:""}.`,"success")}catch(C){g(C instanceof Error?C.message:"Could not install that skill folder.","error")}finally{v(null)}},E=async()=>{const T=y.trim();if(T){v("npm");try{const R=await u(T);k(""),g(`Installed ${R.join(", ")} from npm.`,"success")}catch(R){g(R instanceof Error?R.message:"Could not install that npm package.","error")}finally{v(null)}}},A=async T=>{if(await h({title:"Delete this skill?",body:`“${T.name}” and its folder will be removed from this computer.`,confirmLabel:"Delete skill",tone:"danger"}))try{await p(T.name)}catch(P){g(P instanceof Error?P.message:"Could not delete the skill.","error")}};return l.jsxs(Rn,{title:"Installed skills",description:`${S} of ${e.length} enabled. The model sees each skill's name and description, then loads the full SKILL.md and bundled files on demand with the skill tool.`,children:[l.jsxs("div",{className:"mb-3 rounded-xl border border-line p-3",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>b.current?.click(),disabled:x!==null,className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-ink px-2.5 text-[10.5px] font-medium text-panel disabled:opacity-50",children:[x==="folder"?l.jsx(Ht,{size:12}):l.jsx(xT,{size:12})," Upload skill folder"]}),l.jsx("input",{ref:b,type:"file",className:"hidden",multiple:!0,webkitdirectory:"",directory:"",onChange:T=>{T.target.files&&j(T.target.files),T.target.value=""}}),l.jsx("span",{className:"text-[10px] text-faint",children:"A folder with a SKILL.md, plus optional scripts/ and references/."})]}),l.jsxs("form",{className:"mt-2.5 flex flex-wrap items-center gap-2",onSubmit:T=>{T.preventDefault(),E()},children:[l.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[l.jsx(gd,{size:12,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{value:y,onChange:T=>k(T.target.value),placeholder:"npm package, e.g. @scope/my-skills",className:ee(br,"pl-7 font-mono text-[11px]"),"aria-label":"npm package",spellCheck:!1})]}),l.jsxs("button",{type:"submit",disabled:x!==null||!y.trim(),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-50",children:[x==="npm"?l.jsx(Ht,{size:12}):l.jsx(Kh,{size:12})," Install from npm"]})]}),l.jsx("p",{className:"mt-2 text-[9.5px] leading-relaxed text-faint",children:"npm installs run with scripts disabled; OpenSol only copies the SKILL.md folders the package ships. Skill scripts run only when the model calls the shell tool, and that still asks for approval."})]}),a&&l.jsx("p",{className:"mb-2 text-[10.5px] text-danger",children:a}),e.length===0?l.jsxs("div",{className:"rounded-xl border border-dashed border-line px-4 py-8 text-center",children:[l.jsx(oi,{size:16,className:"mx-auto text-faint"}),l.jsx("p",{className:"mt-2 text-[12px] font-medium text-ink",children:i?"Loading skills…":"No skills installed"}),l.jsx("p",{className:"mt-1 text-[10.5px] text-muted",children:"Upload a skill folder or install one from npm to give the agent new abilities."})]}):l.jsx("div",{className:"overflow-hidden rounded-xl border border-line",children:e.map((T,R)=>l.jsx("div",{className:ee("px-3 py-3",R!==0&&"border-t border-line"),children:l.jsxs("div",{className:"flex items-start gap-2.5",children:[l.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:l.jsx(oi,{size:11})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("p",{className:"font-mono text-[11.5px] font-medium text-ink",children:T.name}),l.jsx("span",{className:"rounded bg-raised px-1.5 py-0.5 text-[8px] font-medium text-faint",children:mI(T.source)}),l.jsxs("span",{className:"text-[8.5px] text-faint",children:[T.fileCount," file",T.fileCount===1?"":"s"," · ",hl(T.size)]})]}),l.jsx("p",{className:"mt-0.5 text-[9.5px] leading-relaxed text-muted",children:T.description||"No description."}),l.jsx("p",{className:"mt-0.5 truncate font-mono text-[8.5px] text-faint",title:T.path,children:T.path})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[l.jsx("button",{type:"button",onClick:()=>{A(T)},className:"icon-button h-7 w-7 hover:text-danger","aria-label":`Delete ${T.name}`,title:"Delete skill",children:l.jsx(sa,{size:12})}),l.jsx(Pi,{checked:T.enabled,onChange:P=>{d(T.name,P)},label:`Enable ${T.name}`})]})]})},T.name))})]})}const Pu={cloudflare:{label:"Cloudflare Pages",short:"Cloudflare",icon:rh,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:rh,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 gI({providerId:e}){const i=Pu[e],a=ze(R=>R.deploySecrets?.[e]),r=ze(R=>R.deployTools?.[e]),c=ze(R=>R.saveDeployCredentials),u=me(R=>R.notify),d=me(R=>R.askConfirm),[p,h]=U.useState(!1),[g,b]=U.useState({}),[x,v]=U.useState(""),[y,k]=U.useState(!1),S=i.fields.filter(R=>!R.secret),j=i.fields.find(R=>R.secret);U.useEffect(()=>{const R={};for(const P of S)R[P.key]=a?.fields?.[P.key]??"";b(R)},[a,S.length]);const E=async()=>{k(!0);try{const R={...g};x.trim()&&j&&(R[j.key]=x.trim()),await c(e,R),v(""),u(`${i.label} credentials saved and encrypted.`,"success")}catch(R){u(R instanceof Error?R.message:"Could not save those credentials.","error")}finally{k(!1)}},A=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 z of i.fields)P[z.key]="";await c(e,P),v(""),u(`${i.label} credentials removed.`,"success")}catch(P){u(P instanceof Error?P.message:"Could not remove those credentials.","error")}},T=i.icon;return l.jsxs("div",{className:"rounded-xl border border-line bg-panel",children:[l.jsxs("button",{type:"button",onClick:()=>h(R=>!R),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left",children:[l.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:l.jsx(T,{size:13})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[11.5px] font-medium text-ink",children:i.label}),a?.configured?l.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-success",children:[l.jsx("span",{className:"h-1 w-1 rounded-full bg-success"})," configured"]}):l.jsx("span",{className:"text-[9px] text-faint",children:"not configured"})]}),l.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}`:""]})]}),l.jsx(dd,{size:13,className:ee("shrink-0 text-faint transition-transform",p&&"rotate-180")})]}),p&&l.jsxs("div",{className:"border-t border-line px-3 py-3",children:[l.jsx("p",{className:"mb-2.5 text-[9.5px] leading-relaxed text-faint",children:i.description}),j&&l.jsxs("div",{className:"mb-2.5",children:[l.jsx(ns,{hint:a?.configured?"Saved; leave blank to keep":"Required",children:j.label}),l.jsx(qg,{value:x,onChange:v,placeholder:a?.configured?`Replace token ${a.hint}`:j.placeholder,label:`${i.label} ${j.label}`})]}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:S.map(R=>l.jsxs("div",{children:[l.jsx(ns,{hint:R.hint,children:R.label}),l.jsx("input",{value:g[R.key]??"",onChange:P=>b(z=>({...z,[R.key]:P.target.value})),placeholder:R.placeholder,spellCheck:!1,className:ee(br,"font-mono text-[10.5px]")})]},R.key))}),l.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a?.configured?l.jsx("button",{type:"button",onClick:()=>{A()},className:"text-[9.5px] font-medium text-faint hover:text-danger",children:"Remove credentials"}):l.jsx("span",{className:"text-[9px] text-faint",children:"Values are encrypted at rest."}),l.jsxs("button",{type:"button",onClick:()=>{E()},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?l.jsx(Ht,{size:10}):l.jsx(Mn,{size:10}),"Save"]})]})]})]})}function xI(){const e=ze(a=>a.deployTools),i=ze(a=>a.secretsError);return l.jsxs(l.Fragment,{children:[l.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&&l.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}),l.jsx("div",{className:"space-y-2",children:Object.keys(Pu).map(a=>l.jsx(gI,{providerId:a},a))})]}),l.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:[l.jsx("div",{className:"overflow-hidden rounded-xl border border-line",children:Object.keys(Pu).map((a,r)=>{const c=e?.[a],u=Pu[a];return l.jsxs("div",{className:ee("flex items-center gap-3 px-3 py-2.5",r!==0&&"border-t border-line"),children:[l.jsx(lg,{size:13,className:"shrink-0 text-faint"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"text-[11px] font-medium text-ink",children:u.short}),l.jsxs("p",{className:"truncate font-mono text-[9px] text-faint",children:[c?.bin??"—"," ",c?.installed?`· ${c.version||"installed"}`:"· not installed, uses npx"]})]}),l.jsx("span",{className:ee("shrink-0 rounded-full border px-1.5 py-0.5 text-[8.5px] font-medium",c?.installed?"border-success/25 text-success":"border-line text-faint"),children:c?.installed?"installed":"npx fallback"})]},a)})}),l.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:[l.jsx(Jr,{size:12})," Open deploy panel"]})]})]})}function bI(){return l.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:l.jsx(H8,{})})}function yI(){const e=ze(),i=ze(p=>p.update),a=me(p=>p.openSettings),r=me(p=>p.notify),c=Ek(e.tools),u=[{id:"light",label:"Light",icon:sg},{id:"dark",label:"Dark",icon:ig},{id:"system",label:"System",icon:ng}],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 l.jsxs("div",{className:"px-5 py-2 sm:px-7",children:[l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Permission"}),l.jsx("p",{className:"settings-hint",children:"Choose the default permission mode for new sessions."})]}),l.jsx("select",{value:c,onChange:p=>i({tools:Sk(e.tools,p.target.value)}),className:ee("settings-select w-full sm:w-[210px]"),"aria-label":"Default permission mode",children:yg.map(p=>l.jsx("option",{value:p.value,children:p.label},p.value))})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Appearance"}),l.jsx("p",{className:"settings-hint",children:"Follow the system or pick a fixed theme."})]}),l.jsxs("div",{className:"w-full sm:w-[360px]",children:[l.jsx("div",{className:"grid grid-cols-3 gap-2",children:u.map(p=>{const h=p.icon,g=e.theme===p.id;return l.jsxs("button",{type:"button",onClick:()=>i({theme:p.id}),className:ee("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:[l.jsx(h,{size:16}),l.jsx("span",{className:"text-[11px] font-medium",children:p.label})]},p.id)})}),l.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 →"})]})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Font size"}),l.jsx("p",{className:"settings-hint",children:"Only affects conversation content."})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("select",{value:e.chatFontSize,onChange:p=>i({chatFontSize:Number(p.target.value)}),className:ee("settings-select w-[84px] text-center"),"aria-label":"Conversation font size",children:Array.from({length:9},(p,h)=>h+12).map(p=>l.jsx("option",{value:p,children:p},p))}),l.jsx("span",{className:"text-[11px] text-faint",children:"px"})]})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Work details"}),l.jsx("p",{className:"settings-hint",children:"Choose how much detail to show for tool calls."})]}),l.jsxs("select",{value:e.workDetail,onChange:p=>i({workDetail:p.target.value==="concise"?"concise":"detailed"}),className:ee("settings-select w-full sm:w-[180px]"),"aria-label":"Work details",children:[l.jsx("option",{value:"concise",children:"Concise"}),l.jsx("option",{value:"detailed",children:"Detailed"})]})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"When to collapse work details"}),l.jsx("p",{className:"settings-hint",children:"Choose when to automatically collapse work details."})]}),l.jsxs("select",{value:e.autoCollapseWork?"completion":"never",onChange:p=>i({autoCollapseWork:p.target.value==="completion"}),className:ee("settings-select w-full sm:w-[180px]"),"aria-label":"When to collapse work details",children:[l.jsx("option",{value:"completion",children:"On completion"}),l.jsx("option",{value:"never",children:"Never"})]})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Let AI name sessions"}),l.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."})]}),l.jsx(Pi,{checked:e.aiSessionTitles,onChange:p=>i({aiSessionTitles:p}),label:"Let AI name sessions"})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Show token estimates"}),l.jsx("p",{className:"settings-hint",children:"When a provider does not report usage, show a rough output estimate."})]}),l.jsx(Pi,{checked:e.showTokenEstimate,onChange:p=>i({showTokenEstimate:p}),label:"Show token estimates"})]}),l.jsxs("div",{className:"settings-row",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"settings-label",children:"Local configuration"}),l.jsx("p",{className:"settings-hint",children:"Settings, conversations and encrypted keys live in this folder."})]}),l.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:[l.jsx(md,{size:13}),"Copy data folder path"]})]}),l.jsx("p",{className:"py-4 text-[10.5px] text-faint",children:"Changes are saved automatically to this computer."})]})}function vI(){const e=ze(),i=ze(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]"},...uE().themes().map(r=>({id:r.id,label:r.label,className:"bg-gradient-to-br from-accent-soft to-panel",line:"bg-line"}))];return l.jsxs(l.Fragment,{children:[l.jsx(Rn,{title:"Theme",description:"System follows your OS preference and updates when it changes.",children:l.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:a.map(r=>{const c=e.theme===r.id;return l.jsxs("button",{type:"button",onClick:()=>i({theme:r.id}),className:ee("rounded-xl border p-2 text-left transition-all",c?"border-accent ring-2 ring-accent/10":"border-line hover:border-faint/50"),children:[l.jsxs("span",{className:ee("block h-14 w-full overflow-hidden rounded-lg border border-line/60 p-2",r.className),children:[l.jsx("span",{className:ee("block h-1.5 w-8 rounded-full",r.line)}),l.jsx("span",{className:ee("mt-1.5 block h-1.5 w-12 rounded-full opacity-60",r.line)}),l.jsx("span",{className:"mt-3 block h-2 w-5 rounded-full bg-accent"})]}),l.jsxs("span",{className:"mt-1.5 flex items-center justify-between px-0.5",children:[l.jsx("span",{className:"text-[10.5px] font-medium text-ink",children:r.label}),c&&l.jsx(Mn,{size:11,className:"text-accent"})]})]},r.id)})})}),l.jsx(Rn,{title:"Interface",children:l.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-line bg-raised/30 px-3 py-2.5",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[11.5px] font-medium text-ink",children:"Show token estimates"}),l.jsx("p",{className:"mt-0.5 text-[9.5px] text-faint",children:"When a provider does not report usage, show a rough output estimate."})]}),l.jsx(Pi,{checked:e.showTokenEstimate,onChange:r=>i({showTokenEstimate:r}),label:"Show token estimates"})]})}),l.jsx(Rn,{title:"Shortcuts",children:l.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,c])=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg px-1 py-1",children:[l.jsx("span",{className:"text-muted",children:r}),l.jsx("kbd",{className:"rounded border border-line bg-raised px-1.5 py-0.5 font-sans text-[9.5px] text-faint",children:c})]},r))})})]})}function wI(){const e=Xe(y=>y.sessions),i=ze(y=>y.daemon),a=ze(y=>y.secretStatus),r=Be(y=>y.entries),c=Be(y=>y.info),u=me(y=>y.askConfirm),d=me(y=>y.notify),p=U.useRef(null),[h,g]=U.useState(""),b=e.reduce((y,k)=>y+k.messages.length,0),x=r.filter(y=>y.type==="file").length,v=async(y,k)=>{if(await u({...k,tone:"danger",confirmLabel:k.label})){g(y);try{SM();const j=await hj(y);await sE(j),d(y==="history"?"Conversation history cleared.":y==="settings"?"Settings restored to defaults.":"OpenSol was reset.","success")}catch(j){d(j instanceof Error?j.message:"Could not reset that data.","error")}finally{g("")}}};return l.jsxs(l.Fragment,{children:[l.jsxs(Rn,{title:"About",children:[l.jsxs("div",{className:"flex items-start gap-3.5",children:[l.jsx(gl,{size:46}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[l.jsx("h3",{className:"font-display text-[20px] font-semibold tracking-[-0.03em] text-ink",children:"OpenSol"}),l.jsxs("span",{className:"text-[10px] text-faint",children:["v",i?.version??"1.0.0"]})]}),l.jsx("p",{className:"mt-0.5 text-[10.5px] font-medium text-muted",children:"An OpenSoftX product"}),l.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."})]})]}),l.jsx("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[["Conversations",String(e.length)],["Messages",String(b)],["Workspace files",c.available?String(x):"None"]].map(([y,k])=>l.jsxs("div",{className:"rounded-lg border border-line bg-raised/30 px-3 py-2",children:[l.jsx("p",{className:"text-[9px] text-faint",children:y}),l.jsx("p",{className:"mt-0.5 text-[15px] font-semibold tracking-[-0.02em] text-ink",children:k})]},y))})]}),l.jsxs(Rn,{title:"Local data",description:"Everything is stored under ~/.maxcode. Clearing that folder removes OpenSol’s local state.",children:[l.jsxs("div",{className:"space-y-1.5 rounded-lg border border-line bg-raised/30 px-3 py-2.5 text-[10px]",children:[l.jsxs("p",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-faint",children:"Data folder"}),l.jsx("span",{className:"min-w-0 truncate font-mono text-ink",title:i?.dataDir,children:i?.dataDir??"~/.maxcode"})]}),l.jsxs("p",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-faint",children:"Encryption"}),l.jsx("span",{className:"text-muted",children:a?.encryption??"AES-256-GCM"})]}),l.jsxs("p",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-faint",children:"Runtime"}),l.jsxs("span",{className:"truncate text-muted",children:[i?.platform??"—"," · Node ",i?.node??"—"]})]}),l.jsxs("p",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-faint",children:"Workspace"}),l.jsx("span",{className:"min-w-0 truncate font-mono text-muted",title:c.root,children:c.available?c.root:"No folder open"})]})]}),l.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[l.jsxs("button",{type:"button",onClick:Sw,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:[l.jsx(rw,{size:12})," Export conversations"]}),l.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:[l.jsx(xw,{size:12})," Import conversations"]}),l.jsx("input",{ref:p,type:"file",accept:"application/json,.json",className:"hidden",onChange:y=>{const k=y.target.files?.[0];k&&(Vj(k).then(S=>d(S>0?`Imported ${S} conversation${S===1?"":"s"}.`:"Those conversations are already in your history.",S>0?"success":"info")).catch(S=>d(S instanceof Error?S.message:"Could not import that file.","error")),y.target.value="")}}),l.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"?l.jsx(Ht,{size:12}):l.jsx(sa,{size:12})," Clear history"]})]}),l.jsxs("p",{className:"mt-3 flex items-center gap-2 text-[9.5px] text-faint",children:[l.jsx(md,{size:11}),hl(new Blob([JSON.stringify(e)]).size)," of conversation history",l.jsx("span",{className:"text-line",children:"·"}),l.jsx(hd,{size:10}),"secrets encrypted at rest"]})]}),l.jsx(Rn,{title:"Danger zone",children:l.jsxs("div",{className:"space-y-2",children:[l.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:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[11px] font-medium text-ink",children:"Restore default settings"}),l.jsx("p",{className:"mt-0.5 text-[9.5px] text-muted",children:"Reset prompt, modes, tool permissions and skills. Keys and chats stay."})]}),l.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"?l.jsx(Ht,{size:11}):l.jsx(fw,{size:11})," Restore defaults"]})]}),l.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:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[11px] font-medium text-ink",children:"Reset OpenSol"}),l.jsx("p",{className:"mt-0.5 text-[9.5px] text-muted",children:"Delete conversations, encrypted keys, skills, settings and the remembered workspace."})]}),l.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"?l.jsx(Ht,{size:11}):l.jsx(sa,{size:11})," Reset everything"]})]})]})})]})}function kI(){const e=Cn(d=>d.servers),i=Cn(d=>d.loaded),a=Cn(d=>d.load),r=me(d=>d.setMcpOpen);U.useEffect(()=>{a()},[a]);const c=e.filter(d=>d.status==="connected").length,u=e.filter(d=>d.status==="needs_auth").length;return l.jsx("div",{className:"space-y-5 px-5 py-6 sm:px-8",children:l.jsxs("div",{className:"settings-card flex flex-wrap items-center gap-4",children:[l.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent",children:l.jsx(Wh,{size:18})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"settings-label",children:"MCP panel"}),l.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.":`${c} of ${e.length} server${e.length===1?"":"s"} connected${u?` · ${u} waiting for sign-in`:""}.`:"Loading…"})]}),l.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 NI(){const e=me(b=>b.settingsOpen),i=me(b=>b.settingsTab),a=me(b=>b.closeSettings),r=me(b=>b.openSettings),c=me(b=>b.notify),u=ze(b=>b.daemon),d=U.useRef(null),p=Math.max(0,No.findIndex(b=>b.id===i)),h=No[p];U.useEffect(()=>{e&&d.current?.scrollTo({top:0})},[e,i]);const g=async()=>{const b=u?.dataDir??"~/.opensol";try{await navigator.clipboard.writeText(b),c(`Copied the data folder path: ${b}`,"success")}catch{c(`Data folder: ${b}`,"info")}};return l.jsx(jd,{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:l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col sm:flex-row",children:[l.jsxs("aside",{className:"relative hidden w-[232px] shrink-0 flex-col bg-canvas sm:flex",children:[l.jsx("div",{className:"settings-glow pointer-events-none absolute inset-x-0 top-0 h-48"}),l.jsxs("div",{className:"relative px-6 pb-4 pt-6",children:[l.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.24em] text-faint",children:"OpenSol · v3.1.0"}),l.jsx("h2",{id:"settings-title",className:"mt-1.5 font-display text-[26px] font-semibold leading-none tracking-[-0.035em] text-ink",children:"Settings"})]}),l.jsxs("nav",{className:"relative flex-1 overflow-y-auto px-3 pb-3",children:[l.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)`}}),No.map((b,x)=>{const v=b.icon,y=i===b.id;return l.jsxs("button",{type:"button",onClick:()=>r(b.id),disabled:b.disabled,title:b.description,className:ee("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 disabled:cursor-not-allowed disabled:opacity-45",y?"font-semibold text-ink":"text-muted hover:text-ink"),children:[l.jsx("span",{className:ee("w-4 font-mono text-[9.5px] tabular-nums transition-colors",y?"text-accent":"text-faint"),children:String(x+1).padStart(2,"0")}),l.jsx(v,{size:14,className:ee("transition-transform duration-300 group-hover/tab:scale-110",y?"text-accent":"text-faint")}),b.label]},b.id)})]}),l.jsx("div",{className:"relative px-6 py-4",children:l.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] text-faint",children:[l.jsx(hd,{size:10})," Keys encrypted on this machine"]})})]}),l.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col bg-panel sm:border-l sm:border-line",children:[l.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:No.map(b=>l.jsx("button",{type:"button",onClick:()=>r(b.id),disabled:b.disabled,className:ee("shrink-0 rounded-full px-3 py-1.5 disabled:opacity-45 text-[11px] font-medium transition-all duration-200",i===b.id?"bg-ink text-panel":"bg-raised text-muted"),children:b.label},b.id))}),l.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:[l.jsxs("div",{className:"settings-title-in min-w-0",children:[l.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.22em] text-accent",children:[String(p+1).padStart(2,"0")," / ",String(No.length).padStart(2,"0")]}),l.jsx("h3",{className:"mt-1 font-display text-[28px] font-semibold leading-none tracking-[-0.035em] text-ink",children:h.label}),l.jsx("p",{className:"mt-2 max-w-[560px] text-[12.5px] leading-relaxed text-muted",children:h.description})]},i),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[l.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:[l.jsx(md,{size:12}),"Data folder"]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8 rounded-full",onClick:a,"aria-label":"Close settings",children:l.jsx($i,{size:16})})]})]}),l.jsx("div",{ref:d,className:"thin-scroll min-h-0 flex-1 overflow-y-auto pb-6",children:l.jsxs("div",{className:"settings-enter",children:[i==="general"&&l.jsx(yI,{}),i==="models"&&l.jsx(rI,{}),i==="tools"&&l.jsx(cI,{}),i==="search"&&l.jsx(dI,{}),i==="skills"&&l.jsx(hI,{}),i==="plugins"&&l.jsx(bI,{}),i==="mcp"&&l.jsx(kI,{}),i==="deploy"&&l.jsx(xI,{}),i==="appearance"&&l.jsx(vI,{}),i==="about"&&l.jsx(wI,{})]},i)})]})]})})}const ih=[{id:"cloudflare",label:"Cloudflare Pages",icon:rh,tint:"#f6821f",blurb:"Global edge, generous free tier",needs:"API token + account id"},{id:"netlify",label:"Netlify",icon:is,tint:"#00c7b7",blurb:"Creates the site once, then reuses it",needs:"Personal access token"},{id:"vercel",label:"Vercel",icon:$C,tint:"#8b95a5",blurb:"Production deploy through the CLI",needs:"Access token"}],ah=[{id:"prepare",label:"Inspect",icon:hC},{id:"build",label:"Build",icon:uw},{id:"publish",label:"Publish",icon:$2}],Mu="h-9 w-full rounded-lg border border-line bg-panel px-2.5 font-mono text-[11px] text-ink outline-none transition-colors placeholder:text-faint focus:border-accent/50 disabled:opacity-60";function Eo({label:e,hint:i,children:a}){return l.jsxs("div",{children:[l.jsxs("p",{className:"mb-1.5 flex items-baseline gap-1.5 text-[10px] font-semibold uppercase tracking-[0.14em] text-faint",children:[e,i&&l.jsx("span",{className:"font-normal normal-case tracking-normal",children:i})]}),a]})}const Ru={prepare:"idle",build:"idle",publish:"idle"};function EI(){const e=me(H=>H.deployOpen),i=me(H=>H.setDeployOpen),a=me(H=>H.openSettings),r=me(H=>H.notify),c=Be(H=>H.root),u=Be(H=>H.info.name),d=Be(H=>H.info.available),p=ze(H=>H.deployTools),h=ze(H=>H.deploySecrets),[g,b]=U.useState("cloudflare"),[x,v]=U.useState(""),[y,k]=U.useState(""),[S,j]=U.useState(""),[E,A]=U.useState(""),[T,R]=U.useState(null),[P,z]=U.useState(""),[C,L]=U.useState(!1),[G,O]=U.useState(Ru),[$,Z]=U.useState([]),[fe,re]=U.useState(null),[te,M]=U.useState(""),[ae,ne]=U.useState(!1),xe=U.useRef(null),_=U.useRef(null),ve=U.useRef(0),ce=U.useRef(null),D=ih.find(H=>H.id===g)??ih[0],B=p?.[g],se=!!h?.[g]?.configured;U.useEffect(()=>{e&&(v(c),re(null),M(""),Z([]),L(!1),ne(!1),O(Ru))},[e,c]),U.useEffect(()=>{if(!e||!x.trim()){R(null),z("");return}let H=!1;const K=window.setTimeout(()=>{$j(x.trim()).then(be=>{H||(R(be),z(""))}).catch(be=>{H||(R(null),z(be instanceof Error?be.message:"Could not read that folder."))})},350);return()=>{H=!0,window.clearTimeout(K)}},[e,x]),U.useEffect(()=>{const H=_.current;H&&(H.scrollTop=H.scrollHeight)},[$]),U.useEffect(()=>()=>xe.current?.abort(),[]);const pe=(H,K)=>{const be=K.trimEnd();if(!be)return;ve.current+=1;const je=ve.current;Z(Oe=>[...Oe.slice(-600),{id:je,stream:H,text:be}])},Ee=H=>{const K=H==="prepare"||H==="publish"?H:"build";O(be=>{const je={...be};for(const Oe of ah)Oe.id===K?je[Oe.id]="active":je[Oe.id]==="active"&&(je[Oe.id]="done");return K==="publish"&&je.build==="idle"&&(je.build="done"),je}),ce.current=K},Le=()=>{xe.current?.abort(),i(!1)},Pe=async()=>{if(C)return;if(!x.trim()){M("Choose the project folder to deploy.");return}L(!0),re(null),M(""),Z([]),O({...Ru,prepare:"active"}),ce.current="prepare";const H=new AbortController;xe.current=H,pe("meta",`Deploying ${x.trim()} to ${D.label}`);let K=!1;try{for await(const be of Rj({provider:g,path:x.trim(),outputDir:y.trim()||void 0,buildCommand:S.trim()||void 0,projectName:E.trim()||void 0},H.signal))if(be.type==="step")Ee(be.id);else if(be.type==="log")pe(be.stream,be.text);else if(be.type==="done"){re(be.result),O({prepare:"done",build:"done",publish:"done"}),pe("meta",`Live at ${be.result.url}`);break}else if(be.type==="error"){K=!0,M(be.message),pe("stderr",be.message);break}}catch(be){if(be instanceof DOMException&&be.name==="AbortError")pe("meta","Deployment stopped."),O(Ru);else{K=!0;const je=be instanceof Error?be.message:"The deployment failed.";M(je),pe("stderr",je)}}finally{if(K&&ce.current){const be=ce.current;O(je=>({...je,[be]:"error"}))}xe.current=null,L(!1)}},Fe=async()=>{if(fe?.url)try{await navigator.clipboard.writeText(fe.url),ne(!0),window.setTimeout(()=>ne(!1),1600)}catch{r("Clipboard access was blocked by the browser.","error")}},Se=x.trim().split(/[\\/]/).filter(Boolean).pop()??"";return l.jsxs(jd,{open:e,onClose:Le,labelledBy:"deploy-title",wide:!0,className:"h-[92dvh] p-0 sm:h-[min(90dvh,780px)]",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-line px-5 py-3.5 sm:px-6",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-accent text-on-accent shadow-pill",children:l.jsx(Jr,{size:17})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{id:"deploy-title",className:"font-display text-[19px] font-semibold leading-tight tracking-[-0.02em] text-ink",children:"Deploy"}),l.jsx("p",{className:"truncate text-[11.5px] text-muted",children:"Build and publish a folder to a live URL. Tokens stay encrypted on this machine."})]})]}),l.jsx("button",{type:"button",className:"icon-button shrink-0",onClick:Le,"aria-label":"Close deploy panel",children:l.jsx($i,{size:16})})]}),l.jsxs("div",{className:"grid min-h-0 flex-1 lg:grid-cols-[minmax(0,390px)_minmax(0,1fr)]",children:[l.jsx("div",{className:"thin-scroll min-h-0 overflow-y-auto border-b border-line lg:border-b-0 lg:border-r",children:l.jsxs("div",{className:"space-y-5 p-5",children:[l.jsxs(Eo,{label:"Host",children:[l.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:ih.map(H=>{const K=H.icon,be=g===H.id,je=h?.[H.id]?.configured;return l.jsxs("button",{type:"button",onClick:()=>b(H.id),disabled:C,"aria-pressed":be,className:ee("relative flex flex-col items-start gap-2 rounded-xl border p-2.5 text-left transition-all disabled:opacity-60",be?"border-accent/50 bg-accent-soft/50 shadow-pill":"border-line bg-panel hover:bg-raised/60"),children:[l.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg text-white",style:{backgroundColor:H.tint},children:l.jsx(K,{size:14})}),l.jsx("span",{className:"text-[11.5px] font-medium leading-tight text-ink",children:H.label}),l.jsx("span",{className:ee("absolute right-2 top-2 h-1.5 w-1.5 rounded-full",je?"bg-success":"bg-warning"),title:je?"Credentials saved":"Needs credentials"})]},H.id)})}),l.jsx("p",{className:"mt-1.5 text-[10px] text-faint",children:D.blurb})]}),!se&&l.jsxs("div",{className:"rounded-xl border border-warning/25 bg-warning/[0.05] p-3",children:[l.jsxs("p",{className:"flex items-start gap-1.5 text-[10.5px] leading-relaxed text-muted",children:[l.jsx(yr,{size:12,className:"mt-0.5 shrink-0 text-warning"}),D.label," needs ",D.needs,". Add it once in Settings → Deploy; it is encrypted and never shown again."]}),l.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 ",D.label," credentials"]})]}),l.jsxs(Eo,{label:"Project folder",children:[l.jsx("input",{value:x,onChange:H=>v(H.target.value),disabled:C,placeholder:"/absolute/path/to/project or ~/Projects/site",spellCheck:!1,className:Mu,"aria-label":"Project folder"}),l.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[l.jsx("p",{className:"min-w-0 truncate text-[10px] text-faint",children:d?`Open workspace: ${u}`:"No workspace open."}),d&&x!==c&&l.jsxs("button",{type:"button",onClick:()=>v(c),disabled:C,className:"inline-flex shrink-0 items-center gap-1 text-[10px] font-medium text-accent disabled:opacity-40",children:[l.jsx(ml,{size:10})," Use workspace"]})]}),T&&l.jsxs("div",{className:"mt-2 flex items-start gap-2.5 rounded-xl border border-line bg-raised/40 p-2.5",children:[l.jsx(Ph,{name:T.outputDir||"src",open:!0,size:22}),l.jsxs("div",{className:"min-w-0 flex-1 text-[10.5px] leading-relaxed",children:[l.jsxs("p",{className:"font-medium text-ink",children:[T.framework||"Folder",T.packageManager&&l.jsx("span",{className:"ml-1.5 font-normal text-faint",children:T.packageManager})]}),l.jsxs("p",{className:"text-muted",children:[T.buildCommand?l.jsxs(l.Fragment,{children:["build ",l.jsx("code",{className:"font-mono text-ink",children:T.buildCommand})]}):"no build step"," → ",T.outputDir?l.jsx("code",{className:"font-mono text-ink",children:T.outputDir}):T.expectedOutputDir?l.jsxs(l.Fragment,{children:[l.jsx("code",{className:"font-mono text-ink",children:T.expectedOutputDir})," ",l.jsx("span",{className:"text-faint",children:"(after build)"})]}):l.jsx("span",{className:"text-warning",children:"no output folder found"})]})]})]}),P&&l.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[10.5px] leading-relaxed text-danger",children:[l.jsx(Du,{size:11,className:"mt-0.5 shrink-0"}),P]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[l.jsx(Eo,{label:"Output folder",hint:"auto",children:l.jsx("input",{value:y,onChange:H=>k(H.target.value),disabled:C,placeholder:T?.outputDir||T?.expectedOutputDir||"auto",spellCheck:!1,className:Mu,"aria-label":"Output folder"})}),l.jsx(Eo,{label:"Project name",hint:"auto",children:l.jsx("input",{value:E,onChange:H=>A(H.target.value),disabled:C,placeholder:T?.name||"my-site",spellCheck:!1,className:Mu,"aria-label":"Project name"})})]}),l.jsxs(Eo,{label:"Build command",hint:"auto when the output folder is missing",children:[l.jsx("input",{value:S,onChange:H=>j(H.target.value),disabled:C,placeholder:T?.buildCommand||"npm run build",spellCheck:!1,className:Mu,"aria-label":"Build command"}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[["npm run build","pnpm build","yarn build"].map(H=>l.jsx("button",{type:"button",onClick:()=>j(H),disabled:C,className:"rounded-md border border-line px-1.5 py-0.5 text-[9.5px] text-faint transition-colors hover:text-ink",children:H},H)),(S||y)&&l.jsx("button",{type:"button",onClick:()=>{j(""),k("")},disabled:C,className:"px-1.5 py-0.5 text-[9.5px] text-faint hover:text-danger",children:"reset to auto"})]})]}),l.jsxs("div",{className:"flex items-start gap-1.5 rounded-lg border border-line bg-raised/40 px-2.5 py-2 text-[10px] leading-relaxed text-faint",children:[l.jsx(lg,{size:11,className:"mt-0.5 shrink-0"}),B?.installed?`${B.label}${B.version?` ${B.version}`:""} found on this machine.`:`${B?.label??"The CLI"} is not installed; OpenSol will fetch it with npx for this deploy.`]})]})}),l.jsxs("div",{className:"flex min-h-0 flex-col",children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-line px-4 py-3",children:[l.jsx("ol",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:ah.map((H,K)=>{const be=G[H.id],je=H.icon;return l.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsxs("span",{className:ee("flex h-7 items-center gap-1.5 rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",be==="active"&&"border-accent/40 bg-accent-soft text-accent",be==="done"&&"border-success/30 bg-success/10 text-success",be==="error"&&"border-danger/30 bg-danger/10 text-danger",be==="idle"&&"border-line text-faint"),children:[be==="active"?l.jsx(Ht,{size:11}):be==="done"?l.jsx(Mn,{size:11}):be==="error"?l.jsx(Du,{size:11}):l.jsx(je,{size:11}),l.jsx("span",{className:"hidden sm:inline",children:H.label})]}),K<ah.length-1&&l.jsx("span",{className:ee("h-px w-4 shrink-0",be==="done"?"bg-success/40":"bg-line")})]},H.id)})}),C?l.jsxs("button",{type:"button",onClick:()=>xe.current?.abort(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-line px-3 text-[11px] font-medium text-muted hover:text-ink",children:[l.jsx(rg,{size:9,fill:"currentColor"})," Stop"]}):l.jsxs("button",{type:"button",onClick:()=>{Pe()},disabled:!se||!x.trim(),className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-accent px-3.5 text-[11.5px] font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-40",children:[l.jsx(iC,{size:10,fill:"currentColor"}),fe||te?"Deploy again":"Deploy"]})]}),fe&&l.jsx("div",{className:"shrink-0 border-b border-line bg-success/[0.05] px-4 py-3.5",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-success/15 text-success",children:l.jsx(Mn,{size:17})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"text-[11px] font-medium text-muted",children:["Live on ",D.label]}),l.jsx("a",{href:fe.url,target:"_blank",rel:"noreferrer",className:"block truncate text-[14px] font-semibold text-accent hover:underline",children:fe.url})]}),l.jsx("button",{type:"button",onClick:Fe,className:"icon-button h-8 w-8",title:"Copy URL","aria-label":"Copy URL",children:ae?l.jsx(Mn,{size:13,className:"text-success"}):l.jsx(pd,{size:13})}),l.jsx("a",{href:fe.url,target:"_blank",rel:"noreferrer",className:"icon-button h-8 w-8",title:"Open site","aria-label":"Open site",children:l.jsx(Xh,{size:13})})]})}),te&&l.jsxs("div",{className:"flex shrink-0 items-start gap-2 border-b border-danger/20 bg-danger/[0.05] px-4 py-2.5 text-[11px] leading-relaxed text-danger",children:[l.jsx(Du,{size:13,className:"mt-0.5 shrink-0"}),te]}),l.jsx("div",{ref:_,className:"thin-scroll min-h-0 flex-1 overflow-y-auto bg-canvas/40 px-4 py-3",children:$.length===0&&!C?l.jsxs("div",{className:"flex h-full min-h-[200px] flex-col items-center justify-center gap-2 px-6 text-center",children:[l.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-2xl bg-raised text-faint",children:l.jsx(YT,{size:18})}),l.jsx("p",{className:"text-[12px] font-medium text-muted",children:"Ready when you are"}),l.jsx("p",{className:"max-w-[280px] text-[10.5px] leading-relaxed text-faint",children:"Leave the fields on auto: OpenSol installs dependencies, builds if there is no output folder yet, then publishes it. Tokens never appear in the log."})]}):l.jsxs("pre",{className:"whitespace-pre-wrap break-words font-mono text-[10.5px] leading-[1.7] text-muted",children:[$.map(H=>l.jsxs("span",{className:ee("block",H.stream==="stderr"&&"text-danger",H.stream==="meta"&&"font-medium text-accent"),children:[H.stream==="meta"?"› ":"",H.text]},H.id)),C&&l.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-accent",children:[l.jsx(Ht,{size:10})," working…"]})]})}),l.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-2 border-t border-line px-4 text-[10px] text-faint",children:[l.jsx(yr,{size:10}),"Tokens encrypted at rest",l.jsx("span",{className:"ml-auto truncate",children:Se||"No folder"})]})]})]})]})}const qh={name:"",transport:"stdio",command:"",args:"",env:"",url:"",headers:"",oauth:!1,clientId:"",clientSecret:"",scope:""},SI=[{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 _I(e){const i=[],a=/"([^"]*)"|'([^']*)'|(\S+)/g;let r;for(;r=a.exec(e);)i.push(r[1]??r[2]??r[3]);return i}function TI(e=[]){return e.map(i=>/\s/.test(i)?`"${i}"`:i).join(" ")}function Zv(e,i){const a={};for(const r of e.split(`
|
|
271
|
+
`)){const c=r.indexOf(i);c<1||(a[r.slice(0,c).trim()]=r.slice(c+1).trim())}return a}function Qv(e,i){return Object.entries(e??{}).map(([a,r])=>`${a}${i===":"?": ":i}${r}`).join(`
|
|
272
|
+
`)}function dE(e){return{id:e.id,name:e.name,transport:e.transport,command:e.command??"",args:TI(e.args),env:Qv(e.env,"="),url:e.url??"",headers:Qv(e.headers,":"),oauth:!!e.oauth?.enabled,clientId:e.oauth?.clientId??"",clientSecret:e.oauth?.clientSecret??"",scope:e.oauth?.scope??""}}function Wv(e){return e.name.trim()?e.transport==="stdio"?!!e.command.trim():/^https?:\/\//i.test(e.url.trim()):!1}function fE(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:_I(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 Js(e){return fE(dE(e),e)}const rl=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Jv=e=>{const i={};if(rl(e))for(const[a,r]of Object.entries(e))(typeof r=="string"||typeof r=="number")&&(i[a]=String(r));return i};function CI(e,i){const a=i.disabled!==!0,r=[i.url,i.serverUrl,i.httpUrl].find(c=>typeof c=="string");if(r){const c=String(i.type??i.transport??"").toLowerCase(),u=c.includes("sse")||!c&&/\/sse\/?$/i.test(r)?"sse":"http",d=Jv(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 c=Array.isArray(i.args)?i.args.filter(u=>typeof u=="string"):[];return{name:e,transport:"stdio",enabled:a,command:i.command,args:c,env:Jv(i.env)}}return null}const ew=e=>rl(e)&&(typeof e.command=="string"||typeof e.url=="string"||typeof e.serverUrl=="string"||typeof e.httpUrl=="string");function jI(e){let i;try{i=JSON.parse(e)}catch{throw new Error("That is not valid JSON.")}if(!rl(i))throw new Error("Expected a JSON object.");let a=null;for(const u of[i.mcpServers,i.servers,rl(i.mcp)?i.mcp.servers:void 0])if(rl(u)){a=u;break}if(a||(ew(i)?a={Imported:i}:Object.values(i).length>0&&Object.values(i).every(ew)&&(a=i)),!a)throw new Error('No MCP servers found. Expect {"mcpServers": {"name": {"command": …} or {"url": …}}}.');const r=[],c=[];for(const[u,d]of Object.entries(a)){const p=rl(d)?CI(u.slice(0,60),d):null;p?r.push(p):c.push(u)}if(r.length===0)throw new Error('None of those entries has a "command" or a "url".');return{servers:r,skipped:c}}const Aa="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",Gh=Aa.replace("h-9 ",""),Yh=[{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"}],AI={stdio:"stdio",http:"HTTP",sse:"SSE"};function Gg({transport:e,size:i=13}){const a=e==="stdio"?lg:e==="sse"?lC:NT;return l.jsx(a,{size:i,strokeWidth:1.7})}function pE({status:e}){return l.jsx("span",{className:ee("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 mE(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 OI(){const e=me(M=>M.mcpOpen),i=me(M=>M.setMcpOpen),a=me(M=>M.notify),r=me(M=>M.askConfirm),c=Cn(M=>M.servers),u=Cn(M=>M.loaded),d=Cn(M=>M.error),p=Cn(M=>M.load),h=Cn(M=>M.save),g=Cn(M=>M.act),b=Cn(M=>M.authorize),x=Cn(M=>M.logout),[v,y]=U.useState(null),[k,S]=U.useState(!1),[j,E]=U.useState(!1),[A,T]=U.useState(null);U.useEffect(()=>{e?p():(y(null),S(!1))},[e,p]);const R=U.useMemo(()=>v&&!(v.kind==="server"&&!c.some(M=>M.id===v.id))?v:c[0]?{kind:"server",id:c[0].id}:{kind:"new",draft:{...qh}},[v,c]),P=R.kind==="server"?c.find(M=>M.id===R.id):void 0,z=()=>i(!1),C=M=>{y(M),S(!0)},L=async(M,ae)=>{E(!0);try{return await h(M),ae&&a(ae,"success"),!0}catch(ne){return a(ne instanceof Error?ne.message:"Could not save MCP servers.","error"),!1}finally{E(!1)}},G=(M,ae)=>L(c.map(ne=>ne.id===M?{...Js(ne),...ae}:Js(ne))),O=async(M,ae)=>{const ne=new Set(c.map(D=>D.id)),xe=fE(M,c.find(D=>D.id===M.id)),_=ae?[...c.map(Js),xe]:c.map(D=>D.id===M.id?xe:Js(D));if(!await L(_,ae?`Added ${xe.name}. Connecting…`:`Saved ${xe.name}.`))return;const ve=Cn.getState().servers.find(D=>!ne.has(D.id)),ce=ae?ve?.id:M.id;ce&&y({kind:"server",id:ce})},$=async M=>{const ae=new Set(c.map(_=>_.id));if(!await L([...c.map(Js),...M],`Imported ${M.length} server${M.length===1?"":"s"}.`))return;const xe=Cn.getState().servers.find(_=>!ae.has(_.id));y(xe?{kind:"server",id:xe.id}:null)},Z=async M=>{await r({title:`Remove ${M.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 L(c.filter(ne=>ne.id!==M.id).map(Js),`Removed ${M.name}.`)&&(y(null),S(!1))},fe=async M=>{T(M.id);try{await b(M.id),a(`Finish signing in to ${M.name} in the new window.`,"info")}catch(ae){a(ae instanceof Error?ae.message:"Could not start sign-in.","error")}finally{T(null)}},re=c.filter(M=>M.status==="connected").length,te=c.reduce((M,ae)=>M+(ae.status==="connected"?ae.tools.length-ae.disabledTools.length:0),0);return l.jsxs(jd,{open:e,onClose:z,labelledBy:"mcp-title",className:"settings-shell h-[94dvh] p-0 sm:h-[min(88dvh,780px)] sm:w-[min(1080px,96vw)] sm:!rounded-[28px]",children:[l.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:[l.jsx("div",{className:"settings-glow pointer-events-none absolute inset-x-0 top-0 h-32"}),l.jsxs("div",{className:"relative min-w-0 flex-1",children:[l.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.22em] text-faint",children:"Model Context Protocol"}),l.jsx("h2",{id:"mcp-title",className:"mt-1 font-display text-[26px] font-semibold leading-none tracking-[-0.035em] text-ink",children:"MCP servers"}),l.jsx("p",{className:"mt-1.5 text-[11.5px] text-muted",children:c.length===0?"Give the agent new tools from local programs or remote services.":`${re} of ${c.length} connected · ${te} tool${te===1?"":"s"} available to the agent`})]}),l.jsxs("div",{className:"relative flex shrink-0 items-center gap-1.5",children:[l.jsxs("button",{type:"button",className:"chip hidden h-8 rounded-full px-3.5 text-[11.5px] sm:inline-flex",onClick:()=>C({kind:"import"}),children:[l.jsx(r0,{size:13})," Import JSON"]}),l.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:()=>C({kind:"new",draft:{...qh}}),children:[l.jsx(Wr,{size:13})," Add server"]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8 rounded-full",onClick:z,"aria-label":"Close MCP panel",children:l.jsx($i,{size:16})})]})]}),l.jsxs("div",{className:"flex min-h-0 flex-1",children:[l.jsxs("aside",{className:ee("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&&l.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&&l.jsxs("p",{className:"flex items-center gap-2 px-2 py-3 text-[12px] text-faint",children:[l.jsx(Ht,{size:12})," Loading servers…"]}),u&&c.length===0&&l.jsx("p",{className:"rounded-2xl border border-dashed border-line px-4 py-8 text-center text-[12px] text-muted",children:"No servers yet."}),l.jsx("ul",{className:"space-y-1",children:c.map(M=>{const ae=R.kind==="server"&&R.id===M.id;return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>C({kind:"server",id:M.id}),className:ee("flex w-full items-center gap-3 rounded-2xl border px-3 py-2.5 text-left transition-all",ae?"border-line bg-panel shadow-pill":"border-transparent hover:bg-raised/70"),children:[l.jsx(pE,{status:M.status}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium text-ink",children:[l.jsx("span",{className:"truncate",children:M.name}),M.oauth?.enabled&&l.jsx(Bo,{size:11,className:ee("shrink-0",M.oauth.authorized?"text-success":"text-warning"),"aria-label":"OAuth"})]}),l.jsx("span",{className:ee("mt-0.5 block truncate text-[11px]",M.status==="needs_auth"?"text-warning":M.status==="error"?"text-danger":"text-muted"),children:mE(M)})]}),l.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:[l.jsx(Gg,{transport:M.transport,size:10}),AI[M.transport]]})]})},M.id)})}),l.jsxs("button",{type:"button",className:"chip mt-3 h-8 w-full justify-center rounded-xl text-[11.5px] sm:hidden",onClick:()=>C({kind:"import"}),children:[l.jsx(r0,{size:13})," Import JSON"]})]}),l.jsxs("section",{className:ee("min-w-0 flex-1 flex-col bg-panel md:flex",k?"flex":"hidden"),children:[l.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:()=>S(!1),children:[l.jsx(A2,{size:15})," All servers"]}),l.jsx("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto",children:u?R.kind==="new"?l.jsx(tw,{title:"New MCP server",initial:R.draft,busy:j,presets:!0,submitLabel:"Save and connect",onCancel:c.length>0?()=>y(null):void 0,onSubmit:M=>{O(M,!0)}},`new-${JSON.stringify(R.draft)}`):R.kind==="edit"?l.jsx(tw,{title:`Edit ${R.draft.name}`,initial:R.draft,busy:j,submitLabel:"Save changes",onCancel:()=>y({kind:"server",id:R.draft.id??""}),onSubmit:M=>{O(M,!1)}},`edit-${R.draft.id}`):R.kind==="import"?l.jsx(RI,{busy:j,onCancel:()=>y(null),onImport:M=>{$(M)}}):P?l.jsx(MI,{server:P,signingIn:A===P.id,onEdit:()=>C({kind:"edit",draft:dE(P)}),onPatch:M=>{G(P.id,M)},onAct:M=>{g(P.id,M)},onAuthorize:()=>{fe(P)},onSignOut:()=>{x(P.id).catch(M=>a(M instanceof Error?M.message:"Could not sign out.","error"))},onRemove:()=>{Z(P)}}):null:null})]})]})]})}function MI({server:e,signingIn:i,onEdit:a,onPatch:r,onAct:c,onAuthorize:u,onSignOut:d,onRemove:p}){const[h,g]=U.useState(""),b=e.status==="connected"||e.status==="connecting",x=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 l.jsxs("div",{className:"space-y-5 px-5 py-5 sm:px-7 sm:py-6",children:[l.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("h3",{className:"flex items-center gap-2.5 font-display text-[22px] font-semibold leading-tight tracking-[-0.03em] text-ink",children:[l.jsx(pE,{status:e.status}),l.jsx("span",{className:"truncate",children:e.name})]}),l.jsx("p",{className:ee("mt-1 text-[12px]",e.status==="error"?"text-danger":e.status==="needs_auth"?"text-warning":"text-muted"),children:mE(e)})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[b?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Reload tools","aria-label":"Reload tools",onClick:()=>c("refresh"),children:l.jsx(Ii,{size:14,className:ee(e.status==="connecting"&&"animate-spin")})}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Disconnect","aria-label":"Disconnect",onClick:()=>c("disconnect"),children:l.jsx(HC,{size:14})})]}):e.status!=="needs_auth"&&l.jsxs("button",{type:"button",className:"chip h-8 rounded-full px-3.5 text-[11.5px]",disabled:!e.enabled,onClick:()=>c("connect"),children:[l.jsx(ag,{size:13})," Connect"]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Edit connection","aria-label":"Edit connection",onClick:a,children:l.jsx($o,{size:14})}),l.jsx(Pi,{checked:e.enabled,onChange:y=>r({enabled:y}),label:`Enable ${e.name}`})]})]}),e.oauth?.enabled&&l.jsxs("div",{className:ee("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:[l.jsx("span",{className:ee("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?l.jsx(yr,{size:17}):l.jsx(Bo,{size:17})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"text-[12.5px] font-medium text-ink",children:e.oauth.authorized?"Signed in with OAuth":"Sign-in required"}),l.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?l.jsxs("button",{type:"button",className:"chip h-8 rounded-full px-3.5 text-[11.5px]",onClick:d,children:[l.jsx(zT,{size:13})," Sign out"]}):l.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?l.jsx(Ht,{size:12}):l.jsx(Xh,{size:12})," Authorize"]})]}),e.status==="error"&&e.error&&l.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}),l.jsxs("div",{className:"grid gap-3 rounded-2xl border border-line p-4 sm:grid-cols-[1fr_auto] sm:items-center",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted",children:[l.jsx(Gg,{transport:e.transport})," ",Yh.find(y=>y.value===e.transport)?.label]}),l.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-ink",children:e.transport==="stdio"?`${e.command} ${(e.args??[]).join(" ")}`:e.url})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[11px] text-muted",children:"Tool calls"}),l.jsx(Ad,{options:[{value:"ask",label:"Ask first"},{value:"auto",label:"Auto-run"}],value:e.approval,onChange:y=>r({approval:y})})]})]}),e.tools.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsxs("p",{className:"mr-auto text-[12px] font-medium text-ink",children:["Tools ",l.jsxs("span",{className:"font-normal text-faint",children:[e.tools.length-e.disabledTools.length,"/",e.tools.length," on"]})]}),l.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&&l.jsxs("div",{className:"relative mb-2",children:[l.jsx(rs,{size:13,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{className:ee(Aa,"pl-8"),placeholder:"Filter tools",value:h,onChange:y=>g(y.target.value)})]}),l.jsxs("ul",{className:"divide-y divide-line rounded-xl border border-line",children:[x.map(y=>{const k=e.disabledTools.includes(y.name);return l.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[l.jsx(Ro,{size:12,className:ee("shrink-0",k?"text-faint":"text-accent")}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:ee("truncate font-mono text-[11.5px]",k?"text-faint line-through":"text-ink"),children:y.name}),y.description&&l.jsx("p",{className:"truncate text-[10.5px] text-muted",children:y.description})]}),y.readOnly&&l.jsx("span",{className:"rounded-full bg-success/10 px-1.5 py-px text-[9px] text-success",children:"read-only"}),l.jsx(Pi,{checked:!k,label:`Enable ${y.name}`,onChange:S=>r({disabledTools:S?e.disabledTools.filter(j=>j!==y.name):[...e.disabledTools,y.name]})})]},y.name)}),x.length===0&&l.jsx("li",{className:"px-3 py-4 text-center text-[11.5px] text-faint",children:"No tools match."})]})]}),l.jsx("div",{className:"flex justify-end",children:l.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:[l.jsx(sa,{size:12})," Remove server"]})})]})}function tw({title:e,initial:i,busy:a,presets:r=!1,submitLabel:c,onCancel:u,onSubmit:d}){const[p,h]=U.useState(i),[g,b]=U.useState(!!(i.clientId||i.scope)),x=p.transport!=="stdio",v=y=>h(k=>({...k,...y}));return l.jsxs("form",{className:"space-y-4 px-5 py-5 sm:px-7 sm:py-6",onSubmit:y=>{y.preventDefault(),Wv(p)&&!a&&d(p)},children:[l.jsx("h3",{className:"font-display text-[22px] font-semibold leading-tight tracking-[-0.03em] text-ink",children:e}),r&&l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 text-[11px] font-medium text-muted",children:"Start from a template"}),l.jsx("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:SI.map(y=>l.jsxs("button",{type:"button",onClick:()=>h({...qh,...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:[l.jsx("span",{className:"block text-[12px] font-medium text-ink",children:y.label}),l.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-muted",children:y.description})]},y.label))})]}),l.jsxs("div",{className:"grid gap-3",children:[l.jsx("input",{"data-autofocus":!0,className:Aa,placeholder:"Name (e.g. GitHub)",value:p.name,onChange:y=>v({name:y.target.value})}),l.jsxs("div",{children:[l.jsx(Ad,{options:Yh.map(({value:y,label:k})=>({value:y,label:k})),value:p.transport,onChange:y=>v({transport:y}),size:"md"}),l.jsx("p",{className:"mt-1.5 text-[11px] text-faint",children:Yh.find(y=>y.value===p.transport)?.hint})]})]}),x?l.jsxs(l.Fragment,{children:[l.jsx("input",{className:ee(Aa,"font-mono"),placeholder:p.transport==="sse"?"https://example.com/sse":"https://example.com/mcp",value:p.url,onChange:y=>v({url:y.target.value})}),l.jsxs("div",{className:"rounded-2xl border border-line p-3.5",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent",children:l.jsx(Bo,{size:14})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"text-[12.5px] font-medium text-ink",children:"Sign in with OAuth"}),l.jsx("p",{className:"text-[11px] text-muted",children:"For services that ask you to approve access in the browser (Linear, Notion, Sentry…)."})]}),l.jsx(Pi,{checked:p.oauth,onChange:y=>v({oauth:y}),label:"Sign in with OAuth"})]}),p.oauth&&l.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[l.jsxs("button",{type:"button",className:"text-[11px] font-medium text-muted transition-colors hover:text-ink",onClick:()=>b(y=>!y),children:[g?"Hide":"Show"," advanced client settings"]}),g&&l.jsxs("div",{className:"mt-2.5 grid gap-2.5 sm:grid-cols-2",children:[l.jsx("input",{className:ee(Aa,"font-mono"),placeholder:"Client ID (optional)",value:p.clientId,onChange:y=>v({clientId:y.target.value})}),l.jsx("input",{className:ee(Aa,"font-mono"),type:"password",autoComplete:"off",placeholder:"Client secret (optional)",value:p.clientSecret,onChange:y=>v({clientSecret:y.target.value})}),l.jsx("input",{className:ee(Aa,"font-mono sm:col-span-2"),placeholder:"Scopes (optional, space separated)",value:p.scope,onChange:y=>v({scope:y.target.value})}),l.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: ",l.jsx("span",{className:"font-mono",children:`${window.location.origin}/oauth/mcp/callback`})]})]})]})]}),l.jsx("textarea",{className:ee(Gh,"h-20 resize-none py-2 font-mono"),placeholder:`Headers, one per line (API keys, bearer tokens)
|
|
273
|
+
Authorization: Bearer …`,value:p.headers,onChange:y=>v({headers:y.target.value})})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsx("input",{className:ee(Aa,"font-mono"),placeholder:"command",value:p.command,onChange:y=>v({command:y.target.value})}),l.jsx("input",{className:ee(Aa,"font-mono"),placeholder:"arguments",value:p.args,onChange:y=>v({args:y.target.value})})]}),l.jsx("textarea",{className:ee(Gh,"h-20 resize-none py-2 font-mono"),placeholder:`Environment, one per line
|
|
274
|
+
API_KEY=…`,value:p.env,onChange:y=>v({env:y.target.value})}),l.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."})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u&&l.jsx("button",{type:"button",className:"chip h-8 rounded-full px-4",onClick:u,children:"Cancel"}),l.jsxs("button",{type:"submit",disabled:a||!Wv(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&&l.jsx(Ht,{size:11})," ",c]})]})]})}function RI({busy:e,onCancel:i,onImport:a}){const[r,c]=U.useState(""),u=U.useMemo(()=>{if(!r.trim())return null;try{return{...jI(r),error:""}}catch(d){return{servers:[],skipped:[],error:d instanceof Error?d.message:"Could not read that JSON."}}},[r]);return l.jsxs("div",{className:"space-y-4 px-5 py-5 sm:px-7 sm:py-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-display text-[22px] font-semibold leading-tight tracking-[-0.03em] text-ink",children:"Import from JSON"}),l.jsxs("p",{className:"mt-1 text-[12px] leading-relaxed text-muted",children:["Paste the ",l.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."]})]}),l.jsx("textarea",{"data-autofocus":!0,className:ee(Gh,"h-48 resize-none py-2.5 font-mono text-[11.5px]"),placeholder:`{
|
|
275
|
+
"mcpServers": {
|
|
276
|
+
"github": { "url": "https://api.githubcopilot.com/mcp/" },
|
|
277
|
+
"files": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] }
|
|
278
|
+
}
|
|
279
|
+
}`,value:r,onChange:d=>c(d.target.value),spellCheck:!1}),u?.error&&l.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&&l.jsx("ul",{className:"divide-y divide-line rounded-xl border border-line",children:u.servers.map(d=>l.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[l.jsx("span",{className:"text-faint",children:l.jsx(Gg,{transport:d.transport??"stdio"})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[12px] font-medium text-ink",children:d.name}),l.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&&l.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&&l.jsxs("p",{className:"text-[11px] text-faint",children:["Skipped (no command or url): ",u.skipped.join(", ")]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",className:"chip h-8 rounded-full px-4",onClick:i,children:"Cancel"}),l.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&&l.jsx(Ht,{size:11})," Import ",u&&u.servers.length>0?`${u.servers.length} server${u.servers.length===1?"":"s"}`:""]})]})]})}function DI(){const e=me(T=>T.paletteOpen),i=me(T=>T.setPaletteOpen),a=me(T=>T.openSettings),r=me(T=>T.setMcpOpen),c=me(T=>T.setWorkspaceOpen),u=me(T=>T.setDeployOpen),d=me(T=>T.focusComposer),p=me(T=>T.notify),h=Xe(T=>T.sessions),g=Be(T=>T.entries),[b,x]=U.useState(""),[v,y]=U.useState(0),k=U.useRef(null),S=U.useRef(null);U.useEffect(()=>{if(!e)return;x(""),y(0),S.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const T=document.body.style.overflow;document.body.style.overflow="hidden";const R=window.setTimeout(()=>k.current?.focus(),30);return()=>{window.clearTimeout(R),document.body.style.overflow=T,S.current?.focus()}},[e]);const j=U.useMemo(()=>{const T=document.documentElement.classList.contains("dark"),R=()=>i(!1),P=[{id:"action-new-chat",label:"New chat",hint:"Start a clean conversation",group:"Actions",icon:Wr,action:()=>{Xe.getState().newChat(),d(),R()}},{id:"action-workspace",label:"Toggle workspace panel",hint:"Browse and edit files in the open folder",group:"Actions",icon:ml,action:()=>{c(!me.getState().workspaceOpen),R()}},{id:"action-deploy",label:"Deploy a page",hint:"Cloudflare Pages, Netlify or Vercel",group:"Actions",icon:Jr,action:()=>{u(!0),R()}},{id:"action-theme",label:T?"Switch to light theme":"Switch to dark theme",group:"Actions",icon:T?sg:ig,action:()=>{ze.getState().update({theme:T?"light":"dark"}),R()}},{id:"action-models",label:"Model settings",hint:"Providers, encrypted keys and reasoning",group:"Settings",icon:Hu,action:()=>{a("models"),R()}},{id:"action-tools",label:"Tool permissions",hint:"Approval and enablement",group:"Settings",icon:Ro,action:()=>{a("tools"),R()}},{id:"action-search",label:"Search settings",hint:"Tavily, Brave, Serper, DuckDuckGo",group:"Settings",icon:is,action:()=>{a("search"),R()}},{id:"action-mcp",label:"MCP servers",hint:"Connections, OAuth sign-in and tools",group:"Settings",icon:ag,action:()=>{R(),r(!0)}},{id:"action-skills",label:"Skills",hint:"Load and manage reusable instructions",group:"Settings",icon:oi,action:()=>{a("skills"),R()}},{id:"action-deploy-settings",label:"Hosting credentials",hint:"Cloudflare, Netlify and Vercel tokens",group:"Settings",icon:Jr,action:()=>{a("deploy"),R()}},{id:"action-appearance",label:"Appearance",hint:"Theme and token estimates",group:"Settings",icon:dw,action:()=>{a("appearance"),R()}},{id:"action-about",label:"About OpenSol",hint:"Local storage and reset controls",group:"Settings",icon:Qh,action:()=>{a("about"),R()}},{id:"action-export",label:"Export conversations",hint:"Download a JSON history file",group:"Actions",icon:rw,action:()=>{Sw(),p("Conversation history exported.","success"),R()}}],z=[...h].sort((L,G)=>G.updatedAt-L.updatedAt).map(L=>({id:`chat-${L.id}`,label:L.title,hint:`${L.messages.length} messages · ${ed(L.updatedAt)}`,group:"Conversations",icon:tg,keywords:L.messages.filter(G=>G.role==="user").map(G=>G.content).join(" ").slice(0,1e3),action:()=>{Xe.getState().setActive(L.id),R()}})),C=g.filter(L=>L.type==="file").slice(0,1500).map(L=>({id:`file-${L.path}`,label:L.name,hint:L.path,group:"Workspace files",icon:as,keywords:L.path,action:()=>{Be.getState().setActiveFile(L.path),c(!0),R()}}));return[...P,...z,...C]},[h,g,d,p,a,r,i,c,u]),E=U.useMemo(()=>{const T=b.trim().toLowerCase(),R=T?40:18;if(!T){const P=new Set([...h].sort((z,C)=>C.updatedAt-z.updatedAt).slice(0,2).map(z=>`chat-${z.id}`));return j.filter(z=>z.group!=="Conversations"||P.has(z.id)).filter((z,C,L)=>L.findIndex(G=>G.id===z.id)===C).slice(0,R)}return j.filter(P=>`${P.label} ${P.hint??""} ${P.keywords??""} ${P.group}`.toLowerCase().includes(T)).slice(0,R)},[j,b,h]);if(U.useEffect(()=>{y(0)},[b]),U.useEffect(()=>{if(!e)return;document.querySelector(`[data-palette-index="${v}"]`)?.scrollIntoView({block:"nearest"})},[v,e]),U.useEffect(()=>{v>E.length-1&&y(Math.max(0,E.length-1))},[E.length,v]),!e)return null;const A=T=>{const R=E[T];R&&R.action()};return xl.createPortal(l.jsxs("div",{className:"fixed inset-0 z-[90] flex items-start justify-center px-3 pt-[10vh] sm:pt-[14vh]",children:[l.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)}),l.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:[l.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2.5 border-b border-line px-3.5",children:[l.jsx(rs,{size:15,className:"shrink-0 text-faint"}),l.jsx("input",{ref:k,value:b,onChange:T=>x(T.target.value),onKeyDown:T=>{T.key==="ArrowDown"?(T.preventDefault(),E.length>0&&y(R=>Math.min(R+1,E.length-1))):T.key==="ArrowUp"?(T.preventDefault(),y(R=>Math.max(R-1,0))):T.key==="Enter"?(T.preventDefault(),A(v)):T.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":E[v]?`palette-${E[v].id}`:void 0}),l.jsx("kbd",{className:"hidden rounded border border-line bg-raised px-1.5 py-0.5 text-[9px] text-faint sm:block",children:"Esc"})]}),l.jsxs("div",{id:"palette-results",role:"listbox",className:"thin-scroll min-h-0 flex-1 overflow-y-auto p-1.5",children:[E.length===0&&l.jsxs("div",{className:"px-4 py-10 text-center",children:[l.jsx("p",{className:"text-[12px] font-medium text-muted",children:"No matches"}),l.jsx("p",{className:"mt-1 text-[10.5px] text-faint",children:"Try a chat title, a file name or “deploy”."})]}),E.map((T,R)=>{const P=T.icon,z=R===0||E[R-1].group!==T.group;return l.jsxs(U.Fragment,{children:[z&&l.jsx("p",{className:"px-2 pb-1 pt-2 text-[9.5px] font-medium uppercase tracking-[0.08em] text-faint",children:T.group}),l.jsxs("button",{type:"button",id:`palette-${T.id}`,"data-palette-index":R,role:"option","aria-selected":v===R,onMouseMove:()=>y(R),onClick:()=>A(R),className:ee("flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors",v===R?"bg-raised":"hover:bg-raised/60"),children:[l.jsx("span",{className:ee("flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-line bg-panel",v===R?"text-accent":"text-muted"),children:l.jsx(P,{size:12})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[11.5px] font-medium text-ink",children:T.label}),T.hint&&l.jsx("span",{className:"mt-0.5 block truncate text-[9.5px] text-faint",children:T.hint})]}),l.jsx(h2,{size:11,className:ee("shrink-0 text-faint transition-opacity",v===R?"opacity-100":"opacity-0")})]})]},T.id)})]}),l.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:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsxs("span",{children:[l.jsx("kbd",{className:"rounded border border-line bg-panel px-1",children:"↑"})," ",l.jsx("kbd",{className:"rounded border border-line bg-panel px-1",children:"↓"})," navigate"]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"rounded border border-line bg-panel px-1",children:"↵"})," open"]})]}),l.jsx("span",{children:"OpenSol"})]})]})]}),document.body)}const nw=["Waking the local daemon","Unlocking your keys","Loading workspace","Almost there"],zI=["M32 7v8","M32 49v8","M7 32h8","M49 32h8"],LI=["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 II({size:e=64}){return l.jsxs("div",{className:"relative",style:{width:e*1.7,height:e*1.7},children:[l.jsx("span",{className:"absolute inset-0 m-auto animate-ping rounded-full bg-accent/20",style:{width:e*.7,height:e*.7}}),l.jsx("span",{className:"absolute inset-0 m-auto rounded-full bg-accent/10 blur-2xl",style:{width:e*1.4,height:e*1.4}}),l.jsxs("svg",{viewBox:"0 0 64 64",width:e,height:e,fill:"none",className:"splash-sun absolute inset-0 m-auto text-accent",children:[l.jsx("circle",{className:"core",cx:"32",cy:"32",r:"12",fill:"currentColor"}),l.jsxs("g",{className:"rays",stroke:"currentColor",strokeWidth:"4.4",strokeLinecap:"round",children:[zI.map((i,a)=>l.jsx("path",{d:i,className:"ray",pathLength:8,style:{animationDelay:`${.35+a*.07}s`}},i)),LI.map((i,a)=>l.jsx("path",{d:i,className:"ray",pathLength:8,opacity:.55,style:{animationDelay:`${.65+a*.07}s`}},i))]})]})]})}function UI({phase:e,error:i,leaving:a,onRetry:r}){const[c,u]=U.useState(0);return U.useEffect(()=>{if(e==="error")return;const d=window.setInterval(()=>u(p=>Math.min(nw.length-1,p+1)),650);return()=>window.clearInterval(d)},[e]),l.jsxs("div",{className:ee("splash",a&&"is-leaving"),role:"status","aria-live":"polite",children:[l.jsx("div",{className:"hero-wash pointer-events-none absolute inset-0","aria-hidden":"true"}),l.jsxs("div",{className:"relative flex w-full max-w-[400px] flex-col items-center px-6 text-center",children:[l.jsx(II,{}),l.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)=>l.jsx("span",{style:{animationDelay:`${.5+p*.05}s`},className:p>=4?"text-accent":void 0,children:d},p))}),l.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"?l.jsxs("div",{className:"mt-8 w-full animate-rise",children:[l.jsxs("div",{className:"w-full rounded-xl border border-danger/25 bg-danger/[0.05] px-4 py-3 text-left",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[12.5px] font-medium text-ink",children:[l.jsx(fd,{size:14,className:"text-danger"}),"The local daemon did not answer"]}),l.jsx("p",{className:"mt-1.5 whitespace-pre-wrap break-words text-[11.5px] leading-relaxed text-muted",children:i})]}),l.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:[l.jsx(Ii,{size:13}),"Try again"]}),l.jsxs("p",{className:"mt-3 text-[11px] leading-relaxed text-faint",children:["Start OpenSol with ",l.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."]})]}):l.jsxs("div",{className:"mt-9 flex animate-fade flex-col items-center gap-3 [animation-delay:0.8s]",children:[l.jsx("div",{className:"loading-bar h-[2px] w-32 rounded-full"}),l.jsxs("p",{className:"animate-rise text-[12px] text-muted",children:[nw[c],"…"]},c)]}),l.jsx("div",{className:"mt-12 animate-fade [animation-delay:1.2s]",children:l.jsx(OM,{})})]})]})}const BI=1600;function $I(){const e=Au(x=>x.phase),i=Au(x=>x.error),a=Au(x=>x.boot),r=ze(x=>x.theme),c=ze(x=>x.chatFontSize),u=me(x=>x.mobileSidebarOpen),d=me(x=>x.setMobileSidebarOpen),p=me(x=>x.setPaletteOpen);qA();const[h,g]=U.useState("show");U.useEffect(()=>{if(e!=="ready"||h!=="show")return;const x=Au.getState().startedAt||Date.now(),v=Math.max(0,BI-(Date.now()-x)),y=window.setTimeout(()=>g("leaving"),v);return()=>window.clearTimeout(y)},[e,h]),U.useEffect(()=>{if(h!=="leaving")return;const x=window.setTimeout(()=>g("gone"),520);return()=>window.clearTimeout(x)},[h]),U.useEffect(()=>{a()},[a]),U.useEffect(()=>{e==="ready"&&bw().then(x=>eI(x.plugins)).catch(()=>{})},[e]),U.useEffect(()=>{const x=document.documentElement,v=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{const k=Dw(r,v.matches);x.dataset.theme=k,x.classList.toggle("dark",ch(r,v.matches)),document.querySelector('meta[name="theme-color"]')?.setAttribute("content",ch(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]),U.useEffect(()=>{document.documentElement.style.setProperty("--chat-font-size",`${c}px`)},[c]),U.useEffect(()=>{const x=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 S=me.getState();S.setWorkspaceOpen(!S.workspaceOpen);return}}v.key==="Escape"&&me.getState().mobileSidebarOpen&&d(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[d,p]);const b=e==="ready";return l.jsxs("div",{className:"flex h-dvh min-h-0 overflow-hidden bg-canvas text-ink",children:[b&&l.jsxs(l.Fragment,{children:[l.jsx(RM,{}),u&&l.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"}),l.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:[l.jsx(n8,{}),l.jsx(m8,{})]}),l.jsx(NI,{}),l.jsx(OI,{}),l.jsx(EI,{}),l.jsx(DI,{}),l.jsx(YM,{})]}),l.jsx(GM,{}),h!=="gone"&&l.jsx(UI,{phase:e,error:i,leaving:h==="leaving",onRetry:()=>{a(!0)}})]})}class PI extends U.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}
|
|
280
|
+
|
|
281
|
+
${i?.stack??""}`}copy=async()=>{try{await navigator.clipboard.writeText(this.details()),this.setState({copied:!0})}catch{}};render(){return this.state.error?l.jsx("div",{className:"flex h-dvh items-center justify-center bg-panel px-5 text-ink",children:l.jsxs("div",{className:"w-full max-w-[460px]",children:[l.jsx(gl,{size:34}),l.jsx("h1",{className:"mt-4 font-display text-[28px] font-normal tracking-[-0.02em]",children:"Something broke on this screen"}),l.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."}),l.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}),l.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[l.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"}),l.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"}),l.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 hE=document.getElementById("root");if(!hE)throw new Error("Root element not found.");n2.createRoot(hE).render(l.jsx(U.StrictMode,{children:l.jsx(PI,{children:l.jsx($I,{})})}));
|