remote-codex 0.1.6 → 0.1.7
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/index.js +6786 -5630
- package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-DvEvXPo5.js → highlighted-body-OFNGDK62-0cYcfOfd.js} +1 -1
- package/apps/supervisor-web/dist/assets/index-CbIt0KnL.css +32 -0
- package/apps/supervisor-web/dist/assets/index-nH6a8Wwn.js +377 -0
- package/apps/supervisor-web/dist/assets/{xterm-CWQ1ih_R.js → xterm-DisVWgDR.js} +1 -1
- package/apps/supervisor-web/dist/index.html +2 -2
- package/package.json +5 -1
- package/packages/agent-runtime/src/index.ts +2 -0
- package/packages/agent-runtime/src/registry.ts +44 -0
- package/packages/agent-runtime/src/types.ts +531 -0
- package/packages/codex/src/appServerManager.test.ts +328 -0
- package/packages/codex/src/appServerManager.ts +656 -0
- package/packages/codex/src/historyItems.ts +1185 -0
- package/packages/codex/src/hookHistory.ts +224 -0
- package/packages/codex/src/index.ts +6 -0
- package/packages/codex/src/jsonrpc.test.ts +58 -0
- package/packages/codex/src/jsonrpc.ts +198 -0
- package/packages/codex/src/requestMapper.test.ts +127 -0
- package/packages/codex/src/requestMapper.ts +511 -0
- package/packages/codex/src/runtimeAdapter.ts +692 -0
- package/packages/codex/src/types.ts +403 -0
- package/packages/db/migrations/0015_agent_provider_fields.sql +14 -0
- package/packages/db/migrations/0016_remove_codex_thread_goal_id.sql +46 -0
- package/packages/db/migrations/0017_remove_codex_thread_columns.sql +85 -0
- package/packages/db/src/client.ts +53 -0
- package/packages/db/src/index.ts +5 -0
- package/packages/db/src/migrate.test.ts +36 -0
- package/packages/db/src/migrate.ts +84 -0
- package/packages/db/src/repositories.ts +893 -0
- package/packages/db/src/schema.ts +177 -0
- package/packages/db/src/seed.ts +51 -0
- package/packages/shared/src/index.ts +878 -0
- package/apps/supervisor-web/dist/assets/index-CQu6sRq7.css +0 -32
- package/apps/supervisor-web/dist/assets/index-MELw9ga_.js +0 -377
|
@@ -0,0 +1,377 @@
|
|
|
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 rA=Object.defineProperty;var aA=Object.getPrototypeOf;var sA=Reflect.get;var FE=e=>{throw TypeError(e)};var iA=(e,t,n)=>t in e?rA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ue=(e,t,n)=>iA(e,typeof t!="symbol"?t+"":t,n),Xp=(e,t,n)=>t.has(e)||FE("Cannot "+n);var Or=(e,t,n)=>(Xp(e,t,"read from private field"),n?n.call(e):t.get(e)),Sl=(e,t,n)=>t.has(e)?FE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ya=(e,t,n,r)=>(Xp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Kp=(e,t,n)=>(Xp(e,t,"access private method"),n);var $E=(e,t,n)=>sA(aA(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 Sh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zp={exports:{}},nc={};/**
|
|
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 VE;function lA(){if(VE)return nc;VE=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 nc.Fragment=t,nc.jsx=n,nc.jsxs=n,nc}var GE;function oA(){return GE||(GE=1,Zp.exports=lA()),Zp.exports}var f=oA(),Jp={exports:{}},xt={};/**
|
|
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 qE;function uA(){if(qE)return xt;qE=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"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function E(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function S(U,te,O){this.props=U,this.context=te,this.refs=C,this.updater=O||v}S.prototype.isReactComponent={},S.prototype.setState=function(U,te){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,te,"setState")},S.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function N(){}N.prototype=S.prototype;function A(U,te,O){this.props=U,this.context=te,this.refs=C,this.updater=O||v}var z=A.prototype=new N;z.constructor=A,w(z,S.prototype),z.isPureReactComponent=!0;var Y=Array.isArray;function M(){}var B={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function ce(U,te,O){var we=O.ref;return{$$typeof:e,type:U,key:te,ref:we!==void 0?we:null,props:O}}function Q(U,te){return ce(U.type,te,U.props)}function he(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function V(U){var te={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(O){return te[O]})}var Te=/\/+/g;function me(U,te){return typeof U=="object"&&U!==null&&U.key!=null?V(""+U.key):te.toString(36)}function ne(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(te){U.status==="pending"&&(U.status="fulfilled",U.value=te)},function(te){U.status==="pending"&&(U.status="rejected",U.reason=te)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,te,O,we,Re){var Se=typeof U;(Se==="undefined"||Se==="boolean")&&(U=null);var Ge=!1;if(U===null)Ge=!0;else switch(Se){case"bigint":case"string":case"number":Ge=!0;break;case"object":switch(U.$$typeof){case e:case t:Ge=!0;break;case p:return Ge=U._init,H(Ge(U._payload),te,O,we,Re)}}if(Ge)return Re=Re(U),Ge=we===""?"."+me(U,0):we,Y(Re)?(O="",Ge!=null&&(O=Ge.replace(Te,"$&/")+"/"),H(Re,te,O,"",function(tt){return tt})):Re!=null&&(he(Re)&&(Re=Q(Re,O+(Re.key==null||U&&U.key===Re.key?"":(""+Re.key).replace(Te,"$&/")+"/")+Ge)),te.push(Re)),1;Ge=0;var Fe=we===""?".":we+":";if(Y(U))for(var De=0;De<U.length;De++)we=U[De],Se=Fe+me(we,De),Ge+=H(we,te,O,Se,Re);else if(De=E(U),typeof De=="function")for(U=De.call(U),De=0;!(we=U.next()).done;)we=we.value,Se=Fe+me(we,De++),Ge+=H(we,te,O,Se,Re);else if(Se==="object"){if(typeof U.then=="function")return H(ne(U),te,O,we,Re);throw te=String(U),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return Ge}function F(U,te,O){if(U==null)return U;var we=[],Re=0;return H(U,we,"","",function(Se){return te.call(O,Se,Re++)}),we}function K(U){if(U._status===-1){var te=U._result;te=te(),te.then(function(O){(U._status===0||U._status===-1)&&(U._status=1,U._result=O)},function(O){(U._status===0||U._status===-1)&&(U._status=2,U._result=O)}),U._status===-1&&(U._status=0,U._result=te)}if(U._status===1)return U._result.default;throw U._result}var oe=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},R={map:F,forEach:function(U,te,O){F(U,function(){te.apply(this,arguments)},O)},count:function(U){var te=0;return F(U,function(){te++}),te},toArray:function(U){return F(U,function(te){return te})||[]},only:function(U){if(!he(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return xt.Activity=g,xt.Children=R,xt.Component=S,xt.Fragment=n,xt.Profiler=i,xt.PureComponent=A,xt.StrictMode=r,xt.Suspense=d,xt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,xt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return B.H.useMemoCache(U)}},xt.cache=function(U){return function(){return U.apply(null,arguments)}},xt.cacheSignal=function(){return null},xt.cloneElement=function(U,te,O){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var we=w({},U.props),Re=U.key;if(te!=null)for(Se in te.key!==void 0&&(Re=""+te.key),te)!G.call(te,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&te.ref===void 0||(we[Se]=te[Se]);var Se=arguments.length-2;if(Se===1)we.children=O;else if(1<Se){for(var Ge=Array(Se),Fe=0;Fe<Se;Fe++)Ge[Fe]=arguments[Fe+2];we.children=Ge}return ce(U.type,Re,we)},xt.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:l,_context:U},U},xt.createElement=function(U,te,O){var we,Re={},Se=null;if(te!=null)for(we in te.key!==void 0&&(Se=""+te.key),te)G.call(te,we)&&we!=="key"&&we!=="__self"&&we!=="__source"&&(Re[we]=te[we]);var Ge=arguments.length-2;if(Ge===1)Re.children=O;else if(1<Ge){for(var Fe=Array(Ge),De=0;De<Ge;De++)Fe[De]=arguments[De+2];Re.children=Fe}if(U&&U.defaultProps)for(we in Ge=U.defaultProps,Ge)Re[we]===void 0&&(Re[we]=Ge[we]);return ce(U,Se,Re)},xt.createRef=function(){return{current:null}},xt.forwardRef=function(U){return{$$typeof:c,render:U}},xt.isValidElement=he,xt.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:K}},xt.memo=function(U,te){return{$$typeof:m,type:U,compare:te===void 0?null:te}},xt.startTransition=function(U){var te=B.T,O={};B.T=O;try{var we=U(),Re=B.S;Re!==null&&Re(O,we),typeof we=="object"&&we!==null&&typeof we.then=="function"&&we.then(M,oe)}catch(Se){oe(Se)}finally{te!==null&&O.types!==null&&(te.types=O.types),B.T=te}},xt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},xt.use=function(U){return B.H.use(U)},xt.useActionState=function(U,te,O){return B.H.useActionState(U,te,O)},xt.useCallback=function(U,te){return B.H.useCallback(U,te)},xt.useContext=function(U){return B.H.useContext(U)},xt.useDebugValue=function(){},xt.useDeferredValue=function(U,te){return B.H.useDeferredValue(U,te)},xt.useEffect=function(U,te){return B.H.useEffect(U,te)},xt.useEffectEvent=function(U){return B.H.useEffectEvent(U)},xt.useId=function(){return B.H.useId()},xt.useImperativeHandle=function(U,te,O){return B.H.useImperativeHandle(U,te,O)},xt.useInsertionEffect=function(U,te){return B.H.useInsertionEffect(U,te)},xt.useLayoutEffect=function(U,te){return B.H.useLayoutEffect(U,te)},xt.useMemo=function(U,te){return B.H.useMemo(U,te)},xt.useOptimistic=function(U,te){return B.H.useOptimistic(U,te)},xt.useReducer=function(U,te,O){return B.H.useReducer(U,te,O)},xt.useRef=function(U){return B.H.useRef(U)},xt.useState=function(U){return B.H.useState(U)},xt.useSyncExternalStore=function(U,te,O){return B.H.useSyncExternalStore(U,te,O)},xt.useTransition=function(){return B.H.useTransition()},xt.version="19.2.5",xt}var YE;function o1(){return YE||(YE=1,Jp.exports=uA()),Jp.exports}var T=o1();const cA=Sh(T);var e0={exports:{}},rc={},t0={exports:{}},n0={};/**
|
|
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 WE;function dA(){return WE||(WE=1,(function(e){function t(H,F){var K=H.length;H.push(F);e:for(;0<K;){var oe=K-1>>>1,R=H[oe];if(0<i(R,F))H[oe]=F,H[K]=R,K=oe;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var F=H[0],K=H.pop();if(K!==F){H[0]=K;e:for(var oe=0,R=H.length,U=R>>>1;oe<U;){var te=2*(oe+1)-1,O=H[te],we=te+1,Re=H[we];if(0>i(O,K))we<R&&0>i(Re,O)?(H[oe]=Re,H[we]=K,oe=we):(H[oe]=O,H[te]=K,oe=te);else if(we<R&&0>i(Re,K))H[oe]=Re,H[we]=K,oe=we;else break e}}return F}function i(H,F){var K=H.sortIndex-F.sortIndex;return K!==0?K:H.id-F.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 d=[],m=[],p=1,g=null,y=3,E=!1,v=!1,w=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function z(H){for(var F=n(m);F!==null;){if(F.callback===null)r(m);else if(F.startTime<=H)r(m),F.sortIndex=F.expirationTime,t(d,F);else break;F=n(m)}}function Y(H){if(w=!1,z(H),!v)if(n(d)!==null)v=!0,M||(M=!0,V());else{var F=n(m);F!==null&&ne(Y,F.startTime-H)}}var M=!1,B=-1,G=5,ce=-1;function Q(){return C?!0:!(e.unstable_now()-ce<G)}function he(){if(C=!1,M){var H=e.unstable_now();ce=H;var F=!0;try{e:{v=!1,w&&(w=!1,N(B),B=-1),E=!0;var K=y;try{t:{for(z(H),g=n(d);g!==null&&!(g.expirationTime>H&&Q());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,y=g.priorityLevel;var R=oe(g.expirationTime<=H);if(H=e.unstable_now(),typeof R=="function"){g.callback=R,z(H),F=!0;break t}g===n(d)&&r(d),z(H)}else r(d);g=n(d)}if(g!==null)F=!0;else{var U=n(m);U!==null&&ne(Y,U.startTime-H),F=!1}}break e}finally{g=null,y=K,E=!1}F=void 0}}finally{F?V():M=!1}}}var V;if(typeof A=="function")V=function(){A(he)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,me=Te.port2;Te.port1.onmessage=he,V=function(){me.postMessage(null)}}else V=function(){S(he,0)};function ne(H,F){B=S(function(){H(e.unstable_now())},F)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var K=y;y=F;try{return H()}finally{y=K}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(H,F){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var K=y;y=H;try{return F()}finally{y=K}},e.unstable_scheduleCallback=function(H,F,K){var oe=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?oe+K:oe):K=oe,H){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=K+R,H={id:p++,callback:F,priorityLevel:H,startTime:K,expirationTime:R,sortIndex:-1},K>oe?(H.sortIndex=K,t(m,H),n(d)===null&&H===n(m)&&(w?(N(B),B=-1):w=!0,ne(Y,K-oe))):(H.sortIndex=R,t(d,H),v||E||(v=!0,M||(M=!0,V()))),H},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(H){var F=y;return function(){var K=y;y=F;try{return H.apply(this,arguments)}finally{y=K}}}})(n0)),n0}var QE;function fA(){return QE||(QE=1,t0.exports=dA()),t0.exports}var r0={exports:{}},kr={};/**
|
|
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 XE;function hA(){if(XE)return kr;XE=1;var e=o1();function t(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+m+" 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(d,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:d,containerInfo:m,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,m){if(d==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,kr.createPortal=function(d,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(d,m,null,p)},kr.flushSync=function(d){var m=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=m,r.p=p,r.d.f()}},kr.preconnect=function(d,m){typeof d=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(d,m))},kr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},kr.preinit=function(d,m){if(typeof d=="string"&&m&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,E=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?r.d.S(d,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:E}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:y,fetchPriority:E,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},kr.preinitModule=function(d,m){if(typeof d=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=c(m.as,m.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(d)},kr.preload=function(d,m){if(typeof d=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin);r.d.L(d,p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},kr.preloadModule=function(d,m){if(typeof d=="string")if(m){var p=c(m.as,m.crossOrigin);r.d.m(d,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(d)},kr.requestFormReset=function(d){r.d.r(d)},kr.unstable_batchedUpdates=function(d,m){return d(m)},kr.useFormState=function(d,m,p){return o.H.useFormState(d,m,p)},kr.useFormStatus=function(){return o.H.useHostTransitionStatus()},kr.version="19.2.5",kr}var KE;function Tv(){if(KE)return r0.exports;KE=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(),r0.exports=hA(),r0.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 ZE;function mA(){if(ZE)return rc;ZE=1;var e=fA(),t=o1(),n=Tv();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 d(a){if(l(a)!==a)throw Error(r(188))}function m(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,h=s;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return d(b),a;if(x===h)return d(b),s;x=x.sibling}throw Error(r(188))}if(u.return!==h.return)u=b,h=x;else{for(var k=!1,L=b.child;L;){if(L===u){k=!0,u=b,h=x;break}if(L===h){k=!0,h=b,u=x;break}L=L.sibling}if(!k){for(L=x.child;L;){if(L===u){k=!0,u=x,h=b;break}if(L===h){k=!0,h=x,u=b;break}L=L.sibling}if(!k)throw Error(r(189))}}if(u.alternate!==h)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,y=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function V(a){return a===null||typeof a!="object"?null:(a=he&&a[he]||a["@@iterator"],typeof a=="function"?a:null)}var Te=Symbol.for("react.client.reference");function me(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Te?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case Y:return"Suspense";case M:return"SuspenseList";case ce:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case A:return a.displayName||"Context";case N:return(a._context.displayName||"Context")+".Consumer";case z: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:me(a.type)||"Memo";case G:s=a._payload,a=a._init;try{return me(a(s))}catch{}}return null}var ne=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},oe=[],R=-1;function U(a){return{current:a}}function te(a){0>R||(a.current=oe[R],oe[R]=null,R--)}function O(a,s){R++,oe[R]=a.current,a.current=s}var we=U(null),Re=U(null),Se=U(null),Ge=U(null);function Fe(a,s){switch(O(Se,s),O(Re,a),O(we,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?dE(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=dE(s),a=fE(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}te(we),O(we,a)}function De(){te(we),te(Re),te(Se)}function tt(a){a.memoizedState!==null&&O(Ge,a);var s=we.current,u=fE(s,a.type);s!==u&&(O(Re,a),O(we,u))}function dt(a){Re.current===a&&(te(we),te(Re)),Ge.current===a&&(te(Ge),Zu._currentValue=K)}var Ct,bt;function At(a){if(Ct===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);Ct=s&&s[1]||"",bt=-1<u.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Ct+a+bt}var Tt=!1;function ot(a,s){if(!a||Tt)return"";Tt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(fe){var le=fe}Reflect.construct(a,[],_e)}else{try{_e.call()}catch(fe){le=fe}a.call(_e.prototype)}}else{try{throw Error()}catch(fe){le=fe}(_e=a())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(fe){if(fe&&le&&typeof fe.stack=="string")return[fe.stack,le.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=h.DetermineComponentFrameRoot(),k=x[0],L=x[1];if(k&&L){var W=k.split(`
|
|
45
|
+
`),ie=L.split(`
|
|
46
|
+
`);for(b=h=0;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(h===W.length||b===ie.length)for(h=W.length-1,b=ie.length-1;1<=h&&0<=b&&W[h]!==ie[b];)b--;for(;1<=h&&0<=b;h--,b--)if(W[h]!==ie[b]){if(h!==1||b!==1)do if(h--,b--,0>b||W[h]!==ie[b]){var be=`
|
|
47
|
+
`+W[h].replace(" at new "," at ");return a.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",a.displayName)),be}while(1<=h&&0<=b);break}}}finally{Tt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?At(u):""}function St(a,s){switch(a.tag){case 26:case 27:case 5:return At(a.type);case 16:return At("Lazy");case 13:return a.child!==s&&s!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return ot(a.type,!1);case 11:return ot(a.type.render,!1);case 1:return ot(a.type,!0);case 31:return At("Activity");default:return""}}function Me(a){try{var s="",u=null;do s+=St(a,u),u=a,a=a.return;while(a);return s}catch(h){return`
|
|
48
|
+
Error generating stack: `+h.message+`
|
|
49
|
+
`+h.stack}}var qe=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,Xt=e.unstable_shouldYield,yn=e.unstable_requestPaint,nt=e.unstable_now,lr=e.unstable_getCurrentPriorityLevel,ge=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,rt=e.unstable_LowPriority,vt=e.unstable_IdlePriority,En=e.log,kn=e.unstable_setDisableYieldValue,xe=null,Oe=null;function Ke(a){if(typeof En=="function"&&kn(a),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(xe,a)}catch{}}var Pe=Math.clz32?Math.clz32:Ee,it=Math.log,X=Math.LN2;function Ee(a){return a>>>=0,a===0?32:31-(it(a)/X|0)|0}var at=256,Ue=262144,Be=4194304;function gt(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 Pt(a,s,u){var h=a.pendingLanes;if(h===0)return 0;var b=0,x=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~x,h!==0?b=gt(h):(k&=L,k!==0?b=gt(k):u||(u=L&~a,u!==0&&(b=gt(u))))):(L=h&~x,L!==0?b=gt(L):k!==0?b=gt(k):u||(u=h&~a,u!==0&&(b=gt(u)))),b===0?0:s!==0&&s!==b&&(s&x)===0&&(x=b&-b,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:b}function Je(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function $t(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 pt(){var a=Be;return Be<<=1,(Be&62914560)===0&&(Be=4194304),a}function Br(a){for(var s=[],u=0;31>u;u++)s.push(a);return s}function Yt(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Xr(a,s,u,h,b,x){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,W=a.expirationTimes,ie=a.hiddenUpdates;for(u=k&~u;0<u;){var be=31-Pe(u),_e=1<<be;L[be]=0,W[be]=-1;var le=ie[be];if(le!==null)for(ie[be]=null,be=0;be<le.length;be++){var fe=le[be];fe!==null&&(fe.lane&=-536870913)}u&=~_e}h!==0&&Zn(a,h,0),x!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=x&~(k&~s))}function Zn(a,s,u){a.pendingLanes|=s,a.suspendedLanes&=~s;var h=31-Pe(s);a.entangledLanes|=s,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function il(a,s){var u=a.entangledLanes|=s;for(a=a.entanglements;u;){var h=31-Pe(u),b=1<<h;b&s|a[h]&s&&(a[h]|=s),u&=~b}}function ii(a,s){var u=s&-s;return u=(u&42)!==0?1:ma(u),(u&(a.suspendedLanes|s))!==0?0:u}function ma(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 za(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function eo(){var a=F.p;return a!==0?a:(a=window.event,a===void 0?32:jE(a.type))}function ll(a,s){var u=F.p;try{return F.p=a,s()}finally{F.p=u}}var Rr=Math.random().toString(36).slice(2),sn="__reactFiber$"+Rr,Fn="__reactProps$"+Rr,Rn="__reactContainer$"+Rr,li="__reactEvents$"+Rr,Er="__reactListeners$"+Rr,ts="__reactHandles$"+Rr,Vt="__reactResources$"+Rr,Mn="__reactMarker$"+Rr;function pa(a){delete a[sn],delete a[Fn],delete a[li],delete a[Er],delete a[ts]}function Jn(a){var s=a[sn];if(s)return s;for(var u=a.parentNode;u;){if(s=u[Rn]||u[sn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(a=yE(a);a!==null;){if(u=a[sn])return u;a=yE(a)}return s}a=u,u=a.parentNode}return null}function $n(a){if(a=a[sn]||a[Rn]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function ns(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function ga(a){var s=a[Vt];return s||(s=a[Vt]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function _n(a){a[Mn]=!0}var ks=new Set,ol={};function or(a,s){rs(a,s),rs(a+"Capture",s)}function rs(a,s){for(ol[a]=s,a=0;a<s.length;a++)ks.add(s[a])}var Kr=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]*$"),oi={},ui={};function Fa(a){return qe.call(ui,a)?!0:qe.call(oi,a)?!1:Kr.test(a)?ui[a]=!0:(oi[a]=!0,!1)}function ba(a,s,u){if(Fa(s))if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+u)}}function Vn(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 er(a,s,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(s,u,""+h)}}function ur(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ci(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ln(a,s,u){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,x=h.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return b.call(this)},set:function(k){u=""+k,x.call(this,k)}}),Object.defineProperty(a,s,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function ws(a){if(!a._valueTracker){var s=ci(a)?"checked":"value";a._valueTracker=ln(a,s,""+a[s])}}function as(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return a&&(h=ci(a)?a.checked?"true":"false":a.value),a=h,a!==u?(s.setValue(a),!0):!1}function _r(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 Pn=/[\n"\\]/g;function Tr(a){return a.replace(Pn,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Zr(a,s,u,h,b,x,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=""+ur(s)):a.value!==""+ur(s)&&(a.value=""+ur(s)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),s!=null?Cs(a,k,ur(s)):u!=null?Cs(a,k,ur(u)):h!=null&&a.removeAttribute("value"),b==null&&x!=null&&(a.defaultChecked=!!x),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+ur(L):a.removeAttribute("name")}function di(a,s,u,h,b,x,k,L){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){ws(a);return}u=u!=null?""+ur(u):"",s=s!=null?""+ur(s):u,L||s===a.value||(a.value=s),a.defaultValue=s}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),ws(a)}function Cs(a,s,u){s==="number"&&_r(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Ur(a,s,u,h){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&&h&&(a[u].defaultSelected=!0)}else{for(u=""+ur(u),s=null,b=0;b<a.length;b++){if(a[b].value===u){a[b].selected=!0,h&&(a[b].defaultSelected=!0);return}s!==null||a[b].disabled||(s=a[b])}s!==null&&(s.selected=!0)}}function en(a,s,u){if(s!=null&&(s=""+ur(s),s!==a.value&&(a.value=s),u==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=u!=null?""+ur(u):""}function xa(a,s,u,h){if(s==null){if(h!=null){if(u!=null)throw Error(r(92));if(ne(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=ur(s),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h),ws(a)}function pr(a,s){if(s){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=s;return}}a.textContent=s}var bu=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 fi(a,s,u){var h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":h?a.setProperty(s,u):typeof u!="number"||u===0||bu.has(s)?s==="float"?a.cssFloat=u:a[s]=(""+u).trim():a[s]=u+"px"}function hi(a,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var b in s)h=s[b],s.hasOwnProperty(b)&&u[b]!==h&&fi(a,b,h)}else for(var x in s)s.hasOwnProperty(x)&&fi(a,x,s[x])}function Ss(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 mi=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"]]),ul=/^[\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 ss(a){return ul.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Lr(){}var pi=null;function gi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var $a=null,ya=null;function bi(a){var s=$n(a);if(s&&(a=s.stateNode)){var u=a[Fn]||null;e:switch(a=s.stateNode,s.type){case"input":if(Zr(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="'+Tr(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==a&&h.form===a.form){var b=h[Fn]||null;if(!b)throw Error(r(90));Zr(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===a.form&&as(h)}break e;case"textarea":en(a,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Ur(a,!!u.multiple,s,!1)}}}var Ea=!1;function Ns(a,s,u){if(Ea)return a(s,u);Ea=!0;try{var h=a(s);return h}finally{if(Ea=!1,($a!==null||ya!==null)&&(Wd(),$a&&(s=$a,a=ya,ya=$a=null,bi(s),a)))for(s=0;s<a.length;s++)bi(a[s])}}function is(a,s){var u=a.stateNode;if(u===null)return null;var h=u[Fn]||null;if(h===null)return null;u=h[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":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cl=!1;if(vr)try{var As={};Object.defineProperty(As,"passive",{get:function(){cl=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{cl=!1}var Jr=null,xi=null,Rs=null;function to(){if(Rs)return Rs;var a,s=xi,u=s.length,h,b="value"in Jr?Jr.value:Jr.textContent,x=b.length;for(a=0;a<u&&s[a]===b[a];a++);var k=u-a;for(h=1;h<=k&&s[u-h]===b[x-h];h++);return Rs=b.slice(a,1<h?1-h:void 0)}function Ls(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 Is(){return!0}function dl(){return!1}function wn(a){function s(u,h,b,x,k){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(u=a[L],this[L]=u?u(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Is:dl,this.isPropagationStopped=dl,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=Is)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),s}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$=wn(ea),Z=g({},ea,{view:0,detail:0}),de=wn(Z),Ie,je,ht,$e=g({},Z,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_a,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!==ht&&(ht&&a.type==="mousemove"?(Ie=a.screenX-ht.screenX,je=a.screenY-ht.screenY):je=Ie=0,ht=a),Ie)},movementY:function(a){return"movementY"in a?a.movementY:je}}),Cn=wn($e),bn=g({},$e,{dataTransfer:0}),ta=wn(bn),Gn=g({},Z,{relatedTarget:0}),rn=wn(Gn),Wt=g({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Ae=wn(Wt),Ze=g({},ea,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),st=wn(Ze),an=g({},ea,{data:0}),It=wn(an),tn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ln={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"},In={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hr(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=In[a])?!!s[a]:!1}function _a(){return Hr}var ad=g({},Z,{key:function(a){if(a.key){var s=tn[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Ls(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Ln[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_a,charCode:function(a){return a.type==="keypress"?Ls(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ls(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),tm=wn(ad),nm=g({},$e,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xu=wn(nm),rm=g({},Z,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_a}),sd=wn(rm),id=g({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),ld=wn(id),od=g({},$e,{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}),ud=wn(od),cd=g({},ea,{newState:0,oldState:0}),dd=wn(cd),fd=[9,13,27,32],no=vr&&"CompositionEvent"in window,yi=null;vr&&"documentMode"in document&&(yi=document.documentMode);var hd=vr&&"TextEvent"in window&&!yi,yu=vr&&(!no||yi&&8<yi&&11>=yi),Eu=" ",_u=!1;function I(a,s){switch(a){case"keyup":return fd.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ae(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ke=!1;function Qe(a,s){switch(a){case"compositionend":return ae(s);case"keypress":return s.which!==32?null:(_u=!0,Eu);case"textInput":return a=s.data,a===Eu&&_u?null:a;default:return null}}function Xe(a,s){if(ke)return a==="compositionend"||!no&&I(a,s)?(a=to(),Rs=xi=Jr=null,ke=!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 yu&&s.locale!=="ko"?null:s.data;default:return null}}var mt={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 ft(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!mt[a.type]:s==="textarea"}function Ot(a,s,u,h){$a?ya?ya.push(h):ya=[h]:$a=h,s=tf(s,"onChange"),0<s.length&&(u=new $("onChange","change",null,u,h),a.push({event:u,listeners:s}))}var yt=null,Kt=null;function tr(a){sE(a,0)}function Bt(a){var s=ns(a);if(as(s))return a}function Ta(a,s){if(a==="change")return s}var Ei=!1;if(vr){var ro;if(vr){var am="oninput"in document;if(!am){var Cb=document.createElement("div");Cb.setAttribute("oninput","return;"),am=typeof Cb.oninput=="function"}ro=am}else ro=!1;Ei=ro&&(!document.documentMode||9<document.documentMode)}function Sb(){yt&&(yt.detachEvent("onpropertychange",Nb),Kt=yt=null)}function Nb(a){if(a.propertyName==="value"&&Bt(Kt)){var s=[];Ot(s,Kt,a,gi(a)),Ns(tr,s)}}function LS(a,s,u){a==="focusin"?(Sb(),yt=s,Kt=u,yt.attachEvent("onpropertychange",Nb)):a==="focusout"&&Sb()}function IS(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Bt(Kt)}function OS(a,s){if(a==="click")return Bt(s)}function DS(a,s){if(a==="input"||a==="change")return Bt(s)}function jS(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var na=typeof Object.is=="function"?Object.is:jS;function Tu(a,s){if(na(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var u=Object.keys(a),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!qe.call(s,b)||!na(a[b],s[b]))return!1}return!0}function Ab(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Rb(a,s){var u=Ab(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=s&&h>=s)return{node:u,offset:s-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ab(u)}}function Lb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Lb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Ib(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=_r(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=_r(a.document)}return s}function sm(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 MS=vr&&"documentMode"in document&&11>=document.documentMode,ao=null,im=null,vu=null,lm=!1;function Ob(a,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;lm||ao==null||ao!==_r(h)||(h=ao,"selectionStart"in h&&sm(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),vu&&Tu(vu,h)||(vu=h,h=tf(im,"onSelect"),0<h.length&&(s=new $("onSelect","select",null,s,u),a.push({event:s,listeners:h}),s.target=ao)))}function fl(a,s){var u={};return u[a.toLowerCase()]=s.toLowerCase(),u["Webkit"+a]="webkit"+s,u["Moz"+a]="moz"+s,u}var so={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionrun:fl("Transition","TransitionRun"),transitionstart:fl("Transition","TransitionStart"),transitioncancel:fl("Transition","TransitionCancel"),transitionend:fl("Transition","TransitionEnd")},om={},Db={};vr&&(Db=document.createElement("div").style,"AnimationEvent"in window||(delete so.animationend.animation,delete so.animationiteration.animation,delete so.animationstart.animation),"TransitionEvent"in window||delete so.transitionend.transition);function hl(a){if(om[a])return om[a];if(!so[a])return a;var s=so[a],u;for(u in s)if(s.hasOwnProperty(u)&&u in Db)return om[a]=s[u];return a}var jb=hl("animationend"),Mb=hl("animationiteration"),Pb=hl("animationstart"),PS=hl("transitionrun"),BS=hl("transitionstart"),US=hl("transitioncancel"),Bb=hl("transitionend"),Ub=new Map,um="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(" ");um.push("scrollEnd");function Va(a,s){Ub.set(a,s),or(s,[a])}var md=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)},va=[],io=0,cm=0;function pd(){for(var a=io,s=cm=io=0;s<a;){var u=va[s];va[s++]=null;var h=va[s];va[s++]=null;var b=va[s];va[s++]=null;var x=va[s];if(va[s++]=null,h!==null&&b!==null){var k=h.pending;k===null?b.next=b:(b.next=k.next,k.next=b),h.pending=b}x!==0&&Hb(u,b,x)}}function gd(a,s,u,h){va[io++]=a,va[io++]=s,va[io++]=u,va[io++]=h,cm|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function dm(a,s,u,h){return gd(a,s,u,h),bd(a)}function ml(a,s){return gd(a,null,null,s),bd(a)}function Hb(a,s,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var b=!1,x=a.return;x!==null;)x.childLanes|=u,h=x.alternate,h!==null&&(h.childLanes|=u),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(b=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,b&&s!==null&&(b=31-Pe(u),a=x.hiddenUpdates,h=a[b],h===null?a[b]=[s]:h.push(s),s.lane=u|536870912),x):null}function bd(a){if(50<Gu)throw Gu=0,Ep=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var lo={};function HS(a,s,u,h){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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(a,s,u,h){return new HS(a,s,u,h)}function fm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Os(a,s){var u=a.alternate;return u===null?(u=ra(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 zb(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 xd(a,s,u,h,b,x){var k=0;if(h=a,typeof a=="function")fm(a)&&(k=1);else if(typeof a=="string")k=GN(a,u,we.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case ce:return a=ra(31,u,s,b),a.elementType=ce,a.lanes=x,a;case w:return pl(u.children,b,x,s);case C:k=8,b|=24;break;case S:return a=ra(12,u,s,b|2),a.elementType=S,a.lanes=x,a;case Y:return a=ra(13,u,s,b),a.elementType=Y,a.lanes=x,a;case M:return a=ra(19,u,s,b),a.elementType=M,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case A:k=10;break e;case N:k=9;break e;case z:k=11;break e;case B:k=14;break e;case G:k=16,h=null;break e}k=29,u=Error(r(130,a===null?"null":typeof a,"")),h=null}return s=ra(k,u,s,b),s.elementType=a,s.type=h,s.lanes=x,s}function pl(a,s,u,h){return a=ra(7,a,h,s),a.lanes=u,a}function hm(a,s,u){return a=ra(6,a,null,s),a.lanes=u,a}function Fb(a){var s=ra(18,null,null,0);return s.stateNode=a,s}function mm(a,s,u){return s=ra(4,a.children!==null?a.children:[],a.key,s),s.lanes=u,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var $b=new WeakMap;function ka(a,s){if(typeof a=="object"&&a!==null){var u=$b.get(a);return u!==void 0?u:(s={value:a,source:s,stack:Me(s)},$b.set(a,s),s)}return{value:a,source:s,stack:Me(s)}}var oo=[],uo=0,yd=null,ku=0,wa=[],Ca=0,_i=null,ls=1,os="";function Ds(a,s){oo[uo++]=ku,oo[uo++]=yd,yd=a,ku=s}function Vb(a,s,u){wa[Ca++]=ls,wa[Ca++]=os,wa[Ca++]=_i,_i=a;var h=ls;a=os;var b=32-Pe(h)-1;h&=~(1<<b),u+=1;var x=32-Pe(s)+b;if(30<x){var k=b-b%5;x=(h&(1<<k)-1).toString(32),h>>=k,b-=k,ls=1<<32-Pe(s)+b|u<<b|h,os=x+a}else ls=1<<x|u<<b|h,os=a}function pm(a){a.return!==null&&(Ds(a,1),Vb(a,1,0))}function gm(a){for(;a===yd;)yd=oo[--uo],oo[uo]=null,ku=oo[--uo],oo[uo]=null;for(;a===_i;)_i=wa[--Ca],wa[Ca]=null,os=wa[--Ca],wa[Ca]=null,ls=wa[--Ca],wa[Ca]=null}function Gb(a,s){wa[Ca++]=ls,wa[Ca++]=os,wa[Ca++]=_i,ls=s.id,os=s.overflow,_i=a}var gr=null,Tn=null,Ft=!1,Ti=null,Sa=!1,bm=Error(r(519));function vi(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wu(ka(s,a)),bm}function qb(a){var s=a.stateNode,u=a.type,h=a.memoizedProps;switch(s[sn]=a,s[Fn]=h,u){case"dialog":jt("cancel",s),jt("close",s);break;case"iframe":case"object":case"embed":jt("load",s);break;case"video":case"audio":for(u=0;u<Yu.length;u++)jt(Yu[u],s);break;case"source":jt("error",s);break;case"img":case"image":case"link":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"input":jt("invalid",s),di(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":jt("invalid",s);break;case"textarea":jt("invalid",s),xa(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||uE(s.textContent,u)?(h.popover!=null&&(jt("beforetoggle",s),jt("toggle",s)),h.onScroll!=null&&jt("scroll",s),h.onScrollEnd!=null&&jt("scrollend",s),h.onClick!=null&&(s.onclick=Lr),s=!0):s=!1,s||vi(a,!0)}function Yb(a){for(gr=a.return;gr;)switch(gr.tag){case 5:case 31:case 13:Sa=!1;return;case 27:case 3:Sa=!0;return;default:gr=gr.return}}function co(a){if(a!==gr)return!1;if(!Ft)return Yb(a),Ft=!0,!1;var s=a.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||jp(a.type,a.memoizedProps)),u=!u),u&&Tn&&vi(a),Yb(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tn=xE(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tn=xE(a)}else s===27?(s=Tn,Pi(a.type)?(a=Hp,Hp=null,Tn=a):Tn=s):Tn=gr?Aa(a.stateNode.nextSibling):null;return!0}function gl(){Tn=gr=null,Ft=!1}function xm(){var a=Ti;return a!==null&&(Vr===null?Vr=a:Vr.push.apply(Vr,a),Ti=null),a}function wu(a){Ti===null?Ti=[a]:Ti.push(a)}var ym=U(null),bl=null,js=null;function ki(a,s,u){O(ym,s._currentValue),s._currentValue=u}function Ms(a){a._currentValue=ym.current,te(ym)}function Em(a,s,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),a===u)break;a=a.return}}function _m(a,s,u,h){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var x=b.dependencies;if(x!==null){var k=b.child;x=x.firstContext;e:for(;x!==null;){var L=x;x=b;for(var W=0;W<s.length;W++)if(L.context===s[W]){x.lanes|=u,L=x.alternate,L!==null&&(L.lanes|=u),Em(x.return,u,a),h||(k=null);break e}x=L.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=u,x=k.alternate,x!==null&&(x.lanes|=u),Em(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 fo(a,s,u,h){a=null;for(var b=s,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!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;na(b.pendingProps.value,k.value)||(a!==null?a.push(L):a=[L])}}else if(b===Ge.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Zu):a=[Zu])}b=b.return}a!==null&&_m(s,a,u,h),s.flags|=262144}function Ed(a){for(a=a.firstContext;a!==null;){if(!na(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function xl(a){bl=a,js=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function br(a){return Wb(bl,a)}function _d(a,s){return bl===null&&xl(a),Wb(a,s)}function Wb(a,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},js===null){if(a===null)throw Error(r(308));js=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else js=js.next=s;return u}var zS=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(u){return u()})}},FS=e.unstable_scheduleCallback,$S=e.unstable_NormalPriority,qn={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tm(){return{controller:new zS,data:new Map,refCount:0}}function Cu(a){a.refCount--,a.refCount===0&&FS($S,function(){a.controller.abort()})}var Su=null,vm=0,ho=0,mo=null;function VS(a,s){if(Su===null){var u=Su=[];vm=0,ho=Cp(),mo={status:"pending",value:void 0,then:function(h){u.push(h)}}}return vm++,s.then(Qb,Qb),s}function Qb(){if(--vm===0&&Su!==null){mo!==null&&(mo.status="fulfilled");var a=Su;Su=null,ho=0,mo=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function GS(a,s){var u=[],h={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return a.then(function(){h.status="fulfilled",h.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(h.status="rejected",h.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),h}var Xb=H.S;H.S=function(a,s){Oy=nt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&VS(a,s),Xb!==null&&Xb(a,s)};var yl=U(null);function km(){var a=yl.current;return a!==null?a:pn.pooledCache}function Td(a,s){s===null?O(yl,yl.current):O(yl,s.pool)}function Kb(){var a=km();return a===null?null:{parent:qn._currentValue,pool:a}}var po=Error(r(460)),wm=Error(r(474)),vd=Error(r(542)),kd={then:function(){}};function Zb(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Jb(a,s,u){switch(u=a[u],u===void 0?a.push(s):u!==s&&(s.then(Lr,Lr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,tx(a),a;default:if(typeof s.status=="string")s.then(Lr,Lr);else{if(a=pn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(h){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=h}},function(h){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,tx(a),a}throw _l=s,po}}function El(a){try{var s=a._init;return s(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(_l=u,po):u}}var _l=null;function ex(){if(_l===null)throw Error(r(459));var a=_l;return _l=null,a}function tx(a){if(a===po||a===vd)throw Error(r(483))}var go=null,Nu=0;function wd(a){var s=Nu;return Nu+=1,go===null&&(go=[]),Jb(go,a,s)}function Au(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Cd(a,s){throw s.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function nx(a){function s(ee,J){if(a){var se=ee.deletions;se===null?(ee.deletions=[J],ee.flags|=16):se.push(J)}}function u(ee,J){if(!a)return null;for(;J!==null;)s(ee,J),J=J.sibling;return null}function h(ee){for(var J=new Map;ee!==null;)ee.key!==null?J.set(ee.key,ee):J.set(ee.index,ee),ee=ee.sibling;return J}function b(ee,J){return ee=Os(ee,J),ee.index=0,ee.sibling=null,ee}function x(ee,J,se){return ee.index=se,a?(se=ee.alternate,se!==null?(se=se.index,se<J?(ee.flags|=67108866,J):se):(ee.flags|=67108866,J)):(ee.flags|=1048576,J)}function k(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function L(ee,J,se,ye){return J===null||J.tag!==6?(J=hm(se,ee.mode,ye),J.return=ee,J):(J=b(J,se),J.return=ee,J)}function W(ee,J,se,ye){var et=se.type;return et===w?be(ee,J,se.props.children,ye,se.key):J!==null&&(J.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===G&&El(et)===J.type)?(J=b(J,se.props),Au(J,se),J.return=ee,J):(J=xd(se.type,se.key,se.props,null,ee.mode,ye),Au(J,se),J.return=ee,J)}function ie(ee,J,se,ye){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=mm(se,ee.mode,ye),J.return=ee,J):(J=b(J,se.children||[]),J.return=ee,J)}function be(ee,J,se,ye,et){return J===null||J.tag!==7?(J=pl(se,ee.mode,ye,et),J.return=ee,J):(J=b(J,se),J.return=ee,J)}function _e(ee,J,se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=hm(""+J,ee.mode,se),J.return=ee,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case E:return se=xd(J.type,J.key,J.props,null,ee.mode,se),Au(se,J),se.return=ee,se;case v:return J=mm(J,ee.mode,se),J.return=ee,J;case G:return J=El(J),_e(ee,J,se)}if(ne(J)||V(J))return J=pl(J,ee.mode,se,null),J.return=ee,J;if(typeof J.then=="function")return _e(ee,wd(J),se);if(J.$$typeof===A)return _e(ee,_d(ee,J),se);Cd(ee,J)}return null}function le(ee,J,se,ye){var et=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return et!==null?null:L(ee,J,""+se,ye);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return se.key===et?W(ee,J,se,ye):null;case v:return se.key===et?ie(ee,J,se,ye):null;case G:return se=El(se),le(ee,J,se,ye)}if(ne(se)||V(se))return et!==null?null:be(ee,J,se,ye,null);if(typeof se.then=="function")return le(ee,J,wd(se),ye);if(se.$$typeof===A)return le(ee,J,_d(ee,se),ye);Cd(ee,se)}return null}function fe(ee,J,se,ye,et){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ee=ee.get(se)||null,L(J,ee,""+ye,et);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case E:return ee=ee.get(ye.key===null?se:ye.key)||null,W(J,ee,ye,et);case v:return ee=ee.get(ye.key===null?se:ye.key)||null,ie(J,ee,ye,et);case G:return ye=El(ye),fe(ee,J,se,ye,et)}if(ne(ye)||V(ye))return ee=ee.get(se)||null,be(J,ee,ye,et,null);if(typeof ye.then=="function")return fe(ee,J,se,wd(ye),et);if(ye.$$typeof===A)return fe(ee,J,se,_d(J,ye),et);Cd(J,ye)}return null}function He(ee,J,se,ye){for(var et=null,Zt=null,We=J,kt=J=0,Ht=null;We!==null&&kt<se.length;kt++){We.index>kt?(Ht=We,We=null):Ht=We.sibling;var Jt=le(ee,We,se[kt],ye);if(Jt===null){We===null&&(We=Ht);break}a&&We&&Jt.alternate===null&&s(ee,We),J=x(Jt,J,kt),Zt===null?et=Jt:Zt.sibling=Jt,Zt=Jt,We=Ht}if(kt===se.length)return u(ee,We),Ft&&Ds(ee,kt),et;if(We===null){for(;kt<se.length;kt++)We=_e(ee,se[kt],ye),We!==null&&(J=x(We,J,kt),Zt===null?et=We:Zt.sibling=We,Zt=We);return Ft&&Ds(ee,kt),et}for(We=h(We);kt<se.length;kt++)Ht=fe(We,ee,kt,se[kt],ye),Ht!==null&&(a&&Ht.alternate!==null&&We.delete(Ht.key===null?kt:Ht.key),J=x(Ht,J,kt),Zt===null?et=Ht:Zt.sibling=Ht,Zt=Ht);return a&&We.forEach(function(Fi){return s(ee,Fi)}),Ft&&Ds(ee,kt),et}function ut(ee,J,se,ye){if(se==null)throw Error(r(151));for(var et=null,Zt=null,We=J,kt=J=0,Ht=null,Jt=se.next();We!==null&&!Jt.done;kt++,Jt=se.next()){We.index>kt?(Ht=We,We=null):Ht=We.sibling;var Fi=le(ee,We,Jt.value,ye);if(Fi===null){We===null&&(We=Ht);break}a&&We&&Fi.alternate===null&&s(ee,We),J=x(Fi,J,kt),Zt===null?et=Fi:Zt.sibling=Fi,Zt=Fi,We=Ht}if(Jt.done)return u(ee,We),Ft&&Ds(ee,kt),et;if(We===null){for(;!Jt.done;kt++,Jt=se.next())Jt=_e(ee,Jt.value,ye),Jt!==null&&(J=x(Jt,J,kt),Zt===null?et=Jt:Zt.sibling=Jt,Zt=Jt);return Ft&&Ds(ee,kt),et}for(We=h(We);!Jt.done;kt++,Jt=se.next())Jt=fe(We,ee,kt,Jt.value,ye),Jt!==null&&(a&&Jt.alternate!==null&&We.delete(Jt.key===null?kt:Jt.key),J=x(Jt,J,kt),Zt===null?et=Jt:Zt.sibling=Jt,Zt=Jt);return a&&We.forEach(function(nA){return s(ee,nA)}),Ft&&Ds(ee,kt),et}function fn(ee,J,se,ye){if(typeof se=="object"&&se!==null&&se.type===w&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case E:e:{for(var et=se.key;J!==null;){if(J.key===et){if(et=se.type,et===w){if(J.tag===7){u(ee,J.sibling),ye=b(J,se.props.children),ye.return=ee,ee=ye;break e}}else if(J.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===G&&El(et)===J.type){u(ee,J.sibling),ye=b(J,se.props),Au(ye,se),ye.return=ee,ee=ye;break e}u(ee,J);break}else s(ee,J);J=J.sibling}se.type===w?(ye=pl(se.props.children,ee.mode,ye,se.key),ye.return=ee,ee=ye):(ye=xd(se.type,se.key,se.props,null,ee.mode,ye),Au(ye,se),ye.return=ee,ee=ye)}return k(ee);case v:e:{for(et=se.key;J!==null;){if(J.key===et)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){u(ee,J.sibling),ye=b(J,se.children||[]),ye.return=ee,ee=ye;break e}else{u(ee,J);break}else s(ee,J);J=J.sibling}ye=mm(se,ee.mode,ye),ye.return=ee,ee=ye}return k(ee);case G:return se=El(se),fn(ee,J,se,ye)}if(ne(se))return He(ee,J,se,ye);if(V(se)){if(et=V(se),typeof et!="function")throw Error(r(150));return se=et.call(se),ut(ee,J,se,ye)}if(typeof se.then=="function")return fn(ee,J,wd(se),ye);if(se.$$typeof===A)return fn(ee,J,_d(ee,se),ye);Cd(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,J!==null&&J.tag===6?(u(ee,J.sibling),ye=b(J,se),ye.return=ee,ee=ye):(u(ee,J),ye=hm(se,ee.mode,ye),ye.return=ee,ee=ye),k(ee)):u(ee,J)}return function(ee,J,se,ye){try{Nu=0;var et=fn(ee,J,se,ye);return go=null,et}catch(We){if(We===po||We===vd)throw We;var Zt=ra(29,We,null,ee.mode);return Zt.lanes=ye,Zt.return=ee,Zt}finally{}}}var Tl=nx(!0),rx=nx(!1),wi=!1;function Cm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sm(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 h=a.updateQueue;if(h===null)return null;if(h=h.shared,(nn&2)!==0){var b=h.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),h.pending=s,s=bd(a),Hb(a,null,u),s}return gd(a,h,s,u),bd(a)}function Ru(a,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=a.pendingLanes,u|=h,s.lanes=u,il(a,u)}}function Nm(a,s){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var k={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=k:x=x.next=k,u=u.next}while(u!==null);x===null?b=x=s:x=x.next=s}else b=x=s;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=s:a.next=s,u.lastBaseUpdate=s}var Am=!1;function Lu(){if(Am){var a=mo;if(a!==null)throw a}}function Iu(a,s,u,h){Am=!1;var b=a.updateQueue;wi=!1;var x=b.firstBaseUpdate,k=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var W=L,ie=W.next;W.next=null,k===null?x=ie:k.next=ie,k=W;var be=a.alternate;be!==null&&(be=be.updateQueue,L=be.lastBaseUpdate,L!==k&&(L===null?be.firstBaseUpdate=ie:L.next=ie,be.lastBaseUpdate=W))}if(x!==null){var _e=b.baseState;k=0,be=ie=W=null,L=x;do{var le=L.lane&-536870913,fe=le!==L.lane;if(fe?(Ut&le)===le:(h&le)===le){le!==0&&le===ho&&(Am=!0),be!==null&&(be=be.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var He=a,ut=L;le=s;var fn=u;switch(ut.tag){case 1:if(He=ut.payload,typeof He=="function"){_e=He.call(fn,_e,le);break e}_e=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=ut.payload,le=typeof He=="function"?He.call(fn,_e,le):He,le==null)break e;_e=g({},_e,le);break e;case 2:wi=!0}}le=L.callback,le!==null&&(a.flags|=64,fe&&(a.flags|=8192),fe=b.callbacks,fe===null?b.callbacks=[le]:fe.push(le))}else fe={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},be===null?(ie=be=fe,W=_e):be=be.next=fe,k|=le;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;fe=L,L=fe.next,fe.next=null,b.lastBaseUpdate=fe,b.shared.pending=null}}while(!0);be===null&&(W=_e),b.baseState=W,b.firstBaseUpdate=ie,b.lastBaseUpdate=be,x===null&&(b.shared.lanes=0),Ii|=k,a.lanes=k,a.memoizedState=_e}}function ax(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function sx(a,s){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)ax(u[a],s)}var bo=U(null),Sd=U(0);function ix(a,s){a=Gs,O(Sd,a),O(bo,s),Gs=a|s.baseLanes}function Rm(){O(Sd,Gs),O(bo,bo.current)}function Lm(){Gs=Sd.current,te(bo),te(Sd)}var aa=U(null),Na=null;function Ni(a){var s=a.alternate;O(Bn,Bn.current&1),O(aa,a),Na===null&&(s===null||bo.current!==null||s.memoizedState!==null)&&(Na=a)}function Im(a){O(Bn,Bn.current),O(aa,a),Na===null&&(Na=a)}function lx(a){a.tag===22?(O(Bn,Bn.current),O(aa,a),Na===null&&(Na=a)):Ai()}function Ai(){O(Bn,Bn.current),O(aa,aa.current)}function sa(a){te(aa),Na===a&&(Na=null),te(Bn)}var Bn=U(0);function Nd(a){for(var s=a;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Bp(u)||Up(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 Ps=0,_t=null,cn=null,Yn=null,Ad=!1,xo=!1,vl=!1,Rd=0,Ou=0,yo=null,qS=0;function On(){throw Error(r(321))}function Om(a,s){if(s===null)return!1;for(var u=0;u<s.length&&u<a.length;u++)if(!na(a[u],s[u]))return!1;return!0}function Dm(a,s,u,h,b,x){return Ps=x,_t=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,H.H=a===null||a.memoizedState===null?Vx:Qm,vl=!1,x=u(h,b),vl=!1,xo&&(x=ux(s,u,h,b)),ox(a),x}function ox(a){H.H=Mu;var s=cn!==null&&cn.next!==null;if(Ps=0,Yn=cn=_t=null,Ad=!1,Ou=0,yo=null,s)throw Error(r(300));a===null||Wn||(a=a.dependencies,a!==null&&Ed(a)&&(Wn=!0))}function ux(a,s,u,h){_t=a;var b=0;do{if(xo&&(yo=null),Ou=0,xo=!1,25<=b)throw Error(r(301));if(b+=1,Yn=cn=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}H.H=Gx,x=s(u,h)}while(xo);return x}function YS(){var a=H.H,s=a.useState()[0];return s=typeof s.then=="function"?Du(s):s,a=a.useState()[0],(cn!==null?cn.memoizedState:null)!==a&&(_t.flags|=1024),s}function jm(){var a=Rd!==0;return Rd=0,a}function Mm(a,s,u){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~u}function Pm(a){if(Ad){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Ad=!1}Ps=0,Yn=cn=_t=null,xo=!1,Ou=Rd=0,yo=null}function Ir(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?_t.memoizedState=Yn=a:Yn=Yn.next=a,Yn}function Un(){if(cn===null){var a=_t.alternate;a=a!==null?a.memoizedState:null}else a=cn.next;var s=Yn===null?_t.memoizedState:Yn.next;if(s!==null)Yn=s,cn=a;else{if(a===null)throw _t.alternate===null?Error(r(467)):Error(r(310));cn=a,a={memoizedState:cn.memoizedState,baseState:cn.baseState,baseQueue:cn.baseQueue,queue:cn.queue,next:null},Yn===null?_t.memoizedState=Yn=a:Yn=Yn.next=a}return Yn}function Ld(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Du(a){var s=Ou;return Ou+=1,yo===null&&(yo=[]),a=Jb(yo,a,s),s=_t,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,H.H=s===null||s.memoizedState===null?Vx:Qm),a}function Id(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Du(a);if(a.$$typeof===A)return br(a)}throw Error(r(438,String(a)))}function Bm(a){var s=null,u=_t.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=_t.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Ld(),_t.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(a),h=0;h<a;h++)u[h]=Q;return s.index++,u}function Bs(a,s){return typeof s=="function"?s(a):s}function Od(a){var s=Un();return Um(s,cn,a)}function Um(a,s,u){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var b=a.baseQueue,x=h.pending;if(x!==null){if(b!==null){var k=b.next;b.next=x.next,x.next=k}s.baseQueue=b=x,h.pending=null}if(x=a.baseState,b===null)a.memoizedState=x;else{s=b.next;var L=k=null,W=null,ie=s,be=!1;do{var _e=ie.lane&-536870913;if(_e!==ie.lane?(Ut&_e)===_e:(Ps&_e)===_e){var le=ie.revertLane;if(le===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),_e===ho&&(be=!0);else if((Ps&le)===le){ie=ie.next,le===ho&&(be=!0);continue}else _e={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},W===null?(L=W=_e,k=x):W=W.next=_e,_t.lanes|=le,Ii|=le;_e=ie.action,vl&&u(x,_e),x=ie.hasEagerState?ie.eagerState:u(x,_e)}else le={lane:_e,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},W===null?(L=W=le,k=x):W=W.next=le,_t.lanes|=_e,Ii|=_e;ie=ie.next}while(ie!==null&&ie!==s);if(W===null?k=x:W.next=L,!na(x,a.memoizedState)&&(Wn=!0,be&&(u=mo,u!==null)))throw u;a.memoizedState=x,a.baseState=k,a.baseQueue=W,h.lastRenderedState=x}return b===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Hm(a){var s=Un(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var h=u.dispatch,b=u.pending,x=s.memoizedState;if(b!==null){u.pending=null;var k=b=b.next;do x=a(x,k.action),k=k.next;while(k!==b);na(x,s.memoizedState)||(Wn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,h]}function cx(a,s,u){var h=_t,b=Un(),x=Ft;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var k=!na((cn||b).memoizedState,u);if(k&&(b.memoizedState=u,Wn=!0),b=b.queue,$m(hx.bind(null,h,b,a),[a]),b.getSnapshot!==s||k||Yn!==null&&Yn.memoizedState.tag&1){if(h.flags|=2048,Eo(9,{destroy:void 0},fx.bind(null,h,b,u,s),null),pn===null)throw Error(r(349));x||(Ps&127)!==0||dx(h,s,u)}return u}function dx(a,s,u){a.flags|=16384,a={getSnapshot:s,value:u},s=_t.updateQueue,s===null?(s=Ld(),_t.updateQueue=s,s.stores=[a]):(u=s.stores,u===null?s.stores=[a]:u.push(a))}function fx(a,s,u,h){s.value=u,s.getSnapshot=h,mx(s)&&px(a)}function hx(a,s,u){return u(function(){mx(s)&&px(a)})}function mx(a){var s=a.getSnapshot;a=a.value;try{var u=s();return!na(a,u)}catch{return!0}}function px(a){var s=ml(a,2);s!==null&&Gr(s,a,2)}function zm(a){var s=Ir();if(typeof a=="function"){var u=a;if(a=u(),vl){Ke(!0);try{u()}finally{Ke(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:a},s}function gx(a,s,u,h){return a.baseState=u,Um(a,cn,typeof h=="function"?h:Bs)}function WS(a,s,u,h,b){if(Md(a))throw Error(r(485));if(a=s.action,a!==null){var x={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};H.T!==null?u(!0):x.isTransition=!1,h(x),u=s.pending,u===null?(x.next=s.pending=x,bx(s,x)):(x.next=u.next,s.pending=u.next=x)}}function bx(a,s){var u=s.action,h=s.payload,b=a.state;if(s.isTransition){var x=H.T,k={};H.T=k;try{var L=u(b,h),W=H.S;W!==null&&W(k,L),xx(a,s,L)}catch(ie){Fm(a,s,ie)}finally{x!==null&&k.types!==null&&(x.types=k.types),H.T=x}}else try{x=u(b,h),xx(a,s,x)}catch(ie){Fm(a,s,ie)}}function xx(a,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){yx(a,s,h)},function(h){return Fm(a,s,h)}):yx(a,s,u)}function yx(a,s,u){s.status="fulfilled",s.value=u,Ex(s),a.state=u,s=a.pending,s!==null&&(u=s.next,u===s?a.pending=null:(u=u.next,s.next=u,bx(a,u)))}function Fm(a,s,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,Ex(s),s=s.next;while(s!==h)}a.action=null}function Ex(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function _x(a,s){return s}function Tx(a,s){if(Ft){var u=pn.formState;if(u!==null){e:{var h=_t;if(Ft){if(Tn){t:{for(var b=Tn,x=Sa;b.nodeType!==8;){if(!x){b=null;break t}if(b=Aa(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Tn=Aa(b.nextSibling),h=b.data==="F!";break e}}vi(h)}h=!1}h&&(s=u[0])}}return u=Ir(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_x,lastRenderedState:s},u.queue=h,u=zx.bind(null,_t,h),h.dispatch=u,h=zm(!1),x=Wm.bind(null,_t,!1,h.queue),h=Ir(),b={state:s,dispatch:null,action:a,pending:null},h.queue=b,u=WS.bind(null,_t,b,x,u),b.dispatch=u,h.memoizedState=a,[s,u,!1]}function vx(a){var s=Un();return kx(s,cn,a)}function kx(a,s,u){if(s=Um(a,s,_x)[0],a=Od(Bs)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=Du(s)}catch(k){throw k===po?vd:k}else h=s;s=Un();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(_t.flags|=2048,Eo(9,{destroy:void 0},QS.bind(null,b,u),null)),[h,x,a]}function QS(a,s){a.action=s}function wx(a){var s=Un(),u=cn;if(u!==null)return kx(s,u,a);Un(),s=s.memoizedState,u=Un();var h=u.queue.dispatch;return u.memoizedState=a,[s,h,!1]}function Eo(a,s,u,h){return a={tag:a,create:u,deps:h,inst:s,next:null},s=_t.updateQueue,s===null&&(s=Ld(),_t.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,s.lastEffect=a),a}function Cx(){return Un().memoizedState}function Dd(a,s,u,h){var b=Ir();_t.flags|=a,b.memoizedState=Eo(1|s,{destroy:void 0},u,h===void 0?null:h)}function jd(a,s,u,h){var b=Un();h=h===void 0?null:h;var x=b.memoizedState.inst;cn!==null&&h!==null&&Om(h,cn.memoizedState.deps)?b.memoizedState=Eo(s,x,u,h):(_t.flags|=a,b.memoizedState=Eo(1|s,x,u,h))}function Sx(a,s){Dd(8390656,8,a,s)}function $m(a,s){jd(2048,8,a,s)}function XS(a){_t.flags|=4;var s=_t.updateQueue;if(s===null)s=Ld(),_t.updateQueue=s,s.events=[a];else{var u=s.events;u===null?s.events=[a]:u.push(a)}}function Nx(a){var s=Un().memoizedState;return XS({ref:s,nextImpl:a}),function(){if((nn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Ax(a,s){return jd(4,2,a,s)}function Rx(a,s){return jd(4,4,a,s)}function Lx(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 Ix(a,s,u){u=u!=null?u.concat([a]):null,jd(4,4,Lx.bind(null,s,a),u)}function Vm(){}function Ox(a,s){var u=Un();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&Om(s,h[1])?h[0]:(u.memoizedState=[a,s],a)}function Dx(a,s){var u=Un();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&Om(s,h[1]))return h[0];if(h=a(),vl){Ke(!0);try{a()}finally{Ke(!1)}}return u.memoizedState=[h,s],h}function Gm(a,s,u){return u===void 0||(Ps&1073741824)!==0&&(Ut&261930)===0?a.memoizedState=s:(a.memoizedState=u,a=jy(),_t.lanes|=a,Ii|=a,u)}function jx(a,s,u,h){return na(u,s)?u:bo.current!==null?(a=Gm(a,u,h),na(a,s)||(Wn=!0),a):(Ps&42)===0||(Ps&1073741824)!==0&&(Ut&261930)===0?(Wn=!0,a.memoizedState=u):(a=jy(),_t.lanes|=a,Ii|=a,s)}function Mx(a,s,u,h,b){var x=F.p;F.p=x!==0&&8>x?x:8;var k=H.T,L={};H.T=L,Wm(a,!1,s,u);try{var W=b(),ie=H.S;if(ie!==null&&ie(L,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var be=GS(W,h);ju(a,s,be,oa(a))}else ju(a,s,h,oa(a))}catch(_e){ju(a,s,{then:function(){},status:"rejected",reason:_e},oa())}finally{F.p=x,k!==null&&L.types!==null&&(k.types=L.types),H.T=k}}function KS(){}function qm(a,s,u,h){if(a.tag!==5)throw Error(r(476));var b=Px(a).queue;Mx(a,b,s,K,u===null?KS:function(){return Bx(a),u(h)})}function Px(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:K},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:u},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function Bx(a){var s=Px(a);s.next===null&&(s=a.alternate.memoizedState),ju(a,s.next.queue,{},oa())}function Ym(){return br(Zu)}function Ux(){return Un().memoizedState}function Hx(){return Un().memoizedState}function ZS(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var u=oa();a=Ci(u);var h=Si(s,a,u);h!==null&&(Gr(h,s,u),Ru(h,s,u)),s={cache:Tm()},a.payload=s;return}s=s.return}}function JS(a,s,u){var h=oa();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Md(a)?Fx(s,u):(u=dm(a,s,u,h),u!==null&&(Gr(u,a,h),$x(u,s,h)))}function zx(a,s,u){var h=oa();ju(a,s,u,h)}function ju(a,s,u,h){var b={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Md(a))Fx(s,b);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var k=s.lastRenderedState,L=x(k,u);if(b.hasEagerState=!0,b.eagerState=L,na(L,k))return gd(a,s,b,0),pn===null&&pd(),!1}catch{}finally{}if(u=dm(a,s,b,h),u!==null)return Gr(u,a,h),$x(u,s,h),!0}return!1}function Wm(a,s,u,h){if(h={lane:2,revertLane:Cp(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Md(a)){if(s)throw Error(r(479))}else s=dm(a,u,h,2),s!==null&&Gr(s,a,2)}function Md(a){var s=a.alternate;return a===_t||s!==null&&s===_t}function Fx(a,s){xo=Ad=!0;var u=a.pending;u===null?s.next=s:(s.next=u.next,u.next=s),a.pending=s}function $x(a,s,u){if((u&4194048)!==0){var h=s.lanes;h&=a.pendingLanes,u|=h,s.lanes=u,il(a,u)}}var Mu={readContext:br,use:Id,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useLayoutEffect:On,useInsertionEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useSyncExternalStore:On,useId:On,useHostTransitionStatus:On,useFormState:On,useActionState:On,useOptimistic:On,useMemoCache:On,useCacheRefresh:On};Mu.useEffectEvent=On;var Vx={readContext:br,use:Id,useCallback:function(a,s){return Ir().memoizedState=[a,s===void 0?null:s],a},useContext:br,useEffect:Sx,useImperativeHandle:function(a,s,u){u=u!=null?u.concat([a]):null,Dd(4194308,4,Lx.bind(null,s,a),u)},useLayoutEffect:function(a,s){return Dd(4194308,4,a,s)},useInsertionEffect:function(a,s){Dd(4,2,a,s)},useMemo:function(a,s){var u=Ir();s=s===void 0?null:s;var h=a();if(vl){Ke(!0);try{a()}finally{Ke(!1)}}return u.memoizedState=[h,s],h},useReducer:function(a,s,u){var h=Ir();if(u!==void 0){var b=u(s);if(vl){Ke(!0);try{u(s)}finally{Ke(!1)}}}else b=s;return h.memoizedState=h.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},h.queue=a,a=a.dispatch=JS.bind(null,_t,a),[h.memoizedState,a]},useRef:function(a){var s=Ir();return a={current:a},s.memoizedState=a},useState:function(a){a=zm(a);var s=a.queue,u=zx.bind(null,_t,s);return s.dispatch=u,[a.memoizedState,u]},useDebugValue:Vm,useDeferredValue:function(a,s){var u=Ir();return Gm(u,a,s)},useTransition:function(){var a=zm(!1);return a=Mx.bind(null,_t,a.queue,!0,!1),Ir().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,u){var h=_t,b=Ir();if(Ft){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),pn===null)throw Error(r(349));(Ut&127)!==0||dx(h,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,Sx(hx.bind(null,h,x,a),[a]),h.flags|=2048,Eo(9,{destroy:void 0},fx.bind(null,h,x,u,s),null),u},useId:function(){var a=Ir(),s=pn.identifierPrefix;if(Ft){var u=os,h=ls;u=(h&~(1<<32-Pe(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Rd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=qS++,s="_"+s+"r_"+u.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:Ym,useFormState:Tx,useActionState:Tx,useOptimistic:function(a){var s=Ir();s.memoizedState=s.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Wm.bind(null,_t,!0,u),u.dispatch=s,[a,s]},useMemoCache:Bm,useCacheRefresh:function(){return Ir().memoizedState=ZS.bind(null,_t)},useEffectEvent:function(a){var s=Ir(),u={impl:a};return s.memoizedState=u,function(){if((nn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Qm={readContext:br,use:Id,useCallback:Ox,useContext:br,useEffect:$m,useImperativeHandle:Ix,useInsertionEffect:Ax,useLayoutEffect:Rx,useMemo:Dx,useReducer:Od,useRef:Cx,useState:function(){return Od(Bs)},useDebugValue:Vm,useDeferredValue:function(a,s){var u=Un();return jx(u,cn.memoizedState,a,s)},useTransition:function(){var a=Od(Bs)[0],s=Un().memoizedState;return[typeof a=="boolean"?a:Du(a),s]},useSyncExternalStore:cx,useId:Ux,useHostTransitionStatus:Ym,useFormState:vx,useActionState:vx,useOptimistic:function(a,s){var u=Un();return gx(u,cn,a,s)},useMemoCache:Bm,useCacheRefresh:Hx};Qm.useEffectEvent=Nx;var Gx={readContext:br,use:Id,useCallback:Ox,useContext:br,useEffect:$m,useImperativeHandle:Ix,useInsertionEffect:Ax,useLayoutEffect:Rx,useMemo:Dx,useReducer:Hm,useRef:Cx,useState:function(){return Hm(Bs)},useDebugValue:Vm,useDeferredValue:function(a,s){var u=Un();return cn===null?Gm(u,a,s):jx(u,cn.memoizedState,a,s)},useTransition:function(){var a=Hm(Bs)[0],s=Un().memoizedState;return[typeof a=="boolean"?a:Du(a),s]},useSyncExternalStore:cx,useId:Ux,useHostTransitionStatus:Ym,useFormState:wx,useActionState:wx,useOptimistic:function(a,s){var u=Un();return cn!==null?gx(u,cn,a,s):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Bm,useCacheRefresh:Hx};Gx.useEffectEvent=Nx;function Xm(a,s,u,h){s=a.memoizedState,u=u(h,s),u=u==null?s:g({},s,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Km={enqueueSetState:function(a,s,u){a=a._reactInternals;var h=oa(),b=Ci(h);b.payload=s,u!=null&&(b.callback=u),s=Si(a,b,h),s!==null&&(Gr(s,a,h),Ru(s,a,h))},enqueueReplaceState:function(a,s,u){a=a._reactInternals;var h=oa(),b=Ci(h);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=Si(a,b,h),s!==null&&(Gr(s,a,h),Ru(s,a,h))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var u=oa(),h=Ci(u);h.tag=2,s!=null&&(h.callback=s),s=Si(a,h,u),s!==null&&(Gr(s,a,u),Ru(s,a,u))}};function qx(a,s,u,h,b,x,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,x,k):s.prototype&&s.prototype.isPureReactComponent?!Tu(u,h)||!Tu(b,x):!0}function Yx(a,s,u,h){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==a&&Km.enqueueReplaceState(s,s.state,null)}function kl(a,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}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 Wx(a){md(a)}function Qx(a){console.error(a)}function Xx(a){md(a)}function Pd(a,s){try{var u=a.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function Kx(a,s,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Zm(a,s,u){return u=Ci(u),u.tag=3,u.payload={element:null},u.callback=function(){Pd(a,s)},u}function Zx(a){return a=Ci(a),a.tag=3,a}function Jx(a,s,u,h){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=h.value;a.payload=function(){return b(x)},a.callback=function(){Kx(s,u,h)}}var k=u.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){Kx(s,u,h),typeof b!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var L=h.stack;this.componentDidCatch(h.value,{componentStack:L!==null?L:""})})}function eN(a,s,u,h,b){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=u.alternate,s!==null&&fo(s,u,b,!0),u=aa.current,u!==null){switch(u.tag){case 31:case 13:return Na===null?Qd():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,h===kd?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),vp(a,h,b)),!1;case 22:return u.flags|=65536,h===kd?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),vp(a,h,b)),!1}throw Error(r(435,u.tag))}return vp(a,h,b),Qd(),!1}if(Ft)return s=aa.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,h!==bm&&(a=Error(r(422),{cause:h}),wu(ka(a,u)))):(h!==bm&&(s=Error(r(423),{cause:h}),wu(ka(s,u))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,h=ka(h,u),b=Zm(a.stateNode,h,b),Nm(a,b),Dn!==4&&(Dn=2)),!1;var x=Error(r(520),{cause:h});if(x=ka(x,u),Vu===null?Vu=[x]:Vu.push(x),Dn!==4&&(Dn=2),s===null)return!0;h=ka(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,a=b&-b,u.lanes|=a,a=Zm(u.stateNode,h,a),Nm(u,a),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Oi===null||!Oi.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=Zx(b),Jx(b,a,u,h),Nm(u,b),!1}u=u.return}while(u!==null);return!1}var Jm=Error(r(461)),Wn=!1;function xr(a,s,u,h){s.child=a===null?rx(s,null,u,h):Tl(s,a.child,u,h)}function ey(a,s,u,h,b){u=u.render;var x=s.ref;if("ref"in h){var k={};for(var L in h)L!=="ref"&&(k[L]=h[L])}else k=h;return xl(s),h=Dm(a,s,u,k,x,b),L=jm(),a!==null&&!Wn?(Mm(a,s,b),Us(a,s,b)):(Ft&&L&&pm(s),s.flags|=1,xr(a,s,h,b),s.child)}function ty(a,s,u,h,b){if(a===null){var x=u.type;return typeof x=="function"&&!fm(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,ny(a,s,x,h,b)):(a=xd(u.type,null,h,s,s.mode,b),a.ref=s.ref,a.return=s,s.child=a)}if(x=a.child,!lp(a,b)){var k=x.memoizedProps;if(u=u.compare,u=u!==null?u:Tu,u(k,h)&&a.ref===s.ref)return Us(a,s,b)}return s.flags|=1,a=Os(x,h),a.ref=s.ref,a.return=s,s.child=a}function ny(a,s,u,h,b){if(a!==null){var x=a.memoizedProps;if(Tu(x,h)&&a.ref===s.ref)if(Wn=!1,s.pendingProps=h=x,lp(a,b))(a.flags&131072)!==0&&(Wn=!0);else return s.lanes=a.lanes,Us(a,s,b)}return ep(a,s,u,h,b)}function ry(a,s,u,h){var b=h.children,x=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,a!==null){for(h=s.child=a.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~x}else h=0,s.child=null;return ay(a,s,x,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Td(s,x!==null?x.cachePool:null),x!==null?ix(s,x):Rm(),lx(s);else return h=s.lanes=536870912,ay(a,s,x!==null?x.baseLanes|u:u,u,h)}else x!==null?(Td(s,x.cachePool),ix(s,x),Ai(),s.memoizedState=null):(a!==null&&Td(s,null),Rm(),Ai());return xr(a,s,b,u),s.child}function Pu(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function ay(a,s,u,h,b){var x=km();return x=x===null?null:{parent:qn._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},a!==null&&Td(s,null),Rm(),lx(s),a!==null&&fo(a,s,h,!0),s.childLanes=b,null}function Bd(a,s){return s=Hd({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function sy(a,s,u){return Tl(s,a.child,null,u),a=Bd(s,s.pendingProps),a.flags|=2,sa(s),s.memoizedState=null,a}function tN(a,s,u){var h=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(Ft){if(h.mode==="hidden")return a=Bd(s,h),s.lanes=536870912,Pu(null,a);if(Im(s),(a=Tn)?(a=bE(a,Sa),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:_i!==null?{id:ls,overflow:os}:null,retryLane:536870912,hydrationErrors:null},u=Fb(a),u.return=s,s.child=u,gr=s,Tn=null)):a=null,a===null)throw vi(s);return s.lanes=536870912,null}return Bd(s,h)}var x=a.memoizedState;if(x!==null){var k=x.dehydrated;if(Im(s),b)if(s.flags&256)s.flags&=-257,s=sy(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||fo(a,s,u,!1),b=(u&a.childLanes)!==0,Wn||b){if(h=pn,h!==null&&(k=ii(h,u),k!==0&&k!==x.retryLane))throw x.retryLane=k,ml(a,k),Gr(h,a,k),Jm;Qd(),s=sy(a,s,u)}else a=x.treeContext,Tn=Aa(k.nextSibling),gr=s,Ft=!0,Ti=null,Sa=!1,a!==null&&Gb(s,a),s=Bd(s,h),s.flags|=4096;return s}return a=Os(a.child,{mode:h.mode,children:h.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Ud(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 ep(a,s,u,h,b){return xl(s),u=Dm(a,s,u,h,void 0,b),h=jm(),a!==null&&!Wn?(Mm(a,s,b),Us(a,s,b)):(Ft&&h&&pm(s),s.flags|=1,xr(a,s,u,b),s.child)}function iy(a,s,u,h,b,x){return xl(s),s.updateQueue=null,u=ux(s,h,u,b),ox(a),h=jm(),a!==null&&!Wn?(Mm(a,s,x),Us(a,s,x)):(Ft&&h&&pm(s),s.flags|=1,xr(a,s,u,x),s.child)}function ly(a,s,u,h,b){if(xl(s),s.stateNode===null){var x=lo,k=u.contextType;typeof k=="object"&&k!==null&&(x=br(k)),x=new u(h,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Km,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=h,x.state=s.memoizedState,x.refs={},Cm(s),k=u.contextType,x.context=typeof k=="object"&&k!==null?br(k):lo,x.state=s.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Xm(s,u,k,h),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&Km.enqueueReplaceState(x,x.state,null),Iu(s,h,x,b),Lu(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(a===null){x=s.stateNode;var L=s.memoizedProps,W=kl(u,L);x.props=W;var ie=x.context,be=u.contextType;k=lo,typeof be=="object"&&be!==null&&(k=br(be));var _e=u.getDerivedStateFromProps;be=typeof _e=="function"||typeof x.getSnapshotBeforeUpdate=="function",L=s.pendingProps!==L,be||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L||ie!==k)&&Yx(s,x,h,k),wi=!1;var le=s.memoizedState;x.state=le,Iu(s,h,x,b),Lu(),ie=s.memoizedState,L||le!==ie||wi?(typeof _e=="function"&&(Xm(s,u,_e,h),ie=s.memoizedState),(W=wi||qx(s,u,W,h,le,ie,k))?(be||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=ie),x.props=h,x.state=ie,x.context=k,h=W):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{x=s.stateNode,Sm(a,s),k=s.memoizedProps,be=kl(u,k),x.props=be,_e=s.pendingProps,le=x.context,ie=u.contextType,W=lo,typeof ie=="object"&&ie!==null&&(W=br(ie)),L=u.getDerivedStateFromProps,(ie=typeof L=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==_e||le!==W)&&Yx(s,x,h,W),wi=!1,le=s.memoizedState,x.state=le,Iu(s,h,x,b),Lu();var fe=s.memoizedState;k!==_e||le!==fe||wi||a!==null&&a.dependencies!==null&&Ed(a.dependencies)?(typeof L=="function"&&(Xm(s,u,L,h),fe=s.memoizedState),(be=wi||qx(s,u,be,h,le,fe,W)||a!==null&&a.dependencies!==null&&Ed(a.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,fe,W),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,fe,W)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===a.memoizedProps&&le===a.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&le===a.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=fe),x.props=h,x.state=fe,x.context=W,h=be):(typeof x.componentDidUpdate!="function"||k===a.memoizedProps&&le===a.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&le===a.memoizedState||(s.flags|=1024),h=!1)}return x=h,Ud(a,s),h=(s.flags&128)!==0,x||h?(x=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,a!==null&&h?(s.child=Tl(s,a.child,null,b),s.child=Tl(s,null,u,b)):xr(a,s,u,b),s.memoizedState=x.state,a=s.child):a=Us(a,s,b),a}function oy(a,s,u,h){return gl(),s.flags|=256,xr(a,s,u,h),s.child}var tp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function np(a){return{baseLanes:a,cachePool:Kb()}}function rp(a,s,u){return a=a!==null?a.childLanes&~u:0,s&&(a|=la),a}function uy(a,s,u){var h=s.pendingProps,b=!1,x=(s.flags&128)!==0,k;if((k=x)||(k=a!==null&&a.memoizedState===null?!1:(Bn.current&2)!==0),k&&(b=!0,s.flags&=-129),k=(s.flags&32)!==0,s.flags&=-33,a===null){if(Ft){if(b?Ni(s):Ai(),(a=Tn)?(a=bE(a,Sa),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:_i!==null?{id:ls,overflow:os}:null,retryLane:536870912,hydrationErrors:null},u=Fb(a),u.return=s,s.child=u,gr=s,Tn=null)):a=null,a===null)throw vi(s);return Up(a)?s.lanes=32:s.lanes=536870912,null}var L=h.children;return h=h.fallback,b?(Ai(),b=s.mode,L=Hd({mode:"hidden",children:L},b),h=pl(h,b,u,null),L.return=s,h.return=s,L.sibling=h,s.child=L,h=s.child,h.memoizedState=np(u),h.childLanes=rp(a,k,u),s.memoizedState=tp,Pu(null,h)):(Ni(s),ap(s,L))}var W=a.memoizedState;if(W!==null&&(L=W.dehydrated,L!==null)){if(x)s.flags&256?(Ni(s),s.flags&=-257,s=sp(a,s,u)):s.memoizedState!==null?(Ai(),s.child=a.child,s.flags|=128,s=null):(Ai(),L=h.fallback,b=s.mode,h=Hd({mode:"visible",children:h.children},b),L=pl(L,b,u,null),L.flags|=2,h.return=s,L.return=s,h.sibling=L,s.child=h,Tl(s,a.child,null,u),h=s.child,h.memoizedState=np(u),h.childLanes=rp(a,k,u),s.memoizedState=tp,s=Pu(null,h));else if(Ni(s),Up(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var ie=k.dgst;k=ie,h=Error(r(419)),h.stack="",h.digest=k,wu({value:h,source:null,stack:null}),s=sp(a,s,u)}else if(Wn||fo(a,s,u,!1),k=(u&a.childLanes)!==0,Wn||k){if(k=pn,k!==null&&(h=ii(k,u),h!==0&&h!==W.retryLane))throw W.retryLane=h,ml(a,h),Gr(k,a,h),Jm;Bp(L)||Qd(),s=sp(a,s,u)}else Bp(L)?(s.flags|=192,s.child=a.child,s=null):(a=W.treeContext,Tn=Aa(L.nextSibling),gr=s,Ft=!0,Ti=null,Sa=!1,a!==null&&Gb(s,a),s=ap(s,h.children),s.flags|=4096);return s}return b?(Ai(),L=h.fallback,b=s.mode,W=a.child,ie=W.sibling,h=Os(W,{mode:"hidden",children:h.children}),h.subtreeFlags=W.subtreeFlags&65011712,ie!==null?L=Os(ie,L):(L=pl(L,b,u,null),L.flags|=2),L.return=s,h.return=s,h.sibling=L,s.child=h,Pu(null,h),h=s.child,L=a.child.memoizedState,L===null?L=np(u):(b=L.cachePool,b!==null?(W=qn._currentValue,b=b.parent!==W?{parent:W,pool:W}:b):b=Kb(),L={baseLanes:L.baseLanes|u,cachePool:b}),h.memoizedState=L,h.childLanes=rp(a,k,u),s.memoizedState=tp,Pu(a.child,h)):(Ni(s),u=a.child,a=u.sibling,u=Os(u,{mode:"visible",children:h.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 ap(a,s){return s=Hd({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function Hd(a,s){return a=ra(22,a,null,s),a.lanes=0,a}function sp(a,s,u){return Tl(s,a.child,null,u),a=ap(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function cy(a,s,u){a.lanes|=s;var h=a.alternate;h!==null&&(h.lanes|=s),Em(a.return,s,u)}function ip(a,s,u,h,b,x){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b,treeForkCount:x}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=u,k.tailMode=b,k.treeForkCount=x)}function dy(a,s,u){var h=s.pendingProps,b=h.revealOrder,x=h.tail;h=h.children;var k=Bn.current,L=(k&2)!==0;if(L?(k=k&1|2,s.flags|=128):k&=1,O(Bn,k),xr(a,s,h,u),h=Ft?ku:0,!L&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&cy(a,u,s);else if(a.tag===19)cy(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&&Nd(a)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),ip(s,!1,b,u,x,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(a=b.alternate,a!==null&&Nd(a)===null){s.child=b;break}a=b.sibling,b.sibling=u,u=b,b=a}ip(s,!0,u,null,x,h);break;case"together":ip(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Us(a,s,u){if(a!==null&&(s.dependencies=a.dependencies),Ii|=s.lanes,(u&s.childLanes)===0)if(a!==null){if(fo(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=Os(a,a.pendingProps),s.child=u,u.return=s;a.sibling!==null;)a=a.sibling,u=u.sibling=Os(a,a.pendingProps),u.return=s;u.sibling=null}return s.child}function lp(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Ed(a)))}function nN(a,s,u){switch(s.tag){case 3:Fe(s,s.stateNode.containerInfo),ki(s,qn,a.memoizedState.cache),gl();break;case 27:case 5:tt(s);break;case 4:Fe(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,Im(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Ni(s),s.flags|=128,null):(u&s.child.childLanes)!==0?uy(a,s,u):(Ni(s),a=Us(a,s,u),a!==null?a.sibling:null);Ni(s);break;case 19:var b=(a.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(fo(a,s,u,!1),h=(u&s.childLanes)!==0),b){if(h)return dy(a,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),O(Bn,Bn.current),h)break;return null;case 22:return s.lanes=0,ry(a,s,u,s.pendingProps);case 24:ki(s,qn,a.memoizedState.cache)}return Us(a,s,u)}function fy(a,s,u){if(a!==null)if(a.memoizedProps!==s.pendingProps)Wn=!0;else{if(!lp(a,u)&&(s.flags&128)===0)return Wn=!1,nN(a,s,u);Wn=(a.flags&131072)!==0}else Wn=!1,Ft&&(s.flags&1048576)!==0&&Vb(s,ku,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(a=El(s.elementType),s.type=a,typeof a=="function")fm(a)?(h=kl(a,h),s.tag=1,s=ly(null,s,a,h,u)):(s.tag=0,s=ep(null,s,a,h,u));else{if(a!=null){var b=a.$$typeof;if(b===z){s.tag=11,s=ey(null,s,a,h,u);break e}else if(b===B){s.tag=14,s=ty(null,s,a,h,u);break e}}throw s=me(a)||a,Error(r(306,s,""))}}return s;case 0:return ep(a,s,s.type,s.pendingProps,u);case 1:return h=s.type,b=kl(h,s.pendingProps),ly(a,s,h,b,u);case 3:e:{if(Fe(s,s.stateNode.containerInfo),a===null)throw Error(r(387));h=s.pendingProps;var x=s.memoizedState;b=x.element,Sm(a,s),Iu(s,h,null,u);var k=s.memoizedState;if(h=k.cache,ki(s,qn,h),h!==x.cache&&_m(s,[qn],u,!0),Lu(),h=k.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:k.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=oy(a,s,h,u);break e}else if(h!==b){b=ka(Error(r(424)),s),wu(b),s=oy(a,s,h,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=Aa(a.firstChild),gr=s,Ft=!0,Ti=null,Sa=!0,u=rx(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(gl(),h===b){s=Us(a,s,u);break e}xr(a,s,h,u)}s=s.child}return s;case 26:return Ud(a,s),a===null?(u=vE(s.type,null,s.pendingProps,null))?s.memoizedState=u:Ft||(u=s.type,a=s.pendingProps,h=nf(Se.current).createElement(u),h[sn]=s,h[Fn]=a,yr(h,u,a),_n(h),s.stateNode=h):s.memoizedState=vE(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return tt(s),a===null&&Ft&&(h=s.stateNode=EE(s.type,s.pendingProps,Se.current),gr=s,Sa=!0,b=Tn,Pi(s.type)?(Hp=b,Tn=Aa(h.firstChild)):Tn=b),xr(a,s,s.pendingProps.children,u),Ud(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&Ft&&((b=h=Tn)&&(h=IN(h,s.type,s.pendingProps,Sa),h!==null?(s.stateNode=h,gr=s,Tn=Aa(h.firstChild),Sa=!1,b=!0):b=!1),b||vi(s)),tt(s),b=s.type,x=s.pendingProps,k=a!==null?a.memoizedProps:null,h=x.children,jp(b,x)?h=null:k!==null&&jp(b,k)&&(s.flags|=32),s.memoizedState!==null&&(b=Dm(a,s,YS,null,null,u),Zu._currentValue=b),Ud(a,s),xr(a,s,h,u),s.child;case 6:return a===null&&Ft&&((a=u=Tn)&&(u=ON(u,s.pendingProps,Sa),u!==null?(s.stateNode=u,gr=s,Tn=null,a=!0):a=!1),a||vi(s)),null;case 13:return uy(a,s,u);case 4:return Fe(s,s.stateNode.containerInfo),h=s.pendingProps,a===null?s.child=Tl(s,null,h,u):xr(a,s,h,u),s.child;case 11:return ey(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 h=s.pendingProps,ki(s,s.type,h.value),xr(a,s,h.children,u),s.child;case 9:return b=s.type._context,h=s.pendingProps.children,xl(s),b=br(b),h=h(b),s.flags|=1,xr(a,s,h,u),s.child;case 14:return ty(a,s,s.type,s.pendingProps,u);case 15:return ny(a,s,s.type,s.pendingProps,u);case 19:return dy(a,s,u);case 31:return tN(a,s,u);case 22:return ry(a,s,u,s.pendingProps);case 24:return xl(s),h=br(qn),a===null?(b=km(),b===null&&(b=pn,x=Tm(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:h,cache:b},Cm(s),ki(s,qn,b)):((a.lanes&u)!==0&&(Sm(a,s),Iu(s,null,null,u),Lu()),b=a.memoizedState,x=s.memoizedState,b.parent!==h?(b={parent:h,cache:h},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),ki(s,qn,h)):(h=x.cache,ki(s,qn,h),h!==b.cache&&_m(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 Hs(a){a.flags|=4}function op(a,s,u,h,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(Uy())a.flags|=8192;else throw _l=kd,wm}else a.flags&=-16777217}function hy(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!NE(s))if(Uy())a.flags|=8192;else throw _l=kd,wm}function zd(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?pt():536870912,a.lanes|=s,ko|=s)}function Bu(a,s){if(!Ft)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 h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function vn(a){var s=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(s)for(var b=a.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=h,a.childLanes=u,s}function rN(a,s,u){var h=s.pendingProps;switch(gm(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,h=null,a!==null&&(h=a.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ms(qn),De(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(co(s)?Hs(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,xm())),vn(s),null;case 26:var b=s.type,x=s.memoizedState;return a===null?(Hs(s),x!==null?(vn(s),hy(s,x)):(vn(s),op(s,b,null,h,u))):x?x!==a.memoizedState?(Hs(s),vn(s),hy(s,x)):(vn(s),s.flags&=-16777217):(a=a.memoizedProps,a!==h&&Hs(s),vn(s),op(s,b,a,h,u)),null;case 27:if(dt(s),u=Se.current,b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&Hs(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return vn(s),null}a=we.current,co(s)?qb(s):(a=EE(b,h,u),s.stateNode=a,Hs(s))}return vn(s),null;case 5:if(dt(s),b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&Hs(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return vn(s),null}if(x=we.current,co(s))qb(s);else{var k=nf(Se.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?k.createElement("select",{is:h.is}):k.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?k.createElement(b,{is:h.is}):k.createElement(b)}}x[sn]=s,x[Fn]=h;e:for(k=s.child;k!==null;){if(k.tag===5||k.tag===6)x.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=x;e:switch(yr(x,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Hs(s)}}return vn(s),op(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,u),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&Hs(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(a=Se.current,co(s)){if(a=s.stateNode,u=s.memoizedProps,h=null,b=gr,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}a[sn]=s,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||uE(a.nodeValue,u)),a||vi(s,!0)}else a=nf(a).createTextNode(h),a[sn]=s,s.stateNode=a}return vn(s),null;case 31:if(u=s.memoizedState,a===null||a.memoizedState!==null){if(h=co(s),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[sn]=s}else gl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;vn(s),a=!1}else u=xm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return s.flags&256?(sa(s),s):(sa(s),null);if((s.flags&128)!==0)throw Error(r(558))}return vn(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=co(s),h!==null&&h.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[sn]=s}else gl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;vn(s),b=!1}else b=xm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(sa(s),s):(sa(s),null)}return sa(s),(s.flags&128)!==0?(s.lanes=u,s):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=s.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==b&&(h.flags|=2048)),u!==a&&u&&(s.child.flags|=8192),zd(s,s.updateQueue),vn(s),null);case 4:return De(),a===null&&Rp(s.stateNode.containerInfo),vn(s),null;case 10:return Ms(s.type),vn(s),null;case 19:if(te(Bn),h=s.memoizedState,h===null)return vn(s),null;if(b=(s.flags&128)!==0,x=h.rendering,x===null)if(b)Bu(h,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(x=Nd(a),x!==null){for(s.flags|=128,Bu(h,!1),a=x.updateQueue,s.updateQueue=a,zd(s,a),s.subtreeFlags=0,a=u,u=s.child;u!==null;)zb(u,a),u=u.sibling;return O(Bn,Bn.current&1|2),Ft&&Ds(s,h.treeForkCount),s.child}a=a.sibling}h.tail!==null&&nt()>qd&&(s.flags|=128,b=!0,Bu(h,!1),s.lanes=4194304)}else{if(!b)if(a=Nd(x),a!==null){if(s.flags|=128,b=!0,a=a.updateQueue,s.updateQueue=a,zd(s,a),Bu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!Ft)return vn(s),null}else 2*nt()-h.renderingStartTime>qd&&u!==536870912&&(s.flags|=128,b=!0,Bu(h,!1),s.lanes=4194304);h.isBackwards?(x.sibling=s.child,s.child=x):(a=h.last,a!==null?a.sibling=x:s.child=x,h.last=x)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=nt(),a.sibling=null,u=Bn.current,O(Bn,b?u&1|2:u&1),Ft&&Ds(s,h.treeForkCount),a):(vn(s),null);case 22:case 23:return sa(s),Lm(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(vn(s),s.subtreeFlags&6&&(s.flags|=8192)):vn(s),u=s.updateQueue,u!==null&&zd(s,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==u&&(s.flags|=2048),a!==null&&te(yl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Ms(qn),vn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function aN(a,s){switch(gm(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Ms(qn),De(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return dt(s),null;case 31:if(s.memoizedState!==null){if(sa(s),s.alternate===null)throw Error(r(340));gl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(sa(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));gl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return te(Bn),null;case 4:return De(),null;case 10:return Ms(s.type),null;case 22:case 23:return sa(s),Lm(),a!==null&&te(yl),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return Ms(qn),null;case 25:return null;default:return null}}function my(a,s){switch(gm(s),s.tag){case 3:Ms(qn),De();break;case 26:case 27:case 5:dt(s);break;case 4:De();break;case 31:s.memoizedState!==null&&sa(s);break;case 13:sa(s);break;case 19:te(Bn);break;case 10:Ms(s.type);break;case 22:case 23:sa(s),Lm(),a!==null&&te(yl);break;case 24:Ms(qn)}}function Uu(a,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&a)===a){h=void 0;var x=u.create,k=u.inst;h=x(),k.destroy=h}u=u.next}while(u!==b)}}catch(L){un(s,s.return,L)}}function Ri(a,s,u){try{var h=s.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var x=b.next;h=x;do{if((h.tag&a)===a){var k=h.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,b=s;var W=u,ie=L;try{ie()}catch(be){un(b,W,be)}}}h=h.next}while(h!==x)}}catch(be){un(s,s.return,be)}}function py(a){var s=a.updateQueue;if(s!==null){var u=a.stateNode;try{sx(s,u)}catch(h){un(a,a.return,h)}}}function gy(a,s,u){u.props=kl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){un(a,s,h)}}function Hu(a,s){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(b){un(a,s,b)}}function us(a,s){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}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 by(a){var s=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(b){un(a,a.return,b)}}function up(a,s,u){try{var h=a.stateNode;CN(h,a.type,u,s),h[Fn]=s}catch(b){un(a,a.return,b)}}function xy(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Pi(a.type)||a.tag===4}function cp(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||xy(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 dp(a,s,u){var h=a.tag;if(h===5||h===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=Lr));else if(h!==4&&(h===27&&Pi(a.type)&&(u=a.stateNode,s=null),a=a.child,a!==null))for(dp(a,s,u),a=a.sibling;a!==null;)dp(a,s,u),a=a.sibling}function Fd(a,s,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?u.insertBefore(a,s):u.appendChild(a);else if(h!==4&&(h===27&&Pi(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Fd(a,s,u),a=a.sibling;a!==null;)Fd(a,s,u),a=a.sibling}function yy(a){var s=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);yr(s,h,u),s[sn]=a,s[Fn]=u}catch(x){un(a,a.return,x)}}var zs=!1,Qn=!1,fp=!1,Ey=typeof WeakSet=="function"?WeakSet:Set,cr=null;function sN(a,s){if(a=a.containerInfo,Op=cf,a=Ib(a),sm(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var k=0,L=-1,W=-1,ie=0,be=0,_e=a,le=null;t:for(;;){for(var fe;_e!==u||b!==0&&_e.nodeType!==3||(L=k+b),_e!==x||h!==0&&_e.nodeType!==3||(W=k+h),_e.nodeType===3&&(k+=_e.nodeValue.length),(fe=_e.firstChild)!==null;)le=_e,_e=fe;for(;;){if(_e===a)break t;if(le===u&&++ie===b&&(L=k),le===x&&++be===h&&(W=k),(fe=_e.nextSibling)!==null)break;_e=le,le=_e.parentNode}_e=fe}u=L===-1||W===-1?null:{start:L,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(Dp={focusedElem:a,selectionRange:u},cf=!1,cr=s;cr!==null;)if(s=cr,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,cr=a;else for(;cr!==null;){switch(s=cr,x=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&&x!==null){a=void 0,u=s,b=x.memoizedProps,x=x.memoizedState,h=u.stateNode;try{var He=kl(u.type,b);a=h.getSnapshotBeforeUpdate(He,x),h.__reactInternalSnapshotBeforeUpdate=a}catch(ut){un(u,u.return,ut)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,u=a.nodeType,u===9)Pp(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Pp(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,cr=a;break}cr=s.return}}function _y(a,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:$s(a,u),h&4&&Uu(5,u);break;case 1:if($s(a,u),h&4)if(a=u.stateNode,s===null)try{a.componentDidMount()}catch(k){un(u,u.return,k)}else{var b=kl(u.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(b,s,a.__reactInternalSnapshotBeforeUpdate)}catch(k){un(u,u.return,k)}}h&64&&py(u),h&512&&Hu(u,u.return);break;case 3:if($s(a,u),h&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{sx(a,s)}catch(k){un(u,u.return,k)}}break;case 27:s===null&&h&4&&yy(u);case 26:case 5:$s(a,u),s===null&&h&4&&by(u),h&512&&Hu(u,u.return);break;case 12:$s(a,u);break;case 31:$s(a,u),h&4&&ky(a,u);break;case 13:$s(a,u),h&4&&wy(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=mN.bind(null,u),DN(a,u))));break;case 22:if(h=u.memoizedState!==null||zs,!h){s=s!==null&&s.memoizedState!==null||Qn,b=zs;var x=Qn;zs=h,(Qn=s)&&!x?Vs(a,u,(u.subtreeFlags&8772)!==0):$s(a,u),zs=b,Qn=x}break;case 30:break;default:$s(a,u)}}function Ty(a){var s=a.alternate;s!==null&&(a.alternate=null,Ty(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&pa(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 Sn=null,zr=!1;function Fs(a,s,u){for(u=u.child;u!==null;)vy(a,s,u),u=u.sibling}function vy(a,s,u){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(xe,u)}catch{}switch(u.tag){case 26:Qn||us(u,s),Fs(a,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Qn||us(u,s);var h=Sn,b=zr;Pi(u.type)&&(Sn=u.stateNode,zr=!1),Fs(a,s,u),Qu(u.stateNode),Sn=h,zr=b;break;case 5:Qn||us(u,s);case 6:if(h=Sn,b=zr,Sn=null,Fs(a,s,u),Sn=h,zr=b,Sn!==null)if(zr)try{(Sn.nodeType===9?Sn.body:Sn.nodeName==="HTML"?Sn.ownerDocument.body:Sn).removeChild(u.stateNode)}catch(x){un(u,s,x)}else try{Sn.removeChild(u.stateNode)}catch(x){un(u,s,x)}break;case 18:Sn!==null&&(zr?(a=Sn,pE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Io(a)):pE(Sn,u.stateNode));break;case 4:h=Sn,b=zr,Sn=u.stateNode.containerInfo,zr=!0,Fs(a,s,u),Sn=h,zr=b;break;case 0:case 11:case 14:case 15:Ri(2,u,s),Qn||Ri(4,u,s),Fs(a,s,u);break;case 1:Qn||(us(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&gy(u,s,h)),Fs(a,s,u);break;case 21:Fs(a,s,u);break;case 22:Qn=(h=Qn)||u.memoizedState!==null,Fs(a,s,u),Qn=h;break;default:Fs(a,s,u)}}function ky(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Io(a)}catch(u){un(s,s.return,u)}}}function wy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Io(a)}catch(u){un(s,s.return,u)}}function iN(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new Ey),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new Ey),s;default:throw Error(r(435,a.tag))}}function $d(a,s){var u=iN(a);s.forEach(function(h){if(!u.has(h)){u.add(h);var b=pN.bind(null,a,h);h.then(b,b)}})}function Fr(a,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h],x=a,k=s,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(Pi(L.type)){Sn=L.stateNode,zr=!1;break e}break;case 5:Sn=L.stateNode,zr=!1;break e;case 3:case 4:Sn=L.stateNode.containerInfo,zr=!0;break e}L=L.return}if(Sn===null)throw Error(r(160));vy(x,k,b),Sn=null,zr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Cy(s,a),s=s.sibling}var Ga=null;function Cy(a,s){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Fr(s,a),$r(a),h&4&&(Ri(3,a,a.return),Uu(3,a),Ri(5,a,a.return));break;case 1:Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),h&64&&zs&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var b=Ga;if(Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),h&4){var x=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":x=b.getElementsByTagName("title")[0],(!x||x[Mn]||x[sn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(h),b.head.insertBefore(x,b.querySelector("head > title"))),yr(x,h,u),x[sn]=a,_n(x),h=x;break e;case"link":var k=CE("link","href",b).get(h+(u.href||""));if(k){for(var L=0;L<k.length;L++)if(x=k[L],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){k.splice(L,1);break t}}x=b.createElement(h),yr(x,h,u),b.head.appendChild(x);break;case"meta":if(k=CE("meta","content",b).get(h+(u.content||""))){for(L=0;L<k.length;L++)if(x=k[L],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){k.splice(L,1);break t}}x=b.createElement(h),yr(x,h,u),b.head.appendChild(x);break;default:throw Error(r(468,h))}x[sn]=a,_n(x),h=x}a.stateNode=h}else SE(b,a.type,a.stateNode);else a.stateNode=wE(b,h,a.memoizedProps);else x!==h?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,h===null?SE(b,a.type,a.stateNode):wE(b,h,a.memoizedProps)):h===null&&a.stateNode!==null&&up(a,a.memoizedProps,u.memoizedProps)}break;case 27:Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),u!==null&&h&4&&up(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),a.flags&32){b=a.stateNode;try{pr(b,"")}catch(He){un(a,a.return,He)}}h&4&&a.stateNode!=null&&(b=a.memoizedProps,up(a,b,u!==null?u.memoizedProps:b)),h&1024&&(fp=!0);break;case 6:if(Fr(s,a),$r(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch(He){un(a,a.return,He)}}break;case 3:if(sf=null,b=Ga,Ga=rf(s.containerInfo),Fr(s,a),Ga=b,$r(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Io(s.containerInfo)}catch(He){un(a,a.return,He)}fp&&(fp=!1,Sy(a));break;case 4:h=Ga,Ga=rf(a.stateNode.containerInfo),Fr(s,a),$r(a),Ga=h;break;case 12:Fr(s,a),$r(a);break;case 31:Fr(s,a),$r(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,$d(a,h)));break;case 13:Fr(s,a),$r(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Gd=nt()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,$d(a,h)));break;case 22:b=a.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,ie=zs,be=Qn;if(zs=ie||b,Qn=be||W,Fr(s,a),Qn=be,zs=ie,$r(a),h&8192)e:for(s=a.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||W||zs||Qn||wl(a)),u=null,s=a;;){if(s.tag===5||s.tag===26){if(u===null){W=u=s;try{if(x=W.stateNode,b)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=W.stateNode;var _e=W.memoizedProps.style,le=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;L.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(He){un(W,W.return,He)}}}else if(s.tag===6){if(u===null){W=s;try{W.stateNode.nodeValue=b?"":W.memoizedProps}catch(He){un(W,W.return,He)}}}else if(s.tag===18){if(u===null){W=s;try{var fe=W.stateNode;b?gE(fe,!0):gE(W.stateNode,!1)}catch(He){un(W,W.return,He)}}}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}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,$d(a,u))));break;case 19:Fr(s,a),$r(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,$d(a,h)));break;case 30:break;case 21:break;default:Fr(s,a),$r(a)}}function $r(a){var s=a.flags;if(s&2){try{for(var u,h=a.return;h!==null;){if(xy(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=cp(a);Fd(a,x,b);break;case 5:var k=u.stateNode;u.flags&32&&(pr(k,""),u.flags&=-33);var L=cp(a);Fd(a,L,k);break;case 3:case 4:var W=u.stateNode.containerInfo,ie=cp(a);dp(a,ie,W);break;default:throw Error(r(161))}}catch(be){un(a,a.return,be)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function Sy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;Sy(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function $s(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)_y(a,s.alternate,s),s=s.sibling}function wl(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),wl(s);break;case 1:us(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&gy(s,s.return,u),wl(s);break;case 27:Qu(s.stateNode);case 26:case 5:us(s,s.return),wl(s);break;case 22:s.memoizedState===null&&wl(s);break;case 30:wl(s);break;default:wl(s)}a=a.sibling}}function Vs(a,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,b=a,x=s,k=x.flags;switch(x.tag){case 0:case 11:case 15:Vs(b,x,u),Uu(4,x);break;case 1:if(Vs(b,x,u),h=x,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){un(h,h.return,ie)}if(h=x,b=h.updateQueue,b!==null){var L=h.stateNode;try{var W=b.shared.hiddenCallbacks;if(W!==null)for(b.shared.hiddenCallbacks=null,b=0;b<W.length;b++)ax(W[b],L)}catch(ie){un(h,h.return,ie)}}u&&k&64&&py(x),Hu(x,x.return);break;case 27:yy(x);case 26:case 5:Vs(b,x,u),u&&h===null&&k&4&&by(x),Hu(x,x.return);break;case 12:Vs(b,x,u);break;case 31:Vs(b,x,u),u&&k&4&&ky(b,x);break;case 13:Vs(b,x,u),u&&k&4&&wy(b,x);break;case 22:x.memoizedState===null&&Vs(b,x,u),Hu(x,x.return);break;case 30:break;default:Vs(b,x,u)}s=s.sibling}}function hp(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&&Cu(u))}function mp(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Cu(a))}function qa(a,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Ny(a,s,u,h),s=s.sibling}function Ny(a,s,u,h){var b=s.flags;switch(s.tag){case 0:case 11:case 15:qa(a,s,u,h),b&2048&&Uu(9,s);break;case 1:qa(a,s,u,h);break;case 3:qa(a,s,u,h),b&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Cu(a)));break;case 12:if(b&2048){qa(a,s,u,h),a=s.stateNode;try{var x=s.memoizedProps,k=x.id,L=x.onPostCommit;typeof L=="function"&&L(k,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){un(s,s.return,W)}}else qa(a,s,u,h);break;case 31:qa(a,s,u,h);break;case 13:qa(a,s,u,h);break;case 23:break;case 22:x=s.stateNode,k=s.alternate,s.memoizedState!==null?x._visibility&2?qa(a,s,u,h):zu(a,s):x._visibility&2?qa(a,s,u,h):(x._visibility|=2,_o(a,s,u,h,(s.subtreeFlags&10256)!==0||!1)),b&2048&&hp(k,s);break;case 24:qa(a,s,u,h),b&2048&&mp(s.alternate,s);break;default:qa(a,s,u,h)}}function _o(a,s,u,h,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=a,k=s,L=u,W=h,ie=k.flags;switch(k.tag){case 0:case 11:case 15:_o(x,k,L,W,b),Uu(8,k);break;case 23:break;case 22:var be=k.stateNode;k.memoizedState!==null?be._visibility&2?_o(x,k,L,W,b):zu(x,k):(be._visibility|=2,_o(x,k,L,W,b)),b&&ie&2048&&hp(k.alternate,k);break;case 24:_o(x,k,L,W,b),b&&ie&2048&&mp(k.alternate,k);break;default:_o(x,k,L,W,b)}s=s.sibling}}function zu(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=a,h=s,b=h.flags;switch(h.tag){case 22:zu(u,h),b&2048&&hp(h.alternate,h);break;case 24:zu(u,h),b&2048&&mp(h.alternate,h);break;default:zu(u,h)}s=s.sibling}}var Fu=8192;function To(a,s,u){if(a.subtreeFlags&Fu)for(a=a.child;a!==null;)Ay(a,s,u),a=a.sibling}function Ay(a,s,u){switch(a.tag){case 26:To(a,s,u),a.flags&Fu&&a.memoizedState!==null&&qN(u,Ga,a.memoizedState,a.memoizedProps);break;case 5:To(a,s,u);break;case 3:case 4:var h=Ga;Ga=rf(a.stateNode.containerInfo),To(a,s,u),Ga=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=Fu,Fu=16777216,To(a,s,u),Fu=h):To(a,s,u));break;default:To(a,s,u)}}function Ry(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 $u(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];cr=h,Iy(h,a)}Ry(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ly(a),a=a.sibling}function Ly(a){switch(a.tag){case 0:case 11:case 15:$u(a),a.flags&2048&&Ri(9,a,a.return);break;case 3:$u(a);break;case 12:$u(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Vd(a)):$u(a);break;default:$u(a)}}function Vd(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];cr=h,Iy(h,a)}Ry(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Ri(8,s,s.return),Vd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Vd(s));break;default:Vd(s)}a=a.sibling}}function Iy(a,s){for(;cr!==null;){var u=cr;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 h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Cu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,cr=h;else e:for(u=a;cr!==null;){h=cr;var b=h.sibling,x=h.return;if(Ty(h),h===u){cr=null;break e}if(b!==null){b.return=x,cr=b;break e}cr=x}}}var lN={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}},oN=typeof WeakMap=="function"?WeakMap:Map,nn=0,pn=null,Dt=null,Ut=0,on=0,ia=null,Li=!1,vo=!1,pp=!1,Gs=0,Dn=0,Ii=0,Cl=0,gp=0,la=0,ko=0,Vu=null,Vr=null,bp=!1,Gd=0,Oy=0,qd=1/0,Yd=null,Oi=null,nr=0,Di=null,wo=null,qs=0,xp=0,yp=null,Dy=null,Gu=0,Ep=null;function oa(){return(nn&2)!==0&&Ut!==0?Ut&-Ut:H.T!==null?Cp():eo()}function jy(){if(la===0)if((Ut&536870912)===0||Ft){var a=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),la=a}else la=536870912;return a=aa.current,a!==null&&(a.flags|=32),la}function Gr(a,s,u){(a===pn&&(on===2||on===9)||a.cancelPendingCommit!==null)&&(Co(a,0),ji(a,Ut,la,!1)),Yt(a,u),((nn&2)===0||a!==pn)&&(a===pn&&((nn&2)===0&&(Cl|=u),Dn===4&&ji(a,Ut,la,!1)),cs(a))}function My(a,s,u){if((nn&6)!==0)throw Error(r(327));var h=!u&&(s&127)===0&&(s&a.expiredLanes)===0||Je(a,s),b=h?dN(a,s):Tp(a,s,!0),x=h;do{if(b===0){vo&&!h&&ji(a,s,0,!1);break}else{if(u=a.current.alternate,x&&!uN(u)){b=Tp(a,s,!1),x=!1;continue}if(b===2){if(x=s,a.errorRecoveryDisabledLanes&x)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=Vu;var W=L.current.memoizedState.isDehydrated;if(W&&(Co(L,k).flags|=256),k=Tp(L,k,!1),k!==2){if(pp&&!W){L.errorRecoveryDisabledLanes|=x,Cl|=x,b=4;break e}x=Vr,Vr=b,x!==null&&(Vr===null?Vr=x:Vr.push.apply(Vr,x))}b=k}if(x=!1,b!==2)continue}}if(b===1){Co(a,0),ji(a,s,0,!0);break}e:{switch(h=a,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ji(h,s,la,!Li);break e;case 2:Vr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Gd+300-nt(),10<b)){if(ji(h,s,la,!Li),Pt(h,0,!0)!==0)break e;qs=s,h.timeoutHandle=hE(Py.bind(null,h,u,Vr,Yd,bp,s,la,Cl,ko,Li,x,"Throttled",-0,0),b);break e}Py(h,u,Vr,Yd,bp,s,la,Cl,ko,Li,x,null,-0,0)}}break}while(!0);cs(a)}function Py(a,s,u,h,b,x,k,L,W,ie,be,_e,le,fe){if(a.timeoutHandle=-1,_e=s.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lr},Ay(s,x,_e);var He=(x&62914560)===x?Gd-nt():(x&4194048)===x?Oy-nt():0;if(He=YN(_e,He),He!==null){qs=x,a.cancelPendingCommit=He(Gy.bind(null,a,s,x,u,h,b,k,L,W,be,_e,null,le,fe)),ji(a,x,k,!ie);return}}Gy(a,s,x,u,h,b,k,L,W)}function uN(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 h=0;h<u.length;h++){var b=u[h],x=b.getSnapshot;b=b.value;try{if(!na(x(),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,h){s&=~gp,s&=~Cl,a.suspendedLanes|=s,a.pingedLanes&=~s,h&&(a.warmLanes|=s),h=a.expirationTimes;for(var b=s;0<b;){var x=31-Pe(b),k=1<<x;h[x]=-1,b&=~k}u!==0&&Zn(a,u,s)}function Wd(){return(nn&6)===0?(qu(0),!1):!0}function _p(){if(Dt!==null){if(on===0)var a=Dt.return;else a=Dt,js=bl=null,Pm(a),go=null,Nu=0,a=Dt;for(;a!==null;)my(a.alternate,a),a=a.return;Dt=null}}function Co(a,s){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,AN(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),qs=0,_p(),pn=a,Dt=u=Os(a.current,null),Ut=s,on=0,ia=null,Li=!1,vo=Je(a,s),pp=!1,ko=la=gp=Cl=Ii=Dn=0,Vr=Vu=null,bp=!1,(s&8)!==0&&(s|=s&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=s;0<h;){var b=31-Pe(h),x=1<<b;s|=a[b],h&=~x}return Gs=s,pd(),u}function By(a,s){_t=null,H.H=Mu,s===po||s===vd?(s=ex(),on=3):s===wm?(s=ex(),on=4):on=s===Jm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ia=s,Dt===null&&(Dn=1,Pd(a,ka(s,a.current)))}function Uy(){var a=aa.current;return a===null?!0:(Ut&4194048)===Ut?Na===null:(Ut&62914560)===Ut||(Ut&536870912)!==0?a===Na:!1}function Hy(){var a=H.H;return H.H=Mu,a===null?Mu:a}function zy(){var a=H.A;return H.A=lN,a}function Qd(){Dn=4,Li||(Ut&4194048)!==Ut&&aa.current!==null||(vo=!0),(Ii&134217727)===0&&(Cl&134217727)===0||pn===null||ji(pn,Ut,la,!1)}function Tp(a,s,u){var h=nn;nn|=2;var b=Hy(),x=zy();(pn!==a||Ut!==s)&&(Yd=null,Co(a,s)),s=!1;var k=Dn;e:do try{if(on!==0&&Dt!==null){var L=Dt,W=ia;switch(on){case 8:_p(),k=6;break e;case 3:case 2:case 9:case 6:aa.current===null&&(s=!0);var ie=on;if(on=0,ia=null,So(a,L,W,ie),u&&vo){k=0;break e}break;default:ie=on,on=0,ia=null,So(a,L,W,ie)}}cN(),k=Dn;break}catch(be){By(a,be)}while(!0);return s&&a.shellSuspendCounter++,js=bl=null,nn=h,H.H=b,H.A=x,Dt===null&&(pn=null,Ut=0,pd()),k}function cN(){for(;Dt!==null;)Fy(Dt)}function dN(a,s){var u=nn;nn|=2;var h=Hy(),b=zy();pn!==a||Ut!==s?(Yd=null,qd=nt()+500,Co(a,s)):vo=Je(a,s);e:do try{if(on!==0&&Dt!==null){s=Dt;var x=ia;t:switch(on){case 1:on=0,ia=null,So(a,s,x,1);break;case 2:case 9:if(Zb(x)){on=0,ia=null,$y(s);break}s=function(){on!==2&&on!==9||pn!==a||(on=7),cs(a)},x.then(s,s);break e;case 3:on=7;break e;case 4:on=5;break e;case 7:Zb(x)?(on=0,ia=null,$y(s)):(on=0,ia=null,So(a,s,x,7));break;case 5:var k=null;switch(Dt.tag){case 26:k=Dt.memoizedState;case 5:case 27:var L=Dt;if(k?NE(k):L.stateNode.complete){on=0,ia=null;var W=L.sibling;if(W!==null)Dt=W;else{var ie=L.return;ie!==null?(Dt=ie,Xd(ie)):Dt=null}break t}}on=0,ia=null,So(a,s,x,5);break;case 6:on=0,ia=null,So(a,s,x,6);break;case 8:_p(),Dn=6;break e;default:throw Error(r(462))}}fN();break}catch(be){By(a,be)}while(!0);return js=bl=null,H.H=h,H.A=b,nn=u,Dt!==null?0:(pn=null,Ut=0,pd(),Dn)}function fN(){for(;Dt!==null&&!Xt();)Fy(Dt)}function Fy(a){var s=fy(a.alternate,a,Gs);a.memoizedProps=a.pendingProps,s===null?Xd(a):Dt=s}function $y(a){var s=a,u=s.alternate;switch(s.tag){case 15:case 0:s=iy(u,s,s.pendingProps,s.type,void 0,Ut);break;case 11:s=iy(u,s,s.pendingProps,s.type.render,s.ref,Ut);break;case 5:Pm(s);default:my(u,s),s=Dt=zb(s,Gs),s=fy(u,s,Gs)}a.memoizedProps=a.pendingProps,s===null?Xd(a):Dt=s}function So(a,s,u,h){js=bl=null,Pm(s),go=null,Nu=0;var b=s.return;try{if(eN(a,b,s,u,Ut)){Dn=1,Pd(a,ka(u,a.current)),Dt=null;return}}catch(x){if(b!==null)throw Dt=b,x;Dn=1,Pd(a,ka(u,a.current)),Dt=null;return}s.flags&32768?(Ft||h===1?a=!0:vo||(Ut&536870912)!==0?a=!1:(Li=a=!0,(h===2||h===9||h===3||h===6)&&(h=aa.current,h!==null&&h.tag===13&&(h.flags|=16384))),Vy(s,a)):Xd(s)}function Xd(a){var s=a;do{if((s.flags&32768)!==0){Vy(s,Li);return}a=s.return;var u=rN(s.alternate,s,Gs);if(u!==null){Dt=u;return}if(s=s.sibling,s!==null){Dt=s;return}Dt=s=a}while(s!==null);Dn===0&&(Dn=5)}function Vy(a,s){do{var u=aN(a.alternate,a);if(u!==null){u.flags&=32767,Dt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(a=a.sibling,a!==null)){Dt=a;return}Dt=a=u}while(a!==null);Dn=6,Dt=null}function Gy(a,s,u,h,b,x,k,L,W){a.cancelPendingCommit=null;do Kd();while(nr!==0);if((nn&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=cm,Xr(a,u,x,k,L,W),a===pn&&(Dt=pn=null,Ut=0),wo=s,Di=a,qs=u,xp=x,yp=b,Dy=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,gN(Ye,function(){return Xy(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,b=F.p,F.p=2,k=nn,nn|=4;try{sN(a,s,u)}finally{nn=k,F.p=b,H.T=h}}nr=1,qy(),Yy(),Wy()}}function qy(){if(nr===1){nr=0;var a=Di,s=wo,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var h=F.p;F.p=2;var b=nn;nn|=4;try{Cy(s,a);var x=Dp,k=Ib(a.containerInfo),L=x.focusedElem,W=x.selectionRange;if(k!==L&&L&&L.ownerDocument&&Lb(L.ownerDocument.documentElement,L)){if(W!==null&&sm(L)){var ie=W.start,be=W.end;if(be===void 0&&(be=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(be,L.value.length);else{var _e=L.ownerDocument||document,le=_e&&_e.defaultView||window;if(le.getSelection){var fe=le.getSelection(),He=L.textContent.length,ut=Math.min(W.start,He),fn=W.end===void 0?ut:Math.min(W.end,He);!fe.extend&&ut>fn&&(k=fn,fn=ut,ut=k);var ee=Rb(L,ut),J=Rb(L,fn);if(ee&&J&&(fe.rangeCount!==1||fe.anchorNode!==ee.node||fe.anchorOffset!==ee.offset||fe.focusNode!==J.node||fe.focusOffset!==J.offset)){var se=_e.createRange();se.setStart(ee.node,ee.offset),fe.removeAllRanges(),ut>fn?(fe.addRange(se),fe.extend(J.node,J.offset)):(se.setEnd(J.node,J.offset),fe.addRange(se))}}}}for(_e=[],fe=L;fe=fe.parentNode;)fe.nodeType===1&&_e.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<_e.length;L++){var ye=_e[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}cf=!!Op,Dp=Op=null}finally{nn=b,F.p=h,H.T=u}}a.current=s,nr=2}}function Yy(){if(nr===2){nr=0;var a=Di,s=wo,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var h=F.p;F.p=2;var b=nn;nn|=4;try{_y(a,s.alternate,s)}finally{nn=b,F.p=h,H.T=u}}nr=3}}function Wy(){if(nr===4||nr===3){nr=0,yn();var a=Di,s=wo,u=qs,h=Dy;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?nr=5:(nr=0,wo=Di=null,Qy(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Oi=null),za(u),s=s.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(xe,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=H.T,b=F.p,F.p=2,H.T=null;try{for(var x=a.onRecoverableError,k=0;k<h.length;k++){var L=h[k];x(L.value,{componentStack:L.stack})}}finally{H.T=s,F.p=b}}(qs&3)!==0&&Kd(),cs(a),b=a.pendingLanes,(u&261930)!==0&&(b&42)!==0?a===Ep?Gu++:(Gu=0,Ep=a):Gu=0,qu(0)}}function Qy(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Cu(s)))}function Kd(){return qy(),Yy(),Wy(),Xy()}function Xy(){if(nr!==5)return!1;var a=Di,s=xp;xp=0;var u=za(qs),h=H.T,b=F.p;try{F.p=32>u?32:u,H.T=null,u=yp,yp=null;var x=Di,k=qs;if(nr=0,wo=Di=null,qs=0,(nn&6)!==0)throw Error(r(331));var L=nn;if(nn|=4,Ly(x.current),Ny(x,x.current,k,u),nn=L,qu(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(xe,x)}catch{}return!0}finally{F.p=b,H.T=h,Qy(a,s)}}function Ky(a,s,u){s=ka(u,s),s=Zm(a.stateNode,s,2),a=Si(a,s,2),a!==null&&(Yt(a,2),cs(a))}function un(a,s,u){if(a.tag===3)Ky(a,a,u);else for(;s!==null;){if(s.tag===3){Ky(s,a,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Oi===null||!Oi.has(h))){a=ka(u,a),u=Zx(2),h=Si(s,u,2),h!==null&&(Jx(u,h,s,a),Yt(h,2),cs(h));break}}s=s.return}}function vp(a,s,u){var h=a.pingCache;if(h===null){h=a.pingCache=new oN;var b=new Set;h.set(s,b)}else b=h.get(s),b===void 0&&(b=new Set,h.set(s,b));b.has(u)||(pp=!0,b.add(u),a=hN.bind(null,a,s,u),s.then(a,a))}function hN(a,s,u){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,pn===a&&(Ut&u)===u&&(Dn===4||Dn===3&&(Ut&62914560)===Ut&&300>nt()-Gd?(nn&2)===0&&Co(a,0):gp|=u,ko===Ut&&(ko=0)),cs(a)}function Zy(a,s){s===0&&(s=pt()),a=ml(a,s),a!==null&&(Yt(a,s),cs(a))}function mN(a){var s=a.memoizedState,u=0;s!==null&&(u=s.retryLane),Zy(a,u)}function pN(a,s){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,b=a.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),Zy(a,u)}function gN(a,s){return zt(a,s)}var Zd=null,No=null,kp=!1,Jd=!1,wp=!1,Mi=0;function cs(a){a!==No&&a.next===null&&(No===null?Zd=No=a:No=No.next=a),Jd=!0,kp||(kp=!0,xN())}function qu(a,s){if(!wp&&Jd){wp=!0;do for(var u=!1,h=Zd;h!==null;){if(a!==0){var b=h.pendingLanes;if(b===0)var x=0;else{var k=h.suspendedLanes,L=h.pingedLanes;x=(1<<31-Pe(42|a)+1)-1,x&=b&~(k&~L),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,nE(h,x))}else x=Ut,x=Pt(h,h===pn?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||Je(h,x)||(u=!0,nE(h,x));h=h.next}while(u);wp=!1}}function bN(){Jy()}function Jy(){Jd=kp=!1;var a=0;Mi!==0&&NN()&&(a=Mi);for(var s=nt(),u=null,h=Zd;h!==null;){var b=h.next,x=eE(h,s);x===0?(h.next=null,u===null?Zd=b:u.next=b,b===null&&(No=u)):(u=h,(a!==0||(x&3)!==0)&&(Jd=!0)),h=b}nr!==0&&nr!==5||qu(a),Mi!==0&&(Mi=0)}function eE(a,s){for(var u=a.suspendedLanes,h=a.pingedLanes,b=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var k=31-Pe(x),L=1<<k,W=b[k];W===-1?((L&u)===0||(L&h)!==0)&&(b[k]=$t(L,s)):W<=s&&(a.expiredLanes|=L),x&=~L}if(s=pn,u=Ut,u=Pt(a,a===s?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===s&&(on===2||on===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&mn(h),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Je(a,u)){if(s=u&-u,s===a.callbackPriority)return s;switch(h!==null&&mn(h),za(u)){case 2:case 8:u=ve;break;case 32:u=Ye;break;case 268435456:u=vt;break;default:u=Ye}return h=tE.bind(null,a),u=zt(u,h),a.callbackPriority=s,a.callbackNode=u,s}return h!==null&&h!==null&&mn(h),a.callbackPriority=2,a.callbackNode=null,2}function tE(a,s){if(nr!==0&&nr!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Kd()&&a.callbackNode!==u)return null;var h=Ut;return h=Pt(a,a===pn?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(My(a,h,s),eE(a,nt()),a.callbackNode!=null&&a.callbackNode===u?tE.bind(null,a):null)}function nE(a,s){if(Kd())return null;My(a,s,!0)}function xN(){RN(function(){(nn&6)!==0?zt(ge,bN):Jy()})}function Cp(){if(Mi===0){var a=ho;a===0&&(a=at,at<<=1,(at&261888)===0&&(at=256)),Mi=a}return Mi}function rE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ss(""+a)}function aE(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 yN(a,s,u,h,b){if(s==="submit"&&u&&u.stateNode===b){var x=rE((b[Fn]||null).action),k=h.submitter;k&&(s=(s=k[Fn]||null)?rE(s.formAction):k.getAttribute("formAction"),s!==null&&(x=s,k=null));var L=new $("action","action",null,h,b);a.push({event:L,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Mi!==0){var W=k?aE(b,k):new FormData(b);qm(u,{pending:!0,data:W,method:b.method,action:x},null,W)}}else typeof x=="function"&&(L.preventDefault(),W=k?aE(b,k):new FormData(b),qm(u,{pending:!0,data:W,method:b.method,action:x},x,W))},currentTarget:b}]})}}for(var Sp=0;Sp<um.length;Sp++){var Np=um[Sp],EN=Np.toLowerCase(),_N=Np[0].toUpperCase()+Np.slice(1);Va(EN,"on"+_N)}Va(jb,"onAnimationEnd"),Va(Mb,"onAnimationIteration"),Va(Pb,"onAnimationStart"),Va("dblclick","onDoubleClick"),Va("focusin","onFocus"),Va("focusout","onBlur"),Va(PS,"onTransitionRun"),Va(BS,"onTransitionStart"),Va(US,"onTransitionCancel"),Va(Bb,"onTransitionEnd"),rs("onMouseEnter",["mouseout","mouseover"]),rs("onMouseLeave",["mouseout","mouseover"]),rs("onPointerEnter",["pointerout","pointerover"]),rs("onPointerLeave",["pointerout","pointerover"]),or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),or("onBeforeInput",["compositionend","keypress","textInput","paste"]),or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="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(" "),TN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function sE(a,s){s=(s&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],b=h.event;h=h.listeners;e:{var x=void 0;if(s)for(var k=h.length-1;0<=k;k--){var L=h[k],W=L.instance,ie=L.currentTarget;if(L=L.listener,W!==x&&b.isPropagationStopped())break e;x=L,b.currentTarget=ie;try{x(b)}catch(be){md(be)}b.currentTarget=null,x=W}else for(k=0;k<h.length;k++){if(L=h[k],W=L.instance,ie=L.currentTarget,L=L.listener,W!==x&&b.isPropagationStopped())break e;x=L,b.currentTarget=ie;try{x(b)}catch(be){md(be)}b.currentTarget=null,x=W}}}}function jt(a,s){var u=s[li];u===void 0&&(u=s[li]=new Set);var h=a+"__bubble";u.has(h)||(iE(s,a,2,!1),u.add(h))}function Ap(a,s,u){var h=0;s&&(h|=4),iE(u,a,h,s)}var ef="_reactListening"+Math.random().toString(36).slice(2);function Rp(a){if(!a[ef]){a[ef]=!0,ks.forEach(function(u){u!=="selectionchange"&&(TN.has(u)||Ap(u,!1,a),Ap(u,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[ef]||(s[ef]=!0,Ap("selectionchange",!1,s))}}function iE(a,s,u,h){switch(jE(s)){case 2:var b=XN;break;case 8:b=KN;break;default:b=Gp}u=b.bind(null,s,u,a),b=void 0,!cl||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),h?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 Lp(a,s,u,h,b){var x=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var L=h.stateNode.containerInfo;if(L===b)break;if(k===4)for(k=h.return;k!==null;){var W=k.tag;if((W===3||W===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;L!==null;){if(k=Jn(L),k===null)return;if(W=k.tag,W===5||W===6||W===26||W===27){h=x=k;continue e}L=L.parentNode}}h=h.return}Ns(function(){var ie=x,be=gi(u),_e=[];e:{var le=Ub.get(a);if(le!==void 0){var fe=$,He=a;switch(a){case"keypress":if(Ls(u)===0)break e;case"keydown":case"keyup":fe=tm;break;case"focusin":He="focus",fe=rn;break;case"focusout":He="blur",fe=rn;break;case"beforeblur":case"afterblur":fe=rn;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":fe=Cn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=ta;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=sd;break;case jb:case Mb:case Pb:fe=Ae;break;case Bb:fe=ld;break;case"scroll":case"scrollend":fe=de;break;case"wheel":fe=ud;break;case"copy":case"cut":case"paste":fe=st;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=xu;break;case"toggle":case"beforetoggle":fe=dd}var ut=(s&4)!==0,fn=!ut&&(a==="scroll"||a==="scrollend"),ee=ut?le!==null?le+"Capture":null:le;ut=[];for(var J=ie,se;J!==null;){var ye=J;if(se=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||se===null||ee===null||(ye=is(J,ee),ye!=null&&ut.push(Wu(J,ye,se))),fn)break;J=J.return}0<ut.length&&(le=new fe(le,He,null,u,be),_e.push({event:le,listeners:ut}))}}if((s&7)===0){e:{if(le=a==="mouseover"||a==="pointerover",fe=a==="mouseout"||a==="pointerout",le&&u!==pi&&(He=u.relatedTarget||u.fromElement)&&(Jn(He)||He[Rn]))break e;if((fe||le)&&(le=be.window===be?be:(le=be.ownerDocument)?le.defaultView||le.parentWindow:window,fe?(He=u.relatedTarget||u.toElement,fe=ie,He=He?Jn(He):null,He!==null&&(fn=l(He),ut=He.tag,He!==fn||ut!==5&&ut!==27&&ut!==6)&&(He=null)):(fe=null,He=ie),fe!==He)){if(ut=Cn,ye="onMouseLeave",ee="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(ut=xu,ye="onPointerLeave",ee="onPointerEnter",J="pointer"),fn=fe==null?le:ns(fe),se=He==null?le:ns(He),le=new ut(ye,J+"leave",fe,u,be),le.target=fn,le.relatedTarget=se,ye=null,Jn(be)===ie&&(ut=new ut(ee,J+"enter",He,u,be),ut.target=se,ut.relatedTarget=fn,ye=ut),fn=ye,fe&&He)t:{for(ut=vN,ee=fe,J=He,se=0,ye=ee;ye;ye=ut(ye))se++;ye=0;for(var et=J;et;et=ut(et))ye++;for(;0<se-ye;)ee=ut(ee),se--;for(;0<ye-se;)J=ut(J),ye--;for(;se--;){if(ee===J||J!==null&&ee===J.alternate){ut=ee;break t}ee=ut(ee),J=ut(J)}ut=null}else ut=null;fe!==null&&lE(_e,le,fe,ut,!1),He!==null&&fn!==null&&lE(_e,fn,He,ut,!0)}}e:{if(le=ie?ns(ie):window,fe=le.nodeName&&le.nodeName.toLowerCase(),fe==="select"||fe==="input"&&le.type==="file")var Zt=Ta;else if(ft(le))if(Ei)Zt=DS;else{Zt=IS;var We=LS}else fe=le.nodeName,!fe||fe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ie&&Ss(ie.elementType)&&(Zt=Ta):Zt=OS;if(Zt&&(Zt=Zt(a,ie))){Ot(_e,Zt,u,be);break e}We&&We(a,le,ie),a==="focusout"&&ie&&le.type==="number"&&ie.memoizedProps.value!=null&&Cs(le,"number",le.value)}switch(We=ie?ns(ie):window,a){case"focusin":(ft(We)||We.contentEditable==="true")&&(ao=We,im=ie,vu=null);break;case"focusout":vu=im=ao=null;break;case"mousedown":lm=!0;break;case"contextmenu":case"mouseup":case"dragend":lm=!1,Ob(_e,u,be);break;case"selectionchange":if(MS)break;case"keydown":case"keyup":Ob(_e,u,be)}var kt;if(no)e:{switch(a){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else ke?I(a,u)&&(Ht="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Ht="onCompositionStart");Ht&&(yu&&u.locale!=="ko"&&(ke||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&ke&&(kt=to()):(Jr=be,xi="value"in Jr?Jr.value:Jr.textContent,ke=!0)),We=tf(ie,Ht),0<We.length&&(Ht=new It(Ht,a,null,u,be),_e.push({event:Ht,listeners:We}),kt?Ht.data=kt:(kt=ae(u),kt!==null&&(Ht.data=kt)))),(kt=hd?Qe(a,u):Xe(a,u))&&(Ht=tf(ie,"onBeforeInput"),0<Ht.length&&(We=new It("onBeforeInput","beforeinput",null,u,be),_e.push({event:We,listeners:Ht}),We.data=kt)),yN(_e,a,ie,u,be)}sE(_e,s)})}function Wu(a,s,u){return{instance:a,listener:s,currentTarget:u}}function tf(a,s){for(var u=s+"Capture",h=[];a!==null;){var b=a,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=is(a,u),b!=null&&h.unshift(Wu(a,b,x)),b=is(a,s),b!=null&&h.push(Wu(a,b,x))),a.tag===3)return h;a=a.return}return[]}function vN(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function lE(a,s,u,h,b){for(var x=s._reactName,k=[];u!==null&&u!==h;){var L=u,W=L.alternate,ie=L.stateNode;if(L=L.tag,W!==null&&W===h)break;L!==5&&L!==26&&L!==27||ie===null||(W=ie,b?(ie=is(u,x),ie!=null&&k.unshift(Wu(u,ie,W))):b||(ie=is(u,x),ie!=null&&k.push(Wu(u,ie,W)))),u=u.return}k.length!==0&&a.push({event:s,listeners:k})}var kN=/\r\n?/g,wN=/\u0000|\uFFFD/g;function oE(a){return(typeof a=="string"?a:""+a).replace(kN,`
|
|
50
|
+
`).replace(wN,"")}function uE(a,s){return s=oE(s),oE(a)===s}function dn(a,s,u,h,b,x){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||pr(a,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&pr(a,""+h);break;case"className":Vn(a,"class",h);break;case"tabIndex":Vn(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Vn(a,u,h);break;case"style":hi(a,h,x);break;case"data":if(s!=="object"){Vn(a,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=ss(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="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 x=="function"&&(u==="formAction"?(s!=="input"&&dn(a,s,"name",b.name,b,null),dn(a,s,"formEncType",b.formEncType,b,null),dn(a,s,"formMethod",b.formMethod,b,null),dn(a,s,"formTarget",b.formTarget,b,null)):(dn(a,s,"encType",b.encType,b,null),dn(a,s,"method",b.method,b,null),dn(a,s,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=ss(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Lr);break;case"onScroll":h!=null&&jt("scroll",a);break;case"onScrollEnd":h!=null&&jt("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=ss(""+h),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":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":jt("beforetoggle",a),jt("toggle",a),ba(a,"popover",h);break;case"xlinkActuate":er(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":er(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":er(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":er(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":er(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":er(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":er(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":er(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":er(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ba(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=mi.get(u)||u,ba(a,u,h))}}function Ip(a,s,u,h,b,x){switch(u){case"style":hi(a,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof h=="string"?pr(a,h):(typeof h=="number"||typeof h=="bigint")&&pr(a,""+h);break;case"onScroll":h!=null&&jt("scroll",a);break;case"onScrollEnd":h!=null&&jt("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ol.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),x=a[Fn]||null,x=x!=null?x[u]:null,typeof x=="function"&&a.removeEventListener(s,x,b),typeof h=="function")){typeof x!="function"&&x!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(s,h,b);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):ba(a,u,h)}}}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":jt("error",a),jt("load",a);var h=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var k=u[x];if(k!=null)switch(x){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:dn(a,s,x,k,u,null)}}b&&dn(a,s,"srcSet",u.srcSet,u,null),h&&dn(a,s,"src",u.src,u,null);return;case"input":jt("invalid",a);var L=x=k=b=null,W=null,ie=null;for(h in u)if(u.hasOwnProperty(h)){var be=u[h];if(be!=null)switch(h){case"name":b=be;break;case"type":k=be;break;case"checked":W=be;break;case"defaultChecked":ie=be;break;case"value":x=be;break;case"defaultValue":L=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:dn(a,s,h,be,u,null)}}di(a,x,L,W,ie,k,b,!1);return;case"select":jt("invalid",a),h=k=x=null;for(b in u)if(u.hasOwnProperty(b)&&(L=u[b],L!=null))switch(b){case"value":x=L;break;case"defaultValue":k=L;break;case"multiple":h=L;default:dn(a,s,b,L,u,null)}s=x,u=k,a.multiple=!!h,s!=null?Ur(a,!!h,s,!1):u!=null&&Ur(a,!!h,u,!0);return;case"textarea":jt("invalid",a),x=b=h=null;for(k in u)if(u.hasOwnProperty(k)&&(L=u[k],L!=null))switch(k){case"value":h=L;break;case"defaultValue":b=L;break;case"children":x=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:dn(a,s,k,L,u,null)}xa(a,h,b,x);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(h=u[W],h!=null))switch(W){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:dn(a,s,W,h,u,null)}return;case"dialog":jt("beforetoggle",a),jt("toggle",a),jt("cancel",a),jt("close",a);break;case"iframe":case"object":jt("load",a);break;case"video":case"audio":for(h=0;h<Yu.length;h++)jt(Yu[h],a);break;case"image":jt("error",a),jt("load",a);break;case"details":jt("toggle",a);break;case"embed":case"source":case"link":jt("error",a),jt("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)&&(h=u[ie],h!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:dn(a,s,ie,h,u,null)}return;default:if(Ss(s)){for(be in u)u.hasOwnProperty(be)&&(h=u[be],h!==void 0&&Ip(a,s,be,h,u,void 0));return}}for(L in u)u.hasOwnProperty(L)&&(h=u[L],h!=null&&dn(a,s,L,h,u,null))}function CN(a,s,u,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,k=null,L=null,W=null,ie=null,be=null;for(fe in u){var _e=u[fe];if(u.hasOwnProperty(fe)&&_e!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":W=_e;default:h.hasOwnProperty(fe)||dn(a,s,fe,null,h,_e)}}for(var le in h){var fe=h[le];if(_e=u[le],h.hasOwnProperty(le)&&(fe!=null||_e!=null))switch(le){case"type":x=fe;break;case"name":b=fe;break;case"checked":ie=fe;break;case"defaultChecked":be=fe;break;case"value":k=fe;break;case"defaultValue":L=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,s));break;default:fe!==_e&&dn(a,s,le,fe,h,_e)}}Zr(a,k,L,W,ie,be,x,b);return;case"select":fe=k=L=le=null;for(x in u)if(W=u[x],u.hasOwnProperty(x)&&W!=null)switch(x){case"value":break;case"multiple":fe=W;default:h.hasOwnProperty(x)||dn(a,s,x,null,h,W)}for(b in h)if(x=h[b],W=u[b],h.hasOwnProperty(b)&&(x!=null||W!=null))switch(b){case"value":le=x;break;case"defaultValue":L=x;break;case"multiple":k=x;default:x!==W&&dn(a,s,b,x,h,W)}s=L,u=k,h=fe,le!=null?Ur(a,!!u,le,!1):!!h!=!!u&&(s!=null?Ur(a,!!u,s,!0):Ur(a,!!u,u?[]:"",!1));return;case"textarea":fe=le=null;for(L in u)if(b=u[L],u.hasOwnProperty(L)&&b!=null&&!h.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:dn(a,s,L,null,h,b)}for(k in h)if(b=h[k],x=u[k],h.hasOwnProperty(k)&&(b!=null||x!=null))switch(k){case"value":le=b;break;case"defaultValue":fe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&dn(a,s,k,b,h,x)}en(a,le,fe);return;case"option":for(var He in u)if(le=u[He],u.hasOwnProperty(He)&&le!=null&&!h.hasOwnProperty(He))switch(He){case"selected":a.selected=!1;break;default:dn(a,s,He,null,h,le)}for(W in h)if(le=h[W],fe=u[W],h.hasOwnProperty(W)&&le!==fe&&(le!=null||fe!=null))switch(W){case"selected":a.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:dn(a,s,W,le,h,fe)}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 ut in u)le=u[ut],u.hasOwnProperty(ut)&&le!=null&&!h.hasOwnProperty(ut)&&dn(a,s,ut,null,h,le);for(ie in h)if(le=h[ie],fe=u[ie],h.hasOwnProperty(ie)&&le!==fe&&(le!=null||fe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,s));break;default:dn(a,s,ie,le,h,fe)}return;default:if(Ss(s)){for(var fn in u)le=u[fn],u.hasOwnProperty(fn)&&le!==void 0&&!h.hasOwnProperty(fn)&&Ip(a,s,fn,void 0,h,le);for(be in h)le=h[be],fe=u[be],!h.hasOwnProperty(be)||le===fe||le===void 0&&fe===void 0||Ip(a,s,be,le,h,fe);return}}for(var ee in u)le=u[ee],u.hasOwnProperty(ee)&&le!=null&&!h.hasOwnProperty(ee)&&dn(a,s,ee,null,h,le);for(_e in h)le=h[_e],fe=u[_e],!h.hasOwnProperty(_e)||le===fe||le==null&&fe==null||dn(a,s,_e,le,h,fe)}function cE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SN(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var b=u[h],x=b.transferSize,k=b.initiatorType,L=b.duration;if(x&&L&&cE(k)){for(k=0,L=b.responseEnd,h+=1;h<u.length;h++){var W=u[h],ie=W.startTime;if(ie>L)break;var be=W.transferSize,_e=W.initiatorType;be&&cE(_e)&&(W=W.responseEnd,k+=be*(W<L?1:(L-ie)/(W-ie)))}if(--h,s+=8*(x+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 Op=null,Dp=null;function nf(a){return a.nodeType===9?a:a.ownerDocument}function dE(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 fE(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 jp(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 Mp=null;function NN(){var a=window.event;return a&&a.type==="popstate"?a===Mp?!1:(Mp=a,!0):(Mp=null,!1)}var hE=typeof setTimeout=="function"?setTimeout:void 0,AN=typeof clearTimeout=="function"?clearTimeout:void 0,mE=typeof Promise=="function"?Promise:void 0,RN=typeof queueMicrotask=="function"?queueMicrotask:typeof mE<"u"?function(a){return mE.resolve(null).then(a).catch(LN)}:hE;function LN(a){setTimeout(function(){throw a})}function Pi(a){return a==="head"}function pE(a,s){var u=s,h=0;do{var b=u.nextSibling;if(a.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(h===0){a.removeChild(b),Io(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Qu(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Qu(u);for(var x=u.firstChild;x;){var k=x.nextSibling,L=x.nodeName;x[Mn]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=k}}else u==="body"&&Qu(a.ownerDocument.body);u=b}while(u);Io(s)}function gE(a,s){var u=a;a=0;do{var h=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||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=h}while(u)}function Pp(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":Pp(u),pa(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function IN(a,s,u,h){for(;a.nodeType===1;){var b=u;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Mn])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==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(x=a.getAttribute("src"),(x!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=Aa(a.nextSibling),a===null)break}return null}function ON(a,s,u){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Aa(a.nextSibling),a===null))return null;return a}function bE(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=Aa(a.nextSibling),a===null))return null;return a}function Bp(a){return a.data==="$?"||a.data==="$~"}function Up(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function DN(a,s){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function Aa(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 Hp=null;function xE(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(s===0)return Aa(a.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}a=a.nextSibling}return null}function yE(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 EE(a,s,u){switch(s=nf(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 Qu(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);pa(a)}var Ra=new Map,_E=new Set;function rf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ys=F.d;F.d={f:jN,r:MN,D:PN,C:BN,L:UN,m:HN,X:FN,S:zN,M:$N};function jN(){var a=Ys.f(),s=Wd();return a||s}function MN(a){var s=$n(a);s!==null&&s.tag===5&&s.type==="form"?Bx(s):Ys.r(a)}var Ao=typeof document>"u"?null:document;function TE(a,s,u){var h=Ao;if(h&&typeof s=="string"&&s){var b=Tr(s);b='link[rel="'+a+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),_E.has(b)||(_E.add(b),a={rel:a,crossOrigin:u,href:s},h.querySelector(b)===null&&(s=h.createElement("link"),yr(s,"link",a),_n(s),h.head.appendChild(s)))}}function PN(a){Ys.D(a),TE("dns-prefetch",a,null)}function BN(a,s){Ys.C(a,s),TE("preconnect",a,s)}function UN(a,s,u){Ys.L(a,s,u);var h=Ao;if(h&&a&&s){var b='link[rel="preload"][as="'+Tr(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+Tr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+Tr(u.imageSizes)+'"]')):b+='[href="'+Tr(a)+'"]';var x=b;switch(s){case"style":x=Ro(a);break;case"script":x=Lo(a)}Ra.has(x)||(a=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:a,as:s},u),Ra.set(x,a),h.querySelector(b)!==null||s==="style"&&h.querySelector(Xu(x))||s==="script"&&h.querySelector(Ku(x))||(s=h.createElement("link"),yr(s,"link",a),_n(s),h.head.appendChild(s)))}}function HN(a,s){Ys.m(a,s);var u=Ao;if(u&&a){var h=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+Tr(h)+'"][href="'+Tr(a)+'"]',x=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Lo(a)}if(!Ra.has(x)&&(a=g({rel:"modulepreload",href:a},s),Ra.set(x,a),u.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ku(x)))return}h=u.createElement("link"),yr(h,"link",a),_n(h),u.head.appendChild(h)}}}function zN(a,s,u){Ys.S(a,s,u);var h=Ao;if(h&&a){var b=ga(h).hoistableStyles,x=Ro(a);s=s||"default";var k=b.get(x);if(!k){var L={loading:0,preload:null};if(k=h.querySelector(Xu(x)))L.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":s},u),(u=Ra.get(x))&&zp(a,u);var W=k=h.createElement("link");_n(W),yr(W,"link",a),W._p=new Promise(function(ie,be){W.onload=ie,W.onerror=be}),W.addEventListener("load",function(){L.loading|=1}),W.addEventListener("error",function(){L.loading|=2}),L.loading|=4,af(k,s,h)}k={type:"stylesheet",instance:k,count:1,state:L},b.set(x,k)}}}function FN(a,s){Ys.X(a,s);var u=Ao;if(u&&a){var h=ga(u).hoistableScripts,b=Lo(a),x=h.get(b);x||(x=u.querySelector(Ku(b)),x||(a=g({src:a,async:!0},s),(s=Ra.get(b))&&Fp(a,s),x=u.createElement("script"),_n(x),yr(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(b,x))}}function $N(a,s){Ys.M(a,s);var u=Ao;if(u&&a){var h=ga(u).hoistableScripts,b=Lo(a),x=h.get(b);x||(x=u.querySelector(Ku(b)),x||(a=g({src:a,async:!0,type:"module"},s),(s=Ra.get(b))&&Fp(a,s),x=u.createElement("script"),_n(x),yr(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(b,x))}}function vE(a,s,u,h){var b=(b=Se.current)?rf(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=Ro(u.href),u=ga(b).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Ro(u.href);var x=ga(b).hoistableStyles,k=x.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,k),(x=b.querySelector(Xu(a)))&&!x._p&&(k.instance=x,k.state.loading=5),Ra.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},Ra.set(a,u),x||VN(b,a,u,k.state))),s&&h===null)throw Error(r(528,""));return k}if(s&&h!==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=Lo(u),u=ga(b).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Ro(a){return'href="'+Tr(a)+'"'}function Xu(a){return'link[rel="stylesheet"]['+a+"]"}function kE(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function VN(a,s,u,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),yr(s,"link",u),_n(s),a.head.appendChild(s))}function Lo(a){return'[src="'+Tr(a)+'"]'}function Ku(a){return"script[async]"+a}function wE(a,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+Tr(u.href)+'"]');if(h)return s.instance=h,_n(h),h;var b=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),_n(h),yr(h,"style",b),af(h,u.precedence,a),s.instance=h;case"stylesheet":b=Ro(u.href);var x=a.querySelector(Xu(b));if(x)return s.state.loading|=4,s.instance=x,_n(x),x;h=kE(u),(b=Ra.get(b))&&zp(h,b),x=(a.ownerDocument||a).createElement("link"),_n(x);var k=x;return k._p=new Promise(function(L,W){k.onload=L,k.onerror=W}),yr(x,"link",h),s.state.loading|=4,af(x,u.precedence,a),s.instance=x;case"script":return x=Lo(u.src),(b=a.querySelector(Ku(x)))?(s.instance=b,_n(b),b):(h=u,(b=Ra.get(x))&&(h=g({},u),Fp(h,b)),a=a.ownerDocument||a,b=a.createElement("script"),_n(b),yr(b,"link",h),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&&(h=s.instance,s.state.loading|=4,af(h,u.precedence,a));return s.instance}function af(a,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,x=b,k=0;k<h.length;k++){var L=h[k];if(L.dataset.precedence===s)x=L;else if(x!==b)break}x?x.parentNode.insertBefore(a,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(a,s.firstChild))}function zp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Fp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var sf=null;function CE(a,s,u){if(sf===null){var h=new Map,b=sf=new Map;b.set(u,h)}else b=sf,h=b.get(u),h||(h=new Map,b.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),b=0;b<u.length;b++){var x=u[b];if(!(x[Mn]||x[sn]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(s)||"";k=a+k;var L=h.get(k);L?L.push(x):h.set(k,[x])}}return h}function SE(a,s,u){a=a.ownerDocument||a,a.head.insertBefore(u,s==="title"?a.querySelector("head > title"):null)}function GN(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 NE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function qN(a,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Ro(h.href),x=s.querySelector(Xu(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=lf.bind(a),s.then(a,a)),u.state.loading|=4,u.instance=x,_n(x);return}x=s.ownerDocument||s,h=kE(h),(b=Ra.get(b))&&zp(h,b),x=x.createElement("link"),_n(x);var k=x;k._p=new Promise(function(L,W){k.onload=L,k.onerror=W}),yr(x,"link",h),u.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=lf.bind(a),s.addEventListener("load",u),s.addEventListener("error",u))}}var $p=0;function YN(a,s){return a.stylesheets&&a.count===0&&uf(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&uf(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+s);0<a.imgBytes&&$p===0&&($p=62500*SN());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&uf(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>$p?50:800)+s);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function lf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uf(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var of=null;function uf(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,of=new Map,s.forEach(WN,a),of=null,lf.call(a))}function WN(a,s){if(!(s.state.loading&4)){var u=of.get(a);if(u)var h=u.get(null);else{u=new Map,of.set(a,u);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var k=b[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(u.set(k.dataset.precedence,k),h=k)}h&&u.set(null,h)}b=s.instance,k=b.getAttribute("data-precedence"),x=u.get(k)||h,x===h&&u.set(null,b),u.set(k,b),this.count++,h=lf.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),x?x.parentNode.insertBefore(b,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),s.state.loading|=4}}var Zu={$$typeof:A,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function QN(a,s,u,h,b,x,k,L,W){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=Br(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Br(0),this.hiddenUpdates=Br(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function AE(a,s,u,h,b,x,k,L,W,ie,be,_e){return a=new QN(a,s,u,k,W,ie,be,_e,L),s=1,x===!0&&(s|=24),x=ra(3,null,null,s),a.current=x,x.stateNode=a,s=Tm(),s.refCount++,a.pooledCache=s,s.refCount++,x.memoizedState={element:h,isDehydrated:u,cache:s},Cm(x),a}function RE(a){return a?(a=lo,a):lo}function LE(a,s,u,h,b,x){b=RE(b),h.context===null?h.context=b:h.pendingContext=b,h=Ci(s),h.payload={element:u},x=x===void 0?null:x,x!==null&&(h.callback=x),u=Si(a,h,s),u!==null&&(Gr(u,a,s),Ru(u,a,s))}function IE(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<s?u:s}}function Vp(a,s){IE(a,s),(a=a.alternate)&&IE(a,s)}function OE(a){if(a.tag===13||a.tag===31){var s=ml(a,67108864);s!==null&&Gr(s,a,67108864),Vp(a,67108864)}}function DE(a){if(a.tag===13||a.tag===31){var s=oa();s=ma(s);var u=ml(a,s);u!==null&&Gr(u,a,s),Vp(a,s)}}var cf=!0;function XN(a,s,u,h){var b=H.T;H.T=null;var x=F.p;try{F.p=2,Gp(a,s,u,h)}finally{F.p=x,H.T=b}}function KN(a,s,u,h){var b=H.T;H.T=null;var x=F.p;try{F.p=8,Gp(a,s,u,h)}finally{F.p=x,H.T=b}}function Gp(a,s,u,h){if(cf){var b=qp(h);if(b===null)Lp(a,s,h,df,u),ME(a,h);else if(JN(b,a,s,u,h))h.stopPropagation();else if(ME(a,h),s&4&&-1<ZN.indexOf(a)){for(;b!==null;){var x=$n(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=gt(x.pendingLanes);if(k!==0){var L=x;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var W=1<<31-Pe(k);L.entanglements[1]|=W,k&=~W}cs(x),(nn&6)===0&&(qd=nt()+500,qu(0))}}break;case 31:case 13:L=ml(x,2),L!==null&&Gr(L,x,2),Wd(),Vp(x,2)}if(x=qp(h),x===null&&Lp(a,s,h,df,u),x===b)break;b=x}b!==null&&h.stopPropagation()}else Lp(a,s,h,null,u)}}function qp(a){return a=gi(a),Yp(a)}var df=null;function Yp(a){if(df=null,a=Jn(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 df=a,null}function jE(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(lr()){case ge:return 2;case ve:return 8;case Ye:case rt:return 32;case vt:return 268435456;default:return 32}default:return 32}}var Wp=!1,Bi=null,Ui=null,Hi=null,Ju=new Map,ec=new Map,zi=[],ZN="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 ME(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":Ju.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":ec.delete(s.pointerId)}}function tc(a,s,u,h,b,x){return a===null||a.nativeEvent!==x?(a={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[b]},s!==null&&(s=$n(s),s!==null&&OE(s)),a):(a.eventSystemFlags|=h,s=a.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),a)}function JN(a,s,u,h,b){switch(s){case"focusin":return Bi=tc(Bi,a,s,u,h,b),!0;case"dragenter":return Ui=tc(Ui,a,s,u,h,b),!0;case"mouseover":return Hi=tc(Hi,a,s,u,h,b),!0;case"pointerover":var x=b.pointerId;return Ju.set(x,tc(Ju.get(x)||null,a,s,u,h,b)),!0;case"gotpointercapture":return x=b.pointerId,ec.set(x,tc(ec.get(x)||null,a,s,u,h,b)),!0}return!1}function PE(a){var s=Jn(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,ll(a.priority,function(){DE(u)});return}}else if(s===31){if(s=c(u),s!==null){a.blockedOn=s,ll(a.priority,function(){DE(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 ff(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var u=qp(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);pi=h,u.target.dispatchEvent(h),pi=null}else return s=$n(u),s!==null&&OE(s),a.blockedOn=u,!1;s.shift()}return!0}function BE(a,s,u){ff(a)&&u.delete(s)}function eA(){Wp=!1,Bi!==null&&ff(Bi)&&(Bi=null),Ui!==null&&ff(Ui)&&(Ui=null),Hi!==null&&ff(Hi)&&(Hi=null),Ju.forEach(BE),ec.forEach(BE)}function hf(a,s){a.blockedOn===s&&(a.blockedOn=null,Wp||(Wp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eA)))}var mf=null;function UE(a){mf!==a&&(mf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mf===a&&(mf=null);for(var s=0;s<a.length;s+=3){var u=a[s],h=a[s+1],b=a[s+2];if(typeof h!="function"){if(Yp(h||u)===null)continue;break}var x=$n(u);x!==null&&(a.splice(s,3),s-=3,qm(x,{pending:!0,data:b,method:u.method,action:h},h,b))}}))}function Io(a){function s(W){return hf(W,a)}Bi!==null&&hf(Bi,a),Ui!==null&&hf(Ui,a),Hi!==null&&hf(Hi,a),Ju.forEach(s),ec.forEach(s);for(var u=0;u<zi.length;u++){var h=zi[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<zi.length&&(u=zi[0],u.blockedOn===null);)PE(u),u.blockedOn===null&&zi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var b=u[h],x=u[h+1],k=b[Fn]||null;if(typeof x=="function")k||UE(u);else if(k){var L=null;if(x&&x.hasAttribute("formAction")){if(b=x,k=x[Fn]||null)L=k.formAction;else if(Yp(b)!==null)continue}else L=k.action;typeof L=="function"?u[h+1]=L:(u.splice(h,3),h-=3),UE(u)}}}function HE(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Qp(a){this._internalRoot=a}pf.prototype.render=Qp.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,h=oa();LE(u,h,a,s,null,null)},pf.prototype.unmount=Qp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;LE(a.current,2,null,a,null,null),Wd(),s[Rn]=null}};function pf(a){this._internalRoot=a}pf.prototype.unstable_scheduleHydration=function(a){if(a){var s=eo();a={blockedOn:null,target:a,priority:s};for(var u=0;u<zi.length&&s!==0&&s<zi[u].priority;u++);zi.splice(u,0,a),u===0&&PE(a)}};var zE=t.version;if(zE!=="19.2.5")throw Error(r(527,zE,"19.2.5"));F.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=m(s),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var tA={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gf.isDisabled&&gf.supportsFiber)try{xe=gf.inject(tA),Oe=gf}catch{}}return rc.createRoot=function(a,s){if(!i(a))throw Error(r(299));var u=!1,h="",b=Wx,x=Qx,k=Xx;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError)),s=AE(a,1,!1,null,null,u,h,null,b,x,k,HE),a[Rn]=s.current,Rp(a),new Qp(s)},rc.hydrateRoot=function(a,s,u){if(!i(a))throw Error(r(299));var h=!1,b="",x=Wx,k=Qx,L=Xx,W=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(L=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),s=AE(a,1,!0,s,u??null,h,b,W,x,k,L,HE),s.context=RE(null),u=s.current,h=oa(),h=ma(h),b=Ci(h),b.callback=null,Si(u,b,h),u=h,s.current.lanes=u,Yt(s,u),cs(s),a[Rn]=s.current,Rp(a),new pf(s)},rc.version="19.2.5",rc}var JE;function pA(){if(JE)return e0.exports;JE=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(),e0.exports=mA(),e0.exports}var gA=pA();const bA=Sh(gA);/**
|
|
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 e2="popstate";function t2(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function xA(e={}){function t(r,i){var m;let l=(m=i.state)==null?void 0:m.masked,{pathname:o,search:c,hash:d}=l||r.location;return lg("",{pathname:o,search:c,hash:d},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:jc(i)}return EA(t,n,null,e)}function An(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ba(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yA(){return Math.random().toString(36).substring(2,10)}function n2(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 lg(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?nu(t):t,state:n,key:t&&t.key||r||yA(),unstable_mask:i}}function jc({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 nu(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 EA(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,c="POP",d=null,m=p();m==null&&(m=0,o.replaceState({...o.state,idx:m},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let C=p(),S=C==null?null:C-m;m=C,d&&d({action:c,location:w.location,delta:S})}function y(C,S){c="PUSH";let N=t2(C)?C:lg(w.location,C,S);m=p()+1;let A=n2(N,m),z=w.createHref(N.unstable_mask||N);try{o.pushState(A,"",z)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;i.location.assign(z)}l&&d&&d({action:c,location:w.location,delta:1})}function E(C,S){c="REPLACE";let N=t2(C)?C:lg(w.location,C,S);m=p();let A=n2(N,m),z=w.createHref(N.unstable_mask||N);o.replaceState(A,"",z),l&&d&&d({action:c,location:w.location,delta:0})}function v(C){return _A(C)}let w={get action(){return c},get location(){return e(i,o)},listen(C){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(e2,g),d=C,()=>{i.removeEventListener(e2,g),d=null}},createHref(C){return t(i,C)},createURL:v,encodeLocation(C){let S=v(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:E,go(C){return o.go(C)}};return w}function _A(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),An(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:jc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function vv(e,t,n="/"){return TA(e,t,n,!1)}function TA(e,t,n,r){let i=typeof t=="string"?nu(t):t,l=ni(i.pathname||"/",n);if(l==null)return null;let o=kv(e);vA(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let m=DA(l);c=IA(o[d],m,r)}return c}function kv(e,t=[],n=[],r="",i=!1){let l=(o,c,d=i,m)=>{let p={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;An(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=gs([r,p.relativePath]),y=n.concat(p);o.children&&o.children.length>0&&(An(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),kv(o.children,t,y,g,d)),!(o.path==null&&!o.index)&&t.push({path:g,score:RA(g,o.index),routesMeta:y})};return e.forEach((o,c)=>{var d;if(o.path===""||!((d=o.path)!=null&&d.includes("?")))l(o,c);else for(let m of wv(o.path))l(o,c,!0,m)}),t}function wv(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=wv(r.join("/")),c=[];return c.push(...o.map(d=>d===""?l:[l,d].join("/"))),i&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function vA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var kA=/^:[\w-]+$/,wA=3,CA=2,SA=1,NA=10,AA=-2,r2=e=>e==="*";function RA(e,t){let n=e.split("/"),r=n.length;return n.some(r2)&&(r+=AA),t&&(r+=CA),n.filter(i=>!r2(i)).reduce((i,l)=>i+(kA.test(l)?wA:l===""?SA:NA),r)}function LA(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 IA(e,t,n=!1){let{routesMeta:r}=e,i={},l="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],m=c===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=eh({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},p),y=d.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=eh({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!g)return null;Object.assign(i,g.params),o.push({params:i,pathname:gs([l,g.pathname]),pathnameBase:BA(gs([l,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(l=gs([l,g.pathnameBase]))}return o}function eh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OA(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((m,{paramName:p,isOptional:g},y)=>{if(p==="*"){let v=c[y]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const E=c[y];return g&&!E?m[p]=void 0:m[p]=(E||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:o,pattern:e}}function OA(e,t=!1,n=!0){Ba(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,d,m,p)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let g=p.charAt(m+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 DA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ba(!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 ni(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 jA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function MA(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?nu(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=a2(n.substring(1),"/"):l=a2(n,t)):l=t,{pathname:l,search:UA(r),hash:HA(i)}}function a2(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 a0(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 PA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function u1(e){let t=PA(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Nh(e,t,n,r=!1){let i;typeof e=="string"?i=nu(e):(i={...e},An(!i.pathname||!i.pathname.includes("?"),a0("?","pathname","search",i)),An(!i.pathname||!i.pathname.includes("#"),a0("#","pathname","hash",i)),An(!i.search||!i.search.includes("#"),a0("#","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 y=o.split("/");for(;y[0]==="..";)y.shift(),g-=1;i.pathname=y.join("/")}c=g>=0?t[g]:"/"}let d=MA(i,c),m=o&&o!=="/"&&o.endsWith("/"),p=(l||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||p)&&(d.pathname+="/"),d}var gs=e=>e.join("/").replace(/\/\/+/g,"/"),BA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zA=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 FA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $A(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Cv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Sv(e,t){let n=e;if(typeof n!="string"||!jA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Cv)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=ni(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:i=!0}catch{Ba(!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 Nv=["POST","PUT","PATCH","DELETE"];new Set(Nv);var VA=["GET",...Nv];new Set(VA);var ru=T.createContext(null);ru.displayName="DataRouter";var Ah=T.createContext(null);Ah.displayName="DataRouterState";var Av=T.createContext(!1);function GA(){return T.useContext(Av)}var Rv=T.createContext({isTransitioning:!1});Rv.displayName="ViewTransition";var qA=T.createContext(new Map);qA.displayName="Fetchers";var YA=T.createContext(null);YA.displayName="Await";var fa=T.createContext(null);fa.displayName="Navigation";var qc=T.createContext(null);qc.displayName="Location";var Ha=T.createContext({outlet:null,matches:[],isDataRoute:!1});Ha.displayName="Route";var c1=T.createContext(null);c1.displayName="RouteError";var Lv="REACT_ROUTER_ERROR",WA="REDIRECT",QA="ROUTE_ERROR_RESPONSE";function XA(e){if(e.startsWith(`${Lv}:${WA}:{`))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 KA(e){if(e.startsWith(`${Lv}:${QA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new zA(t.status,t.statusText,t.data)}catch{}}function ZA(e,{relative:t}={}){An(au(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(fa),{hash:i,pathname:l,search:o}=Yc(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:gs([n,l])),r.createHref({pathname:c,search:o,hash:i})}function au(){return T.useContext(qc)!=null}function ha(){return An(au(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(qc).location}var Iv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ov(e){T.useContext(fa).static||T.useLayoutEffect(e)}function Za(){let{isDataRoute:e}=T.useContext(Ha);return e?m5():JA()}function JA(){An(au(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(ru),{basename:t,navigator:n}=T.useContext(fa),{matches:r}=T.useContext(Ha),{pathname:i}=ha(),l=JSON.stringify(u1(r)),o=T.useRef(!1);return Ov(()=>{o.current=!0}),T.useCallback((d,m={})=>{if(Ba(o.current,Iv),!o.current)return;if(typeof d=="number"){n.go(d);return}let p=Nh(d,JSON.parse(l),i,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:gs([t,p.pathname])),(m.replace?n.replace:n.push)(p,m.state,m)},[t,n,l,i,e])}var e5=T.createContext(null);function t5(e){let t=T.useContext(Ha).outlet;return T.useMemo(()=>t&&T.createElement(e5.Provider,{value:e},t),[t,e])}function n5(){let{matches:e}=T.useContext(Ha),t=e[e.length-1];return t?t.params:{}}function Yc(e,{relative:t}={}){let{matches:n}=T.useContext(Ha),{pathname:r}=ha(),i=JSON.stringify(u1(n));return T.useMemo(()=>Nh(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function r5(e,t){return Dv(e,t)}function Dv(e,t,n){var C;An(au(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(fa),{matches:i}=T.useContext(Ha),l=i[i.length-1],o=l?l.params:{},c=l?l.pathname:"/",d=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";Mv(c,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=ha(),g;if(t){let S=typeof t=="string"?nu(t):t;An(d==="/"||((C=S.pathname)==null?void 0:C.startsWith(d)),`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 "${d}" but pathname "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=p;let y=g.pathname||"/",E=y;if(d!=="/"){let S=d.replace(/^\//,"").split("/");E="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=vv(e,{pathname:E});Ba(m||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ba(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 w=o5(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:gs([d,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?d:gs([d,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,n);return t&&w?T.createElement(qc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function a5(){let e=h5(),t=FA(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 s5=T.createElement(a5,null),jv=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=KA(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(Ha.Provider,{value:this.props.routeContext},T.createElement(c1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(i5,{error:e},t):t}};jv.contextType=Av;var s0=new WeakMap;function i5({children:e,error:t}){let{basename:n}=T.useContext(fa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=XA(t.digest);if(r){let i=s0.get(t);if(i)throw i;let l=Sv(r.location,n);if(Cv&&!s0.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 s0.set(t,o),o}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function l5({routeContext:e,match:t,children:n}){let r=T.useContext(ru);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(Ha.Provider,{value:e},n)}function o5(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);An(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:y,errors:E}=r,v=g.route.loader&&!y.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 d=n==null?void 0:n.onError,m=r&&d?(p,g)=>{var y,E;d(p,{location:r.location,params:((E=(y=r.matches)==null?void 0:y[0])==null?void 0:E.params)??{},unstable_pattern:$A(r.matches),errorInfo:g})}:void 0;return i.reduceRight((p,g,y)=>{let E,v=!1,w=null,C=null;r&&(E=l&&g.route.id?l[g.route.id]:void 0,w=g.route.errorElement||s5,o&&(c<0&&y===0?(Mv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,C=null):c===y&&(v=!0,C=g.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,y+1)),N=()=>{let A;return E?A=w:v?A=C:g.route.Component?A=T.createElement(g.route.Component,null):g.route.element?A=g.route.element:A=p,T.createElement(l5,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:A})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?T.createElement(jv,{location:r.location,revalidation:r.revalidation,component:w,error:E,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):N()},null)}function d1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function u5(e){let t=T.useContext(ru);return An(t,d1(e)),t}function c5(e){let t=T.useContext(Ah);return An(t,d1(e)),t}function d5(e){let t=T.useContext(Ha);return An(t,d1(e)),t}function f1(e){let t=d5(e),n=t.matches[t.matches.length-1];return An(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function f5(){return f1("useRouteId")}function h5(){var r;let e=T.useContext(c1),t=c5("useRouteError"),n=f1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function m5(){let{router:e}=u5("useNavigate"),t=f1("useNavigate"),n=T.useRef(!1);return Ov(()=>{n.current=!0}),T.useCallback(async(i,l={})=>{Ba(n.current,Iv),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var s2={};function Mv(e,t,n){!t&&!s2[e]&&(s2[e]=!0,Ba(!1,n))}T.memo(p5);function p5({routes:e,future:t,state:n,isStatic:r,onError:i}){return Dv(e,void 0,{state:n,isStatic:r,onError:i})}function g5({to:e,replace:t,state:n,relative:r}){An(au(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=T.useContext(fa);Ba(!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(Ha),{pathname:o}=ha(),c=Za(),d=Nh(e,u1(l),o,r==="path"),m=JSON.stringify(d);return T.useEffect(()=>{c(JSON.parse(m),{replace:t,state:n,relative:r})},[c,m,r,t,n]),null}function b5(e){return t5(e.context)}function Ks(e){An(!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 x5({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:l=!1,unstable_useTransitions:o}){An(!au(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=T.useMemo(()=>({basename:c,navigator:i,static:l,unstable_useTransitions:o,future:{}}),[c,i,l,o]);typeof n=="string"&&(n=nu(n));let{pathname:m="/",search:p="",hash:g="",state:y=null,key:E="default",unstable_mask:v}=n,w=T.useMemo(()=>{let C=ni(m,c);return C==null?null:{location:{pathname:C,search:p,hash:g,state:y,key:E,unstable_mask:v},navigationType:r}},[c,m,p,g,y,E,r,v]);return Ba(w!=null,`<Router basename="${c}"> is not able to match the URL "${m}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:T.createElement(fa.Provider,{value:d},T.createElement(qc.Provider,{children:t,value:w}))}function y5({children:e,location:t}){return r5(og(e),t)}function og(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,og(r.props.children,l));return}An(r.type===Ks,`[${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>`),An(!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=og(r.props.children,l)),n.push(o)}),n}var $f="get",Vf="application/x-www-form-urlencoded";function Rh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function E5(e){return Rh(e)&&e.tagName.toLowerCase()==="button"}function _5(e){return Rh(e)&&e.tagName.toLowerCase()==="form"}function T5(e){return Rh(e)&&e.tagName.toLowerCase()==="input"}function v5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function k5(e,t){return e.button===0&&(!t||t==="_self")&&!v5(e)}function ug(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 w5(e,t){let n=ug(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var bf=null;function C5(){if(bf===null)try{new FormData(document.createElement("form"),0),bf=!1}catch{bf=!0}return bf}var S5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function i0(e){return e!=null&&!S5.has(e)?(Ba(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vf}"`),null):e}function N5(e,t){let n,r,i,l,o;if(_5(e)){let c=e.getAttribute("action");r=c?ni(c,t):null,n=e.getAttribute("method")||$f,i=i0(e.getAttribute("enctype"))||Vf,l=new FormData(e)}else if(E5(e)||T5(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 d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?ni(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||$f,i=i0(e.getAttribute("formenctype"))||i0(c.getAttribute("enctype"))||Vf,l=new FormData(c,e),!C5()){let{name:m,type:p,value:g}=e;if(p==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,g)}}else{if(Rh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=$f,r=null,i=Vf,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 h1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Pv(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&&ni(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function A5(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 R5(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 L5(e,t,n){let r=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let o=await A5(l,n);return o.links?o.links():[]}return[]}));return j5(r.flat(1).filter(R5).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function i2(e,t,n,r,i,l){let o=(d,m)=>n[m]?d.route.id!==n[m].route.id:!0,c=(d,m)=>{var p;return n[m].pathname!==d.pathname||((p=n[m].route.path)==null?void 0:p.endsWith("*"))&&n[m].params["*"]!==d.params["*"]};return l==="assets"?t.filter((d,m)=>o(d,m)||c(d,m)):l==="data"?t.filter((d,m)=>{var g;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(o(d,m)||c(d,m))return!0;if(d.route.shouldRevalidate){let y=d.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:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function I5(e,t,{includeHydrateFallback:n}={}){return O5(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 O5(e){return[...new Set(e)]}function D5(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function j5(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let l=JSON.stringify(D5(i));return n.has(l)||(n.add(l),r.push({key:l,link:i})),r},[])}function m1(){let e=T.useContext(ru);return h1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function M5(){let e=T.useContext(Ah);return h1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var p1=T.createContext(void 0);p1.displayName="FrameworkContext";function g1(){let e=T.useContext(p1);return h1(e,"You must render this element inside a <HydratedRouter> element"),e}function P5(e,t){let n=T.useContext(p1),[r,i]=T.useState(!1),[l,o]=T.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:m,onMouseLeave:p,onTouchStart:g}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=S=>{S.forEach(N=>{o(N.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),T.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let E=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:ac(c,E),onBlur:ac(d,v),onMouseEnter:ac(m,E),onMouseLeave:ac(p,v),onTouchStart:ac(g,E)}]:[!1,y,{}]}function ac(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function B5({page:e,...t}){let n=GA(),{router:r}=m1(),i=T.useMemo(()=>vv(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?T.createElement(H5,{page:e,matches:i,...t}):T.createElement(z5,{page:e,matches:i,...t}):null}function U5(e){let{manifest:t,routeModules:n}=g1(),[r,i]=T.useState([]);return T.useEffect(()=>{let l=!1;return L5(e,t,n).then(o=>{l||i(o)}),()=>{l=!0}},[e,t,n]),r}function H5({page:e,matches:t,...n}){let r=ha(),{future:i}=g1(),{basename:l}=m1(),o=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let c=Pv(e,l,i.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,m=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:m.push(p.route.id);return d&&m.length>0&&c.searchParams.set("_routes",m.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 z5({page:e,matches:t,...n}){let r=ha(),{future:i,manifest:l,routeModules:o}=g1(),{basename:c}=m1(),{loaderData:d,matches:m}=M5(),p=T.useMemo(()=>i2(e,t,m,l,r,"data"),[e,t,m,l,r]),g=T.useMemo(()=>i2(e,t,m,l,r,"assets"),[e,t,m,l,r]),y=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(N=>{var z;let A=l.routes[N.route.id];!A||!A.hasLoader||(!p.some(Y=>Y.route.id===N.route.id)&&N.route.id in d&&((z=o[N.route.id])!=null&&z.shouldRevalidate)||A.hasClientLoader?C=!0:w.add(N.route.id))}),w.size===0)return[];let S=Pv(e,c,i.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&S.searchParams.set("_routes",t.filter(N=>w.has(N.route.id)).map(N=>N.route.id).join(",")),[S.pathname+S.search]},[c,i.unstable_trailingSlashAwareDataRequests,d,r,l,p,t,e,o]),E=T.useMemo(()=>I5(g,l),[g,l]),v=U5(g);return T.createElement(T.Fragment,null,y.map(w=>T.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),E.map(w=>T.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),v.map(({key:w,link:C})=>T.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function F5(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$5&&(window.__reactRouterVersion="7.14.0")}catch{}function V5({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=T.useRef();i.current==null&&(i.current=xA({window:r,v5Compat:!0}));let l=i.current,[o,c]=T.useState({action:l.action,location:l.location}),d=T.useCallback(m=>{n===!1?c(m):T.startTransition(()=>c(m))},[n]);return T.useLayoutEffect(()=>l.listen(d),[l,d]),T.createElement(x5,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var Bv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ri=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:l,replace:o,unstable_mask:c,state:d,target:m,to:p,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:E,...v},w){let{basename:C,navigator:S,unstable_useTransitions:N}=T.useContext(fa),A=typeof p=="string"&&Bv.test(p),z=Sv(p,C);p=z.to;let Y=ZA(p,{relative:i}),M=ha(),B=null;if(c){let ne=Nh(c,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);C!=="/"&&(ne.pathname=ne.pathname==="/"?C:gs([C,ne.pathname])),B=S.createHref(ne)}let[G,ce,Q]=P5(r,v),he=W5(p,{replace:o,unstable_mask:c,state:d,target:m,preventScrollReset:g,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:E,unstable_useTransitions:N});function V(ne){t&&t(ne),ne.defaultPrevented||he(ne)}let Te=!(z.isExternal||l),me=T.createElement("a",{...v,...Q,href:(Te?B:void 0)||z.absoluteURL||Y,onClick:Te?V:t,ref:F5(w,ce),target:m,"data-discover":!A&&n==="render"?"true":void 0});return G&&!A?T.createElement(T.Fragment,null,me,T.createElement(B5,{page:Y})):me});ri.displayName="Link";var G5=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:l,to:o,viewTransition:c,children:d,...m},p){let g=Yc(o,{relative:m.relative}),y=ha(),E=T.useContext(Ah),{navigator:v,basename:w}=T.useContext(fa),C=E!=null&&J5(g)&&c===!0,S=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,N=y.pathname,A=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(N=N.toLowerCase(),A=A?A.toLowerCase():null,S=S.toLowerCase()),A&&w&&(A=ni(A,w)||A);const z=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let Y=N===S||!i&&N.startsWith(S)&&N.charAt(z)==="/",M=A!=null&&(A===S||!i&&A.startsWith(S)&&A.charAt(S.length)==="/"),B={isActive:Y,isPending:M,isTransitioning:C},G=Y?t:void 0,ce;typeof r=="function"?ce=r(B):ce=[r,Y?"active":null,M?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let Q=typeof l=="function"?l(B):l;return T.createElement(ri,{...m,"aria-current":G,className:ce,ref:p,style:Q,to:o,viewTransition:c},typeof d=="function"?d(B):d)});G5.displayName="NavLink";var q5=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:l,method:o=$f,action:c,onSubmit:d,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y,...E},v)=>{let{unstable_useTransitions:w}=T.useContext(fa),C=K5(),S=Z5(c,{relative:m}),N=o.toLowerCase()==="get"?"get":"post",A=typeof c=="string"&&Bv.test(c),z=Y=>{if(d&&d(Y),Y.defaultPrevented)return;Y.preventDefault();let M=Y.nativeEvent.submitter,B=(M==null?void 0:M.getAttribute("formmethod"))||o,G=()=>C(M||Y.currentTarget,{fetcherKey:t,method:B,navigate:n,replace:i,state:l,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y});w&&n!==!1?T.startTransition(()=>G()):G()};return T.createElement("form",{ref:v,method:N,action:S,onSubmit:r?d:z,...E,"data-discover":!A&&e==="render"?"true":void 0})});q5.displayName="Form";function Y5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Uv(e){let t=T.useContext(ru);return An(t,Y5(e)),t}function W5(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:m}={}){let p=Za(),g=ha(),y=Yc(e,{relative:o});return T.useCallback(E=>{if(k5(E,t)){E.preventDefault();let v=n!==void 0?n:jc(g)===jc(y),w=()=>p(e,{replace:v,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d});m?T.startTransition(()=>w()):w()}},[g,p,y,n,r,i,t,e,l,o,c,d,m])}function Hv(e){Ba(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(ug(e)),n=T.useRef(!1),r=ha(),i=T.useMemo(()=>w5(r.search,n.current?null:t.current),[r.search]),l=Za(),o=T.useCallback((c,d)=>{const m=ug(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,l("?"+m,d)},[l,i]);return[i,o]}var Q5=0,X5=()=>`__${String(++Q5)}__`;function K5(){let{router:e}=Uv("useSubmit"),{basename:t}=T.useContext(fa),n=f5(),r=e.fetch,i=e.navigate;return T.useCallback(async(l,o={})=>{let{action:c,method:d,encType:m,formData:p,body:g}=N5(l,t);if(o.navigate===!1){let y=o.fetcherKey||X5();await r(y,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,flushSync:o.flushSync})}else await i(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function Z5(e,{relative:t}={}){let{basename:n}=T.useContext(fa),r=T.useContext(Ha);An(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),l={...Yc(e||".",{relative:t})},o=ha();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),d=c.getAll("index");if(d.some(p=>p==="")){c.delete("index"),d.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:gs([n,l.pathname])),jc(l)}function J5(e,{relative:t}={}){let n=T.useContext(Rv);An(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Uv("useViewTransitionState"),i=Yc(e,{relative:t});if(!n.isTransitioning)return!1;let l=ni(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ni(n.nextLocation.pathname,r)||n.nextLocation.pathname;return eh(i.pathname,o)!=null||eh(i.pathname,l)!=null}var su=Tv();const zv=T.createContext(null);function Wl(){return T.useContext(zv)}class Qt extends Error{constructor(t,n){super(n.message),this.statusCode=t,this.payload=n}}async function ct(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 Qt(r.status,i)}return await r.json()}function e6(e){const t=String(e);return t.includes("/exports/pdf")?t.includes("format=html")?"remote-codex-transcript.html":"remote-codex-transcript.pdf":"download"}function t6(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 n6(e,t){const n=await fetch(e,t);if(!n.ok){let i=null;try{i=await n.json()}catch{i=null}throw new Qt(n.status,i??{code:"internal_error",message:"Unable to download file."})}const r=t6(n.headers.get("content-disposition"))??e6(e);return{blob:await n.blob(),filename:r}}function l2(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 r6(){return ct("/api/config/runtime")}function Fv(){return ct("/api/config/workspace-settings",{cache:"no-store"})}function a6(e){return ct("/api/config/workspace-settings",{method:"PATCH",body:JSON.stringify(e)})}function $v(){return ct("/api/agent-runtimes",{cache:"no-store"})}function Vv(e){return ct(`/api/agent-runtimes/${encodeURIComponent(e)}/status`,{cache:"no-store"})}function s6(e){return ct(`/api/agent-runtimes/${encodeURIComponent(e)}/restart`,{method:"POST"})}function cg(e){return ct(`/api/agent-runtimes/${encodeURIComponent(e)}/models`,{cache:"no-store"})}function dg(e,t){return ct(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{cache:"no-store"})}function fg(e,t,n){return ct(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function i6(e){return ct(`/api/config/providers/${encodeURIComponent(e)}/archives`,{cache:"no-store"})}function l6(e,t={}){return ct(`/api/config/providers/${encodeURIComponent(e)}/archives`,{method:"POST",body:JSON.stringify(t)})}function o6(e,t,n){return ct(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function u6(e,t){return ct(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}/apply`,{method:"POST"})}function c6(e){return ct(`/api/agent-runtimes/${encodeURIComponent(e)}/build-restart`,{method:"POST"})}function d6(){return ct("/healthz",{cache:"no-store"})}function b1(){return ct("/api/workspaces")}function Gv(){return ct("/api/threads")}function o2(e,t={}){const n=new URLSearchParams;return t.limit!==void 0&&n.set("limit",String(t.limit)),t.beforeTurnId&&n.set("beforeTurnId",t.beforeTurnId),ct(`/api/threads/${e}${n.size>0?`?${n.toString()}`:""}`)}function f6(e,t){return ct(`/api/threads/${e}/items/${encodeURIComponent(t)}/detail`)}function h6(e){return ct(`/api/threads/${e}/export-turns`,{cache:"no-store"})}function m6(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 p6(e,t){return n6(m6(e,t),{cache:"no-store"})}function g6(e){return ct(`/api/threads/${e}/shell`)}function b6(e){return ct("/api/threads/start",{method:"POST",body:JSON.stringify(e)})}function x6(e){return ct("/api/threads/import",{method:"POST",body:JSON.stringify({sessionId:e})})}function y6(e,t={}){return ct(`/api/threads/${e}/shell`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function E6(e){return ct(`/api/shells/${e}/terminate`,{method:"POST"})}function u2(e,t={}){return ct(`/api/threads/${e}/resume`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function _6(e){return ct(`/api/threads/${e}/disconnect`,{method:"POST"})}function T6(e,t){const n=t.attachments??[];if(n.length===0)return ct(`/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:l2(l,o),placeholder:l.placeholder}));r.append("attachmentManifest",JSON.stringify(i));for(const[l,o]of n.entries())r.append("attachments",o.file,l2(o,l));return ct(`/api/threads/${e}/prompt`,{method:"POST",body:r})}function c2(e,t={}){return ct(`/api/threads/${e}/interrupt`,{method:"POST",body:JSON.stringify(t)})}function qv(e,t){return ct(`/api/threads/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function v6(e){return ct(`/api/threads/${e}`,{method:"DELETE"})}function k6(e,t){return ct(`/api/threads/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function w6(e){return ct(`/api/threads/${e}/compact`,{method:"POST"})}function C6(e){return ct(`/api/threads/${e}/goal`,{cache:"no-store"})}function S6(e,t){return ct(`/api/threads/${e}/goal`,{method:"PATCH",body:JSON.stringify(t)})}function N6(e){return ct(`/api/threads/${e}/goal`,{method:"DELETE"})}function A6(e){return ct(`/api/threads/${e}/fork-turns`,{cache:"no-store"})}function d2(e,t){return ct(`/api/threads/${e}/fork`,{method:"POST",body:JSON.stringify(t)})}function R6(e){return ct(`/api/threads/${e}/skills`,{cache:"no-store"})}function L6(e){return ct(`/api/threads/${e}/mcp-servers`,{cache:"no-store"})}function I6(e){return ct(`/api/threads/${e}/hooks`,{cache:"no-store"})}function O6(e,t){return ct(`/api/threads/${e}/hooks`,{method:"POST",body:JSON.stringify(t)})}function D6(e,t){return ct(`/api/threads/${e}/hooks`,{method:"PUT",body:JSON.stringify(t)})}function j6(e,t){return ct(`/api/threads/${e}/hooks/trust`,{method:"POST",body:JSON.stringify(t)})}function M6(e,t){return ct(`/api/threads/${e}/hooks/untrust`,{method:"POST",body:JSON.stringify(t)})}function P6(e,t,n){return ct(`/api/threads/${e}/requests/${encodeURIComponent(t)}/respond`,{method:"POST",body:JSON.stringify(n)})}function B6(e){return ct("/api/workspaces",{method:"POST",body:JSON.stringify(e)})}function U6(e,t){return ct(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function H6(e){return ct(`/api/workspaces/${e}`,{method:"DELETE"})}function z6(e,t){return ct(`/api/workspaces/${e}/favorite`,{method:"POST",body:JSON.stringify(t)})}function Yv(e){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",i=>{try{const l=JSON.parse(i.data);"threadId"in l&&l.type.startsWith("thread.")&&e(l)}catch{}}),r}function F6(e={}){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",i=>{var l,o;try{const c=JSON.parse(i.data);if(c.type==="supervisor.connected"){(l=e.onConnected)==null||l.call(e,c);return}"shellId"in c&&c.type.startsWith("shell.")&&((o=e.onShellEvent)==null||o.call(e,c))}catch{}}),{socket:r,send(i){r.send(JSON.stringify(i))}}}function $6(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M2 3.25h12v1.5H2Zm0 4h12v1.5H2Zm0 4h12v1.5H2Z"})})}function hg(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.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 f2(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 V6=[{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."}],Wv={hostConfigFiles:[],toolboxItems:[],hookCommandTemplates:[],configArchives:!1,buildRestart:!1};function h2(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,fastServiceTier:!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:Wv}}const zo=[h2("codex","Codex"),h2("claude","Claude")];function G6(e){var t;return((t=zo.find(n=>n.provider===e))==null?void 0:t.managementSchema)??Wv}function q6(e){const t=e.filter(r=>r.enabled).length,n=e.length;return t>1?"New threads use the selected backend. Each backend exposes its own tools and settings.":n>t?"New threads use the selected backend. Additional backends appear here when configured.":"New threads use the selected backend."}function Y6(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 sc(e){return{path:e,exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null}}function x1({className:e=""}){const t=Wl();return t?f.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?f.jsx(hg,{}):f.jsx($6,{})}):null}function y1({className:e=""}){const t=Wl(),n=ha(),r=Za(),i=T.useRef(null),l=n.pathname==="/workspaces";return T.useEffect(()=>{if(!(t!=null&&t.navOpen))return;const o=t;function c(d){const m=d.target;if(!m)return;const p=i.current;p!=null&&p.contains(m)||m instanceof Element&&m.closest('[aria-controls="app-shell-navigation-menu"]')||o.closeNav()}return document.addEventListener("pointerdown",c),()=>{document.removeEventListener("pointerdown",c)}},[t]),t!=null&&t.navOpen?f.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:[f.jsxs("div",{children:[f.jsx("p",{className:"text-base font-semibold tracking-wide text-[var(--theme-accent-strong)]",children:"Remote Codex"}),f.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Navigation"})]}),f.jsxs("nav",{className:"mt-4 flex flex-col gap-1.5 text-sm",children:[f.jsx("button",{type:"button",disabled:l,onClick:()=>{l||(t.closeNav(),r("/workspaces"))},className:f2(l),children:"Workspaces"}),f.jsx("button",{type:"button",onClick:()=>{t.openSettings()},className:f2(),children:"Settings"})]})]}):null}function W6(){const e=Wl(),[t,n]=T.useState(null),[r,i]=T.useState({}),l=t?r[t]:null,[o,c]=T.useState({busy:!1,message:null,error:null}),[d,m]=T.useState([]),[p,g]=T.useState(zo),[y,E]=T.useState({loading:!1,saving:!1,error:null}),[v,w]=T.useState(null),[C,S]=T.useState({devHomeDraft:"",backendDraft:"codex",loading:!1,saving:!1,message:null,error:null}),[N,A]=T.useState({loading:!1,creating:!1,applyingId:null,renamingId:null,renameDraft:"",message:null,error:null}),z=(e==null?void 0:e.themeMode)??"system",Y=(e==null?void 0:e.effectiveTheme)??"dark",M=(e==null?void 0:e.defaultBackend)??"codex",B=p.find(F=>F.provider===M)??zo.find(F=>F.provider===M)??zo[0],G=B.managementSchema??G6(B.provider),ce=G.hostConfigFiles;T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!G.configArchives)return;const F=e;function K(oe){oe.key==="Escape"&&F.closeSettings()}return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let F=!1;return E(K=>({...K,loading:!0,error:null})),$v().then(K=>{if(F)return;const oe=[...K,...zo.filter(R=>!K.some(U=>U.provider===R.provider))];g(oe),E(R=>({...R,loading:!1}))}).catch(K=>{F||(g(zo),E(oe=>({...oe,loading:!1,error:K instanceof Qt?K.message:"Unable to load backend settings."})))}),()=>{F=!0}},[e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let F=!1;return S(K=>({...K,loading:!0,message:null,error:null})),Fv().then(K=>{F||(w(K),e.setDefaultBackend(K.defaultBackend),S(oe=>({...oe,devHomeDraft:K.devHome,backendDraft:K.defaultBackend,loading:!1})))}).catch(K=>{F||S(oe=>({...oe,loading:!1,error:K instanceof Qt?K.message:"Unable to load workspace settings."}))}),()=>{F=!0}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!B.capabilities.management.hostConfigFiles)return;let F=!1;async function K(){i(R=>{const U={...R};for(const te of ce)U[te.name]={...sc(te.name),...R[te.name],loading:!0,saving:!1,error:null,saveMessage:null};return U});const oe=await Promise.allSettled(ce.map(async R=>({name:R.name,result:await dg(B.provider,R.name)})));F||i(R=>{var te,O;const U={...R};for(const we of oe){if(we.status==="fulfilled"){const{name:Ge,result:Fe}=we.value;U[Ge]={path:Fe.path,exists:Fe.exists,originalContent:Fe.content,draftContent:Fe.content,loading:!1,saving:!1,error:null,saveMessage:null};continue}const Re=we.reason instanceof Qt?we.reason.message:"Unable to load the file.",Se=((te=ce[oe.indexOf(we)])==null?void 0:te.name)??((O=ce[0])==null?void 0:O.name);Se&&(U[Se]={...sc(Se),...U[Se],loading:!1,saving:!1,error:Re,saveMessage:null})}return U})}return K(),()=>{F=!0}},[B.capabilities.management.hostConfigFiles,B.provider,ce,e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let F=!1;async function K(){A(oe=>({...oe,loading:!0,error:null,message:null}));try{const oe=await i6(B.provider);if(F)return;m(oe),A(R=>({...R,loading:!1}))}catch(oe){if(F)return;A(R=>({...R,loading:!1,error:oe instanceof Qt?oe.message:"Unable to load config archives."}))}}return K(),()=>{F=!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 F=await s6(B.provider);c({busy:!1,message:F.status.state==="ready"?`${F.displayName} backend restarted.`:`${F.displayName} backend state: ${F.status.state}`,error:null}),g(K=>K.map(oe=>oe.provider===F.provider?F:oe))}catch(F){c({busy:!1,message:null,error:F instanceof Qt?F.message:"Unable to restart the app server."})}}}async function he(){if(!o.busy){c({busy:!0,message:null,error:null});try{await c6(B.provider),c({busy:!1,message:"Build and restart launched. The page may disconnect briefly.",error:null})}catch(F){c({busy:!1,message:null,error:F instanceof Qt?F.message:"Unable to launch build and restart."})}}}async function V(){const F=C.devHomeDraft.trim();if(!(!F||C.saving)){S(K=>({...K,saving:!0,message:null,error:null}));try{const K=await a6({devHome:F,defaultBackend:C.backendDraft});w(K),e==null||e.setDefaultBackend(K.defaultBackend),S(oe=>({...oe,devHomeDraft:K.devHome,backendDraft:K.defaultBackend,saving:!1,message:"Workspace defaults saved."}))}catch(K){S(oe=>({...oe,saving:!1,error:K instanceof Qt?K.message:"Unable to save workspace settings."}))}}}async function Te(F){const K=r[F];if(!(!K||K.saving)){i(oe=>({...oe,[F]:{...sc(F),...oe[F],saving:!0,error:null,saveMessage:null}}));try{const oe=await fg(B.provider,F,{content:K.draftContent});i(R=>({...R,[F]:{path:oe.path,exists:oe.exists,originalContent:oe.content,draftContent:oe.content,loading:!1,saving:!1,error:null,saveMessage:"Saved"}}))}catch(oe){i(R=>({...R,[F]:{...sc(F),...R[F],saving:!1,error:oe instanceof Qt?oe.message:"Unable to save the file.",saveMessage:null}}))}}}async function me(){if(!N.creating){A(F=>({...F,creating:!0,message:null,error:null}));try{const F=await l6(B.provider);m(K=>[F,...K]),A(K=>({...K,creating:!1,message:"Backup created."}))}catch(F){A(K=>({...K,creating:!1,error:F instanceof Qt?F.message:"Unable to create a config backup."}))}}}async function ne(F){if(!N.applyingId){A(K=>({...K,applyingId:F.id,message:null,error:null}));try{const K=await u6(B.provider,F.id);A(oe=>({...oe,applyingId:null,message:K.status.state==="ready"?`Applied "${K.archive.label}" and restarted ${B.displayName}.`:`Applied "${K.archive.label}". ${B.displayName} state: ${K.status.state}.`}))}catch(K){A(oe=>({...oe,applyingId:null,error:K instanceof Qt?K.message:"Unable to apply the config archive."}))}}}async function H(F){const K=N.renameDraft.trim();if(!(!K||N.renamingId!==F.id)){A(oe=>({...oe,message:null,error:null}));try{const oe=await o6(B.provider,F.id,{label:K});m(R=>R.map(U=>U.id===F.id?oe:U)),A(R=>({...R,renamingId:null,renameDraft:"",message:"Backup renamed."}))}catch(oe){A(R=>({...R,error:oe instanceof Qt?oe.message:"Unable to rename the config backup."}))}}}return e!=null&&e.settingsOpen?f.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:[f.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"ui-overlay-scrim absolute inset-0 backdrop-blur-sm"}),f.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:[f.jsx("div",{className:"shrink-0 p-5 pb-0",children:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Settings"}),f.jsx("h2",{className:"mt-2 text-xl font-semibold text-[var(--theme-fg)]",children:"Settings"}),f.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."})]}),f.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:f.jsx(hg,{})})]})}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 pt-5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Appearance"}),f.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,"."]})]})}),f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:V6.map(F=>{const K=z===F.value;return f.jsxs("button",{type:"button",onClick:()=>e.setThemeMode(F.value),className:`block rounded-[1rem] border px-3 py-2.5 text-left transition ${K?"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:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:F.label}),K?f.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]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:F.description})]},F.value)})})]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Backend"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:q6(p)})]}),y.loading?f.jsx("span",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Loading"}):null]}),f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:p.map(F=>{const K=C.backendDraft===F.provider;return f.jsxs("button",{type:"button",disabled:!F.enabled,onClick:()=>{S(oe=>({...oe,backendDraft:F.provider,message:null,error:null}))},className:`block rounded-[1rem] border px-3 py-2.5 text-left transition disabled:cursor-not-allowed disabled:opacity-60 ${K?"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:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:F.displayName}),f.jsx("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:F.enabled?F.status.state:"Unavailable"})]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:F.description})]},F.provider)})}),y.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:y.error}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Workspace defaults"}),f.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."})]})}),f.jsxs("div",{className:"mt-3 grid gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Workspace root"}),f.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:C.loading&&!v?"Loading...":(v==null?void 0:v.workspaceRoot)??"Unavailable"})]}),f.jsxs("div",{children:[f.jsx("label",{htmlFor:"settings-dev-home",className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Dev home"}),f.jsxs("div",{className:"mt-1 flex flex-col gap-2 sm:flex-row",children:[f.jsx("input",{id:"settings-dev-home",value:C.devHomeDraft,onChange:F=>S(K=>({...K,devHomeDraft:F.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)]"}),f.jsx("input",{type:"hidden",value:C.backendDraft,readOnly:!0}),f.jsx("button",{type:"button","aria-label":"Save workspace defaults",onClick:()=>void V(),disabled:C.loading||C.saving||!C.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:C.saving?"Saving...":"Save"})]})]})]}),C.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:C.error}):C.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:C.message}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:[B.displayName," runtime"]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Restart the selected backend after editing host configuration to force a fresh reload."})]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-2",children:[f.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"}),G.buildRestart?f.jsx("button",{type:"button",onClick:()=>void he(),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"}):null]})]}),o.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:o.error}):o.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:o.message}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Provider host files"}),f.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."]})]})}),f.jsxs("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:[ce.map(F=>{const K=r[F.name]??{path:F.name,exists:!1,originalContent:"",draftContent:"",loading:!1},oe=K.draftContent!==K.originalContent;return f.jsx("button",{type:"button",onClick:()=>n(F.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:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:F.label}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:F.description})]}),f.jsx("div",{className:"shrink-0",children:K.loading?f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-[var(--theme-fg-muted)]",children:"Loading"}):oe?f.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"}):K.exists?f.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"}):f.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"})})]})},F.name)}),ce.length===0?f.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?f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Config archives"}),f.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."})]}),f.jsx("button",{type:"button",onClick:()=>void me(),disabled:N.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:N.creating?"Creating...":"Create backup"})]}),N.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:N.error}):N.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:N.message}):null,f.jsx("div",{className:"mt-3 space-y-2",children:N.loading?f.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..."}):d.length===0?f.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."}):d.map(F=>{const K=N.renamingId===F.id;return f.jsx("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3",children:f.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[f.jsxs("div",{className:"min-w-0",children:[K?f.jsxs("div",{className:"flex max-w-xl gap-2",children:[f.jsx("input",{"aria-label":`Rename ${F.label}`,value:N.renameDraft,onChange:oe=>A(R=>({...R,renameDraft:oe.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)]"}),f.jsx("button",{type:"button","aria-label":`Save archive name ${F.label}`,onClick:()=>void H(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"}),f.jsx("button",{type:"button",onClick:()=>A(oe=>({...oe,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"})]}):f.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:F.label}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[var(--theme-fg-muted)]",children:[f.jsxs("span",{children:["Created ",Y6(F.createdAt)]}),ce.map(oe=>{var R;return f.jsxs("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 font-mono",children:[oe.name,": ",(R=F.files[oe.name])!=null&&R.exists?"saved":"missing"]},oe.name)})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[f.jsx("button",{type:"button",onClick:()=>A(oe=>({...oe,renamingId:F.id,renameDraft:F.label,message:null,error:null})),disabled:K,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"}),f.jsx("button",{type:"button",onClick:()=>void ne(F),disabled:N.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:N.applyingId===F.id?"Applying...":"Apply"})]})]})},F.id)})})]}):null]})})]}),t&&l?f.jsx("div",{className:"pointer-events-none fixed inset-0 z-[71] flex items-center justify-center p-4",children:f.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:[f.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--theme-border)] px-4 py-3 sm:px-5",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:t}),f.jsx("p",{className:"mt-1 break-all font-mono text-xs text-[var(--theme-fg-muted)]",children:l.path})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[l.error?f.jsx("span",{className:"text-xs text-rose-300",children:l.error}):l.saveMessage?f.jsx("span",{className:"text-xs text-emerald-300",children:l.saveMessage}):null,f.jsx("button",{type:"button","aria-label":`Save ${t}`,onClick:()=>void Te(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"}),f.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:f.jsx(hg,{})})]})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:f.jsx("textarea",{"aria-label":`Edit ${t}`,value:l.draftContent,onChange:F=>i(K=>({...K,[t]:{...sc(t),...K[t],draftContent:F.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 l0({eyebrow:e,title:t,description:n}){return f.jsxs("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 p-5 shadow-2xl shadow-stone-950/20",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:e}),f.jsx("h2",{className:"mt-3 text-xl font-semibold text-stone-100",children:t}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]})}function Q6(){const[e,t]=T.useState(null),[n,r]=T.useState(null);return T.useEffect(()=>{r6().then(t).catch(i=>{r(i instanceof Error?i.message:"Unable to load runtime config.")})},[]),f.jsx("div",{className:"min-h-screen bg-stone-950 px-4 py-8 text-stone-100 sm:px-6",children:f.jsx("div",{className:"mx-auto max-w-7xl",children:f.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[f.jsxs("section",{className:"rounded-[2rem] border border-stone-800 bg-stone-900 p-8 shadow-2xl shadow-stone-950/20 sm:p-10",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.35em] text-amber-300",children:"Local Supervisor"}),f.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."}),f.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."}),f.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[f.jsx(ri,{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"}),f.jsx(ri,{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"})]})]}),f.jsxs("section",{className:"grid gap-4",children:[f.jsx(l0,{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()}),f.jsx(l0,{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."}),f.jsx(l0,{eyebrow:"Environment",title:(e==null?void 0:e.environment)??"Loading environment",description:e?`${e.host}:${e.port}`:"Runtime metadata appears here after bootstrap."})]})]})})})}function X6(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 K6(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function Z6({open:e,busy:t=!1,turnsState:n,onCancel:r,onLoadTurns:i,onExport:l}){var z,Y,M;const o=((z=n.data)==null?void 0:z.turns)??[],c=T.useMemo(()=>o.slice(0,10).map(B=>B.turnId),[o]),[d,m]=T.useState("latest"),[p,g]=T.useState(()=>new Set),[y,E]=T.useState(!0),[v,w]=T.useState("pdf");if(T.useEffect(()=>{e&&(m("latest"),w("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 C=d==="latest"?Math.min(10,((Y=n.data)==null?void 0:Y.totalTurnCount)??10):p.size,S=!t&&(d==="latest"||p.size>0);function N(B){g(G=>{const ce=new Set(G);return ce.has(B)?ce.delete(B):ce.add(B),ce})}function A(){const B={format:v,mode:d,...d==="latest"?{limit:10}:{turnIds:[...p]},profile:"review",options:{includeTokenAndPrice:y}};l(B)}return su.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6",children:[f.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"}),f.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:[f.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-stone-800 px-5 py-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-semibold text-stone-100",children:"Export transcript"}),f.jsx("p",{className:"mt-1 text-xs text-stone-500",children:"Default review copy summarizes command batches and file changes."})]}),f.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:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.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"})})})]}),f.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[f.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])=>f.jsx("button",{type:"button",onClick:()=>m(B),className:`rounded-full px-3 py-1.5 text-sm transition ${d===B?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:G},B))}),f.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])=>f.jsx("button",{type:"button",onClick:()=>w(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))}),d==="selected"?f.jsxs("div",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-stone-800 px-3 py-2.5",children:[f.jsxs("p",{className:"text-xs text-stone-400",children:["Selected ",p.size," of ",((M=n.data)==null?void 0:M.totalTurnCount)??o.length]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.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"}),f.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"?f.jsx("p",{className:"px-3 py-6 text-sm text-stone-400",children:"Loading turns..."}):n.status==="failed"?f.jsx("p",{className:"px-3 py-6 text-sm text-rose-100",children:n.error}):f.jsx("div",{className:"max-h-80 overflow-auto p-2",children:o.map(B=>f.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:[f.jsx("input",{type:"checkbox",checked:p.has(B.turnId),onChange:()=>N(B.turnId),className:"h-4 w-4 accent-amber-300"}),f.jsxs("span",{className:"shrink-0 text-xs font-medium text-stone-300",children:["Turn ",B.turnNumber]}),f.jsx("span",{className:"shrink-0 text-xs text-stone-500",children:X6(B.startedAt)}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-stone-200",children:B.userPromptPreview}),f.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:K6(B.status)})]},B.turnId))})]}):f.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."}),f.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-stone-300 sm:grid-cols-2",children:[f.jsxs("label",{className:"flex items-center gap-2 rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2",children:[f.jsx("input",{type:"checkbox",checked:y,onChange:B=>E(B.target.checked),className:"h-4 w-4 accent-amber-300"}),"Token and price"]}),f.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."})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-stone-800 px-5 py-4",children:[f.jsxs("p",{className:"min-w-0 text-xs text-stone-500",children:[C," ",C===1?"turn":"turns"," will be exported."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.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"}),f.jsx("button",{type:"button",onClick:A,disabled:!S,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 Gf=[{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:""}],o0=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function m2(e){return e.replace(/\u00a0/g," ")}function J6(e){if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,t.textContent??""}function e4(e){return!!e.querySelector("[style], font")}function t4(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(m=>e.startsWith(m.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 m of r){const p=e.indexOf(m.placeholder,i);p!==-1&&p<c&&(c=p)}const d=e.slice(i,c);d&&(n.push({type:"text",key:`text-${l}`,text:d}),l+=1),i=c}return n}function p2(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function n4(){return f.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:[f.jsx("path",{d:"m4 5 2 2-2 2"}),f.jsx("path",{d:"M7.75 9.5h4.25"})]})}function r4(){return f.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:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function a4(){return f.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:[f.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),f.jsx("path",{d:"M4.25 5.25h2.25"}),f.jsx("path",{d:"M9.5 10.75h2.25"})]})}function s4(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function i4(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function l4(e){var t;return((t=Gf.find(n=>n.value===e))==null?void 0:t.label)??e}function o4(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 u4(e){switch(e){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function c4(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 d4(e){return e.source==="user"?"global":e.source==="project"?"project":null}function g2(e){const t=d4(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 f4(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function h4(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 m4(e){if(!e)return"";const t=e/1e3;return Number.isInteger(t)?String(t):String(Number(t.toFixed(1)))}function mg(e){return e.replace(/\r\n/g,`
|
|
62
|
+
`)}function p4(e){const t=e.trim();return/^[A-Za-z0-9_-]+$/.test(t)?t:null}function g4(e){const n=mg(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 b4(e,t){return`[mcp_servers.${e}]
|
|
64
|
+
url = ${JSON.stringify(t.trim())}
|
|
65
|
+
`}function b2(e,t,n){var g,y;const r=mg(e),i=`${mg(n).trim()}
|
|
66
|
+
`,l=r.split(`
|
|
67
|
+
`),o=`[mcp_servers.${t}]`,c=`[mcp_servers.${t}.`;let d=-1,m=l.length;for(let E=0;E<l.length;E+=1)if((((g=l[E])==null?void 0:g.trim())??"")===o){d=E;break}if(d>=0){for(let w=d+1;w<l.length;w+=1){const C=((y=l[w])==null?void 0:y.trim())??"";if(C.startsWith("[")&&!(C===o||C.startsWith(c))){m=w;break}}const E=l.slice(0,d).join(`
|
|
68
|
+
`).trimEnd(),v=l.slice(m).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 Qv(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function u0(e){const t=e/1e3;return Number.isInteger(t)?`${t}k`:`${Number(t.toFixed(1))}k`}function x4(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,`${u0(n)} used / ${u0(r)}`,`${u0(i)} left`,`${Qv(t.remainingPercent)}% context left`].join(" · ")}function y4({contextUsage:e}){const t=(e==null?void 0:e.availability)??"unavailable",n=Qv(e==null?void 0:e.remainingPercent),r=t==="available"?n:100,i=t!=="available"?"rgba(120,113,108,0.55)":n<=20?"rgba(251,113,133,0.95)":n<=40?"rgba(252,211,77,0.94)":"rgba(125,211,252,0.95)";return f.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-frame pointer-events-none absolute inset-0",style:{"--context-ring-progress":`${r}%`,"--context-ring-color":i}})}function x2(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 y2(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function c0(e){return e.type.startsWith("image/")?"photo":"file"}function pg(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 E2(e,t){return pg(e,t).length>0}function Nl(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function E4(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function _2(e){const t=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return t!=null&&t[1]?t[1]:E4(e.originalName)}function _4(){return f.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:f.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 T4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[f.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"}),f.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"}),f.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 d0(){return f.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:[f.jsx("path",{d:"M5.5 3.25h5"}),f.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 Al({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 f.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 f0({activeView:e,edgeToEdgeMobile:t=!1,busy:n=!1,settingsBusy:r=!1,compactBusy:i=!1,error:l,model:o=null,reasoningEffort:c=null,fastMode:d=!1,collaborationMode:m="default",modelOptions:p=[],contextUsage:g=null,capabilities:y=null,toolboxItems:E=null,hookCommandTemplates:v=null,followTail:w=!1,threadConnected:C=!0,disabled:S=!1,disabledPlaceholder:N,shellControlState:A=null,draftPrompt:z,draftAttachments:Y,skillsState:M={status:"idle",data:null,error:null},mcpState:B={status:"idle",data:null,error:null},hooksState:G={status:"idle",data:null,error:null},goalState:ce={status:"idle",data:null,error:null},forkTurnOptionsState:Q={status:"idle",data:null,error:null},onDraftChange:he,onSubmit:V,onInterrupt:Te,onCompact:me,onOpenSkills:ne,onOpenMcp:H,onOpenHooks:F,onCreateHook:K,onUpdateHook:oe,onTrustHook:R,onUntrustHook:U,onOpenGoal:te,onUpdateGoal:O,onOpenForkTurns:we,onForkLatest:Re,onForkTurn:Se,onReadProviderConfig:Ge,onWriteProviderConfig:Fe,onToggleFollow:De,onUpdateSettings:tt,onToggleView:dt,onShellCopy:Ct,onShellControl:bt,canInterrupt:At=!1}){var id,ld,od,ud,cd,dd,fd,no,yi,hd,yu,Eu,_u;const[Tt,ot]=T.useState({prompt:"",attachments:[]}),[St,Me]=T.useState(null),[qe,zt]=T.useState("root"),[mn,Xt]=T.useState("list"),[yn,nt]=T.useState("list"),[lr,ge]=T.useState("project"),ve=T.useMemo(()=>({fast:(y==null?void 0:y.controls.fastServiceTier)??!1,compact:(y==null?void 0:y.turns.compact)??!1,goal:(y==null?void 0:y.controls.goals)??!1,fork:(y==null?void 0:y.branching.fork)??!1,skills:(y==null?void 0:y.management.skills)??!1,mcp:(y==null?void 0:y.management.mcpStatus)??!1,hooks:(y==null?void 0:y.management.hooks)??!1,hostConfigFiles:(y==null?void 0:y.management.hostConfigFiles)??!1,mcpConfigEditing:!!(y!=null&&y.management.hostConfigFiles)&&!!Ge&&!!Fe,hookTrust:(y==null?void 0:y.management.hookTrust)??!1}),[y,Ge,Fe]),Ye=T.useMemo(()=>(E??[]).filter(I=>{switch(I.action){case"fast":return ve.fast;case"compact":return ve.compact;case"goal":return ve.goal;case"fork":return ve.fork;case"skills":return ve.skills;case"mcp":return ve.mcp;case"hooks":return ve.hooks;default:return!1}}),[ve,E]),rt=T.useMemo(()=>{const I=new Map;for(const ae of v??[])I.set(ae.eventName,ae.command);return I},[v]),vt=I=>rt.get(I)??rt.get("preToolUse")??o0,En=T.useMemo(()=>new Set([o0,...rt.values()]),[rt]),[kn,xe]=T.useState("preToolUse"),[Oe,Ke]=T.useState("Bash"),[Pe,it]=T.useState(o0),[X,Ee]=T.useState("30"),[at,Ue]=T.useState("Running hook"),[Be,gt]=T.useState(null),[Pt,Je]=T.useState(!1),[$t,pt]=T.useState(null),[Br,Yt]=T.useState(null),[Xr,Zn]=T.useState(""),[il,ii]=T.useState(""),[ma,za]=T.useState(""),[eo,ll]=T.useState(null),[Rr,sn]=T.useState(!1),[Fn,Rn]=T.useState(null),[li,Er]=T.useState(null),[ts,Vt]=T.useState(null),[Mn,pa]=T.useState(!1),[Jn,$n]=T.useState(!1),[ns,ga]=T.useState(""),[_n,ks]=T.useState(!1),[ol,or]=T.useState(null),rs=T.useRef(null),Kr=T.useRef(null),oi=T.useRef(null),ui=T.useRef(null),Fa=T.useRef(null),ba=T.useRef([]),Vn=T.useRef(null),er=T.useRef(new Map),ur=T.useRef(""),ci=T.useRef(0),ln=e==="shell",ws=!!(ln&&(A!=null&&A.isMobileShell)),as=(A==null?void 0:A.promptLabel)??null,[_r,Pn]=T.useState({}),[Tr,Zr]=T.useState(!1),[di,Cs]=T.useState(0),Ur=!ln&&z!==void 0&&Y!==void 0&&typeof he=="function",en=Ur?z:Tt.prompt,xa=Ur?Y:Tt.attachments;T.useEffect(()=>{St!=="slash"&&(zt("root"),Xt("list"),Rn(null),Er(null),nt("list"),pt(null),Yt(null))},[St]),T.useEffect(()=>{qe!=="mcp"&&(Xt("list"),Rn(null),Er(null))},[qe]),T.useEffect(()=>{qe!=="forkTurns"&&pa(!1)},[qe]),T.useEffect(()=>{qe!=="hooks"&&(nt("list"),pt(null),Yt(null))},[qe]),T.useEffect(()=>{const I=Gf.find(ae=>ae.value===kn);Ke(ae=>{const ke=ae.trim(),Qe=new Set(Gf.map(Xe=>Xe.matcherHint).filter(Boolean));return ke&&!Qe.has(ke)?ae:(I==null?void 0:I.matcherHint)??""}),it(ae=>En.has(ae.trim())?vt(kn):ae)},[En,kn,rt]),T.useEffect(()=>{if(!ts)return;const I=window.setTimeout(()=>{Vt(ae=>ae===ts?null:ae)},1400);return()=>{window.clearTimeout(I)}},[ts]);function pr(I){if(Ur){he==null||he(ae=>I({prompt:ae.prompt,attachments:ae.attachments}));return}ot(ae=>I(ae))}function bu(I){pr(ae=>{if(typeof I=="function"){const ke=I(ae.prompt,ae.attachments);return{prompt:ke.prompt,attachments:ke.attachments??ae.attachments}}return{prompt:I,attachments:ae.attachments}})}async function fi(I){try{await navigator.clipboard.writeText(`$${I}`),Vt(I)}catch{Vt(null)}}async function hi(){if(Re){pa(!0);try{await Re(),Me(null)}finally{pa(!1)}}}async function Ss(I){if(Se){pa(!0);try{await Se(I),Me(null)}finally{pa(!1)}}}async function mi(){const I=en.trim();if(!I){or("Goal objective cannot be empty.");return}const ae=ns.trim(),ke=h4(ae);if(ae.length>0&&(ke===null||!Number.isInteger(ke)||ke<=0)){or("Token budget must be a positive number in thousands.");return}if(!O){or("/goal is unavailable in this view.");return}ks(!0),or(null);try{await O({objective:I,status:"active",tokenBudget:ke}),ga(""),$n(!1),pr(()=>({prompt:"",attachments:[]}))}catch(Qe){or(Qe instanceof Error?Qe.message:"Unable to set goal.")}finally{ks(!1)}}function ul(){var I;Me(null),zt("root"),$n(!0),ga(m4((I=ce.data)==null?void 0:I.tokenBudget)),or(null),te==null||te(),requestAnimationFrame(()=>{var ae;(ae=Kr.current)==null||ae.focus()})}function ss(){$n(!1),or(null)}const Lr=T.useMemo(()=>p.find(I=>I.model===o)??null,[o,p]),pi=x4(o,g),gi=(Lr==null?void 0:Lr.supportedReasoningEfforts)??[],$a=T.useMemo(()=>t4(en,xa),[xa,en]),ya=T.useMemo(()=>Object.entries(_r).sort(([I],[ae])=>I.localeCompare(ae)).map(([I,ae])=>`${I}:${ae}`).join("|"),[_r]);async function bi(){if(!ve.hostConfigFiles||!Ge)throw new Error("Provider config editing is unavailable for this thread.");const I=await Ge();return ll(I.path),I}async function Ea(I){if(!ve.hostConfigFiles||!Fe)throw new Error("Provider config editing is unavailable for this thread.");const ae=await Fe(I);return ll(ae.path),ae}function Ns(I){switch(I.action){case"fast":return d?"On":"Off";case"compact":return i?"Busy":"Run";case"goal":return Jn?"Composing":ce.data?f4(ce.data.status):"Open";case"fork":return n?"Idle only":"Open";case"skills":case"mcp":case"hooks":return"View";default:return""}}function is(I){switch(I.action){case"fast":return r;case"compact":return i||n;case"fork":return n||Mn;default:return!1}}function vr(I){var ke;return`${I.action==="fast"&&d||I.action==="goal"&&(Jn||((ke=ce.data)==null?void 0:ke.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 cl(I,ae){switch(ae.stopPropagation(),I.action){case"fast":Hr({fastMode:!d});break;case"compact":Me(null),me==null||me();break;case"goal":Jn?(ss(),Me(null)):ul();break;case"fork":zt("fork");break;case"skills":zt("skills"),ne==null||ne();break;case"mcp":zt("mcp"),H==null||H();break;case"hooks":zt("hooks"),F==null||F();break}}function As(){gt(null),ge("project"),xe("preToolUse"),Ke("Bash"),it(vt("preToolUse")),Ee("30"),Ue("Running hook")}function Jr(I){const ae=g2(I);if(!ae){pt("Only command hooks in global or project hooks.json can be edited here.");return}gt(ae),ge(ae.scope),xe(ae.eventName),Ke(ae.matcher??""),it(ae.command),Ee(ae.timeoutSec?String(ae.timeoutSec):""),Ue(ae.statusMessage??""),pt(null),Yt(null),nt("edit")}async function xi(){const I=p4(Xr),ae=il.trim();if(!I){Rn("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(ae)){Rn("HTTP MCP URL must start with http:// or https://");return}sn(!0),Rn(null),Er(null);try{const ke=await bi(),Qe=b2(ke.content,I,b4(I,ae));await Ea(Qe),Er("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Xt("list"),Zn(""),ii(""),H==null||H()}catch(ke){Rn(ke instanceof Error?ke.message:"Unable to update provider config.")}finally{sn(!1)}}async function Rs(){sn(!0),Rn(null),Er(null);try{await bi(),ma.trim()||za(`[mcp_servers.example_stdio]
|
|
77
|
+
command = "npx"
|
|
78
|
+
args = ["-y", "your-mcp-server"]
|
|
79
|
+
`),Xt("stdio")}catch(I){Rn(I instanceof Error?I.message:"Unable to load provider config.")}finally{sn(!1)}}async function to(){const I=g4(ma);if(!I){Rn("The raw MCP block must start with a header like [mcp_servers.name].");return}sn(!0),Rn(null),Er(null);try{const ae=await bi(),ke=b2(ae.content,I,ma);await Ea(ke),Er("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Xt("list"),H==null||H()}catch(ae){Rn(ae instanceof Error?ae.message:"Unable to update provider config.")}finally{sn(!1)}}async function Ls(){if(yn==="edit"&&!oe){pt("Hook editing is unavailable in this view.");return}if(yn!=="edit"&&!K){pt("Hook editing is unavailable in this view.");return}if(yn==="edit"&&!Be){pt("Select a hook to edit first.");return}const I=Pe.trim();if(!I){pt("Hook command cannot be empty.");return}const ae=X.trim(),ke=ae?Number(ae):null;if(ae&&(ke===null||!Number.isInteger(ke)||ke<=0)){pt("Timeout must be a positive number of seconds.");return}Je(!0),pt(null),Yt(null);try{const Qe={scope:lr,eventName:kn,matcher:Oe.trim()||null,command:I,timeoutSec:ke,statusMessage:at.trim()||null};yn==="edit"?await(oe==null?void 0:oe({...Qe,target:Be})):await(K==null?void 0:K(Qe)),Yt(`${lr==="project"?"Project":"Global"} hook ${yn==="edit"?"updated":"written"} in hooks.json and trusted.`),nt("list"),gt(null)}catch(Qe){pt(Qe instanceof Error?Qe.message:"Unable to write hooks.json.")}finally{Je(!1)}}async function Is(I){if(!R||!I.currentHash){pt("Hook trust is unavailable in this view.");return}Je(!0),pt(null),Yt(null);try{await R({key:I.key,currentHash:I.currentHash}),Yt("Hook trusted.")}catch(ae){pt(ae instanceof Error?ae.message:"Unable to trust hook.")}finally{Je(!1)}}async function dl(I){if(!U){pt("Hook trust is unavailable in this view.");return}Je(!0),pt(null),Yt(null);try{await U({key:I.key}),Yt("Hook untrusted.")}catch(ae){pt(ae instanceof Error?ae.message:"Unable to untrust hook.")}finally{Je(!1)}}T.useEffect(()=>{if(ln){Pn({});return}const I={},ae=new Set;for(const ke of xa){if(ke.kind!=="photo")continue;ae.add(ke.clientId);let Qe=er.current.get(ke.clientId);Qe||(Qe=URL.createObjectURL(ke.file),er.current.set(ke.clientId,Qe)),I[ke.clientId]=Qe}for(const[ke,Qe]of er.current.entries())ae.has(ke)||(URL.revokeObjectURL(Qe),er.current.delete(ke));Pn(I)},[xa,ln]),T.useEffect(()=>()=>{for(const I of er.current.values())URL.revokeObjectURL(I);er.current.clear()},[]);function wn(){const I=Kr.current,ae=window.getSelection();if(!I||!ae||ae.rangeCount===0)return null;const ke=ae.getRangeAt(0);return!I.contains(ke.startContainer)||!I.contains(ke.endContainer)?null:{start:ea(I,ke.startContainer,ke.startOffset),end:ea(I,ke.endContainer,ke.endOffset)}}function ea(I,ae,ke){var Ot;let Qe=null,Xe=ke;if(ae===I){const yt=Array.from(I.childNodes);let Kt=0;for(let tr=0;tr<Math.min(ke,yt.length);tr+=1){const Bt=yt[tr];Bt&&(Kt+=Nl(Bt).length)}return Kt}if(ae.nodeType===Node.TEXT_NODE)Qe=ae;else{const yt=Array.from(I.childNodes).find(Kt=>Kt.contains(ae));if(!yt)return Ie().length;if(Qe=yt,yt instanceof HTMLElement&&yt.dataset.segmentType==="attachment"){const Kt=document.createRange();Kt.selectNodeContents(yt);const tr=Nl(yt).length;try{Kt.setEnd(ae,ke);const Bt=Kt.toString().length,Ta=((Ot=yt.textContent)==null?void 0:Ot.length)??0;Ta===0?Xe=tr:Xe=Math.round(Math.min(1,Bt/Ta)*tr)}catch{Xe=tr}}else{const Kt=document.createRange();Kt.selectNodeContents(yt);try{Kt.setEnd(ae,ke),Xe=Kt.toString().length}catch{Xe=Nl(yt).length}}}const mt=Array.from(I.childNodes);let ft=0;for(const yt of mt){if(yt===Qe)return yt.nodeType===Node.TEXT_NODE?ft+Xe:ft+Math.min(Xe,Nl(yt).length);ft+=Nl(yt).length}return ft}function $(I,ae){let ke=Math.max(0,ae);const Qe=Array.from(I.childNodes);for(const[Xe,mt]of Qe.entries()){const Ot=Nl(mt).length;if(mt.nodeType===Node.TEXT_NODE){if(ke<=Ot)return{node:mt,offset:ke};ke-=Ot;continue}if(mt instanceof HTMLElement&&mt.dataset.segmentType==="attachment"){if(ke===0)return{node:I,offset:Xe};if(ke<=Ot){const yt=Qe[Xe+1];return ke===Ot&&(yt==null?void 0:yt.nodeType)===Node.TEXT_NODE?{node:yt,offset:0}:{node:I,offset:Xe+1}}ke-=Ot;continue}if(ke<=Ot)return{node:I,offset:Xe+1};ke-=Ot}return{node:I,offset:I.childNodes.length}}function Z(I){const ae=Kr.current;if(!ae||!I)return;const ke=$(ae,I.start),Qe=$(ae,I.end),Xe=document.createRange();Xe.setStart(ke.node,ke.offset),Xe.setEnd(Qe.node,Qe.offset);const mt=window.getSelection();mt==null||mt.removeAllRanges(),mt==null||mt.addRange(Xe)}function de(I){const ae=ba.current;if(ae.length===0)return!1;const ke=ae.at(-1);if(!ke)return!1;const Qe=Array.from(I.childNodes).find(Ot=>Ot instanceof HTMLElement&&Ot.dataset.segmentType==="attachment"&&Ot.dataset.clientId===ke);if(!(Qe instanceof HTMLElement))return!1;const Xe=document.createRange(),mt=Qe.nextSibling;(mt==null?void 0:mt.nodeType)===Node.TEXT_NODE?Xe.setStart(mt,0):Xe.setStartAfter(Qe),Xe.collapse(!0);const ft=window.getSelection();return ft==null||ft.removeAllRanges(),ft==null||ft.addRange(Xe),!0}function Ie(){const I=Kr.current;if(!I)return en;let ae="";for(const ke of Array.from(I.childNodes))ae+=Nl(ke);return m2(ae)}function je(I,ae,ke){const Qe=I==="photo"?"PHOTO":"FILE";let Xe=0;for(;;){const mt=Xe===0?ae:`${ae} (${Xe+1})`,ft=`[${Qe} ${mt}]`;if(!ke.has(ft))return ft;Xe+=1}}function ht(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function $e(I,ae,ke){const Qe=ae.start>0?I[ae.start-1]:"",Xe=ae.end<I.length?I[ae.end]:"",mt=!!(Qe&&!/\s/.test(Qe)),ft=!Xe||!/\s/.test(Xe);return`${mt?" ":""}${ke.join(" ")}${ft?" ":""}`}function Cn(I,ae){if(!I||I.length===0)return;const ke=Array.from(I),Qe=new Set(xa.map(Bt=>Bt.placeholder)),Xe=ke.map(Bt=>{const Ta=x2(Bt,ae),Ei=je(ae,y2(Ta),Qe);return Qe.add(Ei),{clientId:ht(),kind:ae,originalName:Ta,placeholder:Ei,file:Bt}}),mt=wn()??Vn.current,ft=mt?{start:mt.start,end:mt.end}:{start:en.length,end:en.length},Ot=$e(en,ft,Xe.map(Bt=>Bt.placeholder)),yt=`${en.slice(0,ft.start)}${Ot}${en.slice(ft.end)}`;pr(Bt=>({prompt:yt,attachments:[...Bt.attachments,...Xe]}));const Kt=Ot.endsWith(" ")?1:0,tr=ft.start+Ot.length-Kt;Fa.current={start:tr,end:tr},Vn.current={start:tr,end:tr},ba.current=Xe.map(Bt=>Bt.clientId),Me(null)}function bn(I){if(I.length===0)return;const ae={photo:I.filter(Bt=>c0(Bt)==="photo"),file:I.filter(Bt=>c0(Bt)==="file")},ke=[...ae.photo,...ae.file],Qe=new Set(xa.map(Bt=>Bt.placeholder)),Xe=ke.map(Bt=>{const Ta=c0(Bt),Ei=x2(Bt,Ta),ro=je(Ta,y2(Ei),Qe);return Qe.add(ro),{clientId:ht(),kind:Ta,originalName:Ei,placeholder:ro,file:Bt}}),mt=wn()??Vn.current,ft=mt?{start:mt.start,end:mt.end}:{start:en.length,end:en.length},Ot=$e(en,ft,Xe.map(Bt=>Bt.placeholder)),yt=`${en.slice(0,ft.start)}${Ot}${en.slice(ft.end)}`;pr(Bt=>({prompt:yt,attachments:[...Bt.attachments,...Xe]}));const Kt=Ot.endsWith(" ")?1:0,tr=ft.start+Ot.length-Kt;Fa.current={start:tr,end:tr},Vn.current={start:tr,end:tr},ba.current=Xe.map(Bt=>Bt.clientId),Me(null)}function ta(I){if(!I)return;const ae=wn()??Vn.current,ke=(ae==null?void 0:ae.start)??en.length,Qe=(ae==null?void 0:ae.end)??ke,Xe=m2(I),mt=`${en.slice(0,ke)}${Xe}${en.slice(Qe)}`;pr(Ot=>({prompt:mt,attachments:Ot.attachments}));const ft=ke+Xe.length;Fa.current={start:ft,end:ft},Vn.current={start:ft,end:ft}}T.useEffect(()=>{function I(ae){(typeof ae.composedPath=="function"?ae.composedPath():[]).some(Xe=>Xe instanceof HTMLElement&&(Xe.dataset.composerMenuSurface==="true"||Xe.dataset.composerMenuTrigger==="true"))||St&&Me(null)}if(St)return window.addEventListener("pointerdown",I),()=>{window.removeEventListener("pointerdown",I)}},[St]),T.useLayoutEffect(()=>{const I=Kr.current;if(!I||ln)return;const ae=Fa.current,ke=Ie()!==en||ur.current!==ya||ci.current!==di;if(ke){const Qe=document.createDocumentFragment();for(const Xe of $a){if(Xe.type==="text"){Qe.append(document.createTextNode(Xe.text===" "?" ":Xe.text));continue}const mt=Xe.attachment,ft=document.createElement("span");if(ft.dataset.segmentType="attachment",ft.dataset.clientId=mt.clientId,ft.dataset.placeholder=mt.placeholder,ft.contentEditable="false",ft.className="mx-[0.12rem] inline-flex max-w-full align-baseline",mt.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 Ot=_r[mt.clientId];if(Ot){const Kt=document.createElement("img");Kt.src=Ot,Kt.alt=mt.originalName||"Pasted image",Kt.className="h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",Kt.draggable=!1,ft.append(Kt)}else{const Kt=document.createElement("span");Kt.className="inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",Kt.setAttribute("aria-hidden","true"),ft.append(Kt)}const yt=document.createElement("span");yt.className="ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",yt.textContent=_2(mt),ft.append(yt)}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 Ot=document.createElement("span");Ot.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]",Ot.textContent="FILE";const yt=document.createElement("span");yt.className="inline-flex max-w-[10rem] truncate",yt.textContent=_2(mt),ft.append(Ot,yt)}Qe.append(ft)}I.replaceChildren(Qe),ur.current=ya,ci.current=di}ae!==null?(I.focus(),de(I)||Z(ae),Vn.current=ae):document.activeElement===I&&ke&&Z(Vn.current),Fa.current=null,ba.current=[]},[_r,di,ln,ya,en,$a]);function Gn(){var I;(I=Kr.current)==null||I.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function rn(){var I;if(Gn(),Me(null),!!((I=navigator.clipboard)!=null&&I.readText))try{const ae=await navigator.clipboard.readText();ta(ae)}catch{return}}async function Wt(){if(Jn&&!ln){await mi();return}if(!ln&&!en.trim())return;const I=ln?en:en.trim(),ae=ln?[]:xa.filter(ke=>I.includes(ke.placeholder));await V(ae.length>0?{prompt:I,attachments:ae}:{prompt:I}),pr(()=>({prompt:"",attachments:[]}))}async function Ae(I){I.preventDefault(),await Wt()}function Ze(){const I=Ie(),ae=wn();Vn.current=ae;const ke=Kr.current;(ke?e4(ke):!1)&&(Fa.current=ae,Cs(Xe=>Xe+1)),pr(Xe=>({prompt:I,attachments:Xe.attachments.filter(mt=>I.includes(mt.placeholder))}))}function st(I){var ke,Qe,Xe,mt;const ae=pg((ke=I.clipboardData)==null?void 0:ke.items,(Qe=I.clipboardData)==null?void 0:Qe.files);if(ae.length===0){const ft=((Xe=I.clipboardData)==null?void 0:Xe.getData("text/plain"))??"",Ot=((mt=I.clipboardData)==null?void 0:mt.getData("text/html"))??"",yt=ft||J6(Ot);if(!yt&&!Ot)return;I.preventDefault(),ta(yt);return}I.preventDefault(),bn(ae)}function an(I){var ae,ke;E2((ae=I.dataTransfer)==null?void 0:ae.items,(ke=I.dataTransfer)==null?void 0:ke.files)&&(I.preventDefault(),Zr(!0))}function It(I){var ae,ke;E2((ae=I.dataTransfer)==null?void 0:ae.items,(ke=I.dataTransfer)==null?void 0:ke.files)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),Zr(!0))}function tn(I){I.currentTarget.contains(I.relatedTarget)||Zr(!1)}function Ln(I){var ke,Qe;const ae=pg((ke=I.dataTransfer)==null?void 0:ke.items,(Qe=I.dataTransfer)==null?void 0:Qe.files);ae.length!==0&&(I.preventDefault(),Zr(!1),bn(ae))}function In(I){I.key==="Enter"&&(!I.metaKey&&!I.ctrlKey||(I.preventDefault(),!(n||S)&&Wt()))}async function Hr(I){await(tt==null?void 0:tt(I)),Me(null)}const _a=Jn?"Describe the goal the backend should continue working toward...":N??(ln?"Send shell input to the attached terminal...":"Ask the backend to inspect, modify, or explain code..."),ad=ln?"Send Ctrl-C":"Stop Current Turn",tm=Jn?_n?"Setting...":"Set goal":!C&&n?"Connecting...":C&&n&&!ln?"Sending...":"Send",nm=C?Jn?"ui-action-info":"ui-action-primary":"ui-action-danger",xu=r,rm=t||ws?"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",sd=`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] ${Tr?"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 f.jsxs("div",{className:"relative z-20 shrink-0",children:[f.jsx("input",{ref:oi,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{Cn(I.target.files,"photo"),I.target.value=""}}),f.jsx("input",{ref:ui,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{Cn(I.target.files,"file"),I.target.value=""}}),e==="chat"&&f.jsx("button",{type:"button","aria-label":"Jump to latest",title:w?"Latest turn is in view":"Jump to the latest messages",onClick:()=>De==null?void 0:De(),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:f.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 ${w?"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:f.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:f.jsx("path",{d:"m4 6 4 4 4-4"})})})}),f.jsxs("form",{ref:rs,onSubmit:Ae,className:rm,children:[f.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:[f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!ln&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>Me(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:f.jsx(a4,{})}),St==="slash"&&f.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:qe==="root"?f.jsxs("div",{className:"p-2",children:[Ye.map((I,ae)=>f.jsx("button",{type:"button",disabled:is(I),onClick:ke=>cl(I,ke),className:`${vr(I)} ${ae===0?"mt-0":""}`,title:I.description??I.label,children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:I.command}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Ns(I)})]})},`${I.action}:${I.command}`)),Ye.length===0?f.jsx("p",{className:"px-3 py-2 text-sm text-stone-400",children:"No backend tools are available for this thread."}):null]}):f.jsx("div",{className:"max-h-80 overflow-auto",children:qe==="fork"?f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",disabled:n||Mn,onClick:()=>void hi(),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:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"Fork from latest"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Mn?"Forking":"Run"})]})}),f.jsx("button",{type:"button",disabled:n||Mn,onClick:I=>{I.stopPropagation(),zt("forkTurns"),we==null||we()},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:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"Fork from selected turn"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?f.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]}):qe==="forkTurns"?f.jsxs("div",{className:"p-2",children:[Q.status==="loading"&&!Q.data?f.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,Q.error?f.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:Q.error}):null,(id=Q.data)!=null&&id.length?f.jsx("div",{className:"space-y-2",children:Q.data.map(I=>f.jsx("button",{type:"button",disabled:Mn,onClick:()=>void Ss(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:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",I.turnIndex]}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:Mn?"Forking":I.status})]})},I.turnId))}):null,Q.status!=="loading"&&!Q.error&&(((ld=Q.data)==null?void 0:ld.length)??0)===0?f.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]}):qe==="skills"?f.jsxs("div",{className:"p-2",children:[M.status==="loading"&&!M.data?f.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,M.error?f.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:M.error}):null,(od=M.data)!=null&&od.skills.length?f.jsx("div",{className:"space-y-2",children:M.data.skills.map(I=>{var ae,ke;return f.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((ae=I.interface)==null?void 0:ae.displayName)??I.name}),f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:i4(I.scope)}),f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${ts===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 fi(I.name),title:`Copy $${I.name}`,"aria-label":`Copy $${I.name}`,children:[f.jsx(d0,{}),"$",I.name]})]}),f.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((ke=I.interface)==null?void 0:ke.shortDescription)??I.shortDescription??I.description})]})},I.path)})}):null,(ud=M.data)!=null&&ud.errors.length?f.jsx("div",{className:"mt-2 space-y-2",children:M.data.errors.map(I=>f.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:[f.jsx("p",{className:"font-medium",children:I.message}),f.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,M.status!=="loading"&&!M.error&&(((cd=M.data)==null?void 0:cd.skills.length)??0)===0&&(((dd=M.data)==null?void 0:dd.errors.length)??0)===0?f.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]}):qe==="hooks"?f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),f.jsx("p",{className:"truncate text-[11px] text-stone-500",children:((fd=G.data)==null?void 0:fd.projectHooksPath)??"<workspace hooks config>"})]}),yn==="list"&&ve.hostConfigFiles?f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),As(),nt("add"),pt(null),Yt(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]}),G.status==="loading"&&!G.data?f.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,G.error?f.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,$t?f.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:$t}):null,Br?f.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:Br}):null,yn==="add"||yn==="edit"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[yn==="edit"?f.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing ",c4((Be==null?void 0:Be.eventName)??kn)," in"," ",(Be==null?void 0:Be.scope)==="global"?"global":"project"," hooks.json"]}):null,f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",f.jsxs("select",{"aria-label":"Hook scope",value:lr,onChange:I=>ge(I.target.value),disabled:yn==="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:[f.jsx("option",{value:"project",children:"Project"}),f.jsx("option",{value:"global",children:"Global"})]})]}),f.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",f.jsx("select",{"aria-label":"Hook event",value:kn,onChange:I=>xe(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:Gf.map(I=>f.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),f.jsx("input",{"aria-label":"Hook matcher",value:Oe,onChange:I=>Ke(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"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),f.jsx("textarea",{"aria-label":"Hook command",value:Pe,onChange:I=>it(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"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",f.jsx("input",{"aria-label":"Hook timeout seconds",value:X,onChange:I=>Ee(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"})]}),f.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",f.jsx("input",{"aria-label":"Hook status message",value:at,onChange:I=>Ue(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"})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>{nt("list"),gt(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"}),f.jsx("button",{type:"button",onClick:()=>void Ls(),disabled:Pt,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Pt?"Saving…":yn==="edit"?"Update Hook":"Write Hook"})]})]}):null,yn==="list"&&((no=G.data)!=null&&no.warnings.length)?f.jsx("div",{className:"mb-2 space-y-2",children:G.data.warnings.map(I=>f.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,yn==="list"&&((yi=G.data)!=null&&yi.errors.length)?f.jsx("div",{className:"mb-2 space-y-2",children:G.data.errors.map(I=>f.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:[f.jsx("p",{className:"font-medium",children:I.message}),f.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,yn==="list"&&((hd=G.data)!=null&&hd.hooks.length)?f.jsx("div",{className:"space-y-2",children:G.data.hooks.map(I=>f.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[l4(I.eventName),I.matcher?` · ${I.matcher}`:""]}),f.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:I.command??I.handlerType}),I.statusMessage?f.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:I.statusMessage}):null]}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[g2(I)?f.jsx("button",{type:"button",onClick:ae=>{ae.stopPropagation(),Jr(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,ve.hookTrust&&I.trustStatus==="trusted"&&!I.isManaged?f.jsx("button",{type:"button",disabled:Pt,onClick:ae=>{ae.stopPropagation(),dl(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&&ve.hookTrust?f.jsx("button",{type:"button",disabled:Pt||!I.currentHash,onClick:ae=>{ae.stopPropagation(),Is(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,f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:u4(I.trustStatus)})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:o4(I.source)}),f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:I.enabled?"Enabled":"Disabled"}),f.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[I.timeoutSec,"s"]})]})]},I.key))}):null,yn==="list"&&G.status!=="loading"&&!G.error&&(((yu=G.data)==null?void 0:yu.hooks.length)??0)===0?f.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]}):f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),f.jsx("p",{className:"truncate text-[11px] text-stone-500",children:eo??"<provider config>"})]}),mn==="list"&&ve.mcpConfigEditing?f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Xt("add"),Rn(null),Er(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]}),B.status==="loading"&&!B.data?f.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,B.error?f.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,Fn?f.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:Fn}):null,li?f.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:li}):null,mn==="add"?f.jsxs("div",{className:"space-y-2",children:[f.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Xt("http"),Rn(null),Er(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:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),f.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."})]}),f.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Rs()},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:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),f.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,mn==="http"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),f.jsx("input",{"aria-label":"MCP name",value:Xr,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"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),f.jsx("input",{"aria-label":"URL",value:il,onChange:I=>ii(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"})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>Xt("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"}),f.jsx("button",{type:"button",onClick:()=>void xi(),disabled:Rr,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Rr?"Saving…":"Write HTTP MCP"})]})]}):null,mn==="stdio"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[f.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for provider config"}),f.jsx("textarea",{"aria-label":"MCP block for provider config",value:ma,onChange:I=>za(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"}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>Xt("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"}),f.jsx("button",{type:"button",onClick:()=>void to(),disabled:Rr,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Rr?"Saving…":"Write raw block"})]})]}):null,mn==="list"&&((Eu=B.data)!=null&&Eu.servers.length)?f.jsx("div",{className:"space-y-2",children:B.data.servers.map(I=>f.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:I.name}),f.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[I.tools.length," tools · ",I.resourceCount," ","resources · ",I.resourceTemplateCount," templates"]})]}),f.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:s4(I.authStatus)})]}),I.tools.length>0?f.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,mn==="list"&&B.status!=="loading"&&!B.error&&(((_u=B.data)==null?void 0:_u.servers.length)??0)===0?f.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]})})})]}),!ln&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>Me(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:f.jsx(r4,{})}),St==="attachments"&&f.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:f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",onClick:()=>{var I;Gn(),(I=oi.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"}),f.jsx("button",{type:"button",onClick:()=>{var I;Gn(),(I=ui.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"})]})})]}),f.jsx("button",{type:"button","aria-label":ln?"Switch to chat":"Switch to shell",title:ln?"Switch to chat":"Switch to shell",onClick:()=>dt==null?void 0:dt(),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:ln?f.jsx(_4,{}):f.jsx(n4,{})})]}),f.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[ln&&as&&f.jsx("span",{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:as,children:as}),ws&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":St==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":St==="shellTools",title:St==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{Gn(),Me(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:f.jsx(T4,{})}),St==="shellTools"&&f.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:f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsx("button",{type:"button",onClick:()=>void rn(),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:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(d0,{}),f.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),f.jsx("button",{type:"button",onClick:()=>{Gn(),Me(null),Ct==null||Ct()},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:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(d0,{}),f.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),f.jsx("button",{type:"button",disabled:n,onClick:()=>{Gn(),Me(null),V({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"CLEAR",tone:"sky"})}),f.jsx("button",{type:"button",disabled:!(A!=null&&A.shellInputEnabled)||!(A!=null&&A.isCommandRunning),onClick:()=>{Gn(),Me(null),bt==null||bt("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"CTRL-C",tone:"rose"})}),f.jsx("button",{type:"button",disabled:!(A!=null&&A.shellInputEnabled),onClick:()=>{Gn(),Me(null),bt==null||bt("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"CTRL-D"})}),f.jsx("button",{type:"button",disabled:!(A!=null&&A.shellInputEnabled),onClick:()=>{Gn(),Me(null),bt==null||bt("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"ESC"})}),f.jsx("button",{type:"button",disabled:!(A!=null&&A.shellInputEnabled),onClick:()=>{Gn(),Me(null),bt==null||bt("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"TAB"})}),f.jsx("button",{type:"button",disabled:!(A!=null&&A.shellInputEnabled),onClick:()=>{Gn(),Me(null),bt==null||bt("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"UP"})}),f.jsx("button",{type:"button",disabled:!(A!=null&&A.shellInputEnabled),onClick:()=>{Gn(),Me(null),bt==null||bt("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Al,{label:"DOWN"})})]})})]})]})]}),Jn&&!ln&&f.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:[f.jsx("span",{className:"font-medium uppercase tracking-[0.16em] text-sky-100/90",children:"Goal"}),f.jsxs("label",{className:"flex items-center gap-2 text-stone-300",children:[f.jsx("span",{children:"Max tokens (k)"}),f.jsx("input",{"aria-label":"Goal token budget",value:ns,onChange:I=>ga(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"})]}),ol?f.jsx("span",{className:"min-w-0 flex-1 text-rose-200",children:ol}):null,f.jsx("button",{type:"button",onClick:ss,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"})]}),f.jsxs("div",{className:"relative",children:[ln?f.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:en,onChange:I=>bu(I.target.value),onKeyDown:In,rows:2,placeholder:_a,className:`${sd} resize-y pb-10`}):f.jsxs("div",{className:sd,children:[en.length===0&&f.jsx("span",{className:"pointer-events-none absolute left-4 top-2.5 text-stone-500",children:_a}),f.jsx("div",{ref:Kr,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!S,suppressContentEditableWarning:!0,onInput:()=>Ze(),onPaste:st,onKeyDown:In,onKeyUp:()=>{Vn.current=wn()},onMouseUp:()=>{Vn.current=wn()},onBlur:()=>{Vn.current=wn(),Zr(!1)},onDragEnter:an,onDragOver:It,onDragLeave:tn,onDrop:Ln,className:`relative z-[1] min-h-[5.75rem] whitespace-pre-wrap break-words pb-10 outline-none sm:min-h-[4.875rem] ${S?"cursor-not-allowed text-stone-500":""}`})]}),f.jsx("button",{type:"button","aria-label":ad,title:ad,onClick:()=>void(Te==null?void 0:Te()),disabled:!At,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${At?"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:f.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),f.jsx("button",{type:"submit","aria-label":Jn&&!ln?"Set goal":ln?"Send Shell Input":"Send Prompt",onMouseDown:I=>{I.preventDefault()},onPointerDown:I=>{I.preventDefault()},onTouchStart:I=>{I.preventDefault()},disabled:_n||n||(e==="chat"?S:!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 ${nm}`,children:tm}),!ln&&f.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:[f.jsxs("div",{className:"relative min-w-0",children:[f.jsxs("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":St==="model","aria-label":o??"Select model",disabled:xu||p.length===0,onClick:()=>Me(I=>I==="model"?null:"model"),title:d?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${pi}`:pi,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:[o?f.jsx(y4,{contextUsage:g}):null,f.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:o??"Select model"})]}),St==="model"&&f.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:f.jsx("div",{className:"max-h-72 overflow-auto p-2",children:p.map(I=>f.jsx("button",{type:"button",onClick:()=>void Hr({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:f.jsx("p",{className:"text-sm font-medium",children:I.model})},I.id))})})]}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":St==="effort",disabled:xu||gi.length===0,onClick:()=>Me(I=>I==="effort"?null:"effort"),title:d?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":void 0,className:"thread-composer-inline-toggle rounded-full px-2 py-1 text-stone-500 transition disabled:cursor-not-allowed disabled:text-stone-700",children:p2(c)}),St==="effort"&&f.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:f.jsx("div",{className:"max-h-72 overflow-auto p-2",children:gi.map(I=>f.jsx("button",{type:"button",onClick:()=>void Hr({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:f.jsx("p",{className:"text-sm font-medium",children:p2(I.reasoningEffort)})},I.reasoningEffort))})})]}),f.jsx("button",{type:"button","aria-pressed":m==="plan",disabled:r,onClick:()=>void Hr({collaborationMode:m==="plan"?"default":"plan"}),className:`thread-composer-inline-toggle rounded-full px-2.5 py-1 transition ${m==="plan"?"bg-sky-300/18 text-sky-100":"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"})]})]}),l&&f.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 v4="modulepreload",k4=function(e){return"/"+e},T2={},D=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(m){return Promise.all(m.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]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=o(n.map(m=>{if(m=k4(m),m in T2)return;T2[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=p?"stylesheet":v4,p||(y.as="script"),y.crossOrigin="",y.href=m,d&&y.setAttribute("nonce",d),document.head.appendChild(y),p)return new Promise((E,v)=>{y.addEventListener("load",E),y.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${m}`)))})}))}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 v2(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 w4(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 k2(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 d=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&&(d+=`\x1B[${g}A`),d+=`\r\x1B[${n+1}G`}e.reset(),e.write(d,()=>{e.scrollToBottom()})}function C4(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function h0(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 Xv(e){return e.replace(/\r\n/g,`
|
|
86
|
+
`).replace(/\r/g,`
|
|
87
|
+
`)}function w2(e){const t=Xv(e),n=t.split(`
|
|
88
|
+
`);return t.endsWith(`
|
|
89
|
+
`)&&n.at(-1)===""&&n.pop(),n}function S4(e){const t=e.trim();return t?/(?:[$%#>])\s*$/.test(t):!1}function N4(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 A4(e,t,n){var d,m;const r=w2(e),i=w2(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=N4(c,n);c.length>0&&((d=c[0])==null?void 0:d.trim())==="";)c.shift();for(;c.length>0&&(((m=c.at(-1))==null?void 0:m.trim())===""||S4(c.at(-1)??""));)c.pop();return c.join(`
|
|
90
|
+
`).trimEnd()}function m0(e){if(!e)return"";const t=e.replace(/[\\/]+$/,"");return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function p0(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 R4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[f.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"}),f.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"}),f.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 L4({connected:e}){return e?f.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:f.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"})}):f.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:f.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 C2(){return f.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:[f.jsx("path",{d:"M5.5 3.25h5"}),f.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 Rl({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 f.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 I4(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 O4=T.forwardRef(function({threadId:t,isVisible:n=!0,showHeader:r=!0,showFloatingToolbox:i=!0,onStateChange:l},o){var En,kn;const c=Wl(),d=T.useRef(null),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null),y=T.useRef(null),E=T.useRef(null),v=T.useRef(0),w=T.useRef(""),C=T.useRef(null),S=T.useRef(""),N=T.useRef(null),A=T.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),z=T.useRef(!1),Y=T.useRef(null),[M,B]=T.useState(null),[G,ce]=T.useState(null),[Q,he]=T.useState(!0),[V,Te]=T.useState(!1),[me,ne]=T.useState(null),[H,F]=T.useState(0),[K,oe]=T.useState(!1),[R,U]=T.useState(!1),[te,O]=T.useState(!1),[we,Re]=T.useState(null),[Se,Ge]=T.useState(!1),[Fe,De]=T.useState(null),tt=(c==null?void 0:c.effectiveTheme)??"dark",dt=T.useCallback((xe,Oe)=>{De({tone:xe,text:Oe}),Y.current!==null&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{De(null),Y.current=null},1800)},[]),Ct=T.useCallback(xe=>{var it;const Oe=p.current,Ke=y.current,Pe=g.current;return!Oe||!Ke||!Pe?!1:(Oe.send({type:"shell.input",shellId:Ke,viewerId:Pe,data:xe}),R||(it=d.current)==null||it.focus(),!0)},[R]),bt=T.useCallback(()=>{var Pe;const xe=p.current,Oe=y.current,Ke=g.current;return!xe||!Oe||!Ke?!1:(xe.send({type:"shell.clear",shellId:Oe,viewerId:Ke}),R||(Pe=d.current)==null||Pe.focus(),!0)},[R]),At=T.useCallback(xe=>{const Oe=d.current,Ke=m.current;!Oe||!Ke||(Ke.fit(),w.current&&!h0(M)?k2(Oe,w.current,A.current.cursorX,A.current.cursorY,A.current.paneHeight):Oe.scrollToBottom(),xe!=null&&xe.focus&&!R&&Oe.focus())},[R,M]),Tt=(G==null?void 0:G.state)??"not_created",ot=T.useMemo(()=>(G==null?void 0:G.shell)??null,[G==null?void 0:G.shell]),St=!!(g.current&&ot),Me=T.useMemo(()=>p0(m0(ot==null?void 0:ot.cwd),null),[ot==null?void 0:ot.cwd]),qe=we??Me,zt=V||Q||Tt==="creating"||Tt==="workspace_missing",mn=Tt==="attached"?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":Tt==="exited"||Tt==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":Tt==="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",Xt=Tt==="attached"?"Disconnect shell":Tt==="exited"||Tt==="not_found"?"Restart shell":ot?"Connect shell":"Create shell",yn=(Fe==null?void 0:Fe.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(Fe==null?void 0:Fe.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",nt=T.useCallback(async()=>{he(!0);try{const xe=await g6(t);ce(xe),ne(null)}catch(xe){ne(xe instanceof Error?xe.message:"Unable to load shell state.")}finally{he(!1)}},[t]);T.useEffect(()=>{nt()},[nt]),T.useEffect(()=>{var xe;y.current=((xe=G==null?void 0:G.shell)==null?void 0:xe.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 xe=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),Oe=()=>{U(xe.matches),xe.matches||O(!1)};return Oe(),xe.addEventListener("change",Oe),()=>{xe.removeEventListener("change",Oe)}},[]),T.useEffect(()=>()=>{Y.current!==null&&window.clearTimeout(Y.current)},[]),T.useEffect(()=>{if(!M||d.current)return;let xe=!1,Oe=null;return(async()=>{const[{Terminal:Ke},{FitAddon:Pe}]=await Promise.all([D(()=>import("./xterm-DisVWgDR.js").then(Ee=>Ee.x),[]),D(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(xe||!M)return;const it=new Ke({cursorBlink:!0,disableStdin:R,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:v2(tt)}),X=new Pe;it.loadAddon(X),it.open(M),X.fit(),it.attachCustomKeyEventHandler(Ee=>{if(R||Ee.type!=="keydown")return!0;if(Ee.ctrlKey&&!Ee.altKey&&!Ee.metaKey&&!Ee.shiftKey){const at=C4(Ee.key);return at&&Ct(at)?(Ee.preventDefault(),!1):!0}return!0}),d.current=it,m.current=X,oe(!0),N.current=new ResizeObserver(()=>{At(),p.current&&y.current&&g.current&&p.current.send({type:"shell.resize",shellId:y.current,viewerId:g.current,cols:it.cols,rows:it.rows})}),N.current.observe(M),Oe=it.onData(Ee=>{R||Ct(Ee)})})(),()=>{var Ke,Pe;xe=!0,Oe==null||Oe.dispose(),(Ke=N.current)==null||Ke.disconnect(),N.current=null,oe(!1),(Pe=d.current)==null||Pe.dispose(),d.current=null,m.current=null}},[R,At,Ct,M]),T.useEffect(()=>{if(!n||!K)return;let xe=window.requestAnimationFrame(()=>{At({focus:!0})});return()=>{window.cancelAnimationFrame(xe)}},[n,At,K]),T.useEffect(()=>{const xe=d.current;xe&&(xe.options.disableStdin=R)},[R]),T.useEffect(()=>{var X;const xe=E.current,Oe=(X=xe==null?void 0:xe.shell)==null?void 0:X.id;if(!Oe)return;const Ke=xe==null?void 0:xe.state;if(Ke==="not_created"||Ke==="workspace_missing"||Ke==="creating"||Ke==="not_found"||Ke==="exited")return;const Pe=d.current;if(!Pe||!K||H===v.current)return;v.current=H,Pe.reset(),ne(null),g.current=null,Pe.focus();const it=F6({onConnected:()=>{it.send({type:"shell.attach",shellId:Oe,cols:Pe.cols,rows:Pe.rows})},onShellEvent:Ee=>{if(Ee.shellId!==Oe)return;if(Ee.type==="shell.connected"){const Ue=String(Ee.payload.viewerId??"");g.current=Ue||null,ce(Be=>Be&&{...Be,state:"attached",shell:Be.shell?{...Be.shell,status:"attached",attachedViewerId:Ue}:Be.shell});return}if(Ee.type==="shell.output"){const Ue=typeof Ee.payload.data=="string"?Ee.payload.data:"",Be=Ee.payload.replace===!0,gt=typeof Ee.payload.cursorX=="number"?Ee.payload.cursorX:void 0,Pt=typeof Ee.payload.cursorY=="number"?Ee.payload.cursorY:void 0,Je=typeof Ee.payload.paneHeight=="number"?Ee.payload.paneHeight:void 0,$t=typeof Ee.payload.cwdBaseName=="string"?Ee.payload.cwdBaseName:null,pt=typeof Ee.payload.envPrefix=="string"?Ee.payload.envPrefix:null,Br=p0($t??m0(ot==null?void 0:ot.cwd),pt),Yt=Ee.payload.isCommandRunning===!0;if(A.current={cursorX:gt,cursorY:Pt,paneHeight:Je},Re(Br),Ge(Yt),z.current=Yt,Ue)if(Be){const Xr=Xv(Ue);w.current=Xr,k2(Pe,Ue,gt,Pt,Je),!Yt&&C.current&&(S.current=A4(C.current.beforeSnapshot,Xr,C.current.command),C.current=null)}else Pe.write(Ue);return}if(Ee.type==="shell.error"){ne(String(Ee.payload.message??"Shell connection failed.")),Ee.payload.code==="viewer_conflict"&&ce(Ue=>Ue&&{...Ue,state:"detached",shell:Ue.shell?{...Ue.shell,status:"detached",attachedViewerId:null}:Ue.shell});return}if(Ee.type==="shell.detached"){const Ue=String(Ee.payload.viewerId??""),Be=String(Ee.payload.reason??"");Ue&&Ue===g.current&&(g.current=null,ce(gt=>gt&&{...gt,state:"detached",shell:gt.shell?{...gt.shell,status:"detached",attachedViewerId:null}:gt.shell}),ne(Be==="replaced"?"This shell connection was taken over by another device.":null),Ge(!1),z.current=!1,it.socket.close());return}if(Ee.type==="shell.exited"){g.current=null,Ge(!1),z.current=!1;const Ue=Ee.payload.state==="exited"?"exited":"not_found";ce(Be=>Be&&{...Be,state:Ue,shell:Be.shell?{...Be.shell,status:Ue,attachedViewerId:null}:Be.shell});return}const at=Ee.payload.state;at&&(at!=="attached"&&(g.current=null,Ge(!1),z.current=!1),ce(Ue=>Ue&&{...Ue,state:at,shell:Ue.shell?{...Ue.shell,status:at==="attached"||at==="detached"?at:Ue.shell.status,attachedViewerId:at==="attached"?Ue.shell.attachedViewerId:null}:Ue.shell}))}});return p.current=it,it.socket.addEventListener("close",()=>{var Ee;((Ee=p.current)==null?void 0:Ee.socket)===it.socket&&(p.current=null)}),()=>{var at;const Ee=g.current;Ee&&it.send({type:"shell.detach",shellId:Oe,viewerId:Ee}),g.current=null,it.socket.close(),((at=p.current)==null?void 0:at.socket)===it.socket&&(p.current=null)}},[H,ot==null?void 0:ot.cwd,(kn=G==null?void 0:G.shell)==null?void 0:kn.id,K]);const lr=T.useCallback(async()=>{Te(!0);try{const xe=d.current,Oe=await y6(t,{...(xe==null?void 0:xe.cols)!==void 0?{cols:xe.cols}:{},...(xe==null?void 0:xe.rows)!==void 0?{rows:xe.rows}:{}});ce(Oe),F(Ke=>Ke+1),ne(null)}catch(xe){ne(xe instanceof Qt?xe.payload.message:"Unable to create shell.")}finally{Te(!1)}},[t]),ge=T.useCallback(async()=>{if(Tt==="exited"||Tt==="not_found"){await lr();return}ne(null),F(xe=>xe+1)},[lr,Tt]),ve=T.useCallback(async()=>{if(G!=null&&G.shell){Te(!0);try{await E6(G.shell.id),await nt(),ne(null)}catch(xe){ne(xe instanceof Qt?xe.payload.message:"Unable to terminate shell.")}finally{Te(!1)}}},[nt,G==null?void 0:G.shell]),Ye=T.useCallback(()=>{var Pe;const xe=p.current,Oe=y.current,Ke=g.current;!xe||!Oe||(Ke&&xe.send({type:"shell.detach",shellId:Oe,viewerId:Ke}),g.current=null,xe.socket.close(),((Pe=p.current)==null?void 0:Pe.socket)===xe.socket&&(p.current=null),ne(null),ce(it=>it&&{...it,state:"detached",shell:it.shell?{...it.shell,status:"detached",attachedViewerId:null}:it.shell}))},[tt]);T.useEffect(()=>{d.current&&(d.current.options.theme=v2(tt))},[tt]);const rt=T.useCallback(async()=>{if(!(V||Q||Tt==="creating"||Tt==="workspace_missing")){if(Tt==="attached"){Ye();return}if(Tt==="exited"||Tt==="not_found"||!ot){await lr();return}await ge()}},[V,lr,Ye,ge,Q,ot,Tt]),vt=T.useCallback(async()=>{var xe,Oe,Ke,Pe;try{const it=((Oe=(xe=d.current)==null?void 0:xe.getSelection())==null?void 0:Oe.trim())||((Pe=(Ke=window.getSelection)==null?void 0:Ke.call(window))==null?void 0:Pe.toString().trim())||h0(M);return it?(await navigator.clipboard.writeText(it),dt("done","Copied"),!0):(dt("failed","Nothing to copy"),!1)}catch{return dt("failed","Copy failed"),!1}},[M,dt]);return T.useEffect(()=>{if(!(ot!=null&&ot.cwd)){Re(null);return}Re(xe=>xe??p0(m0(ot.cwd),null))},[ot==null?void 0:ot.cwd]),T.useEffect(()=>{l==null||l({status:Tt,connectionButtonDisabled:zt,connectionButtonLabel:Xt,shellInputEnabled:St,isCommandRunning:Se,promptLabel:qe,isMobileShell:R,hasShell:!!ot,busy:V,loading:Q,error:me})},[V,zt,Xt,me,R,Se,Q,l,qe,ot,St,Tt]),T.useImperativeHandle(o,()=>({async toggleConnection(){await rt()},sendInput(xe){return Ct(xe)},sendCommand(xe){const Oe={command:xe,beforeSnapshot:w.current};if(C.current=Oe,xe.trim()==="clear"){const it=bt();return!it&&C.current===Oe&&(C.current=null),it}const Ke=xe.endsWith(`
|
|
91
|
+
`)?xe:`${xe}
|
|
92
|
+
`,Pe=Ct(Ke);return!Pe&&C.current===Oe&&(C.current=null),Pe},sendControl(xe){return xe==="clear"?bt():Ct(I4(xe))},async copyLastCommandOutput(){const xe=S.current.trim()||h0(M);if(!xe)return dt("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(xe),dt("done","Copied"),!0}catch{return dt("failed","Copy failed"),!1}},async terminate(){await ve()},focus(){var xe;(xe=d.current)==null||xe.focus()},refreshLayout(xe){At(xe)}}),[rt,ve,At,bt,Ct,dt,M]),f.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[r&&f.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),f.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:qe??(ot==null?void 0:ot.cwd)??"Create a durable shell for this thread."})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{type:"button","aria-label":Xt,title:`${Xt} (${w4(Tt)})`,disabled:zt,onClick:()=>void rt(),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 ${mn}`,children:f.jsx(L4,{connected:Tt==="attached"})}),ot&&f.jsx("button",{type:"button",disabled:V,onClick:()=>void ve(),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"})]})]}),(me||Q||(G==null?void 0:G.workspacePathStatus)==="missing")&&f.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[Q&&f.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!Q&&(G==null?void 0:G.workspacePathStatus)==="missing"&&f.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&&me&&f.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:me})]})]}),f.jsx("div",{className:"min-h-0 flex-1",children:Tt==="not_created"||Tt==="workspace_missing"?f.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:f.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[f.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),f.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."})]})}):f.jsx("div",{className:"h-full min-h-0 p-2 sm:p-3",children:f.jsxs("div",{className:"shell-terminal-frame relative h-full rounded-[1.4rem] border shadow-inner",children:[!r&&(me||Q||(G==null?void 0:G.workspacePathStatus)==="missing")&&f.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&&f.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!Q&&(G==null?void 0:G.workspacePathStatus)==="missing"&&f.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&&me&&f.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:me})]}),f.jsx("div",{ref:B,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${R?"mobile-shell-selectable":""}`,onMouseDown:()=>{var xe;(xe=d.current)==null||xe.focus()}}),i&&R&&f.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[Fe&&f.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${yn}`,children:Fe.text}),te&&f.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsx("button",{type:"button",onClick:()=>{dt("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:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(C2,{}),f.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),f.jsx("button",{type:"button",onClick:()=>void vt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(C2,{}),f.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),f.jsx("button",{type:"button",disabled:!St,onClick:()=>{bt()?dt("done","Cleared"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"CLEAR",tone:"sky"})}),f.jsx("button",{type:"button",disabled:!St||!Se,onClick:()=>{Ct("")?dt("done","Sent Ctrl-C"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"CTRL-C",tone:"rose"})}),f.jsx("button",{type:"button",disabled:!St,onClick:()=>{Ct("")?dt("done","Sent Ctrl-D"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"CTRL-D",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!St,onClick:()=>{Ct("\x1B")?dt("done","Sent Esc"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"ESC",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!St,onClick:()=>{Ct(" ")?dt("done","Sent Tab"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"TAB",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!St,onClick:()=>{Ct("\x1B[A")?dt("done","Sent Up"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"UP",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!St,onClick:()=>{Ct("\x1B[B")?dt("done","Sent Down"):dt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Rl,{label:"DOWN",tone:"stone"})})]})}),f.jsx("button",{type:"button","aria-expanded":te,"aria-label":te?"Close shell tools":"Open shell tools",onClick:()=>O(xe=>!xe),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:f.jsx(R4,{})})]})]})})})]})});let Kn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function D4(e){return E1(e)}function E1(e){return Array.isArray(e)?j4(e):e instanceof RegExp?e:typeof e=="object"?M4(e):e}function j4(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=E1(e[n]);return t}function M4(e){let t={};for(let n in e)t[n]=E1(e[n]);return t}function Kv(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Zv(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Zv(e.substring(0,e.length-1)):e.substr(~t+1)}var g0=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,xf=class{static hasCaptures(e){return e===null?!1:(g0.lastIndex=0,g0.test(e))}static replaceCaptures(e,t,n){return e.replace(g0,(r,i,l,o)=>{let c=n[parseInt(i||l,10)];if(c){let d=t.substring(c.start,c.end);for(;d[0]===".";)d=d.substring(1);switch(o){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return r})}};function Jv(e,t){return e<t?-1:e>t?1:0}function ek(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=Jv(e[i],t[i]);if(l!==0)return l}return 0}return n-r}function S2(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 tk(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var nk=class{constructor(e){ue(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}},th=class{constructor(e,t,n){ue(this,"_cachedMatchRoot",new nk(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(U4(e),t)}static createFromParsedTheme(e,t){return z4(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=>P4(e.parent,i.parentScopes));return r?new rk(r.fontStyle,r.foreground,r.background):null}},b0=class qf{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new qf(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new qf(n,t[r]);return n}push(t){return new qf(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 P4(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&&!B4(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function B4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var rk=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function U4(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 d=-1;if(typeof o.settings.fontStyle=="string"){d=0;let g=o.settings.fontStyle.split(" ");for(let y=0,E=g.length;y<E;y++)switch(g[y]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let m=null;typeof o.settings.foreground=="string"&&S2(o.settings.foreground)&&(m=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&S2(o.settings.background)&&(p=o.settings.background);for(let g=0,y=c.length;g<y;g++){let v=c[g].trim().split(" "),w=v[v.length-1],C=null;v.length>1&&(C=v.slice(0,v.length-1),C.reverse()),n[r++]=new H4(w,C,i,d,m,p)}}return n}var H4=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}},Cr=(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))(Cr||{});function z4(e,t){e.sort((d,m)=>{let p=Jv(d.scope,m.scope);return p!==0||(p=ek(d.parentScopes,m.parentScopes),p!==0)?p:d.index-m.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let d=e.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(i=d.background)}let l=new F4(t),o=new rk(n,l.getId(r),l.getId(i)),c=new V4(new gg(0,null,-1,0,0),[]);for(let d=0,m=e.length;d<m;d++){let p=e[d];c.insert(0,p.scope,p.parentScopes,p.fontStyle,l.getId(p.foreground),l.getId(p.background))}return new th(l,o,c)}var F4=class{constructor(e){ue(this,"_isFrozen");ue(this,"_lastColorId");ue(this,"_id2color");ue(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)}},$4=Object.freeze([]),gg=class ak{constructor(t,n,r,i,l){ue(this,"scopeDepth");ue(this,"parentScopes");ue(this,"fontStyle");ue(this,"foreground");ue(this,"background");this.scopeDepth=t,this.parentScopes=n||$4,this.fontStyle=r,this.foreground=i,this.background=l}clone(){return new ak(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)}},V4=class bg{constructor(t,n=[],r={}){ue(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(bg._cmpBySpecificity),n}insert(t,n,r,i,l,o){if(n===""){this._doInsertHere(t,r,i,l,o);return}let c=n.indexOf("."),d,m;c===-1?(d=n,m=""):(d=n.substring(0,c),m=n.substring(c+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new bg(this._mainRule.clone(),gg.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(t+1,m,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 d=this._rulesWithParentScopes[o];if(ek(d.parentScopes,n)===0){d.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 gg(t,n,r,i,l))}},Zo=class La{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=La.getLanguageId(t),r=La.getTokenType(t),i=La.getFontStyle(t),l=La.getForeground(t),o=La.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 d=La.getLanguageId(t),m=La.getTokenType(t),p=La.containsBalancedBrackets(t)?1:0,g=La.getFontStyle(t),y=La.getForeground(t),E=La.getBackground(t);return n!==0&&(d=n),r!==8&&(m=r),i!==null&&(p=i?1:0),l!==-1&&(g=l),o!==0&&(y=o),c!==0&&(E=c),(d<<0|m<<8|p<<10|g<<11|y<<15|E<<24)>>>0}};function nh(e,t){const n=[],r=G4(e);let i=r.next();for(;i!==null;){let d=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let m=o();if(n.push({matcher:m,priority:d}),i!==",")break;i=r.next()}return n;function l(){if(i==="-"){i=r.next();const d=l();return m=>!!d&&!d(m)}if(i==="("){i=r.next();const d=c();return i===")"&&(i=r.next()),d}if(N2(i)){const d=[];do d.push(i),i=r.next();while(N2(i));return m=>t(d,m)}return null}function o(){const d=[];let m=l();for(;m;)d.push(m),m=l();return p=>d.every(g=>g(p))}function c(){const d=[];let m=o();for(;m&&(d.push(m),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");m=o()}return p=>d.some(g=>g(p))}}function N2(e){return!!e&&!!e.match(/[\w\.:]+/)}function G4(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 sk(e){typeof e.dispose=="function"&&e.dispose()}var Mc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},q4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Y4=class{constructor(){ue(this,"_references",[]);ue(this,"_seenReferenceKeys",new Set);ue(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))}},W4=class{constructor(e,t){ue(this,"seenFullScopeRequests",new Set);ue(this,"seenPartialScopeRequests",new Set);ue(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Mc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new Y4;for(const n of e)Q4(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Mc){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 Q4(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 Mc?Yf({baseGrammar:l,selfGrammar:i},r):xg(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 Mc(c))}function xg(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];rh([r],t,n)}}function Yf(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&rh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function rh(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Kv({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&rh(r.patterns,{...t,repository:i},n);const l=r.include;if(!l)continue;const o=ik(l);switch(o.kind){case 0:Yf({...t,selfGrammar:t.baseGrammar},n);break;case 1:Yf(t,n);break;case 2:xg(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 d={baseGrammar:t.baseGrammar,selfGrammar:c,repository:i};o.kind===4?xg(o.ruleName,d,n):Yf(d,n)}else o.kind===4?n.add(new q4(o.scopeName,o.ruleName)):n.add(new Mc(o.scopeName));break}}}var X4=class{constructor(){ue(this,"kind",0)}},K4=class{constructor(){ue(this,"kind",1)}},Z4=class{constructor(e){ue(this,"kind",2);this.ruleName=e}},J4=class{constructor(e){ue(this,"kind",3);this.scopeName=e}},eR=class{constructor(e,t){ue(this,"kind",4);this.scopeName=e,this.ruleName=t}};function ik(e){if(e==="$base")return new X4;if(e==="$self")return new K4;const t=e.indexOf("#");if(t===-1)return new J4(e);if(t===0)return new Z4(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new eR(n,r)}}var tR=/\\(\d+)/,A2=/\\(\d+)/g,nR=-1,lk=-2;var Wc=class{constructor(e,t,n,r){ue(this,"$location");ue(this,"id");ue(this,"_nameIsCapturing");ue(this,"_name");ue(this,"_contentNameIsCapturing");ue(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=xf.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=xf.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Zv(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:xf.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:xf.replaceCaptures(this._contentName,e,t)}},rR=class extends Wc{constructor(t,n,r,i,l){super(t,n,r,i);ue(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!")}},aR=class extends Wc{constructor(t,n,r,i,l){super(t,n,r,null);ue(this,"_match");ue(this,"captures");ue(this,"_cachedCompiledPatterns");this._match=new Pc(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 Bc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},R2=class extends Wc{constructor(t,n,r,i,l){super(t,n,r,i);ue(this,"hasMissingPatterns");ue(this,"patterns");ue(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 Bc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yg=class extends Wc{constructor(t,n,r,i,l,o,c,d,m,p){super(t,n,r,i);ue(this,"_begin");ue(this,"beginCaptures");ue(this,"_end");ue(this,"endHasBackReferences");ue(this,"endCaptures");ue(this,"applyEndPatternLast");ue(this,"hasMissingPatterns");ue(this,"patterns");ue(this,"_cachedCompiledPatterns");this._begin=new Pc(l,this.id),this.beginCaptures=o,this._end=new Pc(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=m||!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 Bc;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}},ah=class extends Wc{constructor(t,n,r,i,l,o,c,d,m){super(t,n,r,i);ue(this,"_begin");ue(this,"beginCaptures");ue(this,"whileCaptures");ue(this,"_while");ue(this,"whileHasBackReferences");ue(this,"hasMissingPatterns");ue(this,"patterns");ue(this,"_cachedCompiledPatterns");ue(this,"_cachedCompiledWhilePatterns");this._begin=new Pc(l,this.id),this.beginCaptures=o,this.whileCaptures=d,this._while=new Pc(c,lk),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=m.patterns,this.hasMissingPatterns=m.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 Bc;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 Bc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},ok=class wr{static createCaptureRule(t,n,r,i,l){return t.registerRule(o=>new rR(n,o,r,i,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new aR(t.$vscodeTextmateLocation,t.id,t.name,t.match,wr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Kv({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new R2(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,wr._compilePatterns(l,n,r))}return t.while?new ah(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,wr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,wr._compileCaptures(t.whileCaptures||t.captures,n,r),wr._compilePatterns(t.patterns,n,r)):new yg(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,wr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,wr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,wr._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 d=0;t[o].patterns&&(d=wr.getCompiledRuleId(t[o],n,r)),i[c]=wr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,d)}}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 d=-1;if(c.include){const m=ik(c.include);switch(m.kind){case 0:case 1:d=wr.getCompiledRuleId(r[c.include],n,r);break;case 2:let p=r[m.ruleName];p&&(d=wr.getCompiledRuleId(p,n,r));break;case 3:case 4:const g=m.scopeName,y=m.kind===4?m.ruleName:null,E=n.getExternalGrammar(g,r);if(E)if(y){let v=E.repository[y];v&&(d=wr.getCompiledRuleId(v,n,E.repository))}else d=wr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else d=wr.getCompiledRuleId(c,n,r);if(d!==-1){const m=n.getRule(d);let p=!1;if((m instanceof R2||m instanceof yg||m instanceof ah)&&m.hasMissingPatterns&&m.patterns.length===0&&(p=!0),p)continue;i.push(d)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Pc=class uk{constructor(t,n){ue(this,"source");ue(this,"ruleId");ue(this,"hasAnchor");ue(this,"hasBackReferences");ue(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 m=t.charAt(c+1);m==="z"?(l.push(t.substring(i,c)),l.push("$(?!\\n)(?<!\\n)"),i=c+2):(m==="A"||m==="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=tR.test(this.source):this.hasBackReferences=!1}clone(){return new uk(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 A2.lastIndex=0,this.source.replace(A2,(i,l)=>tk(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,d;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&&(d=this.source.charAt(l+1),d==="A"?(t[l+1]="",n[l+1]="",r[l+1]="A",i[l+1]="A"):d==="G"?(t[l+1]="",n[l+1]="G",r[l+1]="",i[l+1]="G"):(t[l+1]=d,n[l+1]=d,r[l+1]=d,i[l+1]=d),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}},Bc=class{constructor(){ue(this,"_items");ue(this,"_hasAnchors");ue(this,"_cached");ue(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 L2(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 L2(e,r,this._items.map(i=>i.ruleId))}},L2=class{constructor(e,t,n){ue(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}},x0=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ei,sR=(ei=class{constructor(t,n){ue(this,"_defaultAttributes");ue(this,"_embeddedLanguagesMatcher");ue(this,"_getBasicScopeAttributes",new nk(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new x0(n,r)}));this._defaultAttributes=new x0(t,8),this._embeddedLanguagesMatcher=new iR(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?ei._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(ei.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!")}},ue(ei,"_NULL_SCOPE_METADATA",new x0(0,0)),ue(ei,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ei),iR=class{constructor(e){ue(this,"values");ue(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>tk(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])}},I2=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function ck(e,t,n,r,i,l,o,c){const d=t.content.length;let m=!1,p=-1;if(o){const E=lR(e,t,n,r,i,l);i=E.stack,r=E.linePos,n=E.isFirstLine,p=E.anchorPosition}const g=Date.now();for(;!m;){if(c!==0&&Date.now()-g>c)return new I2(i,!0);y()}return new I2(i,!1);function y(){const E=oR(e,t,n,r,i,p);if(!E){l.produce(i,d),m=!0;return}const v=E.captureIndices,w=E.matchedRuleId,C=v&&v.length>0?v[0].end>r:!1;if(w===nR){const S=i.getRule(e);l.produce(i,v[0].start),i=i.withContentNameScopesList(i.nameScopesList),bc(e,t,n,i,l,S.endCaptures,v),l.produce(i,v[0].end);const N=i;if(i=i.parent,p=N.getAnchorPos(),!C&&N.getEnterPos()===r){i=N,l.produce(i,d),m=!0;return}}else{const S=e.getRule(w);l.produce(i,v[0].start);const N=i,A=S.getName(t.content,v),z=i.contentNameScopesList.pushAttributed(A,e);if(i=i.push(w,r,p,v[0].end===d,null,z,z),S instanceof yg){const Y=S;bc(e,t,n,i,l,Y.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const M=Y.getContentName(t.content,v),B=z.pushAttributed(M,e);if(i=i.withContentNameScopesList(B),Y.endHasBackReferences&&(i=i.withEndRule(Y.getEndWithResolvedBackReferences(t.content,v))),!C&&N.hasSameRuleAs(i)){i=i.pop(),l.produce(i,d),m=!0;return}}else if(S instanceof ah){const Y=S;bc(e,t,n,i,l,Y.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const M=Y.getContentName(t.content,v),B=z.pushAttributed(M,e);if(i=i.withContentNameScopesList(B),Y.whileHasBackReferences&&(i=i.withEndRule(Y.getWhileWithResolvedBackReferences(t.content,v))),!C&&N.hasSameRuleAs(i)){i=i.pop(),l.produce(i,d),m=!0;return}}else if(bc(e,t,n,i,l,S.captures,v),l.produce(i,v[0].end),i=i.pop(),!C){i=i.safePop(),l.produce(i,d),m=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function lR(e,t,n,r,i,l){let o=i.beginRuleCapturedEOL?0:-1;const c=[];for(let d=i;d;d=d.pop()){const m=d.getRule(e);m instanceof ah&&c.push({rule:m,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:m,findOptions:p}=dR(d.rule,e,d.stack.endRule,n,r===o),g=m.findNextMatchSync(t,r,p);if(g){if(g.ruleId!==lk){i=d.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(l.produce(d.stack,g.captureIndices[0].start),bc(e,t,n,d.stack,l,d.rule.whileCaptures,g.captureIndices),l.produce(d.stack,g.captureIndices[0].end),o=g.captureIndices[0].end,g.captureIndices[0].end>r&&(r=g.captureIndices[0].end,n=!1))}else{i=d.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function oR(e,t,n,r,i,l){const o=uR(e,t,n,r,i,l),c=e.getInjections();if(c.length===0)return o;const d=cR(c,e,t,n,r,i,l);if(!d)return o;if(!o)return d;const m=o.captureIndices[0].start,p=d.captureIndices[0].start;return p<m||d.priorityMatch&&p===m?d:o}function uR(e,t,n,r,i,l){const o=i.getRule(e),{ruleScanner:c,findOptions:d}=dk(o,e,i.endRule,n,r===l),m=c.findNextMatchSync(t,r,d);return m?{captureIndices:m.captureIndices,matchedRuleId:m.ruleId}:null}function cR(e,t,n,r,i,l,o){let c=Number.MAX_VALUE,d=null,m,p=0;const g=l.contentNameScopesList.getScopeNames();for(let y=0,E=e.length;y<E;y++){const v=e[y];if(!v.matcher(g))continue;const w=t.getRule(v.ruleId),{ruleScanner:C,findOptions:S}=dk(w,t,null,r,i===o),N=C.findNextMatchSync(n,i,S);if(!N)continue;const A=N.captureIndices[0].start;if(!(A>=c)&&(c=A,d=N.captureIndices,m=N.ruleId,p=v.priority,c===i))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:m}:null}function dk(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function dR(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function bc(e,t,n,r,i,l,o){if(l.length===0)return;const c=t.content,d=Math.min(l.length,o.length),m=[],p=o[0].end;for(let g=0;g<d;g++){const y=l[g];if(y===null)continue;const E=o[g];if(E.length===0)continue;if(E.start>p)break;for(;m.length>0&&m[m.length-1].endPos<=E.start;)i.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop();if(m.length>0?i.produceFromScopes(m[m.length-1].scopes,E.start):i.produce(r,E.start),y.retokenizeCapturedWithRuleId){const w=y.getName(c,o),C=r.contentNameScopesList.pushAttributed(w,e),S=y.getContentName(c,o),N=C.pushAttributed(S,e),A=r.push(y.retokenizeCapturedWithRuleId,E.start,-1,!1,null,C,N),z=e.createOnigString(c.substring(0,E.end));ck(e,z,n&&E.start===0,E.start,A,i,!1,0),sk(z);continue}const v=y.getName(c,o);if(v!==null){const C=(m.length>0?m[m.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);m.push(new fR(C,E.end))}}for(;m.length>0;)i.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop()}var fR=class{constructor(e,t){ue(this,"scopes");ue(this,"endPos");this.scopes=e,this.endPos=t}};function hR(e,t,n,r,i,l,o,c){return new pR(e,t,n,r,i,l,o,c)}function O2(e,t,n,r,i){const l=nh(t,sh),o=ok.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 sh(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(mR(t[i],r))return n=i+1,!0;return!1})}function mR(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 pR=class{constructor(e,t,n,r,i,l,o,c){ue(this,"_rootId");ue(this,"_lastRuleId");ue(this,"_ruleId2desc");ue(this,"_includedGrammars");ue(this,"_grammarRepository");ue(this,"_grammar");ue(this,"_injections");ue(this,"_basicScopeAttributesProvider");ue(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=c,this._basicScopeAttributesProvider=new sR(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=D2(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const d of Object.keys(i)){const m=nh(d,sh);for(const p of m)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[d]})}}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)O2(t,o,i[o],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const d=c.injectionSelector;d&&O2(t,d,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]=D2(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=ok.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Eg.NULL){i=!0;const m=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),g=Zo.set(0,m.languageId,m.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let E;y?E=vc.createRootAndLookUpScopeName(y,g,this):E=vc.createRoot("unknown",g),t=new Eg(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 bR(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),d=ck(this,l,i,0,t,c,!0,r);return sk(l),{lineLength:o,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function D2(e,t){return e=D4(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 vc=class ds{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=b0.push(i,l.scopeNames),r=new ds(r,i,l.encodedTokenAttributes);return r}static createRoot(t,n){return new ds(null,new b0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),l=new b0(null,t),o=r.themeProvider.themeMatch(l),c=ds.mergeAttributes(n,i,o);return new ds(null,l,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ds.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),Zo.set(t,n.languageId,n.tokenType,null,i,l,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ds._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const l of r)i=ds._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=ds.mergeAttributes(t.tokenAttributes,i,o);return new ds(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}},ja,Eg=(ja=class{constructor(t,n,r,i,l,o,c,d){ue(this,"_stackElementBrand");ue(this,"_enterPos");ue(this,"_anchorPos");ue(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=d,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:ja._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?vc.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(){ja._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,l,o,c){return new ja(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 ja(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=vc.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new ja(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,vc.fromExtension(r,n.contentNameScopesList))}},ue(ja,"NULL",new ja(null,0,0,0,!1,null,null,null)),ja),gR=class{constructor(e,t){ue(this,"balancedBracketScopes");ue(this,"unbalancedBracketScopes");ue(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):nh(n,sh).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>nh(n,sh).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}},bR=class{constructor(e,t,n,r){ue(this,"_emitBinaryTokens");ue(this,"_lineText");ue(this,"_tokens");ue(this,"_binaryTokens");ue(this,"_lastTokenEndIndex");ue(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=Zo.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(l=this.balancedBracketSelectors.match(o))}if(l&&(i=Zo.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}},xR=class{constructor(e,t){ue(this,"_grammars",new Map);ue(this,"_rawGrammars",new Map);ue(this,"_injectionGrammars",new Map);ue(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,hR(e,l,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},yR=class{constructor(t){ue(this,"_options");ue(this,"_syncRegistry");ue(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new xR(th.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(th.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 gR(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,l){const o=new W4(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)}},_g=Eg.NULL;const fk=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Qc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Qc.prototype.normal={};Qc.prototype.property={};Qc.prototype.space=void 0;function hk(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Qc(n,r,t)}function Uc(e){return e.toLowerCase()}class Qr{constructor(t,n){this.attribute=n,this.property=t}}Qr.prototype.attribute="";Qr.prototype.booleanish=!1;Qr.prototype.boolean=!1;Qr.prototype.commaOrSpaceSeparated=!1;Qr.prototype.commaSeparated=!1;Qr.prototype.defined=!1;Qr.prototype.mustUseProperty=!1;Qr.prototype.number=!1;Qr.prototype.overloadedBoolean=!1;Qr.prototype.property="";Qr.prototype.spaceSeparated=!1;Qr.prototype.space=void 0;let ER=0;const wt=Ql(),Xn=Ql(),Tg=Ql(),Le=Ql(),xn=Ql(),Wo=Ql(),ua=Ql();function Ql(){return 2**++ER}const vg=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:Xn,commaOrSpaceSeparated:ua,commaSeparated:Wo,number:Le,overloadedBoolean:Tg,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),y0=Object.keys(vg);class _1 extends Qr{constructor(t,n,r,i){let l=-1;if(super(t,n),j2(this,"space",i),typeof r=="number")for(;++l<y0.length;){const o=y0[l];j2(this,y0[l],(r&vg[o])===vg[o])}}}_1.prototype.defined=!0;function j2(e,t,n){n&&(e[t]=n)}function iu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new _1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Uc(r)]=r,n[Uc(l.attribute)]=r}return new Qc(t,n,e.space)}const mk=iu({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 pk(e,t){return t in e?e[t]:t}function gk(e,t){return pk(e,t.toLowerCase())}const _R=iu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wo,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:wt,allowPaymentRequest:wt,allowUserMedia:wt,alt:null,as:null,async:wt,autoCapitalize:null,autoComplete:xn,autoFocus:wt,autoPlay:wt,blocking:xn,capture:null,charSet:null,checked:wt,cite:null,className:xn,cols:Le,colSpan:null,content:null,contentEditable:Xn,controls:wt,controlsList:xn,coords:Le|Wo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wt,defer:wt,dir:null,dirName:null,disabled:wt,download:Tg,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wt,formTarget:null,headers:xn,height:Le,hidden:Tg,high:Le,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:wt,inputMode:null,integrity:null,is:null,isMap:wt,itemId:null,itemProp:xn,itemRef:xn,itemScope:wt,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wt,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:wt,muted:wt,name:null,nonce:null,noModule:wt,noValidate:wt,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:wt,optimum:Le,pattern:null,ping:xn,placeholder:null,playsInline:wt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wt,referrerPolicy:null,rel:xn,required:wt,reversed:wt,rows:Le,rowSpan:Le,sandbox:xn,scope:null,scoped:wt,seamless:wt,selected:wt,shadowRootClonable:wt,shadowRootDelegatesFocus:wt,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:wt,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:wt,declare:wt,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:wt,noHref:wt,noShade:wt,noWrap:wt,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:wt,disableRemotePlayback:wt,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:gk}),TR=iu({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:ua,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:wt,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:Wo,g2:Wo,glyphName:Wo,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:ua,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:ua,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ua,rev:ua,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ua,requiredFeatures:ua,requiredFonts:ua,requiredFormats:ua,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:ua,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:ua,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:ua,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:pk}),bk=iu({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()}}),xk=iu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gk}),yk=iu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vR={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"},kR=/[A-Z]/g,M2=/-[a-z]/g,wR=/^data[-\w.:]+$/i;function Xc(e,t){const n=Uc(t);let r=t,i=Qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wR.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(M2,SR);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!M2.test(l)){let o=l.replace(kR,CR);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=_1}return new i(r,t)}function CR(e){return"-"+e.toLowerCase()}function SR(e){return e.charAt(1).toUpperCase()}const lu=hk([mk,_R,bk,xk,yk],"html"),ys=hk([mk,TR,bk,xk,yk],"svg"),P2={}.hasOwnProperty;function T1(e,t){const n=t||{};function r(i,...l){let o=r.invalid;const c=r.handlers;if(i&&P2.call(i,e)){const d=String(i[e]);o=P2.call(c,d)?c[d]: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 NR=/["&'<>`]/g,AR=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,RR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,LR=/[|\\{}()[\]^$+*?.]/g,B2=new WeakMap;function IR(e,t){if(e=e.replace(t.subset?OR(t.subset):NR,r),t.subset||t.escapeOnly)return e;return e.replace(AR,n).replace(RR,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 OR(e){let t=B2.get(e);return t||(t=DR(e),B2.set(e,t)),t}function DR(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(LR,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const jR=/[\dA-Fa-f]/;function MR(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!jR.test(String.fromCharCode(t))?r:r+";"}const PR=/\d/;function BR(e,t,n){const r="&#"+String(e);return n&&t&&!PR.test(String.fromCharCode(t))?r:r+";"}const UR=["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"],E0={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:"€"},HR=["cent","copy","divide","gt","lt","not","para","times"],Ek={}.hasOwnProperty,kg={};let yf;for(yf in E0)Ek.call(E0,yf)&&(kg[E0[yf]]=yf);const zR=/[^\dA-Za-z]/;function FR(e,t,n,r){const i=String.fromCharCode(e);if(Ek.call(kg,i)){const l=kg[i],o="&"+l;return n&&UR.includes(l)&&!HR.includes(l)&&(!r||t&&t!==61&&zR.test(String.fromCharCode(t)))?o:o+";"}return""}function $R(e,t,n){let r=MR(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=FR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const l=BR(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Qo(e,t){return IR(e,Object.assign({format:$R},t))}const VR=/^>|^->|<!--|-->|--!>|<!-$/g,GR=[">"],qR=["<",">"];function YR(e,t,n,r){return r.settings.bogusComments?"<?"+Qo(e.value,Object.assign({},r.settings.characterReferences,{subset:GR}))+">":"<!--"+e.value.replace(VR,i)+"-->";function i(l){return Qo(l,Object.assign({},r.settings.characterReferences,{subset:qR}))}}function WR(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function ih(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 U2(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 v1(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function H2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function k1(e){return e.join(" ").trim()}const QR=/[ \t\n\f\r]/g;function Lh(e){return typeof e=="object"?e.type==="text"?z2(e.value):!1:z2(e)}function z2(e){return e.replace(QR,"")===""}const ir=Tk(1),_k=Tk(-1),XR=[];function Tk(e){return t;function t(n,r,i){const l=n?n.children:XR;let o=(r||0)+e,c=l[o];if(!i)for(;c&&Lh(c);)o+=e,c=l[o];return c}}const KR={}.hasOwnProperty;function vk(e){return t;function t(n,r,i){return KR.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const w1=vk({body:JR,caption:_0,colgroup:_0,dd:rL,dt:nL,head:_0,html:ZR,li:tL,optgroup:aL,option:sL,p:eL,rp:F2,rt:F2,tbody:lL,td:$2,tfoot:oL,th:$2,thead:iL,tr:uL});function _0(e,t,n){const r=ir(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Lh(r.value.charAt(0)))}function ZR(e,t,n){const r=ir(n,t);return!r||r.type!=="comment"}function JR(e,t,n){const r=ir(n,t);return!r||r.type!=="comment"}function eL(e,t,n){const r=ir(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 tL(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&r.tagName==="li"}function nL(e,t,n){const r=ir(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function rL(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function F2(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function aL(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function sL(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function iL(e,t,n){const r=ir(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function lL(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function oL(e,t,n){return!ir(n,t)}function uL(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function $2(e,t,n){const r=ir(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const cL=vk({body:hL,colgroup:mL,head:fL,html:dL,tbody:pL});function dL(e){const t=ir(e,-1);return!t||t.type!=="comment"}function fL(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 hL(e){const t=ir(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Lh(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function mL(e,t,n){const r=_k(n,t),i=ir(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&w1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function pL(e,t,n){const r=_k(n,t),i=ir(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&w1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Ef={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 gL(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 d;i.space==="html"&&e.tagName==="svg"&&(r.schema=ys);const m=bL(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(m||!l||!cL(e,t,n))&&(c.push("<",e.tagName,m?" "+m:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(d=m.charAt(m.length-1),(!r.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!o&&(!l||!w1(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function bL(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=xL(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 xL(e,t,n){const r=Xc(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 d=Qo(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ef.name[i][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?v1:k1)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?d:(e.settings.preferUnquoted&&(c=Qo(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ef.unquoted[i][l]}))),c!==n&&(e.settings.quoteSmart&&ih(n,o)>ih(n,e.alternative)&&(o=e.alternative),c=o+Qo(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?Ef.single:Ef.double)[i][l],attribute:!0}))+o),d+(c&&"="+c))}const yL=["<","&"];function kk(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Qo(e.value,Object.assign({},r.settings.characterReferences,{subset:yL}))}function EL(e,t,n,r){return r.settings.allowDangerousHtml?e.value:kk(e,t,n,r)}function _L(e,t,n,r){return r.all(e)}const TL=T1("type",{invalid:vL,unknown:kL,handlers:{comment:YR,doctype:WR,element:gL,raw:EL,root:_L,text:kk}});function vL(e){throw new Error("Expected node, not `"+e+"`")}function kL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const wL={},CL={},SL=[];function NL(e,t){const n=t||wL,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:AL,all:RL,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||fk,characterReferences:n.characterReferences||CL,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ys:lu,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function AL(e,t,n){return TL(e,t,n,this)}function RL(e){const t=[],n=e&&e.children||SL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function lh(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 el(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function LL(e){return Array.isArray(e)?e:[e]}async function wk(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function C1(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ck(e){return e==="ansi"||C1(e)}function S1(e){return e==="none"}function Sk(e){return S1(e)}function Nk(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 Ih(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 IL(e){const t=Ih(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 N1="light-dark()",OL=["color","background-color"];function DL(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 jL(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?DL(i,l):i})):e}function ML(e,t,n,r,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>oh(e.variants[p])),c=new Set(o.flatMap(p=>Object.keys(p))),d={},m=(p,g)=>{const y=g==="color"?"":g==="background-color"?"-bg":`-${g}`;return n+t[p]+(g==="color"?"":y)};return o.forEach((p,g)=>{for(const y of c){const E=p[y]||"inherit";if(g===0&&r&&OL.includes(y))if(r===N1&&o.length>1){const v=t.findIndex(N=>N==="light"),w=t.findIndex(N=>N==="dark");if(v===-1||w===-1)throw new Kn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][y]||"inherit",S=o[w][y]||"inherit";d[y]=`light-dark(${C}, ${S})`,i==="css-vars"&&(d[m(g,y)]=E)}else d[y]=E;else i==="css-vars"&&(d[m(g,y)]=E)}}),l.htmlStyle=d,l}function oh(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Cr.Italic&&(t["font-style"]="italic"),e.fontStyle&Cr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Cr.Underline&&n.push("underline"),e.fontStyle&Cr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function wg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Ak=new WeakMap;function Oh(e,t){Ak.set(e,t)}function Hc(e){return Ak.get(e)}class ou{constructor(...t){ue(this,"_stacks",{});ue(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 ou(Object.fromEntries(LL(n).map(r=>[r,_g])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return PL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function PL(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 BL(e,t){if(!(e instanceof ou))throw new Kn("Invalid grammar state");return e.getInternalStack(t)}function UL(){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 d=o.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new Kn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:d,offset:i.posToIndex(o.line,d)}}};const i=IL(n.source),l=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));HL(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 jL(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,y,E,v){const w=i[g];let C="",S=-1,N=-1;if(y===0&&(S=0),E===0&&(N=0),E===Number.POSITIVE_INFINITY&&(N=w.children.length),S===-1||N===-1)for(let z=0;z<w.children.length;z++)C+=Rk(w.children[z]),S===-1&&C.length===y&&(S=z+1),N===-1&&C.length===E&&(N=z+1);if(S===-1)throw new Kn(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(N===-1)throw new Kn(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const A=w.children.slice(S,N);if(!v.alwaysWrap&&A.length===w.children.length)c(w,v,"line");else if(!v.alwaysWrap&&A.length===1&&A[0].type==="element")c(A[0],v,"token");else{const z={type:"element",tagName:"span",properties:{},children:A};c(z,v,"wrapper"),w.children.splice(S,A.length,z)}}function o(g,y){i[g]=c(i[g],y,"line")}function c(g,y,E){var C;const v=y.properties||{},w=y.transform||(S=>S);return g.tagName=y.tagName||"span",g.properties={...g.properties,...v,class:g.properties.class},(C=y.properties)!=null&&C.class&&Nk(g,y.properties.class),g=w(g,E)||g,g}const d=[],m=r.decorations.sort((g,y)=>y.start.offset-g.start.offset||g.end.offset-y.end.offset);for(const g of m){const{start:y,end:E}=g;if(y.line===E.line)l(y.line,y.character,E.character,g);else if(y.line<E.line){l(y.line,y.character,Number.POSITIVE_INFINITY,g);for(let v=y.line+1;v<E.line;v++)d.unshift(()=>o(v,g));l(E.line,0,E.character,g)}}d.forEach(g=>g())}}}function HL(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,d=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(l||o||c||d){if(l&&o||c&&d||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 Rk(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Rk).join(""):""}const zL=[UL()];function uh(e){const t=FL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...zL]}function FL(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 Bl=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],T0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function $L(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 V2(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 VL(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)T0[r]&&t.push({type:"setDecoration",value:T0[r]});else if(r<=29){const i=T0[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:Bl[r-30]}});else if(r===38){const i=V2(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:Bl[r-40]}});else if(r===48){const i=V2(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:Bl[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Bl[r-100+8]}})}return t}function GL(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let l=0;do{const o=$L(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 d=VL(o.sequence);for(const m of d)m.type==="resetAll"?(e=null,t=null,n.clear()):m.type==="resetForegroundColor"?e=null:m.type==="resetBackgroundColor"?t=null:m.type==="resetDecoration"&&n.delete(m.value);for(const m of d)m.type==="setForegroundColor"?e=m.value:m.type==="setBackgroundColor"?t=m.value:m.type==="setDecoration"&&n.add(m.value)}l=o.position}while(l<r.length);return i}}}var qL={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 YL(e=qL){function t(c){return e[c]}function n(c){return`#${c.map(d=>Math.max(0,Math.min(d,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let m=0;m<Bl.length;m++)r.push(t(Bl[m]));let c=[0,95,135,175,215,255];for(let m=0;m<6;m++)for(let p=0;p<6;p++)for(let g=0;g<6;g++)r.push(n([c[m],c[p],c[g]]));let d=8;for(let m=0;m<24;m++,d+=10)r.push(n([d,d,d]));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 WL={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 QL(e,t,n){const r=lh(e,n),i=Ih(t),l=Object.fromEntries(Bl.map(d=>{var g;const m=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`,p=(g=e.colors)==null?void 0:g[m];return[d,p||WL[d]]})),o=YL(l),c=GL();return i.map(d=>c.parse(d[0]).map(m=>{let p,g;m.decorations.has("reverse")?(p=m.background?o.value(m.background):e.bg,g=m.foreground?o.value(m.foreground):e.fg):(p=m.foreground?o.value(m.foreground):e.fg,g=m.background?o.value(m.background):void 0),p=el(p,r),g=el(g,r),m.decorations.has("dim")&&(p=XL(p));let y=Cr.None;return m.decorations.has("bold")&&(y|=Cr.Bold),m.decorations.has("italic")&&(y|=Cr.Italic),m.decorations.has("underline")&&(y|=Cr.Underline),m.decorations.has("strikethrough")&&(y|=Cr.Strikethrough),{content:m.value,offset:d[1],color:p,bgColor:g,fontStyle:y}}))}function XL(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],d=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${l}${l}${o}${o}${d}`}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 A1(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(C1(i)||S1(r))return Ih(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:l,colorMap:o}=e.setTheme(r);if(i==="ansi")return QL(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 ZL(t,c,l,o,n)}function KL(...e){if(e.length===2)return Hc(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=r;if(C1(i)||S1(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),d=t.getLanguage(i);return new ou(R1(n,d,o,c,r).stateStack,d.name,o.name)}function ZL(e,t,n,r,i){const l=R1(e,t,n,r,i),o=new ou(l.stateStack,t.name,n.name);return Oh(l.tokens,o),l.tokens}function R1(e,t,n,r,i){const l=lh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500}=i,d=Ih(e);let m=i.grammarState?BL(i.grammarState,n.name)??_g:i.grammarContextCode!=null?R1(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:_g,p=[];const g=[];for(let y=0,E=d.length;y<E;y++){const[v,w]=d[y];if(v===""){p=[],g.push([]);continue}if(o>0&&v.length>=o){p=[],g.push([{content:v,offset:w,color:"",fontStyle:0}]);continue}let C,S,N;i.includeExplanation&&(C=t.tokenizeLine(v,m,c),S=C.tokens,N=0);const A=t.tokenizeLine2(v,m,c),z=A.tokens.length/2;for(let Y=0;Y<z;Y++){const M=A.tokens[2*Y],B=Y+1<z?A.tokens[2*Y+2]:v.length;if(M===B)continue;const G=A.tokens[2*Y+1],ce=el(r[Zo.getForeground(G)],l),Q=Zo.getFontStyle(G),he={content:v.substring(M,B),offset:w+M,color:ce,fontStyle:Q};if(i.includeExplanation){const V=[];if(i.includeExplanation!=="scopeName")for(const me of n.settings){let ne;switch(typeof me.scope){case"string":ne=me.scope.split(/,/).map(H=>H.trim());break;case"object":ne=me.scope;break;default:continue}V.push({settings:me,selectors:ne.map(H=>H.split(/ /))})}he.explanation=[];let Te=0;for(;M+Te<B;){const me=S[N],ne=v.substring(me.startIndex,me.endIndex);Te+=ne.length,he.explanation.push({content:ne,scopes:i.includeExplanation==="scopeName"?JL(me.scopes):eI(V,me.scopes)}),N+=1}}p.push(he)}g.push(p),p=[],m=A.ruleStack}return{tokens:g,stateStack:m}}function JL(e){return e.map(t=>({scopeName:t}))}function eI(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const l=t[r];n[r]={scopeName:l,themeMatches:nI(e,l,t.slice(0,r))}}return n}function G2(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function tI(e,t,n){if(!G2(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)G2(e[r],n[i])&&(r-=1),i-=1;return r===-1}function nI(e,t,n){const r=[];for(const{selectors:i,settings:l}of e)for(const o of i)if(tI(o,t,n)){r.push(l);break}return r}function Lk(e,t,n){const r=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),i=r.map(d=>{const m=A1(e,t,{...n,theme:d.theme}),p=Hc(m),g=typeof d.theme=="string"?d.theme:d.theme.name;return{tokens:m,state:p,theme:g}}),l=rI(...i.map(d=>d.tokens)),o=l[0].map((d,m)=>d.map((p,g)=>{const y={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=p.explanation),l.forEach((E,v)=>{const{content:w,explanation:C,offset:S,...N}=E[m][g];y.variants[r[v].color]=N}),y})),c=i[0].state?new ou(Object.fromEntries(i.map(d=>{var m;return[d.theme,(m=d.state)==null?void 0:m.getInternalStack(d.theme)]})),i[0].state.lang):void 0;return c&&Oh(o,c),o}function rI(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(d=>d[r]),l=t.map(()=>[]);t.forEach((d,m)=>d.push(l[m]));const o=i.map(()=>0),c=i.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(m=>m.content.length));for(let m=0;m<n;m++){const p=c[m];p.content.length===d?(l[m].push(p),o[m]+=1,c[m]=i[m][o[m]]):(l[m].push({...p,content:p.content.slice(0,d)}),c[m]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return t}function ch(e,t,n){let r,i,l,o,c,d;if("themes"in n){const{defaultColor:m="light",cssVariablePrefix:p="--shiki-",colorsRendering:g="css-vars"}=n,y=Object.entries(n.themes).filter(S=>S[1]).map(S=>({color:S[0],theme:S[1]})).sort((S,N)=>S.color===m?-1:N.color===m?1:0);if(y.length===0)throw new Kn("`themes` option must not be empty");const E=Lk(e,t,n);if(d=Hc(E),m&&N1!==m&&!y.find(S=>S.color===m))throw new Kn(`\`themes\` option must contain the defaultColor key \`${m}\``);const v=y.map(S=>e.getTheme(S.theme)),w=y.map(S=>S.color);l=E.map(S=>S.map(N=>ML(N,w,p,m,g))),d&&Oh(l,d);const C=y.map(S=>lh(S.theme,n));i=q2(y,v,C,p,m,"fg",g),r=q2(y,v,C,p,m,"bg",g),o=`shiki-themes ${v.map(S=>S.name).join(" ")}`,c=m?void 0:[i,r].join(";")}else if("theme"in n){const m=lh(n.theme,n);l=A1(e,t,n);const p=e.getTheme(n.theme);r=el(p.bg,m),i=el(p.fg,m),o=p.name,d=Hc(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:d}}function q2(e,t,n,r,i,l,o){return e.map((c,d)=>{const m=el(t[d][l],n[d])||"inherit",p=`${r+c.color}${l==="bg"?"-bg":""}:${m}`;if(d===0&&i){if(i===N1&&e.length>1){const g=e.findIndex(w=>w.color==="light"),y=e.findIndex(w=>w.color==="dark");if(g===-1||y===-1)throw new Kn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=el(t[g][l],n[g])||"inherit",v=el(t[y][l],n[y])||"inherit";return`light-dark(${E}, ${v});${p}`}return m}return o==="css-vars"?p:null}).filter(c=>!!c).join(";")}function dh(e,t,n,r={meta:{},options:n,codeToHast:(i,l)=>dh(e,i,l),codeToTokens:(i,l)=>ch(e,i,l)}){var v,w;let i=t;for(const C of uh(n))i=((v=C.preprocess)==null?void 0:v.call(r,i,n))||i;let{tokens:l,fg:o,bg:c,themeName:d,rootStyle:m,grammarState:p}=ch(e,i,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:y=!1}=n;g===!0?l=sI(l):g==="never"&&(l=iI(l)),y&&(l=lI(l));const E={...r,get source(){return i}};for(const C of uh(n))l=((w=C.tokens)==null?void 0:w.call(E,l))||l;return aI(l,{...n,fg:o,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??m},E,p)}function aI(e,t,n,r=Hc(e)){var w,C,S,N;const i=uh(t),l=[],o={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=t,m={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?m.style=t.rootStyle:m.style=`background-color:${t.bg};color:${t.fg}`),d!==!1&&d!=null&&(m.tabindex=d.toString());for(const[A,z]of Object.entries(t.meta||{}))A.startsWith("_")||(m[A]=z);let p={type:"element",tagName:"pre",properties:m,children:[],data:t.data},g={type:"element",tagName:"code",properties:{},children:l};const y=[],E={...n,structure:c,addClassToHast:Nk,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 y}};if(e.forEach((A,z)=>{var B,G;z&&(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:[]},M=0;for(const ce of A){let Q={type:"element",tagName:"span",properties:{...ce.htmlAttrs},children:[{type:"text",value:ce.content}]};const he=wg(ce.htmlStyle||oh(ce));he&&(Q.properties.style=he);for(const V of i)Q=((B=V==null?void 0:V.span)==null?void 0:B.call(E,Q,z+1,M,Y,ce))||Q;c==="inline"?o.children.push(Q):c==="classic"&&Y.children.push(Q),M+=ce.content.length}if(c==="classic"){for(const ce of i)Y=((G=ce==null?void 0:ce.line)==null?void 0:G.call(E,Y,z+1))||Y;y.push(Y),l.push(Y)}else c==="inline"&&y.push(Y)}),c==="classic"){for(const A of i)g=((w=A==null?void 0:A.code)==null?void 0:w.call(E,g))||g;p.children.push(g);for(const A of i)p=((C=A==null?void 0:A.pre)==null?void 0:C.call(E,p))||p;o.children.push(p)}else if(c==="inline"){const A=[];let z={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const B of o.children)B.type==="element"&&B.tagName==="br"?(A.push(z),z={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(B.type==="element"||B.type==="text")&&z.children.push(B);A.push(z);let M={type:"element",tagName:"code",properties:{},children:A};for(const B of i)M=((S=B==null?void 0:B.code)==null?void 0:S.call(E,M))||M;o.children=[];for(let B=0;B<M.children.length;B++){B>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const G=M.children[B];G.type==="element"&&o.children.push(...G.children)}}let v=o;for(const A of i)v=((N=A==null?void 0:A.root)==null?void 0:N.call(E,v))||v;return r&&Oh(v,r),v}function sI(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((l,o)=>{const d=!(l.fontStyle&&(l.fontStyle&Cr.Underline||l.fontStyle&Cr.Strikethrough));d&&l.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=l.offset),r+=l.content):r?(d?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 iI(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 lI(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=wg(i.htmlStyle||oh(i)),o=wg(r.htmlStyle||oh(r)),c=i.fontStyle&&(i.fontStyle&Cr.Underline||i.fontStyle&Cr.Strikethrough),d=r.fontStyle&&(r.fontStyle&Cr.Underline||r.fontStyle&Cr.Strikethrough);!c&&!d&&l===o?i.content+=r.content:n.push({...r})}return n})}const oI=NL;function uI(e,t,n){var l;const r={meta:{},options:n,codeToHast:(o,c)=>dh(e,o,c),codeToTokens:(o,c)=>ch(e,o,c)};let i=oI(dh(e,t,n,r));for(const o of uh(n))i=((l=o.postprocess)==null?void 0:l.call(r,i,n))||i;return i}const Y2={light:"#333333",dark:"#bbbbbb"},W2={light:"#fffffe",dark:"#1e1e1e"},Q2="__shiki_resolved";function L1(e){var c,d,m,p,g;if(e!=null&&e[Q2])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 y=t.settings?t.settings.find(E=>!E.name&&!E.scope):void 0;(c=y==null?void 0:y.settings)!=null&&c.foreground&&(r=y.settings.foreground),(d=y==null?void 0:y.settings)!=null&&d.background&&(n=y.settings.background),!r&&((m=t==null?void 0:t.colors)!=null&&m["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"?Y2.light:Y2.dark),n||(n=t.type==="light"?W2.light:W2.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(y){var v;if(l.has(y))return l.get(y);i+=1;const E=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(v=t.colorReplacements)!=null&&v[`#${E}`]?o(y):(l.set(y,E),E)}t.settings=t.settings.map(y=>{var C,S;const E=((C=y.settings)==null?void 0:C.foreground)&&!y.settings.foreground.startsWith("#"),v=((S=y.settings)==null?void 0:S.background)&&!y.settings.background.startsWith("#");if(!E&&!v)return y;const w={...y,settings:{...y.settings}};if(E){const N=o(y.settings.foreground);t.colorReplacements[N]=y.settings.foreground,w.settings.foreground=N}if(v){const N=o(y.settings.background);t.colorReplacements[N]=y.settings.background,w.settings.background=N}return w});for(const y of Object.keys(t.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((g=t.colors[y])!=null&&g.startsWith("#"))){const E=o(t.colors[y]);t.colorReplacements[E]=t.colors[y],t.colors[y]=E}return Object.defineProperty(t,Q2,{enumerable:!1,writable:!1,value:!0}),t}async function Ik(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ck(t)).map(async t=>await wk(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Ok(e){return(await Promise.all(e.map(async n=>Sk(n)?null:L1(await wk(n))))).filter(n=>!!n)}let cI=3;function dI(e,t=3){t>cI||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Go=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Dk(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 Go(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class fI extends yR{constructor(n,r,i,l={}){super(n);ue(this,"_resolvedThemes",new Map);ue(this,"_resolvedGrammars",new Map);ue(this,"_langMap",new Map);ue(this,"_langGraph",new Map);ue(this,"_textmateThemeCache",new WeakMap);ue(this,"_loadedThemesCache",null);ue(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=L1(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=th.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=Dk(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var o,c,d,m;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),(m=(d=this._syncRegistry)==null?void 0:d._grammars)==null||m.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 d=c.embeddedLanguages||c.embeddedLangs;return d==null?void 0:d.some(m=>i.map(([p])=>p).includes(m))}).filter(o=>!i.includes(o));throw new Go(`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 hI{constructor(t,n){ue(this,"_langs",new Map);ue(this,"_scopeToLang",new Map);ue(this,"_injections",new Map);ue(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 ic=0;function mI(e){ic+=1,e.warnings!==!1&&ic>=10&&ic%10===0&&console.warn(`[Shiki] ${ic} 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 Go("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(L1),i=new hI(e.engine,n),l=new fI(i,r,n,e.langAlias);let o;function c(A){return Dk(A,e.langAlias)}function d(A){S();const z=l.getGrammar(typeof A=="string"?A:A.name);if(!z)throw new Go(`Language \`${A}\` not found, you may need to load it first`);return z}function m(A){if(A==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const z=l.getTheme(A);if(!z)throw new Go(`Theme \`${A}\` not found, you may need to load it first`);return z}function p(A){S();const z=m(A);o!==A&&(l.setTheme(z),o=A);const Y=l.getColorMap();return{theme:z,colorMap:Y}}function g(){return S(),l.getLoadedThemes()}function y(){return S(),l.getLoadedLanguages()}function E(...A){S(),l.loadLanguages(A.flat(1))}async function v(...A){return E(await Ik(A))}function w(...A){S();for(const z of A.flat(1))l.loadTheme(z)}async function C(...A){return S(),w(await Ok(A))}function S(){if(t)throw new Go("Shiki instance has been disposed")}function N(){t||(t=!0,l.dispose(),ic-=1)}return{setTheme:p,getTheme:m,getLanguage:d,getLoadedThemes:g,getLoadedLanguages:y,resolveLangAlias:c,loadLanguage:v,loadLanguageSync:E,loadTheme:C,loadThemeSync:w,dispose:N,[Symbol.dispose]:N}}async function pI(e){e.engine||dI("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Ok(e.themes||[]),Ik(e.langs||[]),e.engine]);return mI({...e,themes:t,langs:n,engine:r})}async function gI(e){const t=await pI(e);return{getLastGrammarState:(...n)=>KL(t,...n),codeToTokensBase:(n,r)=>A1(t,n,r),codeToTokensWithThemes:(n,r)=>Lk(t,n,r),codeToTokens:(n,r)=>ch(t,n,r),codeToHast:(n,r)=>dh(t,n,r),codeToHtml:(n,r)=>uI(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function bI(e){const t=e.langs,n=e.themes,r=e.engine;async function i(l){function o(g){var y;if(typeof g=="string"){if(g=((y=l.langAlias)==null?void 0:y[g])||g,Ck(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(Sk(g))return"none";if(typeof g=="string"){const y=n[g];if(!y)throw new Kn(`Theme \`${g}\` is not included in this bundle. You may want to load it from external source.`);return y}return g}const d=(l.themes??[]).map(g=>c(g)),m=(l.langs??[]).map(g=>o(g)),p=await gI({engine:l.engine??r(),...l,themes:d,langs:m});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 I1=[{id:"abap",name:"ABAP",import:(()=>D(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>D(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>D(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>D(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>D(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>D(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>D(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>D(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>D(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>D(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>D(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>D(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>D(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>D(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>D(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>D(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>D(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>D(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>D(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>D(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>D(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>D(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>D(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>D(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>D(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>D(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>D(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>D(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>D(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>D(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>D(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>D(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>D(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>D(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>D(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>D(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>D(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>D(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>D(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>D(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>D(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>D(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>D(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>D(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>D(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>D(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>D(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>D(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>D(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>D(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>D(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>D(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>D(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>D(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>D(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>D(()=>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:(()=>D(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>D(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>D(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>D(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>D(()=>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:(()=>D(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>D(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>D(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>D(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>D(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>D(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>D(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>D(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>D(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>D(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>D(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>D(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>D(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>D(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>D(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>D(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>D(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>D(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>D(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>D(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>D(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>D(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>D(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>D(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>D(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>D(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>D(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>D(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>D(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>D(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>D(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>D(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>D(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>D(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>D(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>D(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>D(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>D(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>D(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>D(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>D(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>D(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>D(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>D(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>D(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>D(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>D(()=>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:(()=>D(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>D(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>D(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>D(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>D(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>D(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>D(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>D(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>D(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>D(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>D(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>D(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>D(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>D(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>D(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>D(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>D(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>D(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>D(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>D(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>D(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>D(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>D(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>D(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>D(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>D(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>D(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>D(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>D(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>D(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>D(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>D(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>D(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>D(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>D(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>D(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>D(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>D(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>D(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>D(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>D(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>D(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>D(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>D(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>D(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>D(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>D(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>D(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>D(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>D(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>D(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>D(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>D(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>D(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>D(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>D(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>D(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>D(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>D(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>D(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>D(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>D(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>D(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>D(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>D(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>D(()=>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:(()=>D(()=>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:(()=>D(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>D(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>D(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>D(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>D(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>D(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>D(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>D(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>D(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>D(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>D(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>D(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>D(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>D(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>D(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>D(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>D(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>D(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>D(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>D(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>D(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>D(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>D(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>D(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>D(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>D(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>D(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>D(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>D(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>D(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>D(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>D(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>D(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>D(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>D(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>D(()=>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:(()=>D(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>D(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>D(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>D(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>D(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>D(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>D(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>D(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>D(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>D(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>D(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>D(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>D(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>D(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>D(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>D(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>D(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>D(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>D(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>D(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>D(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>D(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>D(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>D(()=>import("./zig-VOosw3JB.js"),[]))}],xI=Object.fromEntries(I1.map(e=>[e.id,e.import])),yI=Object.fromEntries(I1.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),jk={...xI,...yI},EI=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>D(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>D(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>D(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>D(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>D(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>D(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>D(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>D(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>D(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>D(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>D(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>D(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>D(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>D(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>D(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>D(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>D(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>D(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>D(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>D(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>D(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>D(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>D(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>D(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>D(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>D(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>D(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>D(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>D(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>D(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>D(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>D(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>D(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>D(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>D(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>D(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>D(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>D(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>D(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>D(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>D(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>D(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>D(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>D(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>D(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>D(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>D(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>D(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>D(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>D(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>D(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>D(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>D(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>D(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>D(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>D(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>D(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>D(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>D(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>D(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>D(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>D(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],_I=Object.fromEntries(EI.map(e=>[e.id,e.import]));class O1 extends Error{constructor(t){super(t),this.name="ShikiError"}}function TI(){return 2147483648}function vI(){return typeof performance<"u"?performance.now():Date.now()}const kI=(e,t)=>e+(t-e%t)%t;async function wI(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,w){r.HEAPU8.copyWithin(E,v,v+w)}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 w=TI();if(E>w)return!1;for(let C=1;C<=4;C*=2){let S=v*(1+.2/C);S=Math.min(S,E+100663296);const N=Math.min(w,kI(Math.max(E,S),65536));if(o(N))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function m(E,v,w=1024){const C=v+w;let S=v;for(;E[S]&&!(S>=C);)++S;if(S-v>16&&E.buffer&&d)return d.decode(E.subarray(v,S));let N="";for(;v<S;){let A=E[v++];if(!(A&128)){N+=String.fromCharCode(A);continue}const z=E[v++]&63;if((A&224)===192){N+=String.fromCharCode((A&31)<<6|z);continue}const Y=E[v++]&63;if((A&240)===224?A=(A&15)<<12|z<<6|Y:A=(A&7)<<18|z<<12|Y<<6|E[v++]&63,A<65536)N+=String.fromCharCode(A);else{const M=A-65536;N+=String.fromCharCode(55296|M>>10,56320|M&1023)}}return N}function p(E,v){return E?m(r.HEAPU8,E,v):""}const g={emscripten_get_now:vI,emscripten_memcpy_big:l,emscripten_resize_heap:c,fd_write:()=>0};async function y(){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 y(),r}var CI=Object.defineProperty,SI=(e,t,n)=>t in e?CI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ar=(e,t,n)=>SI(e,typeof t!="symbol"?t+"":t,n);let fr=null;function NI(e){throw new O1(e.UTF8ToString(e.getLastOnigError()))}class Dh{constructor(t){ar(this,"utf16Length"),ar(this,"utf8Length"),ar(this,"utf16Value"),ar(this,"utf8Value"),ar(this,"utf16OffsetToUtf8"),ar(this,"utf8OffsetToUtf16");const n=t.length,r=Dh._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 d=0;for(let m=0;m<n;m++){const p=t.charCodeAt(m);let g=p,y=!1;if(p>=55296&&p<=56319&&m+1<n){const E=t.charCodeAt(m+1);E>=56320&&E<=57343&&(g=(p-55296<<10)+65536|E-56320,y=!0)}i&&(l[m]=d,y&&(l[m+1]=d),g<=127?o[d+0]=m:g<=2047?(o[d+0]=m,o[d+1]=m):g<=65535?(o[d+0]=m,o[d+1]=m,o[d+2]=m):(o[d+0]=m,o[d+1]=m,o[d+2]=m,o[d+3]=m)),g<=127?c[d++]=g:g<=2047?(c[d++]=192|(g&1984)>>>6,c[d++]=128|(g&63)>>>0):g<=65535?(c[d++]=224|(g&61440)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0):(c[d++]=240|(g&1835008)>>>18,c[d++]=128|(g&258048)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0),y&&m++}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 d=t.charCodeAt(r+1);d>=56320&&d<=57343&&(o=(l-55296<<10)+65536|d-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 jh=class fs{constructor(t){if(ar(this,"id",++fs.LAST_ID),ar(this,"_onigBinding"),ar(this,"content"),ar(this,"utf16Length"),ar(this,"utf8Length"),ar(this,"utf16OffsetToUtf8"),ar(this,"utf8OffsetToUtf16"),ar(this,"ptr"),!fr)throw new O1("Must invoke loadWasm first.");this._onigBinding=fr,this.content=t;const n=new Dh(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!fs._sharedPtrInUse?(fs._sharedPtr||(fs._sharedPtr=fr.omalloc(1e4)),fs._sharedPtrInUse=!0,fr.HEAPU8.set(n.utf8Value,fs._sharedPtr),this.ptr=fs._sharedPtr):this.ptr=n.createString(fr)}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===fs._sharedPtr?fs._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ar(jh,"LAST_ID",0);ar(jh,"_sharedPtr",0);ar(jh,"_sharedPtrInUse",!1);let Mk=jh;class AI{constructor(t){if(ar(this,"_onigBinding"),ar(this,"_ptr"),!fr)throw new O1("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,d=t.length;c<d;c++){const m=new Dh(t[c]);n[c]=m.createString(fr),r[c]=m.utf8Length}const i=fr.omalloc(4*t.length);fr.HEAPU32.set(n,i/4);const l=fr.omalloc(4*t.length);fr.HEAPU32.set(r,l/4);const o=fr.createOnigScanner(i,l,t.length);for(let c=0,d=t.length;c<d;c++)fr.ofree(n[c]);fr.ofree(l),fr.ofree(i),o===0&&NI(fr),this._onigBinding=fr,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 Mk(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 d=o/4;const m=c[d++],p=c[d++],g=[];for(let y=0;y<p;y++){const E=t.convertUtf8OffsetToUtf16(c[d++]),v=t.convertUtf8OffsetToUtf16(c[d++]);g[y]={start:E,end:v,length:v-E}}return{index:m,captureIndices:g}}}function RI(e){return typeof e.instantiator=="function"}function LI(e){return typeof e.default=="function"}function II(e){return typeof e.data<"u"}function OI(e){return typeof Response<"u"&&e instanceof Response}function DI(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 _f;function jI(e){if(_f)return _f;async function t(){fr=await wI(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),RI(r)?r=await r.instantiator(n):LI(r)?r=await r.default(n):(II(r)&&(r=r.data),OI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await MI(r)(n):r=await PI(r)(n):DI(r)?r=await v0(r)(n):r instanceof WebAssembly.Module?r=await v0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await v0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return _f=t(),_f}function v0(e){return t=>WebAssembly.instantiate(e,t)}function MI(e){return t=>WebAssembly.instantiateStreaming(e,t)}function PI(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function BI(e){return e&&await jI(e),{createScanner(t){return new AI(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Mk(t)}}}const UI=bI({langs:jk,themes:_I,engine:()=>BI(D(()=>import("./wasm-CG6Dc4jp.js"),[]))});function uu(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function HI(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const D1=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),hr=String.raw;function cu(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Pk=hr`\[\^?`,Bk=`c.? | C(?:-.?)?|${hr`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${hr`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${hr`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${hr`o\{[^\}]*\}?`}|${hr`\d{1,3}`}`,j1=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Tf=new RegExp(hr`
|
|
104
|
+
\\ (?:
|
|
105
|
+
${Bk}
|
|
106
|
+
| [gk]<[^>]*>?
|
|
107
|
+
| [gk]'[^']*'?
|
|
108
|
+
| .
|
|
109
|
+
)
|
|
110
|
+
| \( (?:
|
|
111
|
+
\? (?:
|
|
112
|
+
[:=!>({]
|
|
113
|
+
| <[=!]
|
|
114
|
+
| <[^>]*>
|
|
115
|
+
| '[^']*'
|
|
116
|
+
| ~\|?
|
|
117
|
+
| #(?:[^)\\]|\\.?)*
|
|
118
|
+
| [^:)]*[:)]
|
|
119
|
+
)?
|
|
120
|
+
| \*[^\)]*\)?
|
|
121
|
+
)?
|
|
122
|
+
| (?:${j1.source})+
|
|
123
|
+
| ${Pk}
|
|
124
|
+
| .
|
|
125
|
+
`.replace(/\s+/g,""),"gsu"),k0=new RegExp(hr`
|
|
126
|
+
\\ (?:
|
|
127
|
+
${Bk}
|
|
128
|
+
| .
|
|
129
|
+
)
|
|
130
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
131
|
+
| ${Pk}
|
|
132
|
+
| &&
|
|
133
|
+
| .
|
|
134
|
+
`.replace(/\s+/g,""),"gsu");function zI(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=iO(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(Tf.lastIndex=0;c=Tf.exec(e);){const g=FI(l,e,c[0],Tf.lastIndex);g.tokens?o.push(...g.tokens):g.token&&o.push(g.token),g.lastIndex!==void 0&&(Tf.lastIndex=g.lastIndex)}const d=[];let m=0;o.filter(g=>g.type==="GroupOpen").forEach(g=>{g.kind==="capturing"?g.number=++m:g.raw==="("&&d.push(g)}),m||d.forEach((g,y)=>{g.kind="capturing",g.number=y+1});const p=m||d.length;return{tokens:o.map(g=>g.type==="EscapedNumber"?oO(g,p):g).flat(),flags:r}}function FI(e,t,n,r){const[i,l]=n;if(n==="["||n==="[^"){const o=$I(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(l))return{token:X2(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:JI(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Hk(n)}}if(l==="K")return{token:zk("keep",n)};if(l==="N"||l==="R")return{token:Ul("newline",n,{negate:l==="N"})};if(l==="O")return{token:Ul("any",n)};if(l==="X")return{token:Ul("text_segment",n)};const o=Uk(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(l==="*")return{token:rO(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:nO(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Fo("group",n)};if(n==="(?>")return{token:Fo("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Fo(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Fo("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Fo("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:XI(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:Ul("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":hr`\A`,$:hr`\Z`}[n]:n;return{token:X2(o,n)}}return n==="|"?{token:GI(n)}:j1.test(n)?{tokens:uO(n)}:{token:ti(uu(n),n)}}function $I(e,t,n){const r=[K2(t[1]==="^",t)];let i=1,l;for(k0.lastIndex=n;l=k0.exec(e);){const o=l[0];if(o[0]==="["&&o[1]!==":")i++,r.push(K2(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ti(93,o));else if(i--,r.push(qI(o)),!i)break}else{const c=VI(o);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:k0.lastIndex||e.length}}function VI(e){if(e[0]==="\\")return Uk(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!D1.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Ul("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?YI(e):e==="&&"?WI(e):ti(uu(e),e)}function Uk(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return tO(e);if("dDhHsSwW".includes(n))return aO(e);if(e.startsWith(hr`\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 sO(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(d=>`\\x${d.toString(16)}`).join("");return ti(uu(o),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ti(lO(e),e);if(Z2.has(n))return ti(Z2.get(n),e);if(/\d/.test(n))return QI(t,e);if(e==="\\")throw new Error(hr`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ti(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function GI(e){return{type:"Alternator",raw:e}}function X2(e,t){return{type:"Assertion",kind:e,raw:t}}function Hk(e){return{type:"Backreference",raw:e}}function ti(e,t){return{type:"Character",value:e,raw:t}}function qI(e){return{type:"CharacterClassClose",raw:e}}function YI(e){return{type:"CharacterClassHyphen",raw:e}}function WI(e){return{type:"CharacterClassIntersector",raw:e}}function K2(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Ul(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function zk(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:cu(n.flags),raw:t}}function QI(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function XI(e){return{type:"GroupClose",raw:e}}function Fo(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function KI(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function ZI(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function JI(e){return{type:"Subroutine",raw:e}}const eO=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Z2=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function tO(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 ti(uu(t.toUpperCase())-64,e)}function nO(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=e_(n),o=e_(r),c={};if(l&&(c.enable=l),o&&(c.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),zk("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,Fo("group",e,{...(l||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function rO(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,d]=l,m=eO.has(n)?n.toLowerCase():"custom";switch(m){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 d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${m}"`)}return KI(m,r??null,(i==null?void 0:i.split(","))??null,e)}function J2(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 ZI(t,n,r,e)}function aO(e){const t=e[1].toLowerCase();return Ul({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function sO(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Ul("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function e_(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 iO(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 lO(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 oO(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[Hk(n)];const l=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const d=o[c];let m;if(c===0&&d!=="8"&&d!=="9"){if(m=parseInt(d,8),m>127)throw new Error(hr`Octal encoded byte above 177 unsupported "${n}"`)}else m=uu(d);l.push(ti(m,(c===0?"\\":"")+d))}return l}function uO(e){const t=[],n=new RegExp(j1,"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(J2(i.slice(0,-1)));continue}}}t.push(J2(i))}return t}function Fk(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 cO(e){return dO.has(e.type)}const dO=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function $k(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=zI(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(y,E)=>{const v=r.tokens[l.nextIndex];switch(l.parent=y,l.nextIndex++,v.type){case"Alternator":return Vl();case"Assertion":return fO(v);case"Backreference":return hO(v,l);case"Character":return Mh(v.value,{useLastValid:!!E.isCheckingRangeEnd});case"CharacterClassHyphen":return mO(v,l,E);case"CharacterClassOpen":return pO(v,l,E);case"CharacterSet":return gO(v,l);case"Directive":return TO(v.kind,{flags:v.flags});case"GroupOpen":return bO(v,l,E);case"NamedCallout":return kO(v.kind,v.tag,v.arguments);case"Quantifier":return xO(v,l);case"Subroutine":return yO(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=CO(vO(r.flags));let c=o.body[0];for(;l.nextIndex<r.tokens.length;){const y=i(c,{});y.type==="Alternative"?(o.body.push(y),c=y):c.body.push(y)}const{capturingGroups:d,hasNumberedRef:m,namedGroupsByName:p,subroutines:g}=l;if(m&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of g)if(typeof y=="number"){if(y>d.length)throw new Error("Subroutine uses a group number that's not defined");y&&(d[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(hr`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(hr`Subroutine uses a group name that's not defined "\g<${y}>"`);return o}function fO({kind:e}){return Cg(cu({"^":"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===hr`\B`||e===hr`\Y`})}function hO({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 d=!1;if(l>c)if(t.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Sg(o?c+1-l:l,{orphan:d})};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 Sg(r)}return i(+r)}function mO(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 d=i(l,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&d.type==="Character")return l.body.pop(),_O(o,d);throw new Error("Invalid character class range")}return Mh(uu("-"))}function pO({negate:e},t,n){const{tokens:r,walk:i}=t,l=r[t.nextIndex],o=[Wf()];let c=r_(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(Wf()),t.nextIndex++;else{const m=o.at(-1);m.body.push(i(m,n))}c=r_(r[t.nextIndex],l)}const d=Wf({negate:e});return o.length===1?d.body=o[0].body:(d.kind="intersection",d.body=o.map(m=>m.body.length===1?m.body[0]:m)),t.nextIndex++,d}function gO({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o}=r;if(e==="property"){const c=Ph(n);if(D1.has(c)&&!(o!=null&&o.has(c)))e="posix",n=c;else return $o(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o})}return e==="posix"?wO(n,{negate:t}):Ng(e,{negate:t})}function bO(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:l,skipLookbehindValidation:o,walk:c}=t,d=SO(e),m=d.type==="AbsenceFunction",p=n_(d),g=p&&d.negate;if(d.type==="CapturingGroup"&&(i.push(d),d.name&&HI(l,d.name,[]).push(d)),m&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=a_(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")d.body.push(Vl()),t.nextIndex++;else{const E=d.body.at(-1),v=c(E,{...n,isInAbsenceFunction:n.isInAbsenceFunction||m,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||g});if(E.body.push(v),(p||n.isInLookbehind)&&!o){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(t_(v)||v.type==="CapturingGroup")throw new Error(w)}else if(t_(v)||n_(v)&&v.negate)throw new Error(w)}}y=a_(r[t.nextIndex])}return t.nextIndex++,d}function xO({kind:e,min:t,max:n},r){const i=r.parent,l=i.body.at(-1);if(!l||!cO(l))throw new Error("Quantifier requires a repeatable token");const o=Gk(e,t,n,l);return i.body.pop(),o}function yO({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,d=n.length;if(t.hasNumberedRef=!0,i={"":c,"+":d+c,"-":d+1-c}[l.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=qk(i);return r.push(o),o}function EO(e,t){return{type:"AbsenceFunction",kind:e,body:Kc(t==null?void 0:t.body)}}function Vl(e){return{type:"Alternative",body:Yk(e==null?void 0:e.body)}}function Cg(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function Sg(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Vk(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!NO(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:Kc(t==null?void 0:t.body)}}function Mh(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 Wf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Yk(e==null?void 0:e.body)}}function _O(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ng(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 TO(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:cu(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function vO(e){return{type:"Flags",...e}}function Qa(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:Kc(e==null?void 0:e.body)}}function jl(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Kc(e==null?void 0:e.body)}}function kO(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function wO(e,t){const n=!!(t!=null&&t.negate);if(!D1.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Gk(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 CO(e,t){return{type:"Regex",body:Kc(t==null?void 0:t.body),flags:e}}function qk(e){return{type:"Subroutine",ref:e}}function $o(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(Ph(e));if(!r){if(n.normalizeUnknownPropertyNames)r=AO(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(hr`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function SO({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return EO("repeater");case"atomic":return Qa({atomic:!0});case"capturing":return Vk(i,{name:n});case"group":return Qa({flags:e});case"lookahead":case"lookbehind":return jl({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function Kc(e){if(e===void 0)e=[Vl()];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 Yk(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 t_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function n_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function NO(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function AO(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 Ph(e){return e.replace(/[- _]+/g,"").toLowerCase()}function r_(e,t){return cu(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function a_(e){return cu(e,"Unclosed group")}function kc(e,t,n=null){function r(l,o){for(let c=0;c<l.length;c++){const d=i(l[c],o,c,l);c=Math.max(-1,c+d)}}function i(l,o=null,c=null,d=null){var S,N;let m=0,p=!1;const g={node:l,parent:o,key:c,container:d,root:e,remove(){vf(d).splice(Math.max(0,Oo(c)+m),1),m--,p=!0},removeAllNextSiblings(){return vf(d).splice(Oo(c)+1)},removeAllPrevSiblings(){const A=Oo(c)+m;return m-=A,vf(d).splice(0,Math.max(0,A))},replaceWith(A,z={}){const Y=!!z.traverse;d?d[Math.max(0,Oo(c)+m)]=A:cu(o,"Can't replace root node")[c]=A,Y&&i(A,o,c,d),p=!0},replaceWithMultiple(A,z={}){const Y=!!z.traverse;if(vf(d).splice(Math.max(0,Oo(c)+m),1,...A),m+=A.length-1,Y){let M=0;for(let B=0;B<A.length;B++)M+=i(A[B],o,Oo(c)+B+M,d)}p=!0},skip(){p=!0}},{type:y}=l,E=t["*"],v=t[y],w=typeof E=="function"?E:E==null?void 0:E.enter,C=typeof v=="function"?v:v==null?void 0:v.enter;if(w==null||w(g,n),C==null||C(g,n),!p)switch(y){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 "${y}"`)}return(S=v==null?void 0:v.exit)==null||S.call(v,g,n),(N=E==null?void 0:E.exit)==null||N.call(E,g,n),m}return i(e),e}function vf(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Oo(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const RO=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function LO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function IO(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Pa=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function M1(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let o=0,c="";for(const d of e.matchAll(i)){const{0:m,groups:{$skip:p}}=d;if(!p&&(!r||r===Pa.DEFAULT==!o)){n instanceof Function?c+=n(d,{context:o?Pa.CHAR_CLASS:Pa.DEFAULT,negated:l[l.length-1]}):c+=n;continue}m[0]==="["?(o++,l.push(m[1]==="^")):m==="]"&&o&&(o--,l.pop()),c+=m}return c}function Wk(e,t,n,r){M1(e,t,n,r)}function OO(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:d}}=o;if(!d&&(!r||r===Pa.DEFAULT==!l))return o;c==="["?l++:c==="]"&&l&&l--,i.lastIndex==o.index&&i.lastIndex++}return null}function kf(e,t,n){return!!OO(e,t,0,n)}function DO(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 s_=new RegExp(String.raw`(?<noncapturingStart>${RO})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function jO(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 d=0,m=0,p=NaN,g;do{g=!1;let y=0,E=0,v=!1,w;for(s_.lastIndex=Number.isNaN(p)?0:p+l.length;w=s_.exec(e);){const{0:C,index:S,groups:{capturingStart:N,noncapturingStart:A}}=w;if(C==="[")y++;else if(y)C==="]"&&y--;else if(C===i&&!v)p=S,v=!0;else if(v&&A)E++;else if(N)v?E++:(d++,o.push(d+m));else if(C===")"&&v){if(!E){m++;const z=d+m;if(e=`${e.slice(0,p)}${l}${e.slice(p+i.length,S)}))<$$${z}>)${e.slice(S+1)}`,g=!0,c.push(z),LO(n,z),r.size){const Y=new Map;r.forEach((M,B)=>{Y.set(B>=z?B+1:B,M.map(G=>G>=z?G+1:G))}),r=Y}break}E--}}}while(g);return n.push(...c),e=M1(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:E,wrappedBackrefNum:v}})=>{if(E){const w=+E;if(w>o.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${o[w]}`}return`\\${v}`},Pa.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Qk=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,w0=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>${Qk})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
149
|
+
| \\?.
|
|
150
|
+
`.replace(/\s+/g,""),"gsu");function MO(e){if(!new RegExp(`${Qk}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",l=0,o;for(w0.lastIndex=0;o=w0.exec(e);){const{0:c,index:d,groups:{qBase:m,qMod:p,invalidQ:g}}=o;if(c==="[")l||(r=d),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 y=-1;if(/^\{\d+\}$/.test(m))e=IO(e,d+m.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,d)}${m})${e.slice(d+c.length)}`}else e=`${e.slice(0,d-i.length)}(?>${i}${m})${e.slice(d+c.length)}`;y+=4}w0.lastIndex+=y}else c[0]==="("?t.push(d):c===")"&&(n=t.length?t.pop():null);i=c}return{pattern:e}}const Ma=String.raw,PO=Ma`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Ag=Ma`\(\?R=(?<rDepth>[^\)]+)\)|${PO}`,Bh=Ma`\(\?<(?![=!])(?<captureName>[^>]+)>`,Xk=Ma`${Bh}|(?<unnamed>\()(?!\?)`,Ll=new RegExp(Ma`${Bh}|${Ag}|\(\?|\\?.`,"gsu"),C0="Cannot use multiple overlapping recursions";function BO(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Ag,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&kf(e,Ma`\(\?\(DEFINE\)`,Pa.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],o=kf(e,Ma`\\[1-9]`,Pa.DEFAULT),c=new Map,d=[];let m=!1,p=0,g=0,y;for(Ll.lastIndex=0;y=Ll.exec(e);){const{0:E,groups:{captureName:v,rDepth:w,gRNameOrNum:C,gRDepth:S}}=y;if(E==="[")p++;else if(p)E==="]"&&p--;else if(w){if(i_(w),m)throw new Error(C0);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const N=e.slice(0,y.index),A=e.slice(Ll.lastIndex);if(kf(A,Ag,Pa.DEFAULT))throw new Error(C0);const z=+w-1;e=l_(N,A,z,!1,n,l,g),i=u_(i,N,z,l.length,0,g);break}else if(C){i_(S);let N=!1;for(const V of d)if(V.name===C||V.num===+C){if(N=!0,V.hasRecursedWithin)throw new Error(C0);break}if(!N)throw new Error(Ma`Recursive \g cannot be used outside the referenced group "${r==="external"?C:Ma`\g<${C}&R=${S}>`}"`);const A=c.get(C),z=DO(e,A);if(o&&kf(z,Ma`${Bh}|\((?!\?)`,Pa.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const Y=e.slice(A,y.index),M=z.slice(Y.length+E.length),B=l.length,G=+S-1,ce=l_(Y,M,G,!0,n,l,g);i=u_(i,Y,G,l.length-B,B,g);const Q=e.slice(0,A),he=e.slice(A+z.length);e=`${Q}${ce}${he}`,Ll.lastIndex+=ce.length-E.length-Y.length-M.length,d.forEach(V=>V.hasRecursedWithin=!0),m=!0}else if(v)g++,c.set(String(g),Ll.lastIndex),c.set(v,Ll.lastIndex),d.push({num:g,name:v});else if(E[0]==="("){const N=E==="(";N&&(g++,c.set(String(g),Ll.lastIndex)),d.push(N?{num:g}:{})}else E===")"&&d.pop()}return n.push(...l),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function i_(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 l_(e,t,n,r,i,l,o){const c=new Set;r&&Wk(e+t,Bh,({groups:{captureName:m}})=>{c.add(m)},Pa.DEFAULT);const d=[n,r?c:null,i,l,o];return`${e}${o_(`(?:${e}`,"forward",...d)}(?:)${o_(`${t})`,"backward",...d)}${t}`}function o_(e,t,n,r,i,l,o){const d=p=>t==="forward"?p+2:n-p+2-1;let m="";for(let p=0;p<n;p++){const g=d(p);m+=M1(e,Ma`${Xk}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:E,unnamed:v,backref:w}})=>{if(w&&r&&!r.has(w))return y;const C=`_$${g}`;if(v||E){const S=o+l.length+1;return l.push(S),UO(i,S),v?y:`(?<${E}${C}>`}return Ma`\k<${w}${C}>`},Pa.DEFAULT)}return m}function UO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function u_(e,t,n,r,i,l){if(e.size&&r){let o=0;Wk(t,Xk,()=>o++,Pa.DEFAULT);const c=l-o+i,d=new Map;return e.forEach((m,p)=>{const g=(r-o*n)/n,y=o*n,E=p>c+o?p+r:p,v=[];for(const w of m)if(w<=c)v.push(w);else if(w>c+o+g)v.push(w+r);else if(w<=c+o)for(let C=0;C<=n;C++)v.push(w+o*C);else for(let C=0;C<=n;C++)v.push(w+y+g*C);d.set(E,v)}),d}return e}var sr=String.fromCodePoint,Et=String.raw,Xa={},Uh=globalThis.RegExp;Xa.flagGroups=(()=>{try{new Uh("(?i:)")}catch{return!1}return!0})();Xa.unicodeSets=(()=>{try{new Uh("[[]]","v")}catch{return!1}return!0})();Xa.bugFlagVLiteralHyphenIsRange=Xa.unicodeSets?(()=>{try{new Uh(Et`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Xa.bugNestedClassIgnoresNegation=Xa.unicodeSets&&new Uh("[[^a]]","v").test("a");function fh(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 zc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Rg(e,t){return c_[e]>=c_[t]}function HO(e,t){if(e==null)throw new Error(t??"Value expected");return e}var c_={ES2025:2025,ES2024:2024,ES2018:2018},zO={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Kk(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!zO[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=Xa.flagGroups?"ES2025":Xa.unicodeSets?"ES2024":"ES2018"),t}var FO="[ -\r ]",$O=new Set([sr(304),sr(305)]),Ws=Et`[\p{L}\p{M}\p{N}\p{Pc}]`;function Zk(e){if($O.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=qO.get(n),l=VO.get(n),o=GO.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 P1=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=>[Ph(e),e])),VO=new Map([["s",sr(383)],[sr(383),"s"]]),GO=new Map([[sr(223),sr(7838)],[sr(107),sr(8490)],[sr(229),sr(8491)],[sr(969),sr(8486)]]),qO=new Map([qi(453),qi(456),qi(459),qi(498),...S0(8072,8079),...S0(8088,8095),...S0(8104,8111),qi(8124),qi(8140),qi(8188)]),YO=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 WO(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function qi(e){const t=sr(e);return[t.toLowerCase(),t]}function S0(e,t){return WO(e,t).map(n=>qi(n))}var Jk=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function QO(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};e3(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Rg(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};kc(e,XO,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};kc(e,KO,l);const o={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return kc(e,ZO,o),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var XO={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const l=Qa();l.body[0].body.push(jl({negate:!0,body:r}),$o("Any"));const o=Qa();o.body[0].body.push(Gk("greedy",0,1/0,l)),n(Hn(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];zc(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=n3(t.get(e));if(r){const i=Qa({flags:r});i.body[0].body=e.body,e.body=[Hn(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:l,replaceWith:o},c){const{kind:d,negate:m}=e,{asciiWordBoundaries:p,avoidSubclass:g,supportedGNodes:y,wordIsAscii:E}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${m?"Y":"y"}"`);if(d==="line_end")o(Hn(jl({body:[Vl({body:[Cg("string_end")]}),Vl({body:[Mh(10)]})]}),t));else if(d==="line_start")o(Hn(Qs(Et`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(d==="search_start")if(y.has(e))i.flags.sticky=!0,l();else{const v=r[n-1];if(v&&a8(v))o(Hn(jl({negate:!0}),t));else{if(g)throw new Error(Et`Uses "\G" in a way that requires a subclass`);o(Yi(Cg("string_start"),t)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")o(Hn(Qs(Et`(?=\n?\z)`),t));else if(d==="word_boundary"){if(!E&&!p){const v=`(?:(?<=${Ws})(?!${Ws})|(?<!${Ws})(?=${Ws}))`,w=`(?:(?<=${Ws})(?=${Ws})|(?<!${Ws})(?!${Ws}))`;o(Hn(Qs(m?w:v),t))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!A0(n)&&(n=N0(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!A0(r)&&(r=N0(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=Wf({body:[e]});n(Hn(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:l,spaceIsAscii:o,wordIsAscii:c}){const{kind:d,negate:m,value:p}=e;if(l&&(d==="digit"||p==="digit")){n(Yi(Ng("digit",{negate:m}),t));return}if(o&&(d==="space"||p==="space")){n(Hn(R0(Qs(FO),m),t));return}if(c&&(d==="word"||p==="word")){n(Yi(Ng("word",{negate:m}),t));return}if(d==="any")n(Yi($o("Any"),t));else if(d==="digit")n(Yi($o("Nd",{negate:m}),t));else if(d!=="dot")if(d==="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})?",y=Et`\p{RI}{2}|${g}(?:\u200D${g})*`;n(Hn(Qs(Et`(?>\r\n|${i?Et`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(d==="hex")n(Yi($o("AHex",{negate:m}),t));else if(d==="newline")n(Hn(Qs(m?`[^
|
|
241
|
+
]`:`(?>\r
|
|
242
|
+
?|[
|
|
243
|
+
\v\f
\u2028\u2029])`),t));else if(d==="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];m&&(g=`\0-${sr(g.codePointAt(0)-1)}${sr(g.codePointAt(2)+1)}-`),n(Hn(Qs(`[${g}]`),t))}else n(Hn(R0(Qs(YO.get(p)),m),t));else if(d==="property")P1.has(Ph(p))||(e.key="sc");else if(d==="space")n(Yi($o("space",{negate:m}),t));else if(d==="word")n(Hn(R0(Qs(Ws),m),t));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:l,removeAllNextSiblings:o}){const{kind:c,flags:d}=e;if(c==="flags")if(!d.enable&&!d.disable)r();else{const m=Qa({flags:d});m.body[0].body=o(),i(Hn(m,t),{traverse:!0})}else if(c==="keep"){const m=n.body[0],g=n.body.length===1&&Fk(m,{type:"Group"})&&m.body[0].body.length===1?m.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(Et`Uses "\K" in a way that's unsupported`);const y=jl({behind:!0});y.body[0].body=l(),i(Hn(y,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(Hn(jl({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Qa();t.body[0].body.push(e.body),e.body=Hn(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=a3(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"&&!A0(n)&&(n=N0(n,t),e.ref=n)}},KO={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:d}){const m=i.get(e);if(m&&c.has(e.number)){const g=Yi(d_(e.number),t);d.set(g,c.get(e.number)),n(g);return}c.set(e.number,e),o.set(e.number,[]),e.name&&zc(o,e.name,[]);const p=o.get(e.name??e.number);for(let g=0;g<p.length;g++){const y=p[g];if(m===y.node||m&&m===y.origin||e===y.origin){p.splice(g,1);break}}if(o.get(e.number).push({node:e,origin:m}),e.name&&o.get(e.name).push({node:e,origin:m}),e.name){const g=zc(l,e.name,new Map);let y=!1;if(m)y=!0;else for(const E of g.values())if(!E.hasDuplicateNameToRemove){y=!0;break}l.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=fh(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,d=c?d_(0):t3(o,r.groupOriginByCopy,null);let m=d;if(!c){const p=n3(t8(o,y=>y.type==="Group"&&!!y.flags)),g=p?fh(r.globalFlags,p):r.globalFlags;JO(g,r.currentFlags)||(m=Qa({flags:n8(g)}),m.body[0].body.push(d))}n(Hn(m,t),{traverse:!c})}},ZO={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=>e8(o,e));if(!l.length)n(Hn(jl({negate:!0}),t));else if(l.length>1){const o=Qa({atomic:!0,body:l.reverse().map(c=>Vl({body:[Sg(c.number)]}))});n(Hn(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=Vk();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function e3(e){kc(e,{"*"({node:t,parent:n}){t.parent=n}})}function JO(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function e8(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=r3(n.parent);for(const i of r){if(i===n)break;if(i===e||s3(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function t3(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]=t3(o,t,i,n):(l==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[l]=o);return i}function d_(e){const t=qk(e);return t.isRecursive=!0,t}function t8(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function N0(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 n3(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 n8({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 r3(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function a3(e){const t=e.find(n=>n.kind==="search_start"||s8(n,{negate:!1})||!r8(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=a3(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function s3(e,t){const n=r3(e)??[];for(const r of n)if(r===t||s3(r,t))return!0;return!1}function r8({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function a8(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function s8(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Fk(e.body[0],{type:"Assertion",kind:"search_start"})}function A0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Qs(e,t){const r=$k(e,{...t,unicodePropertyMap:P1}).body;return r.length>1||r[0].body.length>1?Qa({body:r}):r[0].body[0]}function R0(e,t){return e.negate=t,e}function Yi(e,t){return e.parent=t,e}function Hn(e,t){return e3(e),e.parent=t,e}function i8(e,t){const n=Kk(t),r=Rg(n.target,"ES2024"),i=Rg(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];kc(e,l8,{getCurrentModI:()=>E.at(-1),popModI(){E.pop()},pushModI(v){E.push(v)},setHasCasedChar(){E.at(-1)?o=!0:c=!0}})}const d={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!c)};let m=e;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:m,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:r,verbose:n.verbose};function g(E){return p.lastNode=m,m=E,HO(o8[E.type],`Unexpected node type "${E.type}"`)(E,p,g)}const y={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return r||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((E,v)=>{E.hidden&&y._hiddenCaptures.push(v),E.transferTo&&zc(y._captureTransfers,E.transferTo,[]).push(v)}),y}var l8={"*":{enter({node:e},t){if(h_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?fh({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){h_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){B1(sr(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),i3(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Jk.has(e.value)&&t.setHasCasedChar()}},o8={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=sr(e),r=Do(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&B1(n)){const i=Zk(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");Xa.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(m_)&&(o=[Mh(45),...o.filter(m=>!m_(m))]);const c=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Xa.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(p.length){const g=Qa(),y=g.body[0];return g.parent=l,y.parent=g,o=o.filter(E=>!p.includes(E)),e.body=o,o.length?(e.parent=y,y.body.push(e)):g.body.pop(),p.forEach(E=>{const v=Vl({body:[E]});E.parent=v,v.parent=g,g.body.push(v)}),n(g)}}t.inCharClass=!0;const m=c();return t.inCharClass=!1,m}const d=o[0];if(r==="union"&&!i&&d&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(Xa.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&o.length===1&&d.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=Do(n,i),o=Do(r,i),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const d=i3(e);h8(d).forEach(p=>{c.add(Array.isArray(p)?`${Do(p[0],i)}-${Do(p[1],i)}`:Do(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&&Jk.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=fh(o,n));const c=t.map(l).join("|"),d=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?c:`(?${m8(e,n,i.useFlagMods)}${c})`;return i.currentFlags=o,d},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)+p8(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}>`}},u8=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),c8=new Set(["-","\\","]","^","["]),d8=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),f_=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`]]),f8=new RegExp("^\\p{Cased}$","u");function B1(e){return f8.test(e)}function i3(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=sr(o);if(!B1(c))continue;const d=Zk(c).filter(m=>{const p=m.codePointAt(0);return p<r||p>i});if(d.length&&(l.push(...d),n))break}return l}function Do(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(f_.has(e))return f_.get(e);if(e<32||e>126&&e<160||e>262143||t&&g8(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?d8:c8:u8,l=sr(e);return(i.has(l)?"\\":"")+l}function h8(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 m8(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 p8({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 h_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function g8(e){return e>47&&e<58}function m_({type:e,value:t}){return e==="Character"&&t===45}var Ki,Zs,zl,Zi,Fl,Gc,Lg,tl,b8=(tl=class extends RegExp{constructor(n,r,i){var t=(...tW)=>(super(...tW),Sl(this,Gc),Sl(this,Ki,new Map),Sl(this,Zs,null),Sl(this,zl),Sl(this,Zi,null),Sl(this,Fl,null),ue(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),Ya(this,zl,o.source),o instanceof tl&&(Ya(this,Ki,Or(o,Ki)),Ya(this,Zi,Or(o,Zi)),Ya(this,Fl,Or(o,Fl)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(l?"":n,r),Ya(this,zl,n),Ya(this,Ki,y8(o.hiddenCaptures,o.transfers)),Ya(this,Fl,o.strategy),this.rawOptions=i??{}}l||Ya(this,Zs,this)}get source(){return Or(this,zl)||"(?:)"}exec(n){if(!Or(this,Zs)){const{lazyCompile:l,...o}=this.rawOptions;Ya(this,Zs,new tl(Or(this,zl),this.flags,o))}const r=this.global||this.sticky,i=this.lastIndex;if(Or(this,Fl)==="clip_search"&&r&&i){this.lastIndex=0;const l=Kp(this,Gc,Lg).call(this,n.slice(i));return l&&(x8(l,i,n,this.hasIndices),this.lastIndex+=i),l}return Kp(this,Gc,Lg).call(this,n)}},Ki=new WeakMap,Zs=new WeakMap,zl=new WeakMap,Zi=new WeakMap,Fl=new WeakMap,Gc=new WeakSet,Lg=function(n){Or(this,Zs).lastIndex=this.lastIndex;const r=$E(tl.prototype,this,"exec").call(Or(this,Zs),n);if(this.lastIndex=Or(this,Zs).lastIndex,!r||!Or(this,Ki).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:d,transferTo:m}=Or(this,Ki).get(c)??{};if(d?o.push(null):(o.push(r.length),r.push(i[c]),this.hasIndices&&r.indices.push(l[c])),m&&i[c]!==void 0){const p=o[m];if(!p)throw new Error(`Invalid capture transfer to "${p}"`);if(r[p]=i[c],this.hasIndices&&(r.indices[p]=l[c]),r.groups){Or(this,Zi)||Ya(this,Zi,E8(this.source));const g=Or(this,Zi).get(m);g&&(r.groups[g]=i[c],this.hasIndices&&(r.indices.groups[g]=l[c]))}}}return r},tl);function x8(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 y8(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)zc(n,l,{}).transferTo=r;return n}function E8(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:d}}=l;o==="["?r++:r?o==="]"&&r--:c&&(i++,d&&n.set(i,d))}return n}function _8(e,t){const n=T8(e,t);return n.options?new b8(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function T8(e,t){const n=Kk(t),r=$k(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:P1}),i=QO(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=i8(i,n),o=BO(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),c=MO(o.pattern),d=jO(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),m={pattern:d.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=d.hiddenCaptures.sort((v,w)=>v-w),g=Array.from(d.captureTransfers),y=i._strategy,E=m.pattern.length>=n.lazyCompileLength;(p.length||g.length||y||E)&&(m.options={...p.length&&{hiddenCaptures:p},...g.length&&{transfers:g},...y&&{strategy:y},...E&&{lazyCompile:E}})}return m}const p_=4294967295;class v8{constructor(t,n={}){ue(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 d=l(o);return i==null||i.set(o,d),d}catch(d){if(i==null||i.set(o,d),r)return null;throw d}})}findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,l=[];function o(c,d,m=0){return{index:c,captureIndices:d.indices.map(p=>p==null?{start:p_,end:p_,length:0}:{start:p[0]+m,end:p[1]+m,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const d=this.regexps[c];if(d)try{d.lastIndex=n;const m=d.exec(i);if(!m)continue;if(m.index===n)return o(c,m,0);l.push([c,m,0])}catch(m){if(this.options.forgiving)continue;throw m}}if(l.length){const c=Math.min(...l.map(d=>d[1].index));for(const[d,m,p]of l)if(m.index===c)return o(d,m,p)}return null}}function k8(e,t){return _8(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function w8(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>k8(n,{target:t.target})),{createScanner(n){return new v8(n,t)},createString(n){return{content:n}}}}var C8=w8({forgiving:!0}),S8=Object.fromEntries(I1.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(n=>[n,e.id])})),Qf=new Set(Object.keys(jk)),g_=e=>{let t=e.trim().toLowerCase();return S8[t]||(Qf.has(t),t)},L0=new Map,I0=new Map,jo=new Map,hh=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},N8=(e,t)=>`${e}-${hh(t[0])}-${hh(t[1])}`,A8=(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}`},R8=(e,t)=>{let n=N8(e,t);if(L0.has(n))return L0.get(n);let r=UI({themes:t,langs:[e],engine:C8});return L0.set(n,r),r};function L8(e={}){var t;let n=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(r){let i=g_(r);return Qf.has(i)},getSupportedLanguages(){return Array.from(Qf)},getThemes(){return n},highlight({code:r,language:i,themes:l},o){let c=g_(i),d=[hh(l[0]),hh(l[1])],m=A8(r,c,d);if(I0.has(m))return I0.get(m);o&&(jo.has(m)||jo.set(m,new Set),jo.get(m).add(o));let p=Qf.has(c)?c:"text";return R8(p,l).then(g=>{let y=g.getLoadedLanguages().includes(c)?c:"text",E=g.codeToTokens(r,{lang:y,themes:{light:d[0],dark:d[1]}});I0.set(m,E);let v=jo.get(m);if(v){for(let w of v)w(E);jo.delete(m)}}).catch(g=>{console.error("[Streamdown Code] Failed to highlight code:",g),jo.delete(m)}),null}}}var I8=L8();const Hh=(function(e){if(e==null)return M8;if(typeof e=="function")return zh(e);if(typeof e=="object")return Array.isArray(e)?O8(e):D8(e);if(typeof e=="string")return j8(e);throw new Error("Expected function, string, or object as test")});function O8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Hh(e[n]);return zh(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function D8(e){const t=e;return zh(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function j8(e){return zh(t);function t(n){return n&&n.type===e}}function zh(e){return t;function t(n,r,i){return!!(P8(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function M8(){return!0}function P8(e){return e!==null&&typeof e=="object"&&"type"in e}const l3=[],xc=!0,Ig=!1,qo="skip";function U1(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=Hh(i),o=r?-1:1;c(e,void 0,[])();function c(d,m,p){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(E?"<"+E+">":""))+")"})}return y;function y(){let E=l3,v,w,C;if((!t||l(d,m,p[p.length-1]||void 0))&&(E=B8(n(d,p)),E[0]===Ig))return E;if("children"in d&&d.children){const S=d;if(S.children&&E[0]!==qo)for(w=(r?S.children.length:-1)+o,C=p.concat(S);w>-1&&w<S.children.length;){const N=S.children[w];if(v=c(N,w,C)(),v[0]===Ig)return v;w=typeof v[1]=="number"?v[1]:w+o}}return E}}}function B8(e){return Array.isArray(e)?e:typeof e=="number"?[xc,e]:e==null?l3:[e]}function bs(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),U1(e,l,c,i);function c(d,m){const p=m[m.length-1],g=p?p.children.indexOf(d):void 0;return o(d,g,p)}}const Jo={indicator:"indicator",textOnly:"text-only",remove:"remove"};function U8({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=Jo.indicator,imageBlockPolicy:d=Jo.indicator}){const m=t.length&&!t.every(g=>g==="*"),p=n.length&&!n.every(g=>g==="*");if(!e&&(m||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return g=>{const y=G8(e,t,n,r,i,l,o,c,d);o3(g),bs(g,y)}}function b_(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 H8(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const z8=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),F8=new Set(["javascript:","data:","file:","vbscript:"]);function x_(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=b_(e,n);if(!o||F8.has(o.protocol)||!(z8.has(o.protocol)||l.includes(o.protocol)||l.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const d=H8(e);return o&&t.some(m=>{const p=b_(m,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?d?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:d?o.pathname+o.search+o.hash:o.href:null}function o3(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)o3(t)}}const O0=Symbol("node-seen");function $8(e,t,n){return t===Jo.remove?{type:"remove"}:t===Jo.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 V8(e,t,n){if(t===Jo.remove)return{type:"remove"};if(t===Jo.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 G8=(e,t,n,r,i,l,o,c,d)=>{const m=(p,g,y)=>{if(p.type!=="element"||p[O0])return xc;if(p.tagName==="a"){const E=x_(p.properties.href,t,e,!1,!1,i);if(E===null){if(p[O0]=!0,bs(p,m),y&&typeof g=="number"){const v=$8(p,c,o);if(v.type==="remove")return y.children.splice(g,1),[qo,g];y.children[g]=v.element}return qo}else return p.properties.href=E,p.properties.target="_blank",p.properties.rel="noopener noreferrer",xc}if(p.tagName==="img"){const E=x_(p.properties.src,n,e,r,!0,i);if(E===null){if(p[O0]=!0,bs(p,m),y&&typeof g=="number"){const v=V8(p,d,l);if(v.type==="remove")return y.children.splice(g,1),[qo,g];y.children[g]=v.element}return qo}else return p.properties.src=E,xc}return xc};return m},u3=-1,Fh=0,wc=1,mh=2,H1=3,z1=4,F1=5,$1=6,c3=7,d3=8,y_=typeof self=="object"?self:globalThis,q8=(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 Fh:case u3:return n(o,i);case wc:{const c=n([],i);for(const d of o)c.push(r(d));return c}case mh:{const c=n({},i);for(const[d,m]of o)c[r(d)]=r(m);return c}case H1:return n(new Date(o),i);case z1:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case F1:{const c=n(new Map,i);for(const[d,m]of o)c.set(r(d),r(m));return c}case $1:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case c3:{const{name:c,message:d}=o;return n(new y_[c](d),i)}case d3: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 y_[l](o),i)};return r},E_=e=>q8(new Map,e)(0),Mo="",{toString:Y8}={},{keys:W8}=Object,lc=e=>{const t=typeof e;if(t!=="object"||!e)return[Fh,t];const n=Y8.call(e).slice(8,-1);switch(n){case"Array":return[wc,Mo];case"Object":return[mh,Mo];case"Date":return[H1,Mo];case"RegExp":return[z1,Mo];case"Map":return[F1,Mo];case"Set":return[$1,Mo];case"DataView":return[wc,n]}return n.includes("Array")?[wc,n]:n.includes("Error")?[c3,n]:[mh,n]},wf=([e,t])=>e===Fh&&(t==="function"||t==="symbol"),Q8=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},l=o=>{if(n.has(o))return n.get(o);let[c,d]=lc(o);switch(c){case Fh:{let p=o;switch(d){case"bigint":c=d3,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([u3],o)}return i([c,p],o)}case wc:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],g=i([c,p],o);for(const y of o)p.push(l(y));return g}case mh:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const p=[],g=i([c,p],o);for(const y of W8(o))(e||!wf(lc(o[y])))&&p.push([l(y),l(o[y])]);return g}case H1:return i([c,o.toISOString()],o);case z1:{const{source:p,flags:g}=o;return i([c,{source:p,flags:g}],o)}case F1:{const p=[],g=i([c,p],o);for(const[y,E]of o)(e||!(wf(lc(y))||wf(lc(E))))&&p.push([l(y),l(E)]);return g}case $1:{const p=[],g=i([c,p],o);for(const y of o)(e||!wf(lc(y)))&&p.push(l(y));return g}}const{message:m}=o;return i([c,{name:d,message:m}],o)};return l},__=(e,{json:t,lossy:n}={})=>{const r=[];return Q8(!(t||n),!!t,new Map,r)(e),r},Gl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?E_(__(e,t)):structuredClone(e):(e,t)=>E_(__(e,t));const T_=/[#.]/g;function X8(e,t){const n=e||"",r={};let i=0,l,o;for(;i<n.length;){T_.lastIndex=i;const c=T_.exec(n),d=n.slice(i,c?c.index:n.length);d&&(l?l==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:o=d,i+=d.length),c&&(l=c[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function f3(e,t,n){const r=n?eD(n):void 0;function i(l,o,...c){let d;if(l==null){d={type:"root",children:[]};const m=o;c.unshift(m)}else{d=X8(l,t);const m=d.tagName.toLowerCase(),p=r?r.get(m):void 0;if(d.tagName=p||m,K8(o))c.unshift(o);else for(const[g,y]of Object.entries(o))Z8(e,d.properties,g,y)}for(const m of c)Og(d.children,m);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return i}function K8(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 Z8(e,t,n,r){const i=Xc(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=H2(r):i.commaSeparated?l=U2(r):i.commaOrSpaceSeparated?l=H2(U2(r).join(" ")):l=v_(i,i.property,r):Array.isArray(r)?l=[...r]:l=i.property==="style"?J8(r):String(r);if(Array.isArray(l)){const o=[];for(const c of l)o.push(v_(i,i.property,c));l=o}i.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[i.property]=l}}function Og(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)Og(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Og(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function v_(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Uc(n)===Uc(t)))return!0}return n}function J8(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function eD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const tD=["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"],nD=f3(lu,"div"),rD=f3(ys,"g",tD);function aD(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 d=k_(t,n[o-1]);c=d===-1?t.length+1:d+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],d=k_(t,c),m=d===-1?t.length+1:d+1;if(c===m)break;n.push(m)}const o=(l.line>1?n[l.line-2]:0)+l.column-1;if(o<n[l.line-1])return o}}}function k_(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 Hl={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/"},h3={}.hasOwnProperty,sD=Object.prototype;function iD(e,t){const n=t||{};return V1({file:n.file||void 0,location:!1,schema:n.space==="svg"?ys:lu,verbose:n.verbose||!1},e)}function V1(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Xf(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:m3(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const l=String(e.file),o=aD(l),c=o.toPoint(0),d=o.toPoint(l.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Xf(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Xf(e,r,n),n}default:return n=lD(e,t),n}}function m3(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=V1(e,t[n]);r.push(i)}return r}function lD(e,t){const n=e.schema;e.schema=t.namespaceURI===Hl.svg?ys:lu;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;h3.call(sD,d)||(i[d]=c.value)}const o=(e.schema.space==="svg"?rD:nD)(t.tagName,i,m3(e,t.childNodes));if(Xf(e,t,o),o.tagName==="template"){const c=t,d=c.sourceCodeLocation,m=d&&d.startTag&&Yo(d.startTag),p=d&&d.endTag&&Yo(d.endTag),g=V1(e,c.content);m&&p&&e.file&&(g.position={start:m.end,end:p.start}),o.content=g}return e.schema=n,o}function Xf(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=oD(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function oD(e,t,n){const r=Yo(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)h3.call(n.attrs,o)&&(l[Xc(e.schema,o).property]=Yo(n.attrs[o]));n.startTag;const c=Yo(n.startTag),d=n.endTag?Yo(n.endTag):void 0,m={opening:c};d&&(m.closing=d),m.properties=l,t.data={position:m}}}return r}function Yo(e){const t=w_({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=w_({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function w_(e){return e.line&&e.column?e:void 0}const uD={},cD={}.hasOwnProperty,p3=T1("type",{handlers:{root:fD,element:bD,text:pD,comment:gD,doctype:mD}});function dD(e,t){const r=(t||uD).space;return p3(e,r==="svg"?ys:lu)}function fD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=G1(e.children,n,t),du(e,n),n}function hD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=G1(e.children,n,t),du(e,n),n}function mD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return du(e,t),t}function pD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return du(e,t),t}function gD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return du(e,t),t}function bD(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ys);const i=[];let l;if(e.properties){for(l in e.properties)if(l!=="children"&&cD.call(e.properties,l)){const d=xD(r,l,e.properties[l]);d&&i.push(d)}}const o=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Hl[o],childNodes:[],parentNode:null};return c.childNodes=G1(e.children,c,r),du(e,c),e.tagName==="template"&&e.content&&(c.content=hD(e.content,r)),c}function xD(e,t,n){const r=Xc(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?v1(n):k1(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=Hl[r.space]}return i}function G1(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const l=p3(e[r],n);l.parentNode=t,i.push(l)}return i}function du(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 yD=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]),Nn="�";var j;(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"})(j||(j={}));const qr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function g3(e){return e>=55296&&e<=57343}function ED(e){return e>=56320&&e<=57343}function _D(e,t){return(e-55296)*1024+9216+t}function b3(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function x3(e){return e>=64976&&e<=65007||yD.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 TD=65536;class vD{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=TD,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(ED(n))return this.pos++,this._addGap(),_D(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,j.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,j.EOF;const r=this.html.charCodeAt(n);return r===j.CARRIAGE_RETURN?j.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,j.EOF;let t=this.html.charCodeAt(this.pos);return t===j.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,j.LINE_FEED):t===j.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,g3(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===j.LINE_FEED||t===j.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){b3(t)?this._err(pe.controlCharacterInInputStream):x3(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 Rt;(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"})(Rt||(Rt={}));function y3(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 kD=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))),wD=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 CD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wD.get(e))!==null&&t!==void 0?t:e}var mr;(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"})(mr||(mr={}));const SD=32;var Ji;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ji||(Ji={}));function Dg(e){return e>=mr.ZERO&&e<=mr.NINE}function ND(e){return e>=mr.UPPER_A&&e<=mr.UPPER_F||e>=mr.LOWER_A&&e<=mr.LOWER_F}function AD(e){return e>=mr.UPPER_A&&e<=mr.UPPER_Z||e>=mr.LOWER_A&&e<=mr.LOWER_Z||Dg(e)}function RD(e){return e===mr.EQUALS||AD(e)}var dr;(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"})(dr||(dr={}));var Js;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Js||(Js={}));class LD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=dr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Js.Strict}startEntity(t){this.decodeMode=t,this.state=dr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case dr.EntityStart:return t.charCodeAt(n)===mr.NUM?(this.state=dr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=dr.NamedEntity,this.stateNamedEntity(t,n));case dr.NumericStart:return this.stateNumericStart(t,n);case dr.NumericDecimal:return this.stateNumericDecimal(t,n);case dr.NumericHex:return this.stateNumericHex(t,n);case dr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|SD)===mr.LOWER_X?(this.state=dr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=dr.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(Dg(i)||ND(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(Dg(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===mr.SEMI)this.consumed+=1;else if(this.decodeMode===Js.Strict)return 0;return this.emitCodePoint(CD(this.result),this.consumed),this.errors&&(t!==mr.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&Ji.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=ID(r,i,this.treeIndex+Math.max(1,l),o),this.treeIndex<0)return this.result===0||this.decodeMode===Js.Attribute&&(l===0||RD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],l=(i&Ji.VALUE_LENGTH)>>14,l!==0){if(o===mr.SEMI)return this.emitNamedEntityData(this.treeIndex,l,this.consumed+this.excess);this.decodeMode!==Js.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]&Ji.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]&~Ji.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case dr.NamedEntity:return this.result!==0&&(this.decodeMode!==Js.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case dr.NumericDecimal:return this.emitNumericEntity(0,2);case dr.NumericHex:return this.emitNumericEntity(0,3);case dr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case dr.EntityStart:return 0}}}function ID(e,t,n,r){const i=(t&Ji.BRANCH_LENGTH)>>7,l=t&Ji.JUMP_TABLE;if(i===0)return l!==0&&r===l?n:-1;if(l){const d=r-l;return d<0||d>=i?-1:e[n+d]-1}let o=n,c=o+i-1;for(;o<=c;){const d=o+c>>>1,m=e[d];if(m<r)o=d+1;else if(m>r)c=d-1;else return e[d+i]}return-1}var Ce;(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/"})(Ce||(Ce={}));var $l;(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"})($l||($l={}));var Ia;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ia||(Ia={}));var re;(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"})(re||(re={}));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 OD=new Map([[re.A,_.A],[re.ADDRESS,_.ADDRESS],[re.ANNOTATION_XML,_.ANNOTATION_XML],[re.APPLET,_.APPLET],[re.AREA,_.AREA],[re.ARTICLE,_.ARTICLE],[re.ASIDE,_.ASIDE],[re.B,_.B],[re.BASE,_.BASE],[re.BASEFONT,_.BASEFONT],[re.BGSOUND,_.BGSOUND],[re.BIG,_.BIG],[re.BLOCKQUOTE,_.BLOCKQUOTE],[re.BODY,_.BODY],[re.BR,_.BR],[re.BUTTON,_.BUTTON],[re.CAPTION,_.CAPTION],[re.CENTER,_.CENTER],[re.CODE,_.CODE],[re.COL,_.COL],[re.COLGROUP,_.COLGROUP],[re.DD,_.DD],[re.DESC,_.DESC],[re.DETAILS,_.DETAILS],[re.DIALOG,_.DIALOG],[re.DIR,_.DIR],[re.DIV,_.DIV],[re.DL,_.DL],[re.DT,_.DT],[re.EM,_.EM],[re.EMBED,_.EMBED],[re.FIELDSET,_.FIELDSET],[re.FIGCAPTION,_.FIGCAPTION],[re.FIGURE,_.FIGURE],[re.FONT,_.FONT],[re.FOOTER,_.FOOTER],[re.FOREIGN_OBJECT,_.FOREIGN_OBJECT],[re.FORM,_.FORM],[re.FRAME,_.FRAME],[re.FRAMESET,_.FRAMESET],[re.H1,_.H1],[re.H2,_.H2],[re.H3,_.H3],[re.H4,_.H4],[re.H5,_.H5],[re.H6,_.H6],[re.HEAD,_.HEAD],[re.HEADER,_.HEADER],[re.HGROUP,_.HGROUP],[re.HR,_.HR],[re.HTML,_.HTML],[re.I,_.I],[re.IMG,_.IMG],[re.IMAGE,_.IMAGE],[re.INPUT,_.INPUT],[re.IFRAME,_.IFRAME],[re.KEYGEN,_.KEYGEN],[re.LABEL,_.LABEL],[re.LI,_.LI],[re.LINK,_.LINK],[re.LISTING,_.LISTING],[re.MAIN,_.MAIN],[re.MALIGNMARK,_.MALIGNMARK],[re.MARQUEE,_.MARQUEE],[re.MATH,_.MATH],[re.MENU,_.MENU],[re.META,_.META],[re.MGLYPH,_.MGLYPH],[re.MI,_.MI],[re.MO,_.MO],[re.MN,_.MN],[re.MS,_.MS],[re.MTEXT,_.MTEXT],[re.NAV,_.NAV],[re.NOBR,_.NOBR],[re.NOFRAMES,_.NOFRAMES],[re.NOEMBED,_.NOEMBED],[re.NOSCRIPT,_.NOSCRIPT],[re.OBJECT,_.OBJECT],[re.OL,_.OL],[re.OPTGROUP,_.OPTGROUP],[re.OPTION,_.OPTION],[re.P,_.P],[re.PARAM,_.PARAM],[re.PLAINTEXT,_.PLAINTEXT],[re.PRE,_.PRE],[re.RB,_.RB],[re.RP,_.RP],[re.RT,_.RT],[re.RTC,_.RTC],[re.RUBY,_.RUBY],[re.S,_.S],[re.SCRIPT,_.SCRIPT],[re.SEARCH,_.SEARCH],[re.SECTION,_.SECTION],[re.SELECT,_.SELECT],[re.SOURCE,_.SOURCE],[re.SMALL,_.SMALL],[re.SPAN,_.SPAN],[re.STRIKE,_.STRIKE],[re.STRONG,_.STRONG],[re.STYLE,_.STYLE],[re.SUB,_.SUB],[re.SUMMARY,_.SUMMARY],[re.SUP,_.SUP],[re.TABLE,_.TABLE],[re.TBODY,_.TBODY],[re.TEMPLATE,_.TEMPLATE],[re.TEXTAREA,_.TEXTAREA],[re.TFOOT,_.TFOOT],[re.TD,_.TD],[re.TH,_.TH],[re.THEAD,_.THEAD],[re.TITLE,_.TITLE],[re.TR,_.TR],[re.TRACK,_.TRACK],[re.TT,_.TT],[re.U,_.U],[re.UL,_.UL],[re.SVG,_.SVG],[re.VAR,_.VAR],[re.WBR,_.WBR],[re.XMP,_.XMP]]);function fu(e){var t;return(t=OD.get(e))!==null&&t!==void 0?t:_.UNKNOWN}const Ne=_,DD={[Ce.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[Ce.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[Ce.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[Ce.XLINK]:new Set,[Ce.XML]:new Set,[Ce.XMLNS]:new Set},jg=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);re.STYLE,re.SCRIPT,re.XMP,re.IFRAME,re.NOEMBED,re.NOFRAMES,re.PLAINTEXT;var P;(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"})(P||(P={}));const zn={DATA:P.DATA,RCDATA:P.RCDATA,RAWTEXT:P.RAWTEXT,SCRIPT_DATA:P.SCRIPT_DATA,PLAINTEXT:P.PLAINTEXT,CDATA_SECTION:P.CDATA_SECTION};function jD(e){return e>=j.DIGIT_0&&e<=j.DIGIT_9}function yc(e){return e>=j.LATIN_CAPITAL_A&&e<=j.LATIN_CAPITAL_Z}function MD(e){return e>=j.LATIN_SMALL_A&&e<=j.LATIN_SMALL_Z}function Wi(e){return MD(e)||yc(e)}function C_(e){return Wi(e)||jD(e)}function Cf(e){return e+32}function E3(e){return e===j.SPACE||e===j.LINE_FEED||e===j.TABULATION||e===j.FORM_FEED}function S_(e){return E3(e)||e===j.SOLIDUS||e===j.GREATER_THAN_SIGN}function PD(e){return e===j.NULL?pe.nullCharacterReference:e>1114111?pe.characterReferenceOutsideUnicodeRange:g3(e)?pe.surrogateCharacterReference:x3(e)?pe.noncharacterCharacterReference:b3(e)||e===j.CARRIAGE_RETURN?pe.controlCharacterReference:null}class BD{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=P.DATA,this.returnState=P.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new vD(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new LD(kD,(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=PD(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:Rt.START_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Rt.END_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Rt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Rt.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(y3(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=fu(t.tagName),t.type===Rt.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 Rt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Rt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Rt.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:Rt.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=E3(t)?Rt.WHITESPACE_CHARACTER:t===j.NULL?Rt.NULL_CHARACTER:Rt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Rt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=P.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Js.Attribute:Js.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===P.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===P.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===P.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case P.DATA:{this._stateData(t);break}case P.RCDATA:{this._stateRcdata(t);break}case P.RAWTEXT:{this._stateRawtext(t);break}case P.SCRIPT_DATA:{this._stateScriptData(t);break}case P.PLAINTEXT:{this._statePlaintext(t);break}case P.TAG_OPEN:{this._stateTagOpen(t);break}case P.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case P.TAG_NAME:{this._stateTagName(t);break}case P.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case P.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case P.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case P.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case P.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case P.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case P.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case P.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case P.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case P.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case P.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case P.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case P.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case P.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case P.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case P.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case P.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case P.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case P.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case P.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case P.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case P.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case P.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case P.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case P.BOGUS_COMMENT:{this._stateBogusComment(t);break}case P.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case P.COMMENT_START:{this._stateCommentStart(t);break}case P.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case P.COMMENT:{this._stateComment(t);break}case P.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case P.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case P.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case P.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case P.COMMENT_END:{this._stateCommentEnd(t);break}case P.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case P.DOCTYPE:{this._stateDoctype(t);break}case P.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case P.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case P.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case P.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case P.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case P.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case P.CDATA_SECTION:{this._stateCdataSection(t);break}case P.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case P.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case P.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case P.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=P.TAG_OPEN;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitCodePoint(t);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case j.AMPERSAND:{this._startCharacterReference();break}case j.LESS_THAN_SIGN:{this.state=P.RCDATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Nn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case j.LESS_THAN_SIGN:{this.state=P.RAWTEXT_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Nn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Nn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Nn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Wi(t))this._createStartTagToken(),this.state=P.TAG_NAME,this._stateTagName(t);else switch(t){case j.EXCLAMATION_MARK:{this.state=P.MARKUP_DECLARATION_OPEN;break}case j.SOLIDUS:{this.state=P.END_TAG_OPEN;break}case j.QUESTION_MARK:{this._err(pe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=P.BOGUS_COMMENT,this._stateBogusComment(t);break}case j.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=P.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Wi(t))this._createEndTagToken(),this.state=P.TAG_NAME,this._stateTagName(t);else switch(t){case j.GREATER_THAN_SIGN:{this._err(pe.missingEndTagName),this.state=P.DATA;break}case j.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=P.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=P.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this.state=P.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.tagName+=Nn;break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(yc(t)?Cf(t):t)}}_stateRcdataLessThanSign(t){t===j.SOLIDUS?this.state=P.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=P.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Wi(t)?(this.state=P.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=P.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 j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=P.BEFORE_ATTRIBUTE_NAME,!1;case j.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=P.SELF_CLOSING_START_TAG,!1;case j.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=P.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===j.SOLIDUS?this.state=P.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=P.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Wi(t)?(this.state=P.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=P.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case j.SOLIDUS:{this.state=P.SCRIPT_DATA_END_TAG_OPEN;break}case j.EXCLAMATION_MARK:{this.state=P.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=P.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Wi(t)?(this.state=P.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===j.HYPHEN_MINUS?(this.state=P.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===j.HYPHEN_MINUS?(this.state=P.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Nn);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_ESCAPED,this._emitChars(Nn);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.GREATER_THAN_SIGN:{this.state=P.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_ESCAPED,this._emitChars(Nn);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===j.SOLIDUS?this.state=P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Wi(t)?(this._emitChars("<"),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Wi(t)?(this.state=P.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(qr.SCRIPT,!1)&&S_(this.preprocessor.peek(qr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<qr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Nn);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Nn);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.GREATER_THAN_SIGN:{this.state=P.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Nn);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===j.SOLIDUS?(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(qr.SCRIPT,!1)&&S_(this.preprocessor.peek(qr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<qr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=P.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this.state=P.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._err(pe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=P.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=P.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this._leaveAttrName(),this.state=P.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._leaveAttrName(),this.state=P.BEFORE_ATTRIBUTE_VALUE;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:{this._err(pe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.name+=Nn;break}default:this.currentAttr.name+=String.fromCodePoint(yc(t)?Cf(t):t)}}_stateAfterAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:{this.state=P.SELF_CLOSING_START_TAG;break}case j.EQUALS_SIGN:{this.state=P.BEFORE_ATTRIBUTE_VALUE;break}case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=P.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{this.state=P.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this.state=P.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingAttributeValue),this.state=P.DATA,this.emitCurrentTagToken();break}default:this.state=P.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case j.QUOTATION_MARK:{this.state=P.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Nn;break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case j.APOSTROPHE:{this.state=P.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Nn;break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=P.BEFORE_ATTRIBUTE_NAME;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=P.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Nn;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:case j.EQUALS_SIGN:case j.GRAVE_ACCENT:{this._err(pe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=P.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this._leaveAttrValue(),this.state=P.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=P.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBetweenAttributes),this.state=P.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case j.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=P.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.unexpectedSolidusInTag),this.state=P.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentComment(n);break}case j.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Nn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(qr.DASH_DASH,!0)?(this._createCommentToken(qr.DASH_DASH.length+1),this.state=P.COMMENT_START):this._consumeSequenceIfMatch(qr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(qr.DOCTYPE.length+1),this.state=P.DOCTYPE):this._consumeSequenceIfMatch(qr.CDATA_START,!0)?this.inForeignNode?this.state=P.CDATA_SECTION:(this._err(pe.cdataInHtmlContent),this._createCommentToken(qr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=P.BOGUS_COMMENT):this._ensureHibernation()||(this._err(pe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=P.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case j.HYPHEN_MINUS:{this.state=P.COMMENT_START_DASH;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=P.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=P.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=P.COMMENT_END;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=P.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=P.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=P.COMMENT_END_DASH;break}case j.LESS_THAN_SIGN:{n.data+="<",this.state=P.COMMENT_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Nn;break}case j.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 j.EXCLAMATION_MARK:{n.data+="!",this.state=P.COMMENT_LESS_THAN_SIGN_BANG;break}case j.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=P.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===j.HYPHEN_MINUS?this.state=P.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=P.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===j.HYPHEN_MINUS?this.state=P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=P.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==j.GREATER_THAN_SIGN&&t!==j.EOF&&this._err(pe.nestedComment),this.state=P.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=P.COMMENT_END;break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=P.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentComment(n);break}case j.EXCLAMATION_MARK:{this.state=P.COMMENT_END_BANG;break}case j.HYPHEN_MINUS:{n.data+="-";break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=P.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{n.data+="--!",this.state=P.COMMENT_END_DASH;break}case j.GREATER_THAN_SIGN:{this._err(pe.incorrectlyClosedComment),this.state=P.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=P.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=P.BEFORE_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=P.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case j.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=P.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(yc(t))this._createDoctypeToken(String.fromCharCode(Cf(t))),this.state=P.DOCTYPE_NAME;else switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.NULL:{this._err(pe.unexpectedNullCharacter),this._createDoctypeToken(Nn),this.state=P.DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.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=P.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=P.AFTER_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.name+=Nn;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(yc(t)?Cf(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(qr.PUBLIC,!1)?this.state=P.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(qr.SYSTEM,!1)?this.state=P.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(pe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Nn;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.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 j.APOSTROPHE:{this.state=P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Nn;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.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 j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case j.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.QUOTATION_MARK:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.QUOTATION_MARK:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Nn;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.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 j.APOSTROPHE:{this.state=P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Nn;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.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 j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=P.DATA;break}case j.NULL:{this._err(pe.unexpectedNullCharacter);break}case j.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case j.RIGHT_SQUARE_BRACKET:{this.state=P.CDATA_SECTION_BRACKET;break}case j.EOF:{this._err(pe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===j.RIGHT_SQUARE_BRACKET?this.state=P.CDATA_SECTION_END:(this._emitChars("]"),this.state=P.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case j.GREATER_THAN_SIGN:{this.state=P.DATA;break}case j.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=P.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(j.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&C_(this.preprocessor.peek(1))?P.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){C_(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===j.SEMICOLON&&this._err(pe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const _3=new Set([_.DD,_.DT,_.LI,_.OPTGROUP,_.OPTION,_.P,_.RB,_.RP,_.RT,_.RTC]),N_=new Set([..._3,_.CAPTION,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]),ph=new Set([_.APPLET,_.CAPTION,_.HTML,_.MARQUEE,_.OBJECT,_.TABLE,_.TD,_.TEMPLATE,_.TH]),UD=new Set([...ph,_.OL,_.UL]),HD=new Set([...ph,_.BUTTON]),A_=new Set([_.ANNOTATION_XML,_.MI,_.MN,_.MO,_.MS,_.MTEXT]),R_=new Set([_.DESC,_.FOREIGN_OBJECT,_.TITLE]),zD=new Set([_.TR,_.TEMPLATE,_.HTML]),FD=new Set([_.TBODY,_.TFOOT,_.THEAD,_.TEMPLATE,_.HTML]),$D=new Set([_.TABLE,_.TEMPLATE,_.HTML]),VD=new Set([_.TD,_.TH]);class GD{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)===Ce.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])!==Ce.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(jg,Ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(VD,Ce.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($D,Ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(FD,Ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(zD,Ce.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 Ce.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Ce.SVG:{if(R_.has(i))return!1;break}case Ce.MATHML:{if(A_.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,ph)}hasInListItemScope(t){return this.hasInDynamicScope(t,UD)}hasInButtonScope(t){return this.hasInDynamicScope(t,HD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ce.HTML:{if(jg.has(n))return!0;if(ph.has(n))return!1;break}case Ce.SVG:{if(R_.has(n))return!1;break}case Ce.MATHML:{if(A_.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ce.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])===Ce.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])===Ce.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&&_3.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&N_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&N_.has(this.currentTagId);)this.pop()}}const D0=3;var ps;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ps||(ps={}));const L_={type:ps.Marker};class qD{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 d=this.entries[c];if(d.type===ps.Marker)break;const{element:m}=d;if(this.treeAdapter.getTagName(m)===l&&this.treeAdapter.getNamespaceURI(m)===o){const p=this.treeAdapter.getAttrList(m);p.length===i&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<D0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<D0)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(d=>i.get(d.name)===d.value)&&(l+=1,l>=D0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(L_)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ps.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ps.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(L_);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ps.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ps.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ps.Element&&n.element===t)}}const Qi={createDocument(){return{nodeName:"#document",mode:Ia.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}}},T3="html",YD="about:legacy-compat",WD="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",v3=["+//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//"],QD=[...v3,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],XD=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),k3=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],KD=[...k3,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function I_(e,t){return t.some(n=>e.startsWith(n))}function ZD(e){return e.name===T3&&e.publicId===null&&(e.systemId===null||e.systemId===YD)}function JD(e){if(e.name!==T3)return Ia.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===WD)return Ia.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),XD.has(n))return Ia.QUIRKS;let r=t===null?QD:v3;if(I_(n,r))return Ia.QUIRKS;if(r=t===null?k3:KD,I_(n,r))return Ia.LIMITED_QUIRKS}return Ia.NO_QUIRKS}const O_={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},ej="definitionurl",tj="definitionURL",nj=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])),rj=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ce.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ce.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ce.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ce.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ce.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ce.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ce.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ce.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ce.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ce.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ce.XMLNS}]]),aj=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])),sj=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 ij(e){const t=e.tagID;return t===_.FONT&&e.attrs.some(({name:r})=>r===$l.COLOR||r===$l.SIZE||r===$l.FACE)||sj.has(t)}function w3(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===ej){e.attrs[t].name=tj;break}}function C3(e){for(let t=0;t<e.attrs.length;t++){const n=nj.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function q1(e){for(let t=0;t<e.attrs.length;t++){const n=rj.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 lj(e){const t=aj.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=fu(e.tagName))}function oj(e,t){return t===Ce.MATHML&&(e===_.MI||e===_.MO||e===_.MN||e===_.MS||e===_.MTEXT)}function uj(e,t,n){if(t===Ce.MATHML&&e===_.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===$l.ENCODING){const i=n[r].value.toLowerCase();return i===O_.TEXT_HTML||i===O_.APPLICATION_XML}}return t===Ce.SVG&&(e===_.FOREIGN_OBJECT||e===_.DESC||e===_.TITLE)}function cj(e,t,n,r){return(!r||r===Ce.HTML)&&uj(e,t,n)||(!r||r===Ce.MATHML)&&oj(e,t)}const dj="hidden",fj=8,hj=3;var q;(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"})(q||(q={}));const mj={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},S3=new Set([_.TABLE,_.TBODY,_.TFOOT,_.THEAD,_.TR]),D_={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Qi,onParseError:null};class j_{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.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={...D_,...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 BD(this.options,this),this.activeFormattingElements=new qD(this.treeAdapter),this.fragmentContextID=r?fu(this.treeAdapter.getTagName(r)):_.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new GD(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={...D_,...n};t??(t=r.treeAdapter.createElement(re.TEMPLATE,Ce.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ce.HTML,[]),l=new this(r,i,t);return l.fragmentContextID===_.TEMPLATE&&l.tmplInsertionModeStack.unshift(q.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:mj,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)===Ce.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ce.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=zn.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)===re.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ce.HTML))switch(this.fragmentContextID){case _.TITLE:case _.TEXTAREA:{this.tokenizer.state=zn.RCDATA;break}case _.STYLE:case _.XMP:case _.IFRAME:case _.NOEMBED:case _.NOFRAMES:case _.NOSCRIPT:{this.tokenizer.state=zn.RAWTEXT;break}case _.SCRIPT:{this.tokenizer.state=zn.SCRIPT_DATA;break}case _.PLAINTEXT:{this.tokenizer.state=zn.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,Ce.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ce.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(re.HTML,Ce.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:d,endCol:m,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:d,endCol:m,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===Rt.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)===re.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ce.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===_.MGLYPH||t.tagID===_.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ce.HTML)}_processToken(t){switch(t.type){case Rt.CHARACTER:{this.onCharacter(t);break}case Rt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Rt.COMMENT:{this.onComment(t);break}case Rt.DOCTYPE:{this.onDoctype(t);break}case Rt.START_TAG:{this._processStartTag(t);break}case Rt.END_TAG:{this.onEndTag(t);break}case Rt.EOF:{this.onEof(t);break}case Rt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),l=this.treeAdapter.getAttrList(n);return cj(t,i,l,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ps.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=q.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=q.IN_ROW;return}case _.TBODY:case _.THEAD:case _.TFOOT:{this.insertionMode=q.IN_TABLE_BODY;return}case _.CAPTION:{this.insertionMode=q.IN_CAPTION;return}case _.COLGROUP:{this.insertionMode=q.IN_COLUMN_GROUP;return}case _.TABLE:{this.insertionMode=q.IN_TABLE;return}case _.BODY:{this.insertionMode=q.IN_BODY;return}case _.FRAMESET:{this.insertionMode=q.IN_FRAMESET;return}case _.SELECT:{this._resetInsertionModeForSelect(t);return}case _.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case _.HTML:{this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return}case _.TD:case _.TH:{if(t>0){this.insertionMode=q.IN_CELL;return}break}case _.HEAD:{if(t>0){this.insertionMode=q.IN_HEAD;return}break}}this.insertionMode=q.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=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(t){return S3.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)===Ce.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 DD[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){V9(this,t);return}switch(this.insertionMode){case q.INITIAL:{oc(this,t);break}case q.BEFORE_HTML:{Cc(this,t);break}case q.BEFORE_HEAD:{Sc(this,t);break}case q.IN_HEAD:{Nc(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Ac(this,t);break}case q.AFTER_HEAD:{Rc(this,t);break}case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:{A3(this,t);break}case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{j0(this,t);break}case q.IN_TABLE_TEXT:{j3(this,t);break}case q.IN_COLUMN_GROUP:{gh(this,t);break}case q.AFTER_BODY:{bh(this,t);break}case q.AFTER_AFTER_BODY:{Kf(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$9(this,t);return}switch(this.insertionMode){case q.INITIAL:{oc(this,t);break}case q.BEFORE_HTML:{Cc(this,t);break}case q.BEFORE_HEAD:{Sc(this,t);break}case q.IN_HEAD:{Nc(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Ac(this,t);break}case q.AFTER_HEAD:{Rc(this,t);break}case q.TEXT:{this._insertCharacters(t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{j0(this,t);break}case q.IN_COLUMN_GROUP:{gh(this,t);break}case q.AFTER_BODY:{bh(this,t);break}case q.AFTER_AFTER_BODY:{Kf(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Mg(this,t);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:{Mg(this,t);break}case q.IN_TABLE_TEXT:{uc(this,t);break}case q.AFTER_BODY:{_j(this,t);break}case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{Tj(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:{vj(this,t);break}case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:{this._err(t,pe.misplacedDoctype);break}case q.IN_TABLE_TEXT:{uc(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)?G9(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case q.INITIAL:{oc(this,t);break}case q.BEFORE_HTML:{kj(this,t);break}case q.BEFORE_HEAD:{Cj(this,t);break}case q.IN_HEAD:{Ja(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Aj(this,t);break}case q.AFTER_HEAD:{Lj(this,t);break}case q.IN_BODY:{Nr(this,t);break}case q.IN_TABLE:{eu(this,t);break}case q.IN_TABLE_TEXT:{uc(this,t);break}case q.IN_CAPTION:{S9(this,t);break}case q.IN_COLUMN_GROUP:{Q1(this,t);break}case q.IN_TABLE_BODY:{Gh(this,t);break}case q.IN_ROW:{qh(this,t);break}case q.IN_CELL:{R9(this,t);break}case q.IN_SELECT:{B3(this,t);break}case q.IN_SELECT_IN_TABLE:{I9(this,t);break}case q.IN_TEMPLATE:{D9(this,t);break}case q.AFTER_BODY:{M9(this,t);break}case q.IN_FRAMESET:{P9(this,t);break}case q.AFTER_FRAMESET:{U9(this,t);break}case q.AFTER_AFTER_BODY:{z9(this,t);break}case q.AFTER_AFTER_FRAMESET:{F9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?q9(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case q.INITIAL:{oc(this,t);break}case q.BEFORE_HTML:{wj(this,t);break}case q.BEFORE_HEAD:{Sj(this,t);break}case q.IN_HEAD:{Nj(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Rj(this,t);break}case q.AFTER_HEAD:{Ij(this,t);break}case q.IN_BODY:{Vh(this,t);break}case q.TEXT:{b9(this,t);break}case q.IN_TABLE:{Fc(this,t);break}case q.IN_TABLE_TEXT:{uc(this,t);break}case q.IN_CAPTION:{N9(this,t);break}case q.IN_COLUMN_GROUP:{A9(this,t);break}case q.IN_TABLE_BODY:{Pg(this,t);break}case q.IN_ROW:{P3(this,t);break}case q.IN_CELL:{L9(this,t);break}case q.IN_SELECT:{U3(this,t);break}case q.IN_SELECT_IN_TABLE:{O9(this,t);break}case q.IN_TEMPLATE:{j9(this,t);break}case q.AFTER_BODY:{z3(this,t);break}case q.IN_FRAMESET:{B9(this,t);break}case q.AFTER_FRAMESET:{H9(this,t);break}case q.AFTER_AFTER_BODY:{Kf(this,t);break}}}onEof(t){switch(this.insertionMode){case q.INITIAL:{oc(this,t);break}case q.BEFORE_HTML:{Cc(this,t);break}case q.BEFORE_HEAD:{Sc(this,t);break}case q.IN_HEAD:{Nc(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Ac(this,t);break}case q.AFTER_HEAD:{Rc(this,t);break}case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:{O3(this,t);break}case q.TEXT:{x9(this,t);break}case q.IN_TABLE_TEXT:{uc(this,t);break}case q.IN_TEMPLATE:{H3(this,t);break}case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{W1(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===j.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 q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:{this._insertCharacters(t);break}case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{N3(this,t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{j0(this,t);break}case q.IN_TABLE_TEXT:{D3(this,t);break}}}}function pj(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):I3(e,t),n}function gj(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 bj(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),d=c&&l>=hj;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(o)):(o=xj(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function xj(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 yj(e,t,n){const r=e.treeAdapter.getTagName(t),i=fu(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const l=e.treeAdapter.getNamespaceURI(t);i===_.TEMPLATE&&l===Ce.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Ej(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 Y1(e,t){for(let n=0;n<fj;n++){const r=pj(e,t);if(!r)break;const i=gj(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const l=bj(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(l),o&&yj(e,o,l),Ej(e,i,r)}}function Mg(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function _j(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Tj(e,t){e._appendCommentNode(t,e.document)}function W1(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 vj(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ia.QUIRKS:JD(t);ZD(t)||e._err(t,pe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function oc(e,t){e._err(t,pe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ia.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function kj(e,t){t.tagID===_.HTML?(e._insertElement(t,Ce.HTML),e.insertionMode=q.BEFORE_HEAD):Cc(e,t)}function wj(e,t){const n=t.tagID;(n===_.HTML||n===_.HEAD||n===_.BODY||n===_.BR)&&Cc(e,t)}function Cc(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function Cj(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.HEAD:{e._insertElement(t,Ce.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break}default:Sc(e,t)}}function Sj(e,t){const n=t.tagID;n===_.HEAD||n===_.BODY||n===_.HTML||n===_.BR?Sc(e,t):e._err(t,pe.endTagWithoutMatchingOpenElement)}function Sc(e,t){e._insertFakeElement(re.HEAD,_.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function Ja(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:{e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0;break}case _.TITLE:{e._switchToTextParsing(t,zn.RCDATA);break}case _.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,zn.RAWTEXT):(e._insertElement(t,Ce.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break}case _.NOFRAMES:case _.STYLE:{e._switchToTextParsing(t,zn.RAWTEXT);break}case _.SCRIPT:{e._switchToTextParsing(t,zn.SCRIPT_DATA);break}case _.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Nc(e,t)}}function Nj(e,t){switch(t.tagID){case _.HEAD:{e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break}case _.BODY:case _.BR:case _.HTML:{Nc(e,t);break}case _.TEMPLATE:{Xl(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Xl(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 Nc(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function Aj(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.BASEFONT:case _.BGSOUND:case _.HEAD:case _.LINK:case _.META:case _.NOFRAMES:case _.STYLE:{Ja(e,t);break}case _.NOSCRIPT:{e._err(t,pe.nestedNoscriptInHead);break}default:Ac(e,t)}}function Rj(e,t){switch(t.tagID){case _.NOSCRIPT:{e.openElements.pop(),e.insertionMode=q.IN_HEAD;break}case _.BR:{Ac(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Ac(e,t){const n=t.type===Rt.EOF?pe.openElementsLeftAfterEof:pe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function Lj(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.BODY:{e._insertElement(t,Ce.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break}case _.FRAMESET:{e._insertElement(t,Ce.HTML),e.insertionMode=q.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),Ja(e,t),e.openElements.remove(e.headElement);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Rc(e,t)}}function Ij(e,t){switch(t.tagID){case _.BODY:case _.HTML:case _.BR:{Rc(e,t);break}case _.TEMPLATE:{Xl(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Rc(e,t){e._insertFakeElement(re.BODY,_.BODY),e.insertionMode=q.IN_BODY,$h(e,t)}function $h(e,t){switch(t.type){case Rt.CHARACTER:{A3(e,t);break}case Rt.WHITESPACE_CHARACTER:{N3(e,t);break}case Rt.COMMENT:{Mg(e,t);break}case Rt.START_TAG:{Nr(e,t);break}case Rt.END_TAG:{Vh(e,t);break}case Rt.EOF:{O3(e,t);break}}}function N3(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function A3(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Oj(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Dj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function jj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ce.HTML),e.insertionMode=q.IN_FRAMESET)}function Mj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML)}function Pj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&jg.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ce.HTML)}function Bj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Uj(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),n||(e.formElement=e.openElements.current))}function Hj(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,Ce.HTML)}function zj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),e.tokenizer.state=zn.PLAINTEXT}function Fj(e,t){e.openElements.hasInScope(_.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.framesetOk=!1}function $j(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(re.A);n&&(Y1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Vj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Gj(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(_.NOBR)&&(Y1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function qj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Yj(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ia.QUIRKS&&e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function R3(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function L3(e){const t=y3(e,$l.TYPE);return t!=null&&t.toLowerCase()===dj}function Wj(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ce.HTML),L3(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Qj(e,t){e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0}function Xj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._appendElement(t,Ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Kj(e,t){t.tagName=re.IMG,t.tagID=_.IMG,R3(e,t)}function Zj(e,t){e._insertElement(t,Ce.HTML),e.skipNextNewLine=!0,e.tokenizer.state=zn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function Jj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,zn.RAWTEXT)}function e9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,zn.RAWTEXT)}function M_(e,t){e._switchToTextParsing(t,zn.RAWTEXT)}function t9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function n9(e,t){e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML)}function r9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ce.HTML)}function a9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(_.RTC),e._insertElement(t,Ce.HTML)}function s9(e,t){e._reconstructActiveFormattingElements(),w3(t),q1(t),t.selfClosing?e._appendElement(t,Ce.MATHML):e._insertElement(t,Ce.MATHML),t.ackSelfClosing=!0}function i9(e,t){e._reconstructActiveFormattingElements(),C3(t),q1(t),t.selfClosing?e._appendElement(t,Ce.SVG):e._insertElement(t,Ce.SVG),t.ackSelfClosing=!0}function P_(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML)}function Nr(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:{Vj(e,t);break}case _.A:{$j(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{Pj(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:{Mj(e,t);break}case _.LI:case _.DD:case _.DT:{Hj(e,t);break}case _.BR:case _.IMG:case _.WBR:case _.AREA:case _.EMBED:case _.KEYGEN:{R3(e,t);break}case _.HR:{Xj(e,t);break}case _.RB:case _.RTC:{r9(e,t);break}case _.RT:case _.RP:{a9(e,t);break}case _.PRE:case _.LISTING:{Bj(e,t);break}case _.XMP:{Jj(e,t);break}case _.SVG:{i9(e,t);break}case _.HTML:{Oj(e,t);break}case _.BASE:case _.LINK:case _.META:case _.STYLE:case _.TITLE:case _.SCRIPT:case _.BGSOUND:case _.BASEFONT:case _.TEMPLATE:{Ja(e,t);break}case _.BODY:{Dj(e,t);break}case _.FORM:{Uj(e,t);break}case _.NOBR:{Gj(e,t);break}case _.MATH:{s9(e,t);break}case _.TABLE:{Yj(e,t);break}case _.INPUT:{Wj(e,t);break}case _.PARAM:case _.TRACK:case _.SOURCE:{Qj(e,t);break}case _.IMAGE:{Kj(e,t);break}case _.BUTTON:{Fj(e,t);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{qj(e,t);break}case _.IFRAME:{e9(e,t);break}case _.SELECT:{t9(e,t);break}case _.OPTION:case _.OPTGROUP:{n9(e,t);break}case _.NOEMBED:case _.NOFRAMES:{M_(e,t);break}case _.FRAMESET:{jj(e,t);break}case _.TEXTAREA:{Zj(e,t);break}case _.NOSCRIPT:{e.options.scriptingEnabled?M_(e,t):P_(e,t);break}case _.PLAINTEXT:{zj(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:P_(e,t)}}function l9(e,t){if(e.openElements.hasInScope(_.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function o9(e,t){e.openElements.hasInScope(_.BODY)&&(e.insertionMode=q.AFTER_BODY,z3(e,t))}function u9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function c9(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 d9(e){e.openElements.hasInButtonScope(_.P)||e._insertFakeElement(re.P,_.P),e._closePElement()}function f9(e){e.openElements.hasInListItemScope(_.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(_.LI),e.openElements.popUntilTagNamePopped(_.LI))}function h9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function m9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function p9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function g9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(re.BR,_.BR),e.openElements.pop(),e.framesetOk=!1}function I3(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 Vh(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:{Y1(e,t);break}case _.P:{d9(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:{u9(e,t);break}case _.LI:{f9(e);break}case _.DD:case _.DT:{h9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{m9(e);break}case _.BR:{g9(e);break}case _.BODY:{l9(e,t);break}case _.HTML:{o9(e,t);break}case _.FORM:{c9(e);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{p9(e,t);break}case _.TEMPLATE:{Xl(e,t);break}default:I3(e,t)}}function O3(e,t){e.tmplInsertionModeStack.length>0?H3(e,t):W1(e,t)}function b9(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 x9(e,t){e._err(t,pe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j0(e,t){if(e.openElements.currentTagId!==void 0&&S3.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case Rt.CHARACTER:{j3(e,t);break}case Rt.WHITESPACE_CHARACTER:{D3(e,t);break}}else Zc(e,t)}function y9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ce.HTML),e.insertionMode=q.IN_CAPTION}function E9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ce.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function _9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(re.COLGROUP,_.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,Q1(e,t)}function T9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ce.HTML),e.insertionMode=q.IN_TABLE_BODY}function v9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(re.TBODY,_.TBODY),e.insertionMode=q.IN_TABLE_BODY,Gh(e,t)}function k9(e,t){e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function w9(e,t){L3(t)?e._appendElement(t,Ce.HTML):Zc(e,t),t.ackSelfClosing=!0}function C9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ce.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function eu(e,t){switch(t.tagID){case _.TD:case _.TH:case _.TR:{v9(e,t);break}case _.STYLE:case _.SCRIPT:case _.TEMPLATE:{Ja(e,t);break}case _.COL:{_9(e,t);break}case _.FORM:{C9(e,t);break}case _.TABLE:{k9(e,t);break}case _.TBODY:case _.TFOOT:case _.THEAD:{T9(e,t);break}case _.INPUT:{w9(e,t);break}case _.CAPTION:{y9(e,t);break}case _.COLGROUP:{E9(e,t);break}default:Zc(e,t)}}function Fc(e,t){switch(t.tagID){case _.TABLE:{e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode());break}case _.TEMPLATE:{Xl(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:Zc(e,t)}}function Zc(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,$h(e,t),e.fosterParentingEnabled=n}function D3(e,t){e.pendingCharacterTokens.push(t)}function j3(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function uc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Zc(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const M3=new Set([_.CAPTION,_.COL,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]);function S9(e,t){const n=t.tagID;M3.has(n)?e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,eu(e,t)):Nr(e,t)}function N9(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=q.IN_TABLE,n===_.TABLE&&Fc(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:Vh(e,t)}}function Q1(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.COL:{e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0;break}case _.TEMPLATE:{Ja(e,t);break}default:gh(e,t)}}function A9(e,t){switch(t.tagID){case _.COLGROUP:{e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break}case _.TEMPLATE:{Xl(e,t);break}case _.COL:break;default:gh(e,t)}}function gh(e,t){e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function Gh(e,t){switch(t.tagID){case _.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ce.HTML),e.insertionMode=q.IN_ROW;break}case _.TH:case _.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(re.TR,_.TR),e.insertionMode=q.IN_ROW,qh(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=q.IN_TABLE,eu(e,t));break}default:eu(e,t)}}function Pg(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=q.IN_TABLE);break}case _.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,Fc(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:case _.TR:break;default:Fc(e,t)}}function qh(e,t){switch(t.tagID){case _.TH:case _.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ce.HTML),e.insertionMode=q.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=q.IN_TABLE_BODY,Gh(e,t));break}default:eu(e,t)}}function P3(e,t){switch(t.tagID){case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break}case _.TABLE:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,Pg(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=q.IN_TABLE_BODY,Pg(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:break;default:Fc(e,t)}}function R9(e,t){const n=t.tagID;M3.has(n)?(e.openElements.hasInTableScope(_.TD)||e.openElements.hasInTableScope(_.TH))&&(e._closeTableCell(),qh(e,t)):Nr(e,t)}function L9(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=q.IN_ROW);break}case _.TABLE:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),P3(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:break;default:Vh(e,t)}}function B3(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._insertElement(t,Ce.HTML);break}case _.OPTGROUP:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ce.HTML);break}case _.HR:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ce.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:{Ja(e,t);break}}}function U3(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:{Xl(e,t);break}}}function I9(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)):B3(e,t)}function O9(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)):U3(e,t)}function D9(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:{Ja(e,t);break}case _.CAPTION:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,eu(e,t);break}case _.COL:{e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,Q1(e,t);break}case _.TR:{e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,Gh(e,t);break}case _.TD:case _.TH:{e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,qh(e,t);break}default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,Nr(e,t)}}function j9(e,t){t.tagID===_.TEMPLATE&&Xl(e,t)}function H3(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):W1(e,t)}function M9(e,t){t.tagID===_.HTML?Nr(e,t):bh(e,t)}function z3(e,t){var n;if(t.tagID===_.HTML){if(e.fragmentContext||(e.insertionMode=q.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 bh(e,t)}function bh(e,t){e.insertionMode=q.IN_BODY,$h(e,t)}function P9(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.FRAMESET:{e._insertElement(t,Ce.HTML);break}case _.FRAME:{e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0;break}case _.NOFRAMES:{Ja(e,t);break}}}function B9(e,t){t.tagID===_.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==_.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function U9(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.NOFRAMES:{Ja(e,t);break}}}function H9(e,t){t.tagID===_.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function z9(e,t){t.tagID===_.HTML?Nr(e,t):Kf(e,t)}function Kf(e,t){e.insertionMode=q.IN_BODY,$h(e,t)}function F9(e,t){switch(t.tagID){case _.HTML:{Nr(e,t);break}case _.NOFRAMES:{Ja(e,t);break}}}function $9(e,t){t.chars=Nn,e._insertCharacters(t)}function V9(e,t){e._insertCharacters(t),e.framesetOk=!1}function F3(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ce.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function G9(e,t){if(ij(t))F3(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ce.MATHML?w3(t):r===Ce.SVG&&(lj(t),C3(t)),q1(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function q9(e,t){if(t.tagID===_.P||t.tagID===_.BR){F3(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)===Ce.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}re.AREA,re.BASE,re.BASEFONT,re.BGSOUND,re.BR,re.COL,re.EMBED,re.FRAME,re.HR,re.IMG,re.INPUT,re.KEYGEN,re.LINK,re.META,re.PARAM,re.SOURCE,re.TRACK,re.WBR;const Yh=$3("end"),Es=$3("start");function $3(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 V3(e){const t=Es(e),n=Yh(e);if(t&&n)return{start:t,end:n}}const Y9=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,W9=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),B_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function G3(e,t){const n=aM(e),r=T1("type",{handlers:{root:Q9,element:X9,text:K9,comment:Y3,doctype:Z9,raw:eM},unknown:tM}),i={parser:n?new j_(B_):j_.getFragmentParser(void 0,B_),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),hu(i,Es());const l=n?i.parser.document:i.parser.getFragment(),o=iD(l,{file:i.options.file});return i.stitches&&bs(o,"comment",function(c,d,m){const p=c;if(p.value.stitch&&m&&d!==void 0){const g=m.children;return g[d]=p.value.stitch,d}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function q3(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Q9(e,t){q3(e.children,t)}function X9(e,t){nM(e,t),q3(e.children,t),rM(e,t)}function K9(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Rt.CHARACTER,chars:e.value,location:Jc(e)};hu(t,Es(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Z9(e,t){const n={type:Rt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Jc(e)};hu(t,Es(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function J9(e,t){t.stitches=!0;const n=sM(e);if("children"in e&&"children"in n){const r=G3({type:"root",children:e.children},t.options);n.children=r.children}Y3({type:"comment",value:{stitch:n}},t)}function Y3(e,t){const n=e.value,r={type:Rt.COMMENT,data:n,location:Jc(e)};hu(t,Es(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function eM(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,W3(t,Es(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Y9,"<$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 tM(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))J9(n,t);else{let r="";throw W9.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 hu(e,t){W3(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=zn.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 W3(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 nM(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===zn.PLAINTEXT)return;hu(t,Es(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Hl.html;i===Hl.html&&n==="svg"&&(i=Hl.svg);const l=dD({...e,children:[]},{space:i===Hl.svg?"svg":"html"}),o={type:Rt.START_TAG,tagName:n,tagID:fu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in l?l.attrs:[],location:Jc(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function rM(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&fk.includes(n)||t.parser.tokenizer.state===zn.PLAINTEXT)return;hu(t,Yh(e));const r={type:Rt.END_TAG,tagName:n,tagID:fu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Jc(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===zn.RCDATA||t.parser.tokenizer.state===zn.RAWTEXT||t.parser.tokenizer.state===zn.SCRIPT_DATA)&&(t.parser.tokenizer.state=zn.DATA)}function aM(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Jc(e){const t=Es(e)||{line:void 0,column:void 0,offset:void 0},n=Yh(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 sM(e){return"children"in e?Gl({...e,children:[]}):Gl(e)}function Bg(e){return function(t,n){return G3(t,{...e,file:n})}}const Il=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Ml={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Il,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Il],h2:[["className","sr-only"]],img:[...Il,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Il,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Il],table:[...Il],ul:[...Il,["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 iM(e,t){let n={type:"root",children:[]};const r={schema:t?{...Ml,...t}:Ml,stack:[]},i=Q3(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function Q3(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return lM(e,n);case"doctype":return oM(e,n);case"element":return uM(e,n);case"root":return cM(e,n);case"text":return dM(e,n)}}}function lM(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 ed(l,t),l}}function oM(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return ed(n,t),n}}function uM(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=X3(e,t.children),i=fM(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 d=-1;for(l=!1;++d<c.length;)e.stack.includes(c[d])&&(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 ed(o,t),o}function cM(e,t){const r={type:"root",children:X3(e,t.children)};return ed(r,t),r}function dM(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return ed(r,t),r}function X3(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const l=Q3(e,r[i]);l&&(Array.isArray(l)?n.push(...l):n.push(l))}}return n}function fM(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:{},d={};let m;for(m in c)if(Xi.call(c,m)){const p=c[m];let g=U_(e,H_(l,m),m,p);g==null&&(g=U_(e,H_(o,m),m,p)),g!=null&&(d[m]=g)}if(i&&Xi.call(i,n)){const p=i[n];for(m in p)Xi.call(p,m)&&!Xi.call(d,m)&&(d[m]=p[m])}return d}function U_(e,t,n,r){return t?Array.isArray(r)?hM(e,t,n,r):K3(e,t,n,r):void 0}function hM(e,t,n,r){let i=-1;const l=[];for(;++i<r.length;){const o=K3(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&l.push(o)}return l}function K3(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&mM(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 mM(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("#"),d=i.indexOf("/");if(l<0||d>-1&&l>d||o>-1&&l>o||c>-1&&l>c)return!0;let m=-1;for(;++m<r.length;){const p=r[m];if(l===p.length&&i.slice(0,p.length)===p)return!0}return!1}function ed(e,t){const n=V3(t);t.data&&(e.data=Gl(t.data)),n&&(e.position=n)}function H_(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 Z3(e){return function(t){return iM(t,e)}}const jr=al(/[A-Za-z]/),Sr=al(/[\dA-Za-z]/),pM=al(/[#-'*+\--9=?A-Z^-~]/);function xh(e){return e!==null&&(e<32||e===127)}const Ug=al(/\d/),gM=al(/[\dA-Fa-f]/),bM=al(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function gn(e){return e!==null&&(e<0||e===32)}function Mt(e){return e===-2||e===-1||e===32}const Wh=al(new RegExp("\\p{P}|\\p{S}","u")),ql=al(/\s/);function al(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function xM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yM(e,t,n){const i=Hh((n||{}).ignore||[]),l=EM(t);let o=-1;for(;++o<l.length;)U1(e,"text",c);function c(m,p){let g=-1,y;for(;++g<p.length;){const E=p[g],v=y?y.children:void 0;if(i(E,v?v.indexOf(E):void 0,y))return;y=E}if(y)return d(m,p)}function d(m,p){const g=p[p.length-1],y=l[o][0],E=l[o][1];let v=0;const C=g.children.indexOf(m);let S=!1,N=[];y.lastIndex=0;let A=y.exec(m.value);for(;A;){const z=A.index,Y={index:A.index,input:A.input,stack:[...p,m]};let M=E(...A,Y);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=z+1:(v!==z&&N.push({type:"text",value:m.value.slice(v,z)}),Array.isArray(M)?N.push(...M):M&&N.push(M),v=z+A[0].length,S=!0),!y.global)break;A=y.exec(m.value)}return S?(v<m.value.length&&N.push({type:"text",value:m.value.slice(v)}),g.children.splice(C,1,...N)):N=[m],C+N.length}}function EM(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([_M(i[0]),TM(i[1])])}return t}function _M(e){return typeof e=="string"?new RegExp(xM(e),"g"):e}function TM(e){return typeof e=="function"?e:function(){return e}}const M0="phrasing",P0=["autolink","link","image","label"];function vM(){return{transforms:[RM],enter:{literalAutolink:wM,literalAutolinkEmail:B0,literalAutolinkHttp:B0,literalAutolinkWww:B0},exit:{literalAutolink:AM,literalAutolinkEmail:NM,literalAutolinkHttp:CM,literalAutolinkWww:SM}}}function kM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:M0,notInConstruct:P0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:M0,notInConstruct:P0},{character:":",before:"[ps]",after:"\\/",inConstruct:M0,notInConstruct:P0}]}}function wM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function B0(e){this.config.enter.autolinkProtocol.call(this,e)}function CM(e){this.config.exit.autolinkProtocol.call(this,e)}function SM(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 NM(e){this.config.exit.autolinkEmail.call(this,e)}function AM(e){this.exit(e)}function RM(e){yM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),IM]],{ignore:["link","linkReference"]})}function LM(e,t,n,r,i){let l="";if(!J3(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!OM(n)))return!1;const o=DM(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 IM(e,t,n,r){return!J3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function OM(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 DM(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=ih(e,"(");let l=ih(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 J3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ql(n)||Wh(n))&&(!t||n!==47)}function Ka(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}ew.peek=$M;function jM(){this.buffer()}function MM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PM(){this.buffer()}function BM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ka(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HM(e){this.exit(e)}function zM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ka(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FM(e){this.exit(e)}function $M(){return"["}function ew(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 VM(){return{enter:{gfmFootnoteCallString:jM,gfmFootnoteCall:MM,gfmFootnoteDefinitionLabelString:PM,gfmFootnoteDefinition:BM},exit:{gfmFootnoteCallString:UM,gfmFootnoteCall:HM,gfmFootnoteDefinitionLabelString:zM,gfmFootnoteDefinition:FM}}}function GM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ew},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){const c=l.createTracker(o);let d=c.move("[^");const m=l.enter("footnoteDefinition"),p=l.enter("label");return d+=c.move(l.safe(l.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
245
|
+
`:" ")+l.indentLines(l.containerFlow(r,c.current()),t?tw:qM))),m(),d}}function qM(e,t,n){return t===0?e:tw(e,t,n)}function tw(e,t,n){return(n?"":" ")+e}const YM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nw.peek=ZM;function WM(){return{canContainEols:["delete"],enter:{strikethrough:XM},exit:{strikethrough:KM}}}function QM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:YM}],handlers:{delete:nw}}}function XM(e){this.enter({type:"delete",children:[]},e)}function KM(e){this.exit(e)}function nw(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 ZM(){return"~"}function JM(e){return e.length}function e7(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||JM,l=[],o=[],c=[],d=[];let m=0,p=-1;for(;++p<e.length;){const w=[],C=[];let S=-1;for(e[p].length>m&&(m=e[p].length);++S<e[p].length;){const N=t7(e[p][S]);if(n.alignDelimiters!==!1){const A=i(N);C[S]=A,(d[S]===void 0||A>d[S])&&(d[S]=A)}w.push(N)}o[p]=w,c[p]=C}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<m;)l[g]=z_(r[g]);else{const w=z_(r);for(;++g<m;)l[g]=w}g=-1;const y=[],E=[];for(;++g<m;){const w=l[g];let C="",S="";w===99?(C=":",S=":"):w===108?C=":":w===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[g]-C.length-S.length);const A=C+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=C.length+N+S.length,N>d[g]&&(d[g]=N),E[g]=N),y[g]=A}o.splice(1,0,y),c.splice(1,0,E),p=-1;const v=[];for(;++p<o.length;){const w=o[p],C=c[p];g=-1;const S=[];for(;++g<m;){const N=w[g]||"";let A="",z="";if(n.alignDelimiters!==!1){const Y=d[g]-(C[g]||0),M=l[g];M===114?A=" ".repeat(Y):M===99?Y%2?(A=" ".repeat(Y/2+.5),z=" ".repeat(Y/2-.5)):(A=" ".repeat(Y/2),z=A):z=" ".repeat(Y)}n.delimiterStart!==!1&&!g&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&S.push(" "),n.alignDelimiters!==!1&&S.push(A),S.push(N),n.alignDelimiters!==!1&&S.push(z),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||g!==m-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
|
|
246
|
+
`)}function t7(e){return e==null?"":String(e)}function z_(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 n7(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()),r7);return i(),o}function r7(e,t,n){return">"+(n?"":" ")+e}function a7(e,t){return F_(e,t.inConstruct,!0)&&!F_(e,t.notInConstruct,!1)}function F_(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 $_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
247
|
+
`&&a7(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
248
|
+
`}function s7(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 i7(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 l7(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 o7(e,t,n,r){const i=l7(n),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(i7(e,n)){const g=n.enter("codeIndented"),y=n.indentLines(l,u7);return g(),y}const c=n.createTracker(r),d=i.repeat(Math.max(s7(l,i)+1,3)),m=n.enter("codeFenced");let p=c.move(d);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(d),m(),p}function u7(e,t,n){return(n?"":" ")+e}function X1(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 c7(e,t,n,r){const i=X1(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("[");return m+=d.move(n.safe(n.associationId(e),{before:m,after:"]",...d.current()})),m+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
|
252
|
+
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),o(),m}function d7(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 $c(e){return"&#x"+e.toString(16).toUpperCase()+";"}function tu(e){if(e===null||gn(e)||ql(e))return 1;if(Wh(e))return 2}function yh(e,t,n){const r=tu(e),i=tu(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}}rw.peek=f7;function rw(e,t,n,r){const i=d7(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(i);let d=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const m=d.charCodeAt(0),p=yh(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=$c(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=yh(r.after.charCodeAt(0),g,i);y.inside&&(d=d.slice(0,-1)+$c(g));const E=o.move(i);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function f7(e,t,n){return n.options.emphasis||"*"}const h7={};function K1(e,t){const n=h7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return aw(e,r,i)}function aw(e,t,n){if(m7(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 V_(e.children,t,n)}return Array.isArray(e)?V_(e,t,n):""}function V_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=aw(e[i],t,n);return r.join("")}function m7(e){return!!(e&&typeof e=="object")}function p7(e,t){let n=!1;return bs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ig}),!!((!e.depth||e.depth<3)&&K1(e)&&(t.options.setext||n))}function g7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(p7(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
|
|
253
|
+
`,after:`
|
|
254
|
+
`});return g(),p(),y+`
|
|
255
|
+
`+(i===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
256
|
+
`))+1))}const o="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");l.move(o+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
|
257
|
+
`,...l.current()});return/^[\t ]/.test(m)&&(m=$c(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),d(),c(),m}sw.peek=b7;function sw(e){return e.value||""}function b7(){return"<"}iw.peek=x7;function iw(e,t,n,r){const i=X1(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("![");return m+=d.move(n.safe(e.alt,{before:m,after:"]",...d.current()})),m+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),m+=d.move(")"),o(),m}function x7(){return"!"}lw.peek=y7;function lw(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const m=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!m||m!==g?d+=c.move(g+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function y7(){return"!"}ow.peek=E7;function ow(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 d;if(o.atBreak)for(;d=c.exec(r);){let m=d.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(d.index+1)}}return i+r+i}function E7(){return"`"}function uw(e,t){const n=K1(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))}cw.peek=_7;function cw(e,t,n,r){const i=X1(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,d;if(uw(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"),d=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,{before:m,after:"](",...o.current()})),m+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,{before:m,after:">",...o.current()})),m+=o.move(">")):(d=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,{before:m,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${l}`),m+=o.move(" "+i),m+=o.move(n.safe(e.title,{before:m,after:i,...o.current()})),m+=o.move(i),d()),m+=o.move(")"),c(),m}function _7(e,t,n){return uw(e,n)?"<":"["}dw.peek=T7;function dw(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const m=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!m||m!==g?d+=c.move(g+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function T7(){return"["}function Z1(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 v7(e){const t=Z1(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 k7(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 fw(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 w7(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?k7(n):Z1(n);const c=e.ordered?o==="."?")":".":v7(n);let d=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&&(d=!0),fw(n)===o&&p){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=c),n.bulletCurrent=o;const m=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),m}function C7(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 S7(e,t,n,r){const i=C7(n);let l=n.bulletCurrent||Z1(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 d=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,c.current()),p);return d(),m;function p(g,y,E){return y?(E?"":" ".repeat(o))+g:(E?l:l+" ".repeat(o-l.length))+g}}function N7(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}const A7=Hh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function R7(e,t,n,r){return(e.children.some(function(o){return A7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function L7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hw.peek=I7;function hw(e,t,n,r){const i=L7(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(i+i);let d=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const m=d.charCodeAt(0),p=yh(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=$c(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=yh(r.after.charCodeAt(0),g,i);y.inside&&(d=d.slice(0,-1)+$c(g));const E=o.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function I7(e,t,n){return n.options.strong||"*"}function O7(e,t,n,r){return n.safe(e.value,r)}function D7(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 j7(e,t,n){const r=(fw(n)+(n.options.ruleSpaces?" ":"")).repeat(D7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const mw={blockquote:n7,break:$_,code:o7,definition:c7,emphasis:rw,hardBreak:$_,heading:g7,html:sw,image:iw,imageReference:lw,inlineCode:ow,link:cw,linkReference:dw,list:w7,listItem:S7,paragraph:N7,root:R7,strong:hw,text:O7,thematicBreak:j7},G_=document.createElement("i");function J1(e){const t="&"+e+";";G_.innerHTML=t;const n=G_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pw(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 M7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function P7(e){return e.replace(M7,B7)}function B7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return pw(n.slice(l?2:1),l?16:10)}return J1(n)||e}function U7(){return{enter:{table:H7,tableData:q_,tableHeader:q_,tableRow:F7},exit:{codeText:$7,table:z7,tableData:U0,tableHeader:U0,tableRow:U0}}}function H7(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 z7(e){this.exit(e),this.data.inTable=void 0}function F7(e){this.enter({type:"tableRow",children:[]},e)}function U0(e){this.exit(e)}function q_(e){this.enter({type:"tableCell",children:[]},e)}function $7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,V7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function V7(e,t){return t==="|"?t:e}function G7(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:y,table:o,tableCell:d,tableRow:c}};function o(E,v,w,C){return m(p(E,w,C),E.align)}function c(E,v,w,C){const S=g(E,w,C),N=m([S]);return N.slice(0,N.indexOf(`
|
|
259
|
+
`))}function d(E,v,w,C){const S=w.enter("tableCell"),N=w.enter("phrasing"),A=w.containerPhrasing(E,{...C,before:l,after:l});return N(),S(),A}function m(E,v){return e7(E,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function p(E,v,w){const C=E.children;let S=-1;const N=[],A=v.enter("table");for(;++S<C.length;)N[S]=g(C[S],v,w);return A(),N}function g(E,v,w){const C=E.children;let S=-1;const N=[],A=v.enter("tableRow");for(;++S<C.length;)N[S]=d(C[S],E,v,w);return A(),N}function y(E,v,w){let C=mw.inlineCode(E,v,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function q7(){return{exit:{taskListCheckValueChecked:Y_,taskListCheckValueUnchecked:Y_,paragraph:W7}}}function Y7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Q7}}}function Y_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function W7(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 Q7(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 d=mw.listItem(e,t,n,{...r,...c.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),d;function m(p){return p+o}}function X7(){return[vM(),VM(),WM(),U7(),q7()]}function K7(e){return{extensions:[kM(),GM(e),QM(),G7(e),Y7()]}}function ca(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 Oa(e,t){return e.length>0?(ca(e,e.length,0,t),e):t}const W_={}.hasOwnProperty;function gw(e){const t={};let n=-1;for(;++n<e.length;)Z7(t,e[n]);return t}function Z7(e,t){let n;for(n in t){const i=(W_.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){W_.call(i,o)||(i[o]=[]);const c=l[o];J7(i[o],Array.isArray(c)?c:c?[c]:[])}}}function J7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ca(e,0,0,r)}const eP={tokenize:iP,partial:!0},bw={tokenize:lP,partial:!0},xw={tokenize:oP,partial:!0},yw={tokenize:uP,partial:!0},tP={tokenize:cP,partial:!0},Ew={name:"wwwAutolink",tokenize:aP,previous:Tw},_w={name:"protocolAutolink",tokenize:sP,previous:vw},ai={name:"emailAutolink",tokenize:rP,previous:kw},_s={};function nP(){return{text:_s}}let Ol=48;for(;Ol<123;)_s[Ol]=ai,Ol++,Ol===58?Ol=65:Ol===91&&(Ol=97);_s[43]=ai;_s[45]=ai;_s[46]=ai;_s[95]=ai;_s[72]=[ai,_w];_s[104]=[ai,_w];_s[87]=[ai,Ew];_s[119]=[ai,Ew];function rP(e,t,n){const r=this;let i,l;return o;function o(g){return!Hg(g)||!kw.call(r,r.previous)||eb(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Hg(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(tP,p,m)(g):g===45||g===95||Sr(g)?(l=!0,e.consume(g),d):p(g)}function m(g){return e.consume(g),i=!0,d}function p(g){return l&&i&&jr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function aP(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Tw.call(r,r.previous)||eb(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(eP,e.attempt(bw,e.attempt(xw,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function sP(e,t,n){const r=this;let i="",l=!1;return o;function o(g){return(g===72||g===104)&&vw.call(r,r.previous)&&!eb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(jr(g)&&i.length<5)return i+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const y=i.toLowerCase();if(y==="http"||y==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),l?m:(l=!0,d)):n(g)}function m(g){return g===null||xh(g)||gn(g)||ql(g)||Wh(g)?n(g):e.attempt(bw,e.attempt(xw,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function iP(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 lP(e,t,n){let r,i,l;return o;function o(m){return m===46||m===95?e.check(yw,d,c)(m):m===null||gn(m)||ql(m)||m!==45&&Wh(m)?d(m):(l=!0,e.consume(m),o)}function c(m){return m===95?r=!0:(i=r,r=void 0),e.consume(m),o}function d(m){return i||r||!l?n(m):t(m)}}function oP(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(yw,t,l)(o):o===null||gn(o)||ql(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function uP(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)||ql(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||gn(c)||ql(c)?t(c):r(c)}function l(c){return jr(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):jr(c)?(e.consume(c),o):n(c)}}function cP(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Sr(l)?n(l):t(l)}}function Tw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gn(e)}function vw(e){return!jr(e)}function kw(e){return!(e===47||Hg(e))}function Hg(e){return e===43||e===45||e===46||e===95||Sr(e)}function eb(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 mu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Sr(e.charCodeAt(n+1))&&Sr(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 Qh(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 zg={name:"attention",resolveAll:dP,tokenize:fP};function dP(e,t){let n=-1,r,i,l,o,c,d,m,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;d=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},y={...e[n][1].start};Q_(g,-d),Q_(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=Oa(m,[["enter",e[r][1],t],["exit",e[r][1],t]])),m=Oa(m,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),m=Oa(m,Qh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),m=Oa(m,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,m=Oa(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ca(e,r-1,n-r+3,m),n=r+m.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function fP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tu(r);let l;return o;function o(d){return l=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===l)return e.consume(d),c;const m=e.exit("attentionSequence"),p=tu(d),g=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return m._open=!!(l===42?g:g&&(i||!y)),m._close=!!(l===42?y:y&&(p||!g)),t(d)}}function Q_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hP={name:"autolink",tokenize:mP};function mP(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 jr(E)?(e.consume(E),o):E===64?n(E):m(E)}function o(E){return E===43||E===45||E===46||Sr(E)?(r=1,c(E)):m(E)}function c(E){return E===58?(e.consume(E),r=0,d):(E===43||E===45||E===46||Sr(E))&&r++<32?(e.consume(E),c):(r=0,m(E))}function d(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||xh(E)?n(E):(e.consume(E),d)}function m(E){return E===64?(e.consume(E),p):pM(E)?(e.consume(E),m):n(E)}function p(E){return Sr(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):y(E)}function y(E){if((E===45||Sr(E))&&r++<63){const v=E===45?y: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(d){return Mt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Mt(d)&&l++<i?(e.consume(d),c):(e.exit(n),t(d))}}const td={partial:!0,tokenize:pP};function pP(e,t,n){return r;function r(l){return Mt(l)?Gt(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||lt(l)?t(l):n(l)}}const ww={continuation:{tokenize:bP},exit:xP,name:"blockQuote",tokenize:gP};function gP(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 Mt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function bP(e,t,n){const r=this;return i;function i(o){return Mt(o)?Gt(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(ww,t,n)(o)}}function xP(e){e.exit("blockQuote")}const Cw={name:"characterEscape",tokenize:yP};function yP(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 bM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const Sw={name:"characterReference",tokenize:EP};function EP(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"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,o=Sr,p(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=gM,p):(e.enter("characterReferenceValue"),l=7,o=Ug,p(g))}function p(g){if(g===59&&i){const y=e.exit("characterReferenceValue");return o===Sr&&!J1(r.sliceSerialize(y))?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 X_={partial:!0,tokenize:TP},K_={concrete:!0,name:"codeFenced",tokenize:_P};function _P(e,t,n){const r=this,i={partial:!0,tokenize:Y};let l=0,o=0,c;return d;function d(M){return m(M)}function m(M){const B=r.events[r.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,c=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===c?(o++,e.consume(M),p):o<3?n(M):(e.exit("codeFencedFenceSequence"),Mt(M)?Gt(e,g,"whitespace")(M):g(M))}function g(M){return M===null||lt(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(X_,w,z)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||lt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(M)):Mt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Gt(e,E,"whitespace")(M)):M===96&&M===c?n(M):(e.consume(M),y)}function E(M){return M===null||lt(M)?g(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||lt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(M)):M===96&&M===c?n(M):(e.consume(M),v)}function w(M){return e.attempt(i,z,C)(M)}function C(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),S}function S(M){return l>0&&Mt(M)?Gt(e,N,"linePrefix",l+1)(M):N(M)}function N(M){return M===null||lt(M)?e.check(X_,w,z)(M):(e.enter("codeFlowValue"),A(M))}function A(M){return M===null||lt(M)?(e.exit("codeFlowValue"),N(M)):(e.consume(M),A)}function z(M){return e.exit("codeFenced"),t(M)}function Y(M,B,G){let ce=0;return Q;function Q(ne){return M.enter("lineEnding"),M.consume(ne),M.exit("lineEnding"),he}function he(ne){return M.enter("codeFencedFence"),Mt(ne)?Gt(M,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):V(ne)}function V(ne){return ne===c?(M.enter("codeFencedFenceSequence"),Te(ne)):G(ne)}function Te(ne){return ne===c?(ce++,M.consume(ne),Te):ce>=o?(M.exit("codeFencedFenceSequence"),Mt(ne)?Gt(M,me,"whitespace")(ne):me(ne)):G(ne)}function me(ne){return ne===null||lt(ne)?(M.exit("codeFencedFence"),B(ne)):G(ne)}}}function TP(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 H0={name:"codeIndented",tokenize:kP},vP={partial:!0,tokenize:wP};function kP(e,t,n){const r=this;return i;function i(m){return e.enter("codeIndented"),Gt(e,l,"linePrefix",5)(m)}function l(m){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?d(m):lt(m)?e.attempt(vP,o,d)(m):(e.enter("codeFlowValue"),c(m))}function c(m){return m===null||lt(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),c)}function d(m){return e.exit("codeIndented"),t(m)}}function wP(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):lt(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):lt(o)?i(o):n(o)}}const CP={name:"codeText",previous:NP,resolve:SP,tokenize:AP};function SP(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 NP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AP(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"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(l=e.enter("codeTextSequence"),i=0,p(g)):lt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||lt(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),m)}function p(g){return g===96?(e.consume(g),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",m(g))}}class RP{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&&cc(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),cc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cc(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);cc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cc(this.left,n.reverse())}}}function cc(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 Nw(e){const t={};let n=-1,r,i,l,o,c,d,m;const p=new RP(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"&&(d=r[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,LP(p,n)),n=t[n],m=!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 ca(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!m}function LP(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,d=[],m={};let p,g,y=-1,E=n,v=0,w=0;const C=[w];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;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(w=y+1,C.push(w),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):C.pop(),y=C.length;y--;){const S=c.slice(C[y],C[y+1]),N=l.pop();d.push([N,N+S.length-1]),e.splice(N,2,S)}for(d.reverse(),y=-1;++y<d.length;)m[v+d[y][0]]=v+d[y][1],v+=d[y][1]-d[y][0]-1;return m}const IP={resolve:DP,tokenize:jP},OP={partial:!0,tokenize:MP};function DP(e){return Nw(e),e}function jP(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):lt(c)?e.check(OP,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 MP(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||lt(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 Aw(e,t,n,r,i,l,o,c,d){const m=d||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||xh(S)?n(S):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(S))}function E(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||lt(S)?n(S):(e.consume(S),S===92?v:E)}function v(S){return S===60||S===62||S===92?(e.consume(S),E):E(S)}function w(S){return!p&&(S===null||S===41||gn(S))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(S)):p<m&&S===40?(e.consume(S),p++,w):S===41?(e.consume(S),p--,w):S===null||S===32||S===40||xh(S)?n(S):(e.consume(S),S===92?C:w)}function C(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function Rw(e,t,n,r,i,l){const o=this;let c=0,d;return m;function m(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&&!d||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):lt(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||lt(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),d||(d=!Mt(E)),E===92?y:g)}function y(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function Lw(e,t,n,r,i,l){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(l),m(y))}function m(y){return y===o?(e.exit(l),d(o)):y===null?n(y):lt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Gt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||lt(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?g:p)}function g(y){return y===o||y===92?(e.consume(y),p):p(y)}}function Lc(e,t){let n;return r;function r(i){return lt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Mt(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const PP={name:"definition",tokenize:UP},BP={partial:!0,tokenize:HP};function UP(e,t,n){const r=this;let i;return l;function l(E){return e.enter("definition"),o(E)}function o(E){return Rw.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return i=Ka(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),d):n(E)}function d(E){return gn(E)?Lc(e,m)(E):m(E)}function m(E){return Aw(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(BP,g,g)(E)}function g(E){return Mt(E)?Gt(e,y,"whitespace")(E):y(E)}function y(E){return E===null||lt(E)?(e.exit("definition"),r.parser.defined.push(i),t(E)):n(E)}}function HP(e,t,n){return r;function r(c){return gn(c)?Lc(e,i)(c):n(c)}function i(c){return Lw(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Mt(c)?Gt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||lt(c)?t(c):n(c)}}const zP={name:"hardBreakEscape",tokenize:FP};function FP(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return lt(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const $P={name:"headingAtx",resolve:VP,tokenize:GP};function VP(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"},ca(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function GP(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"),d(p)):p===null||lt(p)?(e.exit("atxHeading"),t(p)):Mt(p)?Gt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),m(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function m(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),m)}}const qP=["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"],Z_=["pre","script","style","textarea"],YP={concrete:!0,name:"htmlFlow",resolveTo:XP,tokenize:KP},WP={partial:!0,tokenize:JP},QP={partial:!0,tokenize:ZP};function XP(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 KP(e,t,n){const r=this;let i,l,o,c,d;return m;function m(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),l=!0,w):O===63?(e.consume(O),i=3,r.interrupt?t:R):jr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function y(O){return O===45?(e.consume(O),i=2,E):O===91?(e.consume(O),i=5,c=0,v):jr(O)?(e.consume(O),i=4,r.interrupt?t:R):n(O)}function E(O){return O===45?(e.consume(O),r.interrupt?t:R):n(O)}function v(O){const we="CDATA[";return O===we.charCodeAt(c++)?(e.consume(O),c===we.length?r.interrupt?t:V:v):n(O)}function w(O){return jr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||gn(O)){const we=O===47,Re=o.toLowerCase();return!we&&!l&&Z_.includes(Re)?(i=1,r.interrupt?t(O):V(O)):qP.includes(o.toLowerCase())?(i=6,we?(e.consume(O),S):r.interrupt?t(O):V(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):l?N(O):A(O))}return O===45||Sr(O)?(e.consume(O),o+=String.fromCharCode(O),C):n(O)}function S(O){return O===62?(e.consume(O),r.interrupt?t:V):n(O)}function N(O){return Mt(O)?(e.consume(O),N):Q(O)}function A(O){return O===47?(e.consume(O),Q):O===58||O===95||jr(O)?(e.consume(O),z):Mt(O)?(e.consume(O),A):Q(O)}function z(O){return O===45||O===46||O===58||O===95||Sr(O)?(e.consume(O),z):Y(O)}function Y(O){return O===61?(e.consume(O),M):Mt(O)?(e.consume(O),Y):A(O)}function M(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,B):Mt(O)?(e.consume(O),M):G(O)}function B(O){return O===d?(e.consume(O),d=null,ce):O===null||lt(O)?n(O):(e.consume(O),B)}function G(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||gn(O)?Y(O):(e.consume(O),G)}function ce(O){return O===47||O===62||Mt(O)?A(O):n(O)}function Q(O){return O===62?(e.consume(O),he):n(O)}function he(O){return O===null||lt(O)?V(O):Mt(O)?(e.consume(O),he):n(O)}function V(O){return O===45&&i===2?(e.consume(O),H):O===60&&i===1?(e.consume(O),F):O===62&&i===4?(e.consume(O),U):O===63&&i===3?(e.consume(O),R):O===93&&i===5?(e.consume(O),oe):lt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(WP,te,Te)(O)):O===null||lt(O)?(e.exit("htmlFlowData"),Te(O)):(e.consume(O),V)}function Te(O){return e.check(QP,me,te)(O)}function me(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ne}function ne(O){return O===null||lt(O)?Te(O):(e.enter("htmlFlowData"),V(O))}function H(O){return O===45?(e.consume(O),R):V(O)}function F(O){return O===47?(e.consume(O),o="",K):V(O)}function K(O){if(O===62){const we=o.toLowerCase();return Z_.includes(we)?(e.consume(O),U):V(O)}return jr(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),K):V(O)}function oe(O){return O===93?(e.consume(O),R):V(O)}function R(O){return O===62?(e.consume(O),U):O===45&&i===2?(e.consume(O),R):V(O)}function U(O){return O===null||lt(O)?(e.exit("htmlFlowData"),te(O)):(e.consume(O),U)}function te(O){return e.exit("htmlFlow"),t(O)}}function ZP(e,t,n){const r=this;return i;function i(o){return lt(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 JP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(td,t,n)}}const eB={name:"htmlText",tokenize:tB};function tB(e,t,n){const r=this;let i,l,o;return c;function c(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),m):R===47?(e.consume(R),Y):R===63?(e.consume(R),A):jr(R)?(e.consume(R),G):n(R)}function m(R){return R===45?(e.consume(R),p):R===91?(e.consume(R),l=0,v):jr(R)?(e.consume(R),N):n(R)}function p(R){return R===45?(e.consume(R),E):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),y):lt(R)?(o=g,F(R)):(e.consume(R),g)}function y(R){return R===45?(e.consume(R),E):g(R)}function E(R){return R===62?H(R):R===45?y(R):g(R)}function v(R){const U="CDATA[";return R===U.charCodeAt(l++)?(e.consume(R),l===U.length?w:v):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),C):lt(R)?(o=w,F(R)):(e.consume(R),w)}function C(R){return R===93?(e.consume(R),S):w(R)}function S(R){return R===62?H(R):R===93?(e.consume(R),S):w(R)}function N(R){return R===null||R===62?H(R):lt(R)?(o=N,F(R)):(e.consume(R),N)}function A(R){return R===null?n(R):R===63?(e.consume(R),z):lt(R)?(o=A,F(R)):(e.consume(R),A)}function z(R){return R===62?H(R):A(R)}function Y(R){return jr(R)?(e.consume(R),M):n(R)}function M(R){return R===45||Sr(R)?(e.consume(R),M):B(R)}function B(R){return lt(R)?(o=B,F(R)):Mt(R)?(e.consume(R),B):H(R)}function G(R){return R===45||Sr(R)?(e.consume(R),G):R===47||R===62||gn(R)?ce(R):n(R)}function ce(R){return R===47?(e.consume(R),H):R===58||R===95||jr(R)?(e.consume(R),Q):lt(R)?(o=ce,F(R)):Mt(R)?(e.consume(R),ce):H(R)}function Q(R){return R===45||R===46||R===58||R===95||Sr(R)?(e.consume(R),Q):he(R)}function he(R){return R===61?(e.consume(R),V):lt(R)?(o=he,F(R)):Mt(R)?(e.consume(R),he):ce(R)}function V(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,Te):lt(R)?(o=V,F(R)):Mt(R)?(e.consume(R),V):(e.consume(R),me)}function Te(R){return R===i?(e.consume(R),i=void 0,ne):R===null?n(R):lt(R)?(o=Te,F(R)):(e.consume(R),Te)}function me(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||gn(R)?ce(R):(e.consume(R),me)}function ne(R){return R===47||R===62||gn(R)?ce(R):n(R)}function H(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function F(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),K}function K(R){return Mt(R)?Gt(e,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):oe(R)}function oe(R){return e.enter("htmlTextData"),o(R)}}const tb={name:"labelEnd",resolveAll:sB,resolveTo:iB,tokenize:lB},nB={tokenize:oB},rB={tokenize:uB},aB={tokenize:cB};function sB(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&&ca(e,0,e.length,n),e}function iB(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 d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={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",d,t],["enter",m,t]],c=Oa(c,e.slice(l+1,l+r+3)),c=Oa(c,[["enter",p,t]]),c=Oa(c,Qh(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Oa(c,[["exit",p,t],e[o-2],e[o-1],["exit",m,t]]),c=Oa(c,e.slice(o+1)),c=Oa(c,[["exit",d,t]]),ca(e,l,e.length,c),e}function lB(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(y){return l?l._inactive?g(y):(o=r.parser.defined.includes(Ka(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(nB,p,o?p:g)(y):y===91?e.attempt(rB,p,o?m:g)(y):o?p(y):g(y)}function m(y){return e.attempt(aB,p,g)(y)}function p(y){return t(y)}function g(y){return l._balanced=!0,n(y)}}function oB(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)?Lc(e,l)(g):l(g)}function l(g){return g===41?p(g):Aw(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return gn(g)?Lc(e,d)(g):p(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?Lw(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function m(g){return gn(g)?Lc(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 uB(e,t,n){const r=this;return i;function i(c){return Rw.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(Ka(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function cB(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 dB={name:"labelStartImage",resolveAll:tb.resolveAll,tokenize:fB};function fB(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 hB={name:"labelStartLink",resolveAll:tb.resolveAll,tokenize:mB};function mB(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 z0={name:"lineEnding",tokenize:pB};function pB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Gt(e,t,"linePrefix")}}const Zf={name:"thematicBreak",tokenize:gB};function gB(e,t,n){let r=0,i;return l;function l(m){return e.enter("thematicBreak"),o(m)}function o(m){return i=m,c(m)}function c(m){return m===i?(e.enter("thematicBreakSequence"),d(m)):r>=3&&(m===null||lt(m))?(e.exit("thematicBreak"),t(m)):n(m)}function d(m){return m===i?(e.consume(m),r++,d):(e.exit("thematicBreakSequence"),Mt(m)?Gt(e,c,"whitespace")(m):c(m))}}const Yr={continuation:{tokenize:EB},exit:TB,name:"list",tokenize:yB},bB={partial:!0,tokenize:vB},xB={partial:!0,tokenize:_B};function yB(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:Ug(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(Zf,n,m)(E):m(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(E)}return n(E)}function d(E){return Ug(E)&&++o<10?(e.consume(E),d):(!r.interrupt||o<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),m(E)):n(E)}function m(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(td,r.interrupt?n:p,e.attempt(bB,y,g))}function p(E){return r.containerState.initialBlankLine=!0,l++,y(E)}function g(E){return Mt(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),y):n(E)}function y(E){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function EB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(td,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||!Mt(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(xB,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(Yr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function _B(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 TB(e){e.exit(this.containerState.type)}function vB(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!Mt(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const J_={name:"setextUnderline",resolveTo:kB,tokenize:wB};function kB(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 wB(e,t,n){const r=this;let i;return l;function l(m){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=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),c(m)}function c(m){return m===i?(e.consume(m),c):(e.exit("setextHeadingLineSequence"),Mt(m)?Gt(e,d,"lineSuffix")(m):d(m))}function d(m){return m===null||lt(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const CB={tokenize:DB,partial:!0};function SB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LB,continuation:{tokenize:IB},exit:OB}},text:{91:{name:"gfmFootnoteCall",tokenize:RB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:NB,resolveTo:AB}}}}function NB(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const d=r.events[i][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!o||!o._balanced)return n(d);const m=Ka(r.sliceSerialize({start:o.end,end:r.now()}));return m.codePointAt(0)!==94||!l.includes(m.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function AB(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 RB(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"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(l>999||g===93&&!o||g===null||g===91||gn(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return i.includes(Ka(r.sliceSerialize(y)))?(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:m}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,m):m(g)}}function LB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(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 w=e.exit("gfmFootnoteDefinitionLabelString");return l=Ka(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}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 y(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 IB(e,t,n){return e.check(td,t,e.attempt(CB,t,n))}function OB(e){e.exit("gfmFootnoteDefinition")}function DB(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 jB(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 d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let m=d;for(;m--;)if(o[m][0]==="exit"&&o[m][1].type==="strikethroughSequenceTemporary"&&o[m][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[m][1].end.offset-o[m][1].start.offset){o[d][1].type="strikethroughSequence",o[m][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[m][1].start),end:Object.assign({},o[d][1].end)},g={type:"strikethroughText",start:Object.assign({},o[m][1].end),end:Object.assign({},o[d][1].start)},y=[["enter",p,c],["enter",o[m][1],c],["exit",o[m][1],c],["enter",g,c]],E=c.parser.constructs.insideSpan.null;E&&ca(y,y.length,0,Qh(E,o.slice(m+1,d),c)),ca(y,y.length,0,[["exit",g,c],["enter",o[d][1],c],["exit",o[d][1],c],["exit",p,c]]),ca(o,m-1,d-m+3,y),d=m+y.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,c,d){const m=this.previous,p=this.events;let g=0;return y;function y(v){return m===126&&p[p.length-1][1].type!=="characterEscape"?d(v):(o.enter("strikethroughSequenceTemporary"),E(v))}function E(v){const w=tu(m);if(v===126)return g>1?d(v):(o.consume(v),g++,E);if(g<2&&!n)return d(v);const C=o.exit("strikethroughSequenceTemporary"),S=tu(v);return C._open=!S||S===2&&!!w,C._close=!w||w===2&&!!S,c(v)}}}class MB{constructor(){this.map=[]}add(t,n,r){PB(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 PB(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 BB(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 UB(){return{flow:{null:{name:"table",tokenize:HB,resolveAll:zB}}}}function HB(e,t,n){const r=this;let i=0,l=0,o;return c;function c(Q){let he=r.events.length-1;for(;he>-1;){const me=r.events[he][1].type;if(me==="lineEnding"||me==="linePrefix")he--;else break}const V=he>-1?r.events[he][1].type:null,Te=V==="tableHead"||V==="tableRow"?M:d;return Te===M&&r.parser.lazy[r.now().line]?n(Q):Te(Q)}function d(Q){return e.enter("tableHead"),e.enter("tableRow"),m(Q)}function m(Q){return Q===124||(o=!0,l+=1),p(Q)}function p(Q){return Q===null?n(Q):lt(Q)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),E):n(Q):Mt(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?y:g)}function y(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,Mt(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?C(Q):Q===124?(o=!0,e.enter("tableCellDivider"),e.consume(Q),e.exit("tableCellDivider"),w):Y(Q)}function w(Q){return Mt(Q)?Gt(e,C,"whitespace")(Q):C(Q)}function C(Q){return Q===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(Q),e.exit("tableDelimiterMarker"),S):Q===45?(l+=1,S(Q)):Q===null||lt(Q)?z(Q):Y(Q)}function S(Q){return Q===45?(e.enter("tableDelimiterFiller"),N(Q)):Y(Q)}function N(Q){return Q===45?(e.consume(Q),N):Q===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(Q),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(Q))}function A(Q){return Mt(Q)?Gt(e,z,"whitespace")(Q):z(Q)}function z(Q){return Q===124?v(Q):Q===null||lt(Q)?!o||i!==l?Y(Q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(Q)):Y(Q)}function Y(Q){return n(Q)}function M(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||lt(Q)?(e.exit("tableRow"),t(Q)):Mt(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?ce:G)}function ce(Q){return Q===92||Q===124?(e.consume(Q),G):G(Q)}}function zB(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,d=0,m,p,g;const y=new MB;for(;++n<e.length;){const E=e[n],v=E[1];E[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(eT(y,t,d,m,p),p=void 0,d=0),m={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",m,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)},y.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=Sf(y,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=Sf(y,t,l,i,void 0,g)),l=o,o=[l[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,l[1]!==0?(o[0]=o[1],g=Sf(y,t,l,i,n,g)):o[1]!==0&&(g=Sf(y,t,o,i,n,g)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&eT(y,t,d,m,p),y.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=BB(t.events,n))}return e}function Sf(e,t,n,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Vo(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const d=Vo(t.events,n[1]);if(l={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const m=Vo(t.events,n[2]),p=Vo(t.events,n[3]),g={type:c,start:Object.assign({},m),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const y=t.events[n[2]],E=t.events[n[3]];if(y[1].end=Object.assign({},E[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return i!==void 0&&(l.end=Object.assign({},Vo(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function eT(e,t,n,r,i){const l=[],o=Vo(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 Vo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const FB={name:"tasklistCheck",tokenize:VB};function $B(){return{text:{91:FB}}}function VB(e,t,n){const r=this;return i;function i(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return gn(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return lt(d)?t(d):Mt(d)?e.check({tokenize:GB},t,n)(d):n(d)}}function GB(e,t,n){return Gt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function qB(e){return gw([nP(),SB(),jB(e),UB(),$B()])}const YB={};function WB(e){const t=this,n=e||YB,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(qB(n)),l.push(X7()),o.push(K7(n))}var QB=Object.defineProperty,XB=Object.defineProperties,KB=Object.getOwnPropertyDescriptors,tT=Object.getOwnPropertySymbols,ZB=Object.prototype.hasOwnProperty,JB=Object.prototype.propertyIsEnumerable,nT=(e,t,n)=>t in e?QB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iw=(e,t)=>{for(var n in t||(t={}))ZB.call(t,n)&&nT(e,n,t[n]);if(tT)for(var n of tT(t))JB.call(t,n)&&nT(e,n,t[n]);return e},Ow=(e,t)=>XB(e,KB(t)),Pr=(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},eU=(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},tU=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]==="`"&&!eU(e,n)&&(t+=1)}return t},nl=(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},nU=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,rU=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(nU,(t,n,r,i)=>Pr(e,i)?t:`${n}\\>${r}`),aU=/(\*\*)([^*]*\*?)$/,sU=/(__)([^_]*?)$/,iU=/(\*\*\*)([^*]*?)$/,lU=/(\*)([^*]*?)$/,oU=/(_)([^_]*?)$/,uU=/(`)([^`]*?)$/,cU=/(~~)([^~]*?)$/,Kl=/^[\s_~*`]*$/,Dw=/^[\s]*[-*+][\s]+$/,dU=/[\p{L}\p{N}_]/u,fU=/^```[^`\n]*```?$/,hU=/^\*{4,}$/,mU=/(__)([^_]+)_$/,pU=/(~~)([^~]+)~$/,rT=/~~/g,rl=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:dU.test(e)},gU=(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},jw=(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},Xh=(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},bU=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
260
|
+
`)return!1}return!1},Mw=(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]==="]"?bU(e,t):!1;if(e[n]===`
|
|
261
|
+
`)return!1}return!1},xU=(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},nb=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
|
|
263
|
+
`){r=d+1;break}let i=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
|
|
264
|
+
`){i=d;break}let l=e.substring(r,i),o=0,c=!1;for(let d of l)if(d===n)o+=1;else if(d!==" "&&d!==" "){c=!0;break}return o>=3&&!c},yU=(e,t,n,r)=>n==="\\"||e.includes("$")&&Xh(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&rl(n)&&rl(r)||(!n||n===" "||n===" "||n===`
|
|
265
|
+
`)&&(!r||r===" "||r===" "||r===`
|
|
266
|
+
`)),Pw=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]:"";yU(e,i,l,o)||(t+=1)}return t},EU=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&Xh(e,t)||Mw(e,t)||xU(e,t)||n==="_"||r==="_"||n&&r&&rl(n)&&rl(r)),_U=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]:"";EU(e,i,l,o)||(t+=1)}return t},TU=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},rb=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},aT=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},vU=(e,t,n)=>{if(!t||Kl.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
267
|
+
`),i=r===-1?0:r+1,l=e.substring(i,n);return Dw.test(l)&&t.includes(`
|
|
268
|
+
`)?!0:nb(e,n,"*")},kU=e=>{let t=e.match(aU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Pr(e,r)||nl(e,r)||vU(e,n,r)?e:rb(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},wU=(e,t,n)=>{if(!t||Kl.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
269
|
+
`),i=r===-1?0:r+1,l=e.substring(i,n);return Dw.test(l)&&t.includes(`
|
|
270
|
+
`)?!0:nb(e,n,"_")},CU=e=>{let t=e.match(sU);if(!t){let i=e.match(mU);if(i){let l=e.lastIndexOf(i[1]);if(!(Pr(e,l)||nl(e,l))&&aT(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Pr(e,r)||nl(e,r)||wU(e,n,r)?e:aT(e)%2===1?`${e}__`:e},SU=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]!=="\\"&&!Xh(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&&rl(r)&&rl(i))continue;return n}}return-1},NU=e=>{if(!e.match(lU))return e;let t=SU(e);if(t===-1||Pr(e,t)||nl(e,t))return e;let n=e.substring(t+1);return!n||Kl.test(n)?e:Pw(e)%2===1?`${e}*`:e},Bw=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]!=="\\"&&!Xh(e,n)&&!Mw(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&rl(r)&&rl(i))continue;return n}}return-1},AU=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}_`},RU=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(rb(t)%2!==1)return null;let n=t.indexOf("**"),r=Bw(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},LU=e=>{if(!e.match(oU))return e;let t=Bw(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||Kl.test(n)||Pr(e,t)||nl(e,t))return e;if(_U(e)%2===1){let r=RU(e);return r!==null?r:AU(e)}return e},IU=e=>{let t=rb(e),n=Pw(e);return t%2===0&&n%2===0},OU=(e,t,n)=>!t||Kl.test(t)||Pr(e,n)||nl(e,n)?!0:nb(e,n,"*"),DU=e=>{if(hU.test(e))return e;let t=e.match(iU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return OU(e,n,r)?e:TU(e)%2===1?IU(e)?e:`${e}***`:e},jU=/<[a-zA-Z/][^>]*$/,MU=e=>{let t=e.match(jU);return!t||t.index===void 0||Pr(e,t.index)?e:e.substring(0,t.index).trimEnd()},PU=e=>!e.match(fU)||e.includes(`
|
|
274
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,BU=e=>(e.match(/```/g)||[]).length%2===1,UU=e=>{let t=PU(e);if(t!==null)return t;let n=e.match(uU);if(n&&!BU(e)){let r=n[2];if(!r||Kl.test(r))return e;if(tU(e)%2===1)return`${e}\``}return e},Uw=(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)==="```",HU=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Uw(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},zU=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!Uw(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},FU=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}$$`},$U=e=>HU(e)%2===0?e:FU(e),VU=e=>zU(e)%2===1?`${e}$`:e,GU=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=gU(e,t);if(r===-1||Pr(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)`},sT=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Pr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=jw(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},qU=(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=sT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(jw(e,t)===-1){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=sT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},Hw=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Pr(e,n)){let r=GU(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Pr(e,r)){let i=qU(e,r,t);if(i!==null)return i}return e},YU=/^-{1,2}$/,WU=/^[\s]*-{1,2}[\s]+$/,QU=/^={1,2}$/,XU=/^[\s]*={1,2}[\s]+$/,KU=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(YU.test(i)&&!n.match(WU)){let l=r.split(`
|
|
279
|
+
`).at(-1);if(l&&l.trim().length>0)return`${e}`}if(QU.test(i)&&!n.match(XU)){let l=r.split(`
|
|
280
|
+
`).at(-1);if(l&&l.trim().length>0)return`${e}`}return e},ZU=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),JU=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(ZU,(t,n)=>Pr(e,n)?t:"\\~"),eH=e=>{var t,n;let r=e.match(cU);if(r){let i=r[2];if(!i||Kl.test(i))return e;let l=e.lastIndexOf(r[1]);if(Pr(e,l)||nl(e,l))return e;if(((t=e.match(rT))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(pU);if(i){let l=e.lastIndexOf(i[0].slice(0,2));if(Pr(e,l)||nl(e,l))return e;if(((n=e.match(rT))==null?void 0:n.length)%2===1)return`${e}~`}}return e},F0=e=>e!==!1,tH=e=>e===!0,Dr={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},nH=[{handler:{name:"singleTilde",handle:JU,priority:Dr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:rU,priority:Dr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:MU,priority:Dr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:KU,priority:Dr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Hw,priority:Dr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:DU,priority:Dr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:kU,priority:Dr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:CU,priority:Dr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:NU,priority:Dr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:LU,priority:Dr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:UU,priority:Dr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:eH,priority:Dr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:$U,priority:Dr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:VU,priority:Dr.INLINE_KATEX},optionKey:"inlineKatex"}],rH=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return nH.filter(({handler:r,optionKey:i})=>r.name==="links"?F0(e==null?void 0:e.links)||F0(e==null?void 0:e.images):r.name==="inlineKatex"?tH(e==null?void 0:e.inlineKatex):F0(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:Ow(Iw({},r),{handle:l=>Hw(l,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},aH=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=rH(t),l=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var d;return{handler:Ow(Iw({},c),{priority:(d=c.priority)!=null?d:Dr.DEFAULT}),earlyReturn:void 0}}),o=[...i,...l].sort((c,d)=>{var m,p;return((m=c.handler.priority)!=null?m:0)-((p=d.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:d}of o)if(r=c.handle(r),d!=null&&d(r))return r;return r},sH=aH;function zw(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=zw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fw(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zw(e))&&(r&&(r+=" "),r+=t);return r}const iH=(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},lH=(e,t)=>({classGroupId:e,validator:t}),$w=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Eh="-",iT=[],oH="arbitrary..",uH=e=>{const t=dH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return cH(o);const c=o.split(Eh),d=c[0]===""&&c.length>1?1:0;return Vw(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],m=n[o];return d?m?iH(m,d):d:m||iT}return n[o]||iT}}},Vw=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const m=Vw(e,t+1,l);if(m)return m}const o=n.validators;if(o===null)return;const c=t===0?e.join(Eh):e.slice(t).join(Eh),d=o.length;for(let m=0;m<d;m++){const p=o[m];if(p.validator(c))return p.classGroupId}},cH=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?oH+r:void 0})(),dH=e=>{const{theme:t,classGroups:n}=e;return fH(n,t)},fH=(e,t)=>{const n=$w();for(const r in e){const i=e[r];ab(i,n,r,t)}return n},ab=(e,t,n,r)=>{const i=e.length;for(let l=0;l<i;l++){const o=e[l];hH(o,t,n,r)}},hH=(e,t,n,r)=>{if(typeof e=="string"){mH(e,t,n);return}if(typeof e=="function"){pH(e,t,n,r);return}gH(e,t,n,r)},mH=(e,t,n)=>{const r=e===""?t:Gw(t,e);r.classGroupId=n},pH=(e,t,n,r)=>{if(bH(e)){ab(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(lH(n,e))},gH=(e,t,n,r)=>{const i=Object.entries(e),l=i.length;for(let o=0;o<l;o++){const[c,d]=i[o];ab(d,Gw(t,c),n,r)}},Gw=(e,t)=>{let n=e;const r=t.split(Eh),i=r.length;for(let l=0;l<i;l++){const o=r[l];let c=n.nextPart.get(o);c||(c=$w(),n.nextPart.set(o,c)),n=c}return n},bH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,xH=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)}}},Fg="!",lT=":",yH=[],oT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),EH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const l=[];let o=0,c=0,d=0,m;const p=i.length;for(let w=0;w<p;w++){const C=i[w];if(o===0&&c===0){if(C===lT){l.push(i.slice(d,w)),d=w+1;continue}if(C==="/"){m=w;continue}}C==="["?o++:C==="]"?o--:C==="("?c++:C===")"&&c--}const g=l.length===0?i:i.slice(d);let y=g,E=!1;g.endsWith(Fg)?(y=g.slice(0,-1),E=!0):g.startsWith(Fg)&&(y=g.slice(1),E=!0);const v=m&&m>d?m-d:void 0;return oT(l,E,y,v)};if(t){const i=t+lT,l=r;r=o=>o.startsWith(i)?l(o.slice(i.length)):oT(yH,!1,o,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},_H=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]==="[",d=t.has(o);c||d?(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}},TH=e=>({cache:xH(e.cacheSize),parseClassName:EH(e),sortModifiers:_H(e),...uH(e)}),vH=/\s+/,kH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=t,o=[],c=e.trim().split(vH);let d="";for(let m=c.length-1;m>=0;m-=1){const p=c[m],{isExternal:g,modifiers:y,hasImportantModifier:E,baseClassName:v,maybePostfixModifierPosition:w}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!w,S=r(C?v.substring(0,w):v);if(!S){if(!C){d=p+(d.length>0?" "+d:d);continue}if(S=r(v),!S){d=p+(d.length>0?" "+d:d);continue}C=!1}const N=y.length===0?"":y.length===1?y[0]:l(y).join(":"),A=E?N+Fg:N,z=A+S;if(o.indexOf(z)>-1)continue;o.push(z);const Y=i(S,C);for(let M=0;M<Y.length;++M){const B=Y[M];o.push(A+B)}d=p+(d.length>0?" "+d:d)}return d},wH=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=qw(n))&&(i&&(i+=" "),i+=r);return i},qw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qw(e[r]))&&(n&&(n+=" "),n+=t);return n},CH=(e,...t)=>{let n,r,i,l;const o=d=>{const m=t.reduce((p,g)=>g(p),e());return n=TH(m),r=n.cache.get,i=n.cache.set,l=c,c(d)},c=d=>{const m=r(d);if(m)return m;const p=kH(d,n);return i(d,p),p};return l=o,(...d)=>l(wH(...d))},SH=[],rr=e=>{const t=n=>n[e]||SH;return t.isThemeGetter=!0,t},Yw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ww=/^\((?:(\w[\w-]*):)?(.+)\)$/i,NH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,AH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RH=/\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$/,LH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$i=e=>NH.test(e),Nt=e=>!!e&&!Number.isNaN(Number(e)),Vi=e=>!!e&&Number.isInteger(Number(e)),$0=e=>e.endsWith("%")&&Nt(e.slice(0,-1)),Xs=e=>AH.test(e),Qw=()=>!0,DH=e=>RH.test(e)&&!LH.test(e),sb=()=>!1,jH=e=>IH.test(e),MH=e=>OH.test(e),PH=e=>!ze(e)&&!Ve(e),BH=e=>sl(e,Zw,sb),ze=e=>Yw.test(e),Dl=e=>sl(e,Jw,DH),uT=e=>sl(e,qH,Nt),UH=e=>sl(e,tC,Qw),HH=e=>sl(e,eC,sb),cT=e=>sl(e,Xw,sb),zH=e=>sl(e,Kw,MH),Nf=e=>sl(e,nC,jH),Ve=e=>Ww.test(e),dc=e=>Zl(e,Jw),FH=e=>Zl(e,eC),dT=e=>Zl(e,Xw),$H=e=>Zl(e,Zw),VH=e=>Zl(e,Kw),Af=e=>Zl(e,nC,!0),GH=e=>Zl(e,tC,!0),sl=(e,t,n)=>{const r=Yw.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Zl=(e,t,n=!1)=>{const r=Ww.exec(e);return r?r[1]?t(r[1]):n:!1},Xw=e=>e==="position"||e==="percentage",Kw=e=>e==="image"||e==="url",Zw=e=>e==="length"||e==="size"||e==="bg-size",Jw=e=>e==="length",qH=e=>e==="number",eC=e=>e==="family-name",tC=e=>e==="number"||e==="weight",nC=e=>e==="shadow",YH=()=>{const e=rr("color"),t=rr("font"),n=rr("text"),r=rr("font-weight"),i=rr("tracking"),l=rr("leading"),o=rr("breakpoint"),c=rr("container"),d=rr("spacing"),m=rr("radius"),p=rr("shadow"),g=rr("inset-shadow"),y=rr("text-shadow"),E=rr("drop-shadow"),v=rr("blur"),w=rr("perspective"),C=rr("aspect"),S=rr("ease"),N=rr("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...z(),Ve,ze],M=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],G=()=>[Ve,ze,d],ce=()=>[$i,"full","auto",...G()],Q=()=>[Vi,"none","subgrid",Ve,ze],he=()=>["auto",{span:["full",Vi,Ve,ze]},Vi,Ve,ze],V=()=>[Vi,"auto",Ve,ze],Te=()=>["auto","min","max","fr",Ve,ze],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...G()],F=()=>[$i,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],K=()=>[$i,"screen","full","dvw","lvw","svw","min","max","fit",...G()],oe=()=>[$i,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],R=()=>[e,Ve,ze],U=()=>[...z(),dT,cT,{position:[Ve,ze]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",$H,BH,{size:[Ve,ze]}],we=()=>[$0,dc,Dl],Re=()=>["","none","full",m,Ve,ze],Se=()=>["",Nt,dc,Dl],Ge=()=>["solid","dashed","dotted","double"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],De=()=>[Nt,$0,dT,cT],tt=()=>["","none",v,Ve,ze],dt=()=>["none",Nt,Ve,ze],Ct=()=>["none",Nt,Ve,ze],bt=()=>[Nt,Ve,ze],At=()=>[$i,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xs],breakpoint:[Xs],color:[Qw],container:[Xs],"drop-shadow":[Xs],ease:["in","out","in-out"],font:[PH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xs],shadow:[Xs],spacing:["px",Nt],text:[Xs],"text-shadow":[Xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$i,ze,Ve,C]}],container:["container"],columns:[{columns:[Nt,ze,Ve,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ce()}],"inset-x":[{"inset-x":ce()}],"inset-y":[{"inset-y":ce()}],start:[{"inset-s":ce(),start:ce()}],end:[{"inset-e":ce(),end:ce()}],"inset-bs":[{"inset-bs":ce()}],"inset-be":[{"inset-be":ce()}],top:[{top:ce()}],right:[{right:ce()}],bottom:[{bottom:ce()}],left:[{left:ce()}],visibility:["visible","invisible","collapse"],z:[{z:[Vi,"auto",Ve,ze]}],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:[Nt,$i,"auto","initial","none",ze]}],grow:[{grow:["",Nt,Ve,ze]}],shrink:[{shrink:["",Nt,Ve,ze]}],order:[{order:[Vi,"first","last","none",Ve,ze]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:he()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:he()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Te()}],"auto-rows":[{"auto-rows":Te()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],w:[{w:[c,"screen",...F()]}],"min-w":[{"min-w":[c,"screen","none",...F()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,dc,Dl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,GH,UH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$0,ze]}],"font-family":[{font:[FH,HH,t]}],"font-features":[{"font-features":[ze]}],"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,Ve,ze]}],"line-clamp":[{"line-clamp":[Nt,"none",Ve,uT]}],leading:[{leading:[l,...G()]}],"list-image":[{"list-image":["none",Ve,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Nt,"from-font","auto",Ve,Dl]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Nt,"auto",Ve,ze]}],"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",Ve,ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vi,Ve,ze],radial:["",Ve,ze],conic:[Vi,Ve,ze]},VH,zH]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:we()}],"gradient-via-pos":[{via:we()}],"gradient-to-pos":[{to:we()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],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:Se()}],"border-w-x":[{"border-x":Se()}],"border-w-y":[{"border-y":Se()}],"border-w-s":[{"border-s":Se()}],"border-w-e":[{"border-e":Se()}],"border-w-bs":[{"border-bs":Se()}],"border-w-be":[{"border-be":Se()}],"border-w-t":[{"border-t":Se()}],"border-w-r":[{"border-r":Se()}],"border-w-b":[{"border-b":Se()}],"border-w-l":[{"border-l":Se()}],"divide-x":[{"divide-x":Se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Nt,Ve,ze]}],"outline-w":[{outline:["",Nt,dc,Dl]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",p,Af,Nf]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",g,Af,Nf]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Nt,Dl]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",y,Af,Nf]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Nt,Ve,ze]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Fe()}],"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":[Nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":De()}],"mask-image-linear-to-pos":[{"mask-linear-to":De()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":De()}],"mask-image-t-to-pos":[{"mask-t-to":De()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":De()}],"mask-image-r-to-pos":[{"mask-r-to":De()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":De()}],"mask-image-b-to-pos":[{"mask-b-to":De()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":De()}],"mask-image-l-to-pos":[{"mask-l-to":De()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":De()}],"mask-image-x-to-pos":[{"mask-x-to":De()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":De()}],"mask-image-y-to-pos":[{"mask-y-to":De()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[Ve,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":De()}],"mask-image-radial-to-pos":[{"mask-radial-to":De()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":De()}],"mask-image-conic-to-pos":[{"mask-conic-to":De()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,ze]}],filter:[{filter:["","none",Ve,ze]}],blur:[{blur:tt()}],brightness:[{brightness:[Nt,Ve,ze]}],contrast:[{contrast:[Nt,Ve,ze]}],"drop-shadow":[{"drop-shadow":["","none",E,Af,Nf]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Nt,Ve,ze]}],"hue-rotate":[{"hue-rotate":[Nt,Ve,ze]}],invert:[{invert:["",Nt,Ve,ze]}],saturate:[{saturate:[Nt,Ve,ze]}],sepia:[{sepia:["",Nt,Ve,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,ze]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[Nt,Ve,ze]}],"backdrop-contrast":[{"backdrop-contrast":[Nt,Ve,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Nt,Ve,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nt,Ve,ze]}],"backdrop-invert":[{"backdrop-invert":["",Nt,Ve,ze]}],"backdrop-opacity":[{"backdrop-opacity":[Nt,Ve,ze]}],"backdrop-saturate":[{"backdrop-saturate":[Nt,Ve,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",Nt,Ve,ze]}],"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",Ve,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Nt,"initial",Ve,ze]}],ease:[{ease:["linear","initial",S,Ve,ze]}],delay:[{delay:[Nt,Ve,ze]}],animate:[{animate:["none",N,Ve,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ve,ze]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:dt()}],"rotate-x":[{"rotate-x":dt()}],"rotate-y":[{"rotate-y":dt()}],"rotate-z":[{"rotate-z":dt()}],scale:[{scale:Ct()}],"scale-x":[{"scale-x":Ct()}],"scale-y":[{"scale-y":Ct()}],"scale-z":[{"scale-z":Ct()}],"scale-3d":["scale-3d"],skew:[{skew:bt()}],"skew-x":[{"skew-x":bt()}],"skew-y":[{"skew-y":bt()}],transform:[{transform:[Ve,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:At()}],"translate-x":[{"translate-x":At()}],"translate-y":[{"translate-y":At()}],"translate-z":[{"translate-z":At()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve,ze]}],"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",Ve,ze]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Nt,dc,Dl,uT]}],stroke:[{stroke:["none",...R()]}],"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"]}},rC=CH(YH),WH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XH={};function fT(e,t){return(XH.jsx?QH:WH).test(e)}var Po={},V0,hT;function KH(){if(hT)return V0;hT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
281
|
+
`,m="/",p="*",g="",y="comment",E="declaration";function v(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var N=1,A=1;function z(me){var ne=me.match(t);ne&&(N+=ne.length);var H=me.lastIndexOf(d);A=~H?me.length-H:A+me.length}function Y(){var me={line:N,column:A};return function(ne){return ne.position=new M(me),ce(),ne}}function M(me){this.start=me,this.end={line:N,column:A},this.source=S.source}M.prototype.content=C;function B(me){var ne=new Error(S.source+":"+N+":"+A+": "+me);if(ne.reason=me,ne.filename=S.source,ne.line=N,ne.column=A,ne.source=C,!S.silent)throw ne}function G(me){var ne=me.exec(C);if(ne){var H=ne[0];return z(H),C=C.slice(H.length),ne}}function ce(){G(n)}function Q(me){var ne;for(me=me||[];ne=he();)ne!==!1&&me.push(ne);return me}function he(){var me=Y();if(!(m!=C.charAt(0)||p!=C.charAt(1))){for(var ne=2;g!=C.charAt(ne)&&(p!=C.charAt(ne)||m!=C.charAt(ne+1));)++ne;if(ne+=2,g===C.charAt(ne-1))return B("End of comment missing");var H=C.slice(2,ne-2);return A+=2,z(H),C=C.slice(ne),A+=2,me({type:y,comment:H})}}function V(){var me=Y(),ne=G(r);if(ne){if(he(),!G(i))return B("property missing ':'");var H=G(l),F=me({type:E,property:w(ne[0].replace(e,g)),value:H?w(H[0].replace(e,g)):g});return G(o),F}}function Te(){var me=[];Q(me);for(var ne;ne=V();)ne!==!1&&(me.push(ne),Q(me));return me}return ce(),Te()}function w(C){return C?C.replace(c,g):g}return V0=v,V0}var mT;function ZH(){if(mT)return Po;mT=1;var e=Po&&Po.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Po,"__esModule",{value:!0}),Po.default=n;const t=e(KH());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(d=>{if(d.type!=="declaration")return;const{property:m,value:p}=d;c?i(m,p,d):p&&(l=l||{},l[m]=p)}),l}return Po}var fc={},pT;function JH(){if(pT)return fc;pT=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},o=function(m,p){return p.toUpperCase()},c=function(m,p){return"".concat(p,"-")},d=function(m,p){return p===void 0&&(p={}),l(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(i,c):m=m.replace(r,c),m.replace(t,o))};return fc.camelCase=d,fc}var hc,gT;function ez(){if(gT)return hc;gT=1;var e=hc&&hc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ZH()),n=JH();function r(i,l){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,l)]=d)}),o}return r.default=r,hc=r,hc}var tz=ez();const nz=Sh(tz);function Ic(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bT(e.position):"start"in e||"end"in e?bT(e):"line"in e||"column"in e?$g(e):""}function $g(e){return xT(e&&e.line)+":"+xT(e&&e.column)}function bT(e){return $g(e&&e.start)+"-"+$g(e&&e.end)}function xT(e){return e&&typeof e=="number"?e:1}class Ar 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 d=r.indexOf(":");d===-1?l.ruleId=r:(l.source=r.slice(0,d),l.ruleId=r.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.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=Ic(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}}Ar.prototype.file="";Ar.prototype.name="";Ar.prototype.reason="";Ar.prototype.message="";Ar.prototype.stack="";Ar.prototype.column=void 0;Ar.prototype.line=void 0;Ar.prototype.ancestors=void 0;Ar.prototype.cause=void 0;Ar.prototype.fatal=void 0;Ar.prototype.place=void 0;Ar.prototype.ruleId=void 0;Ar.prototype.source=void 0;const ib={}.hasOwnProperty,rz=new Map,az=/[A-Z]/g,sz=new Set(["table","tbody","thead","tfoot","tr"]),iz=new Set(["td","th"]),aC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lz(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=pz(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=mz(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"?ys:lu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=sC(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function sC(e,t,n){if(t.type==="element")return oz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return dz(e,t,n);if(t.type==="mdxjsEsm")return cz(e,t);if(t.type==="root")return fz(e,t,n);if(t.type==="text")return hz(e,t)}function oz(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ys,e.schema=i),e.ancestors.push(t);const l=lC(e,t.tagName,!1),o=gz(e,t);let c=ob(e,t);return sz.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Lh(d):!0})),iC(e,o,l,t),lb(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function uz(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)}Vc(e,t.position)}function cz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vc(e,t.position)}function dz(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ys,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:lC(e,t.name,!0),o=bz(e,t),c=ob(e,t);return iC(e,o,l,t),lb(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function fz(e,t,n){const r={};return lb(r,ob(e,t)),e.create(t,e.Fragment,r,n)}function hz(e,t){return t.value}function iC(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function lb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mz(e,t,n){return r;function r(i,l,o,c){const m=Array.isArray(o.children)?n:t;return c?m(l,o,c):m(l,o)}}function pz(e,t){return n;function n(r,i,l,o){const c=Array.isArray(l.children),d=Es(r);return t(i,l,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function gz(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ib.call(t.properties,i)){const l=xz(e,i,t.properties[i]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&iz.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 bz(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 Vc(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 Vc(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function ob(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:rz;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const m=i.get(d)||0;o=d+"-"+m,i.set(d,m+1)}}const c=sC(e,l,o);c!==void 0&&n.push(c)}return n}function xz(e,t,n){const r=Xc(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?v1(n):k1(n)),r.property==="style"){let i=typeof n=="object"?n:yz(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ez(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?vR[r.property]||r.property:r.attribute,n]}}function yz(e,t){try{return nz(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ar("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=aC+"#cannot-parse-style-attribute",i}}function lC(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=fT(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=fT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ib.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vc(e)}function Vc(e,t){const n=new Ar("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=aC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ez(e){const t={};let n;for(n in e)ib.call(e,n)&&(t[_z(n)]=e[n]);return t}function _z(e){let t=e.replace(az,Tz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Tz(e){return"-"+e.toLowerCase()}const G0={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"]},vz={tokenize:kz};function kz(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 d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return lt(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const wz={tokenize:Cz},yT={tokenize:Sz};function Cz(e){const t=this,n=[];let r=0,i,l,o;return c;function c(A){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,d,m)(A)}return m(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&N();const z=t.events.length;let Y=z,M;for(;Y--;)if(t.events[Y][0]==="exit"&&t.events[Y][1].type==="chunkFlow"){M=t.events[Y][1].end;break}S(r);let B=z;for(;B<t.events.length;)t.events[B][1].end={...M},B++;return ca(t.events,Y+1,0,t.events.slice(z)),t.events.length=B,m(A)}return c(A)}function m(A){if(r===n.length){if(!i)return y(A);if(i.currentConstruct&&i.currentConstruct.concrete)return v(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(yT,p,g)(A)}function p(A){return i&&N(),S(r),y(A)}function g(A){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(A)}function y(A){return t.containerState={},e.attempt(yT,E,v)(A)}function E(A){return r++,n.push([t.currentConstruct,t.containerState]),y(A)}function v(A){if(A===null){i&&N(),S(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),w(A)}function w(A){if(A===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(A);return}return lt(A)?(e.consume(A),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(A),w)}function C(A,z){const Y=t.sliceStream(A);if(z&&Y.push(null),A.previous=l,l&&(l.next=A),l=A,i.defineSkip(A.start),i.write(Y),t.parser.lazy[A.start.line]){let M=i.events.length;for(;M--;)if(i.events[M][1].start.offset<o&&(!i.events[M][1].end||i.events[M][1].end.offset>o))return;const B=t.events.length;let G=B,ce,Q;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(ce){Q=t.events[G][1].end;break}ce=!0}for(S(r),M=B;M<t.events.length;)t.events[M][1].end={...Q},M++;ca(t.events,G+1,0,t.events.slice(B)),t.events.length=M}}function S(A){let z=n.length;for(;z-- >A;){const Y=n[z];t.containerState=Y[1],Y[0].exit.call(t,e)}n.length=A}function N(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Sz(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 Nz={tokenize:Az};function Az(e){const t=this,n=e.attempt(td,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(IP,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 Rz={resolveAll:uC()},Lz=oC("string"),Iz=oC("text");function oC(e){return{resolveAll:uC(e==="text"?Oz: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 m(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return m(p)?(n.exit("data"),l(p)):(n.consume(p),d)}function m(p){if(p===null)return!0;const g=i[p];let y=-1;if(g)for(;++y<g.length;){const E=g[y];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function uC(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 Oz(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,d;for(;l--;){const m=i[l];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(m===-2)d=!0,c++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const m={type:n===e.length||d||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={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const Dz={42:Yr,43:Yr,45:Yr,48:Yr,49:Yr,50:Yr,51:Yr,52:Yr,53:Yr,54:Yr,55:Yr,56:Yr,57:Yr,62:ww},jz={91:PP},Mz={[-2]:H0,[-1]:H0,32:H0},Pz={35:$P,42:Zf,45:[J_,Zf],60:YP,61:J_,95:Zf,96:K_,126:K_},Bz={38:Sw,92:Cw},Uz={[-5]:z0,[-4]:z0,[-3]:z0,33:dB,38:Sw,42:zg,60:[hP,eB],91:hB,92:[zP,Cw],93:tb,95:zg,96:CP},Hz={null:[zg,Rz]},zz={null:[42,95]},Fz={null:[]},$z=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:zz,contentInitial:jz,disable:Fz,document:Dz,flow:Pz,flowInitial:Mz,insideSpan:Hz,string:Bz,text:Uz},Symbol.toStringTag,{value:"Module"}));function Vz(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 d={attempt:B(Y),check:B(M),consume:N,enter:A,exit:z,interrupt:B(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:w,events:[],now:v,parser:e,previous:null,sliceSerialize:y,sliceStream:E,write:g};let p=t.tokenize.call(m,d);return t.resolveAll&&l.push(t),m;function g(he){return o=Oa(o,he),C(),o[o.length-1]!==null?[]:(G(t,0),m.events=Qh(l,m.events,m),m.events)}function y(he,V){return qz(E(he),V)}function E(he){return Gz(o,he)}function v(){const{_bufferIndex:he,_index:V,line:Te,column:me,offset:ne}=r;return{_bufferIndex:he,_index:V,line:Te,column:me,offset:ne}}function w(he){i[he.line]=he.column,Q()}function C(){let he;for(;r._index<o.length;){const V=o[r._index];if(typeof V=="string")for(he=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===he&&r._bufferIndex<V.length;)S(V.charCodeAt(r._bufferIndex));else S(V)}}function S(he){p=p(he)}function N(he){lt(he)?(r.line++,r.column=1,r.offset+=he===-3?2:1,Q()):he!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=he}function A(he,V){const Te=V||{};return Te.type=he,Te.start=v(),m.events.push(["enter",Te,m]),c.push(Te),Te}function z(he){const V=c.pop();return V.end=v(),m.events.push(["exit",V,m]),V}function Y(he,V){G(he,V.from)}function M(he,V){V.restore()}function B(he,V){return Te;function Te(me,ne,H){let F,K,oe,R;return Array.isArray(me)?te(me):"tokenize"in me?te([me]):U(me);function U(Se){return Ge;function Ge(Fe){const De=Fe!==null&&Se[Fe],tt=Fe!==null&&Se.null,dt=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return te(dt)(Fe)}}function te(Se){return F=Se,K=0,Se.length===0?H:O(Se[K])}function O(Se){return Ge;function Ge(Fe){return R=ce(),oe=Se,Se.partial||(m.currentConstruct=Se),Se.name&&m.parser.constructs.disable.null.includes(Se.name)?Re():Se.tokenize.call(V?Object.assign(Object.create(m),V):m,d,we,Re)(Fe)}}function we(Se){return he(oe,R),ne}function Re(Se){return R.restore(),++K<F.length?O(F[K]):H}}}function G(he,V){he.resolveAll&&!l.includes(he)&&l.push(he),he.resolve&&ca(m.events,V,m.events.length-V,he.resolve(m.events.slice(V),m)),he.resolveTo&&(m.events=he.resolveTo(m.events,m))}function ce(){const he=v(),V=m.previous,Te=m.currentConstruct,me=m.events.length,ne=Array.from(c);return{from:me,restore:H};function H(){r=he,m.previous=V,m.currentConstruct=Te,m.events.length=me,c=ne,Q()}}function Q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Gz(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 qz(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 Yz(e){const r={constructs:gw([$z,...(e||{}).extensions||[]]),content:i(vz),defined:[],document:i(wz),flow:i(Nz),lazy:{},string:i(Lz),text:i(Iz)};return r;function i(l){return o;function o(c){return Vz(r,l,c)}}}function Wz(e){for(;!Nw(e););return e}const ET=/[\0\t\n\r]/g;function Qz(){let e=1,t="",n=!0,r;return i;function i(l,o,c){const d=[];let m,p,g,y,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(ET.lastIndex=g,m=ET.exec(l),y=m&&m.index!==void 0?m.index:l.length,E=l.charCodeAt(y),!m){t=l.slice(g);break}if(E===10&&g===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<y&&(d.push(l.slice(g,y)),e+=y-g),E){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const cC={}.hasOwnProperty;function Xz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Kz(n)(Wz(Yz(n).document().write(Qz()(e,t,!0))))}function Kz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(qe),autolinkProtocol:ce,autolinkEmail:ce,atxHeading:l(Tt),blockQuote:l(tt),characterEscape:ce,characterReference:ce,codeFenced:l(dt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(dt,o),codeText:l(Ct,o),codeTextData:ce,data:ce,codeFlowValue:ce,definition:l(bt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(At),hardBreakEscape:l(ot),hardBreakTrailing:l(ot),htmlFlow:l(St,o),htmlFlowData:ce,htmlText:l(St,o),htmlTextData:ce,image:l(Me),label:o,link:l(qe),listItem:l(mn),listItemValue:y,listOrdered:l(zt,g),listUnordered:l(zt),paragraph:l(Xt),reference:O,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Tt),strong:l(yn),thematicBreak:l(lr)},exit:{atxHeading:d(),atxHeadingSequence:Y,autolink:d(),autolinkEmail:De,autolinkProtocol:Fe,blockQuote:d(),characterEscapeValue:Q,characterReferenceMarkerHexadecimal:Re,characterReferenceMarkerNumeric:Re,characterReferenceValue:Se,characterReference:Ge,codeFenced:d(C),codeFencedFence:w,codeFencedFenceInfo:E,codeFencedFenceMeta:v,codeFlowValue:Q,codeIndented:d(S),codeText:d(ne),codeTextData:Q,data:Q,definition:d(),definitionDestinationString:z,definitionLabelString:N,definitionTitleString:A,emphasis:d(),hardBreakEscape:d(V),hardBreakTrailing:d(V),htmlFlow:d(Te),htmlFlowData:Q,htmlText:d(me),htmlTextData:Q,image:d(F),label:oe,labelText:K,lineEnding:he,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:we,resourceDestinationString:R,resourceTitleString:U,resource:te,setextHeading:d(G),setextHeadingLineSequence:B,setextHeadingText:M,strong:d(),thematicBreak:d()}};dC(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ge){let ve={type:"root",children:[]};const Ye={stack:[ve],tokenStack:[],config:t,enter:c,exit:m,buffer:o,resume:p,data:n},rt=[];let vt=-1;for(;++vt<ge.length;)if(ge[vt][1].type==="listOrdered"||ge[vt][1].type==="listUnordered")if(ge[vt][0]==="enter")rt.push(vt);else{const En=rt.pop();vt=i(ge,En,vt)}for(vt=-1;++vt<ge.length;){const En=t[ge[vt][0]];cC.call(En,ge[vt][1].type)&&En[ge[vt][1].type].call(Object.assign({sliceSerialize:ge[vt][2].sliceSerialize},Ye),ge[vt][1])}if(Ye.tokenStack.length>0){const En=Ye.tokenStack[Ye.tokenStack.length-1];(En[1]||_T).call(Ye,void 0,En[0])}for(ve.position={start:Gi(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:Gi(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},vt=-1;++vt<t.transforms.length;)ve=t.transforms[vt](ve)||ve;return ve}function i(ge,ve,Ye){let rt=ve-1,vt=-1,En=!1,kn,xe,Oe,Ke;for(;++rt<=Ye;){const Pe=ge[rt];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pe[0]==="enter"?vt++:vt--,Ke=void 0;break}case"lineEndingBlank":{Pe[0]==="enter"&&(kn&&!Ke&&!vt&&!Oe&&(Oe=rt),Ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ke=void 0}if(!vt&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||vt===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(kn){let it=rt;for(xe=void 0;it--;){const X=ge[it];if(X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="exit")continue;xe&&(ge[xe][1].type="lineEndingBlank",En=!0),X[1].type="lineEnding",xe=it}else if(!(X[1].type==="linePrefix"||X[1].type==="blockQuotePrefix"||X[1].type==="blockQuotePrefixWhitespace"||X[1].type==="blockQuoteMarker"||X[1].type==="listItemIndent"))break}Oe&&(!xe||Oe<xe)&&(kn._spread=!0),kn.end=Object.assign({},xe?ge[xe][1].start:Pe[1].end),ge.splice(xe||rt,0,["exit",kn,Pe[2]]),rt++,Ye++}if(Pe[1].type==="listItemPrefix"){const it={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};kn=it,ge.splice(rt,0,["enter",it,Pe[2]]),rt++,Ye++,Oe=void 0,Ke=!0}}}return ge[ve][1]._spread=En,Ye}function l(ge,ve){return Ye;function Ye(rt){c.call(this,ge(rt),rt),ve&&ve.call(this,rt)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(ge,ve,Ye){this.stack[this.stack.length-1].children.push(ge),this.stack.push(ge),this.tokenStack.push([ve,Ye||void 0]),ge.position={start:Gi(ve.start),end:void 0}}function d(ge){return ve;function ve(Ye){ge&&ge.call(this,Ye),m.call(this,Ye)}}function m(ge,ve){const Ye=this.stack.pop(),rt=this.tokenStack.pop();if(rt)rt[0].type!==ge.type&&(ve?ve.call(this,ge,rt[0]):(rt[1]||_T).call(this,ge,rt[0]));else throw new Error("Cannot close `"+ge.type+"` ("+Ic({start:ge.start,end:ge.end})+"): it’s not open");Ye.position.end=Gi(ge.end)}function p(){return K1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(ge){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ge),10),this.data.expectingFirstListItemValue=void 0}}function E(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ge}function v(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ge}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ge.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ge.replace(/(\r?\n|\r)$/g,"")}function N(ge){const ve=this.resume(),Ye=this.stack[this.stack.length-1];Ye.label=ve,Ye.identifier=Ka(this.sliceSerialize(ge)).toLowerCase()}function A(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ge}function z(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ge}function Y(ge){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Ye=this.sliceSerialize(ge).length;ve.depth=Ye}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function B(ge){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ge).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function ce(ge){const Ye=this.stack[this.stack.length-1].children;let rt=Ye[Ye.length-1];(!rt||rt.type!=="text")&&(rt=nt(),rt.position={start:Gi(ge.start),end:void 0},Ye.push(rt)),this.stack.push(rt)}function Q(ge){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ge),ve.position.end=Gi(ge.end)}function he(ge){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ye=ve.children[ve.children.length-1];Ye.position.end=Gi(ge.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(ce.call(this,ge),Q.call(this,ge))}function V(){this.data.atHardBreak=!0}function Te(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ge}function me(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ge}function ne(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ge}function H(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=ve,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function F(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=ve,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function K(ge){const ve=this.sliceSerialize(ge),Ye=this.stack[this.stack.length-2];Ye.label=P7(ve),Ye.identifier=Ka(ve).toLowerCase()}function oe(){const ge=this.stack[this.stack.length-1],ve=this.resume(),Ye=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ye.type==="link"){const rt=ge.children;Ye.children=rt}else Ye.alt=ve}function R(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ge}function U(){const ge=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ge}function te(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function we(ge){const ve=this.resume(),Ye=this.stack[this.stack.length-1];Ye.label=ve,Ye.identifier=Ka(this.sliceSerialize(ge)).toLowerCase(),this.data.referenceType="full"}function Re(ge){this.data.characterReferenceType=ge.type}function Se(ge){const ve=this.sliceSerialize(ge),Ye=this.data.characterReferenceType;let rt;Ye?(rt=pw(ve,Ye==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):rt=J1(ve);const vt=this.stack[this.stack.length-1];vt.value+=rt}function Ge(ge){const ve=this.stack.pop();ve.position.end=Gi(ge.end)}function Fe(ge){Q.call(this,ge);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ge)}function De(ge){Q.call(this,ge);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ge)}function tt(){return{type:"blockquote",children:[]}}function dt(){return{type:"code",lang:null,meta:null,value:""}}function Ct(){return{type:"inlineCode",value:""}}function bt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function At(){return{type:"emphasis",children:[]}}function Tt(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function St(){return{type:"html",value:""}}function Me(){return{type:"image",title:null,url:"",alt:null}}function qe(){return{type:"link",title:null,url:"",children:[]}}function zt(ge){return{type:"list",ordered:ge.type==="listOrdered",start:null,spread:ge._spread,children:[]}}function mn(ge){return{type:"listItem",spread:ge._spread,checked:null,children:[]}}function Xt(){return{type:"paragraph",children:[]}}function yn(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function lr(){return{type:"thematicBreak"}}}function Gi(e){return{line:e.line,column:e.column,offset:e.offset}}function dC(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?dC(e,r):Zz(e,r)}}function Zz(e,t){let n;for(n in t)if(cC.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 _T(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ic({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ic({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ic({start:t.start,end:t.end})+") is still open")}function Jz(e){const t=this;t.parser=n;function n(r){return Xz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function eF(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 tF(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
284
|
+
`}]}function nF(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 rF(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aF(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=mu(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 d={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,d);const m={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,m),e.applyData(t,m)}function iF(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 lF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fC(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 oF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fC(e,t);const i={src:mu(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 uF(e,t){const n={src:mu(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 cF(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 dF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fC(e,t);const i={href:mu(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 fF(e,t){const n={href:mu(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 hF(e,t,n){const r=e.all(t),i=n?mF(n):hC(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 d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
287
|
+
`});const m={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,m),e.applyData(t,m)}function mF(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=hC(n[r])}return t}function hC(e){const t=e.spread;return t??e.children.length>1}function pF(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 gF(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bF(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xF(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yF(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=Es(t.children[1]),d=Yh(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),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 EF(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 d=-1;const m=[];for(;++d<c;){const g=t.children[d],y={},E=o?o[d]:void 0;E&&(y.align=E);let v={type:"element",tagName:l,properties:y,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),m.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function _F(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const TT=9,vT=32;function TF(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(kT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(kT(t.slice(i),i>0,!1)),l.join("")}function kT(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===TT||l===vT;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===TT||l===vT;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function vF(e,t){const n={type:"text",value:TF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function kF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const wF={blockquote:eF,break:tF,code:nF,delete:rF,emphasis:aF,footnoteReference:sF,heading:iF,html:lF,imageReference:oF,image:uF,inlineCode:cF,linkReference:dF,link:fF,listItem:hF,list:pF,paragraph:gF,root:bF,strong:xF,table:yF,tableCell:_F,tableRow:EF,text:vF,thematicBreak:kF,toml:Rf,yaml:Rf,definition:Rf,footnoteDefinition:Rf};function Rf(){}function CF(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 SF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function NF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||CF,r=e.options.footnoteBackLabel||SF,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[d]);if(!m)continue;const p=e.all(m),g=String(m.identifier).toUpperCase(),y=mu(g.toLowerCase());let E=0;const v=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++E<=w;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(d,E);typeof N=="string"&&(N={type:"text",value:N}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,E),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const N=C.children[C.children.length-1];N&&N.type==="text"?N.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else p.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(m,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Gl(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 Vg={}.hasOwnProperty,AF={};function RF(e,t){const n=t||AF,r=new Map,i=new Map,l=new Map,o={...wF,...n.handlers},c={all:m,applyData:IF,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:d,options:n,patch:LF,wrap:DF};return bs(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),c;function d(p,g){const y=p.type,E=c.handlers[y];if(Vg.call(c.handlers,y)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:w,...C}=p,S=Gl(C);return S.children=c.all(p),S}return Gl(p)}return(c.options.unknownHandler||OF)(c,p,g)}function m(p){const g=[];if("children"in p){const y=p.children;let E=-1;for(;++E<y.length;){const v=c.one(y[E],p);if(v){if(E&&y[E-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=wT(v.value)),!Array.isArray(v)&&v.type==="element")){const w=v.children[0];w&&w.type==="text"&&(w.value=wT(w.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function LF(e,t){e.position&&(t.position=V3(e))}function IF(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,Gl(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function OF(e,t){const n=t.data||{},r="value"in t&&!(Vg.call(n,"hProperties")||Vg.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 DF(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 wT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function CT(e,t){const n=RF(e,t),r=n.one(e,void 0),i=NF(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 jF(e,t){return e&&"run"in e?async function(n,r){const i=CT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return CT(n,{file:r,...e||t})}}function ST(e){if(e)throw e}var q0,NT;function MF(){if(NT)return q0;NT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!g)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},o=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},c=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(r)return r(m,p).value}else return;return m[p]};return q0=function d(){var m,p,g,y,E,v,w=arguments[0],C=1,S=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<S;++C)if(m=arguments[C],m!=null)for(p in m)g=c(w,p),y=c(m,p),w!==y&&(N&&y&&(l(y)||(E=i(y)))?(E?(E=!1,v=g&&i(g)?g:[]):v=g&&l(g)?g:{},o(w,{name:p,newValue:d(N,v,y)})):typeof y<"u"&&o(w,{name:p,newValue:y}));return w},q0}var PF=MF();const Y0=Sh(PF);function Gg(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 BF(){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(d,...m){const p=e[++l];let g=-1;if(d){o(d);return}for(;++g<i.length;)(m[g]===null||m[g]===void 0)&&(m[g]=i[g]);i=m,p?UF(p,c)(...m):o(null,...m)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function UF(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}catch(m){const p=m;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(l,i):d instanceof Error?i(d):l(d))}function i(o,...c){n||(n=!0,t(o,...c))}function l(o){i(null,o)}}const ms={basename:HF,dirname:zF,extname:FF,join:$F,sep:"/"};function HF(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nd(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 zF(e){if(nd(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 FF(e){nd(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 $F(...e){let t=-1,n;for(;++t<e.length;)nd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":VF(n)}function VF(e){nd(e);const t=e.codePointAt(0)===47;let n=GF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function GF(e,t){let n="",r=0,i=-1,l=0,o=-1,c,d;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(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),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 nd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qF={cwd:YF};function YF(){return"/"}function qg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function WF(e){if(typeof e=="string")e=new URL(e);else if(!qg(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 QF(e)}function QF(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 W0=["history","path","basename","stem","extname","dirname"];class XF{constructor(t){let n;t?qg(t)?n={path:t}:typeof t=="string"||KF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":qF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<W0.length;){const l=W0[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)W0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ms.basename(this.path):void 0}set basename(t){X0(t,"basename"),Q0(t,"basename"),this.path=ms.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ms.dirname(this.path):void 0}set dirname(t){AT(this.basename,"dirname"),this.path=ms.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ms.extname(this.path):void 0}set extname(t){if(Q0(t,"extname"),AT(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=ms.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){qg(t)&&(t=WF(t)),X0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ms.basename(this.path,this.extname):void 0}set stem(t){X0(t,"stem"),Q0(t,"stem"),this.path=ms.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 Ar(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 Q0(e,t){if(e&&e.includes(ms.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ms.sep+"`")}function X0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function AT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZF=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),JF={}.hasOwnProperty;class ub extends ZF{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=BF()}copy(){const t=new ub;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Y0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(J0("data",this.frozen),this.namespace[t]=n,this):JF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(J0("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=Lf(t),r=this.parser||this.Parser;return K0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),K0("process",this.parser||this.Parser),Z0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){const c=Lf(t),d=r.parse(c);r.run(d,c,function(p,g,y){if(p||!g||!y)return m(p);const E=g,v=r.stringify(E,y);n$(v)?y.value=v:y.result=v,m(p,y)});function m(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),K0("processSync",this.parser||this.Parser),Z0("processSync",this.compiler||this.Compiler),this.process(t,i),LT("processSync","process",n),r;function i(l,o){n=!0,ST(l),r=o}}run(t,n,r){RT(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 d=Lf(n);i.run(t,d,m);function m(p,g,y){const E=g||t;p?c(p):o?o(E):r(void 0,E,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),LT("runSync","run",r),i;function l(o,c){ST(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=Lf(n),i=this.compiler||this.Compiler;return Z0("stringify",i),RT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(J0("use",this.frozen),t!=null)if(typeof t=="function")d(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(m){if(typeof m=="function")d(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[p,...g]=m;d(p,g)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(m.plugins),m.settings&&(i.settings=Y0(!0,i.settings,m.settings))}function c(m){let p=-1;if(m!=null)if(Array.isArray(m))for(;++p<m.length;){const g=m[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function d(m,p){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===m){y=g;break}if(y===-1)r.push([m,...p]);else if(p.length>0){let[E,...v]=p;const w=r[y][1];Gg(w)&&Gg(E)&&(E=Y0(!0,w,E)),r[y]=[m,E,...v]}}}}const e$=new ub().freeze();function K0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Z0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function J0(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 RT(e){if(!Gg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function LT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lf(e){return t$(e)?e:new XF(e)}function t$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function n$(e){return typeof e=="string"||r$(e)}function r$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function cb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Jl=cb();function mC(e){Jl=e}var Pl={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(Mr.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var a$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Mr={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)}}>`)},s$=/^(?:[ \t]*(?:\n|$))+/,i$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,l$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,rd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,o$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,db=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gC=qt(pC).replace(/bull/g,db).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(),u$=qt(pC).replace(/bull/g,db).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(),fb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,c$=/^[^\n]+/,hb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,d$=qt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),f$=qt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,db).getRegex(),Kh="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",mb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,h$=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",mb).replace("tag",Kh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bC=qt(fb).replace("hr",rd).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",Kh).getRegex(),m$=qt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bC).getRegex(),pb={blockquote:m$,code:i$,def:d$,fences:l$,heading:o$,hr:rd,html:h$,lheading:gC,list:f$,newline:s$,paragraph:bC,table:Pl,text:c$},IT=qt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",rd).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",Kh).getRegex(),p$={...pb,lheading:u$,table:IT,paragraph:qt(fb).replace("hr",rd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",IT).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",Kh).getRegex()},g$={...pb,html:qt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mb).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:Pl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:qt(fb).replace("hr",rd).replace("heading",` *#{1,6} *[^
|
|
294
|
+
]`).replace("lheading",gC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},b$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,x$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xC=/^( {2,}|\\)\n(?!\s*$)/,y$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pu=/[\p{P}\p{S}]/u,Zh=/[\s\p{P}\p{S}]/u,gb=/[^\s\p{P}\p{S}]/u,E$=qt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zh).getRegex(),yC=/(?!~)[\p{P}\p{S}]/u,_$=/(?!~)[\s\p{P}\p{S}]/u,T$=/(?:[^\s\p{P}\p{S}]|~)/u,v$=qt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",a$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),EC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,k$=qt(EC,"u").replace(/punct/g,pu).getRegex(),w$=qt(EC,"u").replace(/punct/g,yC).getRegex(),_C="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",C$=qt(_C,"gu").replace(/notPunctSpace/g,gb).replace(/punctSpace/g,Zh).replace(/punct/g,pu).getRegex(),S$=qt(_C,"gu").replace(/notPunctSpace/g,T$).replace(/punctSpace/g,_$).replace(/punct/g,yC).getRegex(),N$=qt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gb).replace(/punctSpace/g,Zh).replace(/punct/g,pu).getRegex(),A$=qt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,pu).getRegex(),R$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",L$=qt(R$,"gu").replace(/notPunctSpace/g,gb).replace(/punctSpace/g,Zh).replace(/punct/g,pu).getRegex(),I$=qt(/\\(punct)/,"gu").replace(/punct/g,pu).getRegex(),O$=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(),D$=qt(mb).replace("(?:-->|$)","-->").getRegex(),j$=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",D$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_h=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,M$=qt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",_h).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),TC=qt(/^!?\[(label)\]\[(ref)\]/).replace("label",_h).replace("ref",hb).getRegex(),vC=qt(/^!?\[(ref)\](?:\[\])?/).replace("ref",hb).getRegex(),P$=qt("reflink|nolink(?!\\()","g").replace("reflink",TC).replace("nolink",vC).getRegex(),OT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bb={_backpedal:Pl,anyPunctuation:I$,autolink:O$,blockSkip:v$,br:xC,code:x$,del:Pl,delLDelim:Pl,delRDelim:Pl,emStrongLDelim:k$,emStrongRDelimAst:C$,emStrongRDelimUnd:N$,escape:b$,link:M$,nolink:vC,punctuation:E$,reflink:TC,reflinkSearch:P$,tag:j$,text:y$,url:Pl},B$={...bb,link:qt(/^!?\[(label)\]\((.*?)\)/).replace("label",_h).getRegex(),reflink:qt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_h).getRegex()},Yg={...bb,emStrongRDelimAst:S$,emStrongLDelim:w$,delLDelim:A$,delRDelim:L$,url:qt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",OT).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",OT).getRegex()},U$={...Yg,br:qt(xC).replace("{2,}","*").getRegex(),text:qt(Yg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},If={normal:pb,gfm:p$,pedantic:g$},mc={normal:bb,gfm:Yg,breaks:U$,pedantic:B$},H$={"&":"&","<":"<",">":">",'"':""","'":"'"},DT=e=>H$[e];function hs(e,t){if(t){if(Mr.escapeTest.test(e))return e.replace(Mr.escapeReplace,DT)}else if(Mr.escapeTestNoEncode.test(e))return e.replace(Mr.escapeReplaceNoEncode,DT);return e}function jT(e){try{e=encodeURI(e).replace(Mr.percentDecode,"%")}catch{return null}return e}function MT(e,t){var l;let n=e.replace(Mr.findPipe,(o,c,d)=>{let m=!1,p=c;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),r=n.split(Mr.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(Mr.slashPipe,"|");return r}function pc(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 z$(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 F$(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 PT(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 d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:o,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function $$(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 Th=class{constructor(e){ue(this,"options");ue(this,"rules");ue(this,"lexer");this.options=e||Jl}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:pc(n,`
|
|
297
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=$$(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=pc(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:pc(t[0],`
|
|
298
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=pc(t[0],`
|
|
299
|
+
`).split(`
|
|
300
|
+
`),r="",i="",l=[];for(;n.length>0;){let o=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),o=!0;else if(!o)c.push(n[d]);else break;n=n.slice(d);let m=c.join(`
|
|
301
|
+
`),p=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
302
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
303
|
+
${m}`:m,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 y=l.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let E=y,v=E.raw+`
|
|
305
|
+
`+n.join(`
|
|
306
|
+
`),w=this.blockquote(v);l[l.length-1]=w,r=r.substring(0,r.length-E.raw.length)+w.raw,i=i.substring(0,i.length-E.text.length)+w.text;break}else if((y==null?void 0:y.type)==="list"){let E=y,v=E.raw+`
|
|
307
|
+
`+n.join(`
|
|
308
|
+
`),w=this.list(v);l[l.length-1]=w,r=r.substring(0,r.length-y.raw.length)+w.raw,i=i.substring(0,i.length-E.raw.length)+w.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),d=!1;for(;e;){let p=!1,g="",y="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let E=F$(t[2].split(`
|
|
310
|
+
`,1)[0],t[1].length),v=e.split(`
|
|
311
|
+
`,1)[0],w=!E.trim(),C=0;if(this.options.pedantic?(C=2,y=E.trimStart()):w?C=t[1].length+1:(C=E.search(this.rules.other.nonSpaceChar),C=C>4?1:C,y=E.slice(C),C+=t[1].length),w&&this.rules.other.blankLine.test(v)&&(g+=v+`
|
|
312
|
+
`,e=e.substring(v.length+1),p=!0),!p){let S=this.rules.other.nextBulletRegex(C),N=this.rules.other.hrRegex(C),A=this.rules.other.fencesBeginRegex(C),z=this.rules.other.headingBeginRegex(C),Y=this.rules.other.htmlBeginRegex(C),M=this.rules.other.blockquoteBeginRegex(C);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," "),A.test(v)||z.test(v)||Y.test(v)||M.test(v)||S.test(v)||N.test(v))break;if(G.search(this.rules.other.nonSpaceChar)>=C||!v.trim())y+=`
|
|
314
|
+
`+G.slice(C);else{if(w||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(E)||z.test(E)||N.test(E))break;y+=`
|
|
315
|
+
`+v}w=!v.trim(),g+=B+`
|
|
316
|
+
`,e=e.substring(B.length+1),E=G.slice(C)}}o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(d=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=g}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.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 y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(p.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};p.checked=y.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=y.raw+p.tokens[0].raw,p.tokens[0].text=y.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(y)):p.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):p.tokens.unshift(y)}}if(!o.loose){let g=p.tokens.filter(E=>E.type==="space"),y=g.length>0&&g.some(E=>this.rules.other.anyLine.test(E.raw));o.loose=y}}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=MT(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(MT(c,l.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:l.align[m]})));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=pc(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=z$(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)),PT(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 PT(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,d=0,m=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+i);(r=m.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)){d+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+d);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 y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}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,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.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 m=[...r[0]][0].length,p=e.slice(0,i+r.index+m+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}}}},Da=class Wg{constructor(t){ue(this,"tokens");ue(this,"options");ue(this,"state");ue(this,"inlineQueue");ue(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jl,this.options.tokenizer=this.options.tokenizer||new Th,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:Mr,block:If.normal,inline:mc.normal};this.options.pedantic?(n.block=If.pedantic,n.inline=mc.pedantic):this.options.gfm&&(n.block=If.gfm,this.options.breaks?n.inline=mc.breaks:n.inline=mc.gfm),this.tokenizer.rules=n}static get rules(){return{block:If,inline:mc}}static lex(t,n){return new Wg(n).lex(t)}static lexInline(t,n){return new Wg(n).inlineTokens(t)}lex(t){t=t.replace(Mr.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(Mr.tabCharGlobal," ").replace(Mr.spaceLine,""));t;){let c;if((l=(i=this.options.extensions)==null?void 0:i.block)!=null&&l.some(m=>(c=m.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 m=n.at(-1);c.raw.length===1&&m!==void 0?m.raw+=`
|
|
320
|
+
`:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
321
|
+
`)?"":`
|
|
322
|
+
`)+c.raw,m.text+=`
|
|
323
|
+
`+c.text,this.inlineQueue.at(-1).src=m.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 m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
324
|
+
`)?"":`
|
|
325
|
+
`)+c.raw,m.text+=`
|
|
326
|
+
`+c.raw,this.inlineQueue.at(-1).src=m.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 d=t;if((o=this.options.extensions)!=null&&o.startBlock){let m=1/0,p=t.slice(1),g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},p),typeof g=="number"&&g>=0&&(m=Math.min(m,g))}),m<1/0&&m>=0&&(d=t.substring(0,m+1))}if(this.state.top&&(c=this.tokenizer.paragraph(d))){let m=n.at(-1);r&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
327
|
+
`)?"":`
|
|
328
|
+
`)+c.raw,m.text+=`
|
|
329
|
+
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c),r=d.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
330
|
+
`)?"":`
|
|
331
|
+
`)+c.raw,m.text+=`
|
|
332
|
+
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var d,m,p,g,y;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=((m=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:m.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(w=>(E=w.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 w=n.at(-1);E.type==="text"&&(w==null?void 0:w.type)==="text"?(w.raw+=E.raw,w.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((y=this.options.extensions)!=null&&y.startInline){let w=1/0,C=t.slice(1),S;this.options.extensions.startInline.forEach(N=>{S=N.call({lexer:this},C),typeof S=="number"&&S>=0&&(w=Math.min(w,S))}),w<1/0&&w>=0&&(v=t.substring(0,w+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 w=n.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=E.raw,w.text+=E.text):n.push(E);continue}if(t){let w="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(w);break}else throw new Error(w)}}return n}},vh=class{constructor(t){ue(this,"options");ue(this,"parser");this.options=t||Jl}space(t){return""}code({text:t,lang:n,escaped:r}){var o;let i=(o=(n||"").match(Mr.notSpaceStart))==null?void 0:o[0],l=t.replace(Mr.endingNewline,"")+`
|
|
333
|
+
`;return i?'<pre><code class="language-'+hs(i)+'">'+(r?l:hs(l,!0))+`</code></pre>
|
|
334
|
+
`:"<pre><code>"+(r?l:hs(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 d=t.items[c];i+=this.listitem(d)}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>${hs(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=jT(t);if(l===null)return i;t=l;let o='<a href="'+t+'"';return n&&(o+=' title="'+hs(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=jT(t);if(l===null)return hs(r);t=l;let o=`<img src="${t}" alt="${hs(r)}"`;return n&&(o+=` title="${hs(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:hs(t.text)}},xb=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}},Wa=class Qg{constructor(t){ue(this,"options");ue(this,"renderer");ue(this,"textRenderer");this.options=t||Jl,this.options.renderer=this.options.renderer||new vh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xb}static parse(t,n){return new Qg(n).parse(t)}static parseInline(t,n){return new Qg(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 d=o,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";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 d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}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 m=this.options.extensions.renderers[c.type].call({parser:this},c);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=m||"";continue}}let d=c;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}},Ff,Ec=(Ff=class{constructor(e){ue(this,"options");ue(this,"block");this.options=e||Jl}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Da.lex:Da.lexInline}provideParser(e=this.block){return e?Wa.parse:Wa.parseInline}},ue(Ff,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ue(Ff,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ff),V$=class{constructor(...t){ue(this,"defaults",cb());ue(this,"options",this.setOptions);ue(this,"parse",this.parseMarkdown(!0));ue(this,"parseInline",this.parseMarkdown(!1));ue(this,"Parser",Wa);ue(this,"Renderer",vh);ue(this,"TextRenderer",xb);ue(this,"Lexer",Da);ue(this,"Tokenizer",Th);ue(this,"Hooks",Ec);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 d of c.header)r=r.concat(this.walkTokens(d.tokens,n));for(let d of c.rows)for(let m of d)r=r.concat(this.walkTokens(m.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(d=>{let m=c[d].flat(1/0);r=r.concat(this.walkTokens(m,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 d=l.renderer.apply(this,c);return d===!1&&(d=o.apply(this,c)),d}: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 vh(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,d=r.renderer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g||""}}i.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new Th(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,d=r.tokenizer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}i.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new Ec;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,d=r.hooks[c],m=l[c];Ec.passThroughHooks.has(o)?l[c]=p=>{if(this.defaults.async&&Ec.passThroughHooksRespectAsync.has(o))return(async()=>{let y=await d.call(l,p);return m.call(l,y)})();let g=d.call(l,p);return m.call(l,g)}:l[c]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await d.apply(l,p);return y===!1&&(y=await m.apply(l,p)),y})();let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}i.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(c){let d=[];return d.push(o.call(this,c)),l&&(d=d.concat(l.call(this,c))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Da.lex(t,n??this.defaults)}parser(t,n){return Wa.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,d=await(l.hooks?await l.hooks.provideLexer(t):t?Da.lex:Da.lexInline)(c,l),m=l.hooks?await l.hooks.processAllTokens(d):d;l.walkTokens&&await Promise.all(this.walkTokens(m,l.walkTokens));let p=await(l.hooks?await l.hooks.provideParser(t):t?Wa.parse:Wa.parseInline)(m,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?Da.lex:Da.lexInline)(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let d=(l.hooks?l.hooks.provideParser(t):t?Wa.parse:Wa.parseInline)(c,l);return l.hooks&&(d=l.hooks.postprocess(d)),d}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>"+hs(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Yl=new V$;function hn(e,t){return Yl.parse(e,t)}hn.options=hn.setOptions=function(e){return Yl.setOptions(e),hn.defaults=Yl.defaults,mC(hn.defaults),hn};hn.getDefaults=cb;hn.defaults=Jl;hn.use=function(...e){return Yl.use(...e),hn.defaults=Yl.defaults,mC(hn.defaults),hn};hn.walkTokens=function(e,t){return Yl.walkTokens(e,t)};hn.parseInline=Yl.parseInline;hn.Parser=Wa;hn.parser=Wa.parse;hn.Renderer=vh;hn.TextRenderer=xb;hn.Lexer=Da;hn.lexer=Da.lex;hn.Tokenizer=Th;hn.Hooks=Ec;hn.parse=hn;hn.options;hn.setOptions;hn.use;hn.walkTokens;hn.parseInline;Wa.parse;Da.lex;var G$=300,q$="300px",Y$=500;function W$(e={}){let{immediate:t=!1,debounceDelay:n=G$,rootMargin:r=q$,idleTimeout:i=Y$}=e,[l,o]=T.useState(!1),c=T.useRef(null),d=T.useRef(null),m=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]),y=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;d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null)},w=A=>{m.current=g(z=>{z.timeRemaining()>0||z.didTimeout?(o(!0),A.disconnect()):m.current=g(()=>{o(!0),A.disconnect()},{timeout:i/2})},{timeout:i})},C=A=>{v(),d.current=window.setTimeout(()=>{var z,Y;let M=A.takeRecords();(M.length===0||(Y=(z=M.at(-1))==null?void 0:z.isIntersecting)!=null&&Y)&&w(A)},n)},S=(A,z)=>{A.isIntersecting?C(z):v()},N=new IntersectionObserver(A=>{for(let z of A)S(z,N)},{rootMargin:r,threshold:0});return N.observe(E),()=>{d.current&&clearTimeout(d.current),m.current&&y(m.current),N.disconnect()}},[t,n,r,i,y,g]),{shouldRender:l,containerRef:c}}var kC=/\s/,Q$=/^\s+$/,X$=new Set(["code","pre","svg","math","annotation"]),K$=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Z$=e=>e.some(t=>K$(t)&&X$.has(t.tagName)),J$=e=>{let t=[],n="",r=!1;for(let i of e){let l=kC.test(i);l!==r&&n&&(t.push(n),n=""),n+=i,r=l}return n&&t.push(n),t},eV=e=>{let t=[],n="";for(let r of e)kC.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},tV=(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}]}},nV=(e,t,n,r,i)=>{let l=t.at(-1);if(!(l&&"children"in l))return;if(Z$(t))return qo;let o=l,c=o.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){i.count+=d.length;return}let m=n.sep==="char"?eV(d):J$(d),p=r.prevContentLength,g=m.map(y=>{let E=i.count;if(i.count+=y.length,Q$.test(y))return{type:"text",value:y};let v=p>0&&E<p,w=v?0:i.newIndex++*n.stagger;return tV(y,n.animation,n.duration,n.easing,v,w)});return o.children.splice(c,1,...g),c+g.length},rV=0;function Xg(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},d=rV++,m=()=>p=>{let g={count:0,newIndex:0};U1(p,"text",(y,E)=>nV(y,E,o,c,g)),c.lastRenderCharCount=g.count,c.prevContentLength=0};return Object.defineProperty(m,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:m,setPrevContentLength(p){c.prevContentLength=p},getLastRenderCharCount(){let p=c.lastRenderCharCount;return c.lastRenderCharCount=0,p}}}Xg();var wC=T.createContext(!1),aV=()=>T.useContext(wC),yb=(...e)=>rC(Fw(e)),sV=(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(" ")},iV=e=>e?(...t)=>sV(e,rC(Fw(t))):yb,Xo=(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)},Kg=T.createContext(yb),Lt=()=>T.useContext(Kg),lV=yb("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"),oV=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},uV=T.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:l=!0,...o})=>{let c=Lt(),d=T.useMemo(()=>c(lV),[c]),m=T.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,oV(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return f.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:f.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:m,children:f.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)=>f.jsx("span",{className:l?d:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
|
|
352
|
+
`:p.map((y,E)=>{let v={},w=!!y.bgColor;if(y.color&&(v["--sdm-c"]=y.color),y.bgColor&&(v["--sdm-tbg"]=y.bgColor),y.htmlStyle)for(let[C,S]of Object.entries(y.htmlStyle))C==="color"?v["--sdm-c"]=S:C==="background-color"?(v["--sdm-tbg"]=S,w=!0):v[C]=S;return f.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",w&&"bg-[var(--sdm-tbg)]",w&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...y.htmlAttrs,children:y.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),cV=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let l=Lt();return f.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})},CC=T.createContext({code:""}),SC=()=>T.useContext(CC),dV=({language:e})=>{let t=Lt();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},fV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
353
|
+
`;)t--;return e.slice(0,t)},hV=T.lazy(()=>D(()=>import("./highlighted-body-OFNGDK62-0cYcfOfd.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),mV=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:l,lineNumbers:o,...c})=>{let d=Lt(),m=T.useMemo(()=>fV(e),[e]),p=T.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:m.split(`
|
|
354
|
+
`).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[m]);return f.jsx(CC.Provider,{value:{code:e},children:f.jsxs(cV,{isIncomplete:i,language:t,children:[f.jsx(dV,{language:t}),r?f.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsx("div",{className:d("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,f.jsx(T.Suspense,{fallback:f.jsx(uV,{className:n,language:t,lineNumbers:o,result:p,startLine:l,...c}),children:f.jsx(hV,{className:n,code:m,language:t,lineNumbers:o,raw:p,startLine:l,...c})})]})})},pV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),gV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),bV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),xV=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),yV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),EV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),_V=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),TV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),vV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),kV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),_c={CheckIcon:pV,CopyIcon:gV,DownloadIcon:bV,ExternalLinkIcon:TV,Loader2Icon:xV,Maximize2Icon:yV,RotateCcwIcon:EV,XIcon:_V,ZoomInIcon:vV,ZoomOutIcon:kV},NC=T.createContext(_c),wV=(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])},BT=({icons:e,children:t})=>{let n=T.useRef(e),r=T.useRef(e?{..._c,...e}:_c);wV(n.current,e)||(n.current=e,r.current=e?{..._c,...e}:_c);let i=r.current;return f.jsx(NC.Provider,{value:i,children:t})},es=()=>T.useContext(NC),AC={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"},Zg=T.createContext(AC),si=()=>T.useContext(Zg),UT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:l,...o})=>{let c=Lt(),[d,m]=T.useState(!1),p=T.useRef(0),{code:g}=SC(),{isAnimating:y}=T.useContext(da),E=si(),v=l??g,w=async()=>{var N;if(typeof window>"u"||!((N=navigator==null?void 0:navigator.clipboard)!=null&&N.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),m(!0),e==null||e(),p.current=window.setTimeout(()=>m(!1),n))}catch(A){t==null||t(A)}};T.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let C=es(),S=d?C.CheckIcon:C.CopyIcon;return f.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:y,onClick:w,title:E.copyCode,type:"button",...o,children:r??f.jsx(S,{size:14})})},HT={"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"},CV=({onDownload:e,onError:t,language:n,children:r,className:i,code:l,...o})=>{let c=Lt(),{code:d}=SC(),{isAnimating:m}=T.useContext(da),p=si(),g=es(),y=l??d,E=`file.${n&&n in HT?HT[n]:"txt"}`,v="text/plain",w=()=>{try{Xo(E,y,v),e==null||e()}catch(C){t==null||t(C)}};return f.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:m,onClick:w,title:p.downloadFile,type:"button",...o,children:r??f.jsx(g.DownloadIcon,{size:14})})},zT=()=>{let{Loader2Icon:e}=es(),t=Lt();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},SV=/\.[^/.]+$/,NV=({node:e,className:t,src:n,alt:r,onLoad:i,onError:l,...o})=>{let{DownloadIcon:c}=es(),d=Lt(),m=T.useRef(null),[p,g]=T.useState(!1),[y,E]=T.useState(!1),v=si(),w=o.width!=null||o.height!=null,C=(p||w)&&!y,S=y&&!w;T.useEffect(()=>{let Y=m.current;if(Y!=null&&Y.complete){let M=Y.naturalWidth>0;g(M),E(!M)}},[]);let N=T.useCallback(Y=>{g(!0),E(!1),i==null||i(Y)},[i]),A=T.useCallback(Y=>{g(!1),E(!0),l==null||l(Y)},[l]),z=async()=>{if(n)try{let Y=await(await fetch(n)).blob(),M=new URL(n,window.location.origin).pathname.split("/").pop()||"",B=M.split(".").pop(),G=M.includes(".")&&B!==void 0&&B.length<=4,ce="";if(G)ce=M;else{let Q=Y.type,he="png";Q.includes("jpeg")||Q.includes("jpg")?he="jpg":Q.includes("png")?he="png":Q.includes("svg")?he="svg":Q.includes("gif")?he="gif":Q.includes("webp")&&(he="webp"),ce=`${(r||M||"image").replace(SV,"")}.${he}`}Xo(ce,Y,Y.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:N,ref:m,src:n,...o}),S&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),C&&f.jsx("button",{className:d("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:z,title:v.downloadImage,type:"button",children:f.jsx(c,{size:14})})]}):null},Oc=0,Eb=()=>{Oc+=1,Oc===1&&(document.body.style.overflow="hidden")},_b=()=>{Oc=Math.max(0,Oc-1),Oc===0&&(document.body.style.overflow="")},AV=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:l,ExternalLinkIcon:o,XIcon:c}=es(),d=Lt(),[m,p]=T.useState(!1),g=si(),y=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){Eb();let v=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),_b()}}},[t,n]),t?f.jsx("div",{className:d("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:f.jsxs("div",{className:d("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:[f.jsx("button",{className:d("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:f.jsx(c,{size:16})}),f.jsxs("div",{className:d("flex flex-col gap-2"),children:[f.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(o,{size:20}),f.jsx("span",{children:g.openExternalLink})]}),f.jsx("p",{className:d("text-muted-foreground text-sm"),children:g.externalLinkWarning})]}),f.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:d("flex gap-2"),children:[f.jsx("button",{className:d("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:y,type:"button",children:m?f.jsxs(f.Fragment,{children:[f.jsx(i,{size:14}),f.jsx("span",{children:g.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(l,{size:14}),f.jsx("span",{children:g.copyLink})]})}),f.jsxs("button",{className:d("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:[f.jsx(o,{size:14}),f.jsx("span",{children:g.openLink})]})]})]})}):null},Jg=T.createContext(null),Tb=()=>T.useContext(Jg),EY=()=>{var e;let t=Tb();return(e=t==null?void 0:t.code)!=null?e:null},vb=()=>{var e;let t=Tb();return(e=t==null?void 0:t.mermaid)!=null?e:null},RV=e=>{var t;let n=Tb();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},LV=(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 d=document.createElement("canvas"),m=c.width*r,p=c.height*r;d.width=m,d.height=p;let g=d.getContext("2d");if(!g){l(new Error("Failed to create 2D canvas context for PNG export"));return}g.drawImage(c,0,0,m,p),d.toBlob(y=>{if(!y){l(new Error("Failed to create PNG blob"));return}i(y)},"image/png")},c.onerror=()=>l(new Error("Failed to load SVG image")),c.src=o})},IV=({chart:e,children:t,className:n,onDownload:r,config:i,onError:l})=>{let o=Lt(),[c,d]=T.useState(!1),m=T.useRef(null),{isAnimating:p}=T.useContext(da),g=es(),y=vb(),E=si(),v=async w=>{try{if(w==="mmd"){Xo("diagram.mmd",e,"text/plain"),d(!1),r==null||r(w);return}if(!y){l==null||l(new Error("Mermaid plugin not available"));return}let C=y.getMermaid(i),S=e.split("").reduce((z,Y)=>(z<<5)-z+Y.charCodeAt(0)|0,0),N=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await C.render(N,e);if(!A){l==null||l(new Error("SVG not found. Please wait for the diagram to render."));return}if(w==="svg"){Xo("diagram.svg",A,"image/svg+xml"),d(!1),r==null||r(w);return}if(w==="png"){let z=await LV(A);Xo("diagram.png",z,"image/png"),r==null||r(w),d(!1);return}}catch(C){l==null||l(C)}};return T.useEffect(()=>{let w=C=>{let S=C.composedPath();m.current&&!S.includes(m.current)&&d(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),f.jsxs("div",{className:o("relative"),ref:m,children:[f.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:()=>d(!c),title:E.downloadDiagram,type:"button",children:t??f.jsx(g.DownloadIcon,{size:14})}),c?f.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:[f.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}),f.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}),f.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]})},OV=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...l})=>{let{Maximize2Icon:o,XIcon:c}=es(),d=Lt(),[m,p]=T.useState(!1),{isAnimating:g,controls:y}=T.useContext(da),E=si(),v=(()=>{if(typeof y=="boolean")return y;let C=y.mermaid;return C===!1?!1:C===!0||C===void 0?!0:C.panZoom!==!1})(),w=()=>{p(!m)};return T.useEffect(()=>{if(m){Eb();let C=S=>{S.key==="Escape"&&p(!1)};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),_b()}}},[m]),T.useEffect(()=>{m?n==null||n():r&&r()},[m,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:g,onClick:w,title:E.viewFullscreen,type:"button",...l,children:f.jsx(o,{size:14})}),m?su.createPortal(f.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:w,onKeyDown:C=>{C.key==="Escape"&&w()},role:"button",tabIndex:0,children:[f.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:E.exitFullscreen,type:"button",children:f.jsx(c,{size:20})}),f.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:f.jsx(dS,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},RC=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 d=[],m=c.querySelectorAll("td");for(let p of m)d.push(((n=p.textContent)==null?void 0:n.trim())||"");i.push(d)}return{headers:r,rows:i}},LC=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,m=!1;for(let p of c){if(p==='"'){d=!0,m=!0;break}(p===","||p===`
|
|
355
|
+
`)&&(d=!0)}return d?m?`"${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
|
+
`)},DV=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let p of c)if(p===" "||p===`
|
|
357
|
+
`||p==="\r"){d=!0;break}if(!d)return c;let m=[];for(let p of c)p===" "?m.push("\\t"):p===`
|
|
358
|
+
`?m.push("\\n"):p==="\r"?m.push("\\r"):m.push(p);return m.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
|
+
`)},eg=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("")},e1=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=>eg(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 d=new Array(t.length);for(let m=0;m<t.length;m+=1)d[m]=m<c.length?eg(c[m]):"";r[i]=`| ${d.join(" | ")} |`,i+=1}else{let d=c.map(m=>eg(m));r[i]=`| ${d.join(" | ")} |`,i+=1}return r.join(`
|
|
360
|
+
`)},IC=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let l=Lt(),[o,c]=T.useState(!1),[d,m]=T.useState(!1),p=T.useRef(null),g=T.useRef(0),{isAnimating:y}=T.useContext(da),E=si(),v=async S=>{var N,A;if(typeof window>"u"||!((N=navigator==null?void 0:navigator.clipboard)!=null&&N.write)){r==null||r(new Error("Clipboard API not available"));return}try{let z=(A=p.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),Y=z==null?void 0:z.querySelector("table");if(!Y){r==null||r(new Error("Table not found"));return}let M=RC(Y),B=({csv:LC,tsv:DV,md:e1}[S]||e1)(M),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]),m(!0),c(!1),n==null||n(S),g.current=window.setTimeout(()=>m(!1),i)}catch(z){r==null||r(z)}};T.useEffect(()=>{let S=N=>{let A=N.composedPath();p.current&&!A.includes(p.current)&&c(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(g.current)}},[]);let w=es(),C=d?w.CheckIcon:w.CopyIcon;return f.jsxs("div",{className:l("relative"),ref:p,children:[f.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:y,onClick:()=>c(!o),title:E.copyTable,type:"button",children:e??f.jsx(C,{height:14,width:14})}),o?f.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:[f.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}),f.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}),f.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]})},OC=({children:e,className:t,onDownload:n,onError:r})=>{let i=Lt(),[l,o]=T.useState(!1),c=T.useRef(null),{isAnimating:d}=T.useContext(da),m=si(),p=es(),g=y=>{var E;try{let v=(E=c.current)==null?void 0:E.closest('[data-streamdown="table-wrapper"]'),w=v==null?void 0:v.querySelector("table");if(!w){r==null||r(new Error("Table not found"));return}let C=RC(w),S=y==="csv"?LC(C):e1(C);Xo(`table.${y==="csv"?"csv":"md"}`,S,y==="csv"?"text/csv":"text/markdown"),o(!1),n==null||n(y)}catch(v){r==null||r(v)}};return T.useEffect(()=>{let y=E=>{let v=E.composedPath();c.current&&!v.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),f.jsxs("div",{className:i("relative"),ref:c,children:[f.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:d,onClick:()=>o(!l),title:m.downloadTable,type:"button",children:e??f.jsx(p.DownloadIcon,{size:14})}),l?f.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:[f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("csv"),title:m.downloadTableAsCsv,type:"button",children:m.tableFormatCsv}),f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("markdown"),title:m.downloadTableAsMarkdown,type:"button",children:m.tableFormatMarkdown})]}):null]})},jV=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:l}=es(),o=Lt(),[c,d]=T.useState(!1),{isAnimating:m}=T.useContext(da),p=si(),g=()=>{d(!0)},y=()=>{d(!1)};return T.useEffect(()=>{if(c){Eb();let E=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),_b()}}},[c]),f.jsxs(f.Fragment,{children:[f.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:m,onClick:g,title:p.viewFullscreen,type:"button",children:f.jsx(i,{size:14})}),c?su.createPortal(f.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:y,onKeyDown:E=>{E.key==="Escape"&&y()},role:"dialog",children:f.jsxs("div",{className:o("flex h-full flex-col"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(IC,{}):null,r?f.jsx(OC,{}):null,f.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:y,title:p.exitFullscreen,type:"button",children:f.jsx(l,{size:20})})]}),f.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},MV=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:l=!0,...o})=>{let c=Lt(),d=n&&r,m=n&&i,p=n&&l,g=d||m||p;return f.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?f.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?f.jsx(IC,{}):null,m?f.jsx(OC,{}):null,p?f.jsx(jV,{showCopy:d,showDownload:m,children:e}):null]}):null,f.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},PV=/startLine=(\d+)/,BV=/\bnoLineNumbers\b/,UV=T.lazy(()=>D(()=>Promise.resolve().then(()=>hY),void 0).then(e=>({default:e.Mermaid}))),HV=/language-([^\s]+)/;function Jh(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 jn(e,t){return e.className===t.className&&Jh(e.node,t.node)}var t1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,tg=(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},FT=(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},Of=(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},kb=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>jn(e,t));kb.displayName="MarkdownOl";var DC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Jh(e.node,t.node));DC.displayName="MarkdownLi";var jC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>jn(e,t));jC.displayName="MarkdownUl";var MC=T.memo(({className:e,node:t,...n})=>{let r=Lt();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>jn(e,t));MC.displayName="MarkdownHr";var PC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>jn(e,t));PC.displayName="MarkdownStrong";var zV=({children:e,className:t,href:n,node:r,...i})=>{let l=Lt(),{linkSafety:o}=T.useContext(da),[c,d]=T.useState(!1),m=n==="streamdown:incomplete-link",p=T.useCallback(async v=>{if(!(!(o!=null&&o.enabled&&n)||m)){if(v.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[o,n,m]),g=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),y=T.useCallback(()=>{d(!1)},[]),E={url:n??"",isOpen:c,onClose:y,onConfirm:g};return o!=null&&o.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:l("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",onClick:p,type:"button",children:e}),o.renderModal?o.renderModal(E):f.jsx(AV,{...E})]}):f.jsx("a",{className:l("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},BC=T.memo(zV,(e,t)=>jn(e,t)&&e.href===t.href);BC.displayName="MarkdownA";var UC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>jn(e,t));UC.displayName="MarkdownH1";var HC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>jn(e,t));HC.displayName="MarkdownH2";var zC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>jn(e,t));zC.displayName="MarkdownH3";var FC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>jn(e,t));FC.displayName="MarkdownH4";var $C=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>jn(e,t));$C.displayName="MarkdownH5";var VC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>jn(e,t));VC.displayName="MarkdownH6";var GC=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(da),l=t1(i,"table"),o=tg(i,"copy"),c=tg(i,"download"),d=tg(i,"fullscreen");return f.jsx(MV,{className:t,showControls:l,showCopy:o,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>jn(e,t));GC.displayName="MarkdownTable";var qC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>jn(e,t));qC.displayName="MarkdownThead";var YC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>jn(e,t));YC.displayName="MarkdownTbody";var WC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>jn(e,t));WC.displayName="MarkdownTr";var QC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.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)=>jn(e,t));QC.displayName="MarkdownTh";var XC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>jn(e,t));XC.displayName="MarkdownTd";var KC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.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)=>jn(e,t));KC.displayName="MarkdownBlockquote";var ZC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>jn(e,t));ZC.displayName="MarkdownSup";var JC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Lt();return f.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>jn(e,t));JC.displayName="MarkdownSub";var eS=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var c,d;if(!T.isValidElement(o))return!1;let m=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,g=!1;for(let y of m)if(y){if(typeof y=="string")y.trim()!==""&&(p=!0);else if(T.isValidElement(y))if(((c=y.props)==null?void 0:c["data-footnote-backref"])!==void 0)g=!0;else{let E=Array.isArray(y.props.children)?y.props.children:[y.props.children];for(let v of E){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((d=v.props)==null?void 0:d["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===kb){let c=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(d=>!i(d));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)?f.jsx("section",{className:t,...r,children:l}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>jn(e,t));eS.displayName="MarkdownSection";var FV=({node:e,className:t,children:n,...r})=>{var i,l;let o=Lt(),c=!("data-block"in r),{mermaid:d,controls:m,lineNumbers:p}=T.useContext(da),g=vb(),y=aV(),E=t==null?void 0:t.match(HV),v=(i=E==null?void 0:E.at(1))!=null?i:"",w=RV(v);if(c)return f.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 C=(l=e==null?void 0:e.properties)==null?void 0:l.metastring,S=C==null?void 0:C.match(PV),N=S?Number.parseInt(S[1],10):void 0,A=N!==void 0&&N>=1?N:void 0,z=!(C&&BV.test(C))&&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),w){let ce=w.component;return f.jsx(T.Suspense,{fallback:f.jsx(zT,{}),children:f.jsx(ce,{code:Y,isIncomplete:y,language:v,meta:C})})}if(v==="mermaid"&&g){let ce=t1(m,"mermaid"),Q=Of(m,"download"),he=Of(m,"copy"),V=Of(m,"fullscreen"),Te=Of(m,"panZoom"),me=ce&&(Q||he||V);return f.jsx(T.Suspense,{fallback:f.jsx(zT,{}),children:f.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:[f.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),me?f.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.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?f.jsx(IV,{chart:Y,config:d==null?void 0:d.config}):null,he?f.jsx(UT,{code:Y}):null,V?f.jsx(OV,{chart:Y,config:d==null?void 0:d.config}):null]})}):null,f.jsx("div",{className:o("rounded-md border border-border bg-background"),children:f.jsx(UV,{chart:Y,config:d==null?void 0:d.config,showControls:Te})})]})})}let M=t1(m,"code"),B=FT(m,"download"),G=FT(m,"copy");return f.jsx(mV,{className:t,code:Y,isIncomplete:y,language:v,lineNumbers:z,startLine:A,children:M?f.jsxs(f.Fragment,{children:[B?f.jsx(CV,{code:Y,language:v}):null,G?f.jsx(UT,{}):null]}):null})},tS=T.memo(FV,(e,t)=>e.className===t.className&&Jh(e.node,t.node));tS.displayName="MarkdownCode";var nS=T.memo(NV,(e,t)=>e.className===t.className&&Jh(e.node,t.node));nS.displayName="MarkdownImg";var rS=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 f.jsx(f.Fragment,{children:e});if(l==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>jn(e,t));rS.displayName="MarkdownParagraph";var $V={ol:kb,li:DC,ul:jC,hr:MC,strong:PC,a:BC,h1:UC,h2:HC,h3:zC,h4:FC,h5:$C,h6:VC,table:GC,thead:qC,tbody:YC,tr:WC,th:QC,td:XC,blockquote:KC,code:tS,img:nS,pre:({children:e})=>T.isValidElement(e)?T.cloneElement(e,{"data-block":"true"}):e,sup:ZC,sub:JC,p:rS,section:eS},VV=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,GV=new RegExp("\\p{L}","u");function $T(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(VV.test(n))return"rtl";if(GV.test(n))return"ltr"}return"ltr"}var qV=/^[ \t]{0,3}(`{3,}|~{3,})/,YV=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,VT=e=>{let t=e.split(`
|
|
361
|
+
`),n=null,r=0;for(let i of t){let l=qV.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],d=o.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},WV=e=>{let t=e.split(`
|
|
362
|
+
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&YV.test(r))return!0}return!1},QV=()=>e=>{bs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},GT=[],qT={allowDangerousHtml:!0},Df=new WeakMap,XV=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 y=0;y<p.length;y+=1){let E=p[y];if(y>0&&(g+=","),Array.isArray(E)){let[v,w]=E;if(typeof v=="function"){let C=Df.get(v);C||(C=v.name,Df.set(v,C)),g+=C}else g+=String(v);g+=":",g+=JSON.stringify(w)}else if(typeof E=="function"){let v=Df.get(E);v||(v=E.name,Df.set(E,v)),g+=v}else g+=String(E)}return g},o=l(n),c=l(r),d=i?JSON.stringify(i):"",m=`${c}::${o}::${d}`;return this.keyCache.set(e,m),m}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()}},YT=new XV,aS=e=>{let t=KV(e),n=e.children||"",r=t.runSync(t.parse(n),n);return aG(r,e)},KV=e=>{let t=YT.get(e);if(t)return t;let n=JV(e);return YT.set(e,n),n},ZV=e=>e.some(t=>Array.isArray(t)?t[0]===Bg:t===Bg),JV=e=>{let t=e.rehypePlugins||GT,n=e.remarkPlugins||GT,r=ZV(t)?n:[...n,QV],i=e.remarkRehypeOptions?{...qT,...e.remarkRehypeOptions}:qT;return e$().use(Jz).use(r).use(jF,i).use(t)},eG=e=>e,tG=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},nG=(e,t)=>{var n;for(let r in G0)if(Object.hasOwn(G0,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],l=G0[r];(l===null||l.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},rG=(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},aG=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:l,unwrapDisallowed:o,urlTransform:c}=t;if(n||r||i||l||c){let d=c||eG;bs(e,(m,p,g)=>{if(m.type==="raw"&&g&&typeof p=="number")return tG(g,p,l,m.value),p;if(m.type==="element"&&(nG(m,d),rG(m,p,g,r,i,n)&&g&&typeof p=="number"))return o&&m.children?g.children.splice(p,1,...m.children):g.children.splice(p,1),p})}return lz(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},sG=/\[\^[\w-]{1,200}\](?!:)/,iG=/\[\^[\w-]{1,200}\]:/,lG=/<(\w+)[\s>]/,oG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),WT=new Map,QT=new Map,uG=e=>{let t=e.toLowerCase(),n=WT.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return WT.set(t,r),r},cG=e=>{let t=e.toLowerCase(),n=QT.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return QT.set(t,r),r},XT=(e,t)=>{if(oG.has(t.toLowerCase()))return 0;let n=e.match(uG(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},KT=(e,t)=>{let n=e.match(cG(t));return n?n.length:0},dG=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},fG=e=>{let t=sG.test(e),n=iG.test(e);if(t||n)return[e];let r=Da.lex(e,{gfm:!0}),i=[],l=[],o=!1;for(let c of r){let d=c.raw,m=i.length;if(l.length>0){i[m-1]+=d;let p=l.at(-1),g=XT(d,p),y=KT(d,p);for(let E=0;E<g;E+=1)l.push(p);for(let E=0;E<y;E+=1)l.length>0&&l.at(-1)===p&&l.pop();continue}if(c.type==="html"&&c.block){let p=d.match(lG);if(p){let g=p[1],y=XT(d,g),E=KT(d,g);y>E&&l.push(g)}}if(m>0&&!o){let p=i[m-1];if(dG(p)%2===1){i[m-1]=p+d;continue}}i.push(d),c.type!=="space"&&(o=c.type==="code")}return i},hG=(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,d)=>{if(!c.includes(`
|
|
363
|
+
|
|
364
|
+
`))return o+c+d;let m=c.replace(/\n\n/g,`
|
|
365
|
+
<!---->
|
|
366
|
+
`),p=(m.startsWith(`
|
|
367
|
+
`)?"":`
|
|
368
|
+
`)+m+(m.endsWith(`
|
|
369
|
+
`)?"":`
|
|
370
|
+
`);return`${o}${p}${d}
|
|
371
|
+
|
|
372
|
+
`})}return n},mG=/([\\`*_~[\]|])/g,pG=e=>e.replace(mG,"\\$1"),gG=(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,d)=>{let m=pG(c).replace(/\n\n/g," ");return o+m+d})}return n},sS=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(sS).join(""):"",bG=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));bs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=sS(r);r.children=i?[{type:"text",value:i}]:[]}})},xG=()=>e=>{bs(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})})},yG=/^[ \t]*<[\w!/?-]/,EG=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,_G=e=>typeof e!="string"||e.length===0||!yG.test(e)?e:e.replace(EG,"$1"),ZT,JT,ev,tv,Jf={...Ml,protocols:{...Ml.protocols,href:[...(JT=(ZT=Ml.protocols)==null?void 0:ZT.href)!=null?JT:[],"tel"]},attributes:{...Ml.attributes,code:[...(tv=(ev=Ml.attributes)==null?void 0:ev.code)!=null?tv:[],"metastring"]}},n1={raw:Bg,sanitize:[Z3,Jf],harden:[U8,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},iS={gfm:[WB,{}],codeMeta:xG},nv=Object.values(n1),TG=Object.values(iS),vG={block:" ▋",circle:" ●"},lS=["github-light","github-dark"],oS={enabled:!0},kG={shikiTheme:lS,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:oS},da=T.createContext(kG),uS=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 d=typeof e=="string"&&n?_G(e):e,m=f.jsx(aS,{...c,children:d});return f.jsx(wC.Provider,{value:i,children:l?f.jsx("div",{dir:l,style:{display:"contents"},children:m}):m})},(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)});uS.displayName="Block";var cS=T.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:l,rehypePlugins:o=nv,remarkPlugins:c=TG,className:d,shikiTheme:m=lS,mermaid:p,controls:g=!0,isAnimating:y=!1,animated:E,BlockComponent:v=uS,parseMarkdownIntoBlocksFn:w=fG,caret:C,plugins:S,remend:N,linkSafety:A=oS,lineNumbers:z=!0,allowedTags:Y,literalTagContent:M,translations:B,icons:G,prefix:ce,onAnimationStart:Q,onAnimationEnd:he,...V})=>{let Te=T.useId(),[me,ne]=T.useTransition(),H=T.useMemo(()=>iV(ce),[ce]),F=T.useRef(null),K=T.useRef(Q),oe=T.useRef(he);K.current=Q,oe.current=he,T.useEffect(()=>{var Me,qe,zt;if(t==="static")return;let mn=F.current;if(F.current=y,mn===null){y&&((Me=K.current)==null||Me.call(K));return}y&&!mn?(qe=K.current)==null||qe.call(K):!y&&mn&&((zt=oe.current)==null||zt.call(oe))},[y,t]);let R=T.useMemo(()=>Y?Object.keys(Y):[],[Y]),U=T.useMemo(()=>{if(typeof e!="string")return"";let Me=t==="streaming"&&r?sH(e,N):e;return M&&M.length>0&&(Me=gG(Me,M)),R.length>0&&(Me=hG(Me,R)),Me},[e,t,r,N,R,M]),te=T.useMemo(()=>w(U),[U,w]),[O,we]=T.useState(te);T.useEffect(()=>{t==="streaming"&&!De?ne(()=>{we(te)}):we(te)},[te,t]);let Re=t==="streaming"?O:te,Se=T.useMemo(()=>n==="auto"?Re.map($T):void 0,[Re,n]),Ge=T.useMemo(()=>Re.map((Me,qe)=>`${Te}-${qe}`),[Re.length,Te]),Fe=T.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),De=T.useMemo(()=>Fe?Fe==="true"?Xg():Xg(E):null,[Fe]),tt=T.useMemo(()=>{var Me,qe;return{shikiTheme:(qe=(Me=S==null?void 0:S.code)==null?void 0:Me.getThemes())!=null?qe:m,controls:g,isAnimating:y,lineNumbers:z,mode:t,mermaid:p,linkSafety:A}},[m,g,y,z,t,p,A,S==null?void 0:S.code]),dt=T.useMemo(()=>B?JSON.stringify(B):"",[B]),Ct=T.useMemo(()=>({...AC,...B}),[dt]),bt=T.useMemo(()=>{let{inlineCode:Me,...qe}=l??{},zt={...$V,...qe};if(Me){let mn=zt.code;zt.code=Xt=>"data-block"in Xt?mn?T.createElement(mn,Xt):null:T.createElement(Me,Xt)}return zt},[l]),At=T.useMemo(()=>{let Me=[];return S!=null&&S.cjk&&(Me=[...Me,...S.cjk.remarkPluginsBefore]),Me=[...Me,...c],S!=null&&S.cjk&&(Me=[...Me,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(Me=[...Me,S.math.remarkPlugin]),Me},[c,S==null?void 0:S.math,S==null?void 0:S.cjk]),Tt=T.useMemo(()=>{var Me;let qe=o;if(Y&&Object.keys(Y).length>0&&o===nv){let zt={...Jf,tagNames:[...(Me=Jf.tagNames)!=null?Me:[],...Object.keys(Y)],attributes:{...Jf.attributes,...Y}};qe=[n1.raw,[Z3,zt],n1.harden]}return M&&M.length>0&&(qe=[...qe,[bG,M]]),S!=null&&S.math&&(qe=[...qe,S.math.rehypePlugin]),De&&y&&(qe=[...qe,De.rehypePlugin]),qe},[o,S==null?void 0:S.math,De,y,Y,M]),ot=T.useMemo(()=>{if(!y||Re.length===0)return!1;let Me=Re.at(-1);return VT(Me)||WV(Me)},[y,Re]),St=T.useMemo(()=>C&&y&&!ot?{"--streamdown-caret":`"${vG[C]}"`}:void 0,[C,y,ot]);return t==="static"?f.jsx(Zg.Provider,{value:Ct,children:f.jsx(Jg.Provider,{value:S??null,children:f.jsx(da.Provider,{value:tt,children:f.jsx(BT,{icons:G,children:f.jsx(Kg.Provider,{value:H,children:f.jsx("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?$T(U):n,children:f.jsx(aS,{components:bt,rehypePlugins:Tt,remarkPlugins:At,...V,children:U})})})})})})}):f.jsx(Zg.Provider,{value:Ct,children:f.jsx(Jg.Provider,{value:S??null,children:f.jsx(da.Provider,{value:tt,children:f.jsx(BT,{icons:G,children:f.jsx(Kg.Provider,{value:H,children:f.jsxs("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&!ot?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:St,children:[Re.length===0&&C&&y&&f.jsx("span",{}),Re.map((Me,qe)=>{var zt;let mn=qe===Re.length-1,Xt=y&&mn&&VT(Me);return f.jsx(v,{animatePlugin:De,components:bt,content:Me,dir:(zt=Se==null?void 0:Se[qe])!=null?zt:n!=="auto"?n:void 0,index:qe,isIncomplete:Xt,rehypePlugins:Tt,remarkPlugins:At,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...V},Ge[qe])})]})})})})})})},(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);cS.displayName="Streamdown";var wG=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:l=!0,initialZoom:o=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:m,ZoomOutIcon:p}=es(),g=Lt(),y=T.useRef(null),E=T.useRef(null),[v,w]=T.useState(o),[C,S]=T.useState({x:0,y:0}),[N,A]=T.useState(!1),[z,Y]=T.useState({x:0,y:0}),[M,B]=T.useState({x:0,y:0}),G=T.useCallback(H=>{w(F=>Math.max(n,Math.min(r,F+H)))},[n,r]),ce=T.useCallback(()=>{G(i)},[G,i]),Q=T.useCallback(()=>{G(-i)},[G,i]),he=T.useCallback(()=>{w(o),S({x:0,y:0})},[o]),V=T.useCallback(H=>{H.preventDefault();let F=H.deltaY>0?-i:i;G(F)},[G,i]),Te=T.useCallback(H=>{if(H.button!==0||H.isPrimary===!1)return;A(!0),Y({x:H.clientX,y:H.clientY}),B(C);let F=H.currentTarget;F instanceof HTMLElement&&F.setPointerCapture(H.pointerId)},[C]),me=T.useCallback(H=>{if(!N)return;H.preventDefault();let F=H.clientX-z.x,K=H.clientY-z.y;S({x:M.x+F,y:M.y+K})},[N,z,M]),ne=T.useCallback(H=>{A(!1);let F=H.currentTarget;F instanceof HTMLElement&&F.releasePointerCapture(H.pointerId)},[]);return T.useEffect(()=>{let H=y.current;if(H)return H.addEventListener("wheel",V,{passive:!1}),()=>{H.removeEventListener("wheel",V)}},[V]),T.useEffect(()=>{let H=E.current;if(H&&N)return document.body.style.userSelect="none",H.addEventListener("pointermove",me,{passive:!1}),H.addEventListener("pointerup",ne),H.addEventListener("pointercancel",ne),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",me),H.removeEventListener("pointerup",ne),H.removeEventListener("pointercancel",ne)}},[N,me,ne]),f.jsxs("div",{className:g("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:y,style:{cursor:N?"grabbing":"grab"},children:[l?f.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:[f.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:ce,title:"Zoom in",type:"button",children:f.jsx(m,{size:16})}),f.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:f.jsx(p,{size:16})}),f.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:he,title:"Reset zoom and pan",type:"button",children:f.jsx(d,{size:16})})]}):null,f.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:Te,ref:E,role:"application",style:{transform:`translate(${C.x}px, ${C.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},dS=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let l=Lt(),[o,c]=T.useState(null),[d,m]=T.useState(!1),[p,g]=T.useState(""),[y,E]=T.useState(""),[v,w]=T.useState(0),{mermaid:C}=T.useContext(da),S=vb(),N=C==null?void 0:C.errorComponent,{shouldRender:A,containerRef:z}=W$({immediate:r});if(T.useEffect(()=>{if(A){if(!S){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),m(!0);let M=S.getMermaid(n),B=e.split("").reduce((Q,he)=>(Q<<5)-Q+he.charCodeAt(0)|0,0),G=`mermaid-${Math.abs(B)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:ce}=await M.render(G,e);g(ce),E(ce)}catch(M){if(!(y||p)){let B=M instanceof Error?M.message:"Failed to render Mermaid chart";c(B)}}finally{m(!1)}})()}},[e,n,v,A,S]),!(A||p||y))return f.jsx("div",{className:l("my-4 min-h-[200px]",t),ref:z});if(d&&!p&&!y)return f.jsx("div",{className:l("my-4 flex justify-center p-4",t),ref:z,children:f.jsxs("div",{className:l("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:l("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:l("text-sm"),children:"Loading diagram..."})]})});if(o&&!p&&!y){let M=()=>w(B=>B+1);return N?f.jsx("div",{ref:z,children:f.jsx(N,{chart:e,error:o,retry:M})}):f.jsxs("div",{className:l("rounded-md bg-red-50 p-4",t),ref:z,children:[f.jsxs("p",{className:l("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),f.jsxs("details",{className:l("mt-2"),children:[f.jsx("summary",{className:l("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.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||y;return f.jsx("div",{className:l("size-full",t),"data-streamdown":"mermaid",ref:z,children:f.jsx(wG,{className:l(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:l("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:Y},role:"img"})})})};function fS({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?su.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close full text",onClick:r,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),f.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:[f.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:t}),f.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:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.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"})})})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:f.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}const CG=[/^(?: {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],SG=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,NG=/!?\[[^\]\n]+\]\([^)]+\)/,AG=/`[^`\n]+`/,RG=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,LG=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,IG=/~~[^~\n]+~~/;function OG(e){const t=e.trim();return t?CG.some(n=>n.test(t))||SG.test(t)?!0:/[`[\]*_~!]/.test(t)?NG.test(t)||AG.test(t)||RG.test(t)||LG.test(t)||IG.test(t):!1:!1}function em(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function Ko(e){return e?new Date(e).toLocaleString():"Time unavailable"}function hS(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 DG(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 mS(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function Ts(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"reasoning":return"timeline-kind-reasoning";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 pS(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"reasoning":return"Reasoning";case"toolCall":return"Tool";case"plan":return"Plan";case"fileChange":return"File Change";case"hook":return"Hook";case"other":return"Other"}}function jG(e){return e==="commandExecution"||e==="reasoning"}const rv=10,MG=10,r1=80;function vs(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"reasoning":return"timeline-reasoning";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 Ua(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"action":return"timeline-overlay-badge timeline-overlay-badge-action"}}function av(){return f.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:[f.jsx("path",{d:"M3.5 5.25h9"}),f.jsx("path",{d:"M5 8h6"}),f.jsx("path",{d:"M6.5 10.75h3"})]})}function PG(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 sv(e){return e.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function gu(e){const t=PG(e);return t.length===1?{firstLine:t[0]??"",showGap:!1,isTruncated:!1}:{firstLine:t[0]??"",showGap:!0,isTruncated:!0}}function a1(e){const t=e.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!t)return null;const n=t[1]?sv(t[1]):null,r=sv(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 iv(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function BG(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 d=o[1],m=((l=o[2])==null?void 0:l.trim())??"";d==="PHOTO"&&m?n.push({type:"photo",key:`photo-${i}`,path:m}):d==="FILE"&&m?n.push({type:"file",key:`file-${i}`,path:m}):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 gS(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 d=[];let m=i.length+4;for(let p=c.length-1;p>=0;p-=1){const g=c[p],y=m+g.length+(d.length>0?1:0);if(d.length>0&&y>t)break;d.unshift(g),m=y}if(d.length>0)return`.../${d.join("/")}${i}`}return`...${l.slice(-(t-i.length-3))}${i}`}function UG(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 HG(e){return e==="userMessage"||e==="agentMessage"}function zG(e){return e==="commandExecution"||e==="webSearch"||e==="fileChange"||e==="image"||e==="contextCompaction"}function FG(e){return e==="agentMessage"||e==="reasoning"||e==="toolCall"||e==="plan"}function $G(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&&zG(n[c].kind);)c+=1;if(c===l+1)continue;const[d]=n.splice(l,1);n.splice(c-1,0,d),l=c-1}let i=!1;return n.map((l,o)=>l.kind!=="userMessage"?l:i?n.slice(o+1).some(d=>FG(d.kind))?l:{...l,status:"Awaiting response"}:(i=!0,l))}function VG(e,t){if(!t||t.length===0)return e;const n=new Set(e.map(l=>l.id)),r=t.filter(l=>!n.has(l.id));if(r.length===0)return e;const i=[...e,...r];return i.some(l=>typeof l.sequence=="number"&&Number.isFinite(l.sequence))?i.map((l,o)=>({item:l,index:o})).sort((l,o)=>{const c=typeof l.item.sequence=="number"&&Number.isFinite(l.item.sequence)?l.item.sequence:Number.POSITIVE_INFINITY,d=typeof o.item.sequence=="number"&&Number.isFinite(o.item.sequence)?o.item.sequence:Number.POSITIVE_INFINITY;return c===d?l.index-o.index:c-d}).map(l=>l.item):i}function GG(e,t){if(!e)return"";const n=t.filter(d=>d.kind==="agentMessage").map(d=>d.text).filter(d=>d.length>0),r=n.at(-1)??"";if(r){const d=e.lastIndexOf(r);if(d>=0){const m=e.slice(d+r.length);return m.trim()?m:""}}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 xs(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("running")||t.includes("inprogress")||t.includes("in_progress")}function kh(e){return e==="inProgress"||e==="sending"}function ng(e,t=r1){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function qG(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 YG(e){var r;const t=[];let n=0;for(;n<e.length;){const i=e[n];if(!i)break;if(i.kind!=="commandExecution"&&i.kind!=="fileChange"&&i.kind!=="webSearch"){t.push({kind:"item",key:i.id,item:i}),n+=1;continue}const l=[];for(;n<e.length&&((r=e[n])==null?void 0:r.kind)===i.kind;)l.push(e[n]),n+=1;if(l.length===1){t.push({kind:"item",key:l[0].id,item:l[0]});continue}const o=l.map(c=>c.id).join(":");if(i.kind==="commandExecution"){t.push({kind:"commandGroup",key:o,items:l});continue}if(i.kind==="fileChange"){t.push({kind:"fileChangeGroup",key:o,items:l});continue}t.push({kind:"searchGroup",key:o,items:l})}return t}function lv({kind:e}){return e==="userMessage"?f.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:[f.jsx("path",{d:"M8 8a2.75 2.75 0 1 0 0-5.5A2.75 2.75 0 0 0 8 8Z"}),f.jsx("path",{d:"M3.5 13.25a4.5 4.5 0 0 1 9 0"})]}):f.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:[f.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"7.5",rx:"2"}),f.jsx("path",{d:"M5.5 6.75h.01M10.5 6.75h.01M6.5 12.25h3"}),f.jsx("path",{d:"M6 10.5v1.75M10 10.5v1.75"})]})}function ov(){return f.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:[f.jsx("path",{d:"m4 5 2 2-2 2"}),f.jsx("path",{d:"M7.75 9.5h4.25"})]})}function s1(){return f.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:[f.jsx("path",{d:"M6.25 4.25 3.5 7l2.75 2.75"}),f.jsx("path",{d:"M9.75 4.25 12.5 7 9.75 9.75"}),f.jsx("path",{d:"M8.9 3.5 7.1 10.5"}),f.jsx("path",{d:"M3 12.25h10"})]})}function uv(){return f.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:[f.jsx("path",{d:"M6.25 4.5v4.25a2.75 2.75 0 1 0 2.75 2.75V7.25"}),f.jsx("path",{d:"M9 7.25a2.75 2.75 0 1 0-2.75-2.75"})]})}function cv(){return f.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:[f.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),f.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),f.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),f.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),f.jsx("path",{d:"M7.9 5.5h1.7"}),f.jsx("path",{d:"m7.75 8 1 1-1 1"}),f.jsx("path",{d:"M9.4 9h1.7"})]})}function dv(){return f.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:[f.jsx("circle",{cx:"7",cy:"7",r:"3.75"}),f.jsx("path",{d:"m10.25 10.25 3 3"})]})}function fv(){return f.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:[f.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),f.jsx("path",{d:"m8 8 1.6 1.6"}),f.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),f.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),f.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),f.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function hv(){return f.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:[f.jsx("rect",{x:"2.75",y:"3",width:"10.5",height:"9.5",rx:"1.5"}),f.jsx("circle",{cx:"6.1",cy:"6.1",r:"1.1"}),f.jsx("path",{d:"m4.5 10 2.2-2.2 1.9 1.9 1.1-1.1 1.8 1.8"})]})}function wh(){return f.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:[f.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"}),f.jsx("path",{d:"M9 2.75v2h2"}),f.jsx("path",{d:"M6.2 8h3.6"}),f.jsx("path",{d:"M6.2 10h1.7"})]})}function WG(){return f.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:[f.jsx("path",{d:"M4.25 4.75h7.5"}),f.jsx("path",{d:"M4.25 8h7.5"}),f.jsx("path",{d:"M4.25 11.25h4.5"}),f.jsx("path",{d:"M2.25 4.75h.01M2.25 8h.01M2.25 11.25h.01"})]})}function QG(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:f.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 XG(){return f.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:[f.jsx("rect",{x:"5.25",y:"3.25",width:"7.5",height:"9",rx:"1.5"}),f.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 Wr({tone:e="amber"}){const t=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return f.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>f.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${t}`,style:{animationDelay:`${n*180}ms`}},n))})}function i1(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 KG(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!xs(e.status);default:return!1}}function ZG(e,t,n){if(!e||!kh(n))return e;const r=e.plan.findIndex(c=>i1(c.status)==="in_progress");if(r<0)return e;const i=e.plan.findIndex((c,d)=>d>r&&i1(c.status)==="pending");if(i<0||!t.some(c=>KG(c)))return e;const o=e.plan.map((c,d)=>d===r?{...c,status:"completed"}:d===i?{...c,status:"in_progress"}:c);return{...e,plan:o}}function JG(){return f.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:[f.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),f.jsx("path",{d:"M8 5.25v2.9l2.05 1.2"})]})}function eq({status:e}){const t=i1(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 f.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"?f.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:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):t==="in_progress"?f.jsx(Wr,{tone:"sky"}):t==="pending"?f.jsx(JG,{}):t==="failed"?f.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:f.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})}):f.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function mv({status:e}){const t=mS(e);return e==="completed"?f.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:f.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:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?f.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:f.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:f.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?f.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:f.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:f.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):f.jsx("span",{"aria-label":t,title:t,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:f.jsx(Wr,{tone:"emerald"})})}function pv({turn:e,variant:t="header"}){const n=mS(e.status),r=oq(e),i=iq(e),l=xS(e),o=kh(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 f.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${c}`,children:[f.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx(mv,{status:e.status}),f.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:r})]}),e.startedAt&&f.jsx("time",{dateTime:e.startedAt,title:Ko(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:em(e.startedAt)})]}),(l||i.length>0)&&f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[l?f.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(m=>f.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${m.className}`,title:m.title,children:[m.icon?f.jsx("span",{className:"mr-1",children:m.icon}):null,m.label]},m.id))]})]});const d=`${n} · ${r}`;return f.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:d,children:[f.jsx(mv,{status:e.status}),f.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:r})]})}function tq(){return f.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:[f.jsx("path",{d:"M8 2.75v8"}),f.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function nq(){return f.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:[f.jsx("path",{d:"M8 13.25v-8"}),f.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function rq(){return f.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:[f.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),f.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),f.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),f.jsx("path",{d:"M3.25 5.25v5.5"}),f.jsx("path",{d:"M12.75 5.25v5.5"})]})}function aq(){return f.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:[f.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"}),f.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),f.jsx("path",{d:"M8 5.5v4.75"}),f.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function jf(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 sq(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 Tc(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Mf(e,t,n){const r=e??null;return!Number.isFinite(r??NaN)||r===null||t<=0||n<=0?null:r*n/t}function bS(e){var c,d,m,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:jf(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?Tc(e.priceEstimate.inputUsd):"--",usdRawValue:((d=e.priceEstimate)==null?void 0:d.inputUsd)??null,className:"token-badge-in",icon:f.jsx(tq,{})}:null,r>0?{id:"cache",label:"Cached input",tokenCompactValue:jf(r),tokenRawValue:r,usdCompactValue:e.priceEstimate?Tc(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((m=e.priceEstimate)==null?void 0:m.cachedInputUsd)??null,className:"token-badge-cache",icon:f.jsx(rq,{})}:null,l>0?{id:"out",label:"Output",tokenCompactValue:jf(l),tokenRawValue:l,usdCompactValue:e.priceEstimate?Tc(Mf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),l)??0):"--",usdRawValue:Mf((p=e.priceEstimate)==null?void 0:p.outputUsd,Math.max(t.outputTokens,0),l),className:"token-badge-out",icon:f.jsx(nq,{})}:null,i>0?{id:"reason",label:"Reasoning",tokenCompactValue:jf(i),tokenRawValue:i,usdCompactValue:e.priceEstimate?Tc(Mf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),i)??0):"--",usdRawValue:Mf((g=e.priceEstimate)==null?void 0:g.outputUsd,Math.max(t.outputTokens,0),i),className:"token-badge-reason",icon:f.jsx(aq,{})}:null].filter(y=>y!==null)}function iq(e){return bS(e).map(t=>({id:t.id,label:t.tokenCompactValue,title:`${t.label}: ${t.tokenRawValue} tokens`,className:t.className,icon:t.icon}))}function xS(e){return{label:e.priceEstimate?sq(e.priceEstimate.totalUsd):"--",title:e.priceEstimate===null||e.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${Tc(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}const rg="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 lq({turn:e}){const t=bS(e),n=xS(e),[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(0),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null);if(T.useLayoutEffect(()=>{if(!r||t.length===0){d(0);return}const E=()=>{const v=m.current,w=g.current;if(!v||!w)return;const C=v.getBoundingClientRect(),S=w.offsetWidth||w.getBoundingClientRect().width;if(S<=0)return;const N=window.innerWidth||document.documentElement.clientWidth,A=12,z=C.left+C.width/2-S/2,Y=A,M=Math.max(Y,N-A-S),B=Math.min(Math.max(z,Y),M);d(Math.round(B-z))};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&&(m.current&&!m.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 y=()=>f.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:f.jsx("div",{className:"space-y-1",children:t.map(E=>f.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:[f.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"inline-flex shrink-0",children:E.icon}),f.jsx("span",{className:"thread-token-popover-strong font-medium",children:E.usdCompactValue})]}),f.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:E.tokenCompactValue})]},E.id))})});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?f.jsxs("div",{ref:p,className:"relative shrink-0",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[f.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":l,onFocus:()=>o(!0),onBlur:()=>o(!1),className:`${rg} 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?f.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:y()}):null]}):null,t.map(E=>f.jsxs("span",{className:`${rg} ${E.className}`,title:`${E.label}: ${E.usdCompactValue}, ${E.tokenRawValue} tokens`,children:[E.icon,f.jsx("span",{className:"font-medium text-stone-100",children:E.tokenCompactValue})]},E.id))]}),f.jsxs("div",{ref:m,className:"relative shrink-0 md:hidden",children:[n?f.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":r,onClick:()=>i(E=>!E),className:`${rg} 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?f.jsx("div",{ref:g,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${c}px) translateX(-50%)`},children:y()}):null]})]})}function oq(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 uq({text:e,className:t="agent-markdown"}){return f.jsx(cS,{mode:"static",plugins:{code:I8},controls:!1,lineNumbers:!1,remarkPlugins:dq,className:t,children:e})}function cq(){return e=>{yS(e)}}const dq=[...Object.values(iS),cq];function yS(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}yS(n),t.push(n)}e.children=t}const fq=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,hq=/[),.;:!?]+$/;function mq(e){return e.startsWith("www.")?`https://${e}`:e}function Ch({text:e}){var r;const t=[];let n=0;for(const i of e.matchAll(fq)){const l=i[0],o=i.index??0,c=((r=l.match(hq))==null?void 0:r[0])??"",d=c?l.slice(0,-c.length):l;d&&(o>n&&t.push(e.slice(n,o)),t.push(f.jsx("a",{href:mq(d),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:d},`${o}-${d}`)),c&&t.push(c),n=o+l.length)}return n<e.length&&t.push(e.slice(n)),f.jsx(f.Fragment,{children:t.length>0?t:e})}function ES({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=OG(e),[d,m]=T.useState(n||typeof IntersectionObserver>"u");return T.useEffect(()=>{if(n||typeof IntersectionObserver>"u"){m(!0);return}if(d||!o.current)return;const p=new IntersectionObserver(g=>{for(const y of g)if(y.isIntersecting){m(!0),p.disconnect();break}},{root:t.current,threshold:0});return p.observe(o.current),()=>{p.disconnect()}},[d,t,n]),f.jsx("div",{ref:o,className:r,children:d&&c?f.jsx(uq,{text:e,className:l}):f.jsx("p",{className:i,children:f.jsx(Ch,{text:e})})})}function pq({text:e,scrollRootRef:t,streaming:n=!1}){return f.jsx(ES,{text:e,scrollRootRef:t,streaming:n,containerClassName:"thread-message-prose"})}function gq({threadId:e,text:t}){const n=T.useMemo(()=>BG(t),[t]);return f.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 f.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=iv(r.path)||"Attached image";return f.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:f.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?f.jsx("img",{src:l,alt:o,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):f.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"}),f.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=iv(r.path)||"Attached file";return f.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:f.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:[f.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"}),f.jsx("span",{className:"min-w-0 truncate",children:i})]})},r.key)})})}function _S(e){return e==="completed"?"timeline-command-status-complete":"timeline-command-status-pending"}function TS({status:e}){return e==="completed"?f.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:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):f.jsx(Wr,{tone:"emerald"})}const Dc=T.memo(function({threadId:t,item:n,scrollRootRef:r,streaming:i=!1}){const[l,o]=T.useState("idle"),c=T.useRef(null),d=n.kind==="userMessage"?"thread-message-icon thread-message-icon-user":"thread-message-icon thread-message-icon-agent",m=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response"),p=n.status==="Steering"?"ui-status-warning":n.status==="Accepted"?"ui-status-success":"ui-status-info";T.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);async function g(){try{await navigator.clipboard.writeText(n.text),o("copied"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1200)}catch{o("failed"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1600)}}return f.jsxs("div",{className:`timeline-item-frame ${n.kind==="agentMessage"?"timeline-has-corner-copy":""} relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(n.kind)} ${vs(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[m&&f.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 ${p}`,children:[f.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:[f.jsx("path",{d:"M3.25 8A4.75 4.75 0 0 1 8 3.25h2.75"}),f.jsx("path",{d:"m9.5 1.75 1.75 1.5-1.75 1.5"}),f.jsx("path",{d:"M12.75 8A4.75 4.75 0 0 1 8 12.75H5.25"}),f.jsx("path",{d:"m6.5 14.25-1.75-1.5 1.75-1.5"})]}),f.jsx("span",{children:n.status})]}),f.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 ${d}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(lv,{kind:n.kind})})}),f.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:[f.jsxs("div",{className:"hidden",children:[f.jsx("span",{className:`hidden h-6 w-6 items-center justify-center rounded-full border sm:inline-flex ${d}`,children:f.jsx(lv,{kind:n.kind})}),i&&n.kind==="agentMessage"&&f.jsx("span",{className:"hidden sm:inline-flex",children:f.jsx(Wr,{tone:"emerald"})})]}),f.jsxs("div",{className:"min-w-0 flex-1",children:[n.kind==="agentMessage"?f.jsx(pq,{text:n.text,scrollRootRef:r,streaming:i}):f.jsx(gq,{threadId:t,text:n.text}),n.status&&!m&&f.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]}),i&&n.kind==="agentMessage"&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{tone:"emerald"})}),n.kind==="agentMessage"&&f.jsx("button",{type:"button","aria-label":"Copy agent reply",title:l==="copied"?"Copied":l==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void g(),className:"timeline-corner-copy absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center transition",children:f.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:f.jsx(XG,{})})})]})}),bq=T.memo(function({item:t,onOpen:n}){const r=gu(t.text);return f.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 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("command")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(ov,{})})}),xs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.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:f.jsx(ov,{})}),xs(t.status)&&f.jsx(Wr,{})]}),f.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:[f.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 ${_S(t.status)} hover:brightness-110`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(TS,{status:t.status})})}),f.jsx("button",{type:"button","aria-label":"Open full command",onClick:()=>n(t,"Command Output"),className:"block w-full text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),xq=T.memo(function({item:t,onOpen:n}){const r=gu(t.text);return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(s1,{})})}),xs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.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:f.jsx(s1,{})}),xs(t.status)&&f.jsx(Wr,{})]}),f.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:[f.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 ${_S(t.status)} hover:brightness-110`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(TS,{status:t.status})})}),f.jsx("button",{type:"button","aria-label":"Open full tool call",onClick:()=>n(t,"Tool Call Details"),className:"block w-full text-left",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),yq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.filter(c=>xs(c.status)).length,o=t.length===1?"1 command":`${t.length} commands`;return f.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:[f.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 ${Ua("command")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(cv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.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:[f.jsx(cv,{}),f.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&&f.jsx(Wr,{})]}),f.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:[f.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:f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.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"}),f.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&&f.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:f.jsx(Wr,{})})]})}),n&&f.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,d)=>{const m=gu(c.text);return f.jsxs("button",{type:"button","aria-label":`Open grouped command ${d+1}`,onClick:()=>i(c,`Command Output ${d+1}`),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.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 ",d+1]}),c.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:c.status})]}),f.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},c.id)})})]})]})]})}),Eq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 search":`${t.length} searches`;return f.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:[f.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 ${Ua("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(fv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.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:[f.jsx(fv,{}),f.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})]})}),f.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:[f.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:f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.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"}),f.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&&f.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,y;const d=((g=o.previewText)==null?void 0:g.trim())||o.text||"Web search",m=gu(d),p=((y=o.detailText)==null?void 0:y.trim())||o.text||"Web search";return f.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:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.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&&f.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),f.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),_q=T.memo(function({item:t,scrollRootRef:n}){return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(WG,{})})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("span",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:pS(t.kind)}),t.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:t.status})]}),f.jsx("div",{className:"mt-1.5",children:f.jsx(ES,{text:t.text,scrollRootRef:n,plainTextClassName:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-300",markdownClassName:"agent-markdown text-sm"})})]})}),Tq=T.memo(function({item:t}){const n=xs(t.status)||t.text==="Compacting context",r=n?"Compacting context":"Context compacted",i=t.detailText&&t.detailText!==r?t.detailText:null;return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[f.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:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(av,{})})}),f.jsxs("div",{className:"flex min-w-0 items-center gap-2 pt-2 sm:pt-0",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 sm:flex",children:f.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:f.jsx(av,{})})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("p",{className:"timeline-primary-text truncate text-[13px] font-medium sm:text-sm",children:r}),n?f.jsx(Wr,{tone:"emerald"}):null]}),i?f.jsx("p",{className:"timeline-meta-text mt-0.5 truncate text-[11px] sm:text-xs",title:i,children:i}):null]})]})]})}),vq=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=gu(r);return f.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 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(dv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.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:f.jsx(dv,{})})}),f.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:[f.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 ${Ua("action")} hover:bg-stone-800`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(QG,{})})}),t.status&&f.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),f.jsx("button",{type:"button","aria-label":"Open full web search",onClick:()=>n("Web Search Details",i),className:"block w-full text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),kq=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 f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(n.kind)} ${vs(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(hv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.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:f.jsx(hv,{})})}),f.jsxs("div",{className:"min-w-0 w-full flex-1",children:[l?f.jsx("button",{type:"button",onClick:()=>r("Image Path",i??n.text),className:"block w-full text-left",children:f.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"})}):f.jsx("div",{className:"timeline-item-inner rounded-xl border px-3 py-3 text-sm",children:n.text}),i&&f.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&&f.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]})]})}),wq=T.memo(function({item:t,onOpen:n}){var d,m,p;const r=(d=t.previewText)!=null&&d.trim()&&t.text.trim()!==t.previewText.trim()?t.text.trim():null,i=((m=t.detailText)==null?void 0:m.trim())||null,l=gS(r??((p=t.previewText)==null?void 0:p.trim())??t.text,48),o=UG(t),c=i?"button":"div";return f.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 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(wh,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.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:f.jsx(wh,{})})}),f.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:f.jsxs("div",{className:"timeline-mobile-file-line flex min-w-0 items-center gap-2",children:[f.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&&f.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:o.map(g=>f.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))})]})})]})]})}),Cq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.reduce((m,p)=>m+(p.changedFiles??0),0),o=t.reduce((m,p)=>m+(p.addedLines??0),0),c=t.reduce((m,p)=>m+(p.removedLines??0),0),d=t.length===1?"1 file change":`${t.length} file changes`;return f.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:[f.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 ${Ua("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(wh,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.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:[f.jsx(wh,{}),f.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})]})}),f.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:[f.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:[f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.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"}),f.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:d}),l>0&&f.jsxs("span",{className:"timeline-meta-text text-xs",children:[l," files"]})]}),f.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[o>0&&f.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&&f.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&&f.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((m,p)=>{var E,v,w,C;const g=((E=m.detailText)==null?void 0:E.trim())||((v=m.previewText)==null?void 0:v.trim())||m.text,y=(w=m.previewText)!=null&&w.trim()&&m.text.trim()!==m.previewText.trim()?m.text.trim():((C=m.previewText)==null?void 0:C.trim())||m.text;return f.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:f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 text-sm leading-6",title:y,children:gS(y,34)}),f.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(m.addedLines??0)>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",m.addedLines]}),(m.removedLines??0)>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",m.removedLines]})]})]})},m.id)})})]})]})]})}),Sq=T.memo(function({item:t}){return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(s1,{})})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[f.jsx("span",{className:"timeline-meta-text text-[10px] uppercase tracking-[0.16em]",children:pS(t.kind)}),t.status&&f.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),f.jsx("pre",{className:`timeline-soft-text mt-1 whitespace-pre-wrap break-words text-[13px] leading-5 ${jG(t.kind)?"max-h-56 overflow-auto":""}`,children:f.jsx(Ch,{text:t.text})})]})}),Nq=T.memo(function({item:t}){var d,m;const n=((d=t.hookOutputEntries)==null?void 0:d.map(p=>p.text.trim()).filter(Boolean).join(`
|
|
377
|
+
`).trim())??"",r=t.hookEventLabel?`${t.hookEventLabel} hook`:t.text,i=((m=t.hookStatusMessage)==null?void 0:m.trim())||(t.previewText&&t.previewText!==t.hookStatusMessage?t.previewText.trim():"")||t.text.trim(),o=gu(n||(i&&i!==r?i:r)),c=!!(n&&o.showGap);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.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 ${Ua("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(uv,{})})}),xs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.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:f.jsx(uv,{})}),xs(t.status)&&f.jsx(Wr,{})]}),f.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:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[f.jsxs("span",{className:"timeline-meta-text min-w-0 truncate text-[10px] uppercase tracking-[0.16em]",children:["Hook · ",t.hookEventLabel??t.text]}),t.status&&f.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),f.jsxs("div",{className:"timeline-mobile-dense-line mt-1.5 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"timeline-meta-text mr-2 font-sans text-[11px] uppercase tracking-[0.12em]",children:r}),f.jsx(Ch,{text:o.firstLine})]}):f.jsx(Ch,{text:o.firstLine&&o.firstLine!==r?`${r} · ${o.firstLine}`:r})}),c?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]})]})]})}),l1=T.memo(function({threadId:t,item:n,scrollRootRef:r,onOpenExpandedText:i,onOpenCommandDetail:l,onOpenToolCallDetail:o}){return HG(n.kind)?f.jsx(Dc,{threadId:t,item:n,scrollRootRef:r}):n.kind==="commandExecution"?f.jsx(bq,{item:n,onOpen:l}):n.kind==="toolCall"?f.jsx(xq,{item:n,onOpen:o}):n.kind==="webSearch"?f.jsx(vq,{item:n,onOpen:i}):n.kind==="image"?f.jsx(kq,{threadId:t,item:n,onOpen:i}):n.kind==="plan"?f.jsx(_q,{item:n,scrollRootRef:r}):n.kind==="fileChange"?f.jsx(wq,{item:n,onOpen:i}):n.kind==="contextCompaction"?f.jsx(Tq,{item:n}):n.kind==="hook"?f.jsx(Nq,{item:n}):f.jsx(Sq,{item:n})});function Pf({request:e,busy:t=!1,onRespond:n}){const[r,i]=T.useState({}),[l,o]=T.useState({}),[c,d]=T.useState(null),m=e.questions[0]??null,p="__other__",g=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function y(w){const C=/\s*\(recommended\)\s*$/i.test(w);return{rawLabel:w,displayLabel:w.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:C}}function E(w){m&&(d(w),n==null||n(e.id,{answers:{[m.id]:{answers:[w]}}}))}function v(w){const C=r[w.id]??"";return C===p?(l[w.id]??"").trim():C.trim()}return f.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[f.jsx("div",{className:"flex items-center justify-between gap-3",children:f.jsxs("div",{children:[f.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:g}),e.kind!=="planDecision"&&e.description&&f.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),f.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(w=>f.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[f.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:w.header}),f.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?f.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:w.options.map((C,S)=>{const N=y(C.label),A=N.displayLabel.toLowerCase()==="implement";return f.jsxs("button",{type:"button",disabled:t,onClick:()=>E(C.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${S===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[N.recommended?f.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===C.label?A?"Starting...":"Saving...":N.displayLabel]},C.label)})}):w.options&&w.options.length>0?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[w.options.map(C=>{const S=y(C.label);return f.jsxs("button",{type:"button",disabled:t,onClick:()=>i(N=>({...N,[w.id]:C.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${r[w.id]===C.label?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[S.recommended?f.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,S.displayLabel]},C.label)}),w.isOther&&f.jsx("button",{type:"button",disabled:t,onClick:()=>i(C=>({...C,[w.id]:p})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${r[w.id]===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&&r[w.id]===p&&f.jsx("input",{"aria-label":`${w.header} custom answer`,value:l[w.id]??"",onChange:C=>o(S=>({...S,[w.id]:C.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"})]}):f.jsx("input",{"aria-label":w.header,value:r[w.id]??"",onChange:C=>i(S=>({...S,[w.id]:C.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"&&f.jsx("div",{className:"mt-3 flex justify-end",children:f.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:[v(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 Bf({note:e}){return f.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[f.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),f.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((t,n)=>f.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",t]},`${e.id}-${n}`))})]})}function Bo({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 f.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:n}),f.jsx("time",{dateTime:e.createdAt,title:Ko(e.createdAt),className:"timeline-meta-text text-[10px]",children:em(e.createdAt)})]}),f.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:r}),e.linkedThreadId?f.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 gv=T.memo(function({threadId:t,turn:n,absoluteIndex:r,isCollapsed:i,livePlan:l,liveItems:o,liveOutput:c,onToggleCollapse:d,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g,scrollRootRef:y,articleRef:E}){const v=T.useMemo(()=>VG(n.items,o),[o,n.items]),w=T.useMemo(()=>ZG(l,v,n.status),[l,v,n.status]),C=T.useMemo(()=>$G(v,kh(n.status)),[v,n.status]),S=T.useMemo(()=>YG(C),[C]),N=T.useMemo(()=>GG(c,v),[c,v]),A=T.useMemo(()=>a1(N),[N]),[z,Y]=T.useState({}),M=T.useCallback(B=>{Y(G=>({...G,[B]:!G[B]}))},[]);return f.jsxs("article",{ref:E,className:"px-2 py-1.5 sm:px-6 sm:py-2",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[f.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[f.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]}),f.jsx("time",{dateTime:n.startedAt??void 0,title:Ko(n.startedAt),className:"timeline-meta-text shrink-0 text-[10px] sm:text-[11px]",children:em(n.startedAt)}),f.jsx(pv,{turn:n}),n.error&&f.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:n.error})]}),f.jsx(lq,{turn:n})]}),f.jsx("button",{type:"button","aria-label":`${i?"Expand":"Collapse"} turn ${r}`,title:i?"Expand turn":"Collapse turn",onClick:()=>d(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:f.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?f.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):f.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),n.error&&f.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:n.error}),!i&&f.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[S.map(B=>B.kind==="commandGroup"?f.jsx(yq,{items:B.items,expanded:z[B.key]??!1,onToggleExpanded:()=>M(B.key),onOpen:p},B.key):B.kind==="fileChangeGroup"?f.jsx(Cq,{items:B.items,expanded:z[B.key]??!1,onToggleExpanded:()=>M(B.key),onOpen:m},B.key):B.kind==="searchGroup"?f.jsx(Eq,{items:B.items,expanded:z[B.key]??!1,onToggleExpanded:()=>M(B.key),onOpen:m},B.key):f.jsx(l1,{threadId:t,item:B.item,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g},B.key)),w&&f.jsxs("div",{className:"timeline-live-plan-card rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem]",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:"Plan update"}),f.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"})]}),w.explanation&&f.jsx("p",{className:"timeline-soft-text mt-3 text-sm",children:w.explanation}),f.jsx("div",{className:"mt-3 space-y-2",children:w.plan.map((B,G)=>f.jsxs("div",{className:"timeline-live-plan-step flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-sm",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1",children:B.step}),f.jsx(eq,{status:B.status})]},`${w.turnId}-${G}`))})]}),A?f.jsx(l1,{threadId:t,item:A,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g}):N?f.jsx(Dc,{item:{id:"live-agent-message",kind:"agentMessage",text:N},scrollRootRef:y,streaming:!0}):null,kh(n.status)&&f.jsx(pv,{turn:n,variant:"footer"})]})]})});function Aq({threadId:e,turns:t,totalTurnCount:n,pendingRequests:r=[],pendingSteers:i=[],livePlan:l=null,liveItems:o=null,respondingRequestId:c=null,onRespondToRequest:d,liveOutput:m,scrollRequestKey:p=0,bottomSpacer:g=0,className:y="",onTailVisibilityChange:E,loadingEarlier:v=!1,onLoadEarlier:w,ephemeralUserNote:C=null,answeredRequestNotes:S=[],activityNotes:N=[],optimisticSteers:A=[],optimisticTurn:z=null,onLoadHistoryItemDetail:Y,onOpenThread:M}){var Ke,Pe,it;const B=T.useRef(null),G=T.useRef(null),ce=T.useRef(p),Q=T.useRef(null),he=T.useRef(g),V=T.useRef(0),Te=T.useRef(null),me=T.useRef(!0),ne=T.useRef(!0),H=T.useRef(0),F=T.useRef(new Map),[K,oe]=T.useState(rv),[R,U]=T.useState(0),[te,O]=T.useState(null),[we,Re]=T.useState({}),[Se,Ge]=T.useState(!0),Fe=T.useMemo(()=>JSON.stringify({turns:t.map(X=>({id:X.id,status:X.status,startedAt:X.startedAt,error:X.error,items:X.items.map(Ee=>({id:Ee.id,kind:Ee.kind,status:Ee.status,textLength:Ee.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:A.map(X=>({id:X.id,turnId:X.turnId,prompt:X.prompt,status:X.status})),liveOutputLength:m.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:z===null?null:{id:z.id,status:z.status,error:z.error,items:z.items.map(X=>({id:X.id,kind:X.kind,textLength:X.text.length}))},answeredRequestNotes:S.map(X=>({id:X.id,turnId:X.turnId??null,title:X.title,createdAt:X.createdAt??"",summaryLines:X.summaryLines})),activityNotes:N.map(X=>({id:X.id,kind:X.kind,text:X.text,createdAt:X.createdAt})),ephemeralUserNote:C,bottomSpacer:g}),[N,S,g,C,m,o,l,A,z,i,r,t]),De=typeof w=="function"||n!==void 0,tt=T.useCallback(X=>{Re(Ee=>({...Ee,[X]:!Ee[X]}))},[]),dt=T.useCallback((X,Ee)=>{O({title:X,text:Ee})},[]),Ct=T.useCallback(async(X,Ee)=>{var gt;const at=((gt=X.detailText)==null?void 0:gt.trim())||X.text||"Command output";if(!X.hasDeferredDetail||!Y){O({title:Ee,text:at});return}const Ue=F.current.get(X.id);if(Ue){O({title:Ue.title,text:Ue.text});return}const Be=H.current+1;H.current=Be,O({title:Ee,text:"Loading full command output..."});try{const Pt=await Y(X.id);if(F.current.set(X.id,Pt),H.current!==Be)return;O({title:Pt.title,text:Pt.text})}catch(Pt){if(H.current!==Be)return;O({title:Ee,text:Pt instanceof Error?Pt.message:"Unable to load full command output."})}},[Y]),bt=T.useCallback(async(X,Ee)=>{var gt;const at=((gt=X.detailText)==null?void 0:gt.trim())||X.text||"Tool call";if(!X.hasDeferredDetail||!Y){O({title:Ee,text:at});return}const Ue=F.current.get(X.id);if(Ue){O({title:Ue.title,text:Ue.text});return}const Be=H.current+1;H.current=Be,O({title:Ee,text:"Loading full tool call details..."});try{const Pt=await Y(X.id);if(F.current.set(X.id,Pt),H.current!==Be)return;O({title:Pt.title,text:Pt.text})}catch(Pt){if(H.current!==Be)return;O({title:Ee,text:Pt instanceof Error?Pt.message:"Unable to load full tool call details."})}},[Y]),At=T.useCallback(()=>{const X=B.current,Ee=Te.current;if(!X)return;const at=Ee?qG(X,Ee):ng(X);me.current=at,Ge(at)},[]),Tt=T.useCallback(()=>{const X=B.current;X&&(ne.current=ng(X,r1)),At()},[At]),ot=T.useCallback(()=>{const X=B.current;X&&(X.scrollTop=X.scrollHeight,V.current=X.scrollHeight,me.current=!0,Ge(!0),ne.current=!0)},[]);T.useEffect(()=>{oe(X=>X>=t.length-1?t.length:Math.max(X,rv))},[t.length]),T.useEffect(()=>{const X=B.current;X&&(V.current=X.scrollHeight,ne.current=ng(X,r1)),At()},[g,S,C,m,o,l,r.length,At,t.length,K]),T.useEffect(()=>{const X=p!==ce.current,Ee=Q.current!==Fe;if(Q.current=Fe,!(X||Ee&&(Se||ne.current)))return;const Ue=window.requestAnimationFrame(()=>{ot()});return p!==ce.current&&(ce.current=p),()=>{window.cancelAnimationFrame(Ue)}},[Fe,Se,ot,p]),T.useEffect(()=>{const X=B.current,Ee=G.current;if(!X||!Ee||typeof ResizeObserver>"u")return;V.current=X.scrollHeight;const at=new ResizeObserver(()=>{const Ue=X.scrollHeight,Be=V.current;V.current=Ue,!(Ue<=Be)&&(ne.current||me.current)&&window.requestAnimationFrame(()=>{ot()})});return at.observe(Ee),()=>{at.disconnect()}},[ot]),T.useEffect(()=>{if(!Se){he.current=g;return}if(g===he.current)return;he.current=g;const X=window.requestAnimationFrame(()=>{ot()});return()=>{window.cancelAnimationFrame(X)}},[g,Se,ot]),T.useEffect(()=>{E==null||E(Se)},[Se,E]);const St=n??t.length,Me=Math.max(0,t.length-K),qe=De?t:t.slice(Me),zt=De?Math.max(0,St-t.length):Me,mn=St+1,Xt=De?Math.max(0,St-t.length):t.length-qe.length,yn=!De&&Xt>0&&R>=2,nt=m&&qe.length>0?qe.findLastIndex(X=>xs(X.status)):-1,lr=nt<0&&!!m&&!!z&&z.status!=="failed",ge=nt>=0||lr,ve=new Set(qe.map(X=>X.id)),Ye=S.reduce((X,Ee)=>{if(!Ee.turnId||!ve.has(Ee.turnId))return X;const at=X.get(Ee.turnId)??[];return at.push(Ee),X.set(Ee.turnId,at),X},new Map),rt=r.reduce((X,Ee)=>{if(!Ee.turnId||!ve.has(Ee.turnId))return X;const at=X.get(Ee.turnId)??[];return at.push(Ee),X.set(Ee.turnId,at),X},new Map),vt=[...i.map(X=>({id:X.id,prompt:X.prompt,status:"Accepted",createdAt:X.createdAt})),...A.map(X=>({id:X.id,prompt:X.prompt,status:X.status==="steering"?"Steering":null,createdAt:X.createdAt}))].sort((X,Ee)=>X.createdAt.localeCompare(Ee.createdAt)),En=S.filter(X=>!X.turnId||!ve.has(X.turnId)),kn=r.filter(X=>!X.turnId||!ve.has(X.turnId)),xe=T.useMemo(()=>{const X=[...qe.map(Be=>({id:Be.id,startedAt:Be.startedAt??""})),...z?[{id:z.id,startedAt:z.startedAt??""}]:[]],Ee=new Map,at=[],Ue=[...En.map(Be=>({kind:"note",id:Be.id,createdAt:Be.createdAt??"",note:Be})),...kn.map(Be=>({kind:"request",id:Be.id,createdAt:Be.createdAt,request:Be}))].sort((Be,gt)=>Be.createdAt.localeCompare(gt.createdAt));for(const Be of Ue){const gt=X.find(Je=>Be.createdAt&&Je.startedAt&&Be.createdAt.localeCompare(Je.startedAt)<=0);if(!gt){at.push(Be);continue}const Pt=Ee.get(gt.id)??[];Pt.push(Be),Ee.set(gt.id,Pt)}return{beforeTurnId:Ee,trailing:at}},[z,r,En,kn,qe]),Oe=T.useMemo(()=>{const X=[...N].sort(($t,pt)=>$t.createdAt.localeCompare(pt.createdAt)),Ee=[...qe.map($t=>({id:$t.id,startedAt:$t.startedAt??""})),...z?[{id:z.id,startedAt:z.startedAt??""}]:[]],at=[],Ue=new Map,Be=new Map,gt=[],Je=Ee.map($t=>$t.startedAt).filter($t=>!!$t).sort().at(-1)??null;for(const $t of X){if($t.anchorTurnId==="__leading__"){at.push($t);continue}if($t.anchorTurnId){if(Ee.some(Yt=>Yt.id===$t.anchorTurnId)){const Yt=Be.get($t.anchorTurnId)??[];Yt.push($t),Be.set($t.anchorTurnId,Yt)}else at.push($t);continue}const pt=Ee.find(Yt=>Yt.startedAt&&$t.createdAt.localeCompare(Yt.startedAt)<=0);if(!pt){!Je||$t.createdAt.localeCompare(Je)<=0?at.push($t):gt.push($t);continue}const Br=Ue.get(pt.id)??[];Br.push($t),Ue.set(pt.id,Br)}return{leading:at,beforeTurnId:Ue,afterTurnId:Be,trailing:gt}},[N,z,qe]);return f.jsxs(f.Fragment,{children:[f.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${y}`.trim(),children:f.jsx("div",{ref:B,"data-testid":"thread-scroll-container",onScroll:Tt,className:"thread-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:g>0?{paddingBottom:g}:void 0,children:f.jsxs("div",{ref:G,children:[t.length>0&&f.jsx("div",{className:"px-2.5 pb-1 pt-2 sm:px-6 sm:pb-1.5 sm:pt-3",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[Xt>0&&f.jsx("button",{type:"button",onClick:()=>{if(De){w==null||w();return}oe(X=>Math.min(t.length,X+MG)),U(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"}),yn&&f.jsx("button",{type:"button",onClick:()=>oe(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"}),f.jsxs("p",{className:"timeline-meta-text",children:["Showing ",qe.length," of ",St," turns",Xt>0?` · ${Xt} earlier hidden`:""]})]})}),t.length===0&&!m&&!z&&f.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."}),(qe.length>0||z||Oe.leading.length>0||Oe.trailing.length>0)&&f.jsxs("div",{className:"divide-y divide-stone-800/80",children:[Oe.leading.length>0?f.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=>f.jsx(Bo,{note:X,onOpenThread:M},X.id))}):null,qe.map((X,Ee)=>{var at,Ue,Be,gt,Pt;return f.jsxs("div",{children:[(((at=Oe.beforeTurnId.get(X.id))==null?void 0:at.length)??0)>0?f.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(Je=>f.jsx(Bo,{note:Je,onOpenThread:M},Je.id))}):null,(((Ue=xe.beforeTurnId.get(X.id))==null?void 0:Ue.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(X.id)??[]).map(Je=>Je.kind==="note"?f.jsx(Bf,{note:Je.note},Je.id):f.jsx(Pf,{request:Je.request,busy:c===Je.request.id,onRespond:d??void 0},Je.id))}):null,f.jsx(gv,{threadId:e,turn:X,absoluteIndex:zt+Ee+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:Ee===nt?m:"",onToggleCollapse:tt,onOpenExpandedText:dt,onOpenCommandDetail:Ct,onOpenToolCallDetail:bt,scrollRootRef:B,articleRef:void 0}),(((Be=Oe.afterTurnId.get(X.id))==null?void 0:Be.length)??0)>0?f.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(Je=>f.jsx(Bo,{note:Je},Je.id))}):null,(gt=Ye.get(X.id))!=null&>.length||(Pt=rt.get(X.id))!=null&&Pt.length?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...(Ye.get(X.id)??[]).map(Je=>({kind:"note",id:Je.id,createdAt:Je.createdAt??"",note:Je})),...(rt.get(X.id)??[]).map(Je=>({kind:"request",id:Je.id,createdAt:Je.createdAt,request:Je}))].sort((Je,$t)=>Je.createdAt.localeCompare($t.createdAt)).map(Je=>Je.kind==="note"?f.jsx(Bf,{note:Je.note},Je.id):f.jsx(Pf,{request:Je.request,busy:c===Je.request.id,onRespond:d??void 0},Je.id))}):null]},X.id)}),z&&f.jsxs(f.Fragment,{children:[(((Ke=Oe.beforeTurnId.get(z.id))==null?void 0:Ke.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.beforeTurnId.get(z.id)??[]).map(X=>f.jsx(Bo,{note:X,onOpenThread:M},X.id))}):null,(((Pe=xe.beforeTurnId.get(z.id))==null?void 0:Pe.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(z.id)??[]).map(X=>X.kind==="note"?f.jsx(Bf,{note:X.note},X.id):f.jsx(Pf,{request:X.request,busy:c===X.request.id,onRespond:d??void 0},X.id))}):null,f.jsx(gv,{threadId:e,turn:z,absoluteIndex:mn,isCollapsed:we[z.id]??!1,livePlan:null,liveItems:null,liveOutput:lr?m:"",onToggleCollapse:tt,onOpenExpandedText:dt,onOpenCommandDetail:Ct,onOpenToolCallDetail:bt,scrollRootRef:B}),(((it=Oe.afterTurnId.get(z.id))==null?void 0:it.length)??0)>0?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.afterTurnId.get(z.id)??[]).map(X=>f.jsx(Bo,{note:X,onOpenThread:M},X.id))}):null]})]}),vt.length>0&&f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:vt.map(X=>f.jsx(Dc,{threadId:e,item:{id:X.id,kind:"userMessage",text:X.prompt,status:X.status},scrollRootRef:B},X.id))}),(xe.trailing.length>0||Oe.trailing.length>0)&&f.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})),...xe.trailing].sort((X,Ee)=>X.createdAt.localeCompare(Ee.createdAt)).map(X=>X.kind==="activity"?f.jsx(Bo,{note:X.note,onOpenThread:M},X.id):X.kind==="note"?f.jsx(Bf,{note:X.note},X.id):f.jsx(Pf,{request:X.request,busy:c===X.request.id,onRespond:d??void 0},X.id))}),C&&f.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:f.jsx(Dc,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:C},scrollRootRef:B})}),m&&!ge&&f.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:a1(m)?f.jsx(l1,{threadId:e,item:a1(m),scrollRootRef:B,onOpenExpandedText:dt,onOpenCommandDetail:Ct,onOpenToolCallDetail:bt}):f.jsx(Dc,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:m},scrollRootRef:B,streaming:!0})}),f.jsx("div",{ref:Te,"aria-hidden":"true",className:"h-px w-full"})]})})}),f.jsx(fS,{open:te!==null,title:(te==null?void 0:te.title)??"Full text",text:(te==null?void 0:te.text)??"",onClose:()=>{H.current+=1,O(null)}})]})}function wb({open:e,title:t,label:n,value:r,busy:i=!1,onChange:l,onCancel:o,onSubmit:c}){if(T.useEffect(()=>{if(!e)return;function m(p){p.key==="Escape"&&!i&&o()}return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[i,o,e]),!e)return null;function d(m){m.preventDefault(),c()}return su.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[f.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"}),f.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":t,onSubmit:d,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:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),f.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),f.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:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.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"})})})]}),f.jsxs("div",{className:"mt-5",children:[f.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),f.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:r,onChange:m=>l(m.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"})]}),f.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[f.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"}),f.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 Rq(){return f.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:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Lq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.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 Iq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.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 bv({title:e,defaultOpen:t=!1,children:n}){const[r,i]=T.useState(t);return f.jsxs("section",{className:"border-t border-[var(--theme-border)] pt-4 first:border-t-0 first:pt-0",children:[f.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":r,className:"flex w-full items-center justify-between gap-3 text-left",children:[f.jsx("span",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:e}),f.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:r?"Hide":"Show"})]}),r&&f.jsx("div",{className:"mt-3",children:n})]})}function Oq({thread:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,showDeleteButton:c=!1,showSessionCopyButton:d=!1}){const[m,p]=T.useState("idle"),g=T.useRef(null),y=r[e.workspaceId],E=t===e.id;T.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);async function v(){const w=e.providerSessionId;if(w)try{await navigator.clipboard.writeText(w),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 f.jsxs("div",{role:"link",tabIndex:0,onClick:()=>i(e.id),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.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":""} ${d&&e.providerSessionId?"pb-4":""}`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.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}),f.jsx("button",{type:"button",onClick:w=>{w.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:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.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&&f.jsx("button",{type:"button",onClick:w=>{w.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:f.jsx(Iq,{})})]}),y&&!n&&f.jsx("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:y})]}),f.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.18em] ${DG(e.status)}`,children:hS(e.status)})]}),f.jsxs("div",{className:`mt-2 flex items-center justify-between gap-3 text-[11px] text-[var(--theme-fg-muted)] ${d&&e.providerSessionId?"pr-9":""}`,children:[f.jsx("time",{dateTime:e.lastTurnStartedAt??e.updatedAt,children:em(e.lastTurnStartedAt??e.updatedAt)}),f.jsx("span",{children:e.model??"No model"})]}),d&&e.providerSessionId&&f.jsx("button",{type:"button","aria-label":"Copy session ID",title:m==="copied"?"Copied":m==="failed"?"Copy failed":"Copy session ID",onClick:w=>{w.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 ${m==="copied"?"border-sky-300/40 bg-sky-300/16 text-sky-100":m==="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:f.jsx(Lq,{})})]})}function vS({threads:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,scrollable:c=!1,maxHeightClassName:d="max-h-full",showDeleteButton:m=!1,showSessionCopyButton:p=!1}){const g=c?`min-h-0 overflow-y-auto overscroll-contain pr-1 ${d}`:"";return f.jsx("div",{className:g,children:f.jsx("div",{className:"space-y-1.5",children:e.map(y=>f.jsx(Oq,{thread:y,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r,onOpenThread:i,onBeginRenameThread:l,showDeleteButton:m,showSessionCopyButton:p,...o?{onDeleteThread:o}:{}},y.id))})})}function kS({threads:e,status:t,loading:n=!1,error:r,viewportConstrained:i=!1,showMobileAppMenu:l=!0,showMobileThreadNavToggle:o=!0,showMobileNewThreadShortcut:c=!0,mobileHeaderAction:d,currentThreadId:m,currentThreadLabel:p=null,currentWorkspaceId:g=null,currentWorkspaceLabel:y=null,workspaceLabels:E={},metaContent:v,settingsContent:w,onRenameThread:C,children:S}){const[N,A]=T.useState(!1),[z,Y]=T.useState(null),[M,B]=T.useState(""),[G,ce]=T.useState(null),Q=Za(),he=Wl(),V=T.useMemo(()=>[...g?e.filter(te=>te.workspaceId===g):e].sort((te,O)=>{if(te.id===m)return-1;if(O.id===m)return 1;const we=Date.parse(te.lastTurnStartedAt??te.updatedAt);return Date.parse(O.lastTurnStartedAt??O.updatedAt)-we}),[m,g,e]),Te=y??(g?"Current workspace":"All threads"),me=p&&p.trim()?`${Te} / ${p.trim()}`:Te,ne=g?`/threads/new?workspaceId=${encodeURIComponent(g)}`:"/threads/new";async function H(U){if(!C)return;const te=M.trim();if(te){ce(U);try{await C(U,te),Y(null),B("")}finally{ce(null)}}}function F(U){Y(U.id),B(U.title)}function K(){Y(null),B("")}function oe(U){Q(`/threads/${U}`),A(!1),he==null||he.closeNav()}function R(){return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("section",{children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:"Thread List"}),f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}),f.jsx(ri,{to:ne,onClick:()=>{A(!1),he==null||he.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&&f.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&&V.length===0&&!n&&f.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."}),V.length>0&&f.jsx(vS,{threads:V,currentThreadId:m,currentWorkspaceId:g,workspaceLabels:E,onOpenThread:oe,onBeginRenameThread:F})]}),f.jsx(bv,{title:"Thread Meta",defaultOpen:!0,children:v??f.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"Select a thread to inspect metadata."})}),f.jsx(bv,{title:"Settings",children:w??f.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"No thread settings available."})})]})}return f.jsxs(f.Fragment,{children:[f.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:[f.jsx("div",{className:"lg:hidden",children:f.jsxs("div",{className:"relative",children:[f.jsxs("div",{className:`thread-topbar-surface grid h-10 items-center gap-1.5 border-b px-2.5 backdrop-blur ${l&&(c||d)?"grid-cols-[2.5rem_minmax(0,1fr)_auto]":l?"grid-cols-[2.5rem_minmax(0,1fr)]":"grid-cols-[minmax(0,1fr)]"}`,children:[l&&f.jsx(x1,{}),o?f.jsxs("button",{type:"button",onClick:()=>A(U=>!U),"aria-expanded":N,"aria-label":N?"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:me,children:[f.jsx("span",{className:"min-w-0 truncate",children:me}),f.jsx("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition ${N?"rotate-180":""}`,children:f.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:f.jsx("path",{d:"m4.5 6.25 3.5 3.5 3.5-3.5"})})})]}):f.jsx("p",{className:"min-w-0 truncate px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:me,children:me}),l&&(d||(c?f.jsxs(ri,{to:ne,onClick:()=>{he==null||he.closeNav(),A(!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:[f.jsx(Rq,{}),f.jsx("span",{className:"hidden sm:inline",children:"New"})]}):null))]}),l&&f.jsx(y1,{className:"absolute left-2 top-[calc(100%+0.45rem)] z-20 w-[min(18rem,calc(100vw-1rem))]"}),o&&N&&f.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:R()})]})}),f.jsx("aside",{className:"hidden min-h-0 lg:block",children:f.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:R()})}),f.jsx("section",{className:i?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":"min-w-0",children:S})]}),f.jsx(wb,{open:z!==null,title:"Rename Thread",label:"Thread Title",value:M,busy:G!==null,onChange:B,onCancel:K,onSubmit:()=>z?H(z):void 0})]})}const xv=10,Dq=1e3,jq=2e3,ag=5500,Mq=3e3,sg=0,Uo=1,Uf=3,Pq=["read-only","workspace-write","danger-full-access"];function Bq(e){return e.sandboxMode??(e.approvalMode==="guarded"?"workspace-write":"danger-full-access")}function Uq(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function Ho(e,t){const n=new Set(t.map(r=>r.id));return[...e.filter(r=>!n.has(r.id)),...t]}function gc(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}function wS(e){return`${e.threadId}:${e.objective}:${e.createdAt}`}function Hq(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 CS(e){const t=new Map;for(const n of e){const r=wS(n),i=t.get(r);t.set(r,i?Hq(i,n):n)}return[...t.values()].sort((n,r)=>Date.parse(r.updatedAt)-Date.parse(n.updatedAt))}function Hf(e,t){return CS([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 Fq(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 yv(e,t){if(!t)return null;const n=e.find(r=>r.model===t);return n?n.supportedReasoningEfforts.length>1:null}function $q(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`client-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function Vq(e,t){return(e==null?void 0:e.items.some(n=>n.kind==="userMessage"&&n.text.trim()===t))??!1}function Gq(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 qq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.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 Yq(){return f.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:[f.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"}),f.jsx("path",{d:"M9.25 2.5v2.25h2.25"}),f.jsx("path",{d:"M7 6.75v4"}),f.jsx("path",{d:"m5.45 9.35 1.55 1.55 1.55-1.55"})]})}function zf({status:e}){return f.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:[f.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"}),f.jsx("path",{d:"M4.75 9a4.95 4.95 0 0 1 6.5 0"}),f.jsx("path",{d:"M6.9 11.3a1.9 1.9 0 0 1 2.2 0"}),e==="connected"?f.jsx("path",{d:"m6.7 13.2.9.9 1.7-2"}):e==="offline"?f.jsx("path",{d:"M3 3l10 10"}):e==="detached"?null:f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M11.8 11.1a2.2 2.2 0 0 1-1.8 2.7"}),f.jsx("path",{d:"m10.7 11.35 1.3-.55-.55-1.3"})]})]})}function Wq(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 Qq(){var ea;const{id:e=""}=n5(),t=Za(),n=T.useRef(""),r=T.useRef(null),i=T.useRef(null),l=T.useRef(null),o=T.useRef(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(typeof navigator>"u"?!0:navigator.onLine),p=T.useRef(!1),g=T.useRef(null),y=T.useRef(null),E=T.useRef(0),v=T.useRef(0),w=T.useRef(null),C=T.useRef(null),S=T.useRef(null),[N,A]=T.useState(null),[z,Y]=T.useState([]),[M,B]=T.useState([]),[G,ce]=T.useState(null),[Q,he]=T.useState(null),[V,Te]=T.useState(null),[me,ne]=T.useState(""),[H,F]=T.useState(null),[K,oe]=T.useState(null),[R,U]=T.useState(!0),[te,O]=T.useState(0),[we,Re]=T.useState(!0),[Se,Ge]=T.useState(!1),[Fe,De]=T.useState(!1),[tt,dt]=T.useState("chat"),[Ct,bt]=T.useState({prompt:"",attachments:[]}),[At,Tt]=T.useState(!1),[ot,St]=T.useState(0),[Me,qe]=T.useState(0),[zt,mn]=T.useState(0),[Xt,yn]=T.useState(!1),[nt,lr]=T.useState(null),[ge,ve]=T.useState(!1),[Ye,rt]=T.useState(!1),[vt,En]=T.useState(!1),[kn,xe]=T.useState(null),[Oe,Ke]=T.useState("idle"),[Pe,it]=T.useState({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null}),[X,Ee]=T.useState(null),[at,Ue]=T.useState([]),[Be,gt]=T.useState({status:"idle",data:null,error:null}),[Pt,Je]=T.useState({status:"idle",data:null,error:null}),[$t,pt]=T.useState({status:"idle",data:null,error:null}),[Br,Yt]=T.useState({status:"idle",data:null,error:null}),[Xr,Zn]=T.useState({status:"idle",data:null,error:null}),[il,ii]=T.useState(!1),[ma,za]=T.useState(!1),[eo,ll]=T.useState(()=>new Set),[Rr,sn]=T.useState(!1),[Fn,Rn]=T.useState(!1),[li,Er]=T.useState({status:"idle",data:null,error:null}),[ts,Vt]=T.useState(null),Mn=((ea=V==null?void 0:V.hostConfigFiles.find($=>{var Z;return(Z=$.roles)==null?void 0:Z.includes("mcp")}))==null?void 0:ea.name)??null,pa=T.useCallback(()=>{const $=n.current;n.current="",r.current=null,$&&ne(Z=>Z+$)},[]),Jn=T.useCallback($=>{n.current+=$,r.current===null&&(r.current=window.requestAnimationFrame(()=>{pa()}))},[pa]),$n=T.useCallback(()=>{n.current="",r.current!==null&&(window.cancelAnimationFrame(r.current),r.current=null)},[]);T.useEffect(()=>{gt({status:"idle",data:null,error:null}),Je({status:"idle",data:null,error:null}),pt({status:"idle",data:null,error:null}),Yt({status:"idle",data:null,error:null}),Zn({status:"idle",data:null,error:null}),sn(!1),Er({status:"idle",data:null,error:null})},[e]);const ns=T.useCallback(async()=>{if(e){Er($=>({status:"loading",data:$.data,error:null}));try{const $=await h6(e);Er({status:"ready",data:$,error:null})}catch($){const Z=$ instanceof Qt?$.payload.message:"Unable to load export turns.";Er(de=>({status:"failed",data:de.data,error:Z}))}}},[e]);async function ga($){if(e){Vt(null),Rn(!0);try{const{blob:Z,filename:de}=await p6(e,$),Ie=URL.createObjectURL(Z),je=document.createElement("a");je.href=Ie,je.download=de,document.body.append(je),je.click(),je.remove(),window.setTimeout(()=>URL.revokeObjectURL(Ie),3e4),sn(!1)}catch(Z){const de=Z instanceof Qt?Z.payload.message:"Unable to export transcript.";Vt(de)}finally{Rn(!1)}}}async function _n(){if(e){Zn($=>{var Z;return{status:"loading",data:$.data??((Z=C.current)==null?void 0:Z.goal)??null,error:null}});try{const $=await C6(e);Zn({status:"ready",data:$.goal,error:null}),A(Z=>Z&&($.goal?{...Z,goal:$.goal,goalHistory:Hf(Z.goalHistory??[],$.goal)}:{...Z,goal:$.goal}))}catch($){Zn(Z=>({status:"failed",data:Z.data,error:$ instanceof Qt?$.payload.message:"Unable to load goal."}))}}}async function ks($){if(e){Zn(Z=>{var de;return{status:"loading",data:Z.data??((de=C.current)==null?void 0:de.goal)??null,error:null}});try{const Z=await S6(e,$);Zn({status:"ready",data:Z.goal,error:null}),A(de=>de&&(Z.goal?{...de,goal:Z.goal,goalHistory:Hf(de.goalHistory??[],Z.goal)}:{...de,goal:Z.goal}))}catch(Z){throw Zn(de=>({status:"failed",data:de.data,error:Z instanceof Qt?Z.payload.message:"Unable to update goal."})),Z}}}async function ol(){if(e){Zn($=>{var Z;return{status:"loading",data:$.data??((Z=C.current)==null?void 0:Z.goal)??null,error:null}});try{const $=await N6(e);Zn({status:"ready",data:null,error:null}),A(Z=>Z&&($.goalHistory?{...Z,goal:null,goalHistory:$.goalHistory}:{...Z,goal:null}))}catch($){throw Zn(Z=>({status:"failed",data:Z.data,error:$ instanceof Qt?$.payload.message:"Unable to clear goal."})),$}}}async function or($){za(!0);try{await ks({status:$})}finally{za(!1)}}async function rs(){za(!0);try{await ol()}finally{za(!1)}}async function Kr(){if(e){gt($=>({status:"loading",data:$.data,error:null}));try{const $=await R6(e);gt({status:"ready",data:$,error:null})}catch($){gt(Z=>({status:"failed",data:Z.data,error:$ instanceof Qt?$.payload.message:"Unable to load skills."}))}}}async function oi(){if(e){Je($=>({status:"loading",data:$.data,error:null}));try{const $=await L6(e);Je({status:"ready",data:$,error:null})}catch($){Je(Z=>({status:"failed",data:Z.data,error:$ instanceof Qt?$.payload.message:"Unable to load MCP servers."}))}}}async function ui(){if(e){pt($=>({status:"loading",data:$.data,error:null}));try{const $=await I6(e);pt({status:"ready",data:$,error:null})}catch($){pt(Z=>({status:"failed",data:Z.data,error:$ instanceof Qt?$.payload.message:"Unable to load hooks."}))}}}async function Fa($){if(e){pt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await O6(e,$);pt({status:"ready",data:Z,error:null})}catch(Z){throw pt(de=>({status:"failed",data:de.data,error:Z instanceof Qt?Z.payload.message:"Unable to create hook."})),Z}}}async function ba($){if(e){pt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await D6(e,$);pt({status:"ready",data:Z,error:null})}catch(Z){throw pt(de=>({status:"failed",data:de.data,error:Z instanceof Qt?Z.payload.message:"Unable to update hook."})),Z}}}async function Vn($){if(e){pt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await j6(e,$);pt({status:"ready",data:Z,error:null})}catch(Z){throw pt(de=>({status:"failed",data:de.data,error:Z instanceof Qt?Z.payload.message:"Unable to trust hook."})),Z}}}async function er($){if(e){pt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await M6(e,$);pt({status:"ready",data:Z,error:null})}catch(Z){throw pt(de=>({status:"failed",data:de.data,error:Z instanceof Qt?Z.payload.message:"Unable to untrust hook."})),Z}}}async function ur(){if(e){Yt($=>({status:"loading",data:$.data,error:null}));try{const $=await A6(e);Yt({status:"ready",data:$,error:null})}catch($){Yt(Z=>({status:"failed",data:Z.data,error:$ instanceof Qt?$.payload.message:"Unable to load turns for forking."}))}}}async function ci(){if(!e)return;const $=await d2(e,{mode:"latest"});Y(Z=>gc(Z,$.thread.thread)),t(`/threads/${$.thread.thread.id}`)}async function ln($){if(!e)return;const Z=await d2(e,{mode:"turn",turnId:$});Y(de=>gc(de,Z.thread.thread)),t(`/threads/${Z.thread.thread.id}`)}const ws=T.useCallback($=>{const Z=S.current,de=Z&&Object.keys(Z).length>0?{...$,thread:{...$.thread,...Z}}:$;C.current=de,F(de.livePlan??null),oe(de.liveItems??null),Zn($e=>$e.status==="idle"?$e:{...$e,data:de.goal??null});const Ie=de.thread.activeTurnId===null&&de.thread.status!=="running";A($e=>$e&&!de.goalHistory?{...de,turns:Ho($e.turns,de.turns),...$e.goalHistory?{goalHistory:$e.goalHistory}:{}}:$e?{...de,turns:Ho($e.turns,de.turns)}:de),Y($e=>gc($e,de.thread));const je=new Map(de.turns.map($e=>[$e.id,$e])),ht=new Set((de.pendingSteers??[]).map($e=>$e.clientRequestId).filter($e=>!!$e));Ue($e=>$e.filter(Cn=>{if(ht.has(Cn.clientRequestId))return!1;const bn=je.get(Cn.turnId);return!(!bn||Vq(bn,Cn.prompt)||de.thread.activeTurnId!==Cn.turnId&&bn.status!=="inProgress")})),Ee($e=>{if(!$e)return $e;const Cn=$e.serverTurnId??$e.id;return de.turns.some(ta=>ta.id===Cn)?null:$e}),(Ie||w.current&&de.turns.some($e=>$e.id===w.current))&&(w.current=null,$n(),ne(""),F(null),oe(null))},[$n]);T.useEffect(()=>{C.current=N},[N]);const as=T.useCallback(async({seedThread:$}={})=>{var ht,$e;const Z=v.current+1;v.current=Z;const[de,Ie,je]=await Promise.allSettled([Gv(),Vv(($==null?void 0:$.provider)??((ht=C.current)==null?void 0:ht.thread.provider)??"codex"),cg(($==null?void 0:$.provider)??(($e=C.current)==null?void 0:$e.thread.provider)??"codex")]);v.current===Z&&(de.status==="fulfilled"?Y($?gc(de.value,$):de.value):$&&Y(Cn=>gc(Cn,$)),Ie.status==="fulfilled"&&(ce(Ie.value.status),he(Ie.value.capabilities),Te(Ie.value.managementSchema)),je.status==="fulfilled"&&B(je.value))},[]),_r=T.useCallback(async({showLoading:$=!0,clearError:Z=!0,reportError:de=!0}={})=>{const Ie=E.current+1;E.current=Ie,$&&Re(!0),Z&&Vt(null);try{const je=await o2(e,{limit:xv});if(E.current!==Ie)return;ws(je)}catch(je){if(E.current!==Ie||!de)return;Vt(je instanceof Error?je.message:"Unable to load thread detail.")}finally{E.current===Ie&&Re(!1)}},[ws,e,as]),Pn=T.useCallback(()=>{var Cn;const $=((Cn=i.current)==null?void 0:Cn.readyState)??Uf,Z=$===Uo,de=m.current,Ie=Date.now(),je=c.current!==null&&Ie-Date.parse(c.current)<=ag,ht=d.current!==null&&Ie-d.current<=ag;let $e;de?Z&&je&&ht?$e="connected":$===sg||l.current!==null||je||ht||o.current?$e="reconnecting":$e="checking":$e="offline",it(bn=>bn.status===$e&&bn.browserOnline===de&&bn.healthOk===je&&bn.socketOpen===Z&&bn.lastHealthyAt===c.current?bn:{status:$e,browserOnline:de,healthOk:je,socketOpen:Z,lastHealthyAt:c.current})},[]);T.useEffect(()=>{E.current+=1,v.current+=1,A(null),bt({prompt:"",attachments:[]}),Ge(!1),Ke("idle"),Ee(null),Ue([]),oe(null),S.current=null,w.current=null,c.current=null,d.current=null,p.current=!1,m.current=typeof navigator>"u"?!0:navigator.onLine,it({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null})},[e]),T.useEffect(()=>{if(Oe==="idle")return;const $=window.setTimeout(()=>{Ke("idle")},Oe==="copied"?1200:1600);return()=>{window.clearTimeout($)}},[Oe]),T.useEffect(()=>{if(typeof document>"u")return;const{documentElement:$,body:Z}=document;return $.classList.add("thread-detail-scroll-locked"),Z.classList.add("thread-detail-scroll-locked"),()=>{$.classList.remove("thread-detail-scroll-locked"),Z.classList.remove("thread-detail-scroll-locked")}},[]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const $=window.matchMedia("(max-width: 639px)"),Z=()=>Tt($.matches);return Z(),$.addEventListener("change",Z),()=>{$.removeEventListener("change",Z)}},[]),T.useEffect(()=>{var Z,de;if(typeof window>"u")return;const $=()=>{const Ie=window.visualViewport,je=Ie?Math.max(0,Math.round(window.innerHeight-Ie.height-Ie.offsetTop)):0;mn(je),document.documentElement.style.setProperty("--thread-detail-keyboard-inset",`${je}px`)};return $(),(Z=window.visualViewport)==null||Z.addEventListener("resize",$),(de=window.visualViewport)==null||de.addEventListener("scroll",$),window.addEventListener("resize",$),()=>{var Ie,je;(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",$),(je=window.visualViewport)==null||je.removeEventListener("scroll",$),window.removeEventListener("resize",$),document.documentElement.style.removeProperty("--thread-detail-keyboard-inset")}},[]),T.useEffect(()=>{if(typeof document>"u")return;const $=()=>{const Z=document.activeElement,de=y.current,Ie=de==null?void 0:de.querySelector('[aria-label="Prompt"]');yn(!!(Z&&Ie&&(Z===Ie||Ie.contains(Z))))};return $(),document.addEventListener("focusin",$),document.addEventListener("focusout",$),()=>{document.removeEventListener("focusin",$),document.removeEventListener("focusout",$)}},[tt,N==null?void 0:N.thread.id,At]),T.useEffect(()=>{const $=y.current;if(!$||typeof ResizeObserver>"u")return;const Z=$.querySelector("form")??$,de=()=>{St(Math.max($.getBoundingClientRect().height,Z.getBoundingClientRect().height))};de();const Ie=new ResizeObserver(()=>{de()});return Ie.observe(Z),()=>{Ie.disconnect()}},[tt,At]),T.useEffect(()=>{var Ie,je;const $=y.current;if(!$||!At||tt!=="chat"){qe(0);return}const Z=()=>{const ht=$.getBoundingClientRect();qe(Math.max(0,Math.ceil(window.innerHeight-ht.top)))};Z(),window.addEventListener("resize",Z),(Ie=window.visualViewport)==null||Ie.addEventListener("resize",Z),(je=window.visualViewport)==null||je.addEventListener("scroll",Z);let de=null;return typeof ResizeObserver<"u"&&(de=new ResizeObserver(Z),de.observe($)),()=>{var ht,$e;window.removeEventListener("resize",Z),(ht=window.visualViewport)==null||ht.removeEventListener("resize",Z),($e=window.visualViewport)==null||$e.removeEventListener("scroll",Z),de==null||de.disconnect()}},[tt,N==null?void 0:N.thread.id,At,zt,Xt]),T.useEffect(()=>{_r({showLoading:!0}),as()},[as,_r]),T.useEffect(()=>{let $=!1,Z=null;const de=()=>{_r({showLoading:!1,clearError:!1,reportError:!1})},Ie=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},je=()=>{$||!m.current||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,!$&&bn()},Dq),Pn())},ht=()=>{const Ae=i.current;if(i.current=null,Ae)try{Ae.close()}catch{}},$e=Ae=>{if(Ae.threadId===e){if(Ae.type==="thread.output.delta"&&typeof Ae.payload.delta=="string"){const Ze=typeof Ae.payload.turnId=="string"?Ae.payload.turnId:null;Jn(Ae.payload.delta),Ze&&Ee(st=>st&&(st.serverTurnId===null||st.serverTurnId===Ze)?{...st,serverTurnId:Ze,id:Ze,status:st.status==="failed"?st.status:"inProgress",tokenUsage:st.tokenUsage}:st)}if(Ae.type==="thread.context.updated"){const Ze=Ae.payload.contextUsage&&typeof Ae.payload.contextUsage=="object"?Ae.payload.contextUsage:null;if(Ze){const st=Ze;A(an=>an&&{...an,thread:{...an.thread,contextUsage:st}}),Y(an=>an.map(It=>It.id===e?{...It,contextUsage:st}:It))}}if(Ae.type==="thread.turn.token.updated"&&typeof Ae.payload.turnId=="string"&&Ae.payload.tokenUsage&&typeof Ae.payload.tokenUsage=="object"){const Ze=Ae.payload.turnId,st=Ae.payload.tokenUsage,an=Ae.payload.priceEstimate&&typeof Ae.payload.priceEstimate=="object"?Ae.payload.priceEstimate:null;A(It=>{if(!It)return It;const tn=Gq(It.turns,Ze,st,an);return tn===It.turns?It:{...It,turns:tn}}),Ee(It=>It&&(It.serverTurnId===Ze||It.id===Ze)?{...It,tokenUsage:st,priceEstimate:an}:It)}if(Ae.type==="thread.turn.started"||Ae.type==="thread.turn.completed"||Ae.type==="thread.turn.failed"||Ae.type==="thread.updated"||Ae.type==="thread.goal.updated"||Ae.type==="thread.goal.cleared"||Ae.type==="thread.request.created"||Ae.type==="thread.request.resolved"){if(Ae.type==="thread.goal.updated"){const Ze=Ae.payload.goal&&typeof Ae.payload.goal=="object"?Ae.payload.goal:null,st=Array.isArray(Ae.payload.goalHistory)?Ae.payload.goalHistory:null;Zn({status:"ready",data:Ze,error:null}),A(an=>an&&(st?{...an,goal:Ze,goalHistory:st}:Ze?{...an,goal:Ze,goalHistory:Hf(an.goalHistory??[],Ze)}:{...an,goal:Ze}))}if(Ae.type==="thread.goal.cleared"){const Ze=Array.isArray(Ae.payload.goalHistory)?Ae.payload.goalHistory:null;Zn({status:"ready",data:null,error:null}),A(st=>st&&(Ze?{...st,goal:null,goalHistory:Ze}:{...st,goal:null}))}if(de(),Ae.type==="thread.turn.started"){$n(),ne(""),oe(null),w.current=null;const Ze=typeof Ae.payload.turnId=="string"?Ae.payload.turnId:null;Ze&&Ee(st=>st&&{...st,serverTurnId:Ze,id:Ze,status:st.status==="failed"?st.status:"inProgress",error:null,tokenUsage:st.tokenUsage})}if(Ae.type==="thread.turn.completed"||Ae.type==="thread.turn.failed"){oe(null);const Ze=typeof Ae.payload.turnId=="string"?Ae.payload.turnId:null;Ze&&(w.current=Ze,Ae.type==="thread.turn.failed"&&Ee(st=>st&&(st.serverTurnId===Ze||st.id===Ze)?{...st,status:"failed",error:typeof Ae.payload.error=="string"?Ae.payload.error:"Unable to complete the turn.",tokenUsage:st.tokenUsage}:st))}}if((Ae.type==="thread.item.started"||Ae.type==="thread.item.completed")&&Ae.payload.item&&typeof Ae.payload.item=="object"&&typeof Ae.payload.turnId=="string"){const Ze=Ae.payload.turnId,st=Ae.payload.item;typeof st.id=="string"&&typeof st.text=="string"&&oe(an=>{const tn=[...((an==null?void 0:an.turnId)===Ze?an.items:[]).filter(Ln=>Ln.id!==st.id),st].sort((Ln,In)=>{const Hr=typeof Ln.sequence=="number"&&Number.isFinite(Ln.sequence)?Ln.sequence:Number.POSITIVE_INFINITY,_a=typeof In.sequence=="number"&&Number.isFinite(In.sequence)?In.sequence:Number.POSITIVE_INFINITY;return Hr===_a?0:Hr-_a});return{turnId:Ze,items:tn,updatedAt:new Date().toISOString()}})}Ae.type==="thread.plan.updated"&&Array.isArray(Ae.payload.plan)&&F({turnId:String(Ae.payload.turnId??""),explanation:typeof Ae.payload.explanation=="string"?Ae.payload.explanation:null,plan:Ae.payload.plan})}},Cn=()=>{const Ae=i.current;if(!(!Ae||Ae.readyState!==Uo))try{Ae.send(JSON.stringify({type:"supervisor.ping",timestamp:new Date().toISOString()}))}catch{p.current=!0,ht(),je(),Pn()}},bn=()=>{var st;if($||!m.current){Pn();return}const Ae=((st=i.current)==null?void 0:st.readyState)??Uf;if(Ae===sg||Ae===Uo){Pn();return}const Ze=Yv($e);i.current=Ze,Pn(),Ze.addEventListener("message",an=>{if(i.current===Ze)try{const It=JSON.parse(an.data);(It.type==="supervisor.connected"||It.type==="supervisor.pong")&&(d.current=Date.now(),Pn())}catch{}}),Ze.addEventListener("open",()=>{i.current===Ze&&(p.current=!0,de(),Cn(),Pn())}),Ze.addEventListener("close",()=>{i.current===Ze&&(i.current=null),p.current=!0,je(),Pn()}),Ze.addEventListener("error",()=>{i.current===Ze&&(i.current=null),p.current=!0,je(),Pn()})},ta=async()=>{var Ae;if(!($||!m.current||o.current)){o.current=!0,Pn();try{await d6();const Ze=p.current;c.current=new Date().toISOString(),Ze&&(p.current=!1,de()),(((Ae=i.current)==null?void 0:Ae.readyState)??Uf)!==Uo&&bn()}catch{c.current=null,p.current=!0,je()}finally{o.current=!1,Pn()}}},Gn=()=>{m.current=!0,p.current=!0,Pn(),bn(),ta()},rn=()=>{m.current=!1,c.current=null,d.current=null,p.current=!0,Ie(),ht(),Pn()},Wt=()=>{var st;if($||!m.current){Pn();return}const Ae=((st=i.current)==null?void 0:st.readyState)??Uf,Ze=d.current===null?null:Date.now()-d.current;Ae===Uo&&Ze!==null&&Ze>ag?(p.current=!0,ht(),je()):Ae===Uo?Cn():Ae!==sg&&bn(),ta(),Pn()};return window.addEventListener("online",Gn),window.addEventListener("offline",rn),bn(),ta(),Z=window.setInterval(Wt,jq),()=>{$=!0,window.removeEventListener("online",Gn),window.removeEventListener("offline",rn),Ie(),Z!==null&&window.clearInterval(Z),$n(),ht()}},[$n,e,_r,Jn,Pn]),T.useEffect(()=>{if(!((N==null?void 0:N.thread.activeTurnId)!==null||(N==null?void 0:N.thread.status)==="running"||X!==null||at.length>0||me.length>0||H!==null||K!==null))return;const Z=window.setInterval(()=>{_r({showLoading:!1,clearError:!1,reportError:!1})},Mq);return()=>{window.clearInterval(Z)}},[N==null?void 0:N.thread.activeTurnId,N==null?void 0:N.thread.status,me.length,K,H,_r,at.length,X]);async function Tr(){var $;if(!(!N||N.turns.length===0||Se)){Ge(!0),Vt(null);try{const Z=($=N.turns[0])==null?void 0:$.id,de=await o2(e,{limit:xv,...Z?{beforeTurnId:Z}:{}});A(Ie=>Ie?{...de,turns:Uq(Ie.turns,de.turns)}:de),Y(Ie=>Ie.map(je=>je.id===de.thread.id?de.thread:je))}catch(Z){Vt(Z instanceof Error?Z.message:"Unable to load earlier turns.")}finally{Ge(!1)}}}async function Zr($){var ta,Gn;if(tt==="shell"){if((N==null?void 0:N.thread.isLoaded)===!1){await Cs({attachShell:!0});return}const rn=((ta=g.current)==null?void 0:ta.sendCommand($.prompt))??!1;Vt(rn?null:"Connect the shell before sending commands.");return}De(!0),Vt(null),O(rn=>rn+1);const Z=C.current,de=Z?{...Z.thread,...S.current??{}}:null,Ie=(de==null?void 0:de.model)??null,je=(de==null?void 0:de.reasoningEffort)??null,ht=$q(),$e=`optimistic-${Date.now()}`,Cn=`optimistic-steer-${ht}`,bn=new Date().toISOString();try{let rn=C.current;if(rn&&!rn.thread.isLoaded){const tn={...rn.thread,...S.current??{}},Ln=await u2(e,{...rn.thread.model?{model:rn.thread.model}:{},...rn.thread.sandboxMode?{sandboxMode:rn.thread.sandboxMode}:{}}),In={...Ln,thread:{...Ln.thread,model:tn.model??Ln.thread.model,reasoningEffort:tn.reasoningEffort??Ln.thread.reasoningEffort,collaborationMode:tn.collaborationMode??Ln.thread.collaborationMode,sandboxMode:tn.sandboxMode??Ln.thread.sandboxMode??null}};rn=In,C.current=In,A(Hr=>Hr?{...In,turns:Ho(Hr.turns,In.turns)}:In),Y(Hr=>Hr.map(_a=>_a.id===In.thread.id?In.thread:_a))}const Wt=rn?{...rn.thread,...S.current??{}}:null,Ae=(Wt==null?void 0:Wt.status)==="running"?Wt.activeTurnId:null,Ze=tt==="chat"&&!!Ae;Ze&&Ae?Ue(tn=>[...tn,{id:Cn,clientRequestId:ht,turnId:Ae,prompt:$.prompt,createdAt:bn,status:"steering"}]):($n(),ne(""),Ee({id:$e,serverTurnId:null,startedAt:bn,status:"sending",error:null,prompt:$.prompt,model:Ie,reasoningEffort:je,reasoningEffortAvailable:yv(M,Ie),tokenUsage:null,priceEstimate:null}));const st={prompt:$.prompt,clientRequestId:ht,...Wt!=null&&Wt.model?{model:Wt.model}:{},...Wt!=null&&Wt.reasoningEffort?{reasoningEffort:Wt.reasoningEffort}:{},...Wt!=null&&Wt.collaborationMode?{collaborationMode:Wt.collaborationMode}:{},...Wt!=null&&Wt.sandboxMode?{sandboxMode:Wt.sandboxMode}:{},...(Gn=$.attachments)!=null&&Gn.length?{attachments:$.attachments}:{}},an=await T6(e,st),It=S.current&&Object.keys(S.current).length>0?{...an,...S.current}:an;A(tn=>tn&&{...tn,thread:It}),Y(tn=>tn.map(Ln=>Ln.id===It.id?It:Ln)),Ze&&Ae?It.activeTurnId!==null&&It.activeTurnId!==Ae&&It.lastTurnStartedAt!==(Wt==null?void 0:Wt.lastTurnStartedAt)?($n(),ne(""),F(null),Ue(Ln=>Ln.filter(In=>In.id!==Cn)),Ee({id:$e,serverTurnId:It.activeTurnId,startedAt:It.lastTurnStartedAt??bn,status:"inProgress",error:null,prompt:$.prompt,model:Ie,reasoningEffort:je,reasoningEffortAvailable:yv(M,Ie),tokenUsage:null,priceEstimate:null})):Ue(Ln=>Ln.map(In=>In.id===Cn?{...In,turnId:It.activeTurnId??In.turnId,status:"accepted"}:In)):(Ee(tn=>tn&&tn.id===$e?{...tn,id:It.activeTurnId??tn.id,serverTurnId:It.activeTurnId??tn.serverTurnId,status:"inProgress",error:null,tokenUsage:tn.tokenUsage,priceEstimate:tn.priceEstimate}:tn),F(null)),bt({prompt:"",attachments:[]})}catch(rn){const Wt=rn instanceof Qt?rn.payload.message:rn instanceof Error?rn.message:"Unable to send prompt.";rn instanceof Qt?Vt(rn.payload.message):Vt(Wt),Ue(Ae=>Ae.filter(Ze=>Ze.clientRequestId!==ht)),Ee(Ae=>Ae&&Ae.id===$e?{...Ae,status:"failed",error:Wt}:Ae)}finally{De(!1)}}async function di(){const $=N==null?void 0:N.thread.providerSessionId;if($)try{await navigator.clipboard.writeText($),Ke("copied")}catch{Ke("failed")}}async function Cs($){if(N){De(!0),Vt(null),$n(),ne("");try{if(N.thread.isLoaded){const de=await _6(e);A(Ie=>Ie?{...de,turns:Ho(Ie.turns,de.turns)}:de),lr(null),Y(Ie=>Ie.map(je=>je.id===de.thread.id?de.thread:je)),ve(!1);return}const Z=await u2(e,{...N.thread.model?{model:N.thread.model}:{},...N.thread.sandboxMode?{sandboxMode:N.thread.sandboxMode}:{}});A(de=>de?{...Z,turns:Ho(de.turns,Z.turns)}:Z),Y(de=>de.map(Ie=>Ie.id===Z.thread.id?Z.thread:Ie)),$!=null&&$.attachShell&&tt==="shell"&&ve(!0)}catch(Z){Vt(Z instanceof Error?Z.message:"Unable to change connection state.")}finally{De(!1)}}}async function Ur(){var $;if(tt==="shell"){const Z=(($=g.current)==null?void 0:$.sendControl("ctrl_c"))??!1;Vt(Z?null:"Connect the shell before sending Ctrl-C.");return}De(!0),Vt(null);try{const Z=N!=null&&N.thread.activeTurnId?await c2(e,{turnId:N.thread.activeTurnId}):await c2(e);A(de=>de&&{...de,thread:Z}),Y(de=>de.map(Ie=>Ie.id===Z.id?Z:Ie)),$n(),ne("")}catch(Z){Vt(Z instanceof Error?Z.message:"Unable to interrupt turn.")}finally{De(!1)}}async function en($){if(!N)return;const Z=N,de={...S.current??{},...$.model!==void 0?{model:$.model}:{},...$.reasoningEffort!==void 0?{reasoningEffort:$.reasoningEffort}:{},...$.fastMode!==void 0?{fastMode:$.fastMode}:{},...$.collaborationMode!==void 0?{collaborationMode:$.collaborationMode}:{},...$.sandboxMode!==void 0?{sandboxMode:$.sandboxMode}:{}},Ie={...N.thread,...de};rt(!0),S.current=de,C.current={...N,thread:Ie},A(je=>je&&{...je,thread:Ie}),Y(je=>je.map(ht=>ht.id===Ie.id?{...ht,...Ie}:ht));try{const je=await k6(e,{...$.model!==void 0?{model:$.model}:{},...$.reasoningEffort!==void 0?{reasoningEffort:$.reasoningEffort}:{},...$.fastMode!==void 0?{fastMode:$.fastMode}:{},...$.collaborationMode!==void 0?{collaborationMode:$.collaborationMode}:{},...$.sandboxMode!==void 0?{sandboxMode:$.sandboxMode}:{}});S.current=null,C.current=Z?{...Z,thread:je}:null,A(ht=>ht&&{...ht,thread:je}),Y(ht=>ht.map($e=>$e.id===je.id?je:$e))}catch(je){S.current=null,C.current=Z,A(Z),Y(ht=>ht.map($e=>$e.id===Z.thread.id?Z.thread:$e)),Vt(je instanceof Error?je.message:"Unable to update thread settings.")}finally{rt(!1)}}async function xa($,Z){xe($),Vt(null);try{const de=await P6(e,$,Z);A(Ie=>Ie?{...de,turns:Ho(Ie.turns,de.turns)}:de),F(de.livePlan??null),oe(de.liveItems??null)}catch(de){Vt(de instanceof Error?de.message:"Unable to answer this request.")}finally{xe(null)}}async function pr(){if(N){En(!0),Vt(null);try{const $=await w6(e);A(Z=>Z&&{...Z,thread:$}),Y(Z=>Z.map(de=>de.id===$.id?$:de))}catch($){Vt($ instanceof Error?$.message:"Unable to compact this thread context.")}finally{En(!1)}}}async function bu($,Z){try{const de=await qv($,{title:Z});Y(Ie=>Ie.map(je=>je.id===de.id?{...je,title:de.title,updatedAt:de.updatedAt}:je)),A(Ie=>Ie&&Ie.thread.id===de.id?{...Ie,thread:{...Ie.thread,title:de.title,updatedAt:de.updatedAt}}:Ie)}catch(de){throw Vt(de instanceof Error?de.message:"Unable to rename thread."),de}}function fi(){dt($=>$==="chat"?(N!=null&&N.thread.isLoaded&&ve(!0),"shell"):"chat")}async function hi(){var Z;const $=await((Z=g.current)==null?void 0:Z.copyLastCommandOutput());Vt($?null:"Unable to copy the last shell command output.")}function Ss($){var de,Ie;const Z=$==="clear"?((de=g.current)==null?void 0:de.sendCommand("clear"))??!1:((Ie=g.current)==null?void 0:Ie.sendControl($))??!1;Vt(Z?null:"Connect the shell before sending control input.")}T.useEffect(()=>{if(!(!ge||tt!=="shell"||!g.current||(N==null?void 0:N.thread.isLoaded)===!1||(nt==null?void 0:nt.loading)!==!1)){if((nt==null?void 0:nt.status)==="attached"){ve(!1);return}ve(!1),g.current.toggleConnection()}},[tt,N==null?void 0:N.thread.isLoaded,ge,nt==null?void 0:nt.loading,nt==null?void 0:nt.status]),T.useEffect(()=>{if(tt!=="shell")return;const $=window.requestAnimationFrame(()=>{var Z;(Z=g.current)==null||Z.refreshLayout({focus:!0})});return()=>{window.cancelAnimationFrame($)}},[tt]);const mi=N&&N.workspacePathStatus==="missing"?"Restore this workspace path on the current machine before continuing.":null,ul=At&&tt==="chat",ss=ul&&Xt?zt:0,Lr=Math.max(ot,144),pi=Math.max(Me,Lr+ss),gi=ul?pi+12:0,$a=N?f.jsxs("dl",{className:"space-y-4 text-sm",children:[f.jsxs("div",{className:"relative pr-9",children:[f.jsx("dt",{className:"text-stone-500",children:"Session ID"}),f.jsx("dd",{className:"mt-1 break-all text-stone-100",children:N.thread.providerSessionId??"Unavailable"}),N.thread.providerSessionId&&f.jsx("button",{type:"button","aria-label":"Copy session ID",title:Oe==="copied"?"Copied":Oe==="failed"?"Copy failed":"Copy session ID",onClick:()=>void di(),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 ${Oe==="copied"?"ui-status-info":Oe==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:f.jsx("span",{className:"scale-[0.72]",children:f.jsx(qq,{})})})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Source"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.source==="local_codex_import"?`Imported local ${N.thread.provider} session`:`${N.thread.provider} supervisor thread`})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Status"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:hS(N.thread.status)})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Created"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:Ko(N.thread.createdAt)})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Workspace"}),f.jsx("dd",{className:"mt-1 break-words text-stone-100",children:N.workspace.absPath})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Workspace path"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.workspacePathStatus==="present"?"Present":"Missing on this machine"})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Active turn"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.activeTurnId??"None"})]})]}):null,ya=N?f.jsx("div",{className:"space-y-3",children:f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-stone-500",children:"Sandbox Mode"}),f.jsx("div",{className:"mt-2 space-y-1.5",children:Pq.map($=>{const Z=Bq(N.thread)===$;return f.jsx("button",{type:"button",disabled:Ye,onClick:()=>void en({sandboxMode:$}),className:`block w-full rounded-xl border px-3 py-2 text-left text-sm transition ${Z?"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:$},$)})})]})}):null,bi=X&&!(N!=null&&N.turns.some($=>$.id===(X.serverTurnId??X.id)))?{id:X.id,startedAt:X.startedAt,status:X.status,error:X.error,model:X.model,reasoningEffort:X.reasoningEffort,reasoningEffortAvailable:X.reasoningEffortAvailable,tokenUsage:X.tokenUsage,priceEstimate:X.priceEstimate,items:[{id:`${X.id}-user-message`,kind:"userMessage",text:X.prompt}]}:null,Ea=(N==null?void 0:N.thread.isLoaded)??!1,Ns=Ea?Pe.status==="connected"?"ui-action-success shadow-lg shadow-stone-950/20":Pe.status==="reconnecting"?"thread-live-connection-reconnecting ui-status-success shadow-lg shadow-stone-950/20":Pe.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",is=Wq(Ea,Pe),vr=[is,Ea?null:"Tap to connect this thread",Pe.lastHealthyAt?`Last healthy ${Ko(Pe.lastHealthyAt)}`:null].filter(Boolean).join(" · "),cl=Ea?f.jsx("div",{role:"status","aria-live":"polite","aria-label":is,title:vr,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${Ns}`,children:f.jsx(zf,{status:Pe.status})}):f.jsx("button",{type:"button",onClick:()=>void Cs(),disabled:Fe||!N,"aria-label":Fe?"Connecting thread":"Connect thread",title:Fe?"Connecting thread":vr,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${Ns}`,children:f.jsx(zf,{status:"detached"})}),As=Ea?f.jsx("div",{title:vr,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${Ns}`,children:f.jsx(zf,{status:Pe.status})}):f.jsx("button",{type:"button",onClick:()=>void Cs(),disabled:Fe||!N,title:Fe?"Connecting thread":vr,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${Ns}`,children:f.jsx(zf,{status:"detached"})}),Jr=Xr.data??(N==null?void 0:N.goal)??null,xi=(N==null?void 0:N.goalHistory)??[],Rs=Jr?Hf(xi,Jr):CS(xi),to=f.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:[f.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),f.jsx("circle",{cx:"8",cy:"8",r:"2"}),f.jsx("path",{d:"M8 1.7v2M8 12.3v2M1.7 8h2M12.3 8h2"})]}),Ls=il?f.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:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-semibold",children:"Goal monitor"}),f.jsx("p",{className:"text-xs text-stone-500",children:"Current thread only"})]}),f.jsx("button",{type:"button",onClick:()=>ii(!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"})]}),Xr.error?f.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:Xr.error}):null,f.jsx("div",{className:"mt-3 max-h-[28rem] space-y-2 overflow-auto pr-1",children:Rs.length===0?f.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."}):Rs.map($=>{const Z=wS($),de=eo.has(Z),Ie=["active","paused","budgetLimited"].includes($.status);return f.jsxs("div",{className:`rounded-2xl border px-3 py-3 ${Ie?"ui-status-info":"border-stone-800 bg-stone-900/60"}`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsx("button",{type:"button",onClick:()=>ll(je=>{const ht=new Set(je);return ht.has(Z)?ht.delete(Z):ht.add(Z),ht}),className:"min-w-0 flex-1 text-left",children:f.jsx("p",{className:`text-sm font-medium leading-5 ${de?"":"line-clamp-2"}`,children:$.objective})}),f.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:$.status})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] text-stone-400",children:[f.jsx("span",{children:Fq($.timeUsedSeconds)}),f.jsx("span",{children:zq($)}),f.jsxs("span",{title:Ko($.updatedAt),children:["Updated ",new Date($.updatedAt).toLocaleTimeString()]})]}),Ie?f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[f.jsx("button",{type:"button",disabled:ma||$.status==="active",onClick:()=>void or("active"),className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-50",children:"Continue"}),f.jsx("button",{type:"button",disabled:ma||$.status==="paused",onClick:()=>void or("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"}),f.jsx("button",{type:"button",disabled:ma,onClick:()=>void rs(),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]},Z)})})]}):null,Is=f.jsx("button",{type:"button","aria-label":"Open goal monitor",title:"Open goal monitor",onClick:()=>{ii($=>!$),_n()},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:to}),dl=f.jsx("button",{type:"button","aria-label":"Export transcript",title:"Export transcript",onClick:()=>sn(!0),disabled:!N,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:f.jsx(Yq,{})}),wn=f.jsxs("div",{className:"relative flex items-center justify-end gap-1.5",children:[dl,Is,cl]});return f.jsx(kS,{threads:z,status:G,loading:we,error:we?null:ts,viewportConstrained:!0,currentThreadId:N==null?void 0:N.thread.id,currentThreadLabel:N==null?void 0:N.thread.title,currentWorkspaceId:N==null?void 0:N.thread.workspaceId,currentWorkspaceLabel:N==null?void 0:N.workspace.label,metaContent:$a,settingsContent:ya,showMobileNewThreadShortcut:!1,mobileHeaderAction:wn,onRenameThread:bu,children:f.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:[f.jsx("div",{className:"pointer-events-none absolute right-4 top-4 z-30 hidden lg:block",children:f.jsx("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[dl,Is,As]})})}),Ls?f.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:top-16 lg:right-4",children:Ls}):null,ts&&!we&&f.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:ts}),we?f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Loading thread detail..."}):N?f.jsxs(f.Fragment,{children:[N.workspacePathStatus==="missing"&&f.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:[f.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),f.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:N.workspace.absPath})]}),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:tt==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:[f.jsx(Aq,{threadId:N.thread.id,turns:N.turns,totalTurnCount:N.totalTurnCount??N.turns.length,pendingRequests:N.pendingRequests,livePlan:H,liveItems:K,respondingRequestId:kn,onRespondToRequest:xa,liveOutput:me,scrollRequestKey:te,bottomSpacer:gi,className:"thread-timeline-surface min-h-0 flex-1",onTailVisibilityChange:U,loadingEarlier:Se,onLoadEarlier:Tr,onLoadHistoryItemDetail:$=>f6(N.thread.id,$),answeredRequestNotes:N.answeredRequestNotes??[],activityNotes:N.activityNotes??[],pendingSteers:N.pendingSteers??[],optimisticSteers:at,optimisticTurn:bi}),ul?f.jsx("div",{ref:y,className:"fixed inset-x-0 bottom-0 z-30 sm:hidden",style:{bottom:`${ss}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:f.jsx(f0,{activeView:tt,edgeToEdgeMobile:!0,busy:tt==="chat"?Fe:!1,settingsBusy:Ye,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:M,contextUsage:N.thread.contextUsage,capabilities:Q,toolboxItems:(V==null?void 0:V.toolboxItems)??[],hookCommandTemplates:(V==null?void 0:V.hookCommandTemplates)??[],followTail:R,threadConnected:N.thread.isLoaded,disabled:!!mi,disabledPlaceholder:mi??void 0,shellControlState:nt,draftPrompt:Ct.prompt,draftAttachments:Ct.attachments,onDraftChange:bt,canInterrupt:!!N.thread.activeTurnId,onSubmit:Zr,onInterrupt:Ur,onCompact:pr,onOpenForkTurns:ur,onForkLatest:ci,onForkTurn:ln,onOpenSkills:Kr,onOpenMcp:oi,onOpenHooks:ui,onCreateHook:Fa,onUpdateHook:ba,onTrustHook:Vn,onUntrustHook:er,goalState:Xr,onOpenGoal:_n,onUpdateGoal:ks,onReadProviderConfig:Mn?()=>dg(N.thread.provider,Mn):void 0,onWriteProviderConfig:Mn?$=>fg(N.thread.provider,Mn,{content:$}):void 0,onToggleFollow:()=>O($=>$+1),onUpdateSettings:en,onToggleView:fi,onShellCopy:hi,onShellControl:Ss,compactBusy:vt,skillsState:Be,mcpState:Pt,hooksState:$t,forkTurnOptionsState:Br})}):f.jsx("div",{ref:y,children:f.jsx(f0,{activeView:tt,busy:tt==="chat"?Fe:!1,settingsBusy:Ye,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:M,contextUsage:N.thread.contextUsage,capabilities:Q,toolboxItems:(V==null?void 0:V.toolboxItems)??[],hookCommandTemplates:(V==null?void 0:V.hookCommandTemplates)??[],followTail:R,threadConnected:N.thread.isLoaded,disabled:!!mi,disabledPlaceholder:mi??void 0,shellControlState:nt,draftPrompt:Ct.prompt,draftAttachments:Ct.attachments,onDraftChange:bt,canInterrupt:!!N.thread.activeTurnId,onSubmit:Zr,onInterrupt:Ur,onCompact:pr,onOpenForkTurns:ur,onForkLatest:ci,onForkTurn:ln,onOpenSkills:Kr,onOpenMcp:oi,onOpenHooks:ui,onCreateHook:Fa,onUpdateHook:ba,onTrustHook:Vn,onUntrustHook:er,goalState:Xr,onOpenGoal:_n,onUpdateGoal:ks,onReadProviderConfig:Mn?()=>dg(N.thread.provider,Mn):void 0,onWriteProviderConfig:Mn?$=>fg(N.thread.provider,Mn,{content:$}):void 0,onToggleFollow:()=>O($=>$+1),onUpdateSettings:en,onToggleView:fi,onShellCopy:hi,onShellControl:Ss,compactBusy:vt,skillsState:Be,mcpState:Pt,hooksState:$t,forkTurnOptionsState:Br})})]}),f.jsxs("div",{className:tt==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[N.thread.isLoaded&&f.jsx(O4,{ref:g,threadId:N.thread.id,isVisible:tt==="shell",showHeader:!1,showFloatingToolbox:!1,onStateChange:lr}),tt==="shell"&&!N.thread.isLoaded&&f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:f.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[f.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})}),tt==="shell"&&f.jsx(f0,{activeView:tt,busy:Fe,settingsBusy:!1,error:N.thread.isLoaded?(nt==null?void 0:nt.error)??null:null,followTail:!1,capabilities:Q,toolboxItems:(V==null?void 0:V.toolboxItems)??[],hookCommandTemplates:(V==null?void 0:V.hookCommandTemplates)??[],threadConnected:N.thread.isLoaded,shellControlState:nt,canInterrupt:!!(N.thread.isLoaded&&(nt!=null&&nt.isCommandRunning)),onSubmit:Zr,onInterrupt:Ur,onToggleView:fi,onShellCopy:hi,onShellControl:Ss})]})]})]}):f.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."}),f.jsx(Z6,{open:Rr,busy:Fn,turnsState:li,onCancel:()=>{Fn||sn(!1)},onLoadTurns:ns,onExport:ga})]})})}function Xq(){const e=Za(),[t,n]=T.useState(""),[r,i]=T.useState(!1),[l,o]=T.useState(null);async function c(d){d.preventDefault();const m=t.trim();if(!m){o("Session ID is required.");return}i(!0),o(null);try{const p=await x6(m);e(`/threads/${p.thread.id}`)}catch(p){p instanceof Qt?o(p.payload.message):o(p instanceof Error?p.message:"Unable to import session.")}finally{i(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Import Session"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Bring in a local Codex session"}),f.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."}),f.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."})]}),f.jsxs("form",{onSubmit:c,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"session-id",className:"text-sm font-medium text-stone-200",children:"Local session ID"}),f.jsx("input",{id:"session-id",value:t,onChange:d=>n(d.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&&f.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}),f.jsx("div",{className:"flex flex-wrap items-center gap-3",children:f.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 ig(e){return e.enabled&&e.capabilities.sessions.resume&&e.capabilities.turns.start}function Kq(){const e=Za(),t=Wl(),[n]=Hv(),[r,i]=T.useState([]),[l,o]=T.useState([]),[c,d]=T.useState([]),[m,p]=T.useState((t==null?void 0:t.defaultBackend)??"codex"),[g,y]=T.useState(""),[E,v]=T.useState(""),[w,C]=T.useState(""),[S,N]=T.useState("yolo"),[A,z]=T.useState(!0),[Y,M]=T.useState(!1),[B,G]=T.useState(null),ce=n.get("workspaceId");T.useEffect(()=>{Promise.all([b1(),Fv(),$v()]).then(async([V,Te,me])=>{var R,U,te,O;const ne=me.filter(ig),H=((R=ne[0])==null?void 0:R.provider)??"codex",F=ne.some(we=>we.provider===Te.defaultBackend)?Te.defaultBackend:H;t==null||t.setDefaultBackend(F),p(F),o(me);const K=await cg(F);i(V),d(K);const oe=V.some(we=>we.id===ce)?ce:((U=V[0])==null?void 0:U.id)??"";y(oe),v(((te=K.find(we=>we.isDefault))==null?void 0:te.model)??((O=K[0])==null?void 0:O.model)??"")}).catch(V=>{G(V instanceof Error?V.message:"Unable to load creation form data.")}).finally(()=>{z(!1)})},[ce,t]),T.useEffect(()=>{if(!m)return;let V=!1;return cg(m).then(Te=>{var me,ne;V||(d(Te),v(((me=Te.find(H=>H.isDefault))==null?void 0:me.model)??((ne=Te[0])==null?void 0:ne.model)??""))}).catch(Te=>{V||G(Te instanceof Error?Te.message:"Unable to load backend models.")}),()=>{V=!0}},[m]);function Q(){if(window.history.length>1){e(-1);return}if(ce){e(`/threads?workspaceId=${encodeURIComponent(ce)}`);return}e("/workspaces")}async function he(V){V.preventDefault(),M(!0),G(null);try{const Te=await b6(w.trim()?{workspaceId:g,provider:m,model:E,approvalMode:S,title:w.trim()}:{workspaceId:g,provider:m,model:E,approvalMode:S});e(`/threads/${Te.id}`)}catch(Te){Te instanceof Qt?G(Te.payload.message):G(Te instanceof Error?Te.message:"Unable to create thread.")}finally{M(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"New Thread"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Start a backend session"}),f.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."})]}),A?f.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..."}):f.jsxs("form",{onSubmit:he,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-backend",children:"Backend"}),f.jsx("select",{id:"thread-backend",value:m,onChange:V=>{const Te=V.target.value;p(Te),t==null||t.setDefaultBackend(Te)},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(V=>f.jsxs("option",{value:V.provider,disabled:!ig(V),children:[V.displayName,ig(V)?"":" (not available)"]},V.provider))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-workspace",children:"Workspace"}),f.jsx("select",{id:"thread-workspace",value:g,onChange:V=>y(V.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(V=>f.jsxs("option",{value:V.id,children:[V.label," · ",V.absPath]},V.id))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-model",children:"Model"}),f.jsx("select",{id:"thread-model",value:E,onChange:V=>v(V.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(V=>f.jsxs("option",{value:V.model,children:[V.displayName," · ",V.model]},V.id))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-title",children:"Title"}),f.jsx("input",{id:"thread-title",value:w,onChange:V=>C(V.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"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-approval-mode",children:"Approval mode"}),f.jsxs("select",{id:"thread-approval-mode",value:S,onChange:V=>N(V.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:[f.jsx("option",{value:"yolo",children:"yolo"}),f.jsx("option",{value:"guarded",children:"guarded"})]})]}),B&&f.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}),f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.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"}),f.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 SS({open:e,title:t,description:n,confirmLabel:r="Delete",busy:i=!1,onCancel:l,onConfirm:o}){return T.useEffect(()=>{if(!e)return;function c(d){d.key==="Escape"&&!i&&l()}return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[i,l,e]),e?su.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[f.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"}),f.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:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),f.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:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.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"})})})]}),f.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[f.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"}),f.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 Zq(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function Jq(){const[e]=Hv(),t=Za(),n=Wl(),r=e.get("workspaceId"),[i,l]=T.useState([]),[o,c]=T.useState([]),[d,m]=T.useState(null),[p,g]=T.useState(!0),[y,E]=T.useState(null),[v,w]=T.useState(null),[C,S]=T.useState(""),[N,A]=T.useState(null),[z,Y]=T.useState(null),[M,B]=T.useState(!1);async function G(){g(!0),E(null);try{const[K,oe,R]=await Promise.all([Vv((n==null?void 0:n.defaultBackend)??"codex").then(U=>U.status),Gv(),b1()]);m(K),l(oe),c(R)}catch(K){E(K instanceof Error?K.message:"Unable to load threads.")}finally{g(!1)}}T.useEffect(()=>{if(r===null)return;G();const K=Yv(oe=>{l(R=>R.map(U=>U.id===oe.threadId?{...U,status:typeof oe.payload.status=="string"?oe.payload.status:U.status,lastError:typeof oe.payload.error=="string"?oe.payload.error:U.lastError,title:typeof oe.payload.title=="string"?oe.payload.title:U.title}:U))});return()=>{K.close()}},[r,n==null?void 0:n.defaultBackend]);const ce=Object.fromEntries(o.map(K=>[K.id,K.label])),Q=o.find(K=>K.id===r)??null,he=T.useMemo(()=>r?i.filter(K=>K.workspaceId===r):[],[r,i]),V=he.filter(K=>K.status==="running").length,Te=r?`/threads/new?workspaceId=${encodeURIComponent(r)}`:"/threads/new";if(r===null)return f.jsx(g5,{to:"/workspaces",replace:!0});function me(){switch(d==null?void 0:d.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 ne(K,oe){try{const R=await qv(K,{title:oe});l(U=>U.map(te=>te.id===R.id?{...te,title:R.title,updatedAt:R.updatedAt}:te))}catch(R){throw E(R instanceof Error?R.message:"Unable to rename thread."),R}}async function H(){if(!v)return;const K=C.trim();if(K){A(v);try{await ne(v,K),w(null),S("")}finally{A(null)}}}async function F(){if(z){B(!0);try{await v6(z.id),l(K=>K.filter(oe=>oe.id!==z.id)),Y(null)}catch(K){E(K instanceof Error?K.message:"Unable to delete thread.")}finally{B(!1)}}}return f.jsx(kS,{threads:i,workspaceLabels:ce,status:d,loading:p,error:y,viewportConstrained:r!==null,showMobileAppMenu:!0,showMobileThreadNavToggle:!1,showMobileNewThreadShortcut:!1,currentWorkspaceId:r,currentWorkspaceLabel:(Q==null?void 0:Q.label)??null,onRenameThread:ne,children:f.jsxs(f.Fragment,{children:[f.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:[f.jsx("div",{className:"border-b border-stone-800 px-4 py-3 sm:px-6 sm:py-4",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.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"}),f.jsx(ri,{to:Te,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"})]})}),f.jsx("div",{className:"px-4 py-3 sm:px-6 sm:py-4",children:f.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:[f.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 shrink-0 rounded-full ${me()}`}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.22em] text-stone-500",children:"Supervisor"}),f.jsx("p",{className:"truncate text-sm text-stone-200",children:(d==null?void 0:d.lastError)??((d==null?void 0:d.state)==="ready"?"Ready":(d==null?void 0:d.state)??"Checking")})]})]})}),!p&&!y&&he.length>0&&f.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:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-stone-500",children:"Recent Threads"}),f.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:[he.length," total"]}),V>0&&f.jsxs("span",{className:"text-xs text-stone-500",children:["· ",V," running"]})]}),f.jsx("div",{className:"mt-3 min-h-0 flex-1",children:f.jsx(vS,{threads:he,currentWorkspaceId:r,workspaceLabels:ce,onOpenThread:K=>t(`/threads/${K}`),onBeginRenameThread:K=>{w(K.id),S(K.title)},onDeleteThread:K=>Y(K),scrollable:!0,maxHeightClassName:"max-h-full",showDeleteButton:!0,showSessionCopyButton:!0})})]}),!p&&!y&&he.length===0&&f.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."})]}),f.jsx(wb,{open:v!==null,title:"Rename Thread",label:"Thread Title",value:C,busy:N!==null,onChange:S,onCancel:()=>{w(null),S("")},onSubmit:()=>void H()}),f.jsx(SS,{open:z!==null,title:"Delete Thread",description:z?`Delete ${Zq(z.title)} from supervisor. The backend session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:M,onCancel:()=>{M||Y(null)},onConfirm:()=>void F()})]})})}function Ev(e){const t=e.trim(),n=t.replace(/[\\/]+$/,"");if(!n)return"";if(NS(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 NS(e){const t=e.trim();return/^https?:\/\/.+/i.test(t)||/^ssh:\/\/.+/i.test(t)||/^git@[^:]+:.+/.test(t)}function eY({initialPath:e="",initialLabel:t="",submitLabel:n="Save Workspace",error:r,busy:i=!1,onSubmit:l}){const o=Ev(e),[c,d]=T.useState(e),[m,p]=T.useState(t||o),[g,y]=T.useState(null),E=T.useRef(o);T.useEffect(()=>{const w=Ev(c);p(C=>!C.trim()||C===E.current?w:C),E.current=w},[c]);async function v(w){w.preventDefault();const C=c.trim();if(!C){y("Workspace path or Git URL is required.");return}y(null);const S=m.trim(),N=NS(C)?"gitUrl":"absPath";await l(S?{[N]:C,label:S}:{[N]:C})}return f.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"workspace-path",className:"text-sm font-medium text-stone-200",children:"Path or Git URL"}),f.jsx("input",{id:"workspace-path",name:"absPath",value:c,onChange:w=>d(w.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"}),f.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Absolute paths register local directories. Git URLs clone into the configured dev home."})]}),f.jsxs("div",{children:[f.jsx("label",{htmlFor:"workspace-label",className:"text-sm font-medium text-stone-200",children:"Display label"}),f.jsx("input",{id:"workspace-label",name:"label",value:m,onChange:w=>p(w.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"}),f.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Defaults to the last folder name. You can override it."})]}),(g||r)&&f.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}),f.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 tY(){const e=Za(),[t,n]=T.useState(null),[r,i]=T.useState(!1);async function l(o){i(!0),n(null);try{const c=await B6(o);e(`/threads?workspaceId=${encodeURIComponent(c.id)}`)}catch(c){c instanceof Qt?n(c.payload.message):n(c instanceof Error?c.message:"Unable to create workspace.")}finally{i(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Add Workspace"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Create a workspace"}),f.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."})]}),f.jsx(eY,{busy:r,error:t,submitLabel:"Create Workspace",onSubmit:l})]})}function _v(e){return Date.parse(e.lastOpenedAt??e.createdAt)}function nY(e,t){return e.isFavorite!==t.isFavorite?e.isFavorite?-1:1:_v(t)-_v(e)}function rY(e){return e?new Date(e).toLocaleString():"Never opened"}function aY(e,t=28){return e.length<=t?e:`...${e.slice(-(t-3))}`}function sY({active:e}){return f.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:f.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 iY(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.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 lY(){const e=Za(),[t,n]=T.useState([]),[r,i]=T.useState(!0),[l,o]=T.useState(null),[c,d]=T.useState(null),[m,p]=T.useState(""),[g,y]=T.useState(null),[E,v]=T.useState(null),[w,C]=T.useState(null),[S,N]=T.useState(!1);async function A(){i(!0),o(null);try{n(await b1())}catch(V){o(V instanceof Error?V.message:"Unable to load workspaces.")}finally{i(!1)}}T.useEffect(()=>{A()},[]);async function z(V){const Te={...V,isFavorite:!V.isFavorite};n(me=>me.map(ne=>ne.id===V.id?Te:ne));try{const me=await z6(V.id,{isFavorite:!V.isFavorite});n(ne=>ne.map(H=>H.id===me.id?me:H))}catch(me){n(ne=>ne.map(H=>H.id===V.id?V:H)),o(me instanceof Error?me.message:"Unable to update workspace.")}}async function Y(V){const Te=m.trim();if(Te){y(V);try{const me=await U6(V,{label:Te});n(ne=>ne.map(H=>H.id===me.id?me:H)),d(null),p("")}catch(me){o(me instanceof Error?me.message:"Unable to rename workspace.")}finally{y(null)}}}function M(V){d(V.id),p(V.label)}function B(){d(null),p("")}function G(V){e(`/threads?workspaceId=${encodeURIComponent(V)}`)}async function ce(){if(w){N(!0);try{await H6(w.id),n(V=>V.filter(Te=>Te.id!==w.id)),C(null)}catch(V){o(V instanceof Error?V.message:"Unable to delete workspace.")}finally{N(!1)}}}function Q(V,Te){(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),G(Te))}const he=T.useMemo(()=>[...t].sort(nY),[t]);return f.jsxs("div",{className:"space-y-4",children:[f.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:f.jsxs("div",{className:"relative",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-2",children:[f.jsx(x1,{}),f.jsx(ri,{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"}),f.jsx(ri,{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"}),f.jsx("div",{className:"min-w-0 flex-1 text-right",children:f.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.24em] text-stone-500",children:"Workspaces"})})]}),f.jsx(y1,{className:"absolute left-0 top-[calc(100%+0.5rem)] z-30 w-[min(22rem,calc(100vw-1rem))]"})]})}),r&&f.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&&f.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&&f.jsxs("div",{className:"rounded-[1.6rem] border border-dashed border-stone-700 bg-stone-900/80 px-6 py-12 text-center",children:[f.jsx("p",{className:"text-lg font-medium text-stone-100",children:"No workspaces yet"}),f.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&&he.length>0&&f.jsx("div",{className:"space-y-2 overflow-x-hidden",children:he.map(V=>f.jsxs("article",{role:"link",tabIndex:0,onClick:()=>G(V.id),onKeyDown:Te=>Q(Te,V.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:[f.jsxs("div",{className:"absolute right-2.5 top-2.5 flex items-center gap-1.5",children:[f.jsx("button",{type:"button","aria-label":`Delete workspace ${V.label}`,title:"Delete workspace",onClick:Te=>{Te.stopPropagation(),C(V)},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:f.jsx(iY,{})}),f.jsx("button",{type:"button","aria-label":V.isFavorite?`Unpin workspace ${V.label}`:`Pin workspace ${V.label}`,title:V.isFavorite?"Unpin workspace":"Pin workspace",onClick:Te=>{Te.stopPropagation(),z(V)},className:`inline-flex h-7 w-7 items-center justify-center rounded-full border transition ${V.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:f.jsx(sY,{active:V.isFavorite})})]}),f.jsx("div",{className:"flex min-w-0 items-start gap-3 pr-[4.6rem]",children:f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[f.jsx("p",{className:"min-w-0 max-w-full truncate text-base font-semibold text-stone-100 sm:text-lg",title:V.label,children:V.label}),f.jsx("button",{type:"button",onClick:Te=>{Te.stopPropagation(),M(V)},"aria-label":`Rename workspace ${V.label}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-stone-500 transition hover:text-stone-100",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.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"})})})]}),f.jsx("button",{type:"button","aria-label":V.absPath,title:V.absPath,onClick:Te=>{Te.stopPropagation(),v(V.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:aY(V.absPath)}),f.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-stone-500",children:f.jsxs("span",{className:"min-w-0 truncate",children:["Last opened: ",rY(V.lastOpenedAt)]})})]})})]},V.id))}),f.jsx(wb,{open:c!==null,title:"Rename Workspace",label:"Workspace Label",value:m,busy:g!==null,onChange:p,onCancel:B,onSubmit:()=>c?Y(c):void 0}),f.jsx(fS,{open:E!==null,title:"Workspace Path",text:E??"",onClose:()=>v(null)}),f.jsx(SS,{open:w!==null,title:"Delete Workspace",description:w?`Delete ${w.label} from supervisor. This also removes its threads and local supervisor metadata.`:"",confirmLabel:"Delete Workspace",busy:S,onCancel:()=>{S||C(null)},onConfirm:()=>void ce()})]})}const AS="remote-codex-theme-mode",RS="remote-codex-default-backend";function oY(){if(typeof window>"u")return"system";const e=window.localStorage.getItem(AS);return e==="light"||e==="dark"||e==="system"?e:"system"}function uY(){return typeof window>"u"?"codex":window.localStorage.getItem(RS)==="claude"?"claude":"codex"}function cY(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function dY({themeMode:e,setThemeMode:t,effectiveTheme:n}){const[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(uY),m=ha(),p=/^\/threads\/[^/]+$/.test(m.pathname),g=m.pathname==="/threads",y=p||g,E=g||p,v=m.pathname==="/workspaces",w=v||g;T.useEffect(()=>{i(!1)},[m.pathname,m.search]);function C(S){d(S),window.localStorage.setItem(RS,S)}return f.jsxs(zv.Provider,{value:{navOpen:r,openNav:()=>i(!0),toggleNav:()=>i(S=>!S),closeNav:()=>i(!1),settingsOpen:l,openSettings:()=>{i(!1),o(!0)},closeSettings:()=>o(!1),themeMode:e,setThemeMode:t,effectiveTheme:n,defaultBackend:c,setDefaultBackend:C},children:[f.jsxs("div",{className:`bg-[var(--app-bg)] text-[var(--app-fg)] ${y?"fixed inset-0 overflow-hidden overscroll-none":"min-h-screen"}`,children:[!w&&f.jsxs("div",{className:`fixed left-4 top-4 z-50 ${p?"hidden sm:block":""}`,children:[f.jsx(x1,{}),f.jsx(y1,{className:"mt-3 w-[min(22rem,calc(100vw-2rem))]"})]}),f.jsx("main",{className:`mx-auto w-full max-w-[1600px] ${y?"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"} ${y?"overflow-hidden overscroll-none px-0 sm:px-6":"px-4 sm:px-6"}`,children:f.jsx("section",{className:`min-w-0 ${y?"h-full overflow-hidden overscroll-none":""}`,children:f.jsx(b5,{})})})]}),f.jsx(W6,{})]})}function fY(){const[e,t]=T.useState(()=>oY()),[n,r]=T.useState(()=>cY()),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(AS,e)},[e]),T.useEffect(()=>{const l=document.documentElement;l.dataset.themeMode=e,l.dataset.themeEffective=i,l.style.colorScheme=i},[i,e]),f.jsx("div",{className:"theme-shell theme-scrollbar",children:f.jsx(V5,{children:f.jsxs(y5,{children:[f.jsx(Ks,{path:"/",element:f.jsx(Q6,{})}),f.jsxs(Ks,{element:f.jsx(dY,{themeMode:e,setThemeMode:t,effectiveTheme:i}),children:[f.jsx(Ks,{path:"/workspaces",element:f.jsx(lY,{})}),f.jsx(Ks,{path:"/workspaces/new",element:f.jsx(tY,{})}),f.jsx(Ks,{path:"/threads",element:f.jsx(Jq,{})}),f.jsx(Ks,{path:"/threads/import",element:f.jsx(Xq,{})}),f.jsx(Ks,{path:"/threads/new",element:f.jsx(Kq,{})}),f.jsx(Ks,{path:"/threads/:id",element:f.jsx(Qq,{})})]})]})})})}bA.createRoot(document.getElementById("root")).render(f.jsx(cA.StrictMode,{children:f.jsx(fY,{})}));const hY=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:dS},Symbol.toStringTag,{value:"Module"}));export{uV as A,EY as L,da as R,Sh as g,f as j,T as r};
|