@bibobonking/opensol 3.1.5 → 3.2.0

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/LICENSE +21 -0
  3. package/README.md +24 -20
  4. package/desktop/README.md +1 -1
  5. package/dist/assets/{index-C0yvs6Vl.js → index-BUVnnhRH.js} +1 -1
  6. package/dist/assets/index-CyxlAgKM.js +271 -0
  7. package/dist/assets/index-DFeF90S8.css +1 -0
  8. package/dist/index.html +2 -2
  9. package/package.json +1 -1
  10. package/server/README.md +15 -68
  11. package/server/daemon.mjs +6 -1
  12. package/server/lib/deploy.mjs +5 -10
  13. package/server/lib/shell.mjs +149 -0
  14. package/server/lib/shell.test.mjs +72 -0
  15. package/server/lib/tools.mjs +8 -44
  16. package/src/agent/adapters/anthropic.ts +2 -3
  17. package/src/agent/adapters/gemini.ts +2 -3
  18. package/src/agent/adapters/openai-responses.ts +2 -3
  19. package/src/agent/adapters/openai.ts +2 -3
  20. package/src/agent/adapters/shared.ts +3 -0
  21. package/src/components/ChatView.tsx +17 -54
  22. package/src/components/Composer.tsx +143 -135
  23. package/src/components/ContextBar.tsx +2 -2
  24. package/src/components/HomeDashboard.tsx +7 -4
  25. package/src/components/MessageItem.tsx +33 -1
  26. package/src/components/ModelDeck.tsx +5 -27
  27. package/src/components/SettingsModal.tsx +8 -0
  28. package/src/components/ToolCallCard.tsx +2 -2
  29. package/src/components/TrajectoryView.tsx +1 -1
  30. package/src/components/composer/PlusMenu.tsx +117 -0
  31. package/src/components/composer/Popover.tsx +109 -0
  32. package/src/components/composer/WorkspacePicker.tsx +102 -0
  33. package/src/core/plugins/tools/shell.ts +2 -2
  34. package/src/core/plugins/tools/subagent.ts +18 -8
  35. package/src/core/services/agent-loop.ts +45 -43
  36. package/src/core/services/compaction.ts +289 -22
  37. package/src/core/services/llm.ts +6 -2
  38. package/src/core/services/subagents.ts +191 -3
  39. package/src/core/services/system-prompt.ts +35 -7
  40. package/src/core/services/tools.ts +2 -1
  41. package/src/core/types.ts +5 -0
  42. package/src/lib/compact-plan.test.mjs +62 -0
  43. package/src/lib/compact-plan.ts +188 -0
  44. package/src/lib/subagent-types.ts +54 -0
  45. package/src/lib/tool-meta.ts +40 -0
  46. package/src/store/settings.ts +3 -0
  47. package/src/store/ui.ts +12 -0
  48. package/src/types.ts +26 -0
  49. package/shared/plugin-builder.test.mjs +0 -43
  50. package/shared/plugin-package.d.mts +0 -34
  51. package/shared/plugin-package.mjs +0 -197
  52. package/shared/plugin-package.test.mjs +0 -94
  53. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,271 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dm={exports:{}},co={};var i0;function q_(){if(i0)return co;i0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:e,type:r,key:d,ref:o!==void 0?o:null,props:u}}return co.Fragment=i,co.jsx=a,co.jsxs=a,co}var a0;function G_(){return a0||(a0=1,dm.exports=q_()),dm.exports}var l=G_(),fm={exports:{}},We={};var r0;function Y_(){if(r0)return We;r0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),v=Symbol.for("react.view_transition"),y=Symbol.iterator;function k($){return $===null||typeof $!="object"?null:($=y&&$[y]||$["@@iterator"],typeof $=="function"?$:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function A($,oe,xe){this.props=$,this.context=oe,this.refs=_,this.updater=xe||S}A.prototype.isReactComponent={},A.prototype.setState=function($,oe){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,$,oe,"setState")},A.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function C(){}C.prototype=A.prototype;function M($,oe,xe){this.props=$,this.context=oe,this.refs=_,this.updater=xe||S}var B=M.prototype=new C;B.constructor=M,j(B,A.prototype),B.isPureReactComponent=!0;var D=Array.isArray;function N(){}var z={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function R($,oe,xe){var Te=xe.ref;return{$$typeof:e,type:$,key:oe,ref:Te!==void 0?Te:null,props:xe}}function G($,oe){return R($.type,oe,$.props)}function Z($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function fe($){var oe={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(xe){return oe[xe]})}var le=/\/+/g;function J($,oe){return typeof $=="object"&&$!==null&&$.key!=null?fe(""+$.key):oe.toString(36)}function O($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(N,N):($.status="pending",$.then(function(oe){$.status==="pending"&&($.status="fulfilled",$.value=oe)},function(oe){$.status==="pending"&&($.status="rejected",$.reason=oe)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function re($,oe,xe,Te,$e){var He=typeof $;(He==="undefined"||He==="boolean")&&($=null);var Be=!1;if($===null)Be=!0;else switch(He){case"bigint":case"string":case"number":Be=!0;break;case"object":switch($.$$typeof){case e:case i:Be=!0;break;case b:return Be=$._init,re(Be($._payload),oe,xe,Te,$e)}}if(Be)return $e=$e($),Be=Te===""?"."+J($,0):Te,D($e)?(xe="",Be!=null&&(xe=Be.replace(le,"$&/")+"/"),re($e,oe,xe,"",function(X){return X})):$e!=null&&(Z($e)&&($e=G($e,xe+($e.key==null||$&&$.key===$e.key?"":(""+$e.key).replace(le,"$&/")+"/")+Be)),oe.push($e)),1;Be=0;var Ee=Te===""?".":Te+":";if(D($))for(var P=0;P<$.length;P++)Te=$[P],He=Ee+J(Te,P),Be+=re(Te,oe,xe,He,$e);else if(P=k($),typeof P=="function")for($=P.call($),P=0;!(Te=$.next()).done;)Te=Te.value,He=Ee+J(Te,P++),Be+=re(Te,oe,xe,He,$e);else if(He==="object"){if(typeof $.then=="function")return re(O($),oe,xe,Te,$e);throw oe=String($),Error("Objects are not valid as a React child (found: "+(oe==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":oe)+"). If you meant to render a collection of children, use an array instead.")}return Be}function ie($,oe,xe){if($==null)return $;var Te=[],$e=0;return re($,Te,"","",function(He){return oe.call(xe,He,$e++)}),Te}function ne($){if($._status===-1){var oe=$._result,xe=oe();xe.then(function(Te){($._status===0||$._status===-1)&&($._status=1,$._result=Te,xe.status===void 0&&(xe.status="fulfilled",xe.value=Te))},function(Te){($._status===0||$._status===-1)&&($._status=2,$._result=Te,xe.status===void 0&&(xe.status="rejected",xe.reason=Te))}),$._status===-1&&($._status=0,$._result=xe)}if($._status===1)return $._result.default;throw $._result}var E=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var oe=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(oe))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)};function pe($){var oe=z.T,xe={};xe.types=oe!==null?oe.types:null,z.T=xe;try{var Te=$(),$e=z.S;$e!==null&&$e(xe,Te),typeof Te=="object"&&Te!==null&&typeof Te.then=="function"&&Te.then(N,E)}catch(He){E(He)}finally{oe!==null&&xe.types!==null&&(oe.types=xe.types),z.T=oe}}function _e($){var oe=z.T;if(oe!==null){var xe=oe.types;xe===null?oe.types=[$]:xe.indexOf($)===-1&&xe.push($)}else pe(_e.bind(null,$))}var L={map:ie,forEach:function($,oe,xe){ie($,function(){oe.apply(this,arguments)},xe)},count:function($){var oe=0;return ie($,function(){oe++}),oe},toArray:function($){return ie($,function(oe){return oe})||[]},only:function($){if(!Z($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return We.Activity=h,We.Children=L,We.Component=A,We.Fragment=a,We.Profiler=o,We.PureComponent=M,We.StrictMode=r,We.Suspense=g,We.ViewTransition=v,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,We.__COMPILER_RUNTIME={__proto__:null,c:function($){return z.H.useMemoCache($)}},We.addTransitionType=_e,We.cache=function($){return function(){return $.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function($,oe,xe){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var Te=j({},$.props),$e=$.key;if(oe!=null)for(He in oe.key!==void 0&&($e=""+oe.key),oe)!q.call(oe,He)||He==="key"||He==="__self"||He==="__source"||He==="ref"&&oe.ref===void 0||(Te[He]=oe[He]);var He=arguments.length-2;if(He===1)Te.children=xe;else if(1<He){for(var Be=Array(He),Ee=0;Ee<He;Ee++)Be[Ee]=arguments[Ee+2];Te.children=Be}return R($.type,$e,Te)},We.createContext=function($){return $={$$typeof:d,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:u,_context:$},$},We.createElement=function($,oe,xe){var Te,$e={},He=null;if(oe!=null)for(Te in oe.key!==void 0&&(He=""+oe.key),oe)q.call(oe,Te)&&Te!=="key"&&Te!=="__self"&&Te!=="__source"&&($e[Te]=oe[Te]);var Be=arguments.length-2;if(Be===1)$e.children=xe;else if(1<Be){for(var Ee=Array(Be),P=0;P<Be;P++)Ee[P]=arguments[P+2];$e.children=Ee}if($&&$.defaultProps)for(Te in Be=$.defaultProps,Be)$e[Te]===void 0&&($e[Te]=Be[Te]);return R($,He,$e)},We.createRef=function(){return{current:null}},We.forwardRef=function($){return{$$typeof:p,render:$}},We.isValidElement=Z,We.lazy=function($){return{$$typeof:b,_payload:{_status:-1,_result:$},_init:ne}},We.memo=function($,oe){return{$$typeof:x,type:$,compare:oe===void 0?null:oe}},We.startTransition=pe,We.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},We.use=function($){return z.H.use($)},We.useActionState=function($,oe,xe){return z.H.useActionState($,oe,xe)},We.useCallback=function($,oe){return z.H.useCallback($,oe)},We.useContext=function($){return z.H.useContext($)},We.useDebugValue=function(){},We.useDeferredValue=function($,oe){return z.H.useDeferredValue($,oe)},We.useEffect=function($,oe){return z.H.useEffect($,oe)},We.useEffectEvent=function($){return z.H.useEffectEvent($)},We.useId=function(){return z.H.useId()},We.useImperativeHandle=function($,oe,xe){return z.H.useImperativeHandle($,oe,xe)},We.useInsertionEffect=function($,oe){return z.H.useInsertionEffect($,oe)},We.useLayoutEffect=function($,oe){return z.H.useLayoutEffect($,oe)},We.useMemo=function($,oe){return z.H.useMemo($,oe)},We.useOptimistic=function($,oe){return z.H.useOptimistic($,oe)},We.useReducer=function($,oe,xe){return z.H.useReducer($,oe,xe)},We.useRef=function($){return z.H.useRef($)},We.useState=function($){return z.H.useState($)},We.useSyncExternalStore=function($,oe,xe){return z.H.useSyncExternalStore($,oe,xe)},We.useTransition=function(){return z.H.useTransition()},We.version="19.3.1",We}var s0;function tg(){return s0||(s0=1,fm.exports=Y_()),fm.exports}var I=tg();const pm=md(I);var mm={exports:{}},uo={},hm={exports:{}},gm={};var l0;function K_(){return l0||(l0=1,(function(e){function i(O,re){var ie=O.length;O.push(re);e:for(;0<ie;){var ne=ie-1>>>1,E=O[ne];if(0<o(E,re))O[ne]=re,O[ie]=E,ie=ne;else break e}}function a(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var re=O[0],ie=O.pop();if(ie!==re){O[0]=ie;e:for(var ne=0,E=O.length,pe=E>>>1;ne<pe;){var _e=2*(ne+1)-1,L=O[_e],$=_e+1,oe=O[$];if(0>o(L,ie))$<E&&0>o(oe,L)?(O[ne]=oe,O[$]=ie,ne=$):(O[ne]=L,O[_e]=ie,ne=_e);else if($<E&&0>o(oe,ie))O[ne]=oe,O[$]=ie,ne=$;else break e}}return re}function o(O,re){var ie=O.sortIndex-re.sortIndex;return ie!==0?ie:O.id-re.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 g=[],x=[],b=1,h=null,v=3,y=!1,k=!1,S=!1,j=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var re=a(x);re!==null;){if(re.callback===null)r(x);else if(re.startTime<=O)r(x),re.sortIndex=re.expirationTime,i(g,re);else break;re=a(x)}}function B(O){if(S=!1,M(O),!k)if(a(g)!==null)k=!0,D||(D=!0,Z());else{var re=a(x);re!==null&&J(B,re.startTime-O)}}var D=!1,N=-1,z=5,q=-1;function R(){return j?!0:!(e.unstable_now()-q<z)}function G(){if(j=!1,D){var O=e.unstable_now();q=O;var re=!0;try{e:{k=!1,S&&(S=!1,A(N),N=-1),y=!0;var ie=v;try{t:{for(M(O),h=a(g);h!==null&&!(h.expirationTime>O&&R());){var ne=h.callback;if(typeof ne=="function"){h.callback=null,v=h.priorityLevel;var E=ne(h.expirationTime<=O);if(O=e.unstable_now(),typeof E=="function"){h.callback=E,M(O),re=!0;break t}h===a(g)&&r(g),M(O)}else r(g);h=a(g)}if(h!==null)re=!0;else{var pe=a(x);pe!==null&&J(B,pe.startTime-O),re=!1}}break e}finally{h=null,v=ie,y=!1}re=void 0}}finally{re?Z():D=!1}}}var Z;if(typeof C=="function")Z=function(){C(G)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,le=fe.port2;fe.port1.onmessage=G,Z=function(){le.postMessage(null)}}else Z=function(){_(G,0)};function J(O,re){N=_(function(){O(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var ie=v;v=re;try{return O()}finally{v=ie}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(O,re){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var ie=v;v=O;try{return re()}finally{v=ie}},e.unstable_scheduleCallback=function(O,re,ie){var ne=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ne+ie:ne):ie=ne,O){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=ie+E,O={id:b++,callback:re,priorityLevel:O,startTime:ie,expirationTime:E,sortIndex:-1},ie>ne?(O.sortIndex=ie,i(x,O),a(g)===null&&O===a(x)&&(S?(A(N),N=-1):S=!0,J(B,ie-ne))):(O.sortIndex=E,i(g,O),k||y||(k=!0,D||(D=!0,Z()))),O},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(O){var re=v;return function(){var ie=v;v=re;try{return O.apply(this,arguments)}finally{v=ie}}}})(gm)),gm}var o0;function V_(){return o0||(o0=1,hm.exports=K_()),hm.exports}var xm={exports:{}},En={};var c0;function X_(){if(c0)return En;c0=1;var e=tg();function i(b){var h="https://react.dev/errors/"+b;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+b+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function p(b,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:y===d?d:""+y,children:b,containerInfo:h,implementation:v}}var g=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(b,h){if(b==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return En.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,En.browser=function(b){return{$$typeof:u,_reason:b}},En.createPortal=function(b,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return p(b,h,null,v)},En.flushSync=function(b){var h=g.T,v=r.p;try{if(g.T=null,r.p=2,b)return b()}finally{g.T=h,r.p=v,r.d.f()}},En.preconnect=function(b,h){typeof b=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(b,h))},En.prefetchDNS=function(b){typeof b=="string"&&r.d.D(b)},En.preinit=function(b,h){if(typeof b=="string"&&h&&typeof h.as=="string"){var v=h.as,y=x(v,h.crossOrigin),k=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?r.d.S(b,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:k,fetchPriority:S}):v==="script"&&r.d.X(b,{crossOrigin:y,integrity:k,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},En.preinitModule=function(b,h){if(typeof b=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=x(h.as,h.crossOrigin);r.d.M(b,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}}else h==null&&r.d.M(b)},En.preload=function(b,h){if(typeof b=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=x(v,h.crossOrigin);r.d.L(b,v,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},En.preloadModule=function(b,h){if(typeof b=="string")if(h){var v=x(h.as,h.crossOrigin);r.d.m(b,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}else r.d.m(b)},En.requestFormReset=function(b){r.d.r(b)},En.unstable_batchedUpdates=function(b,h){return b(h)},En.useFormState=function(b,h,v){return g.H.useFormState(b,h,v)},En.useFormStatus=function(){return g.H.useHostTransitionStatus()},En.version="19.3.1",En}var u0;function pw(){if(u0)return xm.exports;u0=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(),xm.exports=X_(),xm.exports}var d0;function Z_(){if(d0)return uo;d0=1;var e=V_(),i=tg(),a=pw();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){for(var n=t,s=n;s&&!s.alternate;)n=s,(n.flags&4098)!==0&&(t=n.return),s=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(u(t)!==t)throw Error(r(188))}function x(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,c=n;;){var f=s.return;if(f===null)break;var m=f.alternate;if(m===null){if(c=f.return,c!==null){s=c;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===s)return g(f),t;if(m===c)return g(f),n;m=m.sibling}throw Error(r(188))}if(s.return!==c.return)s=f,c=m;else{for(var w=!1,T=f.child;T;){if(T===s){w=!0,s=f,c=m;break}if(T===c){w=!0,c=f,s=m;break}T=T.sibling}if(!w){for(T=m.child;T;){if(T===s){w=!0,s=m,c=f;break}if(T===c){w=!0,c=m,s=f;break}T=T.sibling}if(!w)throw Error(r(189))}}if(s.alternate!==c)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 h(t,n,s,c,f,m){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&s(t,c,f,m)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&h(t.child,n,s,c,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,c){for(;s!==null;){if(s===n)c.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(c.foundSelf)return t[1]=s,!0;t[0]=s}else if((s.tag!==22||s.memoizedState===null)&&S(t,n,s.child,c))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 _=null,A=null;function C(t,n,s){return t===s?!0:t===n?(_=t,!0):!1}function M(t,n,s){return t===s?(A=t,!1):t===n?(A!==null&&(_=t),!0):!1}function B(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 D(t,n,s){for(var c=0,f=t;f;f=s(f))c++;f=0;for(var m=n;m;m=s(m))f++;for(;0<c-f;)t=s(t),c--;for(;0<f-c;)n=s(n),f--;for(;c--;){if(t===n||n!==null&&t===n.alternate)return t;t=s(t),n=s(n)}return null}var N=Object.assign,z=Symbol.for("react.element"),q=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),fe=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),J=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),_e=Symbol.for("react.legacy_hidden"),L=Symbol.for("react.memo_cache_sentinel"),$=Symbol.for("react.view_transition"),oe=Symbol.for("react.recoverable"),xe=Symbol.iterator;function Te(t){return t===null||typeof t!="object"?null:(t=xe&&t[xe]||t["@@iterator"],typeof t=="function"?t:null)}var $e=Symbol.for("react.client.reference");function He(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$e?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case G:return"Fragment";case fe:return"Profiler";case Z:return"StrictMode";case re:return"Suspense";case ie:return"SuspenseList";case pe:return"Activity";case $:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case R:return"Portal";case J:return t.displayName||"Context";case le:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ne:return n=t.displayName||null,n!==null?n:He(t.type)||"Memo";case E:n=t._payload,t=t._init;try{return He(t(n))}catch{}}return null}var Be=Array.isArray,Ee=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},ye=[],je=-1;function Me(t){return{current:t}}function ot(t){0>je||(t.current=ye[je],ye[je]=null,je--)}function Ke(t,n){je++,ye[je]=t.current,t.current=n}var jt=Me(null),se=Me(null),Le=Me(null),bt=Me(null);function ht(t,n){switch(Ke(Le,n),Ke(se,t),Ke(jt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?f1(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=f1(n),t=p1(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ot(jt),Ke(jt,t)}function Ht(){ot(jt),ot(se),ot(Le)}function Bn(t){var n=t.memoizedState;n!==null&&(Gs._currentValue=n.memoizedState,Ke(bt,t)),n=jt.current;var s=p1(n,t.type);n!==s&&(Ke(se,t),Ke(jt,s))}function Qn(t){se.current===t&&(ot(jt),ot(se)),bt.current===t&&(ot(bt),Gs._currentValue=X)}var ae,ve;function Fe(t){if(ae===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ae=n&&n[1]||"",ve=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ae+t+ve}var Ze=!1;function Vt(t,n){if(!t||Ze)return"";Ze=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ke){var Y=ke}Reflect.construct(t,[],ue)}else{try{ue.call()}catch(ke){Y=ke}ue=!1;try{var W=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ue=!0,new t}finally{ue&&(W!==void 0?Object.defineProperty(t.prototype,"props",W):delete t.prototype.props)}}}else{try{throw Error()}catch(ke){Y=ke}(ue=t())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ke){if(ke&&Y&&typeof ke.stack=="string")return[ke.stack,Y.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=c.DetermineComponentFrameRoot(),w=m[0],T=m[1];if(w&&T){var U=w.split(`
4
+ `),V=T.split(`
5
+ `);for(f=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;if(c===U.length||f===V.length)for(c=U.length-1,f=V.length-1;1<=c&&0<=f&&U[c]!==V[f];)f--;for(;1<=c&&0<=f;c--,f--)if(U[c]!==V[f]){if(c!==1||f!==1)do if(c--,f--,0>f||U[c]!==V[f]){var ee=`
6
+ `+U[c].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),ee}while(1<=c&&0<=f);break}}}finally{Ze=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Fe(s):""}function Et(t,n){switch(t.tag){case 26:case 27:case 5:return Fe(t.type);case 16:return Fe("Lazy");case 13:return t.child!==n&&n!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Vt(t.type,!1);case 11:return Vt(t.type.render,!1);case 1:return Vt(t.type,!0);case 31:return Fe("Activity");case 30:return Fe("ViewTransition");default:return""}}function ln(t){try{var n="",s=null;do n+=Et(t,s),s=t,t=t.return;while(t);return n}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var gn=Object.prototype.hasOwnProperty,Ni=e.unstable_scheduleCallback,Ei=e.unstable_cancelCallback,sa=e.unstable_shouldYield,Ra=e.unstable_requestPaint,Xt=e.unstable_now,un=e.unstable_getCurrentPriorityLevel,Si=e.unstable_ImmediatePriority,An=e.unstable_UserBlockingPriority,_i=e.unstable_NormalPriority,H=e.unstable_LowPriority,de=e.unstable_IdlePriority,Se=e.log,Qe=e.unstable_setDisableYieldValue,Rt=null,pt=null;function Oe(t){if(typeof Se=="function"&&Qe(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Rt,t)}catch{}}var Ne=Math.clz32?Math.clz32:Ft,Ve=Math.log,Zt=Math.LN2;function Ft(t){return t>>>=0,t===0?32:31-(Ve(t)/Zt|0)|0}var $i=256,Da=262144,za=4194304;function la(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 La(t,n,s){var c=t.pendingLanes;if(c===0)return 0;var f=0,m=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var T=c&134217727;return T!==0?(c=T&~m,c!==0?f=la(c):(w&=T,w!==0?f=la(w):s||(s=T&~t,s!==0&&(f=la(s))))):(T=c&~m,T!==0?f=la(T):w!==0?f=la(w):s||(s=c&~t,s!==0&&(f=la(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 kr(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 c=31-Ne(s),f=1<<c;n|=t[c],s&=~f}return n}function Pd(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 xl(){var t=za;return za<<=1,(za&62914560)===0&&(za=4194304),t}function Ia(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function Nr(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Hd(t,n,s,c,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 T=t.entanglements,U=t.expirationTimes,V=t.hiddenUpdates;for(s=w&~s;0<s;){var ee=31-Ne(s),ue=1<<ee;T[ee]=0,U[ee]=-1;var Y=V[ee];if(Y!==null)for(V[ee]=null,ee=0;ee<Y.length;ee++){var W=Y[ee];W!==null&&(W.lane&=-536870913)}s&=~ue}c!==0&&Xo(t,c,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(w&~n))}function Xo(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-Ne(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function Ti(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var c=31-Ne(s),f=1<<c;f&n|t[c]&n&&(t[c]|=n),s&=~f}}function bl(t,n){var s=n&-n;return s=(s&42)!==0?1:ss(s),(s&(t.suspendedLanes|n))!==0?0:s}function ss(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 yl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Zo(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:Z1(t.type))}function Qo(t,n){var s=P.p;try{return P.p=t,n()}finally{P.p=s}}var $n=Math.random().toString(36).slice(2),on="__reactFiber$"+$n,he="__reactProps$"+$n,Ie="__reactContainer$"+$n,lt="__reactEvents$"+$n,At="__reactListeners$"+$n,Yt="__reactHandles$"+$n,Pn="__reactResources$"+$n,Hn="__reactMarker$"+$n,oa="__reactLoad$"+$n;function dn(t){delete t[on],delete t[he],delete t[At],delete t[Yt]}function fn(t){var n;if(n=t[on])return n;for(var s=t.parentNode;s;){if(n=s[Ie]||s[on]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=A1(t);t!==null;){if(s=t[on])return s;t=A1(t)}return n}t=s,s=t.parentNode}return null}function ca(t){if(t=t[on]||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 Ua(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function ua(t){var n=t[Pn];return n||(n=t[Pn]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Qt(t){t[Hn]=!0}function Wo(t){t[oa]=void 0}var Jo=new Set,ec={};function ci(t,n){da(t,n),da(t+"Capture",n)}function da(t,n){for(ec[t]=n,t=0;t<n.length;t++)Jo.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]*$"),tc={},ls={};function et(t){return gn.call(ls,t)?!0:gn.call(tc,t)?!1:ui.test(t)?ls[t]=!0:(tc[t]=!0,!1)}var mt=!1;function Wt(){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 c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,s)}}function fa(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 xn(t,n,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,c)}}function bn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function os(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ce(t,n,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var f=c.get,m=c.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:c.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=os(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(),c="";return t&&(c=os(t)?t.checked?"true":"false":t.value),t=c,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 Wn(t,n,s,c,f,m,w,T){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=""+bn(n)):t.value!==""+bn(n)&&(t.value=""+bn(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?w==="number"&&t.value==n?vl(t,bn(t.value)):vl(t,bn(n)):s!=null?vl(t,bn(s)):c!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+bn(T):t.removeAttribute("name")}function nc(t,n,s,c,f,m,w,T){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?""+bn(s):"",n=n!=null?""+bn(n):s,T||n===t.value||(t.value=n),t.defaultValue=n}c=c??f,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=T?t.checked:!!c,t.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),Ue(t)}function vl(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function cs(t,n,s,c){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&&c&&(t[s].defaultSelected=!0)}else{for(s=""+bn(s),n=null,f=0;f<t.length;f++){if(t[f].value===s){t[f].selected=!0,c&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function nx(t,n,s){if(n!=null&&(n=""+bn(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+bn(s):""}function ix(t,n,s,c){if(n==null){if(c!=null){if(s!=null)throw Error(r(92));if(Be(c)){if(1<c.length)throw Error(r(93));c=c[0]}s=c}s==null&&(s=""),n=s}s=bn(n),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),Ue(t)}function us(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var fE=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 ax(t,n,s){var c=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,s):typeof s!="number"||s===0||fE.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function rx(t,n,s){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="",mt=!0);for(var f in n)c=n[f],n.hasOwnProperty(f)&&s[f]!==c&&(ax(t,f,c),mt=!0)}else for(var m in n)n.hasOwnProperty(m)&&ax(t,m,n[m])}function Fd(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 pE=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"]]),mE=/^[\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 ic(t){return mE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Pi(){}var qd=null;function Gd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ds=null,fs=null;function sx(t){var n=ca(t);if(n&&(t=n.stateNode)){var s=t[he]||null;e:switch(t=n.stateNode,n.type){case"input":if(Wn(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 c=s[n];if(c!==t&&c.form===t.form){var f=c[he]||null;if(!f)throw Error(r(90));Wn(c,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)c=s[n],c.form===t.form&&nt(c)}break e;case"textarea":nx(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&cs(t,!!s.multiple,n,!1)}}}var Yd=!1;function lx(t,n,s){if(Yd)return t(n,s);Yd=!0;try{var c=t(n);return c}finally{if(Yd=!1,(ds!==null||fs!==null)&&(iu(),ds&&(n=ds,t=fs,fs=ds=null,sx(n),t)))for(n=0;n<t.length;n++)sx(t[n])}}function wl(t,n){var s=t.stateNode;if(s===null)return null;var c=s[he]||null;if(c===null)return null;s=c[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":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,n,typeof s));return s}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kd=!1;if(pa)try{var kl={};Object.defineProperty(kl,"passive",{get:function(){Kd=!0}}),window.addEventListener("test",kl,kl),window.removeEventListener("test",kl,kl)}catch{Kd=!1}var Ba=null,Vd=null,ac=null;function ox(){if(ac)return ac;var t,n=Vd,s=n.length,c,f="value"in Ba?Ba.value:Ba.textContent,m=f.length;for(t=0;t<s&&n[t]===f[t];t++);var w=s-t;for(c=1;c<=w&&n[s-c]===f[m-c];c++);return ac=f.slice(t,1<c?1-c:void 0)}function rc(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 sc(){return!0}function cx(){return!1}function On(t){function n(s,c,f,m,w){this._reactName=s,this._targetInst=f,this.type=c,this.nativeEvent=m,this.target=w,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(s=t[T],this[T]=s?s(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?sc:cx,this.isPropagationStopped=cx,this}return N(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=sc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=sc)},persist:function(){},isPersistent:sc}),n}var $a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lc=On($a),Nl=N({},$a,{view:0,detail:0}),hE=On(Nl),Xd,Zd,El,oc=N({},Nl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==El&&(El&&t.type==="mousemove"?(Xd=t.screenX-El.screenX,Zd=t.screenY-El.screenY):Zd=Xd=0,El=t),Xd)},movementY:function(t){return"movementY"in t?t.movementY:Zd}}),ux=On(oc),gE=N({},oc,{dataTransfer:0}),xE=On(gE),bE=N({},Nl,{relatedTarget:0}),Qd=On(bE),yE=N({},$a,{animationName:0,elapsedTime:0,pseudoElement:0}),vE=On(yE),wE=N({},$a,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),kE=On(wE),NE=N({},$a,{data:0}),dx=On(NE),EE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SE={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"},_E={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TE(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=_E[t])?!!n[t]:!1}function Wd(){return TE}var CE=N({},Nl,{key:function(t){if(t.key){var n=EE[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=rc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?SE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wd,charCode:function(t){return t.type==="keypress"?rc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?rc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),jE=On(CE),AE=N({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fx=On(AE),OE=N({},$a,{submitter:0}),ME=On(OE),RE=N({},Nl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wd}),DE=On(RE),zE=N({},$a,{propertyName:0,elapsedTime:0,pseudoElement:0}),LE=On(zE),IE=N({},oc,{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}),UE=On(IE),BE=N({},$a,{newState:0,oldState:0,source:0}),$E=On(BE),PE=[9,13,27,32],Jd=pa&&"CompositionEvent"in window,Sl=null;pa&&"documentMode"in document&&(Sl=document.documentMode);var HE=pa&&"TextEvent"in window&&!Sl,px=pa&&(!Jd||Sl&&8<Sl&&11>=Sl),mx=" ",hx=!1;function gx(t,n){switch(t){case"keyup":return PE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ps=!1;function FE(t,n){switch(t){case"compositionend":return xx(n);case"keypress":return n.which!==32?null:(hx=!0,mx);case"textInput":return t=n.data,t===mx&&hx?null:t;default:return null}}function qE(t,n){if(ps)return t==="compositionend"||!Jd&&gx(t,n)?(t=ox(),ac=Vd=Ba=null,ps=!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 px&&n.locale!=="ko"?null:n.data;default:return null}}var GE={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 bx(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!GE[t.type]:n==="textarea"}function yx(t,n,s,c){ds?fs?fs.push(c):fs=[c]:ds=c,n=cu(n,"onChange"),0<n.length&&(s=new lc("onChange","change",null,s,c),t.push({event:s,listeners:n}))}var _l=null,Tl=null;function YE(t){s1(t,0)}function cc(t){var n=Ua(t);if(nt(n))return t}function vx(t,n){if(t==="change")return n}var wx=!1;if(pa){var ef;if(pa){var tf="oninput"in document;if(!tf){var kx=document.createElement("div");kx.setAttribute("oninput","return;"),tf=typeof kx.oninput=="function"}ef=tf}else ef=!1;wx=ef&&(!document.documentMode||9<document.documentMode)}function Nx(){_l&&(_l.detachEvent("onpropertychange",Ex),Tl=_l=null)}function Ex(t){if(t.propertyName==="value"&&cc(Tl)){var n=[];yx(n,Tl,t,Gd(t)),lx(YE,n)}}function KE(t,n,s){t==="focusin"?(Nx(),_l=n,Tl=s,_l.attachEvent("onpropertychange",Ex)):t==="focusout"&&Nx()}function VE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return cc(Tl)}function XE(t,n){if(t==="click")return cc(n)}function ZE(t,n){if(t==="input"||t==="change")return cc(n)}function QE(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Jn=typeof Object.is=="function"?Object.is:QE;function Cl(t,n){if(Jn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),c=Object.keys(n);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var f=s[c];if(!gn.call(n,f)||!Jn(t[f],n[f]))return!1}return!0}function nf(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Sx(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _x(t,n){var s=Sx(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=n&&c>=n)return{node:s,offset:n-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Sx(s)}}function Tx(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Tx(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Cx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=nf(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=nf(t.document)}return n}function af(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 WE=pa&&"documentMode"in document&&11>=document.documentMode,ms=null,rf=null,jl=null,sf=!1;function jx(t,n,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;sf||ms==null||ms!==nf(c)||(c=ms,"selectionStart"in c&&af(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),jl&&Cl(jl,c)||(jl=c,c=cu(rf,"onSelect"),0<c.length&&(n=new lc("onSelect","select",null,n,s),t.push({event:n,listeners:c}),n.target=ms)))}function Er(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var hs={animationend:Er("Animation","AnimationEnd"),animationiteration:Er("Animation","AnimationIteration"),animationstart:Er("Animation","AnimationStart"),transitionrun:Er("Transition","TransitionRun"),transitionstart:Er("Transition","TransitionStart"),transitioncancel:Er("Transition","TransitionCancel"),transitionend:Er("Transition","TransitionEnd")},lf={},Ax={};pa&&(Ax=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function Sr(t){if(lf[t])return lf[t];if(!hs[t])return t;var n=hs[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Ax)return lf[t]=n[s];return t}var Ox=Sr("animationend"),Mx=Sr("animationiteration"),Rx=Sr("animationstart"),JE=Sr("transitionrun"),eS=Sr("transitionstart"),tS=Sr("transitioncancel"),Dx=Sr("transitionend"),zx=new Map,of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");of.push("scrollEnd");function Ci(t,n){zx.set(t,n),ci(n,[t])}var nS=0;function ma(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=Mi.identifierPrefix;var s=nS++;return t="_"+t+"t_"+s.toString(32)+"_",n.autoName=t}function Lx(t){if(t==null||typeof t=="string")return t;var n=null,s=zs;if(s!==null)for(var c=0;c<s.length;c++){var f=t[s[c]];if(f!=null){if(f==="none")return"none";n=n==null?f:n+(" "+f)}}return n??t.default}function ha(t,n){return t=Lx(t),n=Lx(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var uc=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=[],gs=0,cf=0;function dc(){for(var t=gs,n=cf=gs=0;n<t;){var s=di[n];di[n++]=null;var c=di[n];di[n++]=null;var f=di[n];di[n++]=null;var m=di[n];if(di[n++]=null,c!==null&&f!==null){var w=c.pending;w===null?f.next=f:(f.next=w.next,w.next=f),c.pending=f}m!==0&&Ix(s,f,m)}}function fc(t,n,s,c){di[gs++]=t,di[gs++]=n,di[gs++]=s,di[gs++]=c,cf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function uf(t,n,s,c){return fc(t,n,s,c),pc(t)}function _r(t,n){return fc(t,null,null,n),pc(t)}function Ix(t,n,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var f=!1,m=t.return;m!==null;)m.childLanes|=s,c=m.alternate,c!==null&&(c.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-Ne(s),t=m.hiddenUpdates,c=t[f],c===null?t[f]=[n]:c.push(n),n.lane=s|536870912),m):null}function pc(t){if(50<Ql)throw Ql=0,nu=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var xs={};function iS(t,n,s,c){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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(t,n,s,c){return new iS(t,n,s,c)}function df(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ga(t,n){var s=t.alternate;return s===null?(s=Fn(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 Ux(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 mc(t,n,s,c,f,m){var w=0;if(c=t,typeof c=="function")df(c)&&(w=1);else if(typeof c=="string")w=O_(t,s,jt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(c){case pe:return t=Fn(31,s,n,f),t.elementType=pe,t.lanes=m,t;case G:return Tr(s.children,f,m,n);case Z:w=8,f|=24;break;case fe:return t=Fn(12,s,n,f|2),t.elementType=fe,t.lanes=m,t;case re:return t=Fn(13,s,n,f),t.elementType=re,t.lanes=m,t;case ie:return t=Fn(19,s,n,f),t.elementType=ie,t.lanes=m,t;case _e:case $:return t=f|32,t=Fn(30,s,n,t),t.elementType=$,t.lanes=m,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case J:w=10;break e;case le:w=9;break e;case O:w=11;break e;case ne:w=14;break e;case E:w=16,c=null;break e}w=29,s=Error(r(130,t===null?"null":typeof t,"")),c=null}return n=Fn(w,s,n,f),n.elementType=t,n.type=c,n.lanes=m,n}function Tr(t,n,s,c){return t=Fn(7,t,c,n),t.lanes=s,t}function ff(t,n,s){return t=Fn(6,t,null,n),t.lanes=s,t}function Bx(t){var n=Fn(18,null,null,0);return n.stateNode=t,n}function pf(t,n,s){return n=Fn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var $x=new WeakMap;function fi(t,n){if(typeof t=="object"&&t!==null){var s=$x.get(t);return s!==void 0?s:(n={value:t,source:n,stack:ln(n)},$x.set(t,n),n)}return{value:t,source:n,stack:ln(n)}}var bs=[],ys=0,hc=null,Al=0,pi=[],mi=0,Pa=null,Hi=1,Fi="";function xa(t,n){bs[ys++]=Al,bs[ys++]=hc,hc=t,Al=n}function Px(t,n,s){pi[mi++]=Hi,pi[mi++]=Fi,pi[mi++]=Pa,Pa=t;var c=Hi;t=Fi;var f=32-Ne(c)-1;c&=~(1<<f),s+=1;var m=32-Ne(n)+f;if(30<m){var w=f-f%5;m=(c&(1<<w)-1).toString(32),c>>=w,f-=w,Hi=1<<32-Ne(n)+f|s<<f|c,Fi=m+t}else Hi=1<<m|s<<f|c,Fi=t}function gc(t){t.return!==null&&(xa(t,1),Px(t,1,0))}function mf(t){for(;t===hc;)hc=bs[--ys],bs[ys]=null,Al=bs[--ys],bs[ys]=null;for(;t===Pa;)Pa=pi[--mi],pi[mi]=null,Fi=pi[--mi],pi[mi]=null,Hi=pi[--mi],pi[mi]=null}function Hx(t,n){pi[mi++]=Hi,pi[mi++]=Fi,pi[mi++]=Pa,Hi=n.id,Fi=n.overflow,Pa=t}var pn=null,It=null,rt=!1,Ha=null,hi=!1,hf=Error(r(519));function Fa(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ol(fi(n,t)),hf}function Fx(t){var n=t.stateNode,s=t.type,c=t.memoizedProps;switch(n[on]=t,n[he]=c,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<Jl.length;s++)ut(Jl[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),nc(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":ut("invalid",n);break;case"textarea":ut("invalid",n),ix(n,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||c.suppressHydrationWarning===!0||u1(n.textContent,s)?(c.popover!=null&&(ut("beforetoggle",n),ut("toggle",n)),c.onScroll!=null&&ut("scroll",n),c.onScrollEnd!=null&&ut("scrollend",n),c.onClick!=null&&(n.onclick=Pi),n=!0):n=!1,n||Fa(t,!0)}function xc(t){for(pn=t.return;pn;)switch(pn.tag){case 5:case 31:case 13:hi=!1;return;case 27:case 3:hi=!0;return;default:pn=pn.return}}function vs(t){if(t!==pn)return!1;if(!rt)return xc(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")||Gp(t.type,t.memoizedProps)),s=!s),s&&It&&Fa(t),xc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));It=j1(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));It=j1(t)}else n===27?(n=It,rr(t.type)?(t=em,em=null,It=t):It=n):It=pn?xi(t.stateNode.nextSibling):null;return!0}function Cr(){It=pn=null,rt=!1}function gf(){var t=Ha;return t!==null&&(Yn===null?Yn=t:Yn.push.apply(Yn,t),Ha=null),t}function Ol(t){Ha===null?Ha=[t]:Ha.push(t)}var xf=Me(null),jr=null,ba=null;function qa(t,n,s){Ke(xf,n._currentValue),n._currentValue=s}function ya(t){t._currentValue=xf.current,ot(xf)}function bc(t,n,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===s)break;t=t.return}}function bf(t,n,s,c){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 T=m;m=f;for(var U=0;U<n.length;U++)if(T.context===n[U]){m.lanes|=s,T=m.alternate,T!==null&&(T.lanes|=s),bc(m.return,s,t),c||(w=null);break e}m=T.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),bc(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),bc(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 Ar(t,n,s,c){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 T=f.type;Jn(f.pendingProps.value,w.value)||(t!==null?t.push(T):t=[T])}}else if(f===bt.current){if(w=f.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Gs):t=[Gs])}f=f.return}return t!==null&&bf(n,t,s,c),n.flags|=262144,t!==null}function yc(t){for(t=t.firstContext;t!==null;){if(!Jn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Or(t){jr=t,ba=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function yn(t){return qx(jr,t)}function vc(t,n){return jr===null&&Or(t),qx(t,n)}function qx(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ba===null){if(t===null)throw Error(r(308));ba=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ba=ba.next=n;return s}var aS=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},rS=e.unstable_scheduleCallback,sS=e.unstable_NormalPriority,Jt={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yf(){return{controller:new aS,data:new Map,refCount:0}}function Ml(t){t.refCount--,t.refCount===0&&rS(sS,function(){t.controller.abort()})}function Gx(t,n){if((t.pendingLanes&4194048)!==0){var s=t.transitionTypes;for(s===null&&(s=t.transitionTypes=[]),t=0;t<n.length;t++){var c=n[t];s.indexOf(c)===-1&&s.push(c)}}}var Rl=null;function lS(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Dl=null,vf=0,Mr=0,ws=null;function oS(t,n){if(Dl===null){var s=Dl=[];vf=0,Mr=Lp(),ws={status:"pending",value:void 0,then:function(c){s.push(c)}}}return vf++,n.then(Yx,Yx),n}function Yx(){if(--vf===0&&(Rl=null,Dl!==null)){ws!==null&&(ws.status="fulfilled");var t=Dl;Dl=null,Mr=0,ws=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function cS(t,n){var s=[],c={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(c.status="rejected",c.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),c}var Kx=Ee.S;Ee.S=function(t,n){if(By=Xt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&oS(t,n),Rl!==null)for(var s=Bs;s!==null;)Gx(s,Rl),s=s.next;if(s=t.types,s!==null){for(var c=Bs;c!==null;)Gx(c,s),c=c.next;if(Mr!==0){c=Rl,c===null&&(c=Rl=[]);for(var f=0;f<s.length;f++){var m=s[f];c.indexOf(m)===-1&&c.push(m)}}}Kx!==null&&Kx(t,n)};var Rr=Me(null);function wf(){var t=Rr.current;return t!==null?t:Dt.pooledCache}function wc(t,n){n===null?Ke(Rr,Rr.current):Ke(Rr,n.pool)}function Vx(){var t=wf();return t===null?null:{parent:Jt._currentValue,pool:t}}var ks=Error(r(460)),kf=Error(r(474)),kc=Error(r(542)),Nc={then:function(){}};function Xx(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Zx(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Pi,Pi),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Wx(t),t===void 0&&!("reason"in n)?Error(r(600)):t;default:if(typeof n.status=="string")n.then(Pi,Pi);else{if(t=Dt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=c}},function(c){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Wx(t),t}throw zr=n,ks}}function Dr(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(zr=s,ks):s}}var zr=null;function Qx(){if(zr===null)throw Error(r(459));var t=zr;return zr=null,t}function Wx(t){if(t===ks||t===kc)throw Error(r(483))}var Ns=null,zl=0;function Ec(t){var n=zl;return zl+=1,Ns===null&&(Ns=[]),Zx(Ns,t,n)}function Ga(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Sc(t,n){throw n.$$typeof===z?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Jx(t){function n(K,F){if(t){var Q=K.deletions;Q===null?(K.deletions=[F],K.flags|=16):Q.push(F)}}function s(K,F){if(!t)return null;for(;F!==null;)n(K,F),F=F.sibling;return null}function c(K){for(var F=new Map;K!==null;)K.key===null?F.set(K.index,K):F.set(K.key,K),K=K.sibling;return F}function f(K,F){return K=ga(K,F),K.index=0,K.sibling=null,K}function m(K,F,Q){return K.index=Q,t?(Q=K.alternate,Q!==null?(Q=Q.index,Q<F?(K.flags|=2,F):Q):(K.flags|=134217730,F)):(K.flags|=1048576,F)}function w(K){return t&&K.alternate===null&&(K.flags|=134217730),K}function T(K,F,Q,ce){return F===null||F.tag!==6?(F=ff(Q,K.mode,ce),F.return=K,F):(F=f(F,Q),F.return=K,F)}function U(K,F,Q,ce){var Re=Q.type;return Re===G?(K=ee(K,F,Q.props.children,ce,Q.key),Ga(K,Q),K):F!==null&&(F.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===E&&Dr(Re)===F.type)?(F=f(F,Q.props),Ga(F,Q),F.return=K,F):(F=mc(Q.type,Q.key,Q.props,null,K.mode,ce),Ga(F,Q),F.return=K,F)}function V(K,F,Q,ce){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=pf(Q,K.mode,ce),F.return=K,F):(F=f(F,Q.children||[]),F.return=K,F)}function ee(K,F,Q,ce,Re){return F===null||F.tag!==7?(F=Tr(Q,K.mode,ce,Re),F.return=K,F):(F=f(F,Q),F.return=K,F)}function ue(K,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=ff(""+F,K.mode,Q),F.return=K,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case q:return Q=mc(F.type,F.key,F.props,null,K.mode,Q),Ga(Q,F),Q.return=K,Q;case R:return F=pf(F,K.mode,Q),F.return=K,F;case E:return F=Dr(F),ue(K,F,Q)}if(Be(F)||Te(F))return F=Tr(F,K.mode,Q,null),F.return=K,F;if(typeof F.then=="function")return ue(K,Ec(F),Q);if(F.$$typeof===J)return ue(K,vc(K,F),Q);Sc(K,F)}return null}function Y(K,F,Q,ce){var Re=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:T(K,F,""+Q,ce);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case q:return Q.key===Re?U(K,F,Q,ce):null;case R:return Q.key===Re?V(K,F,Q,ce):null;case E:return Q=Dr(Q),Y(K,F,Q,ce)}if(Be(Q)||Te(Q))return Re!==null?null:ee(K,F,Q,ce,null);if(typeof Q.then=="function")return Y(K,F,Ec(Q),ce);if(Q.$$typeof===J)return Y(K,F,vc(K,Q),ce);Sc(K,Q)}return null}function W(K,F,Q,ce,Re){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return K=K.get(Q)||null,T(F,K,""+ce,Re);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case q:return K=K.get(ce.key===null?Q:ce.key)||null,U(F,K,ce,Re);case R:return K=K.get(ce.key===null?Q:ce.key)||null,V(F,K,ce,Re);case E:return ce=Dr(ce),W(K,F,Q,ce,Re)}if(Be(ce)||Te(ce))return K=K.get(Q)||null,ee(F,K,ce,Re,null);if(typeof ce.then=="function")return W(K,F,Q,Ec(ce),Re);if(ce.$$typeof===J)return W(K,F,Q,vc(F,ce),Re);Sc(F,ce)}return null}function ke(K,F,Q,ce){for(var Re=null,ft=null,Pe=F,Ye=F=0,nn=null;Pe!==null&&Ye<Q.length;Ye++){Pe.index>Ye?(nn=Pe,Pe=null):nn=Pe.sibling;var gt=Y(K,Pe,Q[Ye],ce);if(gt===null){Pe===null&&(Pe=nn);break}t&&Pe&&gt.alternate===null&&n(K,Pe),F=m(gt,F,Ye),ft===null?Re=gt:ft.sibling=gt,ft=gt,Pe=nn}if(Ye===Q.length)return s(K,Pe),rt&&xa(K,Ye),Re;if(Pe===null){for(;Ye<Q.length;Ye++)Pe=ue(K,Q[Ye],ce),Pe!==null&&(F=m(Pe,F,Ye),ft===null?Re=Pe:ft.sibling=Pe,ft=Pe);return rt&&xa(K,Ye),Re}for(Pe=c(Pe);Ye<Q.length;Ye++)nn=W(Pe,K,Ye,Q[Ye],ce),nn!==null&&(t&&(gt=nn.alternate,gt!==null&&Pe.delete(gt.key===null?Ye:gt.key)),F=m(nn,F,Ye),ft===null?Re=nn:ft.sibling=nn,ft=nn);return t&&Pe.forEach(function(ur){return n(K,ur)}),rt&&xa(K,Ye),Re}function ze(K,F,Q,ce){if(Q==null)throw Error(r(151));for(var Re=null,ft=null,Pe=F,Ye=F=0,nn=null,gt=Q.next();Pe!==null&&!gt.done;Ye++,gt=Q.next()){Pe.index>Ye?(nn=Pe,Pe=null):nn=Pe.sibling;var ur=Y(K,Pe,gt.value,ce);if(ur===null){Pe===null&&(Pe=nn);break}t&&Pe&&ur.alternate===null&&n(K,Pe),F=m(ur,F,Ye),ft===null?Re=ur:ft.sibling=ur,ft=ur,Pe=nn}if(gt.done)return s(K,Pe),rt&&xa(K,Ye),Re;if(Pe===null){for(;!gt.done;Ye++,gt=Q.next())gt=ue(K,gt.value,ce),gt!==null&&(F=m(gt,F,Ye),ft===null?Re=gt:ft.sibling=gt,ft=gt);return rt&&xa(K,Ye),Re}for(Pe=c(Pe);!gt.done;Ye++,gt=Q.next())gt=W(Pe,K,Ye,gt.value,ce),gt!==null&&(t&&(nn=gt.alternate,nn!==null&&Pe.delete(nn.key===null?Ye:nn.key)),F=m(gt,F,Ye),ft===null?Re=gt:ft.sibling=gt,ft=gt);return t&&Pe.forEach(function(F_){return n(K,F_)}),rt&&xa(K,Ye),Re}function at(K,F,Q,ce){if(typeof Q=="object"&&Q!==null&&Q.type===G&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case q:e:{for(var Re=Q.key;F!==null;){if(F.key===Re){if(Re=Q.type,Re===G){if(F.tag===7){s(K,F.sibling),ce=f(F,Q.props.children),Ga(ce,Q),ce.return=K,K=ce;break e}}else if(F.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===E&&Dr(Re)===F.type){s(K,F.sibling),ce=f(F,Q.props),Ga(ce,Q),ce.return=K,K=ce;break e}s(K,F);break}else n(K,F);F=F.sibling}Q.type===G?(ce=Tr(Q.props.children,K.mode,ce,Q.key),Ga(ce,Q),ce.return=K,K=ce):(ce=mc(Q.type,Q.key,Q.props,null,K.mode,ce),Ga(ce,Q),ce.return=K,K=ce)}return w(K);case R:e:{for(Re=Q.key;F!==null;){if(F.key===Re)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){s(K,F.sibling),ce=f(F,Q.children||[]),ce.return=K,K=ce;break e}else{s(K,F);break}else n(K,F);F=F.sibling}ce=pf(Q,K.mode,ce),ce.return=K,K=ce}return w(K);case E:return Q=Dr(Q),at(K,F,Q,ce)}if(Be(Q))return ke(K,F,Q,ce);if(Te(Q)){if(Re=Te(Q),typeof Re!="function")throw Error(r(150));return Q=Re.call(Q),ze(K,F,Q,ce)}if(typeof Q.then=="function")return at(K,F,Ec(Q),ce);if(Q.$$typeof===J)return at(K,F,vc(K,Q),ce);Sc(K,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(s(K,F.sibling),ce=f(F,Q),ce.return=K,K=ce):(s(K,F),ce=ff(Q,K.mode,ce),ce.return=K,K=ce),w(K)):s(K,F)}return function(K,F,Q,ce){try{zl=0;var Re=at(K,F,Q,ce);return Ns=null,Re}catch(Pe){if(Pe===ks||Pe===kc)throw Pe;var ft=Fn(29,Pe,null,K.mode);return ft.lanes=ce,ft.return=K,ft}}}var Lr=Jx(!0),eb=Jx(!1),Ya=!1;function Nf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(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 Ka(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Va(t,n,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(wt&2)!==0){var f=c.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),c.pending=n,n=pc(t),Ix(t,null,s),n}return fc(t,c,n,s),pc(t)}function Ll(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,Ti(t,s)}}function Sf(t,n){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){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:c.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var _f=!1;function Il(){if(_f){var t=ws;if(t!==null)throw t}}function Ul(t,n,s,c){_f=!1;var f=t.updateQueue;Ya=!1;var m=f.firstBaseUpdate,w=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var U=T,V=U.next;U.next=null,w===null?m=V:w.next=V,w=U;var ee=t.alternate;ee!==null&&(ee=ee.updateQueue,T=ee.lastBaseUpdate,T!==w&&(T===null?ee.firstBaseUpdate=V:T.next=V,ee.lastBaseUpdate=U))}if(m!==null){var ue=f.baseState;w=0,ee=V=U=null,T=m;do{var Y=T.lane&-536870913,W=Y!==T.lane;if(W?(dt&Y)===Y:(c&Y)===Y){Y!==0&&Y===Mr&&(_f=!0),ee!==null&&(ee=ee.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ke=t,ze=T;Y=n;var at=s;switch(ze.tag){case 1:if(ke=ze.payload,typeof ke=="function"){ue=ke.call(at,ue,Y);break e}ue=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=ze.payload,Y=typeof ke=="function"?ke.call(at,ue,Y):ke,Y==null)break e;ue=N({},ue,Y);break e;case 2:Ya=!0}}Y=T.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:T.tag,payload:T.payload,callback:T.callback,next:null},ee===null?(V=ee=W,U=ue):ee=ee.next=W,w|=Y;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;W=T,T=W.next,W.next=null,f.lastBaseUpdate=W,f.shared.pending=null}}while(!0);ee===null&&(U=ue),f.baseState=U,f.firstBaseUpdate=V,f.lastBaseUpdate=ee,m===null&&(f.shared.lanes=0),tr|=w,t.lanes=w,t.memoizedState=ue}}function tb(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function nb(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)tb(s[t],n)}var Xa=Me(null),_c=Me(0);function ib(t,n){t=Ea,Ke(_c,t),Ke(Xa,n),Ea=t|n.baseLanes}function Tf(){Ke(_c,Ea),Ke(Xa,Xa.current)}function Cf(){Ea=_c.current,ot(Xa),ot(_c)}var vn=Me(null),Sn=null;function Za(t){var n=t.alternate;Ke(wn,wn.current&1),Ke(vn,t),Sn===null&&(n===null||Xa.current!==null||n.memoizedState!==null)&&(Sn=t)}function jf(t){Ke(wn,wn.current),Ke(vn,t),Sn===null&&(Sn=t)}function ab(t){t.tag===22?(Ke(wn,wn.current),Ke(vn,t),Sn===null&&(Sn=t)):Qa()}function Qa(){Ke(wn,wn.current),Ke(vn,vn.current)}function ei(t){ot(vn),Sn===t&&(Sn=null),ot(wn)}var wn=Me(0);function Bl(t,n){Ke(vn,vn.current),Ke(wn,n)}function Af(t){ot(wn),ot(vn),Sn===t&&(Sn=null)}function Tc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Wp(s)||Jp(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 va=0,it=null,Ot=null,en=null,Cc=!1,Es=!1,Ir=!1,jc=0,$l=0,Ss=null,uS=0;function qt(){throw Error(r(321))}function Of(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Jn(t[s],n[s]))return!1;return!0}function Mf(t,n,s,c,f,m){return va=m,it=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Ee.H=t===null||t.memoizedState===null?Pb:Hb,Ir=!1,m=s(c,f),Ir=!1,Es&&(m=sb(n,s,c,f)),rb(t),m}function rb(t){Ee.H=Lc;var n=Ot!==null&&Ot.next!==null;if(va=0,en=Ot=it=null,Cc=!1,$l=0,Ss=null,n)throw Error(r(300));t===null||tn||(t=t.dependencies,t!==null&&yc(t)&&(tn=!0))}function sb(t,n,s,c){it=t;var f=0;do{if(Es&&(Ss=null),$l=0,Es=!1,25<=f)throw Error(r(301));if(f+=1,en=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)}Ee.H=bS,m=n(s,c)}while(Es);return m}function dS(){var t=Ee.H,n=t.useState()[0];return n=typeof n.then=="function"?Pl(n):n,t=t.useState()[0],(Ot!==null?Ot.memoizedState:null)!==t&&(it.flags|=1024),n}function Rf(){var t=jc!==0;return jc=0,t}function Df(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function zf(t){if(Cc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Cc=!1}va=0,en=Ot=it=null,Es=!1,$l=jc=0,Ss=null}function Mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?it.memoizedState=en=t:en=en.next=t,en}function Kt(){if(Ot===null){var t=it.alternate;t=t!==null?t.memoizedState:null}else t=Ot.next;var n=en===null?it.memoizedState:en.next;if(n!==null)en=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},en===null?it.memoizedState=en=t:en=en.next=t}return en}function Ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pl(t){var n=$l;return $l+=1,Ss===null&&(Ss=[]),t=Zx(Ss,t,n),n=it,(en===null?n.memoizedState:en.next)===null&&(n=n.alternate,Ee.H=n===null||n.memoizedState===null?Pb:Hb),t}function Oc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Pl(t);if(t.$$typeof===oe)return;if(t.$$typeof===J)return yn(t)}throw Error(r(438,String(t)))}function Lf(t){var n=null,s=it.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var c=it.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Ac(),it.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),c=0;c<t;c++)s[c]=L;return n.index++,s}function wa(t,n){return typeof n=="function"?n(t):n}function Mc(t){var n=Kt();return If(n,Ot,t)}function If(t,n,s){var c=t.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=s;var f=t.baseQueue,m=c.pending;if(m!==null){if(f!==null){var w=f.next;f.next=m.next,m.next=w}n.baseQueue=f=m,c.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{n=f.next;var T=w=null,U=null,V=n,ee=!1;do{var ue=V.lane&-536870913;if(ue!==V.lane?(dt&ue)===ue:(va&ue)===ue){var Y=V.revertLane;if(Y===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ue===Mr&&(ee=!0);else if((va&Y)===Y){V=V.next,Y===Mr&&(ee=!0);continue}else ue={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},U===null?(T=U=ue,w=m):U=U.next=ue,it.lanes|=Y,tr|=Y;ue=V.action,Ir&&s(m,ue),m=V.hasEagerState?V.eagerState:s(m,ue)}else Y={lane:ue,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},U===null?(T=U=Y,w=m):U=U.next=Y,it.lanes|=ue,tr|=ue;V=V.next}while(V!==null&&V!==n);if(U===null?w=m:U.next=T,!Jn(m,t.memoizedState)&&(tn=!0,ee&&(s=ws,s!==null)))throw s;t.memoizedState=m,t.baseState=w,t.baseQueue=U,c.lastRenderedState=m}return f===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function Uf(t){var n=Kt(),s=n.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var c=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);Jn(m,n.memoizedState)||(tn=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),s.lastRenderedState=m}return[m,c]}function lb(t,n,s){var c=it,f=Kt(),m=rt;if(m){if(s===void 0)throw Error(r(407));s=s()}else s=n();var w=!Jn((Ot||f).memoizedState,s);if(w&&(f.memoizedState=s,tn=!0),f=f.queue,Pf(ub.bind(null,c,f,t),[t]),t=f.getSnapshot!==n||w||en!==null&&(en.memoizedState.tag&1)!==0,_s(t?9:8,{destroy:void 0},cb.bind(null,c,f,s,n),null),t){if(c.flags|=2048,Dt===null)throw Error(r(349));m||(va&127)!==0||ob(c,n,s)}return s}function ob(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=it.updateQueue,n===null?(n=Ac(),it.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function cb(t,n,s,c){n.value=s,n.getSnapshot=c,db(n)&&fb(t)}function ub(t,n,s){return s(function(){db(n)&&fb(t)})}function db(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Jn(t,s)}catch{return!0}}function fb(t){var n=_r(t,2);n!==null&&Kn(n,t,2)}function Bf(t){var n=Mn();if(typeof t=="function"){var s=t;if(t=s(),Ir){Oe(!0);try{s()}finally{Oe(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:t},n}function pb(t,n,s,c){return t.baseState=s,If(t,Ot,typeof c=="function"?c:wa)}function fS(t,n,s,c,f){if(zc(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)}};Ee.T!==null?s(!0):m.isTransition=!1,c(m),s=n.pending,s===null?(m.next=n.pending=m,mb(n,m)):(m.next=s.next,n.pending=s.next=m)}}function mb(t,n){var s=n.action,c=n.payload,f=t.state;if(n.isTransition){var m=Ee.T,w={};w.types=m!==null?m.types:null,Ee.T=w;try{var T=s(f,c),U=Ee.S;U!==null&&U(w,T),hb(t,n,T)}catch(V){$f(t,n,V)}finally{m!==null&&w.types!==null&&(m.types=w.types),Ee.T=m}}else try{m=s(f,c),hb(t,n,m)}catch(V){$f(t,n,V)}}function hb(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){gb(t,n,c)},function(c){return $f(t,n,c)}):gb(t,n,s)}function gb(t,n,s){n.status="fulfilled",n.value=s,xb(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,mb(t,s)))}function $f(t,n,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=s,xb(n),n=n.next;while(n!==c)}t.action=null}function xb(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function bb(t,n){return n}function yb(t,n){if(rt){var s=Dt.formState;if(s!==null){e:{var c=it;if(rt){if(It){t:{for(var f=It,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){It=xi(f.nextSibling),c=f.data==="F!";break e}}Fa(c)}c=!1}c&&(n=s[0])}}return s=Mn(),s.memoizedState=s.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bb,lastRenderedState:n},s.queue=c,s=Ub.bind(null,it,c),c.dispatch=s,c=Bf(!1),m=Yf.bind(null,it,!1,c.queue),c=Mn(),f={state:n,dispatch:null,action:t,pending:null},c.queue=f,s=fS.bind(null,it,f,m,s),f.dispatch=s,c.memoizedState=t,[n,s,!1]}function vb(t){var n=Kt();return wb(n,Ot,t)}function wb(t,n,s){if(n=If(t,n,bb)[0],t=Mc(wa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Pl(n)}catch(w){throw w===ks?kc:w}else c=n;n=Kt();var f=n.queue,m=f.dispatch;return s!==n.memoizedState&&(it.flags|=2048,_s(9,{destroy:void 0},pS.bind(null,f,s),null)),[c,m,t]}function pS(t,n){t.action=n}function kb(t){var n=Kt(),s=Ot;if(s!==null)return wb(n,s,t);Kt(),n=n.memoizedState,s=Kt();var c=s.queue.dispatch;return s.memoizedState=t,[n,c,!1]}function _s(t,n,s,c){return t={tag:t,create:s,deps:c,inst:n,next:null},n=it.updateQueue,n===null&&(n=Ac(),it.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,n.lastEffect=t),t}function Nb(){return Kt().memoizedState}function Rc(t,n,s,c){var f=Mn();it.flags|=t,f.memoizedState=_s(1|n,{destroy:void 0},s,c===void 0?null:c)}function Dc(t,n,s,c){var f=Kt();c=c===void 0?null:c;var m=f.memoizedState.inst;Ot!==null&&c!==null&&Of(c,Ot.memoizedState.deps)?f.memoizedState=_s(n,m,s,c):(it.flags|=t,f.memoizedState=_s(1|n,m,s,c))}function Eb(t,n){Rc(8390656,8,t,n)}function Pf(t,n){Dc(2048,8,t,n)}function mS(t){it.flags|=4;var n=it.updateQueue;if(n===null)n=Ac(),it.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Sb(t){var n=Kt().memoizedState;return mS({ref:n,nextImpl:t}),function(){if((wt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function _b(t,n){return Dc(4,2,t,n)}function Tb(t,n){return Dc(4,4,t,n)}function Cb(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function jb(t,n,s){s=s!=null?s.concat([t]):null,Dc(4,4,Cb.bind(null,n,t),s)}function Hf(){}function Ab(t,n){var s=Kt();n=n===void 0?null:n;var c=s.memoizedState;return n!==null&&Of(n,c[1])?c[0]:(s.memoizedState=[t,n],t)}function Ob(t,n){var s=Kt();n=n===void 0?null:n;var c=s.memoizedState;if(n!==null&&Of(n,c[1]))return c[0];if(c=t(),Ir){Oe(!0);try{t()}finally{Oe(!1)}}return s.memoizedState=[c,n],c}function Ff(t,n,s){return s===void 0||(va&1073741824)!==0&&(dt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Py(),it.lanes|=t,tr|=t,s)}function Mb(t,n,s,c){return Jn(s,n)?s:Xa.current!==null?(t=Ff(t,s,c),Jn(t,n)||(tn=!0),t):(va&106)===0||(va&1073741824)!==0&&(dt&261930)===0?(tn=!0,t.memoizedState=s):(t=Py(),it.lanes|=t,tr|=t,n)}function Rb(t,n,s,c,f){var m=P.p;P.p=m!==0&&8>m?m:8;var w=Ee.T,T={};T.types=w!==null?w.types:null,Ee.T=T,Yf(t,!1,n,s);try{var U=f(),V=Ee.S;if(V!==null&&V(T,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ee=cS(U,c);Hl(t,n,ee,ai(t))}else Hl(t,n,c,ai(t))}catch(ue){Hl(t,n,{then:function(){},status:"rejected",reason:ue},ai())}finally{P.p=m,w!==null&&T.types!==null&&(w.types=T.types),Ee.T=w}}function hS(){}function qf(t,n,s,c){if(t.tag!==5)throw Error(r(476));var f=Db(t).queue;Rb(t,f,n,X,s===null?hS:function(){return zb(t),s(c)})}function Db(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:X},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function zb(t){var n=Db(t);n.next===null&&(n=t.alternate.memoizedState),Hl(t,n.next.queue,{},ai())}function Gf(){return yn(Gs)}function Lb(){return Kt().memoizedState}function Ib(){return Kt().memoizedState}function gS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=ai();t=Ka(s);var c=Va(n,t,s);c!==null&&(Kn(c,n,s),Ll(c,n,s)),n={cache:yf()},t.payload=n;return}n=n.return}}function xS(t,n,s){var c=ai();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},zc(t)?Bb(n,s):(s=uf(t,n,s,c),s!==null&&(Kn(s,t,c),$b(s,n,c)))}function Ub(t,n,s){var c=ai();Hl(t,n,s,c)}function Hl(t,n,s,c){var f={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(zc(t))Bb(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,T=m(w,s);if(f.hasEagerState=!0,f.eagerState=T,Jn(T,w))return fc(t,n,f,0),Dt===null&&dc(),!1}catch{}if(s=uf(t,n,f,c),s!==null)return Kn(s,t,c),$b(s,n,c),!0}return!1}function Yf(t,n,s,c){if(c={lane:2,revertLane:Lp(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},zc(t)){if(n)throw Error(r(479))}else n=uf(t,s,c,2),n!==null&&Kn(n,t,2)}function zc(t){var n=t.alternate;return t===it||n!==null&&n===it}function Bb(t,n){Es=Cc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function $b(t,n,s){if((s&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,Ti(t,s)}}var Lc={readContext:yn,use:Oc,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt,useEffectEvent:qt},Pb={readContext:yn,use:Oc,useCallback:function(t,n){return Mn().memoizedState=[t,n===void 0?null:n],t},useContext:yn,useEffect:Eb,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,Rc(4194308,4,Cb.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Rc(4194308,4,t,n)},useInsertionEffect:function(t,n){Rc(4,2,t,n)},useMemo:function(t,n){var s=Mn();n=n===void 0?null:n;var c=t();if(Ir){Oe(!0);try{t()}finally{Oe(!1)}}return s.memoizedState=[c,n],c},useReducer:function(t,n,s){var c=Mn();if(s!==void 0){var f=s(n);if(Ir){Oe(!0);try{s(n)}finally{Oe(!1)}}}else f=n;return c.memoizedState=c.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},c.queue=t,t=t.dispatch=xS.bind(null,it,t),[c.memoizedState,t]},useRef:function(t){var n=Mn();return t={current:t},n.memoizedState=t},useState:function(t){t=Bf(t);var n=t.queue,s=Ub.bind(null,it,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:Hf,useDeferredValue:function(t,n){var s=Mn();return Ff(s,t,n)},useTransition:function(){var t=Bf(!1);return t=Rb.bind(null,it,t.queue,!0,!1),Mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var c=it,f=Mn();if(rt){if(s===void 0)throw Error(r(407));s=s()}else{if(s=n(),Dt===null)throw Error(r(349));(dt&127)!==0||ob(c,n,s)}f.memoizedState=s;var m={value:s,getSnapshot:n};return f.queue=m,Eb(ub.bind(null,c,m,t),[t]),c.flags|=2048,_s(9,{destroy:void 0},cb.bind(null,c,m,s,n),null),s},useId:function(){var t=Mn(),n=Dt.identifierPrefix;if(rt){var s=Fi,c=Hi;s=(c&~(1<<32-Ne(c)-1)).toString(32)+s,n="_"+n+"R_"+s,s=jc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=uS++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Gf,useFormState:yb,useActionState:yb,useOptimistic:function(t){var n=Mn();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Yf.bind(null,it,!0,s),s.dispatch=n,[t,n]},useMemoCache:Lf,useCacheRefresh:function(){return Mn().memoizedState=gS.bind(null,it)},useEffectEvent:function(t){var n=Mn(),s={impl:t};return n.memoizedState=s,function(){if((wt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Hb={readContext:yn,use:Oc,useCallback:Ab,useContext:yn,useEffect:Pf,useImperativeHandle:jb,useInsertionEffect:_b,useLayoutEffect:Tb,useMemo:Ob,useReducer:Mc,useRef:Nb,useState:function(){return Mc(wa)},useDebugValue:Hf,useDeferredValue:function(t,n){var s=Kt();return Mb(s,Ot.memoizedState,t,n)},useTransition:function(){var t=Mc(wa)[0],n=Kt().memoizedState;return[typeof t=="boolean"?t:Pl(t),n]},useSyncExternalStore:lb,useId:Lb,useHostTransitionStatus:Gf,useFormState:vb,useActionState:vb,useOptimistic:function(t,n){var s=Kt();return pb(s,Ot,t,n)},useMemoCache:Lf,useCacheRefresh:Ib,useEffectEvent:Sb},bS={readContext:yn,use:Oc,useCallback:Ab,useContext:yn,useEffect:Pf,useImperativeHandle:jb,useInsertionEffect:_b,useLayoutEffect:Tb,useMemo:Ob,useReducer:Uf,useRef:Nb,useState:function(){return Uf(wa)},useDebugValue:Hf,useDeferredValue:function(t,n){var s=Kt();return Ot===null?Ff(s,t,n):Mb(s,Ot.memoizedState,t,n)},useTransition:function(){var t=Uf(wa)[0],n=Kt().memoizedState;return[typeof t=="boolean"?t:Pl(t),n]},useSyncExternalStore:lb,useId:Lb,useHostTransitionStatus:Gf,useFormState:kb,useActionState:kb,useOptimistic:function(t,n){var s=Kt();return Ot!==null?pb(s,Ot,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Lf,useCacheRefresh:Ib,useEffectEvent:Sb};function Kf(t,n,s,c){n=t.memoizedState,s=s(c,n),s=s==null?n:N({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Vf={enqueueSetState:function(t,n,s){t=t._reactInternals;var c=ai(),f=Ka(c);f.payload=n,s!=null&&(f.callback=s),n=Va(t,f,c),n!==null&&(Kn(n,t,c),Ll(n,t,c))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var c=ai(),f=Ka(c);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Va(t,f,c),n!==null&&(Kn(n,t,c),Ll(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=ai(),c=Ka(s);c.tag=2,n!=null&&(c.callback=n),n=Va(t,c,s),n!==null&&(Kn(n,t,s),Ll(n,t,s))}};function Fb(t,n,s,c,f,m,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,m,w):n.prototype&&n.prototype.isPureReactComponent?!Cl(s,c)||!Cl(f,m):!0}function qb(t,n,s,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,c),n.state!==t&&Vf.enqueueReplaceState(n,n.state,null)}function Ur(t,n){var s=n;if("ref"in n){s={};for(var c in n)c!=="ref"&&(s[c]=n[c])}if(t=t.defaultProps){s===n&&(s=N({},s));for(var f in t)s[f]===void 0&&(s[f]=t[f])}return s}function Gb(t){uc(t)}function Yb(t){console.error(t)}function Kb(t){uc(t)}function Ic(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function Vb(t,n,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xf(t,n,s){return s=Ka(s),s.tag=3,s.payload={element:null},s.callback=function(){Ic(t,n)},s}function Xb(t){return t=Ka(t),t.tag=3,t}function Zb(t,n,s,c){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var m=c.value;t.payload=function(){return f(m)},t.callback=function(){Vb(n,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){Vb(n,s,c),typeof f!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function yS(t,n,s,c,f){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=s.alternate,n!==null&&Ar(n,s,f,!0),s=vn.current,s!==null){switch(s.tag){case 31:case 13:case 19:return Sn===null?au():s.alternate===null&&Gt===0&&(Gt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,c===Nc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([c]):n.add(c),Rp(t,c,f)),!1;case 22:return s.flags|=65536,c===Nc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([c]):s.add(c)),Rp(t,c,f)),!1}throw Error(r(435,s.tag))}return Rp(t,c,f),au(),!1}if(rt)return n=vn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,c!==hf&&(t=Error(r(422),{cause:c}),Ol(fi(t,s)))):(c!==hf&&(n=Error(r(423),{cause:c}),Ol(fi(n,s))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,c=fi(c,s),f=Xf(t.stateNode,c,f),Sf(t,f),Gt!==4&&(Gt=2)),!1;var m=Error(r(520),{cause:c});if(m=fi(m,s),Zl===null?Zl=[m]:Zl.push(m),Gt!==4&&(Gt=2),n===null)return!0;c=fi(c,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=f&-f,s.lanes|=t,t=Xf(s.stateNode,c,t),Sf(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"&&(nr===null||!nr.has(m))))return s.flags|=65536,f&=-f,s.lanes|=f,f=Xb(f),Zb(f,t,s,c),Sf(s,f),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var Zf=Error(r(461)),tn=!1;function cn(t,n,s,c){n.child=t===null?eb(n,null,s,c):Lr(n,t.child,s,c)}function Qb(t,n,s,c,f){s=s.render;var m=n.ref;if("ref"in c){var w={};for(var T in c)T!=="ref"&&(w[T]=c[T])}else w=c;return Or(n),c=Mf(t,n,s,w,m,f),T=Rf(),t!==null&&!tn?(Df(t,n,f),ka(t,n,f)):(rt&&T&&gc(n),n.flags|=1,cn(t,n,c,f),n.child)}function Wb(t,n,s,c,f){if(t===null){var m=s.type;return typeof m=="function"&&!df(m)&&m.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=m,Jb(t,n,m,c,f)):(t=mc(s.type,null,c,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,!ap(t,f)){var w=m.memoizedProps;if(s=s.compare,s=s!==null?s:Cl,s(w,c)&&t.ref===n.ref)return ka(t,n,f)}return n.flags|=1,t=ga(m,c),t.ref=n.ref,t.return=n,n.child=t}function Jb(t,n,s,c,f){if(t!==null){var m=t.memoizedProps;if(Cl(m,c)&&t.ref===n.ref)if(tn=!1,n.pendingProps=c=m,ap(t,f))(t.flags&131072)!==0&&(tn=!0);else return n.lanes=t.lanes,ka(t,n,f)}return Qf(t,n,s,c,f)}function ey(t,n,s,c){var f=c.children,m=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,t!==null){for(c=n.child=t.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;c=f&~m}else c=0,n.child=null;return ty(t,n,m,s,c)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&wc(n,m!==null?m.cachePool:null),m!==null?ib(n,m):Tf(),ab(n);else return c=n.lanes=536870912,ty(t,n,m!==null?m.baseLanes|s:s,s,c)}else m!==null?(wc(n,m.cachePool),ib(n,m),Qa(),n.memoizedState=null):(t!==null&&wc(n,null),Tf(),Qa());return cn(t,n,f,s),n.child}function Fl(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ty(t,n,s,c,f){var m=wf();return m=m===null?null:{parent:Jt._currentValue,pool:m},n.memoizedState={baseLanes:s,cachePool:m},t!==null&&wc(n,null),Tf(),ab(n),t!==null&&Ar(t,n,c,!0),n.childLanes=f,null}function Uc(t,n){return n=Bc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function ny(t,n,s){return Lr(n,t.child,null,s),t=Uc(n,n.pendingProps),t.flags|=2,ei(n),n.memoizedState=null,t}function vS(t,n,s){var c=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(rt){if(c.mode==="hidden")return t=Uc(n,c),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Fl(null,t);if(jf(n),(t=It)?(t=C1(t,hi),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pa!==null?{id:Hi,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=Bx(t),s.return=n,n.child=s,pn=n,It=null)):t=null,t===null)throw Fa(n);return n.lanes=536870912,null}return Uc(n,c)}var m=t.memoizedState;if(m!==null){var w=m.dehydrated;if(jf(n),f)if(n.flags&256)n.flags&=-257,n=ny(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(tn||Ar(t,n,s,!1),f=(s&t.childLanes)!==0,tn||f){if(Xa.current===null){if(c=Dt,c!==null&&(w=bl(c,s),w!==0&&w!==m.retryLane))throw m.retryLane=w,_r(t,w),Kn(c,t,w),Zf;au()}n=ny(t,n,s)}else t=m.treeContext,It=xi(w.nextSibling),pn=n,rt=!0,Ha=null,hi=!1,t!==null&&Hx(n,t),n=Uc(n,c),n.flags|=134221824;return n}return t=ga(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Ts(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 Qf(t,n,s,c,f){return Or(n),s=Mf(t,n,s,c,void 0,f),c=Rf(),t!==null&&!tn?(Df(t,n,f),ka(t,n,f)):(rt&&c&&gc(n),n.flags|=1,cn(t,n,s,f),n.child)}function iy(t,n,s,c,f,m){return Or(n),n.updateQueue=null,s=sb(n,c,s,f),rb(t),c=Rf(),t!==null&&!tn?(Df(t,n,m),ka(t,n,m)):(rt&&c&&gc(n),n.flags|=1,cn(t,n,s,m),n.child)}function ay(t,n,s,c,f){if(Or(n),n.stateNode===null){var m=xs,w=s.contextType;typeof w=="object"&&w!==null&&(m=yn(w)),m=new s(c,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Vf,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=c,m.state=n.memoizedState,m.refs={},Nf(n),w=s.contextType,m.context=typeof w=="object"&&w!==null?yn(w):xs,m.state=n.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Kf(n,s,w,c),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&&Vf.enqueueReplaceState(m,m.state,null),Ul(n,c,m,f),Il(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){m=n.stateNode;var T=n.memoizedProps,U=Ur(s,T);m.props=U;var V=m.context,ee=s.contextType;w=xs,typeof ee=="object"&&ee!==null&&(w=yn(ee));var ue=s.getDerivedStateFromProps;ee=typeof ue=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,ee||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||V!==w)&&qb(n,m,c,w),Ya=!1;var Y=n.memoizedState;m.state=Y,Ul(n,c,m,f),Il(),V=n.memoizedState,T||Y!==V||Ya?(typeof ue=="function"&&(Kf(n,s,ue,c),V=n.memoizedState),(U=Ya||Fb(n,s,U,c,Y,V,w))?(ee||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(n.flags|=4194308)):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=V),m.props=c,m.state=V,m.context=w,c=U):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{m=n.stateNode,Ef(t,n),w=n.memoizedProps,ee=Ur(s,w),m.props=ee,ue=n.pendingProps,Y=m.context,V=s.contextType,U=xs,typeof V=="object"&&V!==null&&(U=yn(V)),T=s.getDerivedStateFromProps,(V=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w!==ue||Y!==U)&&qb(n,m,c,U),Ya=!1,Y=n.memoizedState,m.state=Y,Ul(n,c,m,f),Il();var W=n.memoizedState;w!==ue||Y!==W||Ya||t!==null&&t.dependencies!==null&&yc(t.dependencies)?(typeof T=="function"&&(Kf(n,s,T,c),W=n.memoizedState),(ee=Ya||Fb(n,s,ee,c,Y,W,U)||t!==null&&t.dependencies!==null&&yc(t.dependencies))?(V||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(c,W,U),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(c,W,U)),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=c,n.memoizedState=W),m.props=c,m.state=W,m.context=U,c=ee):(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),c=!1)}return m=c,Ts(t,n),c=(n.flags&128)!==0,m||c?(m=n.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,t!==null&&c?(n.child=Lr(n,t.child,null,f),n.child=Lr(n,null,s,f)):cn(t,n,s,f),n.memoizedState=m.state,t=n.child):t=ka(t,n,f),t}function ry(t,n,s,c){return Cr(),n.flags|=256,cn(t,n,s,c),n.child}var Wf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jf(t){return{baseLanes:t,cachePool:Vx()}}function ep(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=ii),t}function sy(t,n,s){var c=n.pendingProps,f=!1,m=(n.flags&128)!==0,w;if((w=m)||(w=t!==null&&t.memoizedState===null?!1:(wn.current&2)!==0),w&&(f=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,t===null){if(rt){if(f?Za(n):Qa(),(t=It)?(t=C1(t,hi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pa!==null?{id:Hi,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=Bx(t),s.return=n,n.child=s,pn=n,It=null)):t=null,t===null)throw Fa(n);return Jp(t)?n.lanes=32:n.lanes=536870912,null}return m=c.children,c=c.fallback,f?(Qa(),f=n.mode,m=Bc({mode:"hidden",children:m},f),c=Tr(c,f,s,null),m.return=n,c.return=n,m.sibling=c,n.child=m,c=n.child,c.memoizedState=Jf(s),c.childLanes=ep(t,w,s),n.memoizedState=Wf,Fl(null,c)):(Za(n),tp(n,m))}var T=t.memoizedState;if(T!==null){var U=T.dehydrated;if(U!==null)return wS(t,n,m,w,c,U,T,s)}return f?(Qa(),f=c.fallback,m=n.mode,T=t.child,U=T.sibling,c=ga(T,{mode:"hidden",children:c.children}),c.subtreeFlags=T.subtreeFlags&1206910976,U!==null?f=ga(U,f):(f=Tr(f,m,s,null),f.flags|=2),f.return=n,c.return=n,c.sibling=f,n.child=c,Fl(null,c),c=n.child,f=t.child.memoizedState,f===null?f=Jf(s):(m=f.cachePool,m!==null?(T=Jt._currentValue,m=m.parent!==T?{parent:T,pool:T}:m):m=Vx(),f={baseLanes:f.baseLanes|s,cachePool:m}),c.memoizedState=f,c.childLanes=ep(t,w,s),n.memoizedState=Wf,Fl(t.child,c)):(Za(n),s=t.child,t=s.sibling,s=ga(s,{mode:"visible",children:c.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 tp(t,n){return n=Bc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Bc(t,n){return t=Fn(22,t,null,n),t.lanes=0,t}function $c(t,n,s){return Lr(n,t.child,null,s),t=tp(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function wS(t,n,s,c,f,m,w,T){if(s)return n.flags&256?(Za(n),n.flags&=-257,$c(t,n,T)):n.memoizedState!==null?(Qa(),n.child=t.child,n.flags|=128,null):(Qa(),m=f.fallback,w=n.mode,f=Bc({mode:"visible",children:f.children},w),m=Tr(m,w,T,null),m.flags|=2,f.return=n,m.return=n,f.sibling=m,n.child=f,Lr(n,t.child,null,T),f=n.child,f.memoizedState=Jf(T),f.childLanes=ep(t,c,T),n.memoizedState=Wf,Fl(null,f));if(Za(n),Jp(m)){if(c=m.nextSibling&&m.nextSibling.dataset,c)var U=c.dgst;return c=U,c!==""&&(f=Error(r(419)),f.stack="",f.digest=c,Ol({value:f,source:null,stack:null})),$c(t,n,T)}if(tn||Ar(t,n,T,!1),c=(T&t.childLanes)!==0,tn||c){if(Xa.current!==null)return $c(t,n,T);if(c=Dt,c!==null&&(f=bl(c,T),f!==0&&f!==w.retryLane))throw w.retryLane=f,_r(t,f),Kn(c,t,f),Zf;return Wp(m)||au(),$c(t,n,T)}return Wp(m)?(n.flags|=192,n.child=t.child,null):(t=w.treeContext,It=xi(m.nextSibling),pn=n,rt=!0,Ha=null,hi=!1,t!==null&&Hx(n,t),n=tp(n,f.children),n.flags|=134221824,n)}function ly(t,n,s){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),bc(t.return,n,s)}function oy(t){for(var n=null;t!==null;){var s=t.alternate;s!==null&&Tc(s)===null&&(n=t),t=t.sibling}return n}function Pc(t,n,s,c,f,m){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:f,treeForkCount:m}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=f,w.treeForkCount=m)}function np(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 ip(t,n,s){var c=n.pendingProps,f=c.revealOrder,m=c.tail;c=c.children;var w=wn.current;if(n.flags&128)return Bl(n,w),null;var T=(w&2)!==0;if(T?(w=w&1|2,n.flags|=128):w&=1,Bl(n,w),f==="backwards"&&t!==null?(np(t),cn(t,n,c,s),np(t)):cn(t,n,c,s),c=rt?Al:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ly(t,s,n);else if(t.tag===19)ly(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=oy(n.child),s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null,np(n)),Pc(n,!0,f,null,m,c);break;case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Tc(t)===null){n.child=f;break}t=f.sibling,f.sibling=s,s=f,f=t}Pc(n,!0,s,null,m,c);break;case"together":Pc(n,!1,null,null,void 0,c);break;case"independent":n.memoizedState=null;break;default:s=oy(n.child),s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),Pc(n,!1,f,s,m,c)}return n.child}function cy(t,n,s){var c=n.pendingProps;return qa(n,n.type,c.value),cn(t,n,c.children,s),n.child}function ka(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),tr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(Ar(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=ga(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=ga(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function ap(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&yc(t)))}function kS(t,n,s){switch(n.tag){case 3:ht(n,n.stateNode.containerInfo),qa(n,Jt,t.memoizedState.cache),Cr();break;case 27:case 5:Bn(n);break;case 4:ht(n,n.stateNode.containerInfo);break;case 10:qa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,jf(n),null;break;case 13:var c=n.memoizedState;if(c!==null){if(c.dehydrated!==null)return Za(n),n.flags|=128,null;c=Ar(t,n,s,!1);var f=n.child.childLanes;return c||(s&f)!==0?sy(t,n,s):(Za(n),t=ka(t,n,s),t!==null?t.sibling:null)}Za(n);break;case 19:if(n.flags&128)return ip(t,n,s);if(f=(t.flags&128)!==0,c=(s&n.childLanes)!==0,c||(Ar(t,n,s,!1),c=(s&n.childLanes)!==0),f){if(c)return ip(t,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Bl(n,wn.current),c)break;return null;case 22:return n.lanes=0,ey(t,n,s,n.pendingProps);case 24:qa(n,Jt,t.memoizedState.cache)}return ka(t,n,s)}function uy(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)tn=!0;else{if(!ap(t,s)&&(n.flags&128)===0)return tn=!1,kS(t,n,s);tn=(t.flags&131072)!==0}else tn=!1,rt&&(n.flags&1048576)!==0&&Px(n,Al,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=Dr(n.elementType),n.type=t,typeof t=="function")df(t)?(c=Ur(t,c),n.tag=1,n=ay(null,n,t,c,s)):(n.tag=0,n=Qf(null,n,t,c,s));else{if(t!=null){var f=t.$$typeof;if(f===O){n.tag=11,n=Qb(null,n,t,c,s);break e}else if(f===ne){n.tag=14,n=Wb(null,n,t,c,s);break e}else if(f===J){n.tag=10,n.type=t,n=cy(null,n,s);break e}}throw n=He(t)||t,Error(r(306,n,""))}}return n;case 0:return Qf(t,n,n.type,n.pendingProps,s);case 1:return c=n.type,f=Ur(c,n.pendingProps),ay(t,n,c,f,s);case 3:e:{if(ht(n,n.stateNode.containerInfo),t===null)throw Error(r(387));c=n.pendingProps;var m=n.memoizedState;f=m.element,Ef(t,n),Ul(n,c,null,s);var w=n.memoizedState;if(c=w.cache,qa(n,Jt,c),c!==m.cache&&bf(n,[Jt],s,!0),Il(),c=w.element,m.isDehydrated)if(m={element:c,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=ry(t,n,c,s);break e}else if(c!==f){f=fi(Error(r(424)),n),Ol(f),n=ry(t,n,c,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,It=xi(t.firstChild),pn=n,rt=!0,Ha=null,hi=!0,s=eb(n,null,c,s),n.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling;else{if(Cr(),c===f){n=ka(t,n,s);break e}cn(t,n,c,s)}n=n.child}return n;case 26:return Ts(t,n),t===null?(s=z1(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(n.stateNode=m1(n.type,n.pendingProps,Le.current,n)):n.memoizedState=z1(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Bn(n),t===null&&rt&&(c=n.stateNode=O1(n.type,n.pendingProps,Le.current),pn=n,hi=!0,f=It,rr(n.type)?(em=f,It=xi(c.firstChild)):It=f),cn(t,n,n.pendingProps.children,s),Ts(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&rt&&((f=c=It)&&(c=g_(c,n.type,n.pendingProps,hi),c!==null?(n.stateNode=c,pn=n,It=xi(c.firstChild),hi=!1,f=!0):f=!1),f||Fa(n)),Bn(n),f=n.type,m=n.pendingProps,w=t!==null?t.memoizedProps:null,c=m.children,Gp(f,m)?c=null:w!==null&&Gp(f,w)&&(n.flags|=32),n.memoizedState!==null&&(f=Mf(t,n,dS,null,null,s),Gs._currentValue=f),Ts(t,n),cn(t,n,c,s),n.child;case 6:return t===null&&rt&&((t=s=It)&&(s=x_(s,n.pendingProps,hi),s!==null?(n.stateNode=s,pn=n,It=null,t=!0):t=!1),t||Fa(n)),null;case 13:return sy(t,n,s);case 4:return ht(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Lr(n,null,c,s):cn(t,n,c,s),n.child;case 11:return Qb(t,n,n.type,n.pendingProps,s);case 7:return c=n.pendingProps,Ts(t,n),cn(t,n,c,s),n.child;case 8:return cn(t,n,n.pendingProps.children,s),n.child;case 12:return cn(t,n,n.pendingProps.children,s),n.child;case 10:return cy(t,n,s);case 9:return f=n.type._context,c=n.pendingProps.children,Or(n),f=yn(f),c=c(f),n.flags|=1,cn(t,n,c,s),n.child;case 14:return Wb(t,n,n.type,n.pendingProps,s);case 15:return Jb(t,n,n.type,n.pendingProps,s);case 19:return ip(t,n,s);case 31:return vS(t,n,s);case 22:return ey(t,n,s,n.pendingProps);case 24:return Or(n),c=yn(Jt),t===null?(f=wf(),f===null&&(f=Dt,m=yf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=s),f=m),n.memoizedState={parent:c,cache:f},Nf(n),qa(n,Jt,f)):((t.lanes&s)!==0&&(Ef(t,n),Ul(n,null,null,s),Il()),f=t.memoizedState,m=n.memoizedState,f.parent!==c?(f={parent:c,cache:c},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),qa(n,Jt,c)):(c=m.cache,qa(n,Jt,c),c!==f.cache&&bf(n,[Jt],s,!0))),cn(t,n,n.pendingProps.children,s),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),c=n.pendingProps,c.name!=null&&c.name!=="auto"?n.flags|=t===null?18882560:18874368:rt&&gc(n),t!==null&&t.memoizedProps.name!==c.name?n.flags|=4194816:Ts(t,n),cn(t,n,c.children,s),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Na(t){t.flags|=4}function rp(t,n,s,c,f){var m;if((m=(t.mode&32)!==0)&&(m=s===null?B1(n,c):B1(n,c)&&(c.src!==s.src||c.srcSet!==s.srcSet)),m){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(Gy())t.flags|=8192;else throw zr=Nc,kf}else t.flags&=-16777217}function dy(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!$1(n))if(Gy())t.flags|=8192;else throw zr=Nc,kf}function Hc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?xl():536870912,t.lanes|=n,Ms|=n)}function ql(t,n){if(!rt)switch(t.tailMode){case"visible":break;case"collapsed":for(var s=t.tail,c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null;break;default:for(n=t.tail,s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null}}function Ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(n)for(var f=t.child;f!==null;)s|=f.lanes|f.childLanes,c|=f.subtreeFlags&1206910976,c|=f.flags&1206910976,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)s|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=c,t.childLanes=s,n}function NS(t,n,s){var c=n.pendingProps;switch(mf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(n),null;case 1:return Ut(n),null;case 3:return s=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),ya(Jt),Ht(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(vs(n)?Na(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,gf())),Ut(n),null;case 26:var f=n.type,m=n.memoizedState;return t===null?(Na(n),m!==null?(Ut(n),dy(n,m)):(Ut(n),rp(n,f,null,c,s))):m?m!==t.memoizedState?(Na(n),Ut(n),dy(n,m)):(Ut(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&Na(n),Ut(n),rp(n,f,t,c,s)),null;case 27:if(Qn(n),s=Le.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&Na(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Ut(n),n.subtreeFlags&=-33554433,null}t=jt.current,vs(n)?Fx(n):(t=O1(f,c,s),n.stateNode=t,Na(n))}return Ut(n),n.subtreeFlags&=-33554433,null;case 5:if(Qn(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&Na(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Ut(n),n.subtreeFlags&=-33554433,null}if(m=jt.current,vs(n))Fx(n);else{var w=to(Le.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 c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?m.multiple=!0:c.size&&(m.size=c.size);break;default:m=typeof c.is=="string"?w.createElement(f,{is:c.is}):w.createElement(f)}}m[on]=n,m[he]=c;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(Nn(m,f,c),f){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Na(n)}}return Ut(n),n.subtreeFlags&=-33554433,rp(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&Na(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(t=Le.current,vs(n)){if(t=n.stateNode,s=n.memoizedProps,c=null,f=pn,f!==null)switch(f.tag){case 27:case 5:c=f.memoizedProps}t[on]=n,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||u1(t.nodeValue,s)),t||Fa(n,!0)}else t=to(t).createTextNode(c),t[on]=n,n.stateNode=t}return Ut(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(c=vs(n),s!==null){if(t===null){if(!c)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[on]=n}else Cr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),t=!1}else s=gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(ei(n),n):(ei(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Ut(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=vs(n),c!==null&&c.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[on]=n}else Cr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),f=!1}else f=gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(ei(n),n):(ei(n),null)}return ei(n),(n.flags&128)!==0?(n.lanes=s,n):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=n.child,f=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(f=c.alternate.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==f&&(c.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Hc(n,n.updateQueue),Ut(n),null);case 4:return Ht(),t===null&&$p(n.stateNode.containerInfo),n.flags|=67108864,Ut(n),null;case 10:return ya(n.type),Ut(n),null;case 19:if(Af(n),c=n.memoizedState,c===null)return Ut(n),null;if(f=(n.flags&128)!==0,m=c.rendering,m===null)if(f)ql(c,!1);else{if(Gt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=Tc(t),m!==null){for(n.flags|=128,ql(c,!1),t=m.updateQueue,n.updateQueue=t,Hc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)Ux(s,t),s=s.sibling;return Bl(n,wn.current&1|2),rt&&xa(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&Xt()>eu&&(n.flags|=128,f=!0,ql(c,!1),n.lanes=4194304)}else{if(!f)if(t=Tc(m),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Hc(n,t),ql(c,!0),c.tail===null&&c.tailMode!=="collapsed"&&c.tailMode!=="visible"&&!m.alternate&&!rt)return Ut(n),null}else 2*Xt()-c.renderingStartTime>eu&&s!==536870912&&(n.flags|=128,f=!0,ql(c,!1),n.lanes=4194304);c.isBackwards?(m.sibling=n.child,n.child=m):(t=c.last,t!==null?t.sibling=m:n.child=m,c.last=m)}if(c.tail!==null){t=c.tail;e:{for(s=t;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Xt(),t.sibling=null,m=wn.current,m=f?m&1|2:m&1,c.tailMode==="visible"||c.tailMode==="collapsed"||!s||rt?Bl(n,m):(s=m,Ke(vn,n),Ke(wn,s),Sn===null&&(Sn=n)),rt&&xa(n,c.treeForkCount),t}return Ut(n),null;case 22:case 23:return ei(n),Cf(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(s&536870912)!==0&&(n.flags&128)===0&&(Ut(n),n.subtreeFlags&6&&(n.flags|=8192)):Ut(n),s=n.updateQueue,s!==null&&Hc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==s&&(n.flags|=2048),t!==null&&ot(Rr),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),ya(Jt),Ut(n),null;case 25:return null;case 30:return n.flags|=33554432,Ut(n),null}throw Error(r(156,n.tag))}function ES(t,n){switch(mf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ya(Jt),Ht(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Qn(n),null;case 31:if(n.memoizedState!==null){if(ei(n),n.alternate===null)throw Error(r(340));Cr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(ei(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Cr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Af(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 ya(n.type),null;case 22:case 23:return ei(n),Cf(),t!==null&&ot(Rr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ya(Jt),null;case 25:return null;default:return null}}function fy(t,n){switch(mf(n),n.tag){case 3:ya(Jt),Ht();break;case 26:case 27:case 5:Qn(n);break;case 4:Ht();break;case 31:n.memoizedState!==null&&ei(n);break;case 13:ei(n);break;case 19:Af(n);break;case 10:ya(n.type);break;case 22:case 23:ei(n),Cf(),t!==null&&ot(Rr);break;case 24:ya(Jt)}}function Gl(t,n){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var f=c.next;s=f;do{if((s.tag&t)===t){c=void 0;var m=s.create,w=s.inst;c=m(),w.destroy=c}s=s.next}while(s!==f)}}catch(T){Tt(n,n.return,T)}}function Wa(t,n,s){try{var c=n.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var m=f.next;c=m;do{if((c.tag&t)===t){var w=c.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,f=n;var U=s,V=T;try{V()}catch(ee){Tt(f,U,ee)}}}c=c.next}while(c!==m)}}catch(ee){Tt(n,n.return,ee)}}function py(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{nb(n,s)}catch(c){Tt(t,t.return,c)}}}function my(t,n,s){s.props=Ur(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){Tt(t,n,c)}}function qi(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:var f=t.stateNode,m=ma(t.memoizedProps,f);(f.ref===null||f.ref.name!==m)&&(f.ref=w1(m)),c=f.ref;break;case 7:if(t.stateNode===null){var w=new ri(t);h(t.child,!1,m_,w,void 0,void 0),t.stateNode=w}c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(T){Tt(t,n,T)}}function kn(t,n){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}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 Fc(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++)T1(t.stateNode,n[s])}function hy(t){for(var n=t.return;n!==null&&(lp(n)&&T1(t.stateNode,n.stateNode),!sp(n));)n=n.return}function Yl(t){for(var n=t.return;n!==null&&(lp(n)&&h_(t.stateNode,n.stateNode),!sp(n));)n=n.return}function sp(t){return t.tag===5||t.tag===3||t.tag===27}function lp(t){return t&&t.tag===7&&t.stateNode!==null}function op(t){var n=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(f){Tt(t,t.return,f)}}function cp(t,n,s){try{var c=t.stateNode;ZS(c,t.type,s,n),c[he]=n}catch(f){Tt(t,t.return,f)}}function gy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&rr(t.type)||t.tag===4}function up(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gy(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&&rr(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 dp(t,n,s,c){var f=t.tag;if(f===5||f===6)f=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(f,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(f),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Pi)),Fc(t,c),mt=!0;else if(f!==4&&(f===27&&(Fc(t,c),c=null,rr(t.type)&&(s=t.stateNode,n=null)),t=t.child,t!==null))for(dp(t,n,s,c),t=t.sibling;t!==null;)dp(t,n,s,c),t=t.sibling}function qc(t,n,s,c){var f=t.tag;if(f===5||f===6)f=t.stateNode,n?s.insertBefore(f,n):s.appendChild(f),Fc(t,c),mt=!0;else if(f!==4&&(f===27&&(Fc(t,c),c=null,rr(t.type)&&(s=t.stateNode)),t=t.child,t!==null))for(qc(t,n,s,c),t=t.sibling;t!==null;)qc(t,n,s,c),t=t.sibling}function xy(t){var n=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Nn(n,c,s),n[on]=t,n[he]=s}catch(m){Tt(t,t.return,m)}}var Gc=!1,ti=null;function by(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(Gc=!0)}var Gi=null;function yy(){var t=Gi;return Gi=null,t}var qn=0;function Cs(t,n,s,c,f){return qn=0,vy(t.child,n,s,c,f)}function vy(t,n,s,c,f){for(var m=!1;t!==null;){if(t.tag===5){var w=t.stateNode;if(c!==null){var T=Vp(w);c.push(T),T.view&&(m=!0)}else m||Vp(w).view&&(m=!0);Gc=!0,y1(w,qn===0?n:n+"_"+qn,s),qn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f||vy(t.child,n,s,c,f)&&(m=!0));t=t.sibling}return m}function Yi(t,n){for(;t!==null;)t.tag===5?v1(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Yi(t.child,n)),t=t.sibling}function Yc(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(Yc(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=ha(n.default,n.share),n!=="none"&&(Cs(t,s,n,null,!1)||Yi(t.child,!1))}t=t.sibling}}function fp(t,n){if(t.tag===30){var s=t.stateNode,c=t.memoizedProps,f=ma(c,s),m=ha(c.default,s.paired?c.share:c.enter);m!=="none"?Cs(t,f,m,null,!1)?(Yc(t),s.paired||n||Ls(t,c.onEnter)):Yi(t.child,!1):Yc(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)fp(t,n),t=t.sibling;else Yc(t)}function pp(t){if(ti!==null&&ti.size!==0){var n=ti;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var s=t.memoizedProps,c=s.name;if(c!=null&&c!=="auto"){var f=n.get(c);if(f!==void 0){var m=ha(s.default,s.share);if(m!=="none"&&(Cs(t,c,m,null,!1)?(m=t.stateNode,f.paired=m,m.paired=f,Ls(t,s.onShare)):Yi(t.child,!1)),n.delete(c),n.size===0)break}}}pp(t)}t=t.sibling}}}function mp(t){if(t.tag===30){var n=t.memoizedProps,s=ma(n,t.stateNode),c=ti!==null?ti.get(s):void 0,f=ha(n.default,c!==void 0?n.share:n.exit);f!=="none"&&(Cs(t,s,f,null,!1)?c!==void 0?(f=t.stateNode,c.paired=f,f.paired=c,ti.delete(s),Ls(t,n.onShare)):Ls(t,n.onExit):Yi(t.child,!1)),ti!==null&&pp(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)mp(t),t=t.sibling;else ti!==null&&pp(t)}function wy(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,s=ma(n,t.stateNode);n=ha(n.default,n.update),t.flags&=-5,n!=="none"&&Cs(t,s,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&wy(t);t=t.sibling}}function hp(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,Yi(t.child,!1))}hp(t)}t=t.sibling}}function Kc(t){if(t.tag===30)t.stateNode.paired=null,Yi(t.child,!1),hp(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Kc(t),t=t.sibling;else hp(t)}function ky(t){for(t=t.child;t!==null;)t.tag===30?Yi(t.child,!1):(t.subtreeFlags&33554432)!==0&&ky(t),t=t.sibling}function gp(t,n,s,c,f,m,w){for(var T=!1;n!==null;){if(n.tag===5){var U=n.stateNode;if(m!==null&&qn<m.length){var V=m[qn],ee=Vp(U);(V.view||ee.view)&&(T=!0);var ue;if(ue=(t.flags&4)===0)if(ee.clip)ue=!0;else{ue=V.rect;var Y=ee.rect;ue=ue.y!==Y.y||ue.x!==Y.x||ue.height!==Y.height||ue.width!==Y.width}ue&&(t.flags|=4),ee.abs?ee=!V.abs:(V=V.rect,ee=ee.rect,ee=V.height!==ee.height||V.width!==ee.width),ee&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&y1(U,qn===0?s:s+"_"+qn,f),T&&(t.flags&4)!==0||(Gi===null&&(Gi=[]),Gi.push(U,qn===0?c:c+"_"+qn,n.memoizedProps)),qn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&w?t.flags|=n.flags&32:gp(t,n.child,s,c,f,m,w)&&(T=!0));n=n.sibling}return T}function Ny(t,n){for(t=t.child;t!==null;){if(t.tag===30){var s=t.memoizedProps,c=t.stateNode,f=ma(s,c),m=ha(s.default,s.update),w;w=t.memoizedState,t.memoizedState=null,c=t;var T=t.child;qn=0,f=gp(c,T,f,f,m,w,!1),(t.flags&4)!==0&&f&&Ls(t,s.onUpdate)}else(t.subtreeFlags&33554432)!==0&&Ny(t);t=t.sibling}}var mn=!1,Nt=!1,Ki=!1,xp=!1,Ey=typeof WeakSet=="function"?WeakSet:Set,hn=null,Vi=!1,Kl=!1,Vc=!1,bp=!1;function SS(t,n,s){if(t=t.containerInfo,Fp=Ys,t=Cx(t),af(t)){if("selectionStart"in t)var c={start:t.selectionStart,end:t.selectionEnd};else e:{c=(c=t.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var m=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{c.nodeType,w.nodeType}catch{c=null;break e}var T=0,U=-1,V=-1,ee=0,ue=0,Y=t,W=null;t:for(;;){for(var ke;Y!==c||m!==0&&Y.nodeType!==3||(U=T+m),Y!==w||f!==0&&Y.nodeType!==3||(V=T+f),Y.nodeType===3&&(T+=Y.nodeValue.length),(ke=Y.firstChild)!==null;)W=Y,Y=ke;for(;;){if(Y===t)break t;if(W===c&&++ee===m&&(U=T),W===w&&++ue===f&&(V=T),(ke=Y.nextSibling)!==null)break;Y=W,W=Y.parentNode}Y=ke}c=U===-1||V===-1?null:{start:U,end:V}}else c=null}c=c||{start:0,end:0}}else c=null;for(qp={focusedElem:t,selectionRange:c},Ys=!1,s=(s&335544064)===s,hn=n,n=s?9270:1024;hn!==null;){if(t=hn,s&&(c=t.deletions,c!==null))for(m=0;m<c.length;m++)s&&mp(c[m]);if(t.alternate===null&&(t.flags&2)!==0)s&&by(t),Xc(s);else{if(t.tag===22){if(c=t.alternate,t.memoizedState!==null){c!==null&&c.memoizedState===null&&s&&mp(c),Xc(s);continue}else if(c!==null&&c.memoizedState!==null){s&&by(t),Xc(s);continue}}c=t.child,(t.subtreeFlags&n)!==0&&c!==null?(c.return=t,hn=c):(s&&wy(t),Xc(s))}}ti=null}function Xc(t){for(;hn!==null;){var n=hn,s=t,c=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&c!==null){s=void 0,f=c.memoizedProps,c=c.memoizedState;var m=n.stateNode;try{var w=Ur(n.type,f);s=m.getSnapshotBeforeUpdate(w,c),m.__reactInternalSnapshotBeforeUpdate=s}catch(T){Tt(n,n.return,T)}}break;case 3:if((f&1024)!==0){if(c=n.stateNode.containerInfo,s=c.nodeType,s===9)Qp(c);else if(s===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":Qp(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&c!==null&&(s=ma(c.memoizedProps,c.stateNode),f=n.memoizedProps,f=ha(f.default,f.update),f!=="none"&&Cs(c,s,f,c.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(r(163))}if(c=n.sibling,c!==null){c.return=n.return,hn=c;break}hn=n.return}}function Sy(t,n,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Xi(t,s),c&4&&Gl(5,s);break;case 1:if(Xi(t,s),c&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(w){Tt(s,s.return,w)}else{var f=Ur(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(w){Tt(s,s.return,w)}}c&64&&py(s),c&512&&qi(s,s.return);break;case 3:if(Xi(t,s),c&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{nb(t,n)}catch(w){Tt(s,s.return,w)}}break;case 27:n===null&&c&4&&xy(s);case 26:case 5:Xi(t,s),n===null&&c&4&&op(s),c&512&&qi(s,s.return);break;case 12:Xi(t,s);break;case 31:Xi(t,s),c&4&&jy(t,s);break;case 13:Xi(t,s),c&4&&Ay(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=IS.bind(null,s),b_(t,s))));break;case 22:if(c=s.memoizedState!==null||mn,!c){var m=n!==null&&n.memoizedState!==null||Nt;n=mn,f=Nt,mn=c,(Nt=m)&&!f?(c=2,(s.subtreeFlags&8772)!==0&&(c|=1),Oi(t,s,c)):Xi(t,s),mn=n,Nt=f}break;case 30:Xi(t,s),c&512&&qi(s,s.return);break;case 7:c&512&&qi(s,s.return);default:Xi(t,s)}}function yp(t,n){for(t=t.child;t!==null;)_y(t,n),t=t.sibling}function _y(t,n){switch(t.tag){case 5:case 26:try{var s=t.stateNode;if(n){var c=s.style;typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"}else{var f=t.stateNode,m=t.memoizedProps.style,w=m!=null&&m.hasOwnProperty("display")?m.display:null;f.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(U){Tt(t,t.return,U)}vp(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,mt=!0}catch(U){Tt(t,t.return,U)}break;case 18:try{var T=t.stateNode;n?b1(T,!0):b1(t.stateNode,!1)}catch(U){Tt(t,t.return,U)}break;case 22:case 23:t.memoizedState===null&&yp(t,n);break;default:yp(t,n)}}function vp(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var s=t,c=n;switch(s.tag){case 4:_y(s,c);break e;case 22:s.memoizedState===null&&vp(s,c);break e;default:vp(s,c)}}t=t.sibling}}function Ty(t){var n=t.alternate;n!==null&&(t.alternate=null,Ty(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&dn(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Bt=null,Gn=!1;function ji(t,n,s){for(s=s.child;s!==null;)Cy(t,n,s),s=s.sibling}function Cy(t,n,s){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Rt,s)}catch{}switch(s.tag){case 26:Nt||kn(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||kn(s,n),Yl(s);var c=Bt,f=Gn;rr(s.type)&&(Bt=s.stateNode,Gn=!1),ji(t,n,s),M1(s.stateNode,s.type,s.memoizedProps),Bt=c,Gn=f;break;case 5:Nt||kn(s,n),Yl(s);case 6:if(s.tag===6&&Yl(s),c=Bt,f=Gn,Bt=null,ji(t,n,s),Bt=c,Gn=f,Bt!==null)if(Gn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(s.stateNode),mt=!0}catch(m){Tt(s,n,m)}else try{Bt.removeChild(s.stateNode),mt=!0}catch(m){Tt(s,n,m)}break;case 18:Bt!==null&&(Gn?(t=Bt,x1(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ks(t)):x1(Bt,s.stateNode));break;case 4:c=Bt,f=Gn,Bt=s.stateNode.containerInfo,Gn=!0,ji(t,n,s),Bt=c,Gn=f;break;case 0:case 11:case 14:case 15:Wa(2,s,n),Nt||Wa(4,s,n),ji(t,n,s);break;case 1:Nt||(kn(s,n),c=s.stateNode,typeof c.componentWillUnmount=="function"&&my(s,n,c)),ji(t,n,s);break;case 21:ji(t,n,s);break;case 22:Nt=(c=Nt)||s.memoizedState!==null,ji(t,n,s),Nt=c;break;case 30:kn(s,n),ji(t,n,s);break;case 7:Nt||kn(s,n),ji(t,n,s);break;default:ji(t,n,s)}}function jy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ks(t)}catch(s){Tt(n,n.return,s)}}}function Ay(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ks(t)}catch(s){Tt(n,n.return,s)}}function _S(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Ey),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Ey),n;default:throw Error(r(435,t.tag))}}function Zc(t,n){var s=_S(t);n.forEach(function(c){if(!s.has(c)){s.add(c);var f=US.bind(null,t,c);c.then(f,f)}})}function Rn(t,n,s){var c=n.deletions;if(c!==null)for(var f=0;f<c.length;f++){var m=c[f],w=t,T=n,U=T;e:for(;U!==null;){switch(U.tag){case 27:if(rr(U.type)){Bt=U.stateNode,Gn=!1;break e}break;case 5:Bt=U.stateNode,Gn=!1;break e;case 3:case 4:Bt=U.stateNode.containerInfo,Gn=!0;break e}U=U.return}if(Bt===null)throw Error(r(160));Cy(w,T,m),Bt=null,Gn=!1,w=m.alternate,w!==null&&(w.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Oy(n,t,s),n=n.sibling}var Ai=null;function Oy(t,n,s){var c=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(f&4&&(c=t.updateQueue,c=c!==null?c.events:null,c!==null))for(var m=0;m<c.length;m++){var w=c[m];w.ref.impl=w.nextImpl}Rn(n,t,s),Dn(t),f&4&&(Wa(3,t,t.return),Gl(3,t),Wa(5,t,t.return));break;case 1:Rn(n,t,s),Dn(t),f&512&&(Nt||c===null||kn(c,c.return)),f&64&&mn&&(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,Rn(n,t,s),Dn(t),f&512&&(Nt||c===null||kn(c,c.return)),f&4)if(f=c!==null?c.memoizedState:null,s=t.memoizedState,c===null)if(s===null)if(t.stateNode===null)if(mn)t.stateNode=m1(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,s=t.memoizedProps,f=m.ownerDocument||m;t:switch(n){case"title":c=f.getElementsByTagName("title")[0],(!c||c[Hn]||c[on]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=f.createElement(n),f.head.insertBefore(c,f.querySelector("head > title"))),Nn(c,n,s),c[on]=t,Qt(c),n=c;break e;case"link":if(m=U1("link","href",f).get(n+(s.href||""))){for(w=0;w<m.length;w++)if(c=m[w],c.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&c.getAttribute("rel")===(s.rel==null?null:s.rel)&&c.getAttribute("title")===(s.title==null?null:s.title)&&c.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){m.splice(w,1);break t}}c=f.createElement(n),Nn(c,n,s),f.head.appendChild(c);break;case"meta":if(m=U1("meta","content",f).get(n+(s.content||""))){for(w=0;w<m.length;w++)if(c=m[w],c.getAttribute("content")===(s.content==null?null:""+s.content)&&c.getAttribute("name")===(s.name==null?null:s.name)&&c.getAttribute("property")===(s.property==null?null:s.property)&&c.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&c.getAttribute("charset")===(s.charSet==null?null:s.charSet)){m.splice(w,1);break t}}c=f.createElement(n),Nn(c,n,s),f.head.appendChild(c);break;default:throw Error(r(468,n))}c[on]=t,Qt(c),n=c}t.stateNode=n}else mn||am(m,t.type,t.stateNode);else t.stateNode=I1(m,s,t.memoizedProps);else f!==s?(f===null?(n=c.stateNode,n===null||Nt||n.parentNode.removeChild(n)):f.count--,s===null?mn||am(m,t.type,t.stateNode):I1(m,s,t.memoizedProps)):s===null&&t.stateNode!==null&&cp(t,t.memoizedProps,c.memoizedProps);break;case 27:Rn(n,t,s),Dn(t),f&512&&(Nt||c===null||kn(c,c.return)),c!==null&&f&4&&cp(t,t.memoizedProps,c.memoizedProps);break;case 5:if(m=Ki,Ki=!1,Rn(n,t,s),Ki=m,Dn(t),f&512&&(Nt||c===null||kn(c,c.return)),t.flags&32){n=t.stateNode;try{us(n,""),mt=!0}catch(ee){Tt(t,t.return,ee)}}f&4&&t.stateNode!=null&&(n=t.memoizedProps,cp(t,n,c!==null?c.memoizedProps:n)),f&1024&&(xp=!0);break;case 6:if(Rn(n,t,s),Dn(t),f&4){if(t.stateNode===null)throw Error(r(162));n=t.memoizedProps,s=t.stateNode;try{s.nodeValue=n,mt=!0}catch(ee){Tt(t,t.return,ee)}}break;case 3:if(mt=!1,du=null,m=Ai,Ai=no(n.containerInfo),Rn(n,t,s),Ai=m,Dn(t),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Ks(n.containerInfo)}catch(ee){Tt(t,t.return,ee)}xp&&(xp=!1,My(t)),mt=!1;break;case 4:f=Ki,Ki=mn,c=Wt(),m=Ai,Ai=no(t.stateNode.containerInfo),Rn(n,t,s),Dn(t),Ai=m,mt&&Kl&&(Vc=!0),mt=c,Ki=f;break;case 12:Rn(n,t,s),Dn(t);break;case 31:Rn(n,t,s),Dn(t),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Zc(t,n)));break;case 13:Rn(n,t,s),Dn(t),t.child.flags&8192&&t.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Jc=Xt()),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Zc(t,n)));break;case 22:m=t.memoizedState!==null,w=c!==null&&c.memoizedState!==null;var T=mn,U=Nt,V=Ki;mn=T||m,Ki=V||m,Nt=U||w,Rn(n,t,s),Nt=U,Ki=V,mn=T,Dn(t),f&8192&&(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,!m||c===null||w||mn||Nt||(n=w||Nt,s=mn,c=Nt,mn=m||mn,Nt=n,Ja(t,2),mn=s,Nt=c),!m&&Ki||yp(t,m)),f&4&&(n=t.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Zc(t,s))));break;case 19:Rn(n,t,s),Dn(t),f&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Zc(t,n)));break;case 30:f&512&&(Nt||c===null||kn(c,c.return)),f=Wt(),m=Kl,w=(s&335544064)===s,T=t.memoizedProps,Kl=w&&ha(T.default,T.update)!=="none",Rn(n,t,s),Dn(t),w&&c!==null&&mt&&(t.flags|=4),Kl=m,mt=f;break;case 21:break;case 7:f&512&&(Nt||c===null||kn(c,c.return)),c&&c.stateNode!==null&&(c.stateNode._fragmentFiber=t);default:Rn(n,t,s),Dn(t)}}function Dn(t){var n=t.flags;if(n&2){try{for(var s,c=t.return;c!==null;){if(gy(c)){s=c;break}c=c.return}c=null;for(var f=t.return;f!==null;){if(lp(f)){var m=f.stateNode;c===null?c=[m]:c.push(m)}if(sp(f))break;f=f.return}var w=c;if(s==null)throw Error(r(160));switch(s.tag){case 27:var T=s.stateNode,U=up(t);qc(t,U,T,w);break;case 5:var V=s.stateNode;s.flags&32&&(us(V,""),s.flags&=-33);var ee=up(t);qc(t,ee,V,w);break;case 3:case 4:var ue=s.stateNode.containerInfo,Y=up(t);dp(t,Y,ue,w);break;default:throw Error(r(161))}}catch(W){Tt(t,t.return,W)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function My(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;My(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Ys=!0,n.reset(),Ys=!1),t=t.sibling}}function js(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)Ry(n,t),n=n.sibling;else Ny(n)}function Ry(t,n){var s=t.alternate;if(s===null)fp(t,!1);else switch(t.tag){case 3:if(bp=Vi=!1,yy(),js(n,t),!Vi&&!Vc){if(t=Gi,t!==null)for(var c=0;c<t.length;c+=3){s=t[c];var f=t[c+1];v1(s,t[c+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"})),bp=!0}Gi=null;break;case 5:js(n,t);break;case 4:c=Vi,Vi=!1,js(n,t),Vi&&(Vc=!0),Vi=c;break;case 22:t.memoizedState===null&&(s.memoizedState!==null?fp(t,!1):js(n,t));break;case 30:c=Vi,f=yy(),Vi=!1,js(n,t),Vi&&(t.flags|=4);var m=t.memoizedProps,w=t.stateNode;n=ma(m,w),w=ma(s.memoizedProps,w);var T=ha(m.default,m.update);T==="none"?n=!1:(m=s.memoizedState,s.memoizedState=null,s=t.child,qn=0,n=gp(t,s,n,w,T,m,!0),qn!==(m===null?0:m.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(Ls(t,t.memoizedProps.onUpdate),Gi=f):f!==null&&(f.push.apply(f,Gi),Gi=f),Vi=(t.flags&32)!==0?!0:c;break;default:js(n,t)}}function Xi(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Sy(t,n.alternate,n),n=n.sibling}function Ja(t,n){for(t=t.child;t!==null;){var s=t,c=n;switch(s.tag){case 0:case 11:case 14:case 15:Wa(4,s,s.return),Ja(s,c);break;case 1:kn(s,s.return);var f=s.stateNode;typeof f.componentWillUnmount=="function"&&my(s,s.return,f),Ja(s,c);break;case 27:(c&2)!==0&&M1(s.stateNode,s.type,s.memoizedProps);case 5:kn(s,s.return),s.tag!==5&&s.tag!==27||Yl(s),Ja(s,c);break;case 6:Yl(s);break;case 26:kn(s,s.return),f=s.stateNode,s.memoizedState!==null||f===null||Nt||f.parentNode.removeChild(f),Ja(s,c);break;case 22:s.memoizedState===null&&Ja(s,c);break;case 30:kn(s,s.return),Ja(s,c);break;case 7:kn(s,s.return);default:Ja(s,c)}t=t.sibling}}function Oi(t,n,s){for(s=(n.subtreeFlags&8772)!==0?s:s&-2,n=n.child;n!==null;){var c=n.alternate,f=t,m=n,w=m.flags,T=(s&1)!==0;switch(m.tag){case 0:case 11:case 15:Oi(f,m,s),Gl(4,m);break;case 1:if(Oi(f,m,s),c=m,f=c.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ee){Tt(c,c.return,ee)}if(c=m,f=c.updateQueue,f!==null){var U=c.stateNode;try{var V=f.shared.hiddenCallbacks;if(V!==null)for(f.shared.hiddenCallbacks=null,f=0;f<V.length;f++)tb(V[f],U)}catch(ee){Tt(c,c.return,ee)}}T&&w&64&&py(m),qi(m,m.return);break;case 27:(s&2)!==0&&xy(m);case 5:m.tag!==5&&m.tag!==27||hy(m),Oi(f,m,s),T&&c===null&&w&4&&op(m),qi(m,m.return);break;case 6:hy(m);break;case 26:U=m.stateNode,m.memoizedState!==null||U===null||mn||am(no(U.ownerDocument),m.type,U),Oi(f,m,s),T&&c===null&&w&4&&op(m),qi(m,m.return);break;case 12:Oi(f,m,s);break;case 31:Oi(f,m,s),T&&w&4&&jy(f,m);break;case 13:Oi(f,m,s),T&&w&4&&Ay(f,m);break;case 22:m.memoizedState===null&&Oi(f,m,s),qi(m,m.return);break;case 30:Oi(f,m,s),qi(m,m.return);break;case 7:qi(m,m.return);default:Oi(f,m,s)}n=n.sibling}}function wp(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&&Ml(s))}function kp(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ml(t))}function gi(t,n,s,c){var f=(s&335544064)===s;if(n.subtreeFlags&(f?10262:10256))for(n=n.child;n!==null;)Dy(t,n,s,c),n=n.sibling;else f&&ky(n)}function Dy(t,n,s,c){var f=(s&335544064)===s;f&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Kc(n);var m=n.flags;switch(n.tag){case 0:case 11:case 15:gi(t,n,s,c),m&2048&&Gl(9,n);break;case 1:gi(t,n,s,c);break;case 3:gi(t,n,s,c),f&&bp&&(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&&Ml(m)));break;case 12:if(m&2048){gi(t,n,s,c),m=n.stateNode;try{var w=n.memoizedProps,T=w.id,U=w.onPostCommit;typeof U=="function"&&U(T,n.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(V){Tt(n,n.return,V)}}else gi(t,n,s,c);break;case 31:gi(t,n,s,c);break;case 13:gi(t,n,s,c);break;case 23:break;case 22:w=n.stateNode,T=n.alternate,n.memoizedState!==null?(f&&T!==null&&T.memoizedState===null&&Kc(T),w._visibility&2?gi(t,n,s,c):Vl(t,n)):(f&&T!==null&&T.memoizedState!==null&&Kc(n),w._visibility&2?gi(t,n,s,c):(w._visibility|=2,As(t,n,s,c,(n.subtreeFlags&10256)!==0||!1))),m&2048&&wp(T,n);break;case 24:gi(t,n,s,c),m&2048&&kp(n.alternate,n);break;case 30:f&&(m=n.alternate,m!==null&&(Yi(m.child,!0),Yi(n.child,!0))),gi(t,n,s,c);break;default:gi(t,n,s,c)}}function As(t,n,s,c,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=t,w=n,T=s,U=c,V=w.flags;switch(w.tag){case 0:case 11:case 15:As(m,w,T,U,f),Gl(8,w);break;case 23:break;case 22:var ee=w.stateNode;w.memoizedState!==null?ee._visibility&2?As(m,w,T,U,f):Vl(m,w):(ee._visibility|=2,As(m,w,T,U,f)),f&&V&2048&&wp(w.alternate,w);break;case 24:As(m,w,T,U,f),f&&V&2048&&kp(w.alternate,w);break;default:As(m,w,T,U,f)}n=n.sibling}}function Vl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,c=n,f=c.flags;switch(c.tag){case 22:Vl(s,c),f&2048&&wp(c.alternate,c);break;case 24:Vl(s,c),f&2048&&kp(c.alternate,c);break;default:Vl(s,c)}n=n.sibling}}var Br=8192;function $r(t,n,s){if(t.subtreeFlags&Br)for(t=t.child;t!==null;)zy(t,n,s),t=t.sibling}function zy(t,n,s){switch(t.tag){case 26:$r(t,n,s),t.flags&Br&&(t.memoizedState!==null?M_(s,Ai,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&H1(s,t)));break;case 5:$r(t,n,s),t.flags&Br&&(t=t.stateNode,(n&335544128)===n&&H1(s,t));break;case 3:case 4:var c=Ai;Ai=no(t.stateNode.containerInfo),$r(t,n,s),Ai=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Br,Br=16777216,$r(t,n,s),Br=c):$r(t,n,s));break;case 30:if((t.flags&Br)!==0&&(c=t.memoizedProps.name,c!=null&&c!=="auto")){var f=t.stateNode;f.paired=null,ti===null&&(ti=new Map),ti.set(c,f)}$r(t,n,s);break;default:$r(t,n,s)}}function Ly(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 Xl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];hn=c,Uy(c,t)}Ly(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Iy(t),t=t.sibling}function Iy(t){switch(t.tag){case 0:case 11:case 15:Xl(t),t.flags&2048&&Wa(9,t,t.return);break;case 3:Xl(t);break;case 12:Xl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Qc(t)):Xl(t);break;default:Xl(t)}}function Qc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];hn=c,Uy(c,t)}Ly(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Wa(8,n,n.return),Qc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Qc(n));break;default:Qc(n)}t=t.sibling}}function Uy(t,n){for(;hn!==null;){var s=hn;switch(s.tag){case 0:case 11:case 15:Wa(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ml(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,hn=c;else e:for(s=t;hn!==null;){c=hn;var f=c.sibling,m=c.return;if(Ty(c),c===s){hn=null;break e}if(f!==null){f.return=m,hn=f;break e}hn=m}}}var TS={getCacheForType:function(t){var n=yn(Jt),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return yn(Jt).controller.signal}},CS=typeof WeakMap=="function"?WeakMap:Map,wt=0,Dt=null,ct=null,dt=0,_t=0,ni=null,er=!1,Os=!1,Np=!1,Ea=0,Gt=0,tr=0,Pr=0,Wc=0,ii=0,Ms=0,Zl=null,Yn=null,Ep=!1,Jc=0,By=0,eu=1/0,tu=null,nr=null,Pt=0,Mi=null,Hr=null,Zi=0,Sp=0,_p=null,$y=null,Rs=null,Ds=null,zs=null,Ql=0,nu=null;function ai(){return(wt&2)!==0&&dt!==0?dt&-dt:Ee.T!==null?Lp():Zo()}function Py(){if(ii===0)if((dt&536870912)===0||rt){var t=Da;Da<<=1,(Da&3932160)===0&&(Da=262144),ii=t}else ii=536870912;return t=vn.current,t!==null&&(t.flags|=32),ii}function Ls(t,n){if(n!=null){var s=t.stateNode,c=s.ref;c===null&&(c=s.ref=w1(ma(t.memoizedProps,s))),Ds===null&&(Ds=[]),Ds.push(n.bind(null,c))}}function Kn(t,n,s){(t===Dt&&(_t===2||_t===9)||t.cancelPendingCommit!==null)&&(Is(t,0),ir(t,dt,ii,!1)),Nr(t,s),((wt&2)===0||t!==Dt)&&(t===Dt&&((wt&2)===0&&(Pr|=s),Gt===4&&ir(t,dt,ii,!1)),Qi(t))}function Hy(t,n,s){if((wt&6)!==0)throw Error(r(327));var c=!s&&(n&127)===0&&(n&t.expiredLanes)===0||kr(t,n),f=c?OS(t,n):Cp(t,n,!0),m=c;do{if(f===0){Os&&!c&&ir(t,n,0,!1);break}else{if(s=t.current.alternate,m&&!jS(s)){f=Cp(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 T=t;f=Zl;var U=T.current.memoizedState.isDehydrated;if(U&&(Is(T,w).flags|=256),w=Cp(T,w,!1),w!==2&&w!==6){if(Np&&!U){T.errorRecoveryDisabledLanes|=m,Pr|=m,f=4;break e}m=Yn,Yn=f,m!==null&&(Yn===null?Yn=m:Yn.push.apply(Yn,m))}f=w}if(m=!1,f!==2)continue}}if(f===1){Is(t,0),ir(t,n,0,!0);break}e:{switch(c=t,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:ir(c,n,ii,!er);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Jc+300-Xt(),10<f)){if(ir(c,n,ii,!er),La(c,0,!0)!==0)break e;Zi=n,c.timeoutHandle=Kp(Fy.bind(null,c,s,Yn,tu,Ep,n,ii,Pr,Ms,er,m,"Throttled",-0,0),f);break e}Fy(c,s,Yn,tu,Ep,n,ii,Pr,Ms,er,m,null,-0,0)}}break}while(!0);Qi(t)}function Fy(t,n,s,c,f,m,w,T,U,V,ee,ue,Y,W){t.timeoutHandle=-1;var ke=n.subtreeFlags,ze=(m&335544064)===m;if(ue=null,(ze||ke&8192||(ke&16785408)===16785408)&&(ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pi},ti=null,zy(n,m,ue),ze&&(ke=ue,ze=t.containerInfo,ze=(ze.nodeType===9?ze:ze.ownerDocument).__reactViewTransition,ze!=null&&(ke.count++,ke.waitingForViewTransition=!0,ke=ro.bind(ke),ze.finished.then(ke,ke))),ke=(m&62914560)===m?Jc-Xt():(m&4194048)===m?By-Xt():0,ke=R_(ue,ke),ke!==null)){Zi=m,t.cancelPendingCommit=ke(Qy.bind(null,t,n,m,s,c,f,w,T,U,V,ee,ue,null,Y,W)),ir(t,m,w,!V);return}Qy(t,n,m,s,c,f,w,T,U,V,ee,ue)}function jS(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 c=0;c<s.length;c++){var f=s[c],m=f.getSnapshot;f=f.value;try{if(!Jn(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 ir(t,n,s,c){n=Vo(t,n),n&=~Wc,n&=~Pr,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var f=n;0<f;){var m=31-Ne(f),w=1<<m;c[m]=-1,f&=~w}s!==0&&Xo(t,s,n)}function iu(){return(wt&6)===0?(Wl(0),!1):!0}function Tp(){if(ct!==null){if(_t===0)var t=ct.return;else t=ct,ba=jr=null,zf(t),Ns=null,zl=0,t=ct;for(;t!==null;)fy(t.alternate,t),t=t.return;ct=null}}function Is(t,n){var s=t.timeoutHandle;return s!==-1&&(t.timeoutHandle=-1,JS(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Zi=0,Tp(),Dt=t,ct=s=ga(t.current,null),dt=n,_t=0,ni=null,er=!1,Os=kr(t,n),Np=!1,Ms=ii=Wc=Pr=tr=Gt=0,Yn=Zl=null,Ep=!1,Ea=Vo(t,n),dc(),s}function qy(t,n){it=null,Ee.H=Lc,n===ks||n===kc?(n=Qx(),_t=3):n===kf?(n=Qx(),_t=4):_t=n===Zf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ni=n,ct===null&&(Gt=1,Ic(t,fi(n,t.current)))}function Gy(){var t=vn.current;return t===null?!0:(dt&4194048)===dt?Sn===null:(dt&62914560)===dt||(dt&536870912)!==0?t===Sn:!1}function Yy(){var t=Ee.H;return Ee.H=Lc,t===null?Lc:t}function Ky(){var t=Ee.A;return Ee.A=TS,t}function au(){Gt=4,er||(dt&4194048)!==dt&&vn.current!==null||(Os=!0),(tr&134217727)===0&&(Pr&134217727)===0||Dt===null||ir(Dt,dt,ii,!1)}function Cp(t,n,s){var c=wt;wt|=2;var f=Yy(),m=Ky();(Dt!==t||dt!==n)&&(tu=null,Is(t,n)),n=!1;var w=Gt;e:do try{if(_t!==0&&ct!==null){var T=ct,U=ni;switch(_t){case 8:Tp(),w=6;break e;case 3:case 2:case 9:case 6:vn.current===null&&(n=!0);var V=_t;if(_t=0,ni=null,Us(t,T,U,V),s&&Os){w=0;break e}break;default:V=_t,_t=0,ni=null,Us(t,T,U,V)}}AS(),w=Gt;break}catch(ee){qy(t,ee)}while(!0);return n&&t.shellSuspendCounter++,ba=jr=null,wt=c,Ee.H=f,Ee.A=m,ct===null&&(Dt=null,dt=0,dc()),w}function AS(){for(;ct!==null;)Vy(ct)}function OS(t,n){var s=wt;wt|=2;var c=Yy(),f=Ky();Dt!==t||dt!==n?(tu=null,eu=Xt()+500,Is(t,n)):Os=kr(t,n);e:do try{if(_t!==0&&ct!==null){n=ct;var m=ni;t:switch(_t){case 1:_t=0,ni=null,Us(t,n,m,1);break;case 2:case 9:if(Xx(m)){_t=0,ni=null,Xy(n);break}n=function(){_t!==2&&_t!==9||Dt!==t||(_t=7),Qi(t)},m.then(n,n);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:Xx(m)?(_t=0,ni=null,Xy(n)):(_t=0,ni=null,Us(t,n,m,7));break;case 5:var w=null;switch(ct.tag){case 26:w=ct.memoizedState;case 5:case 27:var T=ct;if(w?$1(w):T.stateNode.complete){_t=0,ni=null;var U=T.sibling;if(U!==null)ct=U;else{var V=T.return;V!==null?(ct=V,ru(V)):ct=null}break t}}_t=0,ni=null,Us(t,n,m,5);break;case 6:_t=0,ni=null,Us(t,n,m,6);break;case 8:Tp(),Gt=6;break e;default:throw Error(r(462))}}MS();break}catch(ee){qy(t,ee)}while(!0);return ba=jr=null,Ee.H=c,Ee.A=f,wt=s,ct!==null?0:(Dt=null,dt=0,dc(),Gt)}function MS(){for(;ct!==null&&!sa();)Vy(ct)}function Vy(t){var n=uy(t.alternate,t,Ea);t.memoizedProps=t.pendingProps,n===null?ru(t):ct=n}function Xy(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=iy(s,n,n.pendingProps,n.type,void 0,dt);break;case 11:n=iy(s,n,n.pendingProps,n.type.render,n.ref,dt);break;case 5:zf(n);var c=n;c===pn&&(rt?(xc(c),c.tag===5&&c.stateNode!=null&&(It=c.stateNode)):(xc(c),rt=!0));default:fy(s,n),n=ct=Ux(n,Ea),n=uy(s,n,Ea)}t.memoizedProps=t.pendingProps,n===null?ru(t):ct=n}function Us(t,n,s,c){ba=jr=null,zf(n),Ns=null,zl=0;var f=n.return;try{if(yS(t,f,n,s,dt)){Gt=1,Ic(t,fi(s,t.current)),ct=null;return}}catch(m){if(f!==null)throw ct=f,m;Gt=1,Ic(t,fi(s,t.current)),ct=null;return}n.flags&32768?(rt||c===1?t=!0:Os||(dt&536870912)!==0?t=!1:(er=t=!0,(c===2||c===9||c===3||c===6)&&(c=vn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Zy(n,t)):ru(n)}function ru(t){var n=t;do{if((n.flags&32768)!==0){Zy(n,er);return}t=n.return;var s=NS(n.alternate,n,Ea);if(s!==null){ct=s;return}if(n=n.sibling,n!==null){ct=n;return}ct=n=t}while(n!==null);Gt===0&&(Gt=5)}function Zy(t,n){do{var s=ES(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);Gt=6,ct=null}function Qy(t,n,s,c,f,m,w,T,U,V,ee,ue){t.cancelPendingCommit=null;do su();while(Pt!==0);if((wt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));t===Dt&&(ct=Dt=null,dt=0),Hr=n,Mi=t,Zi=s,_p=f,$y=c,RS(t,n,s,w,T,U,ue)}}function RS(t,n,s,c,f,m,w){var T=n.lanes|n.childLanes;if(Sp=T,T|=cf,Hd(t,s,T,c,f,m),Ds=null,(s&335544064)===s?(zs=lS(t),c=10262):(zs=null,c=10256),(n.subtreeFlags&c)!==0||(n.flags&c)!==0?(t.callbackNode=null,t.callbackPriority=0,BS(_i,function(){return Mp(),null})):(t.callbackNode=null,t.callbackPriority=0),Gc=!1,c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=Ee.T,Ee.T=null,f=P.p,P.p=2,m=wt,wt|=4;try{SS(t,n,s)}finally{wt=m,P.p=f,Ee.T=c}}Pt=1,Gc?Rs=r_(w,t.containerInfo,zs,jp,Ap,zS,Op,Mp,DS):(jp(),Ap(),Op())}function DS(t){if(Pt!==0){var n=Mi.onRecoverableError;n(t,{componentStack:null})}}function zS(){Pt===3&&(Pt=0,Ry(Hr,Mi),Pt=4)}function jp(){if(Pt===1){Pt=0;var t=Mi,n=Hr,s=Zi,c=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||c){c=Ee.T,Ee.T=null;var f=P.p;P.p=2;var m=wt;wt|=4;try{Kl=Vc=!1,Oy(n,t,s),s=qp;var w=Cx(t.containerInfo),T=s.focusedElem,U=s.selectionRange;if(w!==T&&T&&T.ownerDocument&&Tx(T.ownerDocument.documentElement,T)){if(U!==null&&af(T)){var V=U.start,ee=U.end;if(ee===void 0&&(ee=V),"selectionStart"in T)T.selectionStart=V,T.selectionEnd=Math.min(ee,T.value.length);else{var ue=T.ownerDocument||document,Y=ue&&ue.defaultView||window;if(Y.getSelection){var W=Y.getSelection(),ke=T.textContent.length,ze=Math.min(U.start,ke),at=U.end===void 0?ze:Math.min(U.end,ke);!W.extend&&ze>at&&(w=at,at=ze,ze=w);var K=_x(T,ze),F=_x(T,at);if(K&&F&&(W.rangeCount!==1||W.anchorNode!==K.node||W.anchorOffset!==K.offset||W.focusNode!==F.node||W.focusOffset!==F.offset)){var Q=ue.createRange();Q.setStart(K.node,K.offset),W.removeAllRanges(),ze>at?(W.addRange(Q),W.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),W.addRange(Q))}}}}for(ue=[],W=T;W=W.parentNode;)W.nodeType===1&&ue.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ue.length;T++){var ce=ue[T];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Ys=!!Fp,qp=Fp=null}finally{wt=m,P.p=f,Ee.T=c}}t.current=n,Pt=2}}function Ap(){if(Pt===2){Pt=0;var t=Mi,n=Hr,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=Ee.T,Ee.T=null;var c=P.p;P.p=2;var f=wt;wt|=4;try{Sy(t,n.alternate,n)}finally{wt=f,P.p=c,Ee.T=s}}Pt=3}}function Op(){if(Pt===4||Pt===3){Pt=0;var t=Rs;Rs=null,Ra();var n=Mi,s=Hr,c=Zi,f=$y,m=(c&335544064)===c?10262:10256;if((s.subtreeFlags&m)!==0||(s.flags&m)!==0?Pt=5:(Pt=0,Hr=Mi=null,Wy(n,n.pendingLanes)),m=n.pendingLanes,m===0&&(nr=null),yl(c),s=s.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Rt,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=Ee.T,m=P.p,P.p=2,Ee.T=null;try{for(var w=n.onRecoverableError,T=0;T<f.length;T++){var U=f[T];w(U.value,{componentStack:U.stack})}}finally{Ee.T=s,P.p=m}}if(f=Ds,w=zs,zs=null,f!==null&&(Ds=null,w===null&&(w=[]),t!==null))for(U=0;U<f.length;U++)s=(0,f[U])(w),s!==void 0&&t.finished.finally(s);(Zi&3)!==0&&su(),Qi(n),m=n.pendingLanes,(c&261930)!==0&&(m&42)!==0?n===nu?Ql++:(Ql=0,nu=n):(Ql=0,nu=null),Wl(0)}}function Wy(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ml(n)))}function su(){return Rs!==null&&(Rs.skipTransition(),Rs=null),jp(),Ap(),Op(),Mp()}function Mp(){if(Pt!==5)return!1;var t=Mi,n=Sp;Sp=0;var s=yl(Zi),c=Ee.T,f=P.p;try{P.p=32>s?32:s,Ee.T=null,s=_p,_p=null;var m=Mi,w=Zi;if(Pt=0,Hr=Mi=null,Zi=0,(wt&6)!==0)throw Error(r(331));var T=wt;if(wt|=4,Iy(m.current),Dy(m,m.current,w,s),wt=T,Wl(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Rt,m)}catch{}return!0}finally{P.p=f,Ee.T=c,Wy(t,n)}}function Jy(t,n,s){n=fi(s,n),n=Xf(t.stateNode,n,2),t=Va(t,n,2),t!==null&&(Nr(t,2),Qi(t))}function Tt(t,n,s){if(t.tag===3)Jy(t,t,s);else for(;n!==null;){if(n.tag===3){Jy(n,t,s);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(nr===null||!nr.has(c))){t=fi(s,t),s=Xb(2),c=Va(n,s,2),c!==null&&(Zb(s,c,n,t),Nr(c,2),Qi(c));break}}n=n.return}}function Rp(t,n,s){var c=t.pingCache;if(c===null){c=t.pingCache=new CS;var f=new Set;c.set(n,f)}else f=c.get(n),f===void 0&&(f=new Set,c.set(n,f));f.has(s)||(Np=!0,f.add(s),t=LS.bind(null,t,n,s),n.then(t,t))}function LS(t,n,s){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Dt===t&&(dt&s)===s&&((Gt===4||Gt===3&&(dt&62914560)===dt&&300>Xt()-Jc)&&(wt&2)===0?Is(t,0):Wc|=s,Ms===dt&&(Ms=0)),Qi(t)}function e1(t,n){n===0&&(n=xl()),t=_r(t,n),t!==null&&(Nr(t,n),Qi(t))}function IS(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),e1(t,s)}function US(t,n){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,f=t.memoizedState;f!==null&&(s=f.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(n),e1(t,s)}function BS(t,n){return Ni(t,n)}var Bs=null,$s=null,Dp=!1,lu=!1,zp=!1,ar=0;function Qi(t){t!==$s&&t.next===null&&($s===null?Bs=$s=t:$s=$s.next=t),lu=!0,Dp||(Dp=!0,PS())}function Wl(t,n){if(!zp&&lu){zp=!0;do for(var s=!1,c=Bs;c!==null;){if(t!==0){var f=c.pendingLanes;if(f===0)var m=0;else{var w=c.suspendedLanes,T=c.pingedLanes;m=(1<<31-Ne(42|t)+1)-1,m&=f&~(w&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,a1(c,m))}else m=dt,m=La(c,c===Dt?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(m&3)===0||kr(c,m)||(s=!0,a1(c,m));c=c.next}while(s);zp=!1}}function $S(){t1()}function t1(){lu=Dp=!1;var t=0;ar!==0&&WS()&&(t=ar);for(var n=Xt(),s=null,c=Bs;c!==null;){var f=c.next,m=n1(c,n);m===0?(c.next=null,s===null?Bs=f:s.next=f,f===null&&($s=s)):(s=c,(t!==0||(m&3)!==0)&&(lu=!0)),c=f}Pt!==0&&Pt!==5||Wl(t),ar!==0&&(ar=0)}function n1(t,n){for(var s=t.suspendedLanes,c=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var w=31-Ne(m),T=1<<w,U=f[w];U===-1?((T&s)===0||(T&c)!==0)&&(f[w]=Pd(T,n)):U<=n&&(t.expiredLanes|=T),m&=~T}if(n=Dt,s=dt,s=La(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===n&&(_t===2||_t===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Ei(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||kr(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(c!==null&&Ei(c),yl(s)){case 2:case 8:s=An;break;case 32:s=_i;break;case 268435456:s=de;break;default:s=_i}return c=i1.bind(null,t),s=Ni(s,c),t.callbackPriority=n,t.callbackNode=s,n}return c!==null&&c!==null&&Ei(c),t.callbackPriority=2,t.callbackNode=null,2}function i1(t,n){if(Pt!==0&&Pt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(su()&&t.callbackNode!==s)return null;var c=dt;return c=La(t,t===Dt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Hy(t,c,n),n1(t,Xt()),t.callbackNode!=null&&t.callbackNode===s?i1.bind(null,t):null)}function a1(t,n){if(su())return null;Hy(t,n,!0)}function PS(){e_(function(){(wt&6)!==0?Ni(Si,$S):t1()})}function Lp(){if(ar===0){var t=Mr;t===0&&(t=$i,$i<<=1,($i&261888)===0&&($i=256)),ar=t}return ar}function r1(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ic(t)}function HS(t,n,s,c,f){if(n==="submit"&&s&&s.stateNode===f){var m=r1((f[he]||null).action),w=c.submitter;w&&(n=(n=w[he]||null)?r1(n.formAction):w.getAttribute("formAction"),n!==null&&(m=n,w=null));var T=new lc("action","action",null,c,f);t.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ar!==0){var U=new FormData(f,w);qf(s,{pending:!0,data:U,method:f.method,action:m},null,U)}}else typeof m=="function"&&(T.preventDefault(),U=new FormData(f,w),qf(s,{pending:!0,data:U,method:f.method,action:m},m,U))},currentTarget:f}]})}}for(var Ip=0;Ip<of.length;Ip++){var Up=of[Ip],FS=Up.toLowerCase(),qS=Up[0].toUpperCase()+Up.slice(1);Ci(FS,"on"+qS)}Ci(Ox,"onAnimationEnd"),Ci(Mx,"onAnimationIteration"),Ci(Rx,"onAnimationStart"),Ci("dblclick","onDoubleClick"),Ci("focusin","onFocus"),Ci("focusout","onBlur"),Ci(JE,"onTransitionRun"),Ci(eS,"onTransitionStart"),Ci(tS,"onTransitionCancel"),Ci(Dx,"onTransitionEnd"),da("onMouseEnter",["mouseout","mouseover"]),da("onMouseLeave",["mouseout","mouseover"]),da("onPointerEnter",["pointerout","pointerover"]),da("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 Jl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),GS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function s1(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],f=c.event;c=c.listeners;e:{var m=void 0;if(n)for(var w=c.length-1;0<=w;w--){var T=c[w],U=T.instance,V=T.currentTarget;if(T=T.listener,U!==m&&f.isPropagationStopped())break e;m=T,f.currentTarget=V;try{m(f)}catch(ee){uc(ee)}f.currentTarget=null,m=U}else for(w=0;w<c.length;w++){if(T=c[w],U=T.instance,V=T.currentTarget,T=T.listener,U!==m&&f.isPropagationStopped())break e;m=T,f.currentTarget=V;try{m(f)}catch(ee){uc(ee)}f.currentTarget=null,m=U}}}}function ut(t,n){var s=n[lt];s===void 0&&(s=n[lt]=new Set);var c=t+"__bubble";s.has(c)||(l1(n,t,2,!1),s.add(c))}function Bp(t,n,s){var c=0;n&&(c|=4),l1(s,t,c,n)}var ou="_reactListening"+Math.random().toString(36).slice(2);function $p(t){if(!t[ou]){t[ou]=!0,Jo.forEach(function(s){s!=="selectionchange"&&(GS.has(s)||Bp(s,!1,t),Bp(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ou]||(n[ou]=!0,Bp("selectionchange",!1,n))}}function l1(t,n,s,c){switch(Z1(n)){case 2:var f=I_;break;case 8:f=U_;break;default:f=sm}s=f.bind(null,n,s,t),f=void 0,!Kd||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),c?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 Pp(t,n,s,c,f){var m=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var T=c.stateNode.containerInfo;if(T===f)break;if(w===4)for(w=c.return;w!==null;){var U=w.tag;if((U===3||U===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;T!==null;){if(w=fn(T),w===null)return;if(U=w.tag,U===5||U===6||U===26||U===27){c=m=w;continue e}T=T.parentNode}}c=c.return}lx(function(){var V=m,ee=Gd(s),ue=[];e:{var Y=zx.get(t);if(Y!==void 0){var W=lc,ke=t;switch(t){case"keypress":if(rc(s)===0)break e;case"keydown":case"keyup":W=jE;break;case"focusin":ke="focus",W=Qd;break;case"focusout":ke="blur",W=Qd;break;case"beforeblur":case"afterblur":W=Qd;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=ux;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=xE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=DE;break;case Ox:case Mx:case Rx:W=vE;break;case Dx:W=LE;break;case"scroll":case"scrollend":W=hE;break;case"wheel":W=UE;break;case"copy":case"cut":case"paste":W=kE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=fx;break;case"submit":W=ME;break;case"toggle":case"beforetoggle":W=$E}var ze=(n&4)!==0,at=!ze&&(t==="scroll"||t==="scrollend"),K=ze?Y!==null?Y+"Capture":null:Y;ze=[];for(var F=V,Q;F!==null;){var ce=F;if(Q=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||Q===null||K===null||(ce=wl(F,K),ce!=null&&ze.push(eo(F,ce,Q))),at)break;F=F.return}0<ze.length&&(Y=new W(Y,ke,null,s,ee),ue.push({event:Y,listeners:ze}))}}if((n&7)===0){e:{if(W=t==="mouseover"||t==="pointerover",Y=t==="mouseout"||t==="pointerout",W&&s!==qd&&(ke=s.relatedTarget||s.fromElement)&&(fn(ke)||ke[Ie]))break e;(Y||W)&&(ke=ee.window===ee?ee:(W=ee.ownerDocument)?W.defaultView||W.parentWindow:window,Y?(W=s.relatedTarget||s.toElement,Y=V,W=W?fn(W):null,W!==null&&(at=u(W),ze=W.tag,W!==at||ze!==5&&ze!==27&&ze!==6)&&(W=null)):(Y=null,W=V),Y!==W&&(ze=ux,ce="onMouseLeave",K="onMouseEnter",F="mouse",(t==="pointerout"||t==="pointerover")&&(ze=fx,ce="onPointerLeave",K="onPointerEnter",F="pointer"),at=Y==null?ke:Ua(Y),Q=W==null?ke:Ua(W),ke=new ze(ce,F+"leave",Y,s,ee),ke.target=at,ke.relatedTarget=Q,ce=null,fn(ee)===V&&(ze=new ze(K,F+"enter",W,s,ee),ze.target=Q,ze.relatedTarget=at,ce=ze),at=ce,ze=Y&&W?D(Y,W,YS):null,Y!==null&&o1(ue,ke,Y,ze,!1),W!==null&&at!==null&&o1(ue,at,W,ze,!0)))}e:{if(Y=V?Ua(V):window,W=Y.nodeName&&Y.nodeName.toLowerCase(),W==="select"||W==="input"&&Y.type==="file")var Re=vx;else if(bx(Y))if(wx)Re=ZE;else{Re=VE;var ft=KE}else W=Y.nodeName,!W||W.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?V&&Fd(V.elementType)&&(Re=vx):Re=XE;if(Re&&(Re=Re(t,V))){yx(ue,Re,s,ee);break e}ft&&ft(t,Y,V)}switch(ft=V?Ua(V):window,t){case"focusin":(bx(ft)||ft.contentEditable==="true")&&(ms=ft,rf=V,jl=null);break;case"focusout":jl=rf=ms=null;break;case"mousedown":sf=!0;break;case"contextmenu":case"mouseup":case"dragend":sf=!1,jx(ue,s,ee);break;case"selectionchange":if(WE)break;case"keydown":case"keyup":jx(ue,s,ee)}var Pe;if(Jd)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 ps?gx(t,s)&&(Ye="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Ye="onCompositionStart");Ye&&(px&&s.locale!=="ko"&&(ps||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&ps&&(Pe=ox()):(Ba=ee,Vd="value"in Ba?Ba.value:Ba.textContent,ps=!0)),ft=cu(V,Ye),0<ft.length&&(Ye=new dx(Ye,t,null,s,ee),ue.push({event:Ye,listeners:ft}),Pe?Ye.data=Pe:(Pe=xx(s),Pe!==null&&(Ye.data=Pe)))),(Pe=HE?FE(t,s):qE(t,s))&&(Ye=cu(V,"onBeforeInput"),0<Ye.length&&(ft=new dx("onBeforeInput","beforeinput",null,s,ee),ue.push({event:ft,listeners:Ye}),ft.data=Pe)),HS(ue,t,V,s,ee)}s1(ue,n)})}function eo(t,n,s){return{instance:t,listener:n,currentTarget:s}}function cu(t,n){for(var s=n+"Capture",c=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=wl(t,s),f!=null&&c.unshift(eo(t,f,m)),f=wl(t,n),f!=null&&c.push(eo(t,f,m))),t.tag===3)return c;t=t.return}return[]}function YS(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function o1(t,n,s,c,f){for(var m=n._reactName,w=[];s!==null&&s!==c;){var T=s,U=T.alternate,V=T.stateNode;if(T=T.tag,U!==null&&U===c)break;T!==5&&T!==26&&T!==27||V===null||(U=V,f?(V=wl(s,m),V!=null&&w.unshift(eo(s,V,U))):f||(V=wl(s,m),V!=null&&w.push(eo(s,V,U)))),s=s.return}w.length!==0&&t.push({event:n,listeners:w})}var KS=/\r\n?/g,VS=/\u0000|\uFFFD/g;function c1(t){return(typeof t=="string"?t:""+t).replace(KS,`
9
+ `).replace(VS,"")}function u1(t,n){return n=c1(n),c1(t)===n}function Ct(t,n,s,c,f,m){switch(s){case"children":if(typeof c=="string")n==="body"||n==="textarea"&&c===""||us(t,c);else if(typeof c=="number"||typeof c=="bigint")n!=="body"&&us(t,""+c);else return;break;case"className":fa(t,"class",c);break;case"tabIndex":fa(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(t,s,c);break;case"style":rx(t,c,m);return;case"data":if(n!=="object"){fa(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ic(c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="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(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ic(c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=Pi);return;case"onScroll":c!=null&&ut("scroll",t);return;case"onScrollEnd":c!=null&&ut("scrollend",t);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(f.children!=null)throw Error(r(60));m?.__html!==s&&(t.innerHTML=s)}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=ic(c),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":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":ut("beforetoggle",t),ut("toggle",t),yt(t,"popover",c);break;case"xlinkActuate":xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":xn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":xn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":xn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":xn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":yt(t,"is",c);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=pE.get(s)||s,yt(t,s,c);else return}mt=!0}function Hp(t,n,s,c,f,m){switch(s){case"style":rx(t,c,m);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(f.children!=null)throw Error(r(60));m?.__html!==s&&(t.innerHTML=s)}}break;case"children":if(typeof c=="string")us(t,c);else if(typeof c=="number"||typeof c=="bigint")us(t,""+c);else return;break;case"onScroll":c!=null&&ut("scroll",t);return;case"onScrollEnd":c!=null&&ut("scrollend",t);return;case"onClick":c!=null&&(t.onclick=Pi);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!ec.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[he]||null,n=n!=null?n[s]:null,typeof n=="function"&&t.removeEventListener(m,n,f),typeof c=="function")){typeof n!="function"&&n!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(m,c,f);break e}mt=!0,s in t?t[s]=c:c===!0?t.setAttribute(s,""):yt(t,s,c)}return}mt=!0}function Nn(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 c=!1,f=!1,m;for(m in s)if(s.hasOwnProperty(m)){var w=s[m];if(w!=null)switch(m){case"src":c=!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),c&&Ct(t,n,"src",s.src,s,null);return;case"input":ut("invalid",t);var T=m=w=f=null,U=null,V=null;for(c in s)if(s.hasOwnProperty(c)){var ee=s[c];if(ee!=null)switch(c){case"name":f=ee;break;case"type":w=ee;break;case"checked":U=ee;break;case"defaultChecked":V=ee;break;case"value":m=ee;break;case"defaultValue":T=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:Ct(t,n,c,ee,s,null)}}nc(t,m,T,U,V,w,f,!1);return;case"select":ut("invalid",t),c=w=m=null;for(f in s)if(s.hasOwnProperty(f)&&(T=s[f],T!=null))switch(f){case"value":m=T;break;case"defaultValue":w=T;break;case"multiple":c=T;default:Ct(t,n,f,T,s,null)}n=m,s=w,t.multiple=!!c,n!=null?cs(t,!!c,n,!1):s!=null&&cs(t,!!c,s,!0);return;case"textarea":ut("invalid",t),m=f=c=null;for(w in s)if(s.hasOwnProperty(w)&&(T=s[w],T!=null))switch(w){case"value":c=T;break;case"defaultValue":f=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:Ct(t,n,w,T,s,null)}ix(t,c,f,m);return;case"option":for(U in s)s.hasOwnProperty(U)&&(c=s[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":Ct(t,n,U,c,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(c=0;c<Jl.length;c++)ut(Jl[c],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(V in s)if(s.hasOwnProperty(V)&&(c=s[V],c!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Ct(t,n,V,c,s,null)}return;default:if(Fd(n)){for(ee in s)s.hasOwnProperty(ee)&&(c=s[ee],c!==void 0&&Hp(t,n,ee,c,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(c=s[T],c!=null&&Ct(t,n,T,c,s,null))}var XS={};function ZS(t,n,s,c){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,T=null,U=null,V=null,ee=null;for(W in s){var ue=s[W];if(s.hasOwnProperty(W)&&ue!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":U=ue;default:c.hasOwnProperty(W)||Ct(t,n,W,null,c,ue)}}for(var Y in c){var W=c[Y];if(ue=s[Y],c.hasOwnProperty(Y)&&(W!=null||ue!=null))switch(Y){case"type":W!==ue&&(mt=!0),m=W;break;case"name":W!==ue&&(mt=!0),f=W;break;case"checked":W!==ue&&(mt=!0),V=W;break;case"defaultChecked":W!==ue&&(mt=!0),ee=W;break;case"value":W!==ue&&(mt=!0),w=W;break;case"defaultValue":W!==ue&&(mt=!0),T=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:W!==ue&&Ct(t,n,Y,W,c,ue)}}Wn(t,w,T,U,V,ee,m,f);return;case"select":W=w=T=Y=null;for(m in s)if(U=s[m],s.hasOwnProperty(m)&&U!=null)switch(m){case"value":break;case"multiple":W=U;default:c.hasOwnProperty(m)||Ct(t,n,m,null,c,U)}for(f in c)if(m=c[f],U=s[f],c.hasOwnProperty(f)&&(m!=null||U!=null))switch(f){case"value":m!==U&&(mt=!0),Y=m;break;case"defaultValue":m!==U&&(mt=!0),T=m;break;case"multiple":m!==U&&(mt=!0),w=m;default:m!==U&&Ct(t,n,f,m,c,U)}n=T,s=w,c=W,Y!=null?cs(t,!!s,Y,!1):!!c!=!!s&&(n!=null?cs(t,!!s,n,!0):cs(t,!!s,s?[]:"",!1));return;case"textarea":W=Y=null;for(T in s)if(f=s[T],s.hasOwnProperty(T)&&f!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ct(t,n,T,null,c,f)}for(w in c)if(f=c[w],m=s[w],c.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,c,m)}nx(t,Y,W);return;case"option":for(var ke in s)Y=s[ke],s.hasOwnProperty(ke)&&Y!=null&&!c.hasOwnProperty(ke)&&(ke==="selected"?t.selected=!1:Ct(t,n,ke,null,c,Y));for(U in c)Y=c[U],W=s[U],c.hasOwnProperty(U)&&Y!==W&&(Y!=null||W!=null)&&(U==="selected"?(Y!==W&&(mt=!0),t.selected=Y&&typeof Y!="function"&&typeof Y!="symbol"):Ct(t,n,U,Y,c,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 ze in s)Y=s[ze],s.hasOwnProperty(ze)&&Y!=null&&!c.hasOwnProperty(ze)&&Ct(t,n,ze,null,c,Y);for(V in c)if(Y=c[V],W=s[V],c.hasOwnProperty(V)&&Y!==W&&(Y!=null||W!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,n));break;default:Ct(t,n,V,Y,c,W)}return;default:if(Fd(n)){for(var at in s)Y=s[at],s.hasOwnProperty(at)&&Y!==void 0&&!c.hasOwnProperty(at)&&Hp(t,n,at,void 0,c,Y);for(ee in c)Y=c[ee],W=s[ee],!c.hasOwnProperty(ee)||Y===W||Y===void 0&&W===void 0||Hp(t,n,ee,Y,c,W);return}}for(var K in s)Y=s[K],s.hasOwnProperty(K)&&Y!=null&&!c.hasOwnProperty(K)&&Ct(t,n,K,null,c,Y);for(ue in c)Y=c[ue],W=s[ue],!c.hasOwnProperty(ue)||Y===W||Y==null&&W==null||Ct(t,n,ue,Y,c,W)}function d1(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var f=s[c],m=f.transferSize,w=f.initiatorType,T=f.duration;if(m&&T&&d1(w)){for(w=0,T=f.responseEnd,c+=1;c<s.length;c++){var U=s[c],V=U.startTime;if(V>T)break;var ee=U.transferSize,ue=U.initiatorType;ee&&d1(ue)&&(U=U.responseEnd,w+=ee*(U<T?1:(T-V)/(U-V)))}if(--c,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 Fp=null,qp=null;function to(t){return t.nodeType===9?t:t.ownerDocument}function f1(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 p1(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 m1(t,n,s,c){return s=to(s).createElement(t),s[on]=c,s[he]=n,Nn(s,t,n),Qt(s),s}function Gp(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 Yp=null;function WS(){var t=window.event;return t&&t.type==="popstate"?t===Yp?!1:(Yp=t,!0):(Yp=null,!1)}var Kp=typeof setTimeout=="function"?setTimeout:void 0,JS=typeof clearTimeout=="function"?clearTimeout:void 0,h1=typeof Promise=="function"?Promise:void 0,g1=typeof requestAnimationFrame=="function"?requestAnimationFrame:Kp,e_=typeof queueMicrotask=="function"?queueMicrotask:typeof h1<"u"?function(t){return h1.resolve(null).then(t).catch(t_)}:Kp;function t_(t){setTimeout(function(){throw t})}function rr(t){return t==="head"}function x1(t,n){var s=n,c=0;do{var f=s.nextSibling;if(t.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(f),Ks(n);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")tm(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,tm(s);for(var m=s.firstChild;m;){var w=m.nextSibling,T=m.nodeName;m[Hn]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=w}}else s==="body"&&tm(t.ownerDocument.body);s=f}while(s);Ks(n)}function b1(t,n){var s=t;t=0;do{var c=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||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function y1(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 c=1;else for(var f=c=0;f<n.length;f++){var m=n[f];0<m.width&&0<m.height&&c++}c===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+s.paddingTop,t.marginBottom="-"+s.paddingBottom)}}function v1(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 n_(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 Vp(t){var n=t.getBoundingClientRect(),s=getComputedStyle(t);return n_(n,s,t)}function i_(t){return t.documentElement.clientHeight}function a_(t){this.addEventListener("load",t),this.addEventListener("error",t)}function r_(t,n,s,c,f,m,w,T,U){var V=n.nodeType===9?n:n.ownerDocument;try{var ee=V.startViewTransition({update:function(){var Y=V.defaultView,W=Y.navigation&&Y.navigation.transition,ke=V.fonts.status;c();var ze=[];if(ke==="loaded"&&(i_(V),V.fonts.status==="loading"&&ze.push(V.fonts.ready)),ke=ze.length,t!==null)for(var at=t.suspenseyImages,K=0,F=0;F<at.length;F++){var Q=at[F];if(!Q.complete){var ce=Q.getBoundingClientRect();if(0<ce.bottom&&0<ce.right&&ce.top<Y.innerHeight&&ce.left<Y.innerWidth){if(K+=P1(Q),K>fu){ze.length=ke;break}Q=new Promise(a_.bind(Q)),ze.push(Q)}}}if(0<ze.length)return Y=Promise.race([Promise.all(ze),new Promise(function(Re){return setTimeout(Re,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});V.__reactViewTransition=ee;var ue=[];return ee.ready.then(function(){for(var Y=V.documentElement.getAnimations({subtree:!0}),W=0;W<Y.length;W++){var ke=Y[W],ze=ke.effect,at=ze.pseudoElement;if(at!=null&&at.startsWith("::view-transition")){ue.push(ke),ke=ze.getKeyframes();for(var K=at=void 0,F=!0,Q=0;Q<ke.length;Q++){var ce=ke[Q],Re=ce.width;if(at===void 0)at=Re;else if(at!==Re){F=!1;break}if(Re=ce.height,K===void 0)K=Re;else if(K!==Re){F=!1;break}delete ce.width,delete ce.height,ce.transform==="none"&&delete ce.transform}F&&at!==void 0&&K!==void 0&&(ze.setKeyframes(ke),F=getComputedStyle(ze.target,ze.pseudoElement),F.width!==at||F.height!==K)&&(F=ke[0],F.width=at,F.height=K,F=ke[ke.length-1],F.width=at,F.height=K,ze.setKeyframes(ke))}}w()},function(Y){V.__reactViewTransition===ee&&(V.__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&&U(Y)}finally{c(),f(),w()}}),ee.finished.finally(function(){for(var Y=0;Y<ue.length;Y++)ue[Y].cancel();V.__reactViewTransition===ee&&(V.__reactViewTransition=null),T()}),ee}catch{return c(),f(),w(),null}}function Fr(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}Fr.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:N({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},Fr.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,s=t.getAnimations({subtree:!0}),c=[],f=0;f<s.length;f++){var m=s[f].effect;m!==null&&m.target===t&&m.pseudoElement===n&&c.push(s[f])}return c},Fr.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function w1(t){return{name:t,group:new Fr("group",t),imagePair:new Fr("image-pair",t),old:new Fr("old",t),new:new Fr("new",t)}}function ri(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}ri.prototype.addEventListener=function(t,n,s){var c=null,f=null;if(!(s!=null&&typeof s!="boolean"&&(c=s.signal||null,c!==null&&c.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var m=this._eventListeners;if(N1(m,t,n,s)===-1){var w=this,T=n;s!=null&&typeof s!="boolean"&&s.once===!0&&(T=function(U){w.removeEventListener(t,n,s),typeof n=="function"?n.call(this,U):n.handleEvent(U)}),c!==null&&(f=w.removeEventListener.bind(w,t,n,s),c.addEventListener("abort",f,{once:!0}),f=c.removeEventListener.bind(c,"abort",f)),c=Ps(s),m.push({type:t,listener:n,optionsOrUseCapture:s,attachedListener:T,cleanup:f}),h(this._fragmentFiber.child,!1,s_,t,T,c)}this._eventListeners=m}};function s_(t,n,s,c){return j(t).addEventListener(n,s,c),!1}ri.prototype.removeEventListener=function(t,n,s){var c=this._eventListeners;if(c!==null&&(n=N1(c,t,n,s),n!==-1)){var f=c[n];s=f.attachedListener;var m=f.cleanup;f=Ps(f.optionsOrUseCapture),h(this._fragmentFiber.child,!1,l_,t,s,f),c.splice(n,1),m!==null&&m()}};function l_(t,n,s,c){return j(t).removeEventListener(n,s,c),!1}function Ps(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function k1(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function N1(t,n,s,c){if(t.length===0)return-1;c=k1(c);for(var f=0;f<t.length;f++){var m=t[f];if(m.type===n&&m.listener===s&&k1(m.optionsOrUseCapture)===c)return f}return-1}ri.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 c=n.nodeType===9?n.createComment(""):document.createTextNode("");if(s)for(var f=0;f<s.length;f++){var m=s[f];c.addEventListener(m.type,m.attachedListener,Ps(m.optionsOrUseCapture))}if(n.appendChild(c),t=c.dispatchEvent(t),s)for(f=0;f<s.length;f++)m=s[f],c.removeEventListener(m.type,m.attachedListener,Ps(m.optionsOrUseCapture));return n.removeChild(c),t}return n.dispatchEvent(t)},ri.prototype.focus=function(t){h(this._fragmentFiber.child,!0,E1,t,void 0,void 0)};function E1(t,n){return t.tag===6?!1:(t=j(t),y_(t,n))}ri.prototype.focusLast=function(t){var n=[];h(this._fragmentFiber.child,!0,Xp,n,void 0,void 0);for(var s=n.length-1;0<=s&&!E1(n[s],t);s--);};function Xp(t,n){return n.push(t),!1}ri.prototype.blur=function(){var t=v(this._fragmentFiber);t!==null&&(t=j(t),t=to(t).activeElement,t!==null&&h(this._fragmentFiber.child,!1,o_,t,void 0,void 0))};function o_(t,n){return t.tag===6?!1:(t=j(t),t===n||t.contains(n)?(n.blur(),!0):!1)}ri.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),h(this._fragmentFiber.child,!1,c_,t,void 0,void 0)};function c_(t,n){return t.tag===6||(t=j(t),n.observe(t)),!1}ri.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),h(this._fragmentFiber.child,!1,u_,t,void 0,void 0);for(var s=n=0;s<Ri.length;s++){var c=Ri[s];c.fragmentInstance===this&&c.observer===t?t.unobserve(c.instance):Ri[n++]=c}Ri.length=n}};function u_(t,n){return t.tag===6||(t=j(t),n.unobserve(t)),!1}var Ri=[],Zp=!1;function d_(t,n,s){Ri.push({fragmentInstance:t,observer:n,instance:s}),Zp||(Zp=!0,v_(function(){Zp=!1;var c=Ri;Ri=[];for(var f=0;f<c.length;f++){var m=c[f];m.observer.unobserve(m.instance)}}))}ri.prototype.getClientRects=function(){var t=[];return h(this._fragmentFiber.child,!1,f_,t,void 0,void 0),t};function f_(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}ri.prototype.getRootNode=function(t){var n=v(this._fragmentFiber);return n===null?this:j(n).getRootNode(t)},ri.prototype.compareDocumentPosition=function(t){var n=v(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];h(this._fragmentFiber.child,!1,Xp,s,void 0,void 0);var c=j(n);if(s.length===0){if(s=c,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=c=s.compareDocumentPosition(t);return s===t?f=Node.DOCUMENT_POSITION_CONTAINS:c&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:c;if(m==null)return Node.DOCUMENT_POSITION_DISCONNECTED;c=m.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,m=m.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var w=n.compareDocumentPosition(t),T=f.compareDocumentPosition(t),U=w&Node.DOCUMENT_POSITION_CONTAINED_BY||T&Node.DOCUMENT_POSITION_CONTAINED_BY;return T=c&&m&&w&Node.DOCUMENT_POSITION_FOLLOWING&&T&Node.DOCUMENT_POSITION_PRECEDING,n=c&&n===t||m&&f===t||U||T?Node.DOCUMENT_POSITION_CONTAINED_BY:!c&&n===t||!m&&f===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:w,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||p_(n,this._fragmentFiber,s[0],s[s.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function p_(t,n,s,c,f){var m=fn(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=D(s,m,B),n===null?n=!1:(h(n,!0,C,m,s),m=_,_=null,n=m!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!m)&&!(n=m===c)&&(n=D(c,m,B),n===null?n=!1:(h(n,!0,M,m,c),m=_,A=_=null,n=m!==null)),n):!1}function S1(t,n){var s=t.ownerDocument.createRange();s.selectNodeContents(t),t=s.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}ri.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(r(566));var n=[];h(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var s=t!==!1;if(n.length===0){var c=k(this._fragmentFiber);if(c=s?c[1]||c[0]||v(this._fragmentFiber):c[0]||c[1],c===null)return;if(c.tag===6){t=j(c),S1(t,s);return}if(c=j(c),c.nodeType!==9){if(c.nodeType===11){s="host"in c?c.host:null,s!==null&&s.scrollIntoView(t);return}c.scrollIntoView(t)}}for(c=s?n.length-1:0;c!==(s?-1:n.length);){var f=n[c];f.tag===6?(f=j(f),S1(f,s)):j(f).scrollIntoView(t),c+=s?-1:1}};function m_(t,n){return t=j(t),_1(t,n),!1}function _1(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function T1(t,n){var s=n._eventListeners;if(s!==null)for(var c=0;c<s.length;c++){var f=s[c];t.addEventListener(f.type,f.attachedListener,Ps(f.optionsOrUseCapture))}t.nodeType!==3&&(s=n._observers,s!==null&&s.forEach(function(m){for(var w=0,T=0;T<Ri.length;T++){var U=Ri[T];(U.fragmentInstance!==n||U.observer!==m||U.instance!==t)&&(Ri[w++]=U)}Ri.length=w,m.observe(t)}),_1(t,n))}function h_(t,n){var s=n._eventListeners;if(s!==null)for(var c=0;c<s.length;c++){var f=s[c];t.removeEventListener(f.type,f.attachedListener,Ps(f.optionsOrUseCapture))}t.nodeType!==3&&(s=n._observers,s!==null&&s.forEach(function(m){typeof m.rootMargin=="string"?d_(n,m,t):m.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function Qp(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":Qp(s),dn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function g_(t,n,s,c){for(;t.nodeType===1;){var f=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Hn])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 x_(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 C1(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 Wp(t){return t.data==="$?"||t.data==="$~"}function Jp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function b_(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var c=function(){n(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}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 em=null;function j1(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 A1(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 y_(t,n){function s(){c=!0}if(t.ownerDocument.activeElement===t)return!0;var c=!1;try{t.ownerDocument.addEventListener("focus",s,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",s,!0)}return c}function v_(t){g1(function(){g1(function(n){return t(n)})})}function O1(t,n,s){switch(n=to(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 M1(t,n,s){for(var c in s){var f=s[c];s.hasOwnProperty(c)&&f!=null&&Ct(t,n,c,null,XS,f)}s.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Pi&&(t.onclick=null),dn(t)}function tm(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);dn(t)}var bi=new Map,R1=new Set;function no(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 Sa=P.d;P.d={f:w_,r:k_,D:N_,C:E_,L:S_,m:__,X:C_,S:T_,M:j_};function w_(){var t=Sa.f(),n=iu();return t||n}function k_(t){var n=ca(t);n!==null&&n.tag===5&&n.type==="form"?zb(n):Sa.r(t)}var Hs=typeof document>"u"?null:document;function D1(t,n,s){var c=Hs;if(c&&typeof n=="string"&&n){var f=St(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),R1.has(f)||(R1.add(f),t={rel:t,crossOrigin:s,href:n},c.querySelector(f)===null&&(n=c.createElement("link"),Nn(n,"link",t),Qt(n),c.head.appendChild(n)))}}function N_(t){Sa.D(t),D1("dns-prefetch",t,null)}function E_(t,n){Sa.C(t,n),D1("preconnect",t,n)}function S_(t,n,s){Sa.L(t,n,s);var c=Hs;if(c&&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=Fs(t);break;case"script":m=qs(t)}if(!(bi.has(m)||(t=N({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),bi.set(m,t),c.querySelector(f)!==null||n==="style"&&c.querySelector(io(m))||n==="script"&&c.querySelector(ao(m))))){var w=c.createElement("link");Nn(w,"link",t),n==="style"&&(w[oa]=!0,w.onload=w.onerror=function(){Wo(w)}),Qt(w),c.head.appendChild(w)}}}function __(t,n){Sa.m(t,n);var s=Hs;if(s&&t){var c=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+St(c)+'"][href="'+St(t)+'"]',m=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=qs(t)}if(!bi.has(m)&&(t=N({rel:"modulepreload",href:t},n),bi.set(m,t),s.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ao(m)))return}c=s.createElement("link"),Nn(c,"link",t),Qt(c),s.head.appendChild(c)}}}function T_(t,n,s){Sa.S(t,n,s);var c=Hs;if(c&&t){var f=ua(c).hoistableStyles,m=Fs(t);n=n||"default";var w=f.get(m);if(!w){var T={loading:0,preload:null};if(w=c.querySelector(io(m)))T.loading=5;else{t=N({rel:"stylesheet",href:t,"data-precedence":n},s),(s=bi.get(m))&&nm(t,s);var U=w=c.createElement("link");Qt(U),Nn(U,"link",t),U._p=new Promise(function(V,ee){U.onload=V,U.onerror=ee}),U.addEventListener("load",function(){T.loading|=1}),U.addEventListener("error",function(){T.loading|=2}),T.loading|=4,uu(w,n,c)}w={type:"stylesheet",instance:w,count:1,state:T},f.set(m,w)}}}function C_(t,n){Sa.X(t,n);var s=Hs;if(s&&t){var c=ua(s).hoistableScripts,f=qs(t),m=c.get(f);m||(m=s.querySelector(ao(f)),m||(t=N({src:t,async:!0},n),(n=bi.get(f))&&im(t,n),m=s.createElement("script"),Qt(m),Nn(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}}function j_(t,n){Sa.M(t,n);var s=Hs;if(s&&t){var c=ua(s).hoistableScripts,f=qs(t),m=c.get(f);m||(m=s.querySelector(ao(f)),m||(t=N({src:t,async:!0,type:"module"},n),(n=bi.get(f))&&im(t,n),m=s.createElement("script"),Qt(m),Nn(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}}function z1(t,n,s,c){var f=(f=Le.current)?no(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=Fs(s.href),n=ua(f).hoistableStyles,c=n.get(s),c||(c={type:"style",instance:null,count:0,state:null},n.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Fs(s.href);var m=ua(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(io(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)),A_(f,t,m,w.state))),n&&c===null)throw Error(r(528,""));return w}if(n&&c!==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=qs(s),n=ua(f).hoistableScripts,c=n.get(s),c||(c={type:"script",instance:null,count:0,state:null},n.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Fs(t){return'href="'+St(t)+'"'}function io(t){return'link[rel="stylesheet"]['+t+"]"}function L1(t){return N({},t,{"data-precedence":t.precedence,precedence:null})}function A_(t,n,s,c){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[oa]!==!0){c.loading=1;return}}else n=t.createElement("link"),n[oa]=!0,n.onload=n.onerror=Wo.bind(null,n),Nn(n,"link",s),Qt(n),t.head.appendChild(n);c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2})}function qs(t){return'[src="'+St(t)+'"]'}function ao(t){return"script[async]"+t}function I1(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+St(s.href)+'"]');if(c)return n.instance=c,Qt(c),c;var f=N({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Qt(c),Nn(c,"style",f),uu(c,s.precedence,t),n.instance=c;case"stylesheet":f=Fs(s.href);var m=t.querySelector(io(f));if(m)return n.state.loading|=4,n.instance=m,Qt(m),m;c=L1(s),(f=bi.get(f))&&nm(c,f),m=(t.ownerDocument||t).createElement("link"),Qt(m);var w=m;return w._p=new Promise(function(T,U){w.onload=T,w.onerror=U}),Nn(m,"link",c),n.state.loading|=4,uu(m,s.precedence,t),n.instance=m;case"script":return m=qs(s.src),(f=t.querySelector(ao(m)))?(n.instance=f,Qt(f),f):(c=s,(f=bi.get(m))&&(c=N({},s),im(c,f)),t=t.ownerDocument||t,f=t.createElement("script"),Qt(f),Nn(f,"link",c),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&&(c=n.instance,n.state.loading|=4,uu(c,s.precedence,t));return n.instance}function uu(t,n,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=c.length?c[c.length-1]:null,m=f,w=0;w<c.length;w++){var T=c[w];if(T.dataset.precedence===n)m=T;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 nm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function im(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var du=null;function U1(t,n,s){if(du===null){var c=new Map,f=du=new Map;f.set(s,c)}else f=du,c=f.get(s),c||(c=new Map,f.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),f=0;f<s.length;f++){var m=s[f];if(!(m[Hn]||m[on]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var w=m.getAttribute(n)||"";w=t+w;var T=c.get(w);T?T.push(m):c.set(w,[m])}}return c}function am(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function O_(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 B1(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function $1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function P1(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function H1(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=P1(n),t.suspenseyImages.push(n)),t=D_.bind(t),n.decode().then(t,t))}function M_(t,n,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Fs(c.href),m=n.querySelector(io(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ro.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=m,Qt(m);return}m=n.ownerDocument||n,c=L1(c),(f=bi.get(f))&&nm(c,f),m=m.createElement("link"),Qt(m);var w=m;w._p=new Promise(function(T,U){w.onload=T,w.onerror=U}),Nn(m,"link",c),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=ro.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var fu=0;function R_(t,n){return t.stylesheets&&t.count===0&&mu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+n);0<t.imgBytes&&fu===0&&(fu=62500*QS());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>fu?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(f)}}:null}function F1(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)mu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function ro(){this.count--,F1(this)}function D_(){this.imgCount--,F1(this)}var pu=null;function mu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,pu=new Map,n.forEach(z_,t),pu=null,ro.call(t))}function z_(t,n){if(!(n.state.loading&4)){var s=pu.get(t);if(s)var c=s.get(null);else{s=new Map,pu.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),c=w)}c&&s.set(null,c)}f=n.instance,w=f.getAttribute("data-precedence"),m=s.get(w)||c,m===c&&s.set(null,f),s.set(w,f),this.count++,c=ro.bind(this),f.addEventListener("load",c),f.addEventListener("error",c),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var Gs={$$typeof:J,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function L_(t,n,s,c,f,m,w,T,U){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ia(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ia(0),this.hiddenUpdates=Ia(null),this.identifierPrefix=c,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.transitionTypes=null,this.incompleteTransitions=new Map}function q1(t,n,s,c,f,m,w,T,U,V,ee,ue){return t=new L_(t,n,s,w,U,V,ee,ue,T),n=1,m===!0&&(n|=24),m=Fn(3,null,null,n),t.current=m,m.stateNode=t,n=yf(),n.refCount++,t.pooledCache=n,n.refCount++,m.memoizedState={element:c,isDehydrated:s,cache:n},Nf(m),t}function G1(t){return t?(t=xs,t):xs}function Y1(t,n,s,c,f,m){f=G1(f),c.context===null?c.context=f:c.pendingContext=f,c=Ka(n),c.payload={element:s},m=m===void 0?null:m,m!==null&&(c.callback=m),s=Va(t,c,n),s!==null&&(Kn(s,t,n),Ll(s,t,n))}function K1(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function rm(t,n){K1(t,n),(t=t.alternate)&&K1(t,n)}function V1(t){if(t.tag===13||t.tag===31){var n=_r(t,67108864);n!==null&&Kn(n,t,67108864),rm(t,67108864)}}function X1(t){if(t.tag===13||t.tag===31){var n=ai();n=ss(n);var s=_r(t,n);s!==null&&Kn(s,t,n),rm(t,n)}}var Ys=!0;function I_(t,n,s,c){var f=Ee.T;Ee.T=null;var m=P.p;try{P.p=2,sm(t,n,s,c)}finally{P.p=m,Ee.T=f}}function U_(t,n,s,c){var f=Ee.T;Ee.T=null;var m=P.p;try{P.p=8,sm(t,n,s,c)}finally{P.p=m,Ee.T=f}}function sm(t,n,s,c){if(Ys){var f=lm(c);if(f===null)Pp(t,n,c,hu,s),Q1(t,c);else if($_(f,t,n,s,c))c.stopPropagation();else if(Q1(t,c),n&4&&-1<B_.indexOf(t)){for(;f!==null;){var m=ca(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var w=la(m.pendingLanes);if(w!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var U=1<<31-Ne(w);T.entanglements[1]|=U,w&=~U}Qi(m),(wt&6)===0&&(eu=Xt()+500,Wl(0))}}break;case 31:case 13:T=_r(m,2),T!==null&&Kn(T,m,2),iu(),rm(m,2)}if(m=lm(c),m===null&&Pp(t,n,c,hu,s),m===f)break;f=m}f!==null&&c.stopPropagation()}else Pp(t,n,c,null,s)}}function lm(t){return t=Gd(t),om(t)}var hu=null;function om(t){if(hu=null,t=fn(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 hu=t,null}function Z1(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(un()){case Si:return 2;case An:return 8;case _i:case H:return 32;case de:return 268435456;default:return 32}default:return 32}}var cm=!1,sr=null,lr=null,or=null,so=new Map,lo=new Map,cr=[],B_="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 Q1(t,n){switch(t){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":so.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":lo.delete(n.pointerId)}}function oo(t,n,s,c,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:s,eventSystemFlags:c,nativeEvent:m,targetContainers:[f]},n!==null&&(n=ca(n),n!==null&&V1(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function $_(t,n,s,c,f){switch(n){case"focusin":return sr=oo(sr,t,n,s,c,f),!0;case"dragenter":return lr=oo(lr,t,n,s,c,f),!0;case"mouseover":return or=oo(or,t,n,s,c,f),!0;case"pointerover":var m=f.pointerId;return so.set(m,oo(so.get(m)||null,t,n,s,c,f)),!0;case"gotpointercapture":return m=f.pointerId,lo.set(m,oo(lo.get(m)||null,t,n,s,c,f)),!0}return!1}function W1(t){var n=fn(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,Qo(t.priority,function(){X1(s)});return}}else if(n===31){if(n=p(s),n!==null){t.blockedOn=n,Qo(t.priority,function(){X1(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 gu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=lm(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);qd=c,s.target.dispatchEvent(c),qd=null}else return n=ca(s),n!==null&&V1(n),t.blockedOn=s,!1;n.shift()}return!0}function J1(t,n,s){gu(t)&&s.delete(n)}function P_(){cm=!1,sr!==null&&gu(sr)&&(sr=null),lr!==null&&gu(lr)&&(lr=null),or!==null&&gu(or)&&(or=null),so.forEach(J1),lo.forEach(J1)}function xu(t,n){t.blockedOn===n&&(t.blockedOn=null,cm||(cm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,P_)))}var bu=null;function e0(t){bu!==t&&(bu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bu===t&&(bu=null);for(var n=0;n<t.length;n+=3){var s=t[n],c=t[n+1],f=t[n+2];if(typeof c!="function"){if(om(c||s)===null)continue;break}var m=ca(s);m!==null&&(t.splice(n,3),n-=3,qf(m,{pending:!0,data:f,method:s.method,action:c},c,f))}}))}function Ks(t){function n(U){return xu(U,t)}sr!==null&&xu(sr,t),lr!==null&&xu(lr,t),or!==null&&xu(or,t),so.forEach(n),lo.forEach(n);for(var s=0;s<cr.length;s++){var c=cr[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<cr.length&&(s=cr[0],s.blockedOn===null);)W1(s),s.blockedOn===null&&cr.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var f=s[c],m=s[c+1],w=f[he]||null;if(typeof m=="function")w||e0(s);else if(w){var T=null;if(m&&m.hasAttribute("formAction")){if(f=m,w=m[he]||null)T=w.formAction;else if(om(f)!==null)continue}else T=w.action;typeof T=="function"?s[c+1]=T:(s.splice(c,3),c-=3),e0(s)}}}function t0(){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),c||setTimeout(s,20)}function s(){if(!c&&!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 c=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function um(t){this._internalRoot=t}yu.prototype.render=um.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var s=n.current,c=ai();Y1(s,c,t,n,null,null)},yu.prototype.unmount=um.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Y1(t.current,2,null,t,null,null),iu(),n[Ie]=null}};function yu(t){this._internalRoot=t}yu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Zo();t={blockedOn:null,target:t,priority:n};for(var s=0;s<cr.length&&n!==0&&n<cr[s].priority;s++);cr.splice(s,0,t),s===0&&W1(t)}};var n0=i.version;if(n0!=="19.3.1")throw Error(r(527,n0,"19.3.1"));P.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=x(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var H_={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Ee,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{Rt=vu.inject(H_),pt=vu}catch{}}return uo.createRoot=function(t,n){if(!o(t))throw Error(r(299));var s=!1,c="",f=Gb,m=Yb,w=Kb;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=q1(t,1,!1,null,null,s,c,null,f,m,w,t0),t[Ie]=n.current,$p(t),new um(n)},uo.hydrateRoot=function(t,n,s){if(!o(t))throw Error(r(299));var c=!1,f="",m=Gb,w=Yb,T=Kb,U=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!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&&(T=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),n=q1(t,1,!0,n,s??null,c,f,U,m,w,T,t0),n.context=G1(null),s=n.current,c=ai(),c=ss(c),f=Ka(c),f.callback=null,Va(s,f,c),s=c,n.current.lanes=s,Nr(n,s),Qi(n),t[Ie]=n.current,$p(t),new yu(n)},uo.version="19.3.1",uo}var f0;function Q_(){if(f0)return mm.exports;f0=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(),mm.exports=Z_(),mm.exports}var W_=Q_();const J_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,r)=>r?r.toUpperCase():a.toLowerCase()),p0=e=>{const i=e2(e);return i.charAt(0).toUpperCase()+i.slice(1)},mw=(...e)=>e.filter((i,a,r)=>!!i&&i.trim()!==""&&r.indexOf(i)===a).join(" ").trim(),t2=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};var n2={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 i2=I.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:u,iconNode:d,...p},g)=>I.createElement("svg",{ref:g,...n2,width:i,height:i,stroke:e,strokeWidth:r?Number(a)*24/Number(i):a,className:mw("lucide",o),...!u&&!t2(p)&&{"aria-hidden":"true"},...p},[...d.map(([x,b])=>I.createElement(x,b)),...Array.isArray(u)?u:[u]]));const ge=(e,i)=>{const a=I.forwardRef(({className:r,...o},u)=>I.createElement(i2,{ref:u,iconNode:i,className:mw(`lucide-${J_(p0(e))}`,`lucide-${e}`,r),...o}));return a.displayName=p0(e),a};const a2=[["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"}]],r2=ge("activity",a2);const s2=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],hw=ge("arrow-down-to-line",s2);const l2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],o2=ge("arrow-left",l2);const c2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],hd=ge("arrow-right",c2);const u2=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],d2=ge("arrow-up-right",u2);const f2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],p2=ge("arrow-up",f2);const m2=[["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"}]],h2=ge("bot",m2);const g2=[["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"}]],m0=ge("brain",g2);const x2=[["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"}]],b2=ge("bug",x2);const y2=[["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"}]],v2=ge("building-2",y2);const w2=[["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"}]],k2=ge("calendar-days",w2);const N2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sn=ge("check",N2);const E2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bo=ge("chevron-down",E2);const S2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_2=ge("chevron-left",S2);const T2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gw=ge("chevron-right",T2);const C2=[["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"}]],gd=ge("circle-alert",C2);const j2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],A2=ge("circle-check",j2);const O2=[["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"}]],M2=ge("circle-x",O2);const R2=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],D2=ge("clock-3",R2);const z2=[["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"}]],L2=ge("cloud-upload",z2);const I2=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],uh=ge("cloud",I2);const U2=[["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"}]],B2=ge("coins",U2);const $2=[["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"}]],xd=ge("copy",$2);const P2=[["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"}]],Yu=ge("cpu",P2);const H2=[["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"}]],ng=ge("download",H2);const F2=[["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"}]],dl=ge("earth",F2);const q2=[["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"}]],G2=ge("ellipsis",q2);const Y2=[["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"}]],ig=ge("external-link",Y2);const K2=[["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"}]],V2=ge("eye-off",K2);const X2=[["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"}]],ag=ge("eye",X2);const Z2=[["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"}]],h0=ge("file-json",Z2);const Q2=[["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"}]],g0=ge("file-pen-line",Q2);const W2=[["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"}]],xw=ge("file-plus-2",W2);const J2=[["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"}]],eT=ge("file-search",J2);const tT=[["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"}]],ns=ge("file-text",tT);const nT=[["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"}]],iT=ge("file-up",nT);const aT=[["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"}]],gr=ge("folder-open",aT);const rT=[["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"}]],sT=ge("folder-plus",rT);const lT=[["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"}]],bw=ge("folder-tree",lT);const oT=[["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"}]],cT=ge("folder-up",oT);const uT=[["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"}]],Ku=ge("folder",uT);const dT=[["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"}]],fT=ge("gamepad-2",dT);const pT=[["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"}]],rg=ge("git-branch",pT);const mT=[["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"}]],hT=ge("globe",mT);const gT=[["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"}]],yw=ge("hammer",gT);const xT=[["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"}]],bd=ge("hard-drive",xT);const bT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],sg=ge("info",bT);const yT=[["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"}]],$o=ge("key-round",yT);const vT=[["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"}]],wT=ge("layout-template",vT);const kT=[["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"}]],lg=ge("link-2",kT);const NT=[["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"}]],vw=ge("list-checks",NT);const ET=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],og=ge("loader-circle",ET);const ST=[["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"}]],yd=ge("lock-keyhole",ST);const _T=[["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"}]],TT=ge("log-out",_T);const CT=[["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"}]],jT=ge("maximize-2",CT);const AT=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],OT=ge("menu",AT);const MT=[["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"}]],cg=ge("message-square",MT);const RT=[["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"}]],DT=ge("messages-square",RT);const zT=[["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"}]],ug=ge("monitor",zT);const LT=[["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"}]],dg=ge("moon",LT);const IT=[["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"}]],UT=ge("package-open",IT);const BT=[["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"}]],vd=ge("package",BT);const $T=[["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"}]],ww=ge("palette",$T);const PT=[["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"}]],HT=ge("panel-left-close",PT);const FT=[["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"}]],qT=ge("panel-left-open",FT);const GT=[["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"}]],YT=ge("paperclip",GT);const KT=[["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"}]],Po=ge("pencil",KT);const VT=[["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"}]],XT=ge("play",VT);const ZT=[["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"}]],wd=ge("plug",ZT);const QT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],br=ge("plus",QT);const WT=[["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"}]],JT=ge("radio",WT);const eC=[["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"}]],Li=ge("refresh-cw",eC);const tC=[["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"}]],Qr=ge("rocket",tC);const nC=[["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"}]],kw=ge("rotate-ccw",nC);const iC=[["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"}]],Nw=ge("rotate-cw",iC);const aC=[["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"}]],rC=ge("save",aC);const sC=[["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"}]],lC=ge("scan-search",sC);const oC=[["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"}]],cC=ge("scroll-text",oC);const uC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],is=ge("search",uC);const dC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ew=ge("settings",dC);const fC=[["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"}]],Sw=ge("settings-2",fC);const pC=[["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"}]],mC=ge("shield-alert",pC);const hC=[["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"}]],Wr=ge("shield-check",hC);const gC=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],xC=ge("slash",gC);const bC=[["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"}]],yC=ge("sliders-horizontal",bC);const vC=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],wC=ge("smartphone",vC);const kC=[["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=ge("sparkles",kC);const NC=[["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"}]],_w=ge("square-terminal",NC);const EC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],fg=ge("square",EC);const SC=[["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"}]],pg=ge("sun",SC);const _C=[["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"}]],TC=ge("tablet",_C);const CC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],mg=ge("terminal",CC);const jC=[["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"}]],aa=ge("trash-2",jC);const AC=[["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"}]],Lu=ge("triangle-alert",AC);const OC=[["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"}]],MC=ge("triangle",OC);const RC=[["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"}]],DC=ge("unplug",RC);const zC=[["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"}]],Tw=ge("upload",zC);const LC=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],IC=ge("user-round",LC);const UC=[["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"}]],Oo=ge("wrench",UC);const BC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bi=ge("x",BC);const $C=[["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"}]],PC=ge("zap",$C),x0=e=>{let i;const a=new Set,r=(x,b)=>{const h=typeof x=="function"?x(i):x;if(!Object.is(h,i)){const v=i;i=b??(typeof h!="object"||h===null)?h:Object.assign({},i,h),a.forEach(y=>y(i,v))}},o=()=>i,p={setState:r,getState:o,getInitialState:()=>g,subscribe:x=>(a.add(x),()=>a.delete(x))},g=i=e(r,o,p);return p},HC=(e=>e?x0(e):x0),FC=e=>e;function qC(e,i=FC){const a=pm.useSyncExternalStore(e.subscribe,pm.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return pm.useDebugValue(a),a}const GC=e=>{const i=HC(e),a=r=>qC(i,r);return Object.assign(a,i),a},Oa=(e=>GC);class Jr extends Error{status;code;constructor(i,a=0,r="daemon_error"){super(i),this.name="DaemonError",this.status=a,this.code=r}}let Ho="",fo=null;function YC(){return Ho}async function kd(e){const i=await e.text().catch(()=>"");if(i)try{const a=JSON.parse(i);if(a.error?.message)return new Jr(a.error.message,a.error.status??e.status,a.error.code??"daemon_error")}catch{}return new Jr(i.trim().slice(0,400)||`The local daemon returned ${e.status}.`,e.status,"daemon_error")}async function sl(e=!1){return fo&&!e||(fo=(async()=>{let i;try{i=await fetch("/api/session",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin"})}catch{throw new Jr("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 kd(i);const a=await i.json();Ho=typeof a.csrf=="string"?a.csrf:""})().catch(i=>{throw fo=null,i})),fo}async function Xe(e,i={},a=!0){await sl();const r=(i.method??"GET").toUpperCase(),o=new Headers(i.headers);i.body&&!o.has("Content-Type")&&o.set("Content-Type","application/json"),["GET","HEAD"].includes(r)||o.set("x-maxcode-csrf",Ho);let u;try{u=await fetch(e,{...i,method:r,headers:o,credentials:"same-origin"})}catch{throw new Jr("Lost the connection to the local daemon. Check that it is still running.",0,"daemon_unreachable")}if(u.status===401&&a)return await sl(!0),Xe(e,i,!1);if(!u.ok)throw await kd(u);return u.status===204?void 0:(u.headers.get("content-type")??"").includes("application/json")?await u.json():await u.text()}function yr(e){return{method:"POST",body:JSON.stringify(e)}}function KC(){return Xe("/api/state")}function Cw(){return Xe("/api/plugins")}function VC(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 jw(e){const i=await Xe(`/api/plugins/${encodeURIComponent(e)}/package`);return VC(i.archive)}function XC(e){let i="";for(let a=0;a<e.length;a+=32768)i+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(i)}function Aw(e){return Xe("/api/plugins",{method:"POST",body:JSON.stringify({archive:XC(e)})})}function ZC(e,i){return Xe(`/api/plugins/${encodeURIComponent(e)}/grants`,{method:"PUT",body:JSON.stringify(i)})}function b0(e,i){return Xe(`/api/plugins/${encodeURIComponent(e)}/safe`,{method:"PUT",body:JSON.stringify({safe:i})})}function QC(e,i){return Xe(`/api/plugins/${encodeURIComponent(e)}/enabled`,{method:"PUT",body:JSON.stringify({enabled:i})})}function WC(e){return Xe(`/api/plugins/${encodeURIComponent(e)}`,{method:"DELETE"})}function JC(e,i){return Xe(`/api/plugins/${encodeURIComponent(e)}/network`,{method:"POST",body:JSON.stringify(i)})}function ej(e){return Xe("/api/settings",{method:"PATCH",body:JSON.stringify(e)})}function Ow(e){return Xe("/api/chats",{method:"PUT",body:JSON.stringify(e)})}function tj(e){return Xe("/api/migrate",yr(e))}function nj(){return Xe("/api/providers")}function ij(e){return Xe(`/api/models?provider=${encodeURIComponent(e)}`)}function aj(e,i){return i?Xe(`/api/providers/${e}/key`,{method:"PUT",body:JSON.stringify({apiKey:i})}):Xe(`/api/providers/${e}/key`,{method:"DELETE"})}function rj(e){return Xe("/api/search/key",{method:"PUT",body:JSON.stringify({apiKey:e})})}function sj(e,i){return Xe(`/api/deploy/credentials/${e}`,{method:"PUT",body:JSON.stringify(i)})}function lj(e){return Xe("/api/reset",yr({scope:e}))}function oj(e){return Xe("/api/workspaces",yr({path:e}))}function cj(){return Xe("/api/workspaces",{method:"DELETE"})}function uj(e){return Xe(`/api/workspaces?path=${encodeURIComponent(e)}`,{method:"DELETE"})}function dj(){return Xe("/api/mcp")}function fj(e){return Xe("/api/mcp",{method:"PUT",body:JSON.stringify({servers:e})})}function pj(e,i){return Xe(`/api/mcp/${encodeURIComponent(e)}/${i}`,{method:"POST",body:"{}"})}function mj(e){return Xe(`/api/mcp/${encodeURIComponent(e)}/authorize`,{method:"POST",body:"{}"})}function hj(e){return Xe(`/api/mcp/${encodeURIComponent(e)}/logout`,{method:"POST",body:"{}"})}function gj(e,i,a,r){return Xe("/api/mcp/call",{method:"POST",body:JSON.stringify({server:e,tool:i,args:a}),signal:r})}function xj(e){return Xe(`/api/workspaces/browse?path=${encodeURIComponent(e)}`)}function Mw(e="",i=6){return Xe(`/api/workspace/tree?depth=${i}&path=${encodeURIComponent(e)}`)}function dh(e){return Xe(`/api/workspace/file?path=${encodeURIComponent(e)}`)}function fh(e,i){return Xe("/api/workspace/file",{method:"PUT",body:JSON.stringify({path:e,content:i})})}function bj(e,i){return Xe("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"create",path:e,type:i})})}function yj(e,i){return Xe("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"rename",from:e,to:i})})}function vj(e){return Xe("/api/workspace/file",{method:"POST",body:JSON.stringify({action:"delete",path:e})})}function wj(){return Xe("/api/git")}function Di(e,i,a,r,o){return Xe("/api/tools/execute",{...yr({name:e,args:i,mode:a,checkpoint:o}),signal:r})}function kj(){return Xe("/api/preview/token")}function Nj(){return Xe("/api/workspace/instructions")}function Ej(e){return Xe(`/api/checkpoints/${encodeURIComponent(e)}/restore`,{method:"POST",body:JSON.stringify({})})}async function Fo(e,i,a,r,o,u=!0){await sl();let d;try{d=await fetch("/api/llm",{method:"POST",headers:{"Content-Type":"application/json","x-maxcode-csrf":Ho},body:JSON.stringify({provider:e,kind:i,model:a,body:r}),signal:o,credentials:"same-origin"})}catch(p){throw p instanceof DOMException&&p.name==="AbortError"?p:new Jr("Lost the connection to the local daemon while calling the model.",0,"daemon_unreachable")}if(d.status===401&&u)return await sl(!0),Fo(e,i,a,r,o,!1);if(!d.ok)throw await kd(d);return d}async function*Sj(e,i){await sl();let a;try{a=await fetch("/api/deploy",{method:"POST",headers:{"Content-Type":"application/json","x-maxcode-csrf":Ho},body:JSON.stringify(e),signal:i,credentials:"same-origin"})}catch(d){throw d instanceof DOMException&&d.name==="AbortError"?d:new Jr("Lost the connection to the local daemon while deploying.",0,"daemon_unreachable")}if(!a.ok)throw await kd(a);if(!a.body)throw new Jr("The deploy stream was empty.",502,"empty_stream");const r=a.body.getReader(),o=new TextDecoder;let u="";try{for(;;){const{done:p,value:g}=await r.read();if(p)break;u+=o.decode(g,{stream:!0});let x=u.indexOf(`
10
+ `);for(;x!==-1;){const b=u.slice(0,x).trim();if(u=u.slice(x+1),b)try{yield JSON.parse(b)}catch{yield{type:"log",stream:"meta",text:b}}x=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 _j(){return Xe("/api/skills")}function Tj(e){return Xe("/api/skills/upload",yr({files:e}))}function Cj(e){return Xe("/api/skills/npm",yr({spec:e}))}function jj(e,i){return Xe(`/api/skills/${encodeURIComponent(e)}/enabled`,{method:"PUT",body:JSON.stringify({enabled:i})})}function Aj(e){return Xe(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})}function Oj(e,i){return Xe("/api/skills/read",yr({name:e,file:i}))}async function Mj(e){return(await Xe("/api/deploy/detect",yr({path:e}))).project}const wi=Oa()(e=>({compacting:{},setCompacting:(i,a)=>e(r=>{if(!!r.compacting[i]===a)return r;const o={...r.compacting};return a?o[i]=!0:delete o[i],{compacting:o}}),titling:{},setTitling:(i,a)=>e(r=>{if(!!r.titling[i]===a)return r;const o={...r.titling};return a?o[i]=!0:delete o[i],{titling:o}}),streaming:{},setStreaming:(i,a)=>e(r=>{if(!!r.streaming[i]===a)return r;const o={...r.streaming};return a?o[i]=!0:delete o[i],{streaming:o}})}));function Rj(){try{return localStorage.getItem("maxcode.sidebar-collapsed")==="1"}catch{return!1}}function Dj(e){try{localStorage.setItem("maxcode.sidebar-collapsed",e?"1":"0")}catch{}}const me=Oa()((e,i)=>({sidebarCollapsed:Rj(),toggleSidebar:()=>e(a=>{const r=!a.sidebarCollapsed;return Dj(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 zj={root:"",name:"",available:!1,error:"",workspaces:[]},po={available:!1,root:"",branch:"",entries:[],error:""};function y0(e,i){return!!(e&&(e===i||e.startsWith(`${i}/`)))}const qe=Oa()((e,i)=>({info:zj,root:"",entries:[],truncated:!1,loadingTree:!1,treeError:"",activeFile:null,file:null,content:"",dirty:!1,saving:!1,openingFile:!1,git:po,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:po}),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 Nj()})}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 Mw("",7);e({entries:r.entries,truncated:r.truncated,loadingTree:!1,root:r.root,info:r.workspace}),i().loadInstructions()}catch(r){e({loadingTree:!1,treeError:r instanceof Error?r.message:"Could not read the workspace."})}},refresh:async({treeOnly:a=!1}={})=>{if(await i().loadTree(),a)return;const r=i().activeFile;if(!r||i().dirty)return;if(!i().entries.some(u=>u.path===r&&u.type==="file")){e({activeFile:null,file:null,content:"",dirty:!1});return}try{await i().openFile(r,{force:!0})}catch{}},openFile:async(a,{force:r=!1}={})=>{if(!(!a||i().openingFile)&&!(!r&&i().activeFile===a&&i().file)&&!(i().dirty&&!await i().saveFile())){e({openingFile:!0,treeError:""});try{const o=await dh(a);e({activeFile:a,file:o,content:o.content,dirty:!1,openingFile:!1})}catch(o){e({openingFile:!1,treeError:o instanceof Error?o.message:"Could not open that file."}),me.getState().notify(o instanceof Error?o.message:"Could not open that file.","error")}}},closeFile:()=>e({activeFile:null,file:null,content:"",dirty:!1}),setContent:a=>{i().file?.binary||a!==i().content&&e({content:a,dirty:!0})},saveFile:async()=>{const{activeFile:a,content:r,dirty:o,file:u,saving:d}=i();if(!a||!o||d||u?.binary)return!0;e({saving:!0});try{const p=await fh(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 bj(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 yj(a,r),await i().loadTree(),y0(i().activeFile,a)){const o=i().activeFile===a?r:`${r}${i().activeFile?.slice(a.length)??""}`;e({activeFile:null,file:null,content:"",dirty:!1}),await i().openFile(o)}me.getState().notify(`Renamed to ${r}`,"success")},deleteEntry:async a=>{await vj(a),y0(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 oj(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 cj();e({info:a,root:"",entries:[],activeFile:null,file:null,content:"",dirty:!1,git:po,instructions:{file:"",content:"",truncated:!1}})},removeWorkspace:async a=>{const r=i().info.root===a;if(r&&i().dirty&&!await i().saveFile())return;const o=await uj(a);if(!r){e({info:o});return}e({info:o,root:"",entries:[],activeFile:null,file:null,content:"",dirty:!1,git:po,instructions:{file:"",content:"",truncated:!1}})},loadGit:async()=>{if(i().info.available){e({gitLoading:!0});try{const a=await wj();e({git:{...a},gitLoading:!1})}catch(a){e({git:{...po,error:a instanceof Error?a.message:"Git status failed."},gitLoading:!1})}}},setActiveFile:a=>{a?i().openFile(a):i().closeFile()}}));function In(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 Rw(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 Dw(e){let i=0;const a=e.messages.filter(r=>!!(r&&typeof r=="object")).map((r,o)=>{if(r.role==="user")return o>0&&(i+=1),r;const u=typeof r.round=="number"?r.round:i;return r.role==="assistant"?{...r,content:typeof r.content=="string"?r.content:"",reasoning:typeof r.reasoning=="string"?r.reasoning:"",toolCalls:Array.isArray(r.toolCalls)?r.toolCalls:[],round:u}:{...r,round:u}});return{...e,title:e.title.trim()||"New conversation",messages:a,createdAt:typeof e.createdAt=="number"?e.createdAt:Date.now(),updatedAt:typeof e.updatedAt=="number"?e.updatedAt:Date.now(),mode:e.mode==="plan"?"plan":e.mode==="build"?"build":void 0,workspace:typeof e.workspace=="string"?e.workspace:void 0,titleSource:e.titleSource==="ai"||e.titleSource==="user"||e.titleSource==="auto"?e.titleSource:void 0}}function Lj(e){const i=e.replace(/\s+/g," ").trim();return i?i.length>56?`${i.slice(0,56).trim()}…`:i:"New conversation"}const Je=Oa()((e,i)=>({sessions:[],activeId:null,hydrated:!1,hydrate:a=>{const r=(a.sessions??[]).filter(Rw).map(Dw).sort((u,d)=>d.updatedAt-u.updatedAt),o=typeof a.activeId=="string"&&r.some(u=>u.id===a.activeId)?a.activeId:r[0]?.id??null;e({sessions:r,activeId:o,hydrated:!0})},setActive:a=>e({activeId:a}),newChat:()=>e({activeId:null}),createSession:(a,r,o)=>{const u=In("chat"),d=Date.now(),p={id:u,title:"New conversation",createdAt:d,updatedAt:d,messages:[],provider:a,model:r,mode:o,workspace:qe.getState().info.root||void 0,titleSource:"auto"};return e(g=>({sessions:[p,...g.sessions],activeId:u})),u},addMessage:(a,r)=>{e(o=>({sessions:o.sessions.map(u=>{if(u.id!==a)return u;const d={messages:[...u.messages,r],updatedAt:Date.now()};return r.role==="user"&&u.messages.length===0&&(d.title=Lj(r.content)),{...u,...d}})}))},updateMessage:(a,r,o)=>{e(u=>({sessions:u.sessions.map(d=>{if(d.id!==a)return d;let p=!1;const g=d.messages.map(x=>{if(x.id!==r)return x;const b=typeof o=="function"?o(x):o;return!b||Object.keys(b).length===0?x:(p=!0,{...x,...b})});return p?{...d,messages:g,updatedAt:Date.now()}:d})}))},updateSession:(a,r)=>{e(o=>({sessions:o.sessions.map(u=>u.id===a?{...u,...r,updatedAt:Date.now()}:u)}))},renameSession:(a,r)=>{const o=r.trim();o&&i().updateSession(a,{title:o,titleSource:"user"})},deleteSession:a=>{e(r=>{const o=r.sessions.filter(u=>u.id!==a);return{sessions:o,activeId:r.activeId===a?o[0]?.id??null:r.activeId}})},clearAll:()=>e({sessions:[],activeId:null}),persistNow:async()=>{const{sessions:a,activeId:r}=i();await Ow({sessions:a,activeId:r})}}));let Nd=!1,Xr,il;function Ij(){Nd=!0}function Uj(){!Nd||typeof window>"u"||(Xr!==void 0&&window.clearTimeout(Xr),Xr=window.setTimeout(()=>{Xr=void 0,v0()},900),il===void 0&&(il=window.setTimeout(()=>{il=void 0,v0()},6e3)))}async function v0(){if(!Nd)return;Xr!==void 0&&(window.clearTimeout(Xr),Xr=void 0),il!==void 0&&(window.clearTimeout(il),il=void 0);const{sessions:e,activeId:i}=Je.getState();try{await Ow({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"}}))}}Je.subscribe(Uj);if(typeof window<"u"){const e=()=>{if(!Nd)return;const{sessions:i,activeId:a}=Je.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":YC()},body:r}).catch(()=>{})}catch{}};window.addEventListener("beforeunload",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()})}function zw(){const e=Je.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 Bj(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(Rw).map(Dw);if(r.length===0)throw new Error("No valid conversations were found in this file.");const o=new Set(Je.getState().sessions.map(d=>d.id)),u=r.filter(d=>!o.has(d.id));return Je.setState(d=>({sessions:[...u,...d.sessions],activeId:u[0]?.id??d.activeId})),u.length})}const Vu=[{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."}],na=Object.fromEntries(Vu.map(e=>[e.id,e]));function hg(e){return na[e]?.name??e}const w0=["none","minimal","low","medium","high","xhigh","max"],Mo={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 Ro(e){return Mo[e]?.label??e}function vr(e){return e?.reasoningOptions.find(a=>a.type==="effort")?.values??[]}function Lw(e){return e?.reasoningOptions.find(i=>i.type==="budget_tokens")}function Xu(e){return!!Lw(e)}function Iw(e){return!!e?.reasoningOptions.some(i=>i.type==="toggle")}function Uw(e){const i=vr(e);if(i.length===0)return"medium";for(const a of["medium","high","low"])if(i.includes(a))return a;return i[0]}function ll(e,i){const a=vr(i);return a.length===0||a.includes(e)?e:Uw(i)}function $j(e,i){const a=Lw(i),r=Math.max(0,a?.min??1024),o=Math.max(r,a?.max??32768);return Math.max(r,Math.min(o,e))}const Pj={none:1024,minimal:1024,low:2048,medium:8192,high:16384,xhigh:24576,max:32768};function Bw(e,i){return $j(Pj[e]??8192,i)}function Do(e){return[...vr(e)].sort((a,r)=>w0.indexOf(a)-w0.indexOf(r))}function ph(e){if(!e)return"Choose a model to see live reasoning controls.";const i=vr(e);return i.length>0?`Effort levels from this model: ${i.join(", ")}.`:Xu(e)?"This model accepts a thinking token budget, derived from the effort level.":Iw(e)?"This model controls reasoning itself; no effort value is sent.":"This model advertises no reasoning controls, so effort does not apply."}const $w=[{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}],Hj=/^[a-z0-9][a-z0-9:_-]{0,79}$/,gg=new Map($w.map(e=>[e.id,e]));function Pw(e){gg.set(e.id,e)}function Hw(e){$w.some(i=>i.id===e)||gg.delete(e)}function Fw(e){return typeof e=="string"&&Hj.test(e)}function qw(e,i){return e==="system"?i?"dark":"light":Fw(e)?e:"light"}function mh(e,i){return gg.get(qw(e,i))?.dark??!1}function Fj(e){return e==="system"?"system":Fw(e)?e:"system"}const Zu=`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.`,hh={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"}},Ca={provider:"openai",model:"",effort:"medium",webSearchEnabled:!0,temperature:.4,maxTokens:8192,systemPrompt:Zu,workspacePrompts:{},providers:{},searchProvider:"duckduckgo",tools:hh,theme:"system",showTokenEstimate:!0,mode:"build",chatFontSize:15,workDetail:"detailed",autoCollapseWork:!0,aiSessionTitles:!0,showMascot:!1},qj=new Set(["none","minimal","low","medium","high","xhigh","max"]);function Gw(e,i="error"){typeof window>"u"||window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:e,tone:i}}))}function Gj(e){const i={};for(const a of Object.keys(hh))i[a]={...hh[a],...e?.[a]??{}};return i}function Yj(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)?Zu:e}function Kj(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 Vj(e){const i={};for(const[a,r]of Object.entries(e??{}))!(a in na)||!r||typeof r!="object"||typeof r.baseUrl=="string"&&r.baseUrl.trim()&&(i[a]={baseUrl:r.baseUrl.trim()});return i}function Xj(e){const i=e??{},a=typeof i.provider=="string"&&i.provider in na?i.provider:Ca.provider,r=i.mode==="plan"?"plan":i.mode==="build"?"build":Ca.mode;return{...Ca,...i,provider:a,model:typeof i.model=="string"?i.model.trim():"",mode:r,effort:typeof i.effort=="string"&&qj.has(i.effort)?i.effort:Ca.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)):Ca.temperature,maxTokens:typeof i.maxTokens=="number"&&Number.isFinite(i.maxTokens)?Math.max(256,Math.min(2e5,Math.round(i.maxTokens))):Ca.maxTokens,systemPrompt:Yj(i.systemPrompt),providers:Vj(i.providers),searchProvider:i.searchProvider&&["duckduckgo","tavily","brave","serper"].includes(i.searchProvider)?i.searchProvider:Ca.searchProvider,tools:Gj(i.tools),theme:Fj(i.theme),chatFontSize:typeof i.chatFontSize=="number"&&Number.isFinite(i.chatFontSize)?Math.max(12,Math.min(20,Math.round(i.chatFontSize))):Ca.chatFontSize,workDetail:i.workDetail==="concise"?"concise":"detailed",autoCollapseWork:i.autoCollapseWork!==!1,aiSessionTitles:i.aiSessionTitles!==!1,showMascot:i.showMascot===!0,workspacePrompts:Kj(i.workspacePrompts)}}let xg=!1,al={},rl,No;function Yw(e){const i={},a=["provider","model","effort","webSearchEnabled","temperature","maxTokens","systemPrompt","providers","searchProvider","tools","theme","showTokenEstimate","mode","chatFontSize","workDetail","autoCollapseWork","aiSessionTitles","showMascot","workspacePrompts"];for(const r of a)r in e&&(i[r]=e[r]);return i}function gh(){if(!xg||Object.keys(al).length===0)return Promise.resolve();const e=Yw(al);return al={},rl!==void 0&&window.clearTimeout(rl),No!==void 0&&window.clearTimeout(No),rl=void 0,No=void 0,ej(e).then(()=>{}).catch(i=>{Gw(i instanceof Error?i.message:"Could not save settings to the local daemon.")})}function Qs(e){xg&&(al={...al,...Yw(e)},rl!==void 0&&window.clearTimeout(rl),rl=window.setTimeout(()=>{gh()},550),No===void 0&&(No=window.setTimeout(()=>{gh()},4e3)))}function Zj(){xg=!0,Object.keys(al).length>0&&Qs({})}const Ae=Oa()((e,i)=>({...Ca,hydrated:!1,daemon:null,secretStatus:null,providerStatus:[],deployTools:null,deploySecrets:null,secretsError:"",hydrate:a=>{const r=Xj(a.settings),o=a.providers,u=o.filter(d=>d.configured);!xh(r,o,r.provider)&&u.length>0&&(r.provider=u[0].id,r.model=""),xh(r,o,r.provider)||(r.model=""),e({...r,hydrated:!0,daemon:a,secretStatus:a.secrets,providerStatus:o,deployTools:a.deployTools,deploySecrets:a.deploySecrets,secretsError:a.secretsError})},update:a=>{e(a),Qs(a)},selectModel:(a,r,o)=>{const u=o??i().effort,d={provider:a,model:r.trim(),effort:u};e(d),Qs(d)},updateProvider:(a,r)=>{const o={providers:{...i().providers,[a]:{...i().providers[a]??{},...r}}};e(o),Qs(o)},saveProviderKey:async(a,r)=>{const o=await aj(a,r.trim()),u=Ed(i(),a);e(d=>{const p=d.secretStatus?{...d.secretStatus,providers:{...d.secretStatus.providers,[a]:{configured:o.configured,hint:o.hint}}}:d.secretStatus,g=d.providerStatus.map(v=>v.id===a?{...v,configured:o.configured,hint:o.hint}:v),x=o.configured?!ol(d)||d.provider===a:!1,b=d.provider===a&&!o.configured,h={};return x&&(h.provider=a),b&&(h.model=""),{secretStatus:p,providerStatus:g,...h}}),!u&&o.configured&&Gw(`${na[a]?.name??a} is connected.`,"success")},saveSearchKey:async a=>{const r=await rj(a.trim());e(o=>({secretStatus:o.secretStatus?{...o.secretStatus,search:{configured:r.configured,hint:r.hint}}:o.secretStatus}))},saveDeployCredentials:async(a,r)=>{const o=await sj(a,r);e(u=>({secretStatus:u.secretStatus?{...u.secretStatus,deploy:{...u.secretStatus.deploy,[a]:o}}:u.secretStatus,deploySecrets:u.deploySecrets?{...u.deploySecrets,[a]:o}:u.deploySecrets}))},refreshProviders:async()=>{const a=await nj();e({providerStatus:a.providers})},updateTool:(a,r)=>{const o={tools:{...i().tools,[a]:{...i().tools[a],...r}}};e(o),Qs(o)},setMode:a=>{const r={mode:a};e(r),Qs(r)},flush:()=>gh()}));function Xn(e){return e.model.trim()}function Ed(e,i){return xh(e,Ae.getState().providerStatus,i)}function xh(e,i,a){const r=na[a];if(!r)return!1;const o=i.find(u=>u.id===a);return o?o.configured:a==="custom"?!!e.providers.custom?.baseUrl?.trim():!!r.keyless}function ol(e){return Ed(e,e.provider)}typeof window<"u"&&(window.addEventListener("beforeunload",()=>{Ae.getState().flush()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ae.getState().flush()}));function Qu(e){return e==null}function Aa(e,i,a){return Object.defineProperty(e,i,{writable:!0,value:a,enumerable:!1})}function bh(e,i){return arguments.length===1?a=>bh(e,a):e in globalThis&&i instanceof globalThis[e]||Object.prototype.toString.call(i).slice(8,-1)===e}function Kw(e){return bh("ArrayBuffer",e)||bh("SharedArrayBuffer",e)}function Qj(e){return Kw(e)||ArrayBuffer.isView(e)}var cl;(e=>{e.is=Kw,e.isSource=Qj;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 g=new Uint8Array(d);for(let x=0;x<g.byteLength;x++)p+=String.fromCharCode(g[x]);return btoa(p)}e.toBase64=a;function r(d){return typeof Buffer<"u"?i(Buffer.from(d,"base64")):Uint8Array.from(atob(d),p=>p.charCodeAt(0))}e.fromBase64=r;function o(d){return d=i(d),typeof Buffer<"u"?Buffer.from(d).toString("hex"):Array.from(new Uint8Array(d),p=>p.toString(16).padStart(2,"0")).join("")}e.toHex=o;function u(d){if(typeof Buffer<"u")return i(Buffer.from(d,"hex"));const p=d.length%2===0?d:d.slice(0,d.length-1),g=[];for(let x=0;x<p.length;x+=2)g.push(parseInt(`${p[x]}${p[x+1]}`,16));return Uint8Array.from(g).buffer}e.fromHex=u})(cl||(cl={}));cl.fromBase64;cl.toBase64;cl.fromHex;cl.toHex;function Wj(e,i,a){const r=[];let o=0;for(let u=0;u<e.length;u++){const d=e.charCodeAt(u);if(d>=65&&d<=90){if(o===1){const p=e.charCodeAt(u+1);p>=97&&p<=122&&r.push(a),r.push(d+32)}else o!==0&&r.push(a),r.push(d+32);o=1}else d>=97&&d<=122?(r.push(d),o=2):i.includes(d)?(o!==0&&r.push(a),o=0):r.push(d)}return String.fromCharCode(...r)}function Jj(e){return Wj(e,[45,95],45)}var eA=Jj,k0;(e=>{e.millisecond=1,e.second=1e3,e.minute=e.second*60,e.hour=e.minute*60,e.day=e.hour*24,e.week=e.day*7;let i=new Date().getTimezoneOffset();function a(y){i=y}e.setTimezoneOffset=a;function r(){return i}e.getTimezoneOffset=r;function o(y=new Date,k){return typeof y=="number"&&(y=new Date(y)),k===void 0&&(k=i),Math.floor((y.valueOf()/e.minute-k)/1440)}e.getDateNumber=o;function u(y,k){const 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 g(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=g;function x(y){const k=g(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=x;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 h(y,k=2){return y.toString().padStart(k,"0")}e.toDigits=h;function v(y,k=new Date){return y.replace("yyyy",k.getFullYear().toString()).replace("yy",k.getFullYear().toString().slice(2)).replace("MM",h(k.getMonth()+1)).replace("dd",h(k.getDate())).replace("hh",h(k.getHours())).replace("mm",h(k.getMinutes())).replace("ss",h(k.getSeconds())).replace("SSS",h(k.getMilliseconds(),3))}e.template=v})(k0||(k0={}));var tA=Object.defineProperty,De=(e,i)=>tA(e,"name",{value:i,configurable:!0}),bg=class{static{De(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]}},we={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")},nA=function*(){}.constructor,N0=async function*(){}.constructor;function Vw(e){return!(!e.prototype||e instanceof nA||N0!==Function&&e instanceof N0)}De(Vw,"isConstructor");function Sd(e,i){if(e===Object.prototype)return i;const a=Object.create(Sd(Object.getPrototypeOf(e),i));for(const r of Reflect.ownKeys(e))Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(e,r));return a}De(Sd,"joinPrototype");function zo(e){return e&&(typeof e=="object"||typeof e=="function")}De(zo,"isObject");function yg(e,i){let a=e;for(;a;){const r=Reflect.getOwnPropertyDescriptor(a,i);if(r)return r;a=Object.getPrototypeOf(a)}}De(yg,"getPropertyDescriptor");function hr(e,i){if(!zo(i))return i;if(Object.hasOwn(i,we.shadow))return Object.getPrototypeOf(i);const a=i[we.tracker];return a?_d(e,i,a):i}De(hr,"getTraceable");function Lo(e,i){return i?new Proxy(e,{get:De((a,r,o)=>r in i&&r!=="constructor"?Reflect.get(i,r,o):Reflect.get(a,r,o),"get"),set:De((a,r,o,u)=>r in i&&r!=="constructor"?Reflect.set(i,r,o,u):Reflect.set(a,r,o,u),"set")}):e}De(Lo,"withProps");function Wu(e,i,a){return Lo(e,Object.defineProperty(Object.create(null),i,{value:a,writable:!1}))}De(Wu,"withProp");function wo(e,i,a,r){if(!a)return r;const o=yg(i,a)?.value;if(!o)return r;const u=o[we.shadow]??o;return Wu(r,a,e.extend({[we.shadow]:u}))}De(wo,"createShadow");function Xw(e,i,a,r){return new Proxy(i,{apply:De((o,u,d)=>(u===a&&(u=r),hr(e,Reflect.apply(o,u,d))),"apply")})}De(Xw,"createShadowMethod");function _d(e,i,a){const r=e[we.shadow]??e,o=e[we.shadow]?Object.getPrototypeOf(e):e,u=new Proxy(i,{get:De((d,p,g)=>{if(p===we.original)return d;if(p===we.caller)return r;if(p===a.property)return o;if(typeof p=="symbol")return Reflect.get(d,p,g);if(a.associate&&o.reflect.props[`${a.associate}.${p}`])return Reflect.get(e,`${a.associate}.${p}`,Wu(e,we.receiver,g));let x,b;const h=yg(d,p);h&&"value"in h?b=h.value:(x=wo(o,d,a.property,g),b=Reflect.get(d,p,x));const v=b?.[we.tracker];return v?_d(o,b,v):!a.noShadow&&typeof b=="function"?(x??=wo(o,d,a.property,g),Xw(o,b,g,x)):b},"get"),set:De((d,p,g,x)=>{if(p===we.original||p===we.caller||p===a.property)return!1;if(typeof p=="symbol")return Reflect.set(d,p,g,x);if(a.associate&&o.reflect.props[`${a.associate}.${p}`])return Reflect.set(e,`${a.associate}.${p}`,g,Wu(e,we.receiver,x));const b=wo(o,d,a.property,x);return Reflect.set(d,p,g,b)},"set"),apply:De((d,p,g)=>{const x=a.noShadow?u:wo(o,d,a.property,u);return Zw(x,d,p,g)},"apply")});return u}De(_d,"createTraceable");function Zw(e,i,a,r){return i[we.invoke]?i[we.invoke].apply(e,r):Reflect.apply(i,a,r)}De(Zw,"applyTraceable");function Ju(e,i,a){const r=De(function(...o){const u=_d(r.ctx,r,a);return Reflect.apply(u,this,o)},"self");return Aa(r,"name",e),Object.setPrototypeOf(r,i)}De(Ju,"createCallable");function yh(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 o=i.stack.split(`
35
+ `);let u=o.indexOf(r[2]);if(u===-1)throw i;for(u-=e.offset;u>0&&o[u-1].endsWith(" (<anonymous>)");)u-=1;throw o.splice(u,1/0,...a()),i.stack=o.join(`
36
+ `),i}De(yh,"handleError");function vh(e,i=Td()){const a={offset:1,error:new Error};try{const r=e(a);return zo(r)&&"then"in r?r.then(void 0,o=>yh(a,o,i)):r}catch(r){yh(a,r,i)}}De(vh,"composeError");function Td(e=0){const i=new Error;return()=>i.stack.split(`
37
+ `).slice(3+e)}De(Td,"buildOuterStack");var Qw=Symbol.for("ValidationError"),Ww=class wh extends TypeError{constructor(i){super(`invalid config:
38
+ `+i.map(a=>a.path?.length?` - ${a.message} (at ${wh.formatPath(a.path)})`:` - ${a.message}`).join(`
39
+ `)),this.issues=i}issues;static{De(this,"ValidationError")}name="ValidationError";static is(i){return!!i?.[Qw]}static normalizePath(i=[]){return i.map(a=>typeof a=="object"?a.key:a)}static formatPath(i){return wh.normalizePath(i).map(String).join(".")}};Object.defineProperty(Ww.prototype,Qw,{value:!0});function Jw(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 Ww(a.issues);return a.value}De(Jw,"resolveConfig");var kh=class ek extends Error{constructor(i,a){super(a??ek.Code[i]),this.code=i}code;static{De(this,"CordisError")}};(e=>{e.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(kh||(kh={}));var _a="__INACTIVE__",tk=class{constructor(e,i,a,r,o){this.parent=e,this.config=i,this.inject=a,this.runtime=r;const u=De(d=>{this._disposables.push(d)},"collect");if(r){this.uid=e.registry.counter,this.ctx=this.context=e.extend({fiber:this}),this._runner={epoch:_a,getOuterStack:o,execute:De(function(){const d=this._resolve(this.config);if(Vw(r.callback)){const p=new r.callback(this.ctx,d);for(const g of p?.[we.initHooks]??[])g();return p?.[we.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(_a);this.inertia;)await this.inertia;this._updateState(()=>{})}},"ctx.plugin()")}else this.uid=0,this.ctx=this.context=e,this.state=2,this.committed=Object.create(null),this._runner={epoch:"0",getOuterStack:o,execute:De(()=>{},"execute"),collect:u},this.dispose=()=>this.restart()}parent;config;inject;runtime;static{De(this,"Fiber")}uid;ctx;state=0;dispose;committed;provisions=new Set;inertia;_hooks=Object.create(null);_disposables=new bg;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 kh("INACTIVE_EFFECT")}_resolve(e){return this.context.waterfall("internal/config",this,()=>e)}_execute(e){const i=e.epoch;return vh(a=>{const r=De(u=>{if(typeof u=="function")e.collect(u);else if(!Qu(u))throw new TypeError("Invalid effect")},"safeCollect"),o=e.execute.call(this);if(typeof o=="function")return e.collect(o);if(!Qu(o))if(zo(o)){if("then"in o)return o.then(r);if(Symbol.iterator in o){a.error=new Error;const u=o[Symbol.iterator]();for(;;){const d=u.next();if(r(d.value),d.done)return}}else if(Symbol.asyncIterator in o){const u=o[Symbol.asyncIterator]();return(async()=>{for(await Promise.resolve(),a.error=new Error;;){if(e.epoch!==i)return;const d=await u.next();if(r(d.value),d.done)return}})()}else throw new TypeError("Invalid effect")}else throw new TypeError("Invalid effect")},e.getOuterStack)}effect(e,i="anonymous"){this.assertActive();const a=[],r=De(()=>{let x;for(const b of a.splice(0).reverse())if(x)x=x.then(b);else{const h=b();zo(h)&&"then"in h&&(x=h)}return x},"dispose"),o={label:i,children:[]},u={execute:e,epoch:!0,collect:De(x=>{a.push(x),this._disposables.delete(x),x[we.effect]&&o.children.push(x[we.effect])},"collect"),getOuterStack:Td()};let d;try{d=this._execute(u)}catch(x){throw r(),x}d?.catch(r).catch(x=>this.ctx.logger.error(x));const p=Aa(()=>{if(u.epoch)return u.epoch=!1,d?d.then(r):r()},we.effect,o),g=De(()=>{if(u.epoch)return u.epoch=!1,r()},"disposeAsync");return p.then=async(x,b)=>Promise.resolve(d).then(()=>g).then(x,b),a.push(this._disposables.push(p)),p}getEffects(){return[...this._disposables].map(e=>e[we.effect]).filter(Boolean)}_getState(){return this.uid===null?4:this._error?3:this._runner.epoch!==_a?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(hr(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=_a;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!==_a&&i===_a?(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=_a)}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 vh(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===_a)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!==_a,o=r?a._resolve(e):void 0;i||a.context.emit("internal/commit",a,e),a.config=e,a._error=void 0;const u=De(()=>a.restart(),"restart"),d=r?a.context.waterfall(a,"internal/update",o,u):u();if(d===void 0)return;const p=Promise.resolve(d);return p.catch(()=>{}),p}};function Nh(e){return e!==null&&e!==!1&&e!==void 0}De(Nh,"isBailed");var iA=class{constructor(e){this.ctx=e,Aa(this,we.tracker,{property:"ctx",noShadow:!0}),this.on("internal/listener",function(i,a,r){if(i==="internal/update"&&!r.global){const o=this.fiber._hooks["internal/update"]??=new bg,u=r.prepend?"unshift":"push";return this.fiber.effect(()=>o[u](a),'ctx.on("internal/update")')}}),this.on("internal/update",function(i,a){const r=[...this._hooks["internal/update"]||[]],o=De(()=>(r.shift()??a).call(this,i,o),"_next");return o()},{global:!0,prepend:!0}),this.on("internal/config",(i,a)=>Jw(i.runtime,a()))}ctx;static{De(this,"EventsService")}_hooks=Object.create(null);_resolve(e,i){const a=typeof i[0]=="object"||typeof i[0]=="function"?i.shift():null,r=i.shift();(typeof r!="string"||!r.startsWith("internal/"))&&this._hooks["internal/dispatch"]?.length&&this.emit("internal/dispatch",e,r,i,a);const o=a?.[wg.filter],u=(this._hooks[r]||[]).filter(d=>d.global||!o||o.call(a,d.ctx)).map(d=>d.callback);return[a,u,r]}dispatch(e,i){const[a,r]=this._resolve(e,i);return r.map(o=>o.bind(a))}async parallel(...e){const[i,a,r]=this._resolve("parallel",e),u=(await Promise.allSettled(a.map(async p=>Reflect.apply(p,i,e)))).filter(p=>p.status==="rejected");if(!u.length)return;const d=typeof r=="symbol"?String(r):`"${r}"`;throw new AggregateError(u.map(p=>p.reason),`one or more listeners of event ${d} failed`)}emit(...e){const[i,a]=this._resolve("emit",e);for(const r of a)Reflect.apply(r,i,e)}async serial(...e){const[i,a]=this._resolve("serial",e);for(const r of a){const o=await Reflect.apply(r,i,e);if(Nh(o))return o}}bail(...e){const[i,a]=this._resolve("bail",e);for(const r of a){const o=Reflect.apply(r,i,e);if(Nh(o))return o}}waterfall(...e){const[i,a]=this._resolve("waterfall",e),r=e.pop(),o=De(()=>{const u=a.shift();if(!u)return r();let d=!1;const p=De(()=>{if(d)throw new Error("next() called multiple times");return d=!0,o()},"next");return Reflect.apply(u,i,[...e,p])},"dispatch");return o()}register(e,i,a,r){const o=r.prepend?"unshift":"push";return this.ctx.fiber.effect(()=>((this._hooks[i]??=[])[o]({ctx:this.ctx,callback:a,...r}),()=>this.unregister(i,a)),e)}unregister(e,i){const a=this._hooks[e];if(!a)return;const r=a.findIndex(o=>o.callback===i);if(r>=0)return a.splice(r,1),a.length||delete this._hooks[e],!0}on(e,i,a){typeof a!="object"&&(a={prepend:a}),this.ctx.fiber.assertActive(),i=this.ctx.reflect.bind(i);const r=this.bail(this.ctx,"internal/listener",e,i,a);if(r)return r;const o=`ctx.on(${typeof e=="string"?JSON.stringify(e):e.toString()})`;return this.register(o,e,i,a)}once(e,i,a){const r=this.on(e,function(...o){return r(),i.apply(this,o)},a);return r}};function Iu(e){const i=e.stack.split(`
40
+ `);return i.splice(0,2,`Error: ${e.message}`),e.stack=i.join(`
41
+ `),e}De(Iu,"enhanceError");var aA=["prototype","then"];function Uu(e){return typeof e=="symbol"||aA.includes(e)||parseInt(e).toString()===e||e.startsWith("_")}De(Uu,"isSpecialProperty");function vg(e,i){const a=e[we.isolate][i];let r=e[we.isolate],o=e.fiber;for(;;){let u;for(const d of o.provisions)d.name===i&&d.ctx[we.isolate][i]===a&&(u=d);if(u)return{impl:u};for(;r!==o.ctx[we.isolate];){if(!r||Object.hasOwn(r,i))return;r=Object.getPrototypeOf(r)}if(u=o.committed?.[i],u||i in o.inject)return{fiber:o,impl:u};if(!o.runtime)return;o=o.parent.fiber}}De(vg,"locate");var E0=class{constructor(e){this.ctx=e,Aa(this,we.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{De(this,"ReflectService")}static handler={get:De((e,i,a)=>{if(Uu(i))return Reflect.get(e,i,a);if(Reflect.has(e,i))return hr(a,Reflect.get(e,i,a));const r=new Error(`cannot get property "${i}" without inject`);try{const o=e.reflect.props[i];if(o?.type==="accessor")return o.get.call(a,a[we.receiver],r);const u=a[we.shadow]??a;return u.fiber.runtime?a.events.waterfall("internal/get",a,i,r,()=>{const d=vg(u,i);if(!d)throw r;if(d.impl)return hr(a,d.impl.value);throw r.message=`cannot get required service "${i}" in inactive context`,r}):a.reflect.get(i,!1)}catch(o){throw o===r?Iu(o):o}},"get"),set:De((e,i,a,r)=>{if(Uu(i))return Reflect.set(e,i,a,r);const o=new Error(`cannot set property "${i}" without provide`),u=e.reflect.props[i];if(!u){if(!r.fiber.runtime)return Reflect.set(e,i,a,r);throw Iu(o)}try{return u.type==="accessor"?u.set?u.set.call(r,a,r[we.receiver],o):!1:r.events.waterfall("internal/set",r,i,a,o,()=>r.reflect.set(i,a,o))}catch(d){throw d===o?Iu(d):d}},"set"),has:De((e,i)=>Uu(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 hr(this.ctx,this._getImpl(e,i)?.value)}_getImpl(e,i=!0){const a=this.ctx[we.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[we.isolate][e],o=this.store[r];if(!o)throw new Error(`cannot set property "${e}" without provide`);if(o.ctx.fiber!==this.ctx.fiber)throw new Error(`cannot set property "${e}" in multiple fibers`);return o.value=i,!0}provide(e,i,a){return this.ctx.fiber.effect(()=>{if(!this.props[e])this.props[e]??={type:"service"};else if(this.props[e].type!=="service")throw new Error(`property "${e}" is already declared as ${this.props[e].type}`);this.props[e]={type:"service"},this.ctx[we.root][we.isolate][e]??=Symbol(e);const r=this.ctx[we.isolate][e],o={uid:++this._implCounter,name:e,value:i,ctx:this.ctx,check:a,isolate:r,dependents:new Set};if(this.store[r])throw new Error(`service "${e}" has been registered at <${this.store[r].ctx.fiber.name}>`);return this.store[r]=o,this.ctx.fiber.provisions.add(o),this.ctx.fiber.state===2&&this.notify([e]),async()=>{this.store[o.isolate]===o&&delete this.store[o.isolate],this.ctx.isolate(e,o.isolate).reflect.notify([e]),await new Promise(u=>{o.release=u,o.dependents.size||u()}),o.release=void 0,this.ctx.fiber.provisions.delete(o)}},`ctx.provide(${JSON.stringify(e)})`)}notify(e,i=(a,r)=>a[we.isolate][r]===this.ctx[we.isolate][r]){for(const a of this.ctx.registry.values())for(const r of a.fibers){let o=!1;for(const u of e)u in r.inject&&i(r.ctx,u)&&(o=!0,r._checkImpl(u));o&&r._refresh()}for(const a of e){const r=Object.create(this.ctx);r[we.filter]=o=>i(o,a),this.ctx.events.emit(r,"internal/service",a,this._getImpl(a,!1)?.value)}}accessor(e,i){return this.ctx.fiber.effect(()=>{if(e in this.props)throw new Error(`property "${e}" is already declared as ${this.props[e].type}`);return this.props[e]={type:"accessor",...i},()=>delete this.props[e]},`ctx.accessor(${JSON.stringify(e)})`)}mixin(e,i){const a=this;return this.ctx.fiber.effect(function*(){const r=Array.isArray(i)?i.map(u=>[u,u]):Object.entries(i),o=De((u,d)=>u[e],"getTarget");for(const[u,d]of r)yield a.accessor(d,{get(p,g){const x=o(this,g);if(Qu(x))return x;const b=p?Lo(p,x):x,h=Reflect.get(x,u,b);return typeof h!="function"?h:h.bind(b??x)},set(p,g,x){const b=o(this,x),h=g?Lo(g,b):b;return Reflect.set(b,u,p,h)}})},`ctx.mixin(${JSON.stringify(e)})`)}trace(e){return hr(this.ctx,e)}bind(e){return new Proxy(e,{apply:De((i,a,r)=>Reflect.apply(i,this.trace(a),r.map(o=>this.trace(o))),"apply"),construct:De((i,a,r)=>Reflect.construct(i,a.map(o=>this.trace(o)),r),"construct")})}},ki=class Eh{constructor(i,a){this.ctx=i,a??=this.constructor.provide;let r=this;const o={associate:a,property:"ctx"};return r[we.invoke]&&(r=Ju(a,Sd(Object.getPrototypeOf(this),Function.prototype),o)),r.ctx=i,r.name=a,Aa(r,we.tracker,o),r.ctx.reflect.provide(a,r,this[we.check]),r}ctx;static{De(this,"Service")}static init=we.init;static check=we.check;static invoke=we.invoke;static metadata=we.metadata;static extend=we.extend;static tracker=we.tracker;static mergeIntercept=we.mergeIntercept;static resolveIntercept=we.resolveIntercept;name;[we.filter](i){return i[we.isolate][this.name]===this.ctx[we.isolate][this.name]}[we.extend](i){let a;return this[Eh.invoke]?a=Ju(this.name,this,this[we.tracker]):a=Object.create(this),Object.assign(a,i)}[we.mergeIntercept](...i){return Object.assign({},...i)}[we.resolveIntercept](){const i=[];let a=this.ctx[wg.intercept];for(;this.name in a;)Object.hasOwn(a,this.name)&&i.unshift(a[this.name]),a=Object.getPrototypeOf(a);const r=vg(this[we.caller]??this.ctx,this.name)?.fiber?.inject[this.name];return Qu(r)||i.unshift(r),(this[we.mergeIntercept]??Eh.prototype[we.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}},S0={s:De(e=>String(e),"s"),d:De(e=>Math.trunc(Number(e)),"d"),i:De(e=>Math.trunc(Number(e)),"i"),f:De(e=>Number(e),"f"),o:De(e=>JSON.stringify(e),"o"),O:De(e=>JSON.stringify(e),"O"),c:De(()=>"","c"),C:De((e,i,a)=>Sh.color(i,Sh.code(a.name,i.colors),e),"C")};function nk(e){return e instanceof Error&&Array.isArray(e.errors)}De(nk,"isAggregateError");var Sh=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{De(this,"Logger")}static color(e,i,a,r=""){return e.colors?`\x1B[3${i<8?i:"8;5;"+i}${e.colors>=2?r:""}m${a}\x1B[0m`:""+a}static code(e,i){let a=0;for(let o=0;o<e.length;o++)a=(a<<3)-a+e.charCodeAt(o)+13,a|=0;const r=i?i>=2?sA:rA:[];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 g=e.formatters?.[p]??S0[p];if(typeof g=="function"){const x=a.shift();return g(x,e,i)}return d});const o=e.formatters?.o??S0.o;for(let d of a)typeof d=="object"&&d&&(d=o(d,e,i)),r+=" "+d;const{maxLength:u=10240}=e;return r.split(/\r?\n/g).map(d=>d.slice(0,u)+(d.length>u?"...":"")).join(`
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(nk(a[0])&&a[0].errors.length){a[0].errors.forEach(u=>this[e](u));return}}const r=++this.service._snMessage,o=Date.now();for(const u of this.service.exporters.values()){if((u.levels?.[this.name]??u.levels?.default??this.level??2)<i)continue;const p={sn:r,ts:o,type:e,level:i,name:this.name,...this.meta,args:a};u.export(p)}}}},rA=[6,2,3,4,5,1],sA=[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],lA=class ik{static{De(this,"LoggerService")}bufferSize=1e3;buffer=[];ctx;_snMessage=0;_snExporter=0;exporters=new Map;constructor(i){const a={property:"ctx",noShadow:!0},r=Ju("logger",Sd(Object.getPrototypeOf(this),Function.prototype),a);return Object.assign(r,this),r.ctx=i,Aa(r,we.tracker,a),r.exporter({colors:3,export:De(o=>{r.buffer.push(o);const u=r.buffer.length-r.bufferSize;u===1?r.buffer.shift():u>1&&r.buffer.splice(0,u)},"export")}),r}exporter(i){return this.ctx.effect(()=>{const a=++this._snExporter;return this.exporters.set(a,i),()=>this.exporters.delete(a)},"ctx.logger.exporter()")}[we.invoke](i){const a=this[we.caller],r=ki.prototype[ki.resolveIntercept].call(this),o=(a??this.ctx).fiber;return i??=r.name,i??=eA(o.name),new Sh({name:i,level:r.level,meta:{fiber:new WeakRef(o)}},this)}static{for(const i of["error","info","warn","debug"])ik.prototype[i]=function(...a){return this()[i](...a)}}};function ak(e){return e&&typeof e=="object"&&typeof e.apply=="function"}De(ak,"isApplicable");function ed(e,i){return function(a,r){if(r.kind==="class")Object.hasOwn(a,"inject")||(Aa(a,"inject",Object.create(Object.getPrototypeOf(a).inject??null)),Aa(a.inject,we.checkProto,!0)),a.inject[e]=i;else if(r.kind==="method"){const o=(a[we.decorator]??={}).inject??=Object.create(null);o[e]=i,r.addInitializer(function(){const u=this[we.tracker]?.property;(this[we.initHooks]??=[]).push(()=>{this.ctx.inject(o,d=>a.call(u?Lo(this,{[u]:d}):this))})})}else throw new Error("@Inject() can only be used on class or class methods")}}De(ed,"Inject");(e=>{function i(a,r=Object.create(null)){if(!a)return r;if(Array.isArray(a))for(const o of a)r[o]=null;else if(Reflect.has(a,we.checkProto)){Object.assign(r,i(Object.getPrototypeOf(a)));for(const o of Object.keys(a))r[o]=a[o]??null}else for(const o of Object.keys(a))r[o]=a[o]??null;return r}e.resolve=i,De(i,"resolve")})(ed||(ed={}));var oA=class{constructor(e){this.ctx=e,Aa(this,we.tracker,{property:"ctx",noShadow:!0})}ctx;static{De(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(ak(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=Td()){const r=this.resolve(e);if(!r)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e);this.ctx.fiber.assertActive();let o=this._internal.get(r);if(!o){let p=e.name;p==="apply"&&(p=void 0),o={name:p,callback:r,fibers:new bg,Config:e.Config},this._internal.set(r,o)}const u=new tk(this.ctx,i,ed.resolve(e.inject),o,a),d=Object.create(u);return d.then=(p,g)=>u.await().then(p,g),d}},wg=class ko{static{De(this,"Context")}static root=we.root;static effect=we.effect;static filter=we.filter;static isolate=we.isolate;static intercept=we.intercept;static is(i){return!!i?.[ko.is]}static{ko.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),ko.prototype[ko.is]=!0}constructor(){this[we.isolate]=Object.create(null),this[we.intercept]=Object.create(null);const i=new Proxy(this,E0.handler);return this[we.root]=i,this.baseUrl=void 0,this.fiber=new tk(i,{},Object.create(null),null,()=>[]),this.reflect=new E0(i),this.registry=new oA(i),this.events=new iA(i),this.logger=new lA(i),this.fiber._disposables.clear(),i}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.fiber.name}>`}extend(i={}){const a=Reflect.getOwnPropertyDescriptor(this,we.shadow)?.value,r=Object.create(hr(this,this));for(const o of Reflect.ownKeys(i))Object.defineProperty(r,o,Reflect.getOwnPropertyDescriptor(i,o));return a?Object.assign(Object.create(r),{[we.shadow]:a}):r}isolate(i,a){const r=Object.create(this[we.isolate]);return r[i]=a??Symbol(i),this.extend({[we.isolate]:r})}intercept(i,a){const r=Object.create(this[we.intercept]);return r[i]=a,this.extend({[we.intercept]:r})}};function cA(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 bm(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 uA(e){const i=new Map;return{isBusy:a=>i.has(a),isIdle:()=>i.size===0,clear(a){const r=i.get(a);r&&i.set(a,{chain:r.chain,token:{}})},clearAll(){for(const[a,r]of i)i.set(a,{chain:r.chain,token:{}})},push(a,r){const o=i.get(a)??{chain:Promise.resolve(),token:{}},u=o.token,p=o.chain.then(()=>i.get(a)?.token===u?e(a,r):void 0,()=>i.get(a)?.token===u?e(a,r):void 0).then(()=>{},()=>{});return i.set(a,{chain:p,token:u}),p.then(()=>{i.get(a)?.chain===p&&i.delete(a)}),p}}}class dA extends ki{static provide="sessions";constructor(i){super(i,"sessions")}current(i){return Je.getState().sessions.find(a=>a.id===i)}all(){return Je.getState().sessions}getMessages(i){return this.current(i)?.messages??[]}addMessage(i,a){Je.getState().addMessage(i,a),this.flush(i)}updateMessage(i,a,r){Je.getState().updateMessage(i,a,r),this.flush(i)}updateSession(i,a){Je.getState().updateSession(i,a),this.flush(i)}turnHistory(i,a){return cA(i,a)}async flush(i){await this.ctx.events.parallel("session/flush",i).catch(()=>{})}}const li=Oa()(e=>({skills:[],loaded:!1,loading:!1,error:"",load:async()=>{e({loading:!0});try{const{skills:i}=await _j();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 Tj(i);return e({skills:a.skills,loaded:!0}),a.installed},installNpm:async i=>{const a=await Cj(i);return e({skills:a.skills,loaded:!0}),a.installed},setEnabled:async(i,a)=>{e(r=>({skills:r.skills.map(o=>o.name===i?{...o,enabled:a}:o)}));try{const r=await jj(i,a);e({skills:r.skills})}catch(r){e(o=>({skills:o.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 Aj(i);e({skills:a.skills})}}));function fA(){return li.getState().skills.filter(e=>e.enabled)}function pA(){const e=fA();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 rk(e,i){const a=i?e.workspacePrompts?.[i]:void 0;return typeof a=="string"?{text:a,source:"workspace"}:{text:e.systemPrompt,source:"app"}}function sk(e,i,a){return typeof i?.systemPrompt=="string"?{text:i.systemPrompt,source:"session"}:rk(e,a)}const td={explore:{label:"Explore",summary:"fast, local: find where something lives, trace a flow or a bug through the codebase",tools:["read_file","list_files","grep","shell","git","skill"],maxRounds:24,guidance:["Search wide first (grep, list_files), then read only the files that matter.","Run independent searches in the same round instead of one after another.","Report exact paths with line numbers and a short quote or code reference for each claim."]},research:{label:"Research",summary:"look things up on the web (docs, release notes, errors) and cross-check with the local code",tools:["read_file","list_files","grep","web_search","read_url","skill"],maxRounds:18,guidance:["Prefer primary sources (official docs, changelogs, source repositories). Open the pages you cite.","Cross-check important claims with a second source or with the local code.","Report each finding with its URL, and say plainly what you could not confirm."]},review:{label:"Review",summary:"critically review code or a diff for bugs, regressions, missing tests and risky changes",tools:["read_file","list_files","grep","shell","git","skill"],maxRounds:30,guidance:["Start from `git status` and `git diff` when the task is about recent changes; otherwise read the named files.","Check call sites and edge cases, not just the changed lines. Verify a suspected bug by reading the code it touches.",'Report findings ordered by severity, each with file:line, why it is a problem and a concrete fix. Say "no issues found" if that is the truth.']}};function mA(e){return e==="research"||e==="review"?e:"explore"}function hA(){const e=Ae.getState().daemon,i=e?.os??"",a=e?.shell??"";if(!i&&!a)return"";const r=i==="win32"?["- Commands run in PowerShell, not bash. Use PowerShell syntax: `Get-ChildItem`, `Get-Content`, `Select-String`, `$env:NAME`, `;` (not `&&` on Windows PowerShell 5).","- Do not assume `ls -la`, `grep`, `sed`, `cat <<EOF` or `export` exist. Paths may use `\\` or `/`; quote paths that contain spaces."]:i==="darwin"?["- Commands run in a login shell on macOS (BSD userland). `sed -i` needs an argument (`sed -i ''`), `date`, `xargs` and `grep` differ from GNU; prefer portable flags or the dedicated file tools."]:i==="linux"?["- Commands run in bash with GNU userland."]:[];return["## Environment",`- OS: ${i||"unknown"}${e?.arch?` (${e.arch})`:""}`,`- Shell: ${a||"unknown"}`,...r].join(`
44
+ `)}function gA(){const e=qe.getState(),i=e.root||e.info.root;if(!i)return"No folder is open yet. Ask the user to choose a workspace folder in the Workspace panel before using file, shell or git tools.";const a=e.entries.filter(o=>!o.path.includes("/")).slice(0,40).map(o=>`${o.path}${o.type==="dir"?"/":""}`),r=e.git.available?`${e.git.branch||"detached HEAD"} · ${e.git.entries.length} changed file${e.git.entries.length===1?"":"s"}`:"not a git repository";return[`Root: ${i}`,`Git: ${r}`,a.length>0?`Top level: ${a.join(", ")}`:"The folder is empty.",e.truncated?"The file tree was truncated; use list_files or grep for deeper paths.":""].filter(Boolean).join(`
45
+ `)}class xA extends ki{static provide="systemPrompt";customSections=new Map;constructor(i){super(i,"systemPrompt")}registerSection(i,a){return this.customSections.set(i,a),()=>this.customSections.delete(i)}assemble(i,a=i.mode,r){const o=[],u=qe.getState(),d=r?this.ctx.sessions.current(r):void 0,p=sk(i,d,u.root||u.info.root);p.text.trim()&&o.push({name:"base",priority:10,content:p.text.trim()});const g=pA();g&&i.tools.skill?.enabled!==!1&&o.push({name:"skills",priority:20,content:g}),o.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.",gA()].join(`
46
+
47
+ `)});const x=qe.getState().instructions;x.content.trim()&&o.push({name:"project-instructions",priority:35,content:[`## Project instructions (${x.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="${x.file}">
48
+ ${x.content.trim()}${x.truncated?`
49
+ … (file clipped)`:""}
50
+ </project-instructions>`].join(`
51
+
52
+ `)});const b=hA();b&&o.push({name:"environment",priority:38,content:b}),o.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(`
53
+ `):["## 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(`
54
+ `)}),o.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(`
55
+ `)}),o.push({name:"session-context",priority:50,content:["## Session context",`- Model: ${Xn(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(`
56
+ `)});for(const h of this.customSections.values()){const v=h(i,a);v&&v.content&&o.push(v)}return this.ctx.events.waterfall("system-prompt/assemble",o,a,()=>(o.sort((h,v)=>h.priority-v.priority),o.map(h=>h.content).filter(Boolean).join(`
57
+
58
+ `)))}buildSubagentPrompt(i,a,r="explore"){const o=td[r];return[this.assemble(i,"plan",a),[`## Subagent (${o.label})`,"You are a focused, read-only investigator working for the main agent. You cannot ask the user questions and cannot start other subagents.","- Work only on the assigned task. Do not edit files, change git state or run commands that mutate the machine; the daemon enforces this.",...o.guidance.map(u=>`- ${u}`),"- Be efficient: you have a limited number of rounds. Batch independent tool calls in one round.","- Finish with a concise report: the answer first, then evidence (paths, lines, URLs), then open questions. Do not repeat the task. Do not invent evidence; say what could not be verified."].join(`
59
+ `)].join(`
60
+
61
+ `)}}let wu;const rn=Oa()((e,i)=>{const a=r=>{e({servers:r,loaded:!0,loading:!1,error:""}),wu!==void 0&&window.clearTimeout(wu),wu=void 0,r.some(o=>o.status==="connecting")&&(wu=window.setTimeout(()=>{i().load()},1200))};return{servers:[],loaded:!1,loading:!1,error:"",load:async()=>{e({loading:!0});try{a((await dj()).servers)}catch(r){e({loading:!1,loaded:!0,error:r instanceof Error?r.message:"Could not load MCP servers."})}},save:async r=>{const o=await fj(r);a(o.servers)},act:async(r,o)=>{o!=="disconnect"&&e(d=>({servers:d.servers.map(p=>p.id===r?{...p,status:"connecting",error:""}:p)}));const u=await pj(r,o);a(u.servers)},authorize:async r=>{const{url:o}=await mj(r),u=window.open(o,"opensol-mcp-oauth","popup=yes,width=520,height=720");if(!u)throw new Error("The browser blocked the sign-in window. Allow pop-ups for OpenSol and try again.");const d=Date.now(),p=window.setInterval(()=>{i().load();const g=i().servers.find(x=>x.id===r);(u.closed||g?.oauth?.authorized||Date.now()-d>5*6e4)&&(window.clearInterval(p),i().load())},1500)},logout:async r=>{a((await hj(r)).servers)},lookup:r=>{for(const o of i().servers){const u=o.tools.find(d=>d.fn===r);if(u)return{server:o,tool:u}}return null}}});function lk(e){return e.startsWith("mcp__")}try{new BroadcastChannel("opensol-mcp-oauth").onmessage=()=>{rn.getState().load()}}catch{}const ym=28e3;function bA(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 ok(e){if(!lk(e))return;const i=rn.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:bA(r.inputSchema),allowedInMode:o=>o==="build"||r.readOnly,async execute(o,u){const{result:d}=await gj(a.id,r.name,o,u.signal),p=d.text.trim()||"(the tool returned no output)";return{output:p.length>ym?`${p.slice(0,ym)}
62
+ … truncated (${p.length-ym} more characters)`:p,isError:d.isError}}}}function yA(){const e=[];for(const i of rn.getState().servers)for(const a of i.tools){const r=ok(a.fn);r&&e.push(r)}return e}function nd(e,i){if(!lk(i))return e.tools[i];const a=rn.getState().lookup(i);if(!a)return;const{server:r,tool:o}=a;return{enabled:r.enabled&&r.status==="connected"&&!r.disabledTools.includes(o.name),approval:r.approval}}const vA=new Set(["read_file","list_files","grep","web_search","read_url"]);function _0(e,i){return i==="build"?!0:vA.has(e)||e==="shell"||e==="git"||e==="subagent"}class wA 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)??ok(i)}list(){return[...this.definitions.values(),...yA()]}schemas(i,a="build",{subagent:r=!1}={}){const o=[],u=r?[...this.definitions.values()]:this.list();for(const d of u)d.name==="subagent"&&r||!nd(i,d.name)?.enabled||!(d.allowedInMode?d.allowedInMode(a):_0(d.name,a))||(d.name==="web_search"||d.name==="read_url")&&!i.webSearchEnabled||o.push({name:d.name,description:d.description,parameters:d.parameters});return o}async execute(i,a,r,o,u,d,p,g={}){const x={name:i,args:a,settings:r,mode:o,signal:u,callId:d,turnId:p,...g},b=await this.ctx.events.waterfall("tools/pre-execute",x,async()=>{if(!nd(r,i)?.enabled)return{decision:"deny",reason:"This tool is disabled or its MCP server is not connected (Settings → Tools / MCP)."};const y=this.get(i);return(y?.allowedInMode?y.allowedInMode(o):_0(i,o))?(i==="web_search"||i==="read_url")&&!r.webSearchEnabled?{decision:"deny",reason:"Web access is turned off for this session."}:{decision:"allow"}:{decision:"deny",reason:"Plan mode is read-only. Do not edit files or change git state. Finish with an implementation plan instead."}});if(b.decision==="deny"){const y={output:b.reason??"Tool call denied.",isError:!0};return this.ctx.events.emit("tools/result",y,x),y}if(u.aborted)throw new DOMException("Aborted","AbortError");const h=await this.ctx.events.waterfall("tools/execute",x,async()=>{const y=this.get(i);return y?await y.execute(a,x):{output:`Tool "${i}" is not registered.`,isError:!0}}),v=await this.ctx.events.waterfall("tools/post-execute",h,x,async()=>h);return this.ctx.events.emit("tools/result",v,x),v}}const Bu=new Map;class kA extends ki{static provide="approval";static inject=["tools"];constructor(i){super(i,"approval"),this.ctx.on("tools/pre-execute",async(a,r)=>nd(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 NA(i,a)}resolveApproval(i,a){_h(i,a)}}function NA(e,i){return i.aborted?Promise.resolve(!1):new Promise(a=>{const r=u=>{const d=Bu.get(e);d&&(d.cleanup(),Bu.delete(e),a(u))},o=()=>r(!1);i.addEventListener("abort",o,{once:!0}),Bu.set(e,{toolCallId:e,resolve:r,cleanup:()=>i.removeEventListener("abort",o)})})}function _h(e,i){Bu.get(e)?.resolve(i)}async function*Cd(e){if(!e.body)throw new Error("The provider returned an empty response body.");const i=e.body.getReader(),a=new TextDecoder;let r="";try{for(;;){const{done:o,value:u}=await i.read();if(o)break;r+=a.decode(u,{stream:!0}),r=r.replace(/\r\n/g,`
63
+ `);let d=r.indexOf(`
64
+
65
+ `);for(;d!==-1;){const p=r.slice(0,d);r=r.slice(d+2);for(const g of p.split(`
66
+ `)){if(!g.startsWith("data:"))continue;const x=g.slice(5).trim();x&&(yield x)}d=r.indexOf(`
67
+
68
+ `)}}for(const o of r.split(`
69
+ `))if(o.startsWith("data:")){const u=o.slice(5).trim();u&&(yield u)}}finally{i.releaseLock()}}function EA(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."}function Io(e){const i=[e.content];for(const a of e.attachments??[])a.kind==="text"&&a.text&&i.push(`
70
+
71
+ --- Attached file: ${a.name} ---
72
+ ${a.text}`);return i.filter(Boolean).join("")}function jd(e){return!!(e.content.trim()||e.toolCalls.length>0)}function Ad(e){return(e.attachments??[]).filter(i=>i.kind==="image"&&i.dataUrl)}function kg(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 Od(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 SA(e){const i=[],a=(r,o)=>{if(o.length===0)return;const u=i[i.length-1];u?.role===r?u.content.push(...o):i.push({role:r,content:o})};for(const r of e){if(r.role==="user"){const o=[];for(const d of Ad(r)){const p=/^data:(image\/[a-z0-9.+-]+);base64,(.+)$/i.exec(d.dataUrl??"");p&&o.push({type:"image",source:{type:"base64",media_type:p[1],data:p[2]}})}const u=Io(r);u.trim()&&o.push({type:"text",text:u}),o.length===0&&o.push({type:"text",text:"(empty message)"}),a("user",o);continue}if(r.role==="assistant"){if(!jd(r))continue;const o=[];for(const u of r.thinkingBlocks??[])u.signature&&o.push({type:"thinking",thinking:u.text,signature:u.signature});r.content.trim()&&o.push({type:"text",text:r.content});for(const u of r.toolCalls)o.push({type:"tool_use",id:u.id,name:u.name,input:u.args});a("assistant",o);continue}a("user",[{type:"tool_result",tool_use_id:r.call.id,content:Od(r.result,r.status),is_error:r.status==="error"||r.status==="denied"}])}return i}async function _A(e){const{settings:i,model:a,history:r,system:o,signal:u,handlers:d}=e,p=i.model.trim();if(!p)throw new Error("Choose a model before sending a message.");const g=vr(a),x=ll(i.effort,a),b=x!=="none"&&(g.length>0||Xu(a));let h=i.maxTokens,v=0;b&&g.length===0&&Xu(a)&&(v=Bw(x,a),h=Math.max(i.maxTokens,v+1024),a?.maxOutput&&(h=Math.min(h,a.maxOutput)),v=Math.min(v,h-1024),v<1024&&(v=0));const y=e.tools.map(N=>({name:N.name,description:N.description,input_schema:N.parameters})),k={model:p,max_tokens:h,system:o,messages:SA(r),stream:!0};if(y.length>0&&(k.tools=y),b&&g.length>0){const N=x==="minimal"?"low":x;k.output_config={effort:N}}else v>0?k.thinking={type:"enabled",budget_tokens:v}:b||(!a||a.temperature)&&(k.temperature=i.temperature);const S=await Fo(i.provider,"anthropic",p,k,u);let j="",_="",A={};const C=new Map;for await(const N of Cd(S)){let z;try{z=JSON.parse(N)}catch{continue}const q=z.type;if(q==="error"){const R=z.error;throw new Error(typeof R=="string"?R:R?.message??"Anthropic returned an error.")}if(q==="message_start"){const R=z.message;A={...A,input:R?.usage?.input_tokens};continue}if(q==="content_block_start"){const R=Number(z.index??C.size),G=z.content_block;C.set(R,{type:String(G.type??""),text:typeof G.text=="string"?G.text:typeof G.thinking=="string"?G.thinking:"",signature:typeof G.signature=="string"?G.signature:"",id:typeof G.id=="string"?G.id:"",name:typeof G.name=="string"?G.name:"",json:"",input:G.input});continue}if(q==="content_block_delta"){const R=Number(z.index??0),G=C.get(R),Z=z.delta;if(!G||!Z)continue;Z.type==="text_delta"&&typeof Z.text=="string"?(G.text+=Z.text,j+=Z.text,d.onText(Z.text)):Z.type==="thinking_delta"&&typeof Z.thinking=="string"?(G.text+=Z.thinking,_+=Z.thinking,d.onReasoning(Z.thinking)):Z.type==="signature_delta"&&typeof Z.signature=="string"?G.signature+=Z.signature:Z.type==="input_json_delta"&&typeof Z.partial_json=="string"&&(G.json+=Z.partial_json);continue}if(q==="message_delta"){const R=z.usage;A={...A,output:R?.output_tokens??A.output},d.onUsage(A);continue}if(q==="message_stop")break}const M=new Set(y.map(N=>N.name)),B=[],D=[];for(const[,N]of[...C.entries()].sort((z,q)=>z[0]-q[0])){if(N.type==="tool_use"&&N.name){if(!M.has(N.name))throw new Error(`The model requested a tool that is not enabled: ${N.name}`);const z=N.json?kg(N.json,N.name):N.input&&typeof N.input=="object"?N.input:{};B.push({id:N.id||`call_${Date.now().toString(36)}_${B.length}`,name:N.name,args:z})}N.type==="thinking"&&N.text&&D.push({text:N.text,signature:N.signature||void 0})}return B.length>0&&d.onToolCalls(B),{content:j,reasoning:_,toolCalls:B,thinkingBlocks:D,usage:A}}function TA(e){const i=[],a=(r,o)=>{if(o.length===0)return;const u=i[i.length-1];u?.role===r?u.parts.push(...o):i.push({role:r,parts:o})};for(const r of e){if(r.role==="user"){const o=[];for(const d of Ad(r)){const p=/^data:([^;]+);base64,(.+)$/i.exec(d.dataUrl??"");p&&o.push({inlineData:{mimeType:p[1],data:p[2]}})}const u=Io(r);u.trim()&&o.push({text:u}),o.length===0&&o.push({text:"(empty message)"}),a("user",o);continue}if(r.role==="assistant"){if(!jd(r))continue;const o=[];r.content.trim()&&o.push({text:r.content});for(const u of r.toolCalls)o.push({functionCall:{name:u.name,args:u.args},...u.thoughtSignature?{thoughtSignature:u.thoughtSignature}:{}});a("model",o);continue}a("user",[{functionResponse:{name:r.call.name,response:{result:Od(r.result,r.status),...r.status==="error"||r.status==="denied"?{isError:!0}:{}}}}])}return i}function Th(e){if(Array.isArray(e))return e.map(Th);if(!e||typeof e!="object")return e;const i={};for(const[a,r]of Object.entries(e))a==="additionalProperties"||a==="$schema"||(i[a]=Th(r));return i}async function CA(e){const{settings:i,model:a,history:r,system:o,signal:u,handlers:d}=e,p=i.model.trim();if(!p)throw new Error("Choose a model before sending a message.");const g=vr(a),x=ll(i.effort,a),b=Xu(a)?Bw(x,a):0,h=x!=="none"&&(g.length>0||b>0);let v=i.maxTokens;h&&b>0&&(v=Math.max(v,b+2048),a?.maxOutput&&(v=Math.min(v,a.maxOutput)));const y=e.tools,k={maxOutputTokens:v};(!a||a.temperature)&&(k.temperature=i.temperature),h&&g.length>0?k.thinkingConfig={thinkingLevel:x.toUpperCase(),includeThoughts:!0}:h&&b>0?k.thinkingConfig={thinkingBudget:Math.min(b,Math.max(1024,v-1024)),includeThoughts:!0}:h&&Iw(a)&&(k.thinkingConfig={includeThoughts:!0});const S={systemInstruction:{parts:[{text:o}]},contents:TA(r),generationConfig:k};y.length>0&&(S.tools=[{functionDeclarations:y.map(q=>({name:q.name,description:q.description,parameters:Th(q.parameters)}))}],S.toolConfig={functionCallingConfig:{mode:"AUTO"}});const j=await Fo(i.provider,"gemini",p,S,u);let _="",A="",C={},M="";const B=[],D=new Set(y.map(q=>q.name));let N;for await(const q of Cd(j)){let R;try{R=JSON.parse(q)}catch{continue}const G=R.error;if(G?.message)throw new Error(G.message);const Z=R.promptFeedback;if(Z?.blockReason)throw new Error(`Gemini blocked this request (${Z.blockReason}).`);const fe=R.usageMetadata;fe&&(C={input:fe.promptTokenCount,output:(fe.candidatesTokenCount??0)+(fe.thoughtsTokenCount??0)||fe.candidatesTokenCount},d.onUsage(C));const J=R.candidates?.[0];J?.finishReason&&(M=J.finishReason);for(const O of J?.content?.parts??[]){const re=typeof O.thoughtSignature=="string"?O.thoughtSignature:void 0;re&&(N=re),typeof O.text=="string"&&O.text&&(O.thought===!0?(A+=O.text,d.onReasoning(O.text)):(_+=O.text,d.onText(O.text)));const ie=O.functionCall;if(ie?.name){if(!D.has(ie.name))throw new Error(`Gemini requested a tool that is not enabled: ${ie.name}`);B.push({name:ie.name,args:ie.args??{},signature:re??N}),N=void 0}}}if(M==="SAFETY"||M==="RECITATION")throw new Error(`Gemini stopped the response (${M.toLowerCase()}).`);const z=B.map((q,R)=>({id:`gemini_${Date.now().toString(36)}_${R}`,name:q.name,args:q.args,thoughtSignature:q.signature}));return z.length>0&&d.onToolCalls(z),{content:_,reasoning:A,toolCalls:z,usage:C}}function jA(e){const i=[];for(const a of e){if(a.role==="user"){const r=Ad(a);if(r.length>0){const o=[{type:"text",text:Io(a)||"See the attached image."}];for(const u of r)o.push({type:"image_url",image_url:{url:u.dataUrl,detail:"auto"}});i.push({role:"user",content:o})}else{const o=Io(a);o.trim()&&i.push({role:"user",content:o})}continue}if(a.role==="assistant"){if(!jd(a))continue;const r={role:"assistant",content:a.content||null};a.toolCalls.length>0&&(r.tool_calls=a.toolCalls.map(o=>({id:o.id,type:"function",function:{name:o.name,arguments:JSON.stringify(o.args)}}))),i.push(r);continue}i.push({role:"tool",tool_call_id:a.call.id,content:Od(a.result,a.status)})}return i}function T0(e,i){return e!=="openai"?!1:/^(gpt-5|o[1-9]|codex)/i.test(i)}async function AA(e){const{settings:i,model:a,history:r,system:o,signal:u,handlers:d}=e,p=i.model.trim();if(!p)throw new Error("Choose a model before sending a message.");const g=e.tools,x=new Set(g.map(B=>B.name)),b=g.map(B=>({type:"function",function:{name:B.name,description:B.description,parameters:B.parameters}})),h={model:p,messages:[{role:"system",content:o},...jA(r)],stream:!0};b.length>0&&(h.tools=b,h.tool_choice="auto"),(i.provider==="openai"||i.provider==="openrouter")&&(h.stream_options={include_usage:!0}),i.provider==="openrouter"&&(h.usage={include:!0}),T0(i.provider,p)?h.max_completion_tokens=i.maxTokens:h.max_tokens=i.maxTokens;let y=vr(a).length>0?ll(i.effort,a):"";y==="none"&&(y=""),y&&(i.provider==="openrouter"?h.reasoning={effort:y}:h.reasoning_effort=y);const k=a?a.temperature:!T0(i.provider,p);!y&&k&&(h.temperature=i.temperature);const S=await Fo(i.provider,"openai-chat",p,h,u);let j="",_="",A={};const C=new Map;for await(const B of Cd(S)){if(B==="[DONE]")break;let D;try{D=JSON.parse(B)}catch{continue}if(D.error){const R=D.error;throw new Error(typeof R=="string"?R:R.message??"The provider returned an error.")}if(D.usage&&typeof D.usage=="object"){const R=D.usage;A={input:R.prompt_tokens,output:R.completion_tokens,cost:typeof R.cost=="number"&&Number.isFinite(R.cost)?R.cost:void 0},d.onUsage(A)}const z=D.choices?.[0]?.delta;if(!z)continue;typeof z.content=="string"&&z.content&&(j+=z.content,d.onText(z.content));const q=typeof z.reasoning_content=="string"?z.reasoning_content:typeof z.reasoning=="string"?z.reasoning:(z.reasoning_details??[]).map(R=>R.text??"").join("");q&&(_+=q,d.onReasoning(q));for(const[R,G]of(z.tool_calls??[]).entries()){const Z=typeof G.index=="number"?G.index:R,fe=C.get(Z)??{id:"",name:"",arguments:""};G.id&&(fe.id=G.id),G.function?.name&&(fe.name=G.function.name),G.function?.arguments&&(fe.arguments+=G.function.arguments),C.set(Z,fe)}}const M=[];for(const[B,D]of[...C.entries()].sort((N,z)=>N[0]-z[0]))if(D.name){if(!x.has(D.name))throw new Error(`The model requested a tool that is not enabled: ${D.name}`);M.push({id:D.id||`call_${Date.now().toString(36)}_${B}`,name:D.name,args:kg(D.arguments,D.name)})}return M.length>0&&d.onToolCalls(M),{content:j,reasoning:_,toolCalls:M,usage:A}}function OA(e){const i=[];for(const a of e){if(a.role==="user"){const r=Ad(a),o=Io(a)||(r.length>0?"See the attached image.":"");if(!o.trim()&&r.length===0)continue;if(r.length===0){i.push({role:"user",content:o});continue}const u=[{type:"input_text",text:o}];for(const d of r)u.push({type:"input_image",image_url:d.dataUrl,detail:"auto"});i.push({role:"user",content:u});continue}if(a.role==="assistant"){if(!jd(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:Od(a.result,a.status)})}return i}function Vs(e){return e&&typeof e=="object"?e:{}}async function MA(e){const{settings:i,model:a,history:r,system:o,signal:u,handlers:d}=e,p=i.model.trim();if(!p)throw new Error("Choose a model before sending a message.");const g=e.tools,x=new Set(g.map(D=>D.name)),b={model:p,instructions:o,input:OA(r),max_output_tokens:i.maxTokens,tool_choice:"auto"};g.length>0&&(b.tools=g.map(D=>({type:"function",name:D.name,description:D.description,parameters:D.parameters,strict:!1})));const v=vr(a).length>0?ll(i.effort,a):"none";v!=="none"&&(b.reasoning={effort:v});const y=await Fo(i.provider,"openai-responses",p,b,u);let k="",S="",j={};const _=new Map;let A=0;const C=(D,N)=>{const z=_.get(D),q=typeof N.call_id=="string"?N.call_id:z?.id||D,R=typeof N.name=="string"?N.name:z?.name||"",G=typeof N.arguments=="string"?N.arguments:z?.args||"";_.set(D,{id:q,name:R,args:G,order:z?.order??A++})};for await(const D of Cd(y)){if(D==="[DONE]")break;let N;try{N=JSON.parse(D)}catch{continue}const z=typeof N.type=="string"?N.type:"";if(z==="error"||z==="response.failed"){const q=Vs(N.response).error??N.error??N.message,R=Vs(q);throw new Error(typeof q=="string"?q:typeof R.message=="string"?R.message:"The model request failed.")}if(z==="response.output_text.delta"&&typeof N.delta=="string"){k+=N.delta,d.onText(N.delta);continue}if((z==="response.reasoning_summary_text.delta"||z==="response.reasoning_text.delta")&&typeof N.delta=="string"){S+=N.delta,d.onReasoning(N.delta);continue}if(z==="response.output_item.added"){const q=Vs(N.item);if(q.type==="function_call"){const R=typeof q.id=="string"?q.id:typeof q.call_id=="string"?q.call_id:"";R&&C(R,q)}continue}if(z==="response.function_call_arguments.delta"){const q=typeof N.item_id=="string"?N.item_id:"",R=q?_.get(q):void 0;R&&typeof N.delta=="string"&&(R.args+=N.delta);continue}if(z==="response.function_call_arguments.done"){const q=typeof N.item_id=="string"?N.item_id:"",R=q?_.get(q):void 0;R&&typeof N.arguments=="string"&&(R.args=N.arguments);continue}if(z==="response.output_item.done"){const q=Vs(N.item);if(q.type==="function_call"){const R=typeof q.id=="string"?q.id:typeof q.call_id=="string"?q.call_id:"";R&&C(R,q)}continue}if(z==="response.completed"){const q=Vs(N.response),R=Vs(q.usage);(typeof R.input_tokens=="number"||typeof R.output_tokens=="number")&&(j={input:Number(R.input_tokens)||void 0,output:Number(R.output_tokens)||void 0},d.onUsage(j))}}const M=[],B=[..._.entries()].sort((D,N)=>D[1].order-N[1].order);for(const[D,N]of B)if(N.name){if(!x.has(N.name))throw new Error(`The model requested a tool that is not enabled: ${N.name}`);M.push({id:N.id||D,name:N.name,args:kg(N.args,N.name)})}return M.length>0&&d.onToolCalls(M),{content:k,reasoning:S,toolCalls:M,usage:j}}const Eo=[],ck=600*1e3,_n=Oa()((e,i)=>({byProvider:{},loading:{},errors:{},notes:{},source:{},fetchedAt:{},fetchModels:async(a,r=!1)=>{if(i().loading[a])return i().byProvider[a]??Eo;if(!r){const o=i().byProvider[a]??Eo,u=i().fetchedAt[a]??0;if(o.length>0&&Date.now()-u<ck)return o}e(o=>({loading:{...o.loading,[a]:!0},errors:{...o.errors,[a]:""}}));try{const o=await ij(a);return e(u=>({byProvider:{...u.byProvider,[a]:o.models},loading:{...u.loading,[a]:!1},errors:{...u.errors,[a]:""},notes:{...u.notes,[a]:o.note||o.catalogError||""},source:{...u.source,[a]:o.source},fetchedAt:{...u.fetchedAt,[a]:o.fetchedAt||Date.now()}})),o.models}catch(o){const u=o instanceof Error?o.message:"Could not load models from this provider.";return e(d=>({loading:{...d.loading,[a]:!1},errors:{...d.errors,[a]:u},source:{...d.source,[a]:""}})),i().byProvider[a]??Eo}}}));function RA(e){return _n(i=>i.byProvider[e])??Eo}function Md(){const e=Ae(a=>a.provider),i=Ae(a=>a.model);return _n(a=>i?a.byProvider[e]?.find(r=>r.id===i)??null:null)}function ul(e,i){return i?_n.getState().byProvider[e]?.find(a=>a.id===i)??null:null}function DA(){const e=Ae(a=>a.hydrated),i=Ae(a=>a.provider);I.useEffect(()=>{if(!e)return;const a=Ae.getState();if(!ol(a))return;const r=_n.getState(),o=r.byProvider[i]??Eo,u=r.fetchedAt[i]??0;o.length>0&&Date.now()-u<ck||r.fetchModels(i)},[e,i])}function zA(e,i,a){if(a?.apiKind)return a.apiKind;const r=na[e];if(e!=="opencode")return r?.format==="anthropic"?"anthropic":r?.format==="gemini"?"gemini":"openai-chat";const o=i.toLowerCase();return/gemini|gemma/.test(o)?"gemini":/claude|qwen.*(flash|plus)/.test(o)?"anthropic":/gpt|grok|muse|codex/.test(o)?"openai-responses":"openai-chat"}class LA extends ki{static provide="llm";constructor(i){super(i,"llm")}async stream(i){const a={...i,tools:i.tools??this.ctx.tools.schemas(i.settings,i.mode)};return await this.ctx.events.waterfall("agent/request",a,async()=>{switch(zA(a.settings.provider,a.settings.model,a.model)){case"anthropic":return await _A(a);case"gemini":return await CA(a);case"openai-responses":return await MA(a);default:return await AA(a)}})}}const vm=3;function IA(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)/vm)+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)/vm)+4}return Math.ceil((e.result??"").length/vm)+4}function Ch(e){return e.reduce((i,a)=>i+IA(a),0)}function So(e){return e?.context??128e3}function uk(e,i){const r=Ch(e)+2e3,o=So(i),u=Math.min(r/o,1);return{used:r,limit:o,ratio:u,pct:Math.round(u*100)}}const dk=.85,jh=5,UA=/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,BA=/\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 Ng(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"}:UA.test(i)?{retry:!1,reason:"permanent"}:BA.test(i)?{retry:!0,reason:"transient"}:{retry:!1,reason:"unknown"}}function $A(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(),o=r.startsWith("ms")||r.startsWith("milli")?a:r.startsWith("m")&&r!=="ms"&&!r.startsWith("milli")?a*6e4:a*1e3;return Math.min(Math.max(o,500),6e4)}function Eg(e,i="",a=Math.random){const o=Math.min(1500*2**(e-1),24e3)*(.8+a()*.4);return Math.round(Math.max(o,$A(i)??0))}const wm=3,PA=new Set(["write_file","edit_file","rewrite_file"]);function HA(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)/wm)+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)/wm)+4}return Math.ceil((e.result??"").length/wm)+4}function id(e){return e.reduce((i,a)=>i+HA(a),0)}function ia(e,i,a=.35){if(e.length<=i)return e;const r=Math.floor(i*a),o=i-r;return`${e.slice(0,o)}
73
+ … [${e.length-i} characters omitted] …
74
+ ${e.slice(e.length-r)}`}function FA(e){return!!(e&&e.role==="assistant"&&e.compaction)}function qA(e,i,a=4){const r=[];if(e.forEach((d,p)=>{d.role==="user"&&r.push(p)}),r.length===0)return null;let o=r[r.length-1],u=id(e.slice(o));for(let d=r.length-2;d>=0;d-=1){const p=id(e.slice(r[d],r[d+1]));if(u+p>i)break;u+=p,o=r[d]}return o<a?null:{cut:o,head:e.slice(0,o),tail:e.slice(o),midTurn:!1}}function GA(e){const i=e[1];return e[0]?.role==="user"&&FA(i)?{text:i.content,files:i.compaction?.files??[],skip:2}:null}function YA(e,i=[]){const a=new Set(i),r=[...i];for(const o of e)if(o.role==="assistant")for(const u of o.toolCalls){const d=typeof u.args.path=="string"?u.args.path:"";!d||!PA.has(u.name)||(a.has(d)&&r.splice(r.indexOf(d),1),a.add(d),r.push(d))}return r}function KA(e){const i=e.call.name;return e.status==="error"?1500:i==="read_file"?700:i==="write_file"||i==="edit_file"||i==="rewrite_file"?400:i==="shell"?2500:1500}function fk(e){const i=JSON.stringify(e);return i.length>600?`${i.slice(0,600)}…`:i}function VA(e){const i=[];for(const a of e)if(a.role==="user"){const r=(a.attachments??[]).map(o=>o.name);i.push(`[USER]
75
+ ${ia(a.content,6e3)}${r.length?`
76
+ [Attachments: ${r.join(", ")}]`:""}`)}else if(a.role==="assistant"){const r=[];a.content.trim()&&r.push(ia(a.content.trim(),4e3));for(const o of a.toolCalls)r.push(`→ ${o.name} ${fk(o.args)}`);r.length&&i.push(`[ASSISTANT]
77
+ ${r.join(`
78
+ `)}`)}else{const r=a.status==="done"?"ok":a.status;i.push(`[RESULT ${a.call.name} · ${r}]
79
+ ${ia(a.result??"",KA(a))}`)}return i}function XA(e,i){const a=[];let r=[],o=0;for(const u of e)r.length&&o+u.length>i&&(a.push(r.join(`
80
+
81
+ ---
82
+
83
+ `)),r=[],o=0),r.push(u),o+=u.length+9;return r.length&&a.push(r.join(`
84
+
85
+ ---
86
+
87
+ `)),a}function ZA(e,i,a){const r=e.filter(d=>d.role==="user").map(d=>`- ${ia(d.content.trim().replace(/\s+/g," "),300)}`),o=[...e].reverse().find(d=>d.role==="assistant"&&!!d.content.trim()),u=e.filter(d=>d.role==="tool").length;return[i?`## Earlier summary
88
+ ${i}`:"","## User requests so far",r.slice(-12).join(`
89
+ `)||"- (none)",o?`## Last assistant conclusion
90
+ ${ia(o.content.trim(),1500)}`:"",`## Activity
91
+ ${u} tool calls were made. This summary was built without the model, so details may be missing: re-read files before relying on them.`,a.length?`## Files changed
92
+ ${a.map(d=>`- ${d}`).join(`
93
+ `)}`:""].filter(Boolean).join(`
94
+
95
+ `)}function QA(e,i=4){const a=[];for(let r=e.length-1;r>=0&&a.length<i;r-=1){const o=e[r];o.role==="tool"&&a.push(`• ${o.call.name} ${fk(o.call.args)} → ${o.status}
96
+ ${ia(o.result??"",1200)}`)}return a.reverse().join(`
97
+
98
+ `)}const WA=`You are a session compactor for a coding agent. Produce a dense, structured summary that REPLACES the conversation, so the agent can continue as if it had seen everything.
99
+
100
+ You may receive <previous_summary> (an earlier compaction) and <new_transcript> (what happened after it). Merge them into ONE updated summary: keep what is still true and relevant, drop what was superseded or finished long ago, and never invent facts.
101
+
102
+ Write these sections (omit a section only if it is truly empty):
103
+
104
+ ## Goal
105
+ What the user wants overall, with their constraints, preferences and style requirements in their own words.
106
+
107
+ ## Done
108
+ Concrete outcomes: what was built or changed (file paths, function names), commands that mattered with their key results, bugs found and how they were fixed, decisions made and why.
109
+
110
+ ## State
111
+ The exact current state of the workspace and what has been verified (tests, builds) versus assumed. Anything broken or half-finished.
112
+
113
+ ## Next
114
+ The ordered next steps. Quote the user's latest request verbatim if it is not finished.
115
+
116
+ ## Facts
117
+ Technical facts the agent would otherwise have to rediscover: versions, commands to run checks, architecture notes, pitfalls, error messages worth remembering.
118
+
119
+ Rules: keep exact paths, identifiers, commands and error text; do not paste large file contents; do not list every file touched (a tracked file list is appended automatically); no preamble or closing remarks; stay under about 1500 words.`,JA=2,eO=`[Summary of the earlier conversation — the original messages were compacted to save context]
120
+
121
+ `;function Ta(e,i){window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:e,tone:i}}))}function tO(e){return new Promise(i=>window.setTimeout(i,e))}function C0(e){return e>=1e3?`${Math.round(e/1e3)}k`:String(e)}const $u=new Set;function j0(e){return $u.has(e)}function A0(e){const i=Ch(e)+2e3;for(let a=e.length-1;a>=0;a-=1){const r=e[a];if(r.role==="assistant"&&r.usage?.input){const o=r.usage.input+(r.usage.output??0)+Ch(e.slice(a+1));return Math.max(i,o)}}return i}class nO extends ki{static provide="compaction";static inject=["sessions","llm"];constructor(i){super(i,"compaction")}isCompacting(i){return j0(i)}async checkAutoCompact(i,{midTurn:a=!1}={}){const r=this.ctx.sessions.current(i);if(!r||r.messages.length<4||j0(i))return!1;const o=Ae.getState(),u=ul(o.provider,Xn(o)),d=A0(r.messages)/So(u);return d<dk?!1:(Ta(`Context at ${Math.min(Math.round(d*100),100)}% — compacting before the next request…`,"info"),await this.compact(i,{midTurn:a}))}async compact(i,a={}){if($u.has(i))return!1;$u.add(i),wi.getState().setCompacting(i,!0);try{return await this.run(i,a)}catch(r){return Ta(`Compaction failed: ${r instanceof Error?r.message:"unknown error"}. Context was left unchanged.`,"error"),!1}finally{$u.delete(i),wi.getState().setCompacting(i,!1)}}async run(i,a){const r=this.ctx.sessions.current(i);if(!r)return!1;const o=r.messages,u=Ae.getState(),d=Xn(u);if(!d)return!1;const p=ul(u.provider,d),g=So(p),x=A0(o),b=Math.min(Math.floor(g*.3),6e4);let h=a.midTurn?null:qA(o,b);const v=o[o.length-1];if(!h){if(o.length<4)return a.manual&&Ta("Nothing to compact yet.","info"),!1;v.role==="user"&&!a.midTurn?h={cut:o.length-1,head:o.slice(0,-1),tail:[v],midTurn:!1}:h={cut:o.length,head:o.slice(),tail:[],midTurn:!0}}if(h.head.length<3)return a.manual&&Ta("Nothing to compact yet.","info"),!1;const y=GA(h.head),k=h.head.slice(y?.skip??0),S=YA(k,y?.files??[]);let j,_=!1;try{j=await this.summarise(p,y?.text??"",k,a.focus)}catch(R){const G=x/g;if(!a.manual&&G<.95)return Ta(`Auto-compact failed: ${R instanceof Error?R.message:"unknown error"}. Continuing with full context.`,"error"),!1;if(a.manual)return Ta(`Compaction failed: ${R instanceof Error?R.message:"unknown error"}.`,"error"),!1;j=ZA(k,y?.text??"",S),_=!0}if(!j.trim())return!1;const A=Date.now(),C=a.midTurn?"mid-turn":a.manual?"manual":"auto",M=o.find(R=>R.role==="user"),B=[];if(M){const R=(M.attachments??[]).map(G=>G.name);B.push({...M,content:`${ia(M.content,8e3)}${R.length?`
122
+ [Attachments: ${R.join(", ")}]`:""}`,attachments:void 0})}const D={id:In("msg"),role:"assistant",content:`${eO}${j.trim()}${S.length?`
123
+
124
+ ## Files changed (tracked)
125
+ ${S.map(R=>`- ${R}`).join(`
126
+ `)}`:""}`,reasoning:"",toolCalls:[],round:0,model:d,provider:u.provider,createdAt:A,durationMs:0,compaction:{files:S,turns:h.head.filter(R=>R.role==="user").length,toolCalls:h.head.filter(R=>R.role==="tool").length,at:A,trigger:C,fallback:_||void 0}};if(B.push(D),h.tail.length>0)B.push(...h.tail);else if(a.midTurn){const R=[...o].reverse().find(Z=>Z.role==="user"),G=QA(o);B.push({id:In("msg"),role:"user",content:["[Context compacted while you were working. The summary above is the record so far.]",R?`The request you are working on:
127
+ ${ia(R.content.trim(),6e3)}`:"",G?`Most recent steps (verbatim):
128
+ ${G}`:"","Continue from exactly here. Do not redo completed work."].filter(Boolean).join(`
129
+
130
+ `),attachments:R?.attachments,createdAt:A})}const N=id(B)+2e3;if(N>=x)return a.manual&&Ta("Compaction would not free any space, so nothing changed.","info"),!1;const z=this.ctx.sessions.current(i);if(!z||z.messages.length!==o.length||z.messages[z.messages.length-1]?.id!==v.id)return a.manual&&Ta("The conversation changed while compacting, so nothing was changed. Try again.","info"),!1;this.ctx.sessions.updateSession(i,{messages:B});const q=h.tail.filter(R=>R.role==="user").length;return Ta(`Context compacted: ${C0(x)} → ${C0(N)} tokens${q>1?` · kept the last ${q} turns`:""}${_?" · summary built without the model":""}.`,_?"info":"success"),!0}async summarise(i,a,r,o){const u=Math.min(Math.floor(So(i)*.45*3),12e4),d=XA(VA(r),Math.max(u,12e3));let p=a;for(let g=0;g<d.length;g+=1){const x=g===d.length-1,b=[p?`<previous_summary>
131
+ ${p}
132
+ </previous_summary>`:"",`<new_transcript part="${g+1}/${d.length}">
133
+ ${d[g]}
134
+ </new_transcript>`,o?.trim()&&x?`<focus>
135
+ ${o.trim()}
136
+ </focus>
137
+ Give extra weight to the focus above.`:"","Write the updated summary now."].filter(Boolean).join(`
138
+
139
+ `);p=await this.complete(i,b)}return p}async complete(i,a){const r=Ae.getState(),o=new AbortController;for(let u=1;;u+=1){let d="";try{return((await this.ctx.llm.stream({settings:r,model:i,history:[{id:In("msg"),role:"user",content:a,createdAt:Date.now()}],system:WA,mode:"plan",tools:[],signal:o.signal,handlers:{onText:g=>{d+=g},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}}})).content||d).trim()}catch(p){const g=p instanceof Error?p.message:"";if(u>=JA||!Ng(g).retry)throw p;await tO(Eg(u,g))}}}}function Sg(e){return e.startsWith("mcp__")?e.split("__").slice(2).join(" ").replace(/_/g," ")||"MCP tool":{shell:"Shell",read_file:"Read file",list_files:"List files",write_file:"Write file",edit_file:"Edit file",rewrite_file:"Rewrite file",grep:"Grep",web_search:"Web search",read_url:"Read URL",git:"Git",subagent:"Subagent",skill:"Skill"}[e]??"Tool"}function _g(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 iO=12e3,aO=8;function km(){return new DOMException("Aborted","AbortError")}function rO(e,i){return new Promise(a=>{const r=()=>{window.clearTimeout(o),i.removeEventListener("abort",r),a()},o=window.setTimeout(r,e);i.addEventListener("abort",r,{once:!0})})}function sO(e,i){if(id(e)<=i)return;const a=e.filter(r=>r.role==="tool");for(const r of a.slice(0,Math.max(0,a.length-aO)))r.result&&r.result.length>200&&(r.result=`[earlier output of ${r.call.name} pruned: ${r.result.length} characters]`)}class lO extends ki{static provide="subagents";static inject=["tools","llm","systemPrompt"];constructor(i){super(i,"subagents")}async run(i){const{signal:a,onProgress:r}=i,o=i.task.trim();if(!o)return{output:"The subagent was not given a task.",rounds:0,toolCalls:0,capped:!1};if(a.aborted)throw km();const u=i.type??"explore",d=td[u],p=Ae.getState(),g=ul(p.provider,Xn(p)),x=this.ctx.systemPrompt.buildSubagentPrompt(p,i.sessionId,u),b=new Set(d.tools),h=this.ctx.tools.schemas(p,"plan",{subagent:!0}).filter(A=>b.has(A.name)),v=Math.floor(So(g)*.6),y=[{id:In("sub"),role:"user",content:[`Task (${d.label.toLowerCase()}): ${o}`,i.context?.trim()?`
140
+ Context from the main agent:
141
+ ${i.context.trim()}`:"",`
142
+ Investigate now, then write the report.`].filter(Boolean).join(`
143
+ `),createdAt:Date.now()}],k=[],S=A=>{k.push(A),r?.(`${d.label} subagent
144
+ ${k.slice(-14).join(`
145
+ `)}`)};S("starting…");let j=0,_=!1;for(let A=0;;A+=1){if(a.aborted)throw km();const C=A>=d.maxRounds;C&&(_=!0,y.push({id:In("sub"),role:"user",content:"You have used your investigation budget. Write the final report now from what you found, and say what is still unverified.",createdAt:Date.now()})),sO(y,v);const M=await this.stream(x,y,C?[]:h,a,g),B={id:In("sub"),role:"assistant",content:M.content,reasoning:M.reasoning,thinkingBlocks:M.thinkingBlocks,toolCalls:M.toolCalls,round:A,createdAt:Date.now()};if(y.push(B),M.toolCalls.length===0||C)return{output:B.content.trim()||"The subagent returned no report.",rounds:A+1,toolCalls:j,capped:_};const D=await Promise.all(M.toolCalls.map(async N=>{if(j+=1,S(`${N.name} ${ia(_g(N.name,N.args),90)}`),!b.has(N.name))return this.toolMessage(N,A,"error",`Tool "${N.name}" is not available to this subagent.`);try{const z=await this.ctx.tools.execute(N.name,N.args,p,"plan",a);return this.toolMessage(N,A,z.isError?"error":"done",ia(z.output,iO))}catch(z){if(z instanceof DOMException&&z.name==="AbortError")throw z;return this.toolMessage(N,A,"error",z instanceof Error?z.message:"The tool failed.")}}));y.push(...D)}}toolMessage(i,a,r,o){return{id:In("sub"),role:"tool",call:i,status:r,result:o,round:a,createdAt:Date.now()}}async stream(i,a,r,o,u){const d=Ae.getState();for(let p=1;;p+=1)try{return await this.ctx.llm.stream({settings:d,model:u,history:a,system:i,mode:"plan",tools:r,signal:o,handlers:{onText:()=>{},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}}})}catch(g){if(o.aborted)throw km();const x=g instanceof Error?g.message:"";if(p>jh||!Ng(x).retry)throw g;await rO(Eg(p,x),o)}}}const Ah=e=>`maxcode-plugin-theme-${e}`;function oO(e){return Object.entries(e).filter(([i,a])=>/^[a-z][a-z0-9-]*$/.test(i)&&/^[\d\s.]+$/.test(a))}function cO(e){const i=(e.canvas??"").trim().split(/\s+/).map(Number),[a,r,o]=i.length===3?i:[255,255,255];return .2126*a+.7152*r+.0722*o<110}function uO(e,i){const a=oO(i).map(([r,o])=>`--${r}:${o.trim()}`);return a.length===0?"":`[data-theme='${e}']{${a.join(";")}}`}function dO(e,i){if(typeof document>"u")return;let a=document.getElementById(Ah(e));a||(a=document.createElement("style"),a.id=Ah(e),document.head.append(a)),a.textContent=i}function fO(e){typeof document>"u"||document.getElementById(Ah(e))?.remove()}class pO extends ki{static provide="ui";_commands=new Map;_panels=new Map;_themes=new Map;constructor(i){super(i,"ui")}registerCommand(i,a,r){const o={id:i,label:a,run:r};return this._commands.set(i,o),()=>{this._commands.get(i)===o&&this._commands.delete(i)}}registerPanel(i,a,r){const o={id:i,label:a,render:r};return this._panels.set(i,o),()=>{this._panels.get(i)===o&&this._panels.delete(i)}}registerTheme(i,a,r){const o={id:i,label:a,palette:r};return this._themes.set(i,o),Pw({id:i,label:a,dark:cO(r)}),dO(i,uO(i,r)),()=>{this._themes.get(i)===o&&(this._themes.delete(i),Hw(i),fO(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 mO(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 hO(e){let i=0;for(const a of e)a.role==="assistant"&&typeof a.cost=="number"&&(i+=a.cost);return i}function Oh(e){return e<=0?"$0.00":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function gO(e,i){return new Promise(a=>{const r=()=>{window.clearTimeout(o),i.removeEventListener("abort",r),a()},o=window.setTimeout(r,e);i.addEventListener("abort",r,{once:!0})})}function O0(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}class xO extends ki{static provide="agentLoop";static inject=["sessions","systemPrompt","tools","llm","approval","compaction","subagents"];controllers=new Map;queue=uA((i,a)=>this.runTurn(i,a));constructor(i){super(i,"agentLoop")}isBusy(i){return this.queue.isBusy(i)}stopRun(i){this.queue.clear(i),this.controllers.get(i)?.abort(),this.ctx.events.serial("agent/turn-stopping",i)}stopAllRuns(){this.queue.clearAll(),this.controllers.forEach((i,a)=>{i.abort(),this.ctx.events.serial("agent/turn-stopping",a)})}runAgent(i,a){const r=this.ctx.sessions.current(i);if(!r)return;const o=a??bm(r.messages);o&&this.queue.push(i,o)}regenerateLastTurn(i){const a=this.ctx.sessions.current(i);if(!a||this.queue.isBusy(i))return!1;let r=-1;for(let u=a.messages.length-1;u>=0;u-=1)if(a.messages[u].role==="user"){r=u;break}if(r<0)return!1;const o=a.messages[r].id;return this.ctx.sessions.updateSession(i,{messages:a.messages.slice(0,r+1)}),this.runAgent(i,o),!0}async runTurn(i,a){const r=this.ctx.sessions.current(i);if(!r||!this.ctx.sessions.turnHistory(r.messages,a))return;const o=new AbortController;this.controllers.set(i,o),wi.getState().setStreaming(i,!0);const u=Ae.getState(),d=hg(u.provider),p=r.mode??u.mode,g=Date.now();let x=0,b;try{e:for(let h=0;x=h+1,!o.signal.aborted;h+=1){let v=this.ctx.sessions.current(i);if(!v)break;if(bm(v.messages)===a&&await this.ctx.compaction.checkAutoCompact(i,{midTurn:h>0})){const fe=this.ctx.sessions.current(i);if(!fe)break;const le=bm(fe.messages);if(!le)break;a=le,v=fe}const y=this.ctx.sessions.turnHistory(v.messages,a);if(!y)break;const k=In("msg"),S={id:k,role:"assistant",content:"",reasoning:"",toolCalls:[],round:h,model:Xn(u),provider:u.provider,createdAt:Date.now()};this.ctx.sessions.addMessage(i,S);let j="",_="",A,C={};const M=()=>{A===void 0&&(A=window.setTimeout(()=>{A=void 0,this.ctx.sessions.updateMessage(i,k,{content:j,reasoning:_})},40))},B={sessionId:i,round:h,history:y,settings:u,mode:p,signal:o.signal,assistantId:k};await this.ctx.events.waterfall("agent/pre-step",B,()=>{});let D,N=0;for(;;)try{D=await this.ctx.llm.stream({settings:u,model:ul(u.provider,Xn(u)),history:y,system:this.ctx.systemPrompt.assemble(u,p,i),mode:p,signal:o.signal,handlers:{onText:Z=>{j+=Z,M()},onReasoning:Z=>{_+=Z,M()},onToolCalls:()=>{},onUsage:Z=>{C=Z}}});break}catch(Z){const fe=O0(Z)||o.signal.aborted,le=Z instanceof Error?Z.message:"",J=Ng(le);if(!fe&&J.retry&&N<jh&&!j&&!_){N+=1;const re=Eg(N,le);window.dispatchEvent(new CustomEvent("maxcode:notice",{detail:{message:`${d} had a temporary error. Retrying in ${Math.round(re/1e3)}s (${N}/${jh})…`,tone:"info"}})),await gO(re,o.signal);continue}A!==void 0&&window.clearTimeout(A),b=fe?void 0:EA(Z,d),this.ctx.sessions.updateMessage(i,k,{content:j,reasoning:_,stopped:fe,durationMs:Date.now()-g,error:b}),await this.ctx.events.waterfall("agent/request-error",Z,B,()=>{});break e}if(A!==void 0&&window.clearTimeout(A),this.ctx.sessions.updateMessage(i,k,{content:D.content,reasoning:D.reasoning,thinkingBlocks:D.thinkingBlocks,toolCalls:D.toolCalls,usage:C.input||C.output?C:D.usage,cost:mO(C.input||C.output?C:D.usage,ul(u.provider,Xn(u))),durationMs:Date.now()-g,stopped:o.signal.aborted||void 0}),this.ctx.sessions.updateSession(i,{provider:u.provider,model:Xn(u),mode:p}),o.signal.aborted)break;if(D.toolCalls.length===0){const Z={sessionId:i,round:h,assistant:S,toolResults:[],stopped:o.signal.aborted};this.ctx.events.emit("agent/step-finish",Z);break}const z=[],q=async Z=>{const fe=nd(u,Z.name);if(!fe?.enabled){const E={id:In("tool"),role:"tool",call:Z,status:"error",result:"This tool is disabled in Settings → Tools.",round:h,createdAt:Date.now()};return this.ctx.sessions.addMessage(i,E),{message:E,stopped:!1}}const le=In("tool"),J={id:le,role:"tool",call:Z,status:fe.approval==="ask"?"awaiting":"running",round:h,createdAt:Date.now()};this.ctx.sessions.addMessage(i,J);let O,re="";const ie=E=>{re=E,O===void 0&&(O=window.setTimeout(()=>{O=void 0,this.ctx.sessions.updateMessage(i,le,{result:re})},250))},ne=Date.now();try{const E=await this.ctx.tools.execute(Z.name,Z.args,u,p,o.signal,Z.id,a,{sessionId:i,onProgress:ie});O!==void 0&&window.clearTimeout(O);const pe={...J,status:E.isError?"error":"done",result:E.output,durationMs:Date.now()-ne,diff:E.diff};return this.ctx.sessions.updateMessage(i,le,pe),{message:pe,stopped:!1}}catch(E){O!==void 0&&window.clearTimeout(O);const pe=O0(E),_e={...J,status:"error",result:pe?"Stopped.":E instanceof Error?E.message:"The tool failed.",durationMs:Date.now()-ne};return this.ctx.sessions.updateMessage(i,le,_e),{message:_e,stopped:pe}}},R=D.toolCalls;for(let Z=0;Z<R.length&&!o.signal.aborted;){let fe=Z+1;if(R[Z].name==="subagent")for(;fe<R.length&&R[fe].name==="subagent";)fe+=1;const le=await Promise.all(R.slice(Z,fe).map(q));if(z.push(...le.map(J=>J.message)),le.some(J=>J.stopped))break;Z=fe}const G={sessionId:i,round:h,assistant:S,toolResults:z,stopped:o.signal.aborted};if(this.ctx.events.emit("agent/step-finish",G),o.signal.aborted){const Z=this.ctx.sessions.current(i);if(Z){const fe=new Set(Z.messages.filter(le=>le.role==="tool").map(le=>le.call.id));for(const le of D.toolCalls)fe.has(le.id)||this.ctx.sessions.addMessage(i,{id:In("tool"),role:"tool",call:le,status:"error",result:"Stopped before the tool ran.",round:h,createdAt:Date.now()})}break}}}finally{this.controllers.delete(i),wi.getState().setStreaming(i,!1);const h={sessionId:i,userMessageId:a,rounds:x,durationMs:Date.now()-g,stopped:o.signal.aborted,error:b};this.ctx.events.emit("agent/turn-finish",h)}}}const bO="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 M0(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a}function yO(e){const i=e.replace(/<think>[\s\S]*?<\/think>/gi,"").split(`
146
+ `).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 vO(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"?M0(i.content,700):"",assistant:a&&a.role==="assistant"?M0(a.content,700):""}}class wO 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||!Ae.getState().aiSessionTitles)return;const o=this.ctx.sessions.current(a.sessionId);!o||(o.titleSource??"auto")!=="auto"||this.generate(a.sessionId)})}async generate(i,{force:a=!1}={}){if(this.inflight.has(i))return null;const r=this.ctx.sessions.current(i);if(!r||!a&&(r.titleSource??"auto")!=="auto")return null;const{user:o,assistant:u}=vO(r.messages);if(!o)return null;const d=Ae.getState(),p=ul(d.provider,Xn(d)),g=Object.fromEntries(Object.entries(d.tools).map(([v,y])=>[v,{...y,enabled:!1}])),x=Do(p),b={...d,tools:g,webSearchEnabled:!1,temperature:.3,maxTokens:512,effort:x[0]??d.effort},h=[{id:In("title"),role:"user",createdAt:Date.now(),content:`Name this conversation.
147
+
148
+ User: ${o}
149
+
150
+ Assistant: ${u||"(no answer yet)"}`}];this.inflight.add(i),wi.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:h,system:bO,mode:"plan",signal:v.signal,handlers:{onText:A=>{k+=A},onReasoning:()=>{},onToolCalls:()=>{},onUsage:()=>{}}}).finally(()=>window.clearTimeout(y)),j=yO(S.content||k),_=this.ctx.sessions.current(i);return!j||!_||!a&&(_.titleSource??"auto")!=="auto"?null:(this.ctx.sessions.updateSession(i,{title:j,titleSource:"ai"}),j)}catch{return null}finally{this.inflight.delete(i),wi.getState().setTitling(i,!1)}}}const kO=28e3;function NO(e,i=kO){return e.length<=i?e:`${e.slice(0,i)}
151
+ … truncated (${e.length-i} more characters)`}function Vr(e){return e&&typeof e=="object"?e:{}}function mr(e){return typeof e=="string"?e:""}function zi(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function qr(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function EO(e,i){const a=e[i];return typeof a=="string"?a:void 0}function Nm(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 SO(e){const i=Array.isArray(e.entries)?e.entries:[];if(i.length===0)return"This folder is empty.";const a=i.map(o=>{const u=Vr(o),d=mr(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?`
152
+ … listing truncated. Narrow the path or reduce depth.`:"";return`${mr(e.root)?`Root: ${mr(e.root)}
153
+ `:""}${a.join(`
154
+ `)}${r}`}function Em(e){const i=Vr(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 Sm(e){if(!e)return"";const i=e.line?` at L${e.line}${e.column?`:${e.column}`:""}`:"";return` · +${e.added} −${e.removed}${i}`}async function _m(){await qe.getState().refresh().catch(()=>{})}const _O="tool-fs",TO=["tools"];function CO(e){const i=[e.tools.register({name:"read_file",description:"Read a text file from the workspace. Use offset and limit for large files.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative path from the workspace root."},offset:{type:"number",description:"1-based first line. Defaults to 1."},limit:{type:"number",description:"Maximum lines. Defaults to 400."}},required:["path"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=qr(a,"path"),u=Vr((await Di("read_file",{path:o},r.mode,r.signal)).result);if(u.binary===!0)return{output:`${o} is binary (${zi(u.size)??0} bytes).`,isError:!1};const d=Math.max(1,Math.round(Nm(a,"offset",1))),p=Math.min(Math.max(1,Math.round(Nm(a,"limit",400))),2e3),g=mr(u.content).split(`
155
+ `),x=g.slice(d-1,d-1+p),b=g.length-(d-1+p),h=`${mr(u.path)||o} · ${g.length} lines${u.truncated===!0?" · file clipped by daemon":""}`,v=b>0?`
156
+ … ${b} more lines. Read again with offset ${d+p}.`:"";return{output:NO(`${h}
157
+ ────
158
+ ${x.join(`
159
+ `)}${v}`),isError:!1}}}),e.tools.register({name:"list_files",description:"List files and folders below a workspace path.",parameters:{type:"object",properties:{path:{type:"string",description:"Folder path. Defaults to the workspace root."},depth:{type:"number",description:"Recursion depth, 1–8. Defaults to 3."}},additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=Vr((await Di("list_files",{path:EO(a,"path")??"",depth:Math.min(Math.max(1,Nm(a,"depth",3)),8)},r.mode,r.signal)).result);return{output:SO(o),isError:!1}}}),e.tools.register({name:"write_file",description:"Create a file or replace its full contents. Prefer edit_file for small changes.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},content:{type:"string",description:"Complete file content."}},required:["path","content"],additionalProperties:!1},allowedInMode:a=>a==="build",async execute(a,r){const o=qr(a,"path"),u=qr(a,"content"),d=Vr((await Di("write_file",{path:o,content:u},r.mode,r.signal,r.turnId)).result);await _m();const p=d.created===!0?"Created":"Updated",g=Em(d);return{output:`${p} ${mr(d.path)||o} · ${u.split(`
160
+ `).length} lines, ${zi(d.size)??u.length} bytes${Sm(g)}.`,isError:!1,diff:g}}}),e.tools.register({name:"rewrite_file",description:"Replace the complete contents of an existing file. Use when most of the file changes.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},content:{type:"string",description:"The new complete file content."}},required:["path","content"],additionalProperties:!1},allowedInMode:a=>a==="build",async execute(a,r){const o=qr(a,"path"),u=qr(a,"content"),d=Vr((await Di("rewrite_file",{path:o,content:u},r.mode,r.signal,r.turnId)).result);await _m();const p=Em(d);return{output:`Rewrote ${mr(d.path)||o} · ${u.split(`
161
+ `).length} lines, ${zi(d.size)??u.length} bytes${Sm(p)}.`,isError:!1,diff:p}}}),e.tools.register({name:"edit_file",description:"Replace an exact text occurrence in a file. oldText must match whitespace exactly and be unique unless replaceAll is true.",parameters:{type:"object",properties:{path:{type:"string",description:"Relative file path."},oldText:{type:"string",description:"Exact text to replace."},newText:{type:"string",description:"Replacement text."},replaceAll:{type:"boolean",description:"Replace every occurrence. Defaults to false."}},required:["path","oldText","newText"],additionalProperties:!1},allowedInMode:a=>a==="build",async execute(a,r){const o=qr(a,"path"),u=qr(a,"oldText"),d=typeof a.newText=="string"?a.newText:"",p=Vr((await Di("edit_file",{path:o,oldText:u,newText:d,replaceAll:a.replaceAll===!0},r.mode,r.signal,r.turnId)).result);await _m();const g=Em(p);return{output:`Edited ${mr(p.path)||o} · ${zi(p.replacements)??1} replacement${zi(p.replacements)===1?"":"s"}${Sm(g)}.`,isError:!1,diff:g}}})];return()=>i.forEach(a=>a())}const jO=Object.freeze(Object.defineProperty({__proto__:null,apply:CO,inject:TO,name:_O},Symbol.toStringTag,{value:"Module"})),AO=28e3;function OO(e,i=AO){return e.length<=i?e:`${e.slice(0,i)}
162
+ … truncated (${e.length-i} more characters)`}function MO(e){return e&&typeof e=="object"?e:{}}function Tm(e){return typeof e=="string"?e:""}function pk(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function RO(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function DO(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 zO(e,i){const a=[`$ ${i}`,Tm(e.stdout)];Tm(e.stderr)&&a.push(`stderr:
163
+ ${Tm(e.stderr)}`);const r=pk(e.code);return r!==void 0&&r!==0&&a.push(`exit code: ${r}`),e.timedOut===!0&&a.push("The command timed out."),a.filter(o=>o!=="").join(`
164
+ `)}async function LO(){await qe.getState().refresh({treeOnly:!0}).catch(()=>{})}const IO="tool-shell",UO=["tools"];function BO(e){return e.tools.register({name:"shell",description:"Run a command in the user's default shell (bash/zsh on Linux and macOS, PowerShell on Windows; see the Environment section) from 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 command to run, written for the shell named in the Environment section."},timeoutMs:{type:"number",description:"Timeout in milliseconds (max 600000)."}},required:["command"],additionalProperties:!1},allowedInMode:()=>!0,async execute(i,a){const r=RO(i,"command"),o=MO((await Di("shell",{command:r,timeoutMs:DO(i,"timeoutMs",12e4)},a.mode,a.signal)).result);return LO(),{output:OO(zO(o,r)),isError:(pk(o.code)??0)!==0||o.timedOut===!0}}})}const $O=Object.freeze(Object.defineProperty({__proto__:null,apply:BO,inject:UO,name:IO},Symbol.toStringTag,{value:"Module"})),PO=28e3;function HO(e,i=PO){return e.length<=i?e:`${e.slice(0,i)}
165
+ … truncated (${e.length-i} more characters)`}function mk(e){return e&&typeof e=="object"?e:{}}function R0(e){return typeof e=="string"?e:""}function FO(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function qO(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function GO(e,i){const a=e[i];return typeof a=="string"?a:void 0}function YO(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 KO(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=mk(u);return`${R0(d.file)}:${FO(d.line)??0}: ${R0(d.text)}`}),o=e.truncated===!0?`
166
+ … more matches exist. Narrow the pattern or path.`:"";return r.join(`
167
+ `)+o}const VO="tool-grep",XO=["tools"];function ZO(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=qO(i,"pattern"),o=mk((await Di("grep",{pattern:r,path:GO(i,"path")??"",ignoreCase:i.ignoreCase===!0},a.mode,a.signal)).result),u=Math.min(Math.max(1,Math.round(YO(i,"maxResults",80))),200),d=Array.isArray(o.matches)?o.matches.slice(0,u):[],p={...o,matches:d,truncated:o.truncated===!0||Array.isArray(o.matches)&&o.matches.length>u};return{output:HO(KO(p,r)),isError:!1}}})}const QO=Object.freeze(Object.defineProperty({__proto__:null,apply:ZO,inject:XO,name:VO},Symbol.toStringTag,{value:"Module"})),WO=28e3;function JO(e,i=WO){return e.length<=i?e:`${e.slice(0,i)}
168
+ … truncated (${e.length-i} more characters)`}function eM(e){return e&&typeof e=="object"?e:{}}function dr(e){return typeof e=="string"?e:""}function hk(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function tM(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}function nM(e){const i=[];dr(e.current)&&i.push(`Current branch: ${dr(e.current)}`),dr(e.branches)&&i.push(dr(e.branches)),dr(e.stdout)&&i.push(dr(e.stdout)),dr(e.stderr)&&i.push(`stderr:
169
+ ${dr(e.stderr)}`);const a=hk(e.code);return a!==void 0&&a!==0&&i.push(`exit code: ${a}`),i.filter(Boolean).join(`
170
+ `)||"Git completed with no output."}const iM="tool-git",aM=["tools"];function rM(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=tM(i,"action"),o={...i};delete o.action;const u=eM((await Di("git",{action:r,...o},a.mode,a.signal)).result);return(r==="add"||r==="commit"||r==="init"||r==="checkout")&&await qe.getState().loadGit().catch(()=>{}),{output:JO(nM(u)),isError:(hk(u.code)??0)!==0}}})}const sM=Object.freeze(Object.defineProperty({__proto__:null,apply:rM,inject:aM,name:iM},Symbol.toStringTag,{value:"Module"})),lM=28e3;function D0(e,i=lM){return e.length<=i?e:`${e.slice(0,i)}
171
+ … truncated (${e.length-i} more characters)`}function Cm(e){return e&&typeof e=="object"?e:{}}function fr(e){return typeof e=="string"?e:""}function z0(e,i){const a=e[i];if(typeof a!="string"||!a.trim())throw new Error(`Missing string argument "${i}".`);return a}const oM="tool-web",cM=["tools"];function uM(e){const i=[e.tools.register({name:"web_search",description:"Search the web for current information. Returns titles, URLs and snippets. Cite URLs you use.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."}},required:["query"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=z0(a,"query"),u=Cm((await Di("web_search",{query:o,provider:r.settings.searchProvider},r.mode,r.signal)).result),d=Array.isArray(u.results)?u.results:[];if(d.length===0)return{output:"No results found.",isError:!1};const p=d.map((g,x)=>{const b=Cm(g);return`${x+1}. ${fr(b.title)}
172
+ ${fr(b.url)}${fr(b.snippet)?`
173
+ ${fr(b.snippet)}`:""}`}).join(`
174
+
175
+ `);return{output:D0(`Search: ${o}
176
+ Provider: ${fr(u.provider)||"web"}
177
+
178
+ ${p}`),isError:!1}}}),e.tools.register({name:"read_url",description:"Read a public web page as plain text.",parameters:{type:"object",properties:{url:{type:"string",description:"The http(s) URL to read."}},required:["url"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=z0(a,"url"),u=Cm((await Di("read_url",{url:o},r.mode,r.signal)).result),d=fr(u.title);return{output:D0(`Source: ${fr(u.url)||o}${d?`
179
+ Title: ${d}`:""}
180
+
181
+ ${fr(u.content)}${u.truncated===!0?`
182
+
183
+ … page truncated.`:""}`),isError:!1}}})];return()=>i.forEach(a=>a())}const dM=Object.freeze(Object.defineProperty({__proto__:null,apply:uM,inject:cM,name:oM},Symbol.toStringTag,{value:"Module"})),fM=28e3;function pM(e,i=fM){return e.length<=i?e:`${e.slice(0,i)}
184
+ … truncated (${e.length-i} more characters)`}const mM="tool-subagent",hM=["tools","subagents"];function gM(e){const i=Object.entries(td).map(([a,r])=>`"${a}" (${r.summary})`).join("; ");return e.tools.register({name:"subagent",description:`Delegate a focused, read-only investigation to a subagent that works in its own context and returns a concise report. Types: ${i}. Give it a complete, self-contained task (it cannot see this conversation) and any file paths or constraints as context. To investigate independent questions in parallel, call this tool several times in the same message.`,parameters:{type:"object",properties:{task:{type:"string",description:"The specific question or investigation. Be precise about what the report must contain."},context:{type:"string",description:"Optional context: files to start from, what is already known, constraints."},type:{type:"string",enum:Object.keys(td),description:"explore (default), research or review."}},required:["task"],additionalProperties:!1},allowedInMode:()=>!0,async execute(a,r){const o=await e.subagents.run({task:typeof a.task=="string"?a.task:"",context:typeof a.context=="string"?a.context:"",type:mA(a.type),signal:r.signal,sessionId:r.sessionId,onProgress:r.onProgress}),u=`
185
+
186
+ — subagent: ${o.toolCalls} tool call${o.toolCalls===1?"":"s"}, ${o.rounds} round${o.rounds===1?"":"s"}${o.capped?", stopped at its round budget":""}`;return{output:pM(o.output)+u,isError:!1}}})}const xM=Object.freeze(Object.defineProperty({__proto__:null,apply:gM,inject:hM,name:mM},Symbol.toStringTag,{value:"Module"})),L0=6e4,bM="tool-skill",yM=["tools"];function vM(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 Oj(a,typeof i.file=="string"?i.file:void 0),o=[`Skill: ${r.name} · ${r.file}`,`Directory: ${r.directory}`,"────",r.content];r.files&&r.files.length>0&&o.push("────",`Bundled files (read with this tool's "file" argument):
187
+ ${r.files.map(d=>`- ${d}`).join(`
188
+ `)}`);const u=o.join(`
189
+ `);return{output:u.length>L0?`${u.slice(0,L0)}
190
+ … truncated`:u,isError:!1}}catch(r){return{output:r instanceof Error?r.message:"Could not load the skill.",isError:!0}}}})}const wM=Object.freeze(Object.defineProperty({__proto__:null,apply:vM,inject:yM,name:bM},Symbol.toStringTag,{value:"Module"}));function kM(){const e=new wg;return e.plugin(dA),e.plugin(xA),e.plugin(wA),e.plugin(kA),e.plugin(LA),e.plugin(nO),e.plugin(lO),e.plugin(pO),e.plugin(xO),e.plugin(wO),e.plugin(jO),e.plugin($O),e.plugin(QO),e.plugin(sM),e.plugin(dM),e.plugin(xM),e.plugin(wM),e}const Un=kM();function ad(e){Un.agentLoop?Un.agentLoop.stopRun(e):queueMicrotask(()=>Un.agentLoop?.stopRun(e))}function NM(){Un.agentLoop?Un.agentLoop.stopAllRuns():queueMicrotask(()=>Un.agentLoop?.stopAllRuns())}function gk(e,i){Un.agentLoop?Un.agentLoop.runAgent(e,i):queueMicrotask(()=>Un.agentLoop?.runAgent(e,i))}function jm(e){return Un.agentLoop?Un.agentLoop.regenerateLastTurn(e):!1}function xk(e){var i,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(i=0;i<o;i++)e[i]&&(a=xk(e[i]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function EM(){for(var e,i,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(i=xk(e))&&(r&&(r+=" "),r+=i);return r}function te(...e){return EM(e)}function fl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function rd(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 SM(e){const i=new Date,a=new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),r=a-864e5,o=a-6*864e5,u=a-29*864e5,d=[{label:"Today",items:[]},{label:"Yesterday",items:[]},{label:"Previous 7 days",items:[]},{label:"Previous 30 days",items:[]},{label:"Older",items:[]}],p=[...e].sort((g,x)=>x.updatedAt-g.updatedAt);for(const g of p){let x=4;g.updatedAt>=a?x=0:g.updatedAt>=r?x=1:g.updatedAt>=o?x=2:g.updatedAt>=u&&(x=3),d[x].items.push(g)}return d.filter(g=>g.items.length>0)}function _M(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 TM(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 Mh(e,i,a="text/plain"){const r=new Blob([i],{type:a}),o=URL.createObjectURL(r),u=document.createElement("a");u.href=o,u.download=e,u.click(),URL.revokeObjectURL(o)}function pl({size:e=28,className:i,spin:a=!1}){return l.jsx("span",{className:te("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:te(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 CM({compact:e=!1}){return l.jsxs("div",{className:"group/logo flex items-center gap-2",children:[l.jsx(pl,{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 jM(){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 AM(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function OM(){const e=Je(P=>P.sessions),i=Je(P=>P.activeId),a=Je(P=>P.setActive),r=Je(P=>P.newChat),o=Je(P=>P.renameSession),u=Je(P=>P.deleteSession),d=Ae(),p=qe(P=>P.info),g=qe(P=>P.addWorkspace),x=qe(P=>P.removeWorkspace),b=me(P=>P.sidebarCollapsed),h=me(P=>P.toggleSidebar),v=me(P=>P.mobileSidebarOpen),y=me(P=>P.setMobileSidebarOpen),k=me(P=>P.openSettings),S=me(P=>P.setWorkspaceOpen),j=me(P=>P.setDeployOpen),_=me(P=>P.setMcpOpen),A=me(P=>P.askConfirm),C=me(P=>P.notify),M=me(P=>P.focusComposer),B=wi(P=>P.streaming),D=wi(P=>P.titling),[N,z]=I.useState(""),[q,R]=I.useState(null),[G,Z]=I.useState(null),[fe,le]=I.useState(""),[J,O]=I.useState(""),re=I.useMemo(()=>{const P=N.trim().toLowerCase();return P?e.filter(X=>X.title.toLowerCase().includes(P)):e},[e,N]),ie=I.useMemo(()=>SM(re),[re]),ne=I.useMemo(()=>[...p.workspaces].sort((P,X)=>X.lastOpened-P.lastOpened),[p.workspaces]),E=ol(d),pe=(d.daemon?.home??"").split(/[\\/]/).filter(Boolean).pop()||p.name||"Local",_e=()=>{r(),y(!1),R(null),M()},L=P=>{a(P),y(!1),R(null)},$=async P=>{if(P===p.root){S(!0),y(!1);return}O(P);try{await g(P),y(!1)}catch(X){C(X instanceof Error?X.message:"Could not open that folder.","error")}finally{O("")}},oe=async(P,X)=>{if(await A({title:"Remove this workspace?",body:`“${X}” 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 x(P),C(`Removed ${X} from your workspaces.`,"success")}catch(je){C(je instanceof Error?je.message:"Could not remove that workspace.","error")}},xe=async P=>{R(null),await Un.titles?.generate(P,{force:!0})||C("The model could not suggest a title right now.","error")},Te=(P,X)=>{Z(P),le(X),R(null)},$e=()=>{G&&(fe.trim()&&o(G,fe),Z(null),le(""))},He=async(P,X)=>{R(null),await A({title:"Delete this conversation?",body:`“${X}” and its messages will be removed from this computer. This cannot be undone.`,confirmLabel:"Delete conversation",tone:"danger"})&&(ad(P),u(P))},Be=P=>{const X=e.find(je=>je.id===P);if(!X)return;R(null);const ye=X.messages.flatMap(je=>je.role==="user"?[`## You
191
+
192
+ ${je.content}`]:je.role==="assistant"&&je.content.trim()?[`## OpenSol
193
+
194
+ ${je.content.trim()}`]:[]).join(`
195
+
196
+ `);Mh(`opensol-${X.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,40)||"conversation"}.md`,`# ${X.title}
197
+
198
+ ${ye}
199
+ `,"text/markdown"),C("Conversation exported as Markdown.","success")},Ee=P=>{const X=e.find(ye=>ye.id===P);X&&(R(null),Mh(`opensol-${X.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,40)||"conversation"}.json`,JSON.stringify({app:"OpenSol",exportedAt:new Date().toISOString(),session:X},null,2),"application/json"),C("Conversation exported.","success"))};return l.jsxs("aside",{className:te("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(CM,{}),l.jsx("button",{type:"button",className:"icon-button ml-auto hidden lg:inline-flex",onClick:h,title:"Collapse sidebar (Ctrl B)","aria-label":"Collapse sidebar",children:l.jsx(HT,{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(Bi,{size:17})})]}),l.jsxs("nav",{className:"space-y-0.5 px-2 pt-1",children:[l.jsxs("button",{type:"button",onClick:_e,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(br,{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(vd,{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),_(!0)},className:"nav-item",children:[l.jsx(wd,{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(Qr,{size:15,strokeWidth:1.7,className:"shrink-0 text-faint"}),"Deploy"]}),l.jsxs("div",{className:"relative",children:[l.jsx(is,{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:N,onChange:P=>z(P.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(br,{size:13})})]}),ne.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(Ku,{size:15,strokeWidth:1.6,className:"text-faint"}),"Open a project folder"]}):l.jsx("div",{className:"space-y-0.5",children:ne.map(P=>{const X=P.path===p.root;return l.jsxs("div",{className:"group/ws relative",children:[l.jsxs("button",{type:"button",onClick:()=>{$(P.path)},title:P.path,className:te("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]",X?"bg-raised text-ink":"text-muted hover:bg-raised/80 hover:text-ink"),children:[l.jsx(Ku,{size:15,strokeWidth:1.6,className:te("shrink-0 transition-transform duration-200 group-hover/ws:-rotate-6 group-hover/ws:scale-110",X?"text-accent":"text-faint")}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),J===P.path?l.jsx(og,{size:11,className:"shrink-0 animate-spin text-faint"}):X?l.jsx(sn,{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:rd(P.lastOpened)})]}),l.jsx("button",{type:"button",onClick:()=>{oe(P.path,P.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 ${P.name}`,children:l.jsx(aa,{size:12})})]},P.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:re.length})]}),ie.length===0&&l.jsxs("div",{className:"px-2 py-7 text-center",children:[l.jsx("p",{className:"text-[13px] font-medium text-muted",children:N?"No conversations match":"No conversations yet"}),l.jsx("p",{className:"mt-1 text-[11.5px] leading-relaxed text-faint",children:N?"Try a shorter search.":"Start with a task, a question or a file."})]}),ie.map((P,X)=>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:P.label}),l.jsx("div",{className:"space-y-0.5",children:P.items.map((ye,je)=>l.jsx("div",{className:"group/item relative animate-slideleft",style:{animationDelay:`${Math.min(X*40+je*18,320)}ms`},children:G===ye.id?l.jsx("input",{value:fe,onChange:Me=>le(Me.target.value),onBlur:$e,onKeyDown:Me=>{Me.key==="Enter"&&$e(),Me.key==="Escape"&&(Z(null),le(""))},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:()=>L(ye.id),onDoubleClick:()=>Te(ye.id,ye.title),title:`${ye.title} · ${rd(ye.updatedAt)}`,className:te("sidebar-item pr-9",i===ye.id&&"sidebar-item-active"),children:[l.jsx("span",{className:te("min-w-0 flex-1 truncate",D[ye.id]&&"text-shimmer"),children:ye.title}),B[ye.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:Me=>{if(Me.stopPropagation(),q?.id===ye.id){R(null);return}const ot=Me.currentTarget.getBoundingClientRect(),Ke=176,jt=166,se=Math.max(8,Math.min(ot.right-Ke,window.innerWidth-Ke-8)),Le=ot.bottom+jt+8>window.innerHeight?Math.max(8,ot.top-jt-4):ot.bottom+4;R({id:ye.id,x:se,y:Le})},className:te("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",q?.id===ye.id?"flex bg-panel text-ink opacity-100":"opacity-0 group-hover/item:opacity-100 focus:opacity-100"),"aria-label":`Actions for ${ye.title}`,title:"Conversation actions",children:l.jsx(G2,{size:14})})]})},ye.id))})]},P.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:pe.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:pe}),l.jsx("p",{className:"mt-0.5 truncate text-[11px] leading-tight text-faint",children:E?`${hg(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(Ew,{size:16,strokeWidth:1.7})})]})}),q&&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:()=>R(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:q.x,top:q.y},children:(()=>{const P=e.find(X=>X.id===q.id);return P?l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>Te(P.id,P.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(Po,{size:12})," Rename"]}),l.jsxs("button",{type:"button",onClick:()=>{xe(P.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:()=>Ee(P.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(ng,{size:12})," Export JSON"]}),l.jsxs("button",{type:"button",onClick:()=>Be(P.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(ns,{size:12})," Export Markdown"]}),l.jsx("div",{className:"my-1 border-t border-line"}),l.jsxs("button",{type:"button",onClick:()=>{He(P.id,P.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(aa,{size:12})," Delete"]}),l.jsxs("p",{className:"px-2 pb-1 pt-1.5 text-[9px] text-faint",children:["Updated ",AM(P.updatedAt)]})]}):null})()})]})]})}const MM={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 RM(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 bk=864e5,I0=26;function Tg(e){const i=new Date(e);return i.setHours(0,0,0,0),i.getTime()}function yk(e){const i=new Date(e);return`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`}function DM(e,i){return e==="all"?0:Tg(i)-(e==="7d"?6:29)*bk}function U0(e,i){return typeof e.createdAt=="number"?e.createdAt:i}function zM(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 LM(e){return e===0?"12 AM":e===12?"12 PM":e<12?`${e} AM`:`${e-12} PM`}function IM(e,i,a=Date.now()){const r=DM(i,a),o=e.filter(_=>_.updatedAt>=r),u=[];for(const _ of o)for(const A of _.messages)U0(A,_.updatedAt)>=r&&u.push({message:A,session:_});const d=new Array(24).fill(0),p=new Map,g=new Map;let x=0,b=0;for(const{message:_,session:A}of u){const C=U0(_,A.updatedAt),M=yk(C),B=p.get(M);if(B?B.count+=1:p.set(M,{key:M,count:1,date:Tg(C)}),d[new Date(C).getHours()]+=1,_.role!=="assistant")continue;const D=zM(_);x+=D;const N=typeof _.cost=="number"?_.cost:0;b+=N;const z=typeof _.model=="string"?_.model.trim():"";if(!z)continue;const q=g.get(z)??{model:z,messages:0,tokens:0,cost:0};q.messages+=1,q.tokens+=D,q.cost+=N,g.set(z,q)}const h=[...g.values()].sort((_,A)=>A.tokens-_.tokens||A.messages-_.messages||_.model.localeCompare(A.model)),v=h[0],y=u.filter(_=>_.message.role==="assistant").length;let k=0;for(let _=1;_<24;_+=1)d[_]>d[k]&&(k=_);const S=UM(p,a),j=S.reduce((_,A)=>Math.max(_,A.count),0);return{sessions:o.length,messages:u.length,tokens:x,cost:b,activeDays:p.size,peakHour:u.length?LM(k):"—",favoriteModel:v?.model??"—",favoriteShare:v&&y?Math.round(v.messages/y*100):0,models:h,heatmap:S,busiestDay:j}}function UM(e,i){const a=new Date(Tg(i)),r=new Date(a);r.setDate(r.getDate()-r.getDay()-(I0-1)*7);const o=[];for(let u=0;u<I0*7;u+=1){const d=r.getTime()+u*bk,p=yk(d);o.push(e.get(p)??{key:p,count:0,date:d})}return o}function _o(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 Am(e){if(!e||e==="—")return e;const i=e.split("/");return i[i.length-1]||e}function BM(e){return!!(e.content.trim()||e.reasoning.trim()||e.error||e.stopped)}function $M(e){const i=[];let a=null,r=[];const o=()=>{r.length>0&&a?.segments.push({kind:"tools",tools:r}),r=[]};for(const u of e){if(u.role==="tool"){if(!a)continue;r.push(u);continue}if(u.role==="user"){o(),a={id:u.id,user:u,segments:[]},i.push(a);continue}!BM(u)&&u.toolCalls.length>0||(a||(a={id:u.id,segments:[]},i.push(a)),o(),a.segments.push({kind:"assistant",message:u}))}return o(),i}function B0(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function PM({messages:e,model:i,sessionId:a}){const r=I.useMemo(()=>uk(e,i),[e,i]),o=I.useMemo(()=>hO(e),[e]),u=wi(h=>a?!!h.compacting[a]:!1);if(e.length===0)return null;const{pct:d,used:p,limit:g}=r,x=d>=dk*100,b=d>=70&&!x;return l.jsx("div",{className:te("hidden items-baseline gap-1.5 text-[11.5px] tabular-nums text-muted sm:flex",b&&"text-warning",x&&"text-danger"),title:`Context window: ~${p.toLocaleString()} of ${g.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:B0(p)}),l.jsxs("span",{className:"text-faint",children:["/ ",B0(g)," tokens"]}),l.jsx("span",{className:"text-faint",children:"·"}),l.jsxs("span",{children:[d,"%"]}),o>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:Oh(o)})]})]})})}var ml=pw();function vk(e,i,a=!0,r){const o=I.useRef(i);o.current=i,I.useEffect(()=>{if(!a)return;const u=p=>{const g=e.current;if(!g)return;const x=p.target;x instanceof Node&&(g.contains(x)||r?.current?.contains(x)||o.current())},d=p=>{p.key==="Escape"&&o.current()};return document.addEventListener("pointerdown",u,!0),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("keydown",d)}},[a,e,r])}function Rd({open:e,onClose:i,children:a,className:r,labelledBy:o,wide:u=!1}){const d=I.useRef(null),p=I.useRef(null),g=I.useRef(i);return g.current=i,I.useEffect(()=>{if(!e)return;p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=d.current,b=()=>Array.from(x?.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')??[]).filter(k=>k.offsetParent!==null),h=window.setTimeout(()=>{(x?.querySelector("[data-autofocus]")??b()[0]??x)?.focus()},30),v=k=>{if(k.key==="Escape"){k.preventDefault(),g.current();return}if(k.key!=="Tab")return;const S=b();if(S.length===0)return;const j=S[0],_=S[S.length-1];k.shiftKey&&document.activeElement===j?(k.preventDefault(),_.focus()):!k.shiftKey&&document.activeElement===_&&(k.preventDefault(),j.focus())};document.addEventListener("keydown",v);const y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.clearTimeout(h),document.removeEventListener("keydown",v),document.body.style.overflow=y,p.current?.focus()}},[e]),e?ml.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":o,tabIndex:-1,className:te("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 $t({size:e=14,className:i}){return l.jsx(og,{size:e,className:te("animate-spin text-current",i),"aria-hidden":"true"})}function vi({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:te("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:te("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 Dd({options:e,value:i,onChange:a,disabled:r,className:o,size:u="sm"}){return l.jsx("div",{className:te("inline-flex items-center rounded-lg bg-raised p-0.5",u==="md"?"text-[12.5px]":"text-[11.5px]",r&&"opacity-50",o),children:e.map(d=>l.jsx("button",{type:"button",title:d.title,disabled:r,onClick:()=>a(d.value),className:te("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 HM={info:{icon:sg,className:"text-accent"},success:{icon:A2,className:"text-success"},error:{icon:M2,className:"text-danger"}};function FM(){const e=me(o=>o.toast),i=me(o=>o.dismissToast);if(I.useEffect(()=>{if(!e)return;const o=window.setTimeout(()=>i(e.id),4500);return()=>window.clearTimeout(o)},[e,i]),!e)return null;const a=HM[e.tone],r=a.icon;return ml.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:te("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(Bi,{size:13})})]}),document.body)}function qM(){const e=me(r=>r.confirm),i=me(r=>r.resolveConfirm),a=e?.tone==="danger";return l.jsx(Rd,{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:te("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(Lu,{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:te("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(sn,{size:14}),e?.confirmLabel??"Confirm"]})]})]})})}function $0({active:e,title:i,description:a,onClick:r,disabled:o}){return l.jsxs("button",{type:"button",onClick:r,disabled:o,"aria-pressed":e,className:te("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:te("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 GM({session:e}){const i=Ae(),a=Ae(G=>G.update),r=Je(G=>G.updateSession),o=me(G=>G.notify),u=qe(G=>G.root||G.info.root),d=qe(G=>G.info.name),[p,g]=I.useState(!1),[x,b]=I.useState("session"),h=I.useRef(null),v=I.useRef(null);vk(h,()=>g(!1),p,v);const[y,k]=I.useState({top:56,right:12});I.useLayoutEffect(()=>{if(!p)return;const G=()=>{const Z=v.current?.getBoundingClientRect();Z&&k({top:Z.bottom+8,right:Math.max(8,window.innerWidth-Z.right)})};return G(),window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[p]);const S=sk(i,e,u),j=typeof e?.systemPrompt=="string",_=!!u&&typeof i.workspacePrompts[u]=="string",A=j||_,C=x==="session"&&!e&&u?"workspace":x,M=C==="session",B=M?j:_,D=M?e?.systemPrompt??"":i.workspacePrompts[u]??"",N=M?rk(i,u):{text:i.systemPrompt,source:"app"},z=M?!e:!u,q=G=>{if(M){e&&r(e.id,{systemPrompt:G});return}if(!u)return;const Z={...i.workspacePrompts};G===void 0?delete Z[u]:Z[u]=G,a({workspacePrompts:Z})},R=M&&N.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:()=>g(G=>!G),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:te("icon-button relative",p&&"bg-raised text-ink"),children:[l.jsx(cC,{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&&ml.createPortal(l.jsxs("div",{ref:h,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(Dd,{value:C,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:[M?l.jsx(cg,{size:11}):l.jsx(v2,{size:11}),M?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($0,{active:!B,disabled:z,title:"Use shared prompt",description:R,onClick:()=>q(void 0)}),l.jsx($0,{active:B,disabled:z,title:M?"Custom for this session":"Custom for this workspace",description:"Write a prompt that replaces the shared one here.",onClick:()=>{B||(q(N.text),o("Started from the current shared prompt. Edit it below.","info"))}})]}),B&&!z&&l.jsx("textarea",{value:D,onChange:G=>q(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 YM=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function KM({session:e,view:i,onViewChange:a}){const r=Ae(),o=Ae(A=>A.update),u=me(A=>A.sidebarCollapsed),d=me(A=>A.toggleSidebar),p=me(A=>A.setMobileSidebarOpen),g=me(A=>A.setPaletteOpen),x=me(A=>A.openSettings),b=me(A=>A.workspaceOpen),h=me(A=>A.setWorkspaceOpen),v=me(A=>A.setDeployOpen),y=qe(A=>A.info),k=Md(),S=mh(r.theme,typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches),j=!!(e&&e.messages.length>0),_=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(OT,{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(qT,{size:17})}),l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[!e&&l.jsx(pl,{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(vw,{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:[_," turn",_===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:te("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(PM,{messages:e?.messages??[],model:k,sessionId:e?.id??null})}),l.jsxs("button",{type:"button",onClick:()=>h(!b),title:y.available?y.root:"Choose a workspace folder",className:te("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(gr,{size:13,className:"shrink-0"}),l.jsx("span",{className:"max-w-[140px] truncate",children:y.available?y.name:"No folder"})]}),l.jsx(GM,{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(Qr,{size:16,strokeWidth:1.7})}),l.jsx("button",{type:"button",className:"icon-button",onClick:()=>g(!0),title:`Search and commands (${YM?"⌘":"Ctrl"} K)`,"aria-label":"Open search and commands",children:l.jsx(is,{size:16})}),l.jsx("button",{type:"button",className:"icon-button hidden sm:inline-flex",onClick:()=>o({theme:S?"light":"dark"}),title:S?"Switch to light theme":"Switch to dark theme","aria-label":"Toggle theme",children:S?l.jsx(pg,{size:16}):l.jsx(dg,{size:16})}),l.jsx("button",{type:"button",className:"icon-button",onClick:()=>x("general"),title:"Settings","aria-label":"Open settings",children:l.jsx(Ew,{size:16})})]})]})}const Cg=[{value:"ask",label:"Ask first",description:"Confirm shell commands, edits and git changes before they run."},{value:"accept-edits",label:"Accept edits",description:"Apply file edits automatically; still confirm shell and git."},{value:"full",label:"Full access",description:"Run every enabled tool without asking. Use only in trusted folders."}],Rh=["write_file","edit_file","rewrite_file"],Dh=["shell","git","subagent"];function wk(e){const i=Rh.every(r=>e[r]?.approval==="auto"),a=Dh.every(r=>e[r]?.approval==="auto");return i&&a?"full":i?"accept-edits":"ask"}function kk(e,i){const a={};for(const r of Object.keys(e)){const o=Rh.includes(r)||Dh.includes(r),u=i==="full"?"auto":i==="accept-edits"?Rh.includes(r)?"auto":Dh.includes(r)?"ask":e[r].approval:o?"ask":e[r].approval;a[r]={...e[r],approval:u}}return a}function VM(e){return Cg.find(i=>i.value===e)?.label??"Ask first"}const XM=[];function P0(e){return Ed(Ae.getState(),e)}function Om(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6?1:0)}M`:`${Math.round(e/1e3)}k`:""}function ZM(e){return e?Math.max(.06,Math.min(1,Math.log10(e/4e3)/Math.log10(2e6/4e3))):0}function QM(e){const i=e.split(/[\s/.-]+/).filter(Boolean);return(i.length>1?i[0][0]+i[1][0]:e.slice(0,2)).toUpperCase()}function WM({efforts:e,value:i,onChange:a,disabled:r}){const o=I.useRef(null),[u,d]=I.useState(!1),p=Math.max(1,e.length-1),g=Math.max(0,e.indexOf(i)),x=g/p*100,b=I.useCallback(h=>{const v=o.current?.getBoundingClientRect();if(!v||e.length===0)return;const y=1-Math.min(1,Math.max(0,(h-v.top)/v.height)),k=e[Math.round(y*p)];k&&k!==i&&a(k)},[e,p,a,i]);return l.jsxs("div",{className:te("relative flex h-[280px] gap-4 select-none",r&&"pointer-events-none opacity-40"),children:[l.jsxs("div",{ref:o,role:"slider",tabIndex:r?-1:0,"aria-label":"Reasoning effort","aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":g,"aria-valuetext":Ro(i),onKeyDown:h=>{h.key==="ArrowUp"||h.key==="ArrowRight"?(h.preventDefault(),a(e[Math.min(e.length-1,g+1)])):(h.key==="ArrowDown"||h.key==="ArrowLeft")&&(h.preventDefault(),a(e[Math.max(0,g-1)]))},onPointerDown:h=>{h.currentTarget.setPointerCapture(h.pointerId),d(!0),b(h.clientY)},onPointerMove:h=>u&&b(h.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) * ${x/100})`}}),e.map((h,v)=>l.jsx("span",{className:te("absolute left-1/2 h-[7px] w-[7px] -translate-x-1/2 translate-y-1/2 rounded-full border transition-colors duration-300",v<=g?"border-on-accent/40 bg-on-accent/80":"border-line bg-panel"),style:{bottom:`calc(4px + (100% - 8px) * ${v/p})`}},h)),l.jsx("span",{className:te("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) * ${g/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((h,v)=>{const y=v===g;return l.jsxs("button",{type:"button",onClick:()=>a(h),className:te("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:te("font-mono text-[10.5px] uppercase tracking-[0.14em]",y&&"text-accent"),children:Ro(h)}),l.jsx("span",{className:te("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:Mo[h]?.description})]},h)})})]})}function JM({open:e,onClose:i}){const a=Ae(),r=Ae(E=>E.selectModel),o=Ae(E=>E.update),u=me(E=>E.openSettings),[d,p]=I.useState(""),[g,x]=I.useState(""),[b,h]=I.useState(!1),[v,y]=I.useState(0),k=I.useRef(null),S=I.useRef(!1),j=I.useRef(null),_=I.useRef(null),A=a.provider,C=_n(E=>E.byProvider[A])??XM,M=_n(E=>!!E.loading[A]),B=_n(E=>E.errors[A]??""),D=_n(E=>E.notes[A]??""),N=_n(E=>E.fetchModels),z=Xn(a),q=C.find(E=>E.id===z)??null,R=P0(A),G=!!na[A]?.keyless||A==="custom",Z=Do(q);I.useEffect(()=>{e&&(R||G)&&N(A)},[e,A,R,G,N]),I.useEffect(()=>{if(!e){p(""),h(!1);return}const E=window.setTimeout(()=>j.current?.focus(),60),pe=document.activeElement,_e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.clearTimeout(E),document.body.style.overflow=_e,pe?.focus?.()}},[e]);const fe=I.useMemo(()=>{const E=d.trim().toLowerCase();return E?C.filter(pe=>pe.name.toLowerCase().includes(E)||pe.id.toLowerCase().includes(E)):C},[C,d]);I.useLayoutEffect(()=>{y(0)},[d,A]),I.useEffect(()=>{S.current&&(S.current=!1,k.current?.querySelector(`[data-row="${v}"]`)?.scrollIntoView({block:"nearest"}))},[v]);const le=E=>{const pe=Do(E),_e=pe.length>0?ll(a.effort,E):a.effort;r(A,E.id,pe.length>0&&!pe.includes(_e)?Uw(E):_e)},J=E=>{E?.preventDefault();const pe=g.trim();pe&&(r(A,pe,a.effort),x(""),h(!1))},O=E=>{E!==A&&(o({provider:E,model:""}),p(""),N(E))},re=E=>{if(E.key==="ArrowDown")E.preventDefault(),S.current=!0,y(pe=>Math.min(fe.length-1,pe+1));else if(E.key==="ArrowUp")E.preventDefault(),S.current=!0,y(pe=>Math.max(0,pe-1));else if(E.key==="Enter"){E.preventDefault();const pe=fe[v];pe&&pe.id!==z?le(pe):i()}};if(I.useEffect(()=>{if(!e)return;const E=pe=>{pe.key==="Escape"&&(pe.preventDefault(),i())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[e,i]),I.useEffect(()=>{if(!e)return;const E=requestAnimationFrame(()=>_.current?.querySelector('[aria-pressed="true"]')?.scrollIntoView({block:"center"}));return()=>cancelAnimationFrame(E)},[e,A]),!e)return null;const ie=!R&&!G,ne=Math.max(0,Vu.findIndex(E=>E.id===A));return ml.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:q?.name||z||"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:na[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:[Ro(a.effort)," effort"]})]}),q?.context?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-faint",children:"·"}),l.jsxs("span",{children:[Om(q.context)," context"]})]}):null]})]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{N(A,!0)},disabled:M||ie,title:"Refresh live models","aria-label":"Refresh live models",children:l.jsx(Li,{size:14,className:te(M&&"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(Sw,{size:14})}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:i,"aria-label":"Close",children:l.jsx(Bi,{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:_,"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(${ne*52}px)`}}),Vu.map(E=>{const pe=P0(E.id)||E.keyless||E.id==="custom",_e=E.id===A;return l.jsxs("button",{type:"button",onClick:()=>O(E.id),disabled:!pe,title:`${E.name}${pe?"":" · connect to enable"}`,"aria-pressed":_e,className:te("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",_e?"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:QM(E.name)}),l.jsx("span",{className:"max-w-full truncate px-1 text-[8.5px] leading-none text-faint",children:E.name.split(" ")[0]}),l.jsx("span",{className:te("absolute right-1.5 top-1.5 h-1.5 w-1.5 rounded-full",pe?"bg-success":"bg-warning/70")})]},E.id)})]}),l.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:ie?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($o,{size:20})}),l.jsxs("p",{className:"font-display text-[16px] font-semibold text-ink",children:["Connect ",na[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(is,{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:E=>p(E.target.value),onKeyDown:re,placeholder:C.length>0?`Search ${C.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:"↑↓ ↵"})]}),B&&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(gd,{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:B}),l.jsx("button",{type:"button",onClick:()=>{N(A,!0)},className:"text-[11px] font-medium text-danger",children:"Retry"})]}),D&&!B&&l.jsx("p",{className:"mt-1.5 px-1 text-[10.5px] leading-relaxed text-faint",children:D})]}),l.jsxs("div",{ref:k,className:"thin-scroll min-h-0 flex-1 overflow-y-auto px-2.5 pb-3",children:[M&&C.length===0&&l.jsxs("p",{className:"flex items-center gap-2 px-3 py-4 text-[12px] text-faint",children:[l.jsx($t,{size:12})," Loading live models…"]}),fe.map((E,pe)=>{const _e=E.id===z,L=pe===v,$=E.reasoningOptions.length>0;return l.jsxs("button",{type:"button","data-row":pe,onClick:()=>{y(pe),le(E)},onMouseEnter:()=>y(pe),style:{animationDelay:`${Math.min(pe*22,260)}ms`},className:te("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",_e?"bg-accent-soft":L?"bg-raised":"hover:bg-raised/70"),children:[l.jsx("span",{className:te("flex h-8 w-8 shrink-0 items-center justify-center rounded-xl transition-all duration-300",_e?"scale-100 bg-accent text-on-accent":"bg-raised text-faint group-hover/row:bg-panel"),children:_e?l.jsx(sn,{size:14,strokeWidth:2.4}):l.jsx(PC,{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:te("truncate text-[13px] font-medium",_e?"text-accent":"text-ink"),children:E.name||E.id}),E.free&&l.jsx("span",{className:"rounded-full bg-success/10 px-1.5 py-px text-[9px] font-medium text-success",children:"free"}),!E.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:E.id})]}),l.jsxs("span",{className:"hidden shrink-0 items-center gap-2.5 text-faint sm:flex",children:[$&&l.jsx(m0,{size:12,className:"text-accent/80","aria-label":"reasoning"}),E.vision&&l.jsx(ag,{size:12,"aria-label":"vision"}),E.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:Om(E.context)}),l.jsx("span",{className:"h-[3px] w-full overflow-hidden rounded-full bg-line",children:l.jsx("span",{className:te("block h-full rounded-full",_e?"bg-accent":"bg-faint/60"),style:{width:`${ZM(E.context)*100}%`}})})]}):null]})]},E.id)}),!M&&fe.length===0&&C.length>0&&l.jsxs("p",{className:"px-3 py-6 text-center text-[12px] text-faint",children:["No model matches “",d,"”."]}),!M&&C.length===0&&!B&&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:J,className:"deck-row mt-1 flex items-center gap-2 px-1",children:[l.jsx("input",{autoFocus:!0,value:g,onChange:E=>x(E.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:!g.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:()=>h(!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(br,{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(m0,{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(WM,{efforts:Z,value:ll(a.effort,q),onChange:E=>q&&r(A,q.id,E),disabled:!q})}),l.jsx("div",{className:"flex gap-1 rounded-full bg-raised p-1 md:hidden",children:Z.map(E=>l.jsx("button",{type:"button",onClick:()=>q&&r(A,q.id,E),className:te("h-8 min-w-0 flex-1 rounded-full text-[10.5px] font-medium transition-all",a.effort===E?"bg-accent text-on-accent shadow-pill":"text-muted"),children:Ro(E)},E))})]}):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:q?"No effort dial":"Pick a model"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted",children:ph(q)})]}),Z.length>1&&l.jsx("p",{className:"mt-4 hidden text-[10.5px] leading-relaxed text-faint md:block",children:ph(q)})]})]}),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:[q?.maxOutput?l.jsxs("span",{children:["max output ",Om(q.maxOutput)]}):null,q?.apiKind?l.jsx("span",{className:"rounded-md border border-line px-1.5 py-px font-mono",children:q.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 e5({label:e,open:i,disabled:a,onClick:r,triggerRef:o,title:u}){return l.jsxs("button",{ref:o,type:"button",disabled:a,onClick:r,"aria-haspopup":"dialog","aria-expanded":i,title:u,className:te("deck-trigger flex h-8 max-w-[180px] items-center gap-1 rounded-lg px-2 text-[12px] font-medium text-muted transition-colors hover:text-ink disabled:cursor-not-allowed disabled:opacity-45 sm:max-w-[260px]",i&&"text-ink"),children:[l.jsx("span",{className:"truncate",children:e}),l.jsx(Bo,{size:11,className:te("shrink-0 text-faint transition-transform",i&&"rotate-180")})]})}const Wi={outline:"#6b3410",body:"#fbbf24",shade:"#f59e0b",highlight:"#fef3c7",ray:"#f59e0b",eye:"#1a0f06",mark:"#4a2508",blush:"#fb7185",sweat:"#38bdf8",mint:"#34d399",sky:"#60a5fa",rose:"#fb7185"},t5={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"},n5=new Set(["thinking","working","typing","party","wave"]),Nk=[[4,6,9],[5,5,10],[6,4,11],[7,4,11],[8,4,11],[9,4,11],[10,5,10],[11,6,9]],Ws=new Set;for(const[e,i,a]of Nk)for(let r=i;r<=a;r++)Ws.add(`${r},${e}`);const Ek=[];for(let e=2;e<=13;e++)for(let i=2;i<=13;i++){if(Ws.has(`${i},${e}`))continue;(Ws.has(`${i-1},${e}`)||Ws.has(`${i+1},${e}`)||Ws.has(`${i},${e-1}`)||Ws.has(`${i},${e+1}`))&&Ek.push([i,e])}const i5=[[7,0,2,2,"ray"],[7,14,2,2,"ray"],[0,7,2,2,"ray"],[14,7,2,2,"ray"]],a5=[[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 Ji(e,i=0,a=0){const[r,o]=e==="sm"?[1,1]:e==="md"?[1,2]:e==="lg"?[2,2]:[2,1],u=(e==="sm"||e==="flat"?8:7)+a;return[[(e==="lg"||e==="flat"?5:6)+i,u,r,o,"eye"],[9+i,u,r,o,"eye"]]}const H0=[[4,9,1,1,"blush"],[11,9,1,1,"blush"]];function r5(e){switch(e){case"wave":return{eyes:Ji("md"),extras:H0,eyeClass:"pxs-blink"};case"happy":return{eyes:Ji("lg"),extras:[...H0,[13,1,1,3,"ray"],[12,2,3,1,"ray"]],clearCorner:!0};case"party":return{eyes:Ji("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:Ji("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:Ji("sm",0,1),extras:[],eyeClass:"pxs-scan"};case"typing":return{eyes:Ji("md",0,1),extras:[],eyeClass:"pxs-scan"};case"alert":return{eyes:Ji("lg"),extras:[[13,0,1,3,"mark"],[13,4,1,1,"mark"]],clearCorner:!0};case"error":return{eyes:Ji("sm",0,1),extras:[[12,3,1,1,"sweat"],[12,4,1,2,"sweat"]],clearCorner:!0};case"sleepy":return{eyes:Ji("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:Ji("md"),extras:[],eyeClass:"pxs-blink"}}}function Sk({mood:e="idle",size:i=40,className:a,animate:r=!0}){const o=MM[e],u=r&&n5.has(e),d=r5(e);return l.jsx("span",{className:te("inline-flex shrink-0 select-none",r&&t5[e],a),role:"img","aria-label":`PixleSol — ${o}`,title:`PixleSol — ${o}`,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:i5.map(([p,g,x,b,h],v)=>l.jsx("rect",{x:p,y:g,width:x,height:b,fill:Wi[h]},v))}),l.jsx("g",{className:u?"pxs-b":void 0,opacity:d.clearCorner?.35:void 0,children:a5.map(([p,g,x,b,h],v)=>l.jsx("rect",{x:p,y:g,width:x,height:b,fill:Wi[h]},v))}),Ek.map(([p,g])=>l.jsx("rect",{x:p,y:g,width:1,height:1,fill:Wi.outline},`o${p},${g}`)),Nk.map(([p,g,x])=>l.jsx("rect",{x:g,y:p,width:x-g+1,height:1,fill:Wi.body},`b${p}`)),l.jsx("rect",{x:5,y:11,width:6,height:1,fill:Wi.shade}),l.jsx("rect",{x:9,y:10,width:2,height:1,fill:Wi.shade}),l.jsx("rect",{x:6,y:4,width:2,height:1,fill:Wi.highlight}),l.jsx("rect",{x:5,y:5,width:1,height:1,fill:Wi.highlight}),l.jsx("g",{className:r?d.eyeClass:void 0,children:d.eyes.map(([p,g,x,b,h],v)=>l.jsx("rect",{x:p,y:g,width:x,height:b,fill:Wi[h]},v))}),d.extras.map(([p,g,x,b,h],v)=>l.jsx("rect",{x:p,y:g,width:x,height:b,fill:Wi[h]},`x${v}`))]})})}const Mm=12,F0=8;function To({open:e,onClose:i,trigger:a,children:r,width:o=260,placement:u="above",maxHeight:d=260,className:p}){const g=I.useRef(null),x=I.useRef(null),[b,h]=I.useState({side:u,height:d,alignRight:!1});return vk(g,i,e),I.useLayoutEffect(()=>{if(!e)return;const v=()=>{const y=g.current;if(!y)return;const k=y.getBoundingClientRect(),S=k.top-Mm-F0,j=window.innerHeight-k.bottom-Mm-F0,_=Math.min(x.current?.scrollHeight??d,d),A=N=>N>=_,C=u==="above"?S:j,M=u==="above"?j:S,B=A(C)||C>=M?u:u==="above"?"below":"above";h({side:B,height:Math.max(96,Math.min(d,B==="above"?S:j)),alignRight:k.left+o>window.innerWidth-Mm})};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[e,u,d,o]),l.jsxs("div",{ref:g,className:"relative",children:[a,e&&l.jsx("div",{ref:x,style:{width:o,maxHeight:b.height},className:te("surface-lift thin-scroll animate-scalein absolute z-40 max-w-[calc(100vw-24px)] overflow-y-auto overscroll-contain rounded-2xl border border-line p-1.5 shadow-float",b.alignRight?"right-0":"left-0",b.side==="above"?"bottom-[calc(100%+8px)]":"top-[calc(100%+6px)]",p),children:r})]})}function Pu({children:e}){return l.jsx("p",{className:"px-2 pb-1 pt-1.5 text-[10px] font-medium uppercase tracking-[0.1em] text-faint",children:e})}function Hu({children:e,open:i,className:a,...r}){return l.jsx("button",{type:"button","aria-expanded":i,...r,className:te("flex h-8 items-center gap-1 rounded-lg px-2 text-[12px] font-medium text-muted transition-colors hover:text-ink disabled:cursor-not-allowed disabled:opacity-45",i&&"text-ink",a),children:e})}function ku({icon:e,label:i,hint:a,active:r,onClick:o}){return l.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[12px] text-ink transition-colors hover:bg-raised",children:[l.jsx(e,{size:14,className:"shrink-0 text-faint"}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:i}),a&&l.jsx("span",{className:"shrink-0 text-[10.5px] text-faint",children:a}),r!==void 0&&l.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:r&&l.jsx(sn,{size:13,className:"text-accent"})})]})}function s5({onAddFiles:e}){const i=Ae(),a=Ae(S=>S.update),r=li(S=>S.skills.filter(j=>j.enabled).length),o=li(S=>S.loaded),u=li(S=>S.load),d=rn(S=>S.servers),p=rn(S=>S.loaded),g=rn(S=>S.load),x=me(S=>S.openSettings),b=me(S=>S.setMcpOpen),[h,v]=I.useState(!1);I.useEffect(()=>{h&&(o||u(),p||g())},[h,o,p,u,g]);const y=d.filter(S=>S.status==="connected").length,k=()=>v(!1);return l.jsxs(To,{open:h,onClose:k,width:280,trigger:l.jsx("button",{type:"button",onClick:()=>v(S=>!S),className:te("icon-button h-8 w-8",h&&"bg-raised text-ink"),"aria-label":"Add files, skills and tools","aria-expanded":h,title:"Add files, skills and tools",children:l.jsx(br,{size:16,className:te("transition-transform duration-200",h&&"rotate-45")})}),children:[l.jsx(ku,{icon:YT,label:"Add files or photos",onClick:()=>{k(),e()}}),l.jsx(ku,{icon:dl,label:"Web search",active:i.webSearchEnabled,onClick:()=>a({webSearchEnabled:!i.webSearchEnabled})}),l.jsx(ku,{icon:wd,label:"MCP servers",hint:d.length?`${y}/${d.length} connected`:"Add",onClick:()=>{k(),b(!0)}}),l.jsx(ku,{icon:oi,label:"Skills",hint:r?`${r} on`:void 0,onClick:()=>{k(),x("skills")}})]})}function l5(){const e=qe(h=>h.info),i=qe(h=>h.git),a=qe(h=>h.addWorkspace),r=me(h=>h.setWorkspaceOpen),o=me(h=>h.notify),[u,d]=I.useState(!1),[p,g]=I.useState(""),x=async h=>{if(h===e.root){d(!1);return}g(h);try{await a(h),d(!1)}catch(v){o(v instanceof Error?v.message:"Could not open that folder.","error")}finally{g("")}},b=[...e.workspaces].sort((h,v)=>v.lastOpened-h.lastOpened);return l.jsxs(To,{open:u,onClose:()=>d(!1),placement:"below",width:280,maxHeight:260,trigger:l.jsxs(Hu,{open:u,onClick:()=>d(h=>!h),title:e.available?e.root:"Choose a project folder",className:"max-w-[240px]",children:[l.jsx(gr,{size:13,className:"shrink-0 text-faint"}),l.jsx("span",{className:"truncate",children:e.available?e.name:"Select folder"}),e.available&&i.available&&i.branch&&l.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-faint",children:[l.jsx(rg,{size:11}),i.branch]}),l.jsx(Bo,{size:11,className:te("shrink-0 text-faint transition-transform",u&&"rotate-180")})]}),children:[l.jsx(Pu,{children:"Folders"}),l.jsxs("div",{children:[b.length===0&&l.jsx("p",{className:"px-2 pb-2 text-[11.5px] text-faint",children:"No folders yet."}),b.map(h=>l.jsxs("button",{type:"button",onClick:()=>{x(h.path)},disabled:!!p,className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-raised disabled:opacity-60",title:h.path,children:[l.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:h.path===e.root?l.jsx(sn,{size:12,className:"text-accent"}):l.jsx(gr,{size:12,className:"text-faint"})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[12px] font-medium text-ink",children:h.name}),l.jsx("span",{className:"block truncate text-[10px] text-faint",children:h.path})]}),p===h.path&&l.jsx("span",{className:"h-3 w-3 shrink-0 animate-spin rounded-full border border-current border-t-transparent text-faint"})]},h.path))]}),l.jsx("div",{className:"mt-1 border-t border-line pt-1",children:l.jsxs("button",{type:"button",onClick:()=>{d(!1),r(!0)},className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[12px] text-muted transition-colors hover:bg-raised hover:text-ink",children:[l.jsx(gr,{size:12,className:"text-faint"}),"Open another folder…"]})})]})}const o5=/\.(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,Rm=6,c5=5*1024*1024,u5=512*1024,Dm=[{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:"compact",usage:"/compact [focus]",description:"Summarise older context to free up space",takesArgs:!0},{name:"clear",usage:"/clear",description:"Clear this conversation",takesArgs:!1}];function q0(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function G0({value:e,onChange:i,onSend:a,onStop:r,onCommand:o,streaming:u,hints:d=!1,autoFocus:p=!1,placeholder:g="How can I help you today?",contextPct:x,contextTitle:b,pixleMood:h}){const v=Ae(),y=Ae(se=>se.update),k=Ae(se=>se.setMode),S=me(se=>se.notify),j=me(se=>se.composerFocus),[_,A]=I.useState([]),[C,M]=I.useState(!1),[B,D]=I.useState(!1),[N,z]=I.useState(!1),[q,R]=I.useState(!1),[G,Z]=I.useState(!1),[fe,le]=I.useState(!1),[J,O]=I.useState(!1),[re,ie]=I.useState(0),ne=I.useRef(null),E=I.useRef(null),pe=I.useRef(null);I.useEffect(()=>{const se=Le=>{(Le.metaKey||Le.ctrlKey)&&!Le.shiftKey&&!Le.altKey&&Le.key.toLowerCase()==="m"&&(Le.preventDefault(),z(bt=>!bt))};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[]);const _e=Xn(v),L=RA(v.provider),$=Md(),oe=ol(v),xe=Do($),Te=wk(v.tools),$e=oe?_e?L.find(se=>se.id===_e)?.name??_e:"Select model":"No provider",He=I.useMemo(()=>{if(!e.startsWith("/")||e.includes(`
200
+ `))return null;const se=e.slice(1).split(/\s/)[0];return e.slice(1).includes(" ")?null:se.toLowerCase()},[e]),Be=I.useMemo(()=>He===null?[]:Dm.filter(se=>se.name.startsWith(He)),[He]);I.useEffect(()=>{ie(0)},[He]),I.useLayoutEffect(()=>{const se=ne.current;se&&(se.style.height="auto",se.style.height=`${Math.min(Math.max(se.scrollHeight,36),220)}px`)},[e]),I.useEffect(()=>{if(!p||!window.matchMedia("(pointer: fine)").matches)return;const se=window.setTimeout(()=>ne.current?.focus(),80);return()=>window.clearTimeout(se)},[p]),I.useEffect(()=>{j>0&&ne.current?.focus()},[j]),I.useEffect(()=>{oe||z(!1)},[oe]),I.useEffect(()=>{$&&!xe.length&&y({effort:"medium"})},[$,xe.length,y]);const Ee=async se=>{if(se.length===0)return;let Le=Rm-_.length;if(Le<=0){S(`You can attach up to ${Rm} files per message.`,"error");return}const bt=[];for(const ht of se){if(Le<=0){S(`Only ${Rm} attachments were added.`,"info");break}const Ht=/^image\/(png|jpeg|webp|gif)$/i.test(ht.type),Bn=ht.type.startsWith("text/")||o5.test(ht.name);if(Ht){if(ht.size>c5){S(`${ht.name} is larger than 5 MB.`,"error");continue}bt.push({id:q0(),name:ht.name,kind:"image",mime:ht.type,dataUrl:await _M(ht),size:ht.size}),Le-=1}else if(Bn){if(ht.size>u5){S(`${ht.name} is larger than 512 KB.`,"error");continue}bt.push({id:q0(),name:ht.name,kind:"text",mime:ht.type||"text/plain",text:await TM(ht),size:ht.size}),Le-=1}else S(`Can't attach ${ht.name}. Use an image, text or code file.`,"error")}bt.length>0&&A(ht=>[...ht,...bt])},P=async()=>{if(u||J)return;const se=e.trim();if(!(!se&&_.length===0)){if(se.startsWith("/")&&!_.length){const[Le,...bt]=se.slice(1).split(/\s+/),ht=Dm.find(Ht=>Ht.name===Le.toLowerCase());if(ht){const Ht=bt.join(" ").trim();if(o){O(!0);try{await o(ht.name,Ht)&&(i(""),requestAnimationFrame(()=>ne.current?.focus()))}catch(Bn){S(Bn instanceof Error?Bn.message:"That command failed.","error")}finally{O(!1)}return}}}O(!0),z(!1);try{await a(e,_)&&(i(""),A([]),requestAnimationFrame(()=>ne.current?.focus()))}catch(Le){S(Le instanceof Error?Le.message:"The message could not be sent.","error")}finally{O(!1)}}},X=(se,Le)=>{if(Le){i(`/${se} `),ne.current?.focus();return}i(`/${se}`),window.setTimeout(()=>{ye(`/${se}`)},0)},ye=async se=>{const[Le]=se.slice(1).split(/\s+/),bt=Dm.find(ht=>ht.name===Le.toLowerCase());if(!(!bt||!o)){O(!0);try{await o(bt.name,se.slice(1).split(/\s+/).slice(1).join(" "))&&i("")}finally{O(!1)}}},je=se=>{if(Be.length>0){if(se.key==="ArrowDown"){se.preventDefault(),ie(Le=>(Le+1)%Be.length);return}if(se.key==="ArrowUp"){se.preventDefault(),ie(Le=>(Le-1+Be.length)%Be.length);return}if(se.key==="Enter"&&!se.shiftKey&&!se.nativeEvent.isComposing){se.preventDefault();const Le=Be[re];Le&&X(Le.name,Le.takesArgs);return}if(se.key==="Escape"){se.preventDefault(),i("");return}}if(se.key==="Enter"&&!se.shiftKey&&!se.nativeEvent.isComposing){if(se.preventDefault(),u)return;P()}se.key==="Escape"&&z(!1)},Me=se=>{const Le=Array.from(se.clipboardData.files);Le.length>0&&(se.preventDefault(),Ee(Le))},ot=se=>{se.preventDefault(),D(!1),Ee(Array.from(se.dataTransfer.files))},Ke=!e.trim()&&_.length===0||J||u,jt=x===void 0?"":x>=95?"text-danger":x>=70?"text-warning":"text-faint";return l.jsxs("div",{className:"relative w-full",children:[l.jsx(JM,{open:N&&oe,onClose:()=>z(!1)}),Be.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(xC,{size:10})," Commands"]}),Be.map((se,Le)=>l.jsxs("button",{type:"button",onMouseDown:bt=>bt.preventDefault(),onClick:()=>X(se.name,se.takesArgs),className:te("flex w-full items-center gap-2 px-3 py-2 text-left",Le===re?"bg-accent-soft":"hover:bg-raised"),children:[l.jsx("span",{className:te("font-mono text-[10.5px]",Le===re?"text-accent":"text-ink"),children:se.usage}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px] text-faint",children:se.description})]},se.name))]}),l.jsx("div",{className:"mb-1 flex flex-wrap items-center gap-x-1 px-0.5",children:l.jsx(l5,{})}),l.jsxs("div",{onDragOver:se=>{se.dataTransfer.types.includes("Files")&&(se.preventDefault(),D(!0))},onDragLeave:se=>{se.currentTarget.contains(se.relatedTarget)||D(!1)},onDrop:ot,className:te("surface-lift composer-shadow relative rounded-xl border transition-all duration-200",C||B?"border-accent/35":"border-line",u&&"composer-glow border-accent/30",B&&"ring-4 ring-accent/10"),children:[C&&!B&&l.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-xl ring-4 ring-accent/[0.03]","aria-hidden":"true"}),l.jsxs("div",{className:"relative px-3 pb-0 pt-2",children:[_.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 px-1 pb-2",children:_.map(se=>se.kind==="image"?l.jsxs("div",{className:"relative",children:[l.jsx("img",{src:se.dataUrl,alt:se.name,className:"h-14 w-14 rounded-lg border border-line object-cover"}),l.jsx("button",{type:"button",onClick:()=>A(Le=>Le.filter(bt=>bt.id!==se.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 ${se.name}`,children:l.jsx(Bi,{size:10})})]},se.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(ns,{size:11,className:"shrink-0"}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:se.name}),l.jsx("span",{className:"shrink-0 text-faint",children:fl(se.size)}),l.jsx("button",{type:"button",onClick:()=>A(Le=>Le.filter(bt=>bt.id!==se.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 ${se.name}`,children:l.jsx(Bi,{size:10})})]},se.id))}),l.jsx("textarea",{ref:ne,value:e,onChange:se=>i(se.target.value),onKeyDown:je,onPaste:Me,onFocus:()=>M(!0),onBlur:()=>M(!1),placeholder:g,rows:1,"aria-label":"Message OpenSol",className:"block w-full resize-none bg-transparent px-1.5 py-1 text-[14.5px] leading-[1.55] text-ink outline-none placeholder:text-faint",style:{minHeight:36,maxHeight:220}})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2 px-1.5 pb-1.5 pt-0.5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-0.5",children:[l.jsx(s5,{onAddFiles:()=>E.current?.click()}),l.jsxs(To,{open:fe,onClose:()=>le(!1),width:230,trigger:l.jsx(Hu,{open:fe,onClick:()=>{R(!1),Z(!1),le(se=>!se)},title:"Build edits files and runs commands; Plan is read-only",children:v.mode==="plan"?"Plan":"Build"}),children:[l.jsx(Pu,{children:"Mode"}),[{value:"build",label:"Build",hint:"Edit files and run commands",icon:oi},{value:"plan",label:"Plan",hint:"Read-only investigation",icon:vw}].map(se=>l.jsxs("button",{type:"button",onClick:()=>{k(se.value),le(!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:v.mode===se.value?l.jsx(sn,{size:12,className:"text-accent"}):l.jsx(se.icon,{size:12,className:"text-faint"})}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block text-[11.5px] font-medium text-ink",children:se.label}),l.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-faint",children:se.hint})]})]},se.value))]}),l.jsxs(To,{open:q,onClose:()=>R(!1),width:290,trigger:l.jsx(Hu,{open:q,onClick:()=>{Z(!1),le(!1),R(se=>!se)},title:"Choose how much OpenSol can do without asking",children:VM(Te)}),children:[l.jsx(Pu,{children:"Permissions"}),Cg.map(se=>l.jsxs("button",{type:"button",onClick:()=>{y({tools:kk(v.tools,se.value)}),R(!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:Te===se.value?l.jsx(sn,{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:se.label}),l.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-faint",children:se.description})]})]},se.value))]}),xe.length>1&&l.jsxs(To,{open:G,onClose:()=>Z(!1),width:250,trigger:l.jsx(Hu,{open:G,onClick:()=>{R(!1),le(!1),Z(se=>!se)},title:"Reasoning effort for this model",children:Ro(v.effort)}),children:[l.jsx(Pu,{children:"Effort"}),xe.map(se=>l.jsxs("button",{type:"button",onClick:()=>{y({effort:se}),Z(!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:v.effort===se?l.jsx(sn,{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:Mo[se].label}),l.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-faint",children:Mo[se].description})]})]},se))]}),l.jsx("input",{ref:E,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:se=>{se.target.files&&Ee(Array.from(se.target.files)),se.target.value=""}})]}),l.jsxs("div",{className:"flex min-w-0 shrink-0 items-center gap-1",children:[x!==void 0&&l.jsxs("span",{className:te("hidden items-center gap-1 px-1 text-[10.5px] tabular-nums sm:flex",jt),title:b,children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),x,"%"]}),l.jsx(e5,{triggerRef:pe,label:$e,open:N,disabled:!oe,onClick:()=>z(se=>!se),title:oe?"Choose a model (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(fg,{size:11,fill:"currentColor"})}):l.jsx("button",{type:"button",onClick:()=>{P()},disabled:Ke,className:te("flex h-8 w-8 items-center justify-center rounded-full transition-all duration-150",Ke?"cursor-not-allowed bg-raised text-faint":"bg-accent text-on-accent hover:brightness-110"),"aria-label":"Send message",title:"Send (Enter)",children:J?l.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border border-current border-t-transparent"}):l.jsx(d5,{})})]})]}),B&&l.jsxs("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed border-accent/45 bg-panel/95",children:[l.jsx(Tw,{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"})]}),h&&v.showMascot&&l.jsx(Sk,{mood:h,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(Wr,{size:11}),"Local daemon · keys encrypted at rest"]})]})]})}function d5(){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 f5(e,i){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const p5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h5={};function Y0(e,i){return(h5.jsx?m5:p5).test(e)}const g5=/[ \t\n\f\r]/g;function x5(e){return typeof e=="object"?e.type==="text"?K0(e.value):!1:K0(e)}function K0(e){return e.replace(g5,"")===""}class qo{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}qo.prototype.normal={};qo.prototype.property={};qo.prototype.space=void 0;function _k(e,i){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new qo(a,r,i)}function zh(e){return e.toLowerCase()}class Zn{constructor(i,a){this.attribute=a,this.property=i}}Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let b5=0;const tt=as(),an=as(),Lh=as(),be=as(),zt=as(),Zr=as(),si=as();function as(){return 2**++b5}const Ih=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:an,commaOrSpaceSeparated:si,commaSeparated:Zr,number:be,overloadedBoolean:Lh,spaceSeparated:zt},Symbol.toStringTag,{value:"Module"})),zm=Object.keys(Ih);class jg extends Zn{constructor(i,a,r,o){let u=-1;if(super(i,a),V0(this,"space",o),typeof r=="number")for(;++u<zm.length;){const d=zm[u];V0(this,zm[u],(r&Ih[d])===Ih[d])}}}jg.prototype.defined=!0;function V0(e,i,a){a&&(e[i]=a)}function hl(e){const i={},a={};for(const[r,o]of Object.entries(e.properties)){const u=new jg(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),i[r]=u,a[zh(r)]=r,a[zh(u.attribute)]=r}return new qo(i,a,e.space)}const Tk=hl({properties:{ariaActiveDescendant:null,ariaAtomic:an,ariaAutoComplete:null,ariaBusy:an,ariaChecked:an,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:zt,ariaCurrent:null,ariaDescribedBy:zt,ariaDetails:null,ariaDisabled:an,ariaDropEffect:zt,ariaErrorMessage:null,ariaExpanded:an,ariaFlowTo:zt,ariaGrabbed:an,ariaHasPopup:null,ariaHidden:an,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zt,ariaLevel:be,ariaLive:null,ariaModal:an,ariaMultiLine:an,ariaMultiSelectable:an,ariaOrientation:null,ariaOwns:zt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:an,ariaReadOnly:an,ariaRelevant:null,ariaRequired:an,ariaRoleDescription:zt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:an,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Ck(e,i){return i in e?e[i]:i}function jk(e,i){return Ck(e,i.toLowerCase())}const y5=hl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zr,acceptCharset:zt,accessKey:zt,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alpha:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:zt,autoFocus:tt,autoPlay:tt,blocking:zt,capture:null,charSet:null,checked:tt,cite:null,className:zt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:an,controls:tt,controlsList:zt,coords:be|Zr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:Lh,draggable:an,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:zt,height:be,hidden:Lh,high:be,href:null,hrefLang:null,htmlFor:zt,httpEquiv:zt,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:zt,itemRef:zt,itemScope:tt,itemType:zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,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:be,pattern:null,ping:zt,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:zt,required:tt,reversed:tt,rows:be,rowSpan:be,sandbox:zt,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootCustomElementRegistry:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shadowRootSerializable:tt,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:an,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:an,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:an,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:tt,disablePictureInPicture:tt,disableRemotePlayback:tt,exportParts:Zr,part:zt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:jk}),v5=hl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:si,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:zt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zr,g2:Zr,glyphName:Zr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:si,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:si,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:si,rev:si,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:si,requiredFeatures:si,requiredFonts:si,requiredFormats:si,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:si,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:si,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:si,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ck}),Ak=hl({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()}}),Ok=hl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jk}),Mk=hl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),w5={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"},k5=/[A-Z]/g,X0=/-[a-z]/g,N5=/^data[-\w.:]+$/i;function E5(e,i){const a=zh(i);let r=i,o=Zn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&N5.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(X0,_5);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!X0.test(u)){let d=u.replace(k5,S5);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}o=jg}return new o(r,i)}function S5(e){return"-"+e.toLowerCase()}function _5(e){return e.charAt(1).toUpperCase()}const T5=_k([Tk,y5,Ak,Ok,Mk],"html"),Ag=_k([Tk,v5,Ak,Ok,Mk],"svg");function C5(e){return e.join(" ").trim()}var Xs={},Lm,Z0;function j5(){if(Z0)return Lm;Z0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
201
+ `,x="/",b="*",h="",v="comment",y="declaration";function k(j,_){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];_=_||{};var A=1,C=1;function M(le){var J=le.match(i);J&&(A+=J.length);var O=le.lastIndexOf(g);C=~O?le.length-O:C+le.length}function B(){var le={line:A,column:C};return function(J){return J.position=new D(le),q(),J}}function D(le){this.start=le,this.end={line:A,column:C},this.source=_.source}D.prototype.content=j;function N(le){var J=new Error(_.source+":"+A+":"+C+": "+le);if(J.reason=le,J.filename=_.source,J.line=A,J.column=C,J.source=j,!_.silent)throw J}function z(le){var J=le.exec(j);if(J){var O=J[0];return M(O),j=j.slice(O.length),J}}function q(){z(a)}function R(le){var J;for(le=le||[];J=G();)J!==!1&&le.push(J);return le}function G(){var le=B();if(!(x!=j.charAt(0)||b!=j.charAt(1))){for(var J=2;h!=j.charAt(J)&&(b!=j.charAt(J)||x!=j.charAt(J+1));)++J;if(J+=2,h===j.charAt(J-1))return N("End of comment missing");var O=j.slice(2,J-2);return C+=2,M(O),j=j.slice(J),C+=2,le({type:v,comment:O})}}function Z(){var le=B(),J=z(r);if(J){if(G(),!z(o))return N("property missing ':'");var O=z(u),re=le({type:y,property:S(J[0].replace(e,h)),value:O?S(O[0].replace(e,h)):h});return z(d),re}}function fe(){var le=[];R(le);for(var J;J=Z();)J!==!1&&(le.push(J),R(le));return le}return q(),fe()}function S(j){return j?j.replace(p,h):h}return Lm=k,Lm}var Q0;function A5(){if(Q0)return Xs;Q0=1;var e=Xs&&Xs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=a;const i=e(j5());function a(r,o){let u=null;if(!r||typeof r!="string")return u;const d=(0,i.default)(r),p=typeof o=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:x,value:b}=g;p?o(x,b,g):b&&(u=u||{},u[x]=b)}),u}return Xs}var mo={},W0;function O5(){if(W0)return mo;W0=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(x){return!x||a.test(x)||e.test(x)},d=function(x,b){return b.toUpperCase()},p=function(x,b){return"".concat(b,"-")},g=function(x,b){return b===void 0&&(b={}),u(x)?x:(x=x.toLowerCase(),b.reactCompat?x=x.replace(o,p):x=x.replace(r,p),x.replace(i,d))};return mo.camelCase=g,mo}var ho,J0;function M5(){if(J0)return ho;J0=1;var e=ho&&ho.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},i=e(A5()),a=O5();function r(o,u){var d={};return!o||typeof o!="string"||(0,i.default)(o,function(p,g){p&&g&&(d[(0,a.camelCase)(p,u)]=g)}),d}return r.default=r,ho=r,ho}var R5=M5();const D5=md(R5),Rk=Dk("end"),Og=Dk("start");function Dk(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 z5(e){const i=Og(e),a=Rk(e);if(i&&a)return{start:i,end:a}}function Co(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ev(e.position):"start"in e||"end"in e?ev(e):"line"in e||"column"in e?Uh(e):""}function Uh(e){return tv(e&&e.line)+":"+tv(e&&e.column)}function ev(e){return Uh(e&&e.start)+"-"+Uh(e&&e.end)}function tv(e){return e&&typeof e=="number"?e:1}class jn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",u={},d=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof i=="string"?o=i:!u.cause&&i&&(d=!0,o=i.message,u.cause=i),!u.ruleId&&!u.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?u.ruleId=r:(u.source=r.slice(0,g),u.ruleId=r.slice(g+1))}if(!u.place&&u.ancestors&&u.ancestors){const g=u.ancestors[u.ancestors.length-1];g&&(u.place=g.position)}const p=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=p?p.line:void 0,this.name=Co(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}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const Mg={}.hasOwnProperty,L5=new Map,I5=/[A-Z]/g,U5=new Set(["table","tbody","thead","tfoot","tr"]),B5=new Set(["td","th"]),zk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $5(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=V5(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 o={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?Ag:T5,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},u=Lk(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function Lk(e,i,a){if(i.type==="element")return P5(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return H5(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return q5(e,i,a);if(i.type==="mdxjsEsm")return F5(e,i);if(i.type==="root")return G5(e,i,a);if(i.type==="text")return Y5(e,i)}function P5(e,i,a){const r=e.schema;let o=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Ag,e.schema=o),e.ancestors.push(i);const u=Uk(e,i.tagName,!1),d=X5(e,i);let p=Dg(e,i);return U5.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!x5(g):!0})),Ik(e,d,u,i),Rg(d,p),e.ancestors.pop(),e.schema=r,e.create(i,u,d,a)}function H5(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 F5(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Uo(e,i.position)}function q5(e,i,a){const r=e.schema;let o=r;i.name==="svg"&&r.space==="html"&&(o=Ag,e.schema=o),e.ancestors.push(i);const u=i.name===null?e.Fragment:Uk(e,i.name,!0),d=Z5(e,i),p=Dg(e,i);return Ik(e,d,u,i),Rg(d,p),e.ancestors.pop(),e.schema=r,e.create(i,u,d,a)}function G5(e,i,a){const r={};return Rg(r,Dg(e,i)),e.create(i,e.Fragment,r,a)}function Y5(e,i){return i.value}function Ik(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function Rg(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(o,u,d,p){const x=Array.isArray(d.children)?a:i;return p?x(u,d,p):x(u,d)}}function V5(e,i){return a;function a(r,o,u,d){const p=Array.isArray(u.children),g=Og(r);return i(o,u,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function X5(e,i){const a={};let r,o;for(o in i.properties)if(o!=="children"&&Mg.call(i.properties,o)){const u=Q5(e,o,i.properties[o]);if(u){const[d,p]=u;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&B5.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 Z5(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 o=r.name;let u;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,u=e.evaluater.evaluateExpression(p.expression)}else Uo(e,i.position);else u=r.value===null?!0:r.value;a[o]=u}return a}function Dg(e,i){const a=[];let r=-1;const o=e.passKeys?new Map:L5;for(;++r<i.children.length;){const u=i.children[r];let d;if(e.passKeys){const g=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(g){const x=o.get(g)||0;d=g+"-"+x,o.set(g,x+1)}}const p=Lk(e,u,d);p!==void 0&&a.push(p)}return a}function Q5(e,i,a){const r=E5(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?f5(a):C5(a)),r.property==="style"){let o=typeof a=="object"?a:W5(e,String(a));return e.stylePropertyNameCase==="css"&&(o=J5(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?w5[r.property]||r.property:r.attribute,a]}}function W5(e,i){try{return D5(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=zk+"#cannot-parse-style-attribute",o}}function Uk(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const o=i.split(".");let u=-1,d;for(;++u<o.length;){const p=Y0(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(u&&p.type==="Literal"),optional:!1}:p}r=d}else r=Y0(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const o=r.value;return Mg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uo(e)}function Uo(e,i){const a=new jn("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=zk+"#cannot-handle-mdx-estrees-without-createevaluater",a}function J5(e){const i={};let a;for(a in e)Mg.call(e,a)&&(i[e3(a)]=e[a]);return i}function e3(e){let i=e.replace(I5,t3);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function t3(e){return"-"+e.toLowerCase()}const Im={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"]},n3={};function zg(e,i){const a=n3,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Bk(e,r,o)}function Bk(e,i,a){if(i3(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 nv(e.children,i,a)}return Array.isArray(e)?nv(e,i,a):""}function nv(e,i,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=Bk(e[o],i,a);return r.join("")}function i3(e){return!!(e&&typeof e=="object")}const iv=document.createElement("i");function Lg(e){const i="&"+e+";";iv.innerHTML=i;const a=iv.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Ii(e,i,a,r){const o=e.length;let u=0,d;if(i<0?i=-i>o?0:o+i:i=i>o?o:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);u<r.length;)d=r.slice(u,u+1e4),d.unshift(i,0),e.splice(...d),u+=1e4,i+=1e4}function yi(e,i){return e.length>0?(Ii(e,e.length,0,i),e):i}const av={}.hasOwnProperty;function $k(e){const i={};let a=-1;for(;++a<e.length;)a3(i,e[a]);return i}function a3(e,i){let a;for(a in i){const o=(av.call(e,a)?e[a]:void 0)||(e[a]={}),u=i[a];let d;if(u)for(d in u){av.call(o,d)||(o[d]=[]);const p=u[d];r3(o[d],Array.isArray(p)?p:p?[p]:[])}}}function r3(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Ii(e,0,0,r)}function Pk(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 Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ln=wr(/[A-Za-z]/),Tn=wr(/[\dA-Za-z]/),s3=wr(/[#-'*+\--9=?A-Z^-~]/);function sd(e){return e!==null&&(e<32||e===127)}const Bh=wr(/\d/),l3=wr(/[\dA-Fa-f]/),o3=wr(/[!-/:-@[-`{-~]/);function Ge(e){return e!==null&&e<-2}function Lt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const zd=wr(/\p{P}|\p{S}/u),es=wr(/\s/);function wr(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function gl(e){const i=[];let a=-1,r=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&Tn(e.charCodeAt(a+1))&&Tn(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const p=e.charCodeAt(a+1);u<56320&&p>56319&&p<57344?(d=String.fromCharCode(u,p),o=1):d="�"}else d=String.fromCharCode(u);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+o+1,d=""),o&&(a+=o,o=0)}return i.join("")+e.slice(r)}function xt(e,i,a,r){const o=r?r-1:1/0;let u=0;return d;function d(g){return st(g)?(e.enter(a),p(g)):i(g)}function p(g){return st(g)&&u++<o?(e.consume(g),p):(e.exit(a),i(g))}}function Hk(e,i,a,r,o,u){let d=0;return p;function p(b){return st(b)?(e.enter(r),g(b)):x(b)}function g(b){return st(b)&&d<u?(e.consume(b),d++,g):(e.exit(r),x(b))}function x(b){return d>=o?i(b):a(b)}}const c3={tokenize:u3};function u3(e){const i=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),xt(e,i,"linePrefix")}function o(p){return e.enter("paragraph"),u(p)}function u(p){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,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 ld=class{constructor(){this.index=new Map,this.map=[]}add(i,a,r){rv(this,i,a,r,!1)}addBefore(i,a,r){rv(this,i,a,r,!0)}consume(i){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let o=r.pop();for(;o;){for(const u of o)i.push(u);o=r.pop()}this.map.length=0,this.index.clear()}};function rv(e,i,a,r,o){if(a===0&&r.length===0)return;const u=e.index.get(i);if(u){u[1]+=a,o?(r.push(...u[2]),u[2]=r):u[2].push(...r);return}const d=[i,a,r];e.map.push(d),e.index.set(i,d)}const d3={tokenize:f3},sv={tokenize:p3};function f3(e){const i=this,a=[];let r=0,o,u,d;return p;function p(C){if(r<a.length){const M=a[r];return i.containerState=M[1],e.attempt(M[0].continuation,g,x)(C)}return x(C)}function g(C){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&A();const M=i.events.length;let B=M,D;for(;B--;)if(i.events[B][0]==="exit"&&i.events[B][1].type==="chunkFlow"){D=i.events[B][1].end;break}_(r);let N=M;for(;N<i.events.length;)i.events[N][1].end={...D},N++;const z=new ld;return z.add(B+1,0,i.events.slice(M)),z.add(M,N-M,[]),z.consume(i.events),x(C)}return p(C)}function x(C){if(r===a.length){if(!o)return v(C);if(o.currentConstruct&&o.currentConstruct.concrete)return k(C);i.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(sv,b,h)(C)}function b(C){return o&&A(),_(r),v(C)}function h(C){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,k(C)}function v(C){return i.containerState={},e.attempt(sv,y,k)(C)}function y(C){return r++,a.push([i.currentConstruct,i.containerState]),v(C)}function k(C){if(C===null){o&&A(),_(0),e.consume(C);return}return o=o||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),S(C)}function S(C){if(C===null){j(e.exit("chunkFlow"),!0),_(0),e.consume(C);return}return Ge(C)?(e.consume(C),j(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(C),S)}function j(C,M){const B=i.sliceStream(C);if(M&&B.push(null),C.previous=u,u&&(u.next=C),u=C,o.defineSkip(C.start),o.write(B),i.parser.lazy[C.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<d&&(!o.events[D][1].end||o.events[D][1].end.offset>d))return;const N=i.events.length;let z=N,q,R;for(;z--;)if(i.events[z][0]==="exit"&&i.events[z][1].type==="chunkFlow"){if(q){R=i.events[z][1].end;break}q=!0}for(_(r),D=N;D<i.events.length;)i.events[D][1].end={...R},D++;const G=new ld;G.add(z+1,0,i.events.slice(N)),G.add(N,D-N,[]),G.consume(i.events)}}function _(C){let M=a.length;for(;M-- >C;){const B=a[M];i.containerState=B[1],B[0].exit.call(i,e)}a.length=C}function A(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function p3(e,i,a){return xt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function od(e){if(e===null||Lt(e)||es(e))return 1;if(zd(e))return 2}function Ld(e,i,a){const r=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!r.includes(u)&&(i=u(i,a),r.push(u))}return i}const $h={name:"attention",resolveAll:m3,tokenize:h3};function m3(e,i){let a=-1,r;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){let o=a;for(;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&i.sliceSerialize(e[o][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[o][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;const u=e[o][1].end.offset-e[o][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1,d={...e[o][1].end},p={...e[a][1].start};lv(d,-u),lv(p,u);const g={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[o][1].end}},x={type:u>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},b={type:u>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[a][1].start}},h={type:u>1?"strong":"emphasis",start:{...g.start},end:{...x.end}};e[o][1].end={...g.start},e[a][1].start={...x.end},r=[],e[o][1].end.offset-e[o][1].start.offset&&(r=yi(r,[["enter",e[o][1],i],["exit",e[o][1],i]])),r=yi(r,[["enter",h,i],["enter",g,i],["exit",g,i],["enter",b,i]]),r=yi(r,Ld(i.parser.constructs.insideSpan.null,e.slice(o+1,a),i)),r=yi(r,[["exit",b,i],["enter",x,i],["exit",x,i],["exit",h,i]]);let v=0;e[a][1].end.offset-e[a][1].start.offset&&(v=2,r=yi(r,[["enter",e[a][1],i],["exit",e[a][1],i]])),Ii(e,o-1,a-o+3,r),a=o+r.length-v-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function h3(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=od(r);let u;return d;function d(g){return u=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===u)return e.consume(g),p;const x=e.exit("attentionSequence"),b=od(g),h=!b||b===2&&o||a.includes(g)&&g!==42&&g!==95,v=!o||o===2&&b||a.includes(r)&&r!==42&&r!==95;return x._open=!!(u===42?h:h&&(o||!v)),x._close=!!(u===42?v:v&&(b||!h)),i(g)}}function lv(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const g3={name:"autolink",tokenize:x3};function x3(e,i,a){let r=0;return o;function o(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(y){return Ln(y)?(e.consume(y),d):y===64?a(y):x(y)}function d(y){return y===43||y===45||y===46||Tn(y)?(r=1,p(y)):x(y)}function p(y){return y===58?(e.consume(y),r=0,g):(y===43||y===45||y===46||Tn(y))&&r++<32?(e.consume(y),p):(r=0,x(y))}function g(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||sd(y)?a(y):(e.consume(y),g)}function x(y){return y===64?(e.consume(y),b):s3(y)?(e.consume(y),x):a(y)}function b(y){return Tn(y)?h(y):a(y)}function h(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||Tn(y))&&r++<63){const k=y===45?v:h;return e.consume(y),k}return a(y)}}const Go={partial:!0,tokenize:b3};function b3(e,i,a){return r;function r(u){return st(u)?xt(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Ge(u)?i(u):a(u)}}const Fk={continuation:{tokenize:v3},exit:w3,name:"blockQuote",tokenize:y3};function y3(e,i,a){const r=this;return o;function o(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return a(d)}function u(d){return st(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function v3(e,i,a){const r=this;return o;function o(d){return st(d)?xt(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Fk,i,a)(d)}}function w3(e){e.exit("blockQuote")}const qk={name:"characterEscape",tokenize:k3};function k3(e,i,a){return r;function r(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return o3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(u)}}const Gk={name:"characterReference",tokenize:N3};function N3(e,i,a){const r=this;let o=0,u,d;return p;function p(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),g}function g(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),x):(e.enter("characterReferenceValue"),u=31,d=Tn,b(h))}function x(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=l3,b):(e.enter("characterReferenceValue"),u=7,d=Bh,b(h))}function b(h){if(h===59&&o){const v=e.exit("characterReferenceValue");return d===Tn&&!Lg(r.sliceSerialize(v))?a(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(h)&&o++<u?(e.consume(h),b):a(h)}}const Ph={partial:!0,tokenize:E3};function E3(e,i,a){const r=this;return o;function o(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const ov={concrete:!0,name:"codeFenced",tokenize:S3};function S3(e,i,a){const r=this,o={partial:!0,tokenize:B};let u=0,d=0,p;return g;function g(D){return x(D)}function x(D){const N=r.events[r.events.length-1];return u=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,p=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(D)}function b(D){return D===p?(d++,e.consume(D),b):d<3?a(D):(e.exit("codeFencedFenceSequence"),st(D)?xt(e,h,"whitespace")(D):h(D))}function h(D){return D===null||Ge(D)?(e.exit("codeFencedFence"),r.interrupt?i(D):e.check(Ph,S,M)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Ge(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(D)):st(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,y,"whitespace")(D)):D===96&&D===p?a(D):(e.consume(D),v)}function y(D){return D===null||Ge(D)?h(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(D))}function k(D){return D===null||Ge(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(D)):D===96&&D===p?a(D):(e.consume(D),k)}function S(D){return e.attempt(o,M,j)(D)}function j(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),_}function _(D){return u>0&&st(D)?xt(e,A,"linePrefix",u+1)(D):A(D)}function A(D){return D===null||Ge(D)?e.check(Ph,S,M)(D):(e.enter("codeFlowValue"),C(D))}function C(D){return D===null||Ge(D)?(e.exit("codeFlowValue"),A(D)):(e.consume(D),C)}function M(D){return e.exit("codeFenced"),i(D)}function B(D,N,z){let q=0;return R;function R(J){return D.enter("lineEnding"),D.consume(J),D.exit("lineEnding"),G}function G(J){return D.enter("codeFencedFence"),st(J)?xt(D,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):Z(J)}function Z(J){return J===p?(D.enter("codeFencedFenceSequence"),fe(J)):z(J)}function fe(J){return J===p?(q++,D.consume(J),fe):q>=d?(D.exit("codeFencedFenceSequence"),st(J)?xt(D,le,"whitespace")(J):le(J)):z(J)}function le(J){return J===null||Ge(J)?(D.exit("codeFencedFence"),N(J)):z(J)}}}const Um={name:"codeIndented",tokenize:T3},_3={partial:!0,tokenize:C3};function T3(e,i,a){return r;function r(p){return e.enter("codeIndented"),Hk(e,o,a,"linePrefix",4,4)(p)}function o(p){return p===null?d(p):Ge(p)?e.attempt(_3,o,d)(p):(e.enter("codeFlowValue"),u(p))}function u(p){return p===null||Ge(p)?(e.exit("codeFlowValue"),o(p)):(e.consume(p),u)}function d(p){return e.exit("codeIndented"),i(p)}}function C3(e,i,a){const r=this;return o;function o(d){return r.parser.lazy[r.now().line]?a(d):Ge(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):Hk(e,i,u,"linePrefix",4,4)(d)}function u(d){return Ge(d)?o(d):a(d)}}const j3={name:"codeText",previous:O3,resolve:A3,tokenize:M3};function A3(e){let i=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)o===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(o=r):(r===i||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),i-=r-o-2,r=o+2),o=void 0);return e}function O3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M3(e,i,a){let r=0,o,u;return d;function d(h){return e.enter("codeText"),e.enter("codeTextSequence"),p(h)}function p(h){return h===96?(e.consume(h),r++,p):(e.exit("codeTextSequence"),g(h))}function g(h){return h===null?a(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),g):h===96?(u=e.enter("codeTextSequence"),o=0,b(h)):Ge(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),g):(e.enter("codeTextData"),x(h))}function x(h){return h===null||h===32||h===96||Ge(h)?(e.exit("codeTextData"),g(h)):(e.consume(h),x)}function b(h){return h===96?(e.consume(h),o++,b):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(h)):(u.type="codeTextData",x(h))}}class R3{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const o=a||0;this.setCursor(Math.trunc(i));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&go(this.left,r),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),go(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),go(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);go(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);go(this.left,a.reverse())}}}function go(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function Yk(e){const i={};let a=-1,r,o,u,d,p,g,x;const b=new R3(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"&&(g=r[1]._tokenizer.events,u=0,u<g.length&&g[u][1].type==="lineEndingBlank"&&(u+=2),u<g.length&&g[u][1].type==="content"))for(;++u<g.length&&g[u][1].type!=="content";)g[u][1].type==="chunkText"&&(g[u][1]._isInFirstContentOfListItem=!0,u++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,D3(b,a)),a=i[a],x=!0);else if(r[1]._container){for(u=a,o=void 0;u--;)if(d=b.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(r[1].end={...b.get(o)[1].start},p=b.slice(o,a),p.unshift(r),b.splice(o,a-o+1,p))}}return Ii(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!x}function D3(e,i){const a=e.get(i)[1],r=e.get(i)[2];let o=i-1;const u=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],x={};let b,h,v=-1,y=a,k=0,S=0;const j=[S];for(;y;){for(;e.get(++o)[1]!==y;);u.push(o),y._tokenizer||(b=r.sliceStream(y),y.next||b.push(null),h&&d.defineSkip(y.start),y._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),y._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),h=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 _=p.slice(j[v],j[v+1]),A=u.pop();g.push([A,A+_.length-1]),e.splice(A,2,_)}for(g.reverse(),v=-1;++v<g.length;)x[k+g[v][0]]=k+g[v][1],k+=g[v][1]-g[v][0]-1;return x}const z3={resolve:I3,tokenize:U3},L3={partial:!0,tokenize:B3};function I3(e){return Yk(e),e}function U3(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(p)}function o(p){return p===null?u(p):Ge(p)?e.check(L3,d,u)(p):(e.consume(p),o)}function u(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function B3(e,i,a){const r=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),xt(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 Kk(e,i,a,r,o,u,d,p,g){const x=g||Number.POSITIVE_INFINITY;let b=0;return h;function h(_){return _===60?(e.enter(r),e.enter(o),e.enter(u),e.consume(_),e.exit(u),v):_===null||_===32||_===41||sd(_)?a(_):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),S(_))}function v(_){return _===62?(e.enter(u),e.consume(_),e.exit(u),e.exit(o),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===62?(e.exit("chunkString"),e.exit(p),v(_)):_===null||_===60||Ge(_)?a(_):(e.consume(_),_===92?k:y)}function k(_){return _===60||_===62||_===92?(e.consume(_),y):y(_)}function S(_){return!b&&(_===null||_===41||Lt(_))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(_)):b<x&&_===40?(e.consume(_),b++,S):_===41?(e.consume(_),b--,S):_===null||_===32||_===40||sd(_)?a(_):(e.consume(_),_===92?j:S)}function j(_){return _===40||_===41||_===92?(e.consume(_),S):S(_)}}function Vk(e,i,a,r,o,u){const d=this;let p=0,g;return x;function x(y){return e.enter(r),e.enter(o),e.consume(y),e.exit(o),e.enter(u),b}function b(y){return p>999||y===null||y===91||y===93&&!g||y===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(y):y===93?(e.exit(u),e.enter(o),e.consume(y),e.exit(o),e.exit(r),i):Ge(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||Ge(y)||p++>999?(e.exit("chunkString"),b(y)):(e.consume(y),g||(g=!st(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),p++,h):h(y)}}function Xk(e,i,a,r,o,u){let d;return p;function p(v){return v===34||v===39||v===40?(e.enter(r),e.enter(o),e.consume(v),e.exit(o),d=v===40?41:v,g):a(v)}function g(v){return v===d?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),i):(e.enter(u),x(v))}function x(v){return v===d?(e.exit(u),g(d)):v===null?a(v):Ge(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),xt(e,x,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===d||v===null||Ge(v)?(e.exit("chunkString"),x(v)):(e.consume(v),v===92?h:b)}function h(v){return v===d||v===92?(e.consume(v),b):b(v)}}function jo(e,i){let a;return r;function r(o){return Ge(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):st(o)?xt(e,r,a?"linePrefix":"lineSuffix")(o):i(o)}}const $3={name:"definition",tokenize:H3},P3={partial:!0,tokenize:F3};function H3(e,i,a){const r=this;let o;return u;function u(y){return e.enter("definition"),d(y)}function d(y){return Vk.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function p(y){return o=Ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),g):a(y)}function g(y){return Lt(y)?jo(e,x)(y):x(y)}function x(y){return Kk(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function b(y){return e.attempt(P3,h,h)(y)}function h(y){return st(y)?xt(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Ge(y)?(e.exit("definition"),r.parser.defined.push(o),i(y)):a(y)}}function F3(e,i,a){return r;function r(p){return Lt(p)?jo(e,o)(p):a(p)}function o(p){return Xk(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function u(p){return st(p)?xt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Ge(p)?i(p):a(p)}}const q3={name:"hardBreakEscape",tokenize:G3};function G3(e,i,a){return r;function r(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Ge(u)?(e.exit("hardBreakEscape"),i(u)):a(u)}}const Y3={name:"headingAtx",resolve:K3,tokenize:V3};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 o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},u={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"};Ii(e,r,a-r+1,[["enter",o,i],["enter",u,i],["exit",u,i],["exit",o,i]])}return e}function V3(e,i,a){let r=0;return o;function o(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||Lt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Ge(b)?(e.exit("atxHeading"),i(b)):st(b)?xt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),x(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function x(b){return b===null||b===35||Lt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),x)}}const X3=["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"],cv=["pre","script","style","textarea"],Z3={concrete:!0,name:"htmlFlow",resolveTo:W3,tokenize:J3},Q3={partial:!0,tokenize:eR};function W3(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 J3(e,i,a){const r=this;let o,u,d,p,g;return x;function x(L){return b(L)}function b(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),h}function h(L){return L===33?(e.consume(L),v):L===47?(e.consume(L),u=!0,S):L===63?(e.consume(L),o=3,r.interrupt?i:E):Ln(L)?(e.consume(L),d=String.fromCharCode(L),j):a(L)}function v(L){return L===45?(e.consume(L),o=2,y):L===91?(e.consume(L),o=5,p=0,k):Ln(L)?(e.consume(L),o=4,r.interrupt?i:E):a(L)}function y(L){return L===45?(e.consume(L),r.interrupt?i:E):a(L)}function k(L){const $="CDATA[";return L===$.charCodeAt(p++)?(e.consume(L),p===$.length?r.interrupt?i:Z:k):a(L)}function S(L){return Ln(L)?(e.consume(L),d=String.fromCharCode(L),j):a(L)}function j(L){if(L===null||L===47||L===62||Lt(L)){const $=L===47,oe=d.toLowerCase();return!$&&!u&&cv.includes(oe)?(o=1,r.interrupt?i(L):Z(L)):X3.includes(d.toLowerCase())?(o=6,$?(e.consume(L),_):r.interrupt?i(L):Z(L)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(L):u?A(L):C(L))}return L===45||Tn(L)?(e.consume(L),d+=String.fromCharCode(L),j):a(L)}function _(L){return L===62?(e.consume(L),r.interrupt?i:Z):a(L)}function A(L){return st(L)?(e.consume(L),A):R(L)}function C(L){return L===47?(e.consume(L),R):L===58||L===95||Ln(L)?(e.consume(L),M):st(L)?(e.consume(L),C):R(L)}function M(L){return L===45||L===46||L===58||L===95||Tn(L)?(e.consume(L),M):B(L)}function B(L){return L===61?(e.consume(L),D):st(L)?(e.consume(L),B):C(L)}function D(L){return L===null||L===60||L===61||L===62||L===96?a(L):L===34||L===39?(e.consume(L),g=L,N):st(L)?(e.consume(L),D):z(L)}function N(L){return L===g?(e.consume(L),g=null,q):L===null||Ge(L)?a(L):(e.consume(L),N)}function z(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Lt(L)?B(L):(e.consume(L),z)}function q(L){return L===47||L===62||st(L)?C(L):a(L)}function R(L){return L===62?(e.consume(L),G):a(L)}function G(L){return L===null||Ge(L)?Z(L):st(L)?(e.consume(L),G):a(L)}function Z(L){return L===45&&o===2?(e.consume(L),O):L===60&&o===1?(e.consume(L),re):L===62&&o===4?(e.consume(L),pe):L===63&&o===3?(e.consume(L),E):L===93&&o===5?(e.consume(L),ne):Ge(L)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Q3,_e,fe)(L)):L===null||Ge(L)?(e.exit("htmlFlowData"),fe(L)):(e.consume(L),Z)}function fe(L){return e.check(Ph,le,_e)(L)}function le(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),J}function J(L){return L===null||Ge(L)?fe(L):(e.enter("htmlFlowData"),Z(L))}function O(L){return L===45?(e.consume(L),E):Z(L)}function re(L){return L===47?(e.consume(L),d="",ie):Z(L)}function ie(L){if(L===62){const $=d.toLowerCase();return cv.includes($)?(e.consume(L),pe):Z(L)}return Ln(L)&&d.length<8?(e.consume(L),d+=String.fromCharCode(L),ie):Z(L)}function ne(L){return L===93?(e.consume(L),E):Z(L)}function E(L){return L===62?(e.consume(L),pe):L===45&&o===2?(e.consume(L),E):Z(L)}function pe(L){return L===null||Ge(L)?(e.exit("htmlFlowData"),_e(L)):(e.consume(L),pe)}function _e(L){return e.exit("htmlFlow"),i(L)}}function eR(e,i,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Go,i,a)}}const tR={name:"htmlText",tokenize:nR};function nR(e,i,a){const r=this;let o,u,d;return p;function p(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),g}function g(E){return E===33?(e.consume(E),x):E===47?(e.consume(E),B):E===63?(e.consume(E),C):Ln(E)?(e.consume(E),z):a(E)}function x(E){return E===45?(e.consume(E),b):E===91?(e.consume(E),u=0,k):Ln(E)?(e.consume(E),A):a(E)}function b(E){return E===45?(e.consume(E),y):a(E)}function h(E){return E===null?a(E):E===45?(e.consume(E),v):Ge(E)?(d=h,re(E)):(e.consume(E),h)}function v(E){return E===45?(e.consume(E),y):h(E)}function y(E){return E===62?O(E):E===45?v(E):h(E)}function k(E){const pe="CDATA[";return E===pe.charCodeAt(u++)?(e.consume(E),u===pe.length?S:k):a(E)}function S(E){return E===null?a(E):E===93?(e.consume(E),j):Ge(E)?(d=S,re(E)):(e.consume(E),S)}function j(E){return E===93?(e.consume(E),_):S(E)}function _(E){return E===62?O(E):E===93?(e.consume(E),_):S(E)}function A(E){return E===null||E===62?O(E):Ge(E)?(d=A,re(E)):(e.consume(E),A)}function C(E){return E===null?a(E):E===63?(e.consume(E),M):Ge(E)?(d=C,re(E)):(e.consume(E),C)}function M(E){return E===62?O(E):C(E)}function B(E){return Ln(E)?(e.consume(E),D):a(E)}function D(E){return E===45||Tn(E)?(e.consume(E),D):N(E)}function N(E){return Ge(E)?(d=N,re(E)):st(E)?(e.consume(E),N):O(E)}function z(E){return E===45||Tn(E)?(e.consume(E),z):E===47||E===62||Lt(E)?q(E):a(E)}function q(E){return E===47?(e.consume(E),O):E===58||E===95||Ln(E)?(e.consume(E),R):Ge(E)?(d=q,re(E)):st(E)?(e.consume(E),q):O(E)}function R(E){return E===45||E===46||E===58||E===95||Tn(E)?(e.consume(E),R):G(E)}function G(E){return E===61?(e.consume(E),Z):Ge(E)?(d=G,re(E)):st(E)?(e.consume(E),G):q(E)}function Z(E){return E===null||E===60||E===61||E===62||E===96?a(E):E===34||E===39?(e.consume(E),o=E,fe):Ge(E)?(d=Z,re(E)):st(E)?(e.consume(E),Z):(e.consume(E),le)}function fe(E){return E===o?(e.consume(E),o=void 0,J):E===null?a(E):Ge(E)?(d=fe,re(E)):(e.consume(E),fe)}function le(E){return E===null||E===34||E===39||E===60||E===61||E===96?a(E):E===47||E===62||Lt(E)?q(E):(e.consume(E),le)}function J(E){return E===47||E===62||Lt(E)?q(E):a(E)}function O(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),i):a(E)}function re(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),ie}function ie(E){return st(E)?xt(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):ne(E)}function ne(E){return e.enter("htmlTextData"),d(E)}}const Ig={name:"labelEnd",resolveAll:sR,resolveTo:lR,tokenize:oR},iR={tokenize:cR},aR={tokenize:uR},rR={tokenize:dR};function sR(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",i+=o}}return e.length!==a.length&&Ii(e,0,e.length,a),e}function lR(e,i){let a=e.length,r=0,o,u,d;for(;a--;){const b=e[a][1];if(o){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&&(o=a,b.type!=="labelLink")){r=2;break}}else b.type==="labelEnd"&&(u=a)}const p={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},g={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},x={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",p,i],["enter",g,i]],d=yi(d,e.slice(o+1,o+r+3)),d=yi(d,[["enter",x,i]]),d=yi(d,Ld(i.parser.constructs.insideSpan.null,e.slice(o+r+4,u-3),i)),d=yi(d,[["exit",x,i],e[u-2],e[u-1],["exit",g,i]]),d=yi(d,e.slice(u+1)),d=yi(d,[["exit",p,i]]),Ii(e,o,e.length,d),e}function oR(e,i,a){const r=this,o=r._labelStarts;let u,d;if(o){for(;o.length>0&&o[o.length-1]._balanced;)o.pop();u=o[o.length-1]}return p;function p(v){return u?u._inactive?h(v):(d=r.parser.defined.includes(Ui(r.sliceSerialize({start:u.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),g):a(v)}function g(v){return v===40?e.attempt(iR,b,d?b:h)(v):v===91?e.attempt(aR,b,d?x:h)(v):d?b(v):h(v)}function x(v){return e.attempt(rR,b,h)(v)}function b(v){return o.pop(),i(v)}function h(v){return u._balanced=!0,a(v)}}function cR(e,i,a){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Lt(h)?jo(e,u)(h):u(h)}function u(h){return h===41?b(h):Kk(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function d(h){return Lt(h)?jo(e,g)(h):b(h)}function p(h){return a(h)}function g(h){return h===34||h===39||h===40?Xk(e,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):b(h)}function x(h){return Lt(h)?jo(e,b)(h):b(h)}function b(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),i):a(h)}}function uR(e,i,a){const r=this;return o;function o(p){return Vk.call(r,e,u,d,"reference","referenceMarker","referenceString")(p)}function u(p){return r.parser.defined.includes(Ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function dR(e,i,a){return r;function r(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),i):a(u)}}const fR={name:"labelStartImage",resolveAll:Ig.resolveAll,tokenize:pR};function pR(e,i,a){const r=this;let o;return u;function u(g){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(g),e.exit("labelImageMarker"),d}function d(g){return g===91?(e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),o=e.exit("labelImage"),p):a(g)}function p(g){return g===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(g):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(o),i(g))}}const mR={name:"labelStartLink",resolveAll:Ig.resolveAll,tokenize:hR};function hR(e,i,a){const r=this;let o;return u;function u(p){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),o=e.exit("labelLink"),d}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(o),i(p))}}const Bm={name:"lineEnding",tokenize:gR};function gR(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xt(e,i,"linePrefix")}}const Fu={name:"thematicBreak",tokenize:xR};function xR(e,i,a){let r=0,o;return u;function u(x){return e.enter("thematicBreak"),d(x)}function d(x){return o=x,p(x)}function p(x){return x===o?(e.enter("thematicBreakSequence"),g(x)):r>=3&&(x===null||Ge(x))?(e.exit("thematicBreak"),i(x)):a(x)}function g(x){return x===o?(e.consume(x),r++,g):(e.exit("thematicBreakSequence"),st(x)?xt(e,p,"whitespace")(x):p(x))}}const Vn={continuation:{tokenize:wR},exit:NR,name:"list",tokenize:vR},bR={partial:!0,tokenize:ER},yR={partial:!0,tokenize:kR};function vR(e,i,a){const r=this,o=r.events[r.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return p;function p(y){const k=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Bh(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(Fu,a,x)(y):x(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(y)}return a(y)}function g(y){return Bh(y)&&++d<10?(e.consume(y),g):(!r.interrupt||d<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),x(y)):a(y)}function x(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Go,r.interrupt?a:b,e.attempt(bR,v,h))}function b(y){return r.containerState.initialBlankLine=!0,u++,v(y)}function h(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 wR(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Go,o,u);function o(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xt(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(yR,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,xt(e,e.attempt(Vn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function kR(e,i,a){const r=this;return xt(e,o,"listItemIndent",r.containerState.size+1);function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(u):a(u)}}function NR(e){e.exit(this.containerState.type)}function ER(e,i,a){const r=this;return xt(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=r.events[r.events.length-1];return!st(u)&&d&&d[1].type==="listItemPrefixWhitespace"?i(u):a(u)}}const uv={name:"setextUnderline",resolveTo:SR,tokenize:_R};function SR(e,i){const a=new ld;let r=e.length,o,u,d;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){o=r;break}e[r][1].type==="paragraph"&&(u=r)}else e[r][1].type==="content"&&a.add(r,1,[]),!d&&e[r][1].type==="definition"&&(d=r);const p={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",d?(a.add(u,0,[["enter",p,i]]),a.add(d+1,0,[["exit",e[o][1],i]]),e[o][1].end={...e[d][1].end}):e[o][1]=p,a.add(e.length,0,[["exit",p,i]]),a.consume(e),e}function _R(e,i,a){const r=this;let o;return u;function u(x){let b=r.events.length,h;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){h=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=x,d(x)):a(x)}function d(x){return e.enter("setextHeadingLineSequence"),p(x)}function p(x){return x===o?(e.consume(x),p):(e.exit("setextHeadingLineSequence"),st(x)?xt(e,g,"lineSuffix")(x):g(x))}function g(x){return x===null||Ge(x)?(e.exit("setextHeadingLine"),i(x)):a(x)}}const TR={tokenize:CR};function CR(e){const i=this,a=e.attempt(Go,r,e.attempt(this.parser.constructs.flowInitial,o,xt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(z3,o)),"linePrefix")));return a;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const jR={resolveAll:Qk()},AR=Zk("string"),OR=Zk("text");function Zk(e){return{resolveAll:Qk(e==="text"?MR:void 0),tokenize:i};function i(a){const r=this,o=this.parser.constructs[e],u=a.attempt(o,d,p);return d;function d(b){return x(b)?u(b):p(b)}function p(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return x(b)?(a.exit("data"),u(b)):(a.consume(b),g)}function x(b){if(b===null)return!0;const h=o[b];let v=-1;if(h)for(;++v<h.length;){const y=h[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Qk(e){return i;function i(a,r){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,r):a}}function MR(e,i){const a=new ld;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const o=e[r-1][1],u=i.sliceStream(o);let d=u.length,p=-1,g=0,x;for(;d--;){const b=u[d];if(typeof b=="string"){for(p=b.length;b.charCodeAt(p-1)===32;)g++,p--;if(p)break;p=-1}else if(b===-2)x=!0,g++;else if(b!==-1){d++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(g=0),g){const b={type:r===e.length||x||g<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?p:o.start._bufferIndex+p,_index:o.start._index+d,line:o.end.line,column:o.end.column-g,offset:o.end.offset-g},end:{...o.end}};o.end={...b.start},o.start.offset===o.end.offset?Object.assign(o,b):a.add(r,0,[["enter",b,i],["exit",b,i]])}r++}return a.consume(e),e}const RR={42:Vn,43:Vn,45:Vn,48:Vn,49:Vn,50:Vn,51:Vn,52:Vn,53:Vn,54:Vn,55:Vn,56:Vn,57:Vn,62:Fk},DR={91:$3},zR={[-2]:Um,[-1]:Um,32:Um},LR={35:Y3,42:Fu,45:[uv,Fu],60:Z3,61:uv,95:Fu,96:ov,126:ov},IR={38:Gk,92:qk},UR={[-5]:Bm,[-4]:Bm,[-3]:Bm,33:fR,38:Gk,42:$h,60:[g3,tR],91:mR,92:[q3,qk],93:Ig,95:$h,96:j3},BR={null:[$h,jR]},$R={null:[42,95]},PR={null:[]},HR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$R,contentInitial:DR,disable:PR,document:RR,flow:LR,flowInitial:zR,insideSpan:BR,string:IR,text:UR},Symbol.toStringTag,{value:"Module"}));function FR(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let d=[],p=[];const g={attempt:N(B),check:N(D),consume:A,enter:C,exit:M,interrupt:N(D,{interrupt:!0})},x={code:null,containerState:{},defineSkip:S,events:[],now:k,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let b=i.tokenize.call(x,g);return i.resolveAll&&u.push(i),x;function h(G){return d=yi(d,G),j(),d[d.length-1]!==null?[]:(z(i,0),x.events=Ld(u,x.events,x),x.events)}function v(G,Z){return GR(y(G),Z)}function y(G){return qR(d,G)}function k(){const{_bufferIndex:G,_index:Z,line:fe,column:le,offset:J}=r;return{_bufferIndex:G,_index:Z,line:fe,column:le,offset:J}}function S(G){o[G.line]=G.column,R()}function j(){for(;r._index<d.length;){const G=d[r._index];if(typeof G=="string"){const Z=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===Z&&r._bufferIndex<G.length;)_(G.charCodeAt(r._bufferIndex))}else _(G)}}function _(G){b=b(G)}function A(G){Ge(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,R()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),x.previous=G}function C(G,Z){const fe=Z||{};return fe.type=G,fe.start=k(),x.events.push(["enter",fe,x]),p.push(fe),fe}function M(G){const Z=p.pop();return Z.end=k(),x.events.push(["exit",Z,x]),Z}function B(G,Z){z(G,Z.from)}function D(G,Z){Z.restore()}function N(G,Z){return fe;function fe(le,J,O){let re,ie,ne,E;return Array.isArray(le)?_e(le):"tokenize"in le?_e([le]):pe(le);function pe(xe){return Te;function Te($e){const He=$e!==null&&xe[$e],Be=$e!==null&&xe.null,Ee=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(Be)?Be:Be?[Be]:[]];return _e(Ee)($e)}}function _e(xe){return re=xe,ie=0,xe.length===0?O:L(xe[ie])}function L(xe){return Te;function Te($e){return E=q(),ne=xe,xe.partial||(x.currentConstruct=xe),xe.name&&x.parser.constructs.disable.null.includes(xe.name)?oe():xe.tokenize.call(Z?Object.assign(Object.create(x),Z):x,g,$,oe)($e)}}function $(xe){return G(ne,E),J}function oe(xe){return E.restore(),++ie<re.length?L(re[ie]):O}}}function z(G,Z){G.resolveAll&&!u.includes(G)&&u.push(G),G.resolve&&Ii(x.events,Z,x.events.length-Z,G.resolve(x.events.slice(Z),x)),G.resolveTo&&(x.events=G.resolveTo(x.events,x))}function q(){const G=k(),Z=x.previous,fe=x.currentConstruct,le=x.events.length,J=Array.from(p);return{from:le,restore:O};function O(){r=G,x.previous=Z,x.currentConstruct=fe,x.events.length=le,p=J,R()}}function R(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function qR(e,i){const a=i.start._index,r=i.start._bufferIndex,o=i.end._index,u=i.end._bufferIndex;let d;if(a===o)d=[e[a].slice(r,u)];else{if(d=e.slice(a,o),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function GR(e,i){let a=-1;const r=[];let o;for(;++a<e.length;){const u=e[a];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
202
+ `;break}case-3:{d=`\r
203
+ `;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,r.push(d)}return r.join("")}function YR(e){const r={constructs:$k([HR,...(e||{}).extensions||[]]),content:o(c3),defined:[],document:o(d3),flow:o(TR),lazy:{},string:o(AR),text:o(OR)};return r;function o(u){return d;function d(p){return FR(r,u,p)}}}function KR(e){for(;!Yk(e););return e}const dv=/[\0\t\n\r]/g;function VR(){let e=1,i="",a=!0,r;return o;function o(u,d,p){u=i+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u));const g=[];let x=0;for(i="",a&&(u.charCodeAt(0)===65279&&x++,a=void 0);x<u.length;){dv.lastIndex=x;const b=dv.exec(u),h=b&&b.index!==void 0?b.index:u.length,v=u.charCodeAt(h);if(!b){i=u.slice(x);break}if(v===10&&x===h&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<h&&(g.push(u.slice(x,h)),e+=h-x),v){case 0:{g.push(65533),e++;break}case 9:{const y=Math.ceil(e/4)*4;for(g.push(-2);e++<y;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=h+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const XR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZR(e){return e.replace(XR,QR)}function QR(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return Pk(a.slice(u?2:1),u?16:10)}return Lg(a)||e}const Wk={}.hasOwnProperty;function WR(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),JR(a)(KR(YR(a).document().write(VR()(e,i,!0))))}function JR(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(se),autolinkProtocol:R,autolinkEmail:R,atxHeading:d(Me),blockQuote:d(Ee),characterEscape:R,characterReference:R,codeFenced:d(P),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:d(P,p),codeText:d(X,p),codeTextData:R,data:R,codeFlowValue:R,definition:d(ye),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:d(je),hardBreakEscape:d(ot),hardBreakTrailing:d(ot),htmlFlow:d(Ke,p),htmlFlowData:R,htmlText:d(Ke,p),htmlTextData:R,image:d(jt),label:p,link:d(se),listItem:d(bt),listItemValue:y,listOrdered:d(Le,v),listUnordered:d(Le),paragraph:d(ht),reference:$,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:d(Me),strong:d(Ht),thematicBreak:d(Qn)},exit:{atxHeading:x(),atxHeadingSequence:D,autolink:x(),autolinkEmail:Be,autolinkProtocol:He,blockQuote:x(),characterEscapeValue:G,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:Te,characterReference:$e,codeFenced:x(_),codeFencedFence:j,codeFencedFenceInfo:k,codeFencedFenceMeta:S,codeFlowValue:G,codeIndented:x(A),codeText:x(O),codeTextData:G,data:G,definition:x(),definitionDestinationString:B,definitionLabelString:C,definitionTitleString:M,emphasis:x(),hardBreakEscape:x(fe),hardBreakTrailing:x(fe),htmlFlow:x(le),htmlFlowData:G,htmlText:x(J),htmlTextData:G,image:x(ie),label:E,labelText:ne,lineEnding:Z,link:x(re),listItem:x(),listOrdered:x(),listUnordered:x(),paragraph:x(),referenceString:oe,resourceDestinationString:pe,resourceTitleString:_e,resource:L,setextHeading:x(q),setextHeadingLineSequence:z,setextHeadingText:N,strong:x(),thematicBreak:x()}};Jk(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ae){let ve={type:"root",children:[],position:void 0};const Fe={stack:[ve],tokenStack:[],config:i,enter:g,exit:b,buffer:p,resume:h,data:a},Ze=[],Vt=[];let Et=-1;for(;++Et<ae.length;)if(Vt.push(ae[Et]),ae[Et][1].type==="listOrdered"||ae[Et][1].type==="listUnordered")if(ae[Et][0]==="enter")Ze.push(Vt.length-1);else{const ln=Ze.pop();u(Vt,ln)}for(ae=Vt,Et=-1;++Et<ae.length;){const ln=i[ae[Et][0]];ae[Et][0]==="enter"&&i.beforeEnter.length>0&&o(i.beforeEnter,{...Fe,sliceSerialize:ae[Et][2].sliceSerialize},ae[Et][1]),Wk.call(ln,ae[Et][1].type)&&ln[ae[Et][1].type].call({...Fe,sliceSerialize:ae[Et][2].sliceSerialize},ae[Et][1]),ae[Et][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{...Fe,sliceSerialize:ae[Et][2].sliceSerialize},ae[Et][1])}if(Fe.tokenStack.length>0){const ln=Fe.tokenStack[Fe.tokenStack.length-1];(ln[1]||fv).call(Fe,void 0,ln[0])}for(ve.position={start:pr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:pr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Et=-1;++Et<i.transforms.length;)ve=i.transforms[Et](ve)||ve;return ve}function o(ae,ve,Fe){let Ze=-1;for(;++Ze<ae.length;)ae[Ze].call(ve,Fe)}function u(ae,ve){const Fe=ae.length-1;let Ze=ve-1,Vt=-1,Et=!1,ln,gn,Ni,Ei;const sa=[];for(;++Ze<=Fe;){const un=ae[Ze];switch(un[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{un[0]==="enter"?Vt++:Vt--,Ei=void 0;break}case"lineEndingBlank":{un[0]==="enter"&&(ln&&!Ei&&!Vt&&!Ni&&(Ni=Ze),Ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ei=void 0}if(!Vt&&un[0]==="enter"&&un[1].type==="listItemPrefix"||Vt===-1&&un[0]==="exit"&&(un[1].type==="listUnordered"||un[1].type==="listOrdered")){if(ln){let Si=Ze;for(gn=void 0;Si--;){const An=ae[Si];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;gn&&(ae[gn][1].type="lineEndingBlank",Et=!0),An[1].type="lineEnding",gn=Si}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}Ni&&(!gn||Ni<gn)&&(ln._spread=!0),ln.end=Object.assign({},gn?ae[gn][1].start:un[1].end),sa.push({at:gn||Ze,event:["exit",ln,un[2]]})}if(un[1].type==="listItemPrefix"){const Si={type:"listItem",_spread:!1,start:Object.assign({},un[1].start),end:void 0};ln=Si,sa.push({at:Ze,event:["enter",Si,un[2]]}),Ni=void 0,Ei=!0}}}const Ra=ae.splice(ve);let Xt=0;for(Ze=-1;++Ze<Ra.length;){for(;Xt<sa.length&&sa[Xt].at===ve+Ze;)ae.push(sa[Xt++].event);ae.push(Ra[Ze])}ae[ve][1]._spread=Et}function d(ae,ve){return Fe;function Fe(Ze){g.call(this,ae(Ze),Ze),ve&&ve.call(this,Ze)}}function p(){this.stack.push({type:"fragment",children:[]})}function g(ae,ve,Fe){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ve,Fe||void 0]),ae.position={start:pr(ve.start),end:void 0}}function x(ae){return ve;function ve(Fe){ae&&ae.call(this,Fe),b.call(this,Fe)}}function b(ae,ve){const Fe=this.stack.pop(),Ze=this.tokenStack.pop();if(!Ze)throw new Error("Cannot close `"+ae.type+"` ("+Co({start:ae.start,end:ae.end})+"): it’s not open");Ze[0].type!==ae.type&&(ve?ve.call(this,ae,Ze[0]):(Ze[1]||fv).call(this,ae,Ze[0])),Fe.position.end=pr(ae.end)}function h(){return zg(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function y(ae){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function k(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ae}function S(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ae}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae.replace(/(\r?\n|\r)$/g,"")}function C(ae){const ve=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=ve,Fe.identifier=Ui(this.sliceSerialize(ae)).toLowerCase()}function M(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ae}function B(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ae}function D(ae){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Fe=this.sliceSerialize(ae).length;ve.depth=Fe}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function z(ae){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function R(ae){const Fe=this.stack[this.stack.length-1].children;let Ze=Fe[Fe.length-1];(!Ze||Ze.type!=="text")&&(Ze=Bn(),Ze.position={start:pr(ae.start),end:void 0},Fe.push(Ze)),this.stack.push(Ze)}function G(ae){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ae),ve.position.end=pr(ae.end)}function Z(ae){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Fe=ve.children[ve.children.length-1];Fe.position.end=pr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ve.type)&&(R.call(this,ae),G.call(this,ae))}function fe(){this.data.atHardBreak=!0}function le(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae}function J(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae}function O(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae}function re(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ve,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function ie(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ve,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function ne(ae){const ve=this.sliceSerialize(ae),Fe=this.stack[this.stack.length-2];Fe.label=ZR(ve),Fe.identifier=Ui(ve).toLowerCase()}function E(){const ae=this.stack[this.stack.length-1],ve=this.resume(),Fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Fe.type==="link"){const Ze=ae.children;Fe.children=Ze}else Fe.alt=ve}function pe(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ae}function _e(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ae}function L(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function oe(ae){const ve=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=ve,Fe.identifier=Ui(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function xe(ae){this.data.characterReferenceType=ae.type}function Te(ae){const ve=this.sliceSerialize(ae),Fe=this.data.characterReferenceType;let Ze;Fe?(Ze=Pk(ve,Fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Lg(ve);const Vt=this.stack[this.stack.length-1];Vt.value+=Ze}function $e(ae){const ve=this.stack.pop();ve.position.end=pr(ae.end)}function He(ae){G.call(this,ae);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ae)}function Be(ae){G.call(this,ae);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ae)}function Ee(){return{type:"blockquote",children:[],position:void 0}}function P(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function X(){return{type:"inlineCode",value:"",position:void 0}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function je(){return{type:"emphasis",children:[],position:void 0}}function Me(){return{type:"heading",depth:0,children:[],position:void 0}}function ot(){return{type:"break",position:void 0}}function Ke(){return{type:"html",value:"",position:void 0}}function jt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function se(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Le(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[],position:void 0}}function bt(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[],position:void 0}}function ht(){return{type:"paragraph",children:[],position:void 0}}function Ht(){return{type:"strong",children:[],position:void 0}}function Bn(){return{type:"text",value:"",position:void 0}}function Qn(){return{type:"thematicBreak",position:void 0}}}function pr(e){return{line:e.line,column:e.column,offset:e.offset}}function Jk(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Jk(e,r):e4(e,r)}}function e4(e,i){let a;for(a in i)if(Wk.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 fv(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Co({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Co({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Co({start:i.start,end:i.end})+") is still open")}function t4(e){const i=this;i.parser=a;function a(r){return WR(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function n4(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 i4(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
204
+ `}]}function a4(e,i){const a=i.value?i.value+`
205
+ `:"",r={},o=i.lang?i.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(u.data={meta:i.meta}),e.patch(i,u),u=e.applyData(i,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(i,u),u}function r4(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function s4(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function l4(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),o=gl(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 g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const x={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,x),e.applyData(i,x)}function o4(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 c4(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function eN(e,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const o=e.all(i),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=r:o.push({type:"text",value:r}),o}function u4(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return eN(e,i);const o={src:gl(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(i,u),e.applyData(i,u)}function d4(e,i){const a={src:gl(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 f4(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 p4(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return eN(e,i);const o={href:gl(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"a",properties:o,children:e.all(i)};return e.patch(i,u),e.applyData(i,u)}function m4(e,i){const a={href:gl(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 h4(e,i,a){const r=e.all(i),o=a?g4(a):tN(i),u={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let h;b&&b.type==="element"&&b.tagName==="p"?h=b:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.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];(o||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
206
+ `}),b.type==="element"&&b.tagName==="p"&&!o?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(o||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
207
+ `});const x={type:"element",tagName:"li",properties:u,children:d};return e.patch(i,x),e.applyData(i,x)}function g4(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=tN(a[r])}return i}function tN(e){const i=e.spread;return i??e.children.length>1}function x4(e,i){const a={},r=e.all(i);let o=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++o<r.length;){const d=r[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(i,u),e.applyData(i,u)}function b4(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function y4(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function v4(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function w4(e,i){const a=e.all(i),r=a.shift(),o=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),o.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=Og(i.children[1]),g=Rk(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(i,u),e.applyData(i,u)}function k4(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 g=-1;const x=[];for(;++g<p;){const h=i.children[g],v={},y=d?d[g]:void 0;y&&(v.align=y);let k={type:"element",tagName:u,properties:v,children:[]};h&&(k.children=e.all(h),e.patch(h,k),k=e.applyData(h,k)),x.push(k)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(x,!0)};return e.patch(i,b),e.applyData(i,b)}function N4(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const pv=9,mv=32;function E4(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),o=0;const u=[];for(;r;)u.push(hv(i.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(i);return u.push(hv(i.slice(o),o>0,!1)),u.join("")}function hv(e,i,a){let r=0,o=e.length;if(i){let u=e.codePointAt(r);for(;u===pv||u===mv;)r++,u=e.codePointAt(r)}if(a){let u=e.codePointAt(o-1);for(;u===pv||u===mv;)o--,u=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function S4(e,i){const a={type:"text",value:E4(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function _4(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const T4={blockquote:n4,break:i4,code:a4,delete:r4,emphasis:s4,footnoteReference:l4,heading:o4,html:c4,imageReference:u4,image:d4,inlineCode:f4,linkReference:p4,link:m4,listItem:h4,list:x4,paragraph:b4,root:y4,strong:v4,table:w4,tableCell:N4,tableRow:k4,text:S4,thematicBreak:_4,toml:Nu,yaml:Nu,definition:Nu,footnoteDefinition:Nu};function Nu(){}const nN=-1,Id=0,Ao=1,cd=2,Ug=3,Bg=4,$g=5,Pg=6,iN=7,aN=8,{defineProperty:C4}=Object,rN=typeof self=="object"?self:globalThis,gv=(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 rN[e](i)},j4=(e,i)=>{const a=(o,u)=>(e.set(u,o),o),r=o=>{if(e.has(o))return e.get(o);const[u,d]=i[o];switch(u){case Id:case nN:return a(d,o);case Ao:{const p=a([],o);for(const g of d)p.push(r(g));return p}case cd:{const p=a({},o);for(const[g,x]of d){const b=r(g),h=r(x);b==="__proto__"?C4(p,b,{value:h,configurable:!0,enumerable:!0,writable:!0}):p[b]=h}return p}case Ug:return a(new Date(d),o);case Bg:{const{source:p,flags:g}=d;return a(new RegExp(p,g),o)}case $g:{const p=a(new Map,o);for(const[g,x]of d)p.set(r(g),r(x));return p}case Pg:{const p=a(new Set,o);for(const g of d)p.add(r(g));return p}case iN:{const{name:p,message:g}=d;return a(typeof rN[p]=="function"?gv(p,g):new Error(g),o)}case aN:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return a(new DataView(p),d)}case"-0":return-0}return a(gv(u,d),o)};return r},xv=e=>j4(new Map,e)(0),Kr="",{toString:A4}={},{keys:O4,is:M4}=Object,xo=e=>{const i=typeof e;if(i!=="object"||!e)return[Id,i];const a=A4.call(e).slice(8,-1);switch(a){case"Array":return[Ao,Kr];case"Object":return[cd,Kr];case"Date":return[Ug,Kr];case"RegExp":return[Bg,Kr];case"Map":return[$g,Kr];case"Set":return[Pg,Kr];case"DataView":return[Ao,a]}return a.includes("Array")?[Ao,a]:e instanceof Error?[iN,e.name||"Error"]:[cd,a]},Eu=([e,i])=>e===Id&&(i==="function"||i==="symbol"),R4=(e,i,a,r)=>{const o=(d,p)=>{const g=r.push(d)-1;return a.set(p,g),g},u=d=>{if(a.has(d))return a.get(d);let[p,g]=xo(d);switch(p){case Id:{let b=d;switch(g){case"bigint":p=aN,b=d.toString();break;case"number":if(!d&&M4(d,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return o([nN],d)}return o([p,b],d)}case Ao:{if(g){let v=d;return g==="DataView"?v=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(v=new Uint8Array(d)),o([g,[...v]],d)}const b=[],h=o([p,b],d);for(const v of d)b.push(u(v));return h}case cd:{if(g)switch(g){case"BigInt":return o([g,d.toString()],d);case"Boolean":case"Number":case"String":return o([g,d.valueOf()],d)}if(i&&"toJSON"in d)return u(d.toJSON());const b=[],h=o([p,b],d);for(const v of O4(d))(e||!Eu(xo(d[v])))&&b.push([u(v),u(d[v])]);return h}case Ug:return o([p,isNaN(d.getTime())?Kr:d.toISOString()],d);case Bg:{const{source:b,flags:h}=d;return o([p,{source:b,flags:h}],d)}case $g:{const b=[],h=o([p,b],d);for(const[v,y]of d)(e||!(Eu(xo(v))||Eu(xo(y))))&&b.push([u(v),u(y)]);return h}case Pg:{const b=[],h=o([p,b],d);for(const v of d)(e||!Eu(xo(v)))&&b.push(u(v));return h}}const{message:x}=d;return o([p,{name:g,message:x}],d)};return u},bv=(e,{json:i,lossy:a}={})=>{const r=[];return R4(!(i||a),!!i,new Map,r)(e),r},ud=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?xv(bv(e,i)):structuredClone(e):(e,i)=>xv(bv(e,i));function D4(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 z4(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function L4(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||D4,r=e.options.footnoteBackLabel||z4,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const x=e.footnoteById.get(e.footnoteOrder[g]);if(!x)continue;const b=e.all(x),h=String(x.identifier).toUpperCase(),v=gl(h.toLowerCase());let y=0;const k=[],S=e.footnoteCounts.get(h);for(;S!==void 0&&++y<=S;){k.length>0&&k.push({type:"text",value:" "});let A=typeof a=="string"?a:a(g,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(g,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 _={type:"element",tagName:"li",properties:{id:i+"fn-"+v},children:e.wrap(b,!0)};e.patch(x,_),p.push(_)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...ud(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
208
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
209
+ `}]}}const Yo=(function(e){if(e==null)return $4;if(typeof e=="function")return Ud(e);if(typeof e=="object")return Array.isArray(e)?I4(e):U4(e);if(typeof e=="string")return B4(e);throw new Error("Expected function, string, or object as test")});function I4(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=Yo(e[a]);return Ud(r);function r(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function U4(e){const i=e;return Ud(a);function a(r){const o=r;let u;for(u in e)if(o[u]!==i[u])return!1;return!0}}function B4(e){return Ud(i);function i(a){return a&&a.type===e}}function Ud(e){return i;function i(a,r,o){return!!(P4(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function $4(){return!0}function P4(e){return e!==null&&typeof e=="object"&&"type"in e}const sN=[],H4=!0,Hh=!1,F4="skip";function lN(e,i,a,r){let o;typeof i=="function"&&typeof a!="function"?(r=a,a=i):o=i;const u=Yo(o),d=r?-1:1;p(e,void 0,[])();function p(g,x,b){const h=g&&typeof g=="object"?g:{};if(typeof h.type=="string"){const y=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(g.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=sN,k,S,j;if((!i||u(g,x,b[b.length-1]||void 0))&&(y=q4(a(g,b)),y[0]===Hh))return y;if("children"in g&&g.children){const _=g;if(_.children&&y[0]!==F4)for(S=(r?_.children.length:-1)+d,j=b.concat(_);S>-1&&S<_.children.length;){const A=_.children[S];if(k=p(A,S,j)(),k[0]===Hh)return k;S=typeof k[1]=="number"?k[1]:S+d}}return y}}}function q4(e){return Array.isArray(e)?e:typeof e=="number"?[H4,e]:e==null?sN:[e]}function Bd(e,i,a,r){let o,u,d;typeof i=="function"&&typeof a!="function"?(u=void 0,d=i,o=a):(u=i,d=a,o=r),lN(e,u,p,o);function p(g,x){const b=x[x.length-1],h=b?b.children.indexOf(g):void 0;return d(g,h,b)}}const Fh={}.hasOwnProperty,G4={};function Y4(e,i){const a=i||G4,r=new Map,o=new Map,u=new Map,d={...T4,...a.handlers},p={all:x,applyData:V4,definitionById:r,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:g,options:a,patch:K4,wrap:Z4};return Bd(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const h=b.type==="definition"?r:o,v=String(b.identifier).toUpperCase();h.has(v)||h.set(v,b)}}),p;function g(b,h){const v=b.type,y=p.handlers[v];if(Fh.call(p.handlers,v)&&y)return y(p,b,h);if(p.options.passThrough&&p.options.passThrough.includes(v)){if("children"in b){const{children:S,...j}=b,_=ud(j);return _.children=p.all(b),_}return ud(b)}return(p.options.unknownHandler||X4)(p,b,h)}function x(b){const h=[];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=yv(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=yv(S.value))}Array.isArray(k)?h.push(...k):h.push(k)}}}return h}}function K4(e,i){e.position&&(i.position=z5(e))}function V4(e,i){let a=i;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const d="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:d}}a.type==="element"&&u&&Object.assign(a.properties,ud(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function X4(e,i){const a=i.data||{},r="value"in i&&!(Fh.call(a,"hProperties")||Fh.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 Z4(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
210
+ `});++r<e.length;)r&&a.push({type:"text",value:`
211
+ `}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
212
+ `}),a}function yv(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function vv(e,i){const a=Y4(e,i),r=a.one(e,void 0),o=L4(a),u=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
213
+ `},o),u}function Q4(e,i){return e&&"run"in e?async function(a,r){const o=vv(a,{file:r,...i});await e.run(o,r)}:function(a,r){return vv(a,{file:r,...e||i})}}function wv(e){if(e)throw e}var $m,kv;function W4(){if(kv)return $m;kv=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(x){return typeof Array.isArray=="function"?Array.isArray(x):i.call(x)==="[object Array]"},u=function(x){if(!x||i.call(x)!=="[object Object]")return!1;var b=e.call(x,"constructor"),h=x.constructor&&x.constructor.prototype&&e.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!b&&!h)return!1;var v;for(v in x);return typeof v>"u"||e.call(x,v)},d=function(x,b){a&&b.name==="__proto__"?a(x,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):x[b.name]=b.newValue},p=function(x,b){if(b==="__proto__")if(e.call(x,b)){if(r)return r(x,b).value}else return;return x[b]};return $m=function g(){var x,b,h,v,y,k,S=arguments[0],j=1,_=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<_;++j)if(x=arguments[j],x!=null)for(b in x)h=p(S,b),v=p(x,b),S!==v&&(A&&v&&(u(v)||(y=o(v)))?(y?(y=!1,k=h&&o(h)?h:[]):k=h&&u(h)?h:{},d(S,{name:b,newValue:g(A,k,v)})):typeof v<"u"&&d(S,{name:b,newValue:v}));return S},$m}var J4=W4();const Pm=md(J4);function qh(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 eD(){const e=[],i={run:a,use:r};return i;function a(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...o);function p(g,...x){const b=e[++u];let h=-1;if(g){d(g);return}for(;++h<o.length;)(x[h]===null||x[h]===void 0)&&(x[h]=o[h]);o=x,b?tD(b,p)(...x):d(null,...x)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),i}}function tD(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(o);try{g=e.apply(this,d)}catch(x){const b=x;if(p&&a)throw b;return o(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(u,o):g instanceof Error?o(g):u(g))}function o(d,...p){a||(a=!0,i(d,...p))}function u(d){o(null,d)}}const ta={basename:nD,dirname:iD,extname:aD,join:rD,sep:"/"};function nD(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Ko(e);let a=0,r=-1,o=e.length,u;if(i===void 0||i.length===0||i.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else r<0&&(u=!0,r=o+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else d<0&&(u=!0,d=o+1),p>-1&&(e.codePointAt(o)===i.codePointAt(p--)?p<0&&(r=o):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function iD(e){if(Ko(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 aD(e){Ko(e);let i=e.length,a=-1,r=0,o=-1,u=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===46?o<0?o=i:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function rD(...e){let i=-1,a;for(;++i<e.length;)Ko(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":sD(a)}function sD(e){Ko(e);const i=e.codePointAt(0)===47;let a=lD(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function lD(e,i){let a="",r=0,o=-1,u=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",r=0):(a=a.slice(0,g),r=a.length-1-a.lastIndexOf("/")),o=d,u=0;continue}}else if(a.length>0){a="",r=0,o=d,u=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,d):a=e.slice(o+1,d),r=d-o-1;o=d,u=0}else p===46&&u>-1?u++:u=-1}return a}function Ko(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const oD={cwd:cD};function cD(){return"/"}function Gh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function uD(e){if(typeof e=="string")e=new URL(e);else if(!Gh(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 dD(e)}function dD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(i)}const Hm=["history","path","basename","stem","extname","dirname"];class oN{constructor(i){let a;i?Gh(i)?a={path:i}:typeof i=="string"||fD(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":oD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Hm.length;){const u=Hm[r];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Hm.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?ta.basename(this.path):void 0}set basename(i){qm(i,"basename"),Fm(i,"basename"),this.path=ta.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?ta.dirname(this.path):void 0}set dirname(i){Nv(this.basename,"dirname"),this.path=ta.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?ta.extname(this.path):void 0}set extname(i){if(Fm(i,"extname"),Nv(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=ta.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Gh(i)&&(i=uD(i)),qm(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?ta.basename(this.path,this.extname):void 0}set stem(i){qm(i,"stem"),Fm(i,"stem"),this.path=ta.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const o=this.message(i,a,r);throw o.fatal=!0,o}info(i,a,r){const o=this.message(i,a,r);return o.fatal=void 0,o}message(i,a,r){const o=new jn(i,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Fm(e,i){if(e&&e.includes(ta.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+ta.sep+"`")}function qm(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function Nv(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function fD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pD=(function(e){const r=this.constructor.prototype,o=r[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,r),u}),mD={}.hasOwnProperty;class Hg extends pD{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=eD()}copy(){const i=new Hg;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(Pm(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(Km("data",this.frozen),this.namespace[i]=a,this):mD.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Km("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(i,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=Su(i),r=this.parser||this.Parser;return Gm("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),Gm("process",this.parser||this.Parser),Ym("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,d){const p=Su(i),g=r.parse(p);r.run(g,p,function(b,h,v){if(b||!h||!v)return x(b);const y=h,k=r.stringify(y,v);xD(k)?v.value=k:v.result=k,x(b,v)});function x(b,h){b||!h?d(b):u?u(h):a(void 0,h)}}}processSync(i){let a=!1,r;return this.freeze(),Gm("processSync",this.parser||this.Parser),Ym("processSync",this.compiler||this.Compiler),this.process(i,o),Sv("processSync","process",a),r;function o(u,d){a=!0,wv(u),r=d}}run(i,a,r){Ev(i),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?u(void 0,r):new Promise(u);function u(d,p){const g=Su(a);o.run(i,g,x);function x(b,h,v){const y=h||i;b?p(b):d?d(y):r(void 0,y,v)}}}runSync(i,a){let r=!1,o;return this.run(i,a,u),Sv("runSync","run",r),o;function u(d,p){wv(d),o=p,r=!0}}stringify(i,a){this.freeze();const r=Su(a),o=this.compiler||this.Compiler;return Ym("stringify",o),Ev(i),o(i,r)}use(i,...a){const r=this.attachers,o=this.namespace;if(Km("use",this.frozen),i!=null)if(typeof i=="function")g(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(x){if(typeof x=="function")g(x,[]);else if(typeof x=="object")if(Array.isArray(x)){const[b,...h]=x;g(b,h)}else d(x);else throw new TypeError("Expected usable value, not `"+x+"`")}function d(x){if(!("plugins"in x)&&!("settings"in x))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(x.plugins),x.settings&&(o.settings=Pm(!0,o.settings,x.settings))}function p(x){let b=-1;if(x!=null)if(Array.isArray(x))for(;++b<x.length;){const h=x[b];u(h)}else throw new TypeError("Expected a list of plugins, not `"+x+"`")}function g(x,b){let h=-1,v=-1;for(;++h<r.length;)if(r[h][0]===x){v=h;break}if(v===-1)r.push([x,...b]);else if(b.length>0){let[y,...k]=b;const S=r[v][1];qh(S)&&qh(y)&&(y=Pm(!0,S,y)),r[v]=[x,y,...k]}}}}const hD=new Hg().freeze();function Gm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ym(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Km(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 Ev(e){if(!qh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sv(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Su(e){return gD(e)?e:new oN(e)}function gD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xD(e){return typeof e=="string"||bD(e)}function bD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_v=[],Tv={allowDangerousHtml:!0},vD=/^(https?|ircs?|mailto|xmpp)$/i,wD=[{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 kD(e){const i=ND(e),a=ED(e);return SD(i.runSync(i.parse(a),a),e)}function ND(e){const i=e.rehypePlugins||_v,a=e.remarkPlugins||_v,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tv}:Tv;return hD().use(t4).use(a).use(Q4,r).use(i)}function ED(e){const i=e.children||"",a=new oN;return typeof i=="string"&&(a.value=i),a}function SD(e,i){const a=i.allowedElements,r=i.allowElement,o=i.components,u=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||_D;for(const b of wD)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+yD+b.id,void 0);return Bd(e,x),$5(e,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function x(b,h,v){if(b.type==="raw"&&v&&typeof h=="number")return d?v.children.splice(h,1):v.children[h]={type:"text",value:b.value},h;if(b.type==="element"){let y;for(y in Im)if(Object.hasOwn(Im,y)&&Object.hasOwn(b.properties,y)){const k=b.properties[y],S=Im[y];(S===null||S.includes(b.tagName))&&(b.properties[y]=g(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 h=="number"&&(y=!r(b,h,v)),y&&v&&typeof h=="number")return p&&b.children?v.children.splice(h,1,...b.children):v.children.splice(h,1),h}}}function _D(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return i===-1||o!==-1&&i>o||a!==-1&&i>a||r!==-1&&i>r||vD.test(e.slice(0,i))?e:""}function Cv(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(i);for(;o!==-1;)r++,o=a.indexOf(i,o+i.length);return r}function TD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function CD(e,i,a){const o=Yo((a||{}).ignore||[]),u=jD(i);let d=-1;for(;++d<u.length;)lN(e,"text",p);function p(x,b){let h=-1,v;for(;++h<b.length;){const y=b[h],k=v?v.children:void 0;if(o(y,k?k.indexOf(y):void 0,v))return;v=y}if(v)return g(x,b)}function g(x,b){const h=b[b.length-1],v=u[d][0],y=u[d][1];let k=0;const j=h.children.indexOf(x);let _=!1,A=[];v.lastIndex=0;let C=v.exec(x.value);for(;C;){const B=C.index,D={index:C.index,input:C.input,stack:[...b,x]};let N=y(...C,D);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1)v.lastIndex=B+1;else{if(k!==B&&M({type:"text",value:x.value.slice(k,B)}),Array.isArray(N))for(const z of N)M(z);else N&&M(N);k=B+C[0].length,_=!0}if(!v.global)break;C=v.exec(x.value)}return _?(k<x.value.length&&M({type:"text",value:x.value.slice(k)}),h.children.splice(j,1,...A)):A=[x],j+A.length;function M(B){const D=A[A.length-1];D&&D.type==="text"&&B.type==="text"?D.value+=B.value:A.push(B)}}}function jD(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const o=a[r];i.push([AD(o[0]),OD(o[1])])}return i}function AD(e){return typeof e=="string"?new RegExp(TD(e),"g"):e}function OD(e){return typeof e=="function"?e:function(){return e}}const Vm="phrasing",Xm=["autolink","link","image","label"];function MD(){return{transforms:[BD],enter:{literalAutolink:DD,literalAutolinkEmail:Zm,literalAutolinkHttp:Zm,literalAutolinkWww:Zm},exit:{literalAutolink:UD,literalAutolinkEmail:ID,literalAutolinkHttp:zD,literalAutolinkWww:LD}}}function RD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vm,notInConstruct:Xm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vm,notInConstruct:Xm},{character:":",before:"[ps]",after:"\\/",inConstruct:Vm,notInConstruct:Xm}]}}function DD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Zm(e){this.config.enter.autolinkProtocol.call(this,e)}function zD(e){this.config.exit.autolinkProtocol.call(this,e)}function LD(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 ID(e){this.config.exit.autolinkEmail.call(this,e)}function UD(e){this.exit(e)}function BD(e){CD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$D],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,PD]],{ignore:["link","linkReference"]})}function $D(e,i,a,r,o){let u="";if(!cN(o)||(/^w/i.test(i)&&(a=i+a,i="",u="http://"),!HD(a)))return!1;const d=FD(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 PD(e,i,a,r){return!cN(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function HD(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 FD(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const o=Cv(e,"(");let u=Cv(e,")");for(;r!==-1&&o>u;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),u++;return[e,a]}function cN(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||es(a)||zd(a))&&(!i||a!==47)}uN.peek=WD;function qD(){this.buffer()}function GD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YD(){this.buffer()}function KD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function VD(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ui(this.sliceSerialize(e)).toLowerCase(),a.label=i}function XD(e){this.exit(e)}function ZD(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ui(this.sliceSerialize(e)).toLowerCase(),a.label=i}function QD(e){this.exit(e)}function WD(){return"["}function uN(e,i,a,r){const o=a.createTracker(r);let u=o.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),p(),d(),u+=o.move("]"),u}function JD(){return{enter:{gfmFootnoteCallString:qD,gfmFootnoteCall:GD,gfmFootnoteDefinitionLabelString:YD,gfmFootnoteDefinition:KD},exit:{gfmFootnoteCallString:VD,gfmFootnoteCall:XD,gfmFootnoteDefinitionLabelString:ZD,gfmFootnoteDefinition:QD}}}function ez(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:uN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,u,d){const p=u.createTracker(d);let g=p.move("[^");const x=u.enter("footnoteDefinition"),b=u.enter("label");return g+=p.move(u.safe(u.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
214
+ `:" ")+u.indentLines(u.containerFlow(r,p.current()),i?dN:tz))),x(),g}}function tz(e,i,a){return i===0?e:dN(e,i,a)}function dN(e,i,a){return(a?"":" ")+e}const nz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Fg.attention=lz;Fg.peek=oz;function iz(){return{canContainEols:["delete"],enter:{strikethrough:rz},exit:{strikethrough:sz}}}function az(){return{handlers:{delete:Fg},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nz}]}}function rz(e){this.enter({type:"delete",children:[],position:void 0},e)}function sz(e){this.exit(e)}function Fg(e,i,a,r){const o=a.createTracker(r),u=a.stack.includes("strikethrough")?"~":"~~",d=a.enter("strikethrough");let p=o.move(u);return p+=a.containerPhrasing(e,{...o.current(),before:p,after:"~"}),p+=o.move(u),d(),p}function lz(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function oz(){return"~"}function cz(e){return e.length}function uz(e,i){const a=i||{},r=(a.align||[]).concat(),o=a.stringLength||cz,u=[],d=[],p=[],g=[];let x=0,b=-1;for(;++b<e.length;){const S=[],j=[];let _=-1;for(e[b].length>x&&(x=e[b].length);++_<e[b].length;){const A=dz(e[b][_]);if(a.alignDelimiters!==!1){const C=o(A);j[_]=C,(g[_]===void 0||C>g[_])&&(g[_]=C)}S.push(A)}d[b]=S,p[b]=j}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<x;)u[h]=jv(r[h]);else{const S=jv(r);for(;++h<x;)u[h]=S}h=-1;const v=[],y=[];for(;++h<x;){const S=u[h];let j="",_="";S===99?(j=":",_=":"):S===108?j=":":S===114&&(_=":");let A=a.alignDelimiters===!1?1:Math.max(1,g[h]-j.length-_.length);const C=j+"-".repeat(A)+_;a.alignDelimiters!==!1&&(A=j.length+A+_.length,A>g[h]&&(g[h]=A),y[h]=A),v[h]=C}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];h=-1;const _=[];for(;++h<x;){const A=S[h]||"";let C="",M="";if(a.alignDelimiters!==!1){const B=g[h]-(j[h]||0),D=u[h];D===114?C=" ".repeat(B):D===99?B%2?(C=" ".repeat(B/2+.5),M=" ".repeat(B/2-.5)):(C=" ".repeat(B/2),M=C):M=" ".repeat(B)}a.delimiterStart!==!1&&!h&&_.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&A==="")&&(a.delimiterStart!==!1||h)&&_.push(" "),a.alignDelimiters!==!1&&_.push(C),_.push(A),a.alignDelimiters!==!1&&_.push(M),a.padding!==!1&&_.push(" "),(a.delimiterEnd!==!1||h!==x-1)&&_.push("|")}k.push(a.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return k.join(`
215
+ `)}function dz(e){return e==null?"":String(e)}function jv(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 fz=Yo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pz(e,i,a,r){const o=a.enter("blockquote"),u=a.createTracker(r);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),mz);return o(),d}function mz(e,i,a){return">"+(a?"":" ")+e}function hz(e,i){return Av(e,i.inConstruct,!0)&&!Av(e,i.notInConstruct,!1)}function Av(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 Ov(e,i,a,r){let o=-1;for(;++o<a.unsafe.length;){const u=a.unsafe[o];if(u.character===`
216
+ `&&!u.before&&!u.after&&hz(a.stack,u))return/[\t ]/.test(r.before)?"":" "}return`\\
217
+ `}function gz(e,i){const a=String(e);let r=a.indexOf(i),o=r,u=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++u>d&&(d=u):u=1,o=r+i.length,r=a.indexOf(i,o);return d}function xz(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 bz(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 yz(e,i,a,r){const o=bz(a),u=e.value||"";if(xz(e,a)){const h=a.enter("codeIndented"),v=a.indentLines(u,vz);return h(),v}const d=a.createTracker(r),p=o.repeat(Math.max(gz(u,o)+1,3)),g=a.enter("codeFenced"),x=o==="`"?"GraveAccent":"Tilde";let b=d.move(p);if(e.lang){const h=a.enter(`codeFencedLang${x}`);b+=d.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...d.current()})),h()}if(e.lang&&e.meta){const h=a.enter(`codeFencedMeta${x}`);b+=d.move(" "),b+=d.move(a.safe(e.meta,{before:b,after:`
218
+ `,encode:["`"],...d.current()})),h()}return b+=d.move(`
219
+ `),u&&(b+=d.move(u+`
220
+ `)),b+=d.move(p),g(),b}function vz(e,i,a){return(a?"":" ")+e}function qg(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 wz(e,i,a,r){const o=qg(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let x=g.move("[");return x+=g.move(a.safe(a.associationId(e),{before:x,after:"]",...g.current()})),x+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),x+=g.move("<"),x+=g.move(a.safe(e.url,{before:x,after:">",...g.current()})),x+=g.move(">")):(p=a.enter("destinationRaw"),x+=g.move(a.safe(e.url,{before:x,after:e.title?" ":`
221
+ `,...g.current()}))),p(),e.title&&(p=a.enter(`title${u}`),x+=g.move(" "+o),x+=g.move(a.safe(e.title,{before:x,after:o,...g.current()})),x+=g.move(o),p()),d(),x}function kz(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}Gg.attention=Nz;Gg.peek=Ez;function Gg(e,i,a,r){const o=a.enter("phrasing"),u=a.containerPhrasing({type:"root",children:[e]},r);return o(),u}function Nz(e,i){return{construct:"emphasis",markers:kz(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function Ez(e,i,a){return a.options.emphasis||"*"}function Sz(e){return"&#x"+e.toString(16).toUpperCase()+";"}function _z(e,i){let a=!1;return Bd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Hh}),!!((!e.depth||e.depth<3)&&zg(e)&&(i.options.setext||a))}function Tz(e,i,a,r){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(r);if(_z(e,a)){const h=a.enter("headingSetext"),v=a.enter("phrasing"),y=a.containerPhrasing(e,{...u.current(),before:`
222
+ `,after:`
223
+ `});return v(),h(),y+`
224
+ `+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
225
+ `))+1))}const d="#".repeat(o),p=a.enter("headingAtx"),g=a.enter("phrasing");u.move(d+" ");let x=a.containerPhrasing(e,{before:"# ",after:`
226
+ `,...u.current()});const b=x.charCodeAt(0);return(b===9||b===32)&&(x=Sz(b)+x.slice(1)),x=x?d+" "+x:d,a.options.closeAtx&&(x+=" "+d),g(),p(),x}fN.peek=Cz;function fN(e){return e.value||""}function Cz(){return"<"}pN.peek=jz;function pN(e,i,a,r){const o=qg(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let x=g.move("![");return x+=g.move(a.safe(e.alt,{before:x,after:"]",...g.current()})),x+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),x+=g.move("<"),x+=g.move(a.safe(e.url,{before:x,after:">",...g.current()})),x+=g.move(">")):(p=a.enter("destinationRaw"),x+=g.move(a.safe(e.url,{before:x,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${u}`),x+=g.move(" "+o),x+=g.move(a.safe(e.title,{before:x,after:o,...g.current()})),x+=g.move(o),p()),x+=g.move(")"),d(),x}function jz(){return"!"}mN.peek=Az;function mN(e,i,a,r){const o=e.referenceType,u=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const x=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(x+"]["),d();const b=a.stack;a.stack=b.filter(function(v){return v!=="phrasing"}),d=a.enter("reference");const h=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,u(),o==="full"||!x||x!==h?g+=p.move(h+"]"):o==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function Az(){return"!"}hN.peek=Oz;function hN(e,i,a){let r=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++u<a.unsafe.length;){const d=a.unsafe[u],p=a.compilePattern(d);if(!d.atBreak)continue;let g;for(;g=p.exec(r);){let x=g.index;r.charCodeAt(x)===10&&r.charCodeAt(x-1)===13&&x--,r=r.slice(0,x)+" "+r.slice(g.index+1)}}return o+r+o}function Oz(){return"`"}function gN(e,i){const a=zg(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))}xN.peek=Mz;function xN(e,i,a,r){const o=qg(a),u=o==='"'?"Quote":"Apostrophe",d=a.createTracker(r);if(gN(e,a)){const b=a.stack;a.stack=b.filter(function(y){return y!=="phrasing"});const h=a.enter("autolink");let v=d.move("<");return v+=d.move(a.containerPhrasing(e,{before:v,after:">",...d.current()})),v+=d.move(">"),h(),a.stack=b,v}const p=a.enter("link");let g=a.enter("label"),x=d.move("[");return x+=d.move(a.containerPhrasing(e,{before:x,after:"](",...d.current()})),x+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),x+=d.move("<"),x+=d.move(a.safe(e.url,{before:x,after:">",...d.current()})),x+=d.move(">")):(g=a.enter("destinationRaw"),x+=d.move(a.safe(e.url,{before:x,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${u}`),x+=d.move(" "+o),x+=d.move(a.safe(e.title,{before:x,after:o,...d.current()})),x+=d.move(o),g()),x+=d.move(")"),p(),x}function Mz(e,i,a){return gN(e,a)?"<":"["}bN.peek=Rz;function bN(e,i,a,r){const o=e.referenceType,u=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const x=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(x+"]["),d();const b=a.stack;a.stack=b.filter(function(v){return v!=="phrasing"}),d=a.enter("reference");const h=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,u(),o==="full"||!x||x!==h?g+=p.move(h+"]"):o==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function Rz(){return"["}function Yg(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 Dz(e){const i=Yg(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 zz(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 yN(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 Lz(e,i,a,r){const o=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?zz(a):Yg(a);const p=e.ordered?d==="."?")":".":Dz(a);let g=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&&(g=!0),yN(a)===d&&b){let h=-1;for(;++h<e.children.length;){const v=e.children[h];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const x=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=u,o(),x}function Iz(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 Uz(e,i,a,r){const o=Iz(a);let u=a.bulletCurrent||Yg(a);i&&i.type==="list"&&i.ordered&&(u=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(u+" ".repeat(d-u.length)),p.shift(d);const g=a.enter("listItem"),x=a.indentLines(a.containerFlow(e,p.current()),b);return g(),x;function b(h,v,y){return v?(y?"":" ".repeat(d))+h:(y?u:u+" ".repeat(d-u.length))+h}}function Bz(e,i,a,r){const o=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,r);return u(),o(),d}function $z(e,i,a,r){if(!e.children.some(function(p){return fz(p)}))return a.containerFlow(e,r);const u=a.enter("phrasing"),d=a.containerPhrasing(e,r);return u(),d}function Pz(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Kg.attention=Hz;Kg.peek=Fz;function Kg(e,i,a,r){const o=a.enter("phrasing"),u=a.containerPhrasing({type:"root",children:[e]},r);return o(),u}function Hz(e,i){return{construct:"strong",markers:Pz(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Fz(e,i,a){return a.options.strong||"*"}function qz(e,i,a,r){const o=i?i.children:[],u=o.indexOf(e);return a.safe(e.value,{...r,afterNode:o[u+1],beforeNode:o[u-1]})}function Gz(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 Yz(e,i,a){const r=(yN(a)+(a.options.ruleSpaces?" ":"")).repeat(Gz(a));return a.options.ruleSpaces?r.slice(0,-1):r}const vN={blockquote:pz,break:Ov,code:yz,definition:wz,emphasis:Gg,hardBreak:Ov,heading:Tz,html:fN,image:pN,imageReference:mN,inlineCode:hN,link:xN,linkReference:bN,list:Lz,listItem:Uz,paragraph:Bz,root:$z,strong:Kg,text:qz,thematicBreak:Yz};function Kz(){return{enter:{table:Vz,tableData:Mv,tableHeader:Mv,tableRow:Zz},exit:{codeText:Qz,table:Xz,tableData:Qm,tableHeader:Qm,tableRow:Qm}}}function Vz(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 Xz(e){this.exit(e),this.data.inTable=void 0}function Zz(e){this.enter({type:"tableRow",children:[]},e)}function Qm(e){this.exit(e)}function Mv(e){this.enter({type:"tableCell",children:[]},e)}function Qz(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,Wz));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function Wz(e,i){return i==="|"?i:e}function Jz(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,o=i.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
227
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:g,tableRow:p}};function d(y,k,S,j){return x(b(y,S,j),y.align)}function p(y,k,S,j){const _=h(y,S,j),A=x([_]);return A.slice(0,A.indexOf(`
228
+ `))}function g(y,k,S,j){const _=S.enter("tableCell"),A=S.enter("phrasing"),C=S.containerPhrasing(y,{...j,before:u,after:u});return A(),_(),C}function x(y,k){return uz(y,{align:k,alignDelimiters:r,padding:a,stringLength:o})}function b(y,k,S){const j=y.children;let _=-1;const A=[],C=k.enter("table");for(;++_<j.length;)A[_]=h(j[_],k,S);return C(),A}function h(y,k,S){const j=y.children;let _=-1;const A=[],C=k.enter("tableRow");for(;++_<j.length;)A[_]=g(j[_],y,k,S);return C(),A}function v(y,k,S){let j=vN.inlineCode(y,k,S);return S.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function e6(){return{exit:{taskListCheckValueChecked:Rv,taskListCheckValueUnchecked:Rv,paragraph:n6}}}function t6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:i6}}}function Rv(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function n6(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const o=i.children;let u=-1,d;for(;++u<o.length;){const p=o[u];if(p.type==="paragraph"){d=p;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function i6(e,i,a,r){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);u&&p.move(d);let g=vN.listItem(e,i,a,{...r,...p.current()});return u&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,x)),g;function x(b){return b+d}}function a6(){return[MD(),JD(),iz(),Kz(),e6()]}function r6(e){return{extensions:[RD(),ez(e),az(),Jz(e),t6()]}}const s6={tokenize:f6,partial:!0},wN={tokenize:p6,partial:!0},kN={tokenize:m6,partial:!0},NN={tokenize:h6,partial:!0},l6={tokenize:g6,partial:!0},EN={name:"wwwAutolink",tokenize:u6,previous:_N},SN={name:"protocolAutolink",tokenize:d6,previous:TN},Ma={name:"emailAutolink",tokenize:c6,previous:CN},ra={};function o6(){return{text:ra}}let Gr=48;for(;Gr<123;)ra[Gr]=Ma,Gr++,Gr===58?Gr=65:Gr===91&&(Gr=97);ra[43]=Ma;ra[45]=Ma;ra[46]=Ma;ra[95]=Ma;ra[72]=[Ma,SN];ra[104]=[Ma,SN];ra[87]=[Ma,EN];ra[119]=[Ma,EN];function c6(e,i,a){const r=this;let o,u;return d;function d(h){return!Yh(h)||!CN.call(r,r.previous)||Vg(r.events)?a(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(h))}function p(h){return Yh(h)?(e.consume(h),p):h===64?(e.consume(h),g):a(h)}function g(h){return h===46?e.check(l6,b,x)(h):h===45||h===95||Tn(h)?(u=!0,e.consume(h),g):b(h)}function x(h){return e.consume(h),o=!0,g}function b(h){return u&&o&&Ln(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(h)):a(h)}}function u6(e,i,a){const r=this;return o;function o(d){return d!==87&&d!==119||!_N.call(r,r.previous)||Vg(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(s6,e.attempt(wN,e.attempt(kN,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function d6(e,i,a){const r=this;let o="",u=!1;return d;function d(h){return(h===72||h===104)&&TN.call(r,r.previous)&&!Vg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(h),e.consume(h),p):a(h)}function p(h){if(Ln(h)&&o.length<5)return o+=String.fromCodePoint(h),e.consume(h),p;if(h===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(h),g}return a(h)}function g(h){return h===47?(e.consume(h),u?x:(u=!0,g)):a(h)}function x(h){return h===null||sd(h)||Lt(h)||es(h)||zd(h)?a(h):e.attempt(wN,e.attempt(kN,b),a)(h)}function b(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(h)}}function f6(e,i,a){let r=0;return o;function o(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),o):d===46&&r===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):i(d)}}function p6(e,i,a){let r,o,u;return d;function d(x){return x===46||x===95?e.check(NN,g,p)(x):x===null||Lt(x)||es(x)||x!==45&&zd(x)?g(x):(u=!0,e.consume(x),d)}function p(x){return x===95?r=!0:(o=r,r=void 0),e.consume(x),d}function g(x){return o||r||!u?a(x):i(x)}}function m6(e,i){let a=0,r=0;return o;function o(d){return d===40?(a++,e.consume(d),o):d===41&&r<a?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(NN,i,u)(d):d===null||Lt(d)||es(d)?i(d):(e.consume(d),o)}function u(d){return d===41&&r++,e.consume(d),o}}function h6(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),u):p===93?(e.consume(p),o):p===60||p===null||Lt(p)||es(p)?i(p):a(p)}function o(p){return p===null||p===40||p===91||Lt(p)||es(p)?i(p):r(p)}function u(p){return Ln(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):Ln(p)?(e.consume(p),d):a(p)}}function g6(e,i,a){return r;function r(u){return e.consume(u),o}function o(u){return Tn(u)?a(u):i(u)}}function _N(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Lt(e)}function TN(e){return!Ln(e)}function CN(e){return!(e===47||Yh(e))}function Yh(e){return e===43||e===45||e===46||e===95||Tn(e)}function Vg(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 x6={tokenize:S6,partial:!0};function b6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:k6,continuation:{tokenize:N6},exit:E6}},text:{91:{name:"gfmFootnoteCall",tokenize:w6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:y6,resolveTo:v6}}}}function y6(e,i,a){const r=this;let o=r.events.length;const u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;o--;){const g=r.events[o][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return a(g);const x=Ui(r.sliceSerialize({start:d.end,end:r.now()}));return x.codePointAt(0)!==94||!u.includes(x.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function v6(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",o,i],["exit",o,i],["enter",u,i],["enter",d,i],["exit",d,i],["exit",u,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function w6(e,i,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u=0,d;return p;function p(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),g}function g(h){return h!==94?a(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",x)}function x(h){if(u>999||h===93&&!d||h===null||h===91||Lt(h))return a(h);if(h===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(Ui(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(h)}return Lt(h)||(d=!0),u++,e.consume(h),h===92?b:x}function b(h){return h===91||h===92||h===93?(e.consume(h),u++,x):x(h)}}function k6(e,i,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u,d=0,p;return g;function g(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(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||Lt(k))return a(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return u=Ui(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Lt(k)||(p=!0),d++,e.consume(k),k===92?h:b}function h(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"),o.includes(u)||o.push(u),xt(e,y,"gfmFootnoteDefinitionWhitespace")):a(k)}function y(k){return i(k)}}function N6(e,i,a){return e.check(Go,i,e.attempt(x6,i,a))}function E6(e){e.exit("gfmFootnoteDefinition")}function S6(e,i,a){const r=this;return xt(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(u):a(u)}}function _6(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let x=g;for(;x--;)if(d[x][0]==="exit"&&d[x][1].type==="strikethroughSequenceTemporary"&&d[x][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[x][1].end.offset-d[x][1].start.offset){d[g][1].type="strikethroughSequence",d[x][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[x][1].start),end:Object.assign({},d[g][1].end)},h={type:"strikethroughText",start:Object.assign({},d[x][1].end),end:Object.assign({},d[g][1].start)},v=[["enter",b,p],["enter",d[x][1],p],["exit",d[x][1],p],["enter",h,p]],y=p.parser.constructs.insideSpan.null;y&&Ii(v,v.length,0,Ld(y,d.slice(x+1,g),p)),Ii(v,v.length,0,[["exit",h,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Ii(d,x-1,g-x+3,v),g=x+v.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function u(d,p,g){const x=this.previous,b=this.events;let h=0;return v;function v(k){return x===126&&b[b.length-1][1].type!=="characterEscape"?g(k):(d.enter("strikethroughSequenceTemporary"),y(k))}function y(k){const S=od(x);if(k===126)return h>1?g(k):(d.consume(k),h++,y);if(h<2&&!a)return g(k);const j=d.exit("strikethroughSequenceTemporary"),_=od(k);return j._open=!_||_===2&&!!S,j._close=!S||S===2&&!!_,p(k)}}}class T6{constructor(){this.map=[],this.index=new Map}add(i,a,r){C6(this,i,a,r)}consume(i){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let o=r.pop();for(;o;){for(const u of o)i.push(u);o=r.pop()}this.map.length=0,this.index.clear()}}function C6(e,i,a,r){if(a===0&&r.length===0)return;const o=e.index.get(i);if(o){o[1]+=a,o[2].push(...r);return}const u=[i,a,r];e.map.push(u),e.index.set(i,u)}function j6(e,i){let a=!1;const r=[];for(;i<e.length;){const o=e[i];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const u=r.length-1;r[u]=r[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function A6(){return{flow:{null:{name:"table",tokenize:O6,resolveAll:M6}}}}function O6(e,i,a){const r=this;let o=0,u=0,d;return p;function p(R){let G=r.events.length-1;for(;G>-1;){const{type:le}=r.events[G][1];if(le==="lineEnding"||le==="linePrefix")G--;else break}const Z=G>-1?r.events[G][1].type:null,fe=Z==="tableHead"||Z==="tableRow"?D:g;return fe===D&&r.parser.lazy[r.now().line]?a(R):fe(R)}function g(R){return e.enter("tableHead"),e.enter("tableRow"),x(R)}function x(R){return R===124||(d=!0,u+=1),b(R)}function b(R){return R===null?a(R):Ge(R)?u>1?(u=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),y):a(R):st(R)?xt(e,b,"whitespace")(R):(u+=1,d&&(d=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),h(R)))}function h(R){return R===null||R===124||Lt(R)?(e.exit("data"),b(R)):(e.consume(R),R===92?v:h)}function v(R){return R===92||R===124?(e.consume(R),h):h(R)}function y(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(R):(e.enter("tableDelimiterRow"),d=!1,st(R)?xt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):k(R))}function k(R){return R===45||R===58?j(R):R===124?(d=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),S):B(R)}function S(R){return st(R)?xt(e,j,"whitespace")(R):j(R)}function j(R){return R===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),_):R===45?(u+=1,_(R)):R===null||Ge(R)?M(R):B(R)}function _(R){return R===45?(e.enter("tableDelimiterFiller"),A(R)):B(R)}function A(R){return R===45?(e.consume(R),A):R===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(R))}function C(R){return st(R)?xt(e,M,"whitespace")(R):M(R)}function M(R){return R===124?k(R):R===null||Ge(R)?!d||o!==u?B(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(R)):B(R)}function B(R){return a(R)}function D(R){return e.enter("tableRow"),N(R)}function N(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),N):R===null||Ge(R)?(e.exit("tableRow"),i(R)):st(R)?xt(e,N,"whitespace")(R):(e.enter("data"),z(R))}function z(R){return R===null||R===124||Lt(R)?(e.exit("data"),N(R)):(e.consume(R),R===92?q:z)}function q(R){return R===92||R===124?(e.consume(R),z):z(R)}}function M6(e,i){let a=-1,r=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,x,b,h;const v=new T6;for(;++a<e.length;){const y=e[a],k=y[1];y[0]==="enter"?k.type==="tableHead"?(p=!1,g!==0&&(Dv(v,i,g,x,b),b=void 0,g=0),x={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(a,0,[["enter",x,i]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,h=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]])),o=k.type==="tableDelimiterRow"?2:b?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],h=_u(v,i,u,o,void 0,h),u=[0,0,0,0]),d[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(u[1]!==0&&(d[0]=d[1],h=_u(v,i,u,o,void 0,h)),u=d,d=[u[1],a,0,0])):k.type==="tableHead"?(p=!0,g=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(g=a,u[1]!==0?(d[0]=d[1],h=_u(v,i,u,o,a,h)):d[1]!==0&&(h=_u(v,i,d,o,a,h)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&Dv(v,i,g,x,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=j6(i.events,a))}return e}function _u(e,i,a,r,o,u){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(u.end=Object.assign({},Js(i.events,a[0])),e.add(a[0],0,[["exit",u,i]]));const g=Js(i.events,a[1]);if(u={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",u,i]]),a[2]!==0){const x=Js(i.events,a[2]),b=Js(i.events,a[3]),h={type:p,start:Object.assign({},x),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",h,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",h,i]])}return o!==void 0&&(u.end=Object.assign({},Js(i.events,o)),e.add(o,0,[["exit",u,i]]),u=void 0),u}function Dv(e,i,a,r,o){const u=[],d=Js(i.events,a);o&&(o.end=Object.assign({},d),u.push(["exit",o,i])),r.end=Object.assign({},d),u.push(["exit",r,i]),e.add(a+1,0,u)}function Js(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const R6={name:"tasklistCheck",tokenize:z6};function D6(){return{text:{91:R6}}}function z6(e,i,a){const r=this;return o;function o(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),u)}function u(g){return Lt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(g)}function p(g){return Ge(g)?i(g):st(g)?e.check({tokenize:L6},i,a)(g):a(g)}}function L6(e,i,a){return xt(e,r,"whitespace");function r(o){return o===null?a(o):i(o)}}function I6(e){return $k([o6(),b6(),_6(e),A6(),D6()])}const U6={};function B6(e){const i=this,a=e||U6,r=i.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),u=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(I6(a)),u.push(a6()),d.push(r6(a))}const zv=(function(e,i,a){const r=Yo(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]}),rs=(function(e){if(e==null)return H6;if(typeof e=="string")return P6(e);if(typeof e=="object")return $6(e);if(typeof e=="function")return Xg(e);throw new Error("Expected function, string, or array as `test`")});function $6(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=rs(e[a]);return Xg(r);function r(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function P6(e){return Xg(i);function i(a){return a.tagName===e}}function Xg(e){return i;function i(a,r,o){return!!(F6(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function H6(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function F6(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Lv=/\n/g,Iv=/[\t ]+/g,Kh=rs("br"),Uv=rs(Q6),q6=rs("p"),Bv=rs("tr"),G6=rs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Z6,W6]),jN=rs(["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 Y6(e,i){const a=i||{},r="children"in e?e.children:[],o=jN(e),u=MN(e,{whitespace:a.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...ON(e,{breakBefore:!0,breakAfter:!0}));let p=-1;for(;++p<r.length;)d.push(...AN(r[p],e,{whitespace:u,breakBefore:p?void 0:o,breakAfter:p<r.length-1?Kh(r[p+1]):o}));const g=[];let x;for(p=-1;++p<d.length;){const b=d[p];typeof b=="number"?x!==void 0&&b>x&&(x=b):b&&(x!==void 0&&x>-1&&g.push(`
229
+ `.repeat(x)||" "),x=-1,g.push(b))}return g.join("")}function AN(e,i,a){return e.type==="element"?K6(e,i,a):e.type==="text"?a.whitespace==="normal"?ON(e,a):V6(e):[]}function K6(e,i,a){const r=MN(e,a),o=e.children||[];let u=-1,d=[];if(G6(e))return d;let p,g;for(Kh(e)||Bv(e)&&zv(i,e,Bv)?g=`
230
+ `:q6(e)?(p=2,g=2):jN(e)&&(p=1,g=1);++u<o.length;)d=d.concat(AN(o[u],e,{whitespace:r,breakBefore:u?void 0:p,breakAfter:u<o.length-1?Kh(o[u+1]):g}));return Uv(e)&&zv(i,e,Uv)&&d.push(" "),p&&d.unshift(p),g&&d.push(g),d}function ON(e,i){const a=String(e.value),r=[],o=[];let u=0;for(;u<=a.length;){Lv.lastIndex=u;const g=Lv.exec(a),x=g&&"index"in g?g.index:a.length;r.push(X6(a.slice(u,x).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?i.breakBefore:!0,x===a.length?i.breakAfter:!0)),u=x+1}let d=-1,p;for(;++d<r.length;)r[d].charCodeAt(r[d].length-1)===8203||d<r.length-1&&r[d+1].charCodeAt(0)===8203?(o.push(r[d]),p=void 0):r[d]?(typeof p=="number"&&o.push(p),o.push(r[d]),p=0):(d===0||d===r.length-1)&&o.push(0);return o}function V6(e){return[String(e.value)]}function X6(e,i,a){const r=[];let o=0,u;for(;o<e.length;){Iv.lastIndex=o;const d=Iv.exec(e);u=d?d.index:e.length,!o&&!u&&d&&!i&&r.push(""),o!==u&&r.push(e.slice(o,u)),o=d?u+d[0].length:u}return o!==u&&!a&&r.push(""),r.join(" ")}function MN(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 Z6(e){return!!(e.properties||{}).hidden}function Q6(e){return e.tagName==="td"||e.tagName==="th"}function W6(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function J6(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+r+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",p={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},x={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},h={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(x,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:i.optional(o)+e.IDENT_RE,relevance:0},y=i.optional(o)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],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"],_=["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"],M={type:S,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:j},B={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:i.concat(/\b/,`(?!${k.join("|")})`,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},D=[B,h,p,a,e.C_BLOCK_COMMENT_MODE,b,x],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:D.concat([{begin:/\(/,end:/\)/,keywords:M,contains:D.concat(["self"]),relevance:0}]),relevance:0},z={className:"function",begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:M,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[x,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,x,b,p,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,x,b,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:M,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(N,z,B,D,[h,{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:M,contains:["self",p]},{begin:e.IDENT_RE+"::",keywords:M},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function eL(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=J6(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 tL(e){const i=e.regex,a={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},p={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]};o.contains.push(p);const g={match:/\\"/},x={className:"string",begin:/'/,end:/'/},b={match:/\\'/},h={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"],_={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],M=["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"],B=["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,...C,"set","shopt",...M,...B]},contains:[y,e.SHEBANG(),k,h,u,d,_,p,g,x,b,a]}}function nL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+r+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",p={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},x={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},h={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(x,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:i.optional(o)+e.IDENT_RE,relevance:0},y=i.optional(o)+e.IDENT_RE+"\\s*\\(",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"},_=[h,p,a,e.C_BLOCK_COMMENT_MODE,b,x],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={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,x,b,p,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,x,b,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:j,disableAutodetect:!0,illegal:"</",contains:[].concat(A,C,_,[h,{begin:e.IDENT_RE+"::",keywords:j},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:h,strings:x,keywords:j}}}function iL(e){const i=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+r+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",p={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},x={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},h={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(x,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:i.optional(o)+e.IDENT_RE,relevance:0},y=i.optional(o)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],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"],_=["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"],M={type:S,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:j},B={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:i.concat(/\b/,`(?!${k.join("|")})`,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},D=[B,h,p,a,e.C_BLOCK_COMMENT_MODE,b,x],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:D.concat([{begin:/\(/,end:/\)/,keywords:M,contains:D.concat(["self"]),relevance:0}]),relevance:0},z={className:"function",begin:"("+d+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:M,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[x,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,x,b,p,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,x,b,p]}]},p,a,e.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:M,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(N,z,B,D,[h,{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:M,contains:["self",p]},{begin:e.IDENT_RE+"::",keywords:M},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function aL(e){const i=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(u),built_in:i,literal:r},p=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),g={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},x={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},h=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,g,e.C_BLOCK_COMMENT_MODE],y.contains=[j,k,h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[x,S,k,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},p]},C=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",M={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"}},_,g,{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:"("+C+"\\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:[_,g,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},M]}}const rL=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_-]*/}}),sL=["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"],lL=["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"],oL=[...sL,...lL],cL=["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(),uL=["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(),dL=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fL=["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 pL(e){const i=e.regex,a=rL(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",u=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",p=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,r,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+uL.join("|")+")"},{begin:":(:)?("+dL.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+fL.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,a.UNICODE_RANGE,...p,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...p,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:i.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:cL.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...p,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+oL.join("|")+")\\b"}]}}function mL(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 hL(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 gL(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 xL(e){const i=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},p={begin:/\[/,end:/\]/,contains:[r,u,o,d,a,"self"],relevance:0},g=/[A-Za-z0-9_-]+/,x=/"(\\"|[^"])*"/,b=/'[^']*'/,h=i.either(g,x,b),v=i.concat(h,"(\\s*\\.\\s*",h,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[r,p,u,o,d,a]}}]}}var el="[0-9](_*[0-9])*",Tu=`\\.(${el})`,Cu="[0-9a-fA-F](_*[0-9a-fA-F])*",$v={className:"number",variants:[{begin:`(\\b(${el})((${Tu})|\\.)?|(${Tu}))[eE][+-]?(${el})[fFdD]?\\b`},{begin:`\\b(${el})((${Tu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Tu})[fFdD]?\\b`},{begin:`\\b(${el})[fFdD]\\b`},{begin:`\\b0[xX]((${Cu})\\.?|(${Cu})?\\.(${Cu}))[pP][+-]?(${el})[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 RN(e,i,a){return a===-1?"":e.replace(i,r=>RN(e,i,a-1))}function bL(e){const i=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=a+RN("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),g={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"]},x={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:g,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:g,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,$v,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},$v,x]}}const Pv="[A-Za-z$_][0-9A-Za-z$_]*",yL=["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"],vL=["true","false","null","undefined","NaN","Infinity"],DN=["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"],zN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],LN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wL=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kL=[].concat(LN,DN,zN);function NL(e){const i=e.regex,a=(ie,{after:ne})=>{const E="</"+ie[0].slice(1);return ie.input.indexOf(E,ne)!==-1},r=Pv,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ie,ne)=>{const E=ie[0].length+ie.index,pe=ie.input[E];if(pe==="<"||pe===","){ne.ignoreMatch();return}pe===">"&&(a(ie,{after:E})||ne.ignoreMatch());let _e;const L=ie.input.substring(E);if(_e=L.match(/^\s*=/)){ne.ignoreMatch();return}if((_e=L.match(/^\s+extends\s+/))&&_e.index===0){ne.ignoreMatch();return}}},p={$pattern:Pv,keyword:yL,literal:vL,built_in:kL,"variable.language":wL},g="[0-9](_?[0-9])*",x=`\\.(${g})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${b})((${x})|\\.)?|(${x}))[eE][+-]?(${g})\\b`},{begin:`\\b(${b})\\b((${x})\\b|\\.)?|(${x})\\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]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,{match:/\$\d+/},h];v.contains=C.concat({begin:/\{/,end:/\}/,keywords:p,contains:["self"].concat(C)});const M=[].concat(A,v.contains),B=M.concat([{begin:/(\s*)\(/,end:/\)/,keywords:p,contains:["self"].concat(M)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:B},N={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"}}]},z={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:{_:[...DN,...zN]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(ie){return i.concat("(?!",ie.join("|"),")")}const fe={match:i.concat(/\b/,Z([...LN,"super","import","await"].map(ie=>`${ie}\\s*\\(`)),r,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:i.concat(/\./,i.lookahead(i.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},J={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",re={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:z},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,A,{match:/\$\d+/},h,z,{scope:"attr",match:r+i.lookahead(":"),relevance:0},re,{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:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},fe,G,N,J,{match:/\$[(.]/}]}}const EL="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",SL={scope:"number",match:EL,relevance:0};function _L(e){const i={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[i,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,o,SL,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var tl="[0-9](_*[0-9])*",ju=`\\.(${tl})`,Au="[0-9a-fA-F](_*[0-9a-fA-F])*",TL={className:"number",variants:[{begin:`(\\b(${tl})((${ju})|\\.)?|(${ju}))[eE][+-]?(${tl})[fFdD]?\\b`},{begin:`\\b(${tl})((${ju})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ju})[fFdD]?\\b`},{begin:`\\b(${tl})[fFdD]\\b`},{begin:`\\b0[xX]((${Au})\\.?|(${Au})?\\.(${Au}))[pP][+-]?(${tl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Au})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function CL(e){const i={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,o]}]};o.contains.push(d);const p={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},g={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(d,{className:"string"}),"self"]}]},x=TL,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=h;return v.variants[1].contains=[h],h.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,g,{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:[h,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,p,g,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,g]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
231
+ `},x]}}const jL=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_-]*/}}),AL=["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"],ML=[...AL,...OL],RL=["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(),IN=["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(),UN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DL=["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(),zL=IN.concat(UN).sort().reverse();function LL(e){const i=jL(e),a=zL,r="and or not only",o="[\\w-]+",u="("+o+"|@\\{"+o+"\\})",d=[],p=[],g=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},x=function(C,M,B){return{className:C,begin:M,relevance:B}},b={$pattern:/[a-z-]+/,keyword:r,attribute:RL.join(" ")},h={begin:"\\(",end:"\\)",contains:p,keywords:b,relevance:0};p.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g("'"),g('"'),i.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},i.UNICODE_RANGE,i.HEXCOLOR,h,x("variable","@@?"+o,10),x("variable","@\\{"+o+"\\}"),x("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},i.IMPORTANT,{beginKeywords:"and not"},i.FUNCTION_DISPATCH);const v=p.concat({begin:/\{/,end:/\}/,contains:d}),y={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(p)},k={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+DL.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:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},_={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,x("keyword","all\\b"),x("variable","@\\{"+o+"\\}"),{begin:"\\b("+ML.join("|")+")\\b",className:"selector-tag"},i.CSS_NUMBER_MODE,x("selector-tag",u,0),x("selector-id","#"+u),x("selector-class","\\."+u,0),x("selector-tag","&",0),i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+IN.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+UN.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},i.FUNCTION_DISPATCH]},A={begin:o+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[_]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,j,A,k,_,y,i.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function IL(e){const i="\\[=*\\[",a="\\]=*\\]",r={begin:i,end:a,contains:["self"]},o=[e.COMMENT("--(?!"+i+")","$"),e.COMMENT("--"+i,a,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:i,end:a,contains:[r],relevance:5}])}}function UL(e){const i={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[i,a]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[i]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,i,a,r,o,u,d]}}function BL(e){const i=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},p=/[A-Za-z][A-Za-z0-9+.-]*/,g={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}]},x={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}]},h=e.inherit(x,{contains:[]}),v=e.inherit(b,{contains:[]});x.contains.push(v),b.contains.push(h);let y=[a,g];return[x,b,h,v].forEach(_=>{_.contains=_.contains.concat(y)}),y=y.concat(x,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,x,b,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},o,r,g,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function $L(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"]},g={$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:"("+g.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:g,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function PL(e){const i=e.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},p={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},g={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]},x={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,g],h=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(S,j,_="\\1")=>{const A=_==="\\1"?_:i.concat(_,j);return i.concat(i.concat("(?:",S,")"),j,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,_,r)},y=(S,j,_)=>i.concat(i.concat("(?:",S,")"),j,/(?:\\.|[^\\\/])*?/,_,r),k=[g,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}]},x,{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(...h,{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(...h,{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,x]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=k,d.contains=k,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:k}}function HL(e){const i=e.regex,a=/(?![A-Za-z0-9])(?![$])/,r=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),u=i.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+r},p={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},g={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},x=e.inherit(e.APOS_STRING_MODE,{illegal:null}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(g)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(g),"on:begin":(le,J)=>{J.data._beginMatch=le[1]||le[2]},"on:end":(le,J)=>{J.data._beginMatch!==le[1]&&J.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
232
+ ]`,k={scope:"string",variants:[b,x,h,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"],_=["__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"],M={keyword:_,literal:(le=>{const J=[];return le.forEach(O=>{J.push(O),O.toLowerCase()===O?J.push(O.toUpperCase()):J.push(O.toLowerCase())}),J})(j),built_in:A},B=le=>le.map(J=>J.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",B(A).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},N=i.concat(r,"\\b(?!\\()"),z={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,i.concat(/::/,i.lookahead(/(?!class\b)/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[o,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},q={scope:"attr",match:i.concat(r,i.lookahead(":"),i.lookahead(/(?!::)/))},R={relevance:0,begin:/\(/,end:/\)/,keywords:M,contains:[q,d,z,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,S,D]},G={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",B(_).join("\\b|"),"|",B(A).join("\\b|"),"\\b)"),r,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[R]};R.contains.push(G);const Z=[q,z,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,k,S,D],fe={begin:i.concat(/#\[\s*\\?/,i.either(o,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:o},{match:u}]}]};return{case_insensitive:!1,keywords:M,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,G,z,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},D,{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:M,contains:["self",fe,d,z,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 FL(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 qL(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function GL(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"]},g={className:"meta",begin:/^(>>>|\.\.\.) /},x={className:"subst",begin:/\{/,end:/\}/,keywords:p,illegal:/#/},b={begin:/\{\{/,relevance:0},h={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,g],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,g],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,g,b,x]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,g,b,x]},{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,x]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,x]},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}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:["self",g,S,h,e.HASH_COMMENT_MODE]}]};return x.contains=[h,S,g],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:p,illegal:/(<\/|\?)|=>/,contains:[g,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,j,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[_]},{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,_,h]}]}}function YL(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]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=i.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:i.lookahead(i.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[u,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function VL(e){const i=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=i.concat(r,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},p={className:"doctag",begin:"@[A-Za-z]+"},g={begin:"#<",end:">"},x=[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},h={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}]},D=[h,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{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(g,x),relevance:0}].concat(g,x);b.contains=D,S.contains=D;const R=[{begin:/^\s*=>/,starts:{end:"$",contains:D}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:D}}];return x.unshift(g),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(R).concat(x).concat(D)}}function XL(e){const i=e.regex,a=/(r#)?/,r=i.concat(a,e.UNDERSCORE_IDENT_RE),o=i.concat(a,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,i.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",p=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],g=["true","false","Some","None","Ok","Err"],x=["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:g,built_in:x},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:x,type:b}},{className:"punctuation",begin:"->"},u]}}const ZL=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_-]*/}}),QL=["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"],WL=["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"],JL=[...QL,...WL],e9=["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(),t9=["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(),n9=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),i9=["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 a9(e){const i=ZL(e),a=n9,r=t9,o="@[a-z-]+",u="and or not only",p={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+JL.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("+i9.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[i.BLOCK_COMMENT,p,i.HEXCOLOR,i.CSS_NUMBER_MODE,i.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i.IMPORTANT,i.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:e9.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},p,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i.HEXCOLOR,i.CSS_NUMBER_MODE]},i.FUNCTION_DISPATCH]}}function r9(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function s9(e){const i=e.regex,a=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],p=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],g=["add","asc","collation","desc","final","first","last","view"],x=["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"],h=["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=[...x,...g].filter(B=>!b.includes(B)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},j={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:i.concat(/\b/,i.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function A(B){return i.concat(/\b/,i.either(...B.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:A(v),relevance:0};function M(B,{exceptions:D,when:N}={}){const z=N;return D=D||[],B.map(q=>q.match(/\|\d+$/)||D.includes(q)?q:z(q)?`${q}|0`:q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:M(k,{when:B=>B.length<3}),literal:u,type:p,built_in:h},contains:[{scope:"type",match:A(d)},C,_,S,r,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,j]}}function BN(e){return e?typeof e=="string"?e:e.source:null}function bo(e){return Mt("(?=",e,")")}function Mt(...e){return e.map(a=>BN(a)).join("")}function l9(e){const i=e[e.length-1];return typeof i=="object"&&i.constructor===Object?(e.splice(e.length-1,1),i):{}}function zn(...e){return"("+(l9(e).capture?"":"?:")+e.map(r=>BN(r)).join("|")+")"}const Zg=e=>Mt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),o9=["Protocol","Type"].map(Zg),Hv=["init","self"].map(Zg),c9=["Any","Self"],Wm=["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"],Fv=["false","nil","true"],u9=["assignment","associativity","higherThan","left","lowerThan","none","right"],d9=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],qv=["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"],$N=zn(/[/=\-+!*%<>&|^~?]/,/[\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]/),PN=zn($N,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Jm=Mt($N,PN,"*"),HN=zn(/[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]/),dd=zn(HN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ea=Mt(HN,dd,"*"),Ou=Mt(/[A-Z]/,dd,"*"),f9=["attached","autoclosure",Mt(/convention\(/,zn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Mt(/objc\(/,ea,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],p9=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function m9(e){const i={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,a],o={match:[/\./,zn(...o9,...Hv)],className:{2:"keyword"}},u={match:Mt(/\./,zn(...Wm)),relevance:0},d=Wm.filter(Me=>typeof Me=="string").concat(["_|0"]),p=Wm.filter(Me=>typeof Me!="string").concat(c9).map(Zg),g={variants:[{className:"keyword",match:zn(...p,...Hv)}]},x={$pattern:zn(/\b\w+/,/#\w+/),keyword:d.concat(d9),literal:Fv},b=[o,u,g],h={match:Mt(/\./,zn(...qv)),relevance:0},v={className:"built_in",match:Mt(/\b/,zn(...qv),/(?=\()/)},y=[h,v],k={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:Jm},{match:`\\.(\\.|${PN})+`}]},j=[k,S],_="([0-9]_*)+",A="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},M=(Me="")=>({className:"subst",variants:[{match:Mt(/\\/,Me,/[0\\tnr"']/)},{match:Mt(/\\/,Me,/u\{[0-9a-fA-F]{1,8}\}/)}]}),B=(Me="")=>({className:"subst",match:Mt(/\\/,Me,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(Me="")=>({className:"subst",label:"interpol",begin:Mt(/\\/,Me,/\(/),end:/\)/}),N=(Me="")=>({begin:Mt(Me,/"""/),end:Mt(/"""/,Me),contains:[M(Me),B(Me),D(Me)]}),z=(Me="")=>({begin:Mt(Me,/"/),end:Mt(/"/,Me),contains:[M(Me),D(Me)]}),q={className:"string",variants:[N(),N("#"),N("##"),N("###"),z(),z("#"),z("##"),z("###")]},R=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],G={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:R},Z=Me=>{const ot=Mt(Me,/\//),Ke=Mt(/\//,Me);return{begin:ot,end:Ke,contains:[...R,{scope:"comment",begin:`#(?!.*${Ke})`,end:/$/}]}},fe={scope:"regexp",variants:[Z("###"),Z("##"),Z("#"),G]},le={match:Mt(/`/,ea,/`/)},J={className:"variable",match:/\$\d+/},O={className:"variable",match:`\\$${dd}+`},re=[le,J,O],ie={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:p9,contains:[...j,C,q]}]}},ne={scope:"keyword",match:Mt(/@/,zn(...f9),bo(zn(/\(/,/\s+/)))},E={scope:"meta",match:Mt(/@/,ea)},pe=[ie,ne,E],_e={match:bo(/\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)/,dd,"+")},{className:"type",match:Ou,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Mt(/\s+&\s+/,bo(Ou)),relevance:0}]},L={begin:/</,end:/>/,keywords:x,contains:[...r,...b,...pe,k,_e]};_e.contains.push(L);const $={match:Mt(ea,/\s*:/),keywords:"_|0",relevance:0},oe={begin:/\(/,end:/\)/,relevance:0,keywords:x,contains:["self",$,...r,fe,...b,...y,...j,C,q,...re,...pe,_e]},xe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,_e]},Te={begin:zn(bo(Mt(ea,/\s*:/)),bo(Mt(ea,/\s+/,ea,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ea}]},$e={begin:/\(/,end:/\)/,keywords:x,contains:[Te,...r,...b,...j,C,q,...pe,_e,oe],endsParent:!0,illegal:/["']/},He={match:[/(func|macro)/,/\s+/,zn(le.match,ea,Jm)],className:{1:"keyword",3:"title.function"},contains:[xe,$e,i],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,$e,i],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,Jm],className:{1:"keyword",3:"title"}},P={begin:[/precedencegroup/,/\s+/,Ou],className:{1:"keyword",3:"title"},contains:[_e],keywords:[...u9,...Fv],end:/}/},X={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ye={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ea,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:x,contains:[xe,...b,{begin:/:/,end:/\{/,keywords:x,contains:[{scope:"title.class.inherited",match:Ou},...b],relevance:0}]};for(const Me of q.variants){const ot=Me.contains.find(jt=>jt.label==="interpol");ot.keywords=x;const Ke=[...b,...y,...j,C,q,...re];ot.contains=[...Ke,{begin:/\(/,end:/\)/,contains:["self",...Ke]}]}return{name:"Swift",keywords:x,contains:[...r,He,Be,X,ye,je,Ee,P,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},fe,...b,...y,...j,C,q,...re,...pe,_e,oe]}}const fd="[A-Za-z$_][0-9A-Za-z$_]*",FN=["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"],qN=["true","false","null","undefined","NaN","Infinity"],GN=["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"],YN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],KN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],VN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],XN=[].concat(KN,GN,YN);function h9(e){const i=e.regex,a=(ie,{after:ne})=>{const E="</"+ie[0].slice(1);return ie.input.indexOf(E,ne)!==-1},r=fd,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ie,ne)=>{const E=ie[0].length+ie.index,pe=ie.input[E];if(pe==="<"||pe===","){ne.ignoreMatch();return}pe===">"&&(a(ie,{after:E})||ne.ignoreMatch());let _e;const L=ie.input.substring(E);if(_e=L.match(/^\s*=/)){ne.ignoreMatch();return}if((_e=L.match(/^\s+extends\s+/))&&_e.index===0){ne.ignoreMatch();return}}},p={$pattern:fd,keyword:FN,literal:qN,built_in:XN,"variable.language":VN},g="[0-9](_?[0-9])*",x=`\\.(${g})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${b})((${x})|\\.)?|(${x}))[eE][+-]?(${g})\\b`},{begin:`\\b(${b})\\b((${x})\\b|\\.)?|(${x})\\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]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,{match:/\$\d+/},h];v.contains=C.concat({begin:/\{/,end:/\}/,keywords:p,contains:["self"].concat(C)});const M=[].concat(A,v.contains),B=M.concat([{begin:/(\s*)\(/,end:/\)/,keywords:p,contains:["self"].concat(M)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:B},N={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"}}]},z={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:{_:[...GN,...YN]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(ie){return i.concat("(?!",ie.join("|"),")")}const fe={match:i.concat(/\b/,Z([...KN,"super","import","await"].map(ie=>`${ie}\\s*\\(`)),r,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:i.concat(/\./,i.lookahead(i.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},J={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",re={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:z},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,k,S,j,A,{match:/\$\d+/},h,z,{scope:"attr",match:r+i.lookahead(":"),relevance:0},re,{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:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},fe,G,N,J,{match:/\$[(.]/}]}}function g9(e){const i=e.regex,a=h9(e),r=fd,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[a.exports.CLASS_REFERENCE]},p={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},g=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],x={$pattern:fd,keyword:FN.concat(g),literal:qN,built_in:XN.concat(o),"variable.language":VN},b={className:"meta",begin:"@"+r},h=(S,j,_)=>{const A=S.contains.findIndex(C=>C.label===j);if(A===-1)throw new Error("can not find mode to replace");S.contains.splice(A,1,_)};Object.assign(a.keywords,x),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]),h(a,"shebang",e.SHEBANG()),h(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 x9(e){const i=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,p=/\d{1,2}(:\d{1,2}){1,2}/,g={className:"literal",variants:[{begin:i.concat(/# */,i.either(u,o),/ *#/)},{begin:i.concat(/# */,p,/ *#/)},{begin:i.concat(/# */,d,/ *#/)},{begin:i.concat(/# */,i.either(u,o),/ +/,i.either(d,p),/ *#/)}]},x={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+:/},h=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,g,x,b,h,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 b9(e){e.regex;const i=e.COMMENT(/\(;/,/;\)/);i.contains.push("self");const a=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},p={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},g={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},x={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[a,i,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,d,o,e.QUOTE_STRING_MODE,g,x,p]}}function y9(e){const i=e.regex,a=i.concat(/[\p{L}_]/u,i.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(u,{begin:/\(/,end:/\)/}),p=e.inherit(e.APOS_STRING_MODE,{className:"string"}),g=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),x={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,g,p,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,d,g,p]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[g]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[x],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[x],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:x}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function v9(e){const i="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},p=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},k={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},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],_=[...j];return _.pop(),_.push(p),y.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:j}}const w9={arduino:eL,bash:tL,c:nL,cpp:iL,csharp:aL,css:pL,diff:mL,go:hL,graphql:gL,ini:xL,java:bL,javascript:NL,json:_L,kotlin:CL,less:LL,lua:IL,makefile:UL,markdown:BL,objectivec:$L,perl:PL,php:HL,"php-template":FL,plaintext:qL,python:GL,"python-repl":YL,r:KL,ruby:VL,rust:XL,scss:a9,shell:r9,sql:s9,swift:m9,typescript:g9,vbnet:x9,wasm:b9,xml:y9,yaml:v9};var eh,Gv;function k9(){if(Gv)return eh;Gv=1;function e(H){return H instanceof Map?H.clear=H.delete=H.set=function(){throw new Error("map is read-only")}:H instanceof Set&&(H.add=H.clear=H.delete=function(){throw new Error("set is read-only")}),Object.freeze(H),Object.getOwnPropertyNames(H).forEach(de=>{const Se=H[de],Qe=typeof Se;(Qe==="object"||Qe==="function")&&!Object.isFrozen(Se)&&e(Se)}),H}class i{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(H){return H.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(H,...de){const Se=Object.create(null);for(const Qe in H)Se[Qe]=H[Qe];return de.forEach(function(Qe){for(const Rt in Qe)Se[Rt]=Qe[Rt]}),Se}const o="</span>",u=H=>!!H.scope,d=(H,{prefix:de})=>{if(H.startsWith("language:"))return H.replace("language:","language-");if(H.includes(".")){const Se=H.split(".");return[`${de}${Se.shift()}`,...Se.map((Qe,Rt)=>`${Qe}${"_".repeat(Rt+1)}`)].join(" ")}return`${de}${H}`};class p{constructor(de,Se){this.buffer="",this.classPrefix=Se.classPrefix,de.walk(this)}addText(de){this.buffer+=a(de)}openNode(de){if(!u(de))return;const Se=d(de.scope,{prefix:this.classPrefix});this.span(Se)}closeNode(de){u(de)&&(this.buffer+=o)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const g=(H={})=>{const de={children:[]};return Object.assign(de,H),de};class x{constructor(){this.rootNode=g(),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 Se=g({scope:de});this.add(Se),this.stack.push(Se)}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,Se){return typeof Se=="string"?de.addText(Se):Se.children&&(de.openNode(Se),Se.children.forEach(Qe=>this._walk(de,Qe)),de.closeNode(Se)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(Se=>typeof Se=="string")?de.children=[de.children.join("")]:de.children.forEach(Se=>{x._collapse(Se)}))}}class b extends x{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,Se){const Qe=de.root;Se&&(Qe.scope=`language:${Se}`),this.add(Qe)}toHTML(){return new p(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function h(H){return H?typeof H=="string"?H:H.source:null}function v(H){return S("(?=",H,")")}function y(H){return S("(?:",H,")*")}function k(H){return S("(?:",H,")?")}function S(...H){return H.map(Se=>h(Se)).join("")}function j(H){const de=H[H.length-1];return typeof de=="object"&&de.constructor===Object?(H.splice(H.length-1,1),de):{}}function _(...H){return"("+(j(H).capture?"":"?:")+H.map(Qe=>h(Qe)).join("|")+")"}function A(H){return new RegExp(H.toString()+"|").exec("").length-1}function C(H,de){const Se=H&&H.exec(de);return Se&&Se.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function B(H,{joinWith:de}){let Se=0;return H.map(Qe=>{Se+=1;const Rt=Se;let pt=h(Qe),Oe="";for(;pt.length>0;){const Ne=M.exec(pt);if(!Ne){Oe+=pt;break}Oe+=pt.substring(0,Ne.index),pt=pt.substring(Ne.index+Ne[0].length),Ne[0][0]==="\\"&&Ne[1]?Oe+="\\"+String(Number(Ne[1])+Rt):(Oe+=Ne[0],Ne[0]==="("&&Se++)}return Oe}).map(Qe=>`(${Qe})`).join(de)}const D=/\b\B/,N="[a-zA-Z]\\w*",z="[a-zA-Z_]\\w*",q="\\b\\d+(\\.\\d+)?",R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",G="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",fe=(H={})=>{const de=/^#![ ]*\//;return H.binary&&(H.begin=S(de,/.*\b/,H.binary,/\b.*/)),r({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(Se,Qe)=>{Se.index!==0&&Qe.ignoreMatch()}},H)},le={begin:"\\\\[\\s\\S]",relevance:0},J={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[le]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[le]},re={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/},ie=function(H,de,Se={}){const Qe=r({scope:"comment",begin:H,end:de,contains:[]},Se);Qe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Rt=_("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 Qe.contains.push({begin:S(/[ ]+/,"(",Rt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Qe},ne=ie("//","$"),E=ie("/\\*","\\*/"),pe=ie("#","$"),_e={scope:"number",begin:q,relevance:0},L={scope:"number",begin:R,relevance:0},$={scope:"number",begin:G,relevance:0},oe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[le,{begin:/\[/,end:/\]/,relevance:0,contains:[le]}]},xe={scope:"title",begin:N,relevance:0},Te={scope:"title",begin:z,relevance:0},$e={begin:"\\.\\s*"+z,relevance:0};var Be=Object.freeze({__proto__:null,APOS_STRING_MODE:J,BACKSLASH_ESCAPE:le,BINARY_NUMBER_MODE:$,BINARY_NUMBER_RE:G,COMMENT:ie,C_BLOCK_COMMENT_MODE:E,C_LINE_COMMENT_MODE:ne,C_NUMBER_MODE:L,C_NUMBER_RE:R,END_SAME_AS_BEGIN:function(H){return Object.assign(H,{"on:begin":(de,Se)=>{Se.data._beginMatch=de[1]},"on:end":(de,Se)=>{Se.data._beginMatch!==de[1]&&Se.ignoreMatch()}})},HASH_COMMENT_MODE:pe,IDENT_RE:N,MATCH_NOTHING_RE:D,METHOD_GUARD:$e,NUMBER_MODE:_e,NUMBER_RE:q,PHRASAL_WORDS_MODE:re,QUOTE_STRING_MODE:O,REGEXP_MODE:oe,RE_STARTERS_RE:Z,SHEBANG:fe,TITLE_MODE:xe,UNDERSCORE_IDENT_RE:z,UNDERSCORE_TITLE_MODE:Te});function Ee(H,de){H.input[H.index-1]==="."&&de.ignoreMatch()}function P(H,de){H.className!==void 0&&(H.scope=H.className,delete H.className)}function X(H,de){de&&H.beginKeywords&&(H.begin="\\b("+H.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",H.__beforeBegin=Ee,H.keywords=H.keywords||H.beginKeywords,delete H.beginKeywords,H.relevance===void 0&&(H.relevance=0))}function ye(H,de){Array.isArray(H.illegal)&&(H.illegal=_(...H.illegal))}function je(H,de){if(H.match){if(H.begin||H.end)throw new Error("begin & end are not supported with match");H.begin=H.match,delete H.match}}function Me(H,de){H.relevance===void 0&&(H.relevance=1)}const ot=(H,de)=>{if(!H.beforeMatch)return;if(H.starts)throw new Error("beforeMatch cannot be used with starts");const Se=Object.assign({},H);Object.keys(H).forEach(Qe=>{delete H[Qe]}),H.keywords=Se.keywords,H.begin=S(Se.beforeMatch,v(Se.begin)),H.starts={relevance:0,contains:[Object.assign(Se,{endsParent:!0})]},H.relevance=0,delete Se.beforeMatch},Ke=["of","and","for","in","not","or","if","then","parent","list","value"],jt="keyword";function se(H,de,Se=jt){const Qe=Object.create(null);return typeof H=="string"?Rt(Se,H.split(" ")):Array.isArray(H)?Rt(Se,H):Object.keys(H).forEach(function(pt){Object.assign(Qe,se(H[pt],de,pt))}),Qe;function Rt(pt,Oe){de&&(Oe=Oe.map(Ne=>Ne.toLowerCase())),Oe.forEach(function(Ne){const Ve=Ne.split("|");Qe[Ve[0]]=[pt,Le(Ve[0],Ve[1])]})}}function Le(H,de){return de?Number(de):bt(H)?0:1}function bt(H){return Ke.includes(H.toLowerCase())}const ht={},Ht=H=>{console.error(H)},Bn=(H,...de)=>{console.log(`WARN: ${H}`,...de)},Qn=(H,de)=>{ht[`${H}/${de}`]||(console.log(`Deprecated as of ${H}. ${de}`),ht[`${H}/${de}`]=!0)},ae=new Error;function ve(H,de,{key:Se}){let Qe=0;const Rt=H[Se],pt={},Oe={};for(let Ne=1;Ne<=de.length;Ne++)Oe[Ne+Qe]=Rt[Ne],pt[Ne+Qe]=!0,Qe+=A(de[Ne-1]);H[Se]=Oe,H[Se]._emit=pt,H[Se]._multi=!0}function Fe(H){if(Array.isArray(H.begin)){if(H.skip||H.excludeBegin||H.returnBegin)throw Ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ae;if(typeof H.beginScope!="object"||H.beginScope===null)throw Ht("beginScope must be object"),ae;ve(H,H.begin,{key:"beginScope"}),H.begin=B(H.begin,{joinWith:""})}}function Ze(H){if(Array.isArray(H.end)){if(H.skip||H.excludeEnd||H.returnEnd)throw Ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ae;if(typeof H.endScope!="object"||H.endScope===null)throw Ht("endScope must be object"),ae;ve(H,H.end,{key:"endScope"}),H.end=B(H.end,{joinWith:""})}}function Vt(H){H.scope&&typeof H.scope=="object"&&H.scope!==null&&(H.beginScope=H.scope,delete H.scope)}function Et(H){Vt(H),typeof H.beginScope=="string"&&(H.beginScope={_wrap:H.beginScope}),typeof H.endScope=="string"&&(H.endScope={_wrap:H.endScope}),Fe(H),Ze(H)}function ln(H){function de(Oe,Ne){return new RegExp(h(Oe),"m"+(H.case_insensitive?"i":"")+(H.unicodeRegex?"u":"")+(Ne?"g":""))}class Se{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ne,Ve){Ve.position=this.position++,this.matchIndexes[this.matchAt]=Ve,this.regexes.push([Ve,Ne]),this.matchAt+=A(Ne)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ne=this.regexes.map(Ve=>Ve[1]);this.matcherRe=de(B(Ne,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ne){this.matcherRe.lastIndex=this.lastIndex;const Ve=this.matcherRe.exec(Ne);if(!Ve)return null;const Zt=Ve.findIndex(($i,Da)=>Da>0&&$i!==void 0),Ft=this.matchIndexes[Zt];return Ve.splice(0,Zt),Object.assign(Ve,Ft)}}class Qe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ne){if(this.multiRegexes[Ne])return this.multiRegexes[Ne];const Ve=new Se;return this.rules.slice(Ne).forEach(([Zt,Ft])=>Ve.addRule(Zt,Ft)),Ve.compile(),this.multiRegexes[Ne]=Ve,Ve}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ne,Ve){this.rules.push([Ne,Ve]),Ve.type==="begin"&&this.count++}exec(Ne){const Ve=this.getMatcher(this.regexIndex);Ve.lastIndex=this.lastIndex;let Zt=Ve.exec(Ne);if(this.resumingScanAtSamePosition()&&!(Zt&&Zt.index===this.lastIndex)){const Ft=this.getMatcher(0);Ft.lastIndex=this.lastIndex+1,Zt=Ft.exec(Ne)}return Zt&&(this.regexIndex+=Zt.position+1,this.regexIndex===this.count&&this.considerAll()),Zt}}function Rt(Oe){const Ne=new Qe;return Oe.contains.forEach(Ve=>Ne.addRule(Ve.begin,{rule:Ve,type:"begin"})),Oe.terminatorEnd&&Ne.addRule(Oe.terminatorEnd,{type:"end"}),Oe.illegal&&Ne.addRule(Oe.illegal,{type:"illegal"}),Ne}function pt(Oe,Ne){const Ve=Oe;if(Oe.isCompiled)return Ve;[P,je,Et,ot].forEach(Ft=>Ft(Oe,Ne)),H.compilerExtensions.forEach(Ft=>Ft(Oe,Ne)),Oe.__beforeBegin=null,[X,ye,Me].forEach(Ft=>Ft(Oe,Ne)),Oe.isCompiled=!0;let Zt=null;return typeof Oe.keywords=="object"&&Oe.keywords.$pattern&&(Oe.keywords=Object.assign({},Oe.keywords),Zt=Oe.keywords.$pattern,delete Oe.keywords.$pattern),Zt=Zt||/\w+/,Oe.keywords&&(Oe.keywords=se(Oe.keywords,H.case_insensitive)),Ve.keywordPatternRe=de(Zt,!0),Ne&&(Oe.begin||(Oe.begin=/\B|\b/),Ve.beginRe=de(Ve.begin),!Oe.end&&!Oe.endsWithParent&&(Oe.end=/\B|\b/),Oe.end&&(Ve.endRe=de(Ve.end)),Ve.terminatorEnd=h(Ve.end)||"",Oe.endsWithParent&&Ne.terminatorEnd&&(Ve.terminatorEnd+=(Oe.end?"|":"")+Ne.terminatorEnd)),Oe.illegal&&(Ve.illegalRe=de(Oe.illegal)),Oe.contains||(Oe.contains=[]),Oe.contains=[].concat(...Oe.contains.map(function(Ft){return Ni(Ft==="self"?Oe:Ft)})),Oe.contains.forEach(function(Ft){pt(Ft,Ve)}),Oe.starts&&pt(Oe.starts,Ne),Ve.matcher=Rt(Ve),Ve}if(H.compilerExtensions||(H.compilerExtensions=[]),H.contains&&H.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return H.classNameAliases=r(H.classNameAliases||{}),pt(H)}function gn(H){return H?H.endsWithParent||gn(H.starts):!1}function Ni(H){return H.variants&&!H.cachedVariants&&(H.cachedVariants=H.variants.map(function(de){return r(H,{variants:null},de)})),H.cachedVariants?H.cachedVariants:gn(H)?r(H,{starts:H.starts?r(H.starts):null}):Object.isFrozen(H)?r(H):H}var Ei="11.11.2";class sa extends Error{constructor(de,Se){super(de),this.name="HTMLInjectionError",this.html=Se}}const Ra=a,Xt=r,un=Symbol("nomatch"),Si=7,An=function(H){const de=Object.create(null),Se=Object.create(null),Qe=[];let Rt=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",Oe={disableAutodetect:!0,name:"Plain text",contains:[]};let Ne={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Ve(he){return Ne.noHighlightRe.test(he)}function Zt(he){let Ie=he.className+" ";Ie+=he.parentNode?he.parentNode.className:"";const lt=Ne.languageDetectRe.exec(Ie);if(lt){const At=Ti(lt[1]);return At||(Bn(pt.replace("{}",lt[1])),Bn("Falling back to no-highlight mode for this block.",he)),At?lt[1]:"no-highlight"}return Ie.split(/\s+/).find(At=>Ve(At)||Ti(At))}function Ft(he,Ie,lt){let At="",Yt="";typeof Ie=="object"?(At=he,lt=Ie.ignoreIllegals,Yt=Ie.language):(Qn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qn("10.7.0",`Please use highlight(code, options) instead.
233
+ https://github.com/highlightjs/highlight.js/issues/2277`),Yt=he,At=Ie),lt===void 0&&(lt=!0);const Pn={code:At,language:Yt};$n("before:highlight",Pn);const Hn=Pn.result?Pn.result:$i(Pn.language,Pn.code,lt);return Hn.code=Pn.code,$n("after:highlight",Hn),Hn}function $i(he,Ie,lt,At){const Yt=Object.create(null);function Pn(Ce,Ue){return Ce.keywords[Ue]}function Hn(){if(!et.keywords){Wt.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=Pn(et,vt);if(St){const[Wn,nc]=St;if(Wt.addText(nt),nt="",Yt[vt]=(Yt[vt]||0)+1,Yt[vt]<=Si&&(fa+=nc),Wn.startsWith("_"))nt+=Ue[0];else{const vl=ui.classNameAliases[Wn]||Wn;fn(Ue[0],vl)}}else nt+=Ue[0];Ce=et.keywordPatternRe.lastIndex,Ue=et.keywordPatternRe.exec(yt)}nt+=yt.substring(Ce),Wt.addText(nt)}function oa(){if(yt==="")return;let Ce=null;if(typeof et.subLanguage=="string"){if(!de[et.subLanguage]){Wt.addText(yt);return}Ce=$i(et.subLanguage,yt,!0,mt[et.subLanguage]),mt[et.subLanguage]=Ce._top}else Ce=za(yt,et.subLanguage.length?et.subLanguage:null);et.relevance>0&&(fa+=Ce.relevance),Wt.__addSublanguage(Ce._emitter,Ce.language)}function dn(){et.subLanguage!=null?oa():Hn(),yt=""}function fn(Ce,Ue){Ce!==""&&(Wt.startScope(Ue),Wt.addText(Ce),Wt.endScope())}function ca(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],Wn=Ue[nt];St?fn(Wn,St):(yt=Wn,Hn(),yt=""),nt++}}function Ua(Ce,Ue){return Ce.scope&&typeof Ce.scope=="string"&&Wt.openNode(ui.classNameAliases[Ce.scope]||Ce.scope),Ce.beginScope&&(Ce.beginScope._wrap?(fn(yt,ui.classNameAliases[Ce.beginScope._wrap]||Ce.beginScope._wrap),yt=""):Ce.beginScope._multi&&(ca(Ce.beginScope,Ue),yt="")),et=Object.create(Ce,{parent:{value:et}}),et}function ua(Ce,Ue,nt){let vt=C(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 ua(Ce.parent,Ue,nt)}function Qt(Ce){return et.matcher.regexIndex===0?(yt+=Ce[0],1):(os=!0,0)}function Wo(Ce){const Ue=Ce[0],nt=Ce.rule,vt=new i(nt),St=[nt.__beforeBegin,nt["on:begin"]];for(const Wn of St)if(Wn&&(Wn(Ce,vt),vt.isMatchIgnored))return Qt(Ue);return nt.skip?yt+=Ue:(nt.excludeBegin&&(yt+=Ue),dn(),!nt.returnBegin&&!nt.excludeBegin&&(yt=Ue)),Ua(nt,Ce),nt.returnBegin?0:Ue.length}function Jo(Ce){const Ue=Ce[0],nt=Ie.substring(Ce.index),vt=ua(et,Ce,nt);if(!vt)return un;const St=et;et.endScope&&et.endScope._wrap?(dn(),fn(Ue,et.endScope._wrap)):et.endScope&&et.endScope._multi?(dn(),ca(et.endScope,Ce)):St.skip?yt+=Ue:(St.returnEnd||St.excludeEnd||(yt+=Ue),dn(),St.excludeEnd&&(yt=Ue));do et.scope&&Wt.closeNode(),!et.skip&&!et.subLanguage&&(fa+=et.relevance),et=et.parent;while(et!==vt.parent);return vt.starts&&Ua(vt.starts,Ce),St.returnEnd?0:Ue.length}function ec(){const Ce=[];for(let Ue=et;Ue!==ui;Ue=Ue.parent)Ue.scope&&Ce.unshift(Ue.scope);Ce.forEach(Ue=>Wt.openNode(Ue))}let ci={};function da(Ce,Ue){const nt=Ue&&Ue[0];if(yt+=Ce,nt==null)return dn(),0;if(ci.type==="begin"&&Ue.type==="end"&&ci.index===Ue.index&&nt===""){if(yt+=Ie.slice(Ue.index,Ue.index+1),!Rt){const vt=new Error(`0 width match regex (${he})`);throw vt.languageName=he,vt.badRule=ci.rule,vt}return 1}if(ci=Ue,Ue.type==="begin")return Wo(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=Jo(Ue);if(vt!==un)return vt}if(Ue.type==="illegal"&&nt==="")return Ue.index===Ie.length||(yt+=`
234
+ `),1;if(bn>1e5&&bn>Ue.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=nt,nt.length}const ui=Ti(he);if(!ui)throw Ht(pt.replace("{}",he)),new Error('Unknown language: "'+he+'"');const tc=ln(ui);let ls="",et=At||tc;const mt={},Wt=new Ne.__emitter(Ne);ec();let yt="",fa=0,xn=0,bn=0,os=!1;try{if(ui.__emitTokens)ui.__emitTokens(Ie,Wt);else{for(et.matcher.considerAll();;){bn++,os?os=!1:et.matcher.considerAll(),et.matcher.lastIndex=xn;const Ce=et.matcher.exec(Ie);if(!Ce)break;const Ue=Ie.substring(xn,Ce.index),nt=da(Ue,Ce);xn=Ce.index+nt}da(Ie.substring(xn))}return Wt.finalize(),ls=Wt.toHTML(),{language:he,value:ls,relevance:fa,illegal:!1,_emitter:Wt,_top:et}}catch(Ce){if(Ce.message&&Ce.message.includes("Illegal"))return{language:he,value:Ra(Ie),illegal:!0,relevance:0,_illegalBy:{message:Ce.message,index:xn,context:Ie.slice(xn-100,xn+100),mode:Ce.mode,resultSoFar:ls},_emitter:Wt};if(Rt)return{language:he,value:Ra(Ie),illegal:!1,relevance:0,errorRaised:Ce,_emitter:Wt,_top:et};throw Ce}}function Da(he){const Ie={value:Ra(he),illegal:!1,relevance:0,_top:Oe,_emitter:new Ne.__emitter(Ne)};return Ie._emitter.addText(he),Ie}function za(he,Ie){Ie=Ie||Ne.languages||Object.keys(de);const lt=Da(he),At=Ie.filter(Ti).filter(ss).map(dn=>$i(dn,he,!1));At.unshift(lt);const Yt=At.sort((dn,fn)=>{if(dn.relevance!==fn.relevance)return fn.relevance-dn.relevance;if(dn.language&&fn.language){if(Ti(dn.language).supersetOf===fn.language)return 1;if(Ti(fn.language).supersetOf===dn.language)return-1}return 0}),[Pn,Hn]=Yt,oa=Pn;return oa.secondBest=Hn,oa}function la(he,Ie,lt){const At=Ie&&Se[Ie]||lt;he.classList.add("hljs"),he.classList.add(`language-${At}`)}function La(he){let Ie=null;const lt=Zt(he);if(Ve(lt))return;if($n("before:highlightElement",{el:he,language:lt}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(Ne.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(he)),Ne.throwUnescapedHTML))throw new sa("One of your code blocks includes unescaped HTML.",he.innerHTML);Ie=he;const At=Ie.textContent,Yt=lt?Ft(At,{language:lt,ignoreIllegals:!0}):za(At);he.innerHTML=Yt.value,he.dataset.highlighted="yes",la(he,lt,Yt.language),he.result={language:Yt.language,re:Yt.relevance,relevance:Yt.relevance},Yt.secondBest&&(he.secondBest={language:Yt.secondBest.language,relevance:Yt.secondBest.relevance}),$n("after:highlightElement",{el:he,result:Yt,text:At})}function kr(he){Ne=Xt(Ne,he)}const Vo=()=>{Ia(),Qn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Pd(){Ia(),Qn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let xl=!1;function Ia(){function he(){Ia()}if(document.readyState==="loading"){xl||window.addEventListener("DOMContentLoaded",he,!1),xl=!0;return}document.querySelectorAll(Ne.cssSelector).forEach(La)}function Nr(he,Ie){let lt=null;try{lt=Ie(H)}catch(At){if(Ht("Language definition for '{}' could not be registered.".replace("{}",he)),Rt)Ht(At);else throw At;lt=Oe}lt.name||(lt.name=he),de[he]=lt,lt.rawDefinition=Ie.bind(null,H),lt.aliases&&bl(lt.aliases,{languageName:he})}function Hd(he){delete de[he];for(const Ie of Object.keys(Se))Se[Ie]===he&&delete Se[Ie]}function Xo(){return Object.keys(de)}function Ti(he){return he=(he||"").toLowerCase(),de[he]||de[Se[he]]}function bl(he,{languageName:Ie}){typeof he=="string"&&(he=[he]),he.forEach(lt=>{Se[lt.toLowerCase()]=Ie})}function ss(he){const Ie=Ti(he);return Ie&&!Ie.disableAutodetect}function yl(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=Ie=>{he["before:highlightBlock"](Object.assign({block:Ie.el},Ie))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=Ie=>{he["after:highlightBlock"](Object.assign({block:Ie.el},Ie))})}function Zo(he){yl(he),Qe.push(he)}function Qo(he){const Ie=Qe.indexOf(he);Ie!==-1&&Qe.splice(Ie,1)}function $n(he,Ie){const lt=he;Qe.forEach(function(At){At[lt]&&At[lt](Ie)})}function on(he){return Qn("10.7.0","highlightBlock will be removed entirely in v12.0"),Qn("10.7.0","Please use highlightElement now."),La(he)}Object.assign(H,{highlight:Ft,highlightAuto:za,highlightAll:Ia,highlightElement:La,highlightBlock:on,configure:kr,initHighlighting:Vo,initHighlightingOnLoad:Pd,registerLanguage:Nr,unregisterLanguage:Hd,listLanguages:Xo,getLanguage:Ti,registerAliases:bl,autoDetection:ss,inherit:Xt,addPlugin:Zo,removePlugin:Qo}),H.debugMode=function(){Rt=!1},H.safeMode=function(){Rt=!0},H.versionString=Ei,H.regex={concat:S,lookahead:v,either:_,optional:k,anyNumberOfTimes:y};for(const he in Be)typeof Be[he]=="object"&&e(Be[he]);return Object.assign(H,Be),H},_i=An({});return _i.newInstance=()=>An({}),eh=_i,_i.HighlightJS=_i,_i.default=_i,eh}var N9=k9();const E9=md(N9),Yv={},S9="hljs-";function _9(e){const i=E9.newInstance();return e&&u(e),{highlight:a,highlightAuto:r,listLanguages:o,register:u,registerAlias:d,registered:p};function a(g,x,b){const h=b||Yv,v=typeof h.prefix=="string"?h.prefix:S9;if(!i.getLanguage(g))throw new Error("Unknown language: `"+g+"` is not registered");i.configure({__emitter:T9,classPrefix:v});const y=i.highlight(x,{ignoreIllegals:!0,language:g});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(g,x){const h=(x||Yv).subset||o();let v=-1,y=0,k;for(;++v<h.length;){const S=h[v];if(!i.getLanguage(S))continue;const j=a(S,g,x);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 o(){return i.listLanguages()}function u(g,x){if(typeof g=="string")i.registerLanguage(g,x);else{let b;for(b in g)Object.hasOwn(g,b)&&i.registerLanguage(b,g[b])}}function d(g,x){if(typeof g=="string")i.registerAliases(typeof x=="string"?x:[...x],{languageName:g});else{let b;for(b in g)if(Object.hasOwn(g,b)){const h=g[b];i.registerAliases(typeof h=="string"?h:[...h],{languageName:b})}}}function p(g){return!!i.getLanguage(g)}}class T9{constructor(i){this.options=i,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(i){if(i==="")return;const a=this.stack[this.stack.length-1],r=a.children[a.children.length-1];r&&r.type==="text"?r.value+=i:a.children.push({type:"text",value:i})}startScope(i){this.openNode(String(i))}endScope(){this.closeNode()}__addSublanguage(i,a){const r=this.stack[this.stack.length-1],o=i.root.children;a?r.children.push({type:"element",tagName:"span",properties:{className:[a]},children:o}):r.children.push(...o)}openNode(i){const a=this,r=i.split(".").map(function(d,p){return p?d+"_".repeat(p):a.options.classPrefix+d}),o=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const C9={};function j9(e){const i=e||C9,a=i.aliases,r=i.detect||!1,o=i.languages||w9,u=i.plainText,d=i.prefix,p=i.subset;let g="hljs";const x=_9(o);if(a&&x.registerAlias(a),d){const b=d.indexOf("-");g=b===-1?d:d.slice(0,b)}return function(b,h){Bd(b,"element",function(v,y,k){if(v.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const S=A9(v);if(S===!1||!S&&!r||S&&u&&u.includes(S))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(g)||v.properties.className.unshift(g);const j=Y6(v,{whitespace:"pre"});let _;try{_=S?x.highlight(S,j,{prefix:d}):x.highlightAuto(j,{prefix:d,subset:p})}catch(A){const C=A;if(S&&/Unknown language/.test(C.message)){h.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[k,v],cause:C,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw C}!S&&_.data&&_.data.language&&v.properties.className.push("language-"+_.data.language),_.children.length>0&&(v.children=_.children)})}}function A9(e){const i=e.properties.className;let a=-1;if(!Array.isArray(i))return;let r;for(;++a<i.length;){const o=String(i[a]);if(o==="no-highlight"||o==="nohighlight")return!1;!r&&o.slice(0,5)==="lang-"&&(r=o.slice(5)),!r&&o.slice(0,9)==="language-"&&(r=o.slice(9))}return r}function O9(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 Vh(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Vh).join(""):I.isValidElement(e)?Vh(e.props.children):""}function M9(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 R9(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 ZN({html:e,reloadKey:i,className:a}){const r=I.useRef(null);return I.useEffect(()=>{const o=r.current;if(!o)return;const u=d=>{d.source===o.contentWindow&&d.data?.type==="maxcode-preview-ready"&&o.contentWindow?.postMessage({type:"maxcode-preview",html:e},"*")};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[e,i]),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:te("block h-full w-full border-0 bg-white",a)},i)}function D9({html:e,onClose:i}){const[a,r]=I.useState(0);return I.useEffect(()=>{const o=u=>{u.key==="Escape"&&i()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[i]),ml.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(o=>o+1),title:"Restart","aria-label":"Restart preview",children:l.jsx(Nw,{size:16})}),l.jsx("button",{type:"button",className:"icon-button",onClick:i,title:"Close (Esc)","aria-label":"Close preview",children:l.jsx(Bi,{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(ZN,{html:e,reloadKey:a})})]}),document.body)}function z9({children:e,streaming:i}){const[a,r]=I.useState(!1),[o,u]=I.useState("code"),[d,p]=I.useState(0),[g,x]=I.useState(!1),b=O9(e)||"text",h=I.useMemo(()=>Vh(e),[e]),v=!i&&M9(b,h),y=I.useMemo(()=>v?R9(b,h):"",[v,b,h]),k=v&&o==="preview",S=async()=>{try{await navigator.clipboard.writeText(h),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":o===j,onClick:()=>u(j),className:te("h-6 rounded-md px-2.5 text-[11.5px] font-medium capitalize transition-colors",o===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(Nw,{size:13})}),l.jsx("button",{type:"button",onClick:()=>x(!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(jT,{size:13})})]}),v&&l.jsx("button",{type:"button",onClick:()=>Mh(b==="svg"?"image.svg":"index.html",b==="svg"?h: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(ng,{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(sn,{size:13}):l.jsx(xd,{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(ZN,{html:y,reloadKey:d})}):l.jsx("pre",{className:"code-pre thin-scroll",children:e}),g&&l.jsx(D9,{html:y,onClose:()=>x(!1)})]})}function L9({content:e,streaming:i}){return l.jsx("div",{className:te("md",i&&"is-streaming"),children:l.jsx(kD,{remarkPlugins:[B6],rehypePlugins:[[j9,{detect:!0,ignoreMissing:!0}]],components:{pre:({children:a})=>l.jsx(z9,{streaming:i,children:a}),a:({children:a,href:r})=>l.jsx("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:a})},children:e})})}const Qg=I.memo(L9);function QN(e,i){const a=e===""?[]:e.split(`
235
+ `),r=i===""?[]:i.split(`
236
+ `);let o=0;for(;o<a.length&&o<r.length&&a[o]===r[o];)o+=1;let u=a.length,d=r.length;for(;u>o&&d>o&&a[u-1]===r[d-1];)u-=1,d-=1;const p=a.slice(o,u),g=r.slice(o,d),x=a.slice(0,o).map(b=>({type:"ctx",text:b}));if(p.length*g.length>2e6)p.forEach(b=>x.push({type:"del",text:b})),g.forEach(b=>x.push({type:"add",text:b}));else{const b=Array.from({length:p.length+1},()=>new Uint32Array(g.length+1));for(let y=p.length-1;y>=0;y-=1)for(let k=g.length-1;k>=0;k-=1)b[y][k]=p[y]===g[k]?b[y+1][k+1]+1:Math.max(b[y+1][k],b[y][k+1]);let h=0,v=0;for(;h<p.length&&v<g.length;)p[h]===g[v]?(x.push({type:"ctx",text:p[h]}),h+=1,v+=1):b[h+1][v]>=b[h][v+1]?(x.push({type:"del",text:p[h]}),h+=1):(x.push({type:"add",text:g[v]}),v+=1);for(;h<p.length;)x.push({type:"del",text:p[h++]});for(;v<g.length;)x.push({type:"add",text:g[v++]})}return a.slice(u).forEach(b=>x.push({type:"ctx",text:b})),x}function I9(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 th=120;function U9({before:e,after:i,startLine:a=1}){const r=I.useMemo(()=>{const u=QN(e,i),d=new Array(u.length).fill(!1);u.forEach((h,v)=>{if(h.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,g=a;const x=[];let b=!1;return u.forEach((h,v)=>{const y=h.type==="add"?g:p;if(h.type!=="add"&&(p+=1),h.type!=="del"&&(g+=1),!d[v]){b=!0;return}b&&x.length>0&&x.push({key:-v,type:"gap",text:"",no:null,gap:!0}),b=!1,x.push({key:v,type:h.type,text:h.text,no:y})}),x},[e,i,a]),o=r.slice(0,th);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:[o.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:te("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:te("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>th&&l.jsxs("div",{className:"px-3 py-1 text-[10px] text-faint",children:["… ",r.length-th," more rows"]})]})}function Wg({added:e,removed:i,line:a,column:r,className:o}){return l.jsxs("span",{className:te("diff-badge inline-flex items-center gap-1.5 font-mono text-[11px] tabular-nums",o),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 B9=new Set(["write_file","edit_file","rewrite_file"]);function WN(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 I9(QN(i,a))}function $9(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 P9(e){return e===void 0?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function H9(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 JN({message:e,compact:i=!1}){const[a,r]=I.useState(!i&&e.status==="awaiting"||e.status==="error"),[o,u]=I.useState(!1),d=me(j=>j.notify),p=$9(e.status),g=_g(e.call.name,e.call.args),x=e.call.args,b=WN(e),h=B9.has(e.call.name),v=typeof x.command=="string"?x.command:"",y=typeof x.content=="string"?x.content:typeof x.newText=="string"?x.newText:typeof x.oldText=="string"?x.oldText:"";I.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?P9(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(hd,{size:12,strokeWidth:2,className:te("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:Sg(e.call.name)}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] text-muted",children:g||"—"}),h&&b&&e.status==="done"?l.jsx(Wg,{added:b.added,removed:b.removed,line:b.line,column:b.column,className:"shrink-0"}):S&&l.jsx("span",{className:te("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:H9(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:()=>_h(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:()=>_h(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 x.oldText=="string"&&typeof x.newText=="string"&&l.jsx(U9,{before:x.oldText,after:x.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)}
237
+ … ${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:o?"Copied":"Copy"})]}),l.jsx("pre",{className:te("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 nh(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):""}function ih({message:e,sessionId:i,canEdit:a}){const[r,o]=I.useState(!1),[u,d]=I.useState(e.content),p=()=>{const b=u.trim();if(!b)return;const h=Je.getState().sessions.find(k=>k.id===i),v=h?.messages.findIndex(k=>k.id===e.id)??-1;if(!h||v<0)return;const y=In("msg");Je.getState().updateSession(i,{messages:h.messages.slice(0,v)}),Je.getState().addMessage(i,{...e,id:y,content:b,createdAt:Date.now()}),o(!1),gk(i,y)},g=(e.attachments??[]).filter(b=>b.kind==="image"),x=(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"&&o(!1)},autoFocus:!0,rows:Math.min(10,Math.max(2,u.split(`
238
+ `).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:()=>o(!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),o(!0)},className:"mt-2 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg text-faint opacity-0 transition hover:bg-raised hover:text-ink focus-visible:opacity-100 group-hover/user:opacity-100",title:"Edit and resend","aria-label":"Edit and resend message",children:l.jsx(Po,{size:14,strokeWidth:1.7})}),l.jsxs("div",{className:"max-w-[88%] sm:max-w-[82%]",children:[g.length>0&&l.jsx("div",{className:te("mb-2 grid gap-2",g.length>1?"grid-cols-2":"grid-cols-1"),children:g.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:[x.length>0&&l.jsx("div",{className:"mb-2 flex flex-wrap gap-1.5",children:x.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(ns,{size:11}),l.jsx("span",{className:"max-w-[180px] truncate",children:b.name}),l.jsx("span",{className:"text-faint",children:fl(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 eE=new Set(["write_file","rewrite_file","edit_file"]);function Kv(e){const i=new Set;for(const a of e){if(a.status!=="done"||!eE.has(a.call.name))continue;const r=a.call.args.path;typeof r=="string"&&r&&i.add(r)}return[...i]}function F9({turnId:e,files:i,diff:a}){const r=me(b=>b.askConfirm),o=me(b=>b.notify),[u,d]=I.useState("idle"),p=i.slice(0,2).join(", "),g=i.length-2,x=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 h=await Ej(e),v=[h.restored.length?`restored ${h.restored.length}`:"",h.removed.length?`removed ${h.removed.length}`:"",h.skipped.length?`${h.skipped.length} too large to restore`:""].filter(Boolean);o(`Undone: ${v.join(", ")||"nothing to change"}.`,"success"),d("undone"),await qe.getState().refresh().catch(()=>{})}catch(h){d("idle"),o(h instanceof Error?h.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}${g>0?` and ${g} more`:""}`}),u!=="undone"&&a&&l.jsx(Wg,{added:a.added,removed:a.removed,className:"shrink-0"}),u!=="undone"&&l.jsx("button",{type:"button",onClick:()=>{x()},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 q9({text:e}){const[i,a]=I.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(hd,{size:11,strokeWidth:2,className:te("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 tE(e){let i=0,a=0,r=!1;for(const o of e){if(!eE.has(o.call.name))continue;const u=WN(o);u&&(r=!0,i+=u.added,a+=u.removed)}return r?{added:i,removed:a}:null}function G9({tools:e,intermediateMessages:i=[],streaming:a=!1}){const[r,o]=I.useState(!1),u=I.useRef(!1),d=Ae(k=>k.autoCollapseWork),p=Ae(k=>k.workDetail==="detailed"),g=e.some(k=>k.status==="awaiting"),x=a||e.some(k=>k.status==="running");if(I.useEffect(()=>{g?o(!0):x?(u.current=!0,o(!0)):u.current&&d&&(u.current=!1,o(!1))},[x,g,d]),e.length===0&&i.length===0)return null;const b=[...new Set(e.map(k=>Sg(k.call.name)))],h=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,o(k=>!k)},className:"group/task flex max-w-full items-baseline gap-1.5 py-0.5 text-left text-[13px]","aria-expanded":r,children:[l.jsx(hd,{size:13,strokeWidth:2,className:te("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:te("shrink-0 font-medium transition-colors",g?"text-warning":x?"text-shimmer":"text-ink/80 group-hover/task:text-ink"),children:g?"Action required":x?"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})`:""]}),h>0&&l.jsxs("span",{className:"shrink-0 text-[12px] text-danger",children:["· ",h," failed"]}),(()=>{const k=tE(e);return k?l.jsx(Wg,{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(JN,{message:k.tool,compact:!p},k.tool.id):l.jsxs("div",{className:"py-1",children:[k.message.reasoning.trim()&&l.jsx(q9,{text:k.message.reasoning}),k.message.content.trim()&&l.jsx("div",{className:"mt-1 text-[12.5px] leading-relaxed text-muted",children:l.jsx(Qg,{content:k.message.content})})]},k.message.id))})]})}const Y9=/^\[Summary of the earlier conversation[^\n]*\]\n\n/;function K9({message:e}){const[i,a]=I.useState(!1),r=e.compaction;return r?l.jsxs("div",{className:"my-1",children:[l.jsxs("button",{type:"button",onClick:()=>a(o=>!o),className:"group/compact flex w-full items-center gap-3 text-[11.5px] text-faint","aria-expanded":i,children:[l.jsx("span",{className:"h-px flex-1 bg-line"}),l.jsxs("span",{className:"shrink-0 transition-colors group-hover/compact:text-ink",children:["Context compacted · ",r.turns," turn",r.turns===1?"":"s",", ",r.toolCalls," tool call",r.toolCalls===1?"":"s"," summarised",r.fallback?" · without the model":""]}),l.jsx("span",{className:"h-px flex-1 bg-line"})]}),i&&l.jsx("div",{className:"animate-fade mt-2 rounded-xl border border-line bg-raised/40 px-4 py-3",children:l.jsx(Qg,{content:e.content.replace(Y9,"")})})]}):null}function ah({message:e,sessionId:i,streaming:a,isLastAssistant:r,showHeader:o,turnUsage:u}){const d=me(D=>D.notify),p=me(D=>D.openSettings),g=Ae(D=>D.showTokenEstimate),x=_n(D=>e.provider?D.byProvider[e.provider]:void 0),[b,h]=I.useState(!1),[v,y]=I.useState(!1),k=!!(e.content.trim()||e.reasoning.trim()||e.error);if(e.compaction)return l.jsx(K9,{message:e});const S=x?.find(D=>D.id===e.model)?.name??e.model??"",j=!!(e.error&&/api key|base url|settings|credential|403|401/i.test(e.error)),_=[],A=u?.input||e.usage?.input,C=u?.output||e.usage?.output;A&&_.push(`${nh(A)} in`),C?_.push(`${nh(C)} out`):g&&e.content.trim()&&_.push(`~${nh(Math.ceil(e.content.length/4))} out`);const M=[S,..._,e.durationMs?`${(e.durationMs/1e3).toFixed(1)}s`:""].filter(Boolean).join(" · "),B=async()=>{try{await navigator.clipboard.writeText(e.content),h(!0),window.setTimeout(()=>h(!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:[o&&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:()=>jm(i),className:"mt-2 inline-flex items-center gap-1.5 text-[11.5px] font-medium text-accent hover:underline",children:[l.jsx(Li,{size:12})," Try again"]})]})}):l.jsx("div",{className:"group",children:l.jsxs("div",{className:"min-w-0",children:[(o||e.stopped)&&l.jsxs("div",{className:"flex min-h-[22px] items-center gap-1.5",children:[o&&l.jsxs(l.Fragment,{children:[l.jsx(pl,{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(fg,{size:7,fill:"currentColor"}),"Stopped"]})]}),e.reasoning.trim()&&l.jsxs("div",{className:"mt-1",children:[l.jsxs("button",{type:"button",onClick:()=>y(D=>!D),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(hd,{size:12,strokeWidth:2,className:te("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:te("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(Qg,{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(gd,{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(Sw,{size:12}),"Open model settings"]}),r&&l.jsxs("button",{type:"button",onClick:()=>jm(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(Li,{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:B,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(sn,{size:14,className:"text-success"}):l.jsx(xd,{size:14,strokeWidth:1.7})}),r&&l.jsx("button",{type:"button",onClick:()=>jm(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(Li,{size:14,strokeWidth:1.7})}),l.jsx("span",{className:"ml-2 tabular-nums text-muted",children:M})]})]})})}function V9({turn:e,sessionId:i,streaming:a,lastAssistantId:r,activeTurn:o=!1}){const u=[],d=[];for(const v of e.segments)v.kind==="tools"?u.push(...v.tools):v.kind==="assistant"&&d.push(v.message);const p=u.length>0,g=d[0]?.id,x=d[d.length-1]??null;if(o&&p)return l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&l.jsx(ih,{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(JN,{message:k},k.id))},`tools-${y}`):l.jsx(ah,{message:v.message,sessionId:i,streaming:a&&v.message.id===r,isLastAssistant:v.message.id===r,showHeader:v.message.id===g},v.message.id))]});if(!p){let v=0;return l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.user&&l.jsx(ih,{message:e.user,sessionId:i,canEdit:!a}),d.map(y=>l.jsx(ah,{message:y,sessionId:i,streaming:a&&y.id===r,isLastAssistant:y.id===r,showHeader:v++===0},y.id))]})}const b=d.slice(0,-1),h=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(ih,{message:e.user,sessionId:i,canEdit:!a}),l.jsx(G9,{tools:u,intermediateMessages:b}),x&&l.jsx(ah,{message:x,sessionId:i,streaming:!1,isLastAssistant:x.id===r,showHeader:!0,turnUsage:h},x.id),e.user&&Kv(u).length>0&&l.jsx(F9,{turnId:e.user.id,files:Kv(u),diff:tE(u)})]})}const X9=[{value:"all",label:"All"},{value:"30d",label:"30d"},{value:"7d",label:"7d"}],Z9=["bg-raised","bg-accent/20","bg-accent/35","bg-accent/55","bg-accent/80"];function Q9(e,i){return e<=0?0:i<=1?2:Math.min(4,1+Math.floor(e/i*3))}function Yr({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 W9(){const e=Ae(u=>u.daemon),i=Ae(u=>u.showMascot),a=qe(u=>u.info),o=(e?.home??"").split(/[\\/]/).filter(Boolean).pop()||a.name||"there";return l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[i&&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(Sk,{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:o}),"?"]}),l.jsx("p",{className:"-mt-2 text-[13.5px] text-muted",children:"Local-first agent. Your folder, your keys, your machine."})]})}function J9(){const e=Je(g=>g.sessions),[i,a]=I.useState("30d"),[r,o]=I.useState("overview"),u=I.useMemo(()=>IM(e,i),[e,i]),d=I.useMemo(()=>{const g=[];for(let x=0;x<u.heatmap.length;x+=7)g.push(u.heatmap.slice(x,x+7));return g},[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(g=>l.jsx("button",{type:"button",onClick:()=>o(g),className:te("h-6 rounded-md px-2.5 text-[11.5px] font-medium capitalize transition-colors",r===g?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:g},g))}),l.jsx("div",{className:"inline-flex items-center gap-0.5 rounded-lg bg-raised p-0.5",children:X9.map(g=>l.jsx("button",{type:"button",onClick:()=>a(g.value),className:te("h-6 rounded-md px-2.5 text-[11.5px] font-medium transition-colors",i===g.value?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:g.label},g.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(Yr,{icon:r2,label:"Sessions",value:String(u.sessions)}),l.jsx(Yr,{icon:cg,label:"Messages",value:String(u.messages)}),l.jsx(Yr,{icon:oi,label:"Total tokens",value:u.tokens?_o(u.tokens):"0"}),l.jsx(Yr,{icon:B2,label:"Credits spent",value:u.cost>0?Oh(u.cost):"—"}),l.jsx(Yr,{icon:k2,label:"Active days",value:String(u.activeDays)}),l.jsx(Yr,{icon:D2,label:"Peak hour",value:u.peakHour}),l.jsx(Yr,{icon:Yu,label:"Favorite model",value:Am(u.favoriteModel)})]}),l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsx("div",{className:"flex w-max gap-[3px]",children:d.map((g,x)=>l.jsx("div",{className:"grid grid-rows-7 gap-[3px]",children:g.map(b=>l.jsx("span",{className:te("h-[11px] w-[11px] rounded-[2px]",Z9[Q9(b.count,u.busiestDay)]),title:`${b.key} · ${b.count} message${b.count===1?"":"s"}`},b.key))},x))})}),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 ~${_o(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 ",Am(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(Yu,{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(g=>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:g.model,children:Am(g.model)}),l.jsxs("span",{className:"shrink-0 text-[10.5px] tabular-nums text-faint",children:[_o(g.tokens)," · ",g.messages," msg",g.cost>0?` · ${Oh(g.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,g.tokens/p*100):4}%`}})})]},g.model))})})]})})}function Vv(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Xv(e,i=180){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a}function e8(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 t8({session:e}){const i=I.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(Oo,{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(IC,{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:Vv(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 g=!!(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(pl,{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"}),Vv(r.createdAt)]})]}),g?l.jsx("p",{className:"mt-1 line-clamp-4 whitespace-pre-wrap text-[12px] leading-relaxed text-muted",children:Xv(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(gd,{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 o=e8(r),u=r.call.name==="shell",d=["read_file","write_file","edit_file","rewrite_file"].includes(r.call.name),p=u?_w:d?ns:Oo;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:Sg(r.call.name)}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-muted",children:_g(r.call.name,r.call.args)||"—"}),l.jsxs("span",{className:te("flex shrink-0 items-center gap-1 text-[10px] font-medium",o.className),children:[r.status==="done"?l.jsx(sn,{size:10}):l.jsx("span",{className:te("h-1.5 w-1.5 rounded-full",o.dot)}),o.label,r.durationMs!==void 0&&r.status==="done"?` · ${r.durationMs<1e3?`${r.durationMs}ms`:`${(r.durationMs/1e3).toFixed(1)}s`}`:""]})]}),r.result&&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:Xv(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(gw,{size:10})]})]})})}const n8=[{icon:fT,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:wT,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:b2,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."}];function i8(){const e=Je(ne=>ne.sessions),i=Je(ne=>ne.activeId),a=e.find(ne=>ne.id===i)??null,r=wi(ne=>i?!!ne.streaming[i]:!1),o=Ae(),u=Ae(ne=>ne.setMode),d=Ae(ne=>ne.update),p=me(ne=>ne.notify),g=me(ne=>ne.openSettings),x=me(ne=>ne.focusComposer),b=me(ne=>ne.setWorkspaceOpen),h=me(ne=>ne.setDeployOpen),v=me(ne=>ne.askConfirm),y=Md(),[k,S]=I.useState(""),[j,_]=I.useState("chat"),A=I.useRef(null),[C,M]=I.useState(!0),B=I.useRef(i),D=I.useRef(null),N=a?.messages??[],z=N[N.length-1],q=[...N].reverse().find(ne=>ne.role==="assistant")?.id,R=ol(o),G=Xn(o),Z=$M(N),fe=uk(N,y),le=RM(N,r),J=(ne="auto")=>{const E=A.current;E&&E.scrollTo({top:E.scrollHeight,behavior:ne})};I.useEffect(()=>{if(B.current!==i){B.current=i,M(!0),_("chat"),requestAnimationFrame(()=>J("auto"));const ne=Je.getState().sessions.find(E=>E.id===i);ne?.mode&&u(ne.mode)}},[i,u]),I.useEffect(()=>{z&&(z.id!==D.current?(D.current=z.id,z.role==="user"?(M(!0),requestAnimationFrame(()=>J("auto"))):C&&requestAnimationFrame(()=>J("auto"))):C&&J("auto"))},[z,C]),I.useEffect(()=>{if(!C)return;const ne=window.setTimeout(()=>J("auto"),40);return()=>window.clearTimeout(ne)},[N,C]);const O=async(ne,E)=>{const pe=Ae.getState();if(!ol(pe))return p(pe.provider==="custom"?"Add a base URL for your custom endpoint in Settings → Models.":`Add an API key for ${hg(pe.provider)} in Settings → Models.`,"error"),g("models"),!1;const _e=Xn(pe);if(!_e)return p("Choose a model before sending a message.","error"),g("models"),!1;let L=i;(!L||!Je.getState().sessions.some(xe=>xe.id===L))&&(L=Je.getState().createSession(pe.provider,_e,pe.mode));const $=ne.trim(),oe=In("msg");return Je.getState().addMessage(L,{id:oe,role:"user",content:$,attachments:E.length>0?E:void 0,createdAt:Date.now()}),Je.getState().updateSession(L,{mode:pe.mode}),S(""),M(!0),gk(L,oe),!0},re=ne=>{S(ne),x()},ie=async(ne,E)=>{switch(ne){case"search":return E.trim()?(d({webSearchEnabled:!0}),O(`Use the web to research this: ${E.trim()}
239
+
240
+ Read the most useful sources, cite the URLs you actually opened, and answer for this workspace.`,[])):(S("/search "),p("Type what you want OpenSol to research.","info"),x(),!1);case"plan":return u("plan"),E.trim()?O(E.trim(),[]):(p("Plan mode is on: investigation only until you switch to Build.","info"),x(),!0);case"build":return u("build"),E.trim()?O(E.trim(),[]):(p("Build mode is on: OpenSol can edit files and run commands.","info"),x(),!0);case"new":return Je.getState().newChat(),x(),!0;case"workspace":return b(!0),!0;case"deploy":return h(!0),!0;case"settings":return g("models"),!0;case"compact":{const pe=Je.getState().sessions.find(_e=>_e.id===i);return!pe||pe.messages.length<4?(p("There is not enough conversation to compact yet.","info"),!0):r?(p("Wait for the current answer to finish, then run /compact.","info"),!0):(await Un.compaction.compact(pe.id,{focus:E.trim()||void 0,manual:!0}),!0)}case"clear":{const pe=Je.getState().sessions.find(L=>L.id===i);return!pe||pe.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"})||(ad(pe.id),Je.getState().updateSession(pe.id,{messages:[]}),Je.getState().updateSession(pe.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(KM,{session:a,view:j,onViewChange:_}),!a||N.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(W9,{})}),l.jsxs("div",{className:"mt-8 w-full animate-rise [animation-delay:120ms]",children:[(!R||!G)&&l.jsxs("button",{type:"button",onClick:()=>g("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($o,{size:14,className:"shrink-0"}),l.jsx("span",{className:"flex-1",children:R?"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(G0,{value:k,onChange:S,onSend:O,onStop:()=>{},onCommand:ie,streaming:!1,hints:!0,autoFocus:!0,placeholder:R?"How can I help you today?":"Add a provider key to start"}),l.jsx("div",{className:"stagger mt-4 grid grid-cols-1 gap-2 sm:grid-cols-3",children:n8.map(ne=>l.jsxs("button",{type:"button",onClick:()=>re(ne.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(ne.icon,{size:14,strokeWidth:1.8})}),l.jsx("span",{className:"min-w-0 truncate",children:ne.label})]},ne.label))})]}),l.jsx("div",{className:"mt-10 animate-rise [animation-delay:420ms]",children:l.jsx(J9,{})})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"relative min-h-0 flex-1",children:j==="trajectory"?l.jsx(t8,{session:a}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:A,onScroll:ne=>{const E=ne.currentTarget,pe=E.scrollHeight-E.scrollTop-E.clientHeight;M(pe<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:Z.map((ne,E)=>l.jsx("div",{className:E===0?"animate-rise":"mt-10 animate-rise",children:l.jsx(V9,{turn:ne,sessionId:a.id,streaming:r,lastAssistantId:q,activeTurn:r&&E===Z.length-1})},ne.id))})}),!C&&l.jsx("button",{type:"button",onClick:()=>{M(!0),J("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(p2,{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.jsx("div",{className:"mx-auto w-full max-w-[760px]",children:l.jsx(G0,{value:k,onChange:S,onSend:O,onStop:()=>a&&ad(a.id),onCommand:ie,streaming:r,placeholder:R?"How can I help you today?":"Add a provider key to start",contextPct:fe.pct,contextTitle:`Context: ~${_o(fe.used)} / ${_o(fe.limit)} tokens`,pixleMood:le})})})]})]})}const Zv=[{id:"desktop",label:"Desktop",icon:ug,width:"100%"},{id:"tablet",label:"Tablet",icon:TC,width:"768px"},{id:"phone",label:"Phone",icon:wC,width:"390px"}];function a8(e){return e.includes("index.html")?"index.html":[...e].sort((i,a)=>i.split("/").length-a.split("/").length||i.localeCompare(a))[0]??""}function r8(){const e=qe(_=>_.entries),[i,a]=I.useState(""),[r,o]=I.useState(""),[u,d]=I.useState(""),[p,g]=I.useState("desktop"),[x,b]=I.useState(0),h=I.useMemo(()=>e.filter(_=>_.type==="file"&&/\.html?$/i.test(_.path)).map(_=>_.path),[e]),v=I.useMemo(()=>{const _=e.filter(A=>A.type==="file");return`${_.length}-${_.reduce((A,C)=>Math.max(A,C.mtime),0)}`},[e]),y=h.includes(u)?u:a8(h),k=I.useCallback(async()=>{o("");try{a((await kj()).token)}catch(_){a(""),o(_ instanceof Error?_.message:"Could not start the preview.")}},[]);I.useEffect(()=>{k()},[k]);const S=i&&y?`/preview/${i}/${encodeURI(y)}?v=${v}.${x}`:"",j=Zv.find(_=>_.id===p)?.width??"100%";return h.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(ug,{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:_=>d(_.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:h.map(_=>l.jsx("option",{value:_,children:_},_))}),l.jsx("div",{className:"flex items-center rounded-lg bg-raised/70 p-0.5",children:Zv.map(_=>l.jsx("button",{type:"button",onClick:()=>g(_.id),"aria-pressed":p===_.id,title:_.label,"aria-label":_.label,className:te("flex h-7 w-7 items-center justify-center rounded-md transition-colors",p===_.id?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:l.jsx(_.icon,{size:14,strokeWidth:1.7})},_.id))}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",onClick:()=>{k(),b(_=>_+1)},title:"Reload preview","aria-label":"Reload preview",children:l.jsx(Li,{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(ig,{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($t,{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}-${x}`)]}),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 Qv={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"}},rh={"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"}},Wv={color:"#8b95a5",glyph:"text"};function s8(e){const i=e.toLowerCase();if(rh[i])return rh[i];if(i.startsWith(".env"))return rh[".env"];if(/\.(test|spec)\.[a-z]+$/.test(i)){const r=Qv[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?Qv[i.slice(a+1)]??Wv:Wv}function l8({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 sh({name:e,size:i=15,className:a}){const r=s8(e),o=I.useId(),u=r.label,d=u&&u.length>3;return l.jsxs("svg",{viewBox:"0 0 16 16",width:i,height:i,className:te("shrink-0",a),"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,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(#${o})`,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(l8,{kind:r.glyph??"text",color:r.color})]})}const o8={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"}},c8={color:"#e0a526"};function Jv({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 Xh({name:e,open:i=!1,size:a=16,className:r}){const o=o8[e.toLowerCase()]??c8;return l.jsxs("svg",{viewBox:"0 0 16 16",width:a,height:a,className:te("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:o.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:o.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:o.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"}),o.glyph&&!i&&l.jsx(Jv,{kind:o.glyph,color:o.color}),o.glyph&&i&&l.jsx("g",{transform:"translate(0.6 0)",children:l.jsx(Jv,{kind:o.glyph,color:o.color})})]})}function ew(e){return e.messages.filter(i=>i.role==="user").length}function u8(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 d8(){const e=Je(N=>N.sessions),i=Je(N=>N.activeId),a=Je(N=>N.setActive),r=Je(N=>N.newChat),o=Je(N=>N.renameSession),u=Je(N=>N.deleteSession),d=qe(N=>N.info.root),p=wi(N=>N.streaming),g=wi(N=>N.titling),x=me(N=>N.askConfirm),b=me(N=>N.notify),h=me(N=>N.focusComposer),[v,y]=I.useState("workspace"),[k,S]=I.useState(null),[j,_]=I.useState(""),A=I.useMemo(()=>[...v==="all"?e:e.filter(z=>z.workspace===d)].sort((z,q)=>q.updatedAt-z.updatedAt),[e,v,d]),C=e.filter(N=>!N.workspace).length,M=()=>{k&&j.trim()&&o(k,j),S(null)},B=async N=>{await x({title:"Delete this session?",body:`“${N.title}” and its messages will be removed from this computer. This cannot be undone.`,confirmLabel:"Delete session",tone:"danger"})&&(ad(N.id),u(N.id))},D=async N=>{await Un.titles?.generate(N,{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(N=>l.jsx("button",{type:"button",onClick:()=>y(N),className:te("relative z-10 rounded-full px-2.5 py-1 transition-colors",v===N?"bg-panel text-ink shadow-pill":"text-muted hover:text-ink"),children:N==="workspace"?"This workspace":`All · ${e.length}`},N))}),l.jsxs("button",{type:"button",onClick:()=>{r(),h()},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(br,{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(DT,{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"&&C>0?`${C} older session${C===1?"":"s"} were started before workspaces were tracked. Switch to “All” to see them.`:"Start a conversation and it shows up here."})]}):A.map((N,z)=>{const q=!!p[N.id],R=u8(N);return l.jsxs("div",{style:{animationDelay:`${Math.min(z*30,300)}ms`},className:te("session-card group/session animate-slideleft mb-1.5 rounded-xl border px-3 py-2.5 transition-all duration-200",i===N.id?"border-accent/40 bg-accent-soft/60":"border-transparent hover:border-line hover:bg-raised/60"),children:[k===N.id?l.jsx("input",{autoFocus:!0,value:j,onChange:G=>_(G.target.value),onBlur:M,onKeyDown:G=>{G.key==="Enter"&&M(),G.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(N.id),className:"block w-full text-left",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[i===N.id&&l.jsx(sn,{size:12,className:"shrink-0 text-accent"}),l.jsx("span",{className:te("min-w-0 flex-1 truncate text-[12.5px] font-medium text-ink",g[N.id]&&"text-shimmer"),children:N.title}),q&&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:rd(N.updatedAt)}),l.jsxs("span",{children:["· ",ew(N)," turn",ew(N)===1?"":"s"]}),R>0&&l.jsxs("span",{children:["· ",R," file",R===1?"":"s"," edited"]}),N.model&&l.jsxs("span",{className:"max-w-[120px] truncate font-mono",children:["· ",N.model]}),N.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(N.id),_(N.title)},title:"Rename","aria-label":"Rename session",children:l.jsx(Po,{size:11})}),l.jsx("button",{type:"button",className:"icon-button h-6 w-6",onClick:()=>{D(N.id)},disabled:!!g[N.id]||N.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:()=>{B(N)},title:"Delete","aria-label":"Delete session",children:l.jsx(aa,{size:11})})]})]},N.id)})})]})}function f8(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("/"),g=p===-1?null:i.get(u.path.slice(0,p));g?g.children.push(d):a.push(d)}const o=u=>{u.sort((d,p)=>d.entry.type===p.entry.type?d.entry.name.localeCompare(p.entry.name):d.entry.type==="dir"?-1:1),u.forEach(d=>o(d.children))};return o(a),a}function p8(e){const i=/\.([a-z0-9]+)$/i.exec(e);return i?i[1].toUpperCase():"TEXT"}function m8({onDone:e}){const i=qe(M=>M.addWorkspace),a=qe(M=>M.info.workspaces),r=me(M=>M.notify),[o,u]=I.useState(""),[d,p]=I.useState(""),[g,x]=I.useState(""),[b,h]=I.useState([]),[v,y]=I.useState(!0),[k,S]=I.useState(""),[j,_]=I.useState(!1),A=async M=>{y(!0),S("");try{const B=await xj(M);u(B.path),p(B.parent),x(B.home),h(B.entries)}catch(B){S(B instanceof Error?B.message:"Could not read that folder.")}finally{y(!1)}};I.useEffect(()=>{A("")},[]);const C=async M=>{_(!0);try{await i(M),e?.()}catch(B){r(B instanceof Error?B.message:"Could not open that folder.","error")}finally{_(!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(o2,{size:13})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{A(g)},disabled:!g||v,"aria-label":"Home folder",children:l.jsx(bd,{size:13})}),l.jsx("p",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted",title:o,children:o||"Home"}),v&&l.jsx($t,{size:12}),l.jsxs("button",{type:"button",onClick:()=>{C(o)},disabled:!o||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($t,{size:11}):l.jsx(sn,{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(M=>l.jsx("button",{type:"button",onClick:()=>{C(M.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:M.path,children:M.name},M.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(M=>l.jsxs("div",{className:"group flex items-center gap-1",children:[l.jsxs("button",{type:"button",onClick:()=>{A(M.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(Ku,{size:13,className:"shrink-0 text-faint"}),l.jsx("span",{className:"truncate",children:M.name})]}),l.jsx("button",{type:"button",onClick:()=>{C(M.path)},className:"hidden h-7 rounded-md px-2 text-[10px] font-medium text-accent group-hover:block",children:"Use"})]},M.path))]})]})}function h8(){const e=me(X=>X.workspaceOpen),i=me(X=>X.setWorkspaceOpen),a=me(X=>X.notify),r=me(X=>X.askConfirm),o=qe(X=>X.info),u=qe(X=>X.root),d=qe(X=>X.entries),p=qe(X=>X.loadingTree),g=qe(X=>X.treeError),x=qe(X=>X.activeFile),b=qe(X=>X.file),h=qe(X=>X.content),v=qe(X=>X.dirty),y=qe(X=>X.saving),k=qe(X=>X.openingFile),S=qe(X=>X.git),j=qe(X=>X.gitLoading),_=qe(X=>X.setActiveFile),A=qe(X=>X.saveFile),C=qe(X=>X.setContent),M=qe(X=>X.createEntry),B=qe(X=>X.renameEntry),D=qe(X=>X.deleteEntry),N=qe(X=>X.forgetWorkspace),z=qe(X=>X.loadGit),q=qe(X=>X.refresh),[R,G]=I.useState(""),[Z,fe]=I.useState(new Set),le=Je(X=>X.sessions.length),[J,O]=I.useState("files"),[re,ie]=I.useState(!o.available),[ne,E]=I.useState(null),[pe,_e]=I.useState(!1),L=I.useRef(null),$=I.useMemo(()=>f8(d),[d]),oe=I.useMemo(()=>{const X=R.trim().toLowerCase();return X?d.filter(ye=>ye.path.toLowerCase().includes(X)).slice(0,300):null},[d,R]),xe=h?h.split(`
241
+ `).length:0;I.useEffect(()=>{ne&&L.current?.focus()},[ne]),I.useEffect(()=>{ie(!o.available)},[o.available]),I.useEffect(()=>{const X=ye=>{!(ye.metaKey||ye.ctrlKey)||ye.key.toLowerCase()!=="s"||!me.getState().workspaceOpen||!qe.getState().activeFile||(ye.preventDefault(),qe.getState().saveFile())};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[]);const Te=I.useMemo(()=>{const X=new Map,ye=new Set;for(const je of S.entries){X.set(je.path,je.status.trim()||"M");let Me=je.path.lastIndexOf("/");for(;Me>0;)ye.add(je.path.slice(0,Me)),Me=je.path.lastIndexOf("/",Me-1)}return{files:X,dirs:ye}},[S.entries]);if(!e)return null;const $e=async()=>{if(!ne)return;const X=ne.value.trim().replace(/^\/+/,"");if(!X)return E(null);try{if(ne.mode==="rename"){if(!x)return;await B(x,X)}else await M(X,ne.mode==="create-dir"?"dir":"file");E(null)}catch(ye){a(ye instanceof Error?ye.message:"That change failed.","error")}},He=async X=>{if(await r({title:"Delete this path?",body:`${X} will be deleted from disk. This cannot be undone.`,confirmLabel:"Delete",tone:"danger"}))try{await D(X)}catch(je){a(je instanceof Error?je.message:"Could not delete that path.","error")}},Be=async()=>{try{await navigator.clipboard.writeText(h),_e(!0),window.setTimeout(()=>_e(!1),1500)}catch{a("Clipboard access was blocked.","error")}},Ee=X=>X.includes("?")||X.includes("A")?"text-success":X.includes("D")?"text-danger":"text-warning",P=(X,ye)=>{const je=X.entry.path,Me=10+ye*14;if(X.entry.type==="dir"){const jt=Z.has(je),se=Te.dirs.has(je);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>fe(Le=>{const bt=new Set(Le);return bt.has(je)?bt.delete(je):bt.add(je),bt}),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:Me},title:je,"aria-expanded":!jt,children:[l.jsx(gw,{size:11,strokeWidth:2.2,className:te("shrink-0 text-faint transition-transform duration-150",!jt&&"rotate-90")}),l.jsx(Xh,{name:X.entry.name,open:!jt,size:16}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.entry.name}),se&&jt&&l.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-warning",title:"Contains changes"}),jt&&X.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:X.children.length}),l.jsx("span",{role:"button",tabIndex:0,onClick:Le=>{Le.stopPropagation(),He(je)},onKeyDown:Le=>{Le.key==="Enter"&&He(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(aa,{size:11})})]}),!jt&&X.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:Me+5}}),X.children.map(Le=>P(Le,ye+1))]})]},je)}const ot=x===je,Ke=Te.files.get(je);return l.jsxs("button",{type:"button",onClick:()=>_(je),className:te("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:Me+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(sh,{name:X.entry.name,size:15}),l.jsx("span",{className:te("min-w-0 flex-1 truncate",Ke&&Ee(Ke)),children:X.entry.name}),Ke&&l.jsx("span",{className:te("shrink-0 font-mono text-[9px] font-semibold",Ee(Ke)),children:Ke.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:te("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",J==="preview"&&o.available&&!re?"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(gr,{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:o.available?o.name:"Workspace"}),l.jsx("p",{className:"truncate text-[9px] text-faint",title:u,children:o.available?u:"No folder open"})]}),o.available&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>ie(!0),title:"Change folder","aria-label":"Change folder",children:l.jsx(Ku,{size:14})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>{q().catch(()=>{})},title:"Refresh tree","aria-label":"Refresh tree",children:l.jsx(Li,{size:13,className:te(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(Bi,{size:15})})]}),re||!o.available?l.jsx(m8,{onDone:()=>ie(!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:()=>O("files"),className:te("h-7 rounded-md px-2.5 text-[11px] font-medium",J==="files"?"bg-raised text-ink":"text-muted hover:text-ink"),children:"Files"}),l.jsx("button",{type:"button",onClick:()=>O("preview"),className:te("h-7 rounded-md px-2.5 text-[11px] font-medium",J==="preview"?"bg-raised text-ink":"text-muted hover:text-ink"),children:"Preview"}),l.jsxs("button",{type:"button",onClick:()=>O("sessions"),className:te("h-7 rounded-md px-2.5 text-[11px] font-medium",J==="sessions"?"bg-raised text-ink":"text-muted hover:text-ink"),children:["Sessions ",l.jsxs("span",{className:"text-faint",children:["· ",le]})]}),l.jsxs("button",{type:"button",onClick:()=>O("git"),className:te("h-7 rounded-md px-2.5 text-[11px] font-medium",J==="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:()=>E({mode:"create-file",value:""}),title:"New file","aria-label":"New file",children:l.jsx(xw,{size:13})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>E({mode:"create-dir",value:""}),title:"New folder","aria-label":"New folder",children:l.jsx(sT,{size:13})})]})]}),J==="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(is,{size:11,className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{value:R,onChange:X=>G(X.target.value),placeholder:"Find a file",className:"h-7 w-full rounded-md border border-transparent bg-raised/60 pl-7 pr-2 text-[10.5px] text-ink outline-none transition-colors placeholder:text-faint focus:border-line focus:bg-panel","aria-label":"Find a file"})]}),ne&&l.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[l.jsx("input",{ref:L,value:ne.value,onChange:X=>E({...ne,value:X.target.value}),onKeyDown:X=>{X.key==="Enter"&&$e(),X.key==="Escape"&&E(null)},placeholder:ne.mode==="rename"?x??"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:()=>{$e()},className:"flex h-7 items-center rounded-md bg-ink px-2 text-[10px] font-medium text-panel",children:l.jsx(br,{size:10})}),l.jsx("button",{type:"button",onClick:()=>E(null),className:"icon-button h-7 w-7",children:l.jsx(Bi,{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:[g&&l.jsx("p",{className:"px-2 py-2 text-[10.5px] text-danger",children:g}),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($t,{size:11})," Reading folder…"]}),oe?oe.map(X=>l.jsxs("button",{type:"button",onClick:()=>X.type==="file"&&_(X.path),className:te("flex h-7 w-full items-center gap-1.5 rounded-md px-2 text-left font-mono text-[10.5px]",x===X.path?"bg-accent-soft font-medium text-accent":"text-muted hover:bg-raised hover:text-ink"),children:[X.type==="dir"?l.jsx(Xh,{name:X.name,size:15}):l.jsx(sh,{name:X.name,size:15}),l.jsx("span",{className:"truncate",children:X.path})]},X.path)):$.map(X=>P(X,0)),!p&&!g&&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:x&&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:x}),l.jsxs("p",{className:"mt-0.5 text-[9px] text-faint",children:[p8(x)," · ",xe," lines · ",fl(b.size),v?" · unsaved":" · saved"]})]}),k&&l.jsx($t,{size:11}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:()=>E({mode:"rename",value:x}),title:"Rename","aria-label":"Rename",children:l.jsx(Po,{size:12})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7",onClick:Be,title:"Copy","aria-label":"Copy",children:pe?l.jsx(sn,{size:12,className:"text-success"}):l.jsx(xd,{size:12})}),l.jsx("button",{type:"button",className:"icon-button h-7 w-7 hover:text-danger",onClick:()=>{He(x)},title:"Delete","aria-label":"Delete",children:l.jsx(aa,{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($t,{size:10}):l.jsx(rC,{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:h,onChange:X=>C(X.target.value),spellCheck:!1,wrap:"off","aria-label":`Edit ${x}`,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:te("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(ns,{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."})]})})]}):J==="preview"?l.jsx(r8,{}):J==="sessions"?l.jsx(d8,{}):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(rg,{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:()=>{z()},"aria-label":"Refresh git",children:l.jsx(Li,{size:12,className:te(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(X=>l.jsxs("button",{type:"button",onClick:()=>_(X.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-[10px] hover:bg-raised",title:X.path,children:[l.jsx("span",{className:"w-6 shrink-0 font-mono font-semibold text-warning",children:X.status}),l.jsx(sh,{name:X.path.split("/").pop()??X.path,size:14}),l.jsx("span",{className:"truncate text-muted",children:X.path})]},`${X.status}-${X.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 N()},className:"text-[10.5px] font-medium text-faint hover:text-danger",children:"Forget this workspace"})})]})]}),o.available&&!re&&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(og,{size:10,className:te(p&&"animate-spin")}),"Real folder · daemon-scoped access",l.jsxs("span",{className:"ml-auto",children:[d.length," entries"]})]})]})]})}const qu={settings:"maxcode-settings-v1",chats:"maxcode-chats-v1",workspace:"maxcode-workspace-v1"},Mu=Oa()((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 sl();let r=await KC();const o=g8();o.found&&(r.migration?.migratedAt||(r=(await tj({settings:o.settings,chats:o.chats})).state),x8()),await nE(r),Zj(),Ij(),e({phase:"ready",error:""})}catch(r){e({phase:"error",error:r instanceof Error?r.message:"OpenSol could not reach its local daemon."})}}}}));async function nE(e){Ae.getState().hydrate(e),Je.getState().hydrate(e.chats),await qe.getState().hydrate(e.workspace),li.getState().load()}function tw(e){if(e)try{return JSON.parse(e)}catch{return}}function g8(){if(typeof window>"u")return{found:!1,settings:void 0,chats:void 0};let e,i,a=!1;try{e=tw(window.localStorage.getItem(qu.settings)),i=tw(window.localStorage.getItem(qu.chats)),a=!!(e||i||window.localStorage.getItem(qu.workspace))}catch{}return{found:a,settings:e,chats:i}}function x8(){try{for(const e of Object.values(qu))window.localStorage.removeItem(e)}catch{}}const b8=/^[a-z0-9][a-z0-9-]{0,47}$/;function y8(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"&&b8.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 v8(e,i,a){const r=`
242
+ const send = (message) => parent.postMessage(message, '*')
243
+ const api = {
244
+ manifest: ${JSON.stringify({id:e.id,name:e.name})},
245
+ command: (id, label) => send({ type: 'command', id, label }),
246
+ panel: (id, label) => send({ type: 'panel', id, label }),
247
+ log: (message) => send({ type: 'log', message: String(message).slice(0, 500) }),
248
+ network: () => { throw new Error('The sandboxed preview has no network access.') },
249
+ workspace: { list: () => [], read: () => '', write: () => {}, edit: () => false },
250
+ }
251
+ try { ;(function (maxcode) { ${i} })(api) } catch (error) {
252
+ send({ type: 'error', message: String(error && error.message ? error.message : error).slice(0, 500) })
253
+ }
254
+ send({ type: 'ready' })
255
+ `;return`<!doctype html><html><head><meta charset="utf-8"><style>${a}</style></head><body><script>${r}<\/script></body></html>`}function w8(e,i){const a=r=>{r.source===e.contentWindow&&y8(r.data)&&i(r.data)};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)}const k8=5*1024*1024,N8=10*1024*1024,E8=100,S8=64*1024,_8=new Set(["workspace.list","workspace.read","workspace.write","workspace.edit","ui.commands","ui.panels","ui.themes","network.request"]),T8=new Set(["id","name","version","apiVersion","entry","stylesheet","capabilities","domains"]);function kt(e){throw new Error(`Invalid plugin package: ${e}`)}function iE(e){return typeof e=="string"?e:new TextDecoder("utf-8").decode(e)}function pd(e){return new TextEncoder().encode(e)}function C8(e,i,a){if(a===2)return;const r=iE(i),o=e.endsWith(".js")?[/\b(?:import|export)\b|\b(?:fetch|XMLHttpRequest|WebSocket|EventSource|importScripts)\s*\(|\bnavigator\s*\.\s*sendBeacon\s*\(/i,"module imports and unmanaged network calls are forbidden"]:e.endsWith(".css")?[/@import\b|url\s*\(\s*(['"]?)(?!data:image\/(?:png|jpeg|gif|webp);base64,)[^)]*\)/i,"external CSS resources and imports are forbidden"]:null;if(!o)return;const u=o[0].exec(r);if(!u)return;const d=r.slice(0,u.index).split(`
256
+ `).length,p=u[0].length>60?`${u[0].slice(0,60)}…`:u[0];kt(`${o[1]}: found "${p}" at ${e}:${d}`)}function Zh(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 j8(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 $d(e){(!e||typeof e!="object"||Array.isArray(e))&&kt("manifest must be an object"),Object.keys(e).some(h=>!T8.has(h))&&kt("unknown manifest field");const{id:i,name:a,version:r,apiVersion:o,entry:u,stylesheet:d,capabilities:p,domains:g}=e;(typeof i!="string"||!/^[a-z0-9][a-z0-9-]{1,63}$/.test(i))&&kt("invalid plugin id"),(typeof a!="string"||!a.trim()||a.length>100)&&kt("invalid plugin name"),(typeof r!="string"||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(r))&&kt("invalid plugin version"),o!==1&&o!==2&&kt("unsupported API version"),Zh(u),Zh(d),(!u.endsWith(".js")||!d.endsWith(".css"))&&kt("entry must be JavaScript and stylesheet must be CSS");const x=p??[];Array.isArray(x)||kt("capabilities must be an array"),o===1&&x.some(h=>!_8.has(h))&&kt("invalid capability"),g!==void 0&&!Array.isArray(g)&&kt("domains must be an array");const b=(g??[]).map(j8);return new Set(b).size!==b.length&&kt("duplicate domain"),{id:i,name:a.trim(),version:r,apiVersion:o,entry:u,stylesheet:d,capabilities:[...new Set(x)],domains:b}}function A8(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>E8&&kt("too many files");const r={};let o=0;for(const u of a){const d=Zh(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 g=typeof p=="string"?pd(p):p;o+=g.byteLength,o>N8&&kt("package is too large"),(d===i.entry||d===i.stylesheet)&&C8(d,g,i.apiVersion),r[d]=typeof p=="string"?p:iE(g)}return i.entry in r||kt("entry file is missing"),i.stylesheet in r||kt("stylesheet file is missing"),pd(r[i.entry]).byteLength>2*1024*1024&&kt("entry file is too large"),r}function O8(e){const i=$d(e?.manifest),a=A8(e?.files,i),r=JSON.stringify(i);pd(r).byteLength>S8&&kt("manifest is too large");const u=pd(JSON.stringify({format:"cordis-plugin",manifest:i,files:a}));return u.byteLength>k8&&kt("package is too large"),u}function Jg(e){(!e||!(e instanceof Uint8Array)||e.byteLength===0)&&kt("package archive is empty or invalid");let i;try{const o=new TextDecoder("utf-8").decode(e);i=JSON.parse(o)}catch{kt("package is not a valid JSON archive")}(!i||typeof i!="object")&&kt("invalid package format");const a=$d(i.manifest),r=i.files;return(!r||typeof r!="object")&&kt("missing package files"),{manifest:a,files:r}}const M8=/\.(?:png|jpe?g|gif|webp|ico|woff2?|ttf|otf|eot|wasm|zip|pdf|mp3|mp4)$/i;function R8(e){return M8.test(e)}function D8(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 z8(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 $d(i)}function L8(e){const i=D8(e.map(v=>v.path)),a={};let r;e.forEach((v,y)=>{const k=i[y];k==="manifest.json"?r=v.content:a[k]=v.content});const o=Object.keys(a),u=(v,y)=>v!==void 0&&v.endsWith(y)&&o.includes(v)?v:void 0,d=(v,y)=>{if(o.includes(v))return v;const k=o.filter(S=>S.endsWith(y)).sort();return k.find(S=>S.slice(S.lastIndexOf("/")+1)===v)??k[0]};let p,g;if(r!==void 0)try{p=z8(r)}catch(v){g=v instanceof Error?v.message:"manifest.json could not be read."}const x=u(p?.entry,".js")??d("main.js",".js");if(!x)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",h=o.filter(v=>v!==x&&v!==b&&/\.(?:m?js|cjs|jsx|tsx?|css)$/i.test(v));if(h.length>0)throw new Error(`A plugin package holds one script and one stylesheet. Remove or merge: ${h.join(", ")}.`);return{entry:x,stylesheet:b,files:a,manifest:p,manifestError:g}}const I8=["workspace.list","workspace.read","workspace.write","workspace.edit","ui.commands","ui.panels","ui.themes","network.request"],U8=".js,.css,.json,.txt,.html,.svg,.png,.jpg,.jpeg,.gif,.webp,.woff,.woff2",Ru="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 B8(e){const i=e.webkitRelativePath||e.name;return{path:i,content:R8(i)?new Uint8Array(await e.arrayBuffer()):await e.text()}}function $8({onInstalled:e}){const i=me(N=>N.notify),[a,r]=I.useState("my-plugin"),[o,u]=I.useState("My plugin"),[d,p]=I.useState("1.0.0"),[g,x]=I.useState(1),[b,h]=I.useState(["ui.commands"]),[v,y]=I.useState(""),[k,S]=I.useState(null),j=I.useRef(null),_=I.useRef(null),A=async N=>{if(N?.length)try{const z=await Promise.all([...N].map(B8)),q=L8(z);S(q),q.manifest&&(r(q.manifest.id),u(q.manifest.name),p(q.manifest.version),x(q.manifest.apiVersion===2?2:1),h(q.manifest.capabilities),y(q.manifest.domains.join(", "))),i(q.manifestError?`Loaded ${Object.keys(q.files).length} file(s). Its manifest.json was ignored: ${q.manifestError}`:`Loaded ${Object.keys(q.files).length} file(s) — entry ${q.entry}.`,q.manifestError?"error":"info")}catch(z){S(null),i(z instanceof Error?z.message:"Those files are not a plugin folder.","error")}},C=()=>{try{if(!k)throw new Error("Load a plugin folder or its files first.");const N={id:a.trim(),name:o.trim(),version:d.trim(),apiVersion:g,entry:k.entry,stylesheet:k.stylesheet,capabilities:g===2?[]:b,domains:v.split(/[\s,]+/).map(q=>q.trim()).filter(Boolean)};$d(N);const z={...k.files};return z[N.stylesheet]??="",{archive:O8({manifest:N,files:z})}}catch(N){return i(N instanceof Error?N.message:"That package could not be built.","error"),null}},M=()=>{const N=C();if(!N)return;const z=URL.createObjectURL(new Blob([N.archive],{type:"application/json"})),q=document.createElement("a");q.href=z,q.download=`${a.trim()||"plugin"}.plugin.json`,q.click(),URL.revokeObjectURL(z)},B=async()=>{const N=C();if(N)try{const{plugin:z}=await Aw(N.archive);e?.(z),i(`${z.manifest.name} installed. It starts sandboxed and disabled.`,"success")}catch(z){i(z instanceof Error?z.message:"The daemon rejected this package.","error")}},D=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(yw,{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(vi,{checked:g===2,onChange:N=>x(N?2:1),label:"API v2"}),l.jsx("span",{className:"text-[10.5px] font-medium text-ink",children:"API v2 — free plugin (full app access)"}),g===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(bw,{size:12}),"Load folder"]}),l.jsxs("button",{type:"button",onClick:()=>_.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(iT,{size:12}),"Load files"]}),l.jsx("input",{type:"file",multiple:!0,ref:N=>{j.current=N,N&&(N.webkitdirectory=!0)},className:"hidden",onChange:N=>{A(N.target.files),N.target.value=""}}),l.jsx("input",{ref:_,type:"file",multiple:!0,accept:U8,className:"hidden",onChange:N=>{A(N.target.files),N.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:[D.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:[D.slice(0,6).map(N=>l.jsxs("li",{className:"truncate font-mono text-[9.5px] text-faint",children:[N," · ",fl(typeof k.files[N]=="string"?new TextEncoder().encode(k.files[N]).length:k.files[N].byteLength)]},N)),D.length>6&&l.jsxs("li",{className:"font-mono text-[9.5px] text-faint",children:["+",D.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:Ru,value:a,onChange:N=>r(N.target.value)})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Name"}),l.jsx("input",{className:Ru,value:o,onChange:N=>u(N.target.value)})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[10px] font-medium text-muted",children:"Version"}),l.jsx("input",{className:Ru,value:d,onChange:N=>p(N.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:g===2?l.jsx("p",{className:"text-[10px] text-faint",children:"Not needed — API v2 plugin has full access via the Cordis context."}):I8.map(N=>{const z=b.includes(N);return l.jsx("button",{type:"button",onClick:()=>h(q=>z?q.filter(R=>R!==N):[...q,N]),className:`rounded-full border px-2 py-1 font-mono text-[9.5px] ${z?"border-accent/40 bg-accent-soft text-ink":"border-line text-faint"}`,children:N},N)})})]}),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:Ru,value:v,placeholder:"Leave empty — a plugin that needs no network declares none",onChange:N=>y(N.target.value)})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("button",{type:"button",onClick:M,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:()=>{B()},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 P8({plugin:e}){const i=me(b=>b.notify),[a,r]=I.useState(null),[o,u]=I.useState([]),d=I.useRef(null),[p,g]=I.useState(!1);I.useEffect(()=>{if(!(!d.current||!a))return w8(d.current,b=>{const h=b,v=h.type==="ready"?"Sandbox ready — no app access, no network.":`${h.type}: ${h.message??h.label??""}`;u(y=>[...y.slice(-5),v])})},[a]);const x=async()=>{g(!0);try{const b=await jw(e.id),{files:h,manifest:v}=Jg(b);u([]),r(v8(v,h[v.entry]??"",h[v.stylesheet]??""))}catch(b){i(b instanceof Error?b.message:"This plugin could not be previewed.","error")}finally{g(!1)}};return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",disabled:p,onClick:()=>a?r(null):void x(),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(ag,{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:o.map((b,h)=>l.jsx("p",{className:"truncate",children:b},h))})]})]})}const H8={"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 F8(){const e=me(k=>k.notify),i=me(k=>k.askConfirm),[a,r]=I.useState([]),[o,u]=I.useState(!1),[d,p]=I.useState(null),g=I.useRef(null),x=async()=>{try{r((await Cw()).plugins)}catch(k){e(k instanceof Error?k.message:"Could not list plugins.","error")}};I.useEffect(()=>{x()},[]);const b=k=>{r(S=>S.map(j=>j.id===k.id?k:j))},h=async k=>{u(!0);try{Jg(new Uint8Array(await k.arrayBuffer()));const{plugin:S}=await Aw(new Uint8Array(await k.arrayBuffer()));r(j=>[...j.filter(_=>_.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 ZC(k.id,{capabilities:S,domains:j})).plugin)}catch(_){e(_ instanceof Error?_.message:"Could not save plugin permissions.","error")}},y=async k=>{if(k.safe){b((await b0(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 b0(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:o,onClick:()=>g.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(gr,{size:12}),"Choose plugin package"]}),l.jsx("input",{ref:g,type:"file",accept:".plugin.json,.pluginmax,application/json,application/zip",className:"hidden",onChange:k=>{const S=k.target.files?.[0];k.target.value="",S&&h(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(vd,{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(vi,{checked:k.enabled,disabled:!k.safe,label:`Enable ${k.manifest.name}`,onChange:async j=>{b((await QC(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:te("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(mC,{size:13,className:"mt-0.5 shrink-0 text-warning"}):l.jsx(Wr,{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:_=>{v(k,_.target.checked?[...k.grants.capabilities,j]:k.grants.capabilities.filter(A=>A!==j),k.grants.domains)}}),l.jsx("span",{className:"flex-1",children:H8[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:_=>{v(k,k.grants.capabilities,_.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(P8,{plugin:k}),l.jsx("button",{type:"button",onClick:()=>{y(k)},className:te("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 WC(k.id),r(_=>_.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(aa,{size:11}),"Uninstall"]})]})]})]},k.id)})}),l.jsx($8,{onInstalled:k=>r(S=>[...S.filter(j=>j.id!==k.id),k])})]})}const q8=/^[a-z0-9][a-z0-9-]{0,47}$/;function G8(e,i){return!!e?.capabilities.includes(i)}function Y8(e,i,a){let r;try{const o=new URL(a);if(o.protocol!=="https:"||o.port&&o.port!=="443")return null;r=o.hostname.toLowerCase()}catch{return null}return!i.includes(r)||!e?.domains.includes(r)?null:r}function Qh(){return{commands:new Map,panels:new Map,themes:new Map}}function K8(e){throw new Error(`The plugin was not granted ${e}.`)}function V8(e,i,a,r=Qh()){const o=d=>{G8(i,d)||K8(d)},u=d=>{if(!q8.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,g){if(o("ui.commands"),u(d),typeof g!="function")throw new Error("A command needs a function.");r.commands.set(d,{label:String(p).slice(0,80),run:g})},registerPanel(d,p,g){if(o("ui.panels"),u(d),typeof g!="function")throw new Error("A panel needs a render function.");r.panels.set(d,{label:String(p).slice(0,80),render:g})},registerTheme(d,p,g){if(o("ui.themes"),u(d),!g||typeof g!="object")throw new Error("A theme needs a palette.");r.themes.set(d,{label:String(p).slice(0,80),palette:{...g}})},workspace:{list:async d=>(o("workspace.list"),a.workspace.list(d)),read:async d=>(o("workspace.read"),a.workspace.read(d)),write:async(d,p)=>(o("workspace.write"),a.workspace.write(d,p)),edit:async(d,p,g)=>(o("workspace.edit"),a.workspace.edit(d,p,g))},network:{request(d,p){if(o("network.request"),!Y8(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 aE=e=>`maxcode-plugin-style-${e}`,lh="plugin-";function X8(e){return Object.entries(e).filter(([i,a])=>/^[a-z][a-z0-9-]*$/.test(i)&&/^[\d\s.]+$/.test(a))}function Z8(e){const i=(e.canvas??"").trim().split(/\s+/).map(Number),[a,r,o]=i.length===3?i:[255,255,255];return .2126*a+.7152*r+.0722*o<110}function Q8(e,i){const a=X8(i).map(([r,o])=>`--${r}:${o.trim()}`);return a.length===0?"":`[data-theme='${e}']{${a.join(";")}}`}function rE(e){return document.getElementById(aE(e))}function nw(e,i){let a=rE(e);a||(a=document.createElement("style"),a.id=aE(e),document.head.append(a)),a.textContent=i}function W8(e){rE(e)?.remove()}async function iw(e,i){const a=globalThis,r=URL.createObjectURL(new Blob([`const maxcode = globalThis.__maxcodePluginApi;
257
+ ${e}
258
+ `],{type:"text/javascript"}));a.__maxcodePluginApi=i;try{await import(r)}finally{delete a.__maxcodePluginApi,URL.revokeObjectURL(r)}}function J8(){const e=new Map,i=new Map,a=r=>{const o=i.get(r);o&&(i.delete(r),o.dispose());const u=e.get(r);if(u)for(const d of u.themes.keys())Hw(`${lh}${r}:${d}`);e.delete(r),W8(r)};return{contributions:e,contributionsFor:r=>e.get(r)??Qh(),themes(){const r=[];for(const[o,u]of e)for(const[d,p]of u.themes)r.push({id:`${lh}${o}:${d}`,label:p.label});return r},commands(){const r=[];for(const[o,u]of e)for(const[d,p]of u.commands)r.push({pluginId:o,id:d,label:p.label,run:p.run});return r},async activate(r,o){if(a(r.id),!r.safe||!r.enabled)return;const{files:u,manifest:d}=Jg(await jw(r.id));if(d.apiVersion===2){let p,g;const x=new Promise((v,y)=>{p=v,g=y}),b=async v=>{const y=u[d.stylesheet]??"";y&&nw(r.id,y);try{await iw(u[d.entry]??"",v),p()}catch(k){g(k)}},h=Un.plugin(b);i.set(r.id,h);try{await x}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)??Qh();e.set(r.id,p);const g=V8(r,r.grants,o,p);try{await iw(u[d.entry]??"",Object.freeze(g));const x=[...p.themes.entries()].map(([b,h])=>{const v=`${lh}${r.id}:${b}`;return Pw({id:v,label:h.label,dark:Z8(h.palette)}),Q8(v,h.palette)}).join(`
259
+ `);nw(r.id,`${u[d.stylesheet]??""}
260
+ ${x}`)}catch(x){throw a(r.id),new Error(`Plugin ${r.id} failed to start: ${x instanceof Error?x.message:String(x)}`)}}},deactivate:a,deactivateAll(){const r=[...new Set([...e.keys(),...i.keys()])];for(const o of r)a(o)}}}const eI={workspace:{async list(e=""){return(await Mw(e)).entries.map(a=>({path:a.path,name:a.name,type:a.type}))},async read(e){return(await dh(e)).content},async write(e,i){await fh(e,i)},async edit(e,i,a){const r=await dh(e);return r.content.includes(i)?(await fh(e,r.content.replace(i,a)),!0):!1}},network:(e,i)=>JC(e,i)};let aw=null;function sE(){return aw??=J8(),aw}async function tI(e){const i=new Set(e.filter(r=>r.safe&&r.enabled).map(r=>r.id)),a=sE();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,eI)}catch(o){console.error(o)}}const yo=[{id:"general",label:"General",icon:yC,description:"Permissions, appearance and conversation display."},{id:"models",label:"Models",icon:Yu,description:"Providers, encrypted keys, live models and reasoning defaults."},{id:"tools",label:"Tools",icon:Oo,description:"What OpenSol can do on this machine, and when it must ask."},{id:"search",label:"Search",icon:dl,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:vd,description:"Plugins are temporarily disabled for maintenance.",disabled:!0},{id:"mcp",label:"MCP",icon:lg,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:Qr,description:"Hosting credentials and command-line tools."},{id:"appearance",label:"Appearance",icon:ww,description:"Theme and interface preferences."},{id:"about",label:"About",icon:sg,description:"Local storage, history and reset controls."}],xr="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 ts({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 Cn({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 ex({value:e,onChange:i,placeholder:a,disabled:r,label:o}){const[u,d]=I.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":o,className:te(xr,"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(V2,{size:12}):l.jsx(ag,{size:12})})]})}const nI=[];function iI(e){return e?e>=1e3?`${Math.round(e/1e3)}k`:String(e):""}const aI={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 rI({providerId:e,open:i,onToggle:a}){const r=Ae(),o=Ae(O=>O.selectModel),u=Ae(O=>O.updateProvider),d=Ae(O=>O.saveProviderKey),p=me(O=>O.notify),g=me(O=>O.askConfirm),x=_n(O=>O.fetchModels),b=_n(O=>O.byProvider[e])??nI,h=_n(O=>!!O.loading[e]),v=_n(O=>O.errors[e]??""),y=_n(O=>O.notes[e]??""),k=_n(O=>O.source[e]??""),[S,j]=I.useState(""),[_,A]=I.useState(""),[C,M]=I.useState(!1),B=na[e],D=r.providerStatus.find(O=>O.id===e),N=Ed(r,e),z=r.provider===e,q=r.providers[e]?.baseUrl??"",R=D?.hint??"",G=Xn(r),Z=b.find(O=>O.id===G);I.useEffect(()=>{if(!i||!N)return;const O=window.setTimeout(()=>{x(e)},400);return()=>window.clearTimeout(O)},[i,N,e,q,x]);const fe=async()=>{const O=S.trim();if(!O){p(`Paste a ${B.name} API key first.`,"error");return}const re=aI[e];if(re&&!O.startsWith(re.prefix)){let ie="";e==="openrouter"&&O.startsWith("sk-")&&(ie=" (looks like a DeepSeek or OpenAI key). If you are using DeepSeek, please paste it under DeepSeek instead."),p(`A key for ${re.label} must start with "${re.prefix}"${ie}`,"error");return}M(!0);try{await d(e,O),j(""),p(`${B.name} key saved and encrypted.`,"success"),x(e,!0)}catch(ie){p(ie instanceof Error?ie.message:"Could not save that key.","error")}finally{M(!1)}},le=async()=>{if(await g({title:`Remove the ${B.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(`${B.name} key removed.`,"success")}catch(re){p(re instanceof Error?re.message:"Could not remove that key.","error")}},J=async()=>{if(b.length===0){const O=await x(e,!0);O[0]?o(e,O[0].id):p("No usable model was returned by this provider.","error");return}o(e,b[0].id)};return l.jsxs("div",{className:te("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:B.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:B.name}),z&&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:te("mt-0.5 flex items-center gap-1 text-[9.5px]",N?"text-success":"text-faint"),children:[l.jsx("span",{className:te("h-1 w-1 rounded-full",N?"bg-success":"bg-faint")}),N?e==="custom"?"Endpoint configured":B.keyless?"No key needed":`Connected ${R}`:B.keyless?"Local endpoint":"No key"]})]}),!i&&l.jsx("span",{className:"hidden max-w-[170px] truncate text-[9.5px] text-faint sm:block",children:z&&G?Z?.name??G:b.length?`${b.length} live models`:""}),l.jsx(Bo,{size:14,className:te("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:[!B.keyless&&l.jsxs("div",{className:"mb-2.5",children:[l.jsx(ts,{hint:N?"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(ex,{value:S,onChange:j,placeholder:N?`Replace key ${R}`:B.keyHint,label:`${B.name} API key`})}),l.jsxs("button",{type:"button",onClick:()=>{fe()},disabled:!S.trim()||C,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:[C?l.jsx($t,{size:10}):l.jsx(yd,{size:10}),"Save"]})]}),N&&l.jsx("button",{type:"button",onClick:()=>{le()},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(ts,{hint:e==="custom"?"Required":"Optional",children:"Base URL"}),l.jsx("input",{value:q,onChange:O=>u(e,{baseUrl:O.target.value}),placeholder:B.baseUrl||"https://example.com/v1",spellCheck:!1,className:te(xr,"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 ${B.baseUrl||"the provider default"}. Useful for a gateway or local proxy.`})]}),B.note&&l.jsx("p",{className:"mb-2.5 text-[9.5px] leading-relaxed text-faint",children:B.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:()=>{x(e,!0)},disabled:!N||h,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:[h?l.jsx($t,{size:10}):l.jsx(Li,{size:10}),h?"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:z?G:"",onChange:O=>{O.target.value&&o(e,O.target.value)},className:te(xr,"font-mono text-[11px]"),"aria-label":`${B.name} model`,children:[l.jsx("option",{value:"",children:"Choose a model…"}),z&&G&&!b.some(O=>O.id===G)&&l.jsxs("option",{value:G,children:[G," (not listed)"]}),b.map(O=>l.jsxs("option",{value:O.id,children:[O.name||O.id,O.context?` · ${iI(O.context)} ctx`:""]},O.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:h?"Loading the provider’s current models…":N?"No usable models were returned. You can still enter an exact model ID.":e==="custom"?"Set a base URL, then refresh.":B.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:_,onChange:O=>A(O.target.value),placeholder:"or enter a model ID",spellCheck:!1,"aria-label":`${B.name} model ID`,className:te(xr,"font-mono text-[10.5px]")}),l.jsx("button",{type:"button",onClick:()=>{const O=_.trim();O&&(o(e,O),A(""))},disabled:!_.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:B.keyless?"No key is stored for this provider.":N?"The daemon decrypts the key only when it calls the provider.":"The key never enters the page after saving."}),N&&!z&&l.jsxs("button",{type:"button",onClick:()=>{J()},className:"shrink-0 text-[9.5px] font-medium text-accent hover:underline",children:["Use ",B.name]})]})]})]})}function sI(){const e=Ae(),i=Ae(b=>b.update),a=Ae(b=>b.refreshProviders),[r,o]=I.useState(e.provider),[u,d]=I.useState(!1),p=Md(),g=Do(p),x=g.includes(e.effort)?e.effort:g[0];return l.jsxs(l.Fragment,{children:[l.jsxs(Cn,{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($t,{size:10}):l.jsx(Li,{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(Wr,{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:Vu.map(b=>l.jsx(rI,{providerId:b.id,open:r===b.id,onToggle:()=>o(r===b.id?null:b.id)},b.id))})]}),l.jsx(Cn,{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:g.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:x,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:g.map(b=>l.jsx("option",{value:b,children:Mo[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:ph(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(Cn,{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(Bo,{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(ts,{hint:"0 – 2",children:"Temperature"}),l.jsx("input",{type:"number",min:0,max:2,step:.1,value:e.temperature,onChange:b=>{const h=Number(b.target.value);Number.isFinite(h)&&i({temperature:Math.min(2,Math.max(0,h))})},className:xr})]}),l.jsxs("div",{children:[l.jsx(ts,{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 h=Number(b.target.value);Number.isFinite(h)&&i({maxTokens:Math.min(2e5,Math.max(256,Math.round(h)))})},className:xr})]})]}),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:Zu}),className:"inline-flex items-center gap-1 text-[9.5px] font-medium text-faint hover:text-ink",children:[l.jsx(kw,{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 lI=[{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"]}],oI={shell:_w,read_file:ns,list_files:bw,write_file:xw,edit_file:g0,rewrite_file:g0,grep:eT,web_search:dl,read_url:lg,git:rg,subagent:h2,skill:oi},cI={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 uI(){const e=Ae(),i=Ae(r=>r.updateTool),a=me(r=>r.openSettings);return l.jsxs(Cn,{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:lI.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((o,u)=>{const d=e.tools[o],p=oI[o],g=cI[o];return l.jsxs("div",{className:te("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:g.label}),l.jsx("span",{className:"font-mono text-[8.5px] text-faint",children:o})]}),l.jsx("p",{className:"mt-0.5 text-[9.5px] leading-relaxed text-muted",children:g.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(Dd,{value:d.approval,onChange:x=>i(o,{approval:x}),options:[{value:"auto",label:"Auto",title:"Run without asking"},{value:"ask",label:"Ask",title:"Ask before running"}]}),l.jsx(vi,{checked:d.enabled,onChange:x=>i(o,{enabled:x}),label:`Enable ${g.label}`})]})]},o)})})]},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(Wr,{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 dI=[{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 fI(){const e=Ae(),i=Ae(A=>A.update),a=Ae(A=>A.saveSearchKey),r=me(A=>A.notify),[o,u]=I.useState(""),[d,p]=I.useState(!1),[g,x]=I.useState(!1),[b,h]=I.useState(null),v=e.secretStatus?.search,y=e.searchProvider==="duckduckgo",k=!!v?.configured,S=async()=>{if(!o.trim()){r("Paste a search API key first.","error");return}p(!0);try{await a(o.trim()),u(""),h(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(""),h(null),r("Search key removed.","success")}catch(A){r(A instanceof Error?A.message:"Could not remove that key.","error")}},_=async()=>{x(!0),h(null);try{const A=await Di("web_search",{query:"OpenSol local coding agent",provider:e.searchProvider},"build"),C=A.result&&typeof A.result=="object"?A.result:{},M=Array.isArray(C.results)?C.results:[];h({ok:M.length>0,message:M.length>0?`${M.length} results via ${String(C.provider??e.searchProvider)}.`:"No results were returned. Try another provider or query."})}catch(A){h({ok:!1,message:A instanceof Error?A.message:"Search failed."})}finally{x(!1)}};return l.jsxs(l.Fragment,{children:[l.jsx(Cn,{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(vi,{checked:e.webSearchEnabled,onChange:A=>i({webSearchEnabled:A}),label:"Allow web tools"})]})}),l.jsxs(Cn,{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:dI.map(A=>{const C=e.searchProvider===A.id;return l.jsxs("button",{type:"button",onClick:()=>{i({searchProvider:A.id}),h(null)},className:te("rounded-lg border p-3 text-left transition-colors",C?"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:te("flex h-3.5 w-3.5 items-center justify-center rounded-full border",C?"border-accent bg-accent text-on-accent":"border-line"),children:C&&l.jsx(sn,{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(ts,{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(ex,{value:o,onChange:u,placeholder:e.searchProvider==="tavily"?"tvly-…":e.searchProvider==="brave"?"BSA…":"…",label:"Search API key"})}),l.jsxs("button",{type:"button",onClick:()=>{S()},disabled:!o.trim()||d,className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-lg bg-ink px-2.5 text-[10px] font-medium text-panel disabled:opacity-40",children:[d?l.jsx($t,{size:10}):l.jsx(yd,{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:()=>{_()},disabled:g||!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:[g?l.jsx($t,{size:12}):l.jsx(is,{size:12}),g?"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:te("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 pI=/(^|\/)(node_modules|\.git|__pycache__)(\/|$)/,rw=1024*1024;async function mI(e){const i=new Uint8Array(await e.arrayBuffer());let a="";const r=32768;for(let o=0;o<i.length;o+=r)a+=String.fromCharCode(...i.subarray(o,o+r));return btoa(a)}function hI(e){return e.startsWith("npm:")?e:e==="upload"?"Folder":e==="legacy"?"Migrated":"Local"}function gI(){const e=li(C=>C.skills),i=li(C=>C.loading),a=li(C=>C.error),r=li(C=>C.load),o=li(C=>C.upload),u=li(C=>C.installNpm),d=li(C=>C.setEnabled),p=li(C=>C.remove),g=me(C=>C.askConfirm),x=me(C=>C.notify),b=I.useRef(null),[h,v]=I.useState(null),[y,k]=I.useState(""),S=e.filter(C=>C.enabled).length;I.useEffect(()=>{r()},[r]);const j=async C=>{const M=Array.from(C).map(N=>({file:N,path:N.webkitRelativePath||N.name})).filter(N=>!pI.test(N.path));if(M.length===0)return;const B=M.filter(N=>N.file.size>rw),D=M.filter(N=>N.file.size<=rw);if(!D.some(N=>/(^|\/)skill\.md$/i.test(N.path))){x("That folder has no SKILL.md. Choose the skill folder itself (or a folder that contains skill folders).","error");return}v("folder");try{const N=await Promise.all(D.map(async q=>({path:q.path,data:await mI(q.file)}))),z=await o(N);x(`Installed ${z.join(", ")}${B.length>0?` · skipped ${B.length} file${B.length===1?"":"s"} over 1 MB`:""}.`,"success")}catch(N){x(N instanceof Error?N.message:"Could not install that skill folder.","error")}finally{v(null)}},_=async()=>{const C=y.trim();if(C){v("npm");try{const M=await u(C);k(""),x(`Installed ${M.join(", ")} from npm.`,"success")}catch(M){x(M instanceof Error?M.message:"Could not install that npm package.","error")}finally{v(null)}}},A=async C=>{if(await g({title:"Delete this skill?",body:`“${C.name}” and its folder will be removed from this computer.`,confirmLabel:"Delete skill",tone:"danger"}))try{await p(C.name)}catch(B){x(B instanceof Error?B.message:"Could not delete the skill.","error")}};return l.jsxs(Cn,{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:h!==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:[h==="folder"?l.jsx($t,{size:12}):l.jsx(cT,{size:12})," Upload skill folder"]}),l.jsx("input",{ref:b,type:"file",className:"hidden",multiple:!0,webkitdirectory:"",directory:"",onChange:C=>{C.target.files&&j(C.target.files),C.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:C=>{C.preventDefault(),_()},children:[l.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[l.jsx(vd,{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:C=>k(C.target.value),placeholder:"npm package, e.g. @scope/my-skills",className:te(xr,"pl-7 font-mono text-[11px]"),"aria-label":"npm package",spellCheck:!1})]}),l.jsxs("button",{type:"submit",disabled:h!==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:[h==="npm"?l.jsx($t,{size:12}):l.jsx(ng,{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((C,M)=>l.jsx("div",{className:te("px-3 py-3",M!==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:C.name}),l.jsx("span",{className:"rounded bg-raised px-1.5 py-0.5 text-[8px] font-medium text-faint",children:hI(C.source)}),l.jsxs("span",{className:"text-[8.5px] text-faint",children:[C.fileCount," file",C.fileCount===1?"":"s"," · ",fl(C.size)]})]}),l.jsx("p",{className:"mt-0.5 text-[9.5px] leading-relaxed text-muted",children:C.description||"No description."}),l.jsx("p",{className:"mt-0.5 truncate font-mono text-[8.5px] text-faint",title:C.path,children:C.path})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[l.jsx("button",{type:"button",onClick:()=>{A(C)},className:"icon-button h-7 w-7 hover:text-danger","aria-label":`Delete ${C.name}`,title:"Delete skill",children:l.jsx(aa,{size:12})}),l.jsx(vi,{checked:C.enabled,onChange:B=>{d(C.name,B)},label:`Enable ${C.name}`})]})]})},C.name))})]})}const Gu={cloudflare:{label:"Cloudflare Pages",short:"Cloudflare",icon:uh,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:dl,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:uh,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 xI({providerId:e}){const i=Gu[e],a=Ae(M=>M.deploySecrets?.[e]),r=Ae(M=>M.deployTools?.[e]),o=Ae(M=>M.saveDeployCredentials),u=me(M=>M.notify),d=me(M=>M.askConfirm),[p,g]=I.useState(!1),[x,b]=I.useState({}),[h,v]=I.useState(""),[y,k]=I.useState(!1),S=i.fields.filter(M=>!M.secret),j=i.fields.find(M=>M.secret);I.useEffect(()=>{const M={};for(const B of S)M[B.key]=a?.fields?.[B.key]??"";b(M)},[a,S.length]);const _=async()=>{k(!0);try{const M={...x};h.trim()&&j&&(M[j.key]=h.trim()),await o(e,M),v(""),u(`${i.label} credentials saved and encrypted.`,"success")}catch(M){u(M instanceof Error?M.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 B={};for(const D of i.fields)B[D.key]="";await o(e,B),v(""),u(`${i.label} credentials removed.`,"success")}catch(B){u(B instanceof Error?B.message:"Could not remove those credentials.","error")}},C=i.icon;return l.jsxs("div",{className:"rounded-xl border border-line bg-panel",children:[l.jsxs("button",{type:"button",onClick:()=>g(M=>!M),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(C,{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(Bo,{size:13,className:te("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(ts,{hint:a?.configured?"Saved; leave blank to keep":"Required",children:j.label}),l.jsx(ex,{value:h,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(M=>l.jsxs("div",{children:[l.jsx(ts,{hint:M.hint,children:M.label}),l.jsx("input",{value:x[M.key]??"",onChange:B=>b(D=>({...D,[M.key]:B.target.value})),placeholder:M.placeholder,spellCheck:!1,className:te(xr,"font-mono text-[10.5px]")})]},M.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:()=>{_()},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($t,{size:10}):l.jsx(sn,{size:10}),"Save"]})]})]})]})}function bI(){const e=Ae(a=>a.deployTools),i=Ae(a=>a.secretsError);return l.jsxs(l.Fragment,{children:[l.jsxs(Cn,{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(Gu).map(a=>l.jsx(xI,{providerId:a},a))})]}),l.jsxs(Cn,{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(Gu).map((a,r)=>{const o=e?.[a],u=Gu[a];return l.jsxs("div",{className:te("flex items-center gap-3 px-3 py-2.5",r!==0&&"border-t border-line"),children:[l.jsx(mg,{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:[o?.bin??"—"," ",o?.installed?`· ${o.version||"installed"}`:"· not installed, uses npx"]})]}),l.jsx("span",{className:te("shrink-0 rounded-full border px-1.5 py-0.5 text-[8.5px] font-medium",o?.installed?"border-success/25 text-success":"border-line text-faint"),children:o?.installed?"installed":"npx fallback"})]},a)})}),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(Qr,{size:12})," Open deploy panel"]})]})]})}function yI(){return l.jsx(Cn,{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(F8,{})})}function vI(){const e=Ae(),i=Ae(p=>p.update),a=me(p=>p.openSettings),r=me(p=>p.notify),o=wk(e.tools),u=[{id:"light",label:"Light",icon:pg},{id:"dark",label:"Dark",icon:dg},{id:"system",label:"System",icon:ug}],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:o,onChange:p=>i({tools:kk(e.tools,p.target.value)}),className:te("settings-select w-full sm:w-[210px]"),"aria-label":"Default permission mode",children:Cg.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 g=p.icon,x=e.theme===p.id;return l.jsxs("button",{type:"button",onClick:()=>i({theme:p.id}),className:te("flex flex-col items-center gap-1.5 rounded-xl border px-2 py-2.5 transition-colors",x?"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(g,{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:te("settings-select w-[84px] text-center"),"aria-label":"Conversation font size",children:Array.from({length:9},(p,g)=>g+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:te("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:te("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(vi,{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 mascot"}),l.jsx("p",{className:"settings-hint",children:"The pixel mascot on the home screen and above the message box. Off by default."})]}),l.jsx(vi,{checked:e.showMascot,onChange:p=>i({showMascot:p}),label:"Show mascot"})]}),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(vi,{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(bd,{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 wI(){const e=Ae(),i=Ae(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]"},...sE().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(Cn,{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 o=e.theme===r.id;return l.jsxs("button",{type:"button",onClick:()=>i({theme:r.id}),className:te("rounded-xl border p-2 text-left transition-all",o?"border-accent ring-2 ring-accent/10":"border-line hover:border-faint/50"),children:[l.jsxs("span",{className:te("block h-14 w-full overflow-hidden rounded-lg border border-line/60 p-2",r.className),children:[l.jsx("span",{className:te("block h-1.5 w-8 rounded-full",r.line)}),l.jsx("span",{className:te("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}),o&&l.jsx(sn,{size:11,className:"text-accent"})]})]},r.id)})})}),l.jsx(Cn,{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(vi,{checked:e.showTokenEstimate,onChange:r=>i({showTokenEstimate:r}),label:"Show token estimates"})]})}),l.jsx(Cn,{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,o])=>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:o})]},r))})})]})}function kI(){const e=Je(y=>y.sessions),i=Ae(y=>y.daemon),a=Ae(y=>y.secretStatus),r=qe(y=>y.entries),o=qe(y=>y.info),u=me(y=>y.askConfirm),d=me(y=>y.notify),p=I.useRef(null),[g,x]=I.useState(""),b=e.reduce((y,k)=>y+k.messages.length,0),h=r.filter(y=>y.type==="file").length,v=async(y,k)=>{if(await u({...k,tone:"danger",confirmLabel:k.label})){x(y);try{NM();const j=await lj(y);await nE(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{x("")}}};return l.jsxs(l.Fragment,{children:[l.jsxs(Cn,{title:"About",children:[l.jsxs("div",{className:"flex items-start gap-3.5",children:[l.jsx(pl,{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",o.available?String(h):"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(Cn,{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:o.root,children:o.available?o.root:"No folder open"})]})]}),l.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[l.jsxs("button",{type:"button",onClick:zw,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(hw,{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(Tw,{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&&(Bj(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:g==="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:[g==="history"?l.jsx($t,{size:12}):l.jsx(aa,{size:12})," Clear history"]})]}),l.jsxs("p",{className:"mt-3 flex items-center gap-2 text-[9.5px] text-faint",children:[l.jsx(bd,{size:11}),fl(new Blob([JSON.stringify(e)]).size)," of conversation history",l.jsx("span",{className:"text-line",children:"·"}),l.jsx(yd,{size:10}),"secrets encrypted at rest"]})]}),l.jsx(Cn,{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:g==="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:[g==="settings"?l.jsx($t,{size:11}):l.jsx(kw,{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:g==="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:[g==="all"?l.jsx($t,{size:11}):l.jsx(aa,{size:11})," Reset everything"]})]})]})})]})}function NI(){const e=rn(d=>d.servers),i=rn(d=>d.loaded),a=rn(d=>d.load),r=me(d=>d.setMcpOpen);I.useEffect(()=>{a()},[a]);const o=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(lg,{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.":`${o} 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 EI(){const e=me(b=>b.settingsOpen),i=me(b=>b.settingsTab),a=me(b=>b.closeSettings),r=me(b=>b.openSettings),o=me(b=>b.notify),u=Ae(b=>b.daemon),d=I.useRef(null),p=Math.max(0,yo.findIndex(b=>b.id===i)),g=yo[p];I.useEffect(()=>{e&&d.current?.scrollTo({top:0})},[e,i]);const x=async()=>{const b=u?.dataDir??"~/.opensol";try{await navigator.clipboard.writeText(b),o(`Copied the data folder path: ${b}`,"success")}catch{o(`Data folder: ${b}`,"info")}};return l.jsx(Rd,{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)`}}),yo.map((b,h)=>{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:te("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:te("w-4 font-mono text-[9.5px] tabular-nums transition-colors",y?"text-accent":"text-faint"),children:String(h+1).padStart(2,"0")}),l.jsx(v,{size:14,className:te("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(yd,{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:yo.map(b=>l.jsx("button",{type:"button",onClick:()=>r(b.id),disabled:b.disabled,className:te("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(yo.length).padStart(2,"0")]}),l.jsx("h3",{className:"mt-1 font-display text-[28px] font-semibold leading-none tracking-[-0.035em] text-ink",children:g.label}),l.jsx("p",{className:"mt-2 max-w-[560px] text-[12.5px] leading-relaxed text-muted",children:g.description})]},i),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[l.jsxs("button",{type:"button",onClick:()=>{x()},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(bd,{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(Bi,{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(vI,{}),i==="models"&&l.jsx(sI,{}),i==="tools"&&l.jsx(uI,{}),i==="search"&&l.jsx(fI,{}),i==="skills"&&l.jsx(gI,{}),i==="plugins"&&l.jsx(yI,{}),i==="mcp"&&l.jsx(NI,{}),i==="deploy"&&l.jsx(bI,{}),i==="appearance"&&l.jsx(wI,{}),i==="about"&&l.jsx(kI,{})]},i)})]})]})})}const oh=[{id:"cloudflare",label:"Cloudflare Pages",icon:uh,tint:"#f6821f",blurb:"Global edge, generous free tier",needs:"API token + account id"},{id:"netlify",label:"Netlify",icon:dl,tint:"#00c7b7",blurb:"Creates the site once, then reuses it",needs:"Personal access token"},{id:"vercel",label:"Vercel",icon:MC,tint:"#8b95a5",blurb:"Production deploy through the CLI",needs:"Access token"}],ch=[{id:"prepare",label:"Inspect",icon:lC},{id:"build",label:"Build",icon:yw},{id:"publish",label:"Publish",icon:L2}],Du="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 vo({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 zu={prepare:"idle",build:"idle",publish:"idle"};function SI(){const e=me(P=>P.deployOpen),i=me(P=>P.setDeployOpen),a=me(P=>P.openSettings),r=me(P=>P.notify),o=qe(P=>P.root),u=qe(P=>P.info.name),d=qe(P=>P.info.available),p=Ae(P=>P.deployTools),g=Ae(P=>P.deploySecrets),[x,b]=I.useState("cloudflare"),[h,v]=I.useState(""),[y,k]=I.useState(""),[S,j]=I.useState(""),[_,A]=I.useState(""),[C,M]=I.useState(null),[B,D]=I.useState(""),[N,z]=I.useState(!1),[q,R]=I.useState(zu),[G,Z]=I.useState([]),[fe,le]=I.useState(null),[J,O]=I.useState(""),[re,ie]=I.useState(!1),ne=I.useRef(null),E=I.useRef(null),pe=I.useRef(0),_e=I.useRef(null),L=oh.find(P=>P.id===x)??oh[0],$=p?.[x],oe=!!g?.[x]?.configured;I.useEffect(()=>{e&&(v(o),le(null),O(""),Z([]),z(!1),ie(!1),R(zu))},[e,o]),I.useEffect(()=>{if(!e||!h.trim()){M(null),D("");return}let P=!1;const X=window.setTimeout(()=>{Mj(h.trim()).then(ye=>{P||(M(ye),D(""))}).catch(ye=>{P||(M(null),D(ye instanceof Error?ye.message:"Could not read that folder."))})},350);return()=>{P=!0,window.clearTimeout(X)}},[e,h]),I.useEffect(()=>{const P=E.current;P&&(P.scrollTop=P.scrollHeight)},[G]),I.useEffect(()=>()=>ne.current?.abort(),[]);const xe=(P,X)=>{const ye=X.trimEnd();if(!ye)return;pe.current+=1;const je=pe.current;Z(Me=>[...Me.slice(-600),{id:je,stream:P,text:ye}])},Te=P=>{const X=P==="prepare"||P==="publish"?P:"build";R(ye=>{const je={...ye};for(const Me of ch)Me.id===X?je[Me.id]="active":je[Me.id]==="active"&&(je[Me.id]="done");return X==="publish"&&je.build==="idle"&&(je.build="done"),je}),_e.current=X},$e=()=>{ne.current?.abort(),i(!1)},He=async()=>{if(N)return;if(!h.trim()){O("Choose the project folder to deploy.");return}z(!0),le(null),O(""),Z([]),R({...zu,prepare:"active"}),_e.current="prepare";const P=new AbortController;ne.current=P,xe("meta",`Deploying ${h.trim()} to ${L.label}`);let X=!1;try{for await(const ye of Sj({provider:x,path:h.trim(),outputDir:y.trim()||void 0,buildCommand:S.trim()||void 0,projectName:_.trim()||void 0},P.signal))if(ye.type==="step")Te(ye.id);else if(ye.type==="log")xe(ye.stream,ye.text);else if(ye.type==="done"){le(ye.result),R({prepare:"done",build:"done",publish:"done"}),xe("meta",`Live at ${ye.result.url}`);break}else if(ye.type==="error"){X=!0,O(ye.message),xe("stderr",ye.message);break}}catch(ye){if(ye instanceof DOMException&&ye.name==="AbortError")xe("meta","Deployment stopped."),R(zu);else{X=!0;const je=ye instanceof Error?ye.message:"The deployment failed.";O(je),xe("stderr",je)}}finally{if(X&&_e.current){const ye=_e.current;R(je=>({...je,[ye]:"error"}))}ne.current=null,z(!1)}},Be=async()=>{if(fe?.url)try{await navigator.clipboard.writeText(fe.url),ie(!0),window.setTimeout(()=>ie(!1),1600)}catch{r("Clipboard access was blocked by the browser.","error")}},Ee=h.trim().split(/[\\/]/).filter(Boolean).pop()??"";return l.jsxs(Rd,{open:e,onClose:$e,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(Qr,{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:$e,"aria-label":"Close deploy panel",children:l.jsx(Bi,{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(vo,{label:"Host",children:[l.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:oh.map(P=>{const X=P.icon,ye=x===P.id,je=g?.[P.id]?.configured;return l.jsxs("button",{type:"button",onClick:()=>b(P.id),disabled:N,"aria-pressed":ye,className:te("relative flex flex-col items-start gap-2 rounded-xl border p-2.5 text-left transition-all disabled:opacity-60",ye?"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:P.tint},children:l.jsx(X,{size:14})}),l.jsx("span",{className:"text-[11.5px] font-medium leading-tight text-ink",children:P.label}),l.jsx("span",{className:te("absolute right-2 top-2 h-1.5 w-1.5 rounded-full",je?"bg-success":"bg-warning"),title:je?"Credentials saved":"Needs credentials"})]},P.id)})}),l.jsx("p",{className:"mt-1.5 text-[10px] text-faint",children:L.blurb})]}),!oe&&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(Wr,{size:12,className:"mt-0.5 shrink-0 text-warning"}),L.label," needs ",L.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 ",L.label," credentials"]})]}),l.jsxs(vo,{label:"Project folder",children:[l.jsx("input",{value:h,onChange:P=>v(P.target.value),disabled:N,placeholder:"/absolute/path/to/project or ~/Projects/site",spellCheck:!1,className:Du,"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&&h!==o&&l.jsxs("button",{type:"button",onClick:()=>v(o),disabled:N,className:"inline-flex shrink-0 items-center gap-1 text-[10px] font-medium text-accent disabled:opacity-40",children:[l.jsx(gr,{size:10})," Use workspace"]})]}),C&&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(Xh,{name:C.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:[C.framework||"Folder",C.packageManager&&l.jsx("span",{className:"ml-1.5 font-normal text-faint",children:C.packageManager})]}),l.jsxs("p",{className:"text-muted",children:[C.buildCommand?l.jsxs(l.Fragment,{children:["build ",l.jsx("code",{className:"font-mono text-ink",children:C.buildCommand})]}):"no build step"," → ",C.outputDir?l.jsx("code",{className:"font-mono text-ink",children:C.outputDir}):C.expectedOutputDir?l.jsxs(l.Fragment,{children:[l.jsx("code",{className:"font-mono text-ink",children:C.expectedOutputDir})," ",l.jsx("span",{className:"text-faint",children:"(after build)"})]}):l.jsx("span",{className:"text-warning",children:"no output folder found"})]})]})]}),B&&l.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[10.5px] leading-relaxed text-danger",children:[l.jsx(Lu,{size:11,className:"mt-0.5 shrink-0"}),B]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[l.jsx(vo,{label:"Output folder",hint:"auto",children:l.jsx("input",{value:y,onChange:P=>k(P.target.value),disabled:N,placeholder:C?.outputDir||C?.expectedOutputDir||"auto",spellCheck:!1,className:Du,"aria-label":"Output folder"})}),l.jsx(vo,{label:"Project name",hint:"auto",children:l.jsx("input",{value:_,onChange:P=>A(P.target.value),disabled:N,placeholder:C?.name||"my-site",spellCheck:!1,className:Du,"aria-label":"Project name"})})]}),l.jsxs(vo,{label:"Build command",hint:"auto when the output folder is missing",children:[l.jsx("input",{value:S,onChange:P=>j(P.target.value),disabled:N,placeholder:C?.buildCommand||"npm run build",spellCheck:!1,className:Du,"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(P=>l.jsx("button",{type:"button",onClick:()=>j(P),disabled:N,className:"rounded-md border border-line px-1.5 py-0.5 text-[9.5px] text-faint transition-colors hover:text-ink",children:P},P)),(S||y)&&l.jsx("button",{type:"button",onClick:()=>{j(""),k("")},disabled:N,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(mg,{size:11,className:"mt-0.5 shrink-0"}),$?.installed?`${$.label}${$.version?` ${$.version}`:""} found on this machine.`:`${$?.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:ch.map((P,X)=>{const ye=q[P.id],je=P.icon;return l.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsxs("span",{className:te("flex h-7 items-center gap-1.5 rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",ye==="active"&&"border-accent/40 bg-accent-soft text-accent",ye==="done"&&"border-success/30 bg-success/10 text-success",ye==="error"&&"border-danger/30 bg-danger/10 text-danger",ye==="idle"&&"border-line text-faint"),children:[ye==="active"?l.jsx($t,{size:11}):ye==="done"?l.jsx(sn,{size:11}):ye==="error"?l.jsx(Lu,{size:11}):l.jsx(je,{size:11}),l.jsx("span",{className:"hidden sm:inline",children:P.label})]}),X<ch.length-1&&l.jsx("span",{className:te("h-px w-4 shrink-0",ye==="done"?"bg-success/40":"bg-line")})]},P.id)})}),N?l.jsxs("button",{type:"button",onClick:()=>ne.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(fg,{size:9,fill:"currentColor"})," Stop"]}):l.jsxs("button",{type:"button",onClick:()=>{He()},disabled:!oe||!h.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(XT,{size:10,fill:"currentColor"}),fe||J?"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(sn,{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 ",L.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:Be,className:"icon-button h-8 w-8",title:"Copy URL","aria-label":"Copy URL",children:re?l.jsx(sn,{size:13,className:"text-success"}):l.jsx(xd,{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(ig,{size:13})})]})}),J&&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(Lu,{size:13,className:"mt-0.5 shrink-0"}),J]}),l.jsx("div",{ref:E,className:"thin-scroll min-h-0 flex-1 overflow-y-auto bg-canvas/40 px-4 py-3",children:G.length===0&&!N?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(UT,{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:[G.map(P=>l.jsxs("span",{className:te("block",P.stream==="stderr"&&"text-danger",P.stream==="meta"&&"font-medium text-accent"),children:[P.stream==="meta"?"› ":"",P.text]},P.id)),N&&l.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-accent",children:[l.jsx($t,{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(Wr,{size:10}),"Tokens encrypted at rest",l.jsx("span",{className:"ml-auto truncate",children:Ee||"No folder"})]})]})]})]})}const Wh={name:"",transport:"stdio",command:"",args:"",env:"",url:"",headers:"",oauth:!1,clientId:"",clientSecret:"",scope:""},_I=[{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 TI(e){const i=[],a=/"([^"]*)"|'([^']*)'|(\S+)/g;let r;for(;r=a.exec(e);)i.push(r[1]??r[2]??r[3]);return i}function CI(e=[]){return e.map(i=>/\s/.test(i)?`"${i}"`:i).join(" ")}function sw(e,i){const a={};for(const r of e.split(`
261
+ `)){const o=r.indexOf(i);o<1||(a[r.slice(0,o).trim()]=r.slice(o+1).trim())}return a}function lw(e,i){return Object.entries(e??{}).map(([a,r])=>`${a}${i===":"?": ":i}${r}`).join(`
262
+ `)}function lE(e){return{id:e.id,name:e.name,transport:e.transport,command:e.command??"",args:CI(e.args),env:lw(e.env,"="),url:e.url??"",headers:lw(e.headers,":"),oauth:!!e.oauth?.enabled,clientId:e.oauth?.clientId??"",clientSecret:e.oauth?.clientSecret??"",scope:e.oauth?.scope??""}}function ow(e){return e.name.trim()?e.transport==="stdio"?!!e.command.trim():/^https?:\/\//i.test(e.url.trim()):!1}function oE(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:TI(e.args),env:sw(e.env,"=")}:{...a,url:e.url.trim(),headers:sw(e.headers,":"),oauth:e.oauth?{enabled:!0,clientId:e.clientId.trim(),clientSecret:e.clientSecret.trim(),scope:e.scope.trim()}:null}}function Zs(e){return oE(lE(e),e)}const nl=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),cw=e=>{const i={};if(nl(e))for(const[a,r]of Object.entries(e))(typeof r=="string"||typeof r=="number")&&(i[a]=String(r));return i};function jI(e,i){const a=i.disabled!==!0,r=[i.url,i.serverUrl,i.httpUrl].find(o=>typeof o=="string");if(r){const o=String(i.type??i.transport??"").toLowerCase(),u=o.includes("sse")||!o&&/\/sse\/?$/i.test(r)?"sse":"http",d=cw(i.headers),p=Object.keys(d).some(g=>g.toLowerCase()==="authorization");return{name:e,transport:u,enabled:a,url:r,headers:d,oauth:p?null:{enabled:!0}}}if(typeof i.command=="string"&&i.command.trim()){const o=Array.isArray(i.args)?i.args.filter(u=>typeof u=="string"):[];return{name:e,transport:"stdio",enabled:a,command:i.command,args:o,env:cw(i.env)}}return null}const uw=e=>nl(e)&&(typeof e.command=="string"||typeof e.url=="string"||typeof e.serverUrl=="string"||typeof e.httpUrl=="string");function AI(e){let i;try{i=JSON.parse(e)}catch{throw new Error("That is not valid JSON.")}if(!nl(i))throw new Error("Expected a JSON object.");let a=null;for(const u of[i.mcpServers,i.servers,nl(i.mcp)?i.mcp.servers:void 0])if(nl(u)){a=u;break}if(a||(uw(i)?a={Imported:i}:Object.values(i).length>0&&Object.values(i).every(uw)&&(a=i)),!a)throw new Error('No MCP servers found. Expect {"mcpServers": {"name": {"command": …} or {"url": …}}}.');const r=[],o=[];for(const[u,d]of Object.entries(a)){const p=nl(d)?jI(u.slice(0,60),d):null;p?r.push(p):o.push(u)}if(r.length===0)throw new Error('None of those entries has a "command" or a "url".');return{servers:r,skipped:o}}const ja="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",Jh=ja.replace("h-9 ",""),eg=[{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"}],OI={stdio:"stdio",http:"HTTP",sse:"SSE"};function tx({transport:e,size:i=13}){const a=e==="stdio"?mg:e==="sse"?JT:hT;return l.jsx(a,{size:i,strokeWidth:1.7})}function cE({status:e}){return l.jsx("span",{className:te("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 uE(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 MI(){const e=me(O=>O.mcpOpen),i=me(O=>O.setMcpOpen),a=me(O=>O.notify),r=me(O=>O.askConfirm),o=rn(O=>O.servers),u=rn(O=>O.loaded),d=rn(O=>O.error),p=rn(O=>O.load),g=rn(O=>O.save),x=rn(O=>O.act),b=rn(O=>O.authorize),h=rn(O=>O.logout),[v,y]=I.useState(null),[k,S]=I.useState(!1),[j,_]=I.useState(!1),[A,C]=I.useState(null);I.useEffect(()=>{e?p():(y(null),S(!1))},[e,p]);const M=I.useMemo(()=>v&&!(v.kind==="server"&&!o.some(O=>O.id===v.id))?v:o[0]?{kind:"server",id:o[0].id}:{kind:"new",draft:{...Wh}},[v,o]),B=M.kind==="server"?o.find(O=>O.id===M.id):void 0,D=()=>i(!1),N=O=>{y(O),S(!0)},z=async(O,re)=>{_(!0);try{return await g(O),re&&a(re,"success"),!0}catch(ie){return a(ie instanceof Error?ie.message:"Could not save MCP servers.","error"),!1}finally{_(!1)}},q=(O,re)=>z(o.map(ie=>ie.id===O?{...Zs(ie),...re}:Zs(ie))),R=async(O,re)=>{const ie=new Set(o.map(L=>L.id)),ne=oE(O,o.find(L=>L.id===O.id)),E=re?[...o.map(Zs),ne]:o.map(L=>L.id===O.id?ne:Zs(L));if(!await z(E,re?`Added ${ne.name}. Connecting…`:`Saved ${ne.name}.`))return;const pe=rn.getState().servers.find(L=>!ie.has(L.id)),_e=re?pe?.id:O.id;_e&&y({kind:"server",id:_e})},G=async O=>{const re=new Set(o.map(E=>E.id));if(!await z([...o.map(Zs),...O],`Imported ${O.length} server${O.length===1?"":"s"}.`))return;const ne=rn.getState().servers.find(E=>!re.has(E.id));y(ne?{kind:"server",id:ne.id}:null)},Z=async O=>{await r({title:`Remove ${O.name}?`,body:"The server is disconnected, its saved sign-in is deleted and its tools disappear from the agent.",confirmLabel:"Remove server",tone:"danger"})&&await z(o.filter(ie=>ie.id!==O.id).map(Zs),`Removed ${O.name}.`)&&(y(null),S(!1))},fe=async O=>{C(O.id);try{await b(O.id),a(`Finish signing in to ${O.name} in the new window.`,"info")}catch(re){a(re instanceof Error?re.message:"Could not start sign-in.","error")}finally{C(null)}},le=o.filter(O=>O.status==="connected").length,J=o.reduce((O,re)=>O+(re.status==="connected"?re.tools.length-re.disabledTools.length:0),0);return l.jsxs(Rd,{open:e,onClose:D,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:o.length===0?"Give the agent new tools from local programs or remote services.":`${le} of ${o.length} connected · ${J} tool${J===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:()=>N({kind:"import"}),children:[l.jsx(h0,{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:()=>N({kind:"new",draft:{...Wh}}),children:[l.jsx(br,{size:13})," Add server"]}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8 rounded-full",onClick:D,"aria-label":"Close MCP panel",children:l.jsx(Bi,{size:16})})]})]}),l.jsxs("div",{className:"flex min-h-0 flex-1",children:[l.jsxs("aside",{className:te("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($t,{size:12})," Loading servers…"]}),u&&o.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:o.map(O=>{const re=M.kind==="server"&&M.id===O.id;return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>N({kind:"server",id:O.id}),className:te("flex w-full items-center gap-3 rounded-2xl border px-3 py-2.5 text-left transition-all",re?"border-line bg-panel shadow-pill":"border-transparent hover:bg-raised/70"),children:[l.jsx(cE,{status:O.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:O.name}),O.oauth?.enabled&&l.jsx($o,{size:11,className:te("shrink-0",O.oauth.authorized?"text-success":"text-warning"),"aria-label":"OAuth"})]}),l.jsx("span",{className:te("mt-0.5 block truncate text-[11px]",O.status==="needs_auth"?"text-warning":O.status==="error"?"text-danger":"text-muted"),children:uE(O)})]}),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(tx,{transport:O.transport,size:10}),OI[O.transport]]})]})},O.id)})}),l.jsxs("button",{type:"button",className:"chip mt-3 h-8 w-full justify-center rounded-xl text-[11.5px] sm:hidden",onClick:()=>N({kind:"import"}),children:[l.jsx(h0,{size:13})," Import JSON"]})]}),l.jsxs("section",{className:te("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(_2,{size:15})," All servers"]}),l.jsx("div",{className:"thin-scroll min-h-0 flex-1 overflow-y-auto",children:u?M.kind==="new"?l.jsx(dw,{title:"New MCP server",initial:M.draft,busy:j,presets:!0,submitLabel:"Save and connect",onCancel:o.length>0?()=>y(null):void 0,onSubmit:O=>{R(O,!0)}},`new-${JSON.stringify(M.draft)}`):M.kind==="edit"?l.jsx(dw,{title:`Edit ${M.draft.name}`,initial:M.draft,busy:j,submitLabel:"Save changes",onCancel:()=>y({kind:"server",id:M.draft.id??""}),onSubmit:O=>{R(O,!1)}},`edit-${M.draft.id}`):M.kind==="import"?l.jsx(DI,{busy:j,onCancel:()=>y(null),onImport:O=>{G(O)}}):B?l.jsx(RI,{server:B,signingIn:A===B.id,onEdit:()=>N({kind:"edit",draft:lE(B)}),onPatch:O=>{q(B.id,O)},onAct:O=>{x(B.id,O)},onAuthorize:()=>{fe(B)},onSignOut:()=>{h(B.id).catch(O=>a(O instanceof Error?O.message:"Could not sign out.","error"))},onRemove:()=>{Z(B)}}):null:null})]})]})]})}function RI({server:e,signingIn:i,onEdit:a,onPatch:r,onAct:o,onAuthorize:u,onSignOut:d,onRemove:p}){const[g,x]=I.useState(""),b=e.status==="connected"||e.status==="connecting",h=e.tools.filter(y=>!g.trim()||`${y.name} ${y.description}`.toLowerCase().includes(g.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(cE,{status:e.status}),l.jsx("span",{className:"truncate",children:e.name})]}),l.jsx("p",{className:te("mt-1 text-[12px]",e.status==="error"?"text-danger":e.status==="needs_auth"?"text-warning":"text-muted"),children:uE(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:()=>o("refresh"),children:l.jsx(Li,{size:14,className:te(e.status==="connecting"&&"animate-spin")})}),l.jsx("button",{type:"button",className:"icon-button h-8 w-8",title:"Disconnect","aria-label":"Disconnect",onClick:()=>o("disconnect"),children:l.jsx(DC,{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:()=>o("connect"),children:[l.jsx(wd,{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(Po,{size:14})}),l.jsx(vi,{checked:e.enabled,onChange:y=>r({enabled:y}),label:`Enable ${e.name}`})]})]}),e.oauth?.enabled&&l.jsxs("div",{className:te("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:te("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(Wr,{size:17}):l.jsx($o,{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(TT,{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($t,{size:12}):l.jsx(ig,{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(tx,{transport:e.transport})," ",eg.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(Dd,{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(is,{size:13,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-faint"}),l.jsx("input",{className:te(ja,"pl-8"),placeholder:"Filter tools",value:g,onChange:y=>x(y.target.value)})]}),l.jsxs("ul",{className:"divide-y divide-line rounded-xl border border-line",children:[h.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(Oo,{size:12,className:te("shrink-0",k?"text-faint":"text-accent")}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:te("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(vi,{checked:!k,label:`Enable ${y.name}`,onChange:S=>r({disabledTools:S?e.disabledTools.filter(j=>j!==y.name):[...e.disabledTools,y.name]})})]},y.name)}),h.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(aa,{size:12})," Remove server"]})})]})}function dw({title:e,initial:i,busy:a,presets:r=!1,submitLabel:o,onCancel:u,onSubmit:d}){const[p,g]=I.useState(i),[x,b]=I.useState(!!(i.clientId||i.scope)),h=p.transport!=="stdio",v=y=>g(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(),ow(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:_I.map(y=>l.jsxs("button",{type:"button",onClick:()=>g({...Wh,...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:ja,placeholder:"Name (e.g. GitHub)",value:p.name,onChange:y=>v({name:y.target.value})}),l.jsxs("div",{children:[l.jsx(Dd,{options:eg.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:eg.find(y=>y.value===p.transport)?.hint})]})]}),h?l.jsxs(l.Fragment,{children:[l.jsx("input",{className:te(ja,"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($o,{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(vi,{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:[x?"Hide":"Show"," advanced client settings"]}),x&&l.jsxs("div",{className:"mt-2.5 grid gap-2.5 sm:grid-cols-2",children:[l.jsx("input",{className:te(ja,"font-mono"),placeholder:"Client ID (optional)",value:p.clientId,onChange:y=>v({clientId:y.target.value})}),l.jsx("input",{className:te(ja,"font-mono"),type:"password",autoComplete:"off",placeholder:"Client secret (optional)",value:p.clientSecret,onChange:y=>v({clientSecret:y.target.value})}),l.jsx("input",{className:te(ja,"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:te(Jh,"h-20 resize-none py-2 font-mono"),placeholder:`Headers, one per line (API keys, bearer tokens)
263
+ 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:te(ja,"font-mono"),placeholder:"command",value:p.command,onChange:y=>v({command:y.target.value})}),l.jsx("input",{className:te(ja,"font-mono"),placeholder:"arguments",value:p.args,onChange:y=>v({args:y.target.value})})]}),l.jsx("textarea",{className:te(Jh,"h-20 resize-none py-2 font-mono"),placeholder:`Environment, one per line
264
+ 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||!ow(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($t,{size:11})," ",o]})]})]})}function DI({busy:e,onCancel:i,onImport:a}){const[r,o]=I.useState(""),u=I.useMemo(()=>{if(!r.trim())return null;try{return{...AI(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:te(Jh,"h-48 resize-none py-2.5 font-mono text-[11.5px]"),placeholder:`{
265
+ "mcpServers": {
266
+ "github": { "url": "https://api.githubcopilot.com/mcp/" },
267
+ "files": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] }
268
+ }
269
+ }`,value:r,onChange:d=>o(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(tx,{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($t,{size:11})," Import ",u&&u.servers.length>0?`${u.servers.length} server${u.servers.length===1?"":"s"}`:""]})]})]})}function zI(){const e=me(C=>C.paletteOpen),i=me(C=>C.setPaletteOpen),a=me(C=>C.openSettings),r=me(C=>C.setMcpOpen),o=me(C=>C.setWorkspaceOpen),u=me(C=>C.setDeployOpen),d=me(C=>C.focusComposer),p=me(C=>C.notify),g=Je(C=>C.sessions),x=qe(C=>C.entries),[b,h]=I.useState(""),[v,y]=I.useState(0),k=I.useRef(null),S=I.useRef(null);I.useEffect(()=>{if(!e)return;h(""),y(0),S.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const C=document.body.style.overflow;document.body.style.overflow="hidden";const M=window.setTimeout(()=>k.current?.focus(),30);return()=>{window.clearTimeout(M),document.body.style.overflow=C,S.current?.focus()}},[e]);const j=I.useMemo(()=>{const C=document.documentElement.classList.contains("dark"),M=()=>i(!1),B=[{id:"action-new-chat",label:"New chat",hint:"Start a clean conversation",group:"Actions",icon:br,action:()=>{Je.getState().newChat(),d(),M()}},{id:"action-workspace",label:"Toggle workspace panel",hint:"Browse and edit files in the open folder",group:"Actions",icon:gr,action:()=>{o(!me.getState().workspaceOpen),M()}},{id:"action-deploy",label:"Deploy a page",hint:"Cloudflare Pages, Netlify or Vercel",group:"Actions",icon:Qr,action:()=>{u(!0),M()}},{id:"action-theme",label:C?"Switch to light theme":"Switch to dark theme",group:"Actions",icon:C?pg:dg,action:()=>{Ae.getState().update({theme:C?"light":"dark"}),M()}},{id:"action-models",label:"Model settings",hint:"Providers, encrypted keys and reasoning",group:"Settings",icon:Yu,action:()=>{a("models"),M()}},{id:"action-tools",label:"Tool permissions",hint:"Approval and enablement",group:"Settings",icon:Oo,action:()=>{a("tools"),M()}},{id:"action-search",label:"Search settings",hint:"Tavily, Brave, Serper, DuckDuckGo",group:"Settings",icon:dl,action:()=>{a("search"),M()}},{id:"action-mcp",label:"MCP servers",hint:"Connections, OAuth sign-in and tools",group:"Settings",icon:wd,action:()=>{M(),r(!0)}},{id:"action-skills",label:"Skills",hint:"Load and manage reusable instructions",group:"Settings",icon:oi,action:()=>{a("skills"),M()}},{id:"action-deploy-settings",label:"Hosting credentials",hint:"Cloudflare, Netlify and Vercel tokens",group:"Settings",icon:Qr,action:()=>{a("deploy"),M()}},{id:"action-appearance",label:"Appearance",hint:"Theme and token estimates",group:"Settings",icon:ww,action:()=>{a("appearance"),M()}},{id:"action-about",label:"About OpenSol",hint:"Local storage and reset controls",group:"Settings",icon:sg,action:()=>{a("about"),M()}},{id:"action-export",label:"Export conversations",hint:"Download a JSON history file",group:"Actions",icon:hw,action:()=>{zw(),p("Conversation history exported.","success"),M()}}],D=[...g].sort((z,q)=>q.updatedAt-z.updatedAt).map(z=>({id:`chat-${z.id}`,label:z.title,hint:`${z.messages.length} messages · ${rd(z.updatedAt)}`,group:"Conversations",icon:cg,keywords:z.messages.filter(q=>q.role==="user").map(q=>q.content).join(" ").slice(0,1e3),action:()=>{Je.getState().setActive(z.id),M()}})),N=x.filter(z=>z.type==="file").slice(0,1500).map(z=>({id:`file-${z.path}`,label:z.name,hint:z.path,group:"Workspace files",icon:ns,keywords:z.path,action:()=>{qe.getState().setActiveFile(z.path),o(!0),M()}}));return[...B,...D,...N]},[g,x,d,p,a,r,i,o,u]),_=I.useMemo(()=>{const C=b.trim().toLowerCase(),M=C?40:18;if(!C){const B=new Set([...g].sort((D,N)=>N.updatedAt-D.updatedAt).slice(0,2).map(D=>`chat-${D.id}`));return j.filter(D=>D.group!=="Conversations"||B.has(D.id)).filter((D,N,z)=>z.findIndex(q=>q.id===D.id)===N).slice(0,M)}return j.filter(B=>`${B.label} ${B.hint??""} ${B.keywords??""} ${B.group}`.toLowerCase().includes(C)).slice(0,M)},[j,b,g]);if(I.useEffect(()=>{y(0)},[b]),I.useEffect(()=>{if(!e)return;document.querySelector(`[data-palette-index="${v}"]`)?.scrollIntoView({block:"nearest"})},[v,e]),I.useEffect(()=>{v>_.length-1&&y(Math.max(0,_.length-1))},[_.length,v]),!e)return null;const A=C=>{const M=_[C];M&&M.action()};return ml.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(is,{size:15,className:"shrink-0 text-faint"}),l.jsx("input",{ref:k,value:b,onChange:C=>h(C.target.value),onKeyDown:C=>{C.key==="ArrowDown"?(C.preventDefault(),_.length>0&&y(M=>Math.min(M+1,_.length-1))):C.key==="ArrowUp"?(C.preventDefault(),y(M=>Math.max(M-1,0))):C.key==="Enter"?(C.preventDefault(),A(v)):C.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":_[v]?`palette-${_[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:[_.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”."})]}),_.map((C,M)=>{const B=C.icon,D=M===0||_[M-1].group!==C.group;return l.jsxs(I.Fragment,{children:[D&&l.jsx("p",{className:"px-2 pb-1 pt-2 text-[9.5px] font-medium uppercase tracking-[0.08em] text-faint",children:C.group}),l.jsxs("button",{type:"button",id:`palette-${C.id}`,"data-palette-index":M,role:"option","aria-selected":v===M,onMouseMove:()=>y(M),onClick:()=>A(M),className:te("flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors",v===M?"bg-raised":"hover:bg-raised/60"),children:[l.jsx("span",{className:te("flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-line bg-panel",v===M?"text-accent":"text-muted"),children:l.jsx(B,{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:C.label}),C.hint&&l.jsx("span",{className:"mt-0.5 block truncate text-[9.5px] text-faint",children:C.hint})]}),l.jsx(d2,{size:11,className:te("shrink-0 text-faint transition-opacity",v===M?"opacity-100":"opacity-0")})]})]},C.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 fw=["Waking the local daemon","Unlocking your keys","Loading workspace","Almost there"],LI=["M32 7v8","M32 49v8","M7 32h8","M49 32h8"],II=["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 UI({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:[LI.map((i,a)=>l.jsx("path",{d:i,className:"ray",pathLength:8,style:{animationDelay:`${.35+a*.07}s`}},i)),II.map((i,a)=>l.jsx("path",{d:i,className:"ray",pathLength:8,opacity:.55,style:{animationDelay:`${.65+a*.07}s`}},i))]})]})]})}function BI({phase:e,error:i,leaving:a,onRetry:r}){const[o,u]=I.useState(0);return I.useEffect(()=>{if(e==="error")return;const d=window.setInterval(()=>u(p=>Math.min(fw.length-1,p+1)),650);return()=>window.clearInterval(d)},[e]),l.jsxs("div",{className:te("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(UI,{}),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(gd,{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(Li,{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:[fw[o],"…"]},o)]}),l.jsx("div",{className:"mt-12 animate-fade [animation-delay:1.2s]",children:l.jsx(jM,{})})]})]})}const $I=1600;function PI(){const e=Mu(h=>h.phase),i=Mu(h=>h.error),a=Mu(h=>h.boot),r=Ae(h=>h.theme),o=Ae(h=>h.chatFontSize),u=me(h=>h.mobileSidebarOpen),d=me(h=>h.setMobileSidebarOpen),p=me(h=>h.setPaletteOpen);DA();const[g,x]=I.useState("show");I.useEffect(()=>{if(e!=="ready"||g!=="show")return;const h=Mu.getState().startedAt||Date.now(),v=Math.max(0,$I-(Date.now()-h)),y=window.setTimeout(()=>x("leaving"),v);return()=>window.clearTimeout(y)},[e,g]),I.useEffect(()=>{if(g!=="leaving")return;const h=window.setTimeout(()=>x("gone"),520);return()=>window.clearTimeout(h)},[g]),I.useEffect(()=>{a()},[a]),I.useEffect(()=>{e==="ready"&&Cw().then(h=>tI(h.plugins)).catch(()=>{})},[e]),I.useEffect(()=>{const h=document.documentElement,v=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{const k=qw(r,v.matches);h.dataset.theme=k,h.classList.toggle("dark",mh(r,v.matches)),document.querySelector('meta[name="theme-color"]')?.setAttribute("content",mh(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]),I.useEffect(()=>{document.documentElement.style.setProperty("--chat-font-size",`${o}px`)},[o]),I.useEffect(()=>{const h=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",h),()=>window.removeEventListener("keydown",h)},[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(OM,{}),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(i8,{}),l.jsx(h8,{})]}),l.jsx(EI,{}),l.jsx(MI,{}),l.jsx(SI,{}),l.jsx(zI,{}),l.jsx(qM,{})]}),l.jsx(FM,{}),g!=="gone"&&l.jsx(BI,{phase:e,error:i,leaving:g==="leaving",onRetry:()=>{a(!0)}})]})}class HI extends I.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}
270
+
271
+ ${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(pl,{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 dE=document.getElementById("root");if(!dE)throw new Error("Root element not found.");W_.createRoot(dE).render(l.jsx(I.StrictMode,{children:l.jsx(HI,{children:l.jsx(PI,{})})}));