remote-codex 0.1.10 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/supervisor-api/dist/chunk-6M32PPHZ.js +24507 -0
- package/apps/supervisor-api/dist/chunk-7AA2MFXK.js +24499 -0
- package/apps/supervisor-api/dist/chunk-HKBFCPHH.js +24511 -0
- package/apps/supervisor-api/dist/index.js +12525 -28436
- package/apps/supervisor-api/dist/worker-index.d.ts +2 -0
- package/apps/supervisor-api/dist/worker-index.js +33 -0
- package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-CyMcatlD.js → highlighted-body-OFNGDK62-p31aS0f0.js} +1 -1
- package/apps/supervisor-web/dist/assets/index-BiuFei_K.css +32 -0
- package/apps/supervisor-web/dist/assets/index-D1R9CUnx.js +2161 -0
- package/apps/supervisor-web/dist/assets/{xterm-DbYWMNQ0.js → xterm-D92BViLH.js} +1 -1
- package/apps/supervisor-web/dist/index.html +2 -2
- package/package.json +2 -3
- package/packages/agent-runtime/src/index.ts +4 -0
- package/packages/agent-runtime/src/management-errors.ts +11 -0
- package/packages/agent-runtime/src/model-pricing.ts +325 -0
- package/packages/agent-runtime/src/registry.ts +19 -4
- package/packages/agent-runtime/src/runtime-errors.ts +97 -0
- package/packages/agent-runtime/src/types.ts +36 -3
- package/packages/agent-runtime/src/unavailable-runtime.ts +169 -0
- package/packages/claude/src/historyItems.ts +41 -5
- package/packages/claude/src/runtimeAdapter.test.ts +117 -6
- package/packages/claude/src/runtimeAdapter.ts +421 -65
- package/packages/codex/src/historyItems.test.ts +137 -0
- package/packages/codex/src/historyItems.ts +135 -17
- package/packages/codex/src/hookHistory.test.ts +59 -0
- package/packages/codex/src/index.ts +7 -0
- package/packages/codex/src/local-session-store.ts +390 -0
- package/packages/codex/src/management/codex-management-service.ts +454 -0
- package/packages/codex/src/management/codexHostConfig.test.ts +88 -0
- package/packages/codex/src/management/codexHostConfig.ts +188 -0
- package/packages/codex/src/management/errors.ts +20 -0
- package/packages/codex/src/modelPricing.test.ts +235 -0
- package/packages/codex/src/modelPricing.ts +9 -0
- package/packages/codex/src/runtime-errors.test.ts +72 -0
- package/packages/codex/src/runtime-errors.ts +37 -0
- package/packages/codex/src/runtimeAdapter.ts +15 -0
- package/packages/codex/src/thread-title.ts +1 -0
- package/packages/opencode/src/historyItems.test.ts +504 -0
- package/packages/opencode/src/historyItems.ts +896 -0
- package/packages/opencode/src/index.ts +2 -0
- package/packages/opencode/src/runtimeAdapter.test.ts +1444 -0
- package/packages/opencode/src/runtimeAdapter.ts +1473 -0
- package/packages/shared/src/agent-providers.ts +56 -0
- package/packages/shared/src/index.ts +240 -35
- package/apps/supervisor-web/dist/assets/index-BlAhoIuq.js +0 -379
- package/apps/supervisor-web/dist/assets/index-DI0NRNgr.css +0 -32
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-B12qg9BL.js","assets/ruby-Dw2BHqvy.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-Cw27pwNe.js","assets/perl-C0TMdlhV.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-DYVedYrR.js","assets/marko-CnJfTvn9.js","assets/less-B1dDrJ26.js","assets/mdc-BMNejdWA.js","assets/nextflow-Zz6hmt5N.js","assets/nextflow-groovy-BeH2EWoN.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-BrH8l1NY.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-C_ipcX3V.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-DNn4PbVi.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var cN=Object.defineProperty;var dN=Object.getPrototypeOf;var fN=Reflect.get;var XE=e=>{throw TypeError(e)};var hN=(e,t,n)=>t in e?cN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>hN(e,typeof t!="symbol"?t+"":t,n),i0=(e,t,n)=>t.has(e)||XE("Cannot "+n);var Pr=(e,t,n)=>(i0(e,t,"read from private field"),n?n.call(e):t.get(e)),Ol=(e,t,n)=>t.has(e)?XE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),es=(e,t,n,r)=>(i0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),l0=(e,t,n)=>(i0(e,t,"access private method"),n);var KE=(e,t,n)=>fN(dN(e),n,t);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o0={exports:{}},cc={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var ZE;function mN(){if(ZE)return cc;ZE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,l){var o=null;if(l!==void 0&&(o=""+l),i.key!==void 0&&(o=""+i.key),"key"in i){l={};for(var c in i)c!=="key"&&(l[c]=i[c])}else l=i;return i=l.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:l}}return cc.Fragment=t,cc.jsx=n,cc.jsxs=n,cc}var JE;function pN(){return JE||(JE=1,o0.exports=mN()),o0.exports}var d=pN(),u0={exports:{}},yt={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var e2;function gN(){if(e2)return yt;e2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function E(H){return H===null||typeof H!="object"?null:(H=x&&H[x]||H["@@iterator"],typeof H=="function"?H:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function w(H,te,D){this.props=H,this.context=te,this.refs=N,this.updater=D||v}w.prototype.isReactComponent={},w.prototype.setState=function(H,te){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,te,"setState")},w.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function R(){}R.prototype=w.prototype;function C(H,te,D){this.props=H,this.context=te,this.refs=N,this.updater=D||v}var O=C.prototype=new R;O.constructor=C,S(O,w.prototype),O.isPureReactComponent=!0;var Y=Array.isArray;function P(){}var B={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function le(H,te,D){var we=D.ref;return{$$typeof:e,type:H,key:te,ref:we!==void 0?we:null,props:D}}function Q(H,te){return le(H.type,te,H.props)}function ce(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function W(H){var te={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(D){return te[D]})}var fe=/\/+/g;function ge(H,te){return typeof H=="object"&&H!==null&&H.key!=null?W(""+H.key):te.toString(36)}function re(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(P,P):(H.status="pending",H.then(function(te){H.status==="pending"&&(H.status="fulfilled",H.value=te)},function(te){H.status==="pending"&&(H.status="rejected",H.reason=te)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function F(H,te,D,we,Re){var Ne=typeof H;(Ne==="undefined"||Ne==="boolean")&&(H=null);var Xe=!1;if(H===null)Xe=!0;else switch(Ne){case"bigint":case"string":case"number":Xe=!0;break;case"object":switch(H.$$typeof){case e:case t:Xe=!0;break;case p:return Xe=H._init,F(Xe(H._payload),te,D,we,Re)}}if(Xe)return Re=Re(H),Xe=we===""?"."+ge(H,0):we,Y(Re)?(D="",Xe!=null&&(D=Xe.replace(fe,"$&/")+"/"),F(Re,te,D,"",function(Dt){return Dt})):Re!=null&&(ce(Re)&&(Re=Q(Re,D+(Re.key==null||H&&H.key===Re.key?"":(""+Re.key).replace(fe,"$&/")+"/")+Xe)),te.push(Re)),1;Xe=0;var Ze=we===""?".":we+":";if(Y(H))for(var je=0;je<H.length;je++)we=H[je],Ne=Ze+ge(we,je),Xe+=F(we,te,D,Ne,Re);else if(je=E(H),typeof je=="function")for(H=je.call(H),je=0;!(we=H.next()).done;)we=we.value,Ne=Ze+ge(we,je++),Xe+=F(we,te,D,Ne,Re);else if(Ne==="object"){if(typeof H.then=="function")return F(re(H),te,D,we,Re);throw te=String(H),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return Xe}function $(H,te,D){if(H==null)return H;var we=[],Re=0;return F(H,we,"","",function(Ne){return te.call(D,Ne,Re++)}),we}function J(H){if(H._status===-1){var te=H._result;te=te(),te.then(function(D){(H._status===0||H._status===-1)&&(H._status=1,H._result=D)},function(D){(H._status===0||H._status===-1)&&(H._status=2,H._result=D)}),H._status===-1&&(H._status=0,H._result=te)}if(H._status===1)return H._result.default;throw H._result}var he=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},A={map:$,forEach:function(H,te,D){$(H,function(){te.apply(this,arguments)},D)},count:function(H){var te=0;return $(H,function(){te++}),te},toArray:function(H){return $(H,function(te){return te})||[]},only:function(H){if(!ce(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return yt.Activity=g,yt.Children=A,yt.Component=w,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=C,yt.StrictMode=r,yt.Suspense=f,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,yt.__COMPILER_RUNTIME={__proto__:null,c:function(H){return B.H.useMemoCache(H)}},yt.cache=function(H){return function(){return H.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(H,te,D){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var we=S({},H.props),Re=H.key;if(te!=null)for(Ne in te.key!==void 0&&(Re=""+te.key),te)!G.call(te,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&te.ref===void 0||(we[Ne]=te[Ne]);var Ne=arguments.length-2;if(Ne===1)we.children=D;else if(1<Ne){for(var Xe=Array(Ne),Ze=0;Ze<Ne;Ze++)Xe[Ze]=arguments[Ze+2];we.children=Xe}return le(H.type,Re,we)},yt.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:l,_context:H},H},yt.createElement=function(H,te,D){var we,Re={},Ne=null;if(te!=null)for(we in te.key!==void 0&&(Ne=""+te.key),te)G.call(te,we)&&we!=="key"&&we!=="__self"&&we!=="__source"&&(Re[we]=te[we]);var Xe=arguments.length-2;if(Xe===1)Re.children=D;else if(1<Xe){for(var Ze=Array(Xe),je=0;je<Xe;je++)Ze[je]=arguments[je+2];Re.children=Ze}if(H&&H.defaultProps)for(we in Xe=H.defaultProps,Xe)Re[we]===void 0&&(Re[we]=Xe[we]);return le(H,Ne,Re)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(H){return{$$typeof:c,render:H}},yt.isValidElement=ce,yt.lazy=function(H){return{$$typeof:p,_payload:{_status:-1,_result:H},_init:J}},yt.memo=function(H,te){return{$$typeof:h,type:H,compare:te===void 0?null:te}},yt.startTransition=function(H){var te=B.T,D={};B.T=D;try{var we=H(),Re=B.S;Re!==null&&Re(D,we),typeof we=="object"&&we!==null&&typeof we.then=="function"&&we.then(P,he)}catch(Ne){he(Ne)}finally{te!==null&&D.types!==null&&(te.types=D.types),B.T=te}},yt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},yt.use=function(H){return B.H.use(H)},yt.useActionState=function(H,te,D){return B.H.useActionState(H,te,D)},yt.useCallback=function(H,te){return B.H.useCallback(H,te)},yt.useContext=function(H){return B.H.useContext(H)},yt.useDebugValue=function(){},yt.useDeferredValue=function(H,te){return B.H.useDeferredValue(H,te)},yt.useEffect=function(H,te){return B.H.useEffect(H,te)},yt.useEffectEvent=function(H){return B.H.useEffectEvent(H)},yt.useId=function(){return B.H.useId()},yt.useImperativeHandle=function(H,te,D){return B.H.useImperativeHandle(H,te,D)},yt.useInsertionEffect=function(H,te){return B.H.useInsertionEffect(H,te)},yt.useLayoutEffect=function(H,te){return B.H.useLayoutEffect(H,te)},yt.useMemo=function(H,te){return B.H.useMemo(H,te)},yt.useOptimistic=function(H,te){return B.H.useOptimistic(H,te)},yt.useReducer=function(H,te,D){return B.H.useReducer(H,te,D)},yt.useRef=function(H){return B.H.useRef(H)},yt.useState=function(H){return B.H.useState(H)},yt.useSyncExternalStore=function(H,te,D){return B.H.useSyncExternalStore(H,te,D)},yt.useTransition=function(){return B.H.useTransition()},yt.version="19.2.5",yt}var t2;function y1(){return t2||(t2=1,u0.exports=gN()),u0.exports}var T=y1();const bN=Mh(T);var c0={exports:{}},dc={},d0={exports:{}},f0={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var n2;function xN(){return n2||(n2=1,(function(e){function t(F,$){var J=F.length;F.push($);e:for(;0<J;){var he=J-1>>>1,A=F[he];if(0<i(A,$))F[he]=$,F[J]=A,J=he;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var $=F[0],J=F.pop();if(J!==$){F[0]=J;e:for(var he=0,A=F.length,H=A>>>1;he<H;){var te=2*(he+1)-1,D=F[te],we=te+1,Re=F[we];if(0>i(D,J))we<A&&0>i(Re,D)?(F[he]=Re,F[we]=J,he=we):(F[he]=D,F[te]=J,he=te);else if(we<A&&0>i(Re,J))F[he]=Re,F[we]=J,he=we;else break e}}return $}function i(F,$){var J=F.sortIndex-$.sortIndex;return J!==0?J:F.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var f=[],h=[],p=1,g=null,x=3,E=!1,v=!1,S=!1,N=!1,w=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function O(F){for(var $=n(h);$!==null;){if($.callback===null)r(h);else if($.startTime<=F)r(h),$.sortIndex=$.expirationTime,t(f,$);else break;$=n(h)}}function Y(F){if(S=!1,O(F),!v)if(n(f)!==null)v=!0,P||(P=!0,W());else{var $=n(h);$!==null&&re(Y,$.startTime-F)}}var P=!1,B=-1,G=5,le=-1;function Q(){return N?!0:!(e.unstable_now()-le<G)}function ce(){if(N=!1,P){var F=e.unstable_now();le=F;var $=!0;try{e:{v=!1,S&&(S=!1,R(B),B=-1),E=!0;var J=x;try{t:{for(O(F),g=n(f);g!==null&&!(g.expirationTime>F&&Q());){var he=g.callback;if(typeof he=="function"){g.callback=null,x=g.priorityLevel;var A=he(g.expirationTime<=F);if(F=e.unstable_now(),typeof A=="function"){g.callback=A,O(F),$=!0;break t}g===n(f)&&r(f),O(F)}else r(f);g=n(f)}if(g!==null)$=!0;else{var H=n(h);H!==null&&re(Y,H.startTime-F),$=!1}}break e}finally{g=null,x=J,E=!1}$=void 0}}finally{$?W():P=!1}}}var W;if(typeof C=="function")W=function(){C(ce)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ge=fe.port2;fe.port1.onmessage=ce,W=function(){ge.postMessage(null)}}else W=function(){w(ce,0)};function re(F,$){B=w(function(){F(e.unstable_now())},$)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(F){switch(x){case 1:case 2:case 3:var $=3;break;default:$=x}var J=x;x=$;try{return F()}finally{x=J}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(F,$){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var J=x;x=F;try{return $()}finally{x=J}},e.unstable_scheduleCallback=function(F,$,J){var he=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?he+J:he):J=he,F){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=J+A,F={id:p++,callback:$,priorityLevel:F,startTime:J,expirationTime:A,sortIndex:-1},J>he?(F.sortIndex=J,t(h,F),n(f)===null&&F===n(h)&&(S?(R(B),B=-1):S=!0,re(Y,J-he))):(F.sortIndex=A,t(f,F),v||E||(v=!0,P||(P=!0,W()))),F},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(F){var $=x;return function(){var J=x;x=$;try{return F.apply(this,arguments)}finally{x=J}}}})(f0)),f0}var r2;function yN(){return r2||(r2=1,d0.exports=xN()),d0.exports}var h0={exports:{}},Cr={};/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var a2;function EN(){if(a2)return Cr;a2=1;var e=y1();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Cr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cr.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,p)},Cr.flushSync=function(f){var h=o.T,p=r.p;try{if(o.T=null,r.p=2,f)return f()}finally{o.T=h,r.p=p,r.d.f()}},Cr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Cr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Cr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:E}):p==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:E,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Cr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Cr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:g,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})}},Cr.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Cr.requestFormReset=function(f){r.d.r(f)},Cr.unstable_batchedUpdates=function(f,h){return f(h)},Cr.useFormState=function(f,h,p){return o.H.useFormState(f,h,p)},Cr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Cr.version="19.2.5",Cr}var s2;function Ov(){if(s2)return h0.exports;s2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),h0.exports=EN(),h0.exports}/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-dom-client.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var i2;function _N(){if(i2)return dc;i2=1;var e=yN(),t=y1(),n=Ov();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var s=a,u=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(u=s.return),a=s.return;while(a)}return s.tag===3?u:null}function o(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function c(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function f(a){if(l(a)!==a)throw Error(r(188))}function h(a){var s=a.alternate;if(!s){if(s=l(a),s===null)throw Error(r(188));return s!==a?null:a}for(var u=a,m=s;;){var b=u.return;if(b===null)break;var y=b.alternate;if(y===null){if(m=b.return,m!==null){u=m;continue}break}if(b.child===y.child){for(y=b.child;y;){if(y===u)return f(b),a;if(y===m)return f(b),s;y=y.sibling}throw Error(r(188))}if(u.return!==m.return)u=b,m=y;else{for(var k=!1,L=b.child;L;){if(L===u){k=!0,u=b,m=y;break}if(L===m){k=!0,m=b,u=y;break}L=L.sibling}if(!k){for(L=y.child;L;){if(L===u){k=!0,u=y,m=b;break}if(L===m){k=!0,m=y,u=b;break}L=L.sibling}if(!k)throw Error(r(189))}}if(u.alternate!==m)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:s}function p(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=p(a),s!==null)return s;a=a.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),C=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function W(a){return a===null||typeof a!="object"?null:(a=ce&&a[ce]||a["@@iterator"],typeof a=="function"?a:null)}var fe=Symbol.for("react.client.reference");function ge(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===fe?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case w:return"Profiler";case N:return"StrictMode";case Y:return"Suspense";case P:return"SuspenseList";case le:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case C:return a.displayName||"Context";case R:return(a._context.displayName||"Context")+".Consumer";case O:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case B:return s=a.displayName||null,s!==null?s:ge(a.type)||"Memo";case G:s=a._payload,a=a._init;try{return ge(a(s))}catch{}}return null}var re=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},he=[],A=-1;function H(a){return{current:a}}function te(a){0>A||(a.current=he[A],he[A]=null,A--)}function D(a,s){A++,he[A]=a.current,a.current=s}var we=H(null),Re=H(null),Ne=H(null),Xe=H(null);function Ze(a,s){switch(D(Ne,s),D(Re,a),D(we,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?yE(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=yE(s),a=EE(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}te(we),D(we,a)}function je(){te(we),te(Re),te(Ne)}function Dt(a){a.memoizedState!==null&&D(Xe,a);var s=we.current,u=EE(s,a.type);s!==u&&(D(Re,a),D(we,u))}function Ue(a){Re.current===a&&(te(we),te(Re)),Xe.current===a&&(te(Xe),ic._currentValue=J)}var jt,an;function rt(a){if(jt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);jt=s&&s[1]||"",an=-1<u.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+jt+a+an}var pt=!1;function at(a,s){if(!a||pt)return"";pt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(s){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(me){var oe=me}Reflect.construct(a,[],Te)}else{try{Te.call()}catch(me){oe=me}a.call(Te.prototype)}}else{try{throw Error()}catch(me){oe=me}(Te=a())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(me){if(me&&oe&&typeof me.stack=="string")return[me.stack,oe.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=m.DetermineComponentFrameRoot(),k=y[0],L=y[1];if(k&&L){var q=k.split(`
|
|
45
|
-
`),ie=L.split(`
|
|
46
|
-
`);for(b=m=0;m<q.length&&!q[m].includes("DetermineComponentFrameRoot");)m++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(m===q.length||b===ie.length)for(m=q.length-1,b=ie.length-1;1<=m&&0<=b&&q[m]!==ie[b];)b--;for(;1<=m&&0<=b;m--,b--)if(q[m]!==ie[b]){if(m!==1||b!==1)do if(m--,b--,0>b||q[m]!==ie[b]){var xe=`
|
|
47
|
-
`+q[m].replace(" at new "," at ");return a.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",a.displayName)),xe}while(1<=m&&0<=b);break}}}finally{pt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?rt(u):""}function yn(a,s){switch(a.tag){case 26:case 27:case 5:return rt(a.type);case 16:return rt("Lazy");case 13:return a.child!==s&&s!==null?rt("Suspense Fallback"):rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return at(a.type,!1);case 11:return at(a.type.render,!1);case 1:return at(a.type,!0);case 31:return rt("Activity");default:return""}}function Ye(a){try{var s="",u=null;do s+=yn(a,u),u=a,a=a.return;while(a);return s}catch(m){return`
|
|
48
|
-
Error generating stack: `+m.message+`
|
|
49
|
-
`+m.stack}}var Pe=Object.prototype.hasOwnProperty,At=e.unstable_scheduleCallback,sn=e.unstable_cancelCallback,cn=e.unstable_shouldYield,Un=e.unstable_requestPaint,_t=e.unstable_now,St=e.unstable_getCurrentPriorityLevel,be=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,lt=e.unstable_LowPriority,gt=e.unstable_IdlePriority,En=e.log,On=e.unstable_setDisableYieldValue,Ee=null,Oe=null;function Je(a){if(typeof En=="function"&&On(a),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Ee,a)}catch{}}var He=Math.clz32?Math.clz32:ye,tt=Math.log,X=Math.LN2;function ye(a){return a>>>=0,a===0?32:31-(tt(a)/X|0)|0}var We=256,Ge=262144,Fe=4194304;function ht(a){var s=a&42;if(s!==0)return s;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lt(a,s,u){var m=a.pendingLanes;if(m===0)return 0;var b=0,y=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var L=m&134217727;return L!==0?(m=L&~y,m!==0?b=ht(m):(k&=L,k!==0?b=ht(k):u||(u=L&~a,u!==0&&(b=ht(u))))):(L=m&~y,L!==0?b=ht(L):k!==0?b=ht(k):u||(u=m&~a,u!==0&&(b=ht(u)))),b===0?0:s!==0&&s!==b&&(s&y)===0&&(y=b&-b,u=s&-s,y>=u||y===32&&(u&4194048)!==0)?s:b}function st(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function Nt(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 _r(){var a=Fe;return Fe<<=1,(Fe&62914560)===0&&(Fe=4194304),a}function bt(a){for(var s=[],u=0;31>u;u++)s.push(a);return s}function Nn(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Hn(a,s,u,m,b,y){var k=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,q=a.expirationTimes,ie=a.hiddenUpdates;for(u=k&~u;0<u;){var xe=31-He(u),Te=1<<xe;L[xe]=0,q[xe]=-1;var oe=ie[xe];if(oe!==null)for(ie[xe]=null,xe=0;xe<oe.length;xe++){var me=oe[xe];me!==null&&(me.lane&=-536870913)}u&=~Te}m!==0&&Ga(a,m,0),y!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=y&~(k&~s))}function Ga(a,s,u){a.pendingLanes|=s,a.suspendedLanes&=~s;var m=31-He(s);a.entangledLanes|=s,a.entanglements[m]=a.entanglements[m]|1073741824|u&261930}function Zn(a,s){var u=a.entangledLanes|=s;for(a=a.entanglements;u;){var m=31-He(u),b=1<<m;b&s|a[m]&s&&(a[m]|=s),u&=~b}}function ll(a,s){var u=s&-s;return u=(u&42)!==0?1:Ns(u),(u&(a.suspendedLanes|s))!==0?0:u}function Ns(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ba(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function os(){var a=$.p;return a!==0?a:(a=window.event,a===void 0?32:$E(a.type))}function io(a,s){var u=$.p;try{return $.p=a,s()}finally{$.p=u}}var Jr=Math.random().toString(36).slice(2),kn="__reactFiber$"+Jr,bn="__reactProps$"+Jr,xa="__reactContainer$"+Jr,Fn="__reactEvents$"+Jr,lo="__reactListeners$"+Jr,Tr="__reactHandles$"+Jr,qa="__reactResources$"+Jr,Mt="__reactMarker$"+Jr;function Jn(a){delete a[kn],delete a[bn],delete a[Fn],delete a[lo],delete a[Tr]}function Ir(a){var s=a[kn];if(s)return s;for(var u=a.parentNode;u;){if(s=u[xa]||u[kn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(a=SE(a);a!==null;){if(u=a[kn])return u;a=SE(a)}return s}a=u,u=a.parentNode}return null}function er(a){if(a=a[kn]||a[xa]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function ya(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function Ea(a){var s=a[qa];return s||(s=a[qa]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Wt(a){a[Mt]=!0}var ol=new Set,ul={};function $r(a,s){ur(a,s),ur(a+"Capture",s)}function ur(a,s){for(ul[a]=s,a=0;a<s.length;a++)ol.add(s[a])}var oo=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]*$"),As={},uo={};function ea(a){return Pe.call(uo,a)?!0:Pe.call(As,a)?!1:oo.test(a)?uo[a]=!0:(As[a]=!0,!1)}function us(a,s,u){if(ea(s))if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var m=s.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+u)}}function cs(a,s,u){if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+u)}}function tr(a,s,u,m){if(m===null)a.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(s,u,""+m)}}function zn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function cr(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ya(a,s,u){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,y=m.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return b.call(this)},set:function(k){u=""+k,y.call(this,k)}}),Object.defineProperty(a,s,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Rs(a){if(!a._valueTracker){var s=cr(a)?"checked":"value";a._valueTracker=Ya(a,s,""+a[s])}}function di(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var u=s.getValue(),m="";return a&&(m=cr(a)?a.checked?"true":"false":a.value),a=m,a!==u?(s.setValue(a),!0):!1}function Qt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var cl=/[\n"\\]/g;function Dn(a){return a.replace(cl,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Or(a,s,u,m,b,y,k,L){a.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.type=k:a.removeAttribute("type"),s!=null?k==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+zn(s)):a.value!==""+zn(s)&&(a.value=""+zn(s)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),s!=null?dl(a,k,zn(s)):u!=null?dl(a,k,zn(u)):m!=null&&a.removeAttribute("value"),b==null&&y!=null&&(a.defaultChecked=!!y),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+zn(L):a.removeAttribute("name")}function An(a,s,u,m,b,y,k,L){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),s!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Rs(a);return}u=u!=null?""+zn(u):"",s=s!=null?""+zn(s):u,L||s===a.value||(a.value=s),a.defaultValue=s}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=L?a.checked:!!m,a.defaultChecked=!!m,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),Rs(a)}function dl(a,s,u){s==="number"&&Qt(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function vr(a,s,u,m){if(a=a.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<a.length;u++)b=s.hasOwnProperty("$"+a[u].value),a[u].selected!==b&&(a[u].selected=b),b&&m&&(a[u].defaultSelected=!0)}else{for(u=""+zn(u),s=null,b=0;b<a.length;b++){if(a[b].value===u){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}s!==null||a[b].disabled||(s=a[b])}s!==null&&(s.selected=!0)}}function fi(a,s,u){if(s!=null&&(s=""+zn(s),s!==a.value&&(a.value=s),u==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=u!=null?""+zn(u):""}function hi(a,s,u,m){if(s==null){if(m!=null){if(u!=null)throw Error(r(92));if(re(m)){if(1<m.length)throw Error(r(93));m=m[0]}u=m}u==null&&(u=""),s=u}u=zn(s),a.defaultValue=u,m=a.textContent,m===u&&m!==""&&m!==null&&(a.value=m),Rs(a)}function Vr(a,s){if(s){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=s;return}}a.textContent=s}var tn=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 _a(a,s,u){var m=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":m?a.setProperty(s,u):typeof u!="number"||u===0||tn.has(s)?s==="float"?a.cssFloat=u:a[s]=(""+u).trim():a[s]=u+"px"}function Ls(a,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||s!=null&&s.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in s)m=s[b],s.hasOwnProperty(b)&&u[b]!==m&&_a(a,b,m)}else for(var y in s)s.hasOwnProperty(y)&&_a(a,y,s[y])}function ta(a){if(a.indexOf("-")===-1)return!1;switch(a){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 fl=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hl=/^[\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 ds(a){return hl.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function kr(){}var Is=null;function mi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Wa=null,Ta=null;function ml(a){var s=er(a);if(s&&(a=s.stateNode)){var u=a[bn]||null;e:switch(a=s.stateNode,s.type){case"input":if(Or(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Dn(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var m=u[s];if(m!==a&&m.form===a.form){var b=m[bn]||null;if(!b)throw Error(r(90));Or(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)m=u[s],m.form===a.form&&di(m)}break e;case"textarea":fi(a,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&vr(a,!!u.multiple,s,!1)}}}var Os=!1;function pl(a,s,u){if(Os)return a(s,u);Os=!0;try{var m=a(s);return m}finally{if(Os=!1,(Wa!==null||Ta!==null)&&(nf(),Wa&&(s=Wa,a=Ta,Ta=Wa=null,ml(s),a)))for(s=0;s<a.length;s++)ml(a[s])}}function va(a,s){var u=a.stateNode;if(u===null)return null;var m=u[bn]||null;if(m===null)return null;u=m[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pi=!1;if(Dr)try{var na={};Object.defineProperty(na,"passive",{get:function(){pi=!0}}),window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{pi=!1}var jr=null,gi=null,Qa=null;function co(){if(Qa)return Qa;var a,s=gi,u=s.length,m,b="value"in jr?jr.value:jr.textContent,y=b.length;for(a=0;a<u&&s[a]===b[a];a++);var k=u-a;for(m=1;m<=k&&s[u-m]===b[y-m];m++);return Qa=b.slice(a,1<m?1-m:void 0)}function bi(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function Ds(){return!0}function gl(){return!1}function nr(a){function s(u,m,b,y,k){this._reactName=u,this._targetInst=b,this.type=m,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(u=a[L],this[L]=u?u(y):y[L]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ds:gl,this.isPropagationStopped=gl,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ds)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ds)},persist:function(){},isPersistent:Ds}),s}var ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xi=nr(ka),fs=g({},ka,{view:0,detail:0}),wa=nr(fs),js,yi,Xa,z=g({},fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ln,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Xa&&(Xa&&a.type==="mousemove"?(js=a.screenX-Xa.screenX,yi=a.screenY-Xa.screenY):yi=js=0,Xa=a),js)},movementY:function(a){return"movementY"in a?a.movementY:yi}}),K=nr(z),ue=g({},z,{dataTransfer:0}),Ie=nr(ue),De=g({},fs,{relatedTarget:0}),ot=nr(De),Be=g({},ka,{animationName:0,elapsedTime:0,pseudoElement:0}),_n=nr(Be),vt=g({},ka,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),wr=nr(vt),Ca=g({},ka,{data:0}),Jt=nr(Ca),Xt={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ce={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"},et={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mt(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=et[a])?!!s[a]:!1}function ln(){return mt}var xt=g({},fs,{key:function(a){if(a.key){var s=Xt[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=bi(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Ce[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ln,charCode:function(a){return a.type==="keypress"?bi(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?bi(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),nn=nr(xt),$n=g({},z,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vn=nr($n),Ms=g({},fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ln}),fo=nr(Ms),fm=g({},ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),hd=nr(fm),md=g({},z,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),hm=nr(md),mm=g({},ka,{newState:0,oldState:0}),pd=nr(mm),gd=[9,13,27,32],ho=Dr&&"CompositionEvent"in window,Ei=null;Dr&&"documentMode"in document&&(Ei=document.documentMode);var bd=Dr&&"TextEvent"in window&&!Ei,wu=Dr&&(!ho||Ei&&8<Ei&&11>=Ei),Cu=" ",Su=!1;function Nu(a,s){switch(a){case"keyup":return gd.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Au(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ps=!1;function xd(a,s){switch(a){case"compositionend":return Au(s);case"keypress":return s.which!==32?null:(Su=!0,Cu);case"textInput":return a=s.data,a===Cu&&Su?null:a;default:return null}}function yd(a,s){if(Ps)return a==="compositionend"||!ho&&Nu(a,s)?(a=co(),Qa=gi=jr=null,Ps=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return wu&&s.locale!=="ko"?null:s.data;default:return null}}var Ed={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 I(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!Ed[a.type]:s==="textarea"}function ae(a,s,u,m){Wa?Ta?Ta.push(m):Ta=[m]:Wa=m,s=cf(s,"onChange"),0<s.length&&(u=new xi("onChange","change",null,u,m),a.push({event:u,listeners:s}))}var ve=null,$e=null;function Ke(a){hE(a,0)}function ut(a){var s=ya(a);if(di(s))return a}function ft(a,s){if(a==="change")return s}var Pt=!1;if(Dr){var kt;if(Dr){var rn="oninput"in document;if(!rn){var Gn=document.createElement("div");Gn.setAttribute("oninput","return;"),rn=typeof Gn.oninput=="function"}kt=rn}else kt=!1;Pt=kt&&(!document.documentMode||9<document.documentMode)}function Vt(){ve&&(ve.detachEvent("onpropertychange",Sa),$e=ve=null)}function Sa(a){if(a.propertyName==="value"&&ut($e)){var s=[];ae(s,$e,a,mi(a)),pl(Ke,s)}}function bl(a,s,u){a==="focusin"?(Vt(),ve=s,$e=u,ve.attachEvent("onpropertychange",Sa)):a==="focusout"&&Vt()}function _d(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ut($e)}function H5(a,s){if(a==="click")return ut(s)}function F5(a,s){if(a==="input"||a==="change")return ut(s)}function z5(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var ra=typeof Object.is=="function"?Object.is:z5;function Ru(a,s){if(ra(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var u=Object.keys(a),m=Object.keys(s);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var b=u[m];if(!Pe.call(s,b)||!ra(a[b],s[b]))return!1}return!0}function Pb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Bb(a,s){var u=Pb(a);a=0;for(var m;u;){if(u.nodeType===3){if(m=a+u.textContent.length,a<=s&&m>=s)return{node:u,offset:s-a};a=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Pb(u)}}function Ub(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Ub(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Hb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=Qt(a.document);s instanceof a.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)a=s.contentWindow;else break;s=Qt(a.document)}return s}function pm(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var $5=Dr&&"documentMode"in document&&11>=document.documentMode,mo=null,gm=null,Lu=null,bm=!1;function Fb(a,s,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;bm||mo==null||mo!==Qt(m)||(m=mo,"selectionStart"in m&&pm(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Lu&&Ru(Lu,m)||(Lu=m,m=cf(gm,"onSelect"),0<m.length&&(s=new xi("onSelect","select",null,s,u),a.push({event:s,listeners:m}),s.target=mo)))}function xl(a,s){var u={};return u[a.toLowerCase()]=s.toLowerCase(),u["Webkit"+a]="webkit"+s,u["Moz"+a]="moz"+s,u}var po={animationend:xl("Animation","AnimationEnd"),animationiteration:xl("Animation","AnimationIteration"),animationstart:xl("Animation","AnimationStart"),transitionrun:xl("Transition","TransitionRun"),transitionstart:xl("Transition","TransitionStart"),transitioncancel:xl("Transition","TransitionCancel"),transitionend:xl("Transition","TransitionEnd")},xm={},zb={};Dr&&(zb=document.createElement("div").style,"AnimationEvent"in window||(delete po.animationend.animation,delete po.animationiteration.animation,delete po.animationstart.animation),"TransitionEvent"in window||delete po.transitionend.transition);function yl(a){if(xm[a])return xm[a];if(!po[a])return a;var s=po[a],u;for(u in s)if(s.hasOwnProperty(u)&&u in zb)return xm[a]=s[u];return a}var $b=yl("animationend"),Vb=yl("animationiteration"),Gb=yl("animationstart"),V5=yl("transitionrun"),G5=yl("transitionstart"),q5=yl("transitioncancel"),qb=yl("transitionend"),Yb=new Map,ym="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ym.push("scrollEnd");function Ka(a,s){Yb.set(a,s),$r(s,[a])}var Td=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Na=[],go=0,Em=0;function vd(){for(var a=go,s=Em=go=0;s<a;){var u=Na[s];Na[s++]=null;var m=Na[s];Na[s++]=null;var b=Na[s];Na[s++]=null;var y=Na[s];if(Na[s++]=null,m!==null&&b!==null){var k=m.pending;k===null?b.next=b:(b.next=k.next,k.next=b),m.pending=b}y!==0&&Wb(u,b,y)}}function kd(a,s,u,m){Na[go++]=a,Na[go++]=s,Na[go++]=u,Na[go++]=m,Em|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function _m(a,s,u,m){return kd(a,s,u,m),wd(a)}function El(a,s){return kd(a,null,null,s),wd(a)}function Wb(a,s,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var b=!1,y=a.return;y!==null;)y.childLanes|=u,m=y.alternate,m!==null&&(m.childLanes|=u),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(b=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,b&&s!==null&&(b=31-He(u),a=y.hiddenUpdates,m=a[b],m===null?a[b]=[s]:m.push(s),s.lane=u|536870912),y):null}function wd(a){if(50<Ju)throw Ju=0,Rp=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var bo={};function Y5(a,s,u,m){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function aa(a,s,u,m){return new Y5(a,s,u,m)}function Tm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Bs(a,s){var u=a.alternate;return u===null?(u=aa(a.tag,s,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=s,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,s=a.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function Qb(a,s){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,s=u.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function Cd(a,s,u,m,b,y){var k=0;if(m=a,typeof a=="function")Tm(a)&&(k=1);else if(typeof a=="string")k=ZS(a,u,we.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case le:return a=aa(31,u,s,b),a.elementType=le,a.lanes=y,a;case S:return _l(u.children,b,y,s);case N:k=8,b|=24;break;case w:return a=aa(12,u,s,b|2),a.elementType=w,a.lanes=y,a;case Y:return a=aa(13,u,s,b),a.elementType=Y,a.lanes=y,a;case P:return a=aa(19,u,s,b),a.elementType=P,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:k=10;break e;case R:k=9;break e;case O:k=11;break e;case B:k=14;break e;case G:k=16,m=null;break e}k=29,u=Error(r(130,a===null?"null":typeof a,"")),m=null}return s=aa(k,u,s,b),s.elementType=a,s.type=m,s.lanes=y,s}function _l(a,s,u,m){return a=aa(7,a,m,s),a.lanes=u,a}function vm(a,s,u){return a=aa(6,a,null,s),a.lanes=u,a}function Xb(a){var s=aa(18,null,null,0);return s.stateNode=a,s}function km(a,s,u){return s=aa(4,a.children!==null?a.children:[],a.key,s),s.lanes=u,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var Kb=new WeakMap;function Aa(a,s){if(typeof a=="object"&&a!==null){var u=Kb.get(a);return u!==void 0?u:(s={value:a,source:s,stack:Ye(s)},Kb.set(a,s),s)}return{value:a,source:s,stack:Ye(s)}}var xo=[],yo=0,Sd=null,Iu=0,Ra=[],La=0,_i=null,hs=1,ms="";function Us(a,s){xo[yo++]=Iu,xo[yo++]=Sd,Sd=a,Iu=s}function Zb(a,s,u){Ra[La++]=hs,Ra[La++]=ms,Ra[La++]=_i,_i=a;var m=hs;a=ms;var b=32-He(m)-1;m&=~(1<<b),u+=1;var y=32-He(s)+b;if(30<y){var k=b-b%5;y=(m&(1<<k)-1).toString(32),m>>=k,b-=k,hs=1<<32-He(s)+b|u<<b|m,ms=y+a}else hs=1<<y|u<<b|m,ms=a}function wm(a){a.return!==null&&(Us(a,1),Zb(a,1,0))}function Cm(a){for(;a===Sd;)Sd=xo[--yo],xo[yo]=null,Iu=xo[--yo],xo[yo]=null;for(;a===_i;)_i=Ra[--La],Ra[La]=null,ms=Ra[--La],Ra[La]=null,hs=Ra[--La],Ra[La]=null}function Jb(a,s){Ra[La++]=hs,Ra[La++]=ms,Ra[La++]=_i,hs=s.id,ms=s.overflow,_i=a}var gr=null,Tn=null,$t=!1,Ti=null,Ia=!1,Sm=Error(r(519));function vi(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ou(Aa(s,a)),Sm}function ex(a){var s=a.stateNode,u=a.type,m=a.memoizedProps;switch(s[kn]=a,s[bn]=m,u){case"dialog":Ut("cancel",s),Ut("close",s);break;case"iframe":case"object":case"embed":Ut("load",s);break;case"video":case"audio":for(u=0;u<tc.length;u++)Ut(tc[u],s);break;case"source":Ut("error",s);break;case"img":case"image":case"link":Ut("error",s),Ut("load",s);break;case"details":Ut("toggle",s);break;case"input":Ut("invalid",s),An(s,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ut("invalid",s);break;case"textarea":Ut("invalid",s),hi(s,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||m.suppressHydrationWarning===!0||bE(s.textContent,u)?(m.popover!=null&&(Ut("beforetoggle",s),Ut("toggle",s)),m.onScroll!=null&&Ut("scroll",s),m.onScrollEnd!=null&&Ut("scrollend",s),m.onClick!=null&&(s.onclick=kr),s=!0):s=!1,s||vi(a,!0)}function tx(a){for(gr=a.return;gr;)switch(gr.tag){case 5:case 31:case 13:Ia=!1;return;case 27:case 3:Ia=!0;return;default:gr=gr.return}}function Eo(a){if(a!==gr)return!1;if(!$t)return tx(a),$t=!0,!1;var s=a.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Gp(a.type,a.memoizedProps)),u=!u),u&&Tn&&vi(a),tx(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tn=CE(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tn=CE(a)}else s===27?(s=Tn,Pi(a.type)?(a=Xp,Xp=null,Tn=a):Tn=s):Tn=gr?Da(a.stateNode.nextSibling):null;return!0}function Tl(){Tn=gr=null,$t=!1}function Nm(){var a=Ti;return a!==null&&(Wr===null?Wr=a:Wr.push.apply(Wr,a),Ti=null),a}function Ou(a){Ti===null?Ti=[a]:Ti.push(a)}var Am=H(null),vl=null,Hs=null;function ki(a,s,u){D(Am,s._currentValue),s._currentValue=u}function Fs(a){a._currentValue=Am.current,te(Am)}function Rm(a,s,u){for(;a!==null;){var m=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,m!==null&&(m.childLanes|=s)):m!==null&&(m.childLanes&s)!==s&&(m.childLanes|=s),a===u)break;a=a.return}}function Lm(a,s,u,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var y=b.dependencies;if(y!==null){var k=b.child;y=y.firstContext;e:for(;y!==null;){var L=y;y=b;for(var q=0;q<s.length;q++)if(L.context===s[q]){y.lanes|=u,L=y.alternate,L!==null&&(L.lanes|=u),Rm(y.return,u,a),m||(k=null);break e}y=L.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=u,y=k.alternate,y!==null&&(y.lanes|=u),Rm(k,u,a),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===a){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function _o(a,s,u,m){a=null;for(var b=s,y=!1;b!==null;){if(!y){if((b.flags&524288)!==0)y=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var L=b.type;ra(b.pendingProps.value,k.value)||(a!==null?a.push(L):a=[L])}}else if(b===Xe.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(ic):a=[ic])}b=b.return}a!==null&&Lm(s,a,u,m),s.flags|=262144}function Nd(a){for(a=a.firstContext;a!==null;){if(!ra(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function kl(a){vl=a,Hs=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function br(a){return nx(vl,a)}function Ad(a,s){return vl===null&&kl(a),nx(a,s)}function nx(a,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Hs===null){if(a===null)throw Error(r(308));Hs=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Hs=Hs.next=s;return u}var W5=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(u,m){a.push(m)}};this.abort=function(){s.aborted=!0,a.forEach(function(u){return u()})}},Q5=e.unstable_scheduleCallback,X5=e.unstable_NormalPriority,qn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Im(){return{controller:new W5,data:new Map,refCount:0}}function Du(a){a.refCount--,a.refCount===0&&Q5(X5,function(){a.controller.abort()})}var ju=null,Om=0,To=0,vo=null;function K5(a,s){if(ju===null){var u=ju=[];Om=0,To=Mp(),vo={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Om++,s.then(rx,rx),s}function rx(){if(--Om===0&&ju!==null){vo!==null&&(vo.status="fulfilled");var a=ju;ju=null,To=0,vo=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function Z5(a,s){var u=[],m={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return a.then(function(){m.status="fulfilled",m.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(m.status="rejected",m.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),m}var ax=F.S;F.S=function(a,s){Fy=_t(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&K5(a,s),ax!==null&&ax(a,s)};var wl=H(null);function Dm(){var a=wl.current;return a!==null?a:pn.pooledCache}function Rd(a,s){s===null?D(wl,wl.current):D(wl,s.pool)}function sx(){var a=Dm();return a===null?null:{parent:qn._currentValue,pool:a}}var ko=Error(r(460)),jm=Error(r(474)),Ld=Error(r(542)),Id={then:function(){}};function ix(a){return a=a.status,a==="fulfilled"||a==="rejected"}function lx(a,s,u){switch(u=a[u],u===void 0?a.push(s):u!==s&&(s.then(kr,kr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,ux(a),a;default:if(typeof s.status=="string")s.then(kr,kr);else{if(a=pn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(m){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=m}},function(m){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=m}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,ux(a),a}throw Sl=s,ko}}function Cl(a){try{var s=a._init;return s(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Sl=u,ko):u}}var Sl=null;function ox(){if(Sl===null)throw Error(r(459));var a=Sl;return Sl=null,a}function ux(a){if(a===ko||a===Ld)throw Error(r(483))}var wo=null,Mu=0;function Od(a){var s=Mu;return Mu+=1,wo===null&&(wo=[]),lx(wo,a,s)}function Pu(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Dd(a,s){throw s.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function cx(a){function s(ee,Z){if(a){var se=ee.deletions;se===null?(ee.deletions=[Z],ee.flags|=16):se.push(Z)}}function u(ee,Z){if(!a)return null;for(;Z!==null;)s(ee,Z),Z=Z.sibling;return null}function m(ee){for(var Z=new Map;ee!==null;)ee.key!==null?Z.set(ee.key,ee):Z.set(ee.index,ee),ee=ee.sibling;return Z}function b(ee,Z){return ee=Bs(ee,Z),ee.index=0,ee.sibling=null,ee}function y(ee,Z,se){return ee.index=se,a?(se=ee.alternate,se!==null?(se=se.index,se<Z?(ee.flags|=67108866,Z):se):(ee.flags|=67108866,Z)):(ee.flags|=1048576,Z)}function k(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function L(ee,Z,se,_e){return Z===null||Z.tag!==6?(Z=vm(se,ee.mode,_e),Z.return=ee,Z):(Z=b(Z,se),Z.return=ee,Z)}function q(ee,Z,se,_e){var nt=se.type;return nt===S?xe(ee,Z,se.props.children,_e,se.key):Z!==null&&(Z.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===G&&Cl(nt)===Z.type)?(Z=b(Z,se.props),Pu(Z,se),Z.return=ee,Z):(Z=Cd(se.type,se.key,se.props,null,ee.mode,_e),Pu(Z,se),Z.return=ee,Z)}function ie(ee,Z,se,_e){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==se.containerInfo||Z.stateNode.implementation!==se.implementation?(Z=km(se,ee.mode,_e),Z.return=ee,Z):(Z=b(Z,se.children||[]),Z.return=ee,Z)}function xe(ee,Z,se,_e,nt){return Z===null||Z.tag!==7?(Z=_l(se,ee.mode,_e,nt),Z.return=ee,Z):(Z=b(Z,se),Z.return=ee,Z)}function Te(ee,Z,se){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=vm(""+Z,ee.mode,se),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:return se=Cd(Z.type,Z.key,Z.props,null,ee.mode,se),Pu(se,Z),se.return=ee,se;case v:return Z=km(Z,ee.mode,se),Z.return=ee,Z;case G:return Z=Cl(Z),Te(ee,Z,se)}if(re(Z)||W(Z))return Z=_l(Z,ee.mode,se,null),Z.return=ee,Z;if(typeof Z.then=="function")return Te(ee,Od(Z),se);if(Z.$$typeof===C)return Te(ee,Ad(ee,Z),se);Dd(ee,Z)}return null}function oe(ee,Z,se,_e){var nt=Z!==null?Z.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return nt!==null?null:L(ee,Z,""+se,_e);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return se.key===nt?q(ee,Z,se,_e):null;case v:return se.key===nt?ie(ee,Z,se,_e):null;case G:return se=Cl(se),oe(ee,Z,se,_e)}if(re(se)||W(se))return nt!==null?null:xe(ee,Z,se,_e,null);if(typeof se.then=="function")return oe(ee,Z,Od(se),_e);if(se.$$typeof===C)return oe(ee,Z,Ad(ee,se),_e);Dd(ee,se)}return null}function me(ee,Z,se,_e,nt){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return ee=ee.get(se)||null,L(Z,ee,""+_e,nt);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case E:return ee=ee.get(_e.key===null?se:_e.key)||null,q(Z,ee,_e,nt);case v:return ee=ee.get(_e.key===null?se:_e.key)||null,ie(Z,ee,_e,nt);case G:return _e=Cl(_e),me(ee,Z,se,_e,nt)}if(re(_e)||W(_e))return ee=ee.get(se)||null,xe(Z,ee,_e,nt,null);if(typeof _e.then=="function")return me(ee,Z,se,Od(_e),nt);if(_e.$$typeof===C)return me(ee,Z,se,Ad(Z,_e),nt);Dd(Z,_e)}return null}function ze(ee,Z,se,_e){for(var nt=null,Kt=null,Qe=Z,wt=Z=0,zt=null;Qe!==null&&wt<se.length;wt++){Qe.index>wt?(zt=Qe,Qe=null):zt=Qe.sibling;var Zt=oe(ee,Qe,se[wt],_e);if(Zt===null){Qe===null&&(Qe=zt);break}a&&Qe&&Zt.alternate===null&&s(ee,Qe),Z=y(Zt,Z,wt),Kt===null?nt=Zt:Kt.sibling=Zt,Kt=Zt,Qe=zt}if(wt===se.length)return u(ee,Qe),$t&&Us(ee,wt),nt;if(Qe===null){for(;wt<se.length;wt++)Qe=Te(ee,se[wt],_e),Qe!==null&&(Z=y(Qe,Z,wt),Kt===null?nt=Qe:Kt.sibling=Qe,Kt=Qe);return $t&&Us(ee,wt),nt}for(Qe=m(Qe);wt<se.length;wt++)zt=me(Qe,ee,wt,se[wt],_e),zt!==null&&(a&&zt.alternate!==null&&Qe.delete(zt.key===null?wt:zt.key),Z=y(zt,Z,wt),Kt===null?nt=zt:Kt.sibling=zt,Kt=zt);return a&&Qe.forEach(function(zi){return s(ee,zi)}),$t&&Us(ee,wt),nt}function ct(ee,Z,se,_e){if(se==null)throw Error(r(151));for(var nt=null,Kt=null,Qe=Z,wt=Z=0,zt=null,Zt=se.next();Qe!==null&&!Zt.done;wt++,Zt=se.next()){Qe.index>wt?(zt=Qe,Qe=null):zt=Qe.sibling;var zi=oe(ee,Qe,Zt.value,_e);if(zi===null){Qe===null&&(Qe=zt);break}a&&Qe&&zi.alternate===null&&s(ee,Qe),Z=y(zi,Z,wt),Kt===null?nt=zi:Kt.sibling=zi,Kt=zi,Qe=zt}if(Zt.done)return u(ee,Qe),$t&&Us(ee,wt),nt;if(Qe===null){for(;!Zt.done;wt++,Zt=se.next())Zt=Te(ee,Zt.value,_e),Zt!==null&&(Z=y(Zt,Z,wt),Kt===null?nt=Zt:Kt.sibling=Zt,Kt=Zt);return $t&&Us(ee,wt),nt}for(Qe=m(Qe);!Zt.done;wt++,Zt=se.next())Zt=me(Qe,ee,wt,Zt.value,_e),Zt!==null&&(a&&Zt.alternate!==null&&Qe.delete(Zt.key===null?wt:Zt.key),Z=y(Zt,Z,wt),Kt===null?nt=Zt:Kt.sibling=Zt,Kt=Zt);return a&&Qe.forEach(function(uN){return s(ee,uN)}),$t&&Us(ee,wt),nt}function hn(ee,Z,se,_e){if(typeof se=="object"&&se!==null&&se.type===S&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case E:e:{for(var nt=se.key;Z!==null;){if(Z.key===nt){if(nt=se.type,nt===S){if(Z.tag===7){u(ee,Z.sibling),_e=b(Z,se.props.children),_e.return=ee,ee=_e;break e}}else if(Z.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===G&&Cl(nt)===Z.type){u(ee,Z.sibling),_e=b(Z,se.props),Pu(_e,se),_e.return=ee,ee=_e;break e}u(ee,Z);break}else s(ee,Z);Z=Z.sibling}se.type===S?(_e=_l(se.props.children,ee.mode,_e,se.key),_e.return=ee,ee=_e):(_e=Cd(se.type,se.key,se.props,null,ee.mode,_e),Pu(_e,se),_e.return=ee,ee=_e)}return k(ee);case v:e:{for(nt=se.key;Z!==null;){if(Z.key===nt)if(Z.tag===4&&Z.stateNode.containerInfo===se.containerInfo&&Z.stateNode.implementation===se.implementation){u(ee,Z.sibling),_e=b(Z,se.children||[]),_e.return=ee,ee=_e;break e}else{u(ee,Z);break}else s(ee,Z);Z=Z.sibling}_e=km(se,ee.mode,_e),_e.return=ee,ee=_e}return k(ee);case G:return se=Cl(se),hn(ee,Z,se,_e)}if(re(se))return ze(ee,Z,se,_e);if(W(se)){if(nt=W(se),typeof nt!="function")throw Error(r(150));return se=nt.call(se),ct(ee,Z,se,_e)}if(typeof se.then=="function")return hn(ee,Z,Od(se),_e);if(se.$$typeof===C)return hn(ee,Z,Ad(ee,se),_e);Dd(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Z!==null&&Z.tag===6?(u(ee,Z.sibling),_e=b(Z,se),_e.return=ee,ee=_e):(u(ee,Z),_e=vm(se,ee.mode,_e),_e.return=ee,ee=_e),k(ee)):u(ee,Z)}return function(ee,Z,se,_e){try{Mu=0;var nt=hn(ee,Z,se,_e);return wo=null,nt}catch(Qe){if(Qe===ko||Qe===Ld)throw Qe;var Kt=aa(29,Qe,null,ee.mode);return Kt.lanes=_e,Kt.return=ee,Kt}finally{}}}var Nl=cx(!0),dx=cx(!1),wi=!1;function Mm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pm(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ci(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Si(a,s,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(en&2)!==0){var b=m.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),m.pending=s,s=wd(a),Wb(a,null,u),s}return kd(a,m,s,u),wd(a)}function Bu(a,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var m=s.lanes;m&=a.pendingLanes,u|=m,s.lanes=u,Zn(a,u)}}function Bm(a,s){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var b=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var k={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?b=y=k:y=y.next=k,u=u.next}while(u!==null);y===null?b=y=s:y=y.next=s}else b=y=s;u={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:y,shared:m.shared,callbacks:m.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=s:a.next=s,u.lastBaseUpdate=s}var Um=!1;function Uu(){if(Um){var a=vo;if(a!==null)throw a}}function Hu(a,s,u,m){Um=!1;var b=a.updateQueue;wi=!1;var y=b.firstBaseUpdate,k=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var q=L,ie=q.next;q.next=null,k===null?y=ie:k.next=ie,k=q;var xe=a.alternate;xe!==null&&(xe=xe.updateQueue,L=xe.lastBaseUpdate,L!==k&&(L===null?xe.firstBaseUpdate=ie:L.next=ie,xe.lastBaseUpdate=q))}if(y!==null){var Te=b.baseState;k=0,xe=ie=q=null,L=y;do{var oe=L.lane&-536870913,me=oe!==L.lane;if(me?(Ft&oe)===oe:(m&oe)===oe){oe!==0&&oe===To&&(Um=!0),xe!==null&&(xe=xe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var ze=a,ct=L;oe=s;var hn=u;switch(ct.tag){case 1:if(ze=ct.payload,typeof ze=="function"){Te=ze.call(hn,Te,oe);break e}Te=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=ct.payload,oe=typeof ze=="function"?ze.call(hn,Te,oe):ze,oe==null)break e;Te=g({},Te,oe);break e;case 2:wi=!0}}oe=L.callback,oe!==null&&(a.flags|=64,me&&(a.flags|=8192),me=b.callbacks,me===null?b.callbacks=[oe]:me.push(oe))}else me={lane:oe,tag:L.tag,payload:L.payload,callback:L.callback,next:null},xe===null?(ie=xe=me,q=Te):xe=xe.next=me,k|=oe;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;me=L,L=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);xe===null&&(q=Te),b.baseState=q,b.firstBaseUpdate=ie,b.lastBaseUpdate=xe,y===null&&(b.shared.lanes=0),Ii|=k,a.lanes=k,a.memoizedState=Te}}function fx(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function hx(a,s){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)fx(u[a],s)}var Co=H(null),jd=H(0);function mx(a,s){a=Xs,D(jd,a),D(Co,s),Xs=a|s.baseLanes}function Hm(){D(jd,Xs),D(Co,Co.current)}function Fm(){Xs=jd.current,te(Co),te(jd)}var sa=H(null),Oa=null;function Ni(a){var s=a.alternate;D(jn,jn.current&1),D(sa,a),Oa===null&&(s===null||Co.current!==null||s.memoizedState!==null)&&(Oa=a)}function zm(a){D(jn,jn.current),D(sa,a),Oa===null&&(Oa=a)}function px(a){a.tag===22?(D(jn,jn.current),D(sa,a),Oa===null&&(Oa=a)):Ai()}function Ai(){D(jn,jn.current),D(sa,sa.current)}function ia(a){te(sa),Oa===a&&(Oa=null),te(jn)}var jn=H(0);function Md(a){for(var s=a;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Wp(u)||Qp(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var zs=0,Tt=null,dn=null,Yn=null,Pd=!1,So=!1,Al=!1,Bd=0,Fu=0,No=null,J5=0;function Rn(){throw Error(r(321))}function $m(a,s){if(s===null)return!1;for(var u=0;u<s.length&&u<a.length;u++)if(!ra(a[u],s[u]))return!1;return!0}function Vm(a,s,u,m,b,y){return zs=y,Tt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,F.H=a===null||a.memoizedState===null?Zx:sp,Al=!1,y=u(m,b),Al=!1,So&&(y=bx(s,u,m,b)),gx(a),y}function gx(a){F.H=Vu;var s=dn!==null&&dn.next!==null;if(zs=0,Yn=dn=Tt=null,Pd=!1,Fu=0,No=null,s)throw Error(r(300));a===null||Wn||(a=a.dependencies,a!==null&&Nd(a)&&(Wn=!0))}function bx(a,s,u,m){Tt=a;var b=0;do{if(So&&(No=null),Fu=0,So=!1,25<=b)throw Error(r(301));if(b+=1,Yn=dn=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}F.H=Jx,y=s(u,m)}while(So);return y}function eS(){var a=F.H,s=a.useState()[0];return s=typeof s.then=="function"?zu(s):s,a=a.useState()[0],(dn!==null?dn.memoizedState:null)!==a&&(Tt.flags|=1024),s}function Gm(){var a=Bd!==0;return Bd=0,a}function qm(a,s,u){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~u}function Ym(a){if(Pd){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Pd=!1}zs=0,Yn=dn=Tt=null,So=!1,Fu=Bd=0,No=null}function Mr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?Tt.memoizedState=Yn=a:Yn=Yn.next=a,Yn}function Mn(){if(dn===null){var a=Tt.alternate;a=a!==null?a.memoizedState:null}else a=dn.next;var s=Yn===null?Tt.memoizedState:Yn.next;if(s!==null)Yn=s,dn=a;else{if(a===null)throw Tt.alternate===null?Error(r(467)):Error(r(310));dn=a,a={memoizedState:dn.memoizedState,baseState:dn.baseState,baseQueue:dn.baseQueue,queue:dn.queue,next:null},Yn===null?Tt.memoizedState=Yn=a:Yn=Yn.next=a}return Yn}function Ud(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zu(a){var s=Fu;return Fu+=1,No===null&&(No=[]),a=lx(No,a,s),s=Tt,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,F.H=s===null||s.memoizedState===null?Zx:sp),a}function Hd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return zu(a);if(a.$$typeof===C)return br(a)}throw Error(r(438,String(a)))}function Wm(a){var s=null,u=Tt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var m=Tt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(s={data:m.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Ud(),Tt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(a),m=0;m<a;m++)u[m]=Q;return s.index++,u}function $s(a,s){return typeof s=="function"?s(a):s}function Fd(a){var s=Mn();return Qm(s,dn,a)}function Qm(a,s,u){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=u;var b=a.baseQueue,y=m.pending;if(y!==null){if(b!==null){var k=b.next;b.next=y.next,y.next=k}s.baseQueue=b=y,m.pending=null}if(y=a.baseState,b===null)a.memoizedState=y;else{s=b.next;var L=k=null,q=null,ie=s,xe=!1;do{var Te=ie.lane&-536870913;if(Te!==ie.lane?(Ft&Te)===Te:(zs&Te)===Te){var oe=ie.revertLane;if(oe===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),Te===To&&(xe=!0);else if((zs&oe)===oe){ie=ie.next,oe===To&&(xe=!0);continue}else Te={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(L=q=Te,k=y):q=q.next=Te,Tt.lanes|=oe,Ii|=oe;Te=ie.action,Al&&u(y,Te),y=ie.hasEagerState?ie.eagerState:u(y,Te)}else oe={lane:Te,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(L=q=oe,k=y):q=q.next=oe,Tt.lanes|=Te,Ii|=Te;ie=ie.next}while(ie!==null&&ie!==s);if(q===null?k=y:q.next=L,!ra(y,a.memoizedState)&&(Wn=!0,xe&&(u=vo,u!==null)))throw u;a.memoizedState=y,a.baseState=k,a.baseQueue=q,m.lastRenderedState=y}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Xm(a){var s=Mn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var m=u.dispatch,b=u.pending,y=s.memoizedState;if(b!==null){u.pending=null;var k=b=b.next;do y=a(y,k.action),k=k.next;while(k!==b);ra(y,s.memoizedState)||(Wn=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,m]}function xx(a,s,u){var m=Tt,b=Mn(),y=$t;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=s();var k=!ra((dn||b).memoizedState,u);if(k&&(b.memoizedState=u,Wn=!0),b=b.queue,Jm(_x.bind(null,m,b,a),[a]),b.getSnapshot!==s||k||Yn!==null&&Yn.memoizedState.tag&1){if(m.flags|=2048,Ao(9,{destroy:void 0},Ex.bind(null,m,b,u,s),null),pn===null)throw Error(r(349));y||(zs&127)!==0||yx(m,s,u)}return u}function yx(a,s,u){a.flags|=16384,a={getSnapshot:s,value:u},s=Tt.updateQueue,s===null?(s=Ud(),Tt.updateQueue=s,s.stores=[a]):(u=s.stores,u===null?s.stores=[a]:u.push(a))}function Ex(a,s,u,m){s.value=u,s.getSnapshot=m,Tx(s)&&vx(a)}function _x(a,s,u){return u(function(){Tx(s)&&vx(a)})}function Tx(a){var s=a.getSnapshot;a=a.value;try{var u=s();return!ra(a,u)}catch{return!0}}function vx(a){var s=El(a,2);s!==null&&Qr(s,a,2)}function Km(a){var s=Mr();if(typeof a=="function"){var u=a;if(a=u(),Al){Je(!0);try{u()}finally{Je(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:a},s}function kx(a,s,u,m){return a.baseState=u,Qm(a,dn,typeof m=="function"?m:$s)}function tS(a,s,u,m,b){if(Vd(a))throw Error(r(485));if(a=s.action,a!==null){var y={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};F.T!==null?u(!0):y.isTransition=!1,m(y),u=s.pending,u===null?(y.next=s.pending=y,wx(s,y)):(y.next=u.next,s.pending=u.next=y)}}function wx(a,s){var u=s.action,m=s.payload,b=a.state;if(s.isTransition){var y=F.T,k={};F.T=k;try{var L=u(b,m),q=F.S;q!==null&&q(k,L),Cx(a,s,L)}catch(ie){Zm(a,s,ie)}finally{y!==null&&k.types!==null&&(y.types=k.types),F.T=y}}else try{y=u(b,m),Cx(a,s,y)}catch(ie){Zm(a,s,ie)}}function Cx(a,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){Sx(a,s,m)},function(m){return Zm(a,s,m)}):Sx(a,s,u)}function Sx(a,s,u){s.status="fulfilled",s.value=u,Nx(s),a.state=u,s=a.pending,s!==null&&(u=s.next,u===s?a.pending=null:(u=u.next,s.next=u,wx(a,u)))}function Zm(a,s,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do s.status="rejected",s.reason=u,Nx(s),s=s.next;while(s!==m)}a.action=null}function Nx(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function Ax(a,s){return s}function Rx(a,s){if($t){var u=pn.formState;if(u!==null){e:{var m=Tt;if($t){if(Tn){t:{for(var b=Tn,y=Ia;b.nodeType!==8;){if(!y){b=null;break t}if(b=Da(b.nextSibling),b===null){b=null;break t}}y=b.data,b=y==="F!"||y==="F"?b:null}if(b){Tn=Da(b.nextSibling),m=b.data==="F!";break e}}vi(m)}m=!1}m&&(s=u[0])}}return u=Mr(),u.memoizedState=u.baseState=s,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ax,lastRenderedState:s},u.queue=m,u=Qx.bind(null,Tt,m),m.dispatch=u,m=Km(!1),y=ap.bind(null,Tt,!1,m.queue),m=Mr(),b={state:s,dispatch:null,action:a,pending:null},m.queue=b,u=tS.bind(null,Tt,b,y,u),b.dispatch=u,m.memoizedState=a,[s,u,!1]}function Lx(a){var s=Mn();return Ix(s,dn,a)}function Ix(a,s,u){if(s=Qm(a,s,Ax)[0],a=Fd($s)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var m=zu(s)}catch(k){throw k===ko?Ld:k}else m=s;s=Mn();var b=s.queue,y=b.dispatch;return u!==s.memoizedState&&(Tt.flags|=2048,Ao(9,{destroy:void 0},nS.bind(null,b,u),null)),[m,y,a]}function nS(a,s){a.action=s}function Ox(a){var s=Mn(),u=dn;if(u!==null)return Ix(s,u,a);Mn(),s=s.memoizedState,u=Mn();var m=u.queue.dispatch;return u.memoizedState=a,[s,m,!1]}function Ao(a,s,u,m){return a={tag:a,create:u,deps:m,inst:s,next:null},s=Tt.updateQueue,s===null&&(s=Ud(),Tt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=a.next=a:(m=u.next,u.next=a,a.next=m,s.lastEffect=a),a}function Dx(){return Mn().memoizedState}function zd(a,s,u,m){var b=Mr();Tt.flags|=a,b.memoizedState=Ao(1|s,{destroy:void 0},u,m===void 0?null:m)}function $d(a,s,u,m){var b=Mn();m=m===void 0?null:m;var y=b.memoizedState.inst;dn!==null&&m!==null&&$m(m,dn.memoizedState.deps)?b.memoizedState=Ao(s,y,u,m):(Tt.flags|=a,b.memoizedState=Ao(1|s,y,u,m))}function jx(a,s){zd(8390656,8,a,s)}function Jm(a,s){$d(2048,8,a,s)}function rS(a){Tt.flags|=4;var s=Tt.updateQueue;if(s===null)s=Ud(),Tt.updateQueue=s,s.events=[a];else{var u=s.events;u===null?s.events=[a]:u.push(a)}}function Mx(a){var s=Mn().memoizedState;return rS({ref:s,nextImpl:a}),function(){if((en&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Px(a,s){return $d(4,2,a,s)}function Bx(a,s){return $d(4,4,a,s)}function Ux(a,s){if(typeof s=="function"){a=a();var u=s(a);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function Hx(a,s,u){u=u!=null?u.concat([a]):null,$d(4,4,Ux.bind(null,s,a),u)}function ep(){}function Fx(a,s){var u=Mn();s=s===void 0?null:s;var m=u.memoizedState;return s!==null&&$m(s,m[1])?m[0]:(u.memoizedState=[a,s],a)}function zx(a,s){var u=Mn();s=s===void 0?null:s;var m=u.memoizedState;if(s!==null&&$m(s,m[1]))return m[0];if(m=a(),Al){Je(!0);try{a()}finally{Je(!1)}}return u.memoizedState=[m,s],m}function tp(a,s,u){return u===void 0||(zs&1073741824)!==0&&(Ft&261930)===0?a.memoizedState=s:(a.memoizedState=u,a=$y(),Tt.lanes|=a,Ii|=a,u)}function $x(a,s,u,m){return ra(u,s)?u:Co.current!==null?(a=tp(a,u,m),ra(a,s)||(Wn=!0),a):(zs&42)===0||(zs&1073741824)!==0&&(Ft&261930)===0?(Wn=!0,a.memoizedState=u):(a=$y(),Tt.lanes|=a,Ii|=a,s)}function Vx(a,s,u,m,b){var y=$.p;$.p=y!==0&&8>y?y:8;var k=F.T,L={};F.T=L,ap(a,!1,s,u);try{var q=b(),ie=F.S;if(ie!==null&&ie(L,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var xe=Z5(q,m);$u(a,s,xe,ua(a))}else $u(a,s,m,ua(a))}catch(Te){$u(a,s,{then:function(){},status:"rejected",reason:Te},ua())}finally{$.p=y,k!==null&&L.types!==null&&(k.types=L.types),F.T=k}}function aS(){}function np(a,s,u,m){if(a.tag!==5)throw Error(r(476));var b=Gx(a).queue;Vx(a,b,s,J,u===null?aS:function(){return qx(a),u(m)})}function Gx(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:J},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:u},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function qx(a){var s=Gx(a);s.next===null&&(s=a.alternate.memoizedState),$u(a,s.next.queue,{},ua())}function rp(){return br(ic)}function Yx(){return Mn().memoizedState}function Wx(){return Mn().memoizedState}function sS(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var u=ua();a=Ci(u);var m=Si(s,a,u);m!==null&&(Qr(m,s,u),Bu(m,s,u)),s={cache:Im()},a.payload=s;return}s=s.return}}function iS(a,s,u){var m=ua();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Vd(a)?Xx(s,u):(u=_m(a,s,u,m),u!==null&&(Qr(u,a,m),Kx(u,s,m)))}function Qx(a,s,u){var m=ua();$u(a,s,u,m)}function $u(a,s,u,m){var b={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Vd(a))Xx(s,b);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var k=s.lastRenderedState,L=y(k,u);if(b.hasEagerState=!0,b.eagerState=L,ra(L,k))return kd(a,s,b,0),pn===null&&vd(),!1}catch{}finally{}if(u=_m(a,s,b,m),u!==null)return Qr(u,a,m),Kx(u,s,m),!0}return!1}function ap(a,s,u,m){if(m={lane:2,revertLane:Mp(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Vd(a)){if(s)throw Error(r(479))}else s=_m(a,u,m,2),s!==null&&Qr(s,a,2)}function Vd(a){var s=a.alternate;return a===Tt||s!==null&&s===Tt}function Xx(a,s){So=Pd=!0;var u=a.pending;u===null?s.next=s:(s.next=u.next,u.next=s),a.pending=s}function Kx(a,s,u){if((u&4194048)!==0){var m=s.lanes;m&=a.pendingLanes,u|=m,s.lanes=u,Zn(a,u)}}var Vu={readContext:br,use:Hd,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};Vu.useEffectEvent=Rn;var Zx={readContext:br,use:Hd,useCallback:function(a,s){return Mr().memoizedState=[a,s===void 0?null:s],a},useContext:br,useEffect:jx,useImperativeHandle:function(a,s,u){u=u!=null?u.concat([a]):null,zd(4194308,4,Ux.bind(null,s,a),u)},useLayoutEffect:function(a,s){return zd(4194308,4,a,s)},useInsertionEffect:function(a,s){zd(4,2,a,s)},useMemo:function(a,s){var u=Mr();s=s===void 0?null:s;var m=a();if(Al){Je(!0);try{a()}finally{Je(!1)}}return u.memoizedState=[m,s],m},useReducer:function(a,s,u){var m=Mr();if(u!==void 0){var b=u(s);if(Al){Je(!0);try{u(s)}finally{Je(!1)}}}else b=s;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=iS.bind(null,Tt,a),[m.memoizedState,a]},useRef:function(a){var s=Mr();return a={current:a},s.memoizedState=a},useState:function(a){a=Km(a);var s=a.queue,u=Qx.bind(null,Tt,s);return s.dispatch=u,[a.memoizedState,u]},useDebugValue:ep,useDeferredValue:function(a,s){var u=Mr();return tp(u,a,s)},useTransition:function(){var a=Km(!1);return a=Vx.bind(null,Tt,a.queue,!0,!1),Mr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,u){var m=Tt,b=Mr();if($t){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),pn===null)throw Error(r(349));(Ft&127)!==0||yx(m,s,u)}b.memoizedState=u;var y={value:u,getSnapshot:s};return b.queue=y,jx(_x.bind(null,m,y,a),[a]),m.flags|=2048,Ao(9,{destroy:void 0},Ex.bind(null,m,y,u,s),null),u},useId:function(){var a=Mr(),s=pn.identifierPrefix;if($t){var u=ms,m=hs;u=(m&~(1<<32-He(m)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Bd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=J5++,s="_"+s+"r_"+u.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:rp,useFormState:Rx,useActionState:Rx,useOptimistic:function(a){var s=Mr();s.memoizedState=s.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=ap.bind(null,Tt,!0,u),u.dispatch=s,[a,s]},useMemoCache:Wm,useCacheRefresh:function(){return Mr().memoizedState=sS.bind(null,Tt)},useEffectEvent:function(a){var s=Mr(),u={impl:a};return s.memoizedState=u,function(){if((en&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},sp={readContext:br,use:Hd,useCallback:Fx,useContext:br,useEffect:Jm,useImperativeHandle:Hx,useInsertionEffect:Px,useLayoutEffect:Bx,useMemo:zx,useReducer:Fd,useRef:Dx,useState:function(){return Fd($s)},useDebugValue:ep,useDeferredValue:function(a,s){var u=Mn();return $x(u,dn.memoizedState,a,s)},useTransition:function(){var a=Fd($s)[0],s=Mn().memoizedState;return[typeof a=="boolean"?a:zu(a),s]},useSyncExternalStore:xx,useId:Yx,useHostTransitionStatus:rp,useFormState:Lx,useActionState:Lx,useOptimistic:function(a,s){var u=Mn();return kx(u,dn,a,s)},useMemoCache:Wm,useCacheRefresh:Wx};sp.useEffectEvent=Mx;var Jx={readContext:br,use:Hd,useCallback:Fx,useContext:br,useEffect:Jm,useImperativeHandle:Hx,useInsertionEffect:Px,useLayoutEffect:Bx,useMemo:zx,useReducer:Xm,useRef:Dx,useState:function(){return Xm($s)},useDebugValue:ep,useDeferredValue:function(a,s){var u=Mn();return dn===null?tp(u,a,s):$x(u,dn.memoizedState,a,s)},useTransition:function(){var a=Xm($s)[0],s=Mn().memoizedState;return[typeof a=="boolean"?a:zu(a),s]},useSyncExternalStore:xx,useId:Yx,useHostTransitionStatus:rp,useFormState:Ox,useActionState:Ox,useOptimistic:function(a,s){var u=Mn();return dn!==null?kx(u,dn,a,s):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Wm,useCacheRefresh:Wx};Jx.useEffectEvent=Mx;function ip(a,s,u,m){s=a.memoizedState,u=u(m,s),u=u==null?s:g({},s,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var lp={enqueueSetState:function(a,s,u){a=a._reactInternals;var m=ua(),b=Ci(m);b.payload=s,u!=null&&(b.callback=u),s=Si(a,b,m),s!==null&&(Qr(s,a,m),Bu(s,a,m))},enqueueReplaceState:function(a,s,u){a=a._reactInternals;var m=ua(),b=Ci(m);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=Si(a,b,m),s!==null&&(Qr(s,a,m),Bu(s,a,m))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var u=ua(),m=Ci(u);m.tag=2,s!=null&&(m.callback=s),s=Si(a,m,u),s!==null&&(Qr(s,a,u),Bu(s,a,u))}};function ey(a,s,u,m,b,y,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,y,k):s.prototype&&s.prototype.isPureReactComponent?!Ru(u,m)||!Ru(b,y):!0}function ty(a,s,u,m){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,m),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,m),s.state!==a&&lp.enqueueReplaceState(s,s.state,null)}function Rl(a,s){var u=s;if("ref"in s){u={};for(var m in s)m!=="ref"&&(u[m]=s[m])}if(a=a.defaultProps){u===s&&(u=g({},u));for(var b in a)u[b]===void 0&&(u[b]=a[b])}return u}function ny(a){Td(a)}function ry(a){console.error(a)}function ay(a){Td(a)}function Gd(a,s){try{var u=a.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(m){setTimeout(function(){throw m})}}function sy(a,s,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function op(a,s,u){return u=Ci(u),u.tag=3,u.payload={element:null},u.callback=function(){Gd(a,s)},u}function iy(a){return a=Ci(a),a.tag=3,a}function ly(a,s,u,m){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var y=m.value;a.payload=function(){return b(y)},a.callback=function(){sy(s,u,m)}}var k=u.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){sy(s,u,m),typeof b!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var L=m.stack;this.componentDidCatch(m.value,{componentStack:L!==null?L:""})})}function lS(a,s,u,m,b){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(s=u.alternate,s!==null&&_o(s,u,b,!0),u=sa.current,u!==null){switch(u.tag){case 31:case 13:return Oa===null?rf():u.alternate===null&&Ln===0&&(Ln=3),u.flags&=-257,u.flags|=65536,u.lanes=b,m===Id?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([m]):s.add(m),Op(a,m,b)),!1;case 22:return u.flags|=65536,m===Id?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([m]):u.add(m)),Op(a,m,b)),!1}throw Error(r(435,u.tag))}return Op(a,m,b),rf(),!1}if($t)return s=sa.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,m!==Sm&&(a=Error(r(422),{cause:m}),Ou(Aa(a,u)))):(m!==Sm&&(s=Error(r(423),{cause:m}),Ou(Aa(s,u))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=Aa(m,u),b=op(a.stateNode,m,b),Bm(a,b),Ln!==4&&(Ln=2)),!1;var y=Error(r(520),{cause:m});if(y=Aa(y,u),Zu===null?Zu=[y]:Zu.push(y),Ln!==4&&(Ln=2),s===null)return!0;m=Aa(m,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,a=b&-b,u.lanes|=a,a=op(u.stateNode,m,a),Bm(u,a),!1;case 1:if(s=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Oi===null||!Oi.has(y))))return u.flags|=65536,b&=-b,u.lanes|=b,b=iy(b),ly(b,a,u,m),Bm(u,b),!1}u=u.return}while(u!==null);return!1}var up=Error(r(461)),Wn=!1;function xr(a,s,u,m){s.child=a===null?dx(s,null,u,m):Nl(s,a.child,u,m)}function oy(a,s,u,m,b){u=u.render;var y=s.ref;if("ref"in m){var k={};for(var L in m)L!=="ref"&&(k[L]=m[L])}else k=m;return kl(s),m=Vm(a,s,u,k,y,b),L=Gm(),a!==null&&!Wn?(qm(a,s,b),Vs(a,s,b)):($t&&L&&wm(s),s.flags|=1,xr(a,s,m,b),s.child)}function uy(a,s,u,m,b){if(a===null){var y=u.type;return typeof y=="function"&&!Tm(y)&&y.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=y,cy(a,s,y,m,b)):(a=Cd(u.type,null,m,s,s.mode,b),a.ref=s.ref,a.return=s,s.child=a)}if(y=a.child,!bp(a,b)){var k=y.memoizedProps;if(u=u.compare,u=u!==null?u:Ru,u(k,m)&&a.ref===s.ref)return Vs(a,s,b)}return s.flags|=1,a=Bs(y,m),a.ref=s.ref,a.return=s,s.child=a}function cy(a,s,u,m,b){if(a!==null){var y=a.memoizedProps;if(Ru(y,m)&&a.ref===s.ref)if(Wn=!1,s.pendingProps=m=y,bp(a,b))(a.flags&131072)!==0&&(Wn=!0);else return s.lanes=a.lanes,Vs(a,s,b)}return cp(a,s,u,m,b)}function dy(a,s,u,m){var b=m.children,y=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|u:u,a!==null){for(m=s.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~y}else m=0,s.child=null;return fy(a,s,y,u,m)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Rd(s,y!==null?y.cachePool:null),y!==null?mx(s,y):Hm(),px(s);else return m=s.lanes=536870912,fy(a,s,y!==null?y.baseLanes|u:u,u,m)}else y!==null?(Rd(s,y.cachePool),mx(s,y),Ai(),s.memoizedState=null):(a!==null&&Rd(s,null),Hm(),Ai());return xr(a,s,b,u),s.child}function Gu(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function fy(a,s,u,m,b){var y=Dm();return y=y===null?null:{parent:qn._currentValue,pool:y},s.memoizedState={baseLanes:u,cachePool:y},a!==null&&Rd(s,null),Hm(),px(s),a!==null&&_o(a,s,m,!0),s.childLanes=b,null}function qd(a,s){return s=Wd({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function hy(a,s,u){return Nl(s,a.child,null,u),a=qd(s,s.pendingProps),a.flags|=2,ia(s),s.memoizedState=null,a}function oS(a,s,u){var m=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,a===null){if($t){if(m.mode==="hidden")return a=qd(s,m),s.lanes=536870912,Gu(null,a);if(zm(s),(a=Tn)?(a=wE(a,Ia),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:_i!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},u=Xb(a),u.return=s,s.child=u,gr=s,Tn=null)):a=null,a===null)throw vi(s);return s.lanes=536870912,null}return qd(s,m)}var y=a.memoizedState;if(y!==null){var k=y.dehydrated;if(zm(s),b)if(s.flags&256)s.flags&=-257,s=hy(a,s,u);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if(Wn||_o(a,s,u,!1),b=(u&a.childLanes)!==0,Wn||b){if(m=pn,m!==null&&(k=ll(m,u),k!==0&&k!==y.retryLane))throw y.retryLane=k,El(a,k),Qr(m,a,k),up;rf(),s=hy(a,s,u)}else a=y.treeContext,Tn=Da(k.nextSibling),gr=s,$t=!0,Ti=null,Ia=!1,a!==null&&Jb(s,a),s=qd(s,m),s.flags|=4096;return s}return a=Bs(a.child,{mode:m.mode,children:m.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Yd(a,s){var u=s.ref;if(u===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(s.flags|=4194816)}}function cp(a,s,u,m,b){return kl(s),u=Vm(a,s,u,m,void 0,b),m=Gm(),a!==null&&!Wn?(qm(a,s,b),Vs(a,s,b)):($t&&m&&wm(s),s.flags|=1,xr(a,s,u,b),s.child)}function my(a,s,u,m,b,y){return kl(s),s.updateQueue=null,u=bx(s,m,u,b),gx(a),m=Gm(),a!==null&&!Wn?(qm(a,s,y),Vs(a,s,y)):($t&&m&&wm(s),s.flags|=1,xr(a,s,u,y),s.child)}function py(a,s,u,m,b){if(kl(s),s.stateNode===null){var y=bo,k=u.contextType;typeof k=="object"&&k!==null&&(y=br(k)),y=new u(m,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=lp,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=m,y.state=s.memoizedState,y.refs={},Mm(s),k=u.contextType,y.context=typeof k=="object"&&k!==null?br(k):bo,y.state=s.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(ip(s,u,k,m),y.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&lp.enqueueReplaceState(y,y.state,null),Hu(s,m,y,b),Uu(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),m=!0}else if(a===null){y=s.stateNode;var L=s.memoizedProps,q=Rl(u,L);y.props=q;var ie=y.context,xe=u.contextType;k=bo,typeof xe=="object"&&xe!==null&&(k=br(xe));var Te=u.getDerivedStateFromProps;xe=typeof Te=="function"||typeof y.getSnapshotBeforeUpdate=="function",L=s.pendingProps!==L,xe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(L||ie!==k)&&ty(s,y,m,k),wi=!1;var oe=s.memoizedState;y.state=oe,Hu(s,m,y,b),Uu(),ie=s.memoizedState,L||oe!==ie||wi?(typeof Te=="function"&&(ip(s,u,Te,m),ie=s.memoizedState),(q=wi||ey(s,u,q,m,oe,ie,k))?(xe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=m,s.memoizedState=ie),y.props=m,y.state=ie,y.context=k,m=q):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),m=!1)}else{y=s.stateNode,Pm(a,s),k=s.memoizedProps,xe=Rl(u,k),y.props=xe,Te=s.pendingProps,oe=y.context,ie=u.contextType,q=bo,typeof ie=="object"&&ie!==null&&(q=br(ie)),L=u.getDerivedStateFromProps,(ie=typeof L=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==Te||oe!==q)&&ty(s,y,m,q),wi=!1,oe=s.memoizedState,y.state=oe,Hu(s,m,y,b),Uu();var me=s.memoizedState;k!==Te||oe!==me||wi||a!==null&&a.dependencies!==null&&Nd(a.dependencies)?(typeof L=="function"&&(ip(s,u,L,m),me=s.memoizedState),(xe=wi||ey(s,u,xe,m,oe,me,q)||a!==null&&a.dependencies!==null&&Nd(a.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(m,me,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(m,me,q)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===a.memoizedProps&&oe===a.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&oe===a.memoizedState||(s.flags|=1024),s.memoizedProps=m,s.memoizedState=me),y.props=m,y.state=me,y.context=q,m=xe):(typeof y.componentDidUpdate!="function"||k===a.memoizedProps&&oe===a.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&oe===a.memoizedState||(s.flags|=1024),m=!1)}return y=m,Yd(a,s),m=(s.flags&128)!==0,y||m?(y=s.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,a!==null&&m?(s.child=Nl(s,a.child,null,b),s.child=Nl(s,null,u,b)):xr(a,s,u,b),s.memoizedState=y.state,a=s.child):a=Vs(a,s,b),a}function gy(a,s,u,m){return Tl(),s.flags|=256,xr(a,s,u,m),s.child}var dp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fp(a){return{baseLanes:a,cachePool:sx()}}function hp(a,s,u){return a=a!==null?a.childLanes&~u:0,s&&(a|=oa),a}function by(a,s,u){var m=s.pendingProps,b=!1,y=(s.flags&128)!==0,k;if((k=y)||(k=a!==null&&a.memoizedState===null?!1:(jn.current&2)!==0),k&&(b=!0,s.flags&=-129),k=(s.flags&32)!==0,s.flags&=-33,a===null){if($t){if(b?Ni(s):Ai(),(a=Tn)?(a=wE(a,Ia),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:_i!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},u=Xb(a),u.return=s,s.child=u,gr=s,Tn=null)):a=null,a===null)throw vi(s);return Qp(a)?s.lanes=32:s.lanes=536870912,null}var L=m.children;return m=m.fallback,b?(Ai(),b=s.mode,L=Wd({mode:"hidden",children:L},b),m=_l(m,b,u,null),L.return=s,m.return=s,L.sibling=m,s.child=L,m=s.child,m.memoizedState=fp(u),m.childLanes=hp(a,k,u),s.memoizedState=dp,Gu(null,m)):(Ni(s),mp(s,L))}var q=a.memoizedState;if(q!==null&&(L=q.dehydrated,L!==null)){if(y)s.flags&256?(Ni(s),s.flags&=-257,s=pp(a,s,u)):s.memoizedState!==null?(Ai(),s.child=a.child,s.flags|=128,s=null):(Ai(),L=m.fallback,b=s.mode,m=Wd({mode:"visible",children:m.children},b),L=_l(L,b,u,null),L.flags|=2,m.return=s,L.return=s,m.sibling=L,s.child=m,Nl(s,a.child,null,u),m=s.child,m.memoizedState=fp(u),m.childLanes=hp(a,k,u),s.memoizedState=dp,s=Gu(null,m));else if(Ni(s),Qp(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var ie=k.dgst;k=ie,m=Error(r(419)),m.stack="",m.digest=k,Ou({value:m,source:null,stack:null}),s=pp(a,s,u)}else if(Wn||_o(a,s,u,!1),k=(u&a.childLanes)!==0,Wn||k){if(k=pn,k!==null&&(m=ll(k,u),m!==0&&m!==q.retryLane))throw q.retryLane=m,El(a,m),Qr(k,a,m),up;Wp(L)||rf(),s=pp(a,s,u)}else Wp(L)?(s.flags|=192,s.child=a.child,s=null):(a=q.treeContext,Tn=Da(L.nextSibling),gr=s,$t=!0,Ti=null,Ia=!1,a!==null&&Jb(s,a),s=mp(s,m.children),s.flags|=4096);return s}return b?(Ai(),L=m.fallback,b=s.mode,q=a.child,ie=q.sibling,m=Bs(q,{mode:"hidden",children:m.children}),m.subtreeFlags=q.subtreeFlags&65011712,ie!==null?L=Bs(ie,L):(L=_l(L,b,u,null),L.flags|=2),L.return=s,m.return=s,m.sibling=L,s.child=m,Gu(null,m),m=s.child,L=a.child.memoizedState,L===null?L=fp(u):(b=L.cachePool,b!==null?(q=qn._currentValue,b=b.parent!==q?{parent:q,pool:q}:b):b=sx(),L={baseLanes:L.baseLanes|u,cachePool:b}),m.memoizedState=L,m.childLanes=hp(a,k,u),s.memoizedState=dp,Gu(a.child,m)):(Ni(s),u=a.child,a=u.sibling,u=Bs(u,{mode:"visible",children:m.children}),u.return=s,u.sibling=null,a!==null&&(k=s.deletions,k===null?(s.deletions=[a],s.flags|=16):k.push(a)),s.child=u,s.memoizedState=null,u)}function mp(a,s){return s=Wd({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function Wd(a,s){return a=aa(22,a,null,s),a.lanes=0,a}function pp(a,s,u){return Nl(s,a.child,null,u),a=mp(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function xy(a,s,u){a.lanes|=s;var m=a.alternate;m!==null&&(m.lanes|=s),Rm(a.return,s,u)}function gp(a,s,u,m,b,y){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:b,treeForkCount:y}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=u,k.tailMode=b,k.treeForkCount=y)}function yy(a,s,u){var m=s.pendingProps,b=m.revealOrder,y=m.tail;m=m.children;var k=jn.current,L=(k&2)!==0;if(L?(k=k&1|2,s.flags|=128):k&=1,D(jn,k),xr(a,s,m,u),m=$t?Iu:0,!L&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&xy(a,u,s);else if(a.tag===19)xy(a,u,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(u=s.child,b=null;u!==null;)a=u.alternate,a!==null&&Md(a)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),gp(s,!1,b,u,y,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(a=b.alternate,a!==null&&Md(a)===null){s.child=b;break}a=b.sibling,b.sibling=u,u=b,b=a}gp(s,!0,u,null,y,m);break;case"together":gp(s,!1,null,null,void 0,m);break;default:s.memoizedState=null}return s.child}function Vs(a,s,u){if(a!==null&&(s.dependencies=a.dependencies),Ii|=s.lanes,(u&s.childLanes)===0)if(a!==null){if(_o(a,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,u=Bs(a,a.pendingProps),s.child=u,u.return=s;a.sibling!==null;)a=a.sibling,u=u.sibling=Bs(a,a.pendingProps),u.return=s;u.sibling=null}return s.child}function bp(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Nd(a)))}function uS(a,s,u){switch(s.tag){case 3:Ze(s,s.stateNode.containerInfo),ki(s,qn,a.memoizedState.cache),Tl();break;case 27:case 5:Dt(s);break;case 4:Ze(s,s.stateNode.containerInfo);break;case 10:ki(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,zm(s),null;break;case 13:var m=s.memoizedState;if(m!==null)return m.dehydrated!==null?(Ni(s),s.flags|=128,null):(u&s.child.childLanes)!==0?by(a,s,u):(Ni(s),a=Vs(a,s,u),a!==null?a.sibling:null);Ni(s);break;case 19:var b=(a.flags&128)!==0;if(m=(u&s.childLanes)!==0,m||(_o(a,s,u,!1),m=(u&s.childLanes)!==0),b){if(m)return yy(a,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),D(jn,jn.current),m)break;return null;case 22:return s.lanes=0,dy(a,s,u,s.pendingProps);case 24:ki(s,qn,a.memoizedState.cache)}return Vs(a,s,u)}function Ey(a,s,u){if(a!==null)if(a.memoizedProps!==s.pendingProps)Wn=!0;else{if(!bp(a,u)&&(s.flags&128)===0)return Wn=!1,uS(a,s,u);Wn=(a.flags&131072)!==0}else Wn=!1,$t&&(s.flags&1048576)!==0&&Zb(s,Iu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var m=s.pendingProps;if(a=Cl(s.elementType),s.type=a,typeof a=="function")Tm(a)?(m=Rl(a,m),s.tag=1,s=py(null,s,a,m,u)):(s.tag=0,s=cp(null,s,a,m,u));else{if(a!=null){var b=a.$$typeof;if(b===O){s.tag=11,s=oy(null,s,a,m,u);break e}else if(b===B){s.tag=14,s=uy(null,s,a,m,u);break e}}throw s=ge(a)||a,Error(r(306,s,""))}}return s;case 0:return cp(a,s,s.type,s.pendingProps,u);case 1:return m=s.type,b=Rl(m,s.pendingProps),py(a,s,m,b,u);case 3:e:{if(Ze(s,s.stateNode.containerInfo),a===null)throw Error(r(387));m=s.pendingProps;var y=s.memoizedState;b=y.element,Pm(a,s),Hu(s,m,null,u);var k=s.memoizedState;if(m=k.cache,ki(s,qn,m),m!==y.cache&&Lm(s,[qn],u,!0),Uu(),m=k.element,y.isDehydrated)if(y={element:m,isDehydrated:!1,cache:k.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=gy(a,s,m,u);break e}else if(m!==b){b=Aa(Error(r(424)),s),Ou(b),s=gy(a,s,m,u);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Tn=Da(a.firstChild),gr=s,$t=!0,Ti=null,Ia=!0,u=dx(s,null,m,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Tl(),m===b){s=Vs(a,s,u);break e}xr(a,s,m,u)}s=s.child}return s;case 26:return Yd(a,s),a===null?(u=LE(s.type,null,s.pendingProps,null))?s.memoizedState=u:$t||(u=s.type,a=s.pendingProps,m=df(Ne.current).createElement(u),m[kn]=s,m[bn]=a,yr(m,u,a),Wt(m),s.stateNode=m):s.memoizedState=LE(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return Dt(s),a===null&&$t&&(m=s.stateNode=NE(s.type,s.pendingProps,Ne.current),gr=s,Ia=!0,b=Tn,Pi(s.type)?(Xp=b,Tn=Da(m.firstChild)):Tn=b),xr(a,s,s.pendingProps.children,u),Yd(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&$t&&((b=m=Tn)&&(m=US(m,s.type,s.pendingProps,Ia),m!==null?(s.stateNode=m,gr=s,Tn=Da(m.firstChild),Ia=!1,b=!0):b=!1),b||vi(s)),Dt(s),b=s.type,y=s.pendingProps,k=a!==null?a.memoizedProps:null,m=y.children,Gp(b,y)?m=null:k!==null&&Gp(b,k)&&(s.flags|=32),s.memoizedState!==null&&(b=Vm(a,s,eS,null,null,u),ic._currentValue=b),Yd(a,s),xr(a,s,m,u),s.child;case 6:return a===null&&$t&&((a=u=Tn)&&(u=HS(u,s.pendingProps,Ia),u!==null?(s.stateNode=u,gr=s,Tn=null,a=!0):a=!1),a||vi(s)),null;case 13:return by(a,s,u);case 4:return Ze(s,s.stateNode.containerInfo),m=s.pendingProps,a===null?s.child=Nl(s,null,m,u):xr(a,s,m,u),s.child;case 11:return oy(a,s,s.type,s.pendingProps,u);case 7:return xr(a,s,s.pendingProps,u),s.child;case 8:return xr(a,s,s.pendingProps.children,u),s.child;case 12:return xr(a,s,s.pendingProps.children,u),s.child;case 10:return m=s.pendingProps,ki(s,s.type,m.value),xr(a,s,m.children,u),s.child;case 9:return b=s.type._context,m=s.pendingProps.children,kl(s),b=br(b),m=m(b),s.flags|=1,xr(a,s,m,u),s.child;case 14:return uy(a,s,s.type,s.pendingProps,u);case 15:return cy(a,s,s.type,s.pendingProps,u);case 19:return yy(a,s,u);case 31:return oS(a,s,u);case 22:return dy(a,s,u,s.pendingProps);case 24:return kl(s),m=br(qn),a===null?(b=Dm(),b===null&&(b=pn,y=Im(),b.pooledCache=y,y.refCount++,y!==null&&(b.pooledCacheLanes|=u),b=y),s.memoizedState={parent:m,cache:b},Mm(s),ki(s,qn,b)):((a.lanes&u)!==0&&(Pm(a,s),Hu(s,null,null,u),Uu()),b=a.memoizedState,y=s.memoizedState,b.parent!==m?(b={parent:m,cache:m},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),ki(s,qn,m)):(m=y.cache,ki(s,qn,m),m!==b.cache&&Lm(s,[qn],u,!0))),xr(a,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Gs(a){a.flags|=4}function xp(a,s,u,m,b){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(Yy())a.flags|=8192;else throw Sl=Id,jm}else a.flags&=-16777217}function _y(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!ME(s))if(Yy())a.flags|=8192;else throw Sl=Id,jm}function Qd(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?_r():536870912,a.lanes|=s,Oo|=s)}function qu(a,s){if(!$t)switch(a.tailMode){case"hidden":s=a.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function vn(a){var s=a.alternate!==null&&a.alternate.child===a.child,u=0,m=0;if(s)for(var b=a.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=u,s}function cS(a,s,u){var m=s.pendingProps;switch(Cm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(s),null;case 1:return vn(s),null;case 3:return u=s.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),s.memoizedState.cache!==m&&(s.flags|=2048),Fs(qn),je(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Eo(s)?Gs(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Nm())),vn(s),null;case 26:var b=s.type,y=s.memoizedState;return a===null?(Gs(s),y!==null?(vn(s),_y(s,y)):(vn(s),xp(s,b,null,m,u))):y?y!==a.memoizedState?(Gs(s),vn(s),_y(s,y)):(vn(s),s.flags&=-16777217):(a=a.memoizedProps,a!==m&&Gs(s),vn(s),xp(s,b,a,m,u)),null;case 27:if(Ue(s),u=Ne.current,b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Gs(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return vn(s),null}a=we.current,Eo(s)?ex(s):(a=NE(b,m,u),s.stateNode=a,Gs(s))}return vn(s),null;case 5:if(Ue(s),b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Gs(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return vn(s),null}if(y=we.current,Eo(s))ex(s);else{var k=df(Ne.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof m.is=="string"?k.createElement("select",{is:m.is}):k.createElement("select"),m.multiple?y.multiple=!0:m.size&&(y.size=m.size);break;default:y=typeof m.is=="string"?k.createElement(b,{is:m.is}):k.createElement(b)}}y[kn]=s,y[bn]=m;e:for(k=s.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===s)break e;for(;k.sibling===null;){if(k.return===null||k.return===s)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}s.stateNode=y;e:switch(yr(y,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Gs(s)}}return vn(s),xp(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,u),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==m&&Gs(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(a=Ne.current,Eo(s)){if(a=s.stateNode,u=s.memoizedProps,m=null,b=gr,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[kn]=s,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||bE(a.nodeValue,u)),a||vi(s,!0)}else a=df(a).createTextNode(m),a[kn]=s,s.stateNode=a}return vn(s),null;case 31:if(u=s.memoizedState,a===null||a.memoizedState!==null){if(m=Eo(s),u!==null){if(a===null){if(!m)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[kn]=s}else Tl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;vn(s),a=!1}else u=Nm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return s.flags&256?(ia(s),s):(ia(s),null);if((s.flags&128)!==0)throw Error(r(558))}return vn(s),null;case 13:if(m=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Eo(s),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[kn]=s}else Tl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;vn(s),b=!1}else b=Nm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(ia(s),s):(ia(s),null)}return ia(s),(s.flags&128)!==0?(s.lanes=u,s):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=s.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),y=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(y=m.memoizedState.cachePool.pool),y!==b&&(m.flags|=2048)),u!==a&&u&&(s.child.flags|=8192),Qd(s,s.updateQueue),vn(s),null);case 4:return je(),a===null&&Hp(s.stateNode.containerInfo),vn(s),null;case 10:return Fs(s.type),vn(s),null;case 19:if(te(jn),m=s.memoizedState,m===null)return vn(s),null;if(b=(s.flags&128)!==0,y=m.rendering,y===null)if(b)qu(m,!1);else{if(Ln!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(y=Md(a),y!==null){for(s.flags|=128,qu(m,!1),a=y.updateQueue,s.updateQueue=a,Qd(s,a),s.subtreeFlags=0,a=u,u=s.child;u!==null;)Qb(u,a),u=u.sibling;return D(jn,jn.current&1|2),$t&&Us(s,m.treeForkCount),s.child}a=a.sibling}m.tail!==null&&_t()>ef&&(s.flags|=128,b=!0,qu(m,!1),s.lanes=4194304)}else{if(!b)if(a=Md(y),a!==null){if(s.flags|=128,b=!0,a=a.updateQueue,s.updateQueue=a,Qd(s,a),qu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!y.alternate&&!$t)return vn(s),null}else 2*_t()-m.renderingStartTime>ef&&u!==536870912&&(s.flags|=128,b=!0,qu(m,!1),s.lanes=4194304);m.isBackwards?(y.sibling=s.child,s.child=y):(a=m.last,a!==null?a.sibling=y:s.child=y,m.last=y)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=_t(),a.sibling=null,u=jn.current,D(jn,b?u&1|2:u&1),$t&&Us(s,m.treeForkCount),a):(vn(s),null);case 22:case 23:return ia(s),Fm(),m=s.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(u&536870912)!==0&&(s.flags&128)===0&&(vn(s),s.subtreeFlags&6&&(s.flags|=8192)):vn(s),u=s.updateQueue,u!==null&&Qd(s,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==u&&(s.flags|=2048),a!==null&&te(wl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Fs(qn),vn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function dS(a,s){switch(Cm(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Fs(qn),je(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Ue(s),null;case 31:if(s.memoizedState!==null){if(ia(s),s.alternate===null)throw Error(r(340));Tl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(ia(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Tl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return te(jn),null;case 4:return je(),null;case 10:return Fs(s.type),null;case 22:case 23:return ia(s),Fm(),a!==null&&te(wl),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return Fs(qn),null;case 25:return null;default:return null}}function Ty(a,s){switch(Cm(s),s.tag){case 3:Fs(qn),je();break;case 26:case 27:case 5:Ue(s);break;case 4:je();break;case 31:s.memoizedState!==null&&ia(s);break;case 13:ia(s);break;case 19:te(jn);break;case 10:Fs(s.type);break;case 22:case 23:ia(s),Fm(),a!==null&&te(wl);break;case 24:Fs(qn)}}function Yu(a,s){try{var u=s.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var b=m.next;u=b;do{if((u.tag&a)===a){m=void 0;var y=u.create,k=u.inst;m=y(),k.destroy=m}u=u.next}while(u!==b)}}catch(L){un(s,s.return,L)}}function Ri(a,s,u){try{var m=s.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var y=b.next;m=y;do{if((m.tag&a)===a){var k=m.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,b=s;var q=u,ie=L;try{ie()}catch(xe){un(b,q,xe)}}}m=m.next}while(m!==y)}}catch(xe){un(s,s.return,xe)}}function vy(a){var s=a.updateQueue;if(s!==null){var u=a.stateNode;try{hx(s,u)}catch(m){un(a,a.return,m)}}}function ky(a,s,u){u.props=Rl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(m){un(a,s,m)}}function Wu(a,s){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof u=="function"?a.refCleanup=u(m):u.current=m}}catch(b){un(a,s,b)}}function ps(a,s){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(b){un(a,s,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){un(a,s,b)}else u.current=null}function wy(a){var s=a.type,u=a.memoizedProps,m=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(b){un(a,a.return,b)}}function yp(a,s,u){try{var m=a.stateNode;OS(m,a.type,u,s),m[bn]=s}catch(b){un(a,a.return,b)}}function Cy(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Pi(a.type)||a.tag===4}function Ep(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Cy(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Pi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function _p(a,s,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(a),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=kr));else if(m!==4&&(m===27&&Pi(a.type)&&(u=a.stateNode,s=null),a=a.child,a!==null))for(_p(a,s,u),a=a.sibling;a!==null;)_p(a,s,u),a=a.sibling}function Xd(a,s,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?u.insertBefore(a,s):u.appendChild(a);else if(m!==4&&(m===27&&Pi(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Xd(a,s,u),a=a.sibling;a!==null;)Xd(a,s,u),a=a.sibling}function Sy(a){var s=a.stateNode,u=a.memoizedProps;try{for(var m=a.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);yr(s,m,u),s[kn]=a,s[bn]=u}catch(y){un(a,a.return,y)}}var qs=!1,Qn=!1,Tp=!1,Ny=typeof WeakSet=="function"?WeakSet:Set,dr=null;function fS(a,s){if(a=a.containerInfo,$p=xf,a=Hb(a),pm(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var b=m.anchorOffset,y=m.focusNode;m=m.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var k=0,L=-1,q=-1,ie=0,xe=0,Te=a,oe=null;t:for(;;){for(var me;Te!==u||b!==0&&Te.nodeType!==3||(L=k+b),Te!==y||m!==0&&Te.nodeType!==3||(q=k+m),Te.nodeType===3&&(k+=Te.nodeValue.length),(me=Te.firstChild)!==null;)oe=Te,Te=me;for(;;){if(Te===a)break t;if(oe===u&&++ie===b&&(L=k),oe===y&&++xe===m&&(q=k),(me=Te.nextSibling)!==null)break;Te=oe,oe=Te.parentNode}Te=me}u=L===-1||q===-1?null:{start:L,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Vp={focusedElem:a,selectionRange:u},xf=!1,dr=s;dr!==null;)if(s=dr,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,dr=a;else for(;dr!==null;){switch(s=dr,y=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)b=a[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,u=s,b=y.memoizedProps,y=y.memoizedState,m=u.stateNode;try{var ze=Rl(u.type,b);a=m.getSnapshotBeforeUpdate(ze,y),m.__reactInternalSnapshotBeforeUpdate=a}catch(ct){un(u,u.return,ct)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,u=a.nodeType,u===9)Yp(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Yp(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,dr=a;break}dr=s.return}}function Ay(a,s,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:Ws(a,u),m&4&&Yu(5,u);break;case 1:if(Ws(a,u),m&4)if(a=u.stateNode,s===null)try{a.componentDidMount()}catch(k){un(u,u.return,k)}else{var b=Rl(u.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(b,s,a.__reactInternalSnapshotBeforeUpdate)}catch(k){un(u,u.return,k)}}m&64&&vy(u),m&512&&Wu(u,u.return);break;case 3:if(Ws(a,u),m&64&&(a=u.updateQueue,a!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{hx(a,s)}catch(k){un(u,u.return,k)}}break;case 27:s===null&&m&4&&Sy(u);case 26:case 5:Ws(a,u),s===null&&m&4&&wy(u),m&512&&Wu(u,u.return);break;case 12:Ws(a,u);break;case 31:Ws(a,u),m&4&&Iy(a,u);break;case 13:Ws(a,u),m&4&&Oy(a,u),m&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=_S.bind(null,u),FS(a,u))));break;case 22:if(m=u.memoizedState!==null||qs,!m){s=s!==null&&s.memoizedState!==null||Qn,b=qs;var y=Qn;qs=m,(Qn=s)&&!y?Qs(a,u,(u.subtreeFlags&8772)!==0):Ws(a,u),qs=b,Qn=y}break;case 30:break;default:Ws(a,u)}}function Ry(a){var s=a.alternate;s!==null&&(a.alternate=null,Ry(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Jn(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var wn=null,Gr=!1;function Ys(a,s,u){for(u=u.child;u!==null;)Ly(a,s,u),u=u.sibling}function Ly(a,s,u){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(Ee,u)}catch{}switch(u.tag){case 26:Qn||ps(u,s),Ys(a,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Qn||ps(u,s);var m=wn,b=Gr;Pi(u.type)&&(wn=u.stateNode,Gr=!1),Ys(a,s,u),rc(u.stateNode),wn=m,Gr=b;break;case 5:Qn||ps(u,s);case 6:if(m=wn,b=Gr,wn=null,Ys(a,s,u),wn=m,Gr=b,wn!==null)if(Gr)try{(wn.nodeType===9?wn.body:wn.nodeName==="HTML"?wn.ownerDocument.body:wn).removeChild(u.stateNode)}catch(y){un(u,s,y)}else try{wn.removeChild(u.stateNode)}catch(y){un(u,s,y)}break;case 18:wn!==null&&(Gr?(a=wn,vE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Fo(a)):vE(wn,u.stateNode));break;case 4:m=wn,b=Gr,wn=u.stateNode.containerInfo,Gr=!0,Ys(a,s,u),wn=m,Gr=b;break;case 0:case 11:case 14:case 15:Ri(2,u,s),Qn||Ri(4,u,s),Ys(a,s,u);break;case 1:Qn||(ps(u,s),m=u.stateNode,typeof m.componentWillUnmount=="function"&&ky(u,s,m)),Ys(a,s,u);break;case 21:Ys(a,s,u);break;case 22:Qn=(m=Qn)||u.memoizedState!==null,Ys(a,s,u),Qn=m;break;default:Ys(a,s,u)}}function Iy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Fo(a)}catch(u){un(s,s.return,u)}}}function Oy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Fo(a)}catch(u){un(s,s.return,u)}}function hS(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new Ny),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new Ny),s;default:throw Error(r(435,a.tag))}}function Kd(a,s){var u=hS(a);s.forEach(function(m){if(!u.has(m)){u.add(m);var b=TS.bind(null,a,m);m.then(b,b)}})}function qr(a,s){var u=s.deletions;if(u!==null)for(var m=0;m<u.length;m++){var b=u[m],y=a,k=s,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(Pi(L.type)){wn=L.stateNode,Gr=!1;break e}break;case 5:wn=L.stateNode,Gr=!1;break e;case 3:case 4:wn=L.stateNode.containerInfo,Gr=!0;break e}L=L.return}if(wn===null)throw Error(r(160));Ly(y,k,b),wn=null,Gr=!1,y=b.alternate,y!==null&&(y.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Dy(s,a),s=s.sibling}var Za=null;function Dy(a,s){var u=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:qr(s,a),Yr(a),m&4&&(Ri(3,a,a.return),Yu(3,a),Ri(5,a,a.return));break;case 1:qr(s,a),Yr(a),m&512&&(Qn||u===null||ps(u,u.return)),m&64&&qs&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var b=Za;if(qr(s,a),Yr(a),m&512&&(Qn||u===null||ps(u,u.return)),m&4){var y=u!==null?u.memoizedState:null;if(m=a.memoizedState,u===null)if(m===null)if(a.stateNode===null){e:{m=a.type,u=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":y=b.getElementsByTagName("title")[0],(!y||y[Mt]||y[kn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=b.createElement(m),b.head.insertBefore(y,b.querySelector("head > title"))),yr(y,m,u),y[kn]=a,Wt(y),m=y;break e;case"link":var k=DE("link","href",b).get(m+(u.href||""));if(k){for(var L=0;L<k.length;L++)if(y=k[L],y.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){k.splice(L,1);break t}}y=b.createElement(m),yr(y,m,u),b.head.appendChild(y);break;case"meta":if(k=DE("meta","content",b).get(m+(u.content||""))){for(L=0;L<k.length;L++)if(y=k[L],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){k.splice(L,1);break t}}y=b.createElement(m),yr(y,m,u),b.head.appendChild(y);break;default:throw Error(r(468,m))}y[kn]=a,Wt(y),m=y}a.stateNode=m}else jE(b,a.type,a.stateNode);else a.stateNode=OE(b,m,a.memoizedProps);else y!==m?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,m===null?jE(b,a.type,a.stateNode):OE(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&yp(a,a.memoizedProps,u.memoizedProps)}break;case 27:qr(s,a),Yr(a),m&512&&(Qn||u===null||ps(u,u.return)),u!==null&&m&4&&yp(a,a.memoizedProps,u.memoizedProps);break;case 5:if(qr(s,a),Yr(a),m&512&&(Qn||u===null||ps(u,u.return)),a.flags&32){b=a.stateNode;try{Vr(b,"")}catch(ze){un(a,a.return,ze)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,yp(a,b,u!==null?u.memoizedProps:b)),m&1024&&(Tp=!0);break;case 6:if(qr(s,a),Yr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,u=a.stateNode;try{u.nodeValue=m}catch(ze){un(a,a.return,ze)}}break;case 3:if(mf=null,b=Za,Za=ff(s.containerInfo),qr(s,a),Za=b,Yr(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Fo(s.containerInfo)}catch(ze){un(a,a.return,ze)}Tp&&(Tp=!1,jy(a));break;case 4:m=Za,Za=ff(a.stateNode.containerInfo),qr(s,a),Yr(a),Za=m;break;case 12:qr(s,a),Yr(a);break;case 31:qr(s,a),Yr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Kd(a,m)));break;case 13:qr(s,a),Yr(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Jd=_t()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Kd(a,m)));break;case 22:b=a.memoizedState!==null;var q=u!==null&&u.memoizedState!==null,ie=qs,xe=Qn;if(qs=ie||b,Qn=xe||q,qr(s,a),Qn=xe,qs=ie,Yr(a),m&8192)e:for(s=a.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||q||qs||Qn||Ll(a)),u=null,s=a;;){if(s.tag===5||s.tag===26){if(u===null){q=u=s;try{if(y=q.stateNode,b)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=q.stateNode;var Te=q.memoizedProps.style,oe=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;L.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(ze){un(q,q.return,ze)}}}else if(s.tag===6){if(u===null){q=s;try{q.stateNode.nodeValue=b?"":q.memoizedProps}catch(ze){un(q,q.return,ze)}}}else if(s.tag===18){if(u===null){q=s;try{var me=q.stateNode;b?kE(me,!0):kE(q.stateNode,!1)}catch(ze){un(q,q.return,ze)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}m&4&&(m=a.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,Kd(a,u))));break;case 19:qr(s,a),Yr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Kd(a,m)));break;case 30:break;case 21:break;default:qr(s,a),Yr(a)}}function Yr(a){var s=a.flags;if(s&2){try{for(var u,m=a.return;m!==null;){if(Cy(m)){u=m;break}m=m.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,y=Ep(a);Xd(a,y,b);break;case 5:var k=u.stateNode;u.flags&32&&(Vr(k,""),u.flags&=-33);var L=Ep(a);Xd(a,L,k);break;case 3:case 4:var q=u.stateNode.containerInfo,ie=Ep(a);_p(a,ie,q);break;default:throw Error(r(161))}}catch(xe){un(a,a.return,xe)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function jy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;jy(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function Ws(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Ay(a,s.alternate,s),s=s.sibling}function Ll(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Ri(4,s,s.return),Ll(s);break;case 1:ps(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&ky(s,s.return,u),Ll(s);break;case 27:rc(s.stateNode);case 26:case 5:ps(s,s.return),Ll(s);break;case 22:s.memoizedState===null&&Ll(s);break;case 30:Ll(s);break;default:Ll(s)}a=a.sibling}}function Qs(a,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var m=s.alternate,b=a,y=s,k=y.flags;switch(y.tag){case 0:case 11:case 15:Qs(b,y,u),Yu(4,y);break;case 1:if(Qs(b,y,u),m=y,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){un(m,m.return,ie)}if(m=y,b=m.updateQueue,b!==null){var L=m.stateNode;try{var q=b.shared.hiddenCallbacks;if(q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<q.length;b++)fx(q[b],L)}catch(ie){un(m,m.return,ie)}}u&&k&64&&vy(y),Wu(y,y.return);break;case 27:Sy(y);case 26:case 5:Qs(b,y,u),u&&m===null&&k&4&&wy(y),Wu(y,y.return);break;case 12:Qs(b,y,u);break;case 31:Qs(b,y,u),u&&k&4&&Iy(b,y);break;case 13:Qs(b,y,u),u&&k&4&&Oy(b,y);break;case 22:y.memoizedState===null&&Qs(b,y,u),Wu(y,y.return);break;case 30:break;default:Qs(b,y,u)}s=s.sibling}}function vp(a,s){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Du(u))}function kp(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Du(a))}function Ja(a,s,u,m){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)My(a,s,u,m),s=s.sibling}function My(a,s,u,m){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Ja(a,s,u,m),b&2048&&Yu(9,s);break;case 1:Ja(a,s,u,m);break;case 3:Ja(a,s,u,m),b&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Du(a)));break;case 12:if(b&2048){Ja(a,s,u,m),a=s.stateNode;try{var y=s.memoizedProps,k=y.id,L=y.onPostCommit;typeof L=="function"&&L(k,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(q){un(s,s.return,q)}}else Ja(a,s,u,m);break;case 31:Ja(a,s,u,m);break;case 13:Ja(a,s,u,m);break;case 23:break;case 22:y=s.stateNode,k=s.alternate,s.memoizedState!==null?y._visibility&2?Ja(a,s,u,m):Qu(a,s):y._visibility&2?Ja(a,s,u,m):(y._visibility|=2,Ro(a,s,u,m,(s.subtreeFlags&10256)!==0||!1)),b&2048&&vp(k,s);break;case 24:Ja(a,s,u,m),b&2048&&kp(s.alternate,s);break;default:Ja(a,s,u,m)}}function Ro(a,s,u,m,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=a,k=s,L=u,q=m,ie=k.flags;switch(k.tag){case 0:case 11:case 15:Ro(y,k,L,q,b),Yu(8,k);break;case 23:break;case 22:var xe=k.stateNode;k.memoizedState!==null?xe._visibility&2?Ro(y,k,L,q,b):Qu(y,k):(xe._visibility|=2,Ro(y,k,L,q,b)),b&&ie&2048&&vp(k.alternate,k);break;case 24:Ro(y,k,L,q,b),b&&ie&2048&&kp(k.alternate,k);break;default:Ro(y,k,L,q,b)}s=s.sibling}}function Qu(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=a,m=s,b=m.flags;switch(m.tag){case 22:Qu(u,m),b&2048&&vp(m.alternate,m);break;case 24:Qu(u,m),b&2048&&kp(m.alternate,m);break;default:Qu(u,m)}s=s.sibling}}var Xu=8192;function Lo(a,s,u){if(a.subtreeFlags&Xu)for(a=a.child;a!==null;)Py(a,s,u),a=a.sibling}function Py(a,s,u){switch(a.tag){case 26:Lo(a,s,u),a.flags&Xu&&a.memoizedState!==null&&JS(u,Za,a.memoizedState,a.memoizedProps);break;case 5:Lo(a,s,u);break;case 3:case 4:var m=Za;Za=ff(a.stateNode.containerInfo),Lo(a,s,u),Za=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Xu,Xu=16777216,Lo(a,s,u),Xu=m):Lo(a,s,u));break;default:Lo(a,s,u)}}function By(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function Ku(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var m=s[u];dr=m,Hy(m,a)}By(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Uy(a),a=a.sibling}function Uy(a){switch(a.tag){case 0:case 11:case 15:Ku(a),a.flags&2048&&Ri(9,a,a.return);break;case 3:Ku(a);break;case 12:Ku(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Zd(a)):Ku(a);break;default:Ku(a)}}function Zd(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var m=s[u];dr=m,Hy(m,a)}By(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Ri(8,s,s.return),Zd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Zd(s));break;default:Zd(s)}a=a.sibling}}function Hy(a,s){for(;dr!==null;){var u=dr;switch(u.tag){case 0:case 11:case 15:Ri(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Du(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,dr=m;else e:for(u=a;dr!==null;){m=dr;var b=m.sibling,y=m.return;if(Ry(m),m===u){dr=null;break e}if(b!==null){b.return=y,dr=b;break e}dr=y}}}var mS={getCacheForType:function(a){var s=br(qn),u=s.data.get(a);return u===void 0&&(u=a(),s.data.set(a,u)),u},cacheSignal:function(){return br(qn).controller.signal}},pS=typeof WeakMap=="function"?WeakMap:Map,en=0,pn=null,Bt=null,Ft=0,on=0,la=null,Li=!1,Io=!1,wp=!1,Xs=0,Ln=0,Ii=0,Il=0,Cp=0,oa=0,Oo=0,Zu=null,Wr=null,Sp=!1,Jd=0,Fy=0,ef=1/0,tf=null,Oi=null,rr=0,Di=null,Do=null,Ks=0,Np=0,Ap=null,zy=null,Ju=0,Rp=null;function ua(){return(en&2)!==0&&Ft!==0?Ft&-Ft:F.T!==null?Mp():os()}function $y(){if(oa===0)if((Ft&536870912)===0||$t){var a=Ge;Ge<<=1,(Ge&3932160)===0&&(Ge=262144),oa=a}else oa=536870912;return a=sa.current,a!==null&&(a.flags|=32),oa}function Qr(a,s,u){(a===pn&&(on===2||on===9)||a.cancelPendingCommit!==null)&&(jo(a,0),ji(a,Ft,oa,!1)),Nn(a,u),((en&2)===0||a!==pn)&&(a===pn&&((en&2)===0&&(Il|=u),Ln===4&&ji(a,Ft,oa,!1)),gs(a))}function Vy(a,s,u){if((en&6)!==0)throw Error(r(327));var m=!u&&(s&127)===0&&(s&a.expiredLanes)===0||st(a,s),b=m?xS(a,s):Ip(a,s,!0),y=m;do{if(b===0){Io&&!m&&ji(a,s,0,!1);break}else{if(u=a.current.alternate,y&&!gS(u)){b=Ip(a,s,!1),y=!1;continue}if(b===2){if(y=s,a.errorRecoveryDisabledLanes&y)var k=0;else k=a.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){s=k;e:{var L=a;b=Zu;var q=L.current.memoizedState.isDehydrated;if(q&&(jo(L,k).flags|=256),k=Ip(L,k,!1),k!==2){if(wp&&!q){L.errorRecoveryDisabledLanes|=y,Il|=y,b=4;break e}y=Wr,Wr=b,y!==null&&(Wr===null?Wr=y:Wr.push.apply(Wr,y))}b=k}if(y=!1,b!==2)continue}}if(b===1){jo(a,0),ji(a,s,0,!0);break}e:{switch(m=a,y=b,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ji(m,s,oa,!Li);break e;case 2:Wr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Jd+300-_t(),10<b)){if(ji(m,s,oa,!Li),Lt(m,0,!0)!==0)break e;Ks=s,m.timeoutHandle=_E(Gy.bind(null,m,u,Wr,tf,Sp,s,oa,Il,Oo,Li,y,"Throttled",-0,0),b);break e}Gy(m,u,Wr,tf,Sp,s,oa,Il,Oo,Li,y,null,-0,0)}}break}while(!0);gs(a)}function Gy(a,s,u,m,b,y,k,L,q,ie,xe,Te,oe,me){if(a.timeoutHandle=-1,Te=s.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kr},Py(s,y,Te);var ze=(y&62914560)===y?Jd-_t():(y&4194048)===y?Fy-_t():0;if(ze=eN(Te,ze),ze!==null){Ks=y,a.cancelPendingCommit=ze(Jy.bind(null,a,s,y,u,m,b,k,L,q,xe,Te,null,oe,me)),ji(a,y,k,!ie);return}}Jy(a,s,y,u,m,b,k,L,q)}function gS(a){for(var s=a;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var b=u[m],y=b.getSnapshot;b=b.value;try{if(!ra(y(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ji(a,s,u,m){s&=~Cp,s&=~Il,a.suspendedLanes|=s,a.pingedLanes&=~s,m&&(a.warmLanes|=s),m=a.expirationTimes;for(var b=s;0<b;){var y=31-He(b),k=1<<y;m[y]=-1,b&=~k}u!==0&&Ga(a,u,s)}function nf(){return(en&6)===0?(ec(0),!1):!0}function Lp(){if(Bt!==null){if(on===0)var a=Bt.return;else a=Bt,Hs=vl=null,Ym(a),wo=null,Mu=0,a=Bt;for(;a!==null;)Ty(a.alternate,a),a=a.return;Bt=null}}function jo(a,s){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,MS(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Ks=0,Lp(),pn=a,Bt=u=Bs(a.current,null),Ft=s,on=0,la=null,Li=!1,Io=st(a,s),wp=!1,Oo=oa=Cp=Il=Ii=Ln=0,Wr=Zu=null,Sp=!1,(s&8)!==0&&(s|=s&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=s;0<m;){var b=31-He(m),y=1<<b;s|=a[b],m&=~y}return Xs=s,vd(),u}function qy(a,s){Tt=null,F.H=Vu,s===ko||s===Ld?(s=ox(),on=3):s===jm?(s=ox(),on=4):on=s===up?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,la=s,Bt===null&&(Ln=1,Gd(a,Aa(s,a.current)))}function Yy(){var a=sa.current;return a===null?!0:(Ft&4194048)===Ft?Oa===null:(Ft&62914560)===Ft||(Ft&536870912)!==0?a===Oa:!1}function Wy(){var a=F.H;return F.H=Vu,a===null?Vu:a}function Qy(){var a=F.A;return F.A=mS,a}function rf(){Ln=4,Li||(Ft&4194048)!==Ft&&sa.current!==null||(Io=!0),(Ii&134217727)===0&&(Il&134217727)===0||pn===null||ji(pn,Ft,oa,!1)}function Ip(a,s,u){var m=en;en|=2;var b=Wy(),y=Qy();(pn!==a||Ft!==s)&&(tf=null,jo(a,s)),s=!1;var k=Ln;e:do try{if(on!==0&&Bt!==null){var L=Bt,q=la;switch(on){case 8:Lp(),k=6;break e;case 3:case 2:case 9:case 6:sa.current===null&&(s=!0);var ie=on;if(on=0,la=null,Mo(a,L,q,ie),u&&Io){k=0;break e}break;default:ie=on,on=0,la=null,Mo(a,L,q,ie)}}bS(),k=Ln;break}catch(xe){qy(a,xe)}while(!0);return s&&a.shellSuspendCounter++,Hs=vl=null,en=m,F.H=b,F.A=y,Bt===null&&(pn=null,Ft=0,vd()),k}function bS(){for(;Bt!==null;)Xy(Bt)}function xS(a,s){var u=en;en|=2;var m=Wy(),b=Qy();pn!==a||Ft!==s?(tf=null,ef=_t()+500,jo(a,s)):Io=st(a,s);e:do try{if(on!==0&&Bt!==null){s=Bt;var y=la;t:switch(on){case 1:on=0,la=null,Mo(a,s,y,1);break;case 2:case 9:if(ix(y)){on=0,la=null,Ky(s);break}s=function(){on!==2&&on!==9||pn!==a||(on=7),gs(a)},y.then(s,s);break e;case 3:on=7;break e;case 4:on=5;break e;case 7:ix(y)?(on=0,la=null,Ky(s)):(on=0,la=null,Mo(a,s,y,7));break;case 5:var k=null;switch(Bt.tag){case 26:k=Bt.memoizedState;case 5:case 27:var L=Bt;if(k?ME(k):L.stateNode.complete){on=0,la=null;var q=L.sibling;if(q!==null)Bt=q;else{var ie=L.return;ie!==null?(Bt=ie,af(ie)):Bt=null}break t}}on=0,la=null,Mo(a,s,y,5);break;case 6:on=0,la=null,Mo(a,s,y,6);break;case 8:Lp(),Ln=6;break e;default:throw Error(r(462))}}yS();break}catch(xe){qy(a,xe)}while(!0);return Hs=vl=null,F.H=m,F.A=b,en=u,Bt!==null?0:(pn=null,Ft=0,vd(),Ln)}function yS(){for(;Bt!==null&&!cn();)Xy(Bt)}function Xy(a){var s=Ey(a.alternate,a,Xs);a.memoizedProps=a.pendingProps,s===null?af(a):Bt=s}function Ky(a){var s=a,u=s.alternate;switch(s.tag){case 15:case 0:s=my(u,s,s.pendingProps,s.type,void 0,Ft);break;case 11:s=my(u,s,s.pendingProps,s.type.render,s.ref,Ft);break;case 5:Ym(s);default:Ty(u,s),s=Bt=Qb(s,Xs),s=Ey(u,s,Xs)}a.memoizedProps=a.pendingProps,s===null?af(a):Bt=s}function Mo(a,s,u,m){Hs=vl=null,Ym(s),wo=null,Mu=0;var b=s.return;try{if(lS(a,b,s,u,Ft)){Ln=1,Gd(a,Aa(u,a.current)),Bt=null;return}}catch(y){if(b!==null)throw Bt=b,y;Ln=1,Gd(a,Aa(u,a.current)),Bt=null;return}s.flags&32768?($t||m===1?a=!0:Io||(Ft&536870912)!==0?a=!1:(Li=a=!0,(m===2||m===9||m===3||m===6)&&(m=sa.current,m!==null&&m.tag===13&&(m.flags|=16384))),Zy(s,a)):af(s)}function af(a){var s=a;do{if((s.flags&32768)!==0){Zy(s,Li);return}a=s.return;var u=cS(s.alternate,s,Xs);if(u!==null){Bt=u;return}if(s=s.sibling,s!==null){Bt=s;return}Bt=s=a}while(s!==null);Ln===0&&(Ln=5)}function Zy(a,s){do{var u=dS(a.alternate,a);if(u!==null){u.flags&=32767,Bt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(a=a.sibling,a!==null)){Bt=a;return}Bt=a=u}while(a!==null);Ln=6,Bt=null}function Jy(a,s,u,m,b,y,k,L,q){a.cancelPendingCommit=null;do sf();while(rr!==0);if((en&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=Em,Hn(a,u,y,k,L,q),a===pn&&(Bt=pn=null,Ft=0),Do=s,Di=a,Ks=u,Np=y,Ap=b,zy=m,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,vS(Me,function(){return aE(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||m){m=F.T,F.T=null,b=$.p,$.p=2,k=en,en|=4;try{fS(a,s,u)}finally{en=k,$.p=b,F.T=m}}rr=1,eE(),tE(),nE()}}function eE(){if(rr===1){rr=0;var a=Di,s=Do,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=F.T,F.T=null;var m=$.p;$.p=2;var b=en;en|=4;try{Dy(s,a);var y=Vp,k=Hb(a.containerInfo),L=y.focusedElem,q=y.selectionRange;if(k!==L&&L&&L.ownerDocument&&Ub(L.ownerDocument.documentElement,L)){if(q!==null&&pm(L)){var ie=q.start,xe=q.end;if(xe===void 0&&(xe=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(xe,L.value.length);else{var Te=L.ownerDocument||document,oe=Te&&Te.defaultView||window;if(oe.getSelection){var me=oe.getSelection(),ze=L.textContent.length,ct=Math.min(q.start,ze),hn=q.end===void 0?ct:Math.min(q.end,ze);!me.extend&&ct>hn&&(k=hn,hn=ct,ct=k);var ee=Bb(L,ct),Z=Bb(L,hn);if(ee&&Z&&(me.rangeCount!==1||me.anchorNode!==ee.node||me.anchorOffset!==ee.offset||me.focusNode!==Z.node||me.focusOffset!==Z.offset)){var se=Te.createRange();se.setStart(ee.node,ee.offset),me.removeAllRanges(),ct>hn?(me.addRange(se),me.extend(Z.node,Z.offset)):(se.setEnd(Z.node,Z.offset),me.addRange(se))}}}}for(Te=[],me=L;me=me.parentNode;)me.nodeType===1&&Te.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Te.length;L++){var _e=Te[L];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}xf=!!$p,Vp=$p=null}finally{en=b,$.p=m,F.T=u}}a.current=s,rr=2}}function tE(){if(rr===2){rr=0;var a=Di,s=Do,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=F.T,F.T=null;var m=$.p;$.p=2;var b=en;en|=4;try{Ay(a,s.alternate,s)}finally{en=b,$.p=m,F.T=u}}rr=3}}function nE(){if(rr===4||rr===3){rr=0,Un();var a=Di,s=Do,u=Ks,m=zy;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?rr=5:(rr=0,Do=Di=null,rE(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Oi=null),ba(u),s=s.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(Ee,s,void 0,(s.current.flags&128)===128)}catch{}if(m!==null){s=F.T,b=$.p,$.p=2,F.T=null;try{for(var y=a.onRecoverableError,k=0;k<m.length;k++){var L=m[k];y(L.value,{componentStack:L.stack})}}finally{F.T=s,$.p=b}}(Ks&3)!==0&&sf(),gs(a),b=a.pendingLanes,(u&261930)!==0&&(b&42)!==0?a===Rp?Ju++:(Ju=0,Rp=a):Ju=0,ec(0)}}function rE(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Du(s)))}function sf(){return eE(),tE(),nE(),aE()}function aE(){if(rr!==5)return!1;var a=Di,s=Np;Np=0;var u=ba(Ks),m=F.T,b=$.p;try{$.p=32>u?32:u,F.T=null,u=Ap,Ap=null;var y=Di,k=Ks;if(rr=0,Do=Di=null,Ks=0,(en&6)!==0)throw Error(r(331));var L=en;if(en|=4,Uy(y.current),My(y,y.current,k,u),en=L,ec(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Ee,y)}catch{}return!0}finally{$.p=b,F.T=m,rE(a,s)}}function sE(a,s,u){s=Aa(u,s),s=op(a.stateNode,s,2),a=Si(a,s,2),a!==null&&(Nn(a,2),gs(a))}function un(a,s,u){if(a.tag===3)sE(a,a,u);else for(;s!==null;){if(s.tag===3){sE(s,a,u);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Oi===null||!Oi.has(m))){a=Aa(u,a),u=iy(2),m=Si(s,u,2),m!==null&&(ly(u,m,s,a),Nn(m,2),gs(m));break}}s=s.return}}function Op(a,s,u){var m=a.pingCache;if(m===null){m=a.pingCache=new pS;var b=new Set;m.set(s,b)}else b=m.get(s),b===void 0&&(b=new Set,m.set(s,b));b.has(u)||(wp=!0,b.add(u),a=ES.bind(null,a,s,u),s.then(a,a))}function ES(a,s,u){var m=a.pingCache;m!==null&&m.delete(s),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,pn===a&&(Ft&u)===u&&(Ln===4||Ln===3&&(Ft&62914560)===Ft&&300>_t()-Jd?(en&2)===0&&jo(a,0):Cp|=u,Oo===Ft&&(Oo=0)),gs(a)}function iE(a,s){s===0&&(s=_r()),a=El(a,s),a!==null&&(Nn(a,s),gs(a))}function _S(a){var s=a.memoizedState,u=0;s!==null&&(u=s.retryLane),iE(a,u)}function TS(a,s){var u=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(u=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),iE(a,u)}function vS(a,s){return At(a,s)}var lf=null,Po=null,Dp=!1,of=!1,jp=!1,Mi=0;function gs(a){a!==Po&&a.next===null&&(Po===null?lf=Po=a:Po=Po.next=a),of=!0,Dp||(Dp=!0,wS())}function ec(a,s){if(!jp&&of){jp=!0;do for(var u=!1,m=lf;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var y=0;else{var k=m.suspendedLanes,L=m.pingedLanes;y=(1<<31-He(42|a)+1)-1,y&=b&~(k&~L),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,cE(m,y))}else y=Ft,y=Lt(m,m===pn?y:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(y&3)===0||st(m,y)||(u=!0,cE(m,y));m=m.next}while(u);jp=!1}}function kS(){lE()}function lE(){of=Dp=!1;var a=0;Mi!==0&&jS()&&(a=Mi);for(var s=_t(),u=null,m=lf;m!==null;){var b=m.next,y=oE(m,s);y===0?(m.next=null,u===null?lf=b:u.next=b,b===null&&(Po=u)):(u=m,(a!==0||(y&3)!==0)&&(of=!0)),m=b}rr!==0&&rr!==5||ec(a),Mi!==0&&(Mi=0)}function oE(a,s){for(var u=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var k=31-He(y),L=1<<k,q=b[k];q===-1?((L&u)===0||(L&m)!==0)&&(b[k]=Nt(L,s)):q<=s&&(a.expiredLanes|=L),y&=~L}if(s=pn,u=Ft,u=Lt(a,a===s?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,u===0||a===s&&(on===2||on===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&sn(m),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||st(a,u)){if(s=u&-u,s===a.callbackPriority)return s;switch(m!==null&&sn(m),ba(u)){case 2:case 8:u=Se;break;case 32:u=Me;break;case 268435456:u=gt;break;default:u=Me}return m=uE.bind(null,a),u=At(u,m),a.callbackPriority=s,a.callbackNode=u,s}return m!==null&&m!==null&&sn(m),a.callbackPriority=2,a.callbackNode=null,2}function uE(a,s){if(rr!==0&&rr!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(sf()&&a.callbackNode!==u)return null;var m=Ft;return m=Lt(a,a===pn?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(Vy(a,m,s),oE(a,_t()),a.callbackNode!=null&&a.callbackNode===u?uE.bind(null,a):null)}function cE(a,s){if(sf())return null;Vy(a,s,!0)}function wS(){PS(function(){(en&6)!==0?At(be,kS):lE()})}function Mp(){if(Mi===0){var a=To;a===0&&(a=We,We<<=1,(We&261888)===0&&(We=256)),Mi=a}return Mi}function dE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ds(""+a)}function fE(a,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,a.id&&u.setAttribute("form",a.id),s.parentNode.insertBefore(u,s),a=new FormData(a),u.parentNode.removeChild(u),a}function CS(a,s,u,m,b){if(s==="submit"&&u&&u.stateNode===b){var y=dE((b[bn]||null).action),k=m.submitter;k&&(s=(s=k[bn]||null)?dE(s.formAction):k.getAttribute("formAction"),s!==null&&(y=s,k=null));var L=new xi("action","action",null,m,b);a.push({event:L,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Mi!==0){var q=k?fE(b,k):new FormData(b);np(u,{pending:!0,data:q,method:b.method,action:y},null,q)}}else typeof y=="function"&&(L.preventDefault(),q=k?fE(b,k):new FormData(b),np(u,{pending:!0,data:q,method:b.method,action:y},y,q))},currentTarget:b}]})}}for(var Pp=0;Pp<ym.length;Pp++){var Bp=ym[Pp],SS=Bp.toLowerCase(),NS=Bp[0].toUpperCase()+Bp.slice(1);Ka(SS,"on"+NS)}Ka($b,"onAnimationEnd"),Ka(Vb,"onAnimationIteration"),Ka(Gb,"onAnimationStart"),Ka("dblclick","onDoubleClick"),Ka("focusin","onFocus"),Ka("focusout","onBlur"),Ka(V5,"onTransitionRun"),Ka(G5,"onTransitionStart"),Ka(q5,"onTransitionCancel"),Ka(qb,"onTransitionEnd"),ur("onMouseEnter",["mouseout","mouseover"]),ur("onMouseLeave",["mouseout","mouseover"]),ur("onPointerEnter",["pointerout","pointerover"]),ur("onPointerLeave",["pointerout","pointerover"]),$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$r("onBeforeInput",["compositionend","keypress","textInput","paste"]),$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tc="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(" "),AS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(tc));function hE(a,s){s=(s&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],b=m.event;m=m.listeners;e:{var y=void 0;if(s)for(var k=m.length-1;0<=k;k--){var L=m[k],q=L.instance,ie=L.currentTarget;if(L=L.listener,q!==y&&b.isPropagationStopped())break e;y=L,b.currentTarget=ie;try{y(b)}catch(xe){Td(xe)}b.currentTarget=null,y=q}else for(k=0;k<m.length;k++){if(L=m[k],q=L.instance,ie=L.currentTarget,L=L.listener,q!==y&&b.isPropagationStopped())break e;y=L,b.currentTarget=ie;try{y(b)}catch(xe){Td(xe)}b.currentTarget=null,y=q}}}}function Ut(a,s){var u=s[Fn];u===void 0&&(u=s[Fn]=new Set);var m=a+"__bubble";u.has(m)||(mE(s,a,2,!1),u.add(m))}function Up(a,s,u){var m=0;s&&(m|=4),mE(u,a,m,s)}var uf="_reactListening"+Math.random().toString(36).slice(2);function Hp(a){if(!a[uf]){a[uf]=!0,ol.forEach(function(u){u!=="selectionchange"&&(AS.has(u)||Up(u,!1,a),Up(u,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[uf]||(s[uf]=!0,Up("selectionchange",!1,s))}}function mE(a,s,u,m){switch($E(s)){case 2:var b=rN;break;case 8:b=aN;break;default:b=t0}u=b.bind(null,s,u,a),b=void 0,!pi||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(s,u,{capture:!0,passive:b}):a.addEventListener(s,u,!0):b!==void 0?a.addEventListener(s,u,{passive:b}):a.addEventListener(s,u,!1)}function Fp(a,s,u,m,b){var y=m;if((s&1)===0&&(s&2)===0&&m!==null)e:for(;;){if(m===null)return;var k=m.tag;if(k===3||k===4){var L=m.stateNode.containerInfo;if(L===b)break;if(k===4)for(k=m.return;k!==null;){var q=k.tag;if((q===3||q===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;L!==null;){if(k=Ir(L),k===null)return;if(q=k.tag,q===5||q===6||q===26||q===27){m=y=k;continue e}L=L.parentNode}}m=m.return}pl(function(){var ie=y,xe=mi(u),Te=[];e:{var oe=Yb.get(a);if(oe!==void 0){var me=xi,ze=a;switch(a){case"keypress":if(bi(u)===0)break e;case"keydown":case"keyup":me=nn;break;case"focusin":ze="focus",me=ot;break;case"focusout":ze="blur",me=ot;break;case"beforeblur":case"afterblur":me=ot;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=K;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Ie;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=fo;break;case $b:case Vb:case Gb:me=_n;break;case qb:me=hd;break;case"scroll":case"scrollend":me=wa;break;case"wheel":me=hm;break;case"copy":case"cut":case"paste":me=wr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Vn;break;case"toggle":case"beforetoggle":me=pd}var ct=(s&4)!==0,hn=!ct&&(a==="scroll"||a==="scrollend"),ee=ct?oe!==null?oe+"Capture":null:oe;ct=[];for(var Z=ie,se;Z!==null;){var _e=Z;if(se=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||se===null||ee===null||(_e=va(Z,ee),_e!=null&&ct.push(nc(Z,_e,se))),hn)break;Z=Z.return}0<ct.length&&(oe=new me(oe,ze,null,u,xe),Te.push({event:oe,listeners:ct}))}}if((s&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",me=a==="mouseout"||a==="pointerout",oe&&u!==Is&&(ze=u.relatedTarget||u.fromElement)&&(Ir(ze)||ze[xa]))break e;if((me||oe)&&(oe=xe.window===xe?xe:(oe=xe.ownerDocument)?oe.defaultView||oe.parentWindow:window,me?(ze=u.relatedTarget||u.toElement,me=ie,ze=ze?Ir(ze):null,ze!==null&&(hn=l(ze),ct=ze.tag,ze!==hn||ct!==5&&ct!==27&&ct!==6)&&(ze=null)):(me=null,ze=ie),me!==ze)){if(ct=K,_e="onMouseLeave",ee="onMouseEnter",Z="mouse",(a==="pointerout"||a==="pointerover")&&(ct=Vn,_e="onPointerLeave",ee="onPointerEnter",Z="pointer"),hn=me==null?oe:ya(me),se=ze==null?oe:ya(ze),oe=new ct(_e,Z+"leave",me,u,xe),oe.target=hn,oe.relatedTarget=se,_e=null,Ir(xe)===ie&&(ct=new ct(ee,Z+"enter",ze,u,xe),ct.target=se,ct.relatedTarget=hn,_e=ct),hn=_e,me&&ze)t:{for(ct=RS,ee=me,Z=ze,se=0,_e=ee;_e;_e=ct(_e))se++;_e=0;for(var nt=Z;nt;nt=ct(nt))_e++;for(;0<se-_e;)ee=ct(ee),se--;for(;0<_e-se;)Z=ct(Z),_e--;for(;se--;){if(ee===Z||Z!==null&&ee===Z.alternate){ct=ee;break t}ee=ct(ee),Z=ct(Z)}ct=null}else ct=null;me!==null&&pE(Te,oe,me,ct,!1),ze!==null&&hn!==null&&pE(Te,hn,ze,ct,!0)}}e:{if(oe=ie?ya(ie):window,me=oe.nodeName&&oe.nodeName.toLowerCase(),me==="select"||me==="input"&&oe.type==="file")var Kt=ft;else if(I(oe))if(Pt)Kt=F5;else{Kt=_d;var Qe=bl}else me=oe.nodeName,!me||me.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&ta(ie.elementType)&&(Kt=ft):Kt=H5;if(Kt&&(Kt=Kt(a,ie))){ae(Te,Kt,u,xe);break e}Qe&&Qe(a,oe,ie),a==="focusout"&&ie&&oe.type==="number"&&ie.memoizedProps.value!=null&&dl(oe,"number",oe.value)}switch(Qe=ie?ya(ie):window,a){case"focusin":(I(Qe)||Qe.contentEditable==="true")&&(mo=Qe,gm=ie,Lu=null);break;case"focusout":Lu=gm=mo=null;break;case"mousedown":bm=!0;break;case"contextmenu":case"mouseup":case"dragend":bm=!1,Fb(Te,u,xe);break;case"selectionchange":if($5)break;case"keydown":case"keyup":Fb(Te,u,xe)}var wt;if(ho)e:{switch(a){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else Ps?Nu(a,u)&&(zt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(zt="onCompositionStart");zt&&(wu&&u.locale!=="ko"&&(Ps||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&Ps&&(wt=co()):(jr=xe,gi="value"in jr?jr.value:jr.textContent,Ps=!0)),Qe=cf(ie,zt),0<Qe.length&&(zt=new Jt(zt,a,null,u,xe),Te.push({event:zt,listeners:Qe}),wt?zt.data=wt:(wt=Au(u),wt!==null&&(zt.data=wt)))),(wt=bd?xd(a,u):yd(a,u))&&(zt=cf(ie,"onBeforeInput"),0<zt.length&&(Qe=new Jt("onBeforeInput","beforeinput",null,u,xe),Te.push({event:Qe,listeners:zt}),Qe.data=wt)),CS(Te,a,ie,u,xe)}hE(Te,s)})}function nc(a,s,u){return{instance:a,listener:s,currentTarget:u}}function cf(a,s){for(var u=s+"Capture",m=[];a!==null;){var b=a,y=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||y===null||(b=va(a,u),b!=null&&m.unshift(nc(a,b,y)),b=va(a,s),b!=null&&m.push(nc(a,b,y))),a.tag===3)return m;a=a.return}return[]}function RS(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function pE(a,s,u,m,b){for(var y=s._reactName,k=[];u!==null&&u!==m;){var L=u,q=L.alternate,ie=L.stateNode;if(L=L.tag,q!==null&&q===m)break;L!==5&&L!==26&&L!==27||ie===null||(q=ie,b?(ie=va(u,y),ie!=null&&k.unshift(nc(u,ie,q))):b||(ie=va(u,y),ie!=null&&k.push(nc(u,ie,q)))),u=u.return}k.length!==0&&a.push({event:s,listeners:k})}var LS=/\r\n?/g,IS=/\u0000|\uFFFD/g;function gE(a){return(typeof a=="string"?a:""+a).replace(LS,`
|
|
50
|
-
`).replace(IS,"")}function bE(a,s){return s=gE(s),gE(a)===s}function fn(a,s,u,m,b,y){switch(u){case"children":typeof m=="string"?s==="body"||s==="textarea"&&m===""||Vr(a,m):(typeof m=="number"||typeof m=="bigint")&&s!=="body"&&Vr(a,""+m);break;case"className":cs(a,"class",m);break;case"tabIndex":cs(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":cs(a,u,m);break;case"style":Ls(a,m,y);break;case"data":if(s!=="object"){cs(a,"data",m);break}case"src":case"href":if(m===""&&(s!=="a"||u!=="href")){a.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=ds(""+m),a.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(u==="formAction"?(s!=="input"&&fn(a,s,"name",b.name,b,null),fn(a,s,"formEncType",b.formEncType,b,null),fn(a,s,"formMethod",b.formMethod,b,null),fn(a,s,"formTarget",b.formTarget,b,null)):(fn(a,s,"encType",b.encType,b,null),fn(a,s,"method",b.method,b,null),fn(a,s,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=ds(""+m),a.setAttribute(u,m);break;case"onClick":m!=null&&(a.onclick=kr);break;case"onScroll":m!=null&&Ut("scroll",a);break;case"onScrollEnd":m!=null&&Ut("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}u=ds(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""+m):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":m===!0?a.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,m):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(u,m):a.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(u):a.setAttribute(u,m);break;case"popover":Ut("beforetoggle",a),Ut("toggle",a),us(a,"popover",m);break;case"xlinkActuate":tr(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":tr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":tr(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":tr(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":tr(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":tr(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":tr(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":tr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":tr(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":us(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=fl.get(u)||u,us(a,u,m))}}function zp(a,s,u,m,b,y){switch(u){case"style":Ls(a,m,y);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof m=="string"?Vr(a,m):(typeof m=="number"||typeof m=="bigint")&&Vr(a,""+m);break;case"onScroll":m!=null&&Ut("scroll",a);break;case"onScrollEnd":m!=null&&Ut("scrollend",a);break;case"onClick":m!=null&&(a.onclick=kr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ul.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),y=a[bn]||null,y=y!=null?y[u]:null,typeof y=="function"&&a.removeEventListener(s,y,b),typeof m=="function")){typeof y!="function"&&y!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(s,m,b);break e}u in a?a[u]=m:m===!0?a.setAttribute(u,""):us(a,u,m)}}}function yr(a,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ut("error",a),Ut("load",a);var m=!1,b=!1,y;for(y in u)if(u.hasOwnProperty(y)){var k=u[y];if(k!=null)switch(y){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:fn(a,s,y,k,u,null)}}b&&fn(a,s,"srcSet",u.srcSet,u,null),m&&fn(a,s,"src",u.src,u,null);return;case"input":Ut("invalid",a);var L=y=k=b=null,q=null,ie=null;for(m in u)if(u.hasOwnProperty(m)){var xe=u[m];if(xe!=null)switch(m){case"name":b=xe;break;case"type":k=xe;break;case"checked":q=xe;break;case"defaultChecked":ie=xe;break;case"value":y=xe;break;case"defaultValue":L=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,s));break;default:fn(a,s,m,xe,u,null)}}An(a,y,L,q,ie,k,b,!1);return;case"select":Ut("invalid",a),m=k=y=null;for(b in u)if(u.hasOwnProperty(b)&&(L=u[b],L!=null))switch(b){case"value":y=L;break;case"defaultValue":k=L;break;case"multiple":m=L;default:fn(a,s,b,L,u,null)}s=y,u=k,a.multiple=!!m,s!=null?vr(a,!!m,s,!1):u!=null&&vr(a,!!m,u,!0);return;case"textarea":Ut("invalid",a),y=b=m=null;for(k in u)if(u.hasOwnProperty(k)&&(L=u[k],L!=null))switch(k){case"value":m=L;break;case"defaultValue":b=L;break;case"children":y=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:fn(a,s,k,L,u,null)}hi(a,m,b,y);return;case"option":for(q in u)if(u.hasOwnProperty(q)&&(m=u[q],m!=null))switch(q){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:fn(a,s,q,m,u,null)}return;case"dialog":Ut("beforetoggle",a),Ut("toggle",a),Ut("cancel",a),Ut("close",a);break;case"iframe":case"object":Ut("load",a);break;case"video":case"audio":for(m=0;m<tc.length;m++)Ut(tc[m],a);break;case"image":Ut("error",a),Ut("load",a);break;case"details":Ut("toggle",a);break;case"embed":case"source":case"link":Ut("error",a),Ut("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in u)if(u.hasOwnProperty(ie)&&(m=u[ie],m!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:fn(a,s,ie,m,u,null)}return;default:if(ta(s)){for(xe in u)u.hasOwnProperty(xe)&&(m=u[xe],m!==void 0&&zp(a,s,xe,m,u,void 0));return}}for(L in u)u.hasOwnProperty(L)&&(m=u[L],m!=null&&fn(a,s,L,m,u,null))}function OS(a,s,u,m){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,y=null,k=null,L=null,q=null,ie=null,xe=null;for(me in u){var Te=u[me];if(u.hasOwnProperty(me)&&Te!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":q=Te;default:m.hasOwnProperty(me)||fn(a,s,me,null,m,Te)}}for(var oe in m){var me=m[oe];if(Te=u[oe],m.hasOwnProperty(oe)&&(me!=null||Te!=null))switch(oe){case"type":y=me;break;case"name":b=me;break;case"checked":ie=me;break;case"defaultChecked":xe=me;break;case"value":k=me;break;case"defaultValue":L=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:me!==Te&&fn(a,s,oe,me,m,Te)}}Or(a,k,L,q,ie,xe,y,b);return;case"select":me=k=L=oe=null;for(y in u)if(q=u[y],u.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":me=q;default:m.hasOwnProperty(y)||fn(a,s,y,null,m,q)}for(b in m)if(y=m[b],q=u[b],m.hasOwnProperty(b)&&(y!=null||q!=null))switch(b){case"value":oe=y;break;case"defaultValue":L=y;break;case"multiple":k=y;default:y!==q&&fn(a,s,b,y,m,q)}s=L,u=k,m=me,oe!=null?vr(a,!!u,oe,!1):!!m!=!!u&&(s!=null?vr(a,!!u,s,!0):vr(a,!!u,u?[]:"",!1));return;case"textarea":me=oe=null;for(L in u)if(b=u[L],u.hasOwnProperty(L)&&b!=null&&!m.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:fn(a,s,L,null,m,b)}for(k in m)if(b=m[k],y=u[k],m.hasOwnProperty(k)&&(b!=null||y!=null))switch(k){case"value":oe=b;break;case"defaultValue":me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==y&&fn(a,s,k,b,m,y)}fi(a,oe,me);return;case"option":for(var ze in u)if(oe=u[ze],u.hasOwnProperty(ze)&&oe!=null&&!m.hasOwnProperty(ze))switch(ze){case"selected":a.selected=!1;break;default:fn(a,s,ze,null,m,oe)}for(q in m)if(oe=m[q],me=u[q],m.hasOwnProperty(q)&&oe!==me&&(oe!=null||me!=null))switch(q){case"selected":a.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:fn(a,s,q,oe,m,me)}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 ct in u)oe=u[ct],u.hasOwnProperty(ct)&&oe!=null&&!m.hasOwnProperty(ct)&&fn(a,s,ct,null,m,oe);for(ie in m)if(oe=m[ie],me=u[ie],m.hasOwnProperty(ie)&&oe!==me&&(oe!=null||me!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,s));break;default:fn(a,s,ie,oe,m,me)}return;default:if(ta(s)){for(var hn in u)oe=u[hn],u.hasOwnProperty(hn)&&oe!==void 0&&!m.hasOwnProperty(hn)&&zp(a,s,hn,void 0,m,oe);for(xe in m)oe=m[xe],me=u[xe],!m.hasOwnProperty(xe)||oe===me||oe===void 0&&me===void 0||zp(a,s,xe,oe,m,me);return}}for(var ee in u)oe=u[ee],u.hasOwnProperty(ee)&&oe!=null&&!m.hasOwnProperty(ee)&&fn(a,s,ee,null,m,oe);for(Te in m)oe=m[Te],me=u[Te],!m.hasOwnProperty(Te)||oe===me||oe==null&&me==null||fn(a,s,Te,oe,m,me)}function xE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DS(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var b=u[m],y=b.transferSize,k=b.initiatorType,L=b.duration;if(y&&L&&xE(k)){for(k=0,L=b.responseEnd,m+=1;m<u.length;m++){var q=u[m],ie=q.startTime;if(ie>L)break;var xe=q.transferSize,Te=q.initiatorType;xe&&xE(Te)&&(q=q.responseEnd,k+=xe*(q<L?1:(L-ie)/(q-ie)))}if(--m,s+=8*(y+k)/(b.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var $p=null,Vp=null;function df(a){return a.nodeType===9?a:a.ownerDocument}function yE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function EE(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function Gp(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var qp=null;function jS(){var a=window.event;return a&&a.type==="popstate"?a===qp?!1:(qp=a,!0):(qp=null,!1)}var _E=typeof setTimeout=="function"?setTimeout:void 0,MS=typeof clearTimeout=="function"?clearTimeout:void 0,TE=typeof Promise=="function"?Promise:void 0,PS=typeof queueMicrotask=="function"?queueMicrotask:typeof TE<"u"?function(a){return TE.resolve(null).then(a).catch(BS)}:_E;function BS(a){setTimeout(function(){throw a})}function Pi(a){return a==="head"}function vE(a,s){var u=s,m=0;do{var b=u.nextSibling;if(a.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(b),Fo(s);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")rc(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,rc(u);for(var y=u.firstChild;y;){var k=y.nextSibling,L=y.nodeName;y[Mt]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&y.rel.toLowerCase()==="stylesheet"||u.removeChild(y),y=k}}else u==="body"&&rc(a.ownerDocument.body);u=b}while(u);Fo(s)}function kE(a,s){var u=a;a=0;do{var m=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=m}while(u)}function Yp(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Yp(u),Jn(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function US(a,s,u,m){for(;a.nodeType===1;){var b=u;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Mt])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var y=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=Da(a.nextSibling),a===null)break}return null}function HS(a,s,u){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Da(a.nextSibling),a===null))return null;return a}function wE(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=Da(a.nextSibling),a===null))return null;return a}function Wp(a){return a.data==="$?"||a.data==="$~"}function Qp(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function FS(a,s){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||u.readyState!=="loading")s();else{var m=function(){s(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Da(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var Xp=null;function CE(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(s===0)return Da(a.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}a=a.nextSibling}return null}function SE(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return a;s--}else u!=="/$"&&u!=="/&"||s++}a=a.previousSibling}return null}function NE(a,s,u){switch(s=df(u),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function rc(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Jn(a)}var ja=new Map,AE=new Set;function ff(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Zs=$.d;$.d={f:zS,r:$S,D:VS,C:GS,L:qS,m:YS,X:QS,S:WS,M:XS};function zS(){var a=Zs.f(),s=nf();return a||s}function $S(a){var s=er(a);s!==null&&s.tag===5&&s.type==="form"?qx(s):Zs.r(a)}var Bo=typeof document>"u"?null:document;function RE(a,s,u){var m=Bo;if(m&&typeof s=="string"&&s){var b=Dn(s);b='link[rel="'+a+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),AE.has(b)||(AE.add(b),a={rel:a,crossOrigin:u,href:s},m.querySelector(b)===null&&(s=m.createElement("link"),yr(s,"link",a),Wt(s),m.head.appendChild(s)))}}function VS(a){Zs.D(a),RE("dns-prefetch",a,null)}function GS(a,s){Zs.C(a,s),RE("preconnect",a,s)}function qS(a,s,u){Zs.L(a,s,u);var m=Bo;if(m&&a&&s){var b='link[rel="preload"][as="'+Dn(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+Dn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+Dn(u.imageSizes)+'"]')):b+='[href="'+Dn(a)+'"]';var y=b;switch(s){case"style":y=Uo(a);break;case"script":y=Ho(a)}ja.has(y)||(a=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:a,as:s},u),ja.set(y,a),m.querySelector(b)!==null||s==="style"&&m.querySelector(ac(y))||s==="script"&&m.querySelector(sc(y))||(s=m.createElement("link"),yr(s,"link",a),Wt(s),m.head.appendChild(s)))}}function YS(a,s){Zs.m(a,s);var u=Bo;if(u&&a){var m=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+Dn(m)+'"][href="'+Dn(a)+'"]',y=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ho(a)}if(!ja.has(y)&&(a=g({rel:"modulepreload",href:a},s),ja.set(y,a),u.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(sc(y)))return}m=u.createElement("link"),yr(m,"link",a),Wt(m),u.head.appendChild(m)}}}function WS(a,s,u){Zs.S(a,s,u);var m=Bo;if(m&&a){var b=Ea(m).hoistableStyles,y=Uo(a);s=s||"default";var k=b.get(y);if(!k){var L={loading:0,preload:null};if(k=m.querySelector(ac(y)))L.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":s},u),(u=ja.get(y))&&Kp(a,u);var q=k=m.createElement("link");Wt(q),yr(q,"link",a),q._p=new Promise(function(ie,xe){q.onload=ie,q.onerror=xe}),q.addEventListener("load",function(){L.loading|=1}),q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,hf(k,s,m)}k={type:"stylesheet",instance:k,count:1,state:L},b.set(y,k)}}}function QS(a,s){Zs.X(a,s);var u=Bo;if(u&&a){var m=Ea(u).hoistableScripts,b=Ho(a),y=m.get(b);y||(y=u.querySelector(sc(b)),y||(a=g({src:a,async:!0},s),(s=ja.get(b))&&Zp(a,s),y=u.createElement("script"),Wt(y),yr(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(b,y))}}function XS(a,s){Zs.M(a,s);var u=Bo;if(u&&a){var m=Ea(u).hoistableScripts,b=Ho(a),y=m.get(b);y||(y=u.querySelector(sc(b)),y||(a=g({src:a,async:!0,type:"module"},s),(s=ja.get(b))&&Zp(a,s),y=u.createElement("script"),Wt(y),yr(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(b,y))}}function LE(a,s,u,m){var b=(b=Ne.current)?ff(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Uo(u.href),u=Ea(b).hoistableStyles,m=u.get(s),m||(m={type:"style",instance:null,count:0,state:null},u.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Uo(u.href);var y=Ea(b).hoistableStyles,k=y.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,k),(y=b.querySelector(ac(a)))&&!y._p&&(k.instance=y,k.state.loading=5),ja.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ja.set(a,u),y||KS(b,a,u,k.state))),s&&m===null)throw Error(r(528,""));return k}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ho(u),u=Ea(b).hoistableScripts,m=u.get(s),m||(m={type:"script",instance:null,count:0,state:null},u.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Uo(a){return'href="'+Dn(a)+'"'}function ac(a){return'link[rel="stylesheet"]['+a+"]"}function IE(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function KS(a,s,u,m){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=a.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),yr(s,"link",u),Wt(s),a.head.appendChild(s))}function Ho(a){return'[src="'+Dn(a)+'"]'}function sc(a){return"script[async]"+a}function OE(a,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var m=a.querySelector('style[data-href~="'+Dn(u.href)+'"]');if(m)return s.instance=m,Wt(m),m;var b=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Wt(m),yr(m,"style",b),hf(m,u.precedence,a),s.instance=m;case"stylesheet":b=Uo(u.href);var y=a.querySelector(ac(b));if(y)return s.state.loading|=4,s.instance=y,Wt(y),y;m=IE(u),(b=ja.get(b))&&Kp(m,b),y=(a.ownerDocument||a).createElement("link"),Wt(y);var k=y;return k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),yr(y,"link",m),s.state.loading|=4,hf(y,u.precedence,a),s.instance=y;case"script":return y=Ho(u.src),(b=a.querySelector(sc(y)))?(s.instance=b,Wt(b),b):(m=u,(b=ja.get(y))&&(m=g({},u),Zp(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),Wt(b),yr(b,"link",m),a.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,hf(m,u.precedence,a));return s.instance}function hf(a,s,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,y=b,k=0;k<m.length;k++){var L=m[k];if(L.dataset.precedence===s)y=L;else if(y!==b)break}y?y.parentNode.insertBefore(a,y.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(a,s.firstChild))}function Kp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Zp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var mf=null;function DE(a,s,u){if(mf===null){var m=new Map,b=mf=new Map;b.set(u,m)}else b=mf,m=b.get(u),m||(m=new Map,b.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),b=0;b<u.length;b++){var y=u[b];if(!(y[Mt]||y[kn]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(s)||"";k=a+k;var L=m.get(k);L?L.push(y):m.set(k,[y])}}return m}function jE(a,s,u){a=a.ownerDocument||a,a.head.insertBefore(u,s==="title"?a.querySelector("head > title"):null)}function ZS(a,s,u){if(u===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function ME(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function JS(a,s,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Uo(m.href),y=s.querySelector(ac(b));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=pf.bind(a),s.then(a,a)),u.state.loading|=4,u.instance=y,Wt(y);return}y=s.ownerDocument||s,m=IE(m),(b=ja.get(b))&&Kp(m,b),y=y.createElement("link"),Wt(y);var k=y;k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),yr(y,"link",m),u.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=pf.bind(a),s.addEventListener("load",u),s.addEventListener("error",u))}}var Jp=0;function eN(a,s){return a.stylesheets&&a.count===0&&bf(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&bf(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+s);0<a.imgBytes&&Jp===0&&(Jp=62500*DS());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&bf(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>Jp?50:800)+s);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function pf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bf(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var gf=null;function bf(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,gf=new Map,s.forEach(tN,a),gf=null,pf.call(a))}function tN(a,s){if(!(s.state.loading&4)){var u=gf.get(a);if(u)var m=u.get(null);else{u=new Map,gf.set(a,u);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<b.length;y++){var k=b[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(u.set(k.dataset.precedence,k),m=k)}m&&u.set(null,m)}b=s.instance,k=b.getAttribute("data-precedence"),y=u.get(k)||m,y===m&&u.set(null,b),u.set(k,b),this.count++,m=pf.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),y?y.parentNode.insertBefore(b,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),s.state.loading|=4}}var ic={$$typeof:C,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function nN(a,s,u,m,b,y,k,L,q){this.tag=1,this.containerInfo=a,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=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function PE(a,s,u,m,b,y,k,L,q,ie,xe,Te){return a=new nN(a,s,u,k,q,ie,xe,Te,L),s=1,y===!0&&(s|=24),y=aa(3,null,null,s),a.current=y,y.stateNode=a,s=Im(),s.refCount++,a.pooledCache=s,s.refCount++,y.memoizedState={element:m,isDehydrated:u,cache:s},Mm(y),a}function BE(a){return a?(a=bo,a):bo}function UE(a,s,u,m,b,y){b=BE(b),m.context===null?m.context=b:m.pendingContext=b,m=Ci(s),m.payload={element:u},y=y===void 0?null:y,y!==null&&(m.callback=y),u=Si(a,m,s),u!==null&&(Qr(u,a,s),Bu(u,a,s))}function HE(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<s?u:s}}function e0(a,s){HE(a,s),(a=a.alternate)&&HE(a,s)}function FE(a){if(a.tag===13||a.tag===31){var s=El(a,67108864);s!==null&&Qr(s,a,67108864),e0(a,67108864)}}function zE(a){if(a.tag===13||a.tag===31){var s=ua();s=Ns(s);var u=El(a,s);u!==null&&Qr(u,a,s),e0(a,s)}}var xf=!0;function rN(a,s,u,m){var b=F.T;F.T=null;var y=$.p;try{$.p=2,t0(a,s,u,m)}finally{$.p=y,F.T=b}}function aN(a,s,u,m){var b=F.T;F.T=null;var y=$.p;try{$.p=8,t0(a,s,u,m)}finally{$.p=y,F.T=b}}function t0(a,s,u,m){if(xf){var b=n0(m);if(b===null)Fp(a,s,m,yf,u),VE(a,m);else if(iN(b,a,s,u,m))m.stopPropagation();else if(VE(a,m),s&4&&-1<sN.indexOf(a)){for(;b!==null;){var y=er(b);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=ht(y.pendingLanes);if(k!==0){var L=y;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var q=1<<31-He(k);L.entanglements[1]|=q,k&=~q}gs(y),(en&6)===0&&(ef=_t()+500,ec(0))}}break;case 31:case 13:L=El(y,2),L!==null&&Qr(L,y,2),nf(),e0(y,2)}if(y=n0(m),y===null&&Fp(a,s,m,yf,u),y===b)break;b=y}b!==null&&m.stopPropagation()}else Fp(a,s,m,null,u)}}function n0(a){return a=mi(a),r0(a)}var yf=null;function r0(a){if(yf=null,a=Ir(a),a!==null){var s=l(a);if(s===null)a=null;else{var u=s.tag;if(u===13){if(a=o(s),a!==null)return a;a=null}else if(u===31){if(a=c(s),a!==null)return a;a=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return yf=a,null}function $E(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(St()){case be:return 2;case Se:return 8;case Me:case lt:return 32;case gt:return 268435456;default:return 32}default:return 32}}var a0=!1,Bi=null,Ui=null,Hi=null,lc=new Map,oc=new Map,Fi=[],sN="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 VE(a,s){switch(a){case"focusin":case"focusout":Bi=null;break;case"dragenter":case"dragleave":Ui=null;break;case"mouseover":case"mouseout":Hi=null;break;case"pointerover":case"pointerout":lc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(s.pointerId)}}function uc(a,s,u,m,b,y){return a===null||a.nativeEvent!==y?(a={blockedOn:s,domEventName:u,eventSystemFlags:m,nativeEvent:y,targetContainers:[b]},s!==null&&(s=er(s),s!==null&&FE(s)),a):(a.eventSystemFlags|=m,s=a.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),a)}function iN(a,s,u,m,b){switch(s){case"focusin":return Bi=uc(Bi,a,s,u,m,b),!0;case"dragenter":return Ui=uc(Ui,a,s,u,m,b),!0;case"mouseover":return Hi=uc(Hi,a,s,u,m,b),!0;case"pointerover":var y=b.pointerId;return lc.set(y,uc(lc.get(y)||null,a,s,u,m,b)),!0;case"gotpointercapture":return y=b.pointerId,oc.set(y,uc(oc.get(y)||null,a,s,u,m,b)),!0}return!1}function GE(a){var s=Ir(a.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=o(u),s!==null){a.blockedOn=s,io(a.priority,function(){zE(u)});return}}else if(s===31){if(s=c(u),s!==null){a.blockedOn=s,io(a.priority,function(){zE(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Ef(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var u=n0(a.nativeEvent);if(u===null){u=a.nativeEvent;var m=new u.constructor(u.type,u);Is=m,u.target.dispatchEvent(m),Is=null}else return s=er(u),s!==null&&FE(s),a.blockedOn=u,!1;s.shift()}return!0}function qE(a,s,u){Ef(a)&&u.delete(s)}function lN(){a0=!1,Bi!==null&&Ef(Bi)&&(Bi=null),Ui!==null&&Ef(Ui)&&(Ui=null),Hi!==null&&Ef(Hi)&&(Hi=null),lc.forEach(qE),oc.forEach(qE)}function _f(a,s){a.blockedOn===s&&(a.blockedOn=null,a0||(a0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,lN)))}var Tf=null;function YE(a){Tf!==a&&(Tf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tf===a&&(Tf=null);for(var s=0;s<a.length;s+=3){var u=a[s],m=a[s+1],b=a[s+2];if(typeof m!="function"){if(r0(m||u)===null)continue;break}var y=er(u);y!==null&&(a.splice(s,3),s-=3,np(y,{pending:!0,data:b,method:u.method,action:m},m,b))}}))}function Fo(a){function s(q){return _f(q,a)}Bi!==null&&_f(Bi,a),Ui!==null&&_f(Ui,a),Hi!==null&&_f(Hi,a),lc.forEach(s),oc.forEach(s);for(var u=0;u<Fi.length;u++){var m=Fi[u];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Fi.length&&(u=Fi[0],u.blockedOn===null);)GE(u),u.blockedOn===null&&Fi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var b=u[m],y=u[m+1],k=b[bn]||null;if(typeof y=="function")k||YE(u);else if(k){var L=null;if(y&&y.hasAttribute("formAction")){if(b=y,k=y[bn]||null)L=k.formAction;else if(r0(b)!==null)continue}else L=k.action;typeof L=="function"?u[m+1]=L:(u.splice(m,3),m-=3),YE(u)}}}function WE(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function s0(a){this._internalRoot=a}vf.prototype.render=s0.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,m=ua();UE(u,m,a,s,null,null)},vf.prototype.unmount=s0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;UE(a.current,2,null,a,null,null),nf(),s[xa]=null}};function vf(a){this._internalRoot=a}vf.prototype.unstable_scheduleHydration=function(a){if(a){var s=os();a={blockedOn:null,target:a,priority:s};for(var u=0;u<Fi.length&&s!==0&&s<Fi[u].priority;u++);Fi.splice(u,0,a),u===0&&GE(a)}};var QE=t.version;if(QE!=="19.2.5")throw Error(r(527,QE,"19.2.5"));$.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(s),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var oN={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kf.isDisabled&&kf.supportsFiber)try{Ee=kf.inject(oN),Oe=kf}catch{}}return dc.createRoot=function(a,s){if(!i(a))throw Error(r(299));var u=!1,m="",b=ny,y=ry,k=ay;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError)),s=PE(a,1,!1,null,null,u,m,null,b,y,k,WE),a[xa]=s.current,Hp(a),new s0(s)},dc.hydrateRoot=function(a,s,u){if(!i(a))throw Error(r(299));var m=!1,b="",y=ny,k=ry,L=ay,q=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(L=u.onRecoverableError),u.formState!==void 0&&(q=u.formState)),s=PE(a,1,!0,s,u??null,m,b,q,y,k,L,WE),s.context=BE(null),u=s.current,m=ua(),m=Ns(m),b=Ci(m),b.callback=null,Si(u,b,m),u=m,s.current.lanes=u,Nn(s,u),gs(s),a[xa]=s.current,Hp(a),new vf(s)},dc.version="19.2.5",dc}var l2;function TN(){if(l2)return c0.exports;l2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),c0.exports=_N(),c0.exports}var vN=TN();const kN=Mh(vN);/**
|
|
51
|
-
* react-router v7.14.0
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Remix Software Inc.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
-
*
|
|
58
|
-
* @license MIT
|
|
59
|
-
*/var o2="popstate";function u2(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function wN(e={}){function t(r,i){var h;let l=(h=i.state)==null?void 0:h.masked,{pathname:o,search:c,hash:f}=l||r.location;return bg("",{pathname:o,search:c,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:$c(i)}return SN(t,n,null,e)}function Sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $a(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function CN(){return Math.random().toString(36).substring(2,10)}function c2(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function bg(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?du(t):t,state:n,key:t&&t.key||r||CN(),unstable_mask:i}}function $c({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function du(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function SN(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,c="POP",f=null,h=p();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let N=p(),w=N==null?null:N-h;h=N,f&&f({action:c,location:S.location,delta:w})}function x(N,w){c="PUSH";let R=u2(N)?N:bg(S.location,N,w);h=p()+1;let C=c2(R,h),O=S.createHref(R.unstable_mask||R);try{o.pushState(C,"",O)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;i.location.assign(O)}l&&f&&f({action:c,location:S.location,delta:1})}function E(N,w){c="REPLACE";let R=u2(N)?N:bg(S.location,N,w);h=p();let C=c2(R,h),O=S.createHref(R.unstable_mask||R);o.replaceState(C,"",O),l&&f&&f({action:c,location:S.location,delta:0})}function v(N){return NN(N)}let S={get action(){return c},get location(){return e(i,o)},listen(N){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(o2,g),f=N,()=>{i.removeEventListener(o2,g),f=null}},createHref(N){return t(i,N)},createURL:v,encodeLocation(N){let w=v(N);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:x,replace:E,go(N){return o.go(N)}};return S}function NN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Sn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:$c(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Dv(e,t,n="/"){return AN(e,t,n,!1)}function AN(e,t,n,r){let i=typeof t=="string"?du(t):t,l=li(i.pathname||"/",n);if(l==null)return null;let o=jv(e);RN(o);let c=null;for(let f=0;c==null&&f<o.length;++f){let h=FN(l);c=UN(o[f],h,r)}return c}function jv(e,t=[],n=[],r="",i=!1){let l=(o,c,f=i,h)=>{let p={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&f)return;Sn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=Ts([r,p.relativePath]),x=n.concat(p);o.children&&o.children.length>0&&(Sn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),jv(o.children,t,x,g,f)),!(o.path==null&&!o.index)&&t.push({path:g,score:PN(g,o.index),routesMeta:x})};return e.forEach((o,c)=>{var f;if(o.path===""||!((f=o.path)!=null&&f.includes("?")))l(o,c);else for(let h of Mv(o.path))l(o,c,!0,h)}),t}function Mv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let o=Mv(r.join("/")),c=[];return c.push(...o.map(f=>f===""?l:[l,f].join("/"))),i&&c.push(...o),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function RN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:BN(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var LN=/^:[\w-]+$/,IN=3,ON=2,DN=1,jN=10,MN=-2,d2=e=>e==="*";function PN(e,t){let n=e.split("/"),r=n.length;return n.some(d2)&&(r+=MN),t&&(r+=ON),n.filter(i=>!d2(i)).reduce((i,l)=>i+(LN.test(l)?IN:l===""?DN:jN),r)}function BN(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function UN(e,t,n=!1){let{routesMeta:r}=e,i={},l="/",o=[];for(let c=0;c<r.length;++c){let f=r[c],h=c===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},p),x=f.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!g)return null;Object.assign(i,g.params),o.push({params:i,pathname:Ts([l,g.pathname]),pathnameBase:GN(Ts([l,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(l=Ts([l,g.pathnameBase]))}return o}function uh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=HN(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],o=l.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:g},x)=>{if(p==="*"){let v=c[x]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const E=c[x];return g&&!E?h[p]=void 0:h[p]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:o,pattern:e}}function HN(e,t=!1,n=!0){$a(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,f,h,p)=>{if(r.push({paramName:c,isOptional:f!=null}),f){let g=p.charAt(h+o.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function FN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $a(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function li(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var zN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $N(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?du(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=f2(n.substring(1),"/"):l=f2(n,t)):l=t,{pathname:l,search:qN(r),hash:YN(i)}}function f2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function m0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function VN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function E1(e){let t=VN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ph(e,t,n,r=!1){let i;typeof e=="string"?i=du(e):(i={...e},Sn(!i.pathname||!i.pathname.includes("?"),m0("?","pathname","search",i)),Sn(!i.pathname||!i.pathname.includes("#"),m0("#","pathname","hash",i)),Sn(!i.search||!i.search.includes("#"),m0("#","search","hash",i)));let l=e===""||i.pathname==="",o=l?"/":i.pathname,c;if(o==null)c=n;else{let g=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),g-=1;i.pathname=x.join("/")}c=g>=0?t[g]:"/"}let f=$N(i,c),h=o&&o!=="/"&&o.endsWith("/"),p=(l||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var Ts=e=>e.join("/").replace(/\/\/+/g,"/"),GN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,YN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,WN=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function QN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function XN(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Pv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bv(e,t){let n=e;if(typeof n!="string"||!zN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Pv)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=li(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:i=!0}catch{$a(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Uv=["POST","PUT","PATCH","DELETE"];new Set(Uv);var KN=["GET",...Uv];new Set(KN);var fu=T.createContext(null);fu.displayName="DataRouter";var Bh=T.createContext(null);Bh.displayName="DataRouterState";var Hv=T.createContext(!1);function ZN(){return T.useContext(Hv)}var Fv=T.createContext({isTransitioning:!1});Fv.displayName="ViewTransition";var JN=T.createContext(new Map);JN.displayName="Fetchers";var eA=T.createContext(null);eA.displayName="Await";var ha=T.createContext(null);ha.displayName="Navigation";var td=T.createContext(null);td.displayName="Location";var Va=T.createContext({outlet:null,matches:[],isDataRoute:!1});Va.displayName="Route";var _1=T.createContext(null);_1.displayName="RouteError";var zv="REACT_ROUTER_ERROR",tA="REDIRECT",nA="ROUTE_ERROR_RESPONSE";function rA(e){if(e.startsWith(`${zv}:${tA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function aA(e){if(e.startsWith(`${zv}:${nA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new WN(t.status,t.statusText,t.data)}catch{}}function sA(e,{relative:t}={}){Sn(hu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(ha),{hash:i,pathname:l,search:o}=nd(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:Ts([n,l])),r.createHref({pathname:c,search:o,hash:i})}function hu(){return T.useContext(td)!=null}function ma(){return Sn(hu(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(td).location}var $v="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vv(e){T.useContext(ha).static||T.useLayoutEffect(e)}function ss(){let{isDataRoute:e}=T.useContext(Va);return e?_A():iA()}function iA(){Sn(hu(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(fu),{basename:t,navigator:n}=T.useContext(ha),{matches:r}=T.useContext(Va),{pathname:i}=ma(),l=JSON.stringify(E1(r)),o=T.useRef(!1);return Vv(()=>{o.current=!0}),T.useCallback((f,h={})=>{if($a(o.current,$v),!o.current)return;if(typeof f=="number"){n.go(f);return}let p=Ph(f,JSON.parse(l),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ts([t,p.pathname])),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,l,i,e])}var lA=T.createContext(null);function oA(e){let t=T.useContext(Va).outlet;return T.useMemo(()=>t&&T.createElement(lA.Provider,{value:e},t),[t,e])}function uA(){let{matches:e}=T.useContext(Va),t=e[e.length-1];return t?t.params:{}}function nd(e,{relative:t}={}){let{matches:n}=T.useContext(Va),{pathname:r}=ma(),i=JSON.stringify(E1(n));return T.useMemo(()=>Ph(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function cA(e,t){return Gv(e,t)}function Gv(e,t,n){var N;Sn(hu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(ha),{matches:i}=T.useContext(Va),l=i[i.length-1],o=l?l.params:{},c=l?l.pathname:"/",f=l?l.pathnameBase:"/",h=l&&l.route;{let w=h&&h.path||"";Yv(c,!h||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let p=ma(),g;if(t){let w=typeof t=="string"?du(t):t;Sn(f==="/"||((N=w.pathname)==null?void 0:N.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=p;let x=g.pathname||"/",E=x;if(f!=="/"){let w=f.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=Dv(e,{pathname:E});$a(h||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),$a(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=pA(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},o,w.params),pathname:Ts([f,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:Ts([f,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return t&&S?T.createElement(td.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},S):S}function dA(){let e=EA(),t=QN(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:l},"ErrorBoundary")," or"," ",T.createElement("code",{style:l},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:i},n):null,o)}var fA=T.createElement(dA,null),qv=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=aA(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(Va.Provider,{value:this.props.routeContext},T.createElement(_1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(hA,{error:e},t):t}};qv.contextType=Hv;var p0=new WeakMap;function hA({children:e,error:t}){let{basename:n}=T.useContext(ha);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=rA(t.digest);if(r){let i=p0.get(t);if(i)throw i;let l=Bv(r.location,n);if(Pv&&!p0.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw p0.set(t,o),o}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function mA({routeContext:e,match:t,children:n}){let r=T.useContext(fu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(Va.Provider,{value:e},n)}function pA(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=r==null?void 0:r.errors;if(l!=null){let p=i.findIndex(g=>g.route.id&&(l==null?void 0:l[g.route.id])!==void 0);Sn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let p=0;p<i.length;p++){let g=i[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=p),g.route.id){let{loaderData:x,errors:E}=r,v=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.route.lazy||v){n.isStatic&&(o=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(p,g)=>{var x,E;f(p,{location:r.location,params:((E=(x=r.matches)==null?void 0:x[0])==null?void 0:E.params)??{},unstable_pattern:XN(r.matches),errorInfo:g})}:void 0;return i.reduceRight((p,g,x)=>{let E,v=!1,S=null,N=null;r&&(E=l&&g.route.id?l[g.route.id]:void 0,S=g.route.errorElement||fA,o&&(c<0&&x===0?(Yv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,N=null):c===x&&(v=!0,N=g.route.hydrateFallbackElement||null)));let w=t.concat(i.slice(0,x+1)),R=()=>{let C;return E?C=S:v?C=N:g.route.Component?C=T.createElement(g.route.Component,null):g.route.element?C=g.route.element:C=p,T.createElement(mA,{match:g,routeContext:{outlet:p,matches:w,isDataRoute:r!=null},children:C})};return r&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?T.createElement(qv,{location:r.location,revalidation:r.revalidation,component:S,error:E,children:R(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:h}):R()},null)}function T1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gA(e){let t=T.useContext(fu);return Sn(t,T1(e)),t}function bA(e){let t=T.useContext(Bh);return Sn(t,T1(e)),t}function xA(e){let t=T.useContext(Va);return Sn(t,T1(e)),t}function v1(e){let t=xA(e),n=t.matches[t.matches.length-1];return Sn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function yA(){return v1("useRouteId")}function EA(){var r;let e=T.useContext(_1),t=bA("useRouteError"),n=v1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _A(){let{router:e}=gA("useNavigate"),t=v1("useNavigate"),n=T.useRef(!1);return Vv(()=>{n.current=!0}),T.useCallback(async(i,l={})=>{$a(n.current,$v),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var h2={};function Yv(e,t,n){!t&&!h2[e]&&(h2[e]=!0,$a(!1,n))}T.memo(TA);function TA({routes:e,future:t,state:n,isStatic:r,onError:i}){return Gv(e,void 0,{state:n,isStatic:r,onError:i})}function vA({to:e,replace:t,state:n,relative:r}){Sn(hu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=T.useContext(ha);$a(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=T.useContext(Va),{pathname:o}=ma(),c=ss(),f=Ph(e,E1(l),o,r==="path"),h=JSON.stringify(f);return T.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function kA(e){return oA(e.context)}function ni(e){Sn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function wA({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:l=!1,unstable_useTransitions:o}){Sn(!hu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=T.useMemo(()=>({basename:c,navigator:i,static:l,unstable_useTransitions:o,future:{}}),[c,i,l,o]);typeof n=="string"&&(n=du(n));let{pathname:h="/",search:p="",hash:g="",state:x=null,key:E="default",unstable_mask:v}=n,S=T.useMemo(()=>{let N=li(h,c);return N==null?null:{location:{pathname:N,search:p,hash:g,state:x,key:E,unstable_mask:v},navigationType:r}},[c,h,p,g,x,E,r,v]);return $a(S!=null,`<Router basename="${c}"> is not able to match the URL "${h}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:T.createElement(ha.Provider,{value:f},T.createElement(td.Provider,{children:t,value:S}))}function CA({children:e,location:t}){return cA(xg(e),t)}function xg(e,t=[]){let n=[];return T.Children.forEach(e,(r,i)=>{if(!T.isValidElement(r))return;let l=[...t,i];if(r.type===T.Fragment){n.push.apply(n,xg(r.props.children,l));return}Sn(r.type===ni,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Sn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=xg(r.props.children,l)),n.push(o)}),n}var Zf="get",Jf="application/x-www-form-urlencoded";function Uh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function SA(e){return Uh(e)&&e.tagName.toLowerCase()==="button"}function NA(e){return Uh(e)&&e.tagName.toLowerCase()==="form"}function AA(e){return Uh(e)&&e.tagName.toLowerCase()==="input"}function RA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LA(e,t){return e.button===0&&(!t||t==="_self")&&!RA(e)}function yg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function IA(e,t){let n=yg(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var wf=null;function OA(){if(wf===null)try{new FormData(document.createElement("form"),0),wf=!1}catch{wf=!0}return wf}var DA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function g0(e){return e!=null&&!DA.has(e)?($a(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jf}"`),null):e}function jA(e,t){let n,r,i,l,o;if(NA(e)){let c=e.getAttribute("action");r=c?li(c,t):null,n=e.getAttribute("method")||Zf,i=g0(e.getAttribute("enctype"))||Jf,l=new FormData(e)}else if(SA(e)||AA(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?li(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Zf,i=g0(e.getAttribute("formenctype"))||g0(c.getAttribute("enctype"))||Jf,l=new FormData(c,e),!OA()){let{name:h,type:p,value:g}=e;if(p==="image"){let x=h?`${h}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else h&&l.append(h,g)}}else{if(Uh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zf,r=null,i=Jf,o=e}return l&&i==="text/plain"&&(o=l,l=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function k1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Wv(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&li(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function MA(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function PA(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function BA(e,t,n){let r=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let o=await MA(l,n);return o.links?o.links():[]}return[]}));return zA(r.flat(1).filter(PA).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function m2(e,t,n,r,i,l){let o=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,c=(f,h)=>{var p;return n[h].pathname!==f.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>o(f,h)||c(f,h)):l==="data"?t.filter((f,h)=>{var g;let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(o(f,h)||c(f,h))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function UA(e,t,{includeHydrateFallback:n}={}){return HA(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function HA(e){return[...new Set(e)]}function FA(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function zA(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let l=JSON.stringify(FA(i));return n.has(l)||(n.add(l),r.push({key:l,link:i})),r},[])}function w1(){let e=T.useContext(fu);return k1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $A(){let e=T.useContext(Bh);return k1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var C1=T.createContext(void 0);C1.displayName="FrameworkContext";function S1(){let e=T.useContext(C1);return k1(e,"You must render this element inside a <HydratedRouter> element"),e}function VA(e,t){let n=T.useContext(C1),[r,i]=T.useState(!1),[l,o]=T.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,x=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let S=w=>{w.forEach(R=>{o(R.isIntersecting)})},N=new IntersectionObserver(S,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[e]),T.useEffect(()=>{if(r){let S=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(S)}}},[r]);let E=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:fc(c,E),onBlur:fc(f,v),onMouseEnter:fc(h,E),onMouseLeave:fc(p,v),onTouchStart:fc(g,E)}]:[!1,x,{}]}function fc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GA({page:e,...t}){let n=ZN(),{router:r}=w1(),i=T.useMemo(()=>Dv(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?T.createElement(YA,{page:e,matches:i,...t}):T.createElement(WA,{page:e,matches:i,...t}):null}function qA(e){let{manifest:t,routeModules:n}=S1(),[r,i]=T.useState([]);return T.useEffect(()=>{let l=!1;return BA(e,t,n).then(o=>{l||i(o)}),()=>{l=!0}},[e,t,n]),r}function YA({page:e,matches:t,...n}){let r=ma(),{future:i}=S1(),{basename:l}=w1(),o=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let c=Wv(e,l,i.unstable_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?f=!0:h.push(p.route.id);return f&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[l,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return T.createElement(T.Fragment,null,o.map(c=>T.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...n})))}function WA({page:e,matches:t,...n}){let r=ma(),{future:i,manifest:l,routeModules:o}=S1(),{basename:c}=w1(),{loaderData:f,matches:h}=$A(),p=T.useMemo(()=>m2(e,t,h,l,r,"data"),[e,t,h,l,r]),g=T.useMemo(()=>m2(e,t,h,l,r,"assets"),[e,t,h,l,r]),x=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,N=!1;if(t.forEach(R=>{var O;let C=l.routes[R.route.id];!C||!C.hasLoader||(!p.some(Y=>Y.route.id===R.route.id)&&R.route.id in f&&((O=o[R.route.id])!=null&&O.shouldRevalidate)||C.hasClientLoader?N=!0:S.add(R.route.id))}),S.size===0)return[];let w=Wv(e,c,i.unstable_trailingSlashAwareDataRequests,"data");return N&&S.size>0&&w.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[w.pathname+w.search]},[c,i.unstable_trailingSlashAwareDataRequests,f,r,l,p,t,e,o]),E=T.useMemo(()=>UA(g,l),[g,l]),v=qA(g);return T.createElement(T.Fragment,null,x.map(S=>T.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),E.map(S=>T.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),v.map(({key:S,link:N})=>T.createElement("link",{key:S,nonce:n.nonce,...N,crossOrigin:N.crossOrigin??n.crossOrigin})))}function QA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var XA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{XA&&(window.__reactRouterVersion="7.14.0")}catch{}function KA({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=T.useRef();i.current==null&&(i.current=wN({window:r,v5Compat:!0}));let l=i.current,[o,c]=T.useState({action:l.action,location:l.location}),f=T.useCallback(h=>{n===!1?c(h):T.startTransition(()=>c(h))},[n]);return T.useLayoutEffect(()=>l.listen(f),[l,f]),T.createElement(wA,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var Qv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oi=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:l,replace:o,unstable_mask:c,state:f,target:h,to:p,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:E,...v},S){let{basename:N,navigator:w,unstable_useTransitions:R}=T.useContext(ha),C=typeof p=="string"&&Qv.test(p),O=Bv(p,N);p=O.to;let Y=sA(p,{relative:i}),P=ma(),B=null;if(c){let re=Ph(c,[],P.unstable_mask?P.unstable_mask.pathname:"/",!0);N!=="/"&&(re.pathname=re.pathname==="/"?N:Ts([N,re.pathname])),B=w.createHref(re)}let[G,le,Q]=VA(r,v),ce=t6(p,{replace:o,unstable_mask:c,state:f,target:h,preventScrollReset:g,relative:i,viewTransition:x,unstable_defaultShouldRevalidate:E,unstable_useTransitions:R});function W(re){t&&t(re),re.defaultPrevented||ce(re)}let fe=!(O.isExternal||l),ge=T.createElement("a",{...v,...Q,href:(fe?B:void 0)||O.absoluteURL||Y,onClick:fe?W:t,ref:QA(S,le),target:h,"data-discover":!C&&n==="render"?"true":void 0});return G&&!C?T.createElement(T.Fragment,null,ge,T.createElement(GA,{page:Y})):ge});oi.displayName="Link";var ZA=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:l,to:o,viewTransition:c,children:f,...h},p){let g=nd(o,{relative:h.relative}),x=ma(),E=T.useContext(Bh),{navigator:v,basename:S}=T.useContext(ha),N=E!=null&&i6(g)&&c===!0,w=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,R=x.pathname,C=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(R=R.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&S&&(C=li(C,S)||C);const O=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let Y=R===w||!i&&R.startsWith(w)&&R.charAt(O)==="/",P=C!=null&&(C===w||!i&&C.startsWith(w)&&C.charAt(w.length)==="/"),B={isActive:Y,isPending:P,isTransitioning:N},G=Y?t:void 0,le;typeof r=="function"?le=r(B):le=[r,Y?"active":null,P?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let Q=typeof l=="function"?l(B):l;return T.createElement(oi,{...h,"aria-current":G,className:le,ref:p,style:Q,to:o,viewTransition:c},typeof f=="function"?f(B):f)});ZA.displayName="NavLink";var JA=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:l,method:o=Zf,action:c,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:x,...E},v)=>{let{unstable_useTransitions:S}=T.useContext(ha),N=a6(),w=s6(c,{relative:h}),R=o.toLowerCase()==="get"?"get":"post",C=typeof c=="string"&&Qv.test(c),O=Y=>{if(f&&f(Y),Y.defaultPrevented)return;Y.preventDefault();let P=Y.nativeEvent.submitter,B=(P==null?void 0:P.getAttribute("formmethod"))||o,G=()=>N(P||Y.currentTarget,{fetcherKey:t,method:B,navigate:n,replace:i,state:l,relative:h,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:x});S&&n!==!1?T.startTransition(()=>G()):G()};return T.createElement("form",{ref:v,method:R,action:w,onSubmit:r?f:O,...E,"data-discover":!C&&e==="render"?"true":void 0})});JA.displayName="Form";function e6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xv(e){let t=T.useContext(fu);return Sn(t,e6(e)),t}function t6(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let p=ss(),g=ma(),x=nd(e,{relative:o});return T.useCallback(E=>{if(LA(E,t)){E.preventDefault();let v=n!==void 0?n:$c(g)===$c(x),S=()=>p(e,{replace:v,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f});h?T.startTransition(()=>S()):S()}},[g,p,x,n,r,i,t,e,l,o,c,f,h])}function Kv(e){$a(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(yg(e)),n=T.useRef(!1),r=ma(),i=T.useMemo(()=>IA(r.search,n.current?null:t.current),[r.search]),l=ss(),o=T.useCallback((c,f)=>{const h=yg(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,l("?"+h,f)},[l,i]);return[i,o]}var n6=0,r6=()=>`__${String(++n6)}__`;function a6(){let{router:e}=Xv("useSubmit"),{basename:t}=T.useContext(ha),n=yA(),r=e.fetch,i=e.navigate;return T.useCallback(async(l,o={})=>{let{action:c,method:f,encType:h,formData:p,body:g}=jA(l,t);if(o.navigate===!1){let x=o.fetcherKey||r6();await r(x,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||f,formEncType:o.encType||h,flushSync:o.flushSync})}else await i(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||f,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function s6(e,{relative:t}={}){let{basename:n}=T.useContext(ha),r=T.useContext(Va);Sn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),l={...nd(e||".",{relative:t})},o=ma();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),f=c.getAll("index");if(f.some(p=>p==="")){c.delete("index"),f.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();l.search=p?`?${p}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ts([n,l.pathname])),$c(l)}function i6(e,{relative:t}={}){let n=T.useContext(Fv);Sn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Xv("useViewTransitionState"),i=nd(e,{relative:t});if(!n.isTransitioning)return!1;let l=li(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=li(n.nextLocation.pathname,r)||n.nextLocation.pathname;return uh(i.pathname,o)!=null||uh(i.pathname,l)!=null}var mu=Ov();const Zv=T.createContext(null);function eo(){return T.useContext(Zv)}class Yt extends Error{constructor(t,n){super(n.message),this.statusCode=t,this.payload=n}}async function dt(e,t){const n=new Headers(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!(t.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const r=await fetch(e,{headers:n,...t});if(!r.ok){const i=await r.json();throw new Yt(r.status,i)}return await r.json()}function l6(e){const t=String(e);return t.includes("/exports/pdf")?t.includes("format=html")?"remote-codex-transcript.html":"remote-codex-transcript.pdf":"download"}function o6(e){var i;if(!e)return null;const t=e.match(/filename\*=UTF-8''([^;]+)/i);if(t!=null&&t[1])try{return decodeURIComponent(t[1].trim())}catch{return t[1].trim()}const n=e.match(/filename="([^"]+)"/i);if(n!=null&&n[1])return n[1].trim();const r=e.match(/filename=([^;]+)/i);return((i=r==null?void 0:r[1])==null?void 0:i.trim())??null}async function u6(e,t){const n=await fetch(e,t);if(!n.ok){let i=null;try{i=await n.json()}catch{i=null}throw new Yt(n.status,i??{code:"internal_error",message:"Unable to download file."})}const r=o6(n.headers.get("content-disposition"))??l6(e);return{blob:await n.blob(),filename:r}}function p2(e,t){const n=e.originalName.trim();if(n)return n;const r=e.file.name.trim();return r||(e.kind==="photo"?`photo-${t+1}.jpg`:`file-${t+1}`)}function c6(){return dt("/api/config/runtime")}function d6(){return dt("/api/config/workspace-settings",{cache:"no-store"})}function f6(e){return dt("/api/config/workspace-settings",{method:"PATCH",body:JSON.stringify(e)})}function Jv(){return dt("/api/agent-runtimes",{cache:"no-store"})}function ek(e){return dt(`/api/agent-runtimes/${encodeURIComponent(e)}/status`,{cache:"no-store"})}function h6(e){return dt(`/api/agent-runtimes/${encodeURIComponent(e)}/restart`,{method:"POST"})}function Eg(e){return dt(`/api/agent-runtimes/${encodeURIComponent(e)}/models`,{cache:"no-store"})}function _g(e,t){return dt(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{cache:"no-store"})}function Tg(e,t,n){return dt(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function m6(e){return dt(`/api/config/providers/${encodeURIComponent(e)}/archives`,{cache:"no-store"})}function p6(e,t={}){return dt(`/api/config/providers/${encodeURIComponent(e)}/archives`,{method:"POST",body:JSON.stringify(t)})}function g6(e,t,n){return dt(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function b6(e,t){return dt(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}/apply`,{method:"POST"})}function x6(){return dt("/api/service/build-restart",{method:"POST"})}function y6(){return dt("/healthz",{cache:"no-store"})}function N1(){return dt("/api/workspaces")}function tk(){return dt("/api/threads")}function g2(e,t={}){const n=new URLSearchParams;return t.limit!==void 0&&n.set("limit",String(t.limit)),t.beforeTurnId&&n.set("beforeTurnId",t.beforeTurnId),dt(`/api/threads/${e}${n.size>0?`?${n.toString()}`:""}`)}function E6(e,t){return dt(`/api/threads/${e}/items/${encodeURIComponent(t)}/detail`)}function _6(e){return dt(`/api/threads/${e}/export-turns`,{cache:"no-store"})}function T6(e,t){var r,i,l;const n=new URLSearchParams;return t.format!==void 0&&n.set("format",t.format),n.set("mode",t.mode),t.limit!==void 0&&n.set("limit",String(t.limit)),t.turnIds!==void 0&&n.set("turnIds",t.turnIds.join(",")),t.profile!==void 0&&n.set("profile",t.profile),((r=t.options)==null?void 0:r.includeTokenAndPrice)!==void 0&&n.set("includeTokenAndPrice",String(t.options.includeTokenAndPrice)),((i=t.options)==null?void 0:i.includeCommandOutput)!==void 0&&n.set("includeCommandOutput",String(t.options.includeCommandOutput)),((l=t.options)==null?void 0:l.includeAbsolutePaths)!==void 0&&n.set("includeAbsolutePaths",String(t.options.includeAbsolutePaths)),`/api/threads/${encodeURIComponent(e)}/exports/pdf?${n.toString()}`}function v6(e,t){return u6(T6(e,t),{cache:"no-store"})}function k6(e){return dt(`/api/threads/${e}/shell`)}function w6(e){return dt("/api/threads/start",{method:"POST",body:JSON.stringify(e)})}function C6(e){return dt("/api/threads/import",{method:"POST",body:JSON.stringify({sessionId:e})})}function S6(e,t={}){return dt(`/api/threads/${e}/shell`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function N6(e){return dt(`/api/shells/${e}/terminate`,{method:"POST"})}function b2(e,t={}){return dt(`/api/threads/${e}/resume`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function A6(e){return dt(`/api/threads/${e}/disconnect`,{method:"POST"})}function R6(e,t){const n=t.attachments??[];if(n.length===0)return dt(`/api/threads/${e}/prompt`,{method:"POST",body:JSON.stringify(t)});const r=new FormData;r.append("prompt",t.prompt),t.clientRequestId!==void 0&&r.append("clientRequestId",t.clientRequestId),t.model!==void 0&&r.append("model",t.model),t.reasoningEffort!==void 0&&t.reasoningEffort!==null&&r.append("reasoningEffort",t.reasoningEffort),t.collaborationMode!==void 0&&r.append("collaborationMode",t.collaborationMode),t.sandboxMode!==void 0&&t.sandboxMode!==null&&r.append("sandboxMode",t.sandboxMode);const i=n.map((l,o)=>({clientId:l.clientId,kind:l.kind,originalName:p2(l,o),placeholder:l.placeholder}));r.append("attachmentManifest",JSON.stringify(i));for(const[l,o]of n.entries())r.append("attachments",o.file,p2(o,l));return dt(`/api/threads/${e}/prompt`,{method:"POST",body:r})}function x2(e,t={}){return dt(`/api/threads/${e}/interrupt`,{method:"POST",body:JSON.stringify(t)})}function nk(e,t){return dt(`/api/threads/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function L6(e){return dt(`/api/threads/${e}`,{method:"DELETE"})}function I6(e,t){return dt(`/api/threads/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function O6(e){return dt(`/api/threads/${e}/compact`,{method:"POST"})}function D6(e){return dt(`/api/threads/${e}/goal`,{cache:"no-store"})}function j6(e,t){return dt(`/api/threads/${e}/goal`,{method:"PATCH",body:JSON.stringify(t)})}function M6(e){return dt(`/api/threads/${e}/goal`,{method:"DELETE"})}function P6(e){return dt(`/api/threads/${e}/fork-turns`,{cache:"no-store"})}function y2(e,t){return dt(`/api/threads/${e}/fork`,{method:"POST",body:JSON.stringify(t)})}function B6(e){return dt(`/api/threads/${e}/skills`,{cache:"no-store"})}function U6(e){return dt(`/api/threads/${e}/mcp-servers`,{cache:"no-store"})}function H6(e){return dt(`/api/threads/${e}/hooks`,{cache:"no-store"})}function F6(e,t){return dt(`/api/threads/${e}/hooks`,{method:"POST",body:JSON.stringify(t)})}function z6(e,t){return dt(`/api/threads/${e}/hooks`,{method:"PUT",body:JSON.stringify(t)})}function $6(e,t){return dt(`/api/threads/${e}/hooks/trust`,{method:"POST",body:JSON.stringify(t)})}function V6(e,t){return dt(`/api/threads/${e}/hooks/untrust`,{method:"POST",body:JSON.stringify(t)})}function G6(e,t,n){return dt(`/api/threads/${e}/requests/${encodeURIComponent(t)}/respond`,{method:"POST",body:JSON.stringify(n)})}function q6(e){return dt("/api/workspaces",{method:"POST",body:JSON.stringify(e)})}function Y6(e,t){return dt(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function W6(e){return dt(`/api/workspaces/${e}`,{method:"DELETE"})}function Q6(e,t){return dt(`/api/workspaces/${e}/favorite`,{method:"POST",body:JSON.stringify(t)})}function rk(e){const t=window.location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}/ws`);return n.addEventListener("message",r=>{try{const i=JSON.parse(r.data);"threadId"in i&&i.type.startsWith("thread.")&&e(i)}catch{}}),n}function X6(e={}){const t=window.location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}/ws`);return n.addEventListener("message",r=>{var i,l;try{const o=JSON.parse(r.data);if(o.type==="supervisor.connected"){(i=e.onConnected)==null||i.call(e,o);return}"shellId"in o&&o.type.startsWith("shell.")&&((l=e.onShellEvent)==null||l.call(e,o))}catch{}}),{socket:n,send(r){n.send(JSON.stringify(r))}}}function K6(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M2 3.25h12v1.5H2Zm0 4h12v1.5H2Zm0 4h12v1.5H2Z"})})}function vg(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})}function E2(e=!1){return`flex w-full items-center rounded-[0.95rem] px-3 py-2 text-left text-sm transition ${e?"cursor-not-allowed bg-[var(--theme-muted)] text-[var(--theme-fg-muted)]":"text-[var(--theme-fg)] hover:bg-[var(--theme-hover)]"}`}const Z6=[{value:"light",label:"Light",description:"Always use the bright theme."},{value:"dark",label:"Dark",description:"Always use the dark theme."},{value:"system",label:"System",description:"Follow the operating system appearance."}],ak={hostConfigFiles:[],toolboxItems:[],hookCommandTemplates:[],providerConfigFormat:"none",mcpConfigFormat:"none",configArchives:!1,buildRestart:!1};function _2(e,t){return{provider:e,displayName:t,description:`${t} backend descriptor is not available.`,enabled:!1,isDefault:e==="codex",status:{state:"stopped",transport:e==="claude"?"sdk":"none",lastStartedAt:null,lastError:"Backend descriptor is not available.",restartCount:0},capabilities:{sessions:{list:!1,read:!1,resume:!1,importLocal:!1},turns:{start:!1,streamInput:!1,steer:!1,interrupt:!1,compact:!1},branching:{fork:!1,hardRollback:!1,resumeAt:!1,rewindFiles:!1},controls:{planMode:!1,permissionRequests:!1,sandboxMode:!1,performanceMode:!1,goals:!1},management:{models:!1,mcpStatus:!1,skills:!1,hooks:!1,hookTrust:!1,hostConfigFiles:!1,providerSettings:!1},usage:{contextWindow:!1,tokenUsage:!1,costUsd:!1}},managementSchema:ak}}const Xo=[_2("codex","Codex"),_2("claude","Claude")];function J6(e){var t;return((t=Xo.find(n=>n.provider===e))==null?void 0:t.managementSchema)??ak}function e4(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function hc(e){return{path:e,exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null}}function A1({className:e=""}){const t=eo();return t?d.jsx("button",{type:"button","aria-label":t.navOpen?"Close Navigation":"Open Navigation","aria-expanded":t.navOpen,"aria-controls":"app-shell-navigation-menu",onClick:t.toggleNav,className:`inline-flex h-10 w-10 shrink-0 items-center justify-center text-[var(--theme-fg)] transition hover:text-[var(--theme-fg-soft)] ${e}`.trim(),children:t.navOpen?d.jsx(vg,{}):d.jsx(K6,{})}):null}function R1({className:e=""}){const t=eo(),n=ma(),r=ss(),i=T.useRef(null),l=n.pathname==="/workspaces";return T.useEffect(()=>{if(!(t!=null&&t.navOpen))return;const o=t;function c(f){const h=f.target;if(!h)return;const p=i.current;p!=null&&p.contains(h)||h instanceof Element&&h.closest('[aria-controls="app-shell-navigation-menu"]')||o.closeNav()}return document.addEventListener("pointerdown",c),()=>{document.removeEventListener("pointerdown",c)}},[t]),t!=null&&t.navOpen?d.jsxs("div",{ref:i,id:"app-shell-navigation-menu",onPointerDown:o=>{o.stopPropagation()},onMouseDown:o=>{o.stopPropagation()},onTouchStart:o=>{o.stopPropagation()},className:`rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] p-4 shadow-2xl shadow-black/15 backdrop-blur ${e}`.trim(),children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-base font-semibold tracking-wide text-[var(--theme-accent-strong)]",children:"Remote Codex"}),d.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Navigation"})]}),d.jsxs("nav",{className:"mt-4 flex flex-col gap-1.5 text-sm",children:[d.jsx("button",{type:"button",disabled:l,onClick:()=>{l||(t.closeNav(),r("/workspaces"))},className:E2(l),children:"Workspaces"}),d.jsx("button",{type:"button",onClick:()=>{t.openSettings()},className:E2(),children:"Settings"})]})]}):null}function t4(){const e=eo(),[t,n]=T.useState(null),[r,i]=T.useState({}),l=t?r[t]:null,[o,c]=T.useState({busy:!1,message:null,error:null}),[f,h]=T.useState([]),[p,g]=T.useState(Xo),[x,E]=T.useState({loading:!1,saving:!1,error:null}),[v,S]=T.useState(null),[N,w]=T.useState({devHomeDraft:"",loading:!1,saving:!1,message:null,error:null}),[R,C]=T.useState({loading:!1,creating:!1,applyingId:null,renamingId:null,renameDraft:"",message:null,error:null}),O=(e==null?void 0:e.themeMode)??"system",Y=(e==null?void 0:e.effectiveTheme)??"dark",P=(e==null?void 0:e.defaultBackend)??"codex",B=p.find($=>$.provider===P)??Xo.find($=>$.provider===P)??Xo[0],G=B.managementSchema??J6(B.provider),le=G.hostConfigFiles;T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!G.configArchives)return;const $=e;function J(he){he.key==="Escape"&&$.closeSettings()}return window.addEventListener("keydown",J),()=>{window.removeEventListener("keydown",J)}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let $=!1;return E(J=>({...J,loading:!0,error:null})),Jv().then(J=>{if($)return;const he=[...J,...Xo.filter(A=>!J.some(H=>H.provider===A.provider))];g(he),E(A=>({...A,loading:!1}))}).catch(J=>{$||(g(Xo),E(he=>({...he,loading:!1,error:J instanceof Yt?J.message:"Unable to load backend settings."})))}),()=>{$=!0}},[e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let $=!1;return w(J=>({...J,loading:!0,message:null,error:null})),d6().then(J=>{$||(S(J),w(he=>({...he,devHomeDraft:J.devHome,loading:!1})))}).catch(J=>{$||w(he=>({...he,loading:!1,error:J instanceof Yt?J.message:"Unable to load workspace settings."}))}),()=>{$=!0}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!B.capabilities.management.hostConfigFiles)return;let $=!1;async function J(){i(A=>{const H={...A};for(const te of le)H[te.name]={...hc(te.name),...A[te.name],loading:!0,saving:!1,error:null,saveMessage:null};return H});const he=await Promise.allSettled(le.map(async A=>({name:A.name,result:await _g(B.provider,A.name)})));$||i(A=>{var te,D;const H={...A};for(const we of he){if(we.status==="fulfilled"){const{name:Xe,result:Ze}=we.value;H[Xe]={path:Ze.path,exists:Ze.exists,originalContent:Ze.content,draftContent:Ze.content,loading:!1,saving:!1,error:null,saveMessage:null};continue}const Re=we.reason instanceof Yt?we.reason.message:"Unable to load the file.",Ne=((te=le[he.indexOf(we)])==null?void 0:te.name)??((D=le[0])==null?void 0:D.name);Ne&&(H[Ne]={...hc(Ne),...H[Ne],loading:!1,saving:!1,error:Re,saveMessage:null})}return H})}return J(),()=>{$=!0}},[B.capabilities.management.hostConfigFiles,B.provider,le,e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let $=!1;async function J(){C(he=>({...he,loading:!0,error:null,message:null}));try{const he=await m6(B.provider);if($)return;h(he),C(A=>({...A,loading:!1}))}catch(he){if($)return;C(A=>({...A,loading:!1,error:he instanceof Yt?he.message:"Unable to load config archives."}))}}return J(),()=>{$=!0}},[B.provider,G.configArchives,e==null?void 0:e.settingsOpen]);async function Q(){if(!o.busy){c({busy:!0,message:null,error:null});try{const $=await h6(B.provider);c({busy:!1,message:$.status.state==="ready"?`${$.displayName} backend restarted.`:`${$.displayName} backend state: ${$.status.state}`,error:null}),g(J=>J.map(he=>he.provider===$.provider?$:he))}catch($){c({busy:!1,message:null,error:$ instanceof Yt?$.message:"Unable to restart the app server."})}}}async function ce(){if(!o.busy){c({busy:!0,message:null,error:null});try{await x6(),c({busy:!1,message:"Build and restart launched. The page may disconnect briefly.",error:null})}catch($){c({busy:!1,message:null,error:$ instanceof Yt?$.message:"Unable to launch build and restart."})}}}async function W(){const $=N.devHomeDraft.trim();if(!(!$||N.saving)){w(J=>({...J,saving:!0,message:null,error:null}));try{const J=await f6({devHome:$});S(J),w(he=>({...he,devHomeDraft:J.devHome,saving:!1,message:"Workspace defaults saved."}))}catch(J){w(he=>({...he,saving:!1,error:J instanceof Yt?J.message:"Unable to save workspace settings."}))}}}async function fe($){const J=r[$];if(!(!J||J.saving)){i(he=>({...he,[$]:{...hc($),...he[$],saving:!0,error:null,saveMessage:null}}));try{const he=await Tg(B.provider,$,{content:J.draftContent});i(A=>({...A,[$]:{path:he.path,exists:he.exists,originalContent:he.content,draftContent:he.content,loading:!1,saving:!1,error:null,saveMessage:"Saved"}}))}catch(he){i(A=>({...A,[$]:{...hc($),...A[$],saving:!1,error:he instanceof Yt?he.message:"Unable to save the file.",saveMessage:null}}))}}}async function ge(){if(!R.creating){C($=>({...$,creating:!0,message:null,error:null}));try{const $=await p6(B.provider);h(J=>[$,...J]),C(J=>({...J,creating:!1,message:"Backup created."}))}catch($){C(J=>({...J,creating:!1,error:$ instanceof Yt?$.message:"Unable to create a config backup."}))}}}async function re($){if(!R.applyingId){C(J=>({...J,applyingId:$.id,message:null,error:null}));try{const J=await b6(B.provider,$.id);C(he=>({...he,applyingId:null,message:J.status.state==="ready"?`Applied "${J.archive.label}" and restarted ${B.displayName}.`:`Applied "${J.archive.label}". ${B.displayName} state: ${J.status.state}.`}))}catch(J){C(he=>({...he,applyingId:null,error:J instanceof Yt?J.message:"Unable to apply the config archive."}))}}}async function F($){const J=R.renameDraft.trim();if(!(!J||R.renamingId!==$.id)){C(he=>({...he,message:null,error:null}));try{const he=await g6(B.provider,$.id,{label:J});h(A=>A.map(H=>H.id===$.id?he:H)),C(A=>({...A,renamingId:null,renameDraft:"",message:"Backup renamed."}))}catch(he){C(A=>({...A,error:he instanceof Yt?he.message:"Unable to rename the config backup."}))}}}return e!=null&&e.settingsOpen?d.jsxs("div",{className:"fixed inset-0 z-[70] flex items-start justify-center p-4 pt-[max(env(safe-area-inset-top),1rem)] sm:items-center",children:[d.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"ui-overlay-scrim absolute inset-0 backdrop-blur-sm"}),d.jsxs("section",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"relative z-10 flex max-h-[calc(100vh-2rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/20",children:[d.jsx("div",{className:"shrink-0 p-5 pb-0",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Settings"}),d.jsx("h2",{className:"mt-2 text-xl font-semibold text-[var(--theme-fg)]",children:"Settings"}),d.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Choose the default backend and manage host-side runtime files."})]}),d.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:d.jsx(vg,{})})]})}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 pt-5",children:d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsx("div",{className:"flex items-start justify-between gap-3",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Appearance"}),d.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Choose light, dark, or follow the system setting. Active: ",Y,"."]})]})}),d.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:Z6.map($=>{const J=O===$.value;return d.jsxs("button",{type:"button",onClick:()=>e.setThemeMode($.value),className:`block rounded-[1rem] border px-3 py-2.5 text-left transition ${J?"border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)]":"border-[var(--theme-border)] bg-[var(--theme-surface-strong)] hover:bg-[var(--theme-hover)]"}`,children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:$.label}),J?d.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Active"}):null]}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:$.description})]},$.value)})})]}),d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsx("div",{className:"flex items-start justify-between gap-3",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Workspace defaults"}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Git projects clone into dev home. New workspace directories can create one missing child under this path."})]})}),d.jsxs("div",{className:"mt-3 grid gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Workspace root"}),d.jsx("p",{title:(v==null?void 0:v.workspaceRoot)??"Loading workspace root",className:"mt-1 truncate rounded-[0.9rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-2 font-mono text-xs text-[var(--theme-fg-soft)]",children:N.loading&&!v?"Loading...":(v==null?void 0:v.workspaceRoot)??"Unavailable"})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"settings-dev-home",className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Dev home"}),d.jsxs("div",{className:"mt-1 flex flex-col gap-2 sm:flex-row",children:[d.jsx("input",{id:"settings-dev-home",value:N.devHomeDraft,onChange:$=>w(J=>({...J,devHomeDraft:$.target.value,message:null,error:null})),placeholder:"/Users/name/dev",className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-2 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),d.jsx("button",{type:"button","aria-label":"Save workspace defaults",onClick:()=>void W(),disabled:N.loading||N.saving||!N.devHomeDraft.trim(),className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:N.saving?"Saving...":"Save"})]})]})]}),N.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:N.error}):N.message?d.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:N.message}):null]}),d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Runtime controls"}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Restart the selected backend, or rebuild and restart the supervisor service from this checkout."})]}),d.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:()=>void Q(),disabled:o.busy,className:"rounded-full border border-sky-400/35 bg-sky-400/10 px-3 py-1.5 text-xs font-medium text-sky-500 transition hover:bg-sky-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.busy?"Restarting...":"Restart"}),d.jsx("button",{type:"button",onClick:()=>void ce(),disabled:o.busy,className:"rounded-full border border-amber-400/35 bg-amber-400/10 px-3 py-1.5 text-xs font-medium text-amber-500 transition hover:bg-amber-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.busy?"Working...":"Build and restart"})]})]}),o.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:o.error}):o.message?d.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:o.message}):x.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:x.error}):null]}),d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsx("div",{className:"flex items-start justify-between gap-3",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Provider host files"}),d.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:[B.displayName," exposes these editable files through its backend schema."]})]})}),d.jsxs("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:[le.map($=>{const J=r[$.name]??{path:$.name,exists:!1,originalContent:"",draftContent:"",loading:!1},he=J.draftContent!==J.originalContent;return d.jsx("button",{type:"button",onClick:()=>n($.name),className:"block rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-left transition hover:bg-[var(--theme-hover)]",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:$.label}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:$.description})]}),d.jsx("div",{className:"shrink-0",children:J.loading?d.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-[var(--theme-fg-muted)]",children:"Loading"}):he?d.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Unsaved"}):J.exists?d.jsx("span",{className:"rounded-full border border-emerald-400/25 bg-emerald-400/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-emerald-600 dark:text-emerald-100",children:"Ready"}):d.jsx("span",{className:"rounded-full border border-sky-300/25 bg-sky-300/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-600 dark:text-sky-100",children:"New"})})]})},$.name)}),le.length===0?d.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"This backend does not expose editable host files."}):null]})]}),G.configArchives?d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Config archives"}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Backup the selected backend host files, then apply a saved archive with a backend restart."})]}),d.jsx("button",{type:"button",onClick:()=>void ge(),disabled:R.creating,className:"shrink-0 rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-strong)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:R.creating?"Creating...":"Create backup"})]}),R.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:R.error}):R.message?d.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:R.message}):null,d.jsx("div",{className:"mt-3 space-y-2",children:R.loading?d.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"Loading backups..."}):f.length===0?d.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No config backups yet."}):f.map($=>{const J=R.renamingId===$.id;return d.jsx("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3",children:d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{className:"min-w-0",children:[J?d.jsxs("div",{className:"flex max-w-xl gap-2",children:[d.jsx("input",{"aria-label":`Rename ${$.label}`,value:R.renameDraft,onChange:he=>C(A=>({...A,renameDraft:he.target.value,error:null,message:null})),className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),d.jsx("button",{type:"button","aria-label":`Save archive name ${$.label}`,onClick:()=>void F($),className:"rounded-full bg-[var(--theme-accent-solid)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"Save"}),d.jsx("button",{type:"button",onClick:()=>C(he=>({...he,renamingId:null,renameDraft:""})),className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)]",children:"Cancel"})]}):d.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:$.label}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[var(--theme-fg-muted)]",children:[d.jsxs("span",{children:["Created ",e4($.createdAt)]}),le.map(he=>{var A;return d.jsxs("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 font-mono",children:[he.name,": ",(A=$.files[he.name])!=null&&A.exists?"saved":"missing"]},he.name)})]})]}),d.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[d.jsx("button",{type:"button",onClick:()=>C(he=>({...he,renamingId:$.id,renameDraft:$.label,message:null,error:null})),disabled:J,className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:text-[var(--theme-fg-muted)]",children:"Rename"}),d.jsx("button",{type:"button",onClick:()=>void re($),disabled:R.applyingId!==null,className:"rounded-full border border-emerald-400/35 bg-emerald-400/10 px-3 py-1.5 text-xs font-medium text-emerald-600 transition hover:bg-emerald-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)] dark:text-emerald-100",children:R.applyingId===$.id?"Applying...":"Apply"})]})]})},$.id)})})]}):null]})})]}),t&&l?d.jsx("div",{className:"pointer-events-none fixed inset-0 z-[71] flex items-center justify-center p-4",children:d.jsxs("div",{className:"pointer-events-auto relative z-10 flex max-h-[min(88vh,56rem)] w-full max-w-3xl flex-col overflow-hidden rounded-[1.6rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/25",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--theme-border)] px-4 py-3 sm:px-5",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:t}),d.jsx("p",{className:"mt-1 break-all font-mono text-xs text-[var(--theme-fg-muted)]",children:l.path})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[l.error?d.jsx("span",{className:"text-xs text-rose-300",children:l.error}):l.saveMessage?d.jsx("span",{className:"text-xs text-emerald-300",children:l.saveMessage}):null,d.jsx("button",{type:"button","aria-label":`Save ${t}`,onClick:()=>void fe(t),disabled:l.loading||l.saving||l.draftContent===l.originalContent,className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-sm font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:l.saving?"Saving...":"Save"}),d.jsx("button",{type:"button","aria-label":"Close File Editor",onClick:()=>n(null),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:d.jsx(vg,{})})]})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:d.jsx("textarea",{"aria-label":`Edit ${t}`,value:l.draftContent,onChange:$=>i(J=>({...J,[t]:{...hc(t),...J[t],draftContent:$.target.value,error:null,saveMessage:null}})),spellCheck:!1,className:"min-h-[28rem] w-full rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 font-mono text-[13px] leading-6 text-[var(--theme-fg)] outline-none transition focus:border-[var(--theme-accent-border)]",placeholder:l.loading?"Loading...":`Edit ${t} here`})})]})}):null]}):null}function b0({eyebrow:e,title:t,description:n}){return d.jsxs("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 p-5 shadow-2xl shadow-stone-950/20",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:e}),d.jsx("h2",{className:"mt-3 text-xl font-semibold text-stone-100",children:t}),d.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]})}function n4(){const[e,t]=T.useState(null),[n,r]=T.useState(null);return T.useEffect(()=>{c6().then(t).catch(i=>{r(i instanceof Error?i.message:"Unable to load runtime config.")})},[]),d.jsx("div",{className:"min-h-screen bg-stone-950 px-4 py-8 text-stone-100 sm:px-6",children:d.jsx("div",{className:"mx-auto max-w-7xl",children:d.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[d.jsxs("section",{className:"rounded-[2rem] border border-stone-800 bg-stone-900 p-8 shadow-2xl shadow-stone-950/20 sm:p-10",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.35em] text-amber-300",children:"Local Supervisor"}),d.jsx("h1",{className:"mt-4 max-w-3xl text-4xl font-semibold tracking-tight text-stone-100 sm:text-6xl",children:"Bring your local workspaces into a mobile-ready control surface."}),d.jsx("p",{className:"mt-6 max-w-2xl text-base leading-7 text-stone-400 sm:text-lg",children:"Phase 1 focuses on a stable supervisor shell: runtime config, workspace onboarding, database bootstrap, and a read-only file tree that already respects workspace root boundaries."}),d.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[d.jsx(oi,{to:"/workspaces",className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200",children:"Enter Workspace Console"}),d.jsx(oi,{to:"/workspaces/new",className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:border-stone-500 hover:bg-stone-800",children:"Add First Workspace"})]})]}),d.jsxs("section",{className:"grid gap-4",children:[d.jsx(b0,{eyebrow:"Health",title:n?"API unavailable":"Supervisor reachable",description:n??`Connected to ${(e==null?void 0:e.appName)??"Remote Codex Supervisor"} ${(e==null?void 0:e.appVersion)??""}`.trim()}),d.jsx(b0,{eyebrow:"Workspace Root",title:(e==null?void 0:e.workspaceRoot)??"Loading root path",description:"The file tree and workspace creation flow stay inside this boundary in Phase 1."}),d.jsx(b0,{eyebrow:"Environment",title:(e==null?void 0:e.environment)??"Loading environment",description:e?`${e.host}:${e.port}`:"Runtime metadata appears here after bootstrap."})]})]})})})}function r4(e){if(!e)return"No time";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function a4(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function s4({open:e,busy:t=!1,turnsState:n,onCancel:r,onLoadTurns:i,onExport:l}){var O,Y,P;const o=((O=n.data)==null?void 0:O.turns)??[],c=T.useMemo(()=>o.slice(0,10).map(B=>B.turnId),[o]),[f,h]=T.useState("latest"),[p,g]=T.useState(()=>new Set),[x,E]=T.useState(!0),[v,S]=T.useState("pdf");if(T.useEffect(()=>{e&&(h("latest"),S("pdf"),E(!0),i())},[i,e]),T.useEffect(()=>{e&&o.length>0&&g(new Set(c))},[c,e,o.length]),T.useEffect(()=>{if(!e)return;function B(G){G.key==="Escape"&&!t&&r()}return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[t,r,e]),!e)return null;const N=f==="latest"?Math.min(10,((Y=n.data)==null?void 0:Y.totalTurnCount)??10):p.size,w=!t&&(f==="latest"||p.size>0);function R(B){g(G=>{const le=new Set(G);return le.has(B)?le.delete(B):le.add(B),le})}function C(){const B={format:v,mode:f,...f==="latest"?{limit:10}:{turnIds:[...p]},profile:"review",options:{includeTokenAndPrice:x}};l(B)}return mu.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close export dialog",onClick:r,disabled:t,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Export transcript",className:"relative z-[1] flex max-h-[min(46rem,calc(100vh-2rem))] w-full max-w-2xl flex-col rounded-[1.6rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-stone-800 px-5 py-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-semibold text-stone-100",children:"Export transcript"}),d.jsx("p",{className:"mt-1 text-xs text-stone-500",children:"Default review copy summarizes command batches and file changes."})]}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,disabled:t,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[d.jsx("div",{className:"inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["latest","Latest 10"],["selected","Custom selection"]].map(([B,G])=>d.jsx("button",{type:"button",onClick:()=>h(B),className:`rounded-full px-3 py-1.5 text-sm transition ${f===B?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:G},B))}),d.jsx("div",{className:"mt-4 inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["pdf","PDF"],["html","HTML"]].map(([B,G])=>d.jsx("button",{type:"button",onClick:()=>S(B),className:`rounded-full px-3 py-1.5 text-sm transition ${v===B?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:G},B))}),f==="selected"?d.jsxs("div",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-stone-800 px-3 py-2.5",children:[d.jsxs("p",{className:"text-xs text-stone-400",children:["Selected ",p.size," of ",((P=n.data)==null?void 0:P.totalTurnCount)??o.length]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:()=>g(new Set(o.map(B=>B.turnId))),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Select all"}),d.jsx("button",{type:"button",onClick:()=>g(new Set),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Clear"})]})]}),n.status==="loading"?d.jsx("p",{className:"px-3 py-6 text-sm text-stone-400",children:"Loading turns..."}):n.status==="failed"?d.jsx("p",{className:"px-3 py-6 text-sm text-rose-100",children:n.error}):d.jsx("div",{className:"max-h-80 overflow-auto p-2",children:o.map(B=>d.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition hover:bg-stone-800/70",children:[d.jsx("input",{type:"checkbox",checked:p.has(B.turnId),onChange:()=>R(B.turnId),className:"h-4 w-4 accent-amber-300"}),d.jsxs("span",{className:"shrink-0 text-xs font-medium text-stone-300",children:["Turn ",B.turnNumber]}),d.jsx("span",{className:"shrink-0 text-xs text-stone-500",children:r4(B.startedAt)}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-stone-200",children:B.userPromptPreview}),d.jsx("span",{className:"hidden shrink-0 rounded-full border border-stone-700 px-2 py-0.5 text-[10px] text-stone-400 sm:inline",children:a4(B.status)})]},B.turnId))})]}):d.jsx("p",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40 px-3 py-3 text-sm text-stone-300",children:"Exports the latest 10 turns in chronological order."}),d.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-stone-300 sm:grid-cols-2",children:[d.jsxs("label",{className:"flex items-center gap-2 rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2",children:[d.jsx("input",{type:"checkbox",checked:x,onChange:B=>E(B.target.checked),className:"h-4 w-4 accent-amber-300"}),"Token and price"]}),d.jsx("p",{className:"flex items-center rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2 text-xs text-stone-500",children:v==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-stone-800 px-5 py-4",children:[d.jsxs("p",{className:"min-w-0 text-xs text-stone-500",children:[N," ",N===1?"turn":"turns"," will be exported."]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),d.jsx("button",{type:"button",onClick:C,disabled:!w,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:t?"Exporting...":`Export ${v.toUpperCase()}`})]})]})]})]}),document.body)}const eh=[{value:"preToolUse",label:"PreToolUse",matcherHint:"Bash"},{value:"permissionRequest",label:"PermissionRequest",matcherHint:"Bash"},{value:"postToolUse",label:"PostToolUse",matcherHint:"Bash"},{value:"sessionStart",label:"SessionStart",matcherHint:"startup|resume"},{value:"userPromptSubmit",label:"UserPromptSubmit",matcherHint:""},{value:"stop",label:"Stop",matcherHint:""},{value:"preCompact",label:"PreCompact",matcherHint:""},{value:"postCompact",label:"PostCompact",matcherHint:""}],x0=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function T2(e){return e.replace(/\u00a0/g," ")}function i4(e){if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,t.textContent??""}function l4(e){return!!e.querySelector("[style], font")}function o4(e,t){if(!e)return[];const n=[],r=[...t].sort((o,c)=>c.placeholder.length-o.placeholder.length);let i=0,l=0;for(;i<e.length;){const o=r.find(h=>e.startsWith(h.placeholder,i));if(o){n.push({type:"attachment",key:`${o.clientId}-${i}`,attachment:o}),i+=o.placeholder.length;continue}let c=e.length;for(const h of r){const p=e.indexOf(h.placeholder,i);p!==-1&&p<c&&(c=p)}const f=e.slice(i,c);f&&(n.push({type:"text",key:`text-${l}`,text:f}),l+=1),i=c}return n}function v2(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function u4(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"m4 5 2 2-2 2"}),d.jsx("path",{d:"M7.75 9.5h4.25"})]})}function c4(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:d.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function d4(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),d.jsx("path",{d:"M4.25 5.25h2.25"}),d.jsx("path",{d:"M9.5 10.75h2.25"})]})}function f4(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function h4(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function m4(e){var t;return((t=eh.find(n=>n.value===e))==null?void 0:t.label)??e}function p4(e){var t;switch(e){case"cloudRequirements":return"Cloud";case"legacyManagedConfigFile":case"legacyManagedConfigMdm":return"Managed";case"sessionFlags":return"Session";default:return((t=e[0])==null?void 0:t.toUpperCase())+e.slice(1)}}function g4(e){switch(e){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function b4(e){switch(e){case"preToolUse":return"PreToolUse";case"permissionRequest":return"PermissionRequest";case"postToolUse":return"PostToolUse";case"preCompact":return"PreCompact";case"postCompact":return"PostCompact";case"sessionStart":return"SessionStart";case"userPromptSubmit":return"UserPromptSubmit";case"stop":return"Stop"}}function x4(e){return e.source==="user"?"global":e.source==="project"?"project":null}function k2(e){const t=x4(e);return!t||e.handlerType!=="command"||!e.command||e.isManaged?null:{scope:t,eventName:e.eventName,matcher:e.matcher,command:e.command,timeoutSec:e.timeoutSec,statusMessage:e.statusMessage}}function y4(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function E4(e){const t=e.trim();if(!t)return null;const n=Number(t);return!Number.isFinite(n)||n<=0?Number.NaN:Math.round(n*1e3)}function _4(e){if(!e)return"";const t=e/1e3;return Number.isInteger(t)?String(t):String(Number(t.toFixed(1)))}function kg(e){return e.replace(/\r\n/g,`
|
|
62
|
-
`)}function T4(e){const t=e.trim();return/^[A-Za-z0-9_-]+$/.test(t)?t:null}function v4(e){const n=kg(e).split(`
|
|
63
|
-
`).map(i=>i.trim()).filter(Boolean).find(i=>/^\[mcp_servers\.[^\]]+\]$/.test(i));if(!n)return null;const r=n.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\]$/);return(r==null?void 0:r[1])??null}function k4(e,t){return`[mcp_servers.${e}]
|
|
64
|
-
url = ${JSON.stringify(t.trim())}
|
|
65
|
-
`}function w2(e,t,n){var g,x;const r=kg(e),i=`${kg(n).trim()}
|
|
66
|
-
`,l=r.split(`
|
|
67
|
-
`),o=`[mcp_servers.${t}]`,c=`[mcp_servers.${t}.`;let f=-1,h=l.length;for(let E=0;E<l.length;E+=1)if((((g=l[E])==null?void 0:g.trim())??"")===o){f=E;break}if(f>=0){for(let S=f+1;S<l.length;S+=1){const N=((x=l[S])==null?void 0:x.trim())??"";if(N.startsWith("[")&&!(N===o||N.startsWith(c))){h=S;break}}const E=l.slice(0,f).join(`
|
|
68
|
-
`).trimEnd(),v=l.slice(h).join(`
|
|
69
|
-
`).trim();return[E,i.trimEnd(),v].filter(Boolean).join(`
|
|
70
|
-
|
|
71
|
-
`).replace(/\n{3,}/g,`
|
|
72
|
-
|
|
73
|
-
`).concat(`
|
|
74
|
-
`)}const p=r.trimEnd();return p?`${p}
|
|
75
|
-
|
|
76
|
-
${i}`:i}function sk(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function y0(e){const t=e/1e3;return Number.isInteger(t)?`${t}k`:`${Number(t.toFixed(1))}k`}function w4(e,t){if(!e)return"Select model";if((t==null?void 0:t.availability)!=="available"||typeof t.tokensInContextWindow!="number"||typeof t.modelContextWindow!="number")return`${e} · context unavailable`;const n=Math.max(t.tokensInContextWindow,0),r=Math.max(t.modelContextWindow,0),i=Math.max(r-n,0);return[e,`${y0(n)} used / ${y0(r)}`,`${y0(i)} left`,`${sk(t.remainingPercent)}% context left`].join(" · ")}function C4({contextUsage:e}){const t=(e==null?void 0:e.availability)??"unavailable",n=sk(e==null?void 0:e.remainingPercent);if(t!=="available")return null;const r=n<=20?"rgba(251,113,133,0.90)":n<=40?"rgba(252,211,77,0.85)":"rgba(125,211,252,0.80)";return d.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-track pointer-events-none mt-0.5 block",children:d.jsx("span",{className:"thread-context-progress-fill block",style:{width:`${n}%`,backgroundColor:r}})})}function C2(e,t){const n=e.name.trim();if(n)return n;const r=t==="photo"?e.type.includes("png")?".png":e.type.includes("heic")?".heic":e.type.includes("heif")?".heif":e.type.includes("webp")?".webp":".jpg":"";return`${t==="photo"?"photo":"file"}-${Date.now()}${r}`}function S2(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function E0(e){return e.type.startsWith("image/")?"photo":"file"}function wg(e,t){const n=[];if(e)for(const r of Array.from(e)){if(r.kind!=="file")continue;const i=r.getAsFile();i&&n.push(i)}return n.length>0?n:t?Array.from(t):[]}function N2(e,t){return wg(e,t).length>0}function Dl(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function S4(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function A2(e){const t=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return t!=null&&t[1]?t[1]:S4(e.originalName)}function N4(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function A4(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[d.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),d.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),d.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function _0(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5.5 3.25h5"}),d.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function jl({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return d.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:e})}function T0({activeView:e,edgeToEdgeMobile:t=!1,busy:n=!1,settingsBusy:r=!1,compactBusy:i=!1,error:l,model:o=null,reasoningEffort:c=null,fastMode:f=!1,collaborationMode:h="default",modelOptions:p=[],contextUsage:g=null,capabilities:x=null,toolboxItems:E=null,hookCommandTemplates:v=null,mcpConfigFormat:S="none",followTail:N=!1,threadConnected:w=!0,disabled:R=!1,disabledPlaceholder:C,shellControlState:O=null,draftPrompt:Y,draftAttachments:P,skillsState:B={status:"idle",data:null,error:null},mcpState:G={status:"idle",data:null,error:null},hooksState:le={status:"idle",data:null,error:null},goalState:Q={status:"idle",data:null,error:null},forkTurnOptionsState:ce={status:"idle",data:null,error:null},onDraftChange:W,onSubmit:fe,onInterrupt:ge,onCompact:re,onOpenSkills:F,onOpenMcp:$,onOpenHooks:J,onCreateHook:he,onUpdateHook:A,onTrustHook:H,onUntrustHook:te,onOpenGoal:D,onUpdateGoal:we,onOpenForkTurns:Re,onForkLatest:Ne,onForkTurn:Xe,onReadProviderConfig:Ze,onWriteProviderConfig:je,onToggleFollow:Dt,onUpdateSettings:Ue,onToggleView:jt,onShellCopy:an,onShellControl:rt,canInterrupt:pt=!1}){var gd,ho,Ei,bd,wu,Cu,Su,Nu,Au,Ps,xd,yd,Ed;const[at,yn]=T.useState({prompt:"",attachments:[]}),[Ye,Pe]=T.useState(null),[At,sn]=T.useState("root"),[cn,Un]=T.useState("list"),[_t,St]=T.useState("list"),[be,Se]=T.useState("project"),Me=T.useMemo(()=>({fast:(x==null?void 0:x.controls.performanceMode)??!1,compact:(x==null?void 0:x.turns.compact)??!1,goal:(x==null?void 0:x.controls.goals)??!1,fork:(x==null?void 0:x.branching.fork)??!1,skills:(x==null?void 0:x.management.skills)??!1,mcp:(x==null?void 0:x.management.mcpStatus)??!1,hooks:(x==null?void 0:x.management.hooks)??!1,hostConfigFiles:(x==null?void 0:x.management.hostConfigFiles)??!1,mcpConfigEditing:S==="codex-toml"&&!!(x!=null&&x.management.hostConfigFiles)&&!!Ze&&!!je,hookTrust:(x==null?void 0:x.management.hookTrust)??!1,planMode:(x==null?void 0:x.controls.planMode)??!1}),[x,S,Ze,je]),lt=T.useMemo(()=>(E??[]).filter(I=>{switch(I.action){case"fast":return Me.fast;case"compact":return Me.compact;case"goal":return Me.goal;case"fork":return Me.fork;case"skills":return Me.skills;case"mcp":return Me.mcp;case"hooks":return Me.hooks;default:return!1}}),[Me,E]),gt=T.useMemo(()=>{const I=new Map;for(const ae of v??[])I.set(ae.eventName,ae.command);return I},[v]),En=I=>gt.get(I)??gt.get("preToolUse")??x0,On=T.useMemo(()=>new Set([x0,...gt.values()]),[gt]),[Ee,Oe]=T.useState("preToolUse"),[Je,He]=T.useState("Bash"),[tt,X]=T.useState(x0),[ye,We]=T.useState("30"),[Ge,Fe]=T.useState("Running hook"),[ht,Lt]=T.useState(null),[st,Nt]=T.useState(!1),[_r,bt]=T.useState(null),[Nn,Hn]=T.useState(null),[Ga,Zn]=T.useState(""),[ll,Ns]=T.useState(""),[ba,os]=T.useState(""),[io,Jr]=T.useState(null),[kn,bn]=T.useState(!1),[xa,Fn]=T.useState(null),[lo,Tr]=T.useState(null),[qa,Mt]=T.useState(null),[Jn,Ir]=T.useState(!1),[er,ya]=T.useState(!1),[Ea,Wt]=T.useState(""),[ol,ul]=T.useState(!1),[$r,ur]=T.useState(null),[oo,As]=T.useState(null),uo=T.useRef(null),ea=T.useRef(null),us=T.useRef(null),cs=T.useRef(null),tr=T.useRef(null),zn=T.useRef([]),cr=T.useRef(null),Ya=T.useRef(new Map),Rs=T.useRef(""),di=T.useRef(0),Qt=e==="shell",cl=!!(Qt&&(O!=null&&O.isMobileShell)),Dn=(O==null?void 0:O.promptLabel)??null,[Or,An]=T.useState({}),[dl,vr]=T.useState(!1),[fi,hi]=T.useState(0),Vr=!Qt&&Y!==void 0&&P!==void 0&&typeof W=="function",tn=Vr?Y:at.prompt,_a=Vr?P:at.attachments,Ls=oo??h;T.useEffect(()=>{As(null)},[h]),T.useEffect(()=>{Ye!=="slash"&&(sn("root"),Un("list"),Fn(null),Tr(null),St("list"),bt(null),Hn(null))},[Ye]),T.useEffect(()=>{At!=="mcp"&&(Un("list"),Fn(null),Tr(null))},[At]),T.useEffect(()=>{At!=="forkTurns"&&Ir(!1)},[At]),T.useEffect(()=>{At!=="hooks"&&(St("list"),bt(null),Hn(null))},[At]),T.useEffect(()=>{const I=eh.find(ae=>ae.value===Ee);He(ae=>{const ve=ae.trim(),$e=new Set(eh.map(Ke=>Ke.matcherHint).filter(Boolean));return ve&&!$e.has(ve)?ae:(I==null?void 0:I.matcherHint)??""}),X(ae=>On.has(ae.trim())?En(Ee):ae)},[On,Ee,gt]),T.useEffect(()=>{if(!qa)return;const I=window.setTimeout(()=>{Mt(ae=>ae===qa?null:ae)},1400);return()=>{window.clearTimeout(I)}},[qa]);function ta(I){if(Vr){W==null||W(ae=>I({prompt:ae.prompt,attachments:ae.attachments}));return}yn(ae=>I(ae))}function fl(I){ta(ae=>{if(typeof I=="function"){const ve=I(ae.prompt,ae.attachments);return{prompt:ve.prompt,attachments:ve.attachments??ae.attachments}}return{prompt:I,attachments:ae.attachments}})}async function hl(I){try{await navigator.clipboard.writeText(`$${I}`),Mt(I)}catch{Mt(null)}}async function ds(){if(Ne){Ir(!0);try{await Ne(),Pe(null)}finally{Ir(!1)}}}async function kr(I){if(Xe){Ir(!0);try{await Xe(I),Pe(null)}finally{Ir(!1)}}}async function Is(){const I=tn.trim();if(!I){ur("Goal objective cannot be empty.");return}const ae=Ea.trim(),ve=E4(ae);if(ae.length>0&&(ve===null||!Number.isInteger(ve)||ve<=0)){ur("Token budget must be a positive number in thousands.");return}if(!we){ur("/goal is unavailable in this view.");return}ul(!0),ur(null);try{await we({objective:I,status:"active",tokenBudget:ve}),Wt(""),ya(!1),ta(()=>({prompt:"",attachments:[]}))}catch($e){ur($e instanceof Error?$e.message:"Unable to set goal.")}finally{ul(!1)}}function mi(){var I;Pe(null),sn("root"),ya(!0),Wt(_4((I=Q.data)==null?void 0:I.tokenBudget)),ur(null),D==null||D(),requestAnimationFrame(()=>{var ae;(ae=ea.current)==null||ae.focus()})}function Wa(){ya(!1),ur(null)}const Ta=T.useMemo(()=>p.find(I=>I.model===o)??null,[o,p]),ml=w4(o,g),Os=(Ta==null?void 0:Ta.supportedReasoningEfforts)??[],pl=T.useMemo(()=>o4(tn,_a),[_a,tn]),va=T.useMemo(()=>Object.entries(Or).sort(([I],[ae])=>I.localeCompare(ae)).map(([I,ae])=>`${I}:${ae}`).join("|"),[Or]);async function Dr(){if(!Me.hostConfigFiles||!Ze)throw new Error("Provider config editing is unavailable for this thread.");const I=await Ze();return Jr(I.path),I}async function pi(I){if(!Me.hostConfigFiles||!je)throw new Error("Provider config editing is unavailable for this thread.");const ae=await je(I);return Jr(ae.path),ae}function na(I){switch(I.action){case"fast":return f?"On":"Off";case"compact":return i?"Busy":"Run";case"goal":return er?"Composing":Q.data?y4(Q.data.status):"Open";case"fork":return n?"Idle only":"Open";case"skills":case"mcp":case"hooks":return"View";default:return""}}function jr(I){switch(I.action){case"fast":return r;case"compact":return i||n;case"fork":return n||Jn;default:return!1}}function gi(I){var ve;return`${I.action==="fast"&&f||I.action==="goal"&&(er||((ve=Q.data)==null?void 0:ve.status)==="active")?"ui-status-warning":"thread-composer-menu-item"} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`}function Qa(I,ae){switch(ae.stopPropagation(),I.action){case"fast":$n({fastMode:!f});break;case"compact":Pe(null),re==null||re();break;case"goal":er?(Wa(),Pe(null)):mi();break;case"fork":sn("fork");break;case"skills":sn("skills"),F==null||F();break;case"mcp":sn("mcp"),$==null||$();break;case"hooks":sn("hooks"),J==null||J();break}}function co(){Lt(null),Se("project"),Oe("preToolUse"),He("Bash"),X(En("preToolUse")),We("30"),Fe("Running hook")}function bi(I){const ae=k2(I);if(!ae){bt("Only command hooks in global or project hooks.json can be edited here.");return}Lt(ae),Se(ae.scope),Oe(ae.eventName),He(ae.matcher??""),X(ae.command),We(ae.timeoutSec?String(ae.timeoutSec):""),Fe(ae.statusMessage??""),bt(null),Hn(null),St("edit")}async function Ds(){const I=T4(Ga),ae=ll.trim();if(!I){Fn("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(ae)){Fn("HTTP MCP URL must start with http:// or https://");return}bn(!0),Fn(null),Tr(null);try{const ve=await Dr(),$e=w2(ve.content,I,k4(I,ae));await pi($e),Tr("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Un("list"),Zn(""),Ns(""),$==null||$()}catch(ve){Fn(ve instanceof Error?ve.message:"Unable to update provider config.")}finally{bn(!1)}}async function gl(){bn(!0),Fn(null),Tr(null);try{await Dr(),ba.trim()||os(`[mcp_servers.example_stdio]
|
|
77
|
-
command = "npx"
|
|
78
|
-
args = ["-y", "your-mcp-server"]
|
|
79
|
-
`),Un("stdio")}catch(I){Fn(I instanceof Error?I.message:"Unable to load provider config.")}finally{bn(!1)}}async function nr(){const I=v4(ba);if(!I){Fn("The raw MCP block must start with a header like [mcp_servers.name].");return}bn(!0),Fn(null),Tr(null);try{const ae=await Dr(),ve=w2(ae.content,I,ba);await pi(ve),Tr("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Un("list"),$==null||$()}catch(ae){Fn(ae instanceof Error?ae.message:"Unable to update provider config.")}finally{bn(!1)}}async function ka(){if(_t==="edit"&&!A){bt("Hook editing is unavailable in this view.");return}if(_t!=="edit"&&!he){bt("Hook editing is unavailable in this view.");return}if(_t==="edit"&&!ht){bt("Select a hook to edit first.");return}const I=tt.trim();if(!I){bt("Hook command cannot be empty.");return}const ae=ye.trim(),ve=ae?Number(ae):null;if(ae&&(ve===null||!Number.isInteger(ve)||ve<=0)){bt("Timeout must be a positive number of seconds.");return}Nt(!0),bt(null),Hn(null);try{const $e={scope:be,eventName:Ee,matcher:Je.trim()||null,command:I,timeoutSec:ve,statusMessage:Ge.trim()||null};_t==="edit"?await(A==null?void 0:A({...$e,target:ht})):await(he==null?void 0:he($e)),Hn(`${be==="project"?"Project":"Global"} hook ${_t==="edit"?"updated":"written"} in hooks.json and trusted.`),St("list"),Lt(null)}catch($e){bt($e instanceof Error?$e.message:"Unable to write hooks.json.")}finally{Nt(!1)}}async function xi(I){if(!H||!I.currentHash){bt("Hook trust is unavailable in this view.");return}Nt(!0),bt(null),Hn(null);try{await H({key:I.key,currentHash:I.currentHash}),Hn("Hook trusted.")}catch(ae){bt(ae instanceof Error?ae.message:"Unable to trust hook.")}finally{Nt(!1)}}async function fs(I){if(!te){bt("Hook trust is unavailable in this view.");return}Nt(!0),bt(null),Hn(null);try{await te({key:I.key}),Hn("Hook untrusted.")}catch(ae){bt(ae instanceof Error?ae.message:"Unable to untrust hook.")}finally{Nt(!1)}}T.useEffect(()=>{if(Qt){An({});return}const I={},ae=new Set;for(const ve of _a){if(ve.kind!=="photo")continue;ae.add(ve.clientId);let $e=Ya.current.get(ve.clientId);$e||($e=URL.createObjectURL(ve.file),Ya.current.set(ve.clientId,$e)),I[ve.clientId]=$e}for(const[ve,$e]of Ya.current.entries())ae.has(ve)||(URL.revokeObjectURL($e),Ya.current.delete(ve));An(I)},[_a,Qt]),T.useEffect(()=>()=>{for(const I of Ya.current.values())URL.revokeObjectURL(I);Ya.current.clear()},[]);function wa(){const I=ea.current,ae=window.getSelection();if(!I||!ae||ae.rangeCount===0)return null;const ve=ae.getRangeAt(0);return!I.contains(ve.startContainer)||!I.contains(ve.endContainer)?null:{start:js(I,ve.startContainer,ve.startOffset),end:js(I,ve.endContainer,ve.endOffset)}}function js(I,ae,ve){var Pt;let $e=null,Ke=ve;if(ae===I){const kt=Array.from(I.childNodes);let rn=0;for(let Gn=0;Gn<Math.min(ve,kt.length);Gn+=1){const Vt=kt[Gn];Vt&&(rn+=Dl(Vt).length)}return rn}if(ae.nodeType===Node.TEXT_NODE)$e=ae;else{const kt=Array.from(I.childNodes).find(rn=>rn.contains(ae));if(!kt)return K().length;if($e=kt,kt instanceof HTMLElement&&kt.dataset.segmentType==="attachment"){const rn=document.createRange();rn.selectNodeContents(kt);const Gn=Dl(kt).length;try{rn.setEnd(ae,ve);const Vt=rn.toString().length,Sa=((Pt=kt.textContent)==null?void 0:Pt.length)??0;Sa===0?Ke=Gn:Ke=Math.round(Math.min(1,Vt/Sa)*Gn)}catch{Ke=Gn}}else{const rn=document.createRange();rn.selectNodeContents(kt);try{rn.setEnd(ae,ve),Ke=rn.toString().length}catch{Ke=Dl(kt).length}}}const ut=Array.from(I.childNodes);let ft=0;for(const kt of ut){if(kt===$e)return kt.nodeType===Node.TEXT_NODE?ft+Ke:ft+Math.min(Ke,Dl(kt).length);ft+=Dl(kt).length}return ft}function yi(I,ae){let ve=Math.max(0,ae);const $e=Array.from(I.childNodes);for(const[Ke,ut]of $e.entries()){const Pt=Dl(ut).length;if(ut.nodeType===Node.TEXT_NODE){if(ve<=Pt)return{node:ut,offset:ve};ve-=Pt;continue}if(ut instanceof HTMLElement&&ut.dataset.segmentType==="attachment"){if(ve===0)return{node:I,offset:Ke};if(ve<=Pt){const kt=$e[Ke+1];return ve===Pt&&(kt==null?void 0:kt.nodeType)===Node.TEXT_NODE?{node:kt,offset:0}:{node:I,offset:Ke+1}}ve-=Pt;continue}if(ve<=Pt)return{node:I,offset:Ke+1};ve-=Pt}return{node:I,offset:I.childNodes.length}}function Xa(I){const ae=ea.current;if(!ae||!I)return;const ve=yi(ae,I.start),$e=yi(ae,I.end),Ke=document.createRange();Ke.setStart(ve.node,ve.offset),Ke.setEnd($e.node,$e.offset);const ut=window.getSelection();ut==null||ut.removeAllRanges(),ut==null||ut.addRange(Ke)}function z(I){const ae=zn.current;if(ae.length===0)return!1;const ve=ae.at(-1);if(!ve)return!1;const $e=Array.from(I.childNodes).find(Pt=>Pt instanceof HTMLElement&&Pt.dataset.segmentType==="attachment"&&Pt.dataset.clientId===ve);if(!($e instanceof HTMLElement))return!1;const Ke=document.createRange(),ut=$e.nextSibling;(ut==null?void 0:ut.nodeType)===Node.TEXT_NODE?Ke.setStart(ut,0):Ke.setStartAfter($e),Ke.collapse(!0);const ft=window.getSelection();return ft==null||ft.removeAllRanges(),ft==null||ft.addRange(Ke),!0}function K(){const I=ea.current;if(!I)return tn;let ae="";for(const ve of Array.from(I.childNodes))ae+=Dl(ve);return T2(ae)}function ue(I,ae,ve){const $e=I==="photo"?"PHOTO":"FILE";let Ke=0;for(;;){const ut=Ke===0?ae:`${ae} (${Ke+1})`,ft=`[${$e} ${ut}]`;if(!ve.has(ft))return ft;Ke+=1}}function Ie(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function De(I,ae,ve){const $e=ae.start>0?I[ae.start-1]:"",Ke=ae.end<I.length?I[ae.end]:"",ut=!!($e&&!/\s/.test($e)),ft=!Ke||!/\s/.test(Ke);return`${ut?" ":""}${ve.join(" ")}${ft?" ":""}`}function ot(I,ae){if(!I||I.length===0)return;const ve=Array.from(I),$e=new Set(_a.map(Vt=>Vt.placeholder)),Ke=ve.map(Vt=>{const Sa=C2(Vt,ae),bl=ue(ae,S2(Sa),$e);return $e.add(bl),{clientId:Ie(),kind:ae,originalName:Sa,placeholder:bl,file:Vt}}),ut=wa()??cr.current,ft=ut?{start:ut.start,end:ut.end}:{start:tn.length,end:tn.length},Pt=De(tn,ft,Ke.map(Vt=>Vt.placeholder)),kt=`${tn.slice(0,ft.start)}${Pt}${tn.slice(ft.end)}`;ta(Vt=>({prompt:kt,attachments:[...Vt.attachments,...Ke]}));const rn=Pt.endsWith(" ")?1:0,Gn=ft.start+Pt.length-rn;tr.current={start:Gn,end:Gn},cr.current={start:Gn,end:Gn},zn.current=Ke.map(Vt=>Vt.clientId),Pe(null)}function Be(I){if(I.length===0)return;const ae={photo:I.filter(Vt=>E0(Vt)==="photo"),file:I.filter(Vt=>E0(Vt)==="file")},ve=[...ae.photo,...ae.file],$e=new Set(_a.map(Vt=>Vt.placeholder)),Ke=ve.map(Vt=>{const Sa=E0(Vt),bl=C2(Vt,Sa),_d=ue(Sa,S2(bl),$e);return $e.add(_d),{clientId:Ie(),kind:Sa,originalName:bl,placeholder:_d,file:Vt}}),ut=wa()??cr.current,ft=ut?{start:ut.start,end:ut.end}:{start:tn.length,end:tn.length},Pt=De(tn,ft,Ke.map(Vt=>Vt.placeholder)),kt=`${tn.slice(0,ft.start)}${Pt}${tn.slice(ft.end)}`;ta(Vt=>({prompt:kt,attachments:[...Vt.attachments,...Ke]}));const rn=Pt.endsWith(" ")?1:0,Gn=ft.start+Pt.length-rn;tr.current={start:Gn,end:Gn},cr.current={start:Gn,end:Gn},zn.current=Ke.map(Vt=>Vt.clientId),Pe(null)}function _n(I){if(!I)return;const ae=wa()??cr.current,ve=(ae==null?void 0:ae.start)??tn.length,$e=(ae==null?void 0:ae.end)??ve,Ke=T2(I),ut=`${tn.slice(0,ve)}${Ke}${tn.slice($e)}`;ta(Pt=>({prompt:ut,attachments:Pt.attachments}));const ft=ve+Ke.length;tr.current={start:ft,end:ft},cr.current={start:ft,end:ft}}T.useEffect(()=>{function I(ae){(typeof ae.composedPath=="function"?ae.composedPath():[]).some(Ke=>Ke instanceof HTMLElement&&(Ke.dataset.composerMenuSurface==="true"||Ke.dataset.composerMenuTrigger==="true"))||Ye&&Pe(null)}if(Ye)return window.addEventListener("pointerdown",I),()=>{window.removeEventListener("pointerdown",I)}},[Ye]),T.useLayoutEffect(()=>{const I=ea.current;if(!I||Qt)return;const ae=tr.current,ve=K()!==tn||Rs.current!==va||di.current!==fi;if(ve){const $e=document.createDocumentFragment();for(const Ke of pl){if(Ke.type==="text"){$e.append(document.createTextNode(Ke.text===" "?" ":Ke.text));continue}const ut=Ke.attachment,ft=document.createElement("span");if(ft.dataset.segmentType="attachment",ft.dataset.clientId=ut.clientId,ft.dataset.placeholder=ut.placeholder,ft.contentEditable="false",ft.className="mx-[0.12rem] inline-flex max-w-full align-baseline",ut.kind==="photo"){ft.classList.add("rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const Pt=Or[ut.clientId];if(Pt){const rn=document.createElement("img");rn.src=Pt,rn.alt=ut.originalName||"Pasted image",rn.className="h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",rn.draggable=!1,ft.append(rn)}else{const rn=document.createElement("span");rn.className="inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",rn.setAttribute("aria-hidden","true"),ft.append(rn)}const kt=document.createElement("span");kt.className="ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",kt.textContent=A2(ut),ft.append(kt)}else{ft.classList.add("items-center","gap-2","rounded-[0.95rem]","border","border-emerald-300/35","bg-emerald-300/10","px-2.5","py-2","text-[10px]","font-medium","tracking-[0.08em]","text-emerald-50","shadow-sm","shadow-stone-950/20");const Pt=document.createElement("span");Pt.className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/25 bg-emerald-300/12 text-[9px]",Pt.textContent="FILE";const kt=document.createElement("span");kt.className="inline-flex max-w-[10rem] truncate",kt.textContent=A2(ut),ft.append(Pt,kt)}$e.append(ft)}I.replaceChildren($e),Rs.current=va,di.current=fi}ae!==null?(I.focus(),z(I)||Xa(ae),cr.current=ae):document.activeElement===I&&ve&&Xa(cr.current),tr.current=null,zn.current=[]},[Or,fi,Qt,va,tn,pl]);function vt(){var I;(I=ea.current)==null||I.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function wr(){var I;if(vt(),Pe(null),!!((I=navigator.clipboard)!=null&&I.readText))try{const ae=await navigator.clipboard.readText();_n(ae)}catch{return}}async function Ca(){if(er&&!Qt){await Is();return}if(!Qt&&!tn.trim())return;const I=Qt?tn:tn.trim(),ae=Qt?[]:_a.filter(ve=>I.includes(ve.placeholder));await fe(ae.length>0?{prompt:I,attachments:ae}:{prompt:I}),ta(()=>({prompt:"",attachments:[]}))}async function Jt(I){I.preventDefault(),await Ca()}function Xt(){const I=K(),ae=wa();cr.current=ae;const ve=ea.current;(ve?l4(ve):!1)&&(tr.current=ae,hi(Ke=>Ke+1)),ta(Ke=>({prompt:I,attachments:Ke.attachments.filter(ut=>I.includes(ut.placeholder))}))}function Ce(I){var ve,$e,Ke,ut;const ae=wg((ve=I.clipboardData)==null?void 0:ve.items,($e=I.clipboardData)==null?void 0:$e.files);if(ae.length===0){const ft=((Ke=I.clipboardData)==null?void 0:Ke.getData("text/plain"))??"",Pt=((ut=I.clipboardData)==null?void 0:ut.getData("text/html"))??"",kt=ft||i4(Pt);if(!kt&&!Pt)return;I.preventDefault(),_n(kt);return}I.preventDefault(),Be(ae)}function et(I){var ae,ve;N2((ae=I.dataTransfer)==null?void 0:ae.items,(ve=I.dataTransfer)==null?void 0:ve.files)&&(I.preventDefault(),vr(!0))}function mt(I){var ae,ve;N2((ae=I.dataTransfer)==null?void 0:ae.items,(ve=I.dataTransfer)==null?void 0:ve.files)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),vr(!0))}function ln(I){I.currentTarget.contains(I.relatedTarget)||vr(!1)}function xt(I){var ve,$e;const ae=wg((ve=I.dataTransfer)==null?void 0:ve.items,($e=I.dataTransfer)==null?void 0:$e.files);ae.length!==0&&(I.preventDefault(),vr(!1),Be(ae))}function nn(I){I.key==="Enter"&&(!I.metaKey&&!I.ctrlKey||(I.preventDefault(),!(n||R)&&Ca()))}async function $n(I){const ae=oo;I.collaborationMode&&As(I.collaborationMode);try{await(Ue==null?void 0:Ue(I)),Pe(null)}catch(ve){throw I.collaborationMode&&As(ae),ve}}const Vn=er?"Describe the goal the backend should continue working toward...":C??(Qt?"Send shell input to the attached terminal...":"Ask the backend to inspect, modify, or explain code..."),Ms=Qt?"Send Ctrl-C":"Stop Current Turn",fo=er?ol?"Setting...":"Set goal":!w&&n?"Connecting...":w&&n&&!Qt?"Sending...":"Send",fm=w?er?"ui-action-info":"ui-action-primary":"ui-action-danger",hd=r,md=hd||Os.length===0,hm=f?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":Os.length===0?"The selected model does not expose adjustable reasoning effort.":"Select reasoning effort",mm=t||cl?"relative z-20 shrink-0 bg-transparent px-3 pb-0 pt-3 sm:p-4":"relative z-20 shrink-0 bg-transparent px-3 pb-3 pt-0 sm:px-4 sm:pb-4 sm:pt-0",pd=`thread-composer-input min-h-[7.25rem] w-full rounded-[1.25rem] border px-4 pr-14 pt-2.5 outline-none transition sm:min-h-[6.25rem] ${dl?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":"border-stone-700 focus-within:border-[var(--theme-accent-border)]"}`;return d.jsxs("div",{className:"relative z-20 shrink-0",children:[d.jsx("input",{ref:us,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{ot(I.target.files,"photo"),I.target.value=""}}),d.jsx("input",{ref:cs,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{ot(I.target.files,"file"),I.target.value=""}}),e==="chat"&&d.jsx("button",{type:"button","aria-label":"Jump to latest",title:N?"Latest turn is in view":"Jump to the latest messages",onClick:()=>Dt==null?void 0:Dt(),className:"absolute left-1/2 top-3 z-40 inline-flex h-9 min-w-[5.75rem] -translate-x-1/2 -translate-y-[62%] items-start justify-center bg-transparent pt-1 touch-manipulation sm:top-4",children:d.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${N?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m4 6 4 4 4-4"})})})}),d.jsxs("form",{ref:uo,onSubmit:Jt,className:mm,children:[d.jsxs("div",{className:"thread-composer-toolbar relative z-30 mb-0 flex items-center gap-2 rounded-full border px-2.5 py-1.5 text-xs shadow-lg shadow-stone-950/8",children:[d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!Qt&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>Pe(I=>I==="slash"?null:"slash"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:d.jsx(d4,{})}),Ye==="slash"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl",onClick:I=>{I.stopPropagation()},onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:At==="root"?d.jsxs("div",{className:"p-2",children:[lt.map((I,ae)=>d.jsx("button",{type:"button",disabled:jr(I),onClick:ve=>Qa(I,ve),className:`${gi(I)} ${ae===0?"mt-0":""}`,title:I.description??I.label,children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{children:I.command}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:na(I)})]})},`${I.action}:${I.command}`)),lt.length===0?d.jsx("p",{className:"px-3 py-2 text-sm text-stone-400",children:"No backend tools are available for this thread."}):null]}):d.jsx("div",{className:"max-h-80 overflow-auto",children:At==="fork"?d.jsxs("div",{className:"p-2",children:[d.jsx("button",{type:"button",disabled:n||Jn,onClick:()=>void ds(),className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{children:"Fork from latest"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Jn?"Forking":"Run"})]})}),d.jsx("button",{type:"button",disabled:n||Jn,onClick:I=>{I.stopPropagation(),sn("forkTurns"),Re==null||Re()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{children:"Fork from selected turn"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?d.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]}):At==="forkTurns"?d.jsxs("div",{className:"p-2",children:[ce.status==="loading"&&!ce.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns…"}):null,ce.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:ce.error}):null,(gd=ce.data)!=null&&gd.length?d.jsx("div",{className:"space-y-2",children:ce.data.map(I=>d.jsx("button",{type:"button",disabled:Jn,onClick:()=>void kr(I.turnId),className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",I.turnIndex]}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:Jn?"Forking":I.status})]})},I.turnId))}):null,ce.status!=="loading"&&!ce.error&&(((ho=ce.data)==null?void 0:ho.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]}):At==="skills"?d.jsxs("div",{className:"p-2",children:[B.status==="loading"&&!B.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills…"}):null,B.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:B.error}):null,(Ei=B.data)!=null&&Ei.skills.length?d.jsx("div",{className:"space-y-2",children:B.data.skills.map(I=>{var ae,ve;return d.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((ae=I.interface)==null?void 0:ae.displayName)??I.name}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:h4(I.scope)}),d.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${qa===I.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":"thread-composer-chip-button border-stone-700 text-stone-300 hover:border-stone-500"}`,onClick:()=>void hl(I.name),title:`Copy $${I.name}`,"aria-label":`Copy $${I.name}`,children:[d.jsx(_0,{}),"$",I.name]})]}),d.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((ve=I.interface)==null?void 0:ve.shortDescription)??I.shortDescription??I.description})]})},I.path)})}):null,(bd=B.data)!=null&&bd.errors.length?d.jsx("div",{className:"mt-2 space-y-2",children:B.data.errors.map(I=>d.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[d.jsx("p",{className:"font-medium",children:I.message}),d.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,B.status!=="loading"&&!B.error&&(((wu=B.data)==null?void 0:wu.skills.length)??0)===0&&(((Cu=B.data)==null?void 0:Cu.errors.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]}):At==="hooks"?d.jsxs("div",{className:"p-2",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),d.jsx("p",{className:"truncate text-[11px] text-stone-500",children:((Su=le.data)==null?void 0:Su.projectHooksPath)??"<workspace hooks config>"})]}),_t==="list"&&Me.hostConfigFiles?d.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),co(),St("add"),bt(null),Hn(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add Hook"}):null]}),le.status==="loading"&&!le.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading hooks…"}):null,le.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:le.error}):null,_r?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:_r}):null,Nn?d.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:Nn}):null,_t==="add"||_t==="edit"?d.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[_t==="edit"?d.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing ",b4((ht==null?void 0:ht.eventName)??Ee)," in"," ",(ht==null?void 0:ht.scope)==="global"?"global":"project"," hooks.json"]}):null,d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",d.jsxs("select",{"aria-label":"Hook scope",value:be,onChange:I=>Se(I.target.value),disabled:_t==="edit",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:[d.jsx("option",{value:"project",children:"Project"}),d.jsx("option",{value:"global",children:"Global"})]})]}),d.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",d.jsx("select",{"aria-label":"Hook event",value:Ee,onChange:I=>Oe(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:eh.map(I=>d.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),d.jsx("input",{"aria-label":"Hook matcher",value:Je,onChange:I=>He(I.target.value),placeholder:"Bash",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),d.jsx("textarea",{"aria-label":"Hook command",value:tt,onChange:I=>X(I.target.value),rows:3,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 font-mono text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",d.jsx("input",{"aria-label":"Hook timeout seconds",value:ye,onChange:I=>We(I.target.value),inputMode:"numeric",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]}),d.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",d.jsx("input",{"aria-label":"Hook status message",value:Ge,onChange:I=>Fe(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:()=>{St("list"),Lt(null)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),d.jsx("button",{type:"button",onClick:()=>void ka(),disabled:st,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:st?"Saving…":_t==="edit"?"Update Hook":"Write Hook"})]})]}):null,_t==="list"&&((Nu=le.data)!=null&&Nu.warnings.length)?d.jsx("div",{className:"mb-2 space-y-2",children:le.data.warnings.map(I=>d.jsx("p",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:I},I))}):null,_t==="list"&&((Au=le.data)!=null&&Au.errors.length)?d.jsx("div",{className:"mb-2 space-y-2",children:le.data.errors.map(I=>d.jsxs("div",{className:"rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-2 text-xs text-rose-100/90",children:[d.jsx("p",{className:"font-medium",children:I.message}),d.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,_t==="list"&&((Ps=le.data)!=null&&Ps.hooks.length)?d.jsx("div",{className:"space-y-2",children:le.data.hooks.map(I=>d.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[m4(I.eventName),I.matcher?` · ${I.matcher}`:""]}),d.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:I.command??I.handlerType}),I.statusMessage?d.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:I.statusMessage}):null]}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[k2(I)?d.jsx("button",{type:"button",onClick:ae=>{ae.stopPropagation(),bi(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-sky-100 transition hover:border-sky-300/35 hover:bg-sky-300/10",children:"Edit"}):null,Me.hookTrust&&I.trustStatus==="trusted"&&!I.isManaged?d.jsx("button",{type:"button",disabled:st,onClick:ae=>{ae.stopPropagation(),fs(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-amber-100 transition hover:border-amber-300/35 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Untrust"}):null,(I.trustStatus==="untrusted"||I.trustStatus==="modified")&&!I.isManaged&&Me.hookTrust?d.jsx("button",{type:"button",disabled:st||!I.currentHash,onClick:ae=>{ae.stopPropagation(),xi(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-emerald-100 transition hover:border-emerald-300/35 hover:bg-emerald-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Trust"}):null,d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:g4(I.trustStatus)})]}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:p4(I.source)}),d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:I.enabled?"Enabled":"Disabled"}),d.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[I.timeoutSec,"s"]})]})]},I.key))}):null,_t==="list"&&le.status!=="loading"&&!le.error&&(((xd=le.data)==null?void 0:xd.hooks.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No hooks configured for this workspace."}):null]}):d.jsxs("div",{className:"p-2",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),d.jsx("p",{className:"truncate text-[11px] text-stone-500",children:io??"<provider config>"})]}),cn==="list"&&Me.mcpConfigEditing?d.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Un("add"),Fn(null),Tr(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add MCP"}):null]}),G.status==="loading"&&!G.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers…"}):null,G.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:G.error}):null,xa?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:xa}):null,lo?d.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:lo}):null,cn==="add"?d.jsxs("div",{className:"space-y-2",children:[d.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Un("http"),Fn(null),Tr(null)},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),d.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into provider config."})]}),d.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),gl()},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),d.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into provider config."})]})]}):null,cn==="http"?d.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),d.jsx("input",{"aria-label":"MCP name",value:Ga,onChange:I=>Zn(I.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),d.jsx("input",{"aria-label":"URL",value:ll,onChange:I=>Ns(I.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:()=>Un("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),d.jsx("button",{type:"button",onClick:()=>void Ds(),disabled:kn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:kn?"Saving…":"Write HTTP MCP"})]})]}):null,cn==="stdio"?d.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[d.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for provider config"}),d.jsx("textarea",{"aria-label":"MCP block for provider config",value:ba,onChange:I=>os(I.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),d.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:()=>Un("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),d.jsx("button",{type:"button",onClick:()=>void nr(),disabled:kn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:kn?"Saving…":"Write raw block"})]})]}):null,cn==="list"&&((yd=G.data)!=null&&yd.servers.length)?d.jsx("div",{className:"space-y-2",children:G.data.servers.map(I=>d.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:I.name}),d.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[I.tools.length," tools · ",I.resourceCount," ","resources · ",I.resourceTemplateCount," templates"]})]}),d.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:f4(I.authStatus)})]}),I.tools.length>0?d.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:I.tools.slice(0,4).map(ae=>ae.title??ae.name).join(" · ")}):null]},I.name))}):null,cn==="list"&&G.status!=="loading"&&!G.error&&(((Ed=G.data)==null?void 0:Ed.servers.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})})})]}),!Qt&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>Pe(I=>I==="attachments"?null:"attachments"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:d.jsx(c4,{})}),Ye==="attachments"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute left-0 top-full mt-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20",children:d.jsxs("div",{className:"p-2",children:[d.jsx("button",{type:"button",onClick:()=>{var I;vt(),(I=us.current)==null||I.click()},className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"Photo"}),d.jsx("button",{type:"button",onClick:()=>{var I;vt(),(I=cs.current)==null||I.click()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"File"})]})})]}),d.jsx("button",{type:"button","aria-label":Qt?"Switch to chat":"Switch to shell",title:Qt?"Switch to chat":"Switch to shell",onClick:()=>jt==null?void 0:jt(),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:Qt?d.jsx(N4,{}):d.jsx(u4,{})})]}),d.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[Qt&&Dn&&d.jsx("span",{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:Dn,children:Dn}),cl&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":Ye==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":Ye==="shellTools",title:Ye==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{vt(),Pe(I=>I==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:d.jsx(A4,{})}),Ye==="shellTools"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("button",{type:"button",onClick:()=>void wr(),className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(_0,{}),d.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),d.jsx("button",{type:"button",onClick:()=>{vt(),Pe(null),an==null||an()},className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(_0,{}),d.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),d.jsx("button",{type:"button",disabled:n,onClick:()=>{vt(),Pe(null),fe({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"CLEAR",tone:"sky"})}),d.jsx("button",{type:"button",disabled:!(O!=null&&O.shellInputEnabled)||!(O!=null&&O.isCommandRunning),onClick:()=>{vt(),Pe(null),rt==null||rt("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"CTRL-C",tone:"rose"})}),d.jsx("button",{type:"button",disabled:!(O!=null&&O.shellInputEnabled),onClick:()=>{vt(),Pe(null),rt==null||rt("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"CTRL-D"})}),d.jsx("button",{type:"button",disabled:!(O!=null&&O.shellInputEnabled),onClick:()=>{vt(),Pe(null),rt==null||rt("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"ESC"})}),d.jsx("button",{type:"button",disabled:!(O!=null&&O.shellInputEnabled),onClick:()=>{vt(),Pe(null),rt==null||rt("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"TAB"})}),d.jsx("button",{type:"button",disabled:!(O!=null&&O.shellInputEnabled),onClick:()=>{vt(),Pe(null),rt==null||rt("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"UP"})}),d.jsx("button",{type:"button",disabled:!(O!=null&&O.shellInputEnabled),onClick:()=>{vt(),Pe(null),rt==null||rt("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(jl,{label:"DOWN"})})]})})]})]})]}),er&&!Qt&&d.jsxs("div",{className:"relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border border-sky-300/25 bg-sky-300/[0.07] px-3 py-2 text-xs text-sky-50 shadow-sm shadow-stone-950/10",children:[d.jsx("span",{className:"font-medium uppercase tracking-[0.16em] text-sky-100/90",children:"Goal"}),d.jsxs("label",{className:"flex items-center gap-2 text-stone-300",children:[d.jsx("span",{children:"Max tokens (k)"}),d.jsx("input",{"aria-label":"Goal token budget",value:Ea,onChange:I=>Wt(I.target.value),inputMode:"numeric",placeholder:"Optional",className:"h-7 w-24 rounded-full border border-sky-300/25 bg-stone-950/60 px-3 text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/70"})]}),$r?d.jsx("span",{className:"min-w-0 flex-1 text-rose-200",children:$r}):null,d.jsx("button",{type:"button",onClick:Wa,className:"rounded-full border border-stone-700/80 px-2.5 py-1 text-[11px] text-stone-300 transition hover:bg-stone-800",children:"Cancel"})]}),d.jsxs("div",{className:"relative",children:[Qt?d.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:tn,onChange:I=>fl(I.target.value),onKeyDown:nn,rows:2,placeholder:Vn,className:`${pd} resize-y pb-10`}):d.jsxs("div",{className:pd,children:[tn.length===0&&d.jsx("span",{className:"pointer-events-none absolute left-4 top-2.5 text-stone-500",children:Vn}),d.jsx("div",{ref:ea,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!R,suppressContentEditableWarning:!0,onInput:()=>Xt(),onPaste:Ce,onKeyDown:nn,onKeyUp:()=>{cr.current=wa()},onMouseUp:()=>{cr.current=wa()},onBlur:()=>{cr.current=wa(),vr(!1)},onDragEnter:et,onDragOver:mt,onDragLeave:ln,onDrop:xt,className:`relative z-[1] min-h-[5.75rem] whitespace-pre-wrap break-words pb-10 outline-none sm:min-h-[4.875rem] ${R?"cursor-not-allowed text-stone-500":""}`})]}),d.jsx("button",{type:"button","aria-label":Ms,title:Ms,onClick:()=>void(ge==null?void 0:ge()),disabled:!pt,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${pt?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:d.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),d.jsx("button",{type:"submit","aria-label":er&&!Qt?"Set goal":Qt?"Send Shell Input":"Send Prompt",onMouseDown:I=>{I.preventDefault()},onPointerDown:I=>{I.preventDefault()},onTouchStart:I=>{I.preventDefault()},disabled:ol||n||(e==="chat"?R:!1),className:`absolute bottom-2.5 right-2.5 rounded-full px-3.5 py-1.5 text-sm font-medium shadow-lg shadow-stone-950/30 transition disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300 ${fm}`,children:fo}),!Qt&&d.jsxs("div",{className:"absolute bottom-2.5 left-3 z-30 flex max-w-[calc(100%-7rem)] items-center gap-1.5 text-xs",children:[d.jsxs("div",{className:"relative min-w-0",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":Ye==="model","aria-label":o??"Select model",disabled:hd||p.length===0,onClick:()=>Pe(I=>I==="model"?null:"model"),title:f?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${ml}`:ml,className:"thread-composer-inline-toggle relative inline-flex min-w-0 max-w-[8.75rem] items-center overflow-hidden rounded-full px-2.5 py-1 text-left text-stone-300 transition disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]",children:d.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:o??"Select model"})}),o?d.jsx(C4,{contextUsage:g}):null,Ye==="model"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:d.jsx("div",{className:"max-h-72 overflow-auto p-2",children:p.map(I=>d.jsx("button",{type:"button",onClick:()=>void $n({model:I.model,reasoningEffort:I.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.model===o?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:d.jsx("p",{className:"text-sm font-medium",children:I.model})},I.id))})})]}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":Ye==="effort",disabled:md,onClick:()=>Pe(I=>I==="effort"?null:"effort"),title:hm,className:`thread-composer-inline-toggle rounded-full px-2 py-1 transition disabled:cursor-not-allowed disabled:text-stone-700 ${md?"text-stone-500":"text-stone-300 hover:text-stone-100"}`,children:v2(c)}),Ye==="effort"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:d.jsx("div",{className:"max-h-72 overflow-auto p-2",children:Os.map(I=>d.jsx("button",{type:"button",onClick:()=>void $n({reasoningEffort:I.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.reasoningEffort===c?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:d.jsx("p",{className:"text-sm font-medium",children:v2(I.reasoningEffort)})},I.reasoningEffort))})})]}),Me.planMode&&d.jsx("button",{type:"button","aria-pressed":Ls==="plan",disabled:r,onClick:()=>void $n({collaborationMode:Ls==="plan"?"default":"plan"}),className:`thread-composer-inline-toggle rounded-full px-2.5 py-1 transition ${Ls==="plan"?"thread-composer-plan-toggle-active":"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"})]})]}),l&&d.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l})]})]})}const R4="modulepreload",L4=function(e){return"/"+e},R2={},j=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=o(n.map(h=>{if(h=L4(h),h in R2)return;R2[h]=!0;const p=h.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":R4,p||(x.as="script"),x.crossOrigin="",x.href=h,f&&x.setAttribute("nonce",f),document.head.appendChild(x),p)return new Promise((E,v)=>{x.addEventListener("load",E),x.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};function L2(e){return{background:e==="light"?"#f2ede5":"#0c1117",foreground:e==="light"?"#3f3a36":"#d6dde6",cursor:e==="light"?"#3f3a36":"#d6dde6",black:e==="light"?"#d8cfc2":"#0f1720",brightBlack:e==="light"?"#8a7f73":"#475569",red:"#f87171",brightRed:"#fb7185",green:e==="light"?"#16a34a":"#86efac",brightGreen:e==="light"?"#22c55e":"#4ade80",yellow:"#fbbf24",brightYellow:"#fcd34d",blue:e==="light"?"#2563eb":"#93c5fd",brightBlue:e==="light"?"#3b82f6":"#60a5fa",magenta:e==="light"?"#7c3aed":"#c4b5fd",brightMagenta:e==="light"?"#8b5cf6":"#a78bfa",cyan:e==="light"?"#0891b2":"#67e8f9",brightCyan:e==="light"?"#06b6d4":"#22d3ee",white:e==="light"?"#5b5148":"#e2e8f0",brightWhite:e==="light"?"#2c2723":"#f8fafc"}}function I4(e){switch(e){case"not_created":return"Not created";case"creating":return"Creating";case"running":return"Running";case"attached":return"Attached";case"detached":return"Detached";case"exited":return"Exited";case"not_found":return"Missing";case"workspace_missing":return"Workspace missing"}}function I2(e,t,n,r,i){const l=t.replace(/\r\n/g,`
|
|
80
|
-
`).replace(/\r/g,`
|
|
81
|
-
`),o=l.split(`
|
|
82
|
-
`);l.endsWith(`
|
|
83
|
-
`)&&o.at(-1)===""&&o.pop();let f=o.join(`\r
|
|
84
|
-
`);if(n!==void 0&&r!==void 0){const p=(i!==void 0?Math.max(0,o.length-i):0)+r,g=Math.max(0,o.length-p-1);g>0&&(f+=`\x1B[${g}A`),f+=`\r\x1B[${n+1}G`}e.reset(),e.write(f,()=>{e.scrollToBottom()})}function O4(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function v0(e){return e?Array.from(e.querySelectorAll(".xterm-rows > div")).map(n=>n.textContent??"").filter((n,r,i)=>n.length>0||r<i.length-1).join(`
|
|
85
|
-
`).trimEnd():""}function ik(e){return e.replace(/\r\n/g,`
|
|
86
|
-
`).replace(/\r/g,`
|
|
87
|
-
`)}function O2(e){const t=ik(e),n=t.split(`
|
|
88
|
-
`);return t.endsWith(`
|
|
89
|
-
`)&&n.at(-1)===""&&n.pop(),n}function D4(e){const t=e.trim();return t?/(?:[$%#>])\s*$/.test(t):!1}function j4(e,t){const n=t.trim();if(!n||e.length===0)return e;const[r,...i]=e;if(r===void 0)return e;const l=r.trim();return l===n||l.endsWith(` ${n}`)||l.endsWith(`$ ${n}`)||l.endsWith(`% ${n}`)||l.endsWith(`# ${n}`)||l.endsWith(`> ${n}`)?i:e}function M4(e,t,n){var f,h;const r=O2(e),i=O2(t);let l=0;for(;l<r.length&&l<i.length&&r[l]===i[l];)l+=1;let o=0;for(;o<r.length-l&&o<i.length-l&&r[r.length-1-o]===i[i.length-1-o];)o+=1;let c=i.slice(l,i.length-o);for(c=j4(c,n);c.length>0&&((f=c[0])==null?void 0:f.trim())==="";)c.shift();for(;c.length>0&&(((h=c.at(-1))==null?void 0:h.trim())===""||D4(c.at(-1)??""));)c.pop();return c.join(`
|
|
90
|
-
`).trimEnd()}function k0(e){if(!e)return"";const t=e.replace(/[\\/]+$/,"");return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function w0(e,t){const n=[t==null?void 0:t.trim(),e==null?void 0:e.trim()].filter(Boolean);return n.length>0?n.join(" "):null}function P4(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[d.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),d.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),d.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function B4({connected:e}){return e?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function D2(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5.5 3.25h5"}),d.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Ml({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return d.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:e})}function U4(e){switch(e){case"ctrl_c":return"";case"ctrl_d":return"";case"esc":return"\x1B";case"tab":return" ";case"up":return"\x1B[A";case"down":return"\x1B[B"}}const H4=T.forwardRef(function({threadId:t,isVisible:n=!0,showHeader:r=!0,showFloatingToolbox:i=!0,onStateChange:l},o){var En,On;const c=eo(),f=T.useRef(null),h=T.useRef(null),p=T.useRef(null),g=T.useRef(null),x=T.useRef(null),E=T.useRef(null),v=T.useRef(0),S=T.useRef(""),N=T.useRef(null),w=T.useRef(""),R=T.useRef(null),C=T.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),O=T.useRef(!1),Y=T.useRef(null),[P,B]=T.useState(null),[G,le]=T.useState(null),[Q,ce]=T.useState(!0),[W,fe]=T.useState(!1),[ge,re]=T.useState(null),[F,$]=T.useState(0),[J,he]=T.useState(!1),[A,H]=T.useState(!1),[te,D]=T.useState(!1),[we,Re]=T.useState(null),[Ne,Xe]=T.useState(!1),[Ze,je]=T.useState(null),Dt=(c==null?void 0:c.effectiveTheme)??"dark",Ue=T.useCallback((Ee,Oe)=>{je({tone:Ee,text:Oe}),Y.current!==null&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{je(null),Y.current=null},1800)},[]),jt=T.useCallback(Ee=>{var tt;const Oe=p.current,Je=x.current,He=g.current;return!Oe||!Je||!He?!1:(Oe.send({type:"shell.input",shellId:Je,viewerId:He,data:Ee}),A||(tt=f.current)==null||tt.focus(),!0)},[A]),an=T.useCallback(()=>{var He;const Ee=p.current,Oe=x.current,Je=g.current;return!Ee||!Oe||!Je?!1:(Ee.send({type:"shell.clear",shellId:Oe,viewerId:Je}),A||(He=f.current)==null||He.focus(),!0)},[A]),rt=T.useCallback(Ee=>{const Oe=f.current,Je=h.current;!Oe||!Je||(Je.fit(),S.current&&!v0(P)?I2(Oe,S.current,C.current.cursorX,C.current.cursorY,C.current.paneHeight):Oe.scrollToBottom(),Ee!=null&&Ee.focus&&!A&&Oe.focus())},[A,P]),pt=(G==null?void 0:G.state)??"not_created",at=T.useMemo(()=>(G==null?void 0:G.shell)??null,[G==null?void 0:G.shell]),yn=!!(g.current&&at),Ye=T.useMemo(()=>w0(k0(at==null?void 0:at.cwd),null),[at==null?void 0:at.cwd]),Pe=we??Ye,At=W||Q||pt==="creating"||pt==="workspace_missing",sn=pt==="attached"?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":pt==="exited"||pt==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":pt==="workspace_missing"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800",cn=pt==="attached"?"Disconnect shell":pt==="exited"||pt==="not_found"?"Restart shell":at?"Connect shell":"Create shell",Un=(Ze==null?void 0:Ze.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(Ze==null?void 0:Ze.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",_t=T.useCallback(async()=>{ce(!0);try{const Ee=await k6(t);le(Ee),re(null)}catch(Ee){re(Ee instanceof Error?Ee.message:"Unable to load shell state.")}finally{ce(!1)}},[t]);T.useEffect(()=>{_t()},[_t]),T.useEffect(()=>{var Ee;x.current=((Ee=G==null?void 0:G.shell)==null?void 0:Ee.id)??null},[(En=G==null?void 0:G.shell)==null?void 0:En.id]),T.useEffect(()=>{E.current=G},[G]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const Ee=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),Oe=()=>{H(Ee.matches),Ee.matches||D(!1)};return Oe(),Ee.addEventListener("change",Oe),()=>{Ee.removeEventListener("change",Oe)}},[]),T.useEffect(()=>()=>{Y.current!==null&&window.clearTimeout(Y.current)},[]),T.useEffect(()=>{if(!P||f.current)return;let Ee=!1,Oe=null;return(async()=>{const[{Terminal:Je},{FitAddon:He}]=await Promise.all([j(()=>import("./xterm-DbYWMNQ0.js").then(ye=>ye.x),[]),j(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(Ee||!P)return;const tt=new Je({cursorBlink:!0,disableStdin:A,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:L2(Dt)}),X=new He;tt.loadAddon(X),tt.open(P),X.fit(),tt.attachCustomKeyEventHandler(ye=>{if(A||ye.type!=="keydown")return!0;if(ye.ctrlKey&&!ye.altKey&&!ye.metaKey&&!ye.shiftKey){const We=O4(ye.key);return We&&jt(We)?(ye.preventDefault(),!1):!0}return!0}),f.current=tt,h.current=X,he(!0),R.current=new ResizeObserver(()=>{rt(),p.current&&x.current&&g.current&&p.current.send({type:"shell.resize",shellId:x.current,viewerId:g.current,cols:tt.cols,rows:tt.rows})}),R.current.observe(P),Oe=tt.onData(ye=>{A||jt(ye)})})(),()=>{var Je,He;Ee=!0,Oe==null||Oe.dispose(),(Je=R.current)==null||Je.disconnect(),R.current=null,he(!1),(He=f.current)==null||He.dispose(),f.current=null,h.current=null}},[A,rt,jt,P]),T.useEffect(()=>{if(!n||!J)return;let Ee=window.requestAnimationFrame(()=>{rt({focus:!0})});return()=>{window.cancelAnimationFrame(Ee)}},[n,rt,J]),T.useEffect(()=>{const Ee=f.current;Ee&&(Ee.options.disableStdin=A)},[A]),T.useEffect(()=>{var X;const Ee=E.current,Oe=(X=Ee==null?void 0:Ee.shell)==null?void 0:X.id;if(!Oe)return;const Je=Ee==null?void 0:Ee.state;if(Je==="not_created"||Je==="workspace_missing"||Je==="creating"||Je==="not_found"||Je==="exited")return;const He=f.current;if(!He||!J||F===v.current)return;v.current=F,He.reset(),re(null),g.current=null,He.focus();const tt=X6({onConnected:()=>{tt.send({type:"shell.attach",shellId:Oe,cols:He.cols,rows:He.rows})},onShellEvent:ye=>{if(ye.shellId!==Oe)return;if(ye.type==="shell.connected"){const Ge=String(ye.payload.viewerId??"");g.current=Ge||null,le(Fe=>Fe&&{...Fe,state:"attached",shell:Fe.shell?{...Fe.shell,status:"attached",attachedViewerId:Ge}:Fe.shell});return}if(ye.type==="shell.output"){const Ge=typeof ye.payload.data=="string"?ye.payload.data:"",Fe=ye.payload.replace===!0,ht=typeof ye.payload.cursorX=="number"?ye.payload.cursorX:void 0,Lt=typeof ye.payload.cursorY=="number"?ye.payload.cursorY:void 0,st=typeof ye.payload.paneHeight=="number"?ye.payload.paneHeight:void 0,Nt=typeof ye.payload.cwdBaseName=="string"?ye.payload.cwdBaseName:null,_r=typeof ye.payload.envPrefix=="string"?ye.payload.envPrefix:null,bt=w0(Nt??k0(at==null?void 0:at.cwd),_r),Nn=ye.payload.isCommandRunning===!0;if(C.current={cursorX:ht,cursorY:Lt,paneHeight:st},Re(bt),Xe(Nn),O.current=Nn,Ge)if(Fe){const Hn=ik(Ge);S.current=Hn,I2(He,Ge,ht,Lt,st),!Nn&&N.current&&(w.current=M4(N.current.beforeSnapshot,Hn,N.current.command),N.current=null)}else He.write(Ge);return}if(ye.type==="shell.error"){re(String(ye.payload.message??"Shell connection failed.")),ye.payload.code==="viewer_conflict"&&le(Ge=>Ge&&{...Ge,state:"detached",shell:Ge.shell?{...Ge.shell,status:"detached",attachedViewerId:null}:Ge.shell});return}if(ye.type==="shell.detached"){const Ge=String(ye.payload.viewerId??""),Fe=String(ye.payload.reason??"");Ge&&Ge===g.current&&(g.current=null,le(ht=>ht&&{...ht,state:"detached",shell:ht.shell?{...ht.shell,status:"detached",attachedViewerId:null}:ht.shell}),re(Fe==="replaced"?"This shell connection was taken over by another device.":null),Xe(!1),O.current=!1,tt.socket.close());return}if(ye.type==="shell.exited"){g.current=null,Xe(!1),O.current=!1;const Ge=ye.payload.state==="exited"?"exited":"not_found";le(Fe=>Fe&&{...Fe,state:Ge,shell:Fe.shell?{...Fe.shell,status:Ge,attachedViewerId:null}:Fe.shell});return}const We=ye.payload.state;We&&(We!=="attached"&&(g.current=null,Xe(!1),O.current=!1),le(Ge=>Ge&&{...Ge,state:We,shell:Ge.shell?{...Ge.shell,status:We==="attached"||We==="detached"?We:Ge.shell.status,attachedViewerId:We==="attached"?Ge.shell.attachedViewerId:null}:Ge.shell}))}});return p.current=tt,tt.socket.addEventListener("close",()=>{var ye;((ye=p.current)==null?void 0:ye.socket)===tt.socket&&(p.current=null)}),()=>{var We;const ye=g.current;ye&&tt.send({type:"shell.detach",shellId:Oe,viewerId:ye}),g.current=null,tt.socket.close(),((We=p.current)==null?void 0:We.socket)===tt.socket&&(p.current=null)}},[F,at==null?void 0:at.cwd,(On=G==null?void 0:G.shell)==null?void 0:On.id,J]);const St=T.useCallback(async()=>{fe(!0);try{const Ee=f.current,Oe=await S6(t,{...(Ee==null?void 0:Ee.cols)!==void 0?{cols:Ee.cols}:{},...(Ee==null?void 0:Ee.rows)!==void 0?{rows:Ee.rows}:{}});le(Oe),$(Je=>Je+1),re(null)}catch(Ee){re(Ee instanceof Yt?Ee.payload.message:"Unable to create shell.")}finally{fe(!1)}},[t]),be=T.useCallback(async()=>{if(pt==="exited"||pt==="not_found"){await St();return}re(null),$(Ee=>Ee+1)},[St,pt]),Se=T.useCallback(async()=>{if(G!=null&&G.shell){fe(!0);try{await N6(G.shell.id),await _t(),re(null)}catch(Ee){re(Ee instanceof Yt?Ee.payload.message:"Unable to terminate shell.")}finally{fe(!1)}}},[_t,G==null?void 0:G.shell]),Me=T.useCallback(()=>{var He;const Ee=p.current,Oe=x.current,Je=g.current;!Ee||!Oe||(Je&&Ee.send({type:"shell.detach",shellId:Oe,viewerId:Je}),g.current=null,Ee.socket.close(),((He=p.current)==null?void 0:He.socket)===Ee.socket&&(p.current=null),re(null),le(tt=>tt&&{...tt,state:"detached",shell:tt.shell?{...tt.shell,status:"detached",attachedViewerId:null}:tt.shell}))},[Dt]);T.useEffect(()=>{f.current&&(f.current.options.theme=L2(Dt))},[Dt]);const lt=T.useCallback(async()=>{if(!(W||Q||pt==="creating"||pt==="workspace_missing")){if(pt==="attached"){Me();return}if(pt==="exited"||pt==="not_found"||!at){await St();return}await be()}},[W,St,Me,be,Q,at,pt]),gt=T.useCallback(async()=>{var Ee,Oe,Je,He;try{const tt=((Oe=(Ee=f.current)==null?void 0:Ee.getSelection())==null?void 0:Oe.trim())||((He=(Je=window.getSelection)==null?void 0:Je.call(window))==null?void 0:He.toString().trim())||v0(P);return tt?(await navigator.clipboard.writeText(tt),Ue("done","Copied"),!0):(Ue("failed","Nothing to copy"),!1)}catch{return Ue("failed","Copy failed"),!1}},[P,Ue]);return T.useEffect(()=>{if(!(at!=null&&at.cwd)){Re(null);return}Re(Ee=>Ee??w0(k0(at.cwd),null))},[at==null?void 0:at.cwd]),T.useEffect(()=>{l==null||l({status:pt,connectionButtonDisabled:At,connectionButtonLabel:cn,shellInputEnabled:yn,isCommandRunning:Ne,promptLabel:Pe,isMobileShell:A,hasShell:!!at,busy:W,loading:Q,error:ge})},[W,At,cn,ge,A,Ne,Q,l,Pe,at,yn,pt]),T.useImperativeHandle(o,()=>({async toggleConnection(){await lt()},sendInput(Ee){return jt(Ee)},sendCommand(Ee){const Oe={command:Ee,beforeSnapshot:S.current};if(N.current=Oe,Ee.trim()==="clear"){const tt=an();return!tt&&N.current===Oe&&(N.current=null),tt}const Je=Ee.endsWith(`
|
|
91
|
-
`)?Ee:`${Ee}
|
|
92
|
-
`,He=jt(Je);return!He&&N.current===Oe&&(N.current=null),He},sendControl(Ee){return Ee==="clear"?an():jt(U4(Ee))},async copyLastCommandOutput(){const Ee=w.current.trim()||v0(P);if(!Ee)return Ue("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(Ee),Ue("done","Copied"),!0}catch{return Ue("failed","Copy failed"),!1}},async terminate(){await Se()},focus(){var Ee;(Ee=f.current)==null||Ee.focus()},refreshLayout(Ee){rt(Ee)}}),[lt,Se,rt,an,jt,Ue,P]),d.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[r&&d.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),d.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:Pe??(at==null?void 0:at.cwd)??"Create a durable shell for this thread."})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("button",{type:"button","aria-label":cn,title:`${cn} (${I4(pt)})`,disabled:At,onClick:()=>void lt(),className:`inline-flex h-10 w-10 items-center justify-center rounded-full border shadow-lg shadow-stone-950/25 transition disabled:cursor-not-allowed disabled:opacity-60 ${sn}`,children:d.jsx(B4,{connected:pt==="attached"})}),at&&d.jsx("button",{type:"button",disabled:W,onClick:()=>void Se(),className:"rounded-full border border-rose-300/35 bg-rose-300/12 px-3 py-2 text-sm text-rose-600 transition hover:bg-rose-300/18 dark:text-rose-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Terminate"})]})]}),(ge||Q||(G==null?void 0:G.workspacePathStatus)==="missing")&&d.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[Q&&d.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!Q&&(G==null?void 0:G.workspacePathStatus)==="missing"&&d.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!Q&&ge&&d.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:ge})]})]}),d.jsx("div",{className:"min-h-0 flex-1",children:pt==="not_created"||pt==="workspace_missing"?d.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:d.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[d.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),d.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under supervisor-managed tmux and survives browser disconnects. Create it explicitly when you want to inspect or take over the workspace."})]})}):d.jsx("div",{className:"h-full min-h-0 p-2 sm:p-3",children:d.jsxs("div",{className:"shell-terminal-frame relative h-full rounded-[1.4rem] border shadow-inner",children:[!r&&(ge||Q||(G==null?void 0:G.workspacePathStatus)==="missing")&&d.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[Q&&d.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!Q&&(G==null?void 0:G.workspacePathStatus)==="missing"&&d.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!Q&&ge&&d.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:ge})]}),d.jsx("div",{ref:B,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${A?"mobile-shell-selectable":""}`,onMouseDown:()=>{var Ee;(Ee=f.current)==null||Ee.focus()}}),i&&A&&d.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[Ze&&d.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${Un}`,children:Ze.text}),te&&d.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("button",{type:"button",onClick:()=>{Ue("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(D2,{}),d.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),d.jsx("button",{type:"button",onClick:()=>void gt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(D2,{}),d.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),d.jsx("button",{type:"button",disabled:!yn,onClick:()=>{an()?Ue("done","Cleared"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"CLEAR",tone:"sky"})}),d.jsx("button",{type:"button",disabled:!yn||!Ne,onClick:()=>{jt("")?Ue("done","Sent Ctrl-C"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"CTRL-C",tone:"rose"})}),d.jsx("button",{type:"button",disabled:!yn,onClick:()=>{jt("")?Ue("done","Sent Ctrl-D"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"CTRL-D",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!yn,onClick:()=>{jt("\x1B")?Ue("done","Sent Esc"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"ESC",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!yn,onClick:()=>{jt(" ")?Ue("done","Sent Tab"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"TAB",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!yn,onClick:()=>{jt("\x1B[A")?Ue("done","Sent Up"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"UP",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!yn,onClick:()=>{jt("\x1B[B")?Ue("done","Sent Down"):Ue("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(Ml,{label:"DOWN",tone:"stone"})})]})}),d.jsx("button",{type:"button","aria-expanded":te,"aria-label":te?"Close shell tools":"Open shell tools",onClick:()=>D(Ee=>!Ee),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:d.jsx(P4,{})})]})]})})})]})});let Kn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function F4(e){return L1(e)}function L1(e){return Array.isArray(e)?z4(e):e instanceof RegExp?e:typeof e=="object"?$4(e):e}function z4(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=L1(e[n]);return t}function $4(e){let t={};for(let n in e)t[n]=L1(e[n]);return t}function lk(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function ok(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?ok(e.substring(0,e.length-1)):e.substr(~t+1)}var C0=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Cf=class{static hasCaptures(e){return e===null?!1:(C0.lastIndex=0,C0.test(e))}static replaceCaptures(e,t,n){return e.replace(C0,(r,i,l,o)=>{let c=n[parseInt(i||l,10)];if(c){let f=t.substring(c.start,c.end);for(;f[0]===".";)f=f.substring(1);switch(o){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return r})}};function uk(e,t){return e<t?-1:e>t?1:0}function ck(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let l=uk(e[i],t[i]);if(l!==0)return l}return 0}return n-r}function j2(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function dk(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var fk=class{constructor(e){de(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},ch=class{constructor(e,t,n){de(this,"_cachedMatchRoot",new fk(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(q4(e),t)}static createFromParsedTheme(e,t){return W4(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>V4(e.parent,i.parentScopes));return r?new hk(r.fontStyle,r.foreground,r.background):null}},S0=class th{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new th(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new th(n,t[r]);return n}push(t){return new th(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function V4(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!G4(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function G4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var hk=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function q4(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,l=t.length;i<l;i++){let o=t[i];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let g=o.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),c=g.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let f=-1;if(typeof o.settings.fontStyle=="string"){f=0;let g=o.settings.fontStyle.split(" ");for(let x=0,E=g.length;x<E;x++)switch(g[x]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let h=null;typeof o.settings.foreground=="string"&&j2(o.settings.foreground)&&(h=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&j2(o.settings.background)&&(p=o.settings.background);for(let g=0,x=c.length;g<x;g++){let v=c[g].trim().split(" "),S=v[v.length-1],N=null;v.length>1&&(N=v.slice(0,v.length-1),N.reverse()),n[r++]=new Y4(S,N,i,f,h,p)}}return n}var Y4=class{constructor(e,t,n,r,i,l){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=l}},Nr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Nr||{});function W4(e,t){e.sort((f,h)=>{let p=uk(f.scope,h.scope);return p!==0||(p=ck(f.parentScopes,h.parentScopes),p!==0)?p:f.index-h.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(r=f.foreground),f.background!==null&&(i=f.background)}let l=new Q4(t),o=new hk(n,l.getId(r),l.getId(i)),c=new K4(new Cg(0,null,-1,0,0),[]);for(let f=0,h=e.length;f<h;f++){let p=e[f];c.insert(0,p.scope,p.parentScopes,p.fontStyle,l.getId(p.foreground),l.getId(p.background))}return new ch(l,o,c)}var Q4=class{constructor(e){de(this,"_isFrozen");de(this,"_lastColorId");de(this,"_id2color");de(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},X4=Object.freeze([]),Cg=class mk{constructor(t,n,r,i,l){de(this,"scopeDepth");de(this,"parentScopes");de(this,"fontStyle");de(this,"foreground");de(this,"background");this.scopeDepth=t,this.parentScopes=n||X4,this.fontStyle=r,this.foreground=i,this.background=l}clone(){return new mk(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},K4=class Sg{constructor(t,n=[],r={}){de(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const l=n.parentScopes[i].length-t.parentScopes[r].length;if(l!==0)return l;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,l;if(r===-1?(i=t,l=""):(i=t.substring(0,r),l=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(l)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Sg._cmpBySpecificity),n}insert(t,n,r,i,l,o){if(n===""){this._doInsertHere(t,r,i,l,o);return}let c=n.indexOf("."),f,h;c===-1?(f=n,h=""):(f=n.substring(0,c),h=n.substring(c+1));let p;this._children.hasOwnProperty(f)?p=this._children[f]:(p=new Sg(this._mainRule.clone(),Cg.cloneArr(this._rulesWithParentScopes)),this._children[f]=p),p.insert(t+1,h,r,i,l,o)}_doInsertHere(t,n,r,i,l){if(n===null){this._mainRule.acceptOverwrite(t,r,i,l);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let f=this._rulesWithParentScopes[o];if(ck(f.parentScopes,n)===0){f.acceptOverwrite(t,r,i,l);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new Cg(t,n,r,i,l))}},lu=class Ma{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Ma.getLanguageId(t),r=Ma.getTokenType(t),i=Ma.getFontStyle(t),l=Ma.getForeground(t),o=Ma.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:l,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,l,o,c){let f=Ma.getLanguageId(t),h=Ma.getTokenType(t),p=Ma.containsBalancedBrackets(t)?1:0,g=Ma.getFontStyle(t),x=Ma.getForeground(t),E=Ma.getBackground(t);return n!==0&&(f=n),r!==8&&(h=r),i!==null&&(p=i?1:0),l!==-1&&(g=l),o!==0&&(x=o),c!==0&&(E=c),(f<<0|h<<8|p<<10|g<<11|x<<15|E<<24)>>>0}};function dh(e,t){const n=[],r=Z4(e);let i=r.next();for(;i!==null;){let f=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let h=o();if(n.push({matcher:h,priority:f}),i!==",")break;i=r.next()}return n;function l(){if(i==="-"){i=r.next();const f=l();return h=>!!f&&!f(h)}if(i==="("){i=r.next();const f=c();return i===")"&&(i=r.next()),f}if(M2(i)){const f=[];do f.push(i),i=r.next();while(M2(i));return h=>t(f,h)}return null}function o(){const f=[];let h=l();for(;h;)f.push(h),h=l();return p=>f.every(g=>g(p))}function c(){const f=[];let h=o();for(;h&&(f.push(h),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");h=o()}return p=>f.some(g=>g(p))}}function M2(e){return!!e&&!!e.match(/[\w\.:]+/)}function Z4(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function pk(e){typeof e.dispose=="function"&&e.dispose()}var Vc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},J4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},eR=class{constructor(){de(this,"_references",[]);de(this,"_seenReferenceKeys",new Set);de(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},tR=class{constructor(e,t){de(this,"seenFullScopeRequests",new Set);de(this,"seenPartialScopeRequests",new Set);de(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Vc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new eR;for(const n of e)nR(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Vc){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function nR(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=n.lookup(t);e instanceof Vc?nh({baseGrammar:l,selfGrammar:i},r):Ng(e.ruleName,{baseGrammar:l,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const c of o)r.add(new Vc(c))}function Ng(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];fh([r],t,n)}}function nh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&fh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&fh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function fh(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?lk({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&fh(r.patterns,{...t,repository:i},n);const l=r.include;if(!l)continue;const o=gk(l);switch(o.kind){case 0:nh({...t,selfGrammar:t.baseGrammar},n);break;case 1:nh(t,n);break;case 2:Ng(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const c=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const f={baseGrammar:t.baseGrammar,selfGrammar:c,repository:i};o.kind===4?Ng(o.ruleName,f,n):nh(f,n)}else o.kind===4?n.add(new J4(o.scopeName,o.ruleName)):n.add(new Vc(o.scopeName));break}}}var rR=class{constructor(){de(this,"kind",0)}},aR=class{constructor(){de(this,"kind",1)}},sR=class{constructor(e){de(this,"kind",2);this.ruleName=e}},iR=class{constructor(e){de(this,"kind",3);this.scopeName=e}},lR=class{constructor(e,t){de(this,"kind",4);this.scopeName=e,this.ruleName=t}};function gk(e){if(e==="$base")return new rR;if(e==="$self")return new aR;const t=e.indexOf("#");if(t===-1)return new iR(e);if(t===0)return new sR(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new lR(n,r)}}var oR=/\\(\d+)/,P2=/\\(\d+)/g,uR=-1,bk=-2;var rd=class{constructor(e,t,n,r){de(this,"$location");de(this,"id");de(this,"_nameIsCapturing");de(this,"_name");de(this,"_contentNameIsCapturing");de(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Cf.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Cf.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${ok(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Cf.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Cf.replaceCaptures(this._contentName,e,t)}},cR=class extends rd{constructor(t,n,r,i,l){super(t,n,r,i);de(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=l}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,i){throw new Error("Not supported!")}},dR=class extends rd{constructor(t,n,r,i,l){super(t,n,r,null);de(this,"_match");de(this,"captures");de(this,"_cachedCompiledPatterns");this._match=new Gc(i,this.id),this.captures=l,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new qc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},B2=class extends rd{constructor(t,n,r,i,l){super(t,n,r,i);de(this,"hasMissingPatterns");de(this,"patterns");de(this,"_cachedCompiledPatterns");this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new qc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ag=class extends rd{constructor(t,n,r,i,l,o,c,f,h,p){super(t,n,r,i);de(this,"_begin");de(this,"beginCaptures");de(this,"_end");de(this,"endHasBackReferences");de(this,"endCaptures");de(this,"applyEndPatternLast");de(this,"hasMissingPatterns");de(this,"patterns");de(this,"_cachedCompiledPatterns");this._begin=new Gc(l,this.id),this.beginCaptures=o,this._end=new Gc(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=h||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,i)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new qc;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},hh=class extends rd{constructor(t,n,r,i,l,o,c,f,h){super(t,n,r,i);de(this,"_begin");de(this,"beginCaptures");de(this,"whileCaptures");de(this,"_while");de(this,"whileHasBackReferences");de(this,"hasMissingPatterns");de(this,"patterns");de(this,"_cachedCompiledPatterns");de(this,"_cachedCompiledWhilePatterns");this._begin=new Gc(l,this.id),this.beginCaptures=o,this.whileCaptures=f,this._while=new Gc(c,bk),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new qc;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,i){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,i)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new qc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},xk=class Sr{static createCaptureRule(t,n,r,i,l){return t.registerRule(o=>new cR(n,o,r,i,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new dR(t.$vscodeTextmateLocation,t.id,t.name,t.match,Sr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=lk({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new B2(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Sr._compilePatterns(l,n,r))}return t.while?new hh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Sr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Sr._compileCaptures(t.whileCaptures||t.captures,n,r),Sr._compilePatterns(t.patterns,n,r)):new Ag(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Sr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Sr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Sr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let l=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>l&&(l=c)}for(let o=0;o<=l;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let f=0;t[o].patterns&&(f=Sr.getCompiledRuleId(t[o],n,r)),i[c]=Sr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,f)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let l=0,o=t.length;l<o;l++){const c=t[l];let f=-1;if(c.include){const h=gk(c.include);switch(h.kind){case 0:case 1:f=Sr.getCompiledRuleId(r[c.include],n,r);break;case 2:let p=r[h.ruleName];p&&(f=Sr.getCompiledRuleId(p,n,r));break;case 3:case 4:const g=h.scopeName,x=h.kind===4?h.ruleName:null,E=n.getExternalGrammar(g,r);if(E)if(x){let v=E.repository[x];v&&(f=Sr.getCompiledRuleId(v,n,E.repository))}else f=Sr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else f=Sr.getCompiledRuleId(c,n,r);if(f!==-1){const h=n.getRule(f);let p=!1;if((h instanceof B2||h instanceof Ag||h instanceof hh)&&h.hasMissingPatterns&&h.patterns.length===0&&(p=!0),p)continue;i.push(f)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Gc=class yk{constructor(t,n){de(this,"source");de(this,"ruleId");de(this,"hasAnchor");de(this,"hasBackReferences");de(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,l=[],o=!1;for(let c=0;c<r;c++)if(t.charAt(c)==="\\"&&c+1<r){const h=t.charAt(c+1);h==="z"?(l.push(t.substring(i,c)),l.push("$(?!\\n)(?<!\\n)"),i=c+2):(h==="A"||h==="G")&&(o=!0),c++}this.hasAnchor=o,i===0?this.source=t:(l.push(t.substring(i,r)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=oR.test(this.source):this.hasBackReferences=!1}clone(){return new yk(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return P2.lastIndex=0,this.source.replace(P2,(i,l)=>dk(r[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],l,o,c,f;for(l=0,o=this.source.length;l<o;l++)c=this.source.charAt(l),t[l]=c,n[l]=c,r[l]=c,i[l]=c,c==="\\"&&l+1<o&&(f=this.source.charAt(l+1),f==="A"?(t[l+1]="",n[l+1]="",r[l+1]="A",i[l+1]="A"):f==="G"?(t[l+1]="",n[l+1]="G",r[l+1]="",i[l+1]="G"):(t[l+1]=f,n[l+1]=f,r[l+1]=f,i[l+1]=f),l++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},qc=class{constructor(){de(this,"_items");de(this,"_hasAnchors");de(this,"_cached");de(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new U2(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new U2(e,r,this._items.map(i=>i.ruleId))}},U2=class{constructor(e,t,n){de(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
93
|
-
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},N0=class{constructor(e,t){this.languageId=e,this.tokenType=t}},si,fR=(si=class{constructor(t,n){de(this,"_defaultAttributes");de(this,"_embeddedLanguagesMatcher");de(this,"_getBasicScopeAttributes",new fk(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new N0(n,r)}));this._defaultAttributes=new N0(t,8),this._embeddedLanguagesMatcher=new hR(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?si._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(si.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},de(si,"_NULL_SCOPE_METADATA",new N0(0,0)),de(si,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),si),hR=class{constructor(e){de(this,"values");de(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>dk(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},H2=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ek(e,t,n,r,i,l,o,c){const f=t.content.length;let h=!1,p=-1;if(o){const E=mR(e,t,n,r,i,l);i=E.stack,r=E.linePos,n=E.isFirstLine,p=E.anchorPosition}const g=Date.now();for(;!h;){if(c!==0&&Date.now()-g>c)return new H2(i,!0);x()}return new H2(i,!1);function x(){const E=pR(e,t,n,r,i,p);if(!E){l.produce(i,f),h=!0;return}const v=E.captureIndices,S=E.matchedRuleId,N=v&&v.length>0?v[0].end>r:!1;if(S===uR){const w=i.getRule(e);l.produce(i,v[0].start),i=i.withContentNameScopesList(i.nameScopesList),wc(e,t,n,i,l,w.endCaptures,v),l.produce(i,v[0].end);const R=i;if(i=i.parent,p=R.getAnchorPos(),!N&&R.getEnterPos()===r){i=R,l.produce(i,f),h=!0;return}}else{const w=e.getRule(S);l.produce(i,v[0].start);const R=i,C=w.getName(t.content,v),O=i.contentNameScopesList.pushAttributed(C,e);if(i=i.push(S,r,p,v[0].end===f,null,O,O),w instanceof Ag){const Y=w;wc(e,t,n,i,l,Y.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const P=Y.getContentName(t.content,v),B=O.pushAttributed(P,e);if(i=i.withContentNameScopesList(B),Y.endHasBackReferences&&(i=i.withEndRule(Y.getEndWithResolvedBackReferences(t.content,v))),!N&&R.hasSameRuleAs(i)){i=i.pop(),l.produce(i,f),h=!0;return}}else if(w instanceof hh){const Y=w;wc(e,t,n,i,l,Y.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const P=Y.getContentName(t.content,v),B=O.pushAttributed(P,e);if(i=i.withContentNameScopesList(B),Y.whileHasBackReferences&&(i=i.withEndRule(Y.getWhileWithResolvedBackReferences(t.content,v))),!N&&R.hasSameRuleAs(i)){i=i.pop(),l.produce(i,f),h=!0;return}}else if(wc(e,t,n,i,l,w.captures,v),l.produce(i,v[0].end),i=i.pop(),!N){i=i.safePop(),l.produce(i,f),h=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function mR(e,t,n,r,i,l){let o=i.beginRuleCapturedEOL?0:-1;const c=[];for(let f=i;f;f=f.pop()){const h=f.getRule(e);h instanceof hh&&c.push({rule:h,stack:f})}for(let f=c.pop();f;f=c.pop()){const{ruleScanner:h,findOptions:p}=xR(f.rule,e,f.stack.endRule,n,r===o),g=h.findNextMatchSync(t,r,p);if(g){if(g.ruleId!==bk){i=f.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(l.produce(f.stack,g.captureIndices[0].start),wc(e,t,n,f.stack,l,f.rule.whileCaptures,g.captureIndices),l.produce(f.stack,g.captureIndices[0].end),o=g.captureIndices[0].end,g.captureIndices[0].end>r&&(r=g.captureIndices[0].end,n=!1))}else{i=f.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function pR(e,t,n,r,i,l){const o=gR(e,t,n,r,i,l),c=e.getInjections();if(c.length===0)return o;const f=bR(c,e,t,n,r,i,l);if(!f)return o;if(!o)return f;const h=o.captureIndices[0].start,p=f.captureIndices[0].start;return p<h||f.priorityMatch&&p===h?f:o}function gR(e,t,n,r,i,l){const o=i.getRule(e),{ruleScanner:c,findOptions:f}=_k(o,e,i.endRule,n,r===l),h=c.findNextMatchSync(t,r,f);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function bR(e,t,n,r,i,l,o){let c=Number.MAX_VALUE,f=null,h,p=0;const g=l.contentNameScopesList.getScopeNames();for(let x=0,E=e.length;x<E;x++){const v=e[x];if(!v.matcher(g))continue;const S=t.getRule(v.ruleId),{ruleScanner:N,findOptions:w}=_k(S,t,null,r,i===o),R=N.findNextMatchSync(n,i,w);if(!R)continue;const C=R.captureIndices[0].start;if(!(C>=c)&&(c=C,f=R.captureIndices,h=R.ruleId,p=v.priority,c===i))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:h}:null}function _k(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function xR(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function wc(e,t,n,r,i,l,o){if(l.length===0)return;const c=t.content,f=Math.min(l.length,o.length),h=[],p=o[0].end;for(let g=0;g<f;g++){const x=l[g];if(x===null)continue;const E=o[g];if(E.length===0)continue;if(E.start>p)break;for(;h.length>0&&h[h.length-1].endPos<=E.start;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?i.produceFromScopes(h[h.length-1].scopes,E.start):i.produce(r,E.start),x.retokenizeCapturedWithRuleId){const S=x.getName(c,o),N=r.contentNameScopesList.pushAttributed(S,e),w=x.getContentName(c,o),R=N.pushAttributed(w,e),C=r.push(x.retokenizeCapturedWithRuleId,E.start,-1,!1,null,N,R),O=e.createOnigString(c.substring(0,E.end));Ek(e,O,n&&E.start===0,E.start,C,i,!1,0),pk(O);continue}const v=x.getName(c,o);if(v!==null){const N=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);h.push(new yR(N,E.end))}}for(;h.length>0;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var yR=class{constructor(e,t){de(this,"scopes");de(this,"endPos");this.scopes=e,this.endPos=t}};function ER(e,t,n,r,i,l,o,c){return new TR(e,t,n,r,i,l,o,c)}function F2(e,t,n,r,i){const l=dh(t,mh),o=xk.getCompiledRuleId(n,r,i.repository);for(const c of l)e.push({debugSelector:t,matcher:c.matcher,ruleId:o,grammar:i,priority:c.priority})}function mh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(_R(t[i],r))return n=i+1,!0;return!1})}function _R(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var TR=class{constructor(e,t,n,r,i,l,o,c){de(this,"_rootId");de(this,"_lastRuleId");de(this,"_ruleId2desc");de(this,"_includedGrammars");de(this,"_grammarRepository");de(this,"_grammar");de(this,"_injections");de(this,"_basicScopeAttributesProvider");de(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=c,this._basicScopeAttributesProvider=new fR(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=z2(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const f of Object.keys(i)){const h=dh(f,mh);for(const p of h)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[f]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)F2(t,o,i[o],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const f=c.injectionSelector;f&&F2(t,f,c,this,c)}})}return t.sort((i,l)=>i.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=z2(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=xk.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Rg.NULL){i=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),g=lu.set(0,h.languageId,h.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),x=this.getRule(this._rootId).getName(null,null);let E;x?E=Lc.createRootAndLookUpScopeName(x,g,this):E=Lc.createRoot("unknown",g),t=new Rg(null,this._rootId,-1,-1,!1,null,E,E)}else i=!1,t.reset();e=e+`
|
|
94
|
-
`;const l=this.createOnigString(e),o=l.content.length,c=new kR(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=Ek(this,l,i,0,t,c,!0,r);return pk(l),{lineLength:o,lineTokens:c,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function z2(e,t){return e=F4(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Lc=class bs{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=(t==null?void 0:t.scopePath)??null;for(const l of n)i=S0.push(i,l.scopeNames),r=new bs(r,i,l.encodedTokenAttributes);return r}static createRoot(t,n){return new bs(null,new S0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),l=new S0(null,t),o=r.themeProvider.themeMatch(l),c=bs.mergeAttributes(n,i,o);return new bs(null,l,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return bs.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,l=0,o=0;return r!==null&&(i=r.fontStyle,l=r.foregroundId,o=r.backgroundId),lu.set(t,n.languageId,n.tokenType,null,i,l,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return bs._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const l of r)i=bs._pushAttributed(i,l,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),l=t.scopePath.push(n),o=r.themeProvider.themeMatch(l),c=bs.mergeAttributes(t.tokenAttributes,i,o);return new bs(t,l,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var i;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},Ha,Rg=(Ha=class{constructor(t,n,r,i,l,o,c,f){de(this,"_stackElementBrand");de(this,"_enterPos");de(this,"_anchorPos");de(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:Ha._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Lc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ha._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,l,o,c){return new Ha(this,t,n,r,i,l,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,i;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ha(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=Lc.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Ha(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Lc.fromExtension(r,n.contentNameScopesList))}},de(Ha,"NULL",new Ha(null,0,0,0,!1,null,null,null)),Ha),vR=class{constructor(e,t){de(this,"balancedBracketScopes");de(this,"unbalancedBracketScopes");de(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):dh(n,mh).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>dh(n,mh).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},kR=class{constructor(e,t,n,r){de(this,"_emitBinaryTokens");de(this,"_lineText");de(this,"_tokens");de(this,"_binaryTokens");de(this,"_lastTokenEndIndex");de(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var r;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=(e==null?void 0:e.tokenAttributes)??0,l=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(l=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(e==null?void 0:e.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(o)&&(i=lu.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(l=this.balancedBracketSelectors.match(o))}if(l&&(i=lu.set(i,0,8,l,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},wR=class{constructor(e,t){de(this,"_grammars",new Map);de(this,"_rawGrammars",new Map);de(this,"_injectionGrammars",new Map);de(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,ER(e,l,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},CR=class{constructor(t){de(this,"_options");de(this,"_syncRegistry");de(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new wR(ch.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(ch.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new vR(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,l){const o=new tR(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,l=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,l)}},Lg=Rg.NULL;const Tk=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ad{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ad.prototype.normal={};ad.prototype.property={};ad.prototype.space=void 0;function vk(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ad(n,r,t)}function Yc(e){return e.toLowerCase()}class Zr{constructor(t,n){this.attribute=n,this.property=t}}Zr.prototype.attribute="";Zr.prototype.booleanish=!1;Zr.prototype.boolean=!1;Zr.prototype.commaOrSpaceSeparated=!1;Zr.prototype.commaSeparated=!1;Zr.prototype.defined=!1;Zr.prototype.mustUseProperty=!1;Zr.prototype.number=!1;Zr.prototype.overloadedBoolean=!1;Zr.prototype.property="";Zr.prototype.spaceSeparated=!1;Zr.prototype.space=void 0;let SR=0;const Ct=to(),Xn=to(),Ig=to(),Le=to(),xn=to(),ru=to(),ca=to();function to(){return 2**++SR}const Og=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:Xn,commaOrSpaceSeparated:ca,commaSeparated:ru,number:Le,overloadedBoolean:Ig,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),A0=Object.keys(Og);class I1 extends Zr{constructor(t,n,r,i){let l=-1;if(super(t,n),$2(this,"space",i),typeof r=="number")for(;++l<A0.length;){const o=A0[l];$2(this,A0[l],(r&Og[o])===Og[o])}}}I1.prototype.defined=!0;function $2(e,t,n){n&&(e[t]=n)}function pu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new I1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Yc(r)]=r,n[Yc(l.attribute)]=r}return new ad(t,n,e.space)}const kk=pu({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:xn,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:Le,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:xn,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:Xn,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wk(e,t){return t in e?e[t]:t}function Ck(e,t){return wk(e,t.toLowerCase())}const NR=pu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ru,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:xn,autoFocus:Ct,autoPlay:Ct,blocking:xn,capture:null,charSet:null,checked:Ct,cite:null,className:xn,cols:Le,colSpan:null,content:null,contentEditable:Xn,controls:Ct,controlsList:xn,coords:Le|ru,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:Ig,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:xn,height:Le,hidden:Ig,high:Le,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:xn,itemRef:xn,itemScope:Ct,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,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:Ct,optimum:Le,pattern:null,ping:xn,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:xn,required:Ct,reversed:Ct,rows:Le,rowSpan:Le,sandbox:xn,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:Xn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:Xn,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:Xn,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:Ck}),AR=pu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ca,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:xn,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:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,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:ru,g2:ru,glyphName:ru,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:ca,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,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:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ca,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ca,rev:ca,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ca,requiredFeatures:ca,requiredFonts:ca,requiredFormats:ca,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:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:ca,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ca,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ca,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wk}),Sk=pu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Nk=pu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ck}),Ak=pu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),RR={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"},LR=/[A-Z]/g,V2=/-[a-z]/g,IR=/^data[-\w.:]+$/i;function sd(e,t){const n=Yc(t);let r=t,i=Zr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&IR.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(V2,DR);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!V2.test(l)){let o=l.replace(LR,OR);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=I1}return new i(r,t)}function OR(e){return"-"+e.toLowerCase()}function DR(e){return e.charAt(1).toUpperCase()}const gu=vk([kk,NR,Sk,Nk,Ak],"html"),ks=vk([kk,AR,Sk,Nk,Ak],"svg"),G2={}.hasOwnProperty;function O1(e,t){const n=t||{};function r(i,...l){let o=r.invalid;const c=r.handlers;if(i&&G2.call(i,e)){const f=String(i[e]);o=G2.call(c,f)?c[f]:r.unknown}if(o)return o.call(this,i,...l)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const jR=/["&'<>`]/g,MR=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,PR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,BR=/[|\\{}()[\]^$+*?.]/g,q2=new WeakMap;function UR(e,t){if(e=e.replace(t.subset?HR(t.subset):jR,r),t.subset||t.escapeOnly)return e;return e.replace(MR,n).replace(PR,r);function n(i,l,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(l+2),t)}function r(i,l,o){return t.format(i.charCodeAt(0),o.charCodeAt(l+1),t)}}function HR(e){let t=q2.get(e);return t||(t=FR(e),q2.set(e,t)),t}function FR(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(BR,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const zR=/[\dA-Fa-f]/;function $R(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!zR.test(String.fromCharCode(t))?r:r+";"}const VR=/\d/;function GR(e,t,n){const r="&#"+String(e);return n&&t&&!VR.test(String.fromCharCode(t))?r:r+";"}const qR=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],R0={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},YR=["cent","copy","divide","gt","lt","not","para","times"],Rk={}.hasOwnProperty,Dg={};let Sf;for(Sf in R0)Rk.call(R0,Sf)&&(Dg[R0[Sf]]=Sf);const WR=/[^\dA-Za-z]/;function QR(e,t,n,r){const i=String.fromCharCode(e);if(Rk.call(Dg,i)){const l=Dg[i],o="&"+l;return n&&qR.includes(l)&&!YR.includes(l)&&(!r||t&&t!==61&&WR.test(String.fromCharCode(t)))?o:o+";"}return""}function XR(e,t,n){let r=$R(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=QR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const l=GR(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function au(e,t){return UR(e,Object.assign({format:XR},t))}const KR=/^>|^->|<!--|-->|--!>|<!-$/g,ZR=[">"],JR=["<",">"];function eL(e,t,n,r){return r.settings.bogusComments?"<?"+au(e.value,Object.assign({},r.settings.characterReferences,{subset:ZR}))+">":"<!--"+e.value.replace(KR,i)+"-->";function i(l){return au(l,Object.assign({},r.settings.characterReferences,{subset:JR}))}}function tL(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function ph(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Y2(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const o=n.slice(i,r).trim();(o||!l)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function D1(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function W2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function j1(e){return e.join(" ").trim()}const nL=/[ \t\n\f\r]/g;function Hh(e){return typeof e=="object"?e.type==="text"?Q2(e.value):!1:Q2(e)}function Q2(e){return e.replace(nL,"")===""}const or=Ik(1),Lk=Ik(-1),rL=[];function Ik(e){return t;function t(n,r,i){const l=n?n.children:rL;let o=(r||0)+e,c=l[o];if(!i)for(;c&&Hh(c);)o+=e,c=l[o];return c}}const aL={}.hasOwnProperty;function Ok(e){return t;function t(n,r,i){return aL.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const M1=Ok({body:iL,caption:L0,colgroup:L0,dd:cL,dt:uL,head:L0,html:sL,li:oL,optgroup:dL,option:fL,p:lL,rp:X2,rt:X2,tbody:mL,td:K2,tfoot:pL,th:K2,thead:hL,tr:gL});function L0(e,t,n){const r=or(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Hh(r.value.charAt(0)))}function sL(e,t,n){const r=or(n,t);return!r||r.type!=="comment"}function iL(e,t,n){const r=or(n,t);return!r||r.type!=="comment"}function lL(e,t,n){const r=or(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function oL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&r.tagName==="li"}function uL(e,t,n){const r=or(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function cL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function X2(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function dL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function fL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function hL(e,t,n){const r=or(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function mL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function pL(e,t,n){return!or(n,t)}function gL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function K2(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const bL=Ok({body:EL,colgroup:_L,head:yL,html:xL,tbody:TL});function xL(e){const t=or(e,-1);return!t||t.type!=="comment"}function yL(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function EL(e){const t=or(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Hh(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function _L(e,t,n){const r=Lk(n,t),i=or(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&M1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function TL(e,t,n){const r=Lk(n,t),i=or(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&M1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Nf={name:[[`
|
|
95
|
-
\f\r &/=>`.split(""),`
|
|
96
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
97
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
98
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
99
|
-
\f\r &>`.split(""),`\0
|
|
100
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
101
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
102
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function vL(e,t,n,r){const i=r.schema,l=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const c=[];let f;i.space==="html"&&e.tagName==="svg"&&(r.schema=ks);const h=kL(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(h||!l||!bL(e,t,n))&&(c.push("<",e.tagName,h?" "+h:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(f=h.charAt(h.length-1),(!r.settings.tightSelfClosing||f==="/"||f&&f!=='"'&&f!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!o&&(!l||!M1(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function kL(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=wL(e,i,t[i]);l&&n.push(l)}}for(;++r<n.length;){const l=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&l!=='"'&&l!=="'"&&(n[r]+=" ")}return n.join("")}function wL(e,t,n){const r=sd(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let o=e.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const f=au(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Nf.name[i][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?D1:j1)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(c=au(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Nf.unquoted[i][l]}))),c!==n&&(e.settings.quoteSmart&&ph(n,o)>ph(n,e.alternative)&&(o=e.alternative),c=o+au(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?Nf.single:Nf.double)[i][l],attribute:!0}))+o),f+(c&&"="+c))}const CL=["<","&"];function Dk(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:au(e.value,Object.assign({},r.settings.characterReferences,{subset:CL}))}function SL(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Dk(e,t,n,r)}function NL(e,t,n,r){return r.all(e)}const AL=O1("type",{invalid:RL,unknown:LL,handlers:{comment:eL,doctype:tL,element:vL,raw:SL,root:NL,text:Dk}});function RL(e){throw new Error("Expected node, not `"+e+"`")}function LL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const IL={},OL={},DL=[];function jL(e,t){const n=t||IL,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ML,all:PL,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Tk,characterReferences:n.characterReferences||OL,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ks:gu,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ML(e,t,n){return AL(e,t,n,this)}function PL(e){const t=[],n=e&&e.children||DL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function gh(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,l]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof l=="string"?n[i]=l:i===r&&Object.assign(n,l);return n}function tl(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function BL(e){return Array.isArray(e)?e:[e]}async function jk(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function P1(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Mk(e){return e==="ansi"||P1(e)}function B1(e){return e==="none"}function Pk(e){return B1(e)}function Bk(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Fh(e,t=!1){var l;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let o=0;o<n.length;o+=2){const c=t?n[o]+(n[o+1]||""):n[o];i.push([c,r]),r+=n[o].length,r+=((l=n[o+1])==null?void 0:l.length)||0}return i}function UL(e){const t=Fh(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=i,o=0;for(const c of t){if(l<c.length)break;l-=c.length,o++}return{line:o,character:l}}function r(i,l){let o=0;for(let c=0;c<i;c++)o+=t[c].length;return o+=l,o}return{lines:t,indexToPos:n,posToIndex:r}}const U1="light-dark()",HL=["color","background-color"];function FL(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function zL(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const l=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,c)=>o-c);return l.length?FL(i,l):i})):e}function $L(e,t,n,r,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>bh(e.variants[p])),c=new Set(o.flatMap(p=>Object.keys(p))),f={},h=(p,g)=>{const x=g==="color"?"":g==="background-color"?"-bg":`-${g}`;return n+t[p]+(g==="color"?"":x)};return o.forEach((p,g)=>{for(const x of c){const E=p[x]||"inherit";if(g===0&&r&&HL.includes(x))if(r===U1&&o.length>1){const v=t.findIndex(R=>R==="light"),S=t.findIndex(R=>R==="dark");if(v===-1||S===-1)throw new Kn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const N=o[v][x]||"inherit",w=o[S][x]||"inherit";f[x]=`light-dark(${N}, ${w})`,i==="css-vars"&&(f[h(g,x)]=E)}else f[x]=E;else i==="css-vars"&&(f[h(g,x)]=E)}}),l.htmlStyle=f,l}function bh(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Nr.Italic&&(t["font-style"]="italic"),e.fontStyle&Nr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Nr.Underline&&n.push("underline"),e.fontStyle&Nr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function jg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Uk=new WeakMap;function zh(e,t){Uk.set(e,t)}function Wc(e){return Uk.get(e)}class bu{constructor(...t){de(this,"_stacks",{});de(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new bu(Object.fromEntries(BL(n).map(r=>[r,Lg])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return VL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function VL(e){const t=[],n=new Set;function r(i){var o;if(n.has(i))return;n.add(i);const l=(o=i==null?void 0:i.nameScopesList)==null?void 0:o.scopeName;l&&t.push(l),i.parent&&r(i.parent)}return r(e),t}function GL(e,t){if(!(e instanceof bu))throw new Kn("Invalid grammar state");return e.getInternalStack(t)}function qL(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Kn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const c=i.lines[o.line];if(c===void 0)throw new Kn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let f=o.character;if(f<0&&(f=c.length+f),f<0||f>c.length)throw new Kn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:f,offset:i.posToIndex(o.line,f)}}};const i=UL(n.source),l=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));YL(l),e.set(n.meta,{decorations:l,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var o;if(!((o=this.options.decorations)!=null&&o.length))return;const i=t(this).decorations.flatMap(c=>[c.start.offset,c.end.offset]);return zL(n,i)},code(n){var p;if(!((p=this.options.decorations)!=null&&p.length))return;const r=t(this),i=Array.from(n.children).filter(g=>g.type==="element"&&g.tagName==="span");if(i.length!==r.converter.lines.length)throw new Kn(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function l(g,x,E,v){const S=i[g];let N="",w=-1,R=-1;if(x===0&&(w=0),E===0&&(R=0),E===Number.POSITIVE_INFINITY&&(R=S.children.length),w===-1||R===-1)for(let O=0;O<S.children.length;O++)N+=Hk(S.children[O]),w===-1&&N.length===x&&(w=O+1),R===-1&&N.length===E&&(R=O+1);if(w===-1)throw new Kn(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(R===-1)throw new Kn(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const C=S.children.slice(w,R);if(!v.alwaysWrap&&C.length===S.children.length)c(S,v,"line");else if(!v.alwaysWrap&&C.length===1&&C[0].type==="element")c(C[0],v,"token");else{const O={type:"element",tagName:"span",properties:{},children:C};c(O,v,"wrapper"),S.children.splice(w,C.length,O)}}function o(g,x){i[g]=c(i[g],x,"line")}function c(g,x,E){var N;const v=x.properties||{},S=x.transform||(w=>w);return g.tagName=x.tagName||"span",g.properties={...g.properties,...v,class:g.properties.class},(N=x.properties)!=null&&N.class&&Bk(g,x.properties.class),g=S(g,E)||g,g}const f=[],h=r.decorations.sort((g,x)=>x.start.offset-g.start.offset||g.end.offset-x.end.offset);for(const g of h){const{start:x,end:E}=g;if(x.line===E.line)l(x.line,x.character,E.character,g);else if(x.line<E.line){l(x.line,x.character,Number.POSITIVE_INFINITY,g);for(let v=x.line+1;v<E.line;v++)f.unshift(()=>o(v,g));l(E.line,0,E.character,g)}}f.forEach(g=>g())}}}function YL(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Kn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],l=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,c=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,f=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(l||o||c||f){if(l&&o||c&&f||c&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new Kn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function Hk(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Hk).join(""):""}const WL=[qL()];function xh(e){const t=QL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...WL]}function QL(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Vl=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],I0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function XL(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function Z2(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function KL(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)I0[r]&&t.push({type:"setDecoration",value:I0[r]});else if(r<=29){const i=I0[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Vl[r-30]}});else if(r===38){const i=Z2(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Vl[r-40]}});else if(r===48){const i=Z2(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Vl[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Vl[r-100+8]}})}return t}function ZL(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let l=0;do{const o=XL(r,l),c=o.sequence?r.substring(l,o.startPosition):r.substring(l);if(c.length>0&&i.push({value:c,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const f=KL(o.sequence);for(const h of f)h.type==="resetAll"?(e=null,t=null,n.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?t=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of f)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&n.add(h.value)}l=o.position}while(l<r.length);return i}}}var JL={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function eI(e=JL){function t(c){return e[c]}function n(c){return`#${c.map(f=>Math.max(0,Math.min(f,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let h=0;h<Vl.length;h++)r.push(t(Vl[h]));let c=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let p=0;p<6;p++)for(let g=0;g<6;g++)r.push(n([c[h],c[p],c[g]]));let f=8;for(let h=0;h<24;h++,f+=10)r.push(n([f,f,f]));return r}function l(c){return i()[c]}function o(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return l(c.index)}}return{value:o}}const tI={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function nI(e,t,n){const r=gh(e,n),i=Fh(t),l=Object.fromEntries(Vl.map(f=>{var g;const h=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`,p=(g=e.colors)==null?void 0:g[h];return[f,p||tI[f]]})),o=eI(l),c=ZL();return i.map(f=>c.parse(f[0]).map(h=>{let p,g;h.decorations.has("reverse")?(p=h.background?o.value(h.background):e.bg,g=h.foreground?o.value(h.foreground):e.fg):(p=h.foreground?o.value(h.foreground):e.fg,g=h.background?o.value(h.background):void 0),p=tl(p,r),g=tl(g,r),h.decorations.has("dim")&&(p=rI(p));let x=Nr.None;return h.decorations.has("bold")&&(x|=Nr.Bold),h.decorations.has("italic")&&(x|=Nr.Italic),h.decorations.has("underline")&&(x|=Nr.Underline),h.decorations.has("strikethrough")&&(x|=Nr.Strikethrough),{content:h.value,offset:f[1],color:p,bgColor:g,fontStyle:x}}))}function rI(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],l=r[1],o=r[2],c=r[3],f=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${l}${l}${o}${o}${f}`}else if(r.length===3){const i=r[0],l=r[1],o=r[2];return`#${i}${i}${l}${l}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function H1(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(P1(i)||B1(r))return Fh(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:l,colorMap:o}=e.setTheme(r);if(i==="ansi")return nI(l,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new Kn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(l.name))throw new Kn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return sI(t,c,l,o,n)}function aI(...e){if(e.length===2)return Wc(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=r;if(P1(i)||B1(l))throw new Kn("Plain language does not have grammar state");if(i==="ansi")throw new Kn("ANSI language does not have grammar state");const{theme:o,colorMap:c}=t.setTheme(l),f=t.getLanguage(i);return new bu(F1(n,f,o,c,r).stateStack,f.name,o.name)}function sI(e,t,n,r,i){const l=F1(e,t,n,r,i),o=new bu(l.stateStack,t.name,n.name);return zh(l.tokens,o),l.tokens}function F1(e,t,n,r,i){const l=gh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500}=i,f=Fh(e);let h=i.grammarState?GL(i.grammarState,n.name)??Lg:i.grammarContextCode!=null?F1(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Lg,p=[];const g=[];for(let x=0,E=f.length;x<E;x++){const[v,S]=f[x];if(v===""){p=[],g.push([]);continue}if(o>0&&v.length>=o){p=[],g.push([{content:v,offset:S,color:"",fontStyle:0}]);continue}let N,w,R;i.includeExplanation&&(N=t.tokenizeLine(v,h,c),w=N.tokens,R=0);const C=t.tokenizeLine2(v,h,c),O=C.tokens.length/2;for(let Y=0;Y<O;Y++){const P=C.tokens[2*Y],B=Y+1<O?C.tokens[2*Y+2]:v.length;if(P===B)continue;const G=C.tokens[2*Y+1],le=tl(r[lu.getForeground(G)],l),Q=lu.getFontStyle(G),ce={content:v.substring(P,B),offset:S+P,color:le,fontStyle:Q};if(i.includeExplanation){const W=[];if(i.includeExplanation!=="scopeName")for(const ge of n.settings){let re;switch(typeof ge.scope){case"string":re=ge.scope.split(/,/).map(F=>F.trim());break;case"object":re=ge.scope;break;default:continue}W.push({settings:ge,selectors:re.map(F=>F.split(/ /))})}ce.explanation=[];let fe=0;for(;P+fe<B;){const ge=w[R],re=v.substring(ge.startIndex,ge.endIndex);fe+=re.length,ce.explanation.push({content:re,scopes:i.includeExplanation==="scopeName"?iI(ge.scopes):lI(W,ge.scopes)}),R+=1}}p.push(ce)}g.push(p),p=[],h=C.ruleStack}return{tokens:g,stateStack:h}}function iI(e){return e.map(t=>({scopeName:t}))}function lI(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const l=t[r];n[r]={scopeName:l,themeMatches:uI(e,l,t.slice(0,r))}}return n}function J2(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function oI(e,t,n){if(!J2(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)J2(e[r],n[i])&&(r-=1),i-=1;return r===-1}function uI(e,t,n){const r=[];for(const{selectors:i,settings:l}of e)for(const o of i)if(oI(o,t,n)){r.push(l);break}return r}function Fk(e,t,n){const r=Object.entries(n.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),i=r.map(f=>{const h=H1(e,t,{...n,theme:f.theme}),p=Wc(h),g=typeof f.theme=="string"?f.theme:f.theme.name;return{tokens:h,state:p,theme:g}}),l=cI(...i.map(f=>f.tokens)),o=l[0].map((f,h)=>f.map((p,g)=>{const x={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(x.explanation=p.explanation),l.forEach((E,v)=>{const{content:S,explanation:N,offset:w,...R}=E[h][g];x.variants[r[v].color]=R}),x})),c=i[0].state?new bu(Object.fromEntries(i.map(f=>{var h;return[f.theme,(h=f.state)==null?void 0:h.getInternalStack(f.theme)]})),i[0].state.lang):void 0;return c&&zh(o,c),o}function cI(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(f=>f[r]),l=t.map(()=>[]);t.forEach((f,h)=>f.push(l[h]));const o=i.map(()=>0),c=i.map(f=>f[0]);for(;c.every(f=>f);){const f=Math.min(...c.map(h=>h.content.length));for(let h=0;h<n;h++){const p=c[h];p.content.length===f?(l[h].push(p),o[h]+=1,c[h]=i[h][o[h]]):(l[h].push({...p,content:p.content.slice(0,f)}),c[h]={...p,content:p.content.slice(f),offset:p.offset+f})}}}return t}function yh(e,t,n){let r,i,l,o,c,f;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:p="--shiki-",colorsRendering:g="css-vars"}=n,x=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,R)=>w.color===h?-1:R.color===h?1:0);if(x.length===0)throw new Kn("`themes` option must not be empty");const E=Fk(e,t,n);if(f=Wc(E),h&&U1!==h&&!x.find(w=>w.color===h))throw new Kn(`\`themes\` option must contain the defaultColor key \`${h}\``);const v=x.map(w=>e.getTheme(w.theme)),S=x.map(w=>w.color);l=E.map(w=>w.map(R=>$L(R,S,p,h,g))),f&&zh(l,f);const N=x.map(w=>gh(w.theme,n));i=e_(x,v,N,p,h,"fg",g),r=e_(x,v,N,p,h,"bg",g),o=`shiki-themes ${v.map(w=>w.name).join(" ")}`,c=h?void 0:[i,r].join(";")}else if("theme"in n){const h=gh(n.theme,n);l=H1(e,t,n);const p=e.getTheme(n.theme);r=tl(p.bg,h),i=tl(p.fg,h),o=p.name,f=Wc(l)}else throw new Kn("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:i,bg:r,themeName:o,rootStyle:c,grammarState:f}}function e_(e,t,n,r,i,l,o){return e.map((c,f)=>{const h=tl(t[f][l],n[f])||"inherit",p=`${r+c.color}${l==="bg"?"-bg":""}:${h}`;if(f===0&&i){if(i===U1&&e.length>1){const g=e.findIndex(S=>S.color==="light"),x=e.findIndex(S=>S.color==="dark");if(g===-1||x===-1)throw new Kn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=tl(t[g][l],n[g])||"inherit",v=tl(t[x][l],n[x])||"inherit";return`light-dark(${E}, ${v});${p}`}return h}return o==="css-vars"?p:null}).filter(c=>!!c).join(";")}function Eh(e,t,n,r={meta:{},options:n,codeToHast:(i,l)=>Eh(e,i,l),codeToTokens:(i,l)=>yh(e,i,l)}){var v,S;let i=t;for(const N of xh(n))i=((v=N.preprocess)==null?void 0:v.call(r,i,n))||i;let{tokens:l,fg:o,bg:c,themeName:f,rootStyle:h,grammarState:p}=yh(e,i,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:x=!1}=n;g===!0?l=fI(l):g==="never"&&(l=hI(l)),x&&(l=mI(l));const E={...r,get source(){return i}};for(const N of xh(n))l=((S=N.tokens)==null?void 0:S.call(E,l))||l;return dI(l,{...n,fg:o,bg:c,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??h},E,p)}function dI(e,t,n,r=Wc(e)){var S,N,w,R;const i=xh(t),l=[],o={type:"root",children:[]},{structure:c="classic",tabindex:f="0"}=t,h={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?h.style=t.rootStyle:h.style=`background-color:${t.bg};color:${t.fg}`),f!==!1&&f!=null&&(h.tabindex=f.toString());for(const[C,O]of Object.entries(t.meta||{}))C.startsWith("_")||(h[C]=O);let p={type:"element",tagName:"pre",properties:h,children:[],data:t.data},g={type:"element",tagName:"code",properties:{},children:l};const x=[],E={...n,structure:c,addClassToHast:Bk,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return g},get lines(){return x}};if(e.forEach((C,O)=>{var B,G;O&&(c==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&l.push({type:"text",value:`
|
|
103
|
-
`}));let Y={type:"element",tagName:"span",properties:{class:"line"},children:[]},P=0;for(const le of C){let Q={type:"element",tagName:"span",properties:{...le.htmlAttrs},children:[{type:"text",value:le.content}]};const ce=jg(le.htmlStyle||bh(le));ce&&(Q.properties.style=ce);for(const W of i)Q=((B=W==null?void 0:W.span)==null?void 0:B.call(E,Q,O+1,P,Y,le))||Q;c==="inline"?o.children.push(Q):c==="classic"&&Y.children.push(Q),P+=le.content.length}if(c==="classic"){for(const le of i)Y=((G=le==null?void 0:le.line)==null?void 0:G.call(E,Y,O+1))||Y;x.push(Y),l.push(Y)}else c==="inline"&&x.push(Y)}),c==="classic"){for(const C of i)g=((S=C==null?void 0:C.code)==null?void 0:S.call(E,g))||g;p.children.push(g);for(const C of i)p=((N=C==null?void 0:C.pre)==null?void 0:N.call(E,p))||p;o.children.push(p)}else if(c==="inline"){const C=[];let O={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const B of o.children)B.type==="element"&&B.tagName==="br"?(C.push(O),O={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(B.type==="element"||B.type==="text")&&O.children.push(B);C.push(O);let P={type:"element",tagName:"code",properties:{},children:C};for(const B of i)P=((w=B==null?void 0:B.code)==null?void 0:w.call(E,P))||P;o.children=[];for(let B=0;B<P.children.length;B++){B>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const G=P.children[B];G.type==="element"&&o.children.push(...G.children)}}let v=o;for(const C of i)v=((R=C==null?void 0:C.root)==null?void 0:R.call(E,v))||v;return r&&zh(v,r),v}function fI(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((l,o)=>{const f=!(l.fontStyle&&(l.fontStyle&Nr.Underline||l.fontStyle&Nr.Strikethrough));f&&l.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=l.offset),r+=l.content):r?(f?n.push({...l,offset:i,content:r+l.content}):n.push({content:r,offset:i},l),i=void 0,r=""):n.push(l)}),n})}function hI(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,l,o]=r;if(!i&&!o)return n;const c=[{...n,offset:n.offset+i.length,content:l}];return i&&c.unshift({content:i,offset:n.offset}),o&&c.push({content:o,offset:n.offset+i.length+l.length}),c}))}function mI(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],l=jg(i.htmlStyle||bh(i)),o=jg(r.htmlStyle||bh(r)),c=i.fontStyle&&(i.fontStyle&Nr.Underline||i.fontStyle&Nr.Strikethrough),f=r.fontStyle&&(r.fontStyle&Nr.Underline||r.fontStyle&Nr.Strikethrough);!c&&!f&&l===o?i.content+=r.content:n.push({...r})}return n})}const pI=jL;function gI(e,t,n){var l;const r={meta:{},options:n,codeToHast:(o,c)=>Eh(e,o,c),codeToTokens:(o,c)=>yh(e,o,c)};let i=pI(Eh(e,t,n,r));for(const o of xh(n))i=((l=o.postprocess)==null?void 0:l.call(r,i,n))||i;return i}const t_={light:"#333333",dark:"#bbbbbb"},n_={light:"#fffffe",dark:"#1e1e1e"},r_="__shiki_resolved";function z1(e){var c,f,h,p,g;if(e!=null&&e[r_])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const x=t.settings?t.settings.find(E=>!E.name&&!E.scope):void 0;(c=x==null?void 0:x.settings)!=null&&c.foreground&&(r=x.settings.foreground),(f=x==null?void 0:x.settings)!=null&&f.background&&(n=x.settings.background),!r&&((h=t==null?void 0:t.colors)!=null&&h["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((p=t==null?void 0:t.colors)!=null&&p["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?t_.light:t_.dark),n||(n=t.type==="light"?n_.light:n_.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const l=new Map;function o(x){var v;if(l.has(x))return l.get(x);i+=1;const E=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(v=t.colorReplacements)!=null&&v[`#${E}`]?o(x):(l.set(x,E),E)}t.settings=t.settings.map(x=>{var N,w;const E=((N=x.settings)==null?void 0:N.foreground)&&!x.settings.foreground.startsWith("#"),v=((w=x.settings)==null?void 0:w.background)&&!x.settings.background.startsWith("#");if(!E&&!v)return x;const S={...x,settings:{...x.settings}};if(E){const R=o(x.settings.foreground);t.colorReplacements[R]=x.settings.foreground,S.settings.foreground=R}if(v){const R=o(x.settings.background);t.colorReplacements[R]=x.settings.background,S.settings.background=R}return S});for(const x of Object.keys(t.colors||{}))if((x==="editor.foreground"||x==="editor.background"||x.startsWith("terminal.ansi"))&&!((g=t.colors[x])!=null&&g.startsWith("#"))){const E=o(t.colors[x]);t.colorReplacements[E]=t.colors[x],t.colors[x]=E}return Object.defineProperty(t,r_,{enumerable:!1,writable:!1,value:!0}),t}async function zk(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Mk(t)).map(async t=>await jk(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function $k(e){return(await Promise.all(e.map(async n=>Pk(n)?null:z1(await jk(n))))).filter(n=>!!n)}let bI=3;function xI(e,t=3){t>bI||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let eu=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Vk(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new eu(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class yI extends CR{constructor(n,r,i,l={}){super(n);de(this,"_resolvedThemes",new Map);de(this,"_resolvedGrammars",new Map);de(this,"_langMap",new Map);de(this,"_langGraph",new Map);de(this,"_textmateThemeCache",new WeakMap);de(this,"_loadedThemesCache",null);de(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=l,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=z1(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=ch.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=Vk(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var o,c,f,h;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(p=>{var g;return(g=p.embeddedLangsLazy)==null?void 0:g.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const l=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(l.name=n.name,this._resolvedGrammars.set(n.name,l),n.aliases&&n.aliases.forEach(p=>{this._alias[p]=n.name}),this._loadedLanguagesCache=null,r.size)for(const p of r)this._resolvedGrammars.delete(p.name),this._loadedLanguagesCache=null,(c=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||c.delete(p.scopeName),(h=(f=this._syncRegistry)==null?void 0:f._grammars)==null||h.delete(p.scopeName),this.loadLanguage(this._langMap.get(p.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const l of n)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),i=r.filter(([l,o])=>!o);if(i.length){const l=r.filter(([o,c])=>{if(!c)return!1;const f=c.embeddedLanguages||c.embeddedLangs;return f==null?void 0:f.some(h=>i.map(([p])=>p).includes(h))}).filter(o=>!i.includes(o));throw new eu(`Missing languages ${i.map(([o])=>`\`${o}\``).join(", ")}, required by ${l.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[l,o]of r)this._resolver.addLanguage(o);for(const[l,o]of r)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const r=n.embeddedLanguages??n.embeddedLangs;if(r)for(const i of r)this._langGraph.set(i,this._langMap.get(i))}}class EI{constructor(t,n){de(this,"_langs",new Map);de(this,"_scopeToLang",new Map);de(this,"_injections",new Map);de(this,"_onigLib");this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const l=n.slice(0,i).join(".");r=[...r,...this._injections.get(l)||[]]}return r}}let mc=0;function _I(e){mc+=1,e.warnings!==!1&&mc>=10&&mc%10===0&&console.warn(`[Shiki] ${mc} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new eu("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(z1),i=new EI(e.engine,n),l=new yI(i,r,n,e.langAlias);let o;function c(C){return Vk(C,e.langAlias)}function f(C){w();const O=l.getGrammar(typeof C=="string"?C:C.name);if(!O)throw new eu(`Language \`${C}\` not found, you may need to load it first`);return O}function h(C){if(C==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const O=l.getTheme(C);if(!O)throw new eu(`Theme \`${C}\` not found, you may need to load it first`);return O}function p(C){w();const O=h(C);o!==C&&(l.setTheme(O),o=C);const Y=l.getColorMap();return{theme:O,colorMap:Y}}function g(){return w(),l.getLoadedThemes()}function x(){return w(),l.getLoadedLanguages()}function E(...C){w(),l.loadLanguages(C.flat(1))}async function v(...C){return E(await zk(C))}function S(...C){w();for(const O of C.flat(1))l.loadTheme(O)}async function N(...C){return w(),S(await $k(C))}function w(){if(t)throw new eu("Shiki instance has been disposed")}function R(){t||(t=!0,l.dispose(),mc-=1)}return{setTheme:p,getTheme:h,getLanguage:f,getLoadedThemes:g,getLoadedLanguages:x,resolveLangAlias:c,loadLanguage:v,loadLanguageSync:E,loadTheme:N,loadThemeSync:S,dispose:R,[Symbol.dispose]:R}}async function TI(e){e.engine||xI("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([$k(e.themes||[]),zk(e.langs||[]),e.engine]);return _I({...e,themes:t,langs:n,engine:r})}async function vI(e){const t=await TI(e);return{getLastGrammarState:(...n)=>aI(t,...n),codeToTokensBase:(n,r)=>H1(t,n,r),codeToTokensWithThemes:(n,r)=>Fk(t,n,r),codeToTokens:(n,r)=>yh(t,n,r),codeToHast:(n,r)=>Eh(t,n,r),codeToHtml:(n,r)=>gI(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function kI(e){const t=e.langs,n=e.themes,r=e.engine;async function i(l){function o(g){var x;if(typeof g=="string"){if(g=((x=l.langAlias)==null?void 0:x[g])||g,Mk(g))return[];const E=t[g];if(!E)throw new Kn(`Language \`${g}\` is not included in this bundle. You may want to load it from external source.`);return E}return g}function c(g){if(Pk(g))return"none";if(typeof g=="string"){const x=n[g];if(!x)throw new Kn(`Theme \`${g}\` is not included in this bundle. You may want to load it from external source.`);return x}return g}const f=(l.themes??[]).map(g=>c(g)),h=(l.langs??[]).map(g=>o(g)),p=await vI({engine:l.engine??r(),...l,themes:f,langs:h});return{...p,loadLanguage(...g){return p.loadLanguage(...g.map(o))},loadTheme(...g){return p.loadTheme(...g.map(c))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const $1=[{id:"abap",name:"ABAP",import:(()=>j(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>j(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>j(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>j(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>j(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>j(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>j(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>j(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>j(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>j(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>j(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>j(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>j(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>j(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>j(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>j(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>j(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>j(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>j(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>j(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>j(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>j(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>j(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>j(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>j(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>j(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>j(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>j(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>j(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>j(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>j(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>j(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>j(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>j(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>j(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>j(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>j(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>j(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>j(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>j(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>j(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>j(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>j(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>j(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>j(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>j(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>j(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>j(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>j(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>j(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>j(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>j(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>j(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>j(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>j(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>j(()=>import("./erb-B12qg9BL.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>j(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>j(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>j(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>j(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>j(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>j(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>j(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>j(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>j(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>j(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>j(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>j(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>j(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>j(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>j(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>j(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>j(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>j(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>j(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>j(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>j(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>j(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>j(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>j(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>j(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>j(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>j(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>j(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>j(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>j(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>j(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>j(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>j(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>j(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>j(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>j(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>j(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>j(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>j(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>j(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>j(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>j(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>j(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>j(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>j(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>j(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>j(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>j(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>j(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>j(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>j(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>j(()=>import("./just-Cw27pwNe.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>j(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>j(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>j(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>j(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>j(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>j(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>j(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>j(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>j(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>j(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>j(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>j(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>j(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>j(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>j(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>j(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>j(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>j(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>j(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>j(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>j(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>j(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>j(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>j(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>j(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>j(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>j(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>j(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>j(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>j(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>j(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>j(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>j(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>j(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>j(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>j(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>j(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>j(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>j(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>j(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>j(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>j(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>j(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>j(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>j(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>j(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>j(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>j(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>j(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>j(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>j(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>j(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>j(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>j(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>j(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>j(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>j(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>j(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>j(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>j(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>j(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>j(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>j(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>j(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>j(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>j(()=>import("./rst-BrH8l1NY.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>j(()=>import("./ruby-Dw2BHqvy.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>j(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>j(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>j(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>j(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>j(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>j(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>j(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>j(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>j(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>j(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>j(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>j(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>j(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>j(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>j(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>j(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>j(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>j(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>j(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>j(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>j(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>j(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>j(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>j(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>j(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>j(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>j(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>j(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>j(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>j(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>j(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>j(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>j(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>j(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>j(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>j(()=>import("./twig-DNn4PbVi.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>j(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>j(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>j(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>j(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>j(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>j(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>j(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>j(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>j(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>j(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>j(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>j(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>j(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>j(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>j(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>j(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>j(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>j(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>j(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>j(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>j(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>j(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>j(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>j(()=>import("./zig-VOosw3JB.js"),[]))}],wI=Object.fromEntries($1.map(e=>[e.id,e.import])),CI=Object.fromEntries($1.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),Gk={...wI,...CI},SI=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>j(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>j(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>j(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>j(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>j(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>j(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>j(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>j(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>j(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>j(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>j(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>j(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>j(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>j(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>j(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>j(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>j(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>j(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>j(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>j(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>j(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>j(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>j(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>j(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>j(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>j(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>j(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>j(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>j(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>j(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>j(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>j(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>j(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>j(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>j(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>j(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>j(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>j(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>j(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>j(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>j(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>j(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>j(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>j(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>j(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>j(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>j(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>j(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>j(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>j(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>j(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>j(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>j(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>j(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>j(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>j(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>j(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>j(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>j(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>j(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>j(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>j(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],NI=Object.fromEntries(SI.map(e=>[e.id,e.import]));class V1 extends Error{constructor(t){super(t),this.name="ShikiError"}}function AI(){return 2147483648}function RI(){return typeof performance<"u"?performance.now():Date.now()}const LI=(e,t)=>e+(t-e%t)%t;async function II(e){let t,n;const r={};function i(E){n=E,r.HEAPU8=new Uint8Array(E),r.HEAPU32=new Uint32Array(E)}function l(E,v,S){r.HEAPU8.copyWithin(E,v,v+S)}function o(E){try{return t.grow(E-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function c(E){const v=r.HEAPU8.length;E=E>>>0;const S=AI();if(E>S)return!1;for(let N=1;N<=4;N*=2){let w=v*(1+.2/N);w=Math.min(w,E+100663296);const R=Math.min(S,LI(Math.max(E,w),65536));if(o(R))return!0}return!1}const f=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(E,v,S=1024){const N=v+S;let w=v;for(;E[w]&&!(w>=N);)++w;if(w-v>16&&E.buffer&&f)return f.decode(E.subarray(v,w));let R="";for(;v<w;){let C=E[v++];if(!(C&128)){R+=String.fromCharCode(C);continue}const O=E[v++]&63;if((C&224)===192){R+=String.fromCharCode((C&31)<<6|O);continue}const Y=E[v++]&63;if((C&240)===224?C=(C&15)<<12|O<<6|Y:C=(C&7)<<18|O<<12|Y<<6|E[v++]&63,C<65536)R+=String.fromCharCode(C);else{const P=C-65536;R+=String.fromCharCode(55296|P>>10,56320|P&1023)}}return R}function p(E,v){return E?h(r.HEAPU8,E,v):""}const g={emscripten_get_now:RI,emscripten_memcpy_big:l,emscripten_resize_heap:c,fd_write:()=>0};async function x(){const v=await e({env:g,wasi_snapshot_preview1:g});t=v.memory,i(t.buffer),Object.assign(r,v),r.UTF8ToString=p}return await x(),r}var OI=Object.defineProperty,DI=(e,t,n)=>t in e?OI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sr=(e,t,n)=>DI(e,typeof t!="symbol"?t+"":t,n);let hr=null;function jI(e){throw new V1(e.UTF8ToString(e.getLastOnigError()))}class $h{constructor(t){sr(this,"utf16Length"),sr(this,"utf8Length"),sr(this,"utf16Value"),sr(this,"utf8Value"),sr(this,"utf16OffsetToUtf8"),sr(this,"utf8OffsetToUtf16");const n=t.length,r=$h._utf8ByteLength(t),i=r!==n,l=i?new Uint32Array(n+1):null;i&&(l[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const c=new Uint8Array(r);let f=0;for(let h=0;h<n;h++){const p=t.charCodeAt(h);let g=p,x=!1;if(p>=55296&&p<=56319&&h+1<n){const E=t.charCodeAt(h+1);E>=56320&&E<=57343&&(g=(p-55296<<10)+65536|E-56320,x=!0)}i&&(l[h]=f,x&&(l[h+1]=f),g<=127?o[f+0]=h:g<=2047?(o[f+0]=h,o[f+1]=h):g<=65535?(o[f+0]=h,o[f+1]=h,o[f+2]=h):(o[f+0]=h,o[f+1]=h,o[f+2]=h,o[f+3]=h)),g<=127?c[f++]=g:g<=2047?(c[f++]=192|(g&1984)>>>6,c[f++]=128|(g&63)>>>0):g<=65535?(c[f++]=224|(g&61440)>>>12,c[f++]=128|(g&4032)>>>6,c[f++]=128|(g&63)>>>0):(c[f++]=240|(g&1835008)>>>18,c[f++]=128|(g&258048)>>>12,c[f++]=128|(g&4032)>>>6,c[f++]=128|(g&63)>>>0),x&&h++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=c,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const l=t.charCodeAt(r);let o=l,c=!1;if(l>=55296&&l<=56319&&r+1<i){const f=t.charCodeAt(r+1);f>=56320&&f<=57343&&(o=(l-55296<<10)+65536|f-56320,c=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,c&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Vh=class xs{constructor(t){if(sr(this,"id",++xs.LAST_ID),sr(this,"_onigBinding"),sr(this,"content"),sr(this,"utf16Length"),sr(this,"utf8Length"),sr(this,"utf16OffsetToUtf8"),sr(this,"utf8OffsetToUtf16"),sr(this,"ptr"),!hr)throw new V1("Must invoke loadWasm first.");this._onigBinding=hr,this.content=t;const n=new $h(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!xs._sharedPtrInUse?(xs._sharedPtr||(xs._sharedPtr=hr.omalloc(1e4)),xs._sharedPtrInUse=!0,hr.HEAPU8.set(n.utf8Value,xs._sharedPtr),this.ptr=xs._sharedPtr):this.ptr=n.createString(hr)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===xs._sharedPtr?xs._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};sr(Vh,"LAST_ID",0);sr(Vh,"_sharedPtr",0);sr(Vh,"_sharedPtrInUse",!1);let qk=Vh;class MI{constructor(t){if(sr(this,"_onigBinding"),sr(this,"_ptr"),!hr)throw new V1("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,f=t.length;c<f;c++){const h=new $h(t[c]);n[c]=h.createString(hr),r[c]=h.utf8Length}const i=hr.omalloc(4*t.length);hr.HEAPU32.set(n,i/4);const l=hr.omalloc(4*t.length);hr.HEAPU32.set(r,l/4);const o=hr.createOnigScanner(i,l,t.length);for(let c=0,f=t.length;c<f;c++)hr.ofree(n[c]);hr.ofree(l),hr.ofree(i),o===0&&jI(hr),this._onigBinding=hr,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new qk(t);const l=this._findNextMatchSync(t,n,!1,i);return t.dispose(),l}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const l=this._onigBinding,o=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const c=l.HEAPU32;let f=o/4;const h=c[f++],p=c[f++],g=[];for(let x=0;x<p;x++){const E=t.convertUtf8OffsetToUtf16(c[f++]),v=t.convertUtf8OffsetToUtf16(c[f++]);g[x]={start:E,end:v,length:v-E}}return{index:h,captureIndices:g}}}function PI(e){return typeof e.instantiator=="function"}function BI(e){return typeof e.default=="function"}function UI(e){return typeof e.data<"u"}function HI(e){return typeof Response<"u"&&e instanceof Response}function FI(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Af;function zI(e){if(Af)return Af;async function t(){hr=await II(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),PI(r)?r=await r.instantiator(n):BI(r)?r=await r.default(n):(UI(r)&&(r=r.data),HI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await $I(r)(n):r=await VI(r)(n):FI(r)?r=await O0(r)(n):r instanceof WebAssembly.Module?r=await O0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await O0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Af=t(),Af}function O0(e){return t=>WebAssembly.instantiate(e,t)}function $I(e){return t=>WebAssembly.instantiateStreaming(e,t)}function VI(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function GI(e){return e&&await zI(e),{createScanner(t){return new MI(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new qk(t)}}}const qI=kI({langs:Gk,themes:NI,engine:()=>GI(j(()=>import("./wasm-CG6Dc4jp.js"),[]))});function xu(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function YI(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const G1=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),mr=String.raw;function yu(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Yk=mr`\[\^?`,Wk=`c.? | C(?:-.?)?|${mr`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${mr`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${mr`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${mr`o\{[^\}]*\}?`}|${mr`\d{1,3}`}`,q1=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Rf=new RegExp(mr`
|
|
104
|
-
\\ (?:
|
|
105
|
-
${Wk}
|
|
106
|
-
| [gk]<[^>]*>?
|
|
107
|
-
| [gk]'[^']*'?
|
|
108
|
-
| .
|
|
109
|
-
)
|
|
110
|
-
| \( (?:
|
|
111
|
-
\? (?:
|
|
112
|
-
[:=!>({]
|
|
113
|
-
| <[=!]
|
|
114
|
-
| <[^>]*>
|
|
115
|
-
| '[^']*'
|
|
116
|
-
| ~\|?
|
|
117
|
-
| #(?:[^)\\]|\\.?)*
|
|
118
|
-
| [^:)]*[:)]
|
|
119
|
-
)?
|
|
120
|
-
| \*[^\)]*\)?
|
|
121
|
-
)?
|
|
122
|
-
| (?:${q1.source})+
|
|
123
|
-
| ${Yk}
|
|
124
|
-
| .
|
|
125
|
-
`.replace(/\s+/g,""),"gsu"),D0=new RegExp(mr`
|
|
126
|
-
\\ (?:
|
|
127
|
-
${Wk}
|
|
128
|
-
| .
|
|
129
|
-
)
|
|
130
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
131
|
-
| ${Yk}
|
|
132
|
-
| &&
|
|
133
|
-
| .
|
|
134
|
-
`.replace(/\s+/g,""),"gsu");function WI(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=hO(n.flags),i=[r.extended],l={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(g){i.push(g)},replaceCurrentModX(g){i[i.length-1]=g},singleline:n.rules.singleline};let o=[],c;for(Rf.lastIndex=0;c=Rf.exec(e);){const g=QI(l,e,c[0],Rf.lastIndex);g.tokens?o.push(...g.tokens):g.token&&o.push(g.token),g.lastIndex!==void 0&&(Rf.lastIndex=g.lastIndex)}const f=[];let h=0;o.filter(g=>g.type==="GroupOpen").forEach(g=>{g.kind==="capturing"?g.number=++h:g.raw==="("&&f.push(g)}),h||f.forEach((g,x)=>{g.kind="capturing",g.number=x+1});const p=h||f.length;return{tokens:o.map(g=>g.type==="EscapedNumber"?pO(g,p):g).flat(),flags:r}}function QI(e,t,n,r){const[i,l]=n;if(n==="["||n==="[^"){const o=XI(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(l))return{token:a_(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:iO(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Xk(n)}}if(l==="K")return{token:Kk("keep",n)};if(l==="N"||l==="R")return{token:Gl("newline",n,{negate:l==="N"})};if(l==="O")return{token:Gl("any",n)};if(l==="X")return{token:Gl("text_segment",n)};const o=Qk(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(l==="*")return{token:cO(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:uO(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Ko("group",n)};if(n==="(?>")return{token:Ko("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Ko(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Ko("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Ko("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:rO(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
135
|
-
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:Gl("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":mr`\A`,$:mr`\Z`}[n]:n;return{token:a_(o,n)}}return n==="|"?{token:ZI(n)}:q1.test(n)?{tokens:gO(n)}:{token:ii(xu(n),n)}}function XI(e,t,n){const r=[s_(t[1]==="^",t)];let i=1,l;for(D0.lastIndex=n;l=D0.exec(e);){const o=l[0];if(o[0]==="["&&o[1]!==":")i++,r.push(s_(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ii(93,o));else if(i--,r.push(JI(o)),!i)break}else{const c=KI(o);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:D0.lastIndex||e.length}}function KI(e){if(e[0]==="\\")return Qk(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!G1.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Gl("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?eO(e):e==="&&"?tO(e):ii(xu(e),e)}function Qk(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return oO(e);if("dDhHsSwW".includes(n))return dO(e);if(e.startsWith(mr`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return fO(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),l=new TextEncoder;return[...i].map(o=>{const c=[...l.encode(o)].map(f=>`\\x${f.toString(16)}`).join("");return ii(xu(o),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ii(mO(e),e);if(i_.has(n))return ii(i_.get(n),e);if(/\d/.test(n))return nO(t,e);if(e==="\\")throw new Error(mr`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ii(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function ZI(e){return{type:"Alternator",raw:e}}function a_(e,t){return{type:"Assertion",kind:e,raw:t}}function Xk(e){return{type:"Backreference",raw:e}}function ii(e,t){return{type:"Character",value:e,raw:t}}function JI(e){return{type:"CharacterClassClose",raw:e}}function eO(e){return{type:"CharacterClassHyphen",raw:e}}function tO(e){return{type:"CharacterClassIntersector",raw:e}}function s_(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Gl(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Kk(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:yu(n.flags),raw:t}}function nO(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function rO(e){return{type:"GroupClose",raw:e}}function Ko(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function aO(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function sO(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function iO(e){return{type:"Subroutine",raw:e}}const lO=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),i_=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function oO(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return ii(xu(t.toUpperCase())-64,e)}function uO(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),l=o_(n),o=o_(r),c={};if(l&&(c.enable=l),o&&(c.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),Kk("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,Ko("group",e,{...(l||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function cO(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const l=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,c,f]=l,h=lO.has(n)?n.toLowerCase():"custom";switch(h){case"fail":case"mismatch":case"skip":if(l.length>0)throw new Error(`Named callout arguments not allowed "${l}"`);break;case"error":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!l.length||l.length>2)throw new Error(`Named callout must have one or two arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(l.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(l.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(l.length!==3)throw new Error(`Named callout must have three arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${h}"`)}return aO(h,r??null,(i==null?void 0:i.split(","))??null,e)}function l_(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:l}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||l&&+l>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=l===void 0?+i:l===""?1/0:+l,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return sO(t,n,r,e)}function dO(e){const t=e[1].toLowerCase();return Gl({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function fO(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Gl("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function o_(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function hO(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function mO(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function pO(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Xk(n)];const l=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const f=o[c];let h;if(c===0&&f!=="8"&&f!=="9"){if(h=parseInt(f,8),h>127)throw new Error(mr`Octal encoded byte above 177 unsupported "${n}"`)}else h=xu(f);l.push(ii(h,(c===0?"\\":"")+f))}return l}function gO(e){const t=[],n=new RegExp(q1,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const l=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(l){const{min:o,max:c}=l.groups;if(+o>+c&&i.endsWith("?")){n.lastIndex--,t.push(l_(i.slice(0,-1)));continue}}}t.push(l_(i))}return t}function Zk(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function bO(e){return xO.has(e.type)}const xO=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Jk(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=WI(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(x,E)=>{const v=r.tokens[l.nextIndex];switch(l.parent=x,l.nextIndex++,v.type){case"Alternator":return Xl();case"Assertion":return yO(v);case"Backreference":return EO(v,l);case"Character":return Gh(v.value,{useLastValid:!!E.isCheckingRangeEnd});case"CharacterClassHyphen":return _O(v,l,E);case"CharacterClassOpen":return TO(v,l,E);case"CharacterSet":return vO(v,l);case"Directive":return AO(v.kind,{flags:v.flags});case"GroupOpen":return kO(v,l,E);case"NamedCallout":return LO(v.kind,v.tag,v.arguments);case"Quantifier":return wO(v,l);case"Subroutine":return CO(v,l);default:throw new Error(`Unexpected token type "${v.type}"`)}},l={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=OO(RO(r.flags));let c=o.body[0];for(;l.nextIndex<r.tokens.length;){const x=i(c,{});x.type==="Alternative"?(o.body.push(x),c=x):c.body.push(x)}const{capturingGroups:f,hasNumberedRef:h,namedGroupsByName:p,subroutines:g}=l;if(h&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:x}of g)if(typeof x=="number"){if(x>f.length)throw new Error("Subroutine uses a group number that's not defined");x&&(f[x-1].isSubroutined=!0)}else if(p.has(x)){if(p.get(x).length>1)throw new Error(mr`Subroutine uses a duplicate group name "\g<${x}>"`);p.get(x)[0].isSubroutined=!0}else throw new Error(mr`Subroutine uses a group name that's not defined "\g<${x}>"`);return o}function yO({kind:e}){return Mg(yu({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===mr`\B`||e===mr`\Y`})}function EO({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(l,o=!1)=>{const c=t.capturingGroups.length;let f=!1;if(l>c)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Pg(o?c+1-l:l,{orphan:f})};if(n){const l=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(l)return i(+l.groups.num,!!l.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Pg(r)}return i(+r)}function _O(e,t,n){const{tokens:r,walk:i}=t,l=t.parent,o=l.body.at(-1),c=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const f=i(l,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&f.type==="Character")return l.body.pop(),NO(o,f);throw new Error("Invalid character class range")}return Gh(xu("-"))}function TO({negate:e},t,n){const{tokens:r,walk:i}=t,l=r[t.nextIndex],o=[rh()];let c=d_(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(rh()),t.nextIndex++;else{const h=o.at(-1);h.body.push(i(h,n))}c=d_(r[t.nextIndex],l)}const f=rh({negate:e});return o.length===1?f.body=o[0].body:(f.kind="intersection",f.body=o.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,f}function vO({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o}=r;if(e==="property"){const c=qh(n);if(G1.has(c)&&!(o!=null&&o.has(c)))e="posix",n=c;else return Zo(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o})}return e==="posix"?IO(n,{negate:t}):Bg(e,{negate:t})}function kO(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:l,skipLookbehindValidation:o,walk:c}=t,f=DO(e),h=f.type==="AbsenceFunction",p=c_(f),g=p&&f.negate;if(f.type==="CapturingGroup"&&(i.push(f),f.name&&YI(l,f.name,[]).push(f)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let x=f_(r[t.nextIndex]);for(;x.type!=="GroupClose";){if(x.type==="Alternator")f.body.push(Xl()),t.nextIndex++;else{const E=f.body.at(-1),v=c(E,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||g});if(E.body.push(v),(p||n.isInLookbehind)&&!o){const S="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(u_(v)||v.type==="CapturingGroup")throw new Error(S)}else if(u_(v)||c_(v)&&v.negate)throw new Error(S)}}x=f_(r[t.nextIndex])}return t.nextIndex++,f}function wO({kind:e,min:t,max:n},r){const i=r.parent,l=i.body.at(-1);if(!l||!bO(l))throw new Error("Quantifier requires a repeatable token");const o=tw(e,t,n,l);return i.body.pop(),o}function CO({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const l=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(l){const c=+l.groups.num,f=n.length;if(t.hasNumberedRef=!0,i={"":c,"+":f+c,"-":f+1-c}[l.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=nw(i);return r.push(o),o}function SO(e,t){return{type:"AbsenceFunction",kind:e,body:id(t==null?void 0:t.body)}}function Xl(e){return{type:"Alternative",body:rw(e==null?void 0:e.body)}}function Mg(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function Pg(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function ew(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!jO(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:id(t==null?void 0:t.body)}}function Gh(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function rh(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:rw(e==null?void 0:e.body)}}function NO(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Bg(e,t){const n=!!(t!=null&&t.negate),r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function AO(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:yu(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function RO(e){return{type:"Flags",...e}}function ns(e){const t=e==null?void 0:e.atomic,n=e==null?void 0:e.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:id(e==null?void 0:e.body)}}function Fl(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:id(e==null?void 0:e.body)}}function LO(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function IO(e,t){const n=!!(t!=null&&t.negate);if(!G1.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function tw(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function OO(e,t){return{type:"Regex",body:id(t==null?void 0:t.body),flags:e}}function nw(e){return{type:"Subroutine",ref:e}}function Zo(e,t){var i;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=(i=n.unicodePropertyMap)==null?void 0:i.get(qh(e));if(!r){if(n.normalizeUnknownPropertyNames)r=MO(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(mr`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function DO({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return SO("repeater");case"atomic":return ns({atomic:!0});case"capturing":return ew(i,{name:n});case"group":return ns({flags:e});case"lookahead":case"lookbehind":return Fl({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function id(e){if(e===void 0)e=[Xl()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function rw(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function u_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function c_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function jO(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function MO(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function qh(e){return e.replace(/[- _]+/g,"").toLowerCase()}function d_(e,t){return yu(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function f_(e){return yu(e,"Unclosed group")}function Ic(e,t,n=null){function r(l,o){for(let c=0;c<l.length;c++){const f=i(l[c],o,c,l);c=Math.max(-1,c+f)}}function i(l,o=null,c=null,f=null){var w,R;let h=0,p=!1;const g={node:l,parent:o,key:c,container:f,root:e,remove(){Lf(f).splice(Math.max(0,zo(c)+h),1),h--,p=!0},removeAllNextSiblings(){return Lf(f).splice(zo(c)+1)},removeAllPrevSiblings(){const C=zo(c)+h;return h-=C,Lf(f).splice(0,Math.max(0,C))},replaceWith(C,O={}){const Y=!!O.traverse;f?f[Math.max(0,zo(c)+h)]=C:yu(o,"Can't replace root node")[c]=C,Y&&i(C,o,c,f),p=!0},replaceWithMultiple(C,O={}){const Y=!!O.traverse;if(Lf(f).splice(Math.max(0,zo(c)+h),1,...C),h+=C.length-1,Y){let P=0;for(let B=0;B<C.length;B++)P+=i(C[B],o,zo(c)+B+P,f)}p=!0},skip(){p=!0}},{type:x}=l,E=t["*"],v=t[x],S=typeof E=="function"?E:E==null?void 0:E.enter,N=typeof v=="function"?v:v==null?void 0:v.enter;if(S==null||S(g,n),N==null||N(g,n),!p)switch(x){case"AbsenceFunction":case"CapturingGroup":case"Group":r(l.body,l);break;case"Alternative":case"CharacterClass":r(l.body,l);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(l.min,l,"min"),i(l.max,l,"max");break;case"LookaroundAssertion":r(l.body,l);break;case"Quantifier":i(l.body,l,"body");break;case"Regex":r(l.body,l),i(l.flags,l,"flags");break;default:throw new Error(`Unexpected node type "${x}"`)}return(w=v==null?void 0:v.exit)==null||w.call(v,g,n),(R=E==null?void 0:E.exit)==null||R.call(E,g,n),h}return i(e),e}function Lf(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function zo(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const PO=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function BO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function UO(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const za=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Y1(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let o=0,c="";for(const f of e.matchAll(i)){const{0:h,groups:{$skip:p}}=f;if(!p&&(!r||r===za.DEFAULT==!o)){n instanceof Function?c+=n(f,{context:o?za.CHAR_CLASS:za.DEFAULT,negated:l[l.length-1]}):c+=n;continue}h[0]==="["?(o++,l.push(h[1]==="^")):h==="]"&&o&&(o--,l.pop()),c+=h}return c}function aw(e,t,n,r){Y1(e,t,n,r)}function HO(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let l=0,o;for(;o=i.exec(e);){const{0:c,groups:{$skip:f}}=o;if(!f&&(!r||r===za.DEFAULT==!l))return o;c==="["?l++:c==="]"&&l&&l--,i.lastIndex==o.index&&i.lastIndex++}return null}function If(e,t,n){return!!HO(e,t,0,n)}function FO(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,l=1,o;for(;o=n.exec(e);){const[c]=o;if(c==="[")i++;else if(i)c==="]"&&i--;else if(c==="(")l++;else if(c===")"&&(l--,!l)){r=o.index;break}}return e.slice(t,r)}const h_=new RegExp(String.raw`(?<noncapturingStart>${PO})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function zO(e,t){const n=(t==null?void 0:t.hiddenCaptures)??[];let r=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",l="(?:(?=(",o=[0],c=[];let f=0,h=0,p=NaN,g;do{g=!1;let x=0,E=0,v=!1,S;for(h_.lastIndex=Number.isNaN(p)?0:p+l.length;S=h_.exec(e);){const{0:N,index:w,groups:{capturingStart:R,noncapturingStart:C}}=S;if(N==="[")x++;else if(x)N==="]"&&x--;else if(N===i&&!v)p=w,v=!0;else if(v&&C)E++;else if(R)v?E++:(f++,o.push(f+h));else if(N===")"&&v){if(!E){h++;const O=f+h;if(e=`${e.slice(0,p)}${l}${e.slice(p+i.length,w)}))<$$${O}>)${e.slice(w+1)}`,g=!0,c.push(O),BO(n,O),r.size){const Y=new Map;r.forEach((P,B)=>{Y.set(B>=O?B+1:B,P.map(G=>G>=O?G+1:G))}),r=Y}break}E--}}}while(g);return n.push(...c),e=Y1(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:x,groups:{backrefNum:E,wrappedBackrefNum:v}})=>{if(E){const S=+E;if(S>o.length-1)throw new Error(`Backref "${x}" greater than number of captures`);return`\\${o[S]}`}return`\\${v}`},za.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const sw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,j0=new RegExp(String.raw`
|
|
136
|
-
\\(?: \d+
|
|
137
|
-
| c[A-Za-z]
|
|
138
|
-
| [gk]<[^>]+>
|
|
139
|
-
| [pPu]\{[^\}]+\}
|
|
140
|
-
| u[A-Fa-f\d]{4}
|
|
141
|
-
| x[A-Fa-f\d]{2}
|
|
142
|
-
)
|
|
143
|
-
| \((?: \? (?: [:=!>]
|
|
144
|
-
| <(?:[=!]|[^>]+>)
|
|
145
|
-
| [A-Za-z\-]+:
|
|
146
|
-
| \(DEFINE\)
|
|
147
|
-
))?
|
|
148
|
-
| (?<qBase>${sw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
149
|
-
| \\?.
|
|
150
|
-
`.replace(/\s+/g,""),"gsu");function $O(e){if(!new RegExp(`${sw}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",l=0,o;for(j0.lastIndex=0;o=j0.exec(e);){const{0:c,index:f,groups:{qBase:h,qMod:p,invalidQ:g}}=o;if(c==="[")l||(r=f),l++;else if(c==="]")l?l--:r=null;else if(!l)if(p==="+"&&i&&!i.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${c}"`);let x=-1;if(/^\{\d+\}$/.test(h))e=UO(e,f+h.length,p,"");else{if(i===")"||i==="]"){const E=i===")"?n:r;if(E===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,E)}(?>${e.slice(E,f)}${h})${e.slice(f+c.length)}`}else e=`${e.slice(0,f-i.length)}(?>${i}${h})${e.slice(f+c.length)}`;x+=4}j0.lastIndex+=x}else c[0]==="("?t.push(f):c===")"&&(n=t.length?t.pop():null);i=c}return{pattern:e}}const Fa=String.raw,VO=Fa`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Ug=Fa`\(\?R=(?<rDepth>[^\)]+)\)|${VO}`,Yh=Fa`\(\?<(?![=!])(?<captureName>[^>]+)>`,iw=Fa`${Yh}|(?<unnamed>\()(?!\?)`,Pl=new RegExp(Fa`${Yh}|${Ug}|\(\?|\\?.`,"gsu"),M0="Cannot use multiple overlapping recursions";function GO(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Ug,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&If(e,Fa`\(\?\(DEFINE\)`,za.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],o=If(e,Fa`\\[1-9]`,za.DEFAULT),c=new Map,f=[];let h=!1,p=0,g=0,x;for(Pl.lastIndex=0;x=Pl.exec(e);){const{0:E,groups:{captureName:v,rDepth:S,gRNameOrNum:N,gRDepth:w}}=x;if(E==="[")p++;else if(p)E==="]"&&p--;else if(S){if(m_(S),h)throw new Error(M0);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const R=e.slice(0,x.index),C=e.slice(Pl.lastIndex);if(If(C,Ug,za.DEFAULT))throw new Error(M0);const O=+S-1;e=p_(R,C,O,!1,n,l,g),i=b_(i,R,O,l.length,0,g);break}else if(N){m_(w);let R=!1;for(const W of f)if(W.name===N||W.num===+N){if(R=!0,W.hasRecursedWithin)throw new Error(M0);break}if(!R)throw new Error(Fa`Recursive \g cannot be used outside the referenced group "${r==="external"?N:Fa`\g<${N}&R=${w}>`}"`);const C=c.get(N),O=FO(e,C);if(o&&If(O,Fa`${Yh}|\((?!\?)`,za.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const Y=e.slice(C,x.index),P=O.slice(Y.length+E.length),B=l.length,G=+w-1,le=p_(Y,P,G,!0,n,l,g);i=b_(i,Y,G,l.length-B,B,g);const Q=e.slice(0,C),ce=e.slice(C+O.length);e=`${Q}${le}${ce}`,Pl.lastIndex+=le.length-E.length-Y.length-P.length,f.forEach(W=>W.hasRecursedWithin=!0),h=!0}else if(v)g++,c.set(String(g),Pl.lastIndex),c.set(v,Pl.lastIndex),f.push({num:g,name:v});else if(E[0]==="("){const R=E==="(";R&&(g++,c.set(String(g),Pl.lastIndex)),f.push(R?{num:g}:{})}else E===")"&&f.pop()}return n.push(...l),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function m_(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function p_(e,t,n,r,i,l,o){const c=new Set;r&&aw(e+t,Yh,({groups:{captureName:h}})=>{c.add(h)},za.DEFAULT);const f=[n,r?c:null,i,l,o];return`${e}${g_(`(?:${e}`,"forward",...f)}(?:)${g_(`${t})`,"backward",...f)}${t}`}function g_(e,t,n,r,i,l,o){const f=p=>t==="forward"?p+2:n-p+2-1;let h="";for(let p=0;p<n;p++){const g=f(p);h+=Y1(e,Fa`${iw}|\\k<(?<backref>[^>]+)>`,({0:x,groups:{captureName:E,unnamed:v,backref:S}})=>{if(S&&r&&!r.has(S))return x;const N=`_$${g}`;if(v||E){const w=o+l.length+1;return l.push(w),qO(i,w),v?x:`(?<${E}${N}>`}return Fa`\k<${S}${N}>`},za.DEFAULT)}return h}function qO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function b_(e,t,n,r,i,l){if(e.size&&r){let o=0;aw(t,iw,()=>o++,za.DEFAULT);const c=l-o+i,f=new Map;return e.forEach((h,p)=>{const g=(r-o*n)/n,x=o*n,E=p>c+o?p+r:p,v=[];for(const S of h)if(S<=c)v.push(S);else if(S>c+o+g)v.push(S+r);else if(S<=c+o)for(let N=0;N<=n;N++)v.push(S+o*N);else for(let N=0;N<=n;N++)v.push(S+x+g*N);f.set(E,v)}),f}return e}var ir=String.fromCodePoint,Et=String.raw,rs={},Wh=globalThis.RegExp;rs.flagGroups=(()=>{try{new Wh("(?i:)")}catch{return!1}return!0})();rs.unicodeSets=(()=>{try{new Wh("[[]]","v")}catch{return!1}return!0})();rs.bugFlagVLiteralHyphenIsRange=rs.unicodeSets?(()=>{try{new Wh(Et`[\d\-a]`,"v")}catch{return!0}return!1})():!1;rs.bugNestedClassIgnoresNegation=rs.unicodeSets&&new Wh("[[^a]]","v").test("a");function _h(e,{enable:t,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function Qc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Hg(e,t){return x_[e]>=x_[t]}function YO(e,t){if(e==null)throw new Error(t??"Value expected");return e}var x_={ES2025:2025,ES2024:2024,ES2018:2018},WO={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function lw(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!WO[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=rs.flagGroups?"ES2025":rs.unicodeSets?"ES2024":"ES2018"),t}var QO="[ -\r ]",XO=new Set([ir(304),ir(305)]),Js=Et`[\p{L}\p{M}\p{N}\p{Pc}]`;function ow(e){if(XO.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=JO.get(n),l=KO.get(n),o=ZO.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),l&&t.add(l),[...t]}var W1=new Map(`C Other
|
|
151
|
-
Cc Control cntrl
|
|
152
|
-
Cf Format
|
|
153
|
-
Cn Unassigned
|
|
154
|
-
Co Private_Use
|
|
155
|
-
Cs Surrogate
|
|
156
|
-
L Letter
|
|
157
|
-
LC Cased_Letter
|
|
158
|
-
Ll Lowercase_Letter
|
|
159
|
-
Lm Modifier_Letter
|
|
160
|
-
Lo Other_Letter
|
|
161
|
-
Lt Titlecase_Letter
|
|
162
|
-
Lu Uppercase_Letter
|
|
163
|
-
M Mark Combining_Mark
|
|
164
|
-
Mc Spacing_Mark
|
|
165
|
-
Me Enclosing_Mark
|
|
166
|
-
Mn Nonspacing_Mark
|
|
167
|
-
N Number
|
|
168
|
-
Nd Decimal_Number digit
|
|
169
|
-
Nl Letter_Number
|
|
170
|
-
No Other_Number
|
|
171
|
-
P Punctuation punct
|
|
172
|
-
Pc Connector_Punctuation
|
|
173
|
-
Pd Dash_Punctuation
|
|
174
|
-
Pe Close_Punctuation
|
|
175
|
-
Pf Final_Punctuation
|
|
176
|
-
Pi Initial_Punctuation
|
|
177
|
-
Po Other_Punctuation
|
|
178
|
-
Ps Open_Punctuation
|
|
179
|
-
S Symbol
|
|
180
|
-
Sc Currency_Symbol
|
|
181
|
-
Sk Modifier_Symbol
|
|
182
|
-
Sm Math_Symbol
|
|
183
|
-
So Other_Symbol
|
|
184
|
-
Z Separator
|
|
185
|
-
Zl Line_Separator
|
|
186
|
-
Zp Paragraph_Separator
|
|
187
|
-
Zs Space_Separator
|
|
188
|
-
ASCII
|
|
189
|
-
ASCII_Hex_Digit AHex
|
|
190
|
-
Alphabetic Alpha
|
|
191
|
-
Any
|
|
192
|
-
Assigned
|
|
193
|
-
Bidi_Control Bidi_C
|
|
194
|
-
Bidi_Mirrored Bidi_M
|
|
195
|
-
Case_Ignorable CI
|
|
196
|
-
Cased
|
|
197
|
-
Changes_When_Casefolded CWCF
|
|
198
|
-
Changes_When_Casemapped CWCM
|
|
199
|
-
Changes_When_Lowercased CWL
|
|
200
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
201
|
-
Changes_When_Titlecased CWT
|
|
202
|
-
Changes_When_Uppercased CWU
|
|
203
|
-
Dash
|
|
204
|
-
Default_Ignorable_Code_Point DI
|
|
205
|
-
Deprecated Dep
|
|
206
|
-
Diacritic Dia
|
|
207
|
-
Emoji
|
|
208
|
-
Emoji_Component EComp
|
|
209
|
-
Emoji_Modifier EMod
|
|
210
|
-
Emoji_Modifier_Base EBase
|
|
211
|
-
Emoji_Presentation EPres
|
|
212
|
-
Extended_Pictographic ExtPict
|
|
213
|
-
Extender Ext
|
|
214
|
-
Grapheme_Base Gr_Base
|
|
215
|
-
Grapheme_Extend Gr_Ext
|
|
216
|
-
Hex_Digit Hex
|
|
217
|
-
IDS_Binary_Operator IDSB
|
|
218
|
-
IDS_Trinary_Operator IDST
|
|
219
|
-
ID_Continue IDC
|
|
220
|
-
ID_Start IDS
|
|
221
|
-
Ideographic Ideo
|
|
222
|
-
Join_Control Join_C
|
|
223
|
-
Logical_Order_Exception LOE
|
|
224
|
-
Lowercase Lower
|
|
225
|
-
Math
|
|
226
|
-
Noncharacter_Code_Point NChar
|
|
227
|
-
Pattern_Syntax Pat_Syn
|
|
228
|
-
Pattern_White_Space Pat_WS
|
|
229
|
-
Quotation_Mark QMark
|
|
230
|
-
Radical
|
|
231
|
-
Regional_Indicator RI
|
|
232
|
-
Sentence_Terminal STerm
|
|
233
|
-
Soft_Dotted SD
|
|
234
|
-
Terminal_Punctuation Term
|
|
235
|
-
Unified_Ideograph UIdeo
|
|
236
|
-
Uppercase Upper
|
|
237
|
-
Variation_Selector VS
|
|
238
|
-
White_Space space
|
|
239
|
-
XID_Continue XIDC
|
|
240
|
-
XID_Start XIDS`.split(/\s/).map(e=>[qh(e),e])),KO=new Map([["s",ir(383)],[ir(383),"s"]]),ZO=new Map([[ir(223),ir(7838)],[ir(107),ir(8490)],[ir(229),ir(8491)],[ir(969),ir(8486)]]),JO=new Map([qi(453),qi(456),qi(459),qi(498),...P0(8072,8079),...P0(8088,8095),...P0(8104,8111),qi(8124),qi(8140),qi(8188)]),e8=new Map([["alnum",Et`[\p{Alpha}\p{Nd}]`],["alpha",Et`\p{Alpha}`],["ascii",Et`\p{ASCII}`],["blank",Et`[\p{Zs}\t]`],["cntrl",Et`\p{Cc}`],["digit",Et`\p{Nd}`],["graph",Et`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Et`\p{Lower}`],["print",Et`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Et`[\p{P}\p{S}]`],["space",Et`\p{space}`],["upper",Et`\p{Upper}`],["word",Et`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Et`\p{AHex}`]]);function t8(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function qi(e){const t=ir(e);return[t.toLowerCase(),t]}function P0(e,t){return t8(e,t).map(n=>qi(n))}var uw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function n8(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};cw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Hg(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Ic(e,r8,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},l={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Ic(e,a8,l);const o={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return Ic(e,s8,o),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var r8={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const l=ns();l.body[0].body.push(Fl({negate:!0,body:r}),Zo("Any"));const o=ns();o.body[0].body.push(tw("greedy",0,1/0,l)),n(Pn(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(l=>l.kind==="flags");for(let l=n+1;l<t.body.length;l++){const o=t.body[l];Qc(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=fw(t.get(e));if(r){const i=ns({flags:r});i.body[0].body=e.body,e.body=[Pn(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:l,replaceWith:o},c){const{kind:f,negate:h}=e,{asciiWordBoundaries:p,avoidSubclass:g,supportedGNodes:x,wordIsAscii:E}=c;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${h?"Y":"y"}"`);if(f==="line_end")o(Pn(Fl({body:[Xl({body:[Mg("string_end")]}),Xl({body:[Gh(10)]})]}),t));else if(f==="line_start")o(Pn(ei(Et`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(x.has(e))i.flags.sticky=!0,l();else{const v=r[n-1];if(v&&d8(v))o(Pn(Fl({negate:!0}),t));else{if(g)throw new Error(Et`Uses "\G" in a way that requires a subclass`);o(Yi(Mg("string_start"),t)),c.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")o(Pn(ei(Et`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!E&&!p){const v=`(?:(?<=${Js})(?!${Js})|(?<!${Js})(?=${Js}))`,S=`(?:(?<=${Js})(?=${Js})|(?<!${Js})(?!${Js}))`;o(Pn(ei(h?S:v),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!U0(n)&&(n=B0(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!U0(r)&&(r=B0(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=rh({body:[e]});n(Pn(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:l,spaceIsAscii:o,wordIsAscii:c}){const{kind:f,negate:h,value:p}=e;if(l&&(f==="digit"||p==="digit")){n(Yi(Bg("digit",{negate:h}),t));return}if(o&&(f==="space"||p==="space")){n(Pn(H0(ei(QO),h),t));return}if(c&&(f==="word"||p==="word")){n(Yi(Bg("word",{negate:h}),t));return}if(f==="any")n(Yi(Zo("Any"),t));else if(f==="digit")n(Yi(Zo("Nd",{negate:h}),t));else if(f!=="dot")if(f==="text_segment"){if(r==="strict")throw new Error(Et`Use of "\X" requires non-strict accuracy`);const g="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",x=Et`\p{RI}{2}|${g}(?:\u200D${g})*`;n(Pn(ei(Et`(?>\r\n|${i?Et`\p{RGI_Emoji}`:x}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(Yi(Zo("AHex",{negate:h}),t));else if(f==="newline")n(Pn(ei(h?`[^
|
|
241
|
-
]`:`(?>\r
|
|
242
|
-
?|[
|
|
243
|
-
\v\f
\u2028\u2029])`),t));else if(f==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let g={graph:"!-~",print:" -~"}[p];h&&(g=`\0-${ir(g.codePointAt(0)-1)}${ir(g.codePointAt(2)+1)}-`),n(Pn(ei(`[${g}]`),t))}else n(Pn(H0(ei(e8.get(p)),h),t));else if(f==="property")W1.has(qh(p))||(e.key="sc");else if(f==="space")n(Yi(Zo("space",{negate:h}),t));else if(f==="word")n(Pn(H0(ei(Js),h),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:l,removeAllNextSiblings:o}){const{kind:c,flags:f}=e;if(c==="flags")if(!f.enable&&!f.disable)r();else{const h=ns({flags:f});h.body[0].body=o(),i(Pn(h,t),{traverse:!0})}else if(c==="keep"){const h=n.body[0],g=n.body.length===1&&Zk(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(Et`Uses "\K" in a way that's unsupported`);const x=Fl({behind:!0});x.body[0].body=l(),i(Pn(x,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(Pn(Fl({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=ns();t.body[0].body.push(e.body),e.body=Pn(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const l of e.body)if(l.body.length===1&&l.body[0].kind==="search_start")l.body.pop();else{const o=mw(l.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(l=>t.add(l))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Et`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!U0(n)&&(n=B0(n,t),e.ref=n)}},a8={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:l})=>l)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:l,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:f}){const h=i.get(e);if(h&&c.has(e.number)){const g=Yi(y_(e.number),t);f.set(g,c.get(e.number)),n(g);return}c.set(e.number,e),o.set(e.number,[]),e.name&&Qc(o,e.name,[]);const p=o.get(e.name??e.number);for(let g=0;g<p.length;g++){const x=p[g];if(h===x.node||h&&h===x.origin||e===x.origin){p.splice(g,1);break}}if(o.get(e.number).push({node:e,origin:h}),e.name&&o.get(e.name).push({node:e,origin:h}),e.name){const g=Qc(l,e.name,new Map);let x=!1;if(h)x=!0;else for(const E of g.values())if(!E.hasDuplicateNameToRemove){x=!0;break}l.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:x})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=_h(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:l}=e;if(i){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===l||p.number===l)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(l),c=l===0,f=c?y_(0):dw(o,r.groupOriginByCopy,null);let h=f;if(!c){const p=fw(o8(o,x=>x.type==="Group"&&!!x.flags)),g=p?_h(r.globalFlags,p):r.globalFlags;i8(g,r.currentFlags)||(h=ns({flags:u8(g)}),h.body[0].body.push(f))}n(Pn(h,t),{traverse:!c})}},s8={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const l=r.reffedNodesByReferencer.get(e).filter(o=>l8(o,e));if(!l.length)n(Pn(Fl({negate:!0}),t));else if(l.length>1){const o=ns({atomic:!0,body:l.reverse().map(c=>Xl({body:[Pg(c.number)]}))});n(Pn(o,t))}else e.ref=l[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=ew();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function cw(e){Ic(e,{"*"({node:t,parent:n}){t.parent=n}})}function i8(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function l8(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=hw(n.parent);for(const i of r){if(i===n)break;if(i===e||pw(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function dw(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[l,o]of Object.entries(e))l==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[l]=dw(o,t,i,n):(l==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[l]=o);return i}function y_(e){const t=nw(e);return t.isRecursive=!0,t}function o8(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function B0(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function fw(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{var l,o;(l=r.enable)!=null&&l[i]&&(delete n.disable[i],n.enable[i]=!0),(o=r.disable)!=null&&o[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function u8({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function hw(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function mw(e){const t=e.find(n=>n.kind==="search_start"||f8(n,{negate:!1})||!c8(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=mw(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function pw(e,t){const n=hw(e)??[];for(const r of n)if(r===t||pw(r,t))return!0;return!1}function c8({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function d8(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function f8(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Zk(e.body[0],{type:"Assertion",kind:"search_start"})}function U0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function ei(e,t){const r=Jk(e,{...t,unicodePropertyMap:W1}).body;return r.length>1||r[0].body.length>1?ns({body:r}):r[0].body[0]}function H0(e,t){return e.negate=t,e}function Yi(e,t){return e.parent=t,e}function Pn(e,t){return cw(e),e.parent=t,e}function h8(e,t){const n=lw(t),r=Hg(n.target,"ES2024"),i=Hg(n.target,"ES2025"),l=n.rules.recursionLimit;if(!Number.isInteger(l)||l<2||l>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,c=null;if(!i){const E=[e.flags.ignoreCase];Ic(e,m8,{getCurrentModI:()=>E.at(-1),popModI(){E.pop()},pushModI(v){E.push(v)},setHasCasedChar(){E.at(-1)?o=!0:c=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!c)};let h=e;const p={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:r,verbose:n.verbose};function g(E){return p.lastNode=h,h=E,YO(p8[E.type],`Unexpected node type "${E.type}"`)(E,p,g)}const x={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return r||(delete x.options.force.v,x.options.disable.v=!0,x.options.unicodeSetsPlugin=null),x._captureTransfers=new Map,x._hiddenCaptures=[],p.captureMap.forEach((E,v)=>{E.hidden&&x._hiddenCaptures.push(v),E.transferTo&&Qc(x._captureTransfers,E.transferTo,[]).push(v)}),x}var m8={"*":{enter({node:e},t){if(__(e)){const n=t.getCurrentModI();t.pushModI(e.flags?_h({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){__(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Q1(ir(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),gw(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&uw.has(e.value)&&t.setHasCasedChar()}},p8={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Et`\B`:Et`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:l}=e,o={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(o.hidden=!0,l>c.number&&(o.transferTo=c.number)),t.captureMap.set(l,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=ir(e),r=$o(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Q1(n)){const i=ow(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:l}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");rs.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(T_)&&(o=[Gh(45),...o.filter(h=>!T_(h))]);const c=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||rs.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(p.length){const g=ns(),x=g.body[0];return g.parent=l,x.parent=g,o=o.filter(E=>!p.includes(E)),e.body=o,o.length?(e.parent=x,x.body.push(e)):g.body.pop(),p.forEach(E=>{const v=Xl({body:[E]});E.parent=v,v.parent=g,g.body.push(v)}),n(g)}}t.inCharClass=!0;const h=c();return t.inCharClass=!1,h}const f=o[0];if(r==="union"&&!i&&f&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(rs.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&o.length===1&&f.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&l.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},l=$o(n,i),o=$o(r,i),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=gw(e);E8(f).forEach(p=>{c.add(Array.isArray(p)?`${$o(p[0],i)}-${$o(p[1],i)}`:$o(p,i))})}return`${l}-${o}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Et`[^\n]`;if(e==="digit")return t?Et`\D`:Et`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&uw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Et`\P`:Et`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Et`\W`:Et`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,l){const o=i.currentFlags;n&&(i.currentFlags=_h(o,n));const c=t.map(l).join("|"),f=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?c:`(?${_8(e,n,i.useFlagMods)}${c})`;return i.currentFlags=o,f},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+T8(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Et`\g<${t}&R=${r}>`}},g8=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),b8=new Set(["-","\\","]","^","["]),x8=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),E_=new Map([[9,Et`\t`],[10,Et`\n`],[11,Et`\v`],[12,Et`\f`],[13,Et`\r`],[8232,Et`\u2028`],[8233,Et`\u2029`],[65279,Et`\uFEFF`]]),y8=new RegExp("^\\p{Cased}$","u");function Q1(e){return y8.test(e)}function gw(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,i=e.max.value,l=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return l;for(let o=r;o<=i;o++){const c=ir(o);if(!Q1(c))continue;const f=ow(c).filter(h=>{const p=h.codePointAt(0);return p<r||p>i});if(f.length&&(l.push(...f),n))break}return l}function $o(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(E_.has(e))return E_.get(e);if(e<32||e>126&&e<160||e>262143||t&&v8(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?x8:b8:g8,l=ir(e);return(i.has(l)?"\\":"")+l}function E8(e){const t=e.map(i=>i.codePointAt(0)).sort((i,l)=>i-l),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??(r=t[i]):r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function _8(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:l}=t;r=(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")+(l?"-":"")+(l!=null&&l.ignoreCase?"i":"")+(l!=null&&l.dotAll?"s":"")}return`${r}:`}function T8({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function __({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function v8(e){return e>47&&e<58}function T_({type:e,value:t}){return e==="Character"&&t===45}var Zi,ri,Yl,Ji,Wl,ed,Fg,nl,k8=(nl=class extends RegExp{constructor(n,r,i){var t=(...fW)=>(super(...fW),Ol(this,ed),Ol(this,Zi,new Map),Ol(this,ri,null),Ol(this,Yl),Ol(this,Ji,null),Ol(this,Wl,null),de(this,"rawOptions",{}),this);const l=!!(i!=null&&i.lazyCompile);if(n instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=n;t(o,r),es(this,Yl,o.source),o instanceof nl&&(es(this,Zi,Pr(o,Zi)),es(this,Ji,Pr(o,Ji)),es(this,Wl,Pr(o,Wl)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(l?"":n,r),es(this,Yl,n),es(this,Zi,C8(o.hiddenCaptures,o.transfers)),es(this,Wl,o.strategy),this.rawOptions=i??{}}l||es(this,ri,this)}get source(){return Pr(this,Yl)||"(?:)"}exec(n){if(!Pr(this,ri)){const{lazyCompile:l,...o}=this.rawOptions;es(this,ri,new nl(Pr(this,Yl),this.flags,o))}const r=this.global||this.sticky,i=this.lastIndex;if(Pr(this,Wl)==="clip_search"&&r&&i){this.lastIndex=0;const l=l0(this,ed,Fg).call(this,n.slice(i));return l&&(w8(l,i,n,this.hasIndices),this.lastIndex+=i),l}return l0(this,ed,Fg).call(this,n)}},Zi=new WeakMap,ri=new WeakMap,Yl=new WeakMap,Ji=new WeakMap,Wl=new WeakMap,ed=new WeakSet,Fg=function(n){Pr(this,ri).lastIndex=this.lastIndex;const r=KE(nl.prototype,this,"exec").call(Pr(this,ri),n);if(this.lastIndex=Pr(this,ri).lastIndex,!r||!Pr(this,Zi).size)return r;const i=[...r];r.length=1;let l;this.hasIndices&&(l=[...r.indices],r.indices.length=1);const o=[0];for(let c=1;c<i.length;c++){const{hidden:f,transferTo:h}=Pr(this,Zi).get(c)??{};if(f?o.push(null):(o.push(r.length),r.push(i[c]),this.hasIndices&&r.indices.push(l[c])),h&&i[c]!==void 0){const p=o[h];if(!p)throw new Error(`Invalid capture transfer to "${p}"`);if(r[p]=i[c],this.hasIndices&&(r.indices[p]=l[c]),r.groups){Pr(this,Ji)||es(this,Ji,S8(this.source));const g=Pr(this,Ji).get(h);g&&(r.groups[g]=i[c],this.hasIndices&&(r.indices.groups[g]=l[c]))}}}return r},nl);function w8(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const c=i[o];c&&(i[o]=[c[0]+t,c[1]+t])}const l=i.groups;l&&Object.keys(l).forEach(o=>{const c=l[o];c&&(l[o]=[c[0]+t,c[1]+t])})}}function C8(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const l of i)Qc(n,l,{}).transferTo=r;return n}function S8(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,l;for(;l=t.exec(e);){const{0:o,groups:{capture:c,name:f}}=l;o==="["?r++:r?o==="]"&&r--:c&&(i++,f&&n.set(i,f))}return n}function N8(e,t){const n=A8(e,t);return n.options?new k8(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function A8(e,t){const n=lw(t),r=Jk(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:W1}),i=n8(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=h8(i,n),o=GO(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),c=$O(o.pattern),f=zO(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),h={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${l.flags}${l.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=f.hiddenCaptures.sort((v,S)=>v-S),g=Array.from(f.captureTransfers),x=i._strategy,E=h.pattern.length>=n.lazyCompileLength;(p.length||g.length||x||E)&&(h.options={...p.length&&{hiddenCaptures:p},...g.length&&{transfers:g},...x&&{strategy:x},...E&&{lazyCompile:E}})}return h}const v_=4294967295;class R8{constructor(t,n={}){de(this,"regexps");this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:l}=n;if(!l)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const c=i==null?void 0:i.get(o);if(c){if(c instanceof RegExp)return c;if(r)return null;throw c}try{const f=l(o);return i==null||i.set(o,f),f}catch(f){if(i==null||i.set(o,f),r)return null;throw f}})}findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,l=[];function o(c,f,h=0){return{index:c,captureIndices:f.indices.map(p=>p==null?{start:v_,end:v_,length:0}:{start:p[0]+h,end:p[1]+h,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const f=this.regexps[c];if(f)try{f.lastIndex=n;const h=f.exec(i);if(!h)continue;if(h.index===n)return o(c,h,0);l.push([c,h,0])}catch(h){if(this.options.forgiving)continue;throw h}}if(l.length){const c=Math.min(...l.map(f=>f[1].index));for(const[f,h,p]of l)if(h.index===c)return o(f,h,p)}return null}}function L8(e,t){return N8(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function I8(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>L8(n,{target:t.target})),{createScanner(n){return new R8(n,t)},createString(n){return{content:n}}}}var O8=I8({forgiving:!0}),D8=Object.fromEntries($1.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(n=>[n,e.id])})),ah=new Set(Object.keys(Gk)),k_=e=>{let t=e.trim().toLowerCase();return D8[t]||(ah.has(t),t)},F0=new Map,z0=new Map,Vo=new Map,Th=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},j8=(e,t)=>`${e}-${Th(t[0])}-${Th(t[1])}`,M8=(e,t,n)=>{let r=e.slice(0,100),i=e.length>100?e.slice(-100):"";return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${i}`},P8=(e,t)=>{let n=j8(e,t);if(F0.has(n))return F0.get(n);let r=qI({themes:t,langs:[e],engine:O8});return F0.set(n,r),r};function B8(e={}){var t;let n=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(r){let i=k_(r);return ah.has(i)},getSupportedLanguages(){return Array.from(ah)},getThemes(){return n},highlight({code:r,language:i,themes:l},o){let c=k_(i),f=[Th(l[0]),Th(l[1])],h=M8(r,c,f);if(z0.has(h))return z0.get(h);o&&(Vo.has(h)||Vo.set(h,new Set),Vo.get(h).add(o));let p=ah.has(c)?c:"text";return P8(p,l).then(g=>{let x=g.getLoadedLanguages().includes(c)?c:"text",E=g.codeToTokens(r,{lang:x,themes:{light:f[0],dark:f[1]}});z0.set(h,E);let v=Vo.get(h);if(v){for(let S of v)S(E);Vo.delete(h)}}).catch(g=>{console.error("[Streamdown Code] Failed to highlight code:",g),Vo.delete(h)}),null}}}var U8=B8();const Qh=(function(e){if(e==null)return $8;if(typeof e=="function")return Xh(e);if(typeof e=="object")return Array.isArray(e)?H8(e):F8(e);if(typeof e=="string")return z8(e);throw new Error("Expected function, string, or object as test")});function H8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qh(e[n]);return Xh(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function F8(e){const t=e;return Xh(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function z8(e){return Xh(t);function t(n){return n&&n.type===e}}function Xh(e){return t;function t(n,r,i){return!!(V8(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function $8(){return!0}function V8(e){return e!==null&&typeof e=="object"&&"type"in e}const bw=[],Cc=!0,zg=!1,tu="skip";function X1(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=Qh(i),o=r?-1:1;c(e,void 0,[])();function c(f,h,p){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(E?"<"+E+">":""))+")"})}return x;function x(){let E=bw,v,S,N;if((!t||l(f,h,p[p.length-1]||void 0))&&(E=G8(n(f,p)),E[0]===zg))return E;if("children"in f&&f.children){const w=f;if(w.children&&E[0]!==tu)for(S=(r?w.children.length:-1)+o,N=p.concat(w);S>-1&&S<w.children.length;){const R=w.children[S];if(v=c(R,S,N)(),v[0]===zg)return v;S=typeof v[1]=="number"?v[1]:S+o}}return E}}}function G8(e){return Array.isArray(e)?e:typeof e=="number"?[Cc,e]:e==null?bw:[e]}function vs(e,t,n,r){let i,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,i=n):(l=t,o=n,i=r),X1(e,l,c,i);function c(f,h){const p=h[h.length-1],g=p?p.children.indexOf(f):void 0;return o(f,g,p)}}const ou={indicator:"indicator",textOnly:"text-only",remove:"remove"};function q8({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:l="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500",linkBlockPolicy:c=ou.indicator,imageBlockPolicy:f=ou.indicator}){const h=t.length&&!t.every(g=>g==="*"),p=n.length&&!n.every(g=>g==="*");if(!e&&(h||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return g=>{const x=Z8(e,t,n,r,i,l,o,c,f);xw(g),vs(g,x)}}function w_(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function Y8(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const W8=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),Q8=new Set(["javascript:","data:","file:","vbscript:"]);function C_(e,t,n,r=!1,i=!1,l=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const o=w_(e,n);if(!o||Q8.has(o.protocol)||!(W8.has(o.protocol)||l.includes(o.protocol)||l.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const f=Y8(e);return o&&t.some(h=>{const p=w_(h,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?f?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:f?o.pathname+o.search+o.hash:o.href:null}function xw(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)xw(t)}}const $0=Symbol("node-seen");function X8(e,t,n){return t===ou.remove?{type:"remove"}:t===ou.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function K8(e,t,n){if(t===ou.remove)return{type:"remove"};if(t===ou.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const Z8=(e,t,n,r,i,l,o,c,f)=>{const h=(p,g,x)=>{if(p.type!=="element"||p[$0])return Cc;if(p.tagName==="a"){const E=C_(p.properties.href,t,e,!1,!1,i);if(E===null){if(p[$0]=!0,vs(p,h),x&&typeof g=="number"){const v=X8(p,c,o);if(v.type==="remove")return x.children.splice(g,1),[tu,g];x.children[g]=v.element}return tu}else return p.properties.href=E,p.properties.target="_blank",p.properties.rel="noopener noreferrer",Cc}if(p.tagName==="img"){const E=C_(p.properties.src,n,e,r,!0,i);if(E===null){if(p[$0]=!0,vs(p,h),x&&typeof g=="number"){const v=K8(p,f,l);if(v.type==="remove")return x.children.splice(g,1),[tu,g];x.children[g]=v.element}return tu}else return p.properties.src=E,Cc}return Cc};return h},yw=-1,Kh=0,Oc=1,vh=2,K1=3,Z1=4,J1=5,eb=6,Ew=7,_w=8,S_=typeof self=="object"?self:globalThis,J8=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=t[i];switch(l){case Kh:case yw:return n(o,i);case Oc:{const c=n([],i);for(const f of o)c.push(r(f));return c}case vh:{const c=n({},i);for(const[f,h]of o)c[r(f)]=r(h);return c}case K1:return n(new Date(o),i);case Z1:{const{source:c,flags:f}=o;return n(new RegExp(c,f),i)}case J1:{const c=n(new Map,i);for(const[f,h]of o)c.set(r(f),r(h));return c}case eb:{const c=n(new Set,i);for(const f of o)c.add(r(f));return c}case Ew:{const{name:c,message:f}=o;return n(new S_[c](f),i)}case _w:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new S_[l](o),i)};return r},N_=e=>J8(new Map,e)(0),Go="",{toString:eD}={},{keys:tD}=Object,pc=e=>{const t=typeof e;if(t!=="object"||!e)return[Kh,t];const n=eD.call(e).slice(8,-1);switch(n){case"Array":return[Oc,Go];case"Object":return[vh,Go];case"Date":return[K1,Go];case"RegExp":return[Z1,Go];case"Map":return[J1,Go];case"Set":return[eb,Go];case"DataView":return[Oc,n]}return n.includes("Array")?[Oc,n]:n.includes("Error")?[Ew,n]:[vh,n]},Of=([e,t])=>e===Kh&&(t==="function"||t==="symbol"),nD=(e,t,n,r)=>{const i=(o,c)=>{const f=r.push(o)-1;return n.set(c,f),f},l=o=>{if(n.has(o))return n.get(o);let[c,f]=pc(o);switch(c){case Kh:{let p=o;switch(f){case"bigint":c=_w,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yw],o)}return i([c,p],o)}case Oc:{if(f){let x=o;return f==="DataView"?x=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(o)),i([f,[...x]],o)}const p=[],g=i([c,p],o);for(const x of o)p.push(l(x));return g}case vh:{if(f)switch(f){case"BigInt":return i([f,o.toString()],o);case"Boolean":case"Number":case"String":return i([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const p=[],g=i([c,p],o);for(const x of tD(o))(e||!Of(pc(o[x])))&&p.push([l(x),l(o[x])]);return g}case K1:return i([c,o.toISOString()],o);case Z1:{const{source:p,flags:g}=o;return i([c,{source:p,flags:g}],o)}case J1:{const p=[],g=i([c,p],o);for(const[x,E]of o)(e||!(Of(pc(x))||Of(pc(E))))&&p.push([l(x),l(E)]);return g}case eb:{const p=[],g=i([c,p],o);for(const x of o)(e||!Of(pc(x)))&&p.push(l(x));return g}}const{message:h}=o;return i([c,{name:f,message:h}],o)};return l},A_=(e,{json:t,lossy:n}={})=>{const r=[];return nD(!(t||n),!!t,new Map,r)(e),r},Kl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?N_(A_(e,t)):structuredClone(e):(e,t)=>N_(A_(e,t));const R_=/[#.]/g;function rD(e,t){const n=e||"",r={};let i=0,l,o;for(;i<n.length;){R_.lastIndex=i;const c=R_.exec(n),f=n.slice(i,c?c.index:n.length);f&&(l?l==="#"?r.id=f:Array.isArray(r.className)?r.className.push(f):r.className=[f]:o=f,i+=f.length),c&&(l=c[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function Tw(e,t,n){const r=n?lD(n):void 0;function i(l,o,...c){let f;if(l==null){f={type:"root",children:[]};const h=o;c.unshift(h)}else{f=rD(l,t);const h=f.tagName.toLowerCase(),p=r?r.get(h):void 0;if(f.tagName=p||h,aD(o))c.unshift(o);else for(const[g,x]of Object.entries(o))sD(e,f.properties,g,x)}for(const h of c)$g(f.children,h);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return i}function aD(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const l=i;for(const o of l)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function sD(e,t,n,r){const i=sd(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?i.spaceSeparated?l=W2(r):i.commaSeparated?l=Y2(r):i.commaOrSpaceSeparated?l=W2(Y2(r).join(" ")):l=L_(i,i.property,r):Array.isArray(r)?l=[...r]:l=i.property==="style"?iD(r):String(r);if(Array.isArray(l)){const o=[];for(const c of l)o.push(L_(i,i.property,c));l=o}i.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[i.property]=l}}function $g(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)$g(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?$g(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function L_(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Yc(n)===Yc(t)))return!0}return n}function iD(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function lD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const oD=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],uD=Tw(gu,"div"),cD=Tw(ks,"g",oD);function dD(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(l){if(typeof l=="number"&&l>-1&&l<=t.length){let o=0;for(;;){let c=n[o];if(c===void 0){const f=I_(t,n[o-1]);c=f===-1?t.length+1:f+1,n[o]=c}if(c>l)return{line:o+1,column:l-(o>0?n[o-1]:0)+1,offset:l};o++}}}function i(l){if(l&&typeof l.line=="number"&&typeof l.column=="number"&&!Number.isNaN(l.line)&&!Number.isNaN(l.column)){for(;n.length<l.line;){const c=n[n.length-1],f=I_(t,c),h=f===-1?t.length+1:f+1;if(c===h)break;n.push(h)}const o=(l.line>1?n[l.line-2]:0)+l.column-1;if(o<n[l.line-1])return o}}}function I_(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
244
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ql={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},vw={}.hasOwnProperty,fD=Object.prototype;function hD(e,t){const n=t||{};return tb({file:n.file||void 0,location:!1,schema:n.space==="svg"?ks:gu,verbose:n.verbose||!1},e)}function tb(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},sh(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:kw(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const l=String(e.file),o=dD(l),c=o.toPoint(0),f=o.toPoint(l.length);n.position={start:c,end:f}}return n}case"#documentType":{const r=t;return n={type:"doctype"},sh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},sh(e,r,n),n}default:return n=mD(e,t),n}}function kw(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=tb(e,t[n]);r.push(i)}return r}function mD(e,t){const n=e.schema;e.schema=t.namespaceURI===ql.svg?ks:gu;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],f=(c.prefix?c.prefix+":":"")+c.name;vw.call(fD,f)||(i[f]=c.value)}const o=(e.schema.space==="svg"?cD:uD)(t.tagName,i,kw(e,t.childNodes));if(sh(e,t,o),o.tagName==="template"){const c=t,f=c.sourceCodeLocation,h=f&&f.startTag&&nu(f.startTag),p=f&&f.endTag&&nu(f.endTag),g=tb(e,c.content);h&&p&&e.file&&(g.position={start:h.end,end:p.start}),o.content=g}return e.schema=n,o}function sh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=pD(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function pD(e,t,n){const r=nu(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const l={};let o;if(n.attrs)for(o in n.attrs)vw.call(n.attrs,o)&&(l[sd(e.schema,o).property]=nu(n.attrs[o]));n.startTag;const c=nu(n.startTag),f=n.endTag?nu(n.endTag):void 0,h={opening:c};f&&(h.closing=f),h.properties=l,t.data={position:h}}}return r}function nu(e){const t=O_({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=O_({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function O_(e){return e.line&&e.column?e:void 0}const gD={},bD={}.hasOwnProperty,ww=O1("type",{handlers:{root:yD,element:kD,text:TD,comment:vD,doctype:_D}});function xD(e,t){const r=(t||gD).space;return ww(e,r==="svg"?ks:gu)}function yD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=nb(e.children,n,t),Eu(e,n),n}function ED(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=nb(e.children,n,t),Eu(e,n),n}function _D(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Eu(e,t),t}function TD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Eu(e,t),t}function vD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Eu(e,t),t}function kD(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ks);const i=[];let l;if(e.properties){for(l in e.properties)if(l!=="children"&&bD.call(e.properties,l)){const f=wD(r,l,e.properties[l]);f&&i.push(f)}}const o=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:ql[o],childNodes:[],parentNode:null};return c.childNodes=nb(e.children,c,r),Eu(e,c),e.tagName==="template"&&e.content&&(c.content=ED(e.content,r)),c}function wD(e,t,n){const r=sd(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?D1(n):j1(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const l=i.name.indexOf(":");l<0?i.prefix="":(i.name=i.name.slice(l+1),i.prefix=r.attribute.slice(0,l)),i.namespace=ql[r.space]}return i}function nb(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const l=ww(e[r],n);l.parentNode=t,i.push(l)}return i}function Eu(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const CD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Cn="�";var M;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(M||(M={}));const Xr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Cw(e){return e>=55296&&e<=57343}function SD(e){return e>=56320&&e<=57343}function ND(e,t){return(e-55296)*1024+9216+t}function Sw(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Nw(e){return e>=64976&&e<=65007||CD.has(e)}var pe;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(pe||(pe={}));const AD=65536;class RD{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=AD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:l}=this,o=i+n,c=l+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(SD(n))return this.pos++,this._addGap(),ND(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,M.EOF;return this._err(pe.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,M.EOF;const r=this.html.charCodeAt(n);return r===M.CARRIAGE_RETURN?M.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,M.EOF;let t=this.html.charCodeAt(this.pos);return t===M.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,M.LINE_FEED):t===M.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Cw(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===M.LINE_FEED||t===M.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Sw(t)?this._err(pe.controlCharacterInInputStream):Nw(t)&&this._err(pe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var It;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(It||(It={}));function Aw(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const LD=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ID=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function OD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ID.get(e))!==null&&t!==void 0?t:e}var pr;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(pr||(pr={}));const DD=32;var el;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(el||(el={}));function Vg(e){return e>=pr.ZERO&&e<=pr.NINE}function jD(e){return e>=pr.UPPER_A&&e<=pr.UPPER_F||e>=pr.LOWER_A&&e<=pr.LOWER_F}function MD(e){return e>=pr.UPPER_A&&e<=pr.UPPER_Z||e>=pr.LOWER_A&&e<=pr.LOWER_Z||Vg(e)}function PD(e){return e===pr.EQUALS||MD(e)}var fr;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(fr||(fr={}));var ai;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ai||(ai={}));class BD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=fr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ai.Strict}startEntity(t){this.decodeMode=t,this.state=fr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case fr.EntityStart:return t.charCodeAt(n)===pr.NUM?(this.state=fr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=fr.NamedEntity,this.stateNamedEntity(t,n));case fr.NumericStart:return this.stateNumericStart(t,n);case fr.NumericDecimal:return this.stateNumericDecimal(t,n);case fr.NumericHex:return this.stateNumericHex(t,n);case fr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|DD)===pr.LOWER_X?(this.state=fr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=fr.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const l=r-n;this.result=this.result*Math.pow(i,l)+Number.parseInt(t.substr(n,l),i),this.consumed+=l}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Vg(i)||jD(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Vg(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===pr.SEMI)this.consumed+=1;else if(this.decodeMode===ai.Strict)return 0;return this.emitCodePoint(OD(this.result),this.consumed),this.errors&&(t!==pr.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],l=(i&el.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=UD(r,i,this.treeIndex+Math.max(1,l),o),this.treeIndex<0)return this.result===0||this.decodeMode===ai.Attribute&&(l===0||PD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],l=(i&el.VALUE_LENGTH)>>14,l!==0){if(o===pr.SEMI)return this.emitNamedEntityData(this.treeIndex,l,this.consumed+this.excess);this.decodeMode!==ai.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&el.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~el.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case fr.NamedEntity:return this.result!==0&&(this.decodeMode!==ai.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fr.NumericDecimal:return this.emitNumericEntity(0,2);case fr.NumericHex:return this.emitNumericEntity(0,3);case fr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fr.EntityStart:return 0}}}function UD(e,t,n,r){const i=(t&el.BRANCH_LENGTH)>>7,l=t&el.JUMP_TABLE;if(i===0)return l!==0&&r===l?n:-1;if(l){const f=r-l;return f<0||f>=i?-1:e[n+f]-1}let o=n,c=o+i-1;for(;o<=c;){const f=o+c>>>1,h=e[f];if(h<r)o=f+1;else if(h>r)c=f-1;else return e[f+i]}return-1}var ke;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ke||(ke={}));var Ql;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ql||(Ql={}));var Pa;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Pa||(Pa={}));var ne;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(ne||(ne={}));var _;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(_||(_={}));const HD=new Map([[ne.A,_.A],[ne.ADDRESS,_.ADDRESS],[ne.ANNOTATION_XML,_.ANNOTATION_XML],[ne.APPLET,_.APPLET],[ne.AREA,_.AREA],[ne.ARTICLE,_.ARTICLE],[ne.ASIDE,_.ASIDE],[ne.B,_.B],[ne.BASE,_.BASE],[ne.BASEFONT,_.BASEFONT],[ne.BGSOUND,_.BGSOUND],[ne.BIG,_.BIG],[ne.BLOCKQUOTE,_.BLOCKQUOTE],[ne.BODY,_.BODY],[ne.BR,_.BR],[ne.BUTTON,_.BUTTON],[ne.CAPTION,_.CAPTION],[ne.CENTER,_.CENTER],[ne.CODE,_.CODE],[ne.COL,_.COL],[ne.COLGROUP,_.COLGROUP],[ne.DD,_.DD],[ne.DESC,_.DESC],[ne.DETAILS,_.DETAILS],[ne.DIALOG,_.DIALOG],[ne.DIR,_.DIR],[ne.DIV,_.DIV],[ne.DL,_.DL],[ne.DT,_.DT],[ne.EM,_.EM],[ne.EMBED,_.EMBED],[ne.FIELDSET,_.FIELDSET],[ne.FIGCAPTION,_.FIGCAPTION],[ne.FIGURE,_.FIGURE],[ne.FONT,_.FONT],[ne.FOOTER,_.FOOTER],[ne.FOREIGN_OBJECT,_.FOREIGN_OBJECT],[ne.FORM,_.FORM],[ne.FRAME,_.FRAME],[ne.FRAMESET,_.FRAMESET],[ne.H1,_.H1],[ne.H2,_.H2],[ne.H3,_.H3],[ne.H4,_.H4],[ne.H5,_.H5],[ne.H6,_.H6],[ne.HEAD,_.HEAD],[ne.HEADER,_.HEADER],[ne.HGROUP,_.HGROUP],[ne.HR,_.HR],[ne.HTML,_.HTML],[ne.I,_.I],[ne.IMG,_.IMG],[ne.IMAGE,_.IMAGE],[ne.INPUT,_.INPUT],[ne.IFRAME,_.IFRAME],[ne.KEYGEN,_.KEYGEN],[ne.LABEL,_.LABEL],[ne.LI,_.LI],[ne.LINK,_.LINK],[ne.LISTING,_.LISTING],[ne.MAIN,_.MAIN],[ne.MALIGNMARK,_.MALIGNMARK],[ne.MARQUEE,_.MARQUEE],[ne.MATH,_.MATH],[ne.MENU,_.MENU],[ne.META,_.META],[ne.MGLYPH,_.MGLYPH],[ne.MI,_.MI],[ne.MO,_.MO],[ne.MN,_.MN],[ne.MS,_.MS],[ne.MTEXT,_.MTEXT],[ne.NAV,_.NAV],[ne.NOBR,_.NOBR],[ne.NOFRAMES,_.NOFRAMES],[ne.NOEMBED,_.NOEMBED],[ne.NOSCRIPT,_.NOSCRIPT],[ne.OBJECT,_.OBJECT],[ne.OL,_.OL],[ne.OPTGROUP,_.OPTGROUP],[ne.OPTION,_.OPTION],[ne.P,_.P],[ne.PARAM,_.PARAM],[ne.PLAINTEXT,_.PLAINTEXT],[ne.PRE,_.PRE],[ne.RB,_.RB],[ne.RP,_.RP],[ne.RT,_.RT],[ne.RTC,_.RTC],[ne.RUBY,_.RUBY],[ne.S,_.S],[ne.SCRIPT,_.SCRIPT],[ne.SEARCH,_.SEARCH],[ne.SECTION,_.SECTION],[ne.SELECT,_.SELECT],[ne.SOURCE,_.SOURCE],[ne.SMALL,_.SMALL],[ne.SPAN,_.SPAN],[ne.STRIKE,_.STRIKE],[ne.STRONG,_.STRONG],[ne.STYLE,_.STYLE],[ne.SUB,_.SUB],[ne.SUMMARY,_.SUMMARY],[ne.SUP,_.SUP],[ne.TABLE,_.TABLE],[ne.TBODY,_.TBODY],[ne.TEMPLATE,_.TEMPLATE],[ne.TEXTAREA,_.TEXTAREA],[ne.TFOOT,_.TFOOT],[ne.TD,_.TD],[ne.TH,_.TH],[ne.THEAD,_.THEAD],[ne.TITLE,_.TITLE],[ne.TR,_.TR],[ne.TRACK,_.TRACK],[ne.TT,_.TT],[ne.U,_.U],[ne.UL,_.UL],[ne.SVG,_.SVG],[ne.VAR,_.VAR],[ne.WBR,_.WBR],[ne.XMP,_.XMP]]);function _u(e){var t;return(t=HD.get(e))!==null&&t!==void 0?t:_.UNKNOWN}const Ae=_,FD={[ke.HTML]:new Set([Ae.ADDRESS,Ae.APPLET,Ae.AREA,Ae.ARTICLE,Ae.ASIDE,Ae.BASE,Ae.BASEFONT,Ae.BGSOUND,Ae.BLOCKQUOTE,Ae.BODY,Ae.BR,Ae.BUTTON,Ae.CAPTION,Ae.CENTER,Ae.COL,Ae.COLGROUP,Ae.DD,Ae.DETAILS,Ae.DIR,Ae.DIV,Ae.DL,Ae.DT,Ae.EMBED,Ae.FIELDSET,Ae.FIGCAPTION,Ae.FIGURE,Ae.FOOTER,Ae.FORM,Ae.FRAME,Ae.FRAMESET,Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6,Ae.HEAD,Ae.HEADER,Ae.HGROUP,Ae.HR,Ae.HTML,Ae.IFRAME,Ae.IMG,Ae.INPUT,Ae.LI,Ae.LINK,Ae.LISTING,Ae.MAIN,Ae.MARQUEE,Ae.MENU,Ae.META,Ae.NAV,Ae.NOEMBED,Ae.NOFRAMES,Ae.NOSCRIPT,Ae.OBJECT,Ae.OL,Ae.P,Ae.PARAM,Ae.PLAINTEXT,Ae.PRE,Ae.SCRIPT,Ae.SECTION,Ae.SELECT,Ae.SOURCE,Ae.STYLE,Ae.SUMMARY,Ae.TABLE,Ae.TBODY,Ae.TD,Ae.TEMPLATE,Ae.TEXTAREA,Ae.TFOOT,Ae.TH,Ae.THEAD,Ae.TITLE,Ae.TR,Ae.TRACK,Ae.UL,Ae.WBR,Ae.XMP]),[ke.MATHML]:new Set([Ae.MI,Ae.MO,Ae.MN,Ae.MS,Ae.MTEXT,Ae.ANNOTATION_XML]),[ke.SVG]:new Set([Ae.TITLE,Ae.FOREIGN_OBJECT,Ae.DESC]),[ke.XLINK]:new Set,[ke.XML]:new Set,[ke.XMLNS]:new Set},Gg=new Set([Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var U;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(U||(U={}));const Bn={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function zD(e){return e>=M.DIGIT_0&&e<=M.DIGIT_9}function Sc(e){return e>=M.LATIN_CAPITAL_A&&e<=M.LATIN_CAPITAL_Z}function $D(e){return e>=M.LATIN_SMALL_A&&e<=M.LATIN_SMALL_Z}function Wi(e){return $D(e)||Sc(e)}function D_(e){return Wi(e)||zD(e)}function Df(e){return e+32}function Rw(e){return e===M.SPACE||e===M.LINE_FEED||e===M.TABULATION||e===M.FORM_FEED}function j_(e){return Rw(e)||e===M.SOLIDUS||e===M.GREATER_THAN_SIGN}function VD(e){return e===M.NULL?pe.nullCharacterReference:e>1114111?pe.characterReferenceOutsideUnicodeRange:Cw(e)?pe.surrogateCharacterReference:Nw(e)?pe.noncharacterCharacterReference:Sw(e)||e===M.CARRIAGE_RETURN?pe.controlCharacterReference:null}class GD{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new RD(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new BD(LD,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(pe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(pe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=VD(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:It.START_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:It.END_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:It.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:It.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Aw(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(pe.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=_u(t.tagName),t.type===It.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(pe.endTagWithAttributes),t.selfClosing&&this._err(pe.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case It.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case It.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case It.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:It.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Rw(t)?It.WHITESPACE_CHARACTER:t===M.NULL?It.NULL_CHARACTER:It.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(It.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ai.Attribute:ai.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case U.DATA:{this._stateData(t);break}case U.RCDATA:{this._stateRcdata(t);break}case U.RAWTEXT:{this._stateRawtext(t);break}case U.SCRIPT_DATA:{this._stateScriptData(t);break}case U.PLAINTEXT:{this._statePlaintext(t);break}case U.TAG_OPEN:{this._stateTagOpen(t);break}case U.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case U.TAG_NAME:{this._stateTagName(t);break}case U.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case U.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case U.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case U.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case U.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case U.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case U.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case U.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case U.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case U.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case U.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case U.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case U.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case U.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case U.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case U.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case U.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case U.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case U.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case U.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case U.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case U.BOGUS_COMMENT:{this._stateBogusComment(t);break}case U.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case U.COMMENT_START:{this._stateCommentStart(t);break}case U.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case U.COMMENT:{this._stateComment(t);break}case U.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case U.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case U.COMMENT_END:{this._stateCommentEnd(t);break}case U.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case U.DOCTYPE:{this._stateDoctype(t);break}case U.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case U.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case U.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case U.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case U.CDATA_SECTION:{this._stateCdataSection(t);break}case U.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case U.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case U.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case U.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case M.LESS_THAN_SIGN:{this.state=U.TAG_OPEN;break}case M.AMPERSAND:{this._startCharacterReference();break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitCodePoint(t);break}case M.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case M.AMPERSAND:{this._startCharacterReference();break}case M.LESS_THAN_SIGN:{this.state=U.RCDATA_LESS_THAN_SIGN;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case M.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case M.LESS_THAN_SIGN:{this.state=U.RAWTEXT_LESS_THAN_SIGN;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case M.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case M.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case M.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Wi(t))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case M.EXCLAMATION_MARK:{this.state=U.MARKUP_DECLARATION_OPEN;break}case M.SOLIDUS:{this.state=U.END_TAG_OPEN;break}case M.QUESTION_MARK:{this._err(pe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t);break}case M.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=U.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Wi(t))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case M.GREATER_THAN_SIGN:{this._err(pe.missingEndTagName),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this.state=U.BEFORE_ATTRIBUTE_NAME;break}case M.SOLIDUS:{this.state=U.SELF_CLOSING_START_TAG;break}case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentTagToken();break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.tagName+=Cn;break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Sc(t)?Df(t):t)}}_stateRcdataLessThanSign(t){t===M.SOLIDUS?this.state=U.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=U.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Wi(t)?(this.state=U.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=U.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=U.BEFORE_ATTRIBUTE_NAME,!1;case M.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=U.SELF_CLOSING_START_TAG,!1;case M.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=U.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===M.SOLIDUS?this.state=U.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Wi(t)?(this.state=U.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case M.SOLIDUS:{this.state=U.SCRIPT_DATA_END_TAG_OPEN;break}case M.EXCLAMATION_MARK:{this.state=U.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=U.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Wi(t)?(this.state=U.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===M.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===M.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case M.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case M.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case M.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Cn);break}case M.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case M.HYPHEN_MINUS:{this._emitChars("-");break}case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case M.GREATER_THAN_SIGN:{this.state=U.SCRIPT_DATA,this._emitChars(">");break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Cn);break}case M.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===M.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Wi(t)?(this._emitChars("<"),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Wi(t)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Xr.SCRIPT,!1)&&j_(this.preprocessor.peek(Xr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Xr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case M.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case M.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case M.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Cn);break}case M.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case M.HYPHEN_MINUS:{this._emitChars("-");break}case M.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case M.GREATER_THAN_SIGN:{this.state=U.SCRIPT_DATA,this._emitChars(">");break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Cn);break}case M.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===M.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Xr.SCRIPT,!1)&&j_(this.preprocessor.peek(Xr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Xr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.SOLIDUS:case M.GREATER_THAN_SIGN:case M.EOF:{this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case M.EQUALS_SIGN:{this._err(pe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=U.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:case M.SOLIDUS:case M.GREATER_THAN_SIGN:case M.EOF:{this._leaveAttrName(),this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case M.EQUALS_SIGN:{this._leaveAttrName(),this.state=U.BEFORE_ATTRIBUTE_VALUE;break}case M.QUOTATION_MARK:case M.APOSTROPHE:case M.LESS_THAN_SIGN:{this._err(pe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.name+=Cn;break}default:this.currentAttr.name+=String.fromCodePoint(Sc(t)?Df(t):t)}}_stateAfterAttributeName(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.SOLIDUS:{this.state=U.SELF_CLOSING_START_TAG;break}case M.EQUALS_SIGN:{this.state=U.BEFORE_ATTRIBUTE_VALUE;break}case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentTagToken();break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.QUOTATION_MARK:{this.state=U.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case M.APOSTROPHE:{this.state=U.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case M.GREATER_THAN_SIGN:{this._err(pe.missingAttributeValue),this.state=U.DATA,this.emitCurrentTagToken();break}default:this.state=U.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case M.QUOTATION_MARK:{this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case M.AMPERSAND:{this._startCharacterReference();break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Cn;break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case M.APOSTROPHE:{this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case M.AMPERSAND:{this._startCharacterReference();break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Cn;break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break}case M.AMPERSAND:{this._startCharacterReference();break}case M.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break}case M.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Cn;break}case M.QUOTATION_MARK:case M.APOSTROPHE:case M.LESS_THAN_SIGN:case M.EQUALS_SIGN:case M.GRAVE_ACCENT:{this._err(pe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break}case M.SOLIDUS:{this._leaveAttrValue(),this.state=U.SELF_CLOSING_START_TAG;break}case M.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBetweenAttributes),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case M.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=U.DATA,this.emitCurrentTagToken();break}case M.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.unexpectedSolidusInTag),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentComment(n);break}case M.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Cn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Xr.DASH_DASH,!0)?(this._createCommentToken(Xr.DASH_DASH.length+1),this.state=U.COMMENT_START):this._consumeSequenceIfMatch(Xr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Xr.DOCTYPE.length+1),this.state=U.DOCTYPE):this._consumeSequenceIfMatch(Xr.CDATA_START,!0)?this.inForeignNode?this.state=U.CDATA_SECTION:(this._err(pe.cdataInHtmlContent),this._createCommentToken(Xr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=U.BOGUS_COMMENT):this._ensureHibernation()||(this._err(pe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case M.HYPHEN_MINUS:{this.state=U.COMMENT_START_DASH;break}case M.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=U.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=U.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case M.HYPHEN_MINUS:{this.state=U.COMMENT_END;break}case M.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=U.DATA,this.emitCurrentComment(n);break}case M.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=U.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case M.HYPHEN_MINUS:{this.state=U.COMMENT_END_DASH;break}case M.LESS_THAN_SIGN:{n.data+="<",this.state=U.COMMENT_LESS_THAN_SIGN;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Cn;break}case M.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case M.EXCLAMATION_MARK:{n.data+="!",this.state=U.COMMENT_LESS_THAN_SIGN_BANG;break}case M.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=U.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===M.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=U.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===M.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=U.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==M.GREATER_THAN_SIGN&&t!==M.EOF&&this._err(pe.nestedComment),this.state=U.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case M.HYPHEN_MINUS:{this.state=U.COMMENT_END;break}case M.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=U.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentComment(n);break}case M.EXCLAMATION_MARK:{this.state=U.COMMENT_END_BANG;break}case M.HYPHEN_MINUS:{n.data+="-";break}case M.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=U.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case M.HYPHEN_MINUS:{n.data+="--!",this.state=U.COMMENT_END_DASH;break}case M.GREATER_THAN_SIGN:{this._err(pe.incorrectlyClosedComment),this.state=U.DATA,this.emitCurrentComment(n);break}case M.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=U.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_NAME;break}case M.GREATER_THAN_SIGN:{this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case M.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBeforeDoctypeName),this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Sc(t))this._createDoctypeToken(String.fromCharCode(Df(t))),this.state=U.DOCTYPE_NAME;else switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.NULL:{this._err(pe.unexpectedNullCharacter),this._createDoctypeToken(Cn),this.state=U.DOCTYPE_NAME;break}case M.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=U.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this.state=U.AFTER_DOCTYPE_NAME;break}case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.name+=Cn;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Sc(t)?Df(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Xr.PUBLIC,!1)?this.state=U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Xr.SYSTEM,!1)?this.state=U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(pe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case M.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case M.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case M.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.QUOTATION_MARK:{n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case M.APOSTROPHE:{n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case M.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case M.QUOTATION_MARK:{this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Cn;break}case M.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case M.APOSTROPHE:{this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Cn;break}case M.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this.state=U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case M.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.QUOTATION_MARK:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case M.APOSTROPHE:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.QUOTATION_MARK:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case M.APOSTROPHE:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case M.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case M.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case M.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.QUOTATION_MARK:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case M.APOSTROPHE:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case M.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case M.QUOTATION_MARK:{this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Cn;break}case M.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case M.APOSTROPHE:{this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case M.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Cn;break}case M.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case M.SPACE:case M.LINE_FEED:case M.TABULATION:case M.FORM_FEED:break;case M.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case M.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case M.NULL:{this._err(pe.unexpectedNullCharacter);break}case M.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case M.RIGHT_SQUARE_BRACKET:{this.state=U.CDATA_SECTION_BRACKET;break}case M.EOF:{this._err(pe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===M.RIGHT_SQUARE_BRACKET?this.state=U.CDATA_SECTION_END:(this._emitChars("]"),this.state=U.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case M.GREATER_THAN_SIGN:{this.state=U.DATA;break}case M.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=U.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(M.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&D_(this.preprocessor.peek(1))?U.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){D_(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===M.SEMICOLON&&this._err(pe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Lw=new Set([_.DD,_.DT,_.LI,_.OPTGROUP,_.OPTION,_.P,_.RB,_.RP,_.RT,_.RTC]),M_=new Set([...Lw,_.CAPTION,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]),kh=new Set([_.APPLET,_.CAPTION,_.HTML,_.MARQUEE,_.OBJECT,_.TABLE,_.TD,_.TEMPLATE,_.TH]),qD=new Set([...kh,_.OL,_.UL]),YD=new Set([...kh,_.BUTTON]),P_=new Set([_.ANNOTATION_XML,_.MI,_.MN,_.MO,_.MS,_.MTEXT]),B_=new Set([_.DESC,_.FOREIGN_OBJECT,_.TITLE]),WD=new Set([_.TR,_.TEMPLATE,_.HTML]),QD=new Set([_.TBODY,_.TFOOT,_.THEAD,_.TEMPLATE,_.HTML]),XD=new Set([_.TABLE,_.TEMPLATE,_.HTML]),KD=new Set([_.TD,_.TH]);class ZD{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=_.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===_.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ke.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ke.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Gg,ke.HTML)}popUntilTableCellPopped(){this.popUntilPopped(KD,ke.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(XD,ke.HTML)}clearBackToTableBodyContext(){this.clearBackTo(QD,ke.HTML)}clearBackToTableRowContext(){this.clearBackTo(WD,ke.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===_.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===_.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ke.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case ke.SVG:{if(B_.has(i))return!1;break}case ke.MATHML:{if(P_.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,kh)}hasInListItemScope(t){return this.hasInDynamicScope(t,qD)}hasInButtonScope(t){return this.hasInDynamicScope(t,YD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ke.HTML:{if(Gg.has(n))return!0;if(kh.has(n))return!1;break}case ke.SVG:{if(B_.has(n))return!1;break}case ke.MATHML:{if(P_.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.HTML)switch(this.tagIDs[n]){case t:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ke.HTML)switch(this.tagIDs[t]){case _.TBODY:case _.THEAD:case _.TFOOT:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.HTML)switch(this.tagIDs[n]){case t:return!0;case _.OPTION:case _.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Lw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&M_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&M_.has(this.currentTagId);)this.pop()}}const V0=3;var _s;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(_s||(_s={}));const U_={type:_s.Marker};class JD{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,l=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const f=this.entries[c];if(f.type===_s.Marker)break;const{element:h}=f;if(this.treeAdapter.getTagName(h)===l&&this.treeAdapter.getNamespaceURI(h)===o){const p=this.treeAdapter.getAttrList(h);p.length===i&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<V0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<V0)return;const i=new Map(n.map(o=>[o.name,o.value]));let l=0;for(let o=0;o<r.length;o++){const c=r[o];c.attrs.every(f=>i.get(f.name)===f.value)&&(l+=1,l>=V0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(U_)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:_s.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:_s.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(U_);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===_s.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===_s.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===_s.Element&&n.element===t)}}const Qi={createDocument(){return{nodeName:"#document",mode:Pa.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(l=>l.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const l={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Qi.appendChild(e,l)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Qi.isTextNode(n)){n.value+=t;return}}Qi.appendChild(e,Qi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Qi.isTextNode(r)?r.value+=t:Qi.insertBefore(e,Qi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Iw="html",ej="about:legacy-compat",tj="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Ow=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],nj=[...Ow,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],rj=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Dw=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],aj=[...Dw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function H_(e,t){return t.some(n=>e.startsWith(n))}function sj(e){return e.name===Iw&&e.publicId===null&&(e.systemId===null||e.systemId===ej)}function ij(e){if(e.name!==Iw)return Pa.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===tj)return Pa.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),rj.has(n))return Pa.QUIRKS;let r=t===null?nj:Ow;if(H_(n,r))return Pa.QUIRKS;if(r=t===null?Dw:aj,H_(n,r))return Pa.LIMITED_QUIRKS}return Pa.NO_QUIRKS}const F_={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},lj="definitionurl",oj="definitionURL",uj=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),cj=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ke.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ke.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ke.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ke.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ke.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ke.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ke.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ke.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ke.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ke.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ke.XMLNS}]]),dj=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),fj=new Set([_.B,_.BIG,_.BLOCKQUOTE,_.BODY,_.BR,_.CENTER,_.CODE,_.DD,_.DIV,_.DL,_.DT,_.EM,_.EMBED,_.H1,_.H2,_.H3,_.H4,_.H5,_.H6,_.HEAD,_.HR,_.I,_.IMG,_.LI,_.LISTING,_.MENU,_.META,_.NOBR,_.OL,_.P,_.PRE,_.RUBY,_.S,_.SMALL,_.SPAN,_.STRONG,_.STRIKE,_.SUB,_.SUP,_.TABLE,_.TT,_.U,_.UL,_.VAR]);function hj(e){const t=e.tagID;return t===_.FONT&&e.attrs.some(({name:r})=>r===Ql.COLOR||r===Ql.SIZE||r===Ql.FACE)||fj.has(t)}function jw(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===lj){e.attrs[t].name=oj;break}}function Mw(e){for(let t=0;t<e.attrs.length;t++){const n=uj.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function rb(e){for(let t=0;t<e.attrs.length;t++){const n=cj.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function mj(e){const t=dj.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=_u(e.tagName))}function pj(e,t){return t===ke.MATHML&&(e===_.MI||e===_.MO||e===_.MN||e===_.MS||e===_.MTEXT)}function gj(e,t,n){if(t===ke.MATHML&&e===_.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ql.ENCODING){const i=n[r].value.toLowerCase();return i===F_.TEXT_HTML||i===F_.APPLICATION_XML}}return t===ke.SVG&&(e===_.FOREIGN_OBJECT||e===_.DESC||e===_.TITLE)}function bj(e,t,n,r){return(!r||r===ke.HTML)&&gj(e,t,n)||(!r||r===ke.MATHML)&&pj(e,t)}const xj="hidden",yj=8,Ej=3;var V;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(V||(V={}));const _j={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Pw=new Set([_.TABLE,_.TBODY,_.TFOOT,_.THEAD,_.TR]),z_={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Qi,onParseError:null};class $_{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=V.INITIAL,this.originalInsertionMode=V.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...z_,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new GD(this.options,this),this.activeFormattingElements=new JD(this.treeAdapter),this.fragmentContextID=r?_u(this.treeAdapter.getTagName(r)):_.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new ZD(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...z_,...n};t??(t=r.treeAdapter.createElement(ne.TEMPLATE,ke.HTML,[]));const i=r.treeAdapter.createElement("documentmock",ke.HTML,[]),l=new this(r,i,t);return l.fragmentContextID===_.TEMPLATE&&l.tmplInsertionModeStack.unshift(V.IN_TEMPLATE),l._initTokenizerForFragmentParsing(),l._insertFakeRootElement(),l._resetInsertionMode(),l._findFormInFragmentContext(),l}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const l=(i=t.location)!==null&&i!==void 0?i:_j,o={code:n,startLine:l.startLine,startCol:l.startCol,startOffset:l.startOffset,endLine:r?l.startLine:l.endLine,endCol:r?l.startCol:l.endCol,endOffset:r?l.startOffset:l.endOffset};this.onParseError(o)}onItemPush(t,n,r){var i,l;(l=(i=this.treeAdapter).onItemPush)===null||l===void 0||l.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let l,o;this.openElements.stackTop===0&&this.fragmentContext?(l=this.fragmentContext,o=this.fragmentContextID):{current:l,currentTagId:o}=this.openElements,this._setContextModes(l,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ke.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ke.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=V.TEXT}switchToPlaintextParsing(){this.insertionMode=V.TEXT,this.originalInsertionMode=V.IN_BODY,this.tokenizer.state=Bn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ke.HTML))switch(this.fragmentContextID){case _.TITLE:case _.TEXTAREA:{this.tokenizer.state=Bn.RCDATA;break}case _.STYLE:case _.XMP:case _.IFRAME:case _.NOEMBED:case _.NOFRAMES:case _.NOSCRIPT:{this.tokenizer.state=Bn.RAWTEXT;break}case _.SCRIPT:{this.tokenizer.state=Bn.SCRIPT_DATA;break}case _.PLAINTEXT:{this.tokenizer.state=Bn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ke.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ke.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,ke.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,_.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),l=r?i.lastIndexOf(r):i.length,o=i[l-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:f,endCol:h,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:f,endCol:h,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),l=n.type===It.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,l)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===_.SVG&&this.treeAdapter.getTagName(n)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ke.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===_.MGLYPH||t.tagID===_.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ke.HTML)}_processToken(t){switch(t.type){case It.CHARACTER:{this.onCharacter(t);break}case It.NULL_CHARACTER:{this.onNullCharacter(t);break}case It.COMMENT:{this.onComment(t);break}case It.DOCTYPE:{this.onDoctype(t);break}case It.START_TAG:{this._processStartTag(t);break}case It.END_TAG:{this.onEndTag(t);break}case It.EOF:{this.onEof(t);break}case It.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),l=this.treeAdapter.getAttrList(n);return bj(t,i,l,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===_s.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const l=this.activeFormattingElements.entries[i];this._insertElement(l.token,this.treeAdapter.getNamespaceURI(l.element)),l.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=V.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(_.P),this.openElements.popUntilTagNamePopped(_.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case _.TR:{this.insertionMode=V.IN_ROW;return}case _.TBODY:case _.THEAD:case _.TFOOT:{this.insertionMode=V.IN_TABLE_BODY;return}case _.CAPTION:{this.insertionMode=V.IN_CAPTION;return}case _.COLGROUP:{this.insertionMode=V.IN_COLUMN_GROUP;return}case _.TABLE:{this.insertionMode=V.IN_TABLE;return}case _.BODY:{this.insertionMode=V.IN_BODY;return}case _.FRAMESET:{this.insertionMode=V.IN_FRAMESET;return}case _.SELECT:{this._resetInsertionModeForSelect(t);return}case _.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case _.HTML:{this.insertionMode=this.headElement?V.AFTER_HEAD:V.BEFORE_HEAD;return}case _.TD:case _.TH:{if(t>0){this.insertionMode=V.IN_CELL;return}break}case _.HEAD:{if(t>0){this.insertionMode=V.IN_HEAD;return}break}}this.insertionMode=V.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===_.TEMPLATE)break;if(r===_.TABLE){this.insertionMode=V.IN_SELECT_IN_TABLE;return}}this.insertionMode=V.IN_SELECT}_isElementCausesFosterParenting(t){return Pw.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case _.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ke.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case _.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return FD[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){K9(this,t);return}switch(this.insertionMode){case V.INITIAL:{gc(this,t);break}case V.BEFORE_HTML:{Dc(this,t);break}case V.BEFORE_HEAD:{jc(this,t);break}case V.IN_HEAD:{Mc(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Pc(this,t);break}case V.AFTER_HEAD:{Bc(this,t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:{Uw(this,t);break}case V.TEXT:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{G0(this,t);break}case V.IN_TABLE_TEXT:{Gw(this,t);break}case V.IN_COLUMN_GROUP:{wh(this,t);break}case V.AFTER_BODY:{Ch(this,t);break}case V.AFTER_AFTER_BODY:{ih(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){X9(this,t);return}switch(this.insertionMode){case V.INITIAL:{gc(this,t);break}case V.BEFORE_HTML:{Dc(this,t);break}case V.BEFORE_HEAD:{jc(this,t);break}case V.IN_HEAD:{Mc(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Pc(this,t);break}case V.AFTER_HEAD:{Bc(this,t);break}case V.TEXT:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{G0(this,t);break}case V.IN_COLUMN_GROUP:{wh(this,t);break}case V.AFTER_BODY:{Ch(this,t);break}case V.AFTER_AFTER_BODY:{ih(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){qg(this,t);return}switch(this.insertionMode){case V.INITIAL:case V.BEFORE_HTML:case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_TEMPLATE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{qg(this,t);break}case V.IN_TABLE_TEXT:{bc(this,t);break}case V.AFTER_BODY:{Nj(this,t);break}case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{Aj(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case V.INITIAL:{Rj(this,t);break}case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:{this._err(t,pe.misplacedDoctype);break}case V.IN_TABLE_TEXT:{bc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,pe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Z9(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{gc(this,t);break}case V.BEFORE_HTML:{Lj(this,t);break}case V.BEFORE_HEAD:{Oj(this,t);break}case V.IN_HEAD:{is(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Mj(this,t);break}case V.AFTER_HEAD:{Bj(this,t);break}case V.IN_BODY:{Rr(this,t);break}case V.IN_TABLE:{uu(this,t);break}case V.IN_TABLE_TEXT:{bc(this,t);break}case V.IN_CAPTION:{D9(this,t);break}case V.IN_COLUMN_GROUP:{ib(this,t);break}case V.IN_TABLE_BODY:{em(this,t);break}case V.IN_ROW:{tm(this,t);break}case V.IN_CELL:{P9(this,t);break}case V.IN_SELECT:{Ww(this,t);break}case V.IN_SELECT_IN_TABLE:{U9(this,t);break}case V.IN_TEMPLATE:{F9(this,t);break}case V.AFTER_BODY:{$9(this,t);break}case V.IN_FRAMESET:{V9(this,t);break}case V.AFTER_FRAMESET:{q9(this,t);break}case V.AFTER_AFTER_BODY:{W9(this,t);break}case V.AFTER_AFTER_FRAMESET:{Q9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?J9(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{gc(this,t);break}case V.BEFORE_HTML:{Ij(this,t);break}case V.BEFORE_HEAD:{Dj(this,t);break}case V.IN_HEAD:{jj(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Pj(this,t);break}case V.AFTER_HEAD:{Uj(this,t);break}case V.IN_BODY:{Jh(this,t);break}case V.TEXT:{k9(this,t);break}case V.IN_TABLE:{Xc(this,t);break}case V.IN_TABLE_TEXT:{bc(this,t);break}case V.IN_CAPTION:{j9(this,t);break}case V.IN_COLUMN_GROUP:{M9(this,t);break}case V.IN_TABLE_BODY:{Yg(this,t);break}case V.IN_ROW:{Yw(this,t);break}case V.IN_CELL:{B9(this,t);break}case V.IN_SELECT:{Qw(this,t);break}case V.IN_SELECT_IN_TABLE:{H9(this,t);break}case V.IN_TEMPLATE:{z9(this,t);break}case V.AFTER_BODY:{Kw(this,t);break}case V.IN_FRAMESET:{G9(this,t);break}case V.AFTER_FRAMESET:{Y9(this,t);break}case V.AFTER_AFTER_BODY:{ih(this,t);break}}}onEof(t){switch(this.insertionMode){case V.INITIAL:{gc(this,t);break}case V.BEFORE_HTML:{Dc(this,t);break}case V.BEFORE_HEAD:{jc(this,t);break}case V.IN_HEAD:{Mc(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Pc(this,t);break}case V.AFTER_HEAD:{Bc(this,t);break}case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{$w(this,t);break}case V.TEXT:{w9(this,t);break}case V.IN_TABLE_TEXT:{bc(this,t);break}case V.IN_TEMPLATE:{Xw(this,t);break}case V.AFTER_BODY:case V.IN_FRAMESET:case V.AFTER_FRAMESET:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{sb(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===M.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.TEXT:case V.IN_COLUMN_GROUP:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{this._insertCharacters(t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:case V.AFTER_BODY:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{Bw(this,t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{G0(this,t);break}case V.IN_TABLE_TEXT:{Vw(this,t);break}}}}function Tj(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):zw(e,t),n}function vj(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function kj(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let l=0,o=i;o!==n;l++,o=i){i=e.openElements.getCommonAncestor(o);const c=e.activeFormattingElements.getElementEntry(o),f=c&&l>=Ej;!c||f?(f&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(o)):(o=wj(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function wj(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Cj(e,t,n){const r=e.treeAdapter.getTagName(t),i=_u(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const l=e.treeAdapter.getNamespaceURI(t);i===_.TEMPLATE&&l===ke.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Sj(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,l=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,l),e.treeAdapter.appendChild(t,l),e.activeFormattingElements.insertElementAfterBookmark(l,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,l,i.tagID)}function ab(e,t){for(let n=0;n<yj;n++){const r=Tj(e,t);if(!r)break;const i=vj(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const l=kj(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(l),o&&Cj(e,o,l),Sj(e,i,r)}}function qg(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Nj(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Aj(e,t){e._appendCommentNode(t,e.document)}function sb(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const l=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(l);o&&!o.endTag&&e._setEndLocation(l,t)}}}}function Rj(e,t){e._setDocumentType(t);const n=t.forceQuirks?Pa.QUIRKS:ij(t);sj(t)||e._err(t,pe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=V.BEFORE_HTML}function gc(e,t){e._err(t,pe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Pa.QUIRKS),e.insertionMode=V.BEFORE_HTML,e._processToken(t)}function Lj(e,t){t.tagID===_.HTML?(e._insertElement(t,ke.HTML),e.insertionMode=V.BEFORE_HEAD):Dc(e,t)}function Ij(e,t){const n=t.tagID;(n===_.HTML||n===_.HEAD||n===_.BODY||n===_.BR)&&Dc(e,t)}function Dc(e,t){e._insertFakeRootElement(),e.insertionMode=V.BEFORE_HEAD,e._processToken(t)}function Oj(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.HEAD:{e._insertElement(t,ke.HTML),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD;break}default:jc(e,t)}}function Dj(e,t){const n=t.tagID;n===_.HEAD||n===_.BODY||n===_.HTML||n===_.BR?jc(e,t):e._err(t,pe.endTagWithoutMatchingOpenElement)}function jc(e,t){e._insertFakeElement(ne.HEAD,_.HEAD),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD,e._processToken(t)}function is(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case _.TITLE:{e._switchToTextParsing(t,Bn.RCDATA);break}case _.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Bn.RAWTEXT):(e._insertElement(t,ke.HTML),e.insertionMode=V.IN_HEAD_NO_SCRIPT);break}case _.NOFRAMES:case _.STYLE:{e._switchToTextParsing(t,Bn.RAWTEXT);break}case _.SCRIPT:{e._switchToTextParsing(t,Bn.SCRIPT_DATA);break}case _.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=V.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(V.IN_TEMPLATE);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Mc(e,t)}}function jj(e,t){switch(t.tagID){case _.HEAD:{e.openElements.pop(),e.insertionMode=V.AFTER_HEAD;break}case _.BODY:case _.BR:case _.HTML:{Mc(e,t);break}case _.TEMPLATE:{no(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function no(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==_.TEMPLATE&&e._err(t,pe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,pe.endTagWithoutMatchingOpenElement)}function Mc(e,t){e.openElements.pop(),e.insertionMode=V.AFTER_HEAD,e._processToken(t)}function Mj(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.BASEFONT:case _.BGSOUND:case _.HEAD:case _.LINK:case _.META:case _.NOFRAMES:case _.STYLE:{is(e,t);break}case _.NOSCRIPT:{e._err(t,pe.nestedNoscriptInHead);break}default:Pc(e,t)}}function Pj(e,t){switch(t.tagID){case _.NOSCRIPT:{e.openElements.pop(),e.insertionMode=V.IN_HEAD;break}case _.BR:{Pc(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Pc(e,t){const n=t.type===It.EOF?pe.openElementsLeftAfterEof:pe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=V.IN_HEAD,e._processToken(t)}function Bj(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.BODY:{e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=V.IN_BODY;break}case _.FRAMESET:{e._insertElement(t,ke.HTML),e.insertionMode=V.IN_FRAMESET;break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{e._err(t,pe.abandonedHeadElementChild),e.openElements.push(e.headElement,_.HEAD),is(e,t),e.openElements.remove(e.headElement);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Bc(e,t)}}function Uj(e,t){switch(t.tagID){case _.BODY:case _.HTML:case _.BR:{Bc(e,t);break}case _.TEMPLATE:{no(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Bc(e,t){e._insertFakeElement(ne.BODY,_.BODY),e.insertionMode=V.IN_BODY,Zh(e,t)}function Zh(e,t){switch(t.type){case It.CHARACTER:{Uw(e,t);break}case It.WHITESPACE_CHARACTER:{Bw(e,t);break}case It.COMMENT:{qg(e,t);break}case It.START_TAG:{Rr(e,t);break}case It.END_TAG:{Jh(e,t);break}case It.EOF:{$w(e,t);break}}}function Bw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Uw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Hj(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Fj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function zj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_FRAMESET)}function $j(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function Vj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Gg.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ke.HTML)}function Gj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function qj(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ke.HTML),n||(e.formElement=e.openElements.current))}function Yj(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===_.LI&&i===_.LI||(n===_.DD||n===_.DT)&&(i===_.DD||i===_.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==_.ADDRESS&&i!==_.DIV&&i!==_.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function Wj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.tokenizer.state=Bn.PLAINTEXT}function Qj(e,t){e.openElements.hasInScope(_.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1}function Xj(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);n&&(ab(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Kj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Zj(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(_.NOBR)&&(ab(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Jj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function e9(e,t){e.treeAdapter.getDocumentMode(e.document)!==Pa.QUIRKS&&e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=V.IN_TABLE}function Hw(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Fw(e){const t=Aw(e,Ql.TYPE);return t!=null&&t.toLowerCase()===xj}function t9(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),Fw(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function n9(e,t){e._appendElement(t,ke.HTML),t.ackSelfClosing=!0}function r9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function a9(e,t){t.tagName=ne.IMG,t.tagID=_.IMG,Hw(e,t)}function s9(e,t){e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Bn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=V.TEXT}function i9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Bn.RAWTEXT)}function l9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Bn.RAWTEXT)}function V_(e,t){e._switchToTextParsing(t,Bn.RAWTEXT)}function o9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===V.IN_TABLE||e.insertionMode===V.IN_CAPTION||e.insertionMode===V.IN_TABLE_BODY||e.insertionMode===V.IN_ROW||e.insertionMode===V.IN_CELL?V.IN_SELECT_IN_TABLE:V.IN_SELECT}function u9(e,t){e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function c9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ke.HTML)}function d9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(_.RTC),e._insertElement(t,ke.HTML)}function f9(e,t){e._reconstructActiveFormattingElements(),jw(t),rb(t),t.selfClosing?e._appendElement(t,ke.MATHML):e._insertElement(t,ke.MATHML),t.ackSelfClosing=!0}function h9(e,t){e._reconstructActiveFormattingElements(),Mw(t),rb(t),t.selfClosing?e._appendElement(t,ke.SVG):e._insertElement(t,ke.SVG),t.ackSelfClosing=!0}function G_(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Rr(e,t){switch(t.tagID){case _.I:case _.S:case _.B:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.SMALL:case _.STRIKE:case _.STRONG:{Kj(e,t);break}case _.A:{Xj(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{Vj(e,t);break}case _.P:case _.DL:case _.OL:case _.UL:case _.DIV:case _.DIR:case _.NAV:case _.MAIN:case _.MENU:case _.ASIDE:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.DETAILS:case _.ADDRESS:case _.ARTICLE:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{$j(e,t);break}case _.LI:case _.DD:case _.DT:{Yj(e,t);break}case _.BR:case _.IMG:case _.WBR:case _.AREA:case _.EMBED:case _.KEYGEN:{Hw(e,t);break}case _.HR:{r9(e,t);break}case _.RB:case _.RTC:{c9(e,t);break}case _.RT:case _.RP:{d9(e,t);break}case _.PRE:case _.LISTING:{Gj(e,t);break}case _.XMP:{i9(e,t);break}case _.SVG:{h9(e,t);break}case _.HTML:{Hj(e,t);break}case _.BASE:case _.LINK:case _.META:case _.STYLE:case _.TITLE:case _.SCRIPT:case _.BGSOUND:case _.BASEFONT:case _.TEMPLATE:{is(e,t);break}case _.BODY:{Fj(e,t);break}case _.FORM:{qj(e,t);break}case _.NOBR:{Zj(e,t);break}case _.MATH:{f9(e,t);break}case _.TABLE:{e9(e,t);break}case _.INPUT:{t9(e,t);break}case _.PARAM:case _.TRACK:case _.SOURCE:{n9(e,t);break}case _.IMAGE:{a9(e,t);break}case _.BUTTON:{Qj(e,t);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{Jj(e,t);break}case _.IFRAME:{l9(e,t);break}case _.SELECT:{o9(e,t);break}case _.OPTION:case _.OPTGROUP:{u9(e,t);break}case _.NOEMBED:case _.NOFRAMES:{V_(e,t);break}case _.FRAMESET:{zj(e,t);break}case _.TEXTAREA:{s9(e,t);break}case _.NOSCRIPT:{e.options.scriptingEnabled?V_(e,t):G_(e,t);break}case _.PLAINTEXT:{Wj(e,t);break}case _.COL:case _.TH:case _.TD:case _.TR:case _.HEAD:case _.FRAME:case _.TBODY:case _.TFOOT:case _.THEAD:case _.CAPTION:case _.COLGROUP:break;default:G_(e,t)}}function m9(e,t){if(e.openElements.hasInScope(_.BODY)&&(e.insertionMode=V.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function p9(e,t){e.openElements.hasInScope(_.BODY)&&(e.insertionMode=V.AFTER_BODY,Kw(e,t))}function g9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function b9(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(_.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(_.FORM):n&&e.openElements.remove(n))}function x9(e){e.openElements.hasInButtonScope(_.P)||e._insertFakeElement(ne.P,_.P),e._closePElement()}function y9(e){e.openElements.hasInListItemScope(_.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(_.LI),e.openElements.popUntilTagNamePopped(_.LI))}function E9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function _9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function T9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function v9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,_.BR),e.openElements.pop(),e.framesetOk=!1}function zw(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const l=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==_.UNKNOWN||e.treeAdapter.getTagName(l)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(l,o))break}}function Jh(e,t){switch(t.tagID){case _.A:case _.B:case _.I:case _.S:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.NOBR:case _.SMALL:case _.STRIKE:case _.STRONG:{ab(e,t);break}case _.P:{x9(e);break}case _.DL:case _.UL:case _.OL:case _.DIR:case _.DIV:case _.NAV:case _.PRE:case _.MAIN:case _.MENU:case _.ASIDE:case _.BUTTON:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.ADDRESS:case _.ARTICLE:case _.DETAILS:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.LISTING:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{g9(e,t);break}case _.LI:{y9(e);break}case _.DD:case _.DT:{E9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{_9(e);break}case _.BR:{v9(e);break}case _.BODY:{m9(e,t);break}case _.HTML:{p9(e,t);break}case _.FORM:{b9(e);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{T9(e,t);break}case _.TEMPLATE:{no(e,t);break}default:zw(e,t)}}function $w(e,t){e.tmplInsertionModeStack.length>0?Xw(e,t):sb(e,t)}function k9(e,t){var n;t.tagID===_.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function w9(e,t){e._err(t,pe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function G0(e,t){if(e.openElements.currentTagId!==void 0&&Pw.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=V.IN_TABLE_TEXT,t.type){case It.CHARACTER:{Gw(e,t);break}case It.WHITESPACE_CHARACTER:{Vw(e,t);break}}else ld(e,t)}function C9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_CAPTION}function S9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_COLUMN_GROUP}function N9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,_.COLGROUP),e.insertionMode=V.IN_COLUMN_GROUP,ib(e,t)}function A9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_TABLE_BODY}function R9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,_.TBODY),e.insertionMode=V.IN_TABLE_BODY,em(e,t)}function L9(e,t){e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function I9(e,t){Fw(t)?e._appendElement(t,ke.HTML):ld(e,t),t.ackSelfClosing=!0}function O9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ke.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function uu(e,t){switch(t.tagID){case _.TD:case _.TH:case _.TR:{R9(e,t);break}case _.STYLE:case _.SCRIPT:case _.TEMPLATE:{is(e,t);break}case _.COL:{N9(e,t);break}case _.FORM:{O9(e,t);break}case _.TABLE:{L9(e,t);break}case _.TBODY:case _.TFOOT:case _.THEAD:{A9(e,t);break}case _.INPUT:{I9(e,t);break}case _.CAPTION:{C9(e,t);break}case _.COLGROUP:{S9(e,t);break}default:ld(e,t)}}function Xc(e,t){switch(t.tagID){case _.TABLE:{e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode());break}case _.TEMPLATE:{no(e,t);break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:ld(e,t)}}function ld(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Zh(e,t),e.fosterParentingEnabled=n}function Vw(e,t){e.pendingCharacterTokens.push(t)}function Gw(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function bc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)ld(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const qw=new Set([_.CAPTION,_.COL,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]);function D9(e,t){const n=t.tagID;qw.has(n)?e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,uu(e,t)):Rr(e,t)}function j9(e,t){const n=t.tagID;switch(n){case _.CAPTION:case _.TABLE:{e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,n===_.TABLE&&Xc(e,t));break}case _.BODY:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:Jh(e,t)}}function ib(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.COL:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case _.TEMPLATE:{is(e,t);break}default:wh(e,t)}}function M9(e,t){switch(t.tagID){case _.COLGROUP:{e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case _.TEMPLATE:{no(e,t);break}case _.COL:break;default:wh(e,t)}}function wh(e,t){e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE,e._processToken(t))}function em(e,t){switch(t.tagID){case _.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_ROW;break}case _.TH:case _.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,_.TR),e.insertionMode=V.IN_ROW,tm(e,t);break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,uu(e,t));break}default:uu(e,t)}}function Yg(e,t){const n=t.tagID;switch(t.tagID){case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case _.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,Xc(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:case _.TR:break;default:Xc(e,t)}}function tm(e,t){switch(t.tagID){case _.TH:case _.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_CELL,e.activeFormattingElements.insertMarker();break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,em(e,t));break}default:uu(e,t)}}function Yw(e,t){switch(t.tagID){case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY);break}case _.TABLE:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,Yg(e,t));break}case _.TBODY:case _.TFOOT:case _.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(_.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,Yg(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:break;default:Xc(e,t)}}function P9(e,t){const n=t.tagID;qw.has(n)?(e.openElements.hasInTableScope(_.TD)||e.openElements.hasInTableScope(_.TH))&&(e._closeTableCell(),tm(e,t)):Rr(e,t)}function B9(e,t){const n=t.tagID;switch(n){case _.TD:case _.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_ROW);break}case _.TABLE:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Yw(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:break;default:Jh(e,t)}}function Ww(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._insertElement(t,ke.HTML);break}case _.OPTGROUP:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ke.HTML);break}case _.HR:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case _.INPUT:case _.KEYGEN:case _.TEXTAREA:case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),t.tagID!==_.SELECT&&e._processStartTag(t));break}case _.SCRIPT:case _.TEMPLATE:{is(e,t);break}}}function Qw(e,t){switch(t.tagID){case _.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===_.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===_.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop();break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop();break}case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode());break}case _.TEMPLATE:{no(e,t);break}}}function U9(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Ww(e,t)}function H9(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Qw(e,t)}function F9(e,t){switch(t.tagID){case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{is(e,t);break}case _.CAPTION:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.tmplInsertionModeStack[0]=V.IN_TABLE,e.insertionMode=V.IN_TABLE,uu(e,t);break}case _.COL:{e.tmplInsertionModeStack[0]=V.IN_COLUMN_GROUP,e.insertionMode=V.IN_COLUMN_GROUP,ib(e,t);break}case _.TR:{e.tmplInsertionModeStack[0]=V.IN_TABLE_BODY,e.insertionMode=V.IN_TABLE_BODY,em(e,t);break}case _.TD:case _.TH:{e.tmplInsertionModeStack[0]=V.IN_ROW,e.insertionMode=V.IN_ROW,tm(e,t);break}default:e.tmplInsertionModeStack[0]=V.IN_BODY,e.insertionMode=V.IN_BODY,Rr(e,t)}}function z9(e,t){t.tagID===_.TEMPLATE&&no(e,t)}function Xw(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):sb(e,t)}function $9(e,t){t.tagID===_.HTML?Rr(e,t):Ch(e,t)}function Kw(e,t){var n;if(t.tagID===_.HTML){if(e.fragmentContext||(e.insertionMode=V.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===_.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Ch(e,t)}function Ch(e,t){e.insertionMode=V.IN_BODY,Zh(e,t)}function V9(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.FRAMESET:{e._insertElement(t,ke.HTML);break}case _.FRAME:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case _.NOFRAMES:{is(e,t);break}}}function G9(e,t){t.tagID===_.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==_.FRAMESET&&(e.insertionMode=V.AFTER_FRAMESET))}function q9(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.NOFRAMES:{is(e,t);break}}}function Y9(e,t){t.tagID===_.HTML&&(e.insertionMode=V.AFTER_AFTER_FRAMESET)}function W9(e,t){t.tagID===_.HTML?Rr(e,t):ih(e,t)}function ih(e,t){e.insertionMode=V.IN_BODY,Zh(e,t)}function Q9(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.NOFRAMES:{is(e,t);break}}}function X9(e,t){t.chars=Cn,e._insertCharacters(t)}function K9(e,t){e._insertCharacters(t),e.framesetOk=!1}function Zw(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ke.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Z9(e,t){if(hj(t))Zw(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ke.MATHML?jw(t):r===ke.SVG&&(mj(t),Mw(t)),rb(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function J9(e,t){if(t.tagID===_.P||t.tagID===_.BR){Zw(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ke.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const nm=Jw("end"),ws=Jw("start");function Jw(e){return t;function t(n){const r=n&&n.position&&n.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 e3(e){const t=ws(e),n=nm(e);if(t&&n)return{start:t,end:n}}const eM=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,tM=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),q_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function t3(e,t){const n=dM(e),r=O1("type",{handlers:{root:nM,element:rM,text:aM,comment:r3,doctype:sM,raw:lM},unknown:oM}),i={parser:n?new $_(q_):$_.getFragmentParser(void 0,q_),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),Tu(i,ws());const l=n?i.parser.document:i.parser.getFragment(),o=hD(l,{file:i.options.file});return i.stitches&&vs(o,"comment",function(c,f,h){const p=c;if(p.value.stitch&&h&&f!==void 0){const g=h.children;return g[f]=p.value.stitch,f}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function n3(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function nM(e,t){n3(e.children,t)}function rM(e,t){uM(e,t),n3(e.children,t),cM(e,t)}function aM(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:It.CHARACTER,chars:e.value,location:od(e)};Tu(t,ws(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function sM(e,t){const n={type:It.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:od(e)};Tu(t,ws(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function iM(e,t){t.stitches=!0;const n=fM(e);if("children"in e&&"children"in n){const r=t3({type:"root",children:e.children},t.options);n.children=r.children}r3({type:"comment",value:{stitch:n}},t)}function r3(e,t){const n=e.value,r={type:It.COMMENT,data:n,location:od(e)};Tu(t,ws(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function lM(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,a3(t,ws(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(eM,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function oM(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))iM(n,t);else{let r="";throw tM.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Tu(e,t){a3(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Bn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function a3(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function uM(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Bn.PLAINTEXT)return;Tu(t,ws(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ql.html;i===ql.html&&n==="svg"&&(i=ql.svg);const l=xD({...e,children:[]},{space:i===ql.svg?"svg":"html"}),o={type:It.START_TAG,tagName:n,tagID:_u(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in l?l.attrs:[],location:od(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function cM(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Tk.includes(n)||t.parser.tokenizer.state===Bn.PLAINTEXT)return;Tu(t,nm(e));const r={type:It.END_TAG,tagName:n,tagID:_u(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:od(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Bn.RCDATA||t.parser.tokenizer.state===Bn.RAWTEXT||t.parser.tokenizer.state===Bn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Bn.DATA)}function dM(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function od(e){const t=ws(e)||{line:void 0,column:void 0,offset:void 0},n=nm(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function fM(e){return"children"in e?Kl({...e,children:[]}):Kl(e)}function Wg(e){return function(t,n){return t3(t,{...e,file:n})}}const Bl=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],zl={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Bl,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Bl],h2:[["className","sr-only"]],img:[...Bl,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Bl,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Bl],table:[...Bl],ul:[...Bl,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Xi={}.hasOwnProperty;function hM(e,t){let n={type:"root",children:[]};const r={schema:t?{...zl,...t}:zl,stack:[]},i=s3(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function s3(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return mM(e,n);case"doctype":return pM(e,n);case"element":return gM(e,n);case"root":return bM(e,n);case"text":return xM(e,n)}}}function mM(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),l={type:"comment",value:r<0?n:n.slice(0,r)};return ud(l,t),l}}function pM(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return ud(n,t),n}}function gM(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=i3(e,t.children),i=yM(e,t.properties);e.stack.pop();let l=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(l=!0,e.schema.ancestors&&Xi.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let f=-1;for(l=!1;++f<c.length;)e.stack.includes(c[f])&&(l=!0)}if(!l)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return ud(o,t),o}function bM(e,t){const r={type:"root",children:i3(e,t.children)};return ud(r,t),r}function xM(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return ud(r,t),r}function i3(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const l=s3(e,r[i]);l&&(Array.isArray(l)?n.push(...l):n.push(l))}}return n}function yM(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,l=r&&Xi.call(r,n)?r[n]:void 0,o=r&&Xi.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},f={};let h;for(h in c)if(Xi.call(c,h)){const p=c[h];let g=Y_(e,W_(l,h),h,p);g==null&&(g=Y_(e,W_(o,h),h,p)),g!=null&&(f[h]=g)}if(i&&Xi.call(i,n)){const p=i[n];for(h in p)Xi.call(p,h)&&!Xi.call(f,h)&&(f[h]=p[h])}return f}function Y_(e,t,n,r){return t?Array.isArray(r)?EM(e,t,n,r):l3(e,t,n,r):void 0}function EM(e,t,n,r){let i=-1;const l=[];for(;++i<r.length;){const o=l3(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&l.push(o)}return l}function l3(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&_M(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,l=0;for(;++l<t.length;){const o=t[l];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function _M(e,t,n){const r=e.schema.protocols&&Xi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),l=i.indexOf(":"),o=i.indexOf("?"),c=i.indexOf("#"),f=i.indexOf("/");if(l<0||f>-1&&l>f||o>-1&&l>o||c>-1&&l>c)return!0;let h=-1;for(;++h<r.length;){const p=r[h];if(l===p.length&&i.slice(0,p.length)===p)return!0}return!1}function ud(e,t){const n=e3(t);t.data&&(e.data=Kl(t.data)),n&&(e.position=n)}function W_(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],l=typeof i=="string"?i:i[0];if(l===t)return i;l==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function o3(e){return function(t){return hM(t,e)}}const Ur=sl(/[A-Za-z]/),Ar=sl(/[\dA-Za-z]/),TM=sl(/[#-'*+\--9=?A-Z^-~]/);function Sh(e){return e!==null&&(e<32||e===127)}const Qg=sl(/\d/),vM=sl(/[\dA-Fa-f]/),kM=sl(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function gn(e){return e!==null&&(e<0||e===32)}function Ht(e){return e===-2||e===-1||e===32}const rm=sl(new RegExp("\\p{P}|\\p{S}","u")),Zl=sl(/\s/);function sl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function CM(e,t,n){const i=Qh((n||{}).ignore||[]),l=SM(t);let o=-1;for(;++o<l.length;)X1(e,"text",c);function c(h,p){let g=-1,x;for(;++g<p.length;){const E=p[g],v=x?x.children:void 0;if(i(E,v?v.indexOf(E):void 0,x))return;x=E}if(x)return f(h,p)}function f(h,p){const g=p[p.length-1],x=l[o][0],E=l[o][1];let v=0;const N=g.children.indexOf(h);let w=!1,R=[];x.lastIndex=0;let C=x.exec(h.value);for(;C;){const O=C.index,Y={index:C.index,input:C.input,stack:[...p,h]};let P=E(...C,Y);if(typeof P=="string"&&(P=P.length>0?{type:"text",value:P}:void 0),P===!1?x.lastIndex=O+1:(v!==O&&R.push({type:"text",value:h.value.slice(v,O)}),Array.isArray(P)?R.push(...P):P&&R.push(P),v=O+C[0].length,w=!0),!x.global)break;C=x.exec(h.value)}return w?(v<h.value.length&&R.push({type:"text",value:h.value.slice(v)}),g.children.splice(N,1,...R)):R=[h],N+R.length}}function SM(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([NM(i[0]),AM(i[1])])}return t}function NM(e){return typeof e=="string"?new RegExp(wM(e),"g"):e}function AM(e){return typeof e=="function"?e:function(){return e}}const q0="phrasing",Y0=["autolink","link","image","label"];function RM(){return{transforms:[PM],enter:{literalAutolink:IM,literalAutolinkEmail:W0,literalAutolinkHttp:W0,literalAutolinkWww:W0},exit:{literalAutolink:MM,literalAutolinkEmail:jM,literalAutolinkHttp:OM,literalAutolinkWww:DM}}}function LM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:q0,notInConstruct:Y0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:q0,notInConstruct:Y0},{character:":",before:"[ps]",after:"\\/",inConstruct:q0,notInConstruct:Y0}]}}function IM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function W0(e){this.config.enter.autolinkProtocol.call(this,e)}function OM(e){this.config.exit.autolinkProtocol.call(this,e)}function DM(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function jM(e){this.config.exit.autolinkEmail.call(this,e)}function MM(e){this.exit(e)}function PM(e){CM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),UM]],{ignore:["link","linkReference"]})}function BM(e,t,n,r,i){let l="";if(!u3(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!HM(n)))return!1;const o=FM(n+r);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function UM(e,t,n,r){return!u3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function HM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function FM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ph(e,"(");let l=ph(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function u3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Zl(n)||rm(n))&&(!t||n!==47)}function as(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}c3.peek=XM;function zM(){this.buffer()}function $M(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VM(){this.buffer()}function GM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function qM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=as(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YM(e){this.exit(e)}function WM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=as(this.sliceSerialize(e)).toLowerCase(),n.label=t}function QM(e){this.exit(e)}function XM(){return"["}function c3(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=i.move("]"),l}function KM(){return{enter:{gfmFootnoteCallString:zM,gfmFootnoteCall:$M,gfmFootnoteDefinitionLabelString:VM,gfmFootnoteDefinition:GM},exit:{gfmFootnoteCallString:qM,gfmFootnoteCall:YM,gfmFootnoteDefinitionLabelString:WM,gfmFootnoteDefinition:QM}}}function ZM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:c3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){const c=l.createTracker(o);let f=c.move("[^");const h=l.enter("footnoteDefinition"),p=l.enter("label");return f+=c.move(l.safe(l.associationId(r),{before:f,after:"]"})),p(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
245
|
-
`:" ")+l.indentLines(l.containerFlow(r,c.current()),t?d3:JM))),h(),f}}function JM(e,t,n){return t===0?e:d3(e,t,n)}function d3(e,t,n){return(n?"":" ")+e}const e7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];f3.peek=s7;function t7(){return{canContainEols:["delete"],enter:{strikethrough:r7},exit:{strikethrough:a7}}}function n7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:e7}],handlers:{delete:f3}}}function r7(e){this.enter({type:"delete",children:[]},e)}function a7(e){this.exit(e)}function f3(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function s7(){return"~"}function i7(e){return e.length}function l7(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||i7,l=[],o=[],c=[],f=[];let h=0,p=-1;for(;++p<e.length;){const S=[],N=[];let w=-1;for(e[p].length>h&&(h=e[p].length);++w<e[p].length;){const R=o7(e[p][w]);if(n.alignDelimiters!==!1){const C=i(R);N[w]=C,(f[w]===void 0||C>f[w])&&(f[w]=C)}S.push(R)}o[p]=S,c[p]=N}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<h;)l[g]=Q_(r[g]);else{const S=Q_(r);for(;++g<h;)l[g]=S}g=-1;const x=[],E=[];for(;++g<h;){const S=l[g];let N="",w="";S===99?(N=":",w=":"):S===108?N=":":S===114&&(w=":");let R=n.alignDelimiters===!1?1:Math.max(1,f[g]-N.length-w.length);const C=N+"-".repeat(R)+w;n.alignDelimiters!==!1&&(R=N.length+R+w.length,R>f[g]&&(f[g]=R),E[g]=R),x[g]=C}o.splice(1,0,x),c.splice(1,0,E),p=-1;const v=[];for(;++p<o.length;){const S=o[p],N=c[p];g=-1;const w=[];for(;++g<h;){const R=S[g]||"";let C="",O="";if(n.alignDelimiters!==!1){const Y=f[g]-(N[g]||0),P=l[g];P===114?C=" ".repeat(Y):P===99?Y%2?(C=" ".repeat(Y/2+.5),O=" ".repeat(Y/2-.5)):(C=" ".repeat(Y/2),O=C):O=" ".repeat(Y)}n.delimiterStart!==!1&&!g&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||g)&&w.push(" "),n.alignDelimiters!==!1&&w.push(C),w.push(R),n.alignDelimiters!==!1&&w.push(O),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&w.push("|")}v.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return v.join(`
|
|
246
|
-
`)}function o7(e){return e==null?"":String(e)}function Q_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function u7(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),c7);return i(),o}function c7(e,t,n){return">"+(n?"":" ")+e}function d7(e,t){return X_(e,t.inConstruct,!0)&&!X_(e,t.notInConstruct,!1)}function X_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function K_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
247
|
-
`&&d7(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
248
|
-
`}function f7(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+t.length,r=n.indexOf(t,i);return o}function h7(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function m7(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function p7(e,t,n,r){const i=m7(n),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(h7(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(l,g7);return g(),x}const c=n.createTracker(r),f=i.repeat(Math.max(f7(l,i)+1,3)),h=n.enter("codeFenced");let p=c.move(f);if(e.lang){const g=n.enter(`codeFencedLang${o}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${o}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
249
|
-
`,encode:["`"],...c.current()})),g()}return p+=c.move(`
|
|
250
|
-
`),l&&(p+=c.move(l+`
|
|
251
|
-
`)),p+=c.move(f),h(),p}function g7(e,t,n){return(n?"":" ")+e}function lb(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function b7(e,t,n,r){const i=lb(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
252
|
-
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+i),h+=f.move(n.safe(e.title,{before:h,after:i,...f.current()})),h+=f.move(i),c()),o(),h}function x7(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Kc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cu(e){if(e===null||gn(e)||Zl(e))return 1;if(rm(e))return 2}function Nh(e,t,n){const r=cu(e),i=cu(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}h3.peek=y7;function h3(e,t,n,r){const i=x7(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(i);let f=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const h=f.charCodeAt(0),p=Nh(r.before.charCodeAt(r.before.length-1),h,i);p.inside&&(f=Kc(h)+f.slice(1));const g=f.charCodeAt(f.length-1),x=Nh(r.after.charCodeAt(0),g,i);x.inside&&(f=f.slice(0,-1)+Kc(g));const E=o.move(i);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},c+f+E}function y7(e,t,n){return n.options.emphasis||"*"}const E7={};function ob(e,t){const n=E7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return m3(e,r,i)}function m3(e,t,n){if(_7(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Z_(e.children,t,n)}return Array.isArray(e)?Z_(e,t,n):""}function Z_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=m3(e[i],t,n);return r.join("")}function _7(e){return!!(e&&typeof e=="object")}function T7(e,t){let n=!1;return vs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zg}),!!((!e.depth||e.depth<3)&&ob(e)&&(t.options.setext||n))}function v7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(T7(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...l.current(),before:`
|
|
253
|
-
`,after:`
|
|
254
|
-
`});return g(),p(),x+`
|
|
255
|
-
`+(i===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
256
|
-
`))+1))}const o="#".repeat(i),c=n.enter("headingAtx"),f=n.enter("phrasing");l.move(o+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
257
|
-
`,...l.current()});return/^[\t ]/.test(h)&&(h=Kc(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),f(),c(),h}p3.peek=k7;function p3(e){return e.value||""}function k7(){return"<"}g3.peek=w7;function g3(e,t,n,r){const i=lb(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+i),h+=f.move(n.safe(e.title,{before:h,after:i,...f.current()})),h+=f.move(i),c()),h+=f.move(")"),o(),h}function w7(){return"!"}b3.peek=C7;function b3(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const h=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!h||h!==g?f+=c.move(g+"]"):i==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function C7(){return"!"}x3.peek=S7;function x3(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let f;if(o.atBreak)for(;f=c.exec(r);){let h=f.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(f.index+1)}}return i+r+i}function S7(){return"`"}function y3(e,t){const n=ob(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}E3.peek=N7;function E3(e,t,n,r){const i=lb(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,f;if(y3(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=o.move("<");return g+=o.move(n.containerPhrasing(e,{before:g,after:">",...o.current()})),g+=o.move(">"),c(),n.stack=p,g}c=n.enter("link"),f=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(f=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=o.move(" "+i),h+=o.move(n.safe(e.title,{before:h,after:i,...o.current()})),h+=o.move(i),f()),h+=o.move(")"),c(),h}function N7(e,t,n){return y3(e,n)?"<":"["}_3.peek=A7;function _3(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!h||h!==g?f+=c.move(g+"]"):i==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function A7(){return"["}function ub(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function R7(e){const t=ub(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function L7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function T3(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function I7(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?L7(n):ub(n);const c=e.ordered?o==="."?")":".":R7(n);let f=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),T3(n)===o&&p){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(o=c),n.bulletCurrent=o;const h=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),h}function O7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function D7(e,t,n,r){const i=O7(n);let l=n.bulletCurrent||ub(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(r);c.move(l+" ".repeat(o-l.length)),c.shift(o);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),p);return f(),h;function p(g,x,E){return x?(E?"":" ".repeat(o))+g:(E?l:l+" ".repeat(o-l.length))+g}}function j7(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}const M7=Qh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function P7(e,t,n,r){return(e.children.some(function(o){return M7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function B7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}v3.peek=U7;function v3(e,t,n,r){const i=B7(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(i+i);let f=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const h=f.charCodeAt(0),p=Nh(r.before.charCodeAt(r.before.length-1),h,i);p.inside&&(f=Kc(h)+f.slice(1));const g=f.charCodeAt(f.length-1),x=Nh(r.after.charCodeAt(0),g,i);x.inside&&(f=f.slice(0,-1)+Kc(g));const E=o.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},c+f+E}function U7(e,t,n){return n.options.strong||"*"}function H7(e,t,n,r){return n.safe(e.value,r)}function F7(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function z7(e,t,n){const r=(T3(n)+(n.options.ruleSpaces?" ":"")).repeat(F7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const k3={blockquote:u7,break:K_,code:p7,definition:b7,emphasis:h3,hardBreak:K_,heading:v7,html:p3,image:g3,imageReference:b3,inlineCode:x3,link:E3,linkReference:_3,list:I7,listItem:D7,paragraph:j7,root:P7,strong:v3,text:H7,thematicBreak:z7},J_=document.createElement("i");function cb(e){const t="&"+e+";";J_.innerHTML=t;const n=J_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function w3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const $7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V7(e){return e.replace($7,G7)}function G7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return w3(n.slice(l?2:1),l?16:10)}return cb(n)||e}function q7(){return{enter:{table:Y7,tableData:eT,tableHeader:eT,tableRow:Q7},exit:{codeText:X7,table:W7,tableData:Q0,tableHeader:Q0,tableRow:Q0}}}function Y7(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function W7(e){this.exit(e),this.data.inTable=void 0}function Q7(e){this.enter({type:"tableRow",children:[]},e)}function Q0(e){this.exit(e)}function eT(e){this.enter({type:"tableCell",children:[]},e)}function X7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,K7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function K7(e,t){return t==="|"?t:e}function Z7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
258
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:o,tableCell:f,tableRow:c}};function o(E,v,S,N){return h(p(E,S,N),E.align)}function c(E,v,S,N){const w=g(E,S,N),R=h([w]);return R.slice(0,R.indexOf(`
|
|
259
|
-
`))}function f(E,v,S,N){const w=S.enter("tableCell"),R=S.enter("phrasing"),C=S.containerPhrasing(E,{...N,before:l,after:l});return R(),w(),C}function h(E,v){return l7(E,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function p(E,v,S){const N=E.children;let w=-1;const R=[],C=v.enter("table");for(;++w<N.length;)R[w]=g(N[w],v,S);return C(),R}function g(E,v,S){const N=E.children;let w=-1;const R=[],C=v.enter("tableRow");for(;++w<N.length;)R[w]=f(N[w],E,v,S);return C(),R}function x(E,v,S){let N=k3.inlineCode(E,v,S);return S.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function J7(){return{exit:{taskListCheckValueChecked:tT,taskListCheckValueUnchecked:tT,paragraph:tP}}}function eP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nP}}}function tT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tP(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,o;for(;++l<i.length;){const c=i[l];if(c.type==="paragraph"){o=c;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function nP(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let f=k3.listItem(e,t,n,{...r,...c.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(p){return p+o}}function rP(){return[RM(),KM(),t7(),q7(),J7()]}function aP(e){return{extensions:[LM(),ZM(e),n7(),Z7(e),eP()]}}function da(e,t,n,r){const i=e.length;let l=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Ba(e,t){return e.length>0?(da(e,e.length,0,t),e):t}const nT={}.hasOwnProperty;function C3(e){const t={};let n=-1;for(;++n<e.length;)sP(t,e[n]);return t}function sP(e,t){let n;for(n in t){const i=(nT.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){nT.call(i,o)||(i[o]=[]);const c=l[o];iP(i[o],Array.isArray(c)?c:c?[c]:[])}}}function iP(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);da(e,0,0,r)}const lP={tokenize:hP,partial:!0},S3={tokenize:mP,partial:!0},N3={tokenize:pP,partial:!0},A3={tokenize:gP,partial:!0},oP={tokenize:bP,partial:!0},R3={name:"wwwAutolink",tokenize:dP,previous:I3},L3={name:"protocolAutolink",tokenize:fP,previous:O3},ui={name:"emailAutolink",tokenize:cP,previous:D3},Cs={};function uP(){return{text:Cs}}let Ul=48;for(;Ul<123;)Cs[Ul]=ui,Ul++,Ul===58?Ul=65:Ul===91&&(Ul=97);Cs[43]=ui;Cs[45]=ui;Cs[46]=ui;Cs[95]=ui;Cs[72]=[ui,L3];Cs[104]=[ui,L3];Cs[87]=[ui,R3];Cs[119]=[ui,R3];function cP(e,t,n){const r=this;let i,l;return o;function o(g){return!Xg(g)||!D3.call(r,r.previous)||db(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Xg(g)?(e.consume(g),c):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(oP,p,h)(g):g===45||g===95||Ar(g)?(l=!0,e.consume(g),f):p(g)}function h(g){return e.consume(g),i=!0,f}function p(g){return l&&i&&Ur(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function dP(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!I3.call(r,r.previous)||db(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(lP,e.attempt(S3,e.attempt(N3,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function fP(e,t,n){const r=this;let i="",l=!1;return o;function o(g){return(g===72||g===104)&&O3.call(r,r.previous)&&!db(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Ur(g)&&i.length<5)return i+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const x=i.toLowerCase();if(x==="http"||x==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),l?h:(l=!0,f)):n(g)}function h(g){return g===null||Sh(g)||gn(g)||Zl(g)||rm(g)?n(g):e.attempt(S3,e.attempt(N3,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function hP(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function mP(e,t,n){let r,i,l;return o;function o(h){return h===46||h===95?e.check(A3,f,c)(h):h===null||gn(h)||Zl(h)||h!==45&&rm(h)?f(h):(l=!0,e.consume(h),o)}function c(h){return h===95?r=!0:(i=r,r=void 0),e.consume(h),o}function f(h){return i||r||!l?n(h):t(h)}}function pP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(A3,t,l)(o):o===null||gn(o)||Zl(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function gP(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),l):c===93?(e.consume(c),i):c===60||c===null||gn(c)||Zl(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||gn(c)||Zl(c)?t(c):r(c)}function l(c){return Ur(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):Ur(c)?(e.consume(c),o):n(c)}}function bP(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Ar(l)?n(l):t(l)}}function I3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gn(e)}function O3(e){return!Ur(e)}function D3(e){return!(e===47||Xg(e))}function Xg(e){return e===43||e===45||e===46||e===95||Ar(e)}function db(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function vu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Ar(e.charCodeAt(n+1))&&Ar(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function am(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Kg={name:"attention",resolveAll:xP,tokenize:yP};function xP(e,t){let n=-1,r,i,l,o,c,f,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},x={...e[n][1].start};rT(g,-f),rT(x,f),o={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},l={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Ba(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Ba(h,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),h=Ba(h,am(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Ba(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Ba(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,da(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=cu(r);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===l)return e.consume(f),c;const h=e.exit("attentionSequence"),p=cu(f),g=!p||p===2&&i||n.includes(f),x=!i||i===2&&p||n.includes(r);return h._open=!!(l===42?g:g&&(i||!x)),h._close=!!(l===42?x:x&&(p||!g)),t(f)}}function rT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const EP={name:"autolink",tokenize:_P};function _P(e,t,n){let r=0;return i;function i(E){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(E){return Ur(E)?(e.consume(E),o):E===64?n(E):h(E)}function o(E){return E===43||E===45||E===46||Ar(E)?(r=1,c(E)):h(E)}function c(E){return E===58?(e.consume(E),r=0,f):(E===43||E===45||E===46||Ar(E))&&r++<32?(e.consume(E),c):(r=0,h(E))}function f(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||Sh(E)?n(E):(e.consume(E),f)}function h(E){return E===64?(e.consume(E),p):TM(E)?(e.consume(E),h):n(E)}function p(E){return Ar(E)?g(E):n(E)}function g(E){return E===46?(e.consume(E),r=0,p):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):x(E)}function x(E){if((E===45||Ar(E))&&r++<63){const v=E===45?x:g;return e.consume(E),v}return n(E)}}function Gt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return Ht(f)?(e.enter(n),c(f)):t(f)}function c(f){return Ht(f)&&l++<i?(e.consume(f),c):(e.exit(n),t(f))}}const cd={partial:!0,tokenize:TP};function TP(e,t,n){return r;function r(l){return Ht(l)?Gt(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||it(l)?t(l):n(l)}}const j3={continuation:{tokenize:kP},exit:wP,name:"blockQuote",tokenize:vP};function vP(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return Ht(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function kP(e,t,n){const r=this;return i;function i(o){return Ht(o)?Gt(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(j3,t,n)(o)}}function wP(e){e.exit("blockQuote")}const M3={name:"characterEscape",tokenize:CP};function CP(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return kM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const P3={name:"characterReference",tokenize:SP};function SP(e,t,n){const r=this;let i=0,l,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,o=Ar,p(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=vM,p):(e.enter("characterReferenceValue"),l=7,o=Qg,p(g))}function p(g){if(g===59&&i){const x=e.exit("characterReferenceValue");return o===Ar&&!cb(r.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&i++<l?(e.consume(g),p):n(g)}}const aT={partial:!0,tokenize:AP},sT={concrete:!0,name:"codeFenced",tokenize:NP};function NP(e,t,n){const r=this,i={partial:!0,tokenize:Y};let l=0,o=0,c;return f;function f(P){return h(P)}function h(P){const B=r.events[r.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,c=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(P)}function p(P){return P===c?(o++,e.consume(P),p):o<3?n(P):(e.exit("codeFencedFenceSequence"),Ht(P)?Gt(e,g,"whitespace")(P):g(P))}function g(P){return P===null||it(P)?(e.exit("codeFencedFence"),r.interrupt?t(P):e.check(aT,S,O)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(P))}function x(P){return P===null||it(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(P)):Ht(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Gt(e,E,"whitespace")(P)):P===96&&P===c?n(P):(e.consume(P),x)}function E(P){return P===null||it(P)?g(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(P))}function v(P){return P===null||it(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(P)):P===96&&P===c?n(P):(e.consume(P),v)}function S(P){return e.attempt(i,O,N)(P)}function N(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),w}function w(P){return l>0&&Ht(P)?Gt(e,R,"linePrefix",l+1)(P):R(P)}function R(P){return P===null||it(P)?e.check(aT,S,O)(P):(e.enter("codeFlowValue"),C(P))}function C(P){return P===null||it(P)?(e.exit("codeFlowValue"),R(P)):(e.consume(P),C)}function O(P){return e.exit("codeFenced"),t(P)}function Y(P,B,G){let le=0;return Q;function Q(re){return P.enter("lineEnding"),P.consume(re),P.exit("lineEnding"),ce}function ce(re){return P.enter("codeFencedFence"),Ht(re)?Gt(P,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):W(re)}function W(re){return re===c?(P.enter("codeFencedFenceSequence"),fe(re)):G(re)}function fe(re){return re===c?(le++,P.consume(re),fe):le>=o?(P.exit("codeFencedFenceSequence"),Ht(re)?Gt(P,ge,"whitespace")(re):ge(re)):G(re)}function ge(re){return re===null||it(re)?(P.exit("codeFencedFence"),B(re)):G(re)}}}function AP(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const X0={name:"codeIndented",tokenize:LP},RP={partial:!0,tokenize:IP};function LP(e,t,n){const r=this;return i;function i(h){return e.enter("codeIndented"),Gt(e,l,"linePrefix",5)(h)}function l(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?f(h):it(h)?e.attempt(RP,o,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||it(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function IP(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Gt(e,l,"linePrefix",5)(o)}function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):it(o)?i(o):n(o)}}const OP={name:"codeText",previous:jP,resolve:DP,tokenize:MP};function DP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function jP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function MP(e,t,n){let r=0,i,l;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(l=e.enter("codeTextSequence"),i=0,p(g)):it(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||it(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),h)}function p(g){return g===96?(e.consume(g),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",h(g))}}class PP{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&xc(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),xc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),xc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);xc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);xc(this.left,n.reverse())}}}function xc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function B3(e){const t={};let n=-1,r,i,l,o,c,f,h;const p=new PP(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,BP(p,n)),n=t[n],h=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(o=p.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return da(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function BP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,f=[],h={};let p,g,x=-1,E=n,v=0,S=0;const N=[S];for(;E;){for(;e.get(++i)[1]!==E;);l.push(i),E._tokenizer||(p=r.sliceStream(E),E.next||p.push(null),g&&o.defineSkip(E.start),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=E,E=E.next}for(E=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(S=x+1,N.push(S),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):N.pop(),x=N.length;x--;){const w=c.slice(N[x],N[x+1]),R=l.pop();f.push([R,R+w.length-1]),e.splice(R,2,w)}for(f.reverse(),x=-1;++x<f.length;)h[v+f[x][0]]=v+f[x][1],v+=f[x][1]-f[x][0]-1;return h}const UP={resolve:FP,tokenize:zP},HP={partial:!0,tokenize:$P};function FP(e){return B3(e),e}function zP(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?l(c):it(c)?e.check(HP,o,l)(c):(e.consume(c),i)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function $P(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Gt(e,l,"linePrefix")}function l(o){if(o===null||it(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function U3(e,t,n,r,i,l,o,c,f){const h=f||Number.POSITIVE_INFINITY;let p=0;return g;function g(w){return w===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(w),e.exit(l),x):w===null||w===32||w===41||Sh(w)?n(w):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(w))}function x(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(w))}function E(w){return w===62?(e.exit("chunkString"),e.exit(c),x(w)):w===null||w===60||it(w)?n(w):(e.consume(w),w===92?v:E)}function v(w){return w===60||w===62||w===92?(e.consume(w),E):E(w)}function S(w){return!p&&(w===null||w===41||gn(w))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(w)):p<h&&w===40?(e.consume(w),p++,S):w===41?(e.consume(w),p--,S):w===null||w===32||w===40||Sh(w)?n(w):(e.consume(w),w===92?N:S)}function N(w){return w===40||w===41||w===92?(e.consume(w),S):S(w)}}function H3(e,t,n,r,i,l){const o=this;let c=0,f;return h;function h(E){return e.enter(r),e.enter(i),e.consume(E),e.exit(i),e.enter(l),p}function p(E){return c>999||E===null||E===91||E===93&&!f||E===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(E):E===93?(e.exit(l),e.enter(i),e.consume(E),e.exit(i),e.exit(r),t):it(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||E===91||E===93||it(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),f||(f=!Ht(E)),E===92?x:g)}function x(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function F3(e,t,n,r,i,l){let o;return c;function c(x){return x===34||x===39||x===40?(e.enter(r),e.enter(i),e.consume(x),e.exit(i),o=x===40?41:x,f):n(x)}function f(x){return x===o?(e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):(e.enter(l),h(x))}function h(x){return x===o?(e.exit(l),f(o)):x===null?n(x):it(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Gt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===o||x===null||it(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:p)}function g(x){return x===o||x===92?(e.consume(x),p):p(x)}}function Uc(e,t){let n;return r;function r(i){return it(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ht(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const VP={name:"definition",tokenize:qP},GP={partial:!0,tokenize:YP};function qP(e,t,n){const r=this;let i;return l;function l(E){return e.enter("definition"),o(E)}function o(E){return H3.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return i=as(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),f):n(E)}function f(E){return gn(E)?Uc(e,h)(E):h(E)}function h(E){return U3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(GP,g,g)(E)}function g(E){return Ht(E)?Gt(e,x,"whitespace")(E):x(E)}function x(E){return E===null||it(E)?(e.exit("definition"),r.parser.defined.push(i),t(E)):n(E)}}function YP(e,t,n){return r;function r(c){return gn(c)?Uc(e,i)(c):n(c)}function i(c){return F3(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Ht(c)?Gt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||it(c)?t(c):n(c)}}const WP={name:"hardBreakEscape",tokenize:QP};function QP(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return it(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const XP={name:"headingAtx",resolve:KP,tokenize:ZP};function KP(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},da(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function ZP(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||gn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):Ht(p)?Gt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function h(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),h)}}const JP=["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"],iT=["pre","script","style","textarea"],eB={concrete:!0,name:"htmlFlow",resolveTo:rB,tokenize:aB},tB={partial:!0,tokenize:iB},nB={partial:!0,tokenize:sB};function rB(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function aB(e,t,n){const r=this;let i,l,o,c,f;return h;function h(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),g}function g(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),l=!0,S):D===63?(e.consume(D),i=3,r.interrupt?t:A):Ur(D)?(e.consume(D),o=String.fromCharCode(D),N):n(D)}function x(D){return D===45?(e.consume(D),i=2,E):D===91?(e.consume(D),i=5,c=0,v):Ur(D)?(e.consume(D),i=4,r.interrupt?t:A):n(D)}function E(D){return D===45?(e.consume(D),r.interrupt?t:A):n(D)}function v(D){const we="CDATA[";return D===we.charCodeAt(c++)?(e.consume(D),c===we.length?r.interrupt?t:W:v):n(D)}function S(D){return Ur(D)?(e.consume(D),o=String.fromCharCode(D),N):n(D)}function N(D){if(D===null||D===47||D===62||gn(D)){const we=D===47,Re=o.toLowerCase();return!we&&!l&&iT.includes(Re)?(i=1,r.interrupt?t(D):W(D)):JP.includes(o.toLowerCase())?(i=6,we?(e.consume(D),w):r.interrupt?t(D):W(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):l?R(D):C(D))}return D===45||Ar(D)?(e.consume(D),o+=String.fromCharCode(D),N):n(D)}function w(D){return D===62?(e.consume(D),r.interrupt?t:W):n(D)}function R(D){return Ht(D)?(e.consume(D),R):Q(D)}function C(D){return D===47?(e.consume(D),Q):D===58||D===95||Ur(D)?(e.consume(D),O):Ht(D)?(e.consume(D),C):Q(D)}function O(D){return D===45||D===46||D===58||D===95||Ar(D)?(e.consume(D),O):Y(D)}function Y(D){return D===61?(e.consume(D),P):Ht(D)?(e.consume(D),Y):C(D)}function P(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),f=D,B):Ht(D)?(e.consume(D),P):G(D)}function B(D){return D===f?(e.consume(D),f=null,le):D===null||it(D)?n(D):(e.consume(D),B)}function G(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||gn(D)?Y(D):(e.consume(D),G)}function le(D){return D===47||D===62||Ht(D)?C(D):n(D)}function Q(D){return D===62?(e.consume(D),ce):n(D)}function ce(D){return D===null||it(D)?W(D):Ht(D)?(e.consume(D),ce):n(D)}function W(D){return D===45&&i===2?(e.consume(D),F):D===60&&i===1?(e.consume(D),$):D===62&&i===4?(e.consume(D),H):D===63&&i===3?(e.consume(D),A):D===93&&i===5?(e.consume(D),he):it(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(tB,te,fe)(D)):D===null||it(D)?(e.exit("htmlFlowData"),fe(D)):(e.consume(D),W)}function fe(D){return e.check(nB,ge,te)(D)}function ge(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),re}function re(D){return D===null||it(D)?fe(D):(e.enter("htmlFlowData"),W(D))}function F(D){return D===45?(e.consume(D),A):W(D)}function $(D){return D===47?(e.consume(D),o="",J):W(D)}function J(D){if(D===62){const we=o.toLowerCase();return iT.includes(we)?(e.consume(D),H):W(D)}return Ur(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),J):W(D)}function he(D){return D===93?(e.consume(D),A):W(D)}function A(D){return D===62?(e.consume(D),H):D===45&&i===2?(e.consume(D),A):W(D)}function H(D){return D===null||it(D)?(e.exit("htmlFlowData"),te(D)):(e.consume(D),H)}function te(D){return e.exit("htmlFlow"),t(D)}}function sB(e,t,n){const r=this;return i;function i(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function iB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(cd,t,n)}}const lB={name:"htmlText",tokenize:oB};function oB(e,t,n){const r=this;let i,l,o;return c;function c(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),Y):A===63?(e.consume(A),C):Ur(A)?(e.consume(A),G):n(A)}function h(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),l=0,v):Ur(A)?(e.consume(A),R):n(A)}function p(A){return A===45?(e.consume(A),E):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),x):it(A)?(o=g,$(A)):(e.consume(A),g)}function x(A){return A===45?(e.consume(A),E):g(A)}function E(A){return A===62?F(A):A===45?x(A):g(A)}function v(A){const H="CDATA[";return A===H.charCodeAt(l++)?(e.consume(A),l===H.length?S:v):n(A)}function S(A){return A===null?n(A):A===93?(e.consume(A),N):it(A)?(o=S,$(A)):(e.consume(A),S)}function N(A){return A===93?(e.consume(A),w):S(A)}function w(A){return A===62?F(A):A===93?(e.consume(A),w):S(A)}function R(A){return A===null||A===62?F(A):it(A)?(o=R,$(A)):(e.consume(A),R)}function C(A){return A===null?n(A):A===63?(e.consume(A),O):it(A)?(o=C,$(A)):(e.consume(A),C)}function O(A){return A===62?F(A):C(A)}function Y(A){return Ur(A)?(e.consume(A),P):n(A)}function P(A){return A===45||Ar(A)?(e.consume(A),P):B(A)}function B(A){return it(A)?(o=B,$(A)):Ht(A)?(e.consume(A),B):F(A)}function G(A){return A===45||Ar(A)?(e.consume(A),G):A===47||A===62||gn(A)?le(A):n(A)}function le(A){return A===47?(e.consume(A),F):A===58||A===95||Ur(A)?(e.consume(A),Q):it(A)?(o=le,$(A)):Ht(A)?(e.consume(A),le):F(A)}function Q(A){return A===45||A===46||A===58||A===95||Ar(A)?(e.consume(A),Q):ce(A)}function ce(A){return A===61?(e.consume(A),W):it(A)?(o=ce,$(A)):Ht(A)?(e.consume(A),ce):le(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,fe):it(A)?(o=W,$(A)):Ht(A)?(e.consume(A),W):(e.consume(A),ge)}function fe(A){return A===i?(e.consume(A),i=void 0,re):A===null?n(A):it(A)?(o=fe,$(A)):(e.consume(A),fe)}function ge(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||gn(A)?le(A):(e.consume(A),ge)}function re(A){return A===47||A===62||gn(A)?le(A):n(A)}function F(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function $(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),J}function J(A){return Ht(A)?Gt(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):he(A)}function he(A){return e.enter("htmlTextData"),o(A)}}const fb={name:"labelEnd",resolveAll:fB,resolveTo:hB,tokenize:mB},uB={tokenize:pB},cB={tokenize:gB},dB={tokenize:bB};function fB(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&da(e,0,e.length,n),e}function hB(e,t){let n=e.length,r=0,i,l,o,c;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",f,t],["enter",h,t]],c=Ba(c,e.slice(l+1,l+r+3)),c=Ba(c,[["enter",p,t]]),c=Ba(c,am(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Ba(c,[["exit",p,t],e[o-2],e[o-1],["exit",h,t]]),c=Ba(c,e.slice(o+1)),c=Ba(c,[["exit",f,t]]),da(e,l,e.length,c),e}function mB(e,t,n){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return c;function c(x){return l?l._inactive?g(x):(o=r.parser.defined.includes(as(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f):n(x)}function f(x){return x===40?e.attempt(uB,p,o?p:g)(x):x===91?e.attempt(cB,p,o?h:g)(x):o?p(x):g(x)}function h(x){return e.attempt(dB,p,g)(x)}function p(x){return t(x)}function g(x){return l._balanced=!0,n(x)}}function pB(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),i}function i(g){return gn(g)?Uc(e,l)(g):l(g)}function l(g){return g===41?p(g):U3(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return gn(g)?Uc(e,f)(g):p(g)}function c(g){return n(g)}function f(g){return g===34||g===39||g===40?F3(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function h(g){return gn(g)?Uc(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function gB(e,t,n){const r=this;return i;function i(c){return H3.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(as(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function bB(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const xB={name:"labelStartImage",resolveAll:fb.resolveAll,tokenize:yB};function yB(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const EB={name:"labelStartLink",resolveAll:fb.resolveAll,tokenize:_B};function _B(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const K0={name:"lineEnding",tokenize:TB};function TB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Gt(e,t,"linePrefix")}}const lh={name:"thematicBreak",tokenize:vB};function vB(e,t,n){let r=0,i;return l;function l(h){return e.enter("thematicBreak"),o(h)}function o(h){return i=h,c(h)}function c(h){return h===i?(e.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||it(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===i?(e.consume(h),r++,f):(e.exit("thematicBreakSequence"),Ht(h)?Gt(e,c,"whitespace")(h):c(h))}}const Kr={continuation:{tokenize:SB},exit:AB,name:"list",tokenize:CB},kB={partial:!0,tokenize:RB},wB={partial:!0,tokenize:NB};function CB(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(E){const v=r.containerState.type||(E===42||E===43||E===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||E===r.containerState.marker:Qg(E)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),E===42||E===45?e.check(lh,n,h)(E):h(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(E)}return n(E)}function f(E){return Qg(E)&&++o<10?(e.consume(E),f):(!r.interrupt||o<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),h(E)):n(E)}function h(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(cd,r.interrupt?n:p,e.attempt(kB,x,g))}function p(E){return r.containerState.initialBlankLine=!0,l++,x(E)}function g(E){return Ht(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),x):n(E)}function x(E){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function SB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(cd,i,l);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gt(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!Ht(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wB,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(Kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function NB(e,t,n){const r=this;return Gt(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function AB(e){e.exit(this.containerState.type)}function RB(e,t,n){const r=this;return Gt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!Ht(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const lT={name:"setextUnderline",resolveTo:LB,tokenize:IB};function LB(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function IB(e,t,n){const r=this;let i;return l;function l(h){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),i=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===i?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ht(h)?Gt(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||it(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const OB={tokenize:FB,partial:!0};function DB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:BB,continuation:{tokenize:UB},exit:HB}},text:{91:{name:"gfmFootnoteCall",tokenize:PB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jB,resolveTo:MB}}}}function jB(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!o||!o._balanced)return n(f);const h=as(r.sliceSerialize({start:o.end,end:r.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function MB(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function PB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(l>999||g===93&&!o||g===null||g===91||gn(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return i.includes(as(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return gn(g)||(o=!0),l++,e.consume(g),g===92?p:h}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,h):h(g)}}function BB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return f;function f(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(v)}function p(v){if(o>999||v===93&&!c||v===null||v===91||gn(v))return n(v);if(v===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return l=as(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return gn(v)||(c=!0),o++,e.consume(v),v===92?g:p}function g(v){return v===91||v===92||v===93?(e.consume(v),o++,p):p(v)}function x(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(l)||i.push(l),Gt(e,E,"gfmFootnoteDefinitionWhitespace")):n(v)}function E(v){return t(v)}}function UB(e,t,n){return e.check(cd,t,e.attempt(OB,t,n))}function HB(e){e.exit("gfmFootnoteDefinition")}function FB(e,t,n){const r=this;return Gt(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function zB(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,c){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let h=f;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[f][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[f][1].end)},g={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[f][1].start)},x=[["enter",p,c],["enter",o[h][1],c],["exit",o[h][1],c],["enter",g,c]],E=c.parser.constructs.insideSpan.null;E&&da(x,x.length,0,am(E,o.slice(h+1,f),c)),da(x,x.length,0,[["exit",g,c],["enter",o[f][1],c],["exit",o[f][1],c],["exit",p,c]]),da(o,h-1,f-h+3,x),f=h+x.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,c,f){const h=this.previous,p=this.events;let g=0;return x;function x(v){return h===126&&p[p.length-1][1].type!=="characterEscape"?f(v):(o.enter("strikethroughSequenceTemporary"),E(v))}function E(v){const S=cu(h);if(v===126)return g>1?f(v):(o.consume(v),g++,E);if(g<2&&!n)return f(v);const N=o.exit("strikethroughSequenceTemporary"),w=cu(v);return N._open=!w||w===2&&!!S,N._close=!S||S===2&&!!w,c(v)}}}class $B{constructor(){this.map=[]}add(t,n,r){VB(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function VB(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function GB(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function qB(){return{flow:{null:{name:"table",tokenize:YB,resolveAll:WB}}}}function YB(e,t,n){const r=this;let i=0,l=0,o;return c;function c(Q){let ce=r.events.length-1;for(;ce>-1;){const ge=r.events[ce][1].type;if(ge==="lineEnding"||ge==="linePrefix")ce--;else break}const W=ce>-1?r.events[ce][1].type:null,fe=W==="tableHead"||W==="tableRow"?P:f;return fe===P&&r.parser.lazy[r.now().line]?n(Q):fe(Q)}function f(Q){return e.enter("tableHead"),e.enter("tableRow"),h(Q)}function h(Q){return Q===124||(o=!0,l+=1),p(Q)}function p(Q){return Q===null?n(Q):it(Q)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),E):n(Q):Ht(Q)?Gt(e,p,"whitespace")(Q):(l+=1,o&&(o=!1,i+=1),Q===124?(e.enter("tableCellDivider"),e.consume(Q),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(Q)))}function g(Q){return Q===null||Q===124||gn(Q)?(e.exit("data"),p(Q)):(e.consume(Q),Q===92?x:g)}function x(Q){return Q===92||Q===124?(e.consume(Q),g):g(Q)}function E(Q){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(Q):(e.enter("tableDelimiterRow"),o=!1,Ht(Q)?Gt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):v(Q))}function v(Q){return Q===45||Q===58?N(Q):Q===124?(o=!0,e.enter("tableCellDivider"),e.consume(Q),e.exit("tableCellDivider"),S):Y(Q)}function S(Q){return Ht(Q)?Gt(e,N,"whitespace")(Q):N(Q)}function N(Q){return Q===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(Q),e.exit("tableDelimiterMarker"),w):Q===45?(l+=1,w(Q)):Q===null||it(Q)?O(Q):Y(Q)}function w(Q){return Q===45?(e.enter("tableDelimiterFiller"),R(Q)):Y(Q)}function R(Q){return Q===45?(e.consume(Q),R):Q===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(Q),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(Q))}function C(Q){return Ht(Q)?Gt(e,O,"whitespace")(Q):O(Q)}function O(Q){return Q===124?v(Q):Q===null||it(Q)?!o||i!==l?Y(Q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(Q)):Y(Q)}function Y(Q){return n(Q)}function P(Q){return e.enter("tableRow"),B(Q)}function B(Q){return Q===124?(e.enter("tableCellDivider"),e.consume(Q),e.exit("tableCellDivider"),B):Q===null||it(Q)?(e.exit("tableRow"),t(Q)):Ht(Q)?Gt(e,B,"whitespace")(Q):(e.enter("data"),G(Q))}function G(Q){return Q===null||Q===124||gn(Q)?(e.exit("data"),B(Q)):(e.consume(Q),Q===92?le:G)}function le(Q){return Q===92||Q===124?(e.consume(Q),G):G(Q)}}function WB(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,f=0,h,p,g;const x=new $B;for(;++n<e.length;){const E=e[n],v=E[1];E[0]==="enter"?v.type==="tableHead"?(c=!1,f!==0&&(oT(x,t,f,h,p),p=void 0,f=0),h={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},x.add(n,0,[["enter",h,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,g=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},x.add(n,0,[["enter",p,t]])),i=v.type==="tableDelimiterRow"?2:p?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],g=jf(x,t,l,i,void 0,g),l=[0,0,0,0]),o[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],g=jf(x,t,l,i,void 0,g)),l=o,o=[l[1],n,0,0])):v.type==="tableHead"?(c=!0,f=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],g=jf(x,t,l,i,n,g)):o[1]!==0&&(g=jf(x,t,o,i,n,g)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&oT(x,t,f,h,p),x.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=GB(t.events,n))}return e}function jf(e,t,n,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Jo(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=Jo(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=Jo(t.events,n[2]),p=Jo(t.events,n[3]),g={type:c,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const x=t.events[n[2]],E=t.events[n[3]];if(x[1].end=Object.assign({},E[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,S=n[3]-n[2]-1;e.add(v,S,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return i!==void 0&&(l.end=Object.assign({},Jo(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function oT(e,t,n,r,i){const l=[],o=Jo(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function Jo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const QB={name:"tasklistCheck",tokenize:KB};function XB(){return{text:{91:QB}}}function KB(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return gn(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return it(f)?t(f):Ht(f)?e.check({tokenize:ZB},t,n)(f):n(f)}}function ZB(e,t,n){return Gt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function JB(e){return C3([uP(),DB(),zB(e),qB(),XB()])}const eU={};function tU(e){const t=this,n=e||eU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(JB(n)),l.push(rP()),o.push(aP(n))}var nU=Object.defineProperty,rU=Object.defineProperties,aU=Object.getOwnPropertyDescriptors,uT=Object.getOwnPropertySymbols,sU=Object.prototype.hasOwnProperty,iU=Object.prototype.propertyIsEnumerable,cT=(e,t,n)=>t in e?nU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z3=(e,t)=>{for(var n in t||(t={}))sU.call(t,n)&&cT(e,n,t[n]);if(uT)for(var n of uT(t))iU.call(t,n)&&cT(e,n,t[n]);return e},$3=(e,t)=>rU(e,aU(t)),Fr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},lU=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},oU=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!lU(e,n)&&(t+=1)}return t},rl=(e,t)=>{let n=!1,r=!1,i=-1;for(let l=0;l<e.length;l+=1){if(e[l]==="\\"&&l+1<e.length&&e[l+1]==="`"){l+=1;continue}if(e.substring(l,l+3)==="```"){r=!r,l+=2;continue}if(!r&&e[l]==="`")if(n){if(i<t&&t<l)return!0;n=!1,i=-1}else n=!0,i=l}return!1},uU=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,cU=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(uU,(t,n,r,i)=>Fr(e,i)?t:`${n}\\>${r}`),dU=/(\*\*)([^*]*\*?)$/,fU=/(__)([^_]*?)$/,hU=/(\*\*\*)([^*]*?)$/,mU=/(\*)([^*]*?)$/,pU=/(_)([^_]*?)$/,gU=/(`)([^`]*?)$/,bU=/(~~)([^~]*?)$/,ro=/^[\s_~*`]*$/,V3=/^[\s]*[-*+][\s]+$/,xU=/[\p{L}\p{N}_]/u,yU=/^```[^`\n]*```?$/,EU=/^\*{4,}$/,_U=/(__)([^_]+)_$/,TU=/(~~)([^~]+)~$/,dT=/~~/g,al=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:xU.test(e)},vU=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},G3=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},sm=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},kU=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
260
|
-
`)return!1}return!1},q3=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?kU(e,t):!1;if(e[n]===`
|
|
261
|
-
`)return!1}return!1},wU=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
|
|
262
|
-
`)return!1}return!1},hb=(e,t,n)=>{let r=0;for(let f=t-1;f>=0;f-=1)if(e[f]===`
|
|
263
|
-
`){r=f+1;break}let i=e.length;for(let f=t;f<e.length;f+=1)if(e[f]===`
|
|
264
|
-
`){i=f;break}let l=e.substring(r,i),o=0,c=!1;for(let f of l)if(f===n)o+=1;else if(f!==" "&&f!==" "){c=!0;break}return o>=3&&!c},CU=(e,t,n,r)=>n==="\\"||e.includes("$")&&sm(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&al(n)&&al(r)||(!n||n===" "||n===" "||n===`
|
|
265
|
-
`)&&(!r||r===" "||r===" "||r===`
|
|
266
|
-
`)),Y3=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let l=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";CU(e,i,l,o)||(t+=1)}return t},SU=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&sm(e,t)||q3(e,t)||wU(e,t)||n==="_"||r==="_"||n&&r&&al(n)&&al(r)),NU=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let l=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";SU(e,i,l,o)||(t+=1)}return t},AU=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},mb=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},fT=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},RU=(e,t,n)=>{if(!t||ro.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
267
|
-
`),i=r===-1?0:r+1,l=e.substring(i,n);return V3.test(l)&&t.includes(`
|
|
268
|
-
`)?!0:hb(e,n,"*")},LU=e=>{let t=e.match(dU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Fr(e,r)||rl(e,r)||RU(e,n,r)?e:mb(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},IU=(e,t,n)=>{if(!t||ro.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
269
|
-
`),i=r===-1?0:r+1,l=e.substring(i,n);return V3.test(l)&&t.includes(`
|
|
270
|
-
`)?!0:hb(e,n,"_")},OU=e=>{let t=e.match(fU);if(!t){let i=e.match(_U);if(i){let l=e.lastIndexOf(i[1]);if(!(Fr(e,l)||rl(e,l))&&fT(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Fr(e,r)||rl(e,r)||IU(e,n,r)?e:fT(e)%2===1?`${e}__`:e},DU=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!sm(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
271
|
-
`)&&(!i||i===" "||i===" "||i===`
|
|
272
|
-
`)||r&&i&&al(r)&&al(i))continue;return n}}return-1},jU=e=>{if(!e.match(mU))return e;let t=DU(e);if(t===-1||Fr(e,t)||rl(e,t))return e;let n=e.substring(t+1);return!n||ro.test(n)?e:Y3(e)%2===1?`${e}*`:e},W3=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!sm(e,n)&&!q3(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&al(r)&&al(i))continue;return n}}return-1},MU=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
273
|
-
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},PU=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(mb(t)%2!==1)return null;let n=t.indexOf("**"),r=W3(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},BU=e=>{if(!e.match(pU))return e;let t=W3(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||ro.test(n)||Fr(e,t)||rl(e,t))return e;if(NU(e)%2===1){let r=PU(e);return r!==null?r:MU(e)}return e},UU=e=>{let t=mb(e),n=Y3(e);return t%2===0&&n%2===0},HU=(e,t,n)=>!t||ro.test(t)||Fr(e,n)||rl(e,n)?!0:hb(e,n,"*"),FU=e=>{if(EU.test(e))return e;let t=e.match(hU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return HU(e,n,r)?e:AU(e)%2===1?UU(e)?e:`${e}***`:e},zU=/<[a-zA-Z/][^>]*$/,$U=e=>{let t=e.match(zU);return!t||t.index===void 0||Fr(e,t.index)?e:e.substring(0,t.index).trimEnd()},VU=e=>!e.match(yU)||e.includes(`
|
|
274
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,GU=e=>(e.match(/```/g)||[]).length%2===1,qU=e=>{let t=VU(e);if(t!==null)return t;let n=e.match(gU);if(n&&!GU(e)){let r=n[2];if(!r||ro.test(r))return e;if(oU(e)%2===1)return`${e}\``}return e},Q3=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",YU=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Q3(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},WU=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!Q3(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},QU=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
275
|
-
`,t)!==-1&&!e.endsWith(`
|
|
276
|
-
`)?`${e}
|
|
277
|
-
$$`:`${e}$$`},XU=e=>YU(e)%2===0?e:QU(e),KU=e=>WU(e)%2===1?`${e}$`:e,ZU=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=vU(e,t);if(r===-1||Fr(e,r))return null;let i=r>0&&e[r-1]==="!",l=i?r-1:r,o=e.substring(0,l);if(i)return o;let c=e.substring(r+1,t);return n==="text-only"?`${o}${c}`:`${o}[${c}](streamdown:incomplete-link)`},hT=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Fr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=G3(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},JU=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=hT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(G3(e,t)===-1){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=hT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},X3=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Fr(e,n)){let r=ZU(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Fr(e,r)){let i=JU(e,r,t);if(i!==null)return i}return e},eH=/^-{1,2}$/,tH=/^[\s]*-{1,2}[\s]+$/,nH=/^={1,2}$/,rH=/^[\s]*={1,2}[\s]+$/,aH=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
278
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(eH.test(i)&&!n.match(tH)){let l=r.split(`
|
|
279
|
-
`).at(-1);if(l&&l.trim().length>0)return`${e}`}if(nH.test(i)&&!n.match(rH)){let l=r.split(`
|
|
280
|
-
`).at(-1);if(l&&l.trim().length>0)return`${e}`}return e},sH=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),iH=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(sH,(t,n)=>Fr(e,n)?t:"\\~"),lH=e=>{var t,n;let r=e.match(bU);if(r){let i=r[2];if(!i||ro.test(i))return e;let l=e.lastIndexOf(r[1]);if(Fr(e,l)||rl(e,l))return e;if(((t=e.match(dT))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(TU);if(i){let l=e.lastIndexOf(i[0].slice(0,2));if(Fr(e,l)||rl(e,l))return e;if(((n=e.match(dT))==null?void 0:n.length)%2===1)return`${e}~`}}return e},Z0=e=>e!==!1,oH=e=>e===!0,Br={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},uH=[{handler:{name:"singleTilde",handle:iH,priority:Br.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:cU,priority:Br.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:$U,priority:Br.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:aH,priority:Br.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:X3,priority:Br.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:FU,priority:Br.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:LU,priority:Br.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:OU,priority:Br.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:jU,priority:Br.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:BU,priority:Br.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:qU,priority:Br.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:lH,priority:Br.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:XU,priority:Br.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:KU,priority:Br.INLINE_KATEX},optionKey:"inlineKatex"}],cH=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return uH.filter(({handler:r,optionKey:i})=>r.name==="links"?Z0(e==null?void 0:e.links)||Z0(e==null?void 0:e.images):r.name==="inlineKatex"?oH(e==null?void 0:e.inlineKatex):Z0(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:$3(z3({},r),{handle:l=>X3(l,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},dH=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=cH(t),l=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var f;return{handler:$3(z3({},c),{priority:(f=c.priority)!=null?f:Br.DEFAULT}),earlyReturn:void 0}}),o=[...i,...l].sort((c,f)=>{var h,p;return((h=c.handler.priority)!=null?h:0)-((p=f.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:f}of o)if(r=c.handle(r),f!=null&&f(r))return r;return r},fH=dH;function K3(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=K3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Z3(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=K3(e))&&(r&&(r+=" "),r+=t);return r}const hH=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mH=(e,t)=>({classGroupId:e,validator:t}),J3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ah="-",mT=[],pH="arbitrary..",gH=e=>{const t=xH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return bH(o);const c=o.split(Ah),f=c[0]===""&&c.length>1?1:0;return eC(c,f,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const f=r[o],h=n[o];return f?h?hH(h,f):f:h||mT}return n[o]||mT}}},eC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const h=eC(e,t+1,l);if(h)return h}const o=n.validators;if(o===null)return;const c=t===0?e.join(Ah):e.slice(t).join(Ah),f=o.length;for(let h=0;h<f;h++){const p=o[h];if(p.validator(c))return p.classGroupId}},bH=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?pH+r:void 0})(),xH=e=>{const{theme:t,classGroups:n}=e;return yH(n,t)},yH=(e,t)=>{const n=J3();for(const r in e){const i=e[r];pb(i,n,r,t)}return n},pb=(e,t,n,r)=>{const i=e.length;for(let l=0;l<i;l++){const o=e[l];EH(o,t,n,r)}},EH=(e,t,n,r)=>{if(typeof e=="string"){_H(e,t,n);return}if(typeof e=="function"){TH(e,t,n,r);return}vH(e,t,n,r)},_H=(e,t,n)=>{const r=e===""?t:tC(t,e);r.classGroupId=n},TH=(e,t,n,r)=>{if(kH(e)){pb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mH(n,e))},vH=(e,t,n,r)=>{const i=Object.entries(e),l=i.length;for(let o=0;o<l;o++){const[c,f]=i[o];pb(f,tC(t,c),n,r)}},tC=(e,t)=>{let n=e;const r=t.split(Ah),i=r.length;for(let l=0;l<i;l++){const o=r[l];let c=n.nextPart.get(o);c||(c=J3(),n.nextPart.set(o,c)),n=c}return n},kH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,wH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(l,o)=>{n[l]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let o=n[l];if(o!==void 0)return o;if((o=r[l])!==void 0)return i(l,o),o},set(l,o){l in n?n[l]=o:i(l,o)}}},Zg="!",pT=":",CH=[],gT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),SH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const l=[];let o=0,c=0,f=0,h;const p=i.length;for(let S=0;S<p;S++){const N=i[S];if(o===0&&c===0){if(N===pT){l.push(i.slice(f,S)),f=S+1;continue}if(N==="/"){h=S;continue}}N==="["?o++:N==="]"?o--:N==="("?c++:N===")"&&c--}const g=l.length===0?i:i.slice(f);let x=g,E=!1;g.endsWith(Zg)?(x=g.slice(0,-1),E=!0):g.startsWith(Zg)&&(x=g.slice(1),E=!0);const v=h&&h>f?h-f:void 0;return gT(l,E,x,v)};if(t){const i=t+pT,l=r;r=o=>o.startsWith(i)?l(o.slice(i.length)):gT(CH,!1,o,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},NH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let l=0;l<n.length;l++){const o=n[l],c=o[0]==="[",f=t.has(o);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},AH=e=>({cache:wH(e.cacheSize),parseClassName:SH(e),sortModifiers:NH(e),...gH(e)}),RH=/\s+/,LH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=t,o=[],c=e.trim().split(RH);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:x,hasImportantModifier:E,baseClassName:v,maybePostfixModifierPosition:S}=n(p);if(g){f=p+(f.length>0?" "+f:f);continue}let N=!!S,w=r(N?v.substring(0,S):v);if(!w){if(!N){f=p+(f.length>0?" "+f:f);continue}if(w=r(v),!w){f=p+(f.length>0?" "+f:f);continue}N=!1}const R=x.length===0?"":x.length===1?x[0]:l(x).join(":"),C=E?R+Zg:R,O=C+w;if(o.indexOf(O)>-1)continue;o.push(O);const Y=i(w,N);for(let P=0;P<Y.length;++P){const B=Y[P];o.push(C+B)}f=p+(f.length>0?" "+f:f)}return f},IH=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=nC(n))&&(i&&(i+=" "),i+=r);return i},nC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=nC(e[r]))&&(n&&(n+=" "),n+=t);return n},OH=(e,...t)=>{let n,r,i,l;const o=f=>{const h=t.reduce((p,g)=>g(p),e());return n=AH(h),r=n.cache.get,i=n.cache.set,l=c,c(f)},c=f=>{const h=r(f);if(h)return h;const p=LH(f,n);return i(f,p),p};return l=o,(...f)=>l(IH(...f))},DH=[],ar=e=>{const t=n=>n[e]||DH;return t.isThemeGetter=!0,t},rC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,MH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,BH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$i=e=>jH.test(e),Rt=e=>!!e&&!Number.isNaN(Number(e)),Vi=e=>!!e&&Number.isInteger(Number(e)),J0=e=>e.endsWith("%")&&Rt(e.slice(0,-1)),ti=e=>MH.test(e),sC=()=>!0,FH=e=>PH.test(e)&&!BH.test(e),gb=()=>!1,zH=e=>UH.test(e),$H=e=>HH.test(e),VH=e=>!Ve(e)&&!qe(e),GH=e=>il(e,oC,gb),Ve=e=>rC.test(e),Hl=e=>il(e,uC,FH),bT=e=>il(e,JH,Rt),qH=e=>il(e,dC,sC),YH=e=>il(e,cC,gb),xT=e=>il(e,iC,gb),WH=e=>il(e,lC,$H),Mf=e=>il(e,fC,zH),qe=e=>aC.test(e),yc=e=>ao(e,uC),QH=e=>ao(e,cC),yT=e=>ao(e,iC),XH=e=>ao(e,oC),KH=e=>ao(e,lC),Pf=e=>ao(e,fC,!0),ZH=e=>ao(e,dC,!0),il=(e,t,n)=>{const r=rC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ao=(e,t,n=!1)=>{const r=aC.exec(e);return r?r[1]?t(r[1]):n:!1},iC=e=>e==="position"||e==="percentage",lC=e=>e==="image"||e==="url",oC=e=>e==="length"||e==="size"||e==="bg-size",uC=e=>e==="length",JH=e=>e==="number",cC=e=>e==="family-name",dC=e=>e==="number"||e==="weight",fC=e=>e==="shadow",eF=()=>{const e=ar("color"),t=ar("font"),n=ar("text"),r=ar("font-weight"),i=ar("tracking"),l=ar("leading"),o=ar("breakpoint"),c=ar("container"),f=ar("spacing"),h=ar("radius"),p=ar("shadow"),g=ar("inset-shadow"),x=ar("text-shadow"),E=ar("drop-shadow"),v=ar("blur"),S=ar("perspective"),N=ar("aspect"),w=ar("ease"),R=ar("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...O(),qe,Ve],P=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],G=()=>[qe,Ve,f],le=()=>[$i,"full","auto",...G()],Q=()=>[Vi,"none","subgrid",qe,Ve],ce=()=>["auto",{span:["full",Vi,qe,Ve]},Vi,qe,Ve],W=()=>[Vi,"auto",qe,Ve],fe=()=>["auto","min","max","fr",qe,Ve],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...G()],$=()=>[$i,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],J=()=>[$i,"screen","full","dvw","lvw","svw","min","max","fit",...G()],he=()=>[$i,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],A=()=>[e,qe,Ve],H=()=>[...O(),yT,xT,{position:[qe,Ve]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",XH,GH,{size:[qe,Ve]}],we=()=>[J0,yc,Hl],Re=()=>["","none","full",h,qe,Ve],Ne=()=>["",Rt,yc,Hl],Xe=()=>["solid","dashed","dotted","double"],Ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],je=()=>[Rt,J0,yT,xT],Dt=()=>["","none",v,qe,Ve],Ue=()=>["none",Rt,qe,Ve],jt=()=>["none",Rt,qe,Ve],an=()=>[Rt,qe,Ve],rt=()=>[$i,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ti],breakpoint:[ti],color:[sC],container:[ti],"drop-shadow":[ti],ease:["in","out","in-out"],font:[VH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ti],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ti],shadow:[ti],spacing:["px",Rt],text:[ti],"text-shadow":[ti],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$i,Ve,qe,N]}],container:["container"],columns:[{columns:[Rt,Ve,qe,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Vi,"auto",qe,Ve]}],basis:[{basis:[$i,"full","auto",c,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rt,$i,"auto","initial","none",Ve]}],grow:[{grow:["",Rt,qe,Ve]}],shrink:[{shrink:["",Rt,qe,Ve]}],order:[{order:[Vi,"first","last","none",qe,Ve]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[c,"screen",...$()]}],"min-w":[{"min-w":[c,"screen","none",...$()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,yc,Hl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ZH,qH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",J0,Ve]}],"font-family":[{font:[QH,YH,t]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,qe,Ve]}],"line-clamp":[{"line-clamp":[Rt,"none",qe,bT]}],leading:[{leading:[l,...G()]}],"list-image":[{"list-image":["none",qe,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rt,"from-font","auto",qe,Hl]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Rt,"auto",qe,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vi,qe,Ve],radial:["",qe,Ve],conic:[Vi,qe,Ve]},KH,WH]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:we()}],"gradient-via-pos":[{via:we()}],"gradient-to-pos":[{to:we()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:Re()}],"rounded-s":[{"rounded-s":Re()}],"rounded-e":[{"rounded-e":Re()}],"rounded-t":[{"rounded-t":Re()}],"rounded-r":[{"rounded-r":Re()}],"rounded-b":[{"rounded-b":Re()}],"rounded-l":[{"rounded-l":Re()}],"rounded-ss":[{"rounded-ss":Re()}],"rounded-se":[{"rounded-se":Re()}],"rounded-ee":[{"rounded-ee":Re()}],"rounded-es":[{"rounded-es":Re()}],"rounded-tl":[{"rounded-tl":Re()}],"rounded-tr":[{"rounded-tr":Re()}],"rounded-br":[{"rounded-br":Re()}],"rounded-bl":[{"rounded-bl":Re()}],"border-w":[{border:Ne()}],"border-w-x":[{"border-x":Ne()}],"border-w-y":[{"border-y":Ne()}],"border-w-s":[{"border-s":Ne()}],"border-w-e":[{"border-e":Ne()}],"border-w-bs":[{"border-bs":Ne()}],"border-w-be":[{"border-be":Ne()}],"border-w-t":[{"border-t":Ne()}],"border-w-r":[{"border-r":Ne()}],"border-w-b":[{"border-b":Ne()}],"border-w-l":[{"border-l":Ne()}],"divide-x":[{"divide-x":Ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Xe(),"hidden","none"]}],"divide-style":[{divide:[...Xe(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...Xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rt,qe,Ve]}],"outline-w":[{outline:["",Rt,yc,Hl]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",p,Pf,Mf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,Pf,Mf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Rt,Hl]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":Ne()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",x,Pf,Mf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Rt,qe,Ve]}],"mix-blend":[{"mix-blend":[...Ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":je()}],"mask-image-linear-to-pos":[{"mask-linear-to":je()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":je()}],"mask-image-t-to-pos":[{"mask-t-to":je()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":je()}],"mask-image-r-to-pos":[{"mask-r-to":je()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":je()}],"mask-image-b-to-pos":[{"mask-b-to":je()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":je()}],"mask-image-l-to-pos":[{"mask-l-to":je()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":je()}],"mask-image-x-to-pos":[{"mask-x-to":je()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":je()}],"mask-image-y-to-pos":[{"mask-y-to":je()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[qe,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":je()}],"mask-image-radial-to-pos":[{"mask-radial-to":je()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":je()}],"mask-image-conic-to-pos":[{"mask-conic-to":je()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,Ve]}],filter:[{filter:["","none",qe,Ve]}],blur:[{blur:Dt()}],brightness:[{brightness:[Rt,qe,Ve]}],contrast:[{contrast:[Rt,qe,Ve]}],"drop-shadow":[{"drop-shadow":["","none",E,Pf,Mf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Rt,qe,Ve]}],"hue-rotate":[{"hue-rotate":[Rt,qe,Ve]}],invert:[{invert:["",Rt,qe,Ve]}],saturate:[{saturate:[Rt,qe,Ve]}],sepia:[{sepia:["",Rt,qe,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,Ve]}],"backdrop-blur":[{"backdrop-blur":Dt()}],"backdrop-brightness":[{"backdrop-brightness":[Rt,qe,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[Rt,qe,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rt,qe,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rt,qe,Ve]}],"backdrop-invert":[{"backdrop-invert":["",Rt,qe,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[Rt,qe,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[Rt,qe,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Rt,qe,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rt,"initial",qe,Ve]}],ease:[{ease:["linear","initial",w,qe,Ve]}],delay:[{delay:[Rt,qe,Ve]}],animate:[{animate:["none",R,qe,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,qe,Ve]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:Ue()}],"rotate-x":[{"rotate-x":Ue()}],"rotate-y":[{"rotate-y":Ue()}],"rotate-z":[{"rotate-z":Ue()}],scale:[{scale:jt()}],"scale-x":[{"scale-x":jt()}],"scale-y":[{"scale-y":jt()}],"scale-z":[{"scale-z":jt()}],"scale-3d":["scale-3d"],skew:[{skew:an()}],"skew-x":[{"skew-x":an()}],"skew-y":[{"skew-y":an()}],transform:[{transform:[qe,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:rt()}],"translate-x":[{"translate-x":rt()}],"translate-y":[{"translate-y":rt()}],"translate-z":[{"translate-z":rt()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,Ve]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Rt,yc,Hl,bT]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hC=OH(eF),tF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rF={};function ET(e,t){return(rF.jsx?nF:tF).test(e)}var qo={},eg,_T;function aF(){if(_T)return eg;_T=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
281
|
-
`,h="/",p="*",g="",x="comment",E="declaration";function v(N,w){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];w=w||{};var R=1,C=1;function O(ge){var re=ge.match(t);re&&(R+=re.length);var F=ge.lastIndexOf(f);C=~F?ge.length-F:C+ge.length}function Y(){var ge={line:R,column:C};return function(re){return re.position=new P(ge),le(),re}}function P(ge){this.start=ge,this.end={line:R,column:C},this.source=w.source}P.prototype.content=N;function B(ge){var re=new Error(w.source+":"+R+":"+C+": "+ge);if(re.reason=ge,re.filename=w.source,re.line=R,re.column=C,re.source=N,!w.silent)throw re}function G(ge){var re=ge.exec(N);if(re){var F=re[0];return O(F),N=N.slice(F.length),re}}function le(){G(n)}function Q(ge){var re;for(ge=ge||[];re=ce();)re!==!1&&ge.push(re);return ge}function ce(){var ge=Y();if(!(h!=N.charAt(0)||p!=N.charAt(1))){for(var re=2;g!=N.charAt(re)&&(p!=N.charAt(re)||h!=N.charAt(re+1));)++re;if(re+=2,g===N.charAt(re-1))return B("End of comment missing");var F=N.slice(2,re-2);return C+=2,O(F),N=N.slice(re),C+=2,ge({type:x,comment:F})}}function W(){var ge=Y(),re=G(r);if(re){if(ce(),!G(i))return B("property missing ':'");var F=G(l),$=ge({type:E,property:S(re[0].replace(e,g)),value:F?S(F[0].replace(e,g)):g});return G(o),$}}function fe(){var ge=[];Q(ge);for(var re;re=W();)re!==!1&&(ge.push(re),Q(ge));return ge}return le(),fe()}function S(N){return N?N.replace(c,g):g}return eg=v,eg}var TT;function sF(){if(TT)return qo;TT=1;var e=qo&&qo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=n;const t=e(aF());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:p}=f;c?i(h,p,f):p&&(l=l||{},l[h]=p)}),l}return qo}var Ec={},vT;function iF(){if(vT)return Ec;vT=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},o=function(h,p){return p.toUpperCase()},c=function(h,p){return"".concat(p,"-")},f=function(h,p){return p===void 0&&(p={}),l(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(i,c):h=h.replace(r,c),h.replace(t,o))};return Ec.camelCase=f,Ec}var _c,kT;function lF(){if(kT)return _c;kT=1;var e=_c&&_c.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(sF()),n=iF();function r(i,l){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,f){c&&f&&(o[(0,n.camelCase)(c,l)]=f)}),o}return r.default=r,_c=r,_c}var oF=lF();const uF=Mh(oF);function Hc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wT(e.position):"start"in e||"end"in e?wT(e):"line"in e||"column"in e?Jg(e):""}function Jg(e){return CT(e&&e.line)+":"+CT(e&&e.column)}function wT(e){return Jg(e&&e.start)+"-"+Jg(e&&e.end)}function CT(e){return e&&typeof e=="number"?e:1}class Lr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?l.ruleId=r:(l.source=r.slice(0,f),l.ruleId=r.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Hc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Lr.prototype.file="";Lr.prototype.name="";Lr.prototype.reason="";Lr.prototype.message="";Lr.prototype.stack="";Lr.prototype.column=void 0;Lr.prototype.line=void 0;Lr.prototype.ancestors=void 0;Lr.prototype.cause=void 0;Lr.prototype.fatal=void 0;Lr.prototype.place=void 0;Lr.prototype.ruleId=void 0;Lr.prototype.source=void 0;const bb={}.hasOwnProperty,cF=new Map,dF=/[A-Z]/g,fF=new Set(["table","tbody","thead","tfoot","tr"]),hF=new Set(["td","th"]),mC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mF(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=TF(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_F(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ks:gu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=pC(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function pC(e,t,n){if(t.type==="element")return pF(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gF(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return xF(e,t,n);if(t.type==="mdxjsEsm")return bF(e,t);if(t.type==="root")return yF(e,t,n);if(t.type==="text")return EF(e,t)}function pF(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ks,e.schema=i),e.ancestors.push(t);const l=bC(e,t.tagName,!1),o=vF(e,t);let c=yb(e,t);return fF.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!Hh(f):!0})),gC(e,o,l,t),xb(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function gF(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Zc(e,t.position)}function bF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zc(e,t.position)}function xF(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ks,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:bC(e,t.name,!0),o=kF(e,t),c=yb(e,t);return gC(e,o,l,t),xb(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function yF(e,t,n){const r={};return xb(r,yb(e,t)),e.create(t,e.Fragment,r,n)}function EF(e,t){return t.value}function gC(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _F(e,t,n){return r;function r(i,l,o,c){const h=Array.isArray(o.children)?n:t;return c?h(l,o,c):h(l,o)}}function TF(e,t){return n;function n(r,i,l,o){const c=Array.isArray(l.children),f=ws(r);return t(i,l,o,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function vF(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&bb.call(t.properties,i)){const l=wF(e,i,t.properties[i]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&hF.has(t.tagName)?r=c:n[o]=c}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function kF(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Zc(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else Zc(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function yb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:cF;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const h=i.get(f)||0;o=f+"-"+h,i.set(f,h+1)}}const c=pC(e,l,o);c!==void 0&&n.push(c)}return n}function wF(e,t,n){const r=sd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?D1(n):j1(n)),r.property==="style"){let i=typeof n=="object"?n:CF(e,String(n));return e.stylePropertyNameCase==="css"&&(i=SF(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?RR[r.property]||r.property:r.attribute,n]}}function CF(e,t){try{return uF(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Lr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=mC+"#cannot-parse-style-attribute",i}}function bC(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,o;for(;++l<i.length;){const c=ET(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}r=o}else r=ET(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return bb.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zc(e)}function Zc(e,t){const n=new Lr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function SF(e){const t={};let n;for(n in e)bb.call(e,n)&&(t[NF(n)]=e[n]);return t}function NF(e){let t=e.replace(dF,AF);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function AF(e){return"-"+e.toLowerCase()}const tg={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"]},RF={tokenize:LF};function LF(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Gt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),l(c)}function l(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const IF={tokenize:OF},ST={tokenize:DF};function OF(e){const t=this,n=[];let r=0,i,l,o;return c;function c(C){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,f,h)(C)}return h(C)}function f(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&R();const O=t.events.length;let Y=O,P;for(;Y--;)if(t.events[Y][0]==="exit"&&t.events[Y][1].type==="chunkFlow"){P=t.events[Y][1].end;break}w(r);let B=O;for(;B<t.events.length;)t.events[B][1].end={...P},B++;return da(t.events,Y+1,0,t.events.slice(O)),t.events.length=B,h(C)}return c(C)}function h(C){if(r===n.length){if(!i)return x(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ST,p,g)(C)}function p(C){return i&&R(),w(r),x(C)}function g(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(C)}function x(C){return t.containerState={},e.attempt(ST,E,v)(C)}function E(C){return r++,n.push([t.currentConstruct,t.containerState]),x(C)}function v(C){if(C===null){i&&R(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),S(C)}function S(C){if(C===null){N(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return it(C)?(e.consume(C),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(C),S)}function N(C,O){const Y=t.sliceStream(C);if(O&&Y.push(null),C.previous=l,l&&(l.next=C),l=C,i.defineSkip(C.start),i.write(Y),t.parser.lazy[C.start.line]){let P=i.events.length;for(;P--;)if(i.events[P][1].start.offset<o&&(!i.events[P][1].end||i.events[P][1].end.offset>o))return;const B=t.events.length;let G=B,le,Q;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(le){Q=t.events[G][1].end;break}le=!0}for(w(r),P=B;P<t.events.length;)t.events[P][1].end={...Q},P++;da(t.events,G+1,0,t.events.slice(B)),t.events.length=P}}function w(C){let O=n.length;for(;O-- >C;){const Y=n[O];t.containerState=Y[1],Y[0].exit.call(t,e)}n.length=C}function R(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function DF(e,t,n){return Gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const jF={tokenize:MF};function MF(e){const t=this,n=e.attempt(cd,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(UP,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const PF={resolveAll:yC()},BF=xC("string"),UF=xC("text");function xC(e){return{resolveAll:yC(e==="text"?HF:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,o,c);return o;function o(p){return h(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return h(p)?(n.exit("data"),l(p)):(n.consume(p),f)}function h(p){if(p===null)return!0;const g=i[p];let x=-1;if(g)for(;++x<g.length;){const E=g[x];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function yC(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function HF(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,o=-1,c=0,f;for(;l--;){const h=i[l];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(h===-2)f=!0,c++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const FF={42:Kr,43:Kr,45:Kr,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,62:j3},zF={91:VP},$F={[-2]:X0,[-1]:X0,32:X0},VF={35:XP,42:lh,45:[lT,lh],60:eB,61:lT,95:lh,96:sT,126:sT},GF={38:P3,92:M3},qF={[-5]:K0,[-4]:K0,[-3]:K0,33:xB,38:P3,42:Kg,60:[EP,lB],91:EB,92:[WP,M3],93:fb,95:Kg,96:OP},YF={null:[Kg,PF]},WF={null:[42,95]},QF={null:[]},XF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WF,contentInitial:zF,disable:QF,document:FF,flow:VF,flowInitial:$F,insideSpan:YF,string:GF,text:qF},Symbol.toStringTag,{value:"Module"}));function KF(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let o=[],c=[];const f={attempt:B(Y),check:B(P),consume:R,enter:C,exit:O,interrupt:B(P,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:v,parser:e,previous:null,sliceSerialize:x,sliceStream:E,write:g};let p=t.tokenize.call(h,f);return t.resolveAll&&l.push(t),h;function g(ce){return o=Ba(o,ce),N(),o[o.length-1]!==null?[]:(G(t,0),h.events=am(l,h.events,h),h.events)}function x(ce,W){return JF(E(ce),W)}function E(ce){return ZF(o,ce)}function v(){const{_bufferIndex:ce,_index:W,line:fe,column:ge,offset:re}=r;return{_bufferIndex:ce,_index:W,line:fe,column:ge,offset:re}}function S(ce){i[ce.line]=ce.column,Q()}function N(){let ce;for(;r._index<o.length;){const W=o[r._index];if(typeof W=="string")for(ce=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ce&&r._bufferIndex<W.length;)w(W.charCodeAt(r._bufferIndex));else w(W)}}function w(ce){p=p(ce)}function R(ce){it(ce)?(r.line++,r.column=1,r.offset+=ce===-3?2:1,Q()):ce!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=ce}function C(ce,W){const fe=W||{};return fe.type=ce,fe.start=v(),h.events.push(["enter",fe,h]),c.push(fe),fe}function O(ce){const W=c.pop();return W.end=v(),h.events.push(["exit",W,h]),W}function Y(ce,W){G(ce,W.from)}function P(ce,W){W.restore()}function B(ce,W){return fe;function fe(ge,re,F){let $,J,he,A;return Array.isArray(ge)?te(ge):"tokenize"in ge?te([ge]):H(ge);function H(Ne){return Xe;function Xe(Ze){const je=Ze!==null&&Ne[Ze],Dt=Ze!==null&&Ne.null,Ue=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(Dt)?Dt:Dt?[Dt]:[]];return te(Ue)(Ze)}}function te(Ne){return $=Ne,J=0,Ne.length===0?F:D(Ne[J])}function D(Ne){return Xe;function Xe(Ze){return A=le(),he=Ne,Ne.partial||(h.currentConstruct=Ne),Ne.name&&h.parser.constructs.disable.null.includes(Ne.name)?Re():Ne.tokenize.call(W?Object.assign(Object.create(h),W):h,f,we,Re)(Ze)}}function we(Ne){return ce(he,A),re}function Re(Ne){return A.restore(),++J<$.length?D($[J]):F}}}function G(ce,W){ce.resolveAll&&!l.includes(ce)&&l.push(ce),ce.resolve&&da(h.events,W,h.events.length-W,ce.resolve(h.events.slice(W),h)),ce.resolveTo&&(h.events=ce.resolveTo(h.events,h))}function le(){const ce=v(),W=h.previous,fe=h.currentConstruct,ge=h.events.length,re=Array.from(c);return{from:ge,restore:F};function F(){r=ce,h.previous=W,h.currentConstruct=fe,h.events.length=ge,c=re,Q()}}function Q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ZF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,l)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function JF(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
282
|
-
`;break}case-3:{o=`\r
|
|
283
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function ez(e){const r={constructs:C3([XF,...(e||{}).extensions||[]]),content:i(RF),defined:[],document:i(IF),flow:i(jF),lazy:{},string:i(BF),text:i(UF)};return r;function i(l){return o;function o(c){return KF(r,l,c)}}}function tz(e){for(;!B3(e););return e}const NT=/[\0\t\n\r]/g;function nz(){let e=1,t="",n=!0,r;return i;function i(l,o,c){const f=[];let h,p,g,x,E;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(NT.lastIndex=g,h=NT.exec(l),x=h&&h.index!==void 0?h.index:l.length,E=l.charCodeAt(x),!h){t=l.slice(g);break}if(E===10&&g===x&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),g<x&&(f.push(l.slice(g,x)),e+=x-g),E){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}g=x+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const EC={}.hasOwnProperty;function rz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),az(n)(tz(ez(n).document().write(nz()(e,t,!0))))}function az(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Pe),autolinkProtocol:le,autolinkEmail:le,atxHeading:l(pt),blockQuote:l(Dt),characterEscape:le,characterReference:le,codeFenced:l(Ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Ue,o),codeText:l(jt,o),codeTextData:le,data:le,codeFlowValue:le,definition:l(an),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(rt),hardBreakEscape:l(at),hardBreakTrailing:l(at),htmlFlow:l(yn,o),htmlFlowData:le,htmlText:l(yn,o),htmlTextData:le,image:l(Ye),label:o,link:l(Pe),listItem:l(sn),listItemValue:x,listOrdered:l(At,g),listUnordered:l(At),paragraph:l(cn),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(pt),strong:l(Un),thematicBreak:l(St)},exit:{atxHeading:f(),atxHeadingSequence:Y,autolink:f(),autolinkEmail:je,autolinkProtocol:Ze,blockQuote:f(),characterEscapeValue:Q,characterReferenceMarkerHexadecimal:Re,characterReferenceMarkerNumeric:Re,characterReferenceValue:Ne,characterReference:Xe,codeFenced:f(N),codeFencedFence:S,codeFencedFenceInfo:E,codeFencedFenceMeta:v,codeFlowValue:Q,codeIndented:f(w),codeText:f(re),codeTextData:Q,data:Q,definition:f(),definitionDestinationString:O,definitionLabelString:R,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(W),hardBreakTrailing:f(W),htmlFlow:f(fe),htmlFlowData:Q,htmlText:f(ge),htmlTextData:Q,image:f($),label:he,labelText:J,lineEnding:ce,link:f(F),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:we,resourceDestinationString:A,resourceTitleString:H,resource:te,setextHeading:f(G),setextHeadingLineSequence:B,setextHeadingText:P,strong:f(),thematicBreak:f()}};_C(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(be){let Se={type:"root",children:[]};const Me={stack:[Se],tokenStack:[],config:t,enter:c,exit:h,buffer:o,resume:p,data:n},lt=[];let gt=-1;for(;++gt<be.length;)if(be[gt][1].type==="listOrdered"||be[gt][1].type==="listUnordered")if(be[gt][0]==="enter")lt.push(gt);else{const En=lt.pop();gt=i(be,En,gt)}for(gt=-1;++gt<be.length;){const En=t[be[gt][0]];EC.call(En,be[gt][1].type)&&En[be[gt][1].type].call(Object.assign({sliceSerialize:be[gt][2].sliceSerialize},Me),be[gt][1])}if(Me.tokenStack.length>0){const En=Me.tokenStack[Me.tokenStack.length-1];(En[1]||AT).call(Me,void 0,En[0])}for(Se.position={start:Gi(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:Gi(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},gt=-1;++gt<t.transforms.length;)Se=t.transforms[gt](Se)||Se;return Se}function i(be,Se,Me){let lt=Se-1,gt=-1,En=!1,On,Ee,Oe,Je;for(;++lt<=Me;){const He=be[lt];switch(He[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{He[0]==="enter"?gt++:gt--,Je=void 0;break}case"lineEndingBlank":{He[0]==="enter"&&(On&&!Je&&!gt&&!Oe&&(Oe=lt),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!gt&&He[0]==="enter"&&He[1].type==="listItemPrefix"||gt===-1&&He[0]==="exit"&&(He[1].type==="listUnordered"||He[1].type==="listOrdered")){if(On){let tt=lt;for(Ee=void 0;tt--;){const X=be[tt];if(X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="exit")continue;Ee&&(be[Ee][1].type="lineEndingBlank",En=!0),X[1].type="lineEnding",Ee=tt}else if(!(X[1].type==="linePrefix"||X[1].type==="blockQuotePrefix"||X[1].type==="blockQuotePrefixWhitespace"||X[1].type==="blockQuoteMarker"||X[1].type==="listItemIndent"))break}Oe&&(!Ee||Oe<Ee)&&(On._spread=!0),On.end=Object.assign({},Ee?be[Ee][1].start:He[1].end),be.splice(Ee||lt,0,["exit",On,He[2]]),lt++,Me++}if(He[1].type==="listItemPrefix"){const tt={type:"listItem",_spread:!1,start:Object.assign({},He[1].start),end:void 0};On=tt,be.splice(lt,0,["enter",tt,He[2]]),lt++,Me++,Oe=void 0,Je=!0}}}return be[Se][1]._spread=En,Me}function l(be,Se){return Me;function Me(lt){c.call(this,be(lt),lt),Se&&Se.call(this,lt)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(be,Se,Me){this.stack[this.stack.length-1].children.push(be),this.stack.push(be),this.tokenStack.push([Se,Me||void 0]),be.position={start:Gi(Se.start),end:void 0}}function f(be){return Se;function Se(Me){be&&be.call(this,Me),h.call(this,Me)}}function h(be,Se){const Me=this.stack.pop(),lt=this.tokenStack.pop();if(lt)lt[0].type!==be.type&&(Se?Se.call(this,be,lt[0]):(lt[1]||AT).call(this,be,lt[0]));else throw new Error("Cannot close `"+be.type+"` ("+Hc({start:be.start,end:be.end})+"): it’s not open");Me.position.end=Gi(be.end)}function p(){return ob(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(be){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(be),10),this.data.expectingFirstListItemValue=void 0}}function E(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=be}function v(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=be}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.value=be.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.value=be.replace(/(\r?\n|\r)$/g,"")}function R(be){const Se=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Se,Me.identifier=as(this.sliceSerialize(be)).toLowerCase()}function C(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.title=be}function O(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.url=be}function Y(be){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Me=this.sliceSerialize(be).length;Se.depth=Me}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function B(be){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(be).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function le(be){const Me=this.stack[this.stack.length-1].children;let lt=Me[Me.length-1];(!lt||lt.type!=="text")&&(lt=_t(),lt.position={start:Gi(be.start),end:void 0},Me.push(lt)),this.stack.push(lt)}function Q(be){const Se=this.stack.pop();Se.value+=this.sliceSerialize(be),Se.position.end=Gi(be.end)}function ce(be){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Se.children[Se.children.length-1];Me.position.end=Gi(be.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(le.call(this,be),Q.call(this,be))}function W(){this.data.atHardBreak=!0}function fe(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.value=be}function ge(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.value=be}function re(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.value=be}function F(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=Se,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function $(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=Se,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function J(be){const Se=this.sliceSerialize(be),Me=this.stack[this.stack.length-2];Me.label=V7(Se),Me.identifier=as(Se).toLowerCase()}function he(){const be=this.stack[this.stack.length-1],Se=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const lt=be.children;Me.children=lt}else Me.alt=Se}function A(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.url=be}function H(){const be=this.resume(),Se=this.stack[this.stack.length-1];Se.title=be}function te(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function we(be){const Se=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Se,Me.identifier=as(this.sliceSerialize(be)).toLowerCase(),this.data.referenceType="full"}function Re(be){this.data.characterReferenceType=be.type}function Ne(be){const Se=this.sliceSerialize(be),Me=this.data.characterReferenceType;let lt;Me?(lt=w3(Se,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):lt=cb(Se);const gt=this.stack[this.stack.length-1];gt.value+=lt}function Xe(be){const Se=this.stack.pop();Se.position.end=Gi(be.end)}function Ze(be){Q.call(this,be);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(be)}function je(be){Q.call(this,be);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(be)}function Dt(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function jt(){return{type:"inlineCode",value:""}}function an(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function rt(){return{type:"emphasis",children:[]}}function pt(){return{type:"heading",depth:0,children:[]}}function at(){return{type:"break"}}function yn(){return{type:"html",value:""}}function Ye(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function At(be){return{type:"list",ordered:be.type==="listOrdered",start:null,spread:be._spread,children:[]}}function sn(be){return{type:"listItem",spread:be._spread,checked:null,children:[]}}function cn(){return{type:"paragraph",children:[]}}function Un(){return{type:"strong",children:[]}}function _t(){return{type:"text",value:""}}function St(){return{type:"thematicBreak"}}}function Gi(e){return{line:e.line,column:e.column,offset:e.offset}}function _C(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?_C(e,r):sz(e,r)}}function sz(e,t){let n;for(n in t)if(EC.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function AT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Hc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Hc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Hc({start:t.start,end:t.end})+") is still open")}function iz(e){const t=this;t.parser=n;function n(r){return rz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lz(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function oz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
284
|
-
`}]}function uz(e,t){const n=t.value?t.value+`
|
|
285
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function cz(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dz(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fz(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=vu(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function hz(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mz(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function TC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function pz(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return TC(e,t);const i={src:vu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function gz(e,t){const n={src:vu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function bz(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function xz(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return TC(e,t);const i={href:vu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function yz(e,t){const n={href:vu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ez(e,t,n){const r=e.all(t),i=n?_z(n):vC(t),l={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
286
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
|
|
287
|
-
`});const h={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,h),e.applyData(t,h)}function _z(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=vC(n[r])}return t}function vC(e){const t=e.spread;return t??e.children.length>1}function Tz(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function vz(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kz(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wz(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cz(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=ws(t.children[1]),f=nm(t.children[t.children.length-1]);c&&f&&(o.position={start:c,end:f}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function Sz(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const g=t.children[f],x={},E=o?o[f]:void 0;E&&(x.align=E);let v={type:"element",tagName:l,properties:x,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),h.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function Nz(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const RT=9,LT=32;function Az(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(IT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(IT(t.slice(i),i>0,!1)),l.join("")}function IT(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===RT||l===LT;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===RT||l===LT;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Rz(e,t){const n={type:"text",value:Az(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Lz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Iz={blockquote:lz,break:oz,code:uz,delete:cz,emphasis:dz,footnoteReference:fz,heading:hz,html:mz,imageReference:pz,image:gz,inlineCode:bz,linkReference:xz,link:yz,listItem:Ez,list:Tz,paragraph:vz,root:kz,strong:wz,table:Cz,tableCell:Nz,tableRow:Sz,text:Rz,thematicBreak:Lz,toml:Bf,yaml:Bf,definition:Bf,footnoteDefinition:Bf};function Bf(){}function Oz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Dz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function jz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Oz,r=e.options.footnoteBackLabel||Dz,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const p=e.all(h),g=String(h.identifier).toUpperCase(),x=vu(g.toLowerCase());let E=0;const v=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++E<=S;){v.length>0&&v.push({type:"text",value:" "});let R=typeof n=="string"?n:n(f,E);typeof R=="string"&&(R={type:"text",value:R}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,E),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const R=N.children[N.children.length-1];R&&R.type==="text"?R.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...v)}else p.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(h,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Kl(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
288
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
289
|
-
`}]}}const e1={}.hasOwnProperty,Mz={};function Pz(e,t){const n=t||Mz,r=new Map,i=new Map,l=new Map,o={...Iz,...n.handlers},c={all:h,applyData:Uz,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:Bz,wrap:Fz};return vs(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:i,x=String(p.identifier).toUpperCase();g.has(x)||g.set(x,p)}}),c;function f(p,g){const x=p.type,E=c.handlers[x];if(e1.call(c.handlers,x)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in p){const{children:S,...N}=p,w=Kl(N);return w.children=c.all(p),w}return Kl(p)}return(c.options.unknownHandler||Hz)(c,p,g)}function h(p){const g=[];if("children"in p){const x=p.children;let E=-1;for(;++E<x.length;){const v=c.one(x[E],p);if(v){if(E&&x[E-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=OT(v.value)),!Array.isArray(v)&&v.type==="element")){const S=v.children[0];S&&S.type==="text"&&(S.value=OT(S.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function Bz(e,t){e.position&&(t.position=e3(e))}function Uz(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,Kl(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Hz(e,t){const n=t.data||{},r="value"in t&&!(e1.call(n,"hProperties")||e1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Fz(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
290
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
291
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
292
|
-
`}),n}function OT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function DT(e,t){const n=Pz(e,t),r=n.one(e,void 0),i=jz(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
293
|
-
`},i),l}function zz(e,t){return e&&"run"in e?async function(n,r){const i=DT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return DT(n,{file:r,...e||t})}}function jT(e){if(e)throw e}var ng,MT;function $z(){if(MT)return ng;MT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!g)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},o=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},c=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return ng=function f(){var h,p,g,x,E,v,S=arguments[0],N=1,w=arguments.length,R=!1;for(typeof S=="boolean"&&(R=S,S=arguments[1]||{},N=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});N<w;++N)if(h=arguments[N],h!=null)for(p in h)g=c(S,p),x=c(h,p),S!==x&&(R&&x&&(l(x)||(E=i(x)))?(E?(E=!1,v=g&&i(g)?g:[]):v=g&&l(g)?g:{},o(S,{name:p,newValue:f(R,v,x)})):typeof x<"u"&&o(S,{name:p,newValue:x}));return S},ng}var Vz=$z();const rg=Mh(Vz);function t1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gz(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(f,...h){const p=e[++l];let g=-1;if(f){o(f);return}for(;++g<i.length;)(h[g]===null||h[g]===void 0)&&(h[g]=i[g]);i=h,p?qz(p,c)(...h):o(null,...h)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function qz(e,t){let n;return r;function r(...o){const c=e.length>o.length;let f;c&&o.push(i);try{f=e.apply(this,o)}catch(h){const p=h;if(c&&n)throw p;return i(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,i):f instanceof Error?i(f):l(f))}function i(o,...c){n||(n=!0,t(o,...c))}function l(o){i(null,o)}}const Es={basename:Yz,dirname:Wz,extname:Qz,join:Xz,sep:"/"};function Yz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dd(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else o<0&&(l=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Wz(e){if(dd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Qz(e){dd(e);let t=e.length,n=-1,r=0,i=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Xz(...e){let t=-1,n;for(;++t<e.length;)dd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Kz(n)}function Kz(e){dd(e);const t=e.codePointAt(0)===47;let n=Zz(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Zz(e,t){let n="",r=0,i=-1,l=0,o=-1,c,f;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function dd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Jz={cwd:e$};function e$(){return"/"}function n1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function t$(e){if(typeof e=="string")e=new URL(e);else if(!n1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return n$(e)}function n$(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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ag=["history","path","basename","stem","extname","dirname"];class r${constructor(t){let n;t?n1(t)?n={path:t}:typeof t=="string"||a$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Jz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ag.length;){const l=ag[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)ag.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Es.basename(this.path):void 0}set basename(t){ig(t,"basename"),sg(t,"basename"),this.path=Es.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Es.dirname(this.path):void 0}set dirname(t){PT(this.basename,"dirname"),this.path=Es.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Es.extname(this.path):void 0}set extname(t){if(sg(t,"extname"),PT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Es.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){n1(t)&&(t=t$(t)),ig(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Es.basename(this.path,this.extname):void 0}set stem(t){ig(t,"stem"),sg(t,"stem"),this.path=Es.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Lr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sg(e,t){if(e&&e.includes(Es.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Es.sep+"`")}function ig(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function PT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function a$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s$=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),i$={}.hasOwnProperty;class Eb extends s${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=Gz()}copy(){const t=new Eb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(rg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ug("data",this.frozen),this.namespace[t]=n,this):i$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ug("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Uf(t),r=this.parser||this.Parser;return lg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),lg("process",this.parser||this.Parser),og("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){const c=Uf(t),f=r.parse(c);r.run(f,c,function(p,g,x){if(p||!g||!x)return h(p);const E=g,v=r.stringify(E,x);u$(v)?x.value=v:x.result=v,h(p,x)});function h(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),lg("processSync",this.parser||this.Parser),og("processSync",this.compiler||this.Compiler),this.process(t,i),UT("processSync","process",n),r;function i(l,o){n=!0,jT(l),r=o}}run(t,n,r){BT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const f=Uf(n);i.run(t,f,h);function h(p,g,x){const E=g||t;p?c(p):o?o(E):r(void 0,E,x)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),UT("runSync","run",r),i;function l(o,c){jT(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=Uf(n),i=this.compiler||this.Compiler;return og("stringify",i),BT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ug("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...g]=h;f(p,g)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(h){if(!("plugins"in h)&&!("settings"in h))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");c(h.plugins),h.settings&&(i.settings=rg(!0,i.settings,h.settings))}function c(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const g=h[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,p){let g=-1,x=-1;for(;++g<r.length;)if(r[g][0]===h){x=g;break}if(x===-1)r.push([h,...p]);else if(p.length>0){let[E,...v]=p;const S=r[x][1];t1(S)&&t1(E)&&(E=rg(!0,S,E)),r[x]=[h,E,...v]}}}}const l$=new Eb().freeze();function lg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function og(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ug(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function BT(e){if(!t1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function UT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uf(e){return o$(e)?e:new r$(e)}function o$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function u$(e){return typeof e=="string"||c$(e)}function c$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function _b(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var so=_b();function kC(e){so=e}var $l={exec:()=>null};function qt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,l)=>{let o=typeof l=="string"?l:l.source;return o=o.replace(Hr.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var d$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Hr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},f$=/^(?:[ \t]*(?:\n|$))+/,h$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,m$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Tb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,wC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,CC=qt(wC).replace(/bull/g,Tb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g$=qt(wC).replace(/bull/g,Tb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),vb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,b$=/^[^\n]+/,kb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,x$=qt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),y$=qt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Tb).getRegex(),im="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",wb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,E$=qt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",wb).replace("tag",im).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),SC=qt(vb).replace("hr",fd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",im).getRegex(),_$=qt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",SC).getRegex(),Cb={blockquote:_$,code:h$,def:x$,fences:m$,heading:p$,hr:fd,html:E$,lheading:CC,list:y$,newline:f$,paragraph:SC,table:$l,text:b$},HT=qt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",im).getRegex(),T$={...Cb,lheading:g$,table:HT,paragraph:qt(vb).replace("hr",fd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",HT).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",im).getRegex()},v$={...Cb,html:qt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$l,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:qt(vb).replace("hr",fd).replace("heading",` *#{1,6} *[^
|
|
294
|
-
]`).replace("lheading",CC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},k$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,w$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,NC=/^( {2,}|\\)\n(?!\s*$)/,C$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ku=/[\p{P}\p{S}]/u,lm=/[\s\p{P}\p{S}]/u,Sb=/[^\s\p{P}\p{S}]/u,S$=qt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,lm).getRegex(),AC=/(?!~)[\p{P}\p{S}]/u,N$=/(?!~)[\s\p{P}\p{S}]/u,A$=/(?:[^\s\p{P}\p{S}]|~)/u,R$=qt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",d$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),RC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,L$=qt(RC,"u").replace(/punct/g,ku).getRegex(),I$=qt(RC,"u").replace(/punct/g,AC).getRegex(),LC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",O$=qt(LC,"gu").replace(/notPunctSpace/g,Sb).replace(/punctSpace/g,lm).replace(/punct/g,ku).getRegex(),D$=qt(LC,"gu").replace(/notPunctSpace/g,A$).replace(/punctSpace/g,N$).replace(/punct/g,AC).getRegex(),j$=qt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Sb).replace(/punctSpace/g,lm).replace(/punct/g,ku).getRegex(),M$=qt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ku).getRegex(),P$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",B$=qt(P$,"gu").replace(/notPunctSpace/g,Sb).replace(/punctSpace/g,lm).replace(/punct/g,ku).getRegex(),U$=qt(/\\(punct)/,"gu").replace(/punct/g,ku).getRegex(),H$=qt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),F$=qt(wb).replace("(?:-->|$)","-->").getRegex(),z$=qt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",F$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Rh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$$=qt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Rh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),IC=qt(/^!?\[(label)\]\[(ref)\]/).replace("label",Rh).replace("ref",kb).getRegex(),OC=qt(/^!?\[(ref)\](?:\[\])?/).replace("ref",kb).getRegex(),V$=qt("reflink|nolink(?!\\()","g").replace("reflink",IC).replace("nolink",OC).getRegex(),FT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Nb={_backpedal:$l,anyPunctuation:U$,autolink:H$,blockSkip:R$,br:NC,code:w$,del:$l,delLDelim:$l,delRDelim:$l,emStrongLDelim:L$,emStrongRDelimAst:O$,emStrongRDelimUnd:j$,escape:k$,link:$$,nolink:OC,punctuation:S$,reflink:IC,reflinkSearch:V$,tag:z$,text:C$,url:$l},G$={...Nb,link:qt(/^!?\[(label)\]\((.*?)\)/).replace("label",Rh).getRegex(),reflink:qt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rh).getRegex()},r1={...Nb,emStrongRDelimAst:D$,emStrongLDelim:I$,delLDelim:M$,delRDelim:B$,url:qt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",FT).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:qt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",FT).getRegex()},q$={...r1,br:qt(NC).replace("{2,}","*").getRegex(),text:qt(r1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Hf={normal:Cb,gfm:T$,pedantic:v$},Tc={normal:Nb,gfm:r1,breaks:q$,pedantic:G$},Y$={"&":"&","<":"<",">":">",'"':""","'":"'"},zT=e=>Y$[e];function ys(e,t){if(t){if(Hr.escapeTest.test(e))return e.replace(Hr.escapeReplace,zT)}else if(Hr.escapeTestNoEncode.test(e))return e.replace(Hr.escapeReplaceNoEncode,zT);return e}function $T(e){try{e=encodeURI(e).replace(Hr.percentDecode,"%")}catch{return null}return e}function VT(e,t){var l;let n=e.replace(Hr.findPipe,(o,c,f)=>{let h=!1,p=c;for(;--p>=0&&f[p]==="\\";)h=!h;return h?"|":" |"}),r=n.split(Hr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((l=r.at(-1))!=null&&l.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Hr.slashPipe,"|");return r}function vc(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function W$(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Q$(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let l=4-n%4;r+=" ".repeat(l),n+=l}else r+=i,n++;return r}function GT(e,t,n,r,i){let l=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let f={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:o,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,f}function X$(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
295
|
-
`).map(l=>{let o=l.match(n.other.beginningSpace);if(o===null)return l;let[c]=o;return c.length>=i.length?l.slice(i.length):l}).join(`
|
|
296
|
-
`)}var Lh=class{constructor(e){de(this,"options");de(this,"rules");de(this,"lexer");this.options=e||so}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:vc(n,`
|
|
297
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=X$(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=vc(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:vc(t[0],`
|
|
298
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=vc(t[0],`
|
|
299
|
-
`).split(`
|
|
300
|
-
`),r="",i="",l=[];for(;n.length>0;){let o=!1,c=[],f;for(f=0;f<n.length;f++)if(this.rules.other.blockquoteStart.test(n[f]))c.push(n[f]),o=!0;else if(!o)c.push(n[f]);else break;n=n.slice(f);let h=c.join(`
|
|
301
|
-
`),p=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
302
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
303
|
-
${h}`:h,i=i?`${i}
|
|
304
|
-
${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,l,!0),this.lexer.state.top=g,n.length===0)break;let x=l.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){let E=x,v=E.raw+`
|
|
305
|
-
`+n.join(`
|
|
306
|
-
`),S=this.blockquote(v);l[l.length-1]=S,r=r.substring(0,r.length-E.raw.length)+S.raw,i=i.substring(0,i.length-E.text.length)+S.text;break}else if((x==null?void 0:x.type)==="list"){let E=x,v=E.raw+`
|
|
307
|
-
`+n.join(`
|
|
308
|
-
`),S=this.list(v);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,i=i.substring(0,i.length-E.raw.length)+S.raw,n=v.substring(l.at(-1).raw.length).split(`
|
|
309
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:i}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),l=i.length>1,o={type:"list",raw:"",ordered:l,start:l?+i.slice(0,-1):"",loose:!1,items:[]};i=l?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=l?i:"[*+-]");let c=this.rules.other.listItemRegex(i),f=!1;for(;e;){let p=!1,g="",x="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let E=Q$(t[2].split(`
|
|
310
|
-
`,1)[0],t[1].length),v=e.split(`
|
|
311
|
-
`,1)[0],S=!E.trim(),N=0;if(this.options.pedantic?(N=2,x=E.trimStart()):S?N=t[1].length+1:(N=E.search(this.rules.other.nonSpaceChar),N=N>4?1:N,x=E.slice(N),N+=t[1].length),S&&this.rules.other.blankLine.test(v)&&(g+=v+`
|
|
312
|
-
`,e=e.substring(v.length+1),p=!0),!p){let w=this.rules.other.nextBulletRegex(N),R=this.rules.other.hrRegex(N),C=this.rules.other.fencesBeginRegex(N),O=this.rules.other.headingBeginRegex(N),Y=this.rules.other.htmlBeginRegex(N),P=this.rules.other.blockquoteBeginRegex(N);for(;e;){let B=e.split(`
|
|
313
|
-
`,1)[0],G;if(v=B,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),G=v):G=v.replace(this.rules.other.tabCharGlobal," "),C.test(v)||O.test(v)||Y.test(v)||P.test(v)||w.test(v)||R.test(v))break;if(G.search(this.rules.other.nonSpaceChar)>=N||!v.trim())x+=`
|
|
314
|
-
`+G.slice(N);else{if(S||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(E)||O.test(E)||R.test(E))break;x+=`
|
|
315
|
-
`+v}S=!v.trim(),g+=B+`
|
|
316
|
-
`,e=e.substring(B.length+1),E=G.slice(N)}}o.loose||(f?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),o.raw+=g}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((n=p.tokens[0])==null?void 0:n.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(p.raw);if(g){let x={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};p.checked=x.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=x.raw+p.tokens[0].raw,p.tokens[0].text=x.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(x)):p.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):p.tokens.unshift(x)}}if(!o.loose){let g=p.tokens.filter(E=>E.type==="space"),x=g.length>0&&g.some(E=>this.rules.other.anyLine.test(E.raw));o.loose=x}}if(o.loose)for(let p of o.items){p.loose=!0;for(let g of p.tokens)g.type==="text"&&(g.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var o;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=VT(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
317
|
-
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<n.length;c++)l.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:l.align[c]});for(let c of i)l.rows.push(VT(c,l.header.length).map((f,h)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:l.align[h]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
318
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=vc(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=W$(t[2],"()");if(l===-2)return;if(l>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],i=l[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),GT(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return GT(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,f=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+i);(r=h.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(o=[...l].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){f+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+f);let p=[...r[0]][0].length,g=e.slice(0,i+r.index+p+o);if(Math.min(i,o)%2){let E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}let x=g.slice(2,-2);return{type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,f=this.rules.inline.delRDelim;for(f.lastIndex=0,t=t.slice(-1*e.length+i);(r=f.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l||(o=[...l].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let h=[...r[0]][0].length,p=e.slice(0,i+r.index+h+o),g=p.slice(i,-i);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let l;do l=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(l!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Ua=class a1{constructor(t){de(this,"tokens");de(this,"options");de(this,"state");de(this,"inlineQueue");de(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||so,this.options.tokenizer=this.options.tokenizer||new Lh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Hr,block:Hf.normal,inline:Tc.normal};this.options.pedantic?(n.block=Hf.pedantic,n.inline=Tc.pedantic):this.options.gfm&&(n.block=Hf.gfm,this.options.breaks?n.inline=Tc.breaks:n.inline=Tc.gfm),this.tokenizer.rules=n}static get rules(){return{block:Hf,inline:Tc}}static lex(t,n){return new a1(n).lex(t)}static lexInline(t,n){return new a1(n).inlineTokens(t)}lex(t){t=t.replace(Hr.carriageReturn,`
|
|
319
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var i,l,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Hr.tabCharGlobal," ").replace(Hr.spaceLine,""));t;){let c;if((l=(i=this.options.extensions)==null?void 0:i.block)!=null&&l.some(h=>(c=h.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);let h=n.at(-1);c.raw.length===1&&h!==void 0?h.raw+=`
|
|
320
|
-
`:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
321
|
-
`)?"":`
|
|
322
|
-
`)+c.raw,h.text+=`
|
|
323
|
-
`+c.text,this.inlineQueue.at(-1).src=h.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
324
|
-
`)?"":`
|
|
325
|
-
`)+c.raw,h.text+=`
|
|
326
|
-
`+c.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let f=t;if((o=this.options.extensions)!=null&&o.startBlock){let h=1/0,p=t.slice(1),g;this.options.extensions.startBlock.forEach(x=>{g=x.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(this.state.top&&(c=this.tokenizer.paragraph(f))){let h=n.at(-1);r&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
327
|
-
`)?"":`
|
|
328
|
-
`)+c.raw,h.text+=`
|
|
329
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(c),r=f.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
330
|
-
`)?"":`
|
|
331
|
-
`)+c.raw,h.text+=`
|
|
332
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(c);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var f,h,p,g,x;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)E.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)l=i[2]?i[2].length:0,r=r.slice(0,i.index+l)+"["+"a".repeat(i[0].length-l-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((h=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:h.call({lexer:this},r))??r;let o=!1,c="";for(;t;){o||(c=""),o=!1;let E;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(S=>(E=S.call({lexer:this},t,n))?(t=t.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(E.raw.length);let S=n.at(-1);E.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=E.raw,S.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(t)){t=t.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(t))){t=t.substring(E.raw.length),n.push(E);continue}let v=t;if((x=this.options.extensions)!=null&&x.startInline){let S=1/0,N=t.slice(1),w;this.options.extensions.startInline.forEach(R=>{w=R.call({lexer:this},N),typeof w=="number"&&w>=0&&(S=Math.min(S,w))}),S<1/0&&S>=0&&(v=t.substring(0,S+1))}if(E=this.tokenizer.inlineText(v)){t=t.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(c=E.raw.slice(-1)),o=!0;let S=n.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=E.raw,S.text+=E.text):n.push(E);continue}if(t){let S="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return n}},Ih=class{constructor(t){de(this,"options");de(this,"parser");this.options=t||so}space(t){return""}code({text:t,lang:n,escaped:r}){var o;let i=(o=(n||"").match(Hr.notSpaceStart))==null?void 0:o[0],l=t.replace(Hr.endingNewline,"")+`
|
|
333
|
-
`;return i?'<pre><code class="language-'+ys(i)+'">'+(r?l:ys(l,!0))+`</code></pre>
|
|
334
|
-
`:"<pre><code>"+(r?l:ys(l,!0))+`</code></pre>
|
|
335
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
336
|
-
${this.parser.parse(t)}</blockquote>
|
|
337
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
338
|
-
`}hr(t){return`<hr>
|
|
339
|
-
`}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let f=t.items[c];i+=this.listitem(f)}let l=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+l+o+`>
|
|
340
|
-
`+i+"</"+l+`>
|
|
341
|
-
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
342
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
343
|
-
`}table(t){let n="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);n+=this.tablerow({text:r});let i="";for(let l=0;l<t.rows.length;l++){let o=t.rows[l];r="";for(let c=0;c<o.length;c++)r+=this.tablecell(o[c]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
344
|
-
<thead>
|
|
345
|
-
`+n+`</thead>
|
|
346
|
-
`+i+`</table>
|
|
347
|
-
`}tablerow({text:t}){return`<tr>
|
|
348
|
-
${t}</tr>
|
|
349
|
-
`}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
350
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ys(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),l=$T(t);if(l===null)return i;t=l;let o='<a href="'+t+'"';return n&&(o+=' title="'+ys(n)+'"'),o+=">"+i+"</a>",o}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let l=$T(t);if(l===null)return ys(r);t=l;let o=`<img src="${t}" alt="${ys(r)}"`;return n&&(o+=` title="${ys(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ys(t.text)}},Ab=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ts=class s1{constructor(t){de(this,"options");de(this,"renderer");de(this,"textRenderer");this.options=t||so,this.options.renderer=this.options.renderer||new Ih,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ab}static parse(t,n){return new s1(n).parse(t)}static parseInline(t,n){return new s1(n).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let n="";for(let l=0;l<t.length;l++){let o=t[l];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let f=o,h=this.options.extensions.renderers[f.type].call({parser:this},f);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(f.type)){n+=h||"";continue}}let c=o;switch(c.type){case"space":{n+=this.renderer.space(c);break}case"hr":{n+=this.renderer.hr(c);break}case"heading":{n+=this.renderer.heading(c);break}case"code":{n+=this.renderer.code(c);break}case"table":{n+=this.renderer.table(c);break}case"blockquote":{n+=this.renderer.blockquote(c);break}case"list":{n+=this.renderer.list(c);break}case"checkbox":{n+=this.renderer.checkbox(c);break}case"html":{n+=this.renderer.html(c);break}case"def":{n+=this.renderer.def(c);break}case"paragraph":{n+=this.renderer.paragraph(c);break}case"text":{n+=this.renderer.text(c);break}default:{let f='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return n}parseInline(t,n=this.renderer){var i,l;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let c=t[o];if((l=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&l[c.type]){let h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=h||"";continue}}let f=c;switch(f.type){case"escape":{r+=n.text(f);break}case"html":{r+=n.html(f);break}case"link":{r+=n.link(f);break}case"image":{r+=n.image(f);break}case"checkbox":{r+=n.checkbox(f);break}case"strong":{r+=n.strong(f);break}case"em":{r+=n.em(f);break}case"codespan":{r+=n.codespan(f);break}case"br":{r+=n.br(f);break}case"del":{r+=n.del(f);break}case"text":{r+=n.text(f);break}default:{let h='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return r}},Kf,Nc=(Kf=class{constructor(e){de(this,"options");de(this,"block");this.options=e||so}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ua.lex:Ua.lexInline}provideParser(e=this.block){return e?ts.parse:ts.parseInline}},de(Kf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),de(Kf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Kf),K$=class{constructor(...t){de(this,"defaults",_b());de(this,"options",this.setOptions);de(this,"parse",this.parseMarkdown(!0));de(this,"parseInline",this.parseMarkdown(!1));de(this,"Parser",ts);de(this,"Renderer",Ih);de(this,"TextRenderer",Ab);de(this,"Lexer",Ua);de(this,"Tokenizer",Lh);de(this,"Hooks",Nc);this.use(...t)}walkTokens(t,n){var i,l;let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let f of c.header)r=r.concat(this.walkTokens(f.tokens,n));for(let f of c.rows)for(let h of f)r=r.concat(this.walkTokens(h.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;(l=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(f=>{let h=c[f].flat(1/0);r=r.concat(this.walkTokens(h,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let o=n.renderers[l.name];o?n.renderers[l.name]=function(...c){let f=l.renderer.apply(this,c);return f===!1&&(f=o.apply(this,c)),f}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[l.level];o?o.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),i.extensions=n),r.renderer){let l=this.defaults.renderer||new Ih(this.defaults);for(let o in r.renderer){if(!(o in l))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,f=r.renderer[c],h=l[c];l[c]=(...p)=>{let g=f.apply(l,p);return g===!1&&(g=h.apply(l,p)),g||""}}i.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new Lh(this.defaults);for(let o in r.tokenizer){if(!(o in l))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,f=r.tokenizer[c],h=l[c];l[c]=(...p)=>{let g=f.apply(l,p);return g===!1&&(g=h.apply(l,p)),g}}i.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new Nc;for(let o in r.hooks){if(!(o in l))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,f=r.hooks[c],h=l[c];Nc.passThroughHooks.has(o)?l[c]=p=>{if(this.defaults.async&&Nc.passThroughHooksRespectAsync.has(o))return(async()=>{let x=await f.call(l,p);return h.call(l,x)})();let g=f.call(l,p);return h.call(l,g)}:l[c]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await f.apply(l,p);return x===!1&&(x=await h.apply(l,p)),x})();let g=f.apply(l,p);return g===!1&&(g=h.apply(l,p)),g}}i.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(c){let f=[];return f.push(o.call(this,c)),l&&(f=f.concat(l.call(this,c))),f}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ua.lex(t,n??this.defaults)}parser(t,n){return ts.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},l={...this.defaults,...i},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(n):n,f=await(l.hooks?await l.hooks.provideLexer(t):t?Ua.lex:Ua.lexInline)(c,l),h=l.hooks?await l.hooks.processAllTokens(f):f;l.walkTokens&&await Promise.all(this.walkTokens(h,l.walkTokens));let p=await(l.hooks?await l.hooks.provideParser(t):t?ts.parse:ts.parseInline)(h,l);return l.hooks?await l.hooks.postprocess(p):p})().catch(o);try{l.hooks&&(n=l.hooks.preprocess(n));let c=(l.hooks?l.hooks.provideLexer(t):t?Ua.lex:Ua.lexInline)(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let f=(l.hooks?l.hooks.provideParser(t):t?ts.parse:ts.parseInline)(c,l);return l.hooks&&(f=l.hooks.postprocess(f)),f}catch(c){return o(c)}}}onError(t,n){return r=>{if(r.message+=`
|
|
351
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+ys(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Jl=new K$;function mn(e,t){return Jl.parse(e,t)}mn.options=mn.setOptions=function(e){return Jl.setOptions(e),mn.defaults=Jl.defaults,kC(mn.defaults),mn};mn.getDefaults=_b;mn.defaults=so;mn.use=function(...e){return Jl.use(...e),mn.defaults=Jl.defaults,kC(mn.defaults),mn};mn.walkTokens=function(e,t){return Jl.walkTokens(e,t)};mn.parseInline=Jl.parseInline;mn.Parser=ts;mn.parser=ts.parse;mn.Renderer=Ih;mn.TextRenderer=Ab;mn.Lexer=Ua;mn.lexer=Ua.lex;mn.Tokenizer=Lh;mn.Hooks=Nc;mn.parse=mn;mn.options;mn.setOptions;mn.use;mn.walkTokens;mn.parseInline;ts.parse;Ua.lex;var Z$=300,J$="300px",eV=500;function tV(e={}){let{immediate:t=!1,debounceDelay:n=Z$,rootMargin:r=J$,idleTimeout:i=eV}=e,[l,o]=T.useState(!1),c=T.useRef(null),f=T.useRef(null),h=T.useRef(null),p=T.useMemo(()=>E=>{let v=Date.now();return window.setTimeout(()=>{E({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),g=T.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(E,v)=>window.requestIdleCallback(E,v):p,[p]),x=T.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?E=>window.cancelIdleCallback(E):E=>{clearTimeout(E)},[]);return T.useEffect(()=>{if(t){o(!0);return}let E=c.current;if(!E)return;f.current&&(clearTimeout(f.current),f.current=null),h.current&&(x(h.current),h.current=null);let v=()=>{f.current&&(clearTimeout(f.current),f.current=null),h.current&&(x(h.current),h.current=null)},S=C=>{h.current=g(O=>{O.timeRemaining()>0||O.didTimeout?(o(!0),C.disconnect()):h.current=g(()=>{o(!0),C.disconnect()},{timeout:i/2})},{timeout:i})},N=C=>{v(),f.current=window.setTimeout(()=>{var O,Y;let P=C.takeRecords();(P.length===0||(Y=(O=P.at(-1))==null?void 0:O.isIntersecting)!=null&&Y)&&S(C)},n)},w=(C,O)=>{C.isIntersecting?N(O):v()},R=new IntersectionObserver(C=>{for(let O of C)w(O,R)},{rootMargin:r,threshold:0});return R.observe(E),()=>{f.current&&clearTimeout(f.current),h.current&&x(h.current),R.disconnect()}},[t,n,r,i,x,g]),{shouldRender:l,containerRef:c}}var DC=/\s/,nV=/^\s+$/,rV=new Set(["code","pre","svg","math","annotation"]),aV=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",sV=e=>e.some(t=>aV(t)&&rV.has(t.tagName)),iV=e=>{let t=[],n="",r=!1;for(let i of e){let l=DC.test(i);l!==r&&n&&(t.push(n),n=""),n+=i,r=l}return n&&t.push(n),t},lV=e=>{let t=[],n="";for(let r of e)DC.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},oV=(e,t,n,r,i,l)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return l&&(o+=`;--sd-delay:${l}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:o},children:[{type:"text",value:e}]}},uV=(e,t,n,r,i)=>{let l=t.at(-1);if(!(l&&"children"in l))return;if(sV(t))return tu;let o=l,c=o.children.indexOf(e);if(c===-1)return;let f=e.value;if(!f.trim()){i.count+=f.length;return}let h=n.sep==="char"?lV(f):iV(f),p=r.prevContentLength,g=h.map(x=>{let E=i.count;if(i.count+=x.length,nV.test(x))return{type:"text",value:x};let v=p>0&&E<p,S=v?0:i.newIndex++*n.stagger;return oV(x,n.animation,n.duration,n.easing,v,S)});return o.children.splice(c,1,...g),c+g.length},cV=0;function i1(e){var t,n,r,i,l;let o={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(i=e==null?void 0:e.sep)!=null?i:"word",stagger:(l=e==null?void 0:e.stagger)!=null?l:40},c={prevContentLength:0,lastRenderCharCount:0},f=cV++,h=()=>p=>{let g={count:0,newIndex:0};X1(p,"text",(x,E)=>uV(x,E,o,c,g)),c.lastRenderCharCount=g.count,c.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${f}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(p){c.prevContentLength=p},getLastRenderCharCount(){let p=c.lastRenderCharCount;return c.lastRenderCharCount=0,p}}}i1();var jC=T.createContext(!1),dV=()=>T.useContext(jC),Rb=(...e)=>hC(Z3(e)),fV=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},hV=e=>e?(...t)=>fV(e,hC(Z3(t))):Rb,su=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,l=URL.createObjectURL(i),o=document.createElement("a");o.href=l,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)},l1=T.createContext(Rb),Ot=()=>T.useContext(l1),mV=Rb("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),pV=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),l=n.slice(r+1).trim();i&&l&&(t[i]=l)}}return t},gV=T.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:l=!0,...o})=>{let c=Ot(),f=T.useMemo(()=>c(mV),[c]),h=T.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,pV(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return d.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...o,children:d.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:h,children:d.jsx("code",{className:l?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:l&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((p,g)=>d.jsx("span",{className:l?f:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
|
|
352
|
-
`:p.map((x,E)=>{let v={},S=!!x.bgColor;if(x.color&&(v["--sdm-c"]=x.color),x.bgColor&&(v["--sdm-tbg"]=x.bgColor),x.htmlStyle)for(let[N,w]of Object.entries(x.htmlStyle))N==="color"?v["--sdm-c"]=w:N==="background-color"?(v["--sdm-tbg"]=w,S=!0):v[N]=w;return d.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",S&&"bg-[var(--sdm-tbg)]",S&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...x.htmlAttrs,children:x.content},E)})},g))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),bV=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let l=Ot();return d.jsx("div",{className:l("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},MC=T.createContext({code:""}),PC=()=>T.useContext(MC),xV=({language:e})=>{let t=Ot();return d.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:d.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},yV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
353
|
-
`;)t--;return e.slice(0,t)},EV=T.lazy(()=>j(()=>import("./highlighted-body-OFNGDK62-CyMcatlD.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),_V=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:l,lineNumbers:o,...c})=>{let f=Ot(),h=T.useMemo(()=>yV(e),[e]),p=T.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:h.split(`
|
|
354
|
-
`).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[h]);return d.jsx(MC.Provider,{value:{code:e},children:d.jsxs(bV,{isIncomplete:i,language:t,children:[d.jsx(xV,{language:t}),r?d.jsx("div",{className:f("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:d.jsx("div",{className:f("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,d.jsx(T.Suspense,{fallback:d.jsx(gV,{className:n,language:t,lineNumbers:o,result:p,startLine:l,...c}),children:d.jsx(EV,{className:n,code:h,language:t,lineNumbers:o,raw:p,startLine:l,...c})})]})})},TV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),vV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),kV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),wV=e=>d.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[d.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),CV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),SV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),NV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),AV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),RV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),LV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Ac={CheckIcon:TV,CopyIcon:vV,DownloadIcon:kV,ExternalLinkIcon:AV,Loader2Icon:wV,Maximize2Icon:CV,RotateCcwIcon:SV,XIcon:NV,ZoomInIcon:RV,ZoomOutIcon:LV},BC=T.createContext(Ac),IV=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},qT=({icons:e,children:t})=>{let n=T.useRef(e),r=T.useRef(e?{...Ac,...e}:Ac);IV(n.current,e)||(n.current=e,r.current=e?{...Ac,...e}:Ac);let i=r.current;return d.jsx(BC.Provider,{value:i,children:t})},ls=()=>T.useContext(BC),UC={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},o1=T.createContext(UC),ci=()=>T.useContext(o1),YT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:l,...o})=>{let c=Ot(),[f,h]=T.useState(!1),p=T.useRef(0),{code:g}=PC(),{isAnimating:x}=T.useContext(fa),E=ci(),v=l??g,S=async()=>{var R;if(typeof window>"u"||!((R=navigator==null?void 0:navigator.clipboard)!=null&&R.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{f||(await navigator.clipboard.writeText(v),h(!0),e==null||e(),p.current=window.setTimeout(()=>h(!1),n))}catch(C){t==null||t(C)}};T.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let N=ls(),w=f?N.CheckIcon:N.CopyIcon;return d.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:x,onClick:S,title:E.copyCode,type:"button",...o,children:r??d.jsx(w,{size:14})})},WT={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},OV=({onDownload:e,onError:t,language:n,children:r,className:i,code:l,...o})=>{let c=Ot(),{code:f}=PC(),{isAnimating:h}=T.useContext(fa),p=ci(),g=ls(),x=l??f,E=`file.${n&&n in WT?WT[n]:"txt"}`,v="text/plain",S=()=>{try{su(E,x,v),e==null||e()}catch(N){t==null||t(N)}};return d.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:h,onClick:S,title:p.downloadFile,type:"button",...o,children:r??d.jsx(g.DownloadIcon,{size:14})})},QT=()=>{let{Loader2Icon:e}=ls(),t=Ot();return d.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[d.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),d.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:d.jsx(e,{className:t("size-4 animate-spin")})})]})},DV=/\.[^/.]+$/,jV=({node:e,className:t,src:n,alt:r,onLoad:i,onError:l,...o})=>{let{DownloadIcon:c}=ls(),f=Ot(),h=T.useRef(null),[p,g]=T.useState(!1),[x,E]=T.useState(!1),v=ci(),S=o.width!=null||o.height!=null,N=(p||S)&&!x,w=x&&!S;T.useEffect(()=>{let Y=h.current;if(Y!=null&&Y.complete){let P=Y.naturalWidth>0;g(P),E(!P)}},[]);let R=T.useCallback(Y=>{g(!0),E(!1),i==null||i(Y)},[i]),C=T.useCallback(Y=>{g(!1),E(!0),l==null||l(Y)},[l]),O=async()=>{if(n)try{let Y=await(await fetch(n)).blob(),P=new URL(n,window.location.origin).pathname.split("/").pop()||"",B=P.split(".").pop(),G=P.includes(".")&&B!==void 0&&B.length<=4,le="";if(G)le=P;else{let Q=Y.type,ce="png";Q.includes("jpeg")||Q.includes("jpg")?ce="jpg":Q.includes("png")?ce="png":Q.includes("svg")?ce="svg":Q.includes("gif")?ce="gif":Q.includes("webp")&&(ce="webp"),le=`${(r||P||"image").replace(DV,"")}.${ce}`}su(le,Y,Y.type)}catch{window.open(n,"_blank")}};return n?d.jsxs("div",{className:f("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[d.jsx("img",{alt:r,className:f("max-w-full rounded-lg",w&&"hidden",t),"data-streamdown":"image",onError:C,onLoad:R,ref:h,src:n,...o}),w&&d.jsx("span",{className:f("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),d.jsx("div",{className:f("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),N&&d.jsx("button",{className:f("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:O,title:v.downloadImage,type:"button",children:d.jsx(c,{size:14})})]}):null},Fc=0,Lb=()=>{Fc+=1,Fc===1&&(document.body.style.overflow="hidden")},Ib=()=>{Fc=Math.max(0,Fc-1),Fc===0&&(document.body.style.overflow="")},MV=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:l,ExternalLinkIcon:o,XIcon:c}=ls(),f=Ot(),[h,p]=T.useState(!1),g=ci(),x=T.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),E=T.useCallback(()=>{r(),n()},[r,n]);return T.useEffect(()=>{if(t){Lb();let v=S=>{S.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),Ib()}}},[t,n]),t?d.jsx("div",{className:f("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:d.jsxs("div",{className:f("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[d.jsx("button",{className:f("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:g.close,type:"button",children:d.jsx(c,{size:16})}),d.jsxs("div",{className:f("flex flex-col gap-2"),children:[d.jsxs("div",{className:f("flex items-center gap-2 font-semibold text-lg"),children:[d.jsx(o,{size:20}),d.jsx("span",{children:g.openExternalLink})]}),d.jsx("p",{className:f("text-muted-foreground text-sm"),children:g.externalLinkWarning})]}),d.jsx("div",{className:f("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),d.jsxs("div",{className:f("flex gap-2"),children:[d.jsx("button",{className:f("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:x,type:"button",children:h?d.jsxs(d.Fragment,{children:[d.jsx(i,{size:14}),d.jsx("span",{children:g.copied})]}):d.jsxs(d.Fragment,{children:[d.jsx(l,{size:14}),d.jsx("span",{children:g.copyLink})]})}),d.jsxs("button",{className:f("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:E,type:"button",children:[d.jsx(o,{size:14}),d.jsx("span",{children:g.openLink})]})]})]})}):null},u1=T.createContext(null),Ob=()=>T.useContext(u1),LY=()=>{var e;let t=Ob();return(e=t==null?void 0:t.code)!=null?e:null},Db=()=>{var e;let t=Ob();return(e=t==null?void 0:t.mermaid)!=null?e:null},PV=e=>{var t;let n=Ob();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},BV=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,l)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let f=document.createElement("canvas"),h=c.width*r,p=c.height*r;f.width=h,f.height=p;let g=f.getContext("2d");if(!g){l(new Error("Failed to create 2D canvas context for PNG export"));return}g.drawImage(c,0,0,h,p),f.toBlob(x=>{if(!x){l(new Error("Failed to create PNG blob"));return}i(x)},"image/png")},c.onerror=()=>l(new Error("Failed to load SVG image")),c.src=o})},UV=({chart:e,children:t,className:n,onDownload:r,config:i,onError:l})=>{let o=Ot(),[c,f]=T.useState(!1),h=T.useRef(null),{isAnimating:p}=T.useContext(fa),g=ls(),x=Db(),E=ci(),v=async S=>{try{if(S==="mmd"){su("diagram.mmd",e,"text/plain"),f(!1),r==null||r(S);return}if(!x){l==null||l(new Error("Mermaid plugin not available"));return}let N=x.getMermaid(i),w=e.split("").reduce((O,Y)=>(O<<5)-O+Y.charCodeAt(0)|0,0),R=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:C}=await N.render(R,e);if(!C){l==null||l(new Error("SVG not found. Please wait for the diagram to render."));return}if(S==="svg"){su("diagram.svg",C,"image/svg+xml"),f(!1),r==null||r(S);return}if(S==="png"){let O=await BV(C);su("diagram.png",O,"image/png"),r==null||r(S),f(!1);return}}catch(N){l==null||l(N)}};return T.useEffect(()=>{let S=N=>{let w=N.composedPath();h.current&&!w.includes(h.current)&&f(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[]),d.jsxs("div",{className:o("relative"),ref:h,children:[d.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>f(!c),title:E.downloadDiagram,type:"button",children:t??d.jsx(g.DownloadIcon,{size:14})}),c?d.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[d.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:E.downloadDiagramAsSvg,type:"button",children:E.mermaidFormatSvg}),d.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:E.downloadDiagramAsPng,type:"button",children:E.mermaidFormatPng}),d.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:E.downloadDiagramAsMmd,type:"button",children:E.mermaidFormatMmd})]}):null]})},HV=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...l})=>{let{Maximize2Icon:o,XIcon:c}=ls(),f=Ot(),[h,p]=T.useState(!1),{isAnimating:g,controls:x}=T.useContext(fa),E=ci(),v=(()=>{if(typeof x=="boolean")return x;let N=x.mermaid;return N===!1?!1:N===!0||N===void 0?!0:N.panZoom!==!1})(),S=()=>{p(!h)};return T.useEffect(()=>{if(h){Lb();let N=w=>{w.key==="Escape"&&p(!1)};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N),Ib()}}},[h]),T.useEffect(()=>{h?n==null||n():r&&r()},[h,n,r]),d.jsxs(d.Fragment,{children:[d.jsx("button",{className:f("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:g,onClick:S,title:E.viewFullscreen,type:"button",...l,children:d.jsx(o,{size:14})}),h?mu.createPortal(d.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:S,onKeyDown:N=>{N.key==="Escape"&&S()},role:"button",tabIndex:0,children:[d.jsx("button",{className:f("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:S,title:E.exitFullscreen,type:"button",children:d.jsx(c,{size:20})}),d.jsx("div",{className:f("flex size-full items-center justify-center p-4"),onClick:N=>N.stopPropagation(),onKeyDown:N=>N.stopPropagation(),role:"presentation",children:d.jsx(_5,{chart:e,className:f("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},HC=e=>{var t,n;let r=[],i=[],l=e.querySelectorAll("thead th");for(let c of l)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let c of o){let f=[],h=c.querySelectorAll("td");for(let p of h)f.push(((n=p.textContent)==null?void 0:n.trim())||"");i.push(f)}return{headers:r,rows:i}},FC=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1,h=!1;for(let p of c){if(p==='"'){f=!0,h=!0;break}(p===","||p===`
|
|
355
|
-
`)&&(f=!0)}return f?h?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(","),o+=1);for(let c of n)l[o]=c.map(r).join(","),o+=1;return l.join(`
|
|
356
|
-
`)},FV=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1;for(let p of c)if(p===" "||p===`
|
|
357
|
-
`||p==="\r"){f=!0;break}if(!f)return c;let h=[];for(let p of c)p===" "?h.push("\\t"):p===`
|
|
358
|
-
`?h.push("\\n"):p==="\r"?h.push("\\r"):h.push(p);return h.join("")},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(" "),o+=1);for(let c of n)l[o]=c.map(r).join(" "),o+=1;return l.join(`
|
|
359
|
-
`)},cg=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},c1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,l=t.map(c=>cg(c));r[i]=`| ${l.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]="---";r[i]=`| ${o.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let f=new Array(t.length);for(let h=0;h<t.length;h+=1)f[h]=h<c.length?cg(c[h]):"";r[i]=`| ${f.join(" | ")} |`,i+=1}else{let f=c.map(h=>cg(h));r[i]=`| ${f.join(" | ")} |`,i+=1}return r.join(`
|
|
360
|
-
`)},zC=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let l=Ot(),[o,c]=T.useState(!1),[f,h]=T.useState(!1),p=T.useRef(null),g=T.useRef(0),{isAnimating:x}=T.useContext(fa),E=ci(),v=async w=>{var R,C;if(typeof window>"u"||!((R=navigator==null?void 0:navigator.clipboard)!=null&&R.write)){r==null||r(new Error("Clipboard API not available"));return}try{let O=(C=p.current)==null?void 0:C.closest('[data-streamdown="table-wrapper"]'),Y=O==null?void 0:O.querySelector("table");if(!Y){r==null||r(new Error("Table not found"));return}let P=HC(Y),B=({csv:FC,tsv:FV,md:c1}[w]||c1)(P),G=new ClipboardItem({"text/plain":new Blob([B],{type:"text/plain"}),"text/html":new Blob([Y.outerHTML],{type:"text/html"})});await navigator.clipboard.write([G]),h(!0),c(!1),n==null||n(w),g.current=window.setTimeout(()=>h(!1),i)}catch(O){r==null||r(O)}};T.useEffect(()=>{let w=R=>{let C=R.composedPath();p.current&&!C.includes(p.current)&&c(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w),window.clearTimeout(g.current)}},[]);let S=ls(),N=f?S.CheckIcon:S.CopyIcon;return d.jsxs("div",{className:l("relative"),ref:p,children:[d.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:x,onClick:()=>c(!o),title:E.copyTable,type:"button",children:e??d.jsx(N,{height:14,width:14})}),o?d.jsxs("div",{className:l("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[d.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:E.copyTableAsMarkdown,type:"button",children:E.tableFormatMarkdown}),d.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:E.copyTableAsCsv,type:"button",children:E.tableFormatCsv}),d.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:E.copyTableAsTsv,type:"button",children:E.tableFormatTsv})]}):null]})},$C=({children:e,className:t,onDownload:n,onError:r})=>{let i=Ot(),[l,o]=T.useState(!1),c=T.useRef(null),{isAnimating:f}=T.useContext(fa),h=ci(),p=ls(),g=x=>{var E;try{let v=(E=c.current)==null?void 0:E.closest('[data-streamdown="table-wrapper"]'),S=v==null?void 0:v.querySelector("table");if(!S){r==null||r(new Error("Table not found"));return}let N=HC(S),w=x==="csv"?FC(N):c1(N);su(`table.${x==="csv"?"csv":"md"}`,w,x==="csv"?"text/csv":"text/markdown"),o(!1),n==null||n(x)}catch(v){r==null||r(v)}};return T.useEffect(()=>{let x=E=>{let v=E.composedPath();c.current&&!v.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[]),d.jsxs("div",{className:i("relative"),ref:c,children:[d.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>o(!l),title:h.downloadTable,type:"button",children:e??d.jsx(p.DownloadIcon,{size:14})}),l?d.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[d.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("csv"),title:h.downloadTableAsCsv,type:"button",children:h.tableFormatCsv}),d.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("markdown"),title:h.downloadTableAsMarkdown,type:"button",children:h.tableFormatMarkdown})]}):null]})},zV=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:l}=ls(),o=Ot(),[c,f]=T.useState(!1),{isAnimating:h}=T.useContext(fa),p=ci(),g=()=>{f(!0)},x=()=>{f(!1)};return T.useEffect(()=>{if(c){Lb();let E=v=>{v.key==="Escape"&&f(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),Ib()}}},[c]),d.jsxs(d.Fragment,{children:[d.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:g,title:p.viewFullscreen,type:"button",children:d.jsx(i,{size:14})}),c?mu.createPortal(d.jsx("div",{"aria-label":p.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:x,onKeyDown:E=>{E.key==="Escape"&&x()},role:"dialog",children:d.jsxs("div",{className:o("flex h-full flex-col"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[d.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?d.jsx(zC,{}):null,r?d.jsx($C,{}):null,d.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:x,title:p.exitFullscreen,type:"button",children:d.jsx(l,{size:20})})]}),d.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:d.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},$V=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:l=!0,...o})=>{let c=Ot(),f=n&&r,h=n&&i,p=n&&l,g=f||h||p;return d.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[g?d.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[f?d.jsx(zC,{}):null,h?d.jsx($C,{}):null,p?d.jsx(zV,{showCopy:f,showDownload:h,children:e}):null]}):null,d.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:d.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},VV=/startLine=(\d+)/,GV=/\bnoLineNumbers\b/,qV=T.lazy(()=>j(()=>Promise.resolve().then(()=>kY),void 0).then(e=>({default:e.Mermaid}))),YV=/language-([^\s]+)/;function om(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,l=t.position.end;return(n==null?void 0:n.line)===(r==null?void 0:r.line)&&(n==null?void 0:n.column)===(r==null?void 0:r.column)&&(i==null?void 0:i.line)===(l==null?void 0:l.line)&&(i==null?void 0:i.column)===(l==null?void 0:l.column)}function In(e,t){return e.className===t.className&&om(e.node,t.node)}var d1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,dg=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},XT=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Ff=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},jb=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>In(e,t));jb.displayName="MarkdownOl";var VC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&om(e.node,t.node));VC.displayName="MarkdownLi";var GC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>In(e,t));GC.displayName="MarkdownUl";var qC=T.memo(({className:e,node:t,...n})=>{let r=Ot();return d.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>In(e,t));qC.displayName="MarkdownHr";var YC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>In(e,t));YC.displayName="MarkdownStrong";var WV=({children:e,className:t,href:n,node:r,...i})=>{let l=Ot(),{linkSafety:o}=T.useContext(fa),[c,f]=T.useState(!1),h=n==="streamdown:incomplete-link",p=T.useCallback(async v=>{if(!(!(o!=null&&o.enabled&&n)||h)){if(v.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}f(!0)}},[o,n,h]),g=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),x=T.useCallback(()=>{f(!1)},[]),E={url:n??"",isOpen:c,onClose:x,onConfirm:g};return o!=null&&o.enabled&&n?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:l("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",onClick:p,type:"button",children:e}),o.renderModal?o.renderModal(E):d.jsx(MV,{...E})]}):d.jsx("a",{className:l("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},WC=T.memo(WV,(e,t)=>In(e,t)&&e.href===t.href);WC.displayName="MarkdownA";var QC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>In(e,t));QC.displayName="MarkdownH1";var XC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>In(e,t));XC.displayName="MarkdownH2";var KC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>In(e,t));KC.displayName="MarkdownH3";var ZC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>In(e,t));ZC.displayName="MarkdownH4";var JC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>In(e,t));JC.displayName="MarkdownH5";var e5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>In(e,t));e5.displayName="MarkdownH6";var t5=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(fa),l=d1(i,"table"),o=dg(i,"copy"),c=dg(i,"download"),f=dg(i,"fullscreen");return d.jsx($V,{className:t,showControls:l,showCopy:o,showDownload:c,showFullscreen:f,...r,children:e})},(e,t)=>In(e,t));t5.displayName="MarkdownTable";var n5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>In(e,t));n5.displayName="MarkdownThead";var r5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>In(e,t));r5.displayName="MarkdownTbody";var a5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>In(e,t));a5.displayName="MarkdownTr";var s5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>In(e,t));s5.displayName="MarkdownTh";var i5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>In(e,t));i5.displayName="MarkdownTd";var l5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>In(e,t));l5.displayName="MarkdownBlockquote";var o5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>In(e,t));o5.displayName="MarkdownSup";var u5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>In(e,t));u5.displayName="MarkdownSub";var c5=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var c,f;if(!T.isValidElement(o))return!1;let h=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,g=!1;for(let x of h)if(x){if(typeof x=="string")x.trim()!==""&&(p=!0);else if(T.isValidElement(x))if(((c=x.props)==null?void 0:c["data-footnote-backref"])!==void 0)g=!0;else{let E=Array.isArray(x.props.children)?x.props.children:[x.props.children];for(let v of E){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((f=v.props)==null?void 0:f["data-footnote-backref"])===void 0){p=!0;break}}}}return g&&!p},l=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===jb){let c=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(f=>!i(f));return c.length===0?null:{...o,props:{...o.props,children:c}}}return o}):e;return(Array.isArray(l)?l.some(o=>o!==null):l!==null)?d.jsx("section",{className:t,...r,children:l}):null}return d.jsx("section",{className:t,...r,children:e})},(e,t)=>In(e,t));c5.displayName="MarkdownSection";var QV=({node:e,className:t,children:n,...r})=>{var i,l;let o=Ot(),c=!("data-block"in r),{mermaid:f,controls:h,lineNumbers:p}=T.useContext(fa),g=Db(),x=dV(),E=t==null?void 0:t.match(YV),v=(i=E==null?void 0:E.at(1))!=null?i:"",S=PV(v);if(c)return d.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let N=(l=e==null?void 0:e.properties)==null?void 0:l.metastring,w=N==null?void 0:N.match(VV),R=w?Number.parseInt(w[1],10):void 0,C=R!==void 0&&R>=1?R:void 0,O=!(N&&GV.test(N))&&p!==!1,Y="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?Y=n.props.children:typeof n=="string"&&(Y=n),S){let le=S.component;return d.jsx(T.Suspense,{fallback:d.jsx(QT,{}),children:d.jsx(le,{code:Y,isIncomplete:x,language:v,meta:N})})}if(v==="mermaid"&&g){let le=d1(h,"mermaid"),Q=Ff(h,"download"),ce=Ff(h,"copy"),W=Ff(h,"fullscreen"),fe=Ff(h,"panZoom"),ge=le&&(Q||ce||W);return d.jsx(T.Suspense,{fallback:d.jsx(QT,{}),children:d.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[d.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:d.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),ge?d.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:d.jsxs("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[Q?d.jsx(UV,{chart:Y,config:f==null?void 0:f.config}):null,ce?d.jsx(YT,{code:Y}):null,W?d.jsx(HV,{chart:Y,config:f==null?void 0:f.config}):null]})}):null,d.jsx("div",{className:o("rounded-md border border-border bg-background"),children:d.jsx(qV,{chart:Y,config:f==null?void 0:f.config,showControls:fe})})]})})}let P=d1(h,"code"),B=XT(h,"download"),G=XT(h,"copy");return d.jsx(_V,{className:t,code:Y,isIncomplete:x,language:v,lineNumbers:O,startLine:C,children:P?d.jsxs(d.Fragment,{children:[B?d.jsx(OV,{code:Y,language:v}):null,G?d.jsx(YT,{}):null]}):null})},d5=T.memo(QV,(e,t)=>e.className===t.className&&om(e.node,t.node));d5.displayName="MarkdownCode";var f5=T.memo(jV,(e,t)=>e.className===t.className&&om(e.node,t.node));f5.displayName="MarkdownImg";var h5=T.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&T.isValidElement(r[0])){let i=r[0].props.node,l=i==null?void 0:i.tagName;if(l==="img")return d.jsx(d.Fragment,{children:e});if(l==="code"&&"data-block"in r[0].props)return d.jsx(d.Fragment,{children:e})}return d.jsx("p",{...n,children:e})},(e,t)=>In(e,t));h5.displayName="MarkdownParagraph";var XV={ol:jb,li:VC,ul:GC,hr:qC,strong:YC,a:WC,h1:QC,h2:XC,h3:KC,h4:ZC,h5:JC,h6:e5,table:t5,thead:n5,tbody:r5,tr:a5,th:s5,td:i5,blockquote:l5,code:d5,img:f5,pre:({children:e})=>T.isValidElement(e)?T.cloneElement(e,{"data-block":"true"}):e,sup:o5,sub:u5,p:h5,section:c5},KV=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,ZV=new RegExp("\\p{L}","u");function KT(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(KV.test(n))return"rtl";if(ZV.test(n))return"ltr"}return"ltr"}var JV=/^[ \t]{0,3}(`{3,}|~{3,})/,eG=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,ZT=e=>{let t=e.split(`
|
|
361
|
-
`),n=null,r=0;for(let i of t){let l=JV.exec(i);if(n===null){if(l){let o=l[1];n=o[0],r=o.length}}else if(l){let o=l[1],c=o[0],f=o.length;c===n&&f>=r&&(n=null,r=0)}}return n!==null},tG=e=>{let t=e.split(`
|
|
362
|
-
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&eG.test(r))return!0}return!1},nG=()=>e=>{vs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},JT=[],ev={allowDangerousHtml:!0},zf=new WeakMap,rG=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let p="default";return this.keyCache.set(e,p),p}let l=p=>{if(!p||p.length===0)return"";let g="";for(let x=0;x<p.length;x+=1){let E=p[x];if(x>0&&(g+=","),Array.isArray(E)){let[v,S]=E;if(typeof v=="function"){let N=zf.get(v);N||(N=v.name,zf.set(v,N)),g+=N}else g+=String(v);g+=":",g+=JSON.stringify(S)}else if(typeof E=="function"){let v=zf.get(E);v||(v=E.name,zf.set(E,v)),g+=v}else g+=String(E)}return g},o=l(n),c=l(r),f=i?JSON.stringify(i):"",h=`${c}::${o}::${f}`;return this.keyCache.set(e,h),h}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},tv=new rG,m5=e=>{let t=aG(e),n=e.children||"",r=t.runSync(t.parse(n),n);return dG(r,e)},aG=e=>{let t=tv.get(e);if(t)return t;let n=iG(e);return tv.set(e,n),n},sG=e=>e.some(t=>Array.isArray(t)?t[0]===Wg:t===Wg),iG=e=>{let t=e.rehypePlugins||JT,n=e.remarkPlugins||JT,r=sG(t)?n:[...n,nG],i=e.remarkRehypeOptions?{...ev,...e.remarkRehypeOptions}:ev;return l$().use(iz).use(r).use(zz,i).use(t)},lG=e=>e,oG=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},uG=(e,t)=>{var n;for(let r in tg)if(Object.hasOwn(tg,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],l=tg[r];(l===null||l.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},cG=(e,t,n,r,i,l)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&l&&typeof t=="number"&&(o=!l(e,t,n)),o},dG=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:l,unwrapDisallowed:o,urlTransform:c}=t;if(n||r||i||l||c){let f=c||lG;vs(e,(h,p,g)=>{if(h.type==="raw"&&g&&typeof p=="number")return oG(g,p,l,h.value),p;if(h.type==="element"&&(uG(h,f),cG(h,p,g,r,i,n)&&g&&typeof p=="number"))return o&&h.children?g.children.splice(p,1,...h.children):g.children.splice(p,1),p})}return mF(e,{Fragment:d.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0})},fG=/\[\^[\w-]{1,200}\](?!:)/,hG=/\[\^[\w-]{1,200}\]:/,mG=/<(\w+)[\s>]/,pG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),nv=new Map,rv=new Map,gG=e=>{let t=e.toLowerCase(),n=nv.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return nv.set(t,r),r},bG=e=>{let t=e.toLowerCase(),n=rv.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return rv.set(t,r),r},av=(e,t)=>{if(pG.has(t.toLowerCase()))return 0;let n=e.match(gG(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},sv=(e,t)=>{let n=e.match(bG(t));return n?n.length:0},xG=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},yG=e=>{let t=fG.test(e),n=hG.test(e);if(t||n)return[e];let r=Ua.lex(e,{gfm:!0}),i=[],l=[],o=!1;for(let c of r){let f=c.raw,h=i.length;if(l.length>0){i[h-1]+=f;let p=l.at(-1),g=av(f,p),x=sv(f,p);for(let E=0;E<g;E+=1)l.push(p);for(let E=0;E<x;E+=1)l.length>0&&l.at(-1)===p&&l.pop();continue}if(c.type==="html"&&c.block){let p=f.match(mG);if(p){let g=p[1],x=av(f,g),E=sv(f,g);x>E&&l.push(g)}}if(h>0&&!o){let p=i[h-1];if(xG(p)%2===1){i[h-1]=p+f;continue}}i.push(f),c.type!=="space"&&(o=c.type==="code")}return i},EG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,f)=>{if(!c.includes(`
|
|
363
|
-
|
|
364
|
-
`))return o+c+f;let h=c.replace(/\n\n/g,`
|
|
365
|
-
<!---->
|
|
366
|
-
`),p=(h.startsWith(`
|
|
367
|
-
`)?"":`
|
|
368
|
-
`)+h+(h.endsWith(`
|
|
369
|
-
`)?"":`
|
|
370
|
-
`);return`${o}${p}${f}
|
|
371
|
-
|
|
372
|
-
`})}return n},_G=/([\\`*_~[\]|])/g,TG=e=>e.replace(_G,"\\$1"),vG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,f)=>{let h=TG(c).replace(/\n\n/g," ");return o+h+f})}return n},p5=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(p5).join(""):"",kG=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));vs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=p5(r);r.children=i?[{type:"text",value:i}]:[]}})},wG=()=>e=>{vs(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},CG=/^[ \t]*<[\w!/?-]/,SG=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,NG=e=>typeof e!="string"||e.length===0||!CG.test(e)?e:e.replace(SG,"$1"),iv,lv,ov,uv,oh={...zl,protocols:{...zl.protocols,href:[...(lv=(iv=zl.protocols)==null?void 0:iv.href)!=null?lv:[],"tel"]},attributes:{...zl.attributes,code:[...(uv=(ov=zl.attributes)==null?void 0:ov.code)!=null?uv:[],"metastring"]}},f1={raw:Wg,sanitize:[o3,oh],harden:[q8,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},g5={gfm:[tU,{}],codeMeta:wG},cv=Object.values(f1),AG=Object.values(g5),RG={block:" ▋",circle:" ●"},b5=["github-light","github-dark"],x5={enabled:!0},LG={shikiTheme:b5,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:x5},fa=T.createContext(LG),y5=T.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:l,animatePlugin:o,...c})=>{if(o){let p=o.getLastRenderCharCount();o.setPrevContentLength(p)}let f=typeof e=="string"&&n?NG(e):e,h=d.jsx(m5,{...c,children:f});return d.jsx(jC.Provider,{value:i,children:l?d.jsx("div",{dir:l,style:{display:"contents"},children:h}):h})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var l,o;return((l=e.components)==null?void 0:l[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});y5.displayName="Block";var E5=T.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:l,rehypePlugins:o=cv,remarkPlugins:c=AG,className:f,shikiTheme:h=b5,mermaid:p,controls:g=!0,isAnimating:x=!1,animated:E,BlockComponent:v=y5,parseMarkdownIntoBlocksFn:S=yG,caret:N,plugins:w,remend:R,linkSafety:C=x5,lineNumbers:O=!0,allowedTags:Y,literalTagContent:P,translations:B,icons:G,prefix:le,onAnimationStart:Q,onAnimationEnd:ce,...W})=>{let fe=T.useId(),[ge,re]=T.useTransition(),F=T.useMemo(()=>hV(le),[le]),$=T.useRef(null),J=T.useRef(Q),he=T.useRef(ce);J.current=Q,he.current=ce,T.useEffect(()=>{var Ye,Pe,At;if(t==="static")return;let sn=$.current;if($.current=x,sn===null){x&&((Ye=J.current)==null||Ye.call(J));return}x&&!sn?(Pe=J.current)==null||Pe.call(J):!x&&sn&&((At=he.current)==null||At.call(he))},[x,t]);let A=T.useMemo(()=>Y?Object.keys(Y):[],[Y]),H=T.useMemo(()=>{if(typeof e!="string")return"";let Ye=t==="streaming"&&r?fH(e,R):e;return P&&P.length>0&&(Ye=vG(Ye,P)),A.length>0&&(Ye=EG(Ye,A)),Ye},[e,t,r,R,A,P]),te=T.useMemo(()=>S(H),[H,S]),[D,we]=T.useState(te);T.useEffect(()=>{t==="streaming"&&!je?re(()=>{we(te)}):we(te)},[te,t]);let Re=t==="streaming"?D:te,Ne=T.useMemo(()=>n==="auto"?Re.map(KT):void 0,[Re,n]),Xe=T.useMemo(()=>Re.map((Ye,Pe)=>`${fe}-${Pe}`),[Re.length,fe]),Ze=T.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),je=T.useMemo(()=>Ze?Ze==="true"?i1():i1(E):null,[Ze]),Dt=T.useMemo(()=>{var Ye,Pe;return{shikiTheme:(Pe=(Ye=w==null?void 0:w.code)==null?void 0:Ye.getThemes())!=null?Pe:h,controls:g,isAnimating:x,lineNumbers:O,mode:t,mermaid:p,linkSafety:C}},[h,g,x,O,t,p,C,w==null?void 0:w.code]),Ue=T.useMemo(()=>B?JSON.stringify(B):"",[B]),jt=T.useMemo(()=>({...UC,...B}),[Ue]),an=T.useMemo(()=>{let{inlineCode:Ye,...Pe}=l??{},At={...XV,...Pe};if(Ye){let sn=At.code;At.code=cn=>"data-block"in cn?sn?T.createElement(sn,cn):null:T.createElement(Ye,cn)}return At},[l]),rt=T.useMemo(()=>{let Ye=[];return w!=null&&w.cjk&&(Ye=[...Ye,...w.cjk.remarkPluginsBefore]),Ye=[...Ye,...c],w!=null&&w.cjk&&(Ye=[...Ye,...w.cjk.remarkPluginsAfter]),w!=null&&w.math&&(Ye=[...Ye,w.math.remarkPlugin]),Ye},[c,w==null?void 0:w.math,w==null?void 0:w.cjk]),pt=T.useMemo(()=>{var Ye;let Pe=o;if(Y&&Object.keys(Y).length>0&&o===cv){let At={...oh,tagNames:[...(Ye=oh.tagNames)!=null?Ye:[],...Object.keys(Y)],attributes:{...oh.attributes,...Y}};Pe=[f1.raw,[o3,At],f1.harden]}return P&&P.length>0&&(Pe=[...Pe,[kG,P]]),w!=null&&w.math&&(Pe=[...Pe,w.math.rehypePlugin]),je&&x&&(Pe=[...Pe,je.rehypePlugin]),Pe},[o,w==null?void 0:w.math,je,x,Y,P]),at=T.useMemo(()=>{if(!x||Re.length===0)return!1;let Ye=Re.at(-1);return ZT(Ye)||tG(Ye)},[x,Re]),yn=T.useMemo(()=>N&&x&&!at?{"--streamdown-caret":`"${RG[N]}"`}:void 0,[N,x,at]);return t==="static"?d.jsx(o1.Provider,{value:jt,children:d.jsx(u1.Provider,{value:w??null,children:d.jsx(fa.Provider,{value:Dt,children:d.jsx(qT,{icons:G,children:d.jsx(l1.Provider,{value:F,children:d.jsx("div",{className:F("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",f),dir:n==="auto"?KT(H):n,children:d.jsx(m5,{components:an,rehypePlugins:pt,remarkPlugins:rt,...W,children:H})})})})})})}):d.jsx(o1.Provider,{value:jt,children:d.jsx(u1.Provider,{value:w??null,children:d.jsx(fa.Provider,{value:Dt,children:d.jsx(qT,{icons:G,children:d.jsx(l1.Provider,{value:F,children:d.jsxs("div",{className:F("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",N&&!at?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,f),style:yn,children:[Re.length===0&&N&&x&&d.jsx("span",{}),Re.map((Ye,Pe)=>{var At;let sn=Pe===Re.length-1,cn=x&&sn&&ZT(Ye);return d.jsx(v,{animatePlugin:je,components:an,content:Ye,dir:(At=Ne==null?void 0:Ne[Pe])!=null?At:n!=="auto"?n:void 0,index:Pe,isIncomplete:cn,rehypePlugins:pt,remarkPlugins:rt,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...W},Xe[Pe])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);E5.displayName="Streamdown";var IG=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:l=!0,initialZoom:o=1,fullscreen:c=!1})=>{let{RotateCcwIcon:f,ZoomInIcon:h,ZoomOutIcon:p}=ls(),g=Ot(),x=T.useRef(null),E=T.useRef(null),[v,S]=T.useState(o),[N,w]=T.useState({x:0,y:0}),[R,C]=T.useState(!1),[O,Y]=T.useState({x:0,y:0}),[P,B]=T.useState({x:0,y:0}),G=T.useCallback(F=>{S($=>Math.max(n,Math.min(r,$+F)))},[n,r]),le=T.useCallback(()=>{G(i)},[G,i]),Q=T.useCallback(()=>{G(-i)},[G,i]),ce=T.useCallback(()=>{S(o),w({x:0,y:0})},[o]),W=T.useCallback(F=>{F.preventDefault();let $=F.deltaY>0?-i:i;G($)},[G,i]),fe=T.useCallback(F=>{if(F.button!==0||F.isPrimary===!1)return;C(!0),Y({x:F.clientX,y:F.clientY}),B(N);let $=F.currentTarget;$ instanceof HTMLElement&&$.setPointerCapture(F.pointerId)},[N]),ge=T.useCallback(F=>{if(!R)return;F.preventDefault();let $=F.clientX-O.x,J=F.clientY-O.y;w({x:P.x+$,y:P.y+J})},[R,O,P]),re=T.useCallback(F=>{C(!1);let $=F.currentTarget;$ instanceof HTMLElement&&$.releasePointerCapture(F.pointerId)},[]);return T.useEffect(()=>{let F=x.current;if(F)return F.addEventListener("wheel",W,{passive:!1}),()=>{F.removeEventListener("wheel",W)}},[W]),T.useEffect(()=>{let F=E.current;if(F&&R)return document.body.style.userSelect="none",F.addEventListener("pointermove",ge,{passive:!1}),F.addEventListener("pointerup",re),F.addEventListener("pointercancel",re),()=>{document.body.style.userSelect="",F.removeEventListener("pointermove",ge),F.removeEventListener("pointerup",re),F.removeEventListener("pointercancel",re)}},[R,ge,re]),d.jsxs("div",{className:g("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:x,style:{cursor:R?"grabbing":"grab"},children:[l?d.jsxs("div",{className:g("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[d.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:le,title:"Zoom in",type:"button",children:d.jsx(h,{size:16})}),d.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:Q,title:"Zoom out",type:"button",children:d.jsx(p,{size:16})}),d.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:ce,title:"Reset zoom and pan",type:"button",children:d.jsx(f,{size:16})})]}):null,d.jsx("div",{className:g("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:fe,ref:E,role:"application",style:{transform:`translate(${N.x}px, ${N.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},_5=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let l=Ot(),[o,c]=T.useState(null),[f,h]=T.useState(!1),[p,g]=T.useState(""),[x,E]=T.useState(""),[v,S]=T.useState(0),{mermaid:N}=T.useContext(fa),w=Db(),R=N==null?void 0:N.errorComponent,{shouldRender:C,containerRef:O}=tV({immediate:r});if(T.useEffect(()=>{if(C){if(!w){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),h(!0);let P=w.getMermaid(n),B=e.split("").reduce((Q,ce)=>(Q<<5)-Q+ce.charCodeAt(0)|0,0),G=`mermaid-${Math.abs(B)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:le}=await P.render(G,e);g(le),E(le)}catch(P){if(!(x||p)){let B=P instanceof Error?P.message:"Failed to render Mermaid chart";c(B)}}finally{h(!1)}})()}},[e,n,v,C,w]),!(C||p||x))return d.jsx("div",{className:l("my-4 min-h-[200px]",t),ref:O});if(f&&!p&&!x)return d.jsx("div",{className:l("my-4 flex justify-center p-4",t),ref:O,children:d.jsxs("div",{className:l("flex items-center space-x-2 text-muted-foreground"),children:[d.jsx("div",{className:l("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),d.jsx("span",{className:l("text-sm"),children:"Loading diagram..."})]})});if(o&&!p&&!x){let P=()=>S(B=>B+1);return R?d.jsx("div",{ref:O,children:d.jsx(R,{chart:e,error:o,retry:P})}):d.jsxs("div",{className:l("rounded-md bg-red-50 p-4",t),ref:O,children:[d.jsxs("p",{className:l("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),d.jsxs("details",{className:l("mt-2"),children:[d.jsx("summary",{className:l("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),d.jsx("pre",{className:l("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let Y=p||x;return d.jsx("div",{className:l("size-full",t),"data-streamdown":"mermaid",ref:O,children:d.jsx(IG,{className:l(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:d.jsx("div",{"aria-label":"Mermaid chart",className:l("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:Y},role:"img"})})})};function T5({open:e,title:t,text:n,onClose:r}){return T.useEffect(()=>{if(!e)return;function i(l){l.key==="Escape"&&r()}return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[r,e]),e?mu.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close full text",onClick:r,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[d.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:t}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}const OG=[/^(?: {0,3})#{1,6}\s+\S/m,/^(?: {0,3})>{1,}\s*\S/m,/^(?: {0,3})(?:[-+*]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?\S/m,/^(?: {0,3})(?:```|~~~)/m,/^(?: {0,3})(?:[-*_]\s*){3,}$/m],DG=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,jG=/!?\[[^\]\n]+\]\([^)]+\)/,MG=/`[^`\n]+`/,PG=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,BG=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,UG=/~~[^~\n]+~~/;function HG(e){const t=e.trim();return t?OG.some(n=>n.test(t))||DG.test(t)?!0:/[`[\]*_~!]/.test(t)?jG.test(t)||MG.test(t)||PG.test(t)||BG.test(t)||UG.test(t):!1:!1}function um(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function iu(e){return e?new Date(e).toLocaleString():"Time unavailable"}function v5(e){switch(e){case"idle":return"Idle";case"running":return"Running";case"interrupted":return"Interrupted";case"failed":return"Failed";case"not_loaded":return"Not Loaded";case"system_error":return"System Error"}}function FG(e){switch(e){case"idle":return"ui-status-neutral";case"running":return"ui-status-info";case"interrupted":return"ui-status-warning";case"failed":case"system_error":return"ui-status-danger";case"not_loaded":return"ui-status-neutral"}}function k5(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function pa(e){switch(e){case"userMessage":return"timeline-kind-user";case"agentMessage":return"timeline-kind-agent";case"image":return"timeline-kind-action";case"contextCompaction":return"timeline-kind-action";case"commandExecution":return"timeline-kind-command";case"webSearch":return"timeline-kind-search";case"fileRead":return"timeline-kind-file-read";case"reasoning":return"timeline-kind-reasoning";case"agentToolCall":return"timeline-kind-agent-tool";case"skillToolCall":return"timeline-kind-skill-tool";case"toolCall":return"timeline-kind-action";case"plan":return"timeline-kind-plan";case"fileChange":return"timeline-kind-file";case"hook":return"timeline-kind-action";case"other":return"ui-status-neutral"}}function w5(e){switch(e){case"userMessage":return"User";case"agentMessage":return"Agent";case"image":return"Image";case"contextCompaction":return"Context";case"commandExecution":return"Command";case"webSearch":return"Web Search";case"fileRead":return"File Read";case"reasoning":return"Reasoning";case"agentToolCall":return"Agent";case"skillToolCall":return"Skill";case"toolCall":return"Tool";case"plan":return"Plan";case"fileChange":return"File Change";case"hook":return"Hook";case"other":return"Other"}}function zG(e){return e==="commandExecution"||e==="reasoning"}const dv=10,$G=10,h1=80;function ga(e){switch(e){case"userMessage":return"timeline-user";case"agentMessage":return"timeline-agent";case"image":return"timeline-action";case"contextCompaction":return"timeline-action";case"commandExecution":return"timeline-command";case"webSearch":return"timeline-search";case"fileRead":return"timeline-file-read";case"reasoning":return"timeline-reasoning";case"agentToolCall":return"timeline-agent-tool";case"skillToolCall":return"timeline-skill-tool";case"toolCall":return"timeline-action";case"plan":return"timeline-plan";case"fileChange":return"timeline-file-change";case"hook":return"timeline-action";case"other":return"timeline-other"}}function Er(e){switch(e){case"user":return"timeline-overlay-badge timeline-overlay-badge-user";case"agent":return"timeline-overlay-badge timeline-overlay-badge-agent";case"command":return"timeline-overlay-badge timeline-overlay-badge-command";case"search":return"timeline-overlay-badge timeline-overlay-badge-search";case"fileRead":return"timeline-overlay-badge timeline-overlay-badge-file-read";case"agentTool":return"timeline-overlay-badge timeline-overlay-badge-agent-tool";case"skillTool":return"timeline-overlay-badge timeline-overlay-badge-skill-tool";case"action":return"timeline-overlay-badge timeline-overlay-badge-action"}}function fv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3.5 5.25h9"}),d.jsx("path",{d:"M5 8h6"}),d.jsx("path",{d:"M6.5 10.75h3"})]})}function VG(e){var n;const t=e.replace(/\r\n/g,`
|
|
373
|
-
`).split(`
|
|
374
|
-
`);for(;t.length>1&&((n=t.at(-1))==null?void 0:n.trim())==="";)t.pop();return t}function hv(e){return e.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function Ss(e){const t=VG(e);return t.length===1?{firstLine:t[0]??"",showGap:!1,isTruncated:!1}:{firstLine:t[0]??"",showGap:!0,isTruncated:!0}}function m1(e){const t=e.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!t)return null;const n=t[1]?hv(t[1]):null,r=hv(t[2]??"").trim(),i=(n==null?void 0:n.split(":")[0])??"hook",l=i==="stop"?"Stop":i,o=(n==null?void 0:n.split(":").slice(2).join(":"))||null;return{id:`live-hook-prompt:${n??"unknown"}`,kind:"hook",text:`${l} hook`,previewText:r||`${l} hook`,detailText:r||null,status:"Completed",hookEventName:i,hookEventLabel:l,hookHandlerType:"command",hookScope:"turn",hookSource:o?"project":null,hookSourcePath:o,hookStatusMessage:null,hookOutputEntries:r?[{kind:"warning",text:r}]:[]}}function mv(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function GG(e){var l;if(!e)return[];const t=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let r=0,i=0;for(const o of e.matchAll(t)){const c=o.index??0;c>r&&(n.push({type:"text",key:`text-${i}`,text:e.slice(r,c)}),i+=1);const f=o[1],h=((l=o[2])==null?void 0:l.trim())??"";f==="PHOTO"&&h?n.push({type:"photo",key:`photo-${i}`,path:h}):f==="FILE"&&h?n.push({type:"file",key:`file-${i}`,path:h}):n.push({type:"text",key:`text-${i}`,text:o[0]}),i+=1,r=c+o[0].length}return r<e.length&&n.push({type:"text",key:`text-${i}`,text:e.slice(r)}),n}function C5(e,t=42){const n=e.trim();if(!n)return"";const r=n.match(/(, \+\d+ more.*)$/),i=(r==null?void 0:r[1])??"",l=i?n.slice(0,-i.length):n;if(l.length<=t)return`${l}${i}`;const c=l.replace(/\\/g,"/").split("/").filter(Boolean);if(c.length>1){const f=[];let h=i.length+4;for(let p=c.length-1;p>=0;p-=1){const g=c[p],x=h+g.length+(f.length>0?1:0);if(f.length>0&&x>t)break;f.unshift(g),h=x}if(f.length>0)return`.../${f.join("/")}${i}`}return`...${l.slice(-(t-i.length-3))}${i}`}function qG(e){var r;const t=[];if(typeof e.changedFiles=="number"&&e.changedFiles>0&&t.push(`${e.changedFiles} ${e.changedFiles===1?"file":"files"}`),typeof e.addedLines=="number"&&e.addedLines>0&&t.push(`+${e.addedLines}`),typeof e.removedLines=="number"&&e.removedLines>0&&t.push(`-${e.removedLines}`),t.length>0)return t;const n=(r=e.previewText)==null?void 0:r.trim();return n?n.replace(/\bfiles changed\b/gi,"files").replace(/\bfile changed\b/gi,"file").split("·").map(i=>i.trim()).filter(Boolean):[]}function YG(e){return e==="userMessage"||e==="agentMessage"}function WG(e){return e==="commandExecution"||e==="webSearch"||e==="fileRead"||e==="fileChange"||e==="image"||e==="contextCompaction"}function QG(e){return e==="agentMessage"||e==="reasoning"||e==="agentToolCall"||e==="skillToolCall"||e==="toolCall"||e==="plan"}function XG(e,t){if(!t)return e;const n=[...e],r=n.findIndex(l=>l.kind==="userMessage");if(r<0)return n;for(let l=r+1;l<n.length;l+=1){const o=n[l];if(!o||o.kind!=="userMessage")continue;let c=l+1;for(;c<n.length&&WG(n[c].kind);)c+=1;if(c===l+1)continue;const[f]=n.splice(l,1);n.splice(c-1,0,f),l=c-1}let i=!1;return n.map((l,o)=>l.kind!=="userMessage"?l:i?n.slice(o+1).some(f=>QG(f.kind))?l:{...l,status:"Awaiting response"}:(i=!0,l))}function Ki(e){return typeof e.sequence=="number"&&Number.isFinite(e.sequence)}function $f(e){return Ki(e)?e.sequence:Number.POSITIVE_INFINITY}function pv(e){var h;const t=[];let n=0;for(;n<e.length&&((h=e[n])==null?void 0:h.kind)==="userMessage"&&!Ki(e[n]);)t.push(e[n]),n+=1;const r=e.slice(n);if(!r.some(Ki))return e;const i=r.map(p=>$f(p)).filter(Number.isFinite),l=i.length>0?Math.max(...i):0,o=[];let c=0;for(;c<r.length;){const p=r[c];if(Ki(p)){o.push({item:p,index:c,order:$f(p)}),c+=1;continue}const g=c;for(;c<r.length&&!Ki(r[c]);)c+=1;const x=r.slice(g,c),E=[...r.slice(0,g)].reverse().find(Ki),v=r.slice(c).find(Ki),S=E?$f(E):null,N=v?$f(v):null;x.forEach((w,R)=>{let C;if(S===null&&N!==null)C=N-(x.length-R)/(x.length+1);else if(S!==null&&N!==null&&N>S){const O=N-S;C=S+(R+1)/(x.length+1)*O}else C=l+1+R/(x.length+1);o.push({item:w,index:g+R,order:C})})}const f=o.sort((p,g)=>{const x=p.order-g.order;return x===0?p.index-g.index:x}).map(p=>p.item);return[...t,...f]}function KG(e,t){if(!t||t.length===0)return pv(e);const n=new Map(t.map(l=>[l.id,l])),r=e.map(l=>{const o=n.get(l.id);if(!o)return l;n.delete(l.id);const c={...l,...o,text:o.text||l.text},f=o.detailText??l.detailText,h=o.previewText??l.previewText,p=o.status??l.status,g=o.sequence??l.sequence;return f!==void 0&&(c.detailText=f),h!==void 0&&(c.previewText=h),p!==void 0&&(c.status=p),g!==void 0&&(c.sequence=g),c}),i=[...n.values()];return i.length===0&&!r.some(Ki)||(r.push(...i),!r.some(l=>typeof l.sequence=="number"&&Number.isFinite(l.sequence)))?r:pv(r)}function ZG(e,t){if(!e)return"";const n=t.filter(f=>f.kind==="agentMessage").map(f=>f.text).filter(f=>f.length>0),r=n.at(-1)??"";if(r){const f=e.lastIndexOf(r);if(f>=0){const h=e.slice(f+r.length);return h.trim()?h:""}}const i=n.join("");if(!i)return e;const l=Math.min(e.length,i.length);let o=0;for(;o<l&&e[o]===i[o];)o+=1;if(o===0)return e;const c=e.slice(o);return c.trim()?c:""}function zr(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("running")||t.includes("inprogress")||t.includes("in_progress")}function Oh(e){return e==="inProgress"||e==="sending"}function fg(e,t=h1){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function JG(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Math.max(n.top,r.top),l=Math.min(n.bottom,r.bottom);return Math.max(0,l-i)>0}function eq(e){var o,c;const t=[];let n=0;const r=new Set,i=[];function l(){const f=i.splice(0);for(const h of f)t.push({kind:"item",key:h.id,item:h})}for(;n<e.length;){const f=e[n];if(!f)break;if(r.has(f.id)){n+=1;continue}if(f.kind==="reasoning"){let g=n;for(;g<e.length&&((o=e[g])==null?void 0:o.kind)==="reasoning";)i.push(e[g]),g+=1;n=g;continue}if(f.kind==="agentMessage"){const g=i.splice(0);for(const x of g)r.add(x.id);t.push({kind:"item",key:f.id,item:g.length>0?{...f,reasoningItems:g}:f}),n+=1;continue}if(f.kind!=="commandExecution"&&f.kind!=="fileChange"&&f.kind!=="webSearch"&&f.kind!=="fileRead"){t.push({kind:"item",key:f.id,item:f}),n+=1;continue}const h=[];for(;n<e.length&&((c=e[n])==null?void 0:c.kind)===f.kind;)h.push(e[n]),n+=1;if(h.length===1){t.push({kind:"item",key:h[0].id,item:h[0]});continue}const p=h.map(g=>g.id).join(":");if(f.kind==="commandExecution"){t.push({kind:"commandGroup",key:p,items:h});continue}if(f.kind==="fileChange"){t.push({kind:"fileChangeGroup",key:p,items:h});continue}if(f.kind==="fileRead"){t.push({kind:"fileReadGroup",key:p,items:h});continue}t.push({kind:"searchGroup",key:p,items:h})}return l(),t}function gv({kind:e}){return e==="userMessage"?d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 8a2.75 2.75 0 1 0 0-5.5A2.75 2.75 0 0 0 8 8Z"}),d.jsx("path",{d:"M3.5 13.25a4.5 4.5 0 0 1 9 0"})]}):d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"7.5",rx:"2"}),d.jsx("path",{d:"M5.5 6.75h.01M10.5 6.75h.01M6.5 12.25h3"}),d.jsx("path",{d:"M6 10.5v1.75M10 10.5v1.75"})]})}function bv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"m4 5 2 2-2 2"}),d.jsx("path",{d:"M7.75 9.5h4.25"})]})}function p1(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.25 4.25 3.5 7l2.75 2.75"}),d.jsx("path",{d:"M9.75 4.25 12.5 7 9.75 9.75"}),d.jsx("path",{d:"M8.9 3.5 7.1 10.5"}),d.jsx("path",{d:"M3 12.25h10"})]})}function xv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"6.5",rx:"2"}),d.jsx("path",{d:"M5.5 6.25h.01M10.5 6.25h.01"}),d.jsx("path",{d:"M6.25 11.25h3.5"}),d.jsx("path",{d:"M6 13h4"}),d.jsx("path",{d:"M5.25 9.5v1.75M10.75 9.5v1.75"})]})}function yv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5 3.25h6a1.5 1.5 0 0 1 1.5 1.5v6.5a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 0 1-1.5-1.5v-6.5A1.5 1.5 0 0 1 5 3.25Z"}),d.jsx("path",{d:"M6.25 6.25h3.5"}),d.jsx("path",{d:"M6.25 8.25h2.25"}),d.jsx("path",{d:"M10.75 8.5v2.25"}),d.jsx("path",{d:"M9.62 9.62h2.26"})]})}function Ev(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.25 4.5v4.25a2.75 2.75 0 1 0 2.75 2.75V7.25"}),d.jsx("path",{d:"M9 7.25a2.75 2.75 0 1 0-2.75-2.75"})]})}function _v(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),d.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),d.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),d.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),d.jsx("path",{d:"M7.9 5.5h1.7"}),d.jsx("path",{d:"m7.75 8 1 1-1 1"}),d.jsx("path",{d:"M9.4 9h1.7"})]})}function Tv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"7",cy:"7",r:"3.75"}),d.jsx("path",{d:"m10.25 10.25 3 3"})]})}function vv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),d.jsx("path",{d:"m8 8 1.6 1.6"}),d.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),d.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),d.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),d.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function kv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2.75",y:"3",width:"10.5",height:"9.5",rx:"1.5"}),d.jsx("circle",{cx:"6.1",cy:"6.1",r:"1.1"}),d.jsx("path",{d:"m4.5 10 2.2-2.2 1.9 1.9 1.1-1.1 1.8 1.8"})]})}function Dh(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),d.jsx("path",{d:"M9 2.75v2h2"}),d.jsx("path",{d:"M6.2 8h3.6"}),d.jsx("path",{d:"M6.2 10h1.7"})]})}function jh(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),d.jsx("path",{d:"M9 2.75v2h2"}),d.jsx("path",{d:"M6.15 7.25h3.7"}),d.jsx("path",{d:"M6.15 9.25h2.8"}),d.jsx("path",{d:"m10.4 10.7 1.2 1.2"}),d.jsx("circle",{cx:"9.25",cy:"9.55",r:"1.45"})]})}function tq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M4.25 4.75h7.5"}),d.jsx("path",{d:"M4.25 8h7.5"}),d.jsx("path",{d:"M4.25 11.25h4.5"}),d.jsx("path",{d:"M2.25 4.75h.01M2.25 8h.01M2.25 11.25h.01"})]})}function nq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.55 3.05a2.15 2.15 0 0 0-3.3 1.8 2.05 2.05 0 0 0 .28 1.03A2.25 2.25 0 0 0 3 9.77a2.2 2.2 0 0 0 2.14 2.73h1.41V3.05Z"}),d.jsx("path",{d:"M9.45 3.05a2.15 2.15 0 0 1 3.3 1.8 2.05 2.05 0 0 1-.28 1.03A2.25 2.25 0 0 1 13 9.77a2.2 2.2 0 0 1-2.14 2.73H9.45V3.05Z"}),d.jsx("path",{d:"M5.1 6.55h1.45"}),d.jsx("path",{d:"M9.45 6.55h1.45"}),d.jsx("path",{d:"M6.55 9.15H5.1"}),d.jsx("path",{d:"M9.45 9.15h1.45"})]})}function S5(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z"})})}function rq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"5.25",y:"3.25",width:"7.5",height:"9",rx:"1.5"}),d.jsx("path",{d:"M10.75 12.75H4.5a1.25 1.25 0 0 1-1.25-1.25V4.75A1.25 1.25 0 0 1 4.5 3.5h.75"})]})}function lr({tone:e="amber"}){const t=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return d.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>d.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${t}`,style:{animationDelay:`${n*180}ms`}},n))})}function g1(e){const t=e.trim().toLowerCase();return t==="completed"||t==="done"||t==="complete"?"completed":t==="in_progress"||t==="in progress"||t==="inprogress"||t==="running"||t==="active"?"in_progress":t==="pending"||t==="todo"||t==="not_started"||t==="not started"||t==="queued"?"pending":t==="failed"||t==="error"?"failed":"other"}function aq(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!zr(e.status);default:return!1}}function sq(e,t,n){if(!e||!Oh(n))return e;const r=e.plan.findIndex(c=>g1(c.status)==="in_progress");if(r<0)return e;const i=e.plan.findIndex((c,f)=>f>r&&g1(c.status)==="pending");if(i<0||!t.some(c=>aq(c)))return e;const o=e.plan.map((c,f)=>f===r?{...c,status:"completed"}:f===i?{...c,status:"in_progress"}:c);return{...e,plan:o}}function iq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),d.jsx("path",{d:"M8 5.25v2.9l2.05 1.2"})]})}function lq({status:e}){const t=g1(e),n=t==="completed"?"Plan step status: Completed":t==="in_progress"?"Plan step status: In progress":t==="pending"?"Plan step status: Pending":t==="failed"?"Plan step status: Failed":`Plan step status: ${e}`,r=t==="completed"?"ui-status-success":t==="in_progress"?"ui-status-info":t==="pending"?"border-stone-700/90 bg-stone-900/80 text-stone-300":t==="failed"?"border-rose-300/30 bg-rose-300/10 text-rose-100":"border-stone-700/90 bg-stone-900/80 text-stone-300";return d.jsx("span",{"aria-label":n,title:n.replace("Plan step status: ",""),className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border ${r}`,children:t==="completed"?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):t==="in_progress"?d.jsx(lr,{tone:"sky"}):t==="pending"?d.jsx(iq,{}):t==="failed"?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})}):d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function wv({status:e}){const t=k5(e);return e==="completed"?d.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?d.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?d.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):d.jsx("span",{"aria-label":t,title:t,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:d.jsx(lr,{tone:"emerald"})})}function Cv({turn:e,variant:t="header"}){const n=k5(e.status),r=pq(e),i=hq(e),l=A5(e),o=Oh(e.status),c=e.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":o?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(t==="footer")return d.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${c}`,children:[d.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(wv,{status:e.status}),d.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:r})]}),e.startedAt&&d.jsx("time",{dateTime:e.startedAt,title:iu(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:um(e.startedAt)})]}),(l||i.length>0)&&d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[l?d.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${l.className}`,title:l.title,children:l.label}):null,i.map(h=>d.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${h.className}`,title:h.title,children:[h.icon?d.jsx("span",{className:"mr-1",children:h.icon}):null,h.label]},h.id))]})]});const f=`${n} · ${r}`;return d.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${c}`,title:f,children:[d.jsx(wv,{status:e.status}),d.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:r})]})}function oq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 2.75v8"}),d.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function uq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 13.25v-8"}),d.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function cq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),d.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),d.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),d.jsx("path",{d:"M3.25 5.25v5.5"}),d.jsx("path",{d:"M12.75 5.25v5.5"})]})}function dq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),d.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),d.jsx("path",{d:"M8 5.5v4.75"}),d.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function Vf(e){if(!Number.isFinite(e)||e<=0)return"0";if(e>=1e6){const t=e>=1e7?Math.round(e/1e6):e/1e6;return`${String(t.toFixed(1)).replace(/\.0$/,"")}m`}if(e>=1e3){const t=e>=1e4?Math.round(e/1e3):e/1e3;return`${String(t.toFixed(1)).replace(/\.0$/,"")}k`}return String(Math.round(e))}function fq(e){return!Number.isFinite(e)||e<=0?"$0":e>=100?`$${Math.round(e)}`:e>=10?`$${String(e.toFixed(1)).replace(/\.0$/,"")}`:e>=1?`$${String(e.toFixed(2)).replace(/0$/,"").replace(/\.$/,"")}`:e>=.1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>=.001?`$${e.toFixed(4)}`:"<$0.001"}function Rc(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Gf(e,t,n){const r=e??null;return!Number.isFinite(r??NaN)||r===null||t<=0||n<=0?null:r*n/t}function N5(e){var c,f,h,p,g;const t=(c=e.tokenUsage)==null?void 0:c.total;if(!t)return[];const n=Math.max(t.inputTokens-t.cachedInputTokens,0),r=Math.max(t.cachedInputTokens,0),i=Math.max(t.reasoningOutputTokens,0),l=Math.max(t.outputTokens-i,0);return[n>0?{id:"in",label:"Input",tokenCompactValue:Vf(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?Rc(e.priceEstimate.inputUsd):"--",usdRawValue:((f=e.priceEstimate)==null?void 0:f.inputUsd)??null,className:"token-badge-in",icon:d.jsx(oq,{})}:null,r>0?{id:"cache",label:"Cached input",tokenCompactValue:Vf(r),tokenRawValue:r,usdCompactValue:e.priceEstimate?Rc(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((h=e.priceEstimate)==null?void 0:h.cachedInputUsd)??null,className:"token-badge-cache",icon:d.jsx(cq,{})}:null,l>0?{id:"out",label:"Output",tokenCompactValue:Vf(l),tokenRawValue:l,usdCompactValue:e.priceEstimate?Rc(Gf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),l)??0):"--",usdRawValue:Gf((p=e.priceEstimate)==null?void 0:p.outputUsd,Math.max(t.outputTokens,0),l),className:"token-badge-out",icon:d.jsx(uq,{})}:null,i>0?{id:"reason",label:"Reasoning",tokenCompactValue:Vf(i),tokenRawValue:i,usdCompactValue:e.priceEstimate?Rc(Gf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),i)??0):"--",usdRawValue:Gf((g=e.priceEstimate)==null?void 0:g.outputUsd,Math.max(t.outputTokens,0),i),className:"token-badge-reason",icon:d.jsx(dq,{})}:null].filter(x=>x!==null)}function hq(e){return N5(e).map(t=>({id:t.id,label:t.tokenCompactValue,title:`${t.label}: ${t.tokenRawValue} tokens`,className:t.className,icon:t.icon}))}function A5(e){return{label:e.priceEstimate?fq(e.priceEstimate.totalUsd):"--",title:e.priceEstimate===null||e.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${Rc(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}const hg="inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-normal leading-none sm:text-[11px]";function mq({turn:e}){const t=N5(e),n=A5(e),[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,f]=T.useState(0),h=T.useRef(null),p=T.useRef(null),g=T.useRef(null);if(T.useLayoutEffect(()=>{if(!r||t.length===0){f(0);return}const E=()=>{const v=h.current,S=g.current;if(!v||!S)return;const N=v.getBoundingClientRect(),w=S.offsetWidth||S.getBoundingClientRect().width;if(w<=0)return;const R=window.innerWidth||document.documentElement.clientWidth,C=12,O=N.left+N.width/2-w/2,Y=C,P=Math.max(Y,R-C-w),B=Math.min(Math.max(O,Y),P);f(Math.round(B-O))};return E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[t.length,r]),T.useEffect(()=>{if(!r&&!l)return;const E=v=>{v.target instanceof Node&&(h.current&&!h.current.contains(v.target)&&i(!1),p.current&&!p.current.contains(v.target)&&o(!1))};return document.addEventListener("pointerdown",E),()=>{document.removeEventListener("pointerdown",E)}},[l,r]),!n&&t.length===0)return null;const x=()=>d.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:d.jsx("div",{className:"space-y-1",children:t.map(E=>d.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${E.label}: ${E.tokenRawValue} tokens`,children:[d.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"inline-flex shrink-0",children:E.icon}),d.jsx("span",{className:"thread-token-popover-strong font-medium",children:E.usdCompactValue})]}),d.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:E.tokenCompactValue})]},E.id))})});return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?d.jsxs("div",{ref:p,className:"relative shrink-0",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[d.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":l,onFocus:()=>o(!0),onBlur:()=>o(!1),className:`${hg} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),l&&t.length>0?d.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:x()}):null]}):null,t.map(E=>d.jsxs("span",{className:`${hg} ${E.className}`,title:`${E.label}: ${E.usdCompactValue}, ${E.tokenRawValue} tokens`,children:[E.icon,d.jsx("span",{className:"font-medium text-stone-100",children:E.tokenCompactValue})]},E.id))]}),d.jsxs("div",{ref:h,className:"relative shrink-0 md:hidden",children:[n?d.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":r,onClick:()=>i(E=>!E),className:`${hg} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,r&&t.length>0?d.jsx("div",{ref:g,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${c}px) translateX(-50%)`},children:x()}):null]})]})}function pq(e){var r;const t=(r=e.model)!=null&&r.trim()?e.model.trim():"--";let n="--";return e.reasoningEffortAvailable===null||e.reasoningEffortAvailable===void 0?n="--":e.reasoningEffortAvailable===!1?n="-":n=e.reasoningEffort??"--",[t,n].join(" · ")}function gq({text:e,className:t="agent-markdown"}){return d.jsx(E5,{mode:"static",plugins:{code:U8},controls:!1,lineNumbers:!1,remarkPlugins:xq,className:t,children:e})}function bq(){return e=>{R5(e)}}const xq=[...Object.values(g5),bq];function R5(e){if(!Array.isArray(e.children))return;const t=[];for(const n of e.children){if(n.type==="text"&&typeof n.value=="string"&&n.value.includes(`
|
|
375
|
-
`)){n.value.split(`
|
|
376
|
-
`).forEach((i,l)=>{l>0&&t.push({type:"break"}),i&&t.push({...n,value:i})});continue}R5(n),t.push(n)}e.children=t}const yq=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,Eq=/[),.;:!?]+$/;function _q(e){return e.startsWith("www.")?`https://${e}`:e}function Jc({text:e}){var r;const t=[];let n=0;for(const i of e.matchAll(yq)){const l=i[0],o=i.index??0,c=((r=l.match(Eq))==null?void 0:r[0])??"",f=c?l.slice(0,-c.length):l;f&&(o>n&&t.push(e.slice(n,o)),t.push(d.jsx("a",{href:_q(f),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:f},`${o}-${f}`)),c&&t.push(c),n=o+l.length)}return n<e.length&&t.push(e.slice(n)),d.jsx(d.Fragment,{children:t.length>0?t:e})}function L5({text:e,scrollRootRef:t,streaming:n=!1,containerClassName:r="",plainTextClassName:i="whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-100",markdownClassName:l="agent-markdown"}){const o=T.useRef(null),c=HG(e),[f,h]=T.useState(n||typeof IntersectionObserver>"u");return T.useEffect(()=>{if(n||typeof IntersectionObserver>"u"){h(!0);return}if(f||!o.current)return;const p=new IntersectionObserver(g=>{for(const x of g)if(x.isIntersecting){h(!0),p.disconnect();break}},{root:t.current,threshold:0});return p.observe(o.current),()=>{p.disconnect()}},[f,t,n]),d.jsx("div",{ref:o,className:r,children:f&&c?d.jsx(gq,{text:e,className:l}):d.jsx("p",{className:i,children:d.jsx(Jc,{text:e})})})}function Tq({text:e,scrollRootRef:t,streaming:n=!1}){return d.jsx(L5,{text:e,scrollRootRef:t,streaming:n,containerClassName:"thread-message-prose"})}function vq({threadId:e,text:t}){const n=T.useMemo(()=>GG(t),[t]);return d.jsx("div",{className:"thread-message-prose whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-300",children:n.map(r=>{if(r.type==="text")return d.jsx("span",{children:r.text},r.key);if(r.type==="photo"){const l=e?`/api/threads/${e}/assets/image?path=${encodeURIComponent(r.path)}`:null,o=mv(r.path)||"Attached image";return d.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:d.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[l?d.jsx("img",{src:l,alt:o,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):d.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),d.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:r.path,children:o})]})},r.key)}const i=mv(r.path)||"Attached file";return d.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:d.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:r.path,children:[d.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),d.jsx("span",{className:"min-w-0 truncate",children:i})]})},r.key)})})}function cm(e){return e==="completed"?"timeline-command-status-complete":"timeline-command-status-pending"}function dm({status:e}){return e==="completed"?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):d.jsx(lr,{tone:"emerald"})}const zc=T.memo(function({threadId:t,item:n,scrollRootRef:r,streaming:i=!1}){const[l,o]=T.useState("idle"),[c,f]=T.useState(!1),h=T.useRef(null),p=n.kind==="agentMessage"?n.reasoningItems??[]:[],g=p.map(N=>N.text.trim()).filter(Boolean).join(`
|
|
377
|
-
|
|
378
|
-
`),x=n.kind==="userMessage"?"thread-message-icon thread-message-icon-user":"thread-message-icon thread-message-icon-agent",E=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response"),v=n.status==="Steering"?"ui-status-warning":n.status==="Accepted"?"ui-status-success":"ui-status-info";T.useEffect(()=>()=>{h.current!==null&&window.clearTimeout(h.current)},[]);async function S(){try{await navigator.clipboard.writeText(n.text),o("copied"),h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>o("idle"),1200)}catch{o("failed"),h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>o("idle"),1600)}}return d.jsxs("div",{className:`timeline-item-frame ${n.kind==="agentMessage"?"timeline-has-corner-copy":""} relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(n.kind)} ${ga(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[E&&d.jsxs("span",{className:`absolute right-2.5 top-2.5 z-[1] inline-flex items-center gap-1 rounded-full border px-2 py-1 text-[10px] font-medium tracking-[0.12em] shadow-sm shadow-stone-950/20 ${v}`,children:[d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3.25 8A4.75 4.75 0 0 1 8 3.25h2.75"}),d.jsx("path",{d:"m9.5 1.75 1.75 1.5-1.75 1.5"}),d.jsx("path",{d:"M12.75 8A4.75 4.75 0 0 1 8 12.75H5.25"}),d.jsx("path",{d:"m6.5 14.25-1.75-1.5 1.75-1.5"})]}),d.jsx("span",{children:n.status})]}),d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${x}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(gv,{kind:n.kind})})}),d.jsxs("div",{className:"timeline-message-content timeline-mobile-bubble-content flex min-w-0 items-start gap-0 pt-2 sm:gap-2.5 sm:pt-0",children:[d.jsxs("div",{className:"hidden",children:[d.jsx("span",{className:`hidden h-6 w-6 items-center justify-center rounded-full border sm:inline-flex ${x}`,children:d.jsx(gv,{kind:n.kind})}),i&&n.kind==="agentMessage"&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(lr,{tone:"emerald"})})]}),d.jsxs("div",{className:"min-w-0 flex-1",children:[n.kind==="agentMessage"?d.jsxs(d.Fragment,{children:[g?d.jsxs("div",{className:"timeline-attached-reasoning mb-2",children:[d.jsxs("button",{type:"button","aria-expanded":c,onClick:()=>f(N=>!N),className:"timeline-attached-reasoning-toggle",children:[d.jsx("span",{"aria-hidden":"true",className:"timeline-attached-reasoning-chevron inline-flex h-5 w-5 items-center justify-center rounded-full",children:d.jsx("svg",{viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-none stroke-current transition ${c?"rotate-90":""}`,strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m6 4.75 3.25 3.25L6 11.25"})})}),d.jsx("span",{"aria-hidden":"true",className:"timeline-attached-reasoning-icon inline-flex h-5 w-5 items-center justify-center rounded-full",children:d.jsx(nq,{})}),d.jsx("span",{className:"timeline-attached-reasoning-label",children:"Thinking"}),p.some(N=>zr(N.status))?d.jsx(lr,{tone:"sky"}):null]}),c?d.jsx("pre",{className:"timeline-attached-reasoning-body mt-1.5 max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-[0.7rem] px-3 py-2 text-[12px] leading-5",children:d.jsx(Jc,{text:g})}):null]}):null,d.jsx(Tq,{text:n.text,scrollRootRef:r,streaming:i})]}):d.jsx(vq,{threadId:t,text:n.text}),n.status&&!E&&d.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]}),i&&n.kind==="agentMessage"&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(lr,{tone:"emerald"})}),n.kind==="agentMessage"&&d.jsx("button",{type:"button","aria-label":"Copy agent reply",title:l==="copied"?"Copied":l==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void S(),className:"timeline-corner-copy absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center transition",children:d.jsx("span",{className:`timeline-corner-copy-visual inline-flex items-center justify-center border shadow-sm shadow-stone-950/25 backdrop-blur transition ${l==="copied"?"ui-status-info":l==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:d.jsx(rq,{})})})]})}),kq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("command")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(bv,{})})}),zr(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(lr,{})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-amber-300/25 bg-amber-300/10 text-amber-200",children:d.jsx(bv,{})}),zr(t.status)&&d.jsx(lr,{})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Command status: ${t.status}`:"Command status",title:t.status??"Command status",onClick:()=>n(t,"Command Output"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${cm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(dm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open full command",onClick:()=>n(t,"Command Output"),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),wq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(p1,{})})}),zr(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(lr,{})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-100",children:d.jsx(p1,{})}),zr(t.status)&&d.jsx(lr,{})]}),d.jsxs("div",{className:"timeline-item-inner relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Tool status: ${t.status}`:"Tool status",title:t.status??"Tool status",onClick:()=>n(t,"Tool Call Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${cm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(dm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open full tool call",onClick:()=>n(t,"Tool Call Details"),className:"block w-full text-left",children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Cq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("agentTool")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(xv,{})})}),zr(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(lr,{tone:"emerald"})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:d.jsx(xv,{})}),zr(t.status)&&d.jsx(lr,{tone:"emerald"})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Agent status: ${t.status}`:"Agent status",title:t.status??"Agent status",onClick:()=>n(t,"Agent Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${cm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(dm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open agent details",onClick:()=>n(t,"Agent Details"),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Sq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("skillTool")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(yv,{})})}),zr(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(lr,{tone:"sky"})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:d.jsx(yv,{})}),zr(t.status)&&d.jsx(lr,{tone:"sky"})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Skill status: ${t.status}`:"Skill status",title:t.status??"Skill status",onClick:()=>n(t,"Skill Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${cm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(dm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open skill details",onClick:()=>n(t,"Skill Details"),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Nq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.filter(c=>zr(c.status)).length,o=t.length===1?"1 command":`${t.length} commands`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-warning px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("command")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(_v,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-amber-300/30 bg-amber-300/[0.14] text-amber-100 shadow-sm shadow-stone-950/20",children:[d.jsx(_v,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-amber-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-amber-100",children:t.length})]}),l>0&&d.jsx(lr,{})]}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} command entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:o}),l>0&&d.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:d.jsx(lr,{})})]})}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-amber-300/12 pt-3 sm:space-y-2",children:t.map((c,f)=>{const h=Ss(c.text);return d.jsxs("button",{type:"button","aria-label":`Open grouped command ${f+1}`,onClick:()=>i(c,`Command Output ${f+1}`),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",f+1]}),c.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:c.status})]}),d.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},c.id)})})]})]})]})}),Aq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 search":`${t.length} searches`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-info px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(vv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-sky-300/30 bg-sky-300/[0.14] text-sky-100 shadow-sm shadow-stone-950/20",children:[d.jsx(vv,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-sky-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-sky-100",children:t.length})]})}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} web search entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-sky-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var g,x;const f=((g=o.previewText)==null?void 0:g.trim())||o.text||"Web search",h=Ss(f),p=((x=o.detailText)==null?void 0:x.trim())||o.text||"Web search";return d.jsxs("button",{type:"button","aria-label":`Open grouped web search ${c+1}`,onClick:()=>i(`Web Search ${c+1}`,p),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",c+1]}),o.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),d.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),Rq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 file read":`${t.length} file reads`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file-read relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-file-read px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("fileRead")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(jh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-cyan-300/30 bg-cyan-300/[0.14] text-cyan-100 shadow-sm shadow-stone-950/20",children:[d.jsx(jh,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-cyan-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-cyan-100",children:t.length})]})}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file read entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-cyan-300/28 bg-cyan-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-cyan-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-cyan-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var g,x;const f=((g=o.previewText)==null?void 0:g.trim())||o.text||"File read",h=Ss(f),p=((x=o.detailText)==null?void 0:x.trim())||o.text||"File read";return d.jsxs("button",{type:"button","aria-label":`Open grouped file read ${c+1}`,onClick:()=>i(`File Read ${c+1}`,p),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-full border border-cyan-300/18 bg-cyan-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-cyan-100",children:["Read ",c+1]}),o.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),d.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),Lq=T.memo(function({item:t,scrollRootRef:n}){return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(tq,{})})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("span",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:w5(t.kind)}),t.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:t.status})]}),d.jsx("div",{className:"mt-1.5",children:d.jsx(L5,{text:t.text,scrollRootRef:n,plainTextClassName:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-300",markdownClassName:"agent-markdown text-sm"})})]})}),Iq=T.memo(function({item:t}){const n=zr(t.status)||t.text==="Compacting context",r=n?"Compacting context":"Context compacted",i=t.detailText&&t.detailText!==r?t.detailText:null;return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:"absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border border-teal-300/30 bg-teal-300/12 text-[10px] text-teal-100 shadow-sm shadow-stone-950/20 sm:hidden",children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(fv,{})})}),d.jsxs("div",{className:"flex min-w-0 items-center gap-2 pt-2 sm:pt-0",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:d.jsx(fv,{})})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("p",{className:"timeline-primary-text truncate text-[13px] font-medium sm:text-sm",children:r}),n?d.jsx(lr,{tone:"emerald"}):null]}),i?d.jsx("p",{className:"timeline-meta-text mt-0.5 truncate text-[11px] sm:text-xs",title:i,children:i}):null]})]})]})}),Oq=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"Web search",i=((c=t.detailText)==null?void 0:c.trim())||t.text||"Web search",l=Ss(r);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Tv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-sky-300/25 bg-sky-300/10 text-sky-100",children:d.jsx(Tv,{})})}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":"Expand web search",title:"Expand web search",onClick:()=>n("Web Search Details",i),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${Er("action")} hover:bg-stone-800`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(S5,{})})}),t.status&&d.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),d.jsx("button",{type:"button","aria-label":"Open full web search",onClick:()=>n("Web Search Details",i),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Dq=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"File read",i=((c=t.detailText)==null?void 0:c.trim())||t.text||"File read",l=Ss(r);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file-read relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("fileRead")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(jh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-cyan-300/25 bg-cyan-300/10 text-cyan-100",children:d.jsx(jh,{})})}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":"Expand file read",title:"Expand file read",onClick:()=>n("File Read Details",i),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${Er("action")} hover:bg-stone-800`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(S5,{})})}),t.status&&d.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),d.jsx("button",{type:"button","aria-label":"Open full file read",onClick:()=>n("File Read Details",i),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),jq=T.memo(function({threadId:t,item:n,onOpen:r}){const i=n.assetPath??n.detailText??null,l=t&&i?`/api/threads/${t}/assets/image?path=${encodeURIComponent(i)}`:null;return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(n.kind)} ${ga(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(kv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:d.jsx(kv,{})})}),d.jsxs("div",{className:"min-w-0 w-full flex-1",children:[l?d.jsx("button",{type:"button",onClick:()=>r("Image Path",i??n.text),className:"block w-full text-left",children:d.jsx("img",{src:l,alt:n.text||"Image preview",className:"max-h-[24rem] w-full rounded-xl border border-stone-700/80 bg-stone-950 object-contain",loading:"lazy"})}):d.jsx("div",{className:"timeline-item-inner rounded-xl border px-3 py-3 text-sm",children:n.text}),i&&d.jsx("button",{type:"button",onClick:()=>r("Image Path",i),className:"timeline-meta-text mt-2 block max-w-full truncate text-left text-xs hover:text-[var(--theme-fg)]",title:i,children:i}),n.status&&d.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]})]})}),Mq=T.memo(function({item:t,onOpen:n}){var f,h,p;const r=(f=t.previewText)!=null&&f.trim()&&t.text.trim()!==t.previewText.trim()?t.text.trim():null,i=((h=t.detailText)==null?void 0:h.trim())||null,l=C5(r??((p=t.previewText)==null?void 0:p.trim())??t.text,48),o=qG(t),c=i?"button":"div";return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Dh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-lime-300/25 bg-lime-300/10 text-lime-100",children:d.jsx(Dh,{})})}),d.jsx(c,{...i?{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",i)}:{},className:`timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2.5 py-2 text-left sm:rounded-xl sm:px-3 ${i?"transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]":""}`,children:d.jsxs("div",{className:"timeline-mobile-file-line flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:r??l,children:l}),o.length>0&&d.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:o.map(g=>d.jsx("span",{className:`timeline-delta-badge border ${g.startsWith("+")?"timeline-delta-badge-add text-emerald-300":g.startsWith("-")?"timeline-delta-badge-remove text-rose-300":"timeline-delta-badge-neutral"}`,children:g},g))})]})})]})]})}),Pq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.reduce((h,p)=>h+(p.changedFiles??0),0),o=t.reduce((h,p)=>h+(p.addedLines??0),0),c=t.reduce((h,p)=>h+(p.removedLines??0),0),f=t.length===1?"1 file change":`${t.length} file changes`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-success px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Dh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-lime-300/30 bg-lime-300/[0.14] text-lime-100 shadow-sm shadow-stone-950/20",children:[d.jsx(Dh,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-lime-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-lime-100",children:t.length})]})}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file change entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:f}),l>0&&d.jsxs("span",{className:"timeline-meta-text text-xs",children:[l," files"]})]}),d.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[o>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",o]}),c>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",c]})]})]}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-lime-300/12 pt-3 sm:space-y-2",children:t.map((h,p)=>{var E,v,S,N;const g=((E=h.detailText)==null?void 0:E.trim())||((v=h.previewText)==null?void 0:v.trim())||h.text,x=(S=h.previewText)!=null&&S.trim()&&h.text.trim()!==h.previewText.trim()?h.text.trim():((N=h.previewText)==null?void 0:N.trim())||h.text;return d.jsx("button",{type:"button","aria-label":`Open grouped file change ${p+1}`,onClick:()=>i(`File Change ${p+1}`,g),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 text-sm leading-6",title:x,children:C5(x,34)}),d.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(h.addedLines??0)>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",h.addedLines]}),(h.removedLines??0)>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",h.removedLines]})]})]})},h.id)})})]})]})]})}),Bq=T.memo(function({item:t}){return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(p1,{})})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[d.jsx("span",{className:"timeline-meta-text text-[10px] uppercase tracking-[0.16em]",children:w5(t.kind)}),t.status&&d.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),d.jsx("pre",{className:`timeline-soft-text mt-1 whitespace-pre-wrap break-words text-[13px] leading-5 ${zG(t.kind)?"max-h-56 overflow-auto":""}`,children:d.jsx(Jc,{text:t.text})})]})}),Uq=T.memo(function({item:t}){var f,h;const n=((f=t.hookOutputEntries)==null?void 0:f.map(p=>p.text.trim()).filter(Boolean).join(`
|
|
379
|
-
`).trim())??"",r=t.hookEventLabel?`${t.hookEventLabel} hook`:t.text,i=((h=t.hookStatusMessage)==null?void 0:h.trim())||(t.previewText&&t.previewText!==t.hookStatusMessage?t.previewText.trim():"")||t.text.trim(),o=Ss(n||(i&&i!==r?i:r)),c=!!(n&&o.showGap);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${pa(t.kind)} ${ga(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Er("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Ev,{})})}),zr(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(lr,{})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-200",children:d.jsx(Ev,{})}),zr(t.status)&&d.jsx(lr,{})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[d.jsxs("span",{className:"timeline-meta-text min-w-0 truncate text-[10px] uppercase tracking-[0.16em]",children:["Hook · ",t.hookEventLabel??t.text]}),t.status&&d.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),d.jsxs("div",{className:"timeline-mobile-dense-line mt-1.5 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"timeline-meta-text mr-2 font-sans text-[11px] uppercase tracking-[0.12em]",children:r}),d.jsx(Jc,{text:o.firstLine})]}):d.jsx(Jc,{text:o.firstLine&&o.firstLine!==r?`${r} · ${o.firstLine}`:r})}),c?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]})]})]})}),b1=T.memo(function({threadId:t,item:n,scrollRootRef:r,onOpenExpandedText:i,onOpenCommandDetail:l,onOpenToolCallDetail:o}){return YG(n.kind)?d.jsx(zc,{threadId:t,item:n,scrollRootRef:r}):n.kind==="commandExecution"?d.jsx(kq,{item:n,onOpen:l}):n.kind==="toolCall"?d.jsx(wq,{item:n,onOpen:o}):n.kind==="agentToolCall"?d.jsx(Cq,{item:n,onOpen:o}):n.kind==="skillToolCall"?d.jsx(Sq,{item:n,onOpen:o}):n.kind==="webSearch"?d.jsx(Oq,{item:n,onOpen:i}):n.kind==="fileRead"?d.jsx(Dq,{item:n,onOpen:i}):n.kind==="image"?d.jsx(jq,{threadId:t,item:n,onOpen:i}):n.kind==="plan"?d.jsx(Lq,{item:n,scrollRootRef:r}):n.kind==="fileChange"?d.jsx(Mq,{item:n,onOpen:i}):n.kind==="contextCompaction"?d.jsx(Iq,{item:n}):n.kind==="hook"?d.jsx(Uq,{item:n}):d.jsx(Bq,{item:n})});function qf({request:e,busy:t=!1,onRespond:n}){const[r,i]=T.useState({}),[l,o]=T.useState({}),[c,f]=T.useState(null),h=e.questions[0]??null,p="__other__",g=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function x(w){const R=/\s*\(recommended\)\s*$/i.test(w);return{rawLabel:w,displayLabel:w.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:R}}function E(w){h&&(f(w),n==null||n(e.id,{answers:{[h.id]:{answers:[w]}}}))}function v(w){const R=r[w.id]??"";return Array.isArray(R)?R.map(C=>C===p?(l[w.id]??"").trim():C.trim()).filter(Boolean).join(", "):R===p?(l[w.id]??"").trim():R.trim()}function S(w){const R=r[w.id]??"";if(Array.isArray(R))return R.map(O=>O===p?(l[w.id]??"").trim():O.trim()).filter(Boolean);if(R===p){const O=(l[w.id]??"").trim();return O?[O]:[]}const C=R.trim();return C?[C]:[]}function N(w,R){i(C=>{const O=C[w],Y=Array.isArray(O)?O:[],P=Y.includes(R)?Y.filter(B=>B!==R):[...Y,R];return{...C,[w]:P}})}return d.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[d.jsx("div",{className:"flex items-center justify-between gap-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:g}),e.kind!=="planDecision"&&e.description&&d.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),d.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(w=>d.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[d.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:w.header}),d.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:w.question}),e.kind==="planDecision"&&w.options&&w.options.length>0?d.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:w.options.map((R,C)=>{const O=x(R.label),Y=O.displayLabel.toLowerCase()==="implement";return d.jsxs("button",{type:"button",disabled:t,onClick:()=>E(R.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${C===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:R.description,children:[O.recommended?d.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,t&&c===R.label?Y?"Starting...":"Saving...":O.displayLabel]},R.label)})}):w.options&&w.options.length>0?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[w.options.map(R=>{const C=x(R.label),O=r[w.id];return d.jsxs("button",{type:"button",disabled:t,onClick:()=>w.multiSelect?N(w.id,R.label):i(Y=>({...Y,[w.id]:R.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${(w.multiSelect?Array.isArray(O)&&O.includes(R.label):O===R.label)?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:R.description,children:[C.recommended?d.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,C.displayLabel]},R.label)}),w.isOther&&(()=>{const R=r[w.id];return d.jsx("button",{type:"button",disabled:t,onClick:()=>w.multiSelect?N(w.id,p):i(C=>({...C,[w.id]:p})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${(w.multiSelect?Array.isArray(R)&&R.includes(p):R===p)?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})})()]}),w.isOther&&(()=>{const R=r[w.id];return(w.multiSelect?Array.isArray(R)&&R.includes(p):R===p)?d.jsx("input",{"aria-label":`${w.header} custom answer`,value:l[w.id]??"",onChange:O=>o(Y=>({...Y,[w.id]:O.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"}):null})()]}):d.jsx("input",{"aria-label":w.header,value:r[w.id]??"",onChange:R=>i(C=>({...C,[w.id]:R.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},w.id))}),e.kind!=="planDecision"&&d.jsx("div",{className:"mt-3 flex justify-end",children:d.jsx("button",{type:"button",disabled:t||e.questions.some(w=>!v(w)),onClick:()=>void(n==null?void 0:n(e.id,{answers:Object.fromEntries(e.questions.map(w=>[w.id,{answers:S(w)}]))})),className:"ui-action-info rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:t?"Submitting...":"Submit"})})]})}function Yf({note:e}){return d.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[d.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),d.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((t,n)=>d.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",t]},`${e.id}-${n}`))})]})}function Yo({note:e,onOpenThread:t}){const n=e.kind==="forkCreated"?"Fork":e.kind==="forkSource"?"Fork source":"System",r=e.kind==="forkCreated"?`Thread forked from Turn ${e.turnIndex??"?"}`:e.kind==="forkSource"?`Forked from ${e.linkedThreadTitle??"source thread"} at Turn ${e.turnIndex??"?"}`:e.text??"";return d.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:n}),d.jsx("time",{dateTime:e.createdAt,title:iu(e.createdAt),className:"timeline-meta-text text-[10px]",children:um(e.createdAt)})]}),d.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:r}),e.linkedThreadId?d.jsx("button",{type:"button",onClick:()=>{if(t){t(e.linkedThreadId);return}typeof window<"u"&&window.location.assign(`/threads/${e.linkedThreadId}`)},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:e.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}const Sv=T.memo(function({threadId:t,turn:n,absoluteIndex:r,isCollapsed:i,livePlan:l,liveItems:o,liveOutput:c,onToggleCollapse:f,onOpenExpandedText:h,onOpenCommandDetail:p,onOpenToolCallDetail:g,scrollRootRef:x,articleRef:E}){const v=T.useMemo(()=>KG(n.items,o),[o,n.items]),S=T.useMemo(()=>sq(l,v,n.status),[l,v,n.status]),N=T.useMemo(()=>XG(v,Oh(n.status)),[v,n.status]),w=T.useMemo(()=>eq(N),[N]),R=T.useMemo(()=>ZG(c,v),[c,v]),C=T.useMemo(()=>m1(R),[R]),[O,Y]=T.useState({}),P=T.useCallback(B=>{Y(G=>({...G,[B]:!G[B]}))},[]);return d.jsxs("article",{ref:E,className:"px-2 py-1.5 sm:px-6 sm:py-2",children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[d.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[d.jsxs("span",{className:"timeline-meta-text rounded-[0.6rem] border border-stone-700 px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",r]}),d.jsx("time",{dateTime:n.startedAt??void 0,title:iu(n.startedAt),className:"timeline-meta-text shrink-0 text-[10px] sm:text-[11px]",children:um(n.startedAt)}),d.jsx(Cv,{turn:n}),n.error&&d.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:n.error})]}),d.jsx(mq,{turn:n})]}),d.jsx("button",{type:"button","aria-label":`${i?"Expand":"Collapse"} turn ${r}`,title:i?"Expand turn":"Collapse turn",onClick:()=>f(n.id),className:"timeline-compact-action timeline-meta-text inline-flex h-5 w-5 shrink-0 items-center justify-center transition hover:text-[var(--theme-fg)]",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:i?d.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):d.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),n.error&&d.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:n.error}),!i&&d.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[w.map(B=>B.kind==="commandGroup"?d.jsx(Nq,{items:B.items,expanded:O[B.key]??!1,onToggleExpanded:()=>P(B.key),onOpen:p},B.key):B.kind==="fileChangeGroup"?d.jsx(Pq,{items:B.items,expanded:O[B.key]??!1,onToggleExpanded:()=>P(B.key),onOpen:h},B.key):B.kind==="searchGroup"?d.jsx(Aq,{items:B.items,expanded:O[B.key]??!1,onToggleExpanded:()=>P(B.key),onOpen:h},B.key):B.kind==="fileReadGroup"?d.jsx(Rq,{items:B.items,expanded:O[B.key]??!1,onToggleExpanded:()=>P(B.key),onOpen:h},B.key):d.jsx(b1,{threadId:t,item:B.item,scrollRootRef:x,onOpenExpandedText:h,onOpenCommandDetail:p,onOpenToolCallDetail:g},B.key)),S&&d.jsxs("div",{className:"timeline-live-plan-card rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem]",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:"Plan update"}),d.jsx("span",{className:"rounded-full border border-sky-300/40 px-2 py-1 text-[11px] uppercase tracking-[0.2em] text-sky-200",children:"Live"})]}),S.explanation&&d.jsx("p",{className:"timeline-soft-text mt-3 text-sm",children:S.explanation}),d.jsx("div",{className:"mt-3 space-y-2",children:S.plan.map((B,G)=>d.jsxs("div",{className:"timeline-live-plan-step flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-sm",children:[d.jsx("span",{className:"timeline-primary-text min-w-0 flex-1",children:B.step}),d.jsx(lq,{status:B.status})]},`${S.turnId}-${G}`))})]}),C?d.jsx(b1,{threadId:t,item:C,scrollRootRef:x,onOpenExpandedText:h,onOpenCommandDetail:p,onOpenToolCallDetail:g}):R?d.jsx(zc,{item:{id:"live-agent-message",kind:"agentMessage",text:R},scrollRootRef:x,streaming:!0}):null,Oh(n.status)&&d.jsx(Cv,{turn:n,variant:"footer"})]})]})});function Hq({threadId:e,turns:t,totalTurnCount:n,pendingRequests:r=[],pendingSteers:i=[],livePlan:l=null,liveItems:o=null,respondingRequestId:c=null,onRespondToRequest:f,liveOutput:h,scrollRequestKey:p=0,bottomSpacer:g=0,className:x="",onTailVisibilityChange:E,loadingEarlier:v=!1,onLoadEarlier:S,ephemeralUserNote:N=null,answeredRequestNotes:w=[],activityNotes:R=[],optimisticSteers:C=[],optimisticTurn:O=null,onLoadHistoryItemDetail:Y,onOpenThread:P}){var Je,He,tt;const B=T.useRef(null),G=T.useRef(null),le=T.useRef(p),Q=T.useRef(null),ce=T.useRef(g),W=T.useRef(0),fe=T.useRef(null),ge=T.useRef(!0),re=T.useRef(!0),F=T.useRef(0),$=T.useRef(new Map),[J,he]=T.useState(dv),[A,H]=T.useState(0),[te,D]=T.useState(null),[we,Re]=T.useState({}),[Ne,Xe]=T.useState(!0),Ze=T.useMemo(()=>JSON.stringify({turns:t.map(X=>({id:X.id,status:X.status,startedAt:X.startedAt,error:X.error,items:X.items.map(ye=>({id:ye.id,kind:ye.kind,status:ye.status,textLength:ye.text.length}))})),pendingRequests:r.map(X=>({id:X.id,turnId:X.turnId,title:X.title})),pendingSteers:i.map(X=>({id:X.id,turnId:X.turnId,prompt:X.prompt,clientRequestId:X.clientRequestId})),optimisticSteers:C.map(X=>({id:X.id,turnId:X.turnId,prompt:X.prompt,status:X.status})),liveOutputLength:h.length,livePlan:l===null?null:{turnId:l.turnId,explanation:l.explanation,steps:l.plan.map(X=>`${X.status}:${X.step}`)},liveItems:o===null?null:{turnId:o.turnId,items:o.items.map(X=>({id:X.id,kind:X.kind,status:X.status,textLength:X.text.length}))},optimisticTurn:O===null?null:{id:O.id,status:O.status,error:O.error,items:O.items.map(X=>({id:X.id,kind:X.kind,textLength:X.text.length}))},answeredRequestNotes:w.map(X=>({id:X.id,turnId:X.turnId??null,title:X.title,createdAt:X.createdAt??"",summaryLines:X.summaryLines})),activityNotes:R.map(X=>({id:X.id,kind:X.kind,text:X.text,createdAt:X.createdAt})),ephemeralUserNote:N,bottomSpacer:g}),[R,w,g,N,h,o,l,C,O,i,r,t]),je=typeof S=="function"||n!==void 0,Dt=T.useCallback(X=>{Re(ye=>({...ye,[X]:!ye[X]}))},[]),Ue=T.useCallback((X,ye)=>{D({title:X,text:ye})},[]),jt=T.useCallback(async(X,ye)=>{var ht;const We=((ht=X.detailText)==null?void 0:ht.trim())||X.text||"Command output";if(!X.hasDeferredDetail||!Y){D({title:ye,text:We});return}const Ge=$.current.get(X.id);if(Ge){D({title:Ge.title,text:Ge.text});return}const Fe=F.current+1;F.current=Fe,D({title:ye,text:"Loading full command output..."});try{const Lt=await Y(X.id);if($.current.set(X.id,Lt),F.current!==Fe)return;D({title:Lt.title,text:Lt.text})}catch(Lt){if(F.current!==Fe)return;D({title:ye,text:Lt instanceof Error?Lt.message:"Unable to load full command output."})}},[Y]),an=T.useCallback(async(X,ye)=>{var ht;const We=((ht=X.detailText)==null?void 0:ht.trim())||X.text||"Tool call";if(!X.hasDeferredDetail||!Y){D({title:ye,text:We});return}const Ge=$.current.get(X.id);if(Ge){D({title:Ge.title,text:Ge.text});return}const Fe=F.current+1;F.current=Fe,D({title:ye,text:"Loading full tool call details..."});try{const Lt=await Y(X.id);if($.current.set(X.id,Lt),F.current!==Fe)return;D({title:Lt.title,text:Lt.text})}catch(Lt){if(F.current!==Fe)return;D({title:ye,text:Lt instanceof Error?Lt.message:"Unable to load full tool call details."})}},[Y]),rt=T.useCallback(()=>{const X=B.current,ye=fe.current;if(!X)return;const We=ye?JG(X,ye):fg(X);ge.current=We,Xe(We)},[]),pt=T.useCallback(()=>{const X=B.current;X&&(re.current=fg(X,h1)),rt()},[rt]),at=T.useCallback(()=>{const X=B.current;X&&(X.scrollTop=X.scrollHeight,W.current=X.scrollHeight,ge.current=!0,Xe(!0),re.current=!0)},[]);T.useEffect(()=>{he(X=>X>=t.length-1?t.length:Math.max(X,dv))},[t.length]),T.useEffect(()=>{const X=B.current;X&&(W.current=X.scrollHeight,re.current=fg(X,h1)),rt()},[g,w,N,h,o,l,r.length,rt,t.length,J]),T.useEffect(()=>{const X=p!==le.current,ye=Q.current!==Ze;if(Q.current=Ze,!(X||ye&&(Ne||re.current)))return;const Ge=window.requestAnimationFrame(()=>{at()});return p!==le.current&&(le.current=p),()=>{window.cancelAnimationFrame(Ge)}},[Ze,Ne,at,p]),T.useEffect(()=>{const X=B.current,ye=G.current;if(!X||!ye||typeof ResizeObserver>"u")return;W.current=X.scrollHeight;const We=new ResizeObserver(()=>{const Ge=X.scrollHeight,Fe=W.current;W.current=Ge,!(Ge<=Fe)&&(re.current||ge.current)&&window.requestAnimationFrame(()=>{at()})});return We.observe(ye),()=>{We.disconnect()}},[at]),T.useEffect(()=>{if(!Ne){ce.current=g;return}if(g===ce.current)return;ce.current=g;const X=window.requestAnimationFrame(()=>{at()});return()=>{window.cancelAnimationFrame(X)}},[g,Ne,at]),T.useEffect(()=>{E==null||E(Ne)},[Ne,E]);const yn=n??t.length,Ye=Math.max(0,t.length-J),Pe=je?t:t.slice(Ye),At=je?Math.max(0,yn-t.length):Ye,sn=yn+1,cn=je?Math.max(0,yn-t.length):t.length-Pe.length,Un=!je&&cn>0&&A>=2,_t=h&&Pe.length>0?Pe.findLastIndex(X=>zr(X.status)):-1,St=_t<0&&!!h&&!!O&&O.status!=="failed",be=_t>=0||St,Se=new Set(Pe.map(X=>X.id)),Me=w.reduce((X,ye)=>{if(!ye.turnId||!Se.has(ye.turnId))return X;const We=X.get(ye.turnId)??[];return We.push(ye),X.set(ye.turnId,We),X},new Map),lt=r.reduce((X,ye)=>{if(!ye.turnId||!Se.has(ye.turnId))return X;const We=X.get(ye.turnId)??[];return We.push(ye),X.set(ye.turnId,We),X},new Map),gt=[...i.map(X=>({id:X.id,prompt:X.prompt,status:"Accepted",createdAt:X.createdAt})),...C.map(X=>({id:X.id,prompt:X.prompt,status:X.status==="steering"?"Steering":null,createdAt:X.createdAt}))].sort((X,ye)=>X.createdAt.localeCompare(ye.createdAt)),En=w.filter(X=>!X.turnId||!Se.has(X.turnId)),On=r.filter(X=>!X.turnId||!Se.has(X.turnId)),Ee=T.useMemo(()=>{const X=[...Pe.map(Fe=>({id:Fe.id,startedAt:Fe.startedAt??""})),...O?[{id:O.id,startedAt:O.startedAt??""}]:[]],ye=new Map,We=[],Ge=[...En.map(Fe=>({kind:"note",id:Fe.id,createdAt:Fe.createdAt??"",note:Fe})),...On.map(Fe=>({kind:"request",id:Fe.id,createdAt:Fe.createdAt,request:Fe}))].sort((Fe,ht)=>Fe.createdAt.localeCompare(ht.createdAt));for(const Fe of Ge){const ht=X.find(st=>Fe.createdAt&&st.startedAt&&Fe.createdAt.localeCompare(st.startedAt)<=0);if(!ht){We.push(Fe);continue}const Lt=ye.get(ht.id)??[];Lt.push(Fe),ye.set(ht.id,Lt)}return{beforeTurnId:ye,trailing:We}},[O,En,On,Pe]),Oe=T.useMemo(()=>{const X=[...R].sort((Nt,_r)=>Nt.createdAt.localeCompare(_r.createdAt)),ye=[...Pe.map(Nt=>({id:Nt.id,startedAt:Nt.startedAt??""})),...O?[{id:O.id,startedAt:O.startedAt??""}]:[]],We=[],Ge=new Map,Fe=new Map,ht=[],st=ye.map(Nt=>Nt.startedAt).filter(Nt=>!!Nt).sort().at(-1)??null;for(const Nt of X){if(Nt.anchorTurnId==="__leading__"){We.push(Nt);continue}if(Nt.anchorTurnId){if(ye.some(Nn=>Nn.id===Nt.anchorTurnId)){const Nn=Fe.get(Nt.anchorTurnId)??[];Nn.push(Nt),Fe.set(Nt.anchorTurnId,Nn)}else We.push(Nt);continue}const _r=ye.find(Nn=>Nn.startedAt&&Nt.createdAt.localeCompare(Nn.startedAt)<=0);if(!_r){!st||Nt.createdAt.localeCompare(st)<=0?We.push(Nt):ht.push(Nt);continue}const bt=Ge.get(_r.id)??[];bt.push(Nt),Ge.set(_r.id,bt)}return{leading:We,beforeTurnId:Ge,afterTurnId:Fe,trailing:ht}},[R,O,Pe]);return d.jsxs(d.Fragment,{children:[d.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${x}`.trim(),children:d.jsx("div",{ref:B,"data-testid":"thread-scroll-container",onScroll:pt,className:"thread-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:g>0?{paddingBottom:g}:void 0,children:d.jsxs("div",{ref:G,children:[t.length>0&&d.jsx("div",{className:"px-2.5 pb-1 pt-2 sm:px-6 sm:pb-1.5 sm:pt-3",children:d.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[cn>0&&d.jsx("button",{type:"button",onClick:()=>{if(je){S==null||S();return}he(X=>Math.min(t.length,X+$G)),H(X=>X+1)},disabled:v,className:"rounded-full border border-stone-700 px-2.5 py-1.5 text-stone-300 transition hover:bg-stone-800",children:v?"Loading earlier...":"Load 10 earlier"}),Un&&d.jsx("button",{type:"button",onClick:()=>he(t.length),className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),d.jsxs("p",{className:"timeline-meta-text",children:["Showing ",Pe.length," of ",yn," turns",cn>0?` · ${cn} earlier hidden`:""]})]})}),t.length===0&&!h&&!O&&d.jsx("div",{className:"timeline-meta-text px-2.5 py-8 text-sm sm:px-6",children:"Send the first prompt to start the thread."}),(Pe.length>0||O||Oe.leading.length>0||Oe.trailing.length>0)&&d.jsxs("div",{className:"divide-y divide-stone-800/80",children:[Oe.leading.length>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:Oe.leading.map(X=>d.jsx(Yo,{note:X,onOpenThread:P},X.id))}):null,Pe.map((X,ye)=>{var We,Ge,Fe,ht,Lt;return d.jsxs("div",{children:[(((We=Oe.beforeTurnId.get(X.id))==null?void 0:We.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.beforeTurnId.get(X.id)??[]).map(st=>d.jsx(Yo,{note:st,onOpenThread:P},st.id))}):null,(((Ge=Ee.beforeTurnId.get(X.id))==null?void 0:Ge.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Ee.beforeTurnId.get(X.id)??[]).map(st=>st.kind==="note"?d.jsx(Yf,{note:st.note},st.id):d.jsx(qf,{request:st.request,busy:c===st.request.id,onRespond:f??void 0},st.id))}):null,d.jsx(Sv,{threadId:e,turn:X,absoluteIndex:At+ye+1,isCollapsed:we[X.id]??!1,livePlan:(l==null?void 0:l.turnId)===X.id?l:null,liveItems:(o==null?void 0:o.turnId)===X.id?o.items:null,liveOutput:ye===_t?h:"",onToggleCollapse:Dt,onOpenExpandedText:Ue,onOpenCommandDetail:jt,onOpenToolCallDetail:an,scrollRootRef:B,articleRef:void 0}),(((Fe=Oe.afterTurnId.get(X.id))==null?void 0:Fe.length)??0)>0?d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.afterTurnId.get(X.id)??[]).map(st=>d.jsx(Yo,{note:st},st.id))}):null,(ht=Me.get(X.id))!=null&&ht.length||(Lt=lt.get(X.id))!=null&&Lt.length?d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...(Me.get(X.id)??[]).map(st=>({kind:"note",id:st.id,createdAt:st.createdAt??"",note:st})),...(lt.get(X.id)??[]).map(st=>({kind:"request",id:st.id,createdAt:st.createdAt,request:st}))].sort((st,Nt)=>st.createdAt.localeCompare(Nt.createdAt)).map(st=>st.kind==="note"?d.jsx(Yf,{note:st.note},st.id):d.jsx(qf,{request:st.request,busy:c===st.request.id,onRespond:f??void 0},st.id))}):null]},X.id)}),O&&Pe.every(X=>X.id!==O.id)&&d.jsxs(d.Fragment,{children:[(((Je=Oe.beforeTurnId.get(O.id))==null?void 0:Je.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.beforeTurnId.get(O.id)??[]).map(X=>d.jsx(Yo,{note:X,onOpenThread:P},X.id))}):null,(((He=Ee.beforeTurnId.get(O.id))==null?void 0:He.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Ee.beforeTurnId.get(O.id)??[]).map(X=>X.kind==="note"?d.jsx(Yf,{note:X.note},X.id):d.jsx(qf,{request:X.request,busy:c===X.request.id,onRespond:f??void 0},X.id))}):null,d.jsx(Sv,{threadId:e,turn:O,absoluteIndex:sn,isCollapsed:we[O.id]??!1,livePlan:null,liveItems:null,liveOutput:St?h:"",onToggleCollapse:Dt,onOpenExpandedText:Ue,onOpenCommandDetail:jt,onOpenToolCallDetail:an,scrollRootRef:B}),(((tt=Oe.afterTurnId.get(O.id))==null?void 0:tt.length)??0)>0?d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.afterTurnId.get(O.id)??[]).map(X=>d.jsx(Yo,{note:X,onOpenThread:P},X.id))}):null]})]}),gt.length>0&&d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:gt.map(X=>d.jsx(zc,{threadId:e,item:{id:X.id,kind:"userMessage",text:X.prompt,status:X.status},scrollRootRef:B},X.id))}),(Ee.trailing.length>0||Oe.trailing.length>0)&&d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...Oe.trailing.map(X=>({kind:"activity",id:X.id,createdAt:X.createdAt,note:X})),...Ee.trailing].sort((X,ye)=>X.createdAt.localeCompare(ye.createdAt)).map(X=>X.kind==="activity"?d.jsx(Yo,{note:X.note,onOpenThread:P},X.id):X.kind==="note"?d.jsx(Yf,{note:X.note},X.id):d.jsx(qf,{request:X.request,busy:c===X.request.id,onRespond:f??void 0},X.id))}),N&&d.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:d.jsx(zc,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:N},scrollRootRef:B})}),h&&!be&&d.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:m1(h)?d.jsx(b1,{threadId:e,item:m1(h),scrollRootRef:B,onOpenExpandedText:Ue,onOpenCommandDetail:jt,onOpenToolCallDetail:an}):d.jsx(zc,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:h},scrollRootRef:B,streaming:!0})}),d.jsx("div",{ref:fe,"aria-hidden":"true",className:"h-px w-full"})]})})}),d.jsx(T5,{open:te!==null,title:(te==null?void 0:te.title)??"Full text",text:(te==null?void 0:te.text)??"",onClose:()=>{F.current+=1,D(null)}})]})}function Mb({open:e,title:t,label:n,value:r,busy:i=!1,onChange:l,onCancel:o,onSubmit:c}){if(T.useEffect(()=>{if(!e)return;function h(p){p.key==="Escape"&&!i&&o()}return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[i,o,e]),!e)return null;function f(h){h.preventDefault(),c()}return mu.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:o,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),d.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":t,onSubmit:f,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),d.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:o,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsxs("div",{className:"mt-5",children:[d.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),d.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:r,onChange:h=>l(h.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),d.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),d.jsx("button",{type:"submit",disabled:i||!r.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function Fq(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",children:d.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function zq(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function $q(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:d.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Z"})})}function Nv({title:e,defaultOpen:t=!1,children:n}){const[r,i]=T.useState(t);return d.jsxs("section",{className:"border-t border-[var(--theme-border)] pt-4 first:border-t-0 first:pt-0",children:[d.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":r,className:"flex w-full items-center justify-between gap-3 text-left",children:[d.jsx("span",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:e}),d.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:r?"Hide":"Show"})]}),r&&d.jsx("div",{className:"mt-3",children:n})]})}function Vq({thread:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,showDeleteButton:c=!1,showSessionCopyButton:f=!1}){const[h,p]=T.useState("idle"),g=T.useRef(null),x=r[e.workspaceId],E=t===e.id;T.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);async function v(){const S=e.providerSessionId;if(S)try{await navigator.clipboard.writeText(S),p("copied"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1200)}catch{p("failed"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1600)}}return d.jsxs("div",{role:"link",tabIndex:0,onClick:()=>i(e.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),i(e.id))},className:`thread-sidebar-card relative block rounded-[1.2rem] border px-3 py-2.5 transition ${E?"thread-sidebar-card-active shadow-lg shadow-stone-950/12":""} ${f&&e.providerSessionId?"pb-4":""}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("p",{className:"min-w-0 w-fit max-w-[calc(100%-2rem)] truncate text-[13px] font-medium leading-5 text-[var(--theme-fg)]",title:e.title,children:e.title}),d.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),l(e)},"aria-label":`Rename thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition hover:text-[var(--theme-fg)]",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:d.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})}),c&&o&&d.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),o(e)},"aria-label":`Delete thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-rose-300/90 transition hover:text-rose-200",children:d.jsx($q,{})})]}),x&&!n&&d.jsx("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:x})]}),d.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.18em] ${FG(e.status)}`,children:v5(e.status)})]}),d.jsxs("div",{className:`mt-2 flex items-center justify-between gap-3 text-[11px] text-[var(--theme-fg-muted)] ${f&&e.providerSessionId?"pr-9":""}`,children:[d.jsx("time",{dateTime:e.lastTurnStartedAt??e.updatedAt,children:um(e.lastTurnStartedAt??e.updatedAt)}),d.jsx("span",{children:e.model??"No model"})]}),f&&e.providerSessionId&&d.jsx("button",{type:"button","aria-label":"Copy session ID",title:h==="copied"?"Copied":h==="failed"?"Copy failed":"Copy session ID",onClick:S=>{S.stopPropagation(),v()},className:`absolute bottom-2.5 right-2.5 inline-flex h-7 w-7 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${h==="copied"?"border-sky-300/40 bg-sky-300/16 text-sky-100":h==="failed"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg-soft)] hover:bg-[var(--theme-hover)]"}`,children:d.jsx(zq,{})})]})}function I5({threads:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,scrollable:c=!1,maxHeightClassName:f="max-h-full",showDeleteButton:h=!1,showSessionCopyButton:p=!1}){const g=c?`min-h-0 overflow-y-auto overscroll-contain pr-1 ${f}`:"";return d.jsx("div",{className:g,children:d.jsx("div",{className:"space-y-1.5",children:e.map(x=>d.jsx(Vq,{thread:x,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r,onOpenThread:i,onBeginRenameThread:l,showDeleteButton:h,showSessionCopyButton:p,...o?{onDeleteThread:o}:{}},x.id))})})}function O5({threads:e,status:t,loading:n=!1,error:r,viewportConstrained:i=!1,showMobileAppMenu:l=!0,showMobileThreadNavToggle:o=!0,showMobileNewThreadShortcut:c=!0,mobileHeaderAction:f,currentThreadId:h,currentThreadLabel:p=null,currentWorkspaceId:g=null,currentWorkspaceLabel:x=null,workspaceLabels:E={},metaContent:v,settingsContent:S,onRenameThread:N,children:w}){const[R,C]=T.useState(!1),[O,Y]=T.useState(null),[P,B]=T.useState(""),[G,le]=T.useState(null),Q=ss(),ce=eo(),W=T.useMemo(()=>[...g?e.filter(te=>te.workspaceId===g):e].sort((te,D)=>{if(te.id===h)return-1;if(D.id===h)return 1;const we=Date.parse(te.lastTurnStartedAt??te.updatedAt);return Date.parse(D.lastTurnStartedAt??D.updatedAt)-we}),[h,g,e]),fe=x??(g?"Current workspace":"All threads"),ge=p&&p.trim()?`${fe} / ${p.trim()}`:fe,re=g?`/threads/new?workspaceId=${encodeURIComponent(g)}`:"/threads/new";async function F(H){if(!N)return;const te=P.trim();if(te){le(H);try{await N(H,te),Y(null),B("")}finally{le(null)}}}function $(H){Y(H.id),B(H.title)}function J(){Y(null),B("")}function he(H){Q(`/threads/${H}`),C(!1),ce==null||ce.closeNav()}function A(){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("section",{children:[d.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:"Thread List"}),d.jsxs("div",{className:"flex items-center gap-2",children:[n&&d.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}),d.jsx(oi,{to:re,onClick:()=>{C(!1),ce==null||ce.closeNav()},className:"inline-flex h-7 items-center rounded-full bg-[var(--theme-accent-solid)] px-2.5 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"New Thread"})]})]}),r&&d.jsx("div",{className:"rounded-2xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-100",children:r}),!r&&W.length===0&&!n&&d.jsx("div",{className:"rounded-2xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}),W.length>0&&d.jsx(I5,{threads:W,currentThreadId:h,currentWorkspaceId:g,workspaceLabels:E,onOpenThread:he,onBeginRenameThread:$})]}),d.jsx(Nv,{title:"Thread Meta",defaultOpen:!0,children:v??d.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"Select a thread to inspect metadata."})}),d.jsx(Nv,{title:"Settings",children:S??d.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"No thread settings available."})})]})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:i?"flex h-full max-h-full min-h-0 flex-col gap-2 overflow-hidden overscroll-none sm:gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]":"flex min-h-[calc(100dvh-2rem)] flex-col gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]",children:[d.jsx("div",{className:"lg:hidden",children:d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:`thread-topbar-surface grid h-10 items-center gap-1.5 border-b px-2.5 backdrop-blur ${l&&(c||f)?"grid-cols-[2.5rem_minmax(0,1fr)_auto]":l?"grid-cols-[2.5rem_minmax(0,1fr)]":"grid-cols-[minmax(0,1fr)]"}`,children:[l&&d.jsx(A1,{}),o?d.jsxs("button",{type:"button",onClick:()=>C(H=>!H),"aria-expanded":R,"aria-label":R?"Collapse thread navigation":"Expand thread navigation",className:"inline-flex min-w-0 items-center justify-center gap-1 px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:ge,children:[d.jsx("span",{className:"min-w-0 truncate",children:ge}),d.jsx("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition ${R?"rotate-180":""}`,children:d.jsx("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m4.5 6.25 3.5 3.5 3.5-3.5"})})})]}):d.jsx("p",{className:"min-w-0 truncate px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:ge,children:ge}),l&&(f||(c?d.jsxs(oi,{to:re,onClick:()=>{ce==null||ce.closeNav(),C(!1)},"aria-label":"New Thread",className:"inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-1 rounded-full bg-[var(--theme-accent-solid)] px-2 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:[d.jsx(Fq,{}),d.jsx("span",{className:"hidden sm:inline",children:"New"})]}):null))]}),l&&d.jsx(R1,{className:"absolute left-2 top-[calc(100%+0.45rem)] z-20 w-[min(18rem,calc(100vw-1rem))]"}),o&&R&&d.jsx("aside",{className:"thread-sidebar-surface absolute inset-x-2 top-[calc(100%+0.35rem)] z-10 max-h-[40dvh] overflow-y-auto rounded-[1.35rem] border p-4 shadow-2xl shadow-stone-950/18 backdrop-blur",children:A()})]})}),d.jsx("aside",{className:"hidden min-h-0 lg:block",children:d.jsx("div",{className:`thread-sidebar-surface sticky top-4 rounded-[2rem] border p-4 shadow-2xl shadow-stone-950/12 backdrop-blur ${i?"h-full max-h-full overflow-y-auto":""}`,children:A()})}),d.jsx("section",{className:i?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":"min-w-0",children:w})]}),d.jsx(Mb,{open:O!==null,title:"Rename Thread",label:"Thread Title",value:P,busy:G!==null,onChange:B,onCancel:J,onSubmit:()=>O?F(O):void 0})]})}const Av=10,Gq=1e3,qq=2e3,mg=5500,Yq=3e3,pg=0,Wo=1,Wf=3,Wq=["read-only","workspace-write","danger-full-access"];function Qq(e){return e.sandboxMode??(e.approvalMode==="guarded"?"workspace-write":"danger-full-access")}function Xq(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function Qo(e,t){const n=new Set(t.map(r=>r.id));return[...e.filter(r=>!n.has(r.id)),...t]}function kc(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}function D5(e){return`${e.threadId}:${e.objective}:${e.createdAt}`}function Kq(e,t){const n=Date.parse(e.updatedAt)||0,i=(Date.parse(t.updatedAt)||0)>=n?t:e,l=i===t?e:t;return{...i,localGoalId:i.localGoalId??l.localGoalId??null}}function j5(e){const t=new Map;for(const n of e){const r=D5(n),i=t.get(r);t.set(r,i?Kq(i,n):n)}return[...t.values()].sort((n,r)=>Date.parse(r.updatedAt)-Date.parse(n.updatedAt))}function Qf(e,t){return j5([t,...e])}function Zq(e){const t=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});return e.tokenBudget===null?`${t.format(e.tokensUsed)} tok`:`${t.format(e.tokensUsed)}/${t.format(e.tokenBudget)} tok`}function Jq(e){const t=Math.max(0,Math.floor(e/60)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h ${r}m`:`${t}m`}function Rv(e,t){if(!t)return null;const n=e.find(r=>r.model===t);return n?n.supportedReasoningEfforts.length>1:null}function eY(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`client-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function x1(e,t){return(e==null?void 0:e.items.some(n=>n.kind==="userMessage"&&n.text.trim()===t))??!1}function tY(e,t){return e.find(n=>x1(n,t))??null}function nY(e,t,n,r){let i=!1;const l=e.map(o=>o.id!==t?o:(i=!0,{...o,tokenUsage:n,priceEstimate:r}));return i?l:e}function rY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function aY(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M4.25 2.25h5.2l2.3 2.3v9.2h-7.5a2 2 0 0 1-2-2v-7.5a2 2 0 0 1 2-2Z"}),d.jsx("path",{d:"M9.25 2.5v2.25h2.25"}),d.jsx("path",{d:"M7 6.75v4"}),d.jsx("path",{d:"m5.45 9.35 1.55 1.55 1.55-1.55"})]})}function Xf({status:e}){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M2.5 6.75A8.22 8.22 0 0 1 8 4.5c2.14 0 4.1.8 5.5 2.25"}),d.jsx("path",{d:"M4.75 9a4.95 4.95 0 0 1 6.5 0"}),d.jsx("path",{d:"M6.9 11.3a1.9 1.9 0 0 1 2.2 0"}),e==="connected"?d.jsx("path",{d:"m6.7 13.2.9.9 1.7-2"}):e==="offline"?d.jsx("path",{d:"M3 3l10 10"}):e==="detached"?null:d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M11.8 11.1a2.2 2.2 0 0 1-1.8 2.7"}),d.jsx("path",{d:"m10.7 11.35 1.3-.55-.55-1.3"})]})]})}function sY(e,t){if(!e)return"Thread disconnected";switch(t.status){case"connected":return"Realtime updates connected";case"reconnecting":return"Realtime updates reconnecting";case"offline":return"Browser offline";case"checking":return"Checking realtime connection"}}function iY(){var Xa;const{id:e=""}=uA(),t=ss(),n=T.useRef(""),r=T.useRef(null),i=T.useRef(null),l=T.useRef(null),o=T.useRef(!1),c=T.useRef(null),f=T.useRef(null),h=T.useRef(typeof navigator>"u"?!0:navigator.onLine),p=T.useRef(!1),g=T.useRef(null),x=T.useRef(null),E=T.useRef(0),v=T.useRef(0),S=T.useRef(null),N=T.useRef(null),w=T.useRef(null),R=T.useRef(null),[C,O]=T.useState(null),[Y,P]=T.useState([]),[B,G]=T.useState([]),[le,Q]=T.useState(null),[ce,W]=T.useState(null),[fe,ge]=T.useState(null),[re,F]=T.useState(""),[$,J]=T.useState(null),[he,A]=T.useState(null),[H,te]=T.useState(!0),[D,we]=T.useState(0),[Re,Ne]=T.useState(!0),[Xe,Ze]=T.useState(!1),[je,Dt]=T.useState(!1),[Ue,jt]=T.useState("chat"),[an,rt]=T.useState({prompt:"",attachments:[]}),[pt,at]=T.useState(!1),[yn,Ye]=T.useState(0),[Pe,At]=T.useState(0),[sn,cn]=T.useState(0),[Un,_t]=T.useState(!1),[St,be]=T.useState(null),[Se,Me]=T.useState(!1),[lt,gt]=T.useState(!1),[En,On]=T.useState(!1),[Ee,Oe]=T.useState(null),[Je,He]=T.useState("idle"),[tt,X]=T.useState({status:h.current?"checking":"offline",browserOnline:h.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null}),[ye,We]=T.useState(null),[Ge,Fe]=T.useState([]),[ht,Lt]=T.useState({status:"idle",data:null,error:null}),[st,Nt]=T.useState({status:"idle",data:null,error:null}),[_r,bt]=T.useState({status:"idle",data:null,error:null}),[Nn,Hn]=T.useState({status:"idle",data:null,error:null}),[Ga,Zn]=T.useState({status:"idle",data:null,error:null}),[ll,Ns]=T.useState(!1),[ba,os]=T.useState(!1),[io,Jr]=T.useState(()=>new Set),[kn,bn]=T.useState(!1),[xa,Fn]=T.useState(!1),[lo,Tr]=T.useState({status:"idle",data:null,error:null}),[qa,Mt]=T.useState(null),Jn=((Xa=fe==null?void 0:fe.hostConfigFiles.find(z=>{var K;return(K=z.roles)==null?void 0:K.includes("mcp")}))==null?void 0:Xa.name)??null,Ir=T.useCallback(()=>{const z=n.current;n.current="",r.current=null,z&&F(K=>K+z)},[]),er=T.useCallback(z=>{n.current+=z,r.current===null&&(r.current=window.requestAnimationFrame(()=>{Ir()}))},[Ir]),ya=T.useCallback((z,K)=>{A(ue=>{const De=[...((ue==null?void 0:ue.turnId)===z?ue.items:[]).filter(ot=>ot.id!==K.id),K];return{turnId:z,items:De,updatedAt:new Date().toISOString()}})},[]),Ea=T.useCallback((z,K,ue,Ie)=>{A(De=>{const ot=(De==null?void 0:De.turnId)===z?De.items:[],Be=ot.find(vt=>vt.id===K),_n=(Be==null?void 0:Be.kind)==="agentMessage"?{...Be,text:`${Be.text}${ue}`,sequence:Ie??Be.sequence??null}:{id:K,kind:"agentMessage",text:ue,sequence:Ie};return{turnId:z,items:[...ot.filter(vt=>vt.id!==K),_n],updatedAt:new Date().toISOString()}})},[]),Wt=T.useCallback(()=>{n.current="",r.current!==null&&(window.cancelAnimationFrame(r.current),r.current=null)},[]);T.useEffect(()=>{Lt({status:"idle",data:null,error:null}),Nt({status:"idle",data:null,error:null}),bt({status:"idle",data:null,error:null}),Hn({status:"idle",data:null,error:null}),Zn({status:"idle",data:null,error:null}),bn(!1),Tr({status:"idle",data:null,error:null})},[e]);const ol=T.useCallback(async()=>{if(e){Tr(z=>({status:"loading",data:z.data,error:null}));try{const z=await _6(e);Tr({status:"ready",data:z,error:null})}catch(z){const K=z instanceof Yt?z.payload.message:"Unable to load export turns.";Tr(ue=>({status:"failed",data:ue.data,error:K}))}}},[e]);async function ul(z){if(e){Mt(null),Fn(!0);try{const{blob:K,filename:ue}=await v6(e,z),Ie=URL.createObjectURL(K),De=document.createElement("a");De.href=Ie,De.download=ue,document.body.append(De),De.click(),De.remove(),window.setTimeout(()=>URL.revokeObjectURL(Ie),3e4),bn(!1)}catch(K){const ue=K instanceof Yt?K.payload.message:"Unable to export transcript.";Mt(ue)}finally{Fn(!1)}}}async function $r(){if(e){Zn(z=>{var K;return{status:"loading",data:z.data??((K=w.current)==null?void 0:K.goal)??null,error:null}});try{const z=await D6(e);Zn({status:"ready",data:z.goal,error:null}),O(K=>K&&(z.goal?{...K,goal:z.goal,goalHistory:Qf(K.goalHistory??[],z.goal)}:{...K,goal:z.goal}))}catch(z){Zn(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load goal."}))}}}async function ur(z){if(e){Zn(K=>{var ue;return{status:"loading",data:K.data??((ue=w.current)==null?void 0:ue.goal)??null,error:null}});try{const K=await j6(e,z);Zn({status:"ready",data:K.goal,error:null}),O(ue=>ue&&(K.goal?{...ue,goal:K.goal,goalHistory:Qf(ue.goalHistory??[],K.goal)}:{...ue,goal:K.goal}))}catch(K){throw Zn(ue=>({status:"failed",data:ue.data,error:K instanceof Yt?K.payload.message:"Unable to update goal."})),K}}}async function oo(){if(e){Zn(z=>{var K;return{status:"loading",data:z.data??((K=w.current)==null?void 0:K.goal)??null,error:null}});try{const z=await M6(e);Zn({status:"ready",data:null,error:null}),O(K=>K&&(z.goalHistory?{...K,goal:null,goalHistory:z.goalHistory}:{...K,goal:null}))}catch(z){throw Zn(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to clear goal."})),z}}}async function As(z){os(!0);try{await ur({status:z})}finally{os(!1)}}async function uo(){os(!0);try{await oo()}finally{os(!1)}}async function ea(){if(e){Lt(z=>({status:"loading",data:z.data,error:null}));try{const z=await B6(e);Lt({status:"ready",data:z,error:null})}catch(z){Lt(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load skills."}))}}}async function us(){if(e){Nt(z=>({status:"loading",data:z.data,error:null}));try{const z=await U6(e);Nt({status:"ready",data:z,error:null})}catch(z){Nt(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load MCP servers."}))}}}async function cs(){if(e){bt(z=>({status:"loading",data:z.data,error:null}));try{const z=await H6(e);bt({status:"ready",data:z,error:null})}catch(z){bt(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load hooks."}))}}}async function tr(z){if(e){bt(K=>({status:"loading",data:K.data,error:null}));try{const K=await F6(e,z);bt({status:"ready",data:K,error:null})}catch(K){throw bt(ue=>({status:"failed",data:ue.data,error:K instanceof Yt?K.payload.message:"Unable to create hook."})),K}}}async function zn(z){if(e){bt(K=>({status:"loading",data:K.data,error:null}));try{const K=await z6(e,z);bt({status:"ready",data:K,error:null})}catch(K){throw bt(ue=>({status:"failed",data:ue.data,error:K instanceof Yt?K.payload.message:"Unable to update hook."})),K}}}async function cr(z){if(e){bt(K=>({status:"loading",data:K.data,error:null}));try{const K=await $6(e,z);bt({status:"ready",data:K,error:null})}catch(K){throw bt(ue=>({status:"failed",data:ue.data,error:K instanceof Yt?K.payload.message:"Unable to trust hook."})),K}}}async function Ya(z){if(e){bt(K=>({status:"loading",data:K.data,error:null}));try{const K=await V6(e,z);bt({status:"ready",data:K,error:null})}catch(K){throw bt(ue=>({status:"failed",data:ue.data,error:K instanceof Yt?K.payload.message:"Unable to untrust hook."})),K}}}async function Rs(){if(e){Hn(z=>({status:"loading",data:z.data,error:null}));try{const z=await P6(e);Hn({status:"ready",data:z,error:null})}catch(z){Hn(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load turns for forking."}))}}}async function di(){if(!e)return;const z=await y2(e,{mode:"latest"});P(K=>kc(K,z.thread.thread)),t(`/threads/${z.thread.thread.id}`)}async function Qt(z){if(!e)return;const K=await y2(e,{mode:"turn",turnId:z});P(ue=>kc(ue,K.thread.thread)),t(`/threads/${K.thread.thread.id}`)}const cl=T.useCallback(z=>{const K=R.current,ue=K&&Object.keys(K).length>0?{...z,thread:{...z.thread,...K}}:z;w.current=ue,J(ue.livePlan??null),A(ue.liveItems??null),Zn(Be=>Be.status==="idle"?Be:{...Be,data:ue.goal??null});const Ie=ue.thread.activeTurnId===null&&ue.thread.status!=="running";O(Be=>Be&&!ue.goalHistory?{...ue,turns:Qo(Be.turns,ue.turns),...Be.goalHistory?{goalHistory:Be.goalHistory}:{}}:Be?{...ue,turns:Qo(Be.turns,ue.turns)}:ue),P(Be=>kc(Be,ue.thread));const De=new Map(ue.turns.map(Be=>[Be.id,Be])),ot=new Set((ue.pendingSteers??[]).map(Be=>Be.clientRequestId).filter(Be=>!!Be));Fe(Be=>Be.filter(_n=>{if(ot.has(_n.clientRequestId))return!1;const vt=De.get(_n.turnId);return!(!vt||x1(vt,_n.prompt)||ue.thread.activeTurnId!==_n.turnId&&vt.status!=="inProgress")})),We(Be=>{if(!Be)return Be;const _n=Be.serverTurnId??Be.id,vt=ue.turns.some(Jt=>Jt.id===_n),wr=tY(ue.turns,Be.prompt),Ca=!!wr;return wr&&!Be.serverTurnId?{...Be,id:wr.id,serverTurnId:wr.id,status:Be.status==="failed"?Be.status:wr.status==="inProgress"?"inProgress":Be.status}:vt||Ie&&Ca?null:Be}),(Ie||N.current&&ue.turns.some(Be=>Be.id===N.current))&&(N.current=null,Wt(),F(""),J(null),A(null))},[Wt]);T.useEffect(()=>{w.current=C},[C]);const Dn=T.useCallback(async({seedThread:z}={})=>{var Be;const K=v.current+1;v.current=K;const ue=(z==null?void 0:z.provider)??((Be=w.current)==null?void 0:Be.thread.provider)??"codex",[Ie,De,ot]=await Promise.allSettled([tk(),ek(ue),Eg(ue)]);v.current===K&&(Ie.status==="fulfilled"?P(z?kc(Ie.value,z):Ie.value):z&&P(_n=>kc(_n,z)),De.status==="fulfilled"&&(S.current=ue,Q(De.value.status),W(De.value.capabilities),ge(De.value.managementSchema)),ot.status==="fulfilled"&&(S.current=ue,G(ot.value)))},[]),Or=T.useCallback(async({showLoading:z=!0,clearError:K=!0,reportError:ue=!0}={})=>{const Ie=E.current+1;E.current=Ie,z&&Ne(!0),K&&Mt(null);try{const De=await g2(e,{limit:Av});if(E.current!==Ie)return;cl(De),S.current!==De.thread.provider&&Dn({seedThread:De.thread})}catch(De){if(E.current!==Ie||!ue)return;Mt(De instanceof Error?De.message:"Unable to load thread detail.")}finally{E.current===Ie&&Ne(!1)}},[cl,e,Dn]),An=T.useCallback(()=>{var _n;const z=((_n=i.current)==null?void 0:_n.readyState)??Wf,K=z===Wo,ue=h.current,Ie=Date.now(),De=c.current!==null&&Ie-Date.parse(c.current)<=mg,ot=f.current!==null&&Ie-f.current<=mg;let Be;ue?K&&De&&ot?Be="connected":z===pg||l.current!==null||De||ot||o.current?Be="reconnecting":Be="checking":Be="offline",X(vt=>vt.status===Be&&vt.browserOnline===ue&&vt.healthOk===De&&vt.socketOpen===K&&vt.lastHealthyAt===c.current?vt:{status:Be,browserOnline:ue,healthOk:De,socketOpen:K,lastHealthyAt:c.current})},[]);T.useEffect(()=>{E.current+=1,v.current+=1,O(null),rt({prompt:"",attachments:[]}),Ze(!1),He("idle"),We(null),Fe([]),A(null),R.current=null,N.current=null,c.current=null,f.current=null,p.current=!1,h.current=typeof navigator>"u"?!0:navigator.onLine,X({status:h.current?"checking":"offline",browserOnline:h.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null})},[e]),T.useEffect(()=>{if(Je==="idle")return;const z=window.setTimeout(()=>{He("idle")},Je==="copied"?1200:1600);return()=>{window.clearTimeout(z)}},[Je]),T.useEffect(()=>{if(typeof document>"u")return;const{documentElement:z,body:K}=document;return z.classList.add("thread-detail-scroll-locked"),K.classList.add("thread-detail-scroll-locked"),()=>{z.classList.remove("thread-detail-scroll-locked"),K.classList.remove("thread-detail-scroll-locked")}},[]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const z=window.matchMedia("(max-width: 639px)"),K=()=>at(z.matches);return K(),z.addEventListener("change",K),()=>{z.removeEventListener("change",K)}},[]),T.useEffect(()=>{var K,ue;if(typeof window>"u")return;const z=()=>{const Ie=window.visualViewport,De=Ie?Math.max(0,Math.round(window.innerHeight-Ie.height-Ie.offsetTop)):0;cn(De),document.documentElement.style.setProperty("--thread-detail-keyboard-inset",`${De}px`)};return z(),(K=window.visualViewport)==null||K.addEventListener("resize",z),(ue=window.visualViewport)==null||ue.addEventListener("scroll",z),window.addEventListener("resize",z),()=>{var Ie,De;(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",z),(De=window.visualViewport)==null||De.removeEventListener("scroll",z),window.removeEventListener("resize",z),document.documentElement.style.removeProperty("--thread-detail-keyboard-inset")}},[]),T.useEffect(()=>{if(typeof document>"u")return;const z=()=>{const K=document.activeElement,ue=x.current,Ie=ue==null?void 0:ue.querySelector('[aria-label="Prompt"]');_t(!!(K&&Ie&&(K===Ie||Ie.contains(K))))};return z(),document.addEventListener("focusin",z),document.addEventListener("focusout",z),()=>{document.removeEventListener("focusin",z),document.removeEventListener("focusout",z)}},[Ue,C==null?void 0:C.thread.id,pt]),T.useEffect(()=>{const z=x.current;if(!z||typeof ResizeObserver>"u")return;const K=z.querySelector("form")??z,ue=()=>{Ye(Math.max(z.getBoundingClientRect().height,K.getBoundingClientRect().height))};ue();const Ie=new ResizeObserver(()=>{ue()});return Ie.observe(K),()=>{Ie.disconnect()}},[Ue,pt]),T.useEffect(()=>{var Ie,De;const z=x.current;if(!z||!pt||Ue!=="chat"){At(0);return}const K=()=>{const ot=z.getBoundingClientRect();At(Math.max(0,Math.ceil(window.innerHeight-ot.top)))};K(),window.addEventListener("resize",K),(Ie=window.visualViewport)==null||Ie.addEventListener("resize",K),(De=window.visualViewport)==null||De.addEventListener("scroll",K);let ue=null;return typeof ResizeObserver<"u"&&(ue=new ResizeObserver(K),ue.observe(z)),()=>{var ot,Be;window.removeEventListener("resize",K),(ot=window.visualViewport)==null||ot.removeEventListener("resize",K),(Be=window.visualViewport)==null||Be.removeEventListener("scroll",K),ue==null||ue.disconnect()}},[Ue,C==null?void 0:C.thread.id,pt,sn,Un]),T.useEffect(()=>{Or({showLoading:!0}),Dn()},[Dn,Or]),T.useEffect(()=>{let z=!1,K=null;const ue=()=>{Or({showLoading:!1,clearError:!1,reportError:!1})},Ie=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},De=()=>{z||!h.current||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,!z&&vt()},Gq),An())},ot=()=>{const Ce=i.current;if(i.current=null,Ce)try{Ce.close()}catch{}},Be=Ce=>{if(Ce.threadId===e){if(Ce.type==="thread.output.delta"&&typeof Ce.payload.delta=="string"){const et=typeof Ce.payload.turnId=="string"?Ce.payload.turnId:null,mt=typeof Ce.payload.itemId=="string"?Ce.payload.itemId:null,ln=typeof Ce.payload.sequence=="number"&&Number.isFinite(Ce.payload.sequence)?Ce.payload.sequence:null;er(Ce.payload.delta),et&&mt&&Ea(et,mt,Ce.payload.delta,ln),et&&We(xt=>xt&&(xt.serverTurnId===null||xt.serverTurnId===et)?{...xt,serverTurnId:et,id:et,status:xt.status==="failed"?xt.status:"inProgress",tokenUsage:xt.tokenUsage}:xt)}if(Ce.type==="thread.context.updated"){const et=Ce.payload.contextUsage&&typeof Ce.payload.contextUsage=="object"?Ce.payload.contextUsage:null;if(et){const mt=et;O(ln=>ln&&{...ln,thread:{...ln.thread,contextUsage:mt}}),P(ln=>ln.map(xt=>xt.id===e?{...xt,contextUsage:mt}:xt))}}if(Ce.type==="thread.turn.token.updated"&&typeof Ce.payload.turnId=="string"&&Ce.payload.tokenUsage&&typeof Ce.payload.tokenUsage=="object"){const et=Ce.payload.turnId,mt=Ce.payload.tokenUsage,ln=Ce.payload.priceEstimate&&typeof Ce.payload.priceEstimate=="object"?Ce.payload.priceEstimate:null;O(xt=>{if(!xt)return xt;const nn=nY(xt.turns,et,mt,ln);return nn===xt.turns?xt:{...xt,turns:nn}}),We(xt=>xt&&(xt.serverTurnId===et||xt.id===et)?{...xt,tokenUsage:mt,priceEstimate:ln}:xt)}if(Ce.type==="thread.turn.started"||Ce.type==="thread.turn.completed"||Ce.type==="thread.turn.failed"||Ce.type==="thread.updated"||Ce.type==="thread.goal.updated"||Ce.type==="thread.goal.cleared"||Ce.type==="thread.request.created"||Ce.type==="thread.request.resolved"){if(Ce.type==="thread.goal.updated"){const et=Ce.payload.goal&&typeof Ce.payload.goal=="object"?Ce.payload.goal:null,mt=Array.isArray(Ce.payload.goalHistory)?Ce.payload.goalHistory:null;Zn({status:"ready",data:et,error:null}),O(ln=>ln&&(mt?{...ln,goal:et,goalHistory:mt}:et?{...ln,goal:et,goalHistory:Qf(ln.goalHistory??[],et)}:{...ln,goal:et}))}if(Ce.type==="thread.goal.cleared"){const et=Array.isArray(Ce.payload.goalHistory)?Ce.payload.goalHistory:null;Zn({status:"ready",data:null,error:null}),O(mt=>mt&&(et?{...mt,goal:null,goalHistory:et}:{...mt,goal:null}))}if(ue(),Ce.type==="thread.turn.started"){Wt(),F(""),A(null),N.current=null;const et=typeof Ce.payload.turnId=="string"?Ce.payload.turnId:null;et&&We(mt=>mt&&{...mt,serverTurnId:et,id:et,status:mt.status==="failed"?mt.status:"inProgress",error:null,tokenUsage:mt.tokenUsage})}if(Ce.type==="thread.turn.completed"||Ce.type==="thread.turn.failed"){A(null);const et=typeof Ce.payload.turnId=="string"?Ce.payload.turnId:null;et&&(N.current=et,Ce.type==="thread.turn.failed"&&We(mt=>mt&&(mt.serverTurnId===et||mt.id===et)?{...mt,status:"failed",error:typeof Ce.payload.error=="string"?Ce.payload.error:"Unable to complete the turn.",tokenUsage:mt.tokenUsage}:mt))}}if((Ce.type==="thread.item.started"||Ce.type==="thread.item.completed")&&Ce.payload.item&&typeof Ce.payload.item=="object"&&typeof Ce.payload.turnId=="string"){const et=Ce.payload.turnId,mt=Ce.payload.item;typeof mt.id=="string"&&typeof mt.text=="string"&&ya(et,mt)}Ce.type==="thread.plan.updated"&&Array.isArray(Ce.payload.plan)&&J({turnId:String(Ce.payload.turnId??""),explanation:typeof Ce.payload.explanation=="string"?Ce.payload.explanation:null,plan:Ce.payload.plan})}},_n=()=>{const Ce=i.current;if(!(!Ce||Ce.readyState!==Wo))try{Ce.send(JSON.stringify({type:"supervisor.ping",timestamp:new Date().toISOString()}))}catch{p.current=!0,ot(),De(),An()}},vt=()=>{var mt;if(z||!h.current){An();return}const Ce=((mt=i.current)==null?void 0:mt.readyState)??Wf;if(Ce===pg||Ce===Wo){An();return}const et=rk(Be);i.current=et,An(),et.addEventListener("message",ln=>{if(i.current===et)try{const xt=JSON.parse(ln.data);(xt.type==="supervisor.connected"||xt.type==="supervisor.pong")&&(f.current=Date.now(),An())}catch{}}),et.addEventListener("open",()=>{i.current===et&&(p.current=!0,ue(),_n(),An())}),et.addEventListener("close",()=>{i.current===et&&(i.current=null),p.current=!0,De(),An()}),et.addEventListener("error",()=>{i.current===et&&(i.current=null),p.current=!0,De(),An()})},wr=async()=>{var Ce;if(!(z||!h.current||o.current)){o.current=!0,An();try{await y6();const et=p.current;c.current=new Date().toISOString(),et&&(p.current=!1,ue()),(((Ce=i.current)==null?void 0:Ce.readyState)??Wf)!==Wo&&vt()}catch{c.current=null,p.current=!0,De()}finally{o.current=!1,An()}}},Ca=()=>{h.current=!0,p.current=!0,An(),vt(),wr()},Jt=()=>{h.current=!1,c.current=null,f.current=null,p.current=!0,Ie(),ot(),An()},Xt=()=>{var mt;if(z||!h.current){An();return}const Ce=((mt=i.current)==null?void 0:mt.readyState)??Wf,et=f.current===null?null:Date.now()-f.current;Ce===Wo&&et!==null&&et>mg?(p.current=!0,ot(),De()):Ce===Wo?_n():Ce!==pg&&vt(),wr(),An()};return window.addEventListener("online",Ca),window.addEventListener("offline",Jt),vt(),wr(),K=window.setInterval(Xt,qq),()=>{z=!0,window.removeEventListener("online",Ca),window.removeEventListener("offline",Jt),Ie(),K!==null&&window.clearInterval(K),Wt(),ot()}},[Ea,Wt,e,Or,er,An,ya]),T.useEffect(()=>{if(!((C==null?void 0:C.thread.activeTurnId)!==null||(C==null?void 0:C.thread.status)==="running"||ye!==null||Ge.length>0||re.length>0||$!==null||he!==null))return;const K=window.setInterval(()=>{Or({showLoading:!1,clearError:!1,reportError:!1})},Yq);return()=>{window.clearInterval(K)}},[C==null?void 0:C.thread.activeTurnId,C==null?void 0:C.thread.status,re.length,he,$,Or,Ge.length,ye]);async function dl(){var z;if(!(!C||C.turns.length===0||Xe)){Ze(!0),Mt(null);try{const K=(z=C.turns[0])==null?void 0:z.id,ue=await g2(e,{limit:Av,...K?{beforeTurnId:K}:{}});O(Ie=>Ie?{...ue,turns:Xq(Ie.turns,ue.turns)}:ue),P(Ie=>Ie.map(De=>De.id===ue.thread.id?ue.thread:De))}catch(K){Mt(K instanceof Error?K.message:"Unable to load earlier turns.")}finally{Ze(!1)}}}async function vr(z){var wr,Ca;if(Ue==="shell"){if((C==null?void 0:C.thread.isLoaded)===!1){await hi({attachShell:!0});return}const Jt=((wr=g.current)==null?void 0:wr.sendCommand(z.prompt))??!1;Mt(Jt?null:"Connect the shell before sending commands.");return}Dt(!0),Mt(null),we(Jt=>Jt+1);const K=w.current,ue=K?{...K.thread,...R.current??{}}:null,Ie=(ue==null?void 0:ue.model)??null,De=(ue==null?void 0:ue.reasoningEffort)??null,ot=eY(),Be=`optimistic-${Date.now()}`,_n=`optimistic-steer-${ot}`,vt=new Date().toISOString();try{let Jt=w.current;if(Jt&&!Jt.thread.isLoaded){const nn={...Jt.thread,...R.current??{}},$n=await b2(e,{...Jt.thread.model?{model:Jt.thread.model}:{},...Jt.thread.sandboxMode?{sandboxMode:Jt.thread.sandboxMode}:{}}),Vn={...$n,thread:{...$n.thread,model:nn.model??$n.thread.model,reasoningEffort:nn.reasoningEffort??$n.thread.reasoningEffort,collaborationMode:nn.collaborationMode??$n.thread.collaborationMode,sandboxMode:nn.sandboxMode??$n.thread.sandboxMode??null}};Jt=Vn,w.current=Vn,O(Ms=>Ms?{...Vn,turns:Qo(Ms.turns,Vn.turns)}:Vn),P(Ms=>Ms.map(fo=>fo.id===Vn.thread.id?Vn.thread:fo))}const Xt=Jt?{...Jt.thread,...R.current??{}}:null,Ce=(Xt==null?void 0:Xt.status)==="running"?Xt.activeTurnId:null,et=Ue==="chat"&&!!Ce;et&&Ce?Fe(nn=>[...nn,{id:_n,clientRequestId:ot,turnId:Ce,prompt:z.prompt,createdAt:vt,status:"steering"}]):(Wt(),F(""),We({id:Be,serverTurnId:null,startedAt:vt,status:"sending",error:null,prompt:z.prompt,model:Ie,reasoningEffort:De,reasoningEffortAvailable:Rv(B,Ie),tokenUsage:null,priceEstimate:null}));const mt={prompt:z.prompt,clientRequestId:ot,...Xt!=null&&Xt.model?{model:Xt.model}:{},...Xt!=null&&Xt.reasoningEffort?{reasoningEffort:Xt.reasoningEffort}:{},...Xt!=null&&Xt.collaborationMode?{collaborationMode:Xt.collaborationMode}:{},...Xt!=null&&Xt.sandboxMode?{sandboxMode:Xt.sandboxMode}:{},...(Ca=z.attachments)!=null&&Ca.length?{attachments:z.attachments}:{}},ln=await R6(e,mt),xt=R.current&&Object.keys(R.current).length>0?{...ln,...R.current}:ln;O(nn=>nn&&{...nn,thread:xt}),P(nn=>nn.map($n=>$n.id===xt.id?xt:$n)),et&&Ce?xt.activeTurnId!==null&&xt.activeTurnId!==Ce&&xt.lastTurnStartedAt!==(Xt==null?void 0:Xt.lastTurnStartedAt)?(Wt(),F(""),J(null),Fe($n=>$n.filter(Vn=>Vn.id!==_n)),We({id:Be,serverTurnId:xt.activeTurnId,startedAt:xt.lastTurnStartedAt??vt,status:"inProgress",error:null,prompt:z.prompt,model:Ie,reasoningEffort:De,reasoningEffortAvailable:Rv(B,Ie),tokenUsage:null,priceEstimate:null})):Fe($n=>$n.map(Vn=>Vn.id===_n?{...Vn,turnId:xt.activeTurnId??Vn.turnId,status:"accepted"}:Vn)):(We(nn=>nn&&nn.id===Be?{...nn,id:xt.activeTurnId??nn.id,serverTurnId:xt.activeTurnId??nn.serverTurnId,status:"inProgress",error:null,tokenUsage:nn.tokenUsage,priceEstimate:nn.priceEstimate}:nn),J(null)),rt({prompt:"",attachments:[]})}catch(Jt){const Xt=Jt instanceof Yt?Jt.payload.message:Jt instanceof Error?Jt.message:"Unable to send prompt.";Jt instanceof Yt?Mt(Jt.payload.message):Mt(Xt),Fe(Ce=>Ce.filter(et=>et.clientRequestId!==ot)),We(Ce=>Ce&&Ce.id===Be?{...Ce,status:"failed",error:Xt}:Ce)}finally{Dt(!1)}}async function fi(){const z=C==null?void 0:C.thread.providerSessionId;if(z)try{await navigator.clipboard.writeText(z),He("copied")}catch{He("failed")}}async function hi(z){if(C){Dt(!0),Mt(null),Wt(),F("");try{if(C.thread.isLoaded){const ue=await A6(e);O(Ie=>Ie?{...ue,turns:Qo(Ie.turns,ue.turns)}:ue),be(null),P(Ie=>Ie.map(De=>De.id===ue.thread.id?ue.thread:De)),Me(!1);return}const K=await b2(e,{...C.thread.model?{model:C.thread.model}:{},...C.thread.sandboxMode?{sandboxMode:C.thread.sandboxMode}:{}});O(ue=>ue?{...K,turns:Qo(ue.turns,K.turns)}:K),P(ue=>ue.map(Ie=>Ie.id===K.thread.id?K.thread:Ie)),z!=null&&z.attachShell&&Ue==="shell"&&Me(!0)}catch(K){Mt(K instanceof Error?K.message:"Unable to change connection state.")}finally{Dt(!1)}}}async function Vr(){var z;if(Ue==="shell"){const K=((z=g.current)==null?void 0:z.sendControl("ctrl_c"))??!1;Mt(K?null:"Connect the shell before sending Ctrl-C.");return}Dt(!0),Mt(null);try{const K=C!=null&&C.thread.activeTurnId?await x2(e,{turnId:C.thread.activeTurnId}):await x2(e);O(ue=>ue&&{...ue,thread:K}),P(ue=>ue.map(Ie=>Ie.id===K.id?K:Ie)),Wt(),F("")}catch(K){Mt(K instanceof Error?K.message:"Unable to interrupt turn.")}finally{Dt(!1)}}async function tn(z){if(!C)return;const K=C,ue={...R.current??{},...z.model!==void 0?{model:z.model}:{},...z.reasoningEffort!==void 0?{reasoningEffort:z.reasoningEffort}:{},...z.fastMode!==void 0?{fastMode:z.fastMode}:{},...z.collaborationMode!==void 0?{collaborationMode:z.collaborationMode}:{},...z.sandboxMode!==void 0?{sandboxMode:z.sandboxMode}:{}},Ie={...C.thread,...ue};gt(!0),R.current=ue,w.current={...C,thread:Ie},O(De=>De&&{...De,thread:Ie}),P(De=>De.map(ot=>ot.id===Ie.id?{...ot,...Ie}:ot));try{const De=await I6(e,{...z.model!==void 0?{model:z.model}:{},...z.reasoningEffort!==void 0?{reasoningEffort:z.reasoningEffort}:{},...z.fastMode!==void 0?{fastMode:z.fastMode}:{},...z.collaborationMode!==void 0?{collaborationMode:z.collaborationMode}:{},...z.sandboxMode!==void 0?{sandboxMode:z.sandboxMode}:{}});R.current=null,w.current=K?{...K,thread:De}:null,O(ot=>ot&&{...ot,thread:De}),P(ot=>ot.map(Be=>Be.id===De.id?De:Be))}catch(De){R.current=null,w.current=K,O(K),P(ot=>ot.map(Be=>Be.id===K.thread.id?K.thread:Be)),Mt(De instanceof Error?De.message:"Unable to update thread settings.")}finally{gt(!1)}}async function _a(z,K){Oe(z),Mt(null);try{const ue=await G6(e,z,K);O(Ie=>Ie?{...ue,turns:Qo(Ie.turns,ue.turns)}:ue),J(ue.livePlan??null),A(ue.liveItems??null)}catch(ue){Mt(ue instanceof Error?ue.message:"Unable to answer this request.")}finally{Oe(null)}}async function Ls(){if(C){On(!0),Mt(null);try{const z=await O6(e);O(K=>K&&{...K,thread:z}),P(K=>K.map(ue=>ue.id===z.id?z:ue))}catch(z){Mt(z instanceof Error?z.message:"Unable to compact this thread context.")}finally{On(!1)}}}async function ta(z,K){try{const ue=await nk(z,{title:K});P(Ie=>Ie.map(De=>De.id===ue.id?{...De,title:ue.title,updatedAt:ue.updatedAt}:De)),O(Ie=>Ie&&Ie.thread.id===ue.id?{...Ie,thread:{...Ie.thread,title:ue.title,updatedAt:ue.updatedAt}}:Ie)}catch(ue){throw Mt(ue instanceof Error?ue.message:"Unable to rename thread."),ue}}function fl(){jt(z=>z==="chat"?(C!=null&&C.thread.isLoaded&&Me(!0),"shell"):"chat")}async function hl(){var K;const z=await((K=g.current)==null?void 0:K.copyLastCommandOutput());Mt(z?null:"Unable to copy the last shell command output.")}function ds(z){var ue,Ie;const K=z==="clear"?((ue=g.current)==null?void 0:ue.sendCommand("clear"))??!1:((Ie=g.current)==null?void 0:Ie.sendControl(z))??!1;Mt(K?null:"Connect the shell before sending control input.")}T.useEffect(()=>{if(!(!Se||Ue!=="shell"||!g.current||(C==null?void 0:C.thread.isLoaded)===!1||(St==null?void 0:St.loading)!==!1)){if((St==null?void 0:St.status)==="attached"){Me(!1);return}Me(!1),g.current.toggleConnection()}},[Ue,C==null?void 0:C.thread.isLoaded,Se,St==null?void 0:St.loading,St==null?void 0:St.status]),T.useEffect(()=>{if(Ue!=="shell")return;const z=window.requestAnimationFrame(()=>{var K;(K=g.current)==null||K.refreshLayout({focus:!0})});return()=>{window.cancelAnimationFrame(z)}},[Ue]);const kr=C&&C.workspacePathStatus==="missing"?"Restore this workspace path on the current machine before continuing.":null,Is=pt&&Ue==="chat",mi=Is&&Un?sn:0,Wa=Math.max(yn,144),Ta=Math.max(Pe,Wa+mi),ml=Is?Ta+12:0,Os=C?d.jsxs("dl",{className:"space-y-4 text-sm",children:[d.jsxs("div",{className:"relative pr-9",children:[d.jsx("dt",{className:"text-stone-500",children:"Session ID"}),d.jsx("dd",{className:"mt-1 break-all text-stone-100",children:C.thread.providerSessionId??"Unavailable"}),C.thread.providerSessionId&&d.jsx("button",{type:"button","aria-label":"Copy session ID",title:Je==="copied"?"Copied":Je==="failed"?"Copy failed":"Copy session ID",onClick:()=>void fi(),className:`thread-mobile-hit-target absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${Je==="copied"?"ui-status-info":Je==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:d.jsx("span",{className:"scale-[0.72]",children:d.jsx(rY,{})})})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Source"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:C.thread.source==="local_codex_import"?`Imported local ${C.thread.provider} session`:`${C.thread.provider} supervisor thread`})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Status"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:v5(C.thread.status)})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Created"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:iu(C.thread.createdAt)})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Workspace"}),d.jsx("dd",{className:"mt-1 break-words text-stone-100",children:C.workspace.absPath})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Workspace path"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:C.workspacePathStatus==="present"?"Present":"Missing on this machine"})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Active turn"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:C.thread.activeTurnId??"None"})]})]}):null,pl=C&&(ce!=null&&ce.controls.sandboxMode)?d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-stone-500",children:"Sandbox Mode"}),d.jsx("div",{className:"mt-2 space-y-1.5",children:Wq.map(z=>{const K=Qq(C.thread)===z;return d.jsx("button",{type:"button",disabled:lt,onClick:()=>void tn({sandboxMode:z}),className:`block w-full rounded-xl border px-3 py-2 text-left text-sm transition ${K?"ui-status-warning":"border-stone-800 bg-stone-950/40 text-stone-300 hover:bg-stone-800/80"} disabled:cursor-not-allowed disabled:opacity-60`,children:z},z)})})]})}):null,va=(ye==null?void 0:ye.serverTurnId)??null,Dr=ye&&C?C.turns.find(z=>va&&z.id===va||z.id===ye.id||x1(z,ye.prompt))??null:null,pi=ye&&!Dr?{id:ye.id,startedAt:ye.startedAt,status:ye.status,error:ye.error,model:ye.model,reasoningEffort:ye.reasoningEffort,reasoningEffortAvailable:ye.reasoningEffortAvailable,tokenUsage:ye.tokenUsage,priceEstimate:ye.priceEstimate,items:[{id:`${ye.id}-user-message`,kind:"userMessage",text:ye.prompt}]}:null,na=(C==null?void 0:C.thread.isLoaded)??!1,jr=na?tt.status==="connected"?"ui-action-success shadow-lg shadow-stone-950/20":tt.status==="reconnecting"?"thread-live-connection-reconnecting ui-status-success shadow-lg shadow-stone-950/20":tt.status==="offline"?"ui-status-danger shadow-lg shadow-stone-950/20":"ui-status-warning shadow-lg shadow-stone-950/20":"border border-stone-700/90 bg-stone-900/85 text-stone-400 shadow-lg shadow-stone-950/20",gi=sY(na,tt),Qa=[gi,na?null:"Tap to connect this thread",tt.lastHealthyAt?`Last healthy ${iu(tt.lastHealthyAt)}`:null].filter(Boolean).join(" · "),co=na?d.jsx("div",{role:"status","aria-live":"polite","aria-label":gi,title:Qa,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${jr}`,children:d.jsx(Xf,{status:tt.status})}):d.jsx("button",{type:"button",onClick:()=>void hi(),disabled:je||!C,"aria-label":je?"Connecting thread":"Connect thread",title:je?"Connecting thread":Qa,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${jr}`,children:d.jsx(Xf,{status:"detached"})}),bi=na?d.jsx("div",{title:Qa,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${jr}`,children:d.jsx(Xf,{status:tt.status})}):d.jsx("button",{type:"button",onClick:()=>void hi(),disabled:je||!C,title:je?"Connecting thread":Qa,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${jr}`,children:d.jsx(Xf,{status:"detached"})}),Ds=Ga.data??(C==null?void 0:C.goal)??null,gl=(C==null?void 0:C.goalHistory)??[],nr=Ds?Qf(gl,Ds):j5(gl),ka=(ce==null?void 0:ce.controls.goals)??!1,xi=d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),d.jsx("circle",{cx:"8",cy:"8",r:"2"}),d.jsx("path",{d:"M8 1.7v2M8 12.3v2M1.7 8h2M12.3 8h2"})]}),fs=ll&&ka?d.jsxs("div",{className:"w-96 max-w-[calc(100vw-1.5rem)] rounded-3xl border border-stone-700/80 bg-stone-950/92 p-3 text-left text-stone-100 shadow-2xl shadow-stone-950/35 backdrop-blur-xl",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold",children:"Goal monitor"}),d.jsx("p",{className:"text-xs text-stone-500",children:"Current thread only"})]}),d.jsx("button",{type:"button",onClick:()=>Ns(!1),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Close"})]}),Ga.error?d.jsx("p",{className:"mt-3 rounded-2xl border border-rose-400/30 bg-rose-400/10 px-3 py-2 text-xs text-rose-100",children:Ga.error}):null,d.jsx("div",{className:"mt-3 max-h-[28rem] space-y-2 overflow-auto pr-1",children:nr.length===0?d.jsx("p",{className:"rounded-2xl border border-stone-800 bg-stone-900/60 px-3 py-3 text-sm text-stone-400",children:"No goals in this thread yet."}):nr.map(z=>{const K=D5(z),ue=io.has(K),Ie=["active","paused","budgetLimited"].includes(z.status);return d.jsxs("div",{className:`rounded-2xl border px-3 py-3 ${Ie?"ui-status-info":"border-stone-800 bg-stone-900/60"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsx("button",{type:"button",onClick:()=>Jr(De=>{const ot=new Set(De);return ot.has(K)?ot.delete(K):ot.add(K),ot}),className:"min-w-0 flex-1 text-left",children:d.jsx("p",{className:`text-sm font-medium leading-5 ${ue?"":"line-clamp-2"}`,children:z.objective})}),d.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:z.status})]}),d.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] text-stone-400",children:[d.jsx("span",{children:Jq(z.timeUsedSeconds)}),d.jsx("span",{children:Zq(z)}),d.jsxs("span",{title:iu(z.updatedAt),children:["Updated ",new Date(z.updatedAt).toLocaleTimeString()]})]}),Ie?d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d.jsx("button",{type:"button",disabled:ba||z.status==="active",onClick:()=>void As("active"),className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-50",children:"Continue"}),d.jsx("button",{type:"button",disabled:ba||z.status==="paused",onClick:()=>void As("paused"),className:"rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50",children:"Pause"}),d.jsx("button",{type:"button",disabled:ba,onClick:()=>void uo(),className:"rounded-full border border-rose-400/35 px-3 py-1.5 text-xs text-rose-100 transition hover:bg-rose-400/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Terminate"})]}):null]},K)})})]}):null,wa=ka?d.jsx("button",{type:"button","aria-label":"Open goal monitor",title:"Open goal monitor",onClick:()=>{Ns(z=>!z),$r()},className:"ui-status-info inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full shadow-lg shadow-stone-950/20 transition lg:h-9 lg:w-9",children:xi}):null,js=d.jsx("button",{type:"button","aria-label":"Export transcript",title:"Export transcript",onClick:()=>bn(!0),disabled:!C,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/85 text-stone-300 shadow-lg shadow-stone-950/20 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50 lg:h-9 lg:w-9",children:d.jsx(aY,{})}),yi=d.jsxs("div",{className:"relative flex items-center justify-end gap-1.5",children:[js,wa,co]});return d.jsx(O5,{threads:Y,status:le,loading:Re,error:Re?null:qa,viewportConstrained:!0,currentThreadId:C==null?void 0:C.thread.id,currentThreadLabel:C==null?void 0:C.thread.title,currentWorkspaceId:C==null?void 0:C.thread.workspaceId,currentWorkspaceLabel:C==null?void 0:C.workspace.label,metaContent:Os,settingsContent:pl,showMobileNewThreadShortcut:!1,mobileHeaderAction:yi,onRenameThread:ta,children:d.jsxs("div",{className:"thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded-none border-y shadow-2xl shadow-stone-950/20 sm:flex-none sm:rounded-[2rem] sm:border",children:[d.jsx("div",{className:"pointer-events-none absolute right-4 top-4 z-30 hidden lg:block",children:d.jsx("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[js,wa,bi]})})}),fs?d.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:top-16 lg:right-4",children:fs}):null,qa&&!Re&&d.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:qa}),Re?d.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Loading thread detail..."}):C?d.jsxs(d.Fragment,{children:[C.workspacePathStatus==="missing"&&d.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[d.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),d.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:C.workspace.absPath})]}),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Ue==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:[d.jsx(Hq,{threadId:C.thread.id,turns:C.turns,totalTurnCount:C.totalTurnCount??C.turns.length,pendingRequests:C.pendingRequests,livePlan:$,liveItems:he,respondingRequestId:Ee,onRespondToRequest:_a,liveOutput:re,scrollRequestKey:D,bottomSpacer:ml,className:"thread-timeline-surface min-h-0 flex-1",onTailVisibilityChange:te,loadingEarlier:Xe,onLoadEarlier:dl,onLoadHistoryItemDetail:z=>E6(C.thread.id,z),answeredRequestNotes:C.answeredRequestNotes??[],activityNotes:C.activityNotes??[],pendingSteers:C.pendingSteers??[],optimisticSteers:Ge,optimisticTurn:pi}),Is?d.jsx("div",{ref:x,className:"fixed inset-x-0 bottom-0 z-30 sm:hidden",style:{bottom:`${mi}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:d.jsx(T0,{activeView:Ue,edgeToEdgeMobile:!0,busy:Ue==="chat"?je:!1,settingsBusy:lt,error:null,model:C.thread.model,reasoningEffort:C.thread.reasoningEffort,fastMode:C.thread.fastMode??!1,collaborationMode:C.thread.collaborationMode,modelOptions:B,contextUsage:C.thread.contextUsage,capabilities:ce,toolboxItems:(fe==null?void 0:fe.toolboxItems)??[],hookCommandTemplates:(fe==null?void 0:fe.hookCommandTemplates)??[],mcpConfigFormat:(fe==null?void 0:fe.mcpConfigFormat)??"none",followTail:H,threadConnected:C.thread.isLoaded,disabled:!!kr,disabledPlaceholder:kr??void 0,shellControlState:St,draftPrompt:an.prompt,draftAttachments:an.attachments,onDraftChange:rt,canInterrupt:!!C.thread.activeTurnId,onSubmit:vr,onInterrupt:Vr,onCompact:Ls,onOpenForkTurns:Rs,onForkLatest:di,onForkTurn:Qt,onOpenSkills:ea,onOpenMcp:us,onOpenHooks:cs,onCreateHook:tr,onUpdateHook:zn,onTrustHook:cr,onUntrustHook:Ya,goalState:Ga,onOpenGoal:$r,onUpdateGoal:ur,onReadProviderConfig:Jn?()=>_g(C.thread.provider,Jn):void 0,onWriteProviderConfig:Jn?z=>Tg(C.thread.provider,Jn,{content:z}):void 0,onToggleFollow:()=>we(z=>z+1),onUpdateSettings:tn,onToggleView:fl,onShellCopy:hl,onShellControl:ds,compactBusy:En,skillsState:ht,mcpState:st,hooksState:_r,forkTurnOptionsState:Nn})}):d.jsx("div",{ref:x,children:d.jsx(T0,{activeView:Ue,busy:Ue==="chat"?je:!1,settingsBusy:lt,error:null,model:C.thread.model,reasoningEffort:C.thread.reasoningEffort,fastMode:C.thread.fastMode??!1,collaborationMode:C.thread.collaborationMode,modelOptions:B,contextUsage:C.thread.contextUsage,capabilities:ce,toolboxItems:(fe==null?void 0:fe.toolboxItems)??[],hookCommandTemplates:(fe==null?void 0:fe.hookCommandTemplates)??[],mcpConfigFormat:(fe==null?void 0:fe.mcpConfigFormat)??"none",followTail:H,threadConnected:C.thread.isLoaded,disabled:!!kr,disabledPlaceholder:kr??void 0,shellControlState:St,draftPrompt:an.prompt,draftAttachments:an.attachments,onDraftChange:rt,canInterrupt:!!C.thread.activeTurnId,onSubmit:vr,onInterrupt:Vr,onCompact:Ls,onOpenForkTurns:Rs,onForkLatest:di,onForkTurn:Qt,onOpenSkills:ea,onOpenMcp:us,onOpenHooks:cs,onCreateHook:tr,onUpdateHook:zn,onTrustHook:cr,onUntrustHook:Ya,goalState:Ga,onOpenGoal:$r,onUpdateGoal:ur,onReadProviderConfig:Jn?()=>_g(C.thread.provider,Jn):void 0,onWriteProviderConfig:Jn?z=>Tg(C.thread.provider,Jn,{content:z}):void 0,onToggleFollow:()=>we(z=>z+1),onUpdateSettings:tn,onToggleView:fl,onShellCopy:hl,onShellControl:ds,compactBusy:En,skillsState:ht,mcpState:st,hooksState:_r,forkTurnOptionsState:Nn})})]}),d.jsxs("div",{className:Ue==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[C.thread.isLoaded&&d.jsx(H4,{ref:g,threadId:C.thread.id,isVisible:Ue==="shell",showHeader:!1,showFloatingToolbox:!1,onStateChange:be}),Ue==="shell"&&!C.thread.isLoaded&&d.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:d.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[d.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),d.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})}),Ue==="shell"&&d.jsx(T0,{activeView:Ue,busy:je,settingsBusy:!1,error:C.thread.isLoaded?(St==null?void 0:St.error)??null:null,followTail:!1,capabilities:ce,toolboxItems:(fe==null?void 0:fe.toolboxItems)??[],hookCommandTemplates:(fe==null?void 0:fe.hookCommandTemplates)??[],mcpConfigFormat:(fe==null?void 0:fe.mcpConfigFormat)??"none",threadConnected:C.thread.isLoaded,shellControlState:St,canInterrupt:!!(C.thread.isLoaded&&(St!=null&&St.isCommandRunning)),onSubmit:vr,onInterrupt:Vr,onToggleView:fl,onShellCopy:hl,onShellControl:ds})]})]})]}):d.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Unable to resolve this thread."}),d.jsx(s4,{open:kn,busy:xa,turnsState:lo,onCancel:()=>{xa||bn(!1)},onLoadTurns:ol,onExport:ul})]})})}function lY(){const e=ss(),[t,n]=T.useState(""),[r,i]=T.useState(!1),[l,o]=T.useState(null);async function c(f){f.preventDefault();const h=t.trim();if(!h){o("Session ID is required.");return}i(!0),o(null);try{const p=await C6(h);e(`/threads/${p.thread.id}`)}catch(p){p instanceof Yt?o(p.payload.message):o(p instanceof Error?p.message:"Unable to import session.")}finally{i(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Import Session"}),d.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Bring in a local Codex session"}),d.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-stone-400",children:"Paste a session ID from this machine. Supervisor will recover the workspace path, reuse an existing workspace when possible, or create one with the last folder name as the default label."}),d.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-stone-500",children:"Imported history appears immediately, but sending a new prompt still requires a manual Resume / Connect."})]}),d.jsxs("form",{onSubmit:c,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"session-id",className:"text-sm font-medium text-stone-200",children:"Local session ID"}),d.jsx("input",{id:"session-id",value:t,onChange:f=>n(f.target.value),placeholder:"019d6fb7-7033-7a30-a2c7-74d0919e87d4",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),l&&d.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l}),d.jsx("div",{className:"flex flex-wrap items-center gap-3",children:d.jsx("button",{type:"submit",disabled:r,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:r?"Importing...":"Import Session"})})]})]})}function gg(e){return e.enabled&&e.capabilities.sessions.resume&&e.capabilities.turns.start}function oY(){const e=ss(),t=eo(),[n]=Kv(),[r,i]=T.useState([]),[l,o]=T.useState([]),[c,f]=T.useState([]),[h,p]=T.useState((t==null?void 0:t.defaultBackend)??"codex"),[g,x]=T.useState(""),[E,v]=T.useState(""),[S,N]=T.useState(""),[w,R]=T.useState("yolo"),[C,O]=T.useState(!0),[Y,P]=T.useState(!1),[B,G]=T.useState(null),le=n.get("workspaceId");T.useEffect(()=>{let W=!1;return Promise.all([N1(),Jv()]).then(async([fe,ge])=>{var he,A,H,te;if(W)return;const F=((he=ge.filter(gg)[0])==null?void 0:he.provider)??"codex";p(F),o(ge);const $=await Eg(F);if(W)return;i(fe),f($);const J=fe.some(D=>D.id===le)?le:((A=fe[0])==null?void 0:A.id)??"";x(J),v(((H=$.find(D=>D.isDefault))==null?void 0:H.model)??((te=$[0])==null?void 0:te.model)??"")}).catch(fe=>{W||G(fe instanceof Error?fe.message:"Unable to load creation form data.")}).finally(()=>{W||O(!1)}),()=>{W=!0}},[le]),T.useEffect(()=>{if(!h)return;let W=!1;return Eg(h).then(fe=>{var ge,re;W||(f(fe),v(((ge=fe.find(F=>F.isDefault))==null?void 0:ge.model)??((re=fe[0])==null?void 0:re.model)??""))}).catch(fe=>{W||G(fe instanceof Error?fe.message:"Unable to load backend models.")}),()=>{W=!0}},[h]);function Q(){if(window.history.length>1){e(-1);return}if(le){e(`/threads?workspaceId=${encodeURIComponent(le)}`);return}e("/workspaces")}async function ce(W){W.preventDefault(),P(!0),G(null);try{const fe=await w6(S.trim()?{workspaceId:g,provider:h,model:E,approvalMode:w,title:S.trim()}:{workspaceId:g,provider:h,model:E,approvalMode:w});e(`/threads/${fe.id}`)}catch(fe){fe instanceof Yt?G(fe.payload.message):G(fe instanceof Error?fe.message:"Unable to create thread.")}finally{P(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"New Thread"}),d.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Start a backend session"}),d.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Choose the workspace, model, and approval mode that should back the new thread."})]}),C?d.jsx("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 px-6 py-12 text-center text-stone-400",children:"Loading creation form..."}):d.jsxs("form",{onSubmit:ce,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-backend",children:"Backend"}),d.jsx("select",{id:"thread-backend",value:h,onChange:W=>{const fe=W.target.value;p(fe)},className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:l.map(W=>d.jsxs("option",{value:W.provider,disabled:!gg(W),children:[W.displayName,gg(W)?"":" (not available)"]},W.provider))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-workspace",children:"Workspace"}),d.jsx("select",{id:"thread-workspace",value:g,onChange:W=>x(W.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:r.map(W=>d.jsxs("option",{value:W.id,children:[W.label," · ",W.absPath]},W.id))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-model",children:"Model"}),d.jsx("select",{id:"thread-model",value:E,onChange:W=>v(W.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:c.map(W=>d.jsxs("option",{value:W.model,children:[W.displayName," · ",W.model]},W.id))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-title",children:"Title"}),d.jsx("input",{id:"thread-title",value:S,onChange:W=>N(W.target.value),placeholder:"Optional. Falls back to first prompt.",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-approval-mode",children:"Approval mode"}),d.jsxs("select",{id:"thread-approval-mode",value:w,onChange:W=>R(W.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:[d.jsx("option",{value:"yolo",children:"yolo"}),d.jsx("option",{value:"guarded",children:"guarded"})]})]}),B&&d.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:B}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[d.jsx("button",{type:"submit",disabled:Y||!g||!E,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:Y?"Creating...":"Create Thread"}),d.jsx("button",{type:"button",onClick:Q,disabled:Y,className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:border-stone-800 disabled:text-stone-500",children:"Cancel"})]})]})]})}function M5({open:e,title:t,description:n,confirmLabel:r="Delete",busy:i=!1,onCancel:l,onConfirm:o}){return T.useEffect(()=>{if(!e)return;function c(f){f.key==="Escape"&&!i&&l()}return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[i,l,e]),e?mu.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:l,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),d.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:l,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),d.jsx("button",{type:"button",onClick:()=>void o(),disabled:i,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:i?"Deleting...":r})]})]})]}),document.body):null}function uY(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function cY(){const[e]=Kv(),t=ss(),n=eo(),r=e.get("workspaceId"),[i,l]=T.useState([]),[o,c]=T.useState([]),[f,h]=T.useState(null),[p,g]=T.useState(!0),[x,E]=T.useState(null),[v,S]=T.useState(null),[N,w]=T.useState(""),[R,C]=T.useState(null),[O,Y]=T.useState(null),[P,B]=T.useState(!1);async function G(){g(!0),E(null);try{const[J,he,A]=await Promise.all([ek((n==null?void 0:n.defaultBackend)??"codex").then(H=>H.status),tk(),N1()]);h(J),l(he),c(A)}catch(J){E(J instanceof Error?J.message:"Unable to load threads.")}finally{g(!1)}}T.useEffect(()=>{if(r===null)return;G();const J=rk(he=>{l(A=>A.map(H=>H.id===he.threadId?{...H,status:typeof he.payload.status=="string"?he.payload.status:H.status,lastError:typeof he.payload.error=="string"?he.payload.error:H.lastError,title:typeof he.payload.title=="string"?he.payload.title:H.title}:H))});return()=>{J.close()}},[r,n==null?void 0:n.defaultBackend]);const le=Object.fromEntries(o.map(J=>[J.id,J.label])),Q=o.find(J=>J.id===r)??null,ce=T.useMemo(()=>r?i.filter(J=>J.workspaceId===r):[],[r,i]),W=ce.filter(J=>J.status==="running").length,fe=r?`/threads/new?workspaceId=${encodeURIComponent(r)}`:"/threads/new";if(r===null)return d.jsx(vA,{to:"/workspaces",replace:!0});function ge(){switch(f==null?void 0:f.state){case"ready":return"bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.14)]";case"starting":return"bg-amber-300 shadow-[0_0_0_3px_rgba(252,211,77,0.12)]";case"degraded":case"failed":return"bg-rose-400 shadow-[0_0_0_3px_rgba(251,113,133,0.14)]";default:return"bg-stone-500 shadow-[0_0_0_3px_rgba(120,113,108,0.14)]"}}async function re(J,he){try{const A=await nk(J,{title:he});l(H=>H.map(te=>te.id===A.id?{...te,title:A.title,updatedAt:A.updatedAt}:te))}catch(A){throw E(A instanceof Error?A.message:"Unable to rename thread."),A}}async function F(){if(!v)return;const J=N.trim();if(J){C(v);try{await re(v,J),S(null),w("")}finally{C(null)}}}async function $(){if(O){B(!0);try{await L6(O.id),l(J=>J.filter(he=>he.id!==O.id)),Y(null)}catch(J){E(J instanceof Error?J.message:"Unable to delete thread.")}finally{B(!1)}}}return d.jsx(O5,{threads:i,workspaceLabels:le,status:f,loading:p,error:x,viewportConstrained:r!==null,showMobileAppMenu:!0,showMobileThreadNavToggle:!1,showMobileNewThreadShortcut:!1,currentWorkspaceId:r,currentWorkspaceLabel:(Q==null?void 0:Q.label)??null,onRenameThread:re,children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[2rem] border border-stone-800 bg-stone-900/85 shadow-2xl shadow-stone-950/20",children:[d.jsx("div",{className:"border-b border-stone-800 px-4 py-3 sm:px-6 sm:py-4",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("h2",{className:"min-w-0 truncate text-base font-semibold text-stone-100 sm:text-lg",title:Q?`${Q.label} threads`:"All threads",children:Q?Q.label:"All Threads"}),d.jsx(oi,{to:fe,className:"inline-flex h-9 shrink-0 items-center rounded-full bg-amber-300 px-3.5 text-xs font-medium uppercase tracking-[0.18em] text-stone-950 transition hover:bg-amber-200",children:"New Thread"})]})}),d.jsx("div",{className:"px-4 py-3 sm:px-6 sm:py-4",children:d.jsxs("article",{className:"inline-flex min-w-[12rem] max-w-full items-center gap-3 rounded-[1.25rem] border border-stone-800 bg-stone-950/70 px-3.5 py-2.5",children:[d.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 shrink-0 rounded-full ${ge()}`}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.22em] text-stone-500",children:"Supervisor"}),d.jsx("p",{className:"truncate text-sm text-stone-200",children:(f==null?void 0:f.lastError)??((f==null?void 0:f.state)==="ready"?"Ready":(f==null?void 0:f.state)??"Checking")})]})]})}),!p&&!x&&ce.length>0&&d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-stone-800 px-4 py-4 sm:px-6 sm:py-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-stone-500",children:"Recent Threads"}),d.jsxs("span",{className:"rounded-full border border-amber-300/30 bg-amber-300/10 px-2 py-0.5 text-[11px] font-medium uppercase tracking-[0.18em] text-amber-200",children:[ce.length," total"]}),W>0&&d.jsxs("span",{className:"text-xs text-stone-500",children:["· ",W," running"]})]}),d.jsx("div",{className:"mt-3 min-h-0 flex-1",children:d.jsx(I5,{threads:ce,currentWorkspaceId:r,workspaceLabels:le,onOpenThread:J=>t(`/threads/${J}`),onBeginRenameThread:J=>{S(J.id),w(J.title)},onDeleteThread:J=>Y(J),scrollable:!0,maxHeightClassName:"max-h-full",showDeleteButton:!0,showSessionCopyButton:!0})})]}),!p&&!x&&ce.length===0&&d.jsx("div",{className:"border-t border-stone-800 px-4 py-6 text-sm text-stone-500 sm:px-6",children:"No threads available in this workspace."})]}),d.jsx(Mb,{open:v!==null,title:"Rename Thread",label:"Thread Title",value:N,busy:R!==null,onChange:w,onCancel:()=>{S(null),w("")},onSubmit:()=>void F()}),d.jsx(M5,{open:O!==null,title:"Delete Thread",description:O?`Delete ${uY(O.title)} from supervisor. The backend session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:P,onCancel:()=>{P||Y(null)},onConfirm:()=>void $()})]})})}function Lv(e){const t=e.trim(),n=t.replace(/[\\/]+$/,"");if(!n)return"";if(P5(t)){const i=(n.split(/[?#]/)[0]??n).split(/[/:]/).filter(Boolean).at(-1)??"";return i.endsWith(".git")?i.slice(0,-4):i}return n.split(/[\\/]/).filter(Boolean).at(-1)??""}function P5(e){const t=e.trim();return/^https?:\/\/.+/i.test(t)||/^ssh:\/\/.+/i.test(t)||/^git@[^:]+:.+/.test(t)}function dY({initialPath:e="",initialLabel:t="",submitLabel:n="Save Workspace",error:r,busy:i=!1,onSubmit:l}){const o=Lv(e),[c,f]=T.useState(e),[h,p]=T.useState(t||o),[g,x]=T.useState(null),E=T.useRef(o);T.useEffect(()=>{const S=Lv(c);p(N=>!N.trim()||N===E.current?S:N),E.current=S},[c]);async function v(S){S.preventDefault();const N=c.trim();if(!N){x("Workspace path or Git URL is required.");return}x(null);const w=h.trim(),R=P5(N)?"gitUrl":"absPath";await l(w?{[R]:N,label:w}:{[R]:N})}return d.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"workspace-path",className:"text-sm font-medium text-stone-200",children:"Path or Git URL"}),d.jsx("input",{id:"workspace-path",name:"absPath",value:c,onChange:S=>f(S.target.value),placeholder:"/Users/name/project or https://github.com/owner/repo.git",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),d.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Absolute paths register local directories. Git URLs clone into the configured dev home."})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"workspace-label",className:"text-sm font-medium text-stone-200",children:"Display label"}),d.jsx("input",{id:"workspace-label",name:"label",value:h,onChange:S=>p(S.target.value),placeholder:"Optional override",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),d.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Defaults to the last folder name. You can override it."})]}),(g||r)&&d.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:g??r}),d.jsx("button",{type:"submit",disabled:i,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:i?"Saving...":n})]})}function fY(){const e=ss(),[t,n]=T.useState(null),[r,i]=T.useState(!1);async function l(o){i(!0),n(null);try{const c=await q6(o);e(`/threads?workspaceId=${encodeURIComponent(c.id)}`)}catch(c){c instanceof Yt?n(c.payload.message):n(c instanceof Error?c.message:"Unable to create workspace.")}finally{i(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Add Workspace"}),d.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Create a workspace"}),d.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Register an existing local directory, create one missing child directory under dev home, or clone a Git repository into dev home."})]}),d.jsx(dY,{busy:r,error:t,submitLabel:"Create Workspace",onSubmit:l})]})}function Iv(e){return Date.parse(e.lastOpenedAt??e.createdAt)}function hY(e,t){return e.isFavorite!==t.isFavorite?e.isFavorite?-1:1:Iv(t)-Iv(e)}function mY(e){return e?new Date(e).toLocaleString():"Never opened"}function pY(e,t=28){return e.length<=t?e:`...${e.slice(-(t-3))}`}function gY({active:e}){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-current ${e?"rotate-[18deg]":"rotate-[8deg]"}`,children:d.jsx("path",{d:"M10.7 1.75c.34 0 .62.28.62.63v1.24l1.43 1.42c.24.24.24.62 0 .86l-1.1 1.1v2.02c0 .17-.07.33-.19.45l-1.5 1.5v2.28c0 .28-.18.53-.44.6a.62.62 0 0 1-.69-.24L7.2 12.4l-2.83 2.83a.625.625 0 1 1-.88-.88l2.83-2.83-2.2-1.62a.62.62 0 0 1-.24-.69c.08-.26.32-.44.6-.44h2.28l1.5-1.5a.64.64 0 0 1 .45-.18h2.02l1.1-1.11-1.42-1.42H9.07a.63.63 0 0 1-.62-.63c0-.34.28-.62.62-.62h1.63Z"})})}function bY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Zm1.53 1.32c.35 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Zm2.82 0c.34 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Z"})})}function xY(){const e=ss(),[t,n]=T.useState([]),[r,i]=T.useState(!0),[l,o]=T.useState(null),[c,f]=T.useState(null),[h,p]=T.useState(""),[g,x]=T.useState(null),[E,v]=T.useState(null),[S,N]=T.useState(null),[w,R]=T.useState(!1);async function C(){i(!0),o(null);try{n(await N1())}catch(W){o(W instanceof Error?W.message:"Unable to load workspaces.")}finally{i(!1)}}T.useEffect(()=>{C()},[]);async function O(W){const fe={...W,isFavorite:!W.isFavorite};n(ge=>ge.map(re=>re.id===W.id?fe:re));try{const ge=await Q6(W.id,{isFavorite:!W.isFavorite});n(re=>re.map(F=>F.id===ge.id?ge:F))}catch(ge){n(re=>re.map(F=>F.id===W.id?W:F)),o(ge instanceof Error?ge.message:"Unable to update workspace.")}}async function Y(W){const fe=h.trim();if(fe){x(W);try{const ge=await Y6(W,{label:fe});n(re=>re.map(F=>F.id===ge.id?ge:F)),f(null),p("")}catch(ge){o(ge instanceof Error?ge.message:"Unable to rename workspace.")}finally{x(null)}}}function P(W){f(W.id),p(W.label)}function B(){f(null),p("")}function G(W){e(`/threads?workspaceId=${encodeURIComponent(W)}`)}async function le(){if(S){R(!0);try{await W6(S.id),n(W=>W.filter(fe=>fe.id!==S.id)),N(null)}catch(W){o(W instanceof Error?W.message:"Unable to delete workspace.")}finally{R(!1)}}}function Q(W,fe){(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),G(fe))}const ce=T.useMemo(()=>[...t].sort(hY),[t]);return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"sticky top-[env(safe-area-inset-top)] z-20 -mx-4 border-b border-stone-800/90 bg-stone-950/96 px-2.5 py-2 backdrop-blur sm:mx-0 sm:rounded-[1.4rem] sm:border sm:px-4",children:d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-2",children:[d.jsx(A1,{}),d.jsx(oi,{to:"/threads/import",className:"inline-flex h-8 shrink-0 items-center rounded-full border border-sky-400/30 bg-sky-400/10 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-sky-100 transition hover:border-sky-300/45 hover:bg-sky-400/16 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Import"}),d.jsx(oi,{to:"/workspaces/new",className:"inline-flex h-8 shrink-0 items-center rounded-full bg-amber-300 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-stone-950 transition hover:bg-amber-200 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Create"}),d.jsx("div",{className:"min-w-0 flex-1 text-right",children:d.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.24em] text-stone-500",children:"Workspaces"})})]}),d.jsx(R1,{className:"absolute left-0 top-[calc(100%+0.5rem)] z-30 w-[min(22rem,calc(100vw-1rem))]"})]})}),r&&d.jsx("div",{className:"rounded-[1.6rem] border border-stone-800 bg-stone-900/85 px-6 py-12 text-center text-stone-400",children:"Loading workspace registry..."}),l&&d.jsx("div",{className:"rounded-[1.4rem] border border-rose-500/30 bg-rose-500/10 px-4 py-4 text-rose-100",children:l}),!r&&!l&&t.length===0&&d.jsxs("div",{className:"rounded-[1.6rem] border border-dashed border-stone-700 bg-stone-900/80 px-6 py-12 text-center",children:[d.jsx("p",{className:"text-lg font-medium text-stone-100",children:"No workspaces yet"}),d.jsx("p",{className:"mt-2 text-sm text-stone-500",children:"Add a local directory inside the configured workspace root to start building the registry."})]}),!r&&ce.length>0&&d.jsx("div",{className:"space-y-2 overflow-x-hidden",children:ce.map(W=>d.jsxs("article",{role:"link",tabIndex:0,onClick:()=>G(W.id),onKeyDown:fe=>Q(fe,W.id),className:"relative overflow-hidden rounded-[1.35rem] border border-stone-800 bg-stone-900/88 px-4 py-3 shadow-lg shadow-stone-950/10 transition hover:border-stone-700 hover:bg-stone-900",children:[d.jsxs("div",{className:"absolute right-2.5 top-2.5 flex items-center gap-1.5",children:[d.jsx("button",{type:"button","aria-label":`Delete workspace ${W.label}`,title:"Delete workspace",onClick:fe=>{fe.stopPropagation(),N(W)},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-rose-400/20 bg-rose-400/10 text-rose-200 transition hover:bg-rose-400/18",children:d.jsx(bY,{})}),d.jsx("button",{type:"button","aria-label":W.isFavorite?`Unpin workspace ${W.label}`:`Pin workspace ${W.label}`,title:W.isFavorite?"Unpin workspace":"Pin workspace",onClick:fe=>{fe.stopPropagation(),O(W)},className:`inline-flex h-7 w-7 items-center justify-center rounded-full border transition ${W.isFavorite?"border-amber-300/40 bg-amber-300/15 text-amber-200":"border-stone-700 bg-stone-900/72 text-stone-500 hover:text-stone-200"}`,children:d.jsx(gY,{active:W.isFavorite})})]}),d.jsx("div",{className:"flex min-w-0 items-start gap-3 pr-[4.6rem]",children:d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[d.jsx("p",{className:"min-w-0 max-w-full truncate text-base font-semibold text-stone-100 sm:text-lg",title:W.label,children:W.label}),d.jsx("button",{type:"button",onClick:fe=>{fe.stopPropagation(),P(W)},"aria-label":`Rename workspace ${W.label}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-stone-500 transition hover:text-stone-100",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:d.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})})]}),d.jsx("button",{type:"button","aria-label":W.absPath,title:W.absPath,onClick:fe=>{fe.stopPropagation(),v(W.absPath)},className:"mt-1 inline-block max-w-full overflow-hidden whitespace-nowrap text-left text-[9px] leading-4 text-stone-500 transition hover:text-stone-300",children:pY(W.absPath)}),d.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-stone-500",children:d.jsxs("span",{className:"min-w-0 truncate",children:["Last opened: ",mY(W.lastOpenedAt)]})})]})})]},W.id))}),d.jsx(Mb,{open:c!==null,title:"Rename Workspace",label:"Workspace Label",value:h,busy:g!==null,onChange:p,onCancel:B,onSubmit:()=>c?Y(c):void 0}),d.jsx(T5,{open:E!==null,title:"Workspace Path",text:E??"",onClose:()=>v(null)}),d.jsx(M5,{open:S!==null,title:"Delete Workspace",description:S?`Delete ${S.label} from supervisor. This also removes its threads and local supervisor metadata.`:"",confirmLabel:"Delete Workspace",busy:w,onCancel:()=>{w||N(null)},onConfirm:()=>void le()})]})}const B5="remote-codex-theme-mode",U5="remote-codex-default-backend";function yY(){if(typeof window>"u")return"system";const e=window.localStorage.getItem(B5);return e==="light"||e==="dark"||e==="system"?e:"system"}function EY(){return typeof window>"u"?"codex":window.localStorage.getItem(U5)==="claude"?"claude":"codex"}function _Y(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function TY({themeMode:e,setThemeMode:t,effectiveTheme:n}){const[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,f]=T.useState(EY),h=ma(),p=/^\/threads\/[^/]+$/.test(h.pathname),g=h.pathname==="/threads",x=p||g,E=g||p,v=h.pathname==="/workspaces",S=v||g;T.useEffect(()=>{i(!1)},[h.pathname,h.search]);function N(w){f(w),window.localStorage.setItem(U5,w)}return d.jsxs(Zv.Provider,{value:{navOpen:r,openNav:()=>i(!0),toggleNav:()=>i(w=>!w),closeNav:()=>i(!1),settingsOpen:l,openSettings:()=>{i(!1),o(!0)},closeSettings:()=>o(!1),themeMode:e,setThemeMode:t,effectiveTheme:n,defaultBackend:c,setDefaultBackend:N},children:[d.jsxs("div",{className:`bg-[var(--app-bg)] text-[var(--app-fg)] ${x?"fixed inset-0 overflow-hidden overscroll-none":"min-h-screen"}`,children:[!S&&d.jsxs("div",{className:`fixed left-4 top-4 z-50 ${p?"hidden sm:block":""}`,children:[d.jsx(A1,{}),d.jsx(R1,{className:"mt-3 w-[min(22rem,calc(100vw-2rem))]"})]}),d.jsx("main",{className:`mx-auto w-full max-w-[1600px] ${x?"absolute inset-0 pb-0 sm:pb-4":"pb-4"} ${E?p||g?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-[calc(env(safe-area-inset-top)+4rem)] sm:pt-4":v?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-4"} ${x?"overflow-hidden overscroll-none px-0 sm:px-6":"px-4 sm:px-6"}`,children:d.jsx("section",{className:`min-w-0 ${x?"h-full overflow-hidden overscroll-none":""}`,children:d.jsx(kA,{})})})]}),d.jsx(t4,{})]})}function vY(){const[e,t]=T.useState(()=>yY()),[n,r]=T.useState(()=>_Y()),i=e==="system"?n:e;return T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>{r(l.matches?"dark":"light")};return o(),typeof l.addEventListener=="function"?l.addEventListener("change",o):l.addListener(o),()=>{typeof l.removeEventListener=="function"?l.removeEventListener("change",o):l.removeListener(o)}},[]),T.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(B5,e)},[e]),T.useEffect(()=>{const l=document.documentElement;l.dataset.themeMode=e,l.dataset.themeEffective=i,l.style.colorScheme=i},[i,e]),d.jsx("div",{className:"theme-shell theme-scrollbar",children:d.jsx(KA,{children:d.jsxs(CA,{children:[d.jsx(ni,{path:"/",element:d.jsx(n4,{})}),d.jsxs(ni,{element:d.jsx(TY,{themeMode:e,setThemeMode:t,effectiveTheme:i}),children:[d.jsx(ni,{path:"/workspaces",element:d.jsx(xY,{})}),d.jsx(ni,{path:"/workspaces/new",element:d.jsx(fY,{})}),d.jsx(ni,{path:"/threads",element:d.jsx(cY,{})}),d.jsx(ni,{path:"/threads/import",element:d.jsx(lY,{})}),d.jsx(ni,{path:"/threads/new",element:d.jsx(oY,{})}),d.jsx(ni,{path:"/threads/:id",element:d.jsx(iY,{})})]})]})})})}kN.createRoot(document.getElementById("root")).render(d.jsx(bN.StrictMode,{children:d.jsx(vY,{})}));const kY=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:_5},Symbol.toStringTag,{value:"Module"}));export{gV as A,LY as L,fa as R,Mh as g,d as j,T as r};
|