remote-codex 0.1.9 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/apps/supervisor-api/dist/index.js +11942 -6101
  2. package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-BFD4Ytvg.js → highlighted-body-OFNGDK62-ChrwAL9u.js} +1 -1
  3. package/apps/supervisor-web/dist/assets/index-DHf2HOXx.js +381 -0
  4. package/apps/supervisor-web/dist/assets/index-DpWxXCgt.css +32 -0
  5. package/apps/supervisor-web/dist/assets/{xterm-CukFWbxr.js → xterm-D4sevve4.js} +1 -1
  6. package/apps/supervisor-web/dist/index.html +2 -2
  7. package/config/codex-model-pricing.json +63 -0
  8. package/package.json +5 -2
  9. package/packages/agent-runtime/src/index.ts +4 -0
  10. package/packages/agent-runtime/src/management-errors.ts +11 -0
  11. package/packages/agent-runtime/src/model-pricing.ts +312 -0
  12. package/packages/agent-runtime/src/registry.ts +19 -4
  13. package/packages/agent-runtime/src/runtime-errors.ts +97 -0
  14. package/packages/agent-runtime/src/types.ts +50 -4
  15. package/packages/agent-runtime/src/unavailable-runtime.ts +169 -0
  16. package/packages/claude/src/historyItems.ts +693 -0
  17. package/packages/claude/src/index.ts +2 -0
  18. package/packages/claude/src/runtimeAdapter.test.ts +2138 -0
  19. package/packages/claude/src/runtimeAdapter.ts +2145 -0
  20. package/packages/codex/src/appServerManager.ts +12 -3
  21. package/packages/codex/src/historyItems.test.ts +110 -0
  22. package/packages/codex/src/historyItems.ts +97 -16
  23. package/packages/codex/src/hookHistory.test.ts +59 -0
  24. package/packages/codex/src/index.ts +7 -0
  25. package/packages/codex/src/local-session-store.ts +390 -0
  26. package/packages/codex/src/management/codex-management-service.ts +454 -0
  27. package/packages/codex/src/management/codexHostConfig.test.ts +88 -0
  28. package/packages/codex/src/management/codexHostConfig.ts +188 -0
  29. package/packages/codex/src/management/errors.ts +20 -0
  30. package/packages/codex/src/modelPricing.test.ts +184 -0
  31. package/packages/codex/src/modelPricing.ts +9 -0
  32. package/packages/codex/src/runtime-errors.test.ts +72 -0
  33. package/packages/codex/src/runtime-errors.ts +37 -0
  34. package/packages/codex/src/runtimeAdapter.ts +25 -2
  35. package/packages/codex/src/thread-title.ts +1 -0
  36. package/packages/db/src/repositories.ts +30 -0
  37. package/packages/opencode/src/historyItems.test.ts +504 -0
  38. package/packages/opencode/src/historyItems.ts +896 -0
  39. package/packages/opencode/src/index.ts +2 -0
  40. package/packages/opencode/src/runtimeAdapter.test.ts +1355 -0
  41. package/packages/opencode/src/runtimeAdapter.ts +1469 -0
  42. package/packages/shared/src/agent-providers.ts +56 -0
  43. package/packages/shared/src/index.ts +174 -35
  44. package/apps/supervisor-web/dist/assets/index-CbIt0KnL.css +0 -32
  45. package/apps/supervisor-web/dist/assets/index-Rd2EBQac.js +0 -377
@@ -0,0 +1,381 @@
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 yN=Object.defineProperty;var EN=Object.getPrototypeOf;var _N=Reflect.get;var n2=e=>{throw TypeError(e)};var TN=(e,t,n)=>t in e?yN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fe=(e,t,n)=>TN(e,typeof t!="symbol"?t+"":t,n),u0=(e,t,n)=>t.has(e)||n2("Cannot "+n);var Hr=(e,t,n)=>(u0(e,t,"read from private field"),n?n.call(e):t.get(e)),$l=(e,t,n)=>t.has(e)?n2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ts=(e,t,n,r)=>(u0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),c0=(e,t,n)=>(u0(e,t,"access private method"),n);var r2=(e,t,n)=>_N(EN(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 zh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d0={exports:{}},xc={};/**
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 a2;function vN(){if(a2)return xc;a2=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 xc.Fragment=t,xc.jsx=n,xc.jsxs=n,xc}var s2;function kN(){return s2||(s2=1,d0.exports=vN()),d0.exports}var d=kN(),f0={exports:{}},yt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var i2;function wN(){if(i2)return yt;i2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.iterator;function E(U){return U===null||typeof U!="object"?null:(U=x&&U[x]||U["@@iterator"],typeof U=="function"?U:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,S={};function w(U,ee,D){this.props=U,this.context=ee,this.refs=S,this.updater=D||v}w.prototype.isReactComponent={},w.prototype.setState=function(U,ee){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,ee,"setState")},w.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function O(){}O.prototype=w.prototype;function R(U,ee,D){this.props=U,this.context=ee,this.refs=S,this.updater=D||v}var j=R.prototype=new O;j.constructor=R,C(j,w.prototype),j.isPureReactComponent=!0;var G=Array.isArray;function N(){}var P={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function ne(U,ee,D){var Te=D.ref;return{$$typeof:e,type:U,key:ee,ref:Te!==void 0?Te:null,props:D}}function W(U,ee){return ne(U.type,ee,U.props)}function me(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function Q(U){var ee={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return ee[D]})}var _e=/\/+/g;function de(U,ee){return typeof U=="object"&&U!==null&&U.key!=null?Q(""+U.key):ee.toString(36)}function se(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(N,N):(U.status="pending",U.then(function(ee){U.status==="pending"&&(U.status="fulfilled",U.value=ee)},function(ee){U.status==="pending"&&(U.status="rejected",U.reason=ee)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,ee,D,Te,we){var Se=typeof U;(Se==="undefined"||Se==="boolean")&&(U=null);var Ve=!1;if(U===null)Ve=!0;else switch(Se){case"bigint":case"string":case"number":Ve=!0;break;case"object":switch(U.$$typeof){case e:case t:Ve=!0;break;case g:return Ve=U._init,H(Ve(U._payload),ee,D,Te,we)}}if(Ve)return we=we(U),Ve=Te===""?"."+de(U,0):Te,G(we)?(D="",Ve!=null&&(D=Ve.replace(_e,"$&/")+"/"),H(we,ee,D,"",function(Ft){return Ft})):we!=null&&(me(we)&&(we=W(we,D+(we.key==null||U&&U.key===we.key?"":(""+we.key).replace(_e,"$&/")+"/")+Ve)),ee.push(we)),1;Ve=0;var et=Te===""?".":Te+":";if(G(U))for(var Be=0;Be<U.length;Be++)Te=U[Be],Se=et+de(Te,Be),Ve+=H(Te,ee,D,Se,we);else if(Be=E(U),typeof Be=="function")for(U=Be.call(U),Be=0;!(Te=U.next()).done;)Te=Te.value,Se=et+de(Te,Be++),Ve+=H(Te,ee,D,Se,we);else if(Se==="object"){if(typeof U.then=="function")return H(se(U),ee,D,Te,we);throw ee=String(U),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return Ve}function ce(U,ee,D){if(U==null)return U;var Te=[],we=0;return H(U,Te,"","",function(Se){return ee.call(D,Se,we++)}),Te}function q(U){if(U._status===-1){var ee=U._result;ee=ee(),ee.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=ee)}if(U._status===1)return U._result.default;throw U._result}var J=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=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(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},A={map:ce,forEach:function(U,ee,D){ce(U,function(){ee.apply(this,arguments)},D)},count:function(U){var ee=0;return ce(U,function(){ee++}),ee},toArray:function(U){return ce(U,function(ee){return ee})||[]},only:function(U){if(!me(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return yt.Activity=p,yt.Children=A,yt.Component=w,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=R,yt.StrictMode=r,yt.Suspense=f,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,yt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return P.H.useMemoCache(U)}},yt.cache=function(U){return function(){return U.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(U,ee,D){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Te=C({},U.props),we=U.key;if(ee!=null)for(Se in ee.key!==void 0&&(we=""+ee.key),ee)!$.call(ee,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&ee.ref===void 0||(Te[Se]=ee[Se]);var Se=arguments.length-2;if(Se===1)Te.children=D;else if(1<Se){for(var Ve=Array(Se),et=0;et<Se;et++)Ve[et]=arguments[et+2];Te.children=Ve}return ne(U.type,we,Te)},yt.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},yt.createElement=function(U,ee,D){var Te,we={},Se=null;if(ee!=null)for(Te in ee.key!==void 0&&(Se=""+ee.key),ee)$.call(ee,Te)&&Te!=="key"&&Te!=="__self"&&Te!=="__source"&&(we[Te]=ee[Te]);var Ve=arguments.length-2;if(Ve===1)we.children=D;else if(1<Ve){for(var et=Array(Ve),Be=0;Be<Ve;Be++)et[Be]=arguments[Be+2];we.children=et}if(U&&U.defaultProps)for(Te in Ve=U.defaultProps,Ve)we[Te]===void 0&&(we[Te]=Ve[Te]);return ne(U,Se,we)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(U){return{$$typeof:c,render:U}},yt.isValidElement=me,yt.lazy=function(U){return{$$typeof:g,_payload:{_status:-1,_result:U},_init:q}},yt.memo=function(U,ee){return{$$typeof:h,type:U,compare:ee===void 0?null:ee}},yt.startTransition=function(U){var ee=P.T,D={};P.T=D;try{var Te=U(),we=P.S;we!==null&&we(D,Te),typeof Te=="object"&&Te!==null&&typeof Te.then=="function"&&Te.then(N,J)}catch(Se){J(Se)}finally{ee!==null&&D.types!==null&&(ee.types=D.types),P.T=ee}},yt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},yt.use=function(U){return P.H.use(U)},yt.useActionState=function(U,ee,D){return P.H.useActionState(U,ee,D)},yt.useCallback=function(U,ee){return P.H.useCallback(U,ee)},yt.useContext=function(U){return P.H.useContext(U)},yt.useDebugValue=function(){},yt.useDeferredValue=function(U,ee){return P.H.useDeferredValue(U,ee)},yt.useEffect=function(U,ee){return P.H.useEffect(U,ee)},yt.useEffectEvent=function(U){return P.H.useEffectEvent(U)},yt.useId=function(){return P.H.useId()},yt.useImperativeHandle=function(U,ee,D){return P.H.useImperativeHandle(U,ee,D)},yt.useInsertionEffect=function(U,ee){return P.H.useInsertionEffect(U,ee)},yt.useLayoutEffect=function(U,ee){return P.H.useLayoutEffect(U,ee)},yt.useMemo=function(U,ee){return P.H.useMemo(U,ee)},yt.useOptimistic=function(U,ee){return P.H.useOptimistic(U,ee)},yt.useReducer=function(U,ee,D){return P.H.useReducer(U,ee,D)},yt.useRef=function(U){return P.H.useRef(U)},yt.useState=function(U){return P.H.useState(U)},yt.useSyncExternalStore=function(U,ee,D){return P.H.useSyncExternalStore(U,ee,D)},yt.useTransition=function(){return P.H.useTransition()},yt.version="19.2.5",yt}var l2;function k1(){return l2||(l2=1,f0.exports=wN()),f0.exports}var T=k1();const CN=zh(T);var h0={exports:{}},yc={},m0={exports:{}},p0={};/**
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 o2;function SN(){return o2||(o2=1,(function(e){function t(H,ce){var q=H.length;H.push(ce);e:for(;0<q;){var J=q-1>>>1,A=H[J];if(0<i(A,ce))H[J]=ce,H[q]=A,q=J;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ce=H[0],q=H.pop();if(q!==ce){H[0]=q;e:for(var J=0,A=H.length,U=A>>>1;J<U;){var ee=2*(J+1)-1,D=H[ee],Te=ee+1,we=H[Te];if(0>i(D,q))Te<A&&0>i(we,D)?(H[J]=we,H[Te]=q,J=Te):(H[J]=D,H[ee]=q,J=ee);else if(Te<A&&0>i(we,q))H[J]=we,H[Te]=q,J=Te;else break e}}return ce}function i(H,ce){var q=H.sortIndex-ce.sortIndex;return q!==0?q:H.id-ce.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var f=[],h=[],g=1,p=null,x=3,E=!1,v=!1,C=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function j(H){for(var ce=n(h);ce!==null;){if(ce.callback===null)r(h);else if(ce.startTime<=H)r(h),ce.sortIndex=ce.expirationTime,t(f,ce);else break;ce=n(h)}}function G(H){if(C=!1,j(H),!v)if(n(f)!==null)v=!0,N||(N=!0,Q());else{var ce=n(h);ce!==null&&se(G,ce.startTime-H)}}var N=!1,P=-1,$=5,ne=-1;function W(){return S?!0:!(e.unstable_now()-ne<$)}function me(){if(S=!1,N){var H=e.unstable_now();ne=H;var ce=!0;try{e:{v=!1,C&&(C=!1,O(P),P=-1),E=!0;var q=x;try{t:{for(j(H),p=n(f);p!==null&&!(p.expirationTime>H&&W());){var J=p.callback;if(typeof J=="function"){p.callback=null,x=p.priorityLevel;var A=J(p.expirationTime<=H);if(H=e.unstable_now(),typeof A=="function"){p.callback=A,j(H),ce=!0;break t}p===n(f)&&r(f),j(H)}else r(f);p=n(f)}if(p!==null)ce=!0;else{var U=n(h);U!==null&&se(G,U.startTime-H),ce=!1}}break e}finally{p=null,x=q,E=!1}ce=void 0}}finally{ce?Q():N=!1}}}var Q;if(typeof R=="function")Q=function(){R(me)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,de=_e.port2;_e.port1.onmessage=me,Q=function(){de.postMessage(null)}}else Q=function(){w(me,0)};function se(H,ce){P=w(function(){H(e.unstable_now())},ce)}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"):$=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(H){switch(x){case 1:case 2:case 3:var ce=3;break;default:ce=x}var q=x;x=ce;try{return H()}finally{x=q}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(H,ce){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=x;x=H;try{return ce()}finally{x=q}},e.unstable_scheduleCallback=function(H,ce,q){var J=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?J+q:J):q=J,H){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=q+A,H={id:g++,callback:ce,priorityLevel:H,startTime:q,expirationTime:A,sortIndex:-1},q>J?(H.sortIndex=q,t(h,H),n(f)===null&&H===n(h)&&(C?(O(P),P=-1):C=!0,se(G,q-J))):(H.sortIndex=A,t(f,H),v||E||(v=!0,N||(N=!0,Q()))),H},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(H){var ce=x;return function(){var q=x;x=ce;try{return H.apply(this,arguments)}finally{x=q}}}})(p0)),p0}var u2;function NN(){return u2||(u2=1,m0.exports=SN()),m0.exports}var g0={exports:{}},Cr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var c2;function AN(){if(c2)return Cr;c2=1;var e=k1();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,h,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:f,containerInfo:h,implementation:g}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Cr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cr.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,g)},Cr.flushSync=function(f){var h=o.T,g=r.p;try{if(o.T=null,r.p=2,f)return f()}finally{o.T=h,r.p=g,r.d.f()}},Cr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Cr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Cr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,p=c(g,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:x,fetchPriority:E}):g==="script"&&r.d.X(f,{crossOrigin:p,integrity:x,fetchPriority:E,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Cr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Cr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,p=c(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Cr.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Cr.requestFormReset=function(f){r.d.r(f)},Cr.unstable_batchedUpdates=function(f,h){return f(h)},Cr.useFormState=function(f,h,g){return o.H.useFormState(f,h,g)},Cr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Cr.version="19.2.5",Cr}var d2;function Uv(){if(d2)return g0.exports;d2=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(),g0.exports=AN(),g0.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 f2;function RN(){if(f2)return yc;f2=1;var e=NN(),t=k1(),n=Uv();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var s=a,u=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(u=s.return),a=s.return;while(a)}return s.tag===3?u:null}function o(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function c(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function f(a){if(l(a)!==a)throw Error(r(188))}function h(a){var s=a.alternate;if(!s){if(s=l(a),s===null)throw Error(r(188));return s!==a?null:a}for(var u=a,m=s;;){var b=u.return;if(b===null)break;var y=b.alternate;if(y===null){if(m=b.return,m!==null){u=m;continue}break}if(b.child===y.child){for(y=b.child;y;){if(y===u)return f(b),a;if(y===m)return f(b),s;y=y.sibling}throw Error(r(188))}if(u.return!==m.return)u=b,m=y;else{for(var k=!1,L=b.child;L;){if(L===u){k=!0,u=b,m=y;break}if(L===m){k=!0,m=b,u=y;break}L=L.sibling}if(!k){for(L=y.child;L;){if(L===u){k=!0,u=y,m=b;break}if(L===m){k=!0,m=y,u=b;break}L=L.sibling}if(!k)throw Error(r(189))}}if(u.alternate!==m)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:s}function g(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=g(a),s!==null)return s;a=a.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),R=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=me&&a[me]||a["@@iterator"],typeof a=="function"?a:null)}var _e=Symbol.for("react.client.reference");function de(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===_e?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case G:return"Suspense";case N:return"SuspenseList";case ne:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case R:return a.displayName||"Context";case O:return(a._context.displayName||"Context")+".Consumer";case j:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case P:return s=a.displayName||null,s!==null?s:de(a.type)||"Memo";case $:s=a._payload,a=a._init;try{return de(a(s))}catch{}}return null}var se=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},J=[],A=-1;function U(a){return{current:a}}function ee(a){0>A||(a.current=J[A],J[A]=null,A--)}function D(a,s){A++,J[A]=a.current,a.current=s}var Te=U(null),we=U(null),Se=U(null),Ve=U(null);function et(a,s){switch(D(Se,s),D(we,a),D(Te,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?wE(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=wE(s),a=CE(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ee(Te),D(Te,a)}function Be(){ee(Te),ee(we),ee(Se)}function Ft(a){a.memoizedState!==null&&D(Ve,a);var s=Te.current,u=CE(s,a.type);s!==u&&(D(we,a),D(Te,u))}function at(a){we.current===a&&(ee(Te),ee(we)),Ve.current===a&&(ee(Ve),mc._currentValue=q)}var gt,Kt;function Ue(a){if(gt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);gt=s&&s[1]||"",Kt=-1<u.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+gt+a+Kt}var kt=!1;function nt(a,s){if(!a||kt)return"";kt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(s){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(he){var ue=he}Reflect.construct(a,[],Ee)}else{try{Ee.call()}catch(he){ue=he}a.call(Ee.prototype)}}else{try{throw Error()}catch(he){ue=he}(Ee=a())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=m.DetermineComponentFrameRoot(),k=y[0],L=y[1];if(k&&L){var Y=k.split(`
45
+ `),oe=L.split(`
46
+ `);for(b=m=0;m<Y.length&&!Y[m].includes("DetermineComponentFrameRoot");)m++;for(;b<oe.length&&!oe[b].includes("DetermineComponentFrameRoot");)b++;if(m===Y.length||b===oe.length)for(m=Y.length-1,b=oe.length-1;1<=m&&0<=b&&Y[m]!==oe[b];)b--;for(;1<=m&&0<=b;m--,b--)if(Y[m]!==oe[b]){if(m!==1||b!==1)do if(m--,b--,0>b||Y[m]!==oe[b]){var be=`
47
+ `+Y[m].replace(" at new "," at ");return a.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",a.displayName)),be}while(1<=m&&0<=b);break}}}finally{kt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Ue(u):""}function on(a,s){switch(a.tag){case 26:case 27:case 5:return Ue(a.type);case 16:return Ue("Lazy");case 13:return a.child!==s&&s!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return nt(a.type,!1);case 11:return nt(a.type.render,!1);case 1:return nt(a.type,!0);case 31:return Ue("Activity");default:return""}}function $e(a){try{var s="",u=null;do s+=on(a,u),u=a,a=a.return;while(a);return s}catch(m){return`
48
+ Error generating stack: `+m.message+`
49
+ `+m.stack}}var He=Object.prototype.hasOwnProperty,Rt=e.unstable_scheduleCallback,un=e.unstable_cancelCallback,cn=e.unstable_shouldYield,Vn=e.unstable_requestPaint,Tt=e.unstable_now,er=e.unstable_getCurrentPriorityLevel,ge=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,st=e.unstable_LowPriority,xt=e.unstable_IdlePriority,dn=e.log,Ln=e.unstable_setDisableYieldValue,ye=null,ze=null;function tt(a){if(typeof dn=="function"&&Ln(a),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(ye,a)}catch{}}var Me=Math.clz32?Math.clz32:Ze,ft=Math.log,Vt=Math.LN2;function Ze(a){return a>>>=0,a===0?32:31-(ft(a)/Vt|0)|0}var X=256,Le=262144,Pe=4194304;function Xe(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 ut(a,s,u){var m=a.pendingLanes;if(m===0)return 0;var b=0,y=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var L=m&134217727;return L!==0?(m=L&~y,m!==0?b=Xe(m):(k&=L,k!==0?b=Xe(k):u||(u=L&~a,u!==0&&(b=Xe(u))))):(L=m&~y,L!==0?b=Xe(L):k!==0?b=Xe(k):u||(u=m&~a,u!==0&&(b=Xe(u)))),b===0?0:s!==0&&s!==b&&(s&y)===0&&(y=b&-b,u=s&-s,y>=u||y===32&&(u&4194048)!==0)?s:b}function Lt(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function Gt(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=Pe;return Pe<<=1,(Pe&62914560)===0&&(Pe=4194304),a}function it(a){for(var s=[],u=0;31>u;u++)s.push(a);return s}function Nn(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Un(a,s,u,m,b,y){var k=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,Y=a.expirationTimes,oe=a.hiddenUpdates;for(u=k&~u;0<u;){var be=31-Me(u),Ee=1<<be;L[be]=0,Y[be]=-1;var ue=oe[be];if(ue!==null)for(oe[be]=null,be=0;be<ue.length;be++){var he=ue[be];he!==null&&(he.lane&=-536870913)}u&=~Ee}m!==0&&nn(a,m,0),y!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=y&~(k&~s))}function nn(a,s,u){a.pendingLanes|=s,a.suspendedLanes&=~s;var m=31-Me(s);a.entangledLanes|=s,a.entanglements[m]=a.entanglements[m]|1073741824|u&261930}function yi(a,s){var u=a.entangledLanes|=s;for(a=a.entanglements;u;){var m=31-Me(u),b=1<<m;b&s|a[m]&s&&(a[m]|=s),u&=~b}}function us(a,s){var u=s&-s;return u=(u&42)!==0?1:ya(u),(u&(a.suspendedLanes|s))!==0?0:u}function ya(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 In(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function gl(){var a=ce.p;return a!==0?a:(a=window.event,a===void 0?32:QE(a.type))}function bl(a,s){var u=ce.p;try{return ce.p=a,s()}finally{ce.p=u}}var Ir=Math.random().toString(36).slice(2),bn="__reactFiber$"+Ir,An="__reactProps$"+Ir,Va="__reactContainer$"+Ir,tr="__reactEvents$"+Ir,Ns="__reactListeners$"+Ir,Gr="__reactHandles$"+Ir,cs="__reactResources$"+Ir,Ga="__reactMarker$"+Ir;function Or(a){delete a[bn],delete a[An],delete a[tr],delete a[Ns],delete a[Gr]}function On(a){var s=a[bn];if(s)return s;for(var u=a.parentNode;u;){if(s=u[Va]||u[bn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(a=OE(a);a!==null;){if(u=a[bn])return u;a=OE(a)}return s}a=u,u=a.parentNode}return null}function Gn(a){if(a=a[bn]||a[Va]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function Ea(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function _a(a){var s=a[cs];return s||(s=a[cs]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function _n(a){a[Ga]=!0}var zt=new Set,qr={};function aa(a,s){xr(a,s),xr(a+"Capture",s)}function xr(a,s){for(qr[a]=s,a=0;a<s.length;a++)zt.add(s[a])}var xl=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),As={},Dr={};function Ta(a){return He.call(Dr,a)?!0:He.call(As,a)?!1:xl.test(a)?Dr[a]=!0:(As[a]=!0,!1)}function Rs(a,s,u){if(Ta(s))if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var m=s.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+u)}}function qa(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 qn(a,s,u,m){if(m===null)a.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(s,u,""+m)}}function nr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function fr(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ds(a,s,u){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,y=m.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return b.call(this)},set:function(k){u=""+k,y.call(this,k)}}),Object.defineProperty(a,s,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Ls(a){if(!a._valueTracker){var s=fr(a)?"checked":"value";a._valueTracker=ds(a,s,""+a[s])}}function Ei(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var u=s.getValue(),m="";return a&&(m=fr(a)?a.checked?"true":"false":a.value),a=m,a!==u?(s.setValue(a),!0):!1}function Zt(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 yl=/[\n"\\]/g;function rr(a){return a.replace(yl,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ya(a,s,u,m,b,y,k,L){a.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.type=k:a.removeAttribute("type"),s!=null?k==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+nr(s)):a.value!==""+nr(s)&&(a.value=""+nr(s)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),s!=null?Ti(a,k,nr(s)):u!=null?Ti(a,k,nr(u)):m!=null&&a.removeAttribute("value"),b==null&&y!=null&&(a.defaultChecked=!!y),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+nr(L):a.removeAttribute("name")}function _i(a,s,u,m,b,y,k,L){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),s!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Ls(a);return}u=u!=null?""+nr(u):"",s=s!=null?""+nr(s):u,L||s===a.value||(a.value=s),a.defaultValue=s}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=L?a.checked:!!m,a.defaultChecked=!!m,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),Ls(a)}function Ti(a,s,u){s==="number"&&Zt(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function jr(a,s,u,m){if(a=a.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<a.length;u++)b=s.hasOwnProperty("$"+a[u].value),a[u].selected!==b&&(a[u].selected=b),b&&m&&(a[u].defaultSelected=!0)}else{for(u=""+nr(u),s=null,b=0;b<a.length;b++){if(a[b].value===u){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}s!==null||a[b].disabled||(s=a[b])}s!==null&&(s.selected=!0)}}function Is(a,s,u){if(s!=null&&(s=""+nr(s),s!==a.value&&(a.value=s),u==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=u!=null?""+nr(u):""}function El(a,s,u,m){if(s==null){if(m!=null){if(u!=null)throw Error(r(92));if(se(m)){if(1<m.length)throw Error(r(93));m=m[0]}u=m}u==null&&(u=""),s=u}u=nr(s),a.defaultValue=u,m=a.textContent,m===u&&m!==""&&m!==null&&(a.value=m),Ls(a)}function Mr(a,s){if(s){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=s;return}}a.textContent=s}var Xt=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 xn(a,s,u){var m=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":m?a.setProperty(s,u):typeof u!="number"||u===0||Xt.has(s)?s==="float"?a.cssFloat=u:a[s]=(""+u).trim():a[s]=u+"px"}function vi(a,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||s!=null&&s.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in s)m=s[b],s.hasOwnProperty(b)&&u[b]!==m&&xn(a,b,m)}else for(var y in s)s.hasOwnProperty(y)&&xn(a,y,s[y])}function Pr(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 Iu=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"]]),_l=/^[\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 fs(a){return _l.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Br(){}var Tl=null;function ki(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Wa=null,va=null;function Os(a){var s=Gn(a);if(s&&(a=s.stateNode)){var u=a[An]||null;e:switch(a=s.stateNode,s.type){case"input":if(Ya(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="'+rr(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var m=u[s];if(m!==a&&m.form===a.form){var b=m[An]||null;if(!b)throw Error(r(90));Ya(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)m=u[s],m.form===a.form&&Ei(m)}break e;case"textarea":Is(a,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&jr(a,!!u.multiple,s,!1)}}}var Qa=!1;function Ds(a,s,u){if(Qa)return a(s,u);Qa=!0;try{var m=a(s);return m}finally{if(Qa=!1,(Wa!==null||va!==null)&&(lf(),Wa&&(s=Wa,a=va,va=Wa=null,Os(s),a)))for(s=0;s<a.length;s++)Os(a[s])}}function Yr(a,s){var u=a.stateNode;if(u===null)return null;var m=u[An]||null;if(m===null)return null;u=m[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),js=!1;if(yr)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){js=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{js=!1}var ka=null,vl=null,wi=null;function xo(){if(wi)return wi;var a,s=vl,u=s.length,m,b="value"in ka?ka.value:ka.textContent,y=b.length;for(a=0;a<u&&s[a]===b[a];a++);var k=u-a;for(m=1;m<=k&&s[u-m]===b[y-m];m++);return wi=b.slice(a,1<m?1-m:void 0)}function Ps(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 Ci(){return!0}function yo(){return!1}function Dn(a){function s(u,m,b,y,k){this._reactName=u,this._targetInst=b,this.type=m,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(u=a[L],this[L]=u?u(y):y[L]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ci:yo,this.isPropagationStopped=yo,this}return p(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=Ci)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ci)},persist:function(){},isPersistent:Ci}),s}var Wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bs=Dn(Wr),wa=p({},Wr,{view:0,detail:0}),Xa=Dn(wa),Si,Us,Ka,Hs=p({},wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:De,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!==Ka&&(Ka&&a.type==="mousemove"?(Si=a.screenX-Ka.screenX,Us=a.screenY-Ka.screenY):Us=Si=0,Ka=a),Si)},movementY:function(a){return"movementY"in a?a.movementY:Us}}),Fs=Dn(Hs),Eo=p({},Hs,{dataTransfer:0}),kl=Dn(Eo),wl=p({},wa,{relatedTarget:0}),zs=Dn(wl),_o=p({},Wr,{animationName:0,elapsedTime:0,pseudoElement:0}),Cl=Dn(_o),z=p({},Wr,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),K=Dn(z),re=p({},Wr,{data:0}),Ie=Dn(re),je={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Je={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Et={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jn(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=Et[a])?!!s[a]:!1}function De(){return jn}var Rn=p({},wa,{key:function(a){if(a.key){var s=je[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Ps(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Je[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:De,charCode:function(a){return a.type==="keypress"?Ps(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ps(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),ar=Dn(Rn),Bt=p({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nt=Dn(Bt),ke=p({},wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:De}),Fe=Dn(ke),ht=p({},Wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),fn=Dn(ht),bt=p({},Hs,{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}),an=Dn(bt),Er=p({},Wr,{newState:0,oldState:0}),sr=Dn(Er),$s=[9,13,27,32],Vs=yr&&"CompositionEvent"in window,Ni=null;yr&&"documentMode"in document&&(Ni=document.documentMode);var _d=yr&&"TextEvent"in window&&!Ni,Ou=yr&&(!Vs||Ni&&8<Ni&&11>=Ni),Du=" ",ju=!1;function Mu(a,s){switch(a){case"keyup":return $s.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pu(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Gs=!1;function Td(a,s){switch(a){case"compositionend":return Pu(s);case"keypress":return s.which!==32?null:(ju=!0,Du);case"textInput":return a=s.data,a===Du&&ju?null:a;default:return null}}function vd(a,s){if(Gs)return a==="compositionend"||!Vs&&Mu(a,s)?(a=xo(),wi=vl=ka=null,Gs=!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 Ou&&s.locale!=="ko"?null:s.data;default:return null}}var kd={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function I(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!kd[a.type]:s==="textarea"}function ie(a,s,u,m){Wa?va?va.push(m):va=[m]:Wa=m,s=mf(s,"onChange"),0<s.length&&(u=new Bs("onChange","change",null,u,m),a.push({event:u,listeners:s}))}var ve=null,qe=null;function Ke(a){yE(a,0)}function ct(a){var s=Ea(a);if(Ei(s))return a}function mt(a,s){if(a==="change")return s}var Dt=!1;if(yr){var wt;if(yr){var rn="oninput"in document;if(!rn){var Yn=document.createElement("div");Yn.setAttribute("oninput","return;"),rn=typeof Yn.oninput=="function"}wt=rn}else wt=!1;Dt=wt&&(!document.documentMode||9<document.documentMode)}function qt(){ve&&(ve.detachEvent("onpropertychange",Ca),qe=ve=null)}function Ca(a){if(a.propertyName==="value"&&ct(qe)){var s=[];ie(s,qe,a,ki(a)),Ds(Ke,s)}}function Sl(a,s,u){a==="focusin"?(qt(),ve=s,qe=u,ve.attachEvent("onpropertychange",Ca)):a==="focusout"&&qt()}function wd(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ct(qe)}function Q5(a,s){if(a==="click")return ct(s)}function X5(a,s){if(a==="input"||a==="change")return ct(s)}function K5(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var sa=typeof Object.is=="function"?Object.is:K5;function Bu(a,s){if(sa(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var u=Object.keys(a),m=Object.keys(s);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var b=u[m];if(!He.call(s,b)||!sa(a[b],s[b]))return!1}return!0}function $b(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Vb(a,s){var u=$b(a);a=0;for(var m;u;){if(u.nodeType===3){if(m=a+u.textContent.length,a<=s&&m>=s)return{node:u,offset:s-a};a=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=$b(u)}}function Gb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Gb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function qb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=Zt(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=Zt(a.document)}return s}function xm(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 Z5=yr&&"documentMode"in document&&11>=document.documentMode,To=null,ym=null,Uu=null,Em=!1;function Yb(a,s,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Em||To==null||To!==Zt(m)||(m=To,"selectionStart"in m&&xm(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Uu&&Bu(Uu,m)||(Uu=m,m=mf(ym,"onSelect"),0<m.length&&(s=new Bs("onSelect","select",null,s,u),a.push({event:s,listeners:m}),s.target=To)))}function Nl(a,s){var u={};return u[a.toLowerCase()]=s.toLowerCase(),u["Webkit"+a]="webkit"+s,u["Moz"+a]="moz"+s,u}var vo={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionrun:Nl("Transition","TransitionRun"),transitionstart:Nl("Transition","TransitionStart"),transitioncancel:Nl("Transition","TransitionCancel"),transitionend:Nl("Transition","TransitionEnd")},_m={},Wb={};yr&&(Wb=document.createElement("div").style,"AnimationEvent"in window||(delete vo.animationend.animation,delete vo.animationiteration.animation,delete vo.animationstart.animation),"TransitionEvent"in window||delete vo.transitionend.transition);function Al(a){if(_m[a])return _m[a];if(!vo[a])return a;var s=vo[a],u;for(u in s)if(s.hasOwnProperty(u)&&u in Wb)return _m[a]=s[u];return a}var Qb=Al("animationend"),Xb=Al("animationiteration"),Kb=Al("animationstart"),J5=Al("transitionrun"),eS=Al("transitionstart"),tS=Al("transitioncancel"),Zb=Al("transitionend"),Jb=new Map,Tm="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(" ");Tm.push("scrollEnd");function Za(a,s){Jb.set(a,s),aa(s,[a])}var Cd=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)},Sa=[],ko=0,vm=0;function Sd(){for(var a=ko,s=vm=ko=0;s<a;){var u=Sa[s];Sa[s++]=null;var m=Sa[s];Sa[s++]=null;var b=Sa[s];Sa[s++]=null;var y=Sa[s];if(Sa[s++]=null,m!==null&&b!==null){var k=m.pending;k===null?b.next=b:(b.next=k.next,k.next=b),m.pending=b}y!==0&&ex(u,b,y)}}function Nd(a,s,u,m){Sa[ko++]=a,Sa[ko++]=s,Sa[ko++]=u,Sa[ko++]=m,vm|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function km(a,s,u,m){return Nd(a,s,u,m),Ad(a)}function Rl(a,s){return Nd(a,null,null,s),Ad(a)}function ex(a,s,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var b=!1,y=a.return;y!==null;)y.childLanes|=u,m=y.alternate,m!==null&&(m.childLanes|=u),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(b=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,b&&s!==null&&(b=31-Me(u),a=y.hiddenUpdates,m=a[b],m===null?a[b]=[s]:m.push(s),s.lane=u|536870912),y):null}function Ad(a){if(50<lc)throw lc=0,Op=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var wo={};function nS(a,s,u,m){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ia(a,s,u,m){return new nS(a,s,u,m)}function wm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function qs(a,s){var u=a.alternate;return u===null?(u=ia(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 tx(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 Rd(a,s,u,m,b,y){var k=0;if(m=a,typeof a=="function")wm(a)&&(k=1);else if(typeof a=="string")k=lN(a,u,Te.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case ne:return a=ia(31,u,s,b),a.elementType=ne,a.lanes=y,a;case C:return Ll(u.children,b,y,s);case S:k=8,b|=24;break;case w:return a=ia(12,u,s,b|2),a.elementType=w,a.lanes=y,a;case G:return a=ia(13,u,s,b),a.elementType=G,a.lanes=y,a;case N:return a=ia(19,u,s,b),a.elementType=N,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:k=10;break e;case O:k=9;break e;case j:k=11;break e;case P:k=14;break e;case $:k=16,m=null;break e}k=29,u=Error(r(130,a===null?"null":typeof a,"")),m=null}return s=ia(k,u,s,b),s.elementType=a,s.type=m,s.lanes=y,s}function Ll(a,s,u,m){return a=ia(7,a,m,s),a.lanes=u,a}function Cm(a,s,u){return a=ia(6,a,null,s),a.lanes=u,a}function nx(a){var s=ia(18,null,null,0);return s.stateNode=a,s}function Sm(a,s,u){return s=ia(4,a.children!==null?a.children:[],a.key,s),s.lanes=u,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var rx=new WeakMap;function Na(a,s){if(typeof a=="object"&&a!==null){var u=rx.get(a);return u!==void 0?u:(s={value:a,source:s,stack:$e(s)},rx.set(a,s),s)}return{value:a,source:s,stack:$e(s)}}var Co=[],So=0,Ld=null,Hu=0,Aa=[],Ra=0,Ai=null,hs=1,ms="";function Ys(a,s){Co[So++]=Hu,Co[So++]=Ld,Ld=a,Hu=s}function ax(a,s,u){Aa[Ra++]=hs,Aa[Ra++]=ms,Aa[Ra++]=Ai,Ai=a;var m=hs;a=ms;var b=32-Me(m)-1;m&=~(1<<b),u+=1;var y=32-Me(s)+b;if(30<y){var k=b-b%5;y=(m&(1<<k)-1).toString(32),m>>=k,b-=k,hs=1<<32-Me(s)+b|u<<b|m,ms=y+a}else hs=1<<y|u<<b|m,ms=a}function Nm(a){a.return!==null&&(Ys(a,1),ax(a,1,0))}function Am(a){for(;a===Ld;)Ld=Co[--So],Co[So]=null,Hu=Co[--So],Co[So]=null;for(;a===Ai;)Ai=Aa[--Ra],Aa[Ra]=null,ms=Aa[--Ra],Aa[Ra]=null,hs=Aa[--Ra],Aa[Ra]=null}function sx(a,s){Aa[Ra++]=hs,Aa[Ra++]=ms,Aa[Ra++]=Ai,hs=s.id,ms=s.overflow,Ai=a}var _r=null,vn=null,$t=!1,Ri=null,La=!1,Rm=Error(r(519));function Li(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fu(Na(s,a)),Rm}function ix(a){var s=a.stateNode,u=a.type,m=a.memoizedProps;switch(s[bn]=a,s[An]=m,u){case"dialog":Mt("cancel",s),Mt("close",s);break;case"iframe":case"object":case"embed":Mt("load",s);break;case"video":case"audio":for(u=0;u<uc.length;u++)Mt(uc[u],s);break;case"source":Mt("error",s);break;case"img":case"image":case"link":Mt("error",s),Mt("load",s);break;case"details":Mt("toggle",s);break;case"input":Mt("invalid",s),_i(s,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Mt("invalid",s);break;case"textarea":Mt("invalid",s),El(s,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||m.suppressHydrationWarning===!0||vE(s.textContent,u)?(m.popover!=null&&(Mt("beforetoggle",s),Mt("toggle",s)),m.onScroll!=null&&Mt("scroll",s),m.onScrollEnd!=null&&Mt("scrollend",s),m.onClick!=null&&(s.onclick=Br),s=!0):s=!1,s||Li(a,!0)}function lx(a){for(_r=a.return;_r;)switch(_r.tag){case 5:case 31:case 13:La=!1;return;case 27:case 3:La=!0;return;default:_r=_r.return}}function No(a){if(a!==_r)return!1;if(!$t)return lx(a),$t=!0,!1;var s=a.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Wp(a.type,a.memoizedProps)),u=!u),u&&vn&&Li(a),lx(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));vn=IE(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));vn=IE(a)}else s===27?(s=vn,Gi(a.type)?(a=Jp,Jp=null,vn=a):vn=s):vn=_r?Oa(a.stateNode.nextSibling):null;return!0}function Il(){vn=_r=null,$t=!1}function Lm(){var a=Ri;return a!==null&&(Zr===null?Zr=a:Zr.push.apply(Zr,a),Ri=null),a}function Fu(a){Ri===null?Ri=[a]:Ri.push(a)}var Im=U(null),Ol=null,Ws=null;function Ii(a,s,u){D(Im,s._currentValue),s._currentValue=u}function Qs(a){a._currentValue=Im.current,ee(Im)}function Om(a,s,u){for(;a!==null;){var m=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,m!==null&&(m.childLanes|=s)):m!==null&&(m.childLanes&s)!==s&&(m.childLanes|=s),a===u)break;a=a.return}}function Dm(a,s,u,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var y=b.dependencies;if(y!==null){var k=b.child;y=y.firstContext;e:for(;y!==null;){var L=y;y=b;for(var Y=0;Y<s.length;Y++)if(L.context===s[Y]){y.lanes|=u,L=y.alternate,L!==null&&(L.lanes|=u),Om(y.return,u,a),m||(k=null);break e}y=L.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=u,y=k.alternate,y!==null&&(y.lanes|=u),Om(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 Ao(a,s,u,m){a=null;for(var b=s,y=!1;b!==null;){if(!y){if((b.flags&524288)!==0)y=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var L=b.type;sa(b.pendingProps.value,k.value)||(a!==null?a.push(L):a=[L])}}else if(b===Ve.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(mc):a=[mc])}b=b.return}a!==null&&Dm(s,a,u,m),s.flags|=262144}function Id(a){for(a=a.firstContext;a!==null;){if(!sa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Dl(a){Ol=a,Ws=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Tr(a){return ox(Ol,a)}function Od(a,s){return Ol===null&&Dl(a),ox(a,s)}function ox(a,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Ws===null){if(a===null)throw Error(r(308));Ws=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Ws=Ws.next=s;return u}var rS=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(u,m){a.push(m)}};this.abort=function(){s.aborted=!0,a.forEach(function(u){return u()})}},aS=e.unstable_scheduleCallback,sS=e.unstable_NormalPriority,Wn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jm(){return{controller:new rS,data:new Map,refCount:0}}function zu(a){a.refCount--,a.refCount===0&&aS(sS,function(){a.controller.abort()})}var $u=null,Mm=0,Ro=0,Lo=null;function iS(a,s){if($u===null){var u=$u=[];Mm=0,Ro=Up(),Lo={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Mm++,s.then(ux,ux),s}function ux(){if(--Mm===0&&$u!==null){Lo!==null&&(Lo.status="fulfilled");var a=$u;$u=null,Ro=0,Lo=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function lS(a,s){var u=[],m={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return a.then(function(){m.status="fulfilled",m.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(m.status="rejected",m.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),m}var cx=H.S;H.S=function(a,s){Yy=Tt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&iS(a,s),cx!==null&&cx(a,s)};var jl=U(null);function Pm(){var a=jl.current;return a!==null?a:yn.pooledCache}function Dd(a,s){s===null?D(jl,jl.current):D(jl,s.pool)}function dx(){var a=Pm();return a===null?null:{parent:Wn._currentValue,pool:a}}var Io=Error(r(460)),Bm=Error(r(474)),jd=Error(r(542)),Md={then:function(){}};function fx(a){return a=a.status,a==="fulfilled"||a==="rejected"}function hx(a,s,u){switch(u=a[u],u===void 0?a.push(s):u!==s&&(s.then(Br,Br),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,px(a),a;default:if(typeof s.status=="string")s.then(Br,Br);else{if(a=yn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(m){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=m}},function(m){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=m}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,px(a),a}throw Pl=s,Io}}function Ml(a){try{var s=a._init;return s(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Pl=u,Io):u}}var Pl=null;function mx(){if(Pl===null)throw Error(r(459));var a=Pl;return Pl=null,a}function px(a){if(a===Io||a===jd)throw Error(r(483))}var Oo=null,Vu=0;function Pd(a){var s=Vu;return Vu+=1,Oo===null&&(Oo=[]),hx(Oo,a,s)}function Gu(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Bd(a,s){throw s.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function gx(a){function s(te,Z){if(a){var le=te.deletions;le===null?(te.deletions=[Z],te.flags|=16):le.push(Z)}}function u(te,Z){if(!a)return null;for(;Z!==null;)s(te,Z),Z=Z.sibling;return null}function m(te){for(var Z=new Map;te!==null;)te.key!==null?Z.set(te.key,te):Z.set(te.index,te),te=te.sibling;return Z}function b(te,Z){return te=qs(te,Z),te.index=0,te.sibling=null,te}function y(te,Z,le){return te.index=le,a?(le=te.alternate,le!==null?(le=le.index,le<Z?(te.flags|=67108866,Z):le):(te.flags|=67108866,Z)):(te.flags|=1048576,Z)}function k(te){return a&&te.alternate===null&&(te.flags|=67108866),te}function L(te,Z,le,xe){return Z===null||Z.tag!==6?(Z=Cm(le,te.mode,xe),Z.return=te,Z):(Z=b(Z,le),Z.return=te,Z)}function Y(te,Z,le,xe){var rt=le.type;return rt===C?be(te,Z,le.props.children,xe,le.key):Z!==null&&(Z.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===$&&Ml(rt)===Z.type)?(Z=b(Z,le.props),Gu(Z,le),Z.return=te,Z):(Z=Rd(le.type,le.key,le.props,null,te.mode,xe),Gu(Z,le),Z.return=te,Z)}function oe(te,Z,le,xe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==le.containerInfo||Z.stateNode.implementation!==le.implementation?(Z=Sm(le,te.mode,xe),Z.return=te,Z):(Z=b(Z,le.children||[]),Z.return=te,Z)}function be(te,Z,le,xe,rt){return Z===null||Z.tag!==7?(Z=Ll(le,te.mode,xe,rt),Z.return=te,Z):(Z=b(Z,le),Z.return=te,Z)}function Ee(te,Z,le){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Cm(""+Z,te.mode,le),Z.return=te,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:return le=Rd(Z.type,Z.key,Z.props,null,te.mode,le),Gu(le,Z),le.return=te,le;case v:return Z=Sm(Z,te.mode,le),Z.return=te,Z;case $:return Z=Ml(Z),Ee(te,Z,le)}if(se(Z)||Q(Z))return Z=Ll(Z,te.mode,le,null),Z.return=te,Z;if(typeof Z.then=="function")return Ee(te,Pd(Z),le);if(Z.$$typeof===R)return Ee(te,Od(te,Z),le);Bd(te,Z)}return null}function ue(te,Z,le,xe){var rt=Z!==null?Z.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return rt!==null?null:L(te,Z,""+le,xe);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case E:return le.key===rt?Y(te,Z,le,xe):null;case v:return le.key===rt?oe(te,Z,le,xe):null;case $:return le=Ml(le),ue(te,Z,le,xe)}if(se(le)||Q(le))return rt!==null?null:be(te,Z,le,xe,null);if(typeof le.then=="function")return ue(te,Z,Pd(le),xe);if(le.$$typeof===R)return ue(te,Z,Od(te,le),xe);Bd(te,le)}return null}function he(te,Z,le,xe,rt){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return te=te.get(le)||null,L(Z,te,""+xe,rt);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case E:return te=te.get(xe.key===null?le:xe.key)||null,Y(Z,te,xe,rt);case v:return te=te.get(xe.key===null?le:xe.key)||null,oe(Z,te,xe,rt);case $:return xe=Ml(xe),he(te,Z,le,xe,rt)}if(se(xe)||Q(xe))return te=te.get(le)||null,be(Z,te,xe,rt,null);if(typeof xe.then=="function")return he(te,Z,le,Pd(xe),rt);if(xe.$$typeof===R)return he(te,Z,le,Od(Z,xe),rt);Bd(Z,xe)}return null}function Ge(te,Z,le,xe){for(var rt=null,Jt=null,Qe=Z,Ct=Z=0,Ht=null;Qe!==null&&Ct<le.length;Ct++){Qe.index>Ct?(Ht=Qe,Qe=null):Ht=Qe.sibling;var en=ue(te,Qe,le[Ct],xe);if(en===null){Qe===null&&(Qe=Ht);break}a&&Qe&&en.alternate===null&&s(te,Qe),Z=y(en,Z,Ct),Jt===null?rt=en:Jt.sibling=en,Jt=en,Qe=Ht}if(Ct===le.length)return u(te,Qe),$t&&Ys(te,Ct),rt;if(Qe===null){for(;Ct<le.length;Ct++)Qe=Ee(te,le[Ct],xe),Qe!==null&&(Z=y(Qe,Z,Ct),Jt===null?rt=Qe:Jt.sibling=Qe,Jt=Qe);return $t&&Ys(te,Ct),rt}for(Qe=m(Qe);Ct<le.length;Ct++)Ht=he(Qe,te,Ct,le[Ct],xe),Ht!==null&&(a&&Ht.alternate!==null&&Qe.delete(Ht.key===null?Ct:Ht.key),Z=y(Ht,Z,Ct),Jt===null?rt=Ht:Jt.sibling=Ht,Jt=Ht);return a&&Qe.forEach(function(Xi){return s(te,Xi)}),$t&&Ys(te,Ct),rt}function dt(te,Z,le,xe){if(le==null)throw Error(r(151));for(var rt=null,Jt=null,Qe=Z,Ct=Z=0,Ht=null,en=le.next();Qe!==null&&!en.done;Ct++,en=le.next()){Qe.index>Ct?(Ht=Qe,Qe=null):Ht=Qe.sibling;var Xi=ue(te,Qe,en.value,xe);if(Xi===null){Qe===null&&(Qe=Ht);break}a&&Qe&&Xi.alternate===null&&s(te,Qe),Z=y(Xi,Z,Ct),Jt===null?rt=Xi:Jt.sibling=Xi,Jt=Xi,Qe=Ht}if(en.done)return u(te,Qe),$t&&Ys(te,Ct),rt;if(Qe===null){for(;!en.done;Ct++,en=le.next())en=Ee(te,en.value,xe),en!==null&&(Z=y(en,Z,Ct),Jt===null?rt=en:Jt.sibling=en,Jt=en);return $t&&Ys(te,Ct),rt}for(Qe=m(Qe);!en.done;Ct++,en=le.next())en=he(Qe,te,Ct,en.value,xe),en!==null&&(a&&en.alternate!==null&&Qe.delete(en.key===null?Ct:en.key),Z=y(en,Z,Ct),Jt===null?rt=en:Jt.sibling=en,Jt=en);return a&&Qe.forEach(function(xN){return s(te,xN)}),$t&&Ys(te,Ct),rt}function pn(te,Z,le,xe){if(typeof le=="object"&&le!==null&&le.type===C&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case E:e:{for(var rt=le.key;Z!==null;){if(Z.key===rt){if(rt=le.type,rt===C){if(Z.tag===7){u(te,Z.sibling),xe=b(Z,le.props.children),xe.return=te,te=xe;break e}}else if(Z.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===$&&Ml(rt)===Z.type){u(te,Z.sibling),xe=b(Z,le.props),Gu(xe,le),xe.return=te,te=xe;break e}u(te,Z);break}else s(te,Z);Z=Z.sibling}le.type===C?(xe=Ll(le.props.children,te.mode,xe,le.key),xe.return=te,te=xe):(xe=Rd(le.type,le.key,le.props,null,te.mode,xe),Gu(xe,le),xe.return=te,te=xe)}return k(te);case v:e:{for(rt=le.key;Z!==null;){if(Z.key===rt)if(Z.tag===4&&Z.stateNode.containerInfo===le.containerInfo&&Z.stateNode.implementation===le.implementation){u(te,Z.sibling),xe=b(Z,le.children||[]),xe.return=te,te=xe;break e}else{u(te,Z);break}else s(te,Z);Z=Z.sibling}xe=Sm(le,te.mode,xe),xe.return=te,te=xe}return k(te);case $:return le=Ml(le),pn(te,Z,le,xe)}if(se(le))return Ge(te,Z,le,xe);if(Q(le)){if(rt=Q(le),typeof rt!="function")throw Error(r(150));return le=rt.call(le),dt(te,Z,le,xe)}if(typeof le.then=="function")return pn(te,Z,Pd(le),xe);if(le.$$typeof===R)return pn(te,Z,Od(te,le),xe);Bd(te,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Z!==null&&Z.tag===6?(u(te,Z.sibling),xe=b(Z,le),xe.return=te,te=xe):(u(te,Z),xe=Cm(le,te.mode,xe),xe.return=te,te=xe),k(te)):u(te,Z)}return function(te,Z,le,xe){try{Vu=0;var rt=pn(te,Z,le,xe);return Oo=null,rt}catch(Qe){if(Qe===Io||Qe===jd)throw Qe;var Jt=ia(29,Qe,null,te.mode);return Jt.lanes=xe,Jt.return=te,Jt}finally{}}}var Bl=gx(!0),bx=gx(!1),Oi=!1;function Um(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hm(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 Di(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ji(a,s,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(tn&2)!==0){var b=m.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),m.pending=s,s=Ad(a),ex(a,null,u),s}return Nd(a,m,s,u),Ad(a)}function qu(a,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var m=s.lanes;m&=a.pendingLanes,u|=m,s.lanes=u,yi(a,u)}}function Fm(a,s){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var b=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var k={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?b=y=k:y=y.next=k,u=u.next}while(u!==null);y===null?b=y=s:y=y.next=s}else b=y=s;u={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:y,shared:m.shared,callbacks:m.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=s:a.next=s,u.lastBaseUpdate=s}var zm=!1;function Yu(){if(zm){var a=Lo;if(a!==null)throw a}}function Wu(a,s,u,m){zm=!1;var b=a.updateQueue;Oi=!1;var y=b.firstBaseUpdate,k=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var Y=L,oe=Y.next;Y.next=null,k===null?y=oe:k.next=oe,k=Y;var be=a.alternate;be!==null&&(be=be.updateQueue,L=be.lastBaseUpdate,L!==k&&(L===null?be.firstBaseUpdate=oe:L.next=oe,be.lastBaseUpdate=Y))}if(y!==null){var Ee=b.baseState;k=0,be=oe=Y=null,L=y;do{var ue=L.lane&-536870913,he=ue!==L.lane;if(he?(Ut&ue)===ue:(m&ue)===ue){ue!==0&&ue===Ro&&(zm=!0),be!==null&&(be=be.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ge=a,dt=L;ue=s;var pn=u;switch(dt.tag){case 1:if(Ge=dt.payload,typeof Ge=="function"){Ee=Ge.call(pn,Ee,ue);break e}Ee=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=dt.payload,ue=typeof Ge=="function"?Ge.call(pn,Ee,ue):Ge,ue==null)break e;Ee=p({},Ee,ue);break e;case 2:Oi=!0}}ue=L.callback,ue!==null&&(a.flags|=64,he&&(a.flags|=8192),he=b.callbacks,he===null?b.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:L.tag,payload:L.payload,callback:L.callback,next:null},be===null?(oe=be=he,Y=Ee):be=be.next=he,k|=ue;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;he=L,L=he.next,he.next=null,b.lastBaseUpdate=he,b.shared.pending=null}}while(!0);be===null&&(Y=Ee),b.baseState=Y,b.firstBaseUpdate=oe,b.lastBaseUpdate=be,y===null&&(b.shared.lanes=0),Hi|=k,a.lanes=k,a.memoizedState=Ee}}function xx(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function yx(a,s){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)xx(u[a],s)}var Do=U(null),Ud=U(0);function Ex(a,s){a=ai,D(Ud,a),D(Do,s),ai=a|s.baseLanes}function $m(){D(Ud,ai),D(Do,Do.current)}function Vm(){ai=Ud.current,ee(Do),ee(Ud)}var la=U(null),Ia=null;function Mi(a){var s=a.alternate;D(Hn,Hn.current&1),D(la,a),Ia===null&&(s===null||Do.current!==null||s.memoizedState!==null)&&(Ia=a)}function Gm(a){D(Hn,Hn.current),D(la,a),Ia===null&&(Ia=a)}function _x(a){a.tag===22?(D(Hn,Hn.current),D(la,a),Ia===null&&(Ia=a)):Pi()}function Pi(){D(Hn,Hn.current),D(la,la.current)}function oa(a){ee(la),Ia===a&&(Ia=null),ee(Hn)}var Hn=U(0);function Hd(a){for(var s=a;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Kp(u)||Zp(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 Xs=0,vt=null,hn=null,Qn=null,Fd=!1,jo=!1,Ul=!1,zd=0,Qu=0,Mo=null,oS=0;function Mn(){throw Error(r(321))}function qm(a,s){if(s===null)return!1;for(var u=0;u<s.length&&u<a.length;u++)if(!sa(a[u],s[u]))return!1;return!0}function Ym(a,s,u,m,b,y){return Xs=y,vt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,H.H=a===null||a.memoizedState===null?ay:op,Ul=!1,y=u(m,b),Ul=!1,jo&&(y=vx(s,u,m,b)),Tx(a),y}function Tx(a){H.H=Zu;var s=hn!==null&&hn.next!==null;if(Xs=0,Qn=hn=vt=null,Fd=!1,Qu=0,Mo=null,s)throw Error(r(300));a===null||Xn||(a=a.dependencies,a!==null&&Id(a)&&(Xn=!0))}function vx(a,s,u,m){vt=a;var b=0;do{if(jo&&(Mo=null),Qu=0,jo=!1,25<=b)throw Error(r(301));if(b+=1,Qn=hn=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}H.H=sy,y=s(u,m)}while(jo);return y}function uS(){var a=H.H,s=a.useState()[0];return s=typeof s.then=="function"?Xu(s):s,a=a.useState()[0],(hn!==null?hn.memoizedState:null)!==a&&(vt.flags|=1024),s}function Wm(){var a=zd!==0;return zd=0,a}function Qm(a,s,u){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~u}function Xm(a){if(Fd){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Fd=!1}Xs=0,Qn=hn=vt=null,jo=!1,Qu=zd=0,Mo=null}function Ur(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?vt.memoizedState=Qn=a:Qn=Qn.next=a,Qn}function Fn(){if(hn===null){var a=vt.alternate;a=a!==null?a.memoizedState:null}else a=hn.next;var s=Qn===null?vt.memoizedState:Qn.next;if(s!==null)Qn=s,hn=a;else{if(a===null)throw vt.alternate===null?Error(r(467)):Error(r(310));hn=a,a={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},Qn===null?vt.memoizedState=Qn=a:Qn=Qn.next=a}return Qn}function $d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xu(a){var s=Qu;return Qu+=1,Mo===null&&(Mo=[]),a=hx(Mo,a,s),s=vt,(Qn===null?s.memoizedState:Qn.next)===null&&(s=s.alternate,H.H=s===null||s.memoizedState===null?ay:op),a}function Vd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Xu(a);if(a.$$typeof===R)return Tr(a)}throw Error(r(438,String(a)))}function Km(a){var s=null,u=vt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var m=vt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(s={data:m.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=$d(),vt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(a),m=0;m<a;m++)u[m]=W;return s.index++,u}function Ks(a,s){return typeof s=="function"?s(a):s}function Gd(a){var s=Fn();return Zm(s,hn,a)}function Zm(a,s,u){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=u;var b=a.baseQueue,y=m.pending;if(y!==null){if(b!==null){var k=b.next;b.next=y.next,y.next=k}s.baseQueue=b=y,m.pending=null}if(y=a.baseState,b===null)a.memoizedState=y;else{s=b.next;var L=k=null,Y=null,oe=s,be=!1;do{var Ee=oe.lane&-536870913;if(Ee!==oe.lane?(Ut&Ee)===Ee:(Xs&Ee)===Ee){var ue=oe.revertLane;if(ue===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),Ee===Ro&&(be=!0);else if((Xs&ue)===ue){oe=oe.next,ue===Ro&&(be=!0);continue}else Ee={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(L=Y=Ee,k=y):Y=Y.next=Ee,vt.lanes|=ue,Hi|=ue;Ee=oe.action,Ul&&u(y,Ee),y=oe.hasEagerState?oe.eagerState:u(y,Ee)}else ue={lane:Ee,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(L=Y=ue,k=y):Y=Y.next=ue,vt.lanes|=Ee,Hi|=Ee;oe=oe.next}while(oe!==null&&oe!==s);if(Y===null?k=y:Y.next=L,!sa(y,a.memoizedState)&&(Xn=!0,be&&(u=Lo,u!==null)))throw u;a.memoizedState=y,a.baseState=k,a.baseQueue=Y,m.lastRenderedState=y}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Jm(a){var s=Fn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var m=u.dispatch,b=u.pending,y=s.memoizedState;if(b!==null){u.pending=null;var k=b=b.next;do y=a(y,k.action),k=k.next;while(k!==b);sa(y,s.memoizedState)||(Xn=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,m]}function kx(a,s,u){var m=vt,b=Fn(),y=$t;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=s();var k=!sa((hn||b).memoizedState,u);if(k&&(b.memoizedState=u,Xn=!0),b=b.queue,np(Sx.bind(null,m,b,a),[a]),b.getSnapshot!==s||k||Qn!==null&&Qn.memoizedState.tag&1){if(m.flags|=2048,Po(9,{destroy:void 0},Cx.bind(null,m,b,u,s),null),yn===null)throw Error(r(349));y||(Xs&127)!==0||wx(m,s,u)}return u}function wx(a,s,u){a.flags|=16384,a={getSnapshot:s,value:u},s=vt.updateQueue,s===null?(s=$d(),vt.updateQueue=s,s.stores=[a]):(u=s.stores,u===null?s.stores=[a]:u.push(a))}function Cx(a,s,u,m){s.value=u,s.getSnapshot=m,Nx(s)&&Ax(a)}function Sx(a,s,u){return u(function(){Nx(s)&&Ax(a)})}function Nx(a){var s=a.getSnapshot;a=a.value;try{var u=s();return!sa(a,u)}catch{return!0}}function Ax(a){var s=Rl(a,2);s!==null&&Jr(s,a,2)}function ep(a){var s=Ur();if(typeof a=="function"){var u=a;if(a=u(),Ul){tt(!0);try{u()}finally{tt(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:a},s}function Rx(a,s,u,m){return a.baseState=u,Zm(a,hn,typeof m=="function"?m:Ks)}function cS(a,s,u,m,b){if(Wd(a))throw Error(r(485));if(a=s.action,a!==null){var y={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};H.T!==null?u(!0):y.isTransition=!1,m(y),u=s.pending,u===null?(y.next=s.pending=y,Lx(s,y)):(y.next=u.next,s.pending=u.next=y)}}function Lx(a,s){var u=s.action,m=s.payload,b=a.state;if(s.isTransition){var y=H.T,k={};H.T=k;try{var L=u(b,m),Y=H.S;Y!==null&&Y(k,L),Ix(a,s,L)}catch(oe){tp(a,s,oe)}finally{y!==null&&k.types!==null&&(y.types=k.types),H.T=y}}else try{y=u(b,m),Ix(a,s,y)}catch(oe){tp(a,s,oe)}}function Ix(a,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){Ox(a,s,m)},function(m){return tp(a,s,m)}):Ox(a,s,u)}function Ox(a,s,u){s.status="fulfilled",s.value=u,Dx(s),a.state=u,s=a.pending,s!==null&&(u=s.next,u===s?a.pending=null:(u=u.next,s.next=u,Lx(a,u)))}function tp(a,s,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do s.status="rejected",s.reason=u,Dx(s),s=s.next;while(s!==m)}a.action=null}function Dx(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function jx(a,s){return s}function Mx(a,s){if($t){var u=yn.formState;if(u!==null){e:{var m=vt;if($t){if(vn){t:{for(var b=vn,y=La;b.nodeType!==8;){if(!y){b=null;break t}if(b=Oa(b.nextSibling),b===null){b=null;break t}}y=b.data,b=y==="F!"||y==="F"?b:null}if(b){vn=Oa(b.nextSibling),m=b.data==="F!";break e}}Li(m)}m=!1}m&&(s=u[0])}}return u=Ur(),u.memoizedState=u.baseState=s,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jx,lastRenderedState:s},u.queue=m,u=ty.bind(null,vt,m),m.dispatch=u,m=ep(!1),y=lp.bind(null,vt,!1,m.queue),m=Ur(),b={state:s,dispatch:null,action:a,pending:null},m.queue=b,u=cS.bind(null,vt,b,y,u),b.dispatch=u,m.memoizedState=a,[s,u,!1]}function Px(a){var s=Fn();return Bx(s,hn,a)}function Bx(a,s,u){if(s=Zm(a,s,jx)[0],a=Gd(Ks)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var m=Xu(s)}catch(k){throw k===Io?jd:k}else m=s;s=Fn();var b=s.queue,y=b.dispatch;return u!==s.memoizedState&&(vt.flags|=2048,Po(9,{destroy:void 0},dS.bind(null,b,u),null)),[m,y,a]}function dS(a,s){a.action=s}function Ux(a){var s=Fn(),u=hn;if(u!==null)return Bx(s,u,a);Fn(),s=s.memoizedState,u=Fn();var m=u.queue.dispatch;return u.memoizedState=a,[s,m,!1]}function Po(a,s,u,m){return a={tag:a,create:u,deps:m,inst:s,next:null},s=vt.updateQueue,s===null&&(s=$d(),vt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=a.next=a:(m=u.next,u.next=a,a.next=m,s.lastEffect=a),a}function Hx(){return Fn().memoizedState}function qd(a,s,u,m){var b=Ur();vt.flags|=a,b.memoizedState=Po(1|s,{destroy:void 0},u,m===void 0?null:m)}function Yd(a,s,u,m){var b=Fn();m=m===void 0?null:m;var y=b.memoizedState.inst;hn!==null&&m!==null&&qm(m,hn.memoizedState.deps)?b.memoizedState=Po(s,y,u,m):(vt.flags|=a,b.memoizedState=Po(1|s,y,u,m))}function Fx(a,s){qd(8390656,8,a,s)}function np(a,s){Yd(2048,8,a,s)}function fS(a){vt.flags|=4;var s=vt.updateQueue;if(s===null)s=$d(),vt.updateQueue=s,s.events=[a];else{var u=s.events;u===null?s.events=[a]:u.push(a)}}function zx(a){var s=Fn().memoizedState;return fS({ref:s,nextImpl:a}),function(){if((tn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function $x(a,s){return Yd(4,2,a,s)}function Vx(a,s){return Yd(4,4,a,s)}function Gx(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 qx(a,s,u){u=u!=null?u.concat([a]):null,Yd(4,4,Gx.bind(null,s,a),u)}function rp(){}function Yx(a,s){var u=Fn();s=s===void 0?null:s;var m=u.memoizedState;return s!==null&&qm(s,m[1])?m[0]:(u.memoizedState=[a,s],a)}function Wx(a,s){var u=Fn();s=s===void 0?null:s;var m=u.memoizedState;if(s!==null&&qm(s,m[1]))return m[0];if(m=a(),Ul){tt(!0);try{a()}finally{tt(!1)}}return u.memoizedState=[m,s],m}function ap(a,s,u){return u===void 0||(Xs&1073741824)!==0&&(Ut&261930)===0?a.memoizedState=s:(a.memoizedState=u,a=Qy(),vt.lanes|=a,Hi|=a,u)}function Qx(a,s,u,m){return sa(u,s)?u:Do.current!==null?(a=ap(a,u,m),sa(a,s)||(Xn=!0),a):(Xs&42)===0||(Xs&1073741824)!==0&&(Ut&261930)===0?(Xn=!0,a.memoizedState=u):(a=Qy(),vt.lanes|=a,Hi|=a,s)}function Xx(a,s,u,m,b){var y=ce.p;ce.p=y!==0&&8>y?y:8;var k=H.T,L={};H.T=L,lp(a,!1,s,u);try{var Y=b(),oe=H.S;if(oe!==null&&oe(L,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var be=lS(Y,m);Ku(a,s,be,da(a))}else Ku(a,s,m,da(a))}catch(Ee){Ku(a,s,{then:function(){},status:"rejected",reason:Ee},da())}finally{ce.p=y,k!==null&&L.types!==null&&(k.types=L.types),H.T=k}}function hS(){}function sp(a,s,u,m){if(a.tag!==5)throw Error(r(476));var b=Kx(a).queue;Xx(a,b,s,q,u===null?hS:function(){return Zx(a),u(m)})}function Kx(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:q},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:u},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function Zx(a){var s=Kx(a);s.next===null&&(s=a.alternate.memoizedState),Ku(a,s.next.queue,{},da())}function ip(){return Tr(mc)}function Jx(){return Fn().memoizedState}function ey(){return Fn().memoizedState}function mS(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var u=da();a=Di(u);var m=ji(s,a,u);m!==null&&(Jr(m,s,u),qu(m,s,u)),s={cache:jm()},a.payload=s;return}s=s.return}}function pS(a,s,u){var m=da();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wd(a)?ny(s,u):(u=km(a,s,u,m),u!==null&&(Jr(u,a,m),ry(u,s,m)))}function ty(a,s,u){var m=da();Ku(a,s,u,m)}function Ku(a,s,u,m){var b={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Wd(a))ny(s,b);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var k=s.lastRenderedState,L=y(k,u);if(b.hasEagerState=!0,b.eagerState=L,sa(L,k))return Nd(a,s,b,0),yn===null&&Sd(),!1}catch{}finally{}if(u=km(a,s,b,m),u!==null)return Jr(u,a,m),ry(u,s,m),!0}return!1}function lp(a,s,u,m){if(m={lane:2,revertLane:Up(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Wd(a)){if(s)throw Error(r(479))}else s=km(a,u,m,2),s!==null&&Jr(s,a,2)}function Wd(a){var s=a.alternate;return a===vt||s!==null&&s===vt}function ny(a,s){jo=Fd=!0;var u=a.pending;u===null?s.next=s:(s.next=u.next,u.next=s),a.pending=s}function ry(a,s,u){if((u&4194048)!==0){var m=s.lanes;m&=a.pendingLanes,u|=m,s.lanes=u,yi(a,u)}}var Zu={readContext:Tr,use:Vd,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};Zu.useEffectEvent=Mn;var ay={readContext:Tr,use:Vd,useCallback:function(a,s){return Ur().memoizedState=[a,s===void 0?null:s],a},useContext:Tr,useEffect:Fx,useImperativeHandle:function(a,s,u){u=u!=null?u.concat([a]):null,qd(4194308,4,Gx.bind(null,s,a),u)},useLayoutEffect:function(a,s){return qd(4194308,4,a,s)},useInsertionEffect:function(a,s){qd(4,2,a,s)},useMemo:function(a,s){var u=Ur();s=s===void 0?null:s;var m=a();if(Ul){tt(!0);try{a()}finally{tt(!1)}}return u.memoizedState=[m,s],m},useReducer:function(a,s,u){var m=Ur();if(u!==void 0){var b=u(s);if(Ul){tt(!0);try{u(s)}finally{tt(!1)}}}else b=s;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=pS.bind(null,vt,a),[m.memoizedState,a]},useRef:function(a){var s=Ur();return a={current:a},s.memoizedState=a},useState:function(a){a=ep(a);var s=a.queue,u=ty.bind(null,vt,s);return s.dispatch=u,[a.memoizedState,u]},useDebugValue:rp,useDeferredValue:function(a,s){var u=Ur();return ap(u,a,s)},useTransition:function(){var a=ep(!1);return a=Xx.bind(null,vt,a.queue,!0,!1),Ur().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,u){var m=vt,b=Ur();if($t){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),yn===null)throw Error(r(349));(Ut&127)!==0||wx(m,s,u)}b.memoizedState=u;var y={value:u,getSnapshot:s};return b.queue=y,Fx(Sx.bind(null,m,y,a),[a]),m.flags|=2048,Po(9,{destroy:void 0},Cx.bind(null,m,y,u,s),null),u},useId:function(){var a=Ur(),s=yn.identifierPrefix;if($t){var u=ms,m=hs;u=(m&~(1<<32-Me(m)-1)).toString(32)+u,s="_"+s+"R_"+u,u=zd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=oS++,s="_"+s+"r_"+u.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:ip,useFormState:Mx,useActionState:Mx,useOptimistic:function(a){var s=Ur();s.memoizedState=s.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=lp.bind(null,vt,!0,u),u.dispatch=s,[a,s]},useMemoCache:Km,useCacheRefresh:function(){return Ur().memoizedState=mS.bind(null,vt)},useEffectEvent:function(a){var s=Ur(),u={impl:a};return s.memoizedState=u,function(){if((tn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},op={readContext:Tr,use:Vd,useCallback:Yx,useContext:Tr,useEffect:np,useImperativeHandle:qx,useInsertionEffect:$x,useLayoutEffect:Vx,useMemo:Wx,useReducer:Gd,useRef:Hx,useState:function(){return Gd(Ks)},useDebugValue:rp,useDeferredValue:function(a,s){var u=Fn();return Qx(u,hn.memoizedState,a,s)},useTransition:function(){var a=Gd(Ks)[0],s=Fn().memoizedState;return[typeof a=="boolean"?a:Xu(a),s]},useSyncExternalStore:kx,useId:Jx,useHostTransitionStatus:ip,useFormState:Px,useActionState:Px,useOptimistic:function(a,s){var u=Fn();return Rx(u,hn,a,s)},useMemoCache:Km,useCacheRefresh:ey};op.useEffectEvent=zx;var sy={readContext:Tr,use:Vd,useCallback:Yx,useContext:Tr,useEffect:np,useImperativeHandle:qx,useInsertionEffect:$x,useLayoutEffect:Vx,useMemo:Wx,useReducer:Jm,useRef:Hx,useState:function(){return Jm(Ks)},useDebugValue:rp,useDeferredValue:function(a,s){var u=Fn();return hn===null?ap(u,a,s):Qx(u,hn.memoizedState,a,s)},useTransition:function(){var a=Jm(Ks)[0],s=Fn().memoizedState;return[typeof a=="boolean"?a:Xu(a),s]},useSyncExternalStore:kx,useId:Jx,useHostTransitionStatus:ip,useFormState:Ux,useActionState:Ux,useOptimistic:function(a,s){var u=Fn();return hn!==null?Rx(u,hn,a,s):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Km,useCacheRefresh:ey};sy.useEffectEvent=zx;function up(a,s,u,m){s=a.memoizedState,u=u(m,s),u=u==null?s:p({},s,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var cp={enqueueSetState:function(a,s,u){a=a._reactInternals;var m=da(),b=Di(m);b.payload=s,u!=null&&(b.callback=u),s=ji(a,b,m),s!==null&&(Jr(s,a,m),qu(s,a,m))},enqueueReplaceState:function(a,s,u){a=a._reactInternals;var m=da(),b=Di(m);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=ji(a,b,m),s!==null&&(Jr(s,a,m),qu(s,a,m))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var u=da(),m=Di(u);m.tag=2,s!=null&&(m.callback=s),s=ji(a,m,u),s!==null&&(Jr(s,a,u),qu(s,a,u))}};function iy(a,s,u,m,b,y,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,y,k):s.prototype&&s.prototype.isPureReactComponent?!Bu(u,m)||!Bu(b,y):!0}function ly(a,s,u,m){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,m),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,m),s.state!==a&&cp.enqueueReplaceState(s,s.state,null)}function Hl(a,s){var u=s;if("ref"in s){u={};for(var m in s)m!=="ref"&&(u[m]=s[m])}if(a=a.defaultProps){u===s&&(u=p({},u));for(var b in a)u[b]===void 0&&(u[b]=a[b])}return u}function oy(a){Cd(a)}function uy(a){console.error(a)}function cy(a){Cd(a)}function Qd(a,s){try{var u=a.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(m){setTimeout(function(){throw m})}}function dy(a,s,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function dp(a,s,u){return u=Di(u),u.tag=3,u.payload={element:null},u.callback=function(){Qd(a,s)},u}function fy(a){return a=Di(a),a.tag=3,a}function hy(a,s,u,m){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var y=m.value;a.payload=function(){return b(y)},a.callback=function(){dy(s,u,m)}}var k=u.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){dy(s,u,m),typeof b!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var L=m.stack;this.componentDidCatch(m.value,{componentStack:L!==null?L:""})})}function gS(a,s,u,m,b){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(s=u.alternate,s!==null&&Ao(s,u,b,!0),u=la.current,u!==null){switch(u.tag){case 31:case 13:return Ia===null?of():u.alternate===null&&Pn===0&&(Pn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,m===Md?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([m]):s.add(m),Mp(a,m,b)),!1;case 22:return u.flags|=65536,m===Md?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([m]):u.add(m)),Mp(a,m,b)),!1}throw Error(r(435,u.tag))}return Mp(a,m,b),of(),!1}if($t)return s=la.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,m!==Rm&&(a=Error(r(422),{cause:m}),Fu(Na(a,u)))):(m!==Rm&&(s=Error(r(423),{cause:m}),Fu(Na(s,u))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=Na(m,u),b=dp(a.stateNode,m,b),Fm(a,b),Pn!==4&&(Pn=2)),!1;var y=Error(r(520),{cause:m});if(y=Na(y,u),ic===null?ic=[y]:ic.push(y),Pn!==4&&(Pn=2),s===null)return!0;m=Na(m,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,a=b&-b,u.lanes|=a,a=dp(u.stateNode,m,a),Fm(u,a),!1;case 1:if(s=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Fi===null||!Fi.has(y))))return u.flags|=65536,b&=-b,u.lanes|=b,b=fy(b),hy(b,a,u,m),Fm(u,b),!1}u=u.return}while(u!==null);return!1}var fp=Error(r(461)),Xn=!1;function vr(a,s,u,m){s.child=a===null?bx(s,null,u,m):Bl(s,a.child,u,m)}function my(a,s,u,m,b){u=u.render;var y=s.ref;if("ref"in m){var k={};for(var L in m)L!=="ref"&&(k[L]=m[L])}else k=m;return Dl(s),m=Ym(a,s,u,k,y,b),L=Wm(),a!==null&&!Xn?(Qm(a,s,b),Zs(a,s,b)):($t&&L&&Nm(s),s.flags|=1,vr(a,s,m,b),s.child)}function py(a,s,u,m,b){if(a===null){var y=u.type;return typeof y=="function"&&!wm(y)&&y.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=y,gy(a,s,y,m,b)):(a=Rd(u.type,null,m,s,s.mode,b),a.ref=s.ref,a.return=s,s.child=a)}if(y=a.child,!Ep(a,b)){var k=y.memoizedProps;if(u=u.compare,u=u!==null?u:Bu,u(k,m)&&a.ref===s.ref)return Zs(a,s,b)}return s.flags|=1,a=qs(y,m),a.ref=s.ref,a.return=s,s.child=a}function gy(a,s,u,m,b){if(a!==null){var y=a.memoizedProps;if(Bu(y,m)&&a.ref===s.ref)if(Xn=!1,s.pendingProps=m=y,Ep(a,b))(a.flags&131072)!==0&&(Xn=!0);else return s.lanes=a.lanes,Zs(a,s,b)}return hp(a,s,u,m,b)}function by(a,s,u,m){var b=m.children,y=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|u:u,a!==null){for(m=s.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~y}else m=0,s.child=null;return xy(a,s,y,u,m)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Dd(s,y!==null?y.cachePool:null),y!==null?Ex(s,y):$m(),_x(s);else return m=s.lanes=536870912,xy(a,s,y!==null?y.baseLanes|u:u,u,m)}else y!==null?(Dd(s,y.cachePool),Ex(s,y),Pi(),s.memoizedState=null):(a!==null&&Dd(s,null),$m(),Pi());return vr(a,s,b,u),s.child}function Ju(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function xy(a,s,u,m,b){var y=Pm();return y=y===null?null:{parent:Wn._currentValue,pool:y},s.memoizedState={baseLanes:u,cachePool:y},a!==null&&Dd(s,null),$m(),_x(s),a!==null&&Ao(a,s,m,!0),s.childLanes=b,null}function Xd(a,s){return s=Zd({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function yy(a,s,u){return Bl(s,a.child,null,u),a=Xd(s,s.pendingProps),a.flags|=2,oa(s),s.memoizedState=null,a}function bS(a,s,u){var m=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,a===null){if($t){if(m.mode==="hidden")return a=Xd(s,m),s.lanes=536870912,Ju(null,a);if(Gm(s),(a=vn)?(a=LE(a,La),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Ai!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},u=nx(a),u.return=s,s.child=u,_r=s,vn=null)):a=null,a===null)throw Li(s);return s.lanes=536870912,null}return Xd(s,m)}var y=a.memoizedState;if(y!==null){var k=y.dehydrated;if(Gm(s),b)if(s.flags&256)s.flags&=-257,s=yy(a,s,u);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if(Xn||Ao(a,s,u,!1),b=(u&a.childLanes)!==0,Xn||b){if(m=yn,m!==null&&(k=us(m,u),k!==0&&k!==y.retryLane))throw y.retryLane=k,Rl(a,k),Jr(m,a,k),fp;of(),s=yy(a,s,u)}else a=y.treeContext,vn=Oa(k.nextSibling),_r=s,$t=!0,Ri=null,La=!1,a!==null&&sx(s,a),s=Xd(s,m),s.flags|=4096;return s}return a=qs(a.child,{mode:m.mode,children:m.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Kd(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 hp(a,s,u,m,b){return Dl(s),u=Ym(a,s,u,m,void 0,b),m=Wm(),a!==null&&!Xn?(Qm(a,s,b),Zs(a,s,b)):($t&&m&&Nm(s),s.flags|=1,vr(a,s,u,b),s.child)}function Ey(a,s,u,m,b,y){return Dl(s),s.updateQueue=null,u=vx(s,m,u,b),Tx(a),m=Wm(),a!==null&&!Xn?(Qm(a,s,y),Zs(a,s,y)):($t&&m&&Nm(s),s.flags|=1,vr(a,s,u,y),s.child)}function _y(a,s,u,m,b){if(Dl(s),s.stateNode===null){var y=wo,k=u.contextType;typeof k=="object"&&k!==null&&(y=Tr(k)),y=new u(m,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=cp,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=m,y.state=s.memoizedState,y.refs={},Um(s),k=u.contextType,y.context=typeof k=="object"&&k!==null?Tr(k):wo,y.state=s.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(up(s,u,k,m),y.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&cp.enqueueReplaceState(y,y.state,null),Wu(s,m,y,b),Yu(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),m=!0}else if(a===null){y=s.stateNode;var L=s.memoizedProps,Y=Hl(u,L);y.props=Y;var oe=y.context,be=u.contextType;k=wo,typeof be=="object"&&be!==null&&(k=Tr(be));var Ee=u.getDerivedStateFromProps;be=typeof Ee=="function"||typeof y.getSnapshotBeforeUpdate=="function",L=s.pendingProps!==L,be||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(L||oe!==k)&&ly(s,y,m,k),Oi=!1;var ue=s.memoizedState;y.state=ue,Wu(s,m,y,b),Yu(),oe=s.memoizedState,L||ue!==oe||Oi?(typeof Ee=="function"&&(up(s,u,Ee,m),oe=s.memoizedState),(Y=Oi||iy(s,u,Y,m,ue,oe,k))?(be||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=m,s.memoizedState=oe),y.props=m,y.state=oe,y.context=k,m=Y):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),m=!1)}else{y=s.stateNode,Hm(a,s),k=s.memoizedProps,be=Hl(u,k),y.props=be,Ee=s.pendingProps,ue=y.context,oe=u.contextType,Y=wo,typeof oe=="object"&&oe!==null&&(Y=Tr(oe)),L=u.getDerivedStateFromProps,(oe=typeof L=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==Ee||ue!==Y)&&ly(s,y,m,Y),Oi=!1,ue=s.memoizedState,y.state=ue,Wu(s,m,y,b),Yu();var he=s.memoizedState;k!==Ee||ue!==he||Oi||a!==null&&a.dependencies!==null&&Id(a.dependencies)?(typeof L=="function"&&(up(s,u,L,m),he=s.memoizedState),(be=Oi||iy(s,u,be,m,ue,he,Y)||a!==null&&a.dependencies!==null&&Id(a.dependencies))?(oe||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(m,he,Y),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(m,he,Y)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=1024),s.memoizedProps=m,s.memoizedState=he),y.props=m,y.state=he,y.context=Y,m=be):(typeof y.componentDidUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=1024),m=!1)}return y=m,Kd(a,s),m=(s.flags&128)!==0,y||m?(y=s.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,a!==null&&m?(s.child=Bl(s,a.child,null,b),s.child=Bl(s,null,u,b)):vr(a,s,u,b),s.memoizedState=y.state,a=s.child):a=Zs(a,s,b),a}function Ty(a,s,u,m){return Il(),s.flags|=256,vr(a,s,u,m),s.child}var mp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pp(a){return{baseLanes:a,cachePool:dx()}}function gp(a,s,u){return a=a!==null?a.childLanes&~u:0,s&&(a|=ca),a}function vy(a,s,u){var m=s.pendingProps,b=!1,y=(s.flags&128)!==0,k;if((k=y)||(k=a!==null&&a.memoizedState===null?!1:(Hn.current&2)!==0),k&&(b=!0,s.flags&=-129),k=(s.flags&32)!==0,s.flags&=-33,a===null){if($t){if(b?Mi(s):Pi(),(a=vn)?(a=LE(a,La),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Ai!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},u=nx(a),u.return=s,s.child=u,_r=s,vn=null)):a=null,a===null)throw Li(s);return Zp(a)?s.lanes=32:s.lanes=536870912,null}var L=m.children;return m=m.fallback,b?(Pi(),b=s.mode,L=Zd({mode:"hidden",children:L},b),m=Ll(m,b,u,null),L.return=s,m.return=s,L.sibling=m,s.child=L,m=s.child,m.memoizedState=pp(u),m.childLanes=gp(a,k,u),s.memoizedState=mp,Ju(null,m)):(Mi(s),bp(s,L))}var Y=a.memoizedState;if(Y!==null&&(L=Y.dehydrated,L!==null)){if(y)s.flags&256?(Mi(s),s.flags&=-257,s=xp(a,s,u)):s.memoizedState!==null?(Pi(),s.child=a.child,s.flags|=128,s=null):(Pi(),L=m.fallback,b=s.mode,m=Zd({mode:"visible",children:m.children},b),L=Ll(L,b,u,null),L.flags|=2,m.return=s,L.return=s,m.sibling=L,s.child=m,Bl(s,a.child,null,u),m=s.child,m.memoizedState=pp(u),m.childLanes=gp(a,k,u),s.memoizedState=mp,s=Ju(null,m));else if(Mi(s),Zp(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var oe=k.dgst;k=oe,m=Error(r(419)),m.stack="",m.digest=k,Fu({value:m,source:null,stack:null}),s=xp(a,s,u)}else if(Xn||Ao(a,s,u,!1),k=(u&a.childLanes)!==0,Xn||k){if(k=yn,k!==null&&(m=us(k,u),m!==0&&m!==Y.retryLane))throw Y.retryLane=m,Rl(a,m),Jr(k,a,m),fp;Kp(L)||of(),s=xp(a,s,u)}else Kp(L)?(s.flags|=192,s.child=a.child,s=null):(a=Y.treeContext,vn=Oa(L.nextSibling),_r=s,$t=!0,Ri=null,La=!1,a!==null&&sx(s,a),s=bp(s,m.children),s.flags|=4096);return s}return b?(Pi(),L=m.fallback,b=s.mode,Y=a.child,oe=Y.sibling,m=qs(Y,{mode:"hidden",children:m.children}),m.subtreeFlags=Y.subtreeFlags&65011712,oe!==null?L=qs(oe,L):(L=Ll(L,b,u,null),L.flags|=2),L.return=s,m.return=s,m.sibling=L,s.child=m,Ju(null,m),m=s.child,L=a.child.memoizedState,L===null?L=pp(u):(b=L.cachePool,b!==null?(Y=Wn._currentValue,b=b.parent!==Y?{parent:Y,pool:Y}:b):b=dx(),L={baseLanes:L.baseLanes|u,cachePool:b}),m.memoizedState=L,m.childLanes=gp(a,k,u),s.memoizedState=mp,Ju(a.child,m)):(Mi(s),u=a.child,a=u.sibling,u=qs(u,{mode:"visible",children:m.children}),u.return=s,u.sibling=null,a!==null&&(k=s.deletions,k===null?(s.deletions=[a],s.flags|=16):k.push(a)),s.child=u,s.memoizedState=null,u)}function bp(a,s){return s=Zd({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function Zd(a,s){return a=ia(22,a,null,s),a.lanes=0,a}function xp(a,s,u){return Bl(s,a.child,null,u),a=bp(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function ky(a,s,u){a.lanes|=s;var m=a.alternate;m!==null&&(m.lanes|=s),Om(a.return,s,u)}function yp(a,s,u,m,b,y){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:b,treeForkCount:y}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=u,k.tailMode=b,k.treeForkCount=y)}function wy(a,s,u){var m=s.pendingProps,b=m.revealOrder,y=m.tail;m=m.children;var k=Hn.current,L=(k&2)!==0;if(L?(k=k&1|2,s.flags|=128):k&=1,D(Hn,k),vr(a,s,m,u),m=$t?Hu:0,!L&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&ky(a,u,s);else if(a.tag===19)ky(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&&Hd(a)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),yp(s,!1,b,u,y,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(a=b.alternate,a!==null&&Hd(a)===null){s.child=b;break}a=b.sibling,b.sibling=u,u=b,b=a}yp(s,!0,u,null,y,m);break;case"together":yp(s,!1,null,null,void 0,m);break;default:s.memoizedState=null}return s.child}function Zs(a,s,u){if(a!==null&&(s.dependencies=a.dependencies),Hi|=s.lanes,(u&s.childLanes)===0)if(a!==null){if(Ao(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=qs(a,a.pendingProps),s.child=u,u.return=s;a.sibling!==null;)a=a.sibling,u=u.sibling=qs(a,a.pendingProps),u.return=s;u.sibling=null}return s.child}function Ep(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Id(a)))}function xS(a,s,u){switch(s.tag){case 3:et(s,s.stateNode.containerInfo),Ii(s,Wn,a.memoizedState.cache),Il();break;case 27:case 5:Ft(s);break;case 4:et(s,s.stateNode.containerInfo);break;case 10:Ii(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Gm(s),null;break;case 13:var m=s.memoizedState;if(m!==null)return m.dehydrated!==null?(Mi(s),s.flags|=128,null):(u&s.child.childLanes)!==0?vy(a,s,u):(Mi(s),a=Zs(a,s,u),a!==null?a.sibling:null);Mi(s);break;case 19:var b=(a.flags&128)!==0;if(m=(u&s.childLanes)!==0,m||(Ao(a,s,u,!1),m=(u&s.childLanes)!==0),b){if(m)return wy(a,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),D(Hn,Hn.current),m)break;return null;case 22:return s.lanes=0,by(a,s,u,s.pendingProps);case 24:Ii(s,Wn,a.memoizedState.cache)}return Zs(a,s,u)}function Cy(a,s,u){if(a!==null)if(a.memoizedProps!==s.pendingProps)Xn=!0;else{if(!Ep(a,u)&&(s.flags&128)===0)return Xn=!1,xS(a,s,u);Xn=(a.flags&131072)!==0}else Xn=!1,$t&&(s.flags&1048576)!==0&&ax(s,Hu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var m=s.pendingProps;if(a=Ml(s.elementType),s.type=a,typeof a=="function")wm(a)?(m=Hl(a,m),s.tag=1,s=_y(null,s,a,m,u)):(s.tag=0,s=hp(null,s,a,m,u));else{if(a!=null){var b=a.$$typeof;if(b===j){s.tag=11,s=my(null,s,a,m,u);break e}else if(b===P){s.tag=14,s=py(null,s,a,m,u);break e}}throw s=de(a)||a,Error(r(306,s,""))}}return s;case 0:return hp(a,s,s.type,s.pendingProps,u);case 1:return m=s.type,b=Hl(m,s.pendingProps),_y(a,s,m,b,u);case 3:e:{if(et(s,s.stateNode.containerInfo),a===null)throw Error(r(387));m=s.pendingProps;var y=s.memoizedState;b=y.element,Hm(a,s),Wu(s,m,null,u);var k=s.memoizedState;if(m=k.cache,Ii(s,Wn,m),m!==y.cache&&Dm(s,[Wn],u,!0),Yu(),m=k.element,y.isDehydrated)if(y={element:m,isDehydrated:!1,cache:k.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=Ty(a,s,m,u);break e}else if(m!==b){b=Na(Error(r(424)),s),Fu(b),s=Ty(a,s,m,u);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(vn=Oa(a.firstChild),_r=s,$t=!0,Ri=null,La=!0,u=bx(s,null,m,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Il(),m===b){s=Zs(a,s,u);break e}vr(a,s,m,u)}s=s.child}return s;case 26:return Kd(a,s),a===null?(u=PE(s.type,null,s.pendingProps,null))?s.memoizedState=u:$t||(u=s.type,a=s.pendingProps,m=pf(Se.current).createElement(u),m[bn]=s,m[An]=a,kr(m,u,a),_n(m),s.stateNode=m):s.memoizedState=PE(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return Ft(s),a===null&&$t&&(m=s.stateNode=DE(s.type,s.pendingProps,Se.current),_r=s,La=!0,b=vn,Gi(s.type)?(Jp=b,vn=Oa(m.firstChild)):vn=b),vr(a,s,s.pendingProps.children,u),Kd(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&$t&&((b=m=vn)&&(m=WS(m,s.type,s.pendingProps,La),m!==null?(s.stateNode=m,_r=s,vn=Oa(m.firstChild),La=!1,b=!0):b=!1),b||Li(s)),Ft(s),b=s.type,y=s.pendingProps,k=a!==null?a.memoizedProps:null,m=y.children,Wp(b,y)?m=null:k!==null&&Wp(b,k)&&(s.flags|=32),s.memoizedState!==null&&(b=Ym(a,s,uS,null,null,u),mc._currentValue=b),Kd(a,s),vr(a,s,m,u),s.child;case 6:return a===null&&$t&&((a=u=vn)&&(u=QS(u,s.pendingProps,La),u!==null?(s.stateNode=u,_r=s,vn=null,a=!0):a=!1),a||Li(s)),null;case 13:return vy(a,s,u);case 4:return et(s,s.stateNode.containerInfo),m=s.pendingProps,a===null?s.child=Bl(s,null,m,u):vr(a,s,m,u),s.child;case 11:return my(a,s,s.type,s.pendingProps,u);case 7:return vr(a,s,s.pendingProps,u),s.child;case 8:return vr(a,s,s.pendingProps.children,u),s.child;case 12:return vr(a,s,s.pendingProps.children,u),s.child;case 10:return m=s.pendingProps,Ii(s,s.type,m.value),vr(a,s,m.children,u),s.child;case 9:return b=s.type._context,m=s.pendingProps.children,Dl(s),b=Tr(b),m=m(b),s.flags|=1,vr(a,s,m,u),s.child;case 14:return py(a,s,s.type,s.pendingProps,u);case 15:return gy(a,s,s.type,s.pendingProps,u);case 19:return wy(a,s,u);case 31:return bS(a,s,u);case 22:return by(a,s,u,s.pendingProps);case 24:return Dl(s),m=Tr(Wn),a===null?(b=Pm(),b===null&&(b=yn,y=jm(),b.pooledCache=y,y.refCount++,y!==null&&(b.pooledCacheLanes|=u),b=y),s.memoizedState={parent:m,cache:b},Um(s),Ii(s,Wn,b)):((a.lanes&u)!==0&&(Hm(a,s),Wu(s,null,null,u),Yu()),b=a.memoizedState,y=s.memoizedState,b.parent!==m?(b={parent:m,cache:m},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),Ii(s,Wn,m)):(m=y.cache,Ii(s,Wn,m),m!==b.cache&&Dm(s,[Wn],u,!0))),vr(a,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Js(a){a.flags|=4}function _p(a,s,u,m,b){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(Jy())a.flags|=8192;else throw Pl=Md,Bm}else a.flags&=-16777217}function Sy(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!zE(s))if(Jy())a.flags|=8192;else throw Pl=Md,Bm}function Jd(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?pt():536870912,a.lanes|=s,Fo|=s)}function ec(a,s){if(!$t)switch(a.tailMode){case"hidden":s=a.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function kn(a){var s=a.alternate!==null&&a.alternate.child===a.child,u=0,m=0;if(s)for(var b=a.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=u,s}function yS(a,s,u){var m=s.pendingProps;switch(Am(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(s),null;case 1:return kn(s),null;case 3:return u=s.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),s.memoizedState.cache!==m&&(s.flags|=2048),Qs(Wn),Be(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(No(s)?Js(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Lm())),kn(s),null;case 26:var b=s.type,y=s.memoizedState;return a===null?(Js(s),y!==null?(kn(s),Sy(s,y)):(kn(s),_p(s,b,null,m,u))):y?y!==a.memoizedState?(Js(s),kn(s),Sy(s,y)):(kn(s),s.flags&=-16777217):(a=a.memoizedProps,a!==m&&Js(s),kn(s),_p(s,b,a,m,u)),null;case 27:if(at(s),u=Se.current,b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Js(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return kn(s),null}a=Te.current,No(s)?ix(s):(a=DE(b,m,u),s.stateNode=a,Js(s))}return kn(s),null;case 5:if(at(s),b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Js(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return kn(s),null}if(y=Te.current,No(s))ix(s);else{var k=pf(Se.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof m.is=="string"?k.createElement("select",{is:m.is}):k.createElement("select"),m.multiple?y.multiple=!0:m.size&&(y.size=m.size);break;default:y=typeof m.is=="string"?k.createElement(b,{is:m.is}):k.createElement(b)}}y[bn]=s,y[An]=m;e:for(k=s.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===s)break e;for(;k.sibling===null;){if(k.return===null||k.return===s)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}s.stateNode=y;e:switch(kr(y,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Js(s)}}return kn(s),_p(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,u),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==m&&Js(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(a=Se.current,No(s)){if(a=s.stateNode,u=s.memoizedProps,m=null,b=_r,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[bn]=s,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||vE(a.nodeValue,u)),a||Li(s,!0)}else a=pf(a).createTextNode(m),a[bn]=s,s.stateNode=a}return kn(s),null;case 31:if(u=s.memoizedState,a===null||a.memoizedState!==null){if(m=No(s),u!==null){if(a===null){if(!m)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[bn]=s}else Il(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kn(s),a=!1}else u=Lm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return s.flags&256?(oa(s),s):(oa(s),null);if((s.flags&128)!==0)throw Error(r(558))}return kn(s),null;case 13:if(m=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=No(s),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[bn]=s}else Il(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kn(s),b=!1}else b=Lm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(oa(s),s):(oa(s),null)}return oa(s),(s.flags&128)!==0?(s.lanes=u,s):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=s.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),y=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(y=m.memoizedState.cachePool.pool),y!==b&&(m.flags|=2048)),u!==a&&u&&(s.child.flags|=8192),Jd(s,s.updateQueue),kn(s),null);case 4:return Be(),a===null&&$p(s.stateNode.containerInfo),kn(s),null;case 10:return Qs(s.type),kn(s),null;case 19:if(ee(Hn),m=s.memoizedState,m===null)return kn(s),null;if(b=(s.flags&128)!==0,y=m.rendering,y===null)if(b)ec(m,!1);else{if(Pn!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(y=Hd(a),y!==null){for(s.flags|=128,ec(m,!1),a=y.updateQueue,s.updateQueue=a,Jd(s,a),s.subtreeFlags=0,a=u,u=s.child;u!==null;)tx(u,a),u=u.sibling;return D(Hn,Hn.current&1|2),$t&&Ys(s,m.treeForkCount),s.child}a=a.sibling}m.tail!==null&&Tt()>af&&(s.flags|=128,b=!0,ec(m,!1),s.lanes=4194304)}else{if(!b)if(a=Hd(y),a!==null){if(s.flags|=128,b=!0,a=a.updateQueue,s.updateQueue=a,Jd(s,a),ec(m,!0),m.tail===null&&m.tailMode==="hidden"&&!y.alternate&&!$t)return kn(s),null}else 2*Tt()-m.renderingStartTime>af&&u!==536870912&&(s.flags|=128,b=!0,ec(m,!1),s.lanes=4194304);m.isBackwards?(y.sibling=s.child,s.child=y):(a=m.last,a!==null?a.sibling=y:s.child=y,m.last=y)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Tt(),a.sibling=null,u=Hn.current,D(Hn,b?u&1|2:u&1),$t&&Ys(s,m.treeForkCount),a):(kn(s),null);case 22:case 23:return oa(s),Vm(),m=s.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(u&536870912)!==0&&(s.flags&128)===0&&(kn(s),s.subtreeFlags&6&&(s.flags|=8192)):kn(s),u=s.updateQueue,u!==null&&Jd(s,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==u&&(s.flags|=2048),a!==null&&ee(jl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Qs(Wn),kn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function ES(a,s){switch(Am(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Qs(Wn),Be(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return at(s),null;case 31:if(s.memoizedState!==null){if(oa(s),s.alternate===null)throw Error(r(340));Il()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(oa(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Il()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return ee(Hn),null;case 4:return Be(),null;case 10:return Qs(s.type),null;case 22:case 23:return oa(s),Vm(),a!==null&&ee(jl),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return Qs(Wn),null;case 25:return null;default:return null}}function Ny(a,s){switch(Am(s),s.tag){case 3:Qs(Wn),Be();break;case 26:case 27:case 5:at(s);break;case 4:Be();break;case 31:s.memoizedState!==null&&oa(s);break;case 13:oa(s);break;case 19:ee(Hn);break;case 10:Qs(s.type);break;case 22:case 23:oa(s),Vm(),a!==null&&ee(jl);break;case 24:Qs(Wn)}}function tc(a,s){try{var u=s.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var b=m.next;u=b;do{if((u.tag&a)===a){m=void 0;var y=u.create,k=u.inst;m=y(),k.destroy=m}u=u.next}while(u!==b)}}catch(L){ln(s,s.return,L)}}function Bi(a,s,u){try{var m=s.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var y=b.next;m=y;do{if((m.tag&a)===a){var k=m.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,b=s;var Y=u,oe=L;try{oe()}catch(be){ln(b,Y,be)}}}m=m.next}while(m!==y)}}catch(be){ln(s,s.return,be)}}function Ay(a){var s=a.updateQueue;if(s!==null){var u=a.stateNode;try{yx(s,u)}catch(m){ln(a,a.return,m)}}}function Ry(a,s,u){u.props=Hl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(m){ln(a,s,m)}}function nc(a,s){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof u=="function"?a.refCleanup=u(m):u.current=m}}catch(b){ln(a,s,b)}}function ps(a,s){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(b){ln(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){ln(a,s,b)}else u.current=null}function Ly(a){var s=a.type,u=a.memoizedProps,m=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(b){ln(a,a.return,b)}}function Tp(a,s,u){try{var m=a.stateNode;zS(m,a.type,u,s),m[An]=s}catch(b){ln(a,a.return,b)}}function Iy(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Gi(a.type)||a.tag===4}function vp(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Iy(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&&Gi(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 kp(a,s,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(a),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Br));else if(m!==4&&(m===27&&Gi(a.type)&&(u=a.stateNode,s=null),a=a.child,a!==null))for(kp(a,s,u),a=a.sibling;a!==null;)kp(a,s,u),a=a.sibling}function ef(a,s,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?u.insertBefore(a,s):u.appendChild(a);else if(m!==4&&(m===27&&Gi(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(ef(a,s,u),a=a.sibling;a!==null;)ef(a,s,u),a=a.sibling}function Oy(a){var s=a.stateNode,u=a.memoizedProps;try{for(var m=a.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);kr(s,m,u),s[bn]=a,s[An]=u}catch(y){ln(a,a.return,y)}}var ei=!1,Kn=!1,wp=!1,Dy=typeof WeakSet=="function"?WeakSet:Set,hr=null;function _S(a,s){if(a=a.containerInfo,qp=Tf,a=qb(a),xm(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var b=m.anchorOffset,y=m.focusNode;m=m.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var k=0,L=-1,Y=-1,oe=0,be=0,Ee=a,ue=null;t:for(;;){for(var he;Ee!==u||b!==0&&Ee.nodeType!==3||(L=k+b),Ee!==y||m!==0&&Ee.nodeType!==3||(Y=k+m),Ee.nodeType===3&&(k+=Ee.nodeValue.length),(he=Ee.firstChild)!==null;)ue=Ee,Ee=he;for(;;){if(Ee===a)break t;if(ue===u&&++oe===b&&(L=k),ue===y&&++be===m&&(Y=k),(he=Ee.nextSibling)!==null)break;Ee=ue,ue=Ee.parentNode}Ee=he}u=L===-1||Y===-1?null:{start:L,end:Y}}else u=null}u=u||{start:0,end:0}}else u=null;for(Yp={focusedElem:a,selectionRange:u},Tf=!1,hr=s;hr!==null;)if(s=hr,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,hr=a;else for(;hr!==null;){switch(s=hr,y=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)b=a[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,u=s,b=y.memoizedProps,y=y.memoizedState,m=u.stateNode;try{var Ge=Hl(u.type,b);a=m.getSnapshotBeforeUpdate(Ge,y),m.__reactInternalSnapshotBeforeUpdate=a}catch(dt){ln(u,u.return,dt)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,u=a.nodeType,u===9)Xp(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Xp(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,hr=a;break}hr=s.return}}function jy(a,s,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:ni(a,u),m&4&&tc(5,u);break;case 1:if(ni(a,u),m&4)if(a=u.stateNode,s===null)try{a.componentDidMount()}catch(k){ln(u,u.return,k)}else{var b=Hl(u.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(b,s,a.__reactInternalSnapshotBeforeUpdate)}catch(k){ln(u,u.return,k)}}m&64&&Ay(u),m&512&&nc(u,u.return);break;case 3:if(ni(a,u),m&64&&(a=u.updateQueue,a!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{yx(a,s)}catch(k){ln(u,u.return,k)}}break;case 27:s===null&&m&4&&Oy(u);case 26:case 5:ni(a,u),s===null&&m&4&&Ly(u),m&512&&nc(u,u.return);break;case 12:ni(a,u);break;case 31:ni(a,u),m&4&&By(a,u);break;case 13:ni(a,u),m&4&&Uy(a,u),m&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=RS.bind(null,u),XS(a,u))));break;case 22:if(m=u.memoizedState!==null||ei,!m){s=s!==null&&s.memoizedState!==null||Kn,b=ei;var y=Kn;ei=m,(Kn=s)&&!y?ri(a,u,(u.subtreeFlags&8772)!==0):ni(a,u),ei=b,Kn=y}break;case 30:break;default:ni(a,u)}}function My(a){var s=a.alternate;s!==null&&(a.alternate=null,My(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Or(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var wn=null,Qr=!1;function ti(a,s,u){for(u=u.child;u!==null;)Py(a,s,u),u=u.sibling}function Py(a,s,u){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(ye,u)}catch{}switch(u.tag){case 26:Kn||ps(u,s),ti(a,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kn||ps(u,s);var m=wn,b=Qr;Gi(u.type)&&(wn=u.stateNode,Qr=!1),ti(a,s,u),dc(u.stateNode),wn=m,Qr=b;break;case 5:Kn||ps(u,s);case 6:if(m=wn,b=Qr,wn=null,ti(a,s,u),wn=m,Qr=b,wn!==null)if(Qr)try{(wn.nodeType===9?wn.body:wn.nodeName==="HTML"?wn.ownerDocument.body:wn).removeChild(u.stateNode)}catch(y){ln(u,s,y)}else try{wn.removeChild(u.stateNode)}catch(y){ln(u,s,y)}break;case 18:wn!==null&&(Qr?(a=wn,AE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Qo(a)):AE(wn,u.stateNode));break;case 4:m=wn,b=Qr,wn=u.stateNode.containerInfo,Qr=!0,ti(a,s,u),wn=m,Qr=b;break;case 0:case 11:case 14:case 15:Bi(2,u,s),Kn||Bi(4,u,s),ti(a,s,u);break;case 1:Kn||(ps(u,s),m=u.stateNode,typeof m.componentWillUnmount=="function"&&Ry(u,s,m)),ti(a,s,u);break;case 21:ti(a,s,u);break;case 22:Kn=(m=Kn)||u.memoizedState!==null,ti(a,s,u),Kn=m;break;default:ti(a,s,u)}}function By(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Qo(a)}catch(u){ln(s,s.return,u)}}}function Uy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Qo(a)}catch(u){ln(s,s.return,u)}}function TS(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new Dy),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new Dy),s;default:throw Error(r(435,a.tag))}}function tf(a,s){var u=TS(a);s.forEach(function(m){if(!u.has(m)){u.add(m);var b=LS.bind(null,a,m);m.then(b,b)}})}function Xr(a,s){var u=s.deletions;if(u!==null)for(var m=0;m<u.length;m++){var b=u[m],y=a,k=s,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(Gi(L.type)){wn=L.stateNode,Qr=!1;break e}break;case 5:wn=L.stateNode,Qr=!1;break e;case 3:case 4:wn=L.stateNode.containerInfo,Qr=!0;break e}L=L.return}if(wn===null)throw Error(r(160));Py(y,k,b),wn=null,Qr=!1,y=b.alternate,y!==null&&(y.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Hy(s,a),s=s.sibling}var Ja=null;function Hy(a,s){var u=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Xr(s,a),Kr(a),m&4&&(Bi(3,a,a.return),tc(3,a),Bi(5,a,a.return));break;case 1:Xr(s,a),Kr(a),m&512&&(Kn||u===null||ps(u,u.return)),m&64&&ei&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var b=Ja;if(Xr(s,a),Kr(a),m&512&&(Kn||u===null||ps(u,u.return)),m&4){var y=u!==null?u.memoizedState:null;if(m=a.memoizedState,u===null)if(m===null)if(a.stateNode===null){e:{m=a.type,u=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":y=b.getElementsByTagName("title")[0],(!y||y[Ga]||y[bn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=b.createElement(m),b.head.insertBefore(y,b.querySelector("head > title"))),kr(y,m,u),y[bn]=a,_n(y),m=y;break e;case"link":var k=HE("link","href",b).get(m+(u.href||""));if(k){for(var L=0;L<k.length;L++)if(y=k[L],y.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){k.splice(L,1);break t}}y=b.createElement(m),kr(y,m,u),b.head.appendChild(y);break;case"meta":if(k=HE("meta","content",b).get(m+(u.content||""))){for(L=0;L<k.length;L++)if(y=k[L],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){k.splice(L,1);break t}}y=b.createElement(m),kr(y,m,u),b.head.appendChild(y);break;default:throw Error(r(468,m))}y[bn]=a,_n(y),m=y}a.stateNode=m}else FE(b,a.type,a.stateNode);else a.stateNode=UE(b,m,a.memoizedProps);else y!==m?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,m===null?FE(b,a.type,a.stateNode):UE(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Tp(a,a.memoizedProps,u.memoizedProps)}break;case 27:Xr(s,a),Kr(a),m&512&&(Kn||u===null||ps(u,u.return)),u!==null&&m&4&&Tp(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Xr(s,a),Kr(a),m&512&&(Kn||u===null||ps(u,u.return)),a.flags&32){b=a.stateNode;try{Mr(b,"")}catch(Ge){ln(a,a.return,Ge)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,Tp(a,b,u!==null?u.memoizedProps:b)),m&1024&&(wp=!0);break;case 6:if(Xr(s,a),Kr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,u=a.stateNode;try{u.nodeValue=m}catch(Ge){ln(a,a.return,Ge)}}break;case 3:if(xf=null,b=Ja,Ja=gf(s.containerInfo),Xr(s,a),Ja=b,Kr(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Qo(s.containerInfo)}catch(Ge){ln(a,a.return,Ge)}wp&&(wp=!1,Fy(a));break;case 4:m=Ja,Ja=gf(a.stateNode.containerInfo),Xr(s,a),Kr(a),Ja=m;break;case 12:Xr(s,a),Kr(a);break;case 31:Xr(s,a),Kr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,tf(a,m)));break;case 13:Xr(s,a),Kr(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(rf=Tt()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,tf(a,m)));break;case 22:b=a.memoizedState!==null;var Y=u!==null&&u.memoizedState!==null,oe=ei,be=Kn;if(ei=oe||b,Kn=be||Y,Xr(s,a),Kn=be,ei=oe,Kr(a),m&8192)e:for(s=a.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||Y||ei||Kn||Fl(a)),u=null,s=a;;){if(s.tag===5||s.tag===26){if(u===null){Y=u=s;try{if(y=Y.stateNode,b)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=Y.stateNode;var Ee=Y.memoizedProps.style,ue=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;L.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ge){ln(Y,Y.return,Ge)}}}else if(s.tag===6){if(u===null){Y=s;try{Y.stateNode.nodeValue=b?"":Y.memoizedProps}catch(Ge){ln(Y,Y.return,Ge)}}}else if(s.tag===18){if(u===null){Y=s;try{var he=Y.stateNode;b?RE(he,!0):RE(Y.stateNode,!1)}catch(Ge){ln(Y,Y.return,Ge)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}m&4&&(m=a.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,tf(a,u))));break;case 19:Xr(s,a),Kr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,tf(a,m)));break;case 30:break;case 21:break;default:Xr(s,a),Kr(a)}}function Kr(a){var s=a.flags;if(s&2){try{for(var u,m=a.return;m!==null;){if(Iy(m)){u=m;break}m=m.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,y=vp(a);ef(a,y,b);break;case 5:var k=u.stateNode;u.flags&32&&(Mr(k,""),u.flags&=-33);var L=vp(a);ef(a,L,k);break;case 3:case 4:var Y=u.stateNode.containerInfo,oe=vp(a);kp(a,oe,Y);break;default:throw Error(r(161))}}catch(be){ln(a,a.return,be)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function Fy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;Fy(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function ni(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)jy(a,s.alternate,s),s=s.sibling}function Fl(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Bi(4,s,s.return),Fl(s);break;case 1:ps(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Ry(s,s.return,u),Fl(s);break;case 27:dc(s.stateNode);case 26:case 5:ps(s,s.return),Fl(s);break;case 22:s.memoizedState===null&&Fl(s);break;case 30:Fl(s);break;default:Fl(s)}a=a.sibling}}function ri(a,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var m=s.alternate,b=a,y=s,k=y.flags;switch(y.tag){case 0:case 11:case 15:ri(b,y,u),tc(4,y);break;case 1:if(ri(b,y,u),m=y,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(oe){ln(m,m.return,oe)}if(m=y,b=m.updateQueue,b!==null){var L=m.stateNode;try{var Y=b.shared.hiddenCallbacks;if(Y!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Y.length;b++)xx(Y[b],L)}catch(oe){ln(m,m.return,oe)}}u&&k&64&&Ay(y),nc(y,y.return);break;case 27:Oy(y);case 26:case 5:ri(b,y,u),u&&m===null&&k&4&&Ly(y),nc(y,y.return);break;case 12:ri(b,y,u);break;case 31:ri(b,y,u),u&&k&4&&By(b,y);break;case 13:ri(b,y,u),u&&k&4&&Uy(b,y);break;case 22:y.memoizedState===null&&ri(b,y,u),nc(y,y.return);break;case 30:break;default:ri(b,y,u)}s=s.sibling}}function Cp(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&&zu(u))}function Sp(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&zu(a))}function es(a,s,u,m){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)zy(a,s,u,m),s=s.sibling}function zy(a,s,u,m){var b=s.flags;switch(s.tag){case 0:case 11:case 15:es(a,s,u,m),b&2048&&tc(9,s);break;case 1:es(a,s,u,m);break;case 3:es(a,s,u,m),b&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&zu(a)));break;case 12:if(b&2048){es(a,s,u,m),a=s.stateNode;try{var y=s.memoizedProps,k=y.id,L=y.onPostCommit;typeof L=="function"&&L(k,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Y){ln(s,s.return,Y)}}else es(a,s,u,m);break;case 31:es(a,s,u,m);break;case 13:es(a,s,u,m);break;case 23:break;case 22:y=s.stateNode,k=s.alternate,s.memoizedState!==null?y._visibility&2?es(a,s,u,m):rc(a,s):y._visibility&2?es(a,s,u,m):(y._visibility|=2,Bo(a,s,u,m,(s.subtreeFlags&10256)!==0||!1)),b&2048&&Cp(k,s);break;case 24:es(a,s,u,m),b&2048&&Sp(s.alternate,s);break;default:es(a,s,u,m)}}function Bo(a,s,u,m,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=a,k=s,L=u,Y=m,oe=k.flags;switch(k.tag){case 0:case 11:case 15:Bo(y,k,L,Y,b),tc(8,k);break;case 23:break;case 22:var be=k.stateNode;k.memoizedState!==null?be._visibility&2?Bo(y,k,L,Y,b):rc(y,k):(be._visibility|=2,Bo(y,k,L,Y,b)),b&&oe&2048&&Cp(k.alternate,k);break;case 24:Bo(y,k,L,Y,b),b&&oe&2048&&Sp(k.alternate,k);break;default:Bo(y,k,L,Y,b)}s=s.sibling}}function rc(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=a,m=s,b=m.flags;switch(m.tag){case 22:rc(u,m),b&2048&&Cp(m.alternate,m);break;case 24:rc(u,m),b&2048&&Sp(m.alternate,m);break;default:rc(u,m)}s=s.sibling}}var ac=8192;function Uo(a,s,u){if(a.subtreeFlags&ac)for(a=a.child;a!==null;)$y(a,s,u),a=a.sibling}function $y(a,s,u){switch(a.tag){case 26:Uo(a,s,u),a.flags&ac&&a.memoizedState!==null&&oN(u,Ja,a.memoizedState,a.memoizedProps);break;case 5:Uo(a,s,u);break;case 3:case 4:var m=Ja;Ja=gf(a.stateNode.containerInfo),Uo(a,s,u),Ja=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=ac,ac=16777216,Uo(a,s,u),ac=m):Uo(a,s,u));break;default:Uo(a,s,u)}}function Vy(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 sc(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var m=s[u];hr=m,qy(m,a)}Vy(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Gy(a),a=a.sibling}function Gy(a){switch(a.tag){case 0:case 11:case 15:sc(a),a.flags&2048&&Bi(9,a,a.return);break;case 3:sc(a);break;case 12:sc(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,nf(a)):sc(a);break;default:sc(a)}}function nf(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var m=s[u];hr=m,qy(m,a)}Vy(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Bi(8,s,s.return),nf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,nf(s));break;default:nf(s)}a=a.sibling}}function qy(a,s){for(;hr!==null;){var u=hr;switch(u.tag){case 0:case 11:case 15:Bi(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:zu(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,hr=m;else e:for(u=a;hr!==null;){m=hr;var b=m.sibling,y=m.return;if(My(m),m===u){hr=null;break e}if(b!==null){b.return=y,hr=b;break e}hr=y}}}var vS={getCacheForType:function(a){var s=Tr(Wn),u=s.data.get(a);return u===void 0&&(u=a(),s.data.set(a,u)),u},cacheSignal:function(){return Tr(Wn).controller.signal}},kS=typeof WeakMap=="function"?WeakMap:Map,tn=0,yn=null,jt=null,Ut=0,sn=0,ua=null,Ui=!1,Ho=!1,Np=!1,ai=0,Pn=0,Hi=0,zl=0,Ap=0,ca=0,Fo=0,ic=null,Zr=null,Rp=!1,rf=0,Yy=0,af=1/0,sf=null,Fi=null,ir=0,zi=null,zo=null,si=0,Lp=0,Ip=null,Wy=null,lc=0,Op=null;function da(){return(tn&2)!==0&&Ut!==0?Ut&-Ut:H.T!==null?Up():gl()}function Qy(){if(ca===0)if((Ut&536870912)===0||$t){var a=Le;Le<<=1,(Le&3932160)===0&&(Le=262144),ca=a}else ca=536870912;return a=la.current,a!==null&&(a.flags|=32),ca}function Jr(a,s,u){(a===yn&&(sn===2||sn===9)||a.cancelPendingCommit!==null)&&($o(a,0),$i(a,Ut,ca,!1)),Nn(a,u),((tn&2)===0||a!==yn)&&(a===yn&&((tn&2)===0&&(zl|=u),Pn===4&&$i(a,Ut,ca,!1)),gs(a))}function Xy(a,s,u){if((tn&6)!==0)throw Error(r(327));var m=!u&&(s&127)===0&&(s&a.expiredLanes)===0||Lt(a,s),b=m?SS(a,s):jp(a,s,!0),y=m;do{if(b===0){Ho&&!m&&$i(a,s,0,!1);break}else{if(u=a.current.alternate,y&&!wS(u)){b=jp(a,s,!1),y=!1;continue}if(b===2){if(y=s,a.errorRecoveryDisabledLanes&y)var k=0;else k=a.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){s=k;e:{var L=a;b=ic;var Y=L.current.memoizedState.isDehydrated;if(Y&&($o(L,k).flags|=256),k=jp(L,k,!1),k!==2){if(Np&&!Y){L.errorRecoveryDisabledLanes|=y,zl|=y,b=4;break e}y=Zr,Zr=b,y!==null&&(Zr===null?Zr=y:Zr.push.apply(Zr,y))}b=k}if(y=!1,b!==2)continue}}if(b===1){$o(a,0),$i(a,s,0,!0);break}e:{switch(m=a,y=b,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:$i(m,s,ca,!Ui);break e;case 2:Zr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=rf+300-Tt(),10<b)){if($i(m,s,ca,!Ui),ut(m,0,!0)!==0)break e;si=s,m.timeoutHandle=SE(Ky.bind(null,m,u,Zr,sf,Rp,s,ca,zl,Fo,Ui,y,"Throttled",-0,0),b);break e}Ky(m,u,Zr,sf,Rp,s,ca,zl,Fo,Ui,y,null,-0,0)}}break}while(!0);gs(a)}function Ky(a,s,u,m,b,y,k,L,Y,oe,be,Ee,ue,he){if(a.timeoutHandle=-1,Ee=s.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Br},$y(s,y,Ee);var Ge=(y&62914560)===y?rf-Tt():(y&4194048)===y?Yy-Tt():0;if(Ge=uN(Ee,Ge),Ge!==null){si=y,a.cancelPendingCommit=Ge(sE.bind(null,a,s,y,u,m,b,k,L,Y,be,Ee,null,ue,he)),$i(a,y,k,!oe);return}}sE(a,s,y,u,m,b,k,L,Y)}function wS(a){for(var s=a;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var b=u[m],y=b.getSnapshot;b=b.value;try{if(!sa(y(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function $i(a,s,u,m){s&=~Ap,s&=~zl,a.suspendedLanes|=s,a.pingedLanes&=~s,m&&(a.warmLanes|=s),m=a.expirationTimes;for(var b=s;0<b;){var y=31-Me(b),k=1<<y;m[y]=-1,b&=~k}u!==0&&nn(a,u,s)}function lf(){return(tn&6)===0?(oc(0),!1):!0}function Dp(){if(jt!==null){if(sn===0)var a=jt.return;else a=jt,Ws=Ol=null,Xm(a),Oo=null,Vu=0,a=jt;for(;a!==null;)Ny(a.alternate,a),a=a.return;jt=null}}function $o(a,s){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,GS(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),si=0,Dp(),yn=a,jt=u=qs(a.current,null),Ut=s,sn=0,ua=null,Ui=!1,Ho=Lt(a,s),Np=!1,Fo=ca=Ap=zl=Hi=Pn=0,Zr=ic=null,Rp=!1,(s&8)!==0&&(s|=s&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=s;0<m;){var b=31-Me(m),y=1<<b;s|=a[b],m&=~y}return ai=s,Sd(),u}function Zy(a,s){vt=null,H.H=Zu,s===Io||s===jd?(s=mx(),sn=3):s===Bm?(s=mx(),sn=4):sn=s===fp?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ua=s,jt===null&&(Pn=1,Qd(a,Na(s,a.current)))}function Jy(){var a=la.current;return a===null?!0:(Ut&4194048)===Ut?Ia===null:(Ut&62914560)===Ut||(Ut&536870912)!==0?a===Ia:!1}function eE(){var a=H.H;return H.H=Zu,a===null?Zu:a}function tE(){var a=H.A;return H.A=vS,a}function of(){Pn=4,Ui||(Ut&4194048)!==Ut&&la.current!==null||(Ho=!0),(Hi&134217727)===0&&(zl&134217727)===0||yn===null||$i(yn,Ut,ca,!1)}function jp(a,s,u){var m=tn;tn|=2;var b=eE(),y=tE();(yn!==a||Ut!==s)&&(sf=null,$o(a,s)),s=!1;var k=Pn;e:do try{if(sn!==0&&jt!==null){var L=jt,Y=ua;switch(sn){case 8:Dp(),k=6;break e;case 3:case 2:case 9:case 6:la.current===null&&(s=!0);var oe=sn;if(sn=0,ua=null,Vo(a,L,Y,oe),u&&Ho){k=0;break e}break;default:oe=sn,sn=0,ua=null,Vo(a,L,Y,oe)}}CS(),k=Pn;break}catch(be){Zy(a,be)}while(!0);return s&&a.shellSuspendCounter++,Ws=Ol=null,tn=m,H.H=b,H.A=y,jt===null&&(yn=null,Ut=0,Sd()),k}function CS(){for(;jt!==null;)nE(jt)}function SS(a,s){var u=tn;tn|=2;var m=eE(),b=tE();yn!==a||Ut!==s?(sf=null,af=Tt()+500,$o(a,s)):Ho=Lt(a,s);e:do try{if(sn!==0&&jt!==null){s=jt;var y=ua;t:switch(sn){case 1:sn=0,ua=null,Vo(a,s,y,1);break;case 2:case 9:if(fx(y)){sn=0,ua=null,rE(s);break}s=function(){sn!==2&&sn!==9||yn!==a||(sn=7),gs(a)},y.then(s,s);break e;case 3:sn=7;break e;case 4:sn=5;break e;case 7:fx(y)?(sn=0,ua=null,rE(s)):(sn=0,ua=null,Vo(a,s,y,7));break;case 5:var k=null;switch(jt.tag){case 26:k=jt.memoizedState;case 5:case 27:var L=jt;if(k?zE(k):L.stateNode.complete){sn=0,ua=null;var Y=L.sibling;if(Y!==null)jt=Y;else{var oe=L.return;oe!==null?(jt=oe,uf(oe)):jt=null}break t}}sn=0,ua=null,Vo(a,s,y,5);break;case 6:sn=0,ua=null,Vo(a,s,y,6);break;case 8:Dp(),Pn=6;break e;default:throw Error(r(462))}}NS();break}catch(be){Zy(a,be)}while(!0);return Ws=Ol=null,H.H=m,H.A=b,tn=u,jt!==null?0:(yn=null,Ut=0,Sd(),Pn)}function NS(){for(;jt!==null&&!cn();)nE(jt)}function nE(a){var s=Cy(a.alternate,a,ai);a.memoizedProps=a.pendingProps,s===null?uf(a):jt=s}function rE(a){var s=a,u=s.alternate;switch(s.tag){case 15:case 0:s=Ey(u,s,s.pendingProps,s.type,void 0,Ut);break;case 11:s=Ey(u,s,s.pendingProps,s.type.render,s.ref,Ut);break;case 5:Xm(s);default:Ny(u,s),s=jt=tx(s,ai),s=Cy(u,s,ai)}a.memoizedProps=a.pendingProps,s===null?uf(a):jt=s}function Vo(a,s,u,m){Ws=Ol=null,Xm(s),Oo=null,Vu=0;var b=s.return;try{if(gS(a,b,s,u,Ut)){Pn=1,Qd(a,Na(u,a.current)),jt=null;return}}catch(y){if(b!==null)throw jt=b,y;Pn=1,Qd(a,Na(u,a.current)),jt=null;return}s.flags&32768?($t||m===1?a=!0:Ho||(Ut&536870912)!==0?a=!1:(Ui=a=!0,(m===2||m===9||m===3||m===6)&&(m=la.current,m!==null&&m.tag===13&&(m.flags|=16384))),aE(s,a)):uf(s)}function uf(a){var s=a;do{if((s.flags&32768)!==0){aE(s,Ui);return}a=s.return;var u=yS(s.alternate,s,ai);if(u!==null){jt=u;return}if(s=s.sibling,s!==null){jt=s;return}jt=s=a}while(s!==null);Pn===0&&(Pn=5)}function aE(a,s){do{var u=ES(a.alternate,a);if(u!==null){u.flags&=32767,jt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(a=a.sibling,a!==null)){jt=a;return}jt=a=u}while(a!==null);Pn=6,jt=null}function sE(a,s,u,m,b,y,k,L,Y){a.cancelPendingCommit=null;do cf();while(ir!==0);if((tn&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=vm,Un(a,u,y,k,L,Y),a===yn&&(jt=yn=null,Ut=0),zo=s,zi=a,si=u,Lp=y,Ip=b,Wy=m,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,IS(Re,function(){return cE(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||m){m=H.T,H.T=null,b=ce.p,ce.p=2,k=tn,tn|=4;try{_S(a,s,u)}finally{tn=k,ce.p=b,H.T=m}}ir=1,iE(),lE(),oE()}}function iE(){if(ir===1){ir=0;var a=zi,s=zo,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var m=ce.p;ce.p=2;var b=tn;tn|=4;try{Hy(s,a);var y=Yp,k=qb(a.containerInfo),L=y.focusedElem,Y=y.selectionRange;if(k!==L&&L&&L.ownerDocument&&Gb(L.ownerDocument.documentElement,L)){if(Y!==null&&xm(L)){var oe=Y.start,be=Y.end;if(be===void 0&&(be=oe),"selectionStart"in L)L.selectionStart=oe,L.selectionEnd=Math.min(be,L.value.length);else{var Ee=L.ownerDocument||document,ue=Ee&&Ee.defaultView||window;if(ue.getSelection){var he=ue.getSelection(),Ge=L.textContent.length,dt=Math.min(Y.start,Ge),pn=Y.end===void 0?dt:Math.min(Y.end,Ge);!he.extend&&dt>pn&&(k=pn,pn=dt,dt=k);var te=Vb(L,dt),Z=Vb(L,pn);if(te&&Z&&(he.rangeCount!==1||he.anchorNode!==te.node||he.anchorOffset!==te.offset||he.focusNode!==Z.node||he.focusOffset!==Z.offset)){var le=Ee.createRange();le.setStart(te.node,te.offset),he.removeAllRanges(),dt>pn?(he.addRange(le),he.extend(Z.node,Z.offset)):(le.setEnd(Z.node,Z.offset),he.addRange(le))}}}}for(Ee=[],he=L;he=he.parentNode;)he.nodeType===1&&Ee.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Ee.length;L++){var xe=Ee[L];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Tf=!!qp,Yp=qp=null}finally{tn=b,ce.p=m,H.T=u}}a.current=s,ir=2}}function lE(){if(ir===2){ir=0;var a=zi,s=zo,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var m=ce.p;ce.p=2;var b=tn;tn|=4;try{jy(a,s.alternate,s)}finally{tn=b,ce.p=m,H.T=u}}ir=3}}function oE(){if(ir===4||ir===3){ir=0,Vn();var a=zi,s=zo,u=si,m=Wy;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ir=5:(ir=0,zo=zi=null,uE(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Fi=null),In(u),s=s.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(ye,s,void 0,(s.current.flags&128)===128)}catch{}if(m!==null){s=H.T,b=ce.p,ce.p=2,H.T=null;try{for(var y=a.onRecoverableError,k=0;k<m.length;k++){var L=m[k];y(L.value,{componentStack:L.stack})}}finally{H.T=s,ce.p=b}}(si&3)!==0&&cf(),gs(a),b=a.pendingLanes,(u&261930)!==0&&(b&42)!==0?a===Op?lc++:(lc=0,Op=a):lc=0,oc(0)}}function uE(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,zu(s)))}function cf(){return iE(),lE(),oE(),cE()}function cE(){if(ir!==5)return!1;var a=zi,s=Lp;Lp=0;var u=In(si),m=H.T,b=ce.p;try{ce.p=32>u?32:u,H.T=null,u=Ip,Ip=null;var y=zi,k=si;if(ir=0,zo=zi=null,si=0,(tn&6)!==0)throw Error(r(331));var L=tn;if(tn|=4,Gy(y.current),zy(y,y.current,k,u),tn=L,oc(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(ye,y)}catch{}return!0}finally{ce.p=b,H.T=m,uE(a,s)}}function dE(a,s,u){s=Na(u,s),s=dp(a.stateNode,s,2),a=ji(a,s,2),a!==null&&(Nn(a,2),gs(a))}function ln(a,s,u){if(a.tag===3)dE(a,a,u);else for(;s!==null;){if(s.tag===3){dE(s,a,u);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Fi===null||!Fi.has(m))){a=Na(u,a),u=fy(2),m=ji(s,u,2),m!==null&&(hy(u,m,s,a),Nn(m,2),gs(m));break}}s=s.return}}function Mp(a,s,u){var m=a.pingCache;if(m===null){m=a.pingCache=new kS;var b=new Set;m.set(s,b)}else b=m.get(s),b===void 0&&(b=new Set,m.set(s,b));b.has(u)||(Np=!0,b.add(u),a=AS.bind(null,a,s,u),s.then(a,a))}function AS(a,s,u){var m=a.pingCache;m!==null&&m.delete(s),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,yn===a&&(Ut&u)===u&&(Pn===4||Pn===3&&(Ut&62914560)===Ut&&300>Tt()-rf?(tn&2)===0&&$o(a,0):Ap|=u,Fo===Ut&&(Fo=0)),gs(a)}function fE(a,s){s===0&&(s=pt()),a=Rl(a,s),a!==null&&(Nn(a,s),gs(a))}function RS(a){var s=a.memoizedState,u=0;s!==null&&(u=s.retryLane),fE(a,u)}function LS(a,s){var u=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(u=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),fE(a,u)}function IS(a,s){return Rt(a,s)}var df=null,Go=null,Pp=!1,ff=!1,Bp=!1,Vi=0;function gs(a){a!==Go&&a.next===null&&(Go===null?df=Go=a:Go=Go.next=a),ff=!0,Pp||(Pp=!0,DS())}function oc(a,s){if(!Bp&&ff){Bp=!0;do for(var u=!1,m=df;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var y=0;else{var k=m.suspendedLanes,L=m.pingedLanes;y=(1<<31-Me(42|a)+1)-1,y&=b&~(k&~L),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,gE(m,y))}else y=Ut,y=ut(m,m===yn?y:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(y&3)===0||Lt(m,y)||(u=!0,gE(m,y));m=m.next}while(u);Bp=!1}}function OS(){hE()}function hE(){ff=Pp=!1;var a=0;Vi!==0&&VS()&&(a=Vi);for(var s=Tt(),u=null,m=df;m!==null;){var b=m.next,y=mE(m,s);y===0?(m.next=null,u===null?df=b:u.next=b,b===null&&(Go=u)):(u=m,(a!==0||(y&3)!==0)&&(ff=!0)),m=b}ir!==0&&ir!==5||oc(a),Vi!==0&&(Vi=0)}function mE(a,s){for(var u=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var k=31-Me(y),L=1<<k,Y=b[k];Y===-1?((L&u)===0||(L&m)!==0)&&(b[k]=Gt(L,s)):Y<=s&&(a.expiredLanes|=L),y&=~L}if(s=yn,u=Ut,u=ut(a,a===s?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,u===0||a===s&&(sn===2||sn===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&un(m),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Lt(a,u)){if(s=u&-u,s===a.callbackPriority)return s;switch(m!==null&&un(m),In(u)){case 2:case 8:u=Ne;break;case 32:u=Re;break;case 268435456:u=xt;break;default:u=Re}return m=pE.bind(null,a),u=Rt(u,m),a.callbackPriority=s,a.callbackNode=u,s}return m!==null&&m!==null&&un(m),a.callbackPriority=2,a.callbackNode=null,2}function pE(a,s){if(ir!==0&&ir!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(cf()&&a.callbackNode!==u)return null;var m=Ut;return m=ut(a,a===yn?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(Xy(a,m,s),mE(a,Tt()),a.callbackNode!=null&&a.callbackNode===u?pE.bind(null,a):null)}function gE(a,s){if(cf())return null;Xy(a,s,!0)}function DS(){qS(function(){(tn&6)!==0?Rt(ge,OS):hE()})}function Up(){if(Vi===0){var a=Ro;a===0&&(a=X,X<<=1,(X&261888)===0&&(X=256)),Vi=a}return Vi}function bE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:fs(""+a)}function xE(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 jS(a,s,u,m,b){if(s==="submit"&&u&&u.stateNode===b){var y=bE((b[An]||null).action),k=m.submitter;k&&(s=(s=k[An]||null)?bE(s.formAction):k.getAttribute("formAction"),s!==null&&(y=s,k=null));var L=new Bs("action","action",null,m,b);a.push({event:L,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Vi!==0){var Y=k?xE(b,k):new FormData(b);sp(u,{pending:!0,data:Y,method:b.method,action:y},null,Y)}}else typeof y=="function"&&(L.preventDefault(),Y=k?xE(b,k):new FormData(b),sp(u,{pending:!0,data:Y,method:b.method,action:y},y,Y))},currentTarget:b}]})}}for(var Hp=0;Hp<Tm.length;Hp++){var Fp=Tm[Hp],MS=Fp.toLowerCase(),PS=Fp[0].toUpperCase()+Fp.slice(1);Za(MS,"on"+PS)}Za(Qb,"onAnimationEnd"),Za(Xb,"onAnimationIteration"),Za(Kb,"onAnimationStart"),Za("dblclick","onDoubleClick"),Za("focusin","onFocus"),Za("focusout","onBlur"),Za(J5,"onTransitionRun"),Za(eS,"onTransitionStart"),Za(tS,"onTransitionCancel"),Za(Zb,"onTransitionEnd"),xr("onMouseEnter",["mouseout","mouseover"]),xr("onMouseLeave",["mouseout","mouseover"]),xr("onPointerEnter",["pointerout","pointerover"]),xr("onPointerLeave",["pointerout","pointerover"]),aa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),aa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),aa("onBeforeInput",["compositionend","keypress","textInput","paste"]),aa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),aa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),aa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uc="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(" "),BS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uc));function yE(a,s){s=(s&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],b=m.event;m=m.listeners;e:{var y=void 0;if(s)for(var k=m.length-1;0<=k;k--){var L=m[k],Y=L.instance,oe=L.currentTarget;if(L=L.listener,Y!==y&&b.isPropagationStopped())break e;y=L,b.currentTarget=oe;try{y(b)}catch(be){Cd(be)}b.currentTarget=null,y=Y}else for(k=0;k<m.length;k++){if(L=m[k],Y=L.instance,oe=L.currentTarget,L=L.listener,Y!==y&&b.isPropagationStopped())break e;y=L,b.currentTarget=oe;try{y(b)}catch(be){Cd(be)}b.currentTarget=null,y=Y}}}}function Mt(a,s){var u=s[tr];u===void 0&&(u=s[tr]=new Set);var m=a+"__bubble";u.has(m)||(EE(s,a,2,!1),u.add(m))}function zp(a,s,u){var m=0;s&&(m|=4),EE(u,a,m,s)}var hf="_reactListening"+Math.random().toString(36).slice(2);function $p(a){if(!a[hf]){a[hf]=!0,zt.forEach(function(u){u!=="selectionchange"&&(BS.has(u)||zp(u,!1,a),zp(u,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[hf]||(s[hf]=!0,zp("selectionchange",!1,s))}}function EE(a,s,u,m){switch(QE(s)){case 2:var b=fN;break;case 8:b=hN;break;default:b=a0}u=b.bind(null,s,u,a),b=void 0,!js||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(s,u,{capture:!0,passive:b}):a.addEventListener(s,u,!0):b!==void 0?a.addEventListener(s,u,{passive:b}):a.addEventListener(s,u,!1)}function Vp(a,s,u,m,b){var y=m;if((s&1)===0&&(s&2)===0&&m!==null)e:for(;;){if(m===null)return;var k=m.tag;if(k===3||k===4){var L=m.stateNode.containerInfo;if(L===b)break;if(k===4)for(k=m.return;k!==null;){var Y=k.tag;if((Y===3||Y===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;L!==null;){if(k=On(L),k===null)return;if(Y=k.tag,Y===5||Y===6||Y===26||Y===27){m=y=k;continue e}L=L.parentNode}}m=m.return}Ds(function(){var oe=y,be=ki(u),Ee=[];e:{var ue=Jb.get(a);if(ue!==void 0){var he=Bs,Ge=a;switch(a){case"keypress":if(Ps(u)===0)break e;case"keydown":case"keyup":he=ar;break;case"focusin":Ge="focus",he=zs;break;case"focusout":Ge="blur",he=zs;break;case"beforeblur":case"afterblur":he=zs;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":he=Fs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=kl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=Fe;break;case Qb:case Xb:case Kb:he=Cl;break;case Zb:he=fn;break;case"scroll":case"scrollend":he=Xa;break;case"wheel":he=an;break;case"copy":case"cut":case"paste":he=K;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Nt;break;case"toggle":case"beforetoggle":he=sr}var dt=(s&4)!==0,pn=!dt&&(a==="scroll"||a==="scrollend"),te=dt?ue!==null?ue+"Capture":null:ue;dt=[];for(var Z=oe,le;Z!==null;){var xe=Z;if(le=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||le===null||te===null||(xe=Yr(Z,te),xe!=null&&dt.push(cc(Z,xe,le))),pn)break;Z=Z.return}0<dt.length&&(ue=new he(ue,Ge,null,u,be),Ee.push({event:ue,listeners:dt}))}}if((s&7)===0){e:{if(ue=a==="mouseover"||a==="pointerover",he=a==="mouseout"||a==="pointerout",ue&&u!==Tl&&(Ge=u.relatedTarget||u.fromElement)&&(On(Ge)||Ge[Va]))break e;if((he||ue)&&(ue=be.window===be?be:(ue=be.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(Ge=u.relatedTarget||u.toElement,he=oe,Ge=Ge?On(Ge):null,Ge!==null&&(pn=l(Ge),dt=Ge.tag,Ge!==pn||dt!==5&&dt!==27&&dt!==6)&&(Ge=null)):(he=null,Ge=oe),he!==Ge)){if(dt=Fs,xe="onMouseLeave",te="onMouseEnter",Z="mouse",(a==="pointerout"||a==="pointerover")&&(dt=Nt,xe="onPointerLeave",te="onPointerEnter",Z="pointer"),pn=he==null?ue:Ea(he),le=Ge==null?ue:Ea(Ge),ue=new dt(xe,Z+"leave",he,u,be),ue.target=pn,ue.relatedTarget=le,xe=null,On(be)===oe&&(dt=new dt(te,Z+"enter",Ge,u,be),dt.target=le,dt.relatedTarget=pn,xe=dt),pn=xe,he&&Ge)t:{for(dt=US,te=he,Z=Ge,le=0,xe=te;xe;xe=dt(xe))le++;xe=0;for(var rt=Z;rt;rt=dt(rt))xe++;for(;0<le-xe;)te=dt(te),le--;for(;0<xe-le;)Z=dt(Z),xe--;for(;le--;){if(te===Z||Z!==null&&te===Z.alternate){dt=te;break t}te=dt(te),Z=dt(Z)}dt=null}else dt=null;he!==null&&_E(Ee,ue,he,dt,!1),Ge!==null&&pn!==null&&_E(Ee,pn,Ge,dt,!0)}}e:{if(ue=oe?Ea(oe):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var Jt=mt;else if(I(ue))if(Dt)Jt=X5;else{Jt=wd;var Qe=Sl}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?oe&&Pr(oe.elementType)&&(Jt=mt):Jt=Q5;if(Jt&&(Jt=Jt(a,oe))){ie(Ee,Jt,u,be);break e}Qe&&Qe(a,ue,oe),a==="focusout"&&oe&&ue.type==="number"&&oe.memoizedProps.value!=null&&Ti(ue,"number",ue.value)}switch(Qe=oe?Ea(oe):window,a){case"focusin":(I(Qe)||Qe.contentEditable==="true")&&(To=Qe,ym=oe,Uu=null);break;case"focusout":Uu=ym=To=null;break;case"mousedown":Em=!0;break;case"contextmenu":case"mouseup":case"dragend":Em=!1,Yb(Ee,u,be);break;case"selectionchange":if(Z5)break;case"keydown":case"keyup":Yb(Ee,u,be)}var Ct;if(Vs)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 Gs?Mu(a,u)&&(Ht="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Ht="onCompositionStart");Ht&&(Ou&&u.locale!=="ko"&&(Gs||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&Gs&&(Ct=xo()):(ka=be,vl="value"in ka?ka.value:ka.textContent,Gs=!0)),Qe=mf(oe,Ht),0<Qe.length&&(Ht=new Ie(Ht,a,null,u,be),Ee.push({event:Ht,listeners:Qe}),Ct?Ht.data=Ct:(Ct=Pu(u),Ct!==null&&(Ht.data=Ct)))),(Ct=_d?Td(a,u):vd(a,u))&&(Ht=mf(oe,"onBeforeInput"),0<Ht.length&&(Qe=new Ie("onBeforeInput","beforeinput",null,u,be),Ee.push({event:Qe,listeners:Ht}),Qe.data=Ct)),jS(Ee,a,oe,u,be)}yE(Ee,s)})}function cc(a,s,u){return{instance:a,listener:s,currentTarget:u}}function mf(a,s){for(var u=s+"Capture",m=[];a!==null;){var b=a,y=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||y===null||(b=Yr(a,u),b!=null&&m.unshift(cc(a,b,y)),b=Yr(a,s),b!=null&&m.push(cc(a,b,y))),a.tag===3)return m;a=a.return}return[]}function US(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function _E(a,s,u,m,b){for(var y=s._reactName,k=[];u!==null&&u!==m;){var L=u,Y=L.alternate,oe=L.stateNode;if(L=L.tag,Y!==null&&Y===m)break;L!==5&&L!==26&&L!==27||oe===null||(Y=oe,b?(oe=Yr(u,y),oe!=null&&k.unshift(cc(u,oe,Y))):b||(oe=Yr(u,y),oe!=null&&k.push(cc(u,oe,Y)))),u=u.return}k.length!==0&&a.push({event:s,listeners:k})}var HS=/\r\n?/g,FS=/\u0000|\uFFFD/g;function TE(a){return(typeof a=="string"?a:""+a).replace(HS,`
50
+ `).replace(FS,"")}function vE(a,s){return s=TE(s),TE(a)===s}function mn(a,s,u,m,b,y){switch(u){case"children":typeof m=="string"?s==="body"||s==="textarea"&&m===""||Mr(a,m):(typeof m=="number"||typeof m=="bigint")&&s!=="body"&&Mr(a,""+m);break;case"className":qa(a,"class",m);break;case"tabIndex":qa(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":qa(a,u,m);break;case"style":vi(a,m,y);break;case"data":if(s!=="object"){qa(a,"data",m);break}case"src":case"href":if(m===""&&(s!=="a"||u!=="href")){a.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=fs(""+m),a.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(u==="formAction"?(s!=="input"&&mn(a,s,"name",b.name,b,null),mn(a,s,"formEncType",b.formEncType,b,null),mn(a,s,"formMethod",b.formMethod,b,null),mn(a,s,"formTarget",b.formTarget,b,null)):(mn(a,s,"encType",b.encType,b,null),mn(a,s,"method",b.method,b,null),mn(a,s,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=fs(""+m),a.setAttribute(u,m);break;case"onClick":m!=null&&(a.onclick=Br);break;case"onScroll":m!=null&&Mt("scroll",a);break;case"onScrollEnd":m!=null&&Mt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}u=fs(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""+m):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":m===!0?a.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,m):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(u,m):a.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(u):a.setAttribute(u,m);break;case"popover":Mt("beforetoggle",a),Mt("toggle",a),Rs(a,"popover",m);break;case"xlinkActuate":qn(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":qn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":qn(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":qn(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":qn(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":qn(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":qn(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":qn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":qn(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Rs(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Iu.get(u)||u,Rs(a,u,m))}}function Gp(a,s,u,m,b,y){switch(u){case"style":vi(a,m,y);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof m=="string"?Mr(a,m):(typeof m=="number"||typeof m=="bigint")&&Mr(a,""+m);break;case"onScroll":m!=null&&Mt("scroll",a);break;case"onScrollEnd":m!=null&&Mt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Br);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qr.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),y=a[An]||null,y=y!=null?y[u]:null,typeof y=="function"&&a.removeEventListener(s,y,b),typeof m=="function")){typeof y!="function"&&y!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(s,m,b);break e}u in a?a[u]=m:m===!0?a.setAttribute(u,""):Rs(a,u,m)}}}function kr(a,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mt("error",a),Mt("load",a);var m=!1,b=!1,y;for(y in u)if(u.hasOwnProperty(y)){var k=u[y];if(k!=null)switch(y){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:mn(a,s,y,k,u,null)}}b&&mn(a,s,"srcSet",u.srcSet,u,null),m&&mn(a,s,"src",u.src,u,null);return;case"input":Mt("invalid",a);var L=y=k=b=null,Y=null,oe=null;for(m in u)if(u.hasOwnProperty(m)){var be=u[m];if(be!=null)switch(m){case"name":b=be;break;case"type":k=be;break;case"checked":Y=be;break;case"defaultChecked":oe=be;break;case"value":y=be;break;case"defaultValue":L=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:mn(a,s,m,be,u,null)}}_i(a,y,L,Y,oe,k,b,!1);return;case"select":Mt("invalid",a),m=k=y=null;for(b in u)if(u.hasOwnProperty(b)&&(L=u[b],L!=null))switch(b){case"value":y=L;break;case"defaultValue":k=L;break;case"multiple":m=L;default:mn(a,s,b,L,u,null)}s=y,u=k,a.multiple=!!m,s!=null?jr(a,!!m,s,!1):u!=null&&jr(a,!!m,u,!0);return;case"textarea":Mt("invalid",a),y=b=m=null;for(k in u)if(u.hasOwnProperty(k)&&(L=u[k],L!=null))switch(k){case"value":m=L;break;case"defaultValue":b=L;break;case"children":y=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:mn(a,s,k,L,u,null)}El(a,m,b,y);return;case"option":for(Y in u)if(u.hasOwnProperty(Y)&&(m=u[Y],m!=null))switch(Y){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:mn(a,s,Y,m,u,null)}return;case"dialog":Mt("beforetoggle",a),Mt("toggle",a),Mt("cancel",a),Mt("close",a);break;case"iframe":case"object":Mt("load",a);break;case"video":case"audio":for(m=0;m<uc.length;m++)Mt(uc[m],a);break;case"image":Mt("error",a),Mt("load",a);break;case"details":Mt("toggle",a);break;case"embed":case"source":case"link":Mt("error",a),Mt("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(oe in u)if(u.hasOwnProperty(oe)&&(m=u[oe],m!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:mn(a,s,oe,m,u,null)}return;default:if(Pr(s)){for(be in u)u.hasOwnProperty(be)&&(m=u[be],m!==void 0&&Gp(a,s,be,m,u,void 0));return}}for(L in u)u.hasOwnProperty(L)&&(m=u[L],m!=null&&mn(a,s,L,m,u,null))}function zS(a,s,u,m){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,y=null,k=null,L=null,Y=null,oe=null,be=null;for(he in u){var Ee=u[he];if(u.hasOwnProperty(he)&&Ee!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Y=Ee;default:m.hasOwnProperty(he)||mn(a,s,he,null,m,Ee)}}for(var ue in m){var he=m[ue];if(Ee=u[ue],m.hasOwnProperty(ue)&&(he!=null||Ee!=null))switch(ue){case"type":y=he;break;case"name":b=he;break;case"checked":oe=he;break;case"defaultChecked":be=he;break;case"value":k=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,s));break;default:he!==Ee&&mn(a,s,ue,he,m,Ee)}}Ya(a,k,L,Y,oe,be,y,b);return;case"select":he=k=L=ue=null;for(y in u)if(Y=u[y],u.hasOwnProperty(y)&&Y!=null)switch(y){case"value":break;case"multiple":he=Y;default:m.hasOwnProperty(y)||mn(a,s,y,null,m,Y)}for(b in m)if(y=m[b],Y=u[b],m.hasOwnProperty(b)&&(y!=null||Y!=null))switch(b){case"value":ue=y;break;case"defaultValue":L=y;break;case"multiple":k=y;default:y!==Y&&mn(a,s,b,y,m,Y)}s=L,u=k,m=he,ue!=null?jr(a,!!u,ue,!1):!!m!=!!u&&(s!=null?jr(a,!!u,s,!0):jr(a,!!u,u?[]:"",!1));return;case"textarea":he=ue=null;for(L in u)if(b=u[L],u.hasOwnProperty(L)&&b!=null&&!m.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:mn(a,s,L,null,m,b)}for(k in m)if(b=m[k],y=u[k],m.hasOwnProperty(k)&&(b!=null||y!=null))switch(k){case"value":ue=b;break;case"defaultValue":he=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==y&&mn(a,s,k,b,m,y)}Is(a,ue,he);return;case"option":for(var Ge in u)if(ue=u[Ge],u.hasOwnProperty(Ge)&&ue!=null&&!m.hasOwnProperty(Ge))switch(Ge){case"selected":a.selected=!1;break;default:mn(a,s,Ge,null,m,ue)}for(Y in m)if(ue=m[Y],he=u[Y],m.hasOwnProperty(Y)&&ue!==he&&(ue!=null||he!=null))switch(Y){case"selected":a.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:mn(a,s,Y,ue,m,he)}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 dt in u)ue=u[dt],u.hasOwnProperty(dt)&&ue!=null&&!m.hasOwnProperty(dt)&&mn(a,s,dt,null,m,ue);for(oe in m)if(ue=m[oe],he=u[oe],m.hasOwnProperty(oe)&&ue!==he&&(ue!=null||he!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:mn(a,s,oe,ue,m,he)}return;default:if(Pr(s)){for(var pn in u)ue=u[pn],u.hasOwnProperty(pn)&&ue!==void 0&&!m.hasOwnProperty(pn)&&Gp(a,s,pn,void 0,m,ue);for(be in m)ue=m[be],he=u[be],!m.hasOwnProperty(be)||ue===he||ue===void 0&&he===void 0||Gp(a,s,be,ue,m,he);return}}for(var te in u)ue=u[te],u.hasOwnProperty(te)&&ue!=null&&!m.hasOwnProperty(te)&&mn(a,s,te,null,m,ue);for(Ee in m)ue=m[Ee],he=u[Ee],!m.hasOwnProperty(Ee)||ue===he||ue==null&&he==null||mn(a,s,Ee,ue,m,he)}function kE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $S(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var b=u[m],y=b.transferSize,k=b.initiatorType,L=b.duration;if(y&&L&&kE(k)){for(k=0,L=b.responseEnd,m+=1;m<u.length;m++){var Y=u[m],oe=Y.startTime;if(oe>L)break;var be=Y.transferSize,Ee=Y.initiatorType;be&&kE(Ee)&&(Y=Y.responseEnd,k+=be*(Y<L?1:(L-oe)/(Y-oe)))}if(--m,s+=8*(y+k)/(b.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var qp=null,Yp=null;function pf(a){return a.nodeType===9?a:a.ownerDocument}function wE(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 CE(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 Wp(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Qp=null;function VS(){var a=window.event;return a&&a.type==="popstate"?a===Qp?!1:(Qp=a,!0):(Qp=null,!1)}var SE=typeof setTimeout=="function"?setTimeout:void 0,GS=typeof clearTimeout=="function"?clearTimeout:void 0,NE=typeof Promise=="function"?Promise:void 0,qS=typeof queueMicrotask=="function"?queueMicrotask:typeof NE<"u"?function(a){return NE.resolve(null).then(a).catch(YS)}:SE;function YS(a){setTimeout(function(){throw a})}function Gi(a){return a==="head"}function AE(a,s){var u=s,m=0;do{var b=u.nextSibling;if(a.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(b),Qo(s);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")dc(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,dc(u);for(var y=u.firstChild;y;){var k=y.nextSibling,L=y.nodeName;y[Ga]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&y.rel.toLowerCase()==="stylesheet"||u.removeChild(y),y=k}}else u==="body"&&dc(a.ownerDocument.body);u=b}while(u);Qo(s)}function RE(a,s){var u=a;a=0;do{var m=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=m}while(u)}function Xp(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":Xp(u),Or(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function WS(a,s,u,m){for(;a.nodeType===1;){var b=u;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Ga])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var y=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=Oa(a.nextSibling),a===null)break}return null}function QS(a,s,u){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Oa(a.nextSibling),a===null))return null;return a}function LE(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=Oa(a.nextSibling),a===null))return null;return a}function Kp(a){return a.data==="$?"||a.data==="$~"}function Zp(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function XS(a,s){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||u.readyState!=="loading")s();else{var m=function(){s(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Oa(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 Jp=null;function IE(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(s===0)return Oa(a.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}a=a.nextSibling}return null}function OE(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 DE(a,s,u){switch(s=pf(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 dc(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Or(a)}var Da=new Map,jE=new Set;function gf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ii=ce.d;ce.d={f:KS,r:ZS,D:JS,C:eN,L:tN,m:nN,X:aN,S:rN,M:sN};function KS(){var a=ii.f(),s=lf();return a||s}function ZS(a){var s=Gn(a);s!==null&&s.tag===5&&s.type==="form"?Zx(s):ii.r(a)}var qo=typeof document>"u"?null:document;function ME(a,s,u){var m=qo;if(m&&typeof s=="string"&&s){var b=rr(s);b='link[rel="'+a+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),jE.has(b)||(jE.add(b),a={rel:a,crossOrigin:u,href:s},m.querySelector(b)===null&&(s=m.createElement("link"),kr(s,"link",a),_n(s),m.head.appendChild(s)))}}function JS(a){ii.D(a),ME("dns-prefetch",a,null)}function eN(a,s){ii.C(a,s),ME("preconnect",a,s)}function tN(a,s,u){ii.L(a,s,u);var m=qo;if(m&&a&&s){var b='link[rel="preload"][as="'+rr(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+rr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+rr(u.imageSizes)+'"]')):b+='[href="'+rr(a)+'"]';var y=b;switch(s){case"style":y=Yo(a);break;case"script":y=Wo(a)}Da.has(y)||(a=p({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:a,as:s},u),Da.set(y,a),m.querySelector(b)!==null||s==="style"&&m.querySelector(fc(y))||s==="script"&&m.querySelector(hc(y))||(s=m.createElement("link"),kr(s,"link",a),_n(s),m.head.appendChild(s)))}}function nN(a,s){ii.m(a,s);var u=qo;if(u&&a){var m=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+rr(m)+'"][href="'+rr(a)+'"]',y=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Wo(a)}if(!Da.has(y)&&(a=p({rel:"modulepreload",href:a},s),Da.set(y,a),u.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(hc(y)))return}m=u.createElement("link"),kr(m,"link",a),_n(m),u.head.appendChild(m)}}}function rN(a,s,u){ii.S(a,s,u);var m=qo;if(m&&a){var b=_a(m).hoistableStyles,y=Yo(a);s=s||"default";var k=b.get(y);if(!k){var L={loading:0,preload:null};if(k=m.querySelector(fc(y)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":s},u),(u=Da.get(y))&&e0(a,u);var Y=k=m.createElement("link");_n(Y),kr(Y,"link",a),Y._p=new Promise(function(oe,be){Y.onload=oe,Y.onerror=be}),Y.addEventListener("load",function(){L.loading|=1}),Y.addEventListener("error",function(){L.loading|=2}),L.loading|=4,bf(k,s,m)}k={type:"stylesheet",instance:k,count:1,state:L},b.set(y,k)}}}function aN(a,s){ii.X(a,s);var u=qo;if(u&&a){var m=_a(u).hoistableScripts,b=Wo(a),y=m.get(b);y||(y=u.querySelector(hc(b)),y||(a=p({src:a,async:!0},s),(s=Da.get(b))&&t0(a,s),y=u.createElement("script"),_n(y),kr(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(b,y))}}function sN(a,s){ii.M(a,s);var u=qo;if(u&&a){var m=_a(u).hoistableScripts,b=Wo(a),y=m.get(b);y||(y=u.querySelector(hc(b)),y||(a=p({src:a,async:!0,type:"module"},s),(s=Da.get(b))&&t0(a,s),y=u.createElement("script"),_n(y),kr(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(b,y))}}function PE(a,s,u,m){var b=(b=Se.current)?gf(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=Yo(u.href),u=_a(b).hoistableStyles,m=u.get(s),m||(m={type:"style",instance:null,count:0,state:null},u.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Yo(u.href);var y=_a(b).hoistableStyles,k=y.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,k),(y=b.querySelector(fc(a)))&&!y._p&&(k.instance=y,k.state.loading=5),Da.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},Da.set(a,u),y||iN(b,a,u,k.state))),s&&m===null)throw Error(r(528,""));return k}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wo(u),u=_a(b).hoistableScripts,m=u.get(s),m||(m={type:"script",instance:null,count:0,state:null},u.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Yo(a){return'href="'+rr(a)+'"'}function fc(a){return'link[rel="stylesheet"]['+a+"]"}function BE(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function iN(a,s,u,m){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=a.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),kr(s,"link",u),_n(s),a.head.appendChild(s))}function Wo(a){return'[src="'+rr(a)+'"]'}function hc(a){return"script[async]"+a}function UE(a,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var m=a.querySelector('style[data-href~="'+rr(u.href)+'"]');if(m)return s.instance=m,_n(m),m;var b=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),_n(m),kr(m,"style",b),bf(m,u.precedence,a),s.instance=m;case"stylesheet":b=Yo(u.href);var y=a.querySelector(fc(b));if(y)return s.state.loading|=4,s.instance=y,_n(y),y;m=BE(u),(b=Da.get(b))&&e0(m,b),y=(a.ownerDocument||a).createElement("link"),_n(y);var k=y;return k._p=new Promise(function(L,Y){k.onload=L,k.onerror=Y}),kr(y,"link",m),s.state.loading|=4,bf(y,u.precedence,a),s.instance=y;case"script":return y=Wo(u.src),(b=a.querySelector(hc(y)))?(s.instance=b,_n(b),b):(m=u,(b=Da.get(y))&&(m=p({},u),t0(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),_n(b),kr(b,"link",m),a.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,bf(m,u.precedence,a));return s.instance}function bf(a,s,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,y=b,k=0;k<m.length;k++){var L=m[k];if(L.dataset.precedence===s)y=L;else if(y!==b)break}y?y.parentNode.insertBefore(a,y.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(a,s.firstChild))}function e0(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function t0(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var xf=null;function HE(a,s,u){if(xf===null){var m=new Map,b=xf=new Map;b.set(u,m)}else b=xf,m=b.get(u),m||(m=new Map,b.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),b=0;b<u.length;b++){var y=u[b];if(!(y[Ga]||y[bn]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(s)||"";k=a+k;var L=m.get(k);L?L.push(y):m.set(k,[y])}}return m}function FE(a,s,u){a=a.ownerDocument||a,a.head.insertBefore(u,s==="title"?a.querySelector("head > title"):null)}function lN(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 zE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function oN(a,s,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Yo(m.href),y=s.querySelector(fc(b));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=yf.bind(a),s.then(a,a)),u.state.loading|=4,u.instance=y,_n(y);return}y=s.ownerDocument||s,m=BE(m),(b=Da.get(b))&&e0(m,b),y=y.createElement("link"),_n(y);var k=y;k._p=new Promise(function(L,Y){k.onload=L,k.onerror=Y}),kr(y,"link",m),u.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=yf.bind(a),s.addEventListener("load",u),s.addEventListener("error",u))}}var n0=0;function uN(a,s){return a.stylesheets&&a.count===0&&_f(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&_f(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+s);0<a.imgBytes&&n0===0&&(n0=62500*$S());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&_f(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>n0?50:800)+s);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_f(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ef=null;function _f(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ef=new Map,s.forEach(cN,a),Ef=null,yf.call(a))}function cN(a,s){if(!(s.state.loading&4)){var u=Ef.get(a);if(u)var m=u.get(null);else{u=new Map,Ef.set(a,u);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<b.length;y++){var k=b[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(u.set(k.dataset.precedence,k),m=k)}m&&u.set(null,m)}b=s.instance,k=b.getAttribute("data-precedence"),y=u.get(k)||m,y===m&&u.set(null,b),u.set(k,b),this.count++,m=yf.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),y?y.parentNode.insertBefore(b,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),s.state.loading|=4}}var mc={$$typeof:R,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function dN(a,s,u,m,b,y,k,L,Y){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=it(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=it(0),this.hiddenUpdates=it(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function $E(a,s,u,m,b,y,k,L,Y,oe,be,Ee){return a=new dN(a,s,u,k,Y,oe,be,Ee,L),s=1,y===!0&&(s|=24),y=ia(3,null,null,s),a.current=y,y.stateNode=a,s=jm(),s.refCount++,a.pooledCache=s,s.refCount++,y.memoizedState={element:m,isDehydrated:u,cache:s},Um(y),a}function VE(a){return a?(a=wo,a):wo}function GE(a,s,u,m,b,y){b=VE(b),m.context===null?m.context=b:m.pendingContext=b,m=Di(s),m.payload={element:u},y=y===void 0?null:y,y!==null&&(m.callback=y),u=ji(a,m,s),u!==null&&(Jr(u,a,s),qu(u,a,s))}function qE(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<s?u:s}}function r0(a,s){qE(a,s),(a=a.alternate)&&qE(a,s)}function YE(a){if(a.tag===13||a.tag===31){var s=Rl(a,67108864);s!==null&&Jr(s,a,67108864),r0(a,67108864)}}function WE(a){if(a.tag===13||a.tag===31){var s=da();s=ya(s);var u=Rl(a,s);u!==null&&Jr(u,a,s),r0(a,s)}}var Tf=!0;function fN(a,s,u,m){var b=H.T;H.T=null;var y=ce.p;try{ce.p=2,a0(a,s,u,m)}finally{ce.p=y,H.T=b}}function hN(a,s,u,m){var b=H.T;H.T=null;var y=ce.p;try{ce.p=8,a0(a,s,u,m)}finally{ce.p=y,H.T=b}}function a0(a,s,u,m){if(Tf){var b=s0(m);if(b===null)Vp(a,s,m,vf,u),XE(a,m);else if(pN(b,a,s,u,m))m.stopPropagation();else if(XE(a,m),s&4&&-1<mN.indexOf(a)){for(;b!==null;){var y=Gn(b);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=Xe(y.pendingLanes);if(k!==0){var L=y;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var Y=1<<31-Me(k);L.entanglements[1]|=Y,k&=~Y}gs(y),(tn&6)===0&&(af=Tt()+500,oc(0))}}break;case 31:case 13:L=Rl(y,2),L!==null&&Jr(L,y,2),lf(),r0(y,2)}if(y=s0(m),y===null&&Vp(a,s,m,vf,u),y===b)break;b=y}b!==null&&m.stopPropagation()}else Vp(a,s,m,null,u)}}function s0(a){return a=ki(a),i0(a)}var vf=null;function i0(a){if(vf=null,a=On(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 vf=a,null}function QE(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(er()){case ge:return 2;case Ne:return 8;case Re:case st:return 32;case xt:return 268435456;default:return 32}default:return 32}}var l0=!1,qi=null,Yi=null,Wi=null,pc=new Map,gc=new Map,Qi=[],mN="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 XE(a,s){switch(a){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Yi=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":pc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":gc.delete(s.pointerId)}}function bc(a,s,u,m,b,y){return a===null||a.nativeEvent!==y?(a={blockedOn:s,domEventName:u,eventSystemFlags:m,nativeEvent:y,targetContainers:[b]},s!==null&&(s=Gn(s),s!==null&&YE(s)),a):(a.eventSystemFlags|=m,s=a.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),a)}function pN(a,s,u,m,b){switch(s){case"focusin":return qi=bc(qi,a,s,u,m,b),!0;case"dragenter":return Yi=bc(Yi,a,s,u,m,b),!0;case"mouseover":return Wi=bc(Wi,a,s,u,m,b),!0;case"pointerover":var y=b.pointerId;return pc.set(y,bc(pc.get(y)||null,a,s,u,m,b)),!0;case"gotpointercapture":return y=b.pointerId,gc.set(y,bc(gc.get(y)||null,a,s,u,m,b)),!0}return!1}function KE(a){var s=On(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,bl(a.priority,function(){WE(u)});return}}else if(s===31){if(s=c(u),s!==null){a.blockedOn=s,bl(a.priority,function(){WE(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 kf(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var u=s0(a.nativeEvent);if(u===null){u=a.nativeEvent;var m=new u.constructor(u.type,u);Tl=m,u.target.dispatchEvent(m),Tl=null}else return s=Gn(u),s!==null&&YE(s),a.blockedOn=u,!1;s.shift()}return!0}function ZE(a,s,u){kf(a)&&u.delete(s)}function gN(){l0=!1,qi!==null&&kf(qi)&&(qi=null),Yi!==null&&kf(Yi)&&(Yi=null),Wi!==null&&kf(Wi)&&(Wi=null),pc.forEach(ZE),gc.forEach(ZE)}function wf(a,s){a.blockedOn===s&&(a.blockedOn=null,l0||(l0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gN)))}var Cf=null;function JE(a){Cf!==a&&(Cf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Cf===a&&(Cf=null);for(var s=0;s<a.length;s+=3){var u=a[s],m=a[s+1],b=a[s+2];if(typeof m!="function"){if(i0(m||u)===null)continue;break}var y=Gn(u);y!==null&&(a.splice(s,3),s-=3,sp(y,{pending:!0,data:b,method:u.method,action:m},m,b))}}))}function Qo(a){function s(Y){return wf(Y,a)}qi!==null&&wf(qi,a),Yi!==null&&wf(Yi,a),Wi!==null&&wf(Wi,a),pc.forEach(s),gc.forEach(s);for(var u=0;u<Qi.length;u++){var m=Qi[u];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Qi.length&&(u=Qi[0],u.blockedOn===null);)KE(u),u.blockedOn===null&&Qi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var b=u[m],y=u[m+1],k=b[An]||null;if(typeof y=="function")k||JE(u);else if(k){var L=null;if(y&&y.hasAttribute("formAction")){if(b=y,k=y[An]||null)L=k.formAction;else if(i0(b)!==null)continue}else L=k.action;typeof L=="function"?u[m+1]=L:(u.splice(m,3),m-=3),JE(u)}}}function e2(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function o0(a){this._internalRoot=a}Sf.prototype.render=o0.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,m=da();GE(u,m,a,s,null,null)},Sf.prototype.unmount=o0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;GE(a.current,2,null,a,null,null),lf(),s[Va]=null}};function Sf(a){this._internalRoot=a}Sf.prototype.unstable_scheduleHydration=function(a){if(a){var s=gl();a={blockedOn:null,target:a,priority:s};for(var u=0;u<Qi.length&&s!==0&&s<Qi[u].priority;u++);Qi.splice(u,0,a),u===0&&KE(a)}};var t2=t.version;if(t2!=="19.2.5")throw Error(r(527,t2,"19.2.5"));ce.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(s),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var bN={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nf.isDisabled&&Nf.supportsFiber)try{ye=Nf.inject(bN),ze=Nf}catch{}}return yc.createRoot=function(a,s){if(!i(a))throw Error(r(299));var u=!1,m="",b=oy,y=uy,k=cy;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError)),s=$E(a,1,!1,null,null,u,m,null,b,y,k,e2),a[Va]=s.current,$p(a),new o0(s)},yc.hydrateRoot=function(a,s,u){if(!i(a))throw Error(r(299));var m=!1,b="",y=oy,k=uy,L=cy,Y=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(L=u.onRecoverableError),u.formState!==void 0&&(Y=u.formState)),s=$E(a,1,!0,s,u??null,m,b,Y,y,k,L,e2),s.context=VE(null),u=s.current,m=da(),m=ya(m),b=Di(m),b.callback=null,ji(u,b,m),u=m,s.current.lanes=u,Nn(s,u),gs(s),a[Va]=s.current,$p(a),new Sf(s)},yc.version="19.2.5",yc}var h2;function LN(){if(h2)return h0.exports;h2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),h0.exports=RN(),h0.exports}var IN=LN();const ON=zh(IN);/**
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 m2="popstate";function p2(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function DN(e={}){function t(r,i){var h;let l=(h=i.state)==null?void 0:h.masked,{pathname:o,search:c,hash:f}=l||r.location;return Tg("",{pathname:o,search:c,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Kc(i)}return MN(t,n,null,e)}function Sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function za(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jN(){return Math.random().toString(36).substring(2,10)}function g2(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 Tg(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?xu(t):t,state:n,key:t&&t.key||r||jN(),unstable_mask:i}}function Kc({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 xu(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 MN(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,c="POP",f=null,h=g();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function g(){return(o.state||{idx:null}).idx}function p(){c="POP";let S=g(),w=S==null?null:S-h;h=S,f&&f({action:c,location:C.location,delta:w})}function x(S,w){c="PUSH";let O=p2(S)?S:Tg(C.location,S,w);h=g()+1;let R=g2(O,h),j=C.createHref(O.unstable_mask||O);try{o.pushState(R,"",j)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;i.location.assign(j)}l&&f&&f({action:c,location:C.location,delta:1})}function E(S,w){c="REPLACE";let O=p2(S)?S:Tg(C.location,S,w);h=g();let R=g2(O,h),j=C.createHref(O.unstable_mask||O);o.replaceState(R,"",j),l&&f&&f({action:c,location:C.location,delta:0})}function v(S){return PN(S)}let C={get action(){return c},get location(){return e(i,o)},listen(S){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(m2,p),f=S,()=>{i.removeEventListener(m2,p),f=null}},createHref(S){return t(i,S)},createURL:v,encodeLocation(S){let w=v(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:x,replace:E,go(S){return o.go(S)}};return C}function PN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Sn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Kc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Hv(e,t,n="/"){return BN(e,t,n,!1)}function BN(e,t,n,r){let i=typeof t=="string"?xu(t):t,l=pi(i.pathname||"/",n);if(l==null)return null;let o=Fv(e);UN(o);let c=null;for(let f=0;c==null&&f<o.length;++f){let h=XN(l);c=WN(o[f],h,r)}return c}function Fv(e,t=[],n=[],r="",i=!1){let l=(o,c,f=i,h)=>{let g={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&f)return;Sn(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let p=Ts([r,g.relativePath]),x=n.concat(g);o.children&&o.children.length>0&&(Sn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Fv(o.children,t,x,p,f)),!(o.path==null&&!o.index)&&t.push({path:p,score:qN(p,o.index),routesMeta:x})};return e.forEach((o,c)=>{var f;if(o.path===""||!((f=o.path)!=null&&f.includes("?")))l(o,c);else for(let h of zv(o.path))l(o,c,!0,h)}),t}function zv(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=zv(r.join("/")),c=[];return c.push(...o.map(f=>f===""?l:[l,f].join("/"))),i&&c.push(...o),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function UN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:YN(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var HN=/^:[\w-]+$/,FN=3,zN=2,$N=1,VN=10,GN=-2,b2=e=>e==="*";function qN(e,t){let n=e.split("/"),r=n.length;return n.some(b2)&&(r+=GN),t&&(r+=zN),n.filter(i=>!b2(i)).reduce((i,l)=>i+(HN.test(l)?FN:l===""?$N:VN),r)}function YN(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 WN(e,t,n=!1){let{routesMeta:r}=e,i={},l="/",o=[];for(let c=0;c<r.length;++c){let f=r[c],h=c===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",p=hh({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),x=f.route;if(!p&&h&&n&&!r[r.length-1].route.index&&(p=hh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:Ts([l,p.pathname]),pathnameBase:eA(Ts([l,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(l=Ts([l,p.pathnameBase]))}return o}function hh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=QN(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],o=l.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((h,{paramName:g,isOptional:p},x)=>{if(g==="*"){let v=c[x]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const E=c[x];return p&&!E?h[g]=void 0:h[g]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:o,pattern:e}}function QN(e,t=!1,n=!0){za(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,f,h,g)=>{if(r.push({paramName:c,isOptional:f!=null}),f){let p=g.charAt(h+o.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 XN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return za(!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 pi(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 KN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ZN(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?xu(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=x2(n.substring(1),"/"):l=x2(n,t)):l=t,{pathname:l,search:tA(r),hash:nA(i)}}function x2(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 b0(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 JN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function w1(e){let t=JN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function $h(e,t,n,r=!1){let i;typeof e=="string"?i=xu(e):(i={...e},Sn(!i.pathname||!i.pathname.includes("?"),b0("?","pathname","search",i)),Sn(!i.pathname||!i.pathname.includes("#"),b0("#","pathname","hash",i)),Sn(!i.search||!i.search.includes("#"),b0("#","search","hash",i)));let l=e===""||i.pathname==="",o=l?"/":i.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),p-=1;i.pathname=x.join("/")}c=p>=0?t[p]:"/"}let f=ZN(i,c),h=o&&o!=="/"&&o.endsWith("/"),g=(l||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var Ts=e=>e.join("/").replace(/\/\/+/g,"/"),eA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rA=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 aA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function sA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var $v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vv(e,t){let n=e;if(typeof n!="string"||!KN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if($v)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=pi(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:i=!0}catch{za(!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 Gv=["POST","PUT","PATCH","DELETE"];new Set(Gv);var iA=["GET",...Gv];new Set(iA);var yu=T.createContext(null);yu.displayName="DataRouter";var Vh=T.createContext(null);Vh.displayName="DataRouterState";var qv=T.createContext(!1);function lA(){return T.useContext(qv)}var Yv=T.createContext({isTransitioning:!1});Yv.displayName="ViewTransition";var oA=T.createContext(new Map);oA.displayName="Fetchers";var uA=T.createContext(null);uA.displayName="Await";var pa=T.createContext(null);pa.displayName="Navigation";var ud=T.createContext(null);ud.displayName="Location";var $a=T.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var C1=T.createContext(null);C1.displayName="RouteError";var Wv="REACT_ROUTER_ERROR",cA="REDIRECT",dA="ROUTE_ERROR_RESPONSE";function fA(e){if(e.startsWith(`${Wv}:${cA}:{`))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 hA(e){if(e.startsWith(`${Wv}:${dA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rA(t.status,t.statusText,t.data)}catch{}}function mA(e,{relative:t}={}){Sn(Eu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(pa),{hash:i,pathname:l,search:o}=cd(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:Ts([n,l])),r.createHref({pathname:c,search:o,hash:i})}function Eu(){return T.useContext(ud)!=null}function ga(){return Sn(Eu(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(ud).location}var Qv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xv(e){T.useContext(pa).static||T.useLayoutEffect(e)}function is(){let{isDataRoute:e}=T.useContext($a);return e?RA():pA()}function pA(){Sn(Eu(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(yu),{basename:t,navigator:n}=T.useContext(pa),{matches:r}=T.useContext($a),{pathname:i}=ga(),l=JSON.stringify(w1(r)),o=T.useRef(!1);return Xv(()=>{o.current=!0}),T.useCallback((f,h={})=>{if(za(o.current,Qv),!o.current)return;if(typeof f=="number"){n.go(f);return}let g=$h(f,JSON.parse(l),i,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ts([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,i,e])}var gA=T.createContext(null);function bA(e){let t=T.useContext($a).outlet;return T.useMemo(()=>t&&T.createElement(gA.Provider,{value:e},t),[t,e])}function xA(){let{matches:e}=T.useContext($a),t=e[e.length-1];return t?t.params:{}}function cd(e,{relative:t}={}){let{matches:n}=T.useContext($a),{pathname:r}=ga(),i=JSON.stringify(w1(n));return T.useMemo(()=>$h(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function yA(e,t){return Kv(e,t)}function Kv(e,t,n){var S;Sn(Eu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(pa),{matches:i}=T.useContext($a),l=i[i.length-1],o=l?l.params:{},c=l?l.pathname:"/",f=l?l.pathnameBase:"/",h=l&&l.route;{let w=h&&h.path||"";Jv(c,!h||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let g=ga(),p;if(t){let w=typeof t=="string"?xu(t):t;Sn(f==="/"||((S=w.pathname)==null?void 0:S.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=g;let x=p.pathname||"/",E=x;if(f!=="/"){let w=f.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=Hv(e,{pathname:E});za(h||v!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),za(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 "${p.pathname}${p.search}${p.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 C=kA(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},o,w.params),pathname:Ts([f,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:Ts([f,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return t&&C?T.createElement(ud.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},C):C}function EA(){let e=AA(),t=aA(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 _A=T.createElement(EA,null),Zv=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=hA(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement($a.Provider,{value:this.props.routeContext},T.createElement(C1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(TA,{error:e},t):t}};Zv.contextType=qv;var x0=new WeakMap;function TA({children:e,error:t}){let{basename:n}=T.useContext(pa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=fA(t.digest);if(r){let i=x0.get(t);if(i)throw i;let l=Vv(r.location,n);if($v&&!x0.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 x0.set(t,o),o}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function vA({routeContext:e,match:t,children:n}){let r=T.useContext(yu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement($a.Provider,{value:e},n)}function kA(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 g=i.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);Sn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let g=0;g<i.length;g++){let p=i[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=g),p.route.id){let{loaderData:x,errors:E}=r,v=p.route.loader&&!x.hasOwnProperty(p.route.id)&&(!E||E[p.route.id]===void 0);if(p.route.lazy||v){n.isStatic&&(o=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(g,p)=>{var x,E;f(g,{location:r.location,params:((E=(x=r.matches)==null?void 0:x[0])==null?void 0:E.params)??{},unstable_pattern:sA(r.matches),errorInfo:p})}:void 0;return i.reduceRight((g,p,x)=>{let E,v=!1,C=null,S=null;r&&(E=l&&p.route.id?l[p.route.id]:void 0,C=p.route.errorElement||_A,o&&(c<0&&x===0?(Jv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,S=null):c===x&&(v=!0,S=p.route.hydrateFallbackElement||null)));let w=t.concat(i.slice(0,x+1)),O=()=>{let R;return E?R=C:v?R=S:p.route.Component?R=T.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=g,T.createElement(vA,{match:p,routeContext:{outlet:g,matches:w,isDataRoute:r!=null},children:R})};return r&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?T.createElement(Zv,{location:r.location,revalidation:r.revalidation,component:C,error:E,children:O(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:h}):O()},null)}function S1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wA(e){let t=T.useContext(yu);return Sn(t,S1(e)),t}function CA(e){let t=T.useContext(Vh);return Sn(t,S1(e)),t}function SA(e){let t=T.useContext($a);return Sn(t,S1(e)),t}function N1(e){let t=SA(e),n=t.matches[t.matches.length-1];return Sn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NA(){return N1("useRouteId")}function AA(){var r;let e=T.useContext(C1),t=CA("useRouteError"),n=N1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function RA(){let{router:e}=wA("useNavigate"),t=N1("useNavigate"),n=T.useRef(!1);return Xv(()=>{n.current=!0}),T.useCallback(async(i,l={})=>{za(n.current,Qv),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var y2={};function Jv(e,t,n){!t&&!y2[e]&&(y2[e]=!0,za(!1,n))}T.memo(LA);function LA({routes:e,future:t,state:n,isStatic:r,onError:i}){return Kv(e,void 0,{state:n,isStatic:r,onError:i})}function IA({to:e,replace:t,state:n,relative:r}){Sn(Eu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=T.useContext(pa);za(!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($a),{pathname:o}=ga(),c=is(),f=$h(e,w1(l),o,r==="path"),h=JSON.stringify(f);return T.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function OA(e){return bA(e.context)}function ci(e){Sn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function DA({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:l=!1,unstable_useTransitions:o}){Sn(!Eu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=T.useMemo(()=>({basename:c,navigator:i,static:l,unstable_useTransitions:o,future:{}}),[c,i,l,o]);typeof n=="string"&&(n=xu(n));let{pathname:h="/",search:g="",hash:p="",state:x=null,key:E="default",unstable_mask:v}=n,C=T.useMemo(()=>{let S=pi(h,c);return S==null?null:{location:{pathname:S,search:g,hash:p,state:x,key:E,unstable_mask:v},navigationType:r}},[c,h,g,p,x,E,r,v]);return za(C!=null,`<Router basename="${c}"> is not able to match the URL "${h}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:T.createElement(pa.Provider,{value:f},T.createElement(ud.Provider,{children:t,value:C}))}function jA({children:e,location:t}){return yA(vg(e),t)}function vg(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,vg(r.props.children,l));return}Sn(r.type===ci,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Sn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=vg(r.props.children,l)),n.push(o)}),n}var nh="get",rh="application/x-www-form-urlencoded";function Gh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function MA(e){return Gh(e)&&e.tagName.toLowerCase()==="button"}function PA(e){return Gh(e)&&e.tagName.toLowerCase()==="form"}function BA(e){return Gh(e)&&e.tagName.toLowerCase()==="input"}function UA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function HA(e,t){return e.button===0&&(!t||t==="_self")&&!UA(e)}function kg(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 FA(e,t){let n=kg(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var Af=null;function zA(){if(Af===null)try{new FormData(document.createElement("form"),0),Af=!1}catch{Af=!0}return Af}var $A=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function y0(e){return e!=null&&!$A.has(e)?(za(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rh}"`),null):e}function VA(e,t){let n,r,i,l,o;if(PA(e)){let c=e.getAttribute("action");r=c?pi(c,t):null,n=e.getAttribute("method")||nh,i=y0(e.getAttribute("enctype"))||rh,l=new FormData(e)}else if(MA(e)||BA(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?pi(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||nh,i=y0(e.getAttribute("formenctype"))||y0(c.getAttribute("enctype"))||rh,l=new FormData(c,e),!zA()){let{name:h,type:g,value:p}=e;if(g==="image"){let x=h?`${h}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else h&&l.append(h,p)}}else{if(Gh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=nh,r=null,i=rh,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 A1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ek(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&&pi(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function GA(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 qA(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 YA(e,t,n){let r=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let o=await GA(l,n);return o.links?o.links():[]}return[]}));return KA(r.flat(1).filter(qA).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function E2(e,t,n,r,i,l){let o=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,c=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>o(f,h)||c(f,h)):l==="data"?t.filter((f,h)=>{var p;let g=r.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(o(f,h)||c(f,h))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function WA(e,t,{includeHydrateFallback:n}={}){return QA(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 QA(e){return[...new Set(e)]}function XA(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function KA(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let l=JSON.stringify(XA(i));return n.has(l)||(n.add(l),r.push({key:l,link:i})),r},[])}function R1(){let e=T.useContext(yu);return A1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ZA(){let e=T.useContext(Vh);return A1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var L1=T.createContext(void 0);L1.displayName="FrameworkContext";function I1(){let e=T.useContext(L1);return A1(e,"You must render this element inside a <HydratedRouter> element"),e}function JA(e,t){let n=T.useContext(L1),[r,i]=T.useState(!1),[l,o]=T.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:p}=t,x=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let C=w=>{w.forEach(O=>{o(O.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return x.current&&S.observe(x.current),()=>{S.disconnect()}}},[e]),T.useEffect(()=>{if(r){let C=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(C)}}},[r]);let E=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:Ec(c,E),onBlur:Ec(f,v),onMouseEnter:Ec(h,E),onMouseLeave:Ec(g,v),onTouchStart:Ec(p,E)}]:[!1,x,{}]}function Ec(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function e6({page:e,...t}){let n=lA(),{router:r}=R1(),i=T.useMemo(()=>Hv(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?T.createElement(n6,{page:e,matches:i,...t}):T.createElement(r6,{page:e,matches:i,...t}):null}function t6(e){let{manifest:t,routeModules:n}=I1(),[r,i]=T.useState([]);return T.useEffect(()=>{let l=!1;return YA(e,t,n).then(o=>{l||i(o)}),()=>{l=!0}},[e,t,n]),r}function n6({page:e,matches:t,...n}){let r=ga(),{future:i}=I1(),{basename:l}=R1(),o=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let c=ek(e,l,i.unstable_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?f=!0:h.push(g.route.id);return f&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[l,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return T.createElement(T.Fragment,null,o.map(c=>T.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...n})))}function r6({page:e,matches:t,...n}){let r=ga(),{future:i,manifest:l,routeModules:o}=I1(),{basename:c}=R1(),{loaderData:f,matches:h}=ZA(),g=T.useMemo(()=>E2(e,t,h,l,r,"data"),[e,t,h,l,r]),p=T.useMemo(()=>E2(e,t,h,l,r,"assets"),[e,t,h,l,r]),x=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,S=!1;if(t.forEach(O=>{var j;let R=l.routes[O.route.id];!R||!R.hasLoader||(!g.some(G=>G.route.id===O.route.id)&&O.route.id in f&&((j=o[O.route.id])!=null&&j.shouldRevalidate)||R.hasClientLoader?S=!0:C.add(O.route.id))}),C.size===0)return[];let w=ek(e,c,i.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&w.searchParams.set("_routes",t.filter(O=>C.has(O.route.id)).map(O=>O.route.id).join(",")),[w.pathname+w.search]},[c,i.unstable_trailingSlashAwareDataRequests,f,r,l,g,t,e,o]),E=T.useMemo(()=>WA(p,l),[p,l]),v=t6(p);return T.createElement(T.Fragment,null,x.map(C=>T.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),E.map(C=>T.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),v.map(({key:C,link:S})=>T.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function a6(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var s6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{s6&&(window.__reactRouterVersion="7.14.0")}catch{}function i6({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=T.useRef();i.current==null&&(i.current=DN({window:r,v5Compat:!0}));let l=i.current,[o,c]=T.useState({action:l.action,location:l.location}),f=T.useCallback(h=>{n===!1?c(h):T.startTransition(()=>c(h))},[n]);return T.useLayoutEffect(()=>l.listen(f),[l,f]),T.createElement(DA,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var tk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gi=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:l,replace:o,unstable_mask:c,state:f,target:h,to:g,preventScrollReset:p,viewTransition:x,unstable_defaultShouldRevalidate:E,...v},C){let{basename:S,navigator:w,unstable_useTransitions:O}=T.useContext(pa),R=typeof g=="string"&&tk.test(g),j=Vv(g,S);g=j.to;let G=mA(g,{relative:i}),N=ga(),P=null;if(c){let se=$h(c,[],N.unstable_mask?N.unstable_mask.pathname:"/",!0);S!=="/"&&(se.pathname=se.pathname==="/"?S:Ts([S,se.pathname])),P=w.createHref(se)}let[$,ne,W]=JA(r,v),me=c6(g,{replace:o,unstable_mask:c,state:f,target:h,preventScrollReset:p,relative:i,viewTransition:x,unstable_defaultShouldRevalidate:E,unstable_useTransitions:O});function Q(se){t&&t(se),se.defaultPrevented||me(se)}let _e=!(j.isExternal||l),de=T.createElement("a",{...v,...W,href:(_e?P:void 0)||j.absoluteURL||G,onClick:_e?Q:t,ref:a6(C,ne),target:h,"data-discover":!R&&n==="render"?"true":void 0});return $&&!R?T.createElement(T.Fragment,null,de,T.createElement(e6,{page:G})):de});gi.displayName="Link";var l6=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:l,to:o,viewTransition:c,children:f,...h},g){let p=cd(o,{relative:h.relative}),x=ga(),E=T.useContext(Vh),{navigator:v,basename:C}=T.useContext(pa),S=E!=null&&p6(p)&&c===!0,w=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,O=x.pathname,R=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(O=O.toLowerCase(),R=R?R.toLowerCase():null,w=w.toLowerCase()),R&&C&&(R=pi(R,C)||R);const j=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let G=O===w||!i&&O.startsWith(w)&&O.charAt(j)==="/",N=R!=null&&(R===w||!i&&R.startsWith(w)&&R.charAt(w.length)==="/"),P={isActive:G,isPending:N,isTransitioning:S},$=G?t:void 0,ne;typeof r=="function"?ne=r(P):ne=[r,G?"active":null,N?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let W=typeof l=="function"?l(P):l;return T.createElement(gi,{...h,"aria-current":$,className:ne,ref:g,style:W,to:o,viewTransition:c},typeof f=="function"?f(P):f)});l6.displayName="NavLink";var o6=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:l,method:o=nh,action:c,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:x,...E},v)=>{let{unstable_useTransitions:C}=T.useContext(pa),S=h6(),w=m6(c,{relative:h}),O=o.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&tk.test(c),j=G=>{if(f&&f(G),G.defaultPrevented)return;G.preventDefault();let N=G.nativeEvent.submitter,P=(N==null?void 0:N.getAttribute("formmethod"))||o,$=()=>S(N||G.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:l,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:x});C&&n!==!1?T.startTransition(()=>$()):$()};return T.createElement("form",{ref:v,method:O,action:w,onSubmit:r?f:j,...E,"data-discover":!R&&e==="render"?"true":void 0})});o6.displayName="Form";function u6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nk(e){let t=T.useContext(yu);return Sn(t,u6(e)),t}function c6(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let g=is(),p=ga(),x=cd(e,{relative:o});return T.useCallback(E=>{if(HA(E,t)){E.preventDefault();let v=n!==void 0?n:Kc(p)===Kc(x),C=()=>g(e,{replace:v,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f});h?T.startTransition(()=>C()):C()}},[p,g,x,n,r,i,t,e,l,o,c,f,h])}function rk(e){za(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(kg(e)),n=T.useRef(!1),r=ga(),i=T.useMemo(()=>FA(r.search,n.current?null:t.current),[r.search]),l=is(),o=T.useCallback((c,f)=>{const h=kg(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,l("?"+h,f)},[l,i]);return[i,o]}var d6=0,f6=()=>`__${String(++d6)}__`;function h6(){let{router:e}=nk("useSubmit"),{basename:t}=T.useContext(pa),n=NA(),r=e.fetch,i=e.navigate;return T.useCallback(async(l,o={})=>{let{action:c,method:f,encType:h,formData:g,body:p}=VA(l,t);if(o.navigate===!1){let x=o.fetcherKey||f6();await r(x,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||f,formEncType:o.encType||h,flushSync:o.flushSync})}else await i(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||f,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function m6(e,{relative:t}={}){let{basename:n}=T.useContext(pa),r=T.useContext($a);Sn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),l={...cd(e||".",{relative:t})},o=ga();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),f=c.getAll("index");if(f.some(g=>g==="")){c.delete("index"),f.filter(p=>p).forEach(p=>c.append("index",p));let g=c.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ts([n,l.pathname])),Kc(l)}function p6(e,{relative:t}={}){let n=T.useContext(Yv);Sn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=nk("useViewTransitionState"),i=cd(e,{relative:t});if(!n.isTransitioning)return!1;let l=pi(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=pi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hh(i.pathname,o)!=null||hh(i.pathname,l)!=null}var _u=Uv();const ak=["codex","claude","opencode"],dl="codex",sk={codex:{displayName:"Codex",description:"Local Codex app-server runtime.",defaultTransport:"stdio",homeEnvVar:"CODEX_HOME",commandEnvVar:"CODEX_COMMAND",defaultHomeDir:".codex",defaultCommand:"codex"},claude:{displayName:"Claude Code",description:"Local Claude Code Agent SDK runtime.",defaultTransport:"sdk",homeEnvVar:"CLAUDE_HOME",commandEnvVar:"CLAUDE_COMMAND",defaultHomeDir:".claude",defaultCommand:"claude"},opencode:{displayName:"OpenCode",description:"Local OpenCode runtime.",defaultTransport:"sdk",homeEnvVar:"OPENCODE_HOME",commandEnvVar:"OPENCODE_COMMAND",defaultHomeDir:".opencode",defaultCommand:"opencode"}};function g6(e){return typeof e=="string"&&ak.includes(e)}function b6(e){return g6(e)?e:null}const ik=T.createContext(null);function fo(){return T.useContext(ik)}class Yt extends Error{constructor(t,n){super(n.message),this.statusCode=t,this.payload=n}}async function ot(e,t){const n=new Headers(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!(t.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const r=await fetch(e,{headers:n,...t});if(!r.ok){const i=await r.json();throw new Yt(r.status,i)}return await r.json()}function x6(e){const t=String(e);return t.includes("/exports/pdf")?t.includes("format=html")?"remote-codex-transcript.html":"remote-codex-transcript.pdf":"download"}function y6(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 E6(e,t){const n=await fetch(e,t);if(!n.ok){let i=null;try{i=await n.json()}catch{i=null}throw new Yt(n.status,i??{code:"internal_error",message:"Unable to download file."})}const r=y6(n.headers.get("content-disposition"))??x6(e);return{blob:await n.blob(),filename:r}}function _2(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 _6(){return ot("/api/config/runtime")}function T6(){return ot("/api/config/workspace-settings",{cache:"no-store"})}function v6(e){return ot("/api/config/workspace-settings",{method:"PATCH",body:JSON.stringify(e)})}function lk(){return ot("/api/agent-runtimes",{cache:"no-store"})}function ok(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/status`,{cache:"no-store"})}function k6(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/restart`,{method:"POST"})}function w6(e,t){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/install`,{method:"POST",body:JSON.stringify({action:t})})}function wg(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/models`,{cache:"no-store"})}function Cg(e,t){return ot(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{cache:"no-store"})}function Sg(e,t,n){return ot(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function C6(e){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives`,{cache:"no-store"})}function S6(e,t={}){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives`,{method:"POST",body:JSON.stringify(t)})}function N6(e,t,n){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function A6(e,t){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}/apply`,{method:"POST"})}function R6(){return ot("/api/service/build-restart",{method:"POST"})}function L6(){return ot("/healthz",{cache:"no-store"})}function O1(){return ot("/api/workspaces")}function uk(){return ot("/api/threads")}function E0(e,t={}){const n=new URLSearchParams;return t.limit!==void 0&&n.set("limit",String(t.limit)),t.beforeTurnId&&n.set("beforeTurnId",t.beforeTurnId),ot(`/api/threads/${e}${n.size>0?`?${n.toString()}`:""}`)}function I6(e,t){return ot(`/api/threads/${e}/items/${encodeURIComponent(t)}/detail`)}function O6(e){return ot(`/api/threads/${e}/export-turns`,{cache:"no-store"})}function D6(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 j6(e,t){return E6(D6(e,t),{cache:"no-store"})}function M6(e){return ot(`/api/threads/${e}/shell`)}function P6(e){return ot("/api/threads/start",{method:"POST",body:JSON.stringify(e)})}function B6(e){return ot("/api/threads/import",{method:"POST",body:JSON.stringify({sessionId:e})})}function U6(e,t={}){return ot(`/api/threads/${e}/shell`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function H6(e){return ot(`/api/shells/${e}/terminate`,{method:"POST"})}function T2(e,t={}){return ot(`/api/threads/${e}/resume`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function F6(e){return ot(`/api/threads/${e}/disconnect`,{method:"POST"})}function z6(e,t){const n=t.attachments??[];if(n.length===0)return ot(`/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:_2(l,o),placeholder:l.placeholder}));r.append("attachmentManifest",JSON.stringify(i));for(const[l,o]of n.entries())r.append("attachments",o.file,_2(o,l));return ot(`/api/threads/${e}/prompt`,{method:"POST",body:r})}function v2(e,t={}){return ot(`/api/threads/${e}/interrupt`,{method:"POST",body:JSON.stringify(t)})}function ck(e,t){return ot(`/api/threads/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function dk(e){return ot(`/api/threads/${e}`,{method:"DELETE"})}function $6(e,t){return ot(`/api/threads/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function V6(e){return ot(`/api/threads/${e}/compact`,{method:"POST"})}function G6(e){return ot(`/api/threads/${e}/goal`,{cache:"no-store"})}function q6(e,t){return ot(`/api/threads/${e}/goal`,{method:"PATCH",body:JSON.stringify(t)})}function Y6(e){return ot(`/api/threads/${e}/goal`,{method:"DELETE"})}function W6(e){return ot(`/api/threads/${e}/fork-turns`,{cache:"no-store"})}function k2(e,t){return ot(`/api/threads/${e}/fork`,{method:"POST",body:JSON.stringify(t)})}function Q6(e){return ot(`/api/threads/${e}/skills`,{cache:"no-store"})}function X6(e){return ot(`/api/threads/${e}/mcp-servers`,{cache:"no-store"})}function K6(e){return ot(`/api/threads/${e}/hooks`,{cache:"no-store"})}function Z6(e,t){return ot(`/api/threads/${e}/hooks`,{method:"POST",body:JSON.stringify(t)})}function J6(e,t){return ot(`/api/threads/${e}/hooks`,{method:"PUT",body:JSON.stringify(t)})}function eR(e,t){return ot(`/api/threads/${e}/hooks/trust`,{method:"POST",body:JSON.stringify(t)})}function tR(e,t){return ot(`/api/threads/${e}/hooks/untrust`,{method:"POST",body:JSON.stringify(t)})}function nR(e,t,n){return ot(`/api/threads/${e}/requests/${encodeURIComponent(t)}/respond`,{method:"POST",body:JSON.stringify(n)})}function rR(e){return ot("/api/workspaces",{method:"POST",body:JSON.stringify(e)})}function aR(e,t){return ot(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function sR(e){return ot(`/api/workspaces/${e}`,{method:"DELETE"})}function iR(e,t){return ot(`/api/workspaces/${e}/favorite`,{method:"POST",body:JSON.stringify(t)})}function fk(e){const t=window.location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}/ws`);return n.addEventListener("message",r=>{try{const i=JSON.parse(r.data);oR(i)&&e(i)}catch{}}),n}function lR(e={}){const t=window.location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}/ws`);return n.addEventListener("message",r=>{var i,l;try{const o=JSON.parse(r.data);if(o.type==="supervisor.connected"){(i=e.onConnected)==null||i.call(e,o);return}uR(o)&&((l=e.onShellEvent)==null||l.call(e,o))}catch{}}),{socket:n,send(r){n.send(JSON.stringify(r))}}}function oR(e){return"threadId"in e&&e.type.startsWith("thread.")&&typeof e.payload=="object"&&e.payload!==null}function uR(e){return"shellId"in e&&e.type.startsWith("shell.")&&typeof e.payload=="object"&&e.payload!==null}function cR(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M2 3.25h12v1.5H2Zm0 4h12v1.5H2Zm0 4h12v1.5H2Z"})})}function Ng(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})}function w2(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 dR=[{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."}],hk={hostConfigFiles:[],toolboxItems:[],hookCommandTemplates:[],providerConfigFormat:"none",mcpConfigFormat:"none",configArchives:!1,buildRestart:!1},fR={codex:{packageName:"@openai/codex",installCommand:null,updateCommand:"npm install -g @openai/codex@latest"},claude:{packageName:"@anthropic-ai/claude-agent-sdk",installCommand:"npm install -g @anthropic-ai/claude-code @anthropic-ai/claude-agent-sdk",updateCommand:"npm install -g @anthropic-ai/claude-code@latest @anthropic-ai/claude-agent-sdk@latest"},opencode:{packageName:"opencode-ai",installCommand:"npm install -g opencode-ai @opencode-ai/sdk",updateCommand:"npm install -g opencode-ai@latest @opencode-ai/sdk@latest"}};function Ag(e){const t=fR[e];return{packageName:t.packageName,installed:e==="codex",installedVersion:null,latestVersion:null,installCommand:t.installCommand,updateCommand:t.updateCommand,busy:!1,lastError:null}}function hR(e,t){return{provider:e,displayName:t,description:`${t} backend descriptor is not available.`,enabled:!1,isDefault:e===dl,status:{state:"stopped",transport:sk[e].defaultTransport,lastStartedAt:null,lastError:"Backend descriptor is not available.",restartCount:0},capabilities:{sessions:{list:!1,read:!1,resume:!1,importLocal:!1},turns:{start:!1,streamInput:!1,steer:!1,interrupt:!1,compact:!1},branching:{fork:!1,hardRollback:!1,resumeAt:!1,rewindFiles:!1},controls:{planMode:!1,permissionRequests:!1,sandboxMode:!1,performanceMode:!1,goals:!1},management:{models:!1,mcpStatus:!1,skills:!1,hooks:!1,hookTrust:!1,hostConfigFiles:!1,providerSettings:!1},usage:{contextWindow:!1,tokenUsage:!1,costUsd:!1}},managementSchema:hk,installation:Ag(e)}}function _0(e){const t=e.installation??Ag(e.provider);return{...e,installation:{...Ag(e.provider),...t}}}const ru=[...ak.map(e=>hR(e,sk[e].displayName))];function mR(e){var t;return((t=ru.find(n=>n.provider===e))==null?void 0:t.managementSchema)??hk}function pR(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 gR(e){const t=e.payload.details,n=typeof(t==null?void 0:t.stderr)=="string"&&t.stderr.trim()?t.stderr.trim():typeof(t==null?void 0:t.stdout)=="string"&&t.stdout.trim()?t.stdout.trim():null;return n?`${e.message}
62
+ ${n}`:e.message}function _c(e){return{path:e,exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null}}function D1({className:e=""}){const t=fo();return t?d.jsx("button",{type:"button","aria-label":t.navOpen?"Close Navigation":"Open Navigation","aria-expanded":t.navOpen,"aria-controls":"app-shell-navigation-menu",onClick:t.toggleNav,className:`inline-flex h-10 w-10 shrink-0 items-center justify-center text-[var(--theme-fg)] transition hover:text-[var(--theme-fg-soft)] ${e}`.trim(),children:t.navOpen?d.jsx(Ng,{}):d.jsx(cR,{})}):null}function j1({className:e=""}){const t=fo(),n=ga(),r=is(),i=T.useRef(null),l=n.pathname==="/workspaces";return T.useEffect(()=>{if(!(t!=null&&t.navOpen))return;const o=t;function c(f){const h=f.target;if(!h)return;const g=i.current;g!=null&&g.contains(h)||h instanceof Element&&h.closest('[aria-controls="app-shell-navigation-menu"]')||o.closeNav()}return document.addEventListener("pointerdown",c),()=>{document.removeEventListener("pointerdown",c)}},[t]),t!=null&&t.navOpen?d.jsxs("div",{ref:i,id:"app-shell-navigation-menu",onPointerDown:o=>{o.stopPropagation()},onMouseDown:o=>{o.stopPropagation()},onTouchStart:o=>{o.stopPropagation()},className:`rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] p-4 shadow-2xl shadow-black/15 backdrop-blur ${e}`.trim(),children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-base font-semibold tracking-wide text-[var(--theme-accent-strong)]",children:"Remote Codex"}),d.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Navigation"})]}),d.jsxs("nav",{className:"mt-4 flex flex-col gap-1.5 text-sm",children:[d.jsx("button",{type:"button",disabled:l,onClick:()=>{l||(t.closeNav(),r("/workspaces"))},className:w2(l),children:"Workspaces"}),d.jsx("button",{type:"button",onClick:()=>{t.openSettings()},className:w2(),children:"Settings"})]})]}):null}function bR(){const e=fo(),[t,n]=T.useState(null),[r,i]=T.useState({}),l=t?r[t]:null,[o,c]=T.useState({busy:!1,message:null,error:null}),[f,h]=T.useState([]),[g,p]=T.useState(ru),[x,E]=T.useState({loading:!1,saving:!1,error:null,operatingProvider:null,operatingAction:null,message:null}),[v,C]=T.useState(null),[S,w]=T.useState({devHomeDraft:"",loading:!1,saving:!1,message:null,error:null}),[O,R]=T.useState({loading:!1,creating:!1,applyingId:null,renamingId:null,renameDraft:"",message:null,error:null}),j=(e==null?void 0:e.themeMode)??"system",G=(e==null?void 0:e.effectiveTheme)??"dark",N=(e==null?void 0:e.defaultBackend)??dl,P=g.find(q=>q.provider===N)??ru.find(q=>q.provider===N)??ru[0],$=P.managementSchema??mR(P.provider),ne=$.hostConfigFiles;T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!$.configArchives)return;const q=e;function J(A){A.key==="Escape"&&q.closeSettings()}return window.addEventListener("keydown",J),()=>{window.removeEventListener("keydown",J)}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let q=!1;return E(J=>({...J,loading:!0,error:null})),lk().then(J=>{if(q)return;const A=[...J.map(_0),...ru.filter(U=>!J.some(ee=>ee.provider===U.provider))];p(A),E(U=>({...U,loading:!1}))}).catch(J=>{q||(p(ru),E(A=>({...A,loading:!1,error:J instanceof Yt?J.message:"Unable to load backend settings."})))}),()=>{q=!0}},[e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let q=!1;return w(J=>({...J,loading:!0,message:null,error:null})),T6().then(J=>{q||(C(J),w(A=>({...A,devHomeDraft:J.devHome,loading:!1})))}).catch(J=>{q||w(A=>({...A,loading:!1,error:J instanceof Yt?J.message:"Unable to load workspace settings."}))}),()=>{q=!0}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!P.capabilities.management.hostConfigFiles)return;let q=!1;async function J(){i(U=>{const ee={...U};for(const D of ne)ee[D.name]={..._c(D.name),...U[D.name],loading:!0,saving:!1,error:null,saveMessage:null};return ee});const A=await Promise.allSettled(ne.map(async U=>({name:U.name,result:await Cg(P.provider,U.name)})));q||i(U=>{var D,Te;const ee={...U};for(const we of A){if(we.status==="fulfilled"){const{name:et,result:Be}=we.value;ee[et]={path:Be.path,exists:Be.exists,originalContent:Be.content,draftContent:Be.content,loading:!1,saving:!1,error:null,saveMessage:null};continue}const Se=we.reason instanceof Yt?we.reason.message:"Unable to load the file.",Ve=((D=ne[A.indexOf(we)])==null?void 0:D.name)??((Te=ne[0])==null?void 0:Te.name);Ve&&(ee[Ve]={..._c(Ve),...ee[Ve],loading:!1,saving:!1,error:Se,saveMessage:null})}return ee})}return J(),()=>{q=!0}},[P.capabilities.management.hostConfigFiles,P.provider,ne,e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let q=!1;async function J(){R(A=>({...A,loading:!0,error:null,message:null}));try{const A=await C6(P.provider);if(q)return;h(A),R(U=>({...U,loading:!1}))}catch(A){if(q)return;R(U=>({...U,loading:!1,error:A instanceof Yt?A.message:"Unable to load config archives."}))}}return J(),()=>{q=!0}},[P.provider,$.configArchives,e==null?void 0:e.settingsOpen]);async function W(){if(!(o.busy||x.saving)){c({busy:!0,message:null,error:null});try{const q=await k6(P.provider),J=_0(q);c({busy:!1,message:J.status.state==="ready"?`${J.displayName} backend restarted.`:`${J.displayName} backend state: ${J.status.state}`,error:null}),p(A=>A.map(U=>U.provider===J.provider?J:U))}catch(q){c({busy:!1,message:null,error:q instanceof Yt?q.message:"Unable to restart the app server."})}}}async function me(q,J){if(o.busy||x.saving)return;const A=g.find(U=>U.provider===q);E(U=>({...U,saving:!0,operatingProvider:q,operatingAction:J,message:null,error:null}));try{const U=await w6(q,J),ee=_0(U);p(D=>D.map(Te=>Te.provider===ee.provider?ee:Te)),E(D=>({...D,saving:!1,operatingProvider:null,operatingAction:null,message:ee.installation.lastError?`${ee.displayName} ${J==="install"?"installed":"updated"}, but requires attention:
63
+ ${ee.installation.lastError}`:`${ee.displayName} ${J==="install"?"installed":"updated"}.`,error:null}))}catch(U){E(ee=>({...ee,saving:!1,operatingProvider:null,operatingAction:null,message:null,error:U instanceof Yt?gR(U):`Unable to ${J} ${(A==null?void 0:A.displayName)??q}.`}))}}async function Q(){if(!(o.busy||x.saving)){c({busy:!0,message:null,error:null});try{await R6(),c({busy:!1,message:"Build and restart launched. The page may disconnect briefly.",error:null})}catch(q){c({busy:!1,message:null,error:q instanceof Yt?q.message:"Unable to launch build and restart."})}}}async function _e(){const q=S.devHomeDraft.trim();if(!(!q||S.saving)){w(J=>({...J,saving:!0,message:null,error:null}));try{const J=await v6({devHome:q});C(J),w(A=>({...A,devHomeDraft:J.devHome,saving:!1,message:"Workspace defaults saved."}))}catch(J){w(A=>({...A,saving:!1,error:J instanceof Yt?J.message:"Unable to save workspace settings."}))}}}async function de(q){const J=r[q];if(!(!J||J.saving)){i(A=>({...A,[q]:{..._c(q),...A[q],saving:!0,error:null,saveMessage:null}}));try{const A=await Sg(P.provider,q,{content:J.draftContent});i(U=>({...U,[q]:{path:A.path,exists:A.exists,originalContent:A.content,draftContent:A.content,loading:!1,saving:!1,error:null,saveMessage:"Saved"}}))}catch(A){i(U=>({...U,[q]:{..._c(q),...U[q],saving:!1,error:A instanceof Yt?A.message:"Unable to save the file.",saveMessage:null}}))}}}async function se(){if(!O.creating){R(q=>({...q,creating:!0,message:null,error:null}));try{const q=await S6(P.provider);h(J=>[q,...J]),R(J=>({...J,creating:!1,message:"Backup created."}))}catch(q){R(J=>({...J,creating:!1,error:q instanceof Yt?q.message:"Unable to create a config backup."}))}}}async function H(q){if(!O.applyingId){R(J=>({...J,applyingId:q.id,message:null,error:null}));try{const J=await A6(P.provider,q.id);R(A=>({...A,applyingId:null,message:J.status.state==="ready"?`Applied "${J.archive.label}" and restarted ${P.displayName}.`:`Applied "${J.archive.label}". ${P.displayName} state: ${J.status.state}.`}))}catch(J){R(A=>({...A,applyingId:null,error:J instanceof Yt?J.message:"Unable to apply the config archive."}))}}}async function ce(q){const J=O.renameDraft.trim();if(!(!J||O.renamingId!==q.id)){R(A=>({...A,message:null,error:null}));try{const A=await N6(P.provider,q.id,{label:J});h(U=>U.map(ee=>ee.id===q.id?A:ee)),R(U=>({...U,renamingId:null,renameDraft:"",message:"Backup renamed."}))}catch(A){R(U=>({...U,error:A instanceof Yt?A.message:"Unable to rename the config backup."}))}}}return e!=null&&e.settingsOpen?d.jsxs("div",{className:"fixed inset-0 z-[70] flex items-start justify-center p-4 pt-[max(env(safe-area-inset-top),1rem)] sm:items-center",children:[d.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"ui-overlay-scrim absolute inset-0 backdrop-blur-sm"}),d.jsxs("section",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"relative z-10 flex max-h-[calc(100vh-2rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/20",children:[d.jsx("div",{className:"shrink-0 p-5 pb-0",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Settings"}),d.jsx("h2",{className:"mt-2 text-xl font-semibold text-[var(--theme-fg)]",children:"Settings"}),d.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Choose the default backend and manage host-side runtime files."})]}),d.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:d.jsx(Ng,{})})]})}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 pt-5",children:d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsx("div",{className:"flex items-start justify-between gap-3",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Appearance"}),d.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Choose light, dark, or follow the system setting. Active: ",G,"."]})]})}),d.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:dR.map(q=>{const J=j===q.value;return d.jsxs("button",{type:"button",onClick:()=>e.setThemeMode(q.value),className:`block rounded-[1rem] border px-3 py-2.5 text-left transition ${J?"border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)]":"border-[var(--theme-border)] bg-[var(--theme-surface-strong)] hover:bg-[var(--theme-hover)]"}`,children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:q.label}),J?d.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Active"}):null]}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:q.description})]},q.value)})})]}),d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsx("div",{className:"flex items-start justify-between gap-3",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Workspace defaults"}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Git projects clone into dev home. New workspace directories can create one missing child under this path."})]})}),d.jsxs("div",{className:"mt-3 grid gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Workspace root"}),d.jsx("p",{title:(v==null?void 0:v.workspaceRoot)??"Loading workspace root",className:"mt-1 truncate rounded-[0.9rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-2 font-mono text-xs text-[var(--theme-fg-soft)]",children:S.loading&&!v?"Loading...":(v==null?void 0:v.workspaceRoot)??"Unavailable"})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"settings-dev-home",className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Dev home"}),d.jsxs("div",{className:"mt-1 flex flex-col gap-2 sm:flex-row",children:[d.jsx("input",{id:"settings-dev-home",value:S.devHomeDraft,onChange:q=>w(J=>({...J,devHomeDraft:q.target.value,message:null,error:null})),placeholder:"/Users/name/dev",className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-2 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),d.jsx("button",{type:"button","aria-label":"Save workspace defaults",onClick:()=>void _e(),disabled:S.loading||S.saving||!S.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:S.saving?"Saving...":"Save"})]})]})]}),S.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:S.error}):S.message?d.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:S.message}):null]}),d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Runtime controls"}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Inspect installed backend versions, install optional runtimes, or restart the selected backend."})]}),d.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:()=>void W(),disabled:o.busy||x.saving,className:"rounded-full border border-sky-400/35 bg-sky-400/10 px-3 py-1.5 text-xs font-medium text-sky-500 transition hover:bg-sky-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.busy?"Restarting...":"Restart"}),d.jsx("button",{type:"button",onClick:()=>void Q(),disabled:o.busy||x.saving,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"})]})]}),d.jsx("div",{className:"mt-3 grid gap-2",children:g.map(q=>{const J=q.installation,A=!J.installed&&!!J.installCommand,U=J.installed&&!!J.updateCommand,ee=x.saving&&x.operatingProvider===q.provider,D=A?"Install":"Update";return d.jsxs("div",{className:"flex flex-col gap-2 rounded-[0.95rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-2 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:q.displayName}),d.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-[0.16em] ${q.enabled?"border-emerald-400/35 bg-emerald-400/10 text-emerald-400":"border-[var(--theme-border)] bg-[var(--theme-muted)] text-[var(--theme-fg-muted)]"}`,children:q.enabled?"Ready":J.installed?q.status.state:"Not installed"})]}),d.jsxs("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:["Version: ",J.installedVersion??(J.installed?"Installed":"Unavailable"),J.latestVersion?` · Latest: ${J.latestVersion}`:""]}),J.lastError?d.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-rose-300",children:J.lastError}):null]}),A||U?d.jsx("button",{type:"button","aria-label":`${A?"Install":"Update"} ${q.displayName}`,onClick:()=>void me(q.provider,A?"install":"update"),disabled:o.busy||x.saving||!A&&!U,className:"shrink-0 rounded-full border border-[var(--theme-border-strong)] 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:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:ee?x.operatingAction==="install"?"Installing...":"Updating...":D}):null]},q.provider)})}),o.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:o.error}):o.message?d.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:o.message}):x.message?d.jsx("p",{className:`mt-2 whitespace-pre-line text-xs ${x.message.includes("requires attention")?"text-amber-300":"text-emerald-300"}`,children:x.message}):x.error?d.jsx("p",{className:"mt-2 whitespace-pre-line text-xs text-rose-300",children:x.error}):null]}),d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsx("div",{className:"flex items-start justify-between gap-3",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Provider host files"}),d.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:[P.displayName," exposes these editable files through its backend schema."]})]})}),d.jsxs("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:[ne.map(q=>{const J=r[q.name]??{path:q.name,exists:!1,originalContent:"",draftContent:"",loading:!1},A=J.draftContent!==J.originalContent;return d.jsx("button",{type:"button",onClick:()=>n(q.name),className:"block rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-left transition hover:bg-[var(--theme-hover)]",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:q.label}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:q.description})]}),d.jsx("div",{className:"shrink-0",children:J.loading?d.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-[var(--theme-fg-muted)]",children:"Loading"}):A?d.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Unsaved"}):J.exists?d.jsx("span",{className:"rounded-full border border-emerald-400/25 bg-emerald-400/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-emerald-600 dark:text-emerald-100",children:"Ready"}):d.jsx("span",{className:"rounded-full border border-sky-300/25 bg-sky-300/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-600 dark:text-sky-100",children:"New"})})]})},q.name)}),ne.length===0?d.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"This backend does not expose editable host files."}):null]})]}),$.configArchives?d.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Config archives"}),d.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Backup the selected backend host files, then apply a saved archive with a backend restart."})]}),d.jsx("button",{type:"button",onClick:()=>void se(),disabled:O.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:O.creating?"Creating...":"Create backup"})]}),O.error?d.jsx("p",{className:"mt-2 text-xs text-rose-300",children:O.error}):O.message?d.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:O.message}):null,d.jsx("div",{className:"mt-3 space-y-2",children:O.loading?d.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"Loading backups..."}):f.length===0?d.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No config backups yet."}):f.map(q=>{const J=O.renamingId===q.id;return d.jsx("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3",children:d.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[d.jsxs("div",{className:"min-w-0",children:[J?d.jsxs("div",{className:"flex max-w-xl gap-2",children:[d.jsx("input",{"aria-label":`Rename ${q.label}`,value:O.renameDraft,onChange:A=>R(U=>({...U,renameDraft:A.target.value,error:null,message:null})),className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),d.jsx("button",{type:"button","aria-label":`Save archive name ${q.label}`,onClick:()=>void ce(q),className:"rounded-full bg-[var(--theme-accent-solid)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"Save"}),d.jsx("button",{type:"button",onClick:()=>R(A=>({...A,renamingId:null,renameDraft:""})),className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)]",children:"Cancel"})]}):d.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:q.label}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[var(--theme-fg-muted)]",children:[d.jsxs("span",{children:["Created ",pR(q.createdAt)]}),ne.map(A=>{var U;return d.jsxs("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 font-mono",children:[A.name,": ",(U=q.files[A.name])!=null&&U.exists?"saved":"missing"]},A.name)})]})]}),d.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[d.jsx("button",{type:"button",onClick:()=>R(A=>({...A,renamingId:q.id,renameDraft:q.label,message:null,error:null})),disabled:J,className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:text-[var(--theme-fg-muted)]",children:"Rename"}),d.jsx("button",{type:"button",onClick:()=>void H(q),disabled:O.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:O.applyingId===q.id?"Applying...":"Apply"})]})]})},q.id)})})]}):null]})})]}),t&&l?d.jsx("div",{className:"pointer-events-none fixed inset-0 z-[71] flex items-center justify-center p-4",children:d.jsxs("div",{className:"pointer-events-auto relative z-10 flex max-h-[min(88vh,56rem)] w-full max-w-3xl flex-col overflow-hidden rounded-[1.6rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/25",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--theme-border)] px-4 py-3 sm:px-5",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:t}),d.jsx("p",{className:"mt-1 break-all font-mono text-xs text-[var(--theme-fg-muted)]",children:l.path})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[l.error?d.jsx("span",{className:"text-xs text-rose-300",children:l.error}):l.saveMessage?d.jsx("span",{className:"text-xs text-emerald-300",children:l.saveMessage}):null,d.jsx("button",{type:"button","aria-label":`Save ${t}`,onClick:()=>void de(t),disabled:l.loading||l.saving||l.draftContent===l.originalContent,className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-sm font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:l.saving?"Saving...":"Save"}),d.jsx("button",{type:"button","aria-label":"Close File Editor",onClick:()=>n(null),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:d.jsx(Ng,{})})]})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:d.jsx("textarea",{"aria-label":`Edit ${t}`,value:l.draftContent,onChange:q=>i(J=>({...J,[t]:{..._c(t),...J[t],draftContent:q.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 T0({eyebrow:e,title:t,description:n}){return d.jsxs("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 p-5 shadow-2xl shadow-stone-950/20",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:e}),d.jsx("h2",{className:"mt-3 text-xl font-semibold text-stone-100",children:t}),d.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]})}function xR(){const[e,t]=T.useState(null),[n,r]=T.useState(null);return T.useEffect(()=>{_6().then(t).catch(i=>{r(i instanceof Error?i.message:"Unable to load runtime config.")})},[]),d.jsx("div",{className:"min-h-screen bg-stone-950 px-4 py-8 text-stone-100 sm:px-6",children:d.jsx("div",{className:"mx-auto max-w-7xl",children:d.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[d.jsxs("section",{className:"rounded-[2rem] border border-stone-800 bg-stone-900 p-8 shadow-2xl shadow-stone-950/20 sm:p-10",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.35em] text-amber-300",children:"Local Supervisor"}),d.jsx("h1",{className:"mt-4 max-w-3xl text-4xl font-semibold tracking-tight text-stone-100 sm:text-6xl",children:"Bring your local workspaces into a mobile-ready control surface."}),d.jsx("p",{className:"mt-6 max-w-2xl text-base leading-7 text-stone-400 sm:text-lg",children:"Phase 1 focuses on a stable supervisor shell: runtime config, workspace onboarding, database bootstrap, and a read-only file tree that already respects workspace root boundaries."}),d.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[d.jsx(gi,{to:"/workspaces",className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200",children:"Enter Workspace Console"}),d.jsx(gi,{to:"/workspaces/new",className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:border-stone-500 hover:bg-stone-800",children:"Add First Workspace"})]})]}),d.jsxs("section",{className:"grid gap-4",children:[d.jsx(T0,{eyebrow:"Health",title:n?"API unavailable":"Supervisor reachable",description:n??`Connected to ${(e==null?void 0:e.appName)??"Remote Codex Supervisor"} ${(e==null?void 0:e.appVersion)??""}`.trim()}),d.jsx(T0,{eyebrow:"Workspace Root",title:(e==null?void 0:e.workspaceRoot)??"Loading root path",description:"The file tree and workspace creation flow stay inside this boundary in Phase 1."}),d.jsx(T0,{eyebrow:"Environment",title:(e==null?void 0:e.environment)??"Loading environment",description:e?`${e.host}:${e.port}`:"Runtime metadata appears here after bootstrap."})]})]})})})}function yR(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 ER(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function _R({open:e,busy:t=!1,turnsState:n,onCancel:r,onLoadTurns:i,onExport:l}){var j,G,N;const o=((j=n.data)==null?void 0:j.turns)??[],c=T.useMemo(()=>o.slice(0,10).map(P=>P.turnId),[o]),[f,h]=T.useState("latest"),[g,p]=T.useState(()=>new Set),[x,E]=T.useState(!0),[v,C]=T.useState("pdf");if(T.useEffect(()=>{e&&(h("latest"),C("pdf"),E(!0),i())},[i,e]),T.useEffect(()=>{e&&o.length>0&&p(new Set(c))},[c,e,o.length]),T.useEffect(()=>{if(!e)return;function P($){$.key==="Escape"&&!t&&r()}return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[t,r,e]),!e)return null;const S=f==="latest"?Math.min(10,((G=n.data)==null?void 0:G.totalTurnCount)??10):g.size,w=!t&&(f==="latest"||g.size>0);function O(P){p($=>{const ne=new Set($);return ne.has(P)?ne.delete(P):ne.add(P),ne})}function R(){const P={format:v,mode:f,...f==="latest"?{limit:10}:{turnIds:[...g]},profile:"review",options:{includeTokenAndPrice:x}};l(P)}return _u.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close export dialog",onClick:r,disabled:t,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Export transcript",className:"relative z-[1] flex max-h-[min(46rem,calc(100vh-2rem))] w-full max-w-2xl flex-col rounded-[1.6rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-stone-800 px-5 py-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-semibold text-stone-100",children:"Export transcript"}),d.jsx("p",{className:"mt-1 text-xs text-stone-500",children:"Default review copy summarizes command batches and file changes."})]}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,disabled:t,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[d.jsx("div",{className:"inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["latest","Latest 10"],["selected","Custom selection"]].map(([P,$])=>d.jsx("button",{type:"button",onClick:()=>h(P),className:`rounded-full px-3 py-1.5 text-sm transition ${f===P?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:$},P))}),d.jsx("div",{className:"mt-4 inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["pdf","PDF"],["html","HTML"]].map(([P,$])=>d.jsx("button",{type:"button",onClick:()=>C(P),className:`rounded-full px-3 py-1.5 text-sm transition ${v===P?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:$},P))}),f==="selected"?d.jsxs("div",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-stone-800 px-3 py-2.5",children:[d.jsxs("p",{className:"text-xs text-stone-400",children:["Selected ",g.size," of ",((N=n.data)==null?void 0:N.totalTurnCount)??o.length]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:()=>p(new Set(o.map(P=>P.turnId))),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Select all"}),d.jsx("button",{type:"button",onClick:()=>p(new Set),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Clear"})]})]}),n.status==="loading"?d.jsx("p",{className:"px-3 py-6 text-sm text-stone-400",children:"Loading turns..."}):n.status==="failed"?d.jsx("p",{className:"px-3 py-6 text-sm text-rose-100",children:n.error}):d.jsx("div",{className:"max-h-80 overflow-auto p-2",children:o.map(P=>d.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition hover:bg-stone-800/70",children:[d.jsx("input",{type:"checkbox",checked:g.has(P.turnId),onChange:()=>O(P.turnId),className:"h-4 w-4 accent-amber-300"}),d.jsxs("span",{className:"shrink-0 text-xs font-medium text-stone-300",children:["Turn ",P.turnNumber]}),d.jsx("span",{className:"shrink-0 text-xs text-stone-500",children:yR(P.startedAt)}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-stone-200",children:P.userPromptPreview}),d.jsx("span",{className:"hidden shrink-0 rounded-full border border-stone-700 px-2 py-0.5 text-[10px] text-stone-400 sm:inline",children:ER(P.status)})]},P.turnId))})]}):d.jsx("p",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40 px-3 py-3 text-sm text-stone-300",children:"Exports the latest 10 turns in chronological order."}),d.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-stone-300 sm:grid-cols-2",children:[d.jsxs("label",{className:"flex items-center gap-2 rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2",children:[d.jsx("input",{type:"checkbox",checked:x,onChange:P=>E(P.target.checked),className:"h-4 w-4 accent-amber-300"}),"Token and price"]}),d.jsx("p",{className:"flex items-center rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2 text-xs text-stone-500",children:v==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-stone-800 px-5 py-4",children:[d.jsxs("p",{className:"min-w-0 text-xs text-stone-500",children:[S," ",S===1?"turn":"turns"," will be exported."]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),d.jsx("button",{type:"button",onClick:R,disabled:!w,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:t?"Exporting...":`Export ${v.toUpperCase()}`})]})]})]})]}),document.body)}function M1({open:e,title:t,description:n,confirmLabel:r="Delete",busy:i=!1,onCancel:l,onConfirm:o}){return T.useEffect(()=>{if(!e)return;function c(f){f.key==="Escape"&&!i&&l()}return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[i,l,e]),e?_u.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:l,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),d.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:l,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),d.jsx("button",{type:"button",onClick:()=>void o(),disabled:i,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:i?"Deleting...":r})]})]})]}),document.body):null}const ah=[{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:""}],v0=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function C2(e){return e.replace(/\u00a0/g," ")}function TR(e){if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,t.textContent??""}function vR(e){return!!e.querySelector("[style], font")}function kR(e,t){if(!e)return[];const n=[],r=[...t].sort((o,c)=>c.placeholder.length-o.placeholder.length);let i=0,l=0;for(;i<e.length;){const o=r.find(h=>e.startsWith(h.placeholder,i));if(o){n.push({type:"attachment",key:`${o.clientId}-${i}`,attachment:o}),i+=o.placeholder.length;continue}let c=e.length;for(const h of r){const g=e.indexOf(h.placeholder,i);g!==-1&&g<c&&(c=g)}const f=e.slice(i,c);f&&(n.push({type:"text",key:`text-${l}`,text:f}),l+=1),i=c}return n}function S2(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function wR(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"m4 5 2 2-2 2"}),d.jsx("path",{d:"M7.75 9.5h4.25"})]})}function CR(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:d.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function SR(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),d.jsx("path",{d:"M4.25 5.25h2.25"}),d.jsx("path",{d:"M9.5 10.75h2.25"})]})}function NR(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function AR(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function RR(e){var t;return((t=ah.find(n=>n.value===e))==null?void 0:t.label)??e}function LR(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 IR(e){switch(e){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function OR(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 DR(e){return e.source==="user"?"global":e.source==="project"?"project":null}function N2(e){const t=DR(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 jR(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function MR(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 PR(e){if(!e)return"";const t=e/1e3;return Number.isInteger(t)?String(t):String(Number(t.toFixed(1)))}function Rg(e){return e.replace(/\r\n/g,`
64
+ `)}function BR(e){const t=e.trim();return/^[A-Za-z0-9_-]+$/.test(t)?t:null}function UR(e){const n=Rg(e).split(`
65
+ `).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 HR(e,t){return`[mcp_servers.${e}]
66
+ url = ${JSON.stringify(t.trim())}
67
+ `}function A2(e,t,n){var p,x;const r=Rg(e),i=`${Rg(n).trim()}
68
+ `,l=r.split(`
69
+ `),o=`[mcp_servers.${t}]`,c=`[mcp_servers.${t}.`;let f=-1,h=l.length;for(let E=0;E<l.length;E+=1)if((((p=l[E])==null?void 0:p.trim())??"")===o){f=E;break}if(f>=0){for(let C=f+1;C<l.length;C+=1){const S=((x=l[C])==null?void 0:x.trim())??"";if(S.startsWith("[")&&!(S===o||S.startsWith(c))){h=C;break}}const E=l.slice(0,f).join(`
70
+ `).trimEnd(),v=l.slice(h).join(`
71
+ `).trim();return[E,i.trimEnd(),v].filter(Boolean).join(`
72
+
73
+ `).replace(/\n{3,}/g,`
74
+
75
+ `).concat(`
76
+ `)}const g=r.trimEnd();return g?`${g}
77
+
78
+ ${i}`:i}function mk(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function k0(e){const t=e/1e3;return Number.isInteger(t)?`${t}k`:`${Number(t.toFixed(1))}k`}function FR(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,`${k0(n)} used / ${k0(r)}`,`${k0(i)} left`,`${mk(t.remainingPercent)}% context left`].join(" · ")}function zR({contextUsage:e}){const t=(e==null?void 0:e.availability)??"unavailable",n=mk(e==null?void 0:e.remainingPercent);if(t!=="available")return null;const r=n<=20?"rgba(251,113,133,0.90)":n<=40?"rgba(252,211,77,0.85)":"rgba(125,211,252,0.80)";return d.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-track pointer-events-none mt-0.5 block",children:d.jsx("span",{className:"thread-context-progress-fill block",style:{width:`${n}%`,backgroundColor:r}})})}function R2(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 L2(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function w0(e){return e.type.startsWith("image/")?"photo":"file"}function Lg(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 I2(e,t){return Lg(e,t).length>0}function Vl(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function $R(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function O2(e){const t=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return t!=null&&t[1]?t[1]:$R(e.originalName)}function VR(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function GR(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[d.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),d.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),d.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function C0(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5.5 3.25h5"}),d.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Gl({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return d.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:e})}function S0({activeView:e,edgeToEdgeMobile:t=!1,busy:n=!1,settingsBusy:r=!1,compactBusy:i=!1,error:l,model:o=null,reasoningEffort:c=null,fastMode:f=!1,collaborationMode:h="default",modelOptions:g=[],contextUsage:p=null,capabilities:x=null,toolboxItems:E=null,hookCommandTemplates:v=null,mcpConfigFormat:C="none",followTail:S=!1,threadConnected:w=!0,disabled:O=!1,disabledPlaceholder:R,shellControlState:j=null,draftPrompt:G,draftAttachments:N,skillsState:P={status:"idle",data:null,error:null},mcpState:$={status:"idle",data:null,error:null},hooksState:ne={status:"idle",data:null,error:null},goalState:W={status:"idle",data:null,error:null},forkTurnOptionsState:me={status:"idle",data:null,error:null},onDraftChange:Q,onSubmit:_e,onInterrupt:de,onCompact:se,onOpenSkills:H,onOpenMcp:ce,onOpenHooks:q,onCreateHook:J,onUpdateHook:A,onTrustHook:U,onUntrustHook:ee,onOpenGoal:D,onUpdateGoal:Te,onOpenForkTurns:we,onForkLatest:Se,onForkTurn:Ve,onReadProviderConfig:et,onWriteProviderConfig:Be,onToggleFollow:Ft,onUpdateSettings:at,onToggleView:gt,onShellCopy:Kt,onShellControl:Ue,canInterrupt:kt=!1}){var $s,Vs,Ni,_d,Ou,Du,ju,Mu,Pu,Gs,Td,vd,kd;const[nt,on]=T.useState({prompt:"",attachments:[]}),[$e,He]=T.useState(null),[Rt,un]=T.useState("root"),[cn,Vn]=T.useState("list"),[Tt,er]=T.useState("list"),[ge,Ne]=T.useState("project"),Re=T.useMemo(()=>({fast:(x==null?void 0:x.controls.performanceMode)??!1,compact:(x==null?void 0:x.turns.compact)??!1,goal:(x==null?void 0:x.controls.goals)??!1,fork:(x==null?void 0:x.branching.fork)??!1,skills:(x==null?void 0:x.management.skills)??!1,mcp:(x==null?void 0:x.management.mcpStatus)??!1,hooks:(x==null?void 0:x.management.hooks)??!1,hostConfigFiles:(x==null?void 0:x.management.hostConfigFiles)??!1,mcpConfigEditing:C==="codex-toml"&&!!(x!=null&&x.management.hostConfigFiles)&&!!et&&!!Be,hookTrust:(x==null?void 0:x.management.hookTrust)??!1,planMode:(x==null?void 0:x.controls.planMode)??!1}),[x,C,et,Be]),st=T.useMemo(()=>(E??[]).filter(I=>{switch(I.action){case"fast":return Re.fast;case"compact":return Re.compact;case"goal":return Re.goal;case"fork":return Re.fork;case"skills":return Re.skills;case"mcp":return Re.mcp;case"hooks":return Re.hooks;default:return!1}}),[Re,E]),xt=T.useMemo(()=>{const I=new Map;for(const ie of v??[])I.set(ie.eventName,ie.command);return I},[v]),dn=I=>xt.get(I)??xt.get("preToolUse")??v0,Ln=T.useMemo(()=>new Set([v0,...xt.values()]),[xt]),[ye,ze]=T.useState("preToolUse"),[tt,Me]=T.useState("Bash"),[ft,Vt]=T.useState(v0),[Ze,X]=T.useState("30"),[Le,Pe]=T.useState("Running hook"),[Xe,ut]=T.useState(null),[Lt,Gt]=T.useState(!1),[pt,it]=T.useState(null),[Nn,Un]=T.useState(null),[nn,yi]=T.useState(""),[us,ya]=T.useState(""),[In,gl]=T.useState(""),[bl,Ir]=T.useState(null),[bn,An]=T.useState(!1),[Va,tr]=T.useState(null),[Ns,Gr]=T.useState(null),[cs,Ga]=T.useState(null),[Or,On]=T.useState(!1),[Gn,Ea]=T.useState(!1),[_a,_n]=T.useState(""),[zt,qr]=T.useState(!1),[aa,xr]=T.useState(null),[xl,As]=T.useState(null),Dr=T.useRef(null),Ta=T.useRef(null),Rs=T.useRef(null),qa=T.useRef(null),qn=T.useRef(null),nr=T.useRef([]),fr=T.useRef(null),ds=T.useRef(new Map),Ls=T.useRef(""),Ei=T.useRef(0),Zt=e==="shell",yl=!!(Zt&&(j!=null&&j.isMobileShell)),rr=(j==null?void 0:j.promptLabel)??null,[Ya,_i]=T.useState({}),[Ti,jr]=T.useState(!1),[Is,El]=T.useState(0),Mr=!Zt&&G!==void 0&&N!==void 0&&typeof Q=="function",Xt=Mr?G:nt.prompt,xn=Mr?N:nt.attachments,vi=xl??h;T.useEffect(()=>{As(null)},[h]),T.useEffect(()=>{$e!=="slash"&&(un("root"),Vn("list"),tr(null),Gr(null),er("list"),it(null),Un(null))},[$e]),T.useEffect(()=>{Rt!=="mcp"&&(Vn("list"),tr(null),Gr(null))},[Rt]),T.useEffect(()=>{Rt!=="forkTurns"&&On(!1)},[Rt]),T.useEffect(()=>{Rt!=="hooks"&&(er("list"),it(null),Un(null))},[Rt]),T.useEffect(()=>{const I=ah.find(ie=>ie.value===ye);Me(ie=>{const ve=ie.trim(),qe=new Set(ah.map(Ke=>Ke.matcherHint).filter(Boolean));return ve&&!qe.has(ve)?ie:(I==null?void 0:I.matcherHint)??""}),Vt(ie=>Ln.has(ie.trim())?dn(ye):ie)},[Ln,ye,xt]),T.useEffect(()=>{if(!cs)return;const I=window.setTimeout(()=>{Ga(ie=>ie===cs?null:ie)},1400);return()=>{window.clearTimeout(I)}},[cs]);function Pr(I){if(Mr){Q==null||Q(ie=>I({prompt:ie.prompt,attachments:ie.attachments}));return}on(ie=>I(ie))}function Iu(I){Pr(ie=>{if(typeof I=="function"){const ve=I(ie.prompt,ie.attachments);return{prompt:ve.prompt,attachments:ve.attachments??ie.attachments}}return{prompt:I,attachments:ie.attachments}})}async function _l(I){try{await navigator.clipboard.writeText(`$${I}`),Ga(I)}catch{Ga(null)}}async function fs(){if(Se){On(!0);try{await Se(),He(null)}finally{On(!1)}}}async function Br(I){if(Ve){On(!0);try{await Ve(I),He(null)}finally{On(!1)}}}async function Tl(){const I=Xt.trim();if(!I){xr("Goal objective cannot be empty.");return}const ie=_a.trim(),ve=MR(ie);if(ie.length>0&&(ve===null||!Number.isInteger(ve)||ve<=0)){xr("Token budget must be a positive number in thousands.");return}if(!Te){xr("/goal is unavailable in this view.");return}qr(!0),xr(null);try{await Te({objective:I,status:"active",tokenBudget:ve}),_n(""),Ea(!1),Pr(()=>({prompt:"",attachments:[]}))}catch(qe){xr(qe instanceof Error?qe.message:"Unable to set goal.")}finally{qr(!1)}}function ki(){var I;He(null),un("root"),Ea(!0),_n(PR((I=W.data)==null?void 0:I.tokenBudget)),xr(null),D==null||D(),requestAnimationFrame(()=>{var ie;(ie=Ta.current)==null||ie.focus()})}function Wa(){Ea(!1),xr(null)}const va=T.useMemo(()=>g.find(I=>I.model===o)??null,[o,g]),Os=FR(o,p),Qa=(va==null?void 0:va.supportedReasoningEfforts)??[],Ds=T.useMemo(()=>kR(Xt,xn),[xn,Xt]),Yr=T.useMemo(()=>Object.entries(Ya).sort(([I],[ie])=>I.localeCompare(ie)).map(([I,ie])=>`${I}:${ie}`).join("|"),[Ya]);async function yr(){if(!Re.hostConfigFiles||!et)throw new Error("Provider config editing is unavailable for this thread.");const I=await et();return Ir(I.path),I}async function js(I){if(!Re.hostConfigFiles||!Be)throw new Error("Provider config editing is unavailable for this thread.");const ie=await Be(I);return Ir(ie.path),ie}function Ms(I){switch(I.action){case"fast":return f?"On":"Off";case"compact":return i?"Busy":"Run";case"goal":return Gn?"Composing":W.data?jR(W.data.status):"Open";case"fork":return n?"Idle only":"Open";case"skills":case"mcp":case"hooks":return"View";default:return""}}function ka(I){switch(I.action){case"fast":return r;case"compact":return i||n;case"fork":return n||Or;default:return!1}}function vl(I){var ve;return`${I.action==="fast"&&f||I.action==="goal"&&(Gn||((ve=W.data)==null?void 0:ve.status)==="active")?"ui-status-warning":"thread-composer-menu-item"} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`}function wi(I,ie){switch(ie.stopPropagation(),I.action){case"fast":Bt({fastMode:!f});break;case"compact":He(null),se==null||se();break;case"goal":Gn?(Wa(),He(null)):ki();break;case"fork":un("fork");break;case"skills":un("skills"),H==null||H();break;case"mcp":un("mcp"),ce==null||ce();break;case"hooks":un("hooks"),q==null||q();break}}function xo(){ut(null),Ne("project"),ze("preToolUse"),Me("Bash"),Vt(dn("preToolUse")),X("30"),Pe("Running hook")}function Ps(I){const ie=N2(I);if(!ie){it("Only command hooks in global or project hooks.json can be edited here.");return}ut(ie),Ne(ie.scope),ze(ie.eventName),Me(ie.matcher??""),Vt(ie.command),X(ie.timeoutSec?String(ie.timeoutSec):""),Pe(ie.statusMessage??""),it(null),Un(null),er("edit")}async function Ci(){const I=BR(nn),ie=us.trim();if(!I){tr("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(ie)){tr("HTTP MCP URL must start with http:// or https://");return}An(!0),tr(null),Gr(null);try{const ve=await yr(),qe=A2(ve.content,I,HR(I,ie));await js(qe),Gr("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Vn("list"),yi(""),ya(""),ce==null||ce()}catch(ve){tr(ve instanceof Error?ve.message:"Unable to update provider config.")}finally{An(!1)}}async function yo(){An(!0),tr(null),Gr(null);try{await yr(),In.trim()||gl(`[mcp_servers.example_stdio]
79
+ command = "npx"
80
+ args = ["-y", "your-mcp-server"]
81
+ `),Vn("stdio")}catch(I){tr(I instanceof Error?I.message:"Unable to load provider config.")}finally{An(!1)}}async function Dn(){const I=UR(In);if(!I){tr("The raw MCP block must start with a header like [mcp_servers.name].");return}An(!0),tr(null),Gr(null);try{const ie=await yr(),ve=A2(ie.content,I,In);await js(ve),Gr("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Vn("list"),ce==null||ce()}catch(ie){tr(ie instanceof Error?ie.message:"Unable to update provider config.")}finally{An(!1)}}async function Wr(){if(Tt==="edit"&&!A){it("Hook editing is unavailable in this view.");return}if(Tt!=="edit"&&!J){it("Hook editing is unavailable in this view.");return}if(Tt==="edit"&&!Xe){it("Select a hook to edit first.");return}const I=ft.trim();if(!I){it("Hook command cannot be empty.");return}const ie=Ze.trim(),ve=ie?Number(ie):null;if(ie&&(ve===null||!Number.isInteger(ve)||ve<=0)){it("Timeout must be a positive number of seconds.");return}Gt(!0),it(null),Un(null);try{const qe={scope:ge,eventName:ye,matcher:tt.trim()||null,command:I,timeoutSec:ve,statusMessage:Le.trim()||null};Tt==="edit"?await(A==null?void 0:A({...qe,target:Xe})):await(J==null?void 0:J(qe)),Un(`${ge==="project"?"Project":"Global"} hook ${Tt==="edit"?"updated":"written"} in hooks.json and trusted.`),er("list"),ut(null)}catch(qe){it(qe instanceof Error?qe.message:"Unable to write hooks.json.")}finally{Gt(!1)}}async function Bs(I){if(!U||!I.currentHash){it("Hook trust is unavailable in this view.");return}Gt(!0),it(null),Un(null);try{await U({key:I.key,currentHash:I.currentHash}),Un("Hook trusted.")}catch(ie){it(ie instanceof Error?ie.message:"Unable to trust hook.")}finally{Gt(!1)}}async function wa(I){if(!ee){it("Hook trust is unavailable in this view.");return}Gt(!0),it(null),Un(null);try{await ee({key:I.key}),Un("Hook untrusted.")}catch(ie){it(ie instanceof Error?ie.message:"Unable to untrust hook.")}finally{Gt(!1)}}T.useEffect(()=>{if(Zt){_i({});return}const I={},ie=new Set;for(const ve of xn){if(ve.kind!=="photo")continue;ie.add(ve.clientId);let qe=ds.current.get(ve.clientId);qe||(qe=URL.createObjectURL(ve.file),ds.current.set(ve.clientId,qe)),I[ve.clientId]=qe}for(const[ve,qe]of ds.current.entries())ie.has(ve)||(URL.revokeObjectURL(qe),ds.current.delete(ve));_i(I)},[xn,Zt]),T.useEffect(()=>()=>{for(const I of ds.current.values())URL.revokeObjectURL(I);ds.current.clear()},[]);function Xa(){const I=Ta.current,ie=window.getSelection();if(!I||!ie||ie.rangeCount===0)return null;const ve=ie.getRangeAt(0);return!I.contains(ve.startContainer)||!I.contains(ve.endContainer)?null:{start:Si(I,ve.startContainer,ve.startOffset),end:Si(I,ve.endContainer,ve.endOffset)}}function Si(I,ie,ve){var Dt;let qe=null,Ke=ve;if(ie===I){const wt=Array.from(I.childNodes);let rn=0;for(let Yn=0;Yn<Math.min(ve,wt.length);Yn+=1){const qt=wt[Yn];qt&&(rn+=Vl(qt).length)}return rn}if(ie.nodeType===Node.TEXT_NODE)qe=ie;else{const wt=Array.from(I.childNodes).find(rn=>rn.contains(ie));if(!wt)return Fs().length;if(qe=wt,wt instanceof HTMLElement&&wt.dataset.segmentType==="attachment"){const rn=document.createRange();rn.selectNodeContents(wt);const Yn=Vl(wt).length;try{rn.setEnd(ie,ve);const qt=rn.toString().length,Ca=((Dt=wt.textContent)==null?void 0:Dt.length)??0;Ca===0?Ke=Yn:Ke=Math.round(Math.min(1,qt/Ca)*Yn)}catch{Ke=Yn}}else{const rn=document.createRange();rn.selectNodeContents(wt);try{rn.setEnd(ie,ve),Ke=rn.toString().length}catch{Ke=Vl(wt).length}}}const ct=Array.from(I.childNodes);let mt=0;for(const wt of ct){if(wt===qe)return wt.nodeType===Node.TEXT_NODE?mt+Ke:mt+Math.min(Ke,Vl(wt).length);mt+=Vl(wt).length}return mt}function Us(I,ie){let ve=Math.max(0,ie);const qe=Array.from(I.childNodes);for(const[Ke,ct]of qe.entries()){const Dt=Vl(ct).length;if(ct.nodeType===Node.TEXT_NODE){if(ve<=Dt)return{node:ct,offset:ve};ve-=Dt;continue}if(ct instanceof HTMLElement&&ct.dataset.segmentType==="attachment"){if(ve===0)return{node:I,offset:Ke};if(ve<=Dt){const wt=qe[Ke+1];return ve===Dt&&(wt==null?void 0:wt.nodeType)===Node.TEXT_NODE?{node:wt,offset:0}:{node:I,offset:Ke+1}}ve-=Dt;continue}if(ve<=Dt)return{node:I,offset:Ke+1};ve-=Dt}return{node:I,offset:I.childNodes.length}}function Ka(I){const ie=Ta.current;if(!ie||!I)return;const ve=Us(ie,I.start),qe=Us(ie,I.end),Ke=document.createRange();Ke.setStart(ve.node,ve.offset),Ke.setEnd(qe.node,qe.offset);const ct=window.getSelection();ct==null||ct.removeAllRanges(),ct==null||ct.addRange(Ke)}function Hs(I){const ie=nr.current;if(ie.length===0)return!1;const ve=ie.at(-1);if(!ve)return!1;const qe=Array.from(I.childNodes).find(Dt=>Dt instanceof HTMLElement&&Dt.dataset.segmentType==="attachment"&&Dt.dataset.clientId===ve);if(!(qe instanceof HTMLElement))return!1;const Ke=document.createRange(),ct=qe.nextSibling;(ct==null?void 0:ct.nodeType)===Node.TEXT_NODE?Ke.setStart(ct,0):Ke.setStartAfter(qe),Ke.collapse(!0);const mt=window.getSelection();return mt==null||mt.removeAllRanges(),mt==null||mt.addRange(Ke),!0}function Fs(){const I=Ta.current;if(!I)return Xt;let ie="";for(const ve of Array.from(I.childNodes))ie+=Vl(ve);return C2(ie)}function Eo(I,ie,ve){const qe=I==="photo"?"PHOTO":"FILE";let Ke=0;for(;;){const ct=Ke===0?ie:`${ie} (${Ke+1})`,mt=`[${qe} ${ct}]`;if(!ve.has(mt))return mt;Ke+=1}}function kl(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function wl(I,ie,ve){const qe=ie.start>0?I[ie.start-1]:"",Ke=ie.end<I.length?I[ie.end]:"",ct=!!(qe&&!/\s/.test(qe)),mt=!Ke||!/\s/.test(Ke);return`${ct?" ":""}${ve.join(" ")}${mt?" ":""}`}function zs(I,ie){if(!I||I.length===0)return;const ve=Array.from(I),qe=new Set(xn.map(qt=>qt.placeholder)),Ke=ve.map(qt=>{const Ca=R2(qt,ie),Sl=Eo(ie,L2(Ca),qe);return qe.add(Sl),{clientId:kl(),kind:ie,originalName:Ca,placeholder:Sl,file:qt}}),ct=Xa()??fr.current,mt=ct?{start:ct.start,end:ct.end}:{start:Xt.length,end:Xt.length},Dt=wl(Xt,mt,Ke.map(qt=>qt.placeholder)),wt=`${Xt.slice(0,mt.start)}${Dt}${Xt.slice(mt.end)}`;Pr(qt=>({prompt:wt,attachments:[...qt.attachments,...Ke]}));const rn=Dt.endsWith(" ")?1:0,Yn=mt.start+Dt.length-rn;qn.current={start:Yn,end:Yn},fr.current={start:Yn,end:Yn},nr.current=Ke.map(qt=>qt.clientId),He(null)}function _o(I){if(I.length===0)return;const ie={photo:I.filter(qt=>w0(qt)==="photo"),file:I.filter(qt=>w0(qt)==="file")},ve=[...ie.photo,...ie.file],qe=new Set(xn.map(qt=>qt.placeholder)),Ke=ve.map(qt=>{const Ca=w0(qt),Sl=R2(qt,Ca),wd=Eo(Ca,L2(Sl),qe);return qe.add(wd),{clientId:kl(),kind:Ca,originalName:Sl,placeholder:wd,file:qt}}),ct=Xa()??fr.current,mt=ct?{start:ct.start,end:ct.end}:{start:Xt.length,end:Xt.length},Dt=wl(Xt,mt,Ke.map(qt=>qt.placeholder)),wt=`${Xt.slice(0,mt.start)}${Dt}${Xt.slice(mt.end)}`;Pr(qt=>({prompt:wt,attachments:[...qt.attachments,...Ke]}));const rn=Dt.endsWith(" ")?1:0,Yn=mt.start+Dt.length-rn;qn.current={start:Yn,end:Yn},fr.current={start:Yn,end:Yn},nr.current=Ke.map(qt=>qt.clientId),He(null)}function Cl(I){if(!I)return;const ie=Xa()??fr.current,ve=(ie==null?void 0:ie.start)??Xt.length,qe=(ie==null?void 0:ie.end)??ve,Ke=C2(I),ct=`${Xt.slice(0,ve)}${Ke}${Xt.slice(qe)}`;Pr(Dt=>({prompt:ct,attachments:Dt.attachments}));const mt=ve+Ke.length;qn.current={start:mt,end:mt},fr.current={start:mt,end:mt}}T.useEffect(()=>{function I(ie){(typeof ie.composedPath=="function"?ie.composedPath():[]).some(Ke=>Ke instanceof HTMLElement&&(Ke.dataset.composerMenuSurface==="true"||Ke.dataset.composerMenuTrigger==="true"))||$e&&He(null)}if($e)return window.addEventListener("pointerdown",I),()=>{window.removeEventListener("pointerdown",I)}},[$e]),T.useLayoutEffect(()=>{const I=Ta.current;if(!I||Zt)return;const ie=qn.current,ve=Fs()!==Xt||Ls.current!==Yr||Ei.current!==Is;if(ve){const qe=document.createDocumentFragment();for(const Ke of Ds){if(Ke.type==="text"){qe.append(document.createTextNode(Ke.text===" "?" ":Ke.text));continue}const ct=Ke.attachment,mt=document.createElement("span");if(mt.dataset.segmentType="attachment",mt.dataset.clientId=ct.clientId,mt.dataset.placeholder=ct.placeholder,mt.contentEditable="false",mt.className="mx-[0.12rem] inline-flex max-w-full align-baseline",ct.kind==="photo"){mt.classList.add("rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const Dt=Ya[ct.clientId];if(Dt){const rn=document.createElement("img");rn.src=Dt,rn.alt=ct.originalName||"Pasted image",rn.className="h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",rn.draggable=!1,mt.append(rn)}else{const rn=document.createElement("span");rn.className="inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",rn.setAttribute("aria-hidden","true"),mt.append(rn)}const wt=document.createElement("span");wt.className="ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",wt.textContent=O2(ct),mt.append(wt)}else{mt.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 Dt=document.createElement("span");Dt.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]",Dt.textContent="FILE";const wt=document.createElement("span");wt.className="inline-flex max-w-[10rem] truncate",wt.textContent=O2(ct),mt.append(Dt,wt)}qe.append(mt)}I.replaceChildren(qe),Ls.current=Yr,Ei.current=Is}ie!==null?(I.focus(),Hs(I)||Ka(ie),fr.current=ie):document.activeElement===I&&ve&&Ka(fr.current),qn.current=null,nr.current=[]},[Ya,Is,Zt,Yr,Xt,Ds]);function z(){var I;(I=Ta.current)==null||I.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function K(){var I;if(z(),He(null),!!((I=navigator.clipboard)!=null&&I.readText))try{const ie=await navigator.clipboard.readText();Cl(ie)}catch{return}}async function re(){if(Gn&&!Zt){await Tl();return}if(!Zt&&!Xt.trim())return;const I=Zt?Xt:Xt.trim(),ie=Zt?[]:xn.filter(ve=>I.includes(ve.placeholder));await _e(ie.length>0?{prompt:I,attachments:ie}:{prompt:I}),Pr(()=>({prompt:"",attachments:[]}))}async function Ie(I){I.preventDefault(),await re()}function je(){const I=Fs(),ie=Xa();fr.current=ie;const ve=Ta.current;(ve?vR(ve):!1)&&(qn.current=ie,El(Ke=>Ke+1)),Pr(Ke=>({prompt:I,attachments:Ke.attachments.filter(ct=>I.includes(ct.placeholder))}))}function Je(I){var ve,qe,Ke,ct;const ie=Lg((ve=I.clipboardData)==null?void 0:ve.items,(qe=I.clipboardData)==null?void 0:qe.files);if(ie.length===0){const mt=((Ke=I.clipboardData)==null?void 0:Ke.getData("text/plain"))??"",Dt=((ct=I.clipboardData)==null?void 0:ct.getData("text/html"))??"",wt=mt||TR(Dt);if(!wt&&!Dt)return;I.preventDefault(),Cl(wt);return}I.preventDefault(),_o(ie)}function Et(I){var ie,ve;I2((ie=I.dataTransfer)==null?void 0:ie.items,(ve=I.dataTransfer)==null?void 0:ve.files)&&(I.preventDefault(),jr(!0))}function jn(I){var ie,ve;I2((ie=I.dataTransfer)==null?void 0:ie.items,(ve=I.dataTransfer)==null?void 0:ve.files)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),jr(!0))}function De(I){I.currentTarget.contains(I.relatedTarget)||jr(!1)}function Rn(I){var ve,qe;const ie=Lg((ve=I.dataTransfer)==null?void 0:ve.items,(qe=I.dataTransfer)==null?void 0:qe.files);ie.length!==0&&(I.preventDefault(),jr(!1),_o(ie))}function ar(I){I.key==="Enter"&&(!I.metaKey&&!I.ctrlKey||(I.preventDefault(),!(n||O)&&re()))}async function Bt(I){const ie=xl;I.collaborationMode&&As(I.collaborationMode);try{await(at==null?void 0:at(I)),He(null)}catch(ve){throw I.collaborationMode&&As(ie),ve}}const Nt=Gn?"Describe the goal the backend should continue working toward...":R??(Zt?"Send shell input to the attached terminal...":"Ask the backend to inspect, modify, or explain code..."),ke=Zt?"Send Ctrl-C":"Stop Current Turn",Fe=Gn?zt?"Setting...":"Set goal":!w&&n?"Connecting...":w&&n&&!Zt?"Sending...":"Send",ht=w?Gn?"ui-action-info":"ui-action-primary":"ui-action-danger",fn=r,bt=fn||Qa.length===0,an=f?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":Qa.length===0?"The selected model does not expose adjustable reasoning effort.":"Select reasoning effort",Er=t||yl?"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",sr=`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] ${Ti?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":"border-stone-700 focus-within:border-[var(--theme-accent-border)]"}`;return d.jsxs("div",{className:"relative z-20 shrink-0",children:[d.jsx("input",{ref:Rs,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{zs(I.target.files,"photo"),I.target.value=""}}),d.jsx("input",{ref:qa,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{zs(I.target.files,"file"),I.target.value=""}}),e==="chat"&&d.jsx("button",{type:"button","aria-label":"Jump to latest",title:S?"Latest turn is in view":"Jump to the latest messages",onClick:()=>Ft==null?void 0:Ft(),className:"absolute left-1/2 top-3 z-40 inline-flex h-9 min-w-[5.75rem] -translate-x-1/2 -translate-y-[62%] items-start justify-center bg-transparent pt-1 touch-manipulation sm:top-4",children:d.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${S?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m4 6 4 4 4-4"})})})}),d.jsxs("form",{ref:Dr,onSubmit:Ie,className:Er,children:[d.jsxs("div",{className:"thread-composer-toolbar relative z-30 mb-0 flex items-center gap-2 rounded-full border px-2.5 py-1.5 text-xs shadow-lg shadow-stone-950/8",children:[d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!Zt&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>He(I=>I==="slash"?null:"slash"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:d.jsx(SR,{})}),$e==="slash"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl",onClick:I=>{I.stopPropagation()},onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:Rt==="root"?d.jsxs("div",{className:"p-2",children:[st.map((I,ie)=>d.jsx("button",{type:"button",disabled:ka(I),onClick:ve=>wi(I,ve),className:`${vl(I)} ${ie===0?"mt-0":""}`,title:I.description??I.label,children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{children:I.command}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Ms(I)})]})},`${I.action}:${I.command}`)),st.length===0?d.jsx("p",{className:"px-3 py-2 text-sm text-stone-400",children:"No backend tools are available for this thread."}):null]}):d.jsx("div",{className:"max-h-80 overflow-auto",children:Rt==="fork"?d.jsxs("div",{className:"p-2",children:[d.jsx("button",{type:"button",disabled:n||Or,onClick:()=>void fs(),className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{children:"Fork from latest"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Or?"Forking":"Run"})]})}),d.jsx("button",{type:"button",disabled:n||Or,onClick:I=>{I.stopPropagation(),un("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:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{children:"Fork from selected turn"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?d.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]}):Rt==="forkTurns"?d.jsxs("div",{className:"p-2",children:[me.status==="loading"&&!me.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns…"}):null,me.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:me.error}):null,($s=me.data)!=null&&$s.length?d.jsx("div",{className:"space-y-2",children:me.data.map(I=>d.jsx("button",{type:"button",disabled:Or,onClick:()=>void Br(I.turnId),className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",I.turnIndex]}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:Or?"Forking":I.status})]})},I.turnId))}):null,me.status!=="loading"&&!me.error&&(((Vs=me.data)==null?void 0:Vs.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]}):Rt==="skills"?d.jsxs("div",{className:"p-2",children:[P.status==="loading"&&!P.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills…"}):null,P.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:P.error}):null,(Ni=P.data)!=null&&Ni.skills.length?d.jsx("div",{className:"space-y-2",children:P.data.skills.map(I=>{var ie,ve;return d.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((ie=I.interface)==null?void 0:ie.displayName)??I.name}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:AR(I.scope)}),d.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${cs===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 _l(I.name),title:`Copy $${I.name}`,"aria-label":`Copy $${I.name}`,children:[d.jsx(C0,{}),"$",I.name]})]}),d.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((ve=I.interface)==null?void 0:ve.shortDescription)??I.shortDescription??I.description})]})},I.path)})}):null,(_d=P.data)!=null&&_d.errors.length?d.jsx("div",{className:"mt-2 space-y-2",children:P.data.errors.map(I=>d.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[d.jsx("p",{className:"font-medium",children:I.message}),d.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,P.status!=="loading"&&!P.error&&(((Ou=P.data)==null?void 0:Ou.skills.length)??0)===0&&(((Du=P.data)==null?void 0:Du.errors.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]}):Rt==="hooks"?d.jsxs("div",{className:"p-2",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),d.jsx("p",{className:"truncate text-[11px] text-stone-500",children:((ju=ne.data)==null?void 0:ju.projectHooksPath)??"<workspace hooks config>"})]}),Tt==="list"&&Re.hostConfigFiles?d.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),xo(),er("add"),it(null),Un(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]}),ne.status==="loading"&&!ne.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading hooks…"}):null,ne.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:ne.error}):null,pt?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:pt}):null,Nn?d.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:Nn}):null,Tt==="add"||Tt==="edit"?d.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[Tt==="edit"?d.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing ",OR((Xe==null?void 0:Xe.eventName)??ye)," in"," ",(Xe==null?void 0:Xe.scope)==="global"?"global":"project"," hooks.json"]}):null,d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",d.jsxs("select",{"aria-label":"Hook scope",value:ge,onChange:I=>Ne(I.target.value),disabled:Tt==="edit",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:[d.jsx("option",{value:"project",children:"Project"}),d.jsx("option",{value:"global",children:"Global"})]})]}),d.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",d.jsx("select",{"aria-label":"Hook event",value:ye,onChange:I=>ze(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:ah.map(I=>d.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),d.jsx("input",{"aria-label":"Hook matcher",value:tt,onChange:I=>Me(I.target.value),placeholder:"Bash",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),d.jsx("textarea",{"aria-label":"Hook command",value:ft,onChange:I=>Vt(I.target.value),rows:3,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 font-mono text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",d.jsx("input",{"aria-label":"Hook timeout seconds",value:Ze,onChange:I=>X(I.target.value),inputMode:"numeric",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]}),d.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",d.jsx("input",{"aria-label":"Hook status message",value:Le,onChange:I=>Pe(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:()=>{er("list"),ut(null)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),d.jsx("button",{type:"button",onClick:()=>void Wr(),disabled:Lt,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Lt?"Saving…":Tt==="edit"?"Update Hook":"Write Hook"})]})]}):null,Tt==="list"&&((Mu=ne.data)!=null&&Mu.warnings.length)?d.jsx("div",{className:"mb-2 space-y-2",children:ne.data.warnings.map(I=>d.jsx("p",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:I},I))}):null,Tt==="list"&&((Pu=ne.data)!=null&&Pu.errors.length)?d.jsx("div",{className:"mb-2 space-y-2",children:ne.data.errors.map(I=>d.jsxs("div",{className:"rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-2 text-xs text-rose-100/90",children:[d.jsx("p",{className:"font-medium",children:I.message}),d.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,Tt==="list"&&((Gs=ne.data)!=null&&Gs.hooks.length)?d.jsx("div",{className:"space-y-2",children:ne.data.hooks.map(I=>d.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[RR(I.eventName),I.matcher?` · ${I.matcher}`:""]}),d.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:I.command??I.handlerType}),I.statusMessage?d.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:I.statusMessage}):null]}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[N2(I)?d.jsx("button",{type:"button",onClick:ie=>{ie.stopPropagation(),Ps(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,Re.hookTrust&&I.trustStatus==="trusted"&&!I.isManaged?d.jsx("button",{type:"button",disabled:Lt,onClick:ie=>{ie.stopPropagation(),wa(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&&Re.hookTrust?d.jsx("button",{type:"button",disabled:Lt||!I.currentHash,onClick:ie=>{ie.stopPropagation(),Bs(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-emerald-100 transition hover:border-emerald-300/35 hover:bg-emerald-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Trust"}):null,d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:IR(I.trustStatus)})]}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:LR(I.source)}),d.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:I.enabled?"Enabled":"Disabled"}),d.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[I.timeoutSec,"s"]})]})]},I.key))}):null,Tt==="list"&&ne.status!=="loading"&&!ne.error&&(((Td=ne.data)==null?void 0:Td.hooks.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No hooks configured for this workspace."}):null]}):d.jsxs("div",{className:"p-2",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),d.jsx("p",{className:"truncate text-[11px] text-stone-500",children:bl??"<provider config>"})]}),cn==="list"&&Re.mcpConfigEditing?d.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Vn("add"),tr(null),Gr(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]}),$.status==="loading"&&!$.data?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers…"}):null,$.error?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:$.error}):null,Va?d.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:Va}):null,Ns?d.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:Ns}):null,cn==="add"?d.jsxs("div",{className:"space-y-2",children:[d.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Vn("http"),tr(null),Gr(null)},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),d.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into provider config."})]}),d.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),yo()},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),d.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into provider config."})]})]}):null,cn==="http"?d.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),d.jsx("input",{"aria-label":"MCP name",value:nn,onChange:I=>yi(I.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),d.jsx("input",{"aria-label":"URL",value:us,onChange:I=>ya(I.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:()=>Vn("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),d.jsx("button",{type:"button",onClick:()=>void Ci(),disabled:bn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:bn?"Saving…":"Write HTTP MCP"})]})]}):null,cn==="stdio"?d.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[d.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for provider config"}),d.jsx("textarea",{"aria-label":"MCP block for provider config",value:In,onChange:I=>gl(I.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),d.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:()=>Vn("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),d.jsx("button",{type:"button",onClick:()=>void Dn(),disabled:bn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:bn?"Saving…":"Write raw block"})]})]}):null,cn==="list"&&((vd=$.data)!=null&&vd.servers.length)?d.jsx("div",{className:"space-y-2",children:$.data.servers.map(I=>d.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:I.name}),d.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[I.tools.length," tools · ",I.resourceCount," ","resources · ",I.resourceTemplateCount," templates"]})]}),d.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:NR(I.authStatus)})]}),I.tools.length>0?d.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:I.tools.slice(0,4).map(ie=>ie.title??ie.name).join(" · ")}):null]},I.name))}):null,cn==="list"&&$.status!=="loading"&&!$.error&&(((kd=$.data)==null?void 0:kd.servers.length)??0)===0?d.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})})})]}),!Zt&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>He(I=>I==="attachments"?null:"attachments"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:d.jsx(CR,{})}),$e==="attachments"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute left-0 top-full mt-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20",children:d.jsxs("div",{className:"p-2",children:[d.jsx("button",{type:"button",onClick:()=>{var I;z(),(I=Rs.current)==null||I.click()},className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"Photo"}),d.jsx("button",{type:"button",onClick:()=>{var I;z(),(I=qa.current)==null||I.click()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"File"})]})})]}),d.jsx("button",{type:"button","aria-label":Zt?"Switch to chat":"Switch to shell",title:Zt?"Switch to chat":"Switch to shell",onClick:()=>gt==null?void 0:gt(),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:Zt?d.jsx(VR,{}):d.jsx(wR,{})})]}),d.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[Zt&&rr&&d.jsx("span",{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:rr,children:rr}),yl&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":$e==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":$e==="shellTools",title:$e==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{z(),He(I=>I==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:d.jsx(GR,{})}),$e==="shellTools"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("button",{type:"button",onClick:()=>void K(),className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(C0,{}),d.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),d.jsx("button",{type:"button",onClick:()=>{z(),He(null),Kt==null||Kt()},className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(C0,{}),d.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),d.jsx("button",{type:"button",disabled:n,onClick:()=>{z(),He(null),_e({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"CLEAR",tone:"sky"})}),d.jsx("button",{type:"button",disabled:!(j!=null&&j.shellInputEnabled)||!(j!=null&&j.isCommandRunning),onClick:()=>{z(),He(null),Ue==null||Ue("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"CTRL-C",tone:"rose"})}),d.jsx("button",{type:"button",disabled:!(j!=null&&j.shellInputEnabled),onClick:()=>{z(),He(null),Ue==null||Ue("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"CTRL-D"})}),d.jsx("button",{type:"button",disabled:!(j!=null&&j.shellInputEnabled),onClick:()=>{z(),He(null),Ue==null||Ue("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"ESC"})}),d.jsx("button",{type:"button",disabled:!(j!=null&&j.shellInputEnabled),onClick:()=>{z(),He(null),Ue==null||Ue("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"TAB"})}),d.jsx("button",{type:"button",disabled:!(j!=null&&j.shellInputEnabled),onClick:()=>{z(),He(null),Ue==null||Ue("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"UP"})}),d.jsx("button",{type:"button",disabled:!(j!=null&&j.shellInputEnabled),onClick:()=>{z(),He(null),Ue==null||Ue("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:d.jsx(Gl,{label:"DOWN"})})]})})]})]})]}),Gn&&!Zt&&d.jsxs("div",{className:"relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border border-sky-300/25 bg-sky-300/[0.07] px-3 py-2 text-xs text-sky-50 shadow-sm shadow-stone-950/10",children:[d.jsx("span",{className:"font-medium uppercase tracking-[0.16em] text-sky-100/90",children:"Goal"}),d.jsxs("label",{className:"flex items-center gap-2 text-stone-300",children:[d.jsx("span",{children:"Max tokens (k)"}),d.jsx("input",{"aria-label":"Goal token budget",value:_a,onChange:I=>_n(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"})]}),aa?d.jsx("span",{className:"min-w-0 flex-1 text-rose-200",children:aa}):null,d.jsx("button",{type:"button",onClick:Wa,className:"rounded-full border border-stone-700/80 px-2.5 py-1 text-[11px] text-stone-300 transition hover:bg-stone-800",children:"Cancel"})]}),d.jsxs("div",{className:"relative",children:[Zt?d.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:Xt,onChange:I=>Iu(I.target.value),onKeyDown:ar,rows:2,placeholder:Nt,className:`${sr} resize-y pb-10`}):d.jsxs("div",{className:sr,children:[Xt.length===0&&d.jsx("span",{className:"pointer-events-none absolute left-4 top-2.5 text-stone-500",children:Nt}),d.jsx("div",{ref:Ta,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!O,suppressContentEditableWarning:!0,onInput:()=>je(),onPaste:Je,onKeyDown:ar,onKeyUp:()=>{fr.current=Xa()},onMouseUp:()=>{fr.current=Xa()},onBlur:()=>{fr.current=Xa(),jr(!1)},onDragEnter:Et,onDragOver:jn,onDragLeave:De,onDrop:Rn,className:`relative z-[1] min-h-[5.75rem] whitespace-pre-wrap break-words pb-10 outline-none sm:min-h-[4.875rem] ${O?"cursor-not-allowed text-stone-500":""}`})]}),d.jsx("button",{type:"button","aria-label":ke,title:ke,onClick:()=>void(de==null?void 0:de()),disabled:!kt,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${kt?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:d.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),d.jsx("button",{type:"submit","aria-label":Gn&&!Zt?"Set goal":Zt?"Send Shell Input":"Send Prompt",onMouseDown:I=>{I.preventDefault()},onPointerDown:I=>{I.preventDefault()},onTouchStart:I=>{I.preventDefault()},disabled:zt||n||(e==="chat"?O:!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 ${ht}`,children:Fe}),!Zt&&d.jsxs("div",{className:"absolute bottom-2.5 left-3 z-30 flex max-w-[calc(100%-7rem)] items-center gap-1.5 text-xs",children:[d.jsxs("div",{className:"relative min-w-0",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":$e==="model","aria-label":o??"Select model",disabled:fn||g.length===0,onClick:()=>He(I=>I==="model"?null:"model"),title:f?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${Os}`:Os,className:"thread-composer-inline-toggle relative inline-flex min-w-0 max-w-[8.75rem] items-center overflow-hidden rounded-full px-2.5 py-1 text-left text-stone-300 transition disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]",children:d.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:o??"Select model"})}),o?d.jsx(zR,{contextUsage:p}):null,$e==="model"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:d.jsx("div",{className:"max-h-72 overflow-auto p-2",children:g.map(I=>d.jsx("button",{type:"button",onClick:()=>void Bt({model:I.model,reasoningEffort:I.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.model===o?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:d.jsx("p",{className:"text-sm font-medium",children:I.model})},I.id))})})]}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":$e==="effort",disabled:bt,onClick:()=>He(I=>I==="effort"?null:"effort"),title:an,className:`thread-composer-inline-toggle rounded-full px-2 py-1 transition disabled:cursor-not-allowed disabled:text-stone-700 ${bt?"text-stone-500":"text-stone-300 hover:text-stone-100"}`,children:S2(c)}),$e==="effort"&&d.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:d.jsx("div",{className:"max-h-72 overflow-auto p-2",children:Qa.map(I=>d.jsx("button",{type:"button",onClick:()=>void Bt({reasoningEffort:I.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.reasoningEffort===c?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:d.jsx("p",{className:"text-sm font-medium",children:S2(I.reasoningEffort)})},I.reasoningEffort))})})]}),Re.planMode&&d.jsx("button",{type:"button","aria-pressed":vi==="plan",disabled:r,onClick:()=>void Bt({collaborationMode:vi==="plan"?"default":"plan"}),className:`thread-composer-inline-toggle rounded-full px-2.5 py-1 transition ${vi==="plan"?"thread-composer-plan-toggle-active":"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"})]})]}),l&&d.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l})]})]})}const qR="modulepreload",YR=function(e){return"/"+e},D2={},M=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=o(n.map(h=>{if(h=YR(h),h in D2)return;D2[h]=!0;const g=h.endsWith(".css"),p=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":qR,g||(x.as="script"),x.crossOrigin="",x.href=h,f&&x.setAttribute("nonce",f),document.head.appendChild(x),g)return new Promise((E,v)=>{x.addEventListener("load",E),x.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};function j2(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 WR(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 M2(e,t,n,r,i){const l=t.replace(/\r\n/g,`
82
+ `).replace(/\r/g,`
83
+ `),o=l.split(`
84
+ `);l.endsWith(`
85
+ `)&&o.at(-1)===""&&o.pop();let f=o.join(`\r
86
+ `);if(n!==void 0&&r!==void 0){const g=(i!==void 0?Math.max(0,o.length-i):0)+r,p=Math.max(0,o.length-g-1);p>0&&(f+=`\x1B[${p}A`),f+=`\r\x1B[${n+1}G`}e.reset(),e.write(f,()=>{e.scrollToBottom()})}function QR(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function N0(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(`
87
+ `).trimEnd():""}function pk(e){return e.replace(/\r\n/g,`
88
+ `).replace(/\r/g,`
89
+ `)}function P2(e){const t=pk(e),n=t.split(`
90
+ `);return t.endsWith(`
91
+ `)&&n.at(-1)===""&&n.pop(),n}function XR(e){const t=e.trim();return t?/(?:[$%#>])\s*$/.test(t):!1}function KR(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 ZR(e,t,n){var f,h;const r=P2(e),i=P2(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=KR(c,n);c.length>0&&((f=c[0])==null?void 0:f.trim())==="";)c.shift();for(;c.length>0&&(((h=c.at(-1))==null?void 0:h.trim())===""||XR(c.at(-1)??""));)c.pop();return c.join(`
92
+ `).trimEnd()}function A0(e){if(!e)return"";const t=e.replace(/[\\/]+$/,"");return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function R0(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 JR(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[d.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),d.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),d.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function e4({connected:e}){return e?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function B2(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5.5 3.25h5"}),d.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function ql({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return d.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:e})}function t4(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 n4=T.forwardRef(function({threadId:t,isVisible:n=!0,showHeader:r=!0,showFloatingToolbox:i=!0,onStateChange:l},o){var dn,Ln;const c=fo(),f=T.useRef(null),h=T.useRef(null),g=T.useRef(null),p=T.useRef(null),x=T.useRef(null),E=T.useRef(null),v=T.useRef(0),C=T.useRef(""),S=T.useRef(null),w=T.useRef(""),O=T.useRef(null),R=T.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),j=T.useRef(!1),G=T.useRef(null),[N,P]=T.useState(null),[$,ne]=T.useState(null),[W,me]=T.useState(!0),[Q,_e]=T.useState(!1),[de,se]=T.useState(null),[H,ce]=T.useState(0),[q,J]=T.useState(!1),[A,U]=T.useState(!1),[ee,D]=T.useState(!1),[Te,we]=T.useState(null),[Se,Ve]=T.useState(!1),[et,Be]=T.useState(null),Ft=(c==null?void 0:c.effectiveTheme)??"dark",at=T.useCallback((ye,ze)=>{Be({tone:ye,text:ze}),G.current!==null&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>{Be(null),G.current=null},1800)},[]),gt=T.useCallback(ye=>{var ft;const ze=g.current,tt=x.current,Me=p.current;return!ze||!tt||!Me?!1:(ze.send({type:"shell.input",shellId:tt,viewerId:Me,data:ye}),A||(ft=f.current)==null||ft.focus(),!0)},[A]),Kt=T.useCallback(()=>{var Me;const ye=g.current,ze=x.current,tt=p.current;return!ye||!ze||!tt?!1:(ye.send({type:"shell.clear",shellId:ze,viewerId:tt}),A||(Me=f.current)==null||Me.focus(),!0)},[A]),Ue=T.useCallback(ye=>{const ze=f.current,tt=h.current;!ze||!tt||(tt.fit(),C.current&&!N0(N)?M2(ze,C.current,R.current.cursorX,R.current.cursorY,R.current.paneHeight):ze.scrollToBottom(),ye!=null&&ye.focus&&!A&&ze.focus())},[A,N]),kt=($==null?void 0:$.state)??"not_created",nt=T.useMemo(()=>($==null?void 0:$.shell)??null,[$==null?void 0:$.shell]),on=!!(p.current&&nt),$e=T.useMemo(()=>R0(A0(nt==null?void 0:nt.cwd),null),[nt==null?void 0:nt.cwd]),He=Te??$e,Rt=Q||W||kt==="creating"||kt==="workspace_missing",un=kt==="attached"?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":kt==="exited"||kt==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":kt==="workspace_missing"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800",cn=kt==="attached"?"Disconnect shell":kt==="exited"||kt==="not_found"?"Restart shell":nt?"Connect shell":"Create shell",Vn=(et==null?void 0:et.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(et==null?void 0:et.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",Tt=T.useCallback(async()=>{me(!0);try{const ye=await M6(t);ne(ye),se(null)}catch(ye){se(ye instanceof Error?ye.message:"Unable to load shell state.")}finally{me(!1)}},[t]);T.useEffect(()=>{Tt()},[Tt]),T.useEffect(()=>{var ye;x.current=((ye=$==null?void 0:$.shell)==null?void 0:ye.id)??null},[(dn=$==null?void 0:$.shell)==null?void 0:dn.id]),T.useEffect(()=>{E.current=$},[$]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const ye=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),ze=()=>{U(ye.matches),ye.matches||D(!1)};return ze(),ye.addEventListener("change",ze),()=>{ye.removeEventListener("change",ze)}},[]),T.useEffect(()=>()=>{G.current!==null&&window.clearTimeout(G.current)},[]),T.useEffect(()=>{if(!N||f.current)return;let ye=!1,ze=null;return(async()=>{const[{Terminal:tt},{FitAddon:Me}]=await Promise.all([M(()=>import("./xterm-D4sevve4.js").then(Ze=>Ze.x),[]),M(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(ye||!N)return;const ft=new tt({cursorBlink:!0,disableStdin:A,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:j2(Ft)}),Vt=new Me;ft.loadAddon(Vt),ft.open(N),Vt.fit(),ft.attachCustomKeyEventHandler(Ze=>{if(A||Ze.type!=="keydown")return!0;if(Ze.ctrlKey&&!Ze.altKey&&!Ze.metaKey&&!Ze.shiftKey){const X=QR(Ze.key);return X&&gt(X)?(Ze.preventDefault(),!1):!0}return!0}),f.current=ft,h.current=Vt,J(!0),O.current=new ResizeObserver(()=>{Ue(),g.current&&x.current&&p.current&&g.current.send({type:"shell.resize",shellId:x.current,viewerId:p.current,cols:ft.cols,rows:ft.rows})}),O.current.observe(N),ze=ft.onData(Ze=>{A||gt(Ze)})})(),()=>{var tt,Me;ye=!0,ze==null||ze.dispose(),(tt=O.current)==null||tt.disconnect(),O.current=null,J(!1),(Me=f.current)==null||Me.dispose(),f.current=null,h.current=null}},[A,Ue,gt,N]),T.useEffect(()=>{if(!n||!q)return;let ye=window.requestAnimationFrame(()=>{Ue({focus:!0})});return()=>{window.cancelAnimationFrame(ye)}},[n,Ue,q]),T.useEffect(()=>{const ye=f.current;ye&&(ye.options.disableStdin=A)},[A]),T.useEffect(()=>{var Vt;const ye=E.current,ze=(Vt=ye==null?void 0:ye.shell)==null?void 0:Vt.id;if(!ze)return;const tt=ye==null?void 0:ye.state;if(tt==="not_created"||tt==="workspace_missing"||tt==="creating"||tt==="not_found"||tt==="exited")return;const Me=f.current;if(!Me||!q||H===v.current)return;v.current=H,Me.reset(),se(null),p.current=null,Me.focus();const ft=lR({onConnected:()=>{ft.send({type:"shell.attach",shellId:ze,cols:Me.cols,rows:Me.rows})},onShellEvent:Ze=>{if(Ze.shellId!==ze)return;if(Ze.type==="shell.connected"){const Le=String(Ze.payload.viewerId??"");p.current=Le||null,ne(Pe=>Pe&&{...Pe,state:"attached",shell:Pe.shell?{...Pe.shell,status:"attached",attachedViewerId:Le}:Pe.shell});return}if(Ze.type==="shell.output"){const Le=typeof Ze.payload.data=="string"?Ze.payload.data:"",Pe=Ze.payload.replace===!0,Xe=typeof Ze.payload.cursorX=="number"?Ze.payload.cursorX:void 0,ut=typeof Ze.payload.cursorY=="number"?Ze.payload.cursorY:void 0,Lt=typeof Ze.payload.paneHeight=="number"?Ze.payload.paneHeight:void 0,Gt=typeof Ze.payload.cwdBaseName=="string"?Ze.payload.cwdBaseName:null,pt=typeof Ze.payload.envPrefix=="string"?Ze.payload.envPrefix:null,it=R0(Gt??A0(nt==null?void 0:nt.cwd),pt),Nn=Ze.payload.isCommandRunning===!0;if(R.current={cursorX:Xe,cursorY:ut,paneHeight:Lt},we(it),Ve(Nn),j.current=Nn,Le)if(Pe){const Un=pk(Le);C.current=Un,M2(Me,Le,Xe,ut,Lt),!Nn&&S.current&&(w.current=ZR(S.current.beforeSnapshot,Un,S.current.command),S.current=null)}else Me.write(Le);return}if(Ze.type==="shell.error"){se(String(Ze.payload.message??"Shell connection failed.")),Ze.payload.code==="viewer_conflict"&&ne(Le=>Le&&{...Le,state:"detached",shell:Le.shell?{...Le.shell,status:"detached",attachedViewerId:null}:Le.shell});return}if(Ze.type==="shell.detached"){const Le=String(Ze.payload.viewerId??""),Pe=String(Ze.payload.reason??"");Le&&Le===p.current&&(p.current=null,ne(Xe=>Xe&&{...Xe,state:"detached",shell:Xe.shell?{...Xe.shell,status:"detached",attachedViewerId:null}:Xe.shell}),se(Pe==="replaced"?"This shell connection was taken over by another device.":null),Ve(!1),j.current=!1,ft.socket.close());return}if(Ze.type==="shell.exited"){p.current=null,Ve(!1),j.current=!1;const Le=Ze.payload.state==="exited"?"exited":"not_found";ne(Pe=>Pe&&{...Pe,state:Le,shell:Pe.shell?{...Pe.shell,status:Le,attachedViewerId:null}:Pe.shell});return}const X=Ze.payload.state;X&&(X!=="attached"&&(p.current=null,Ve(!1),j.current=!1),ne(Le=>Le&&{...Le,state:X,shell:Le.shell?{...Le.shell,status:X==="attached"||X==="detached"?X:Le.shell.status,attachedViewerId:X==="attached"?Le.shell.attachedViewerId:null}:Le.shell}))}});return g.current=ft,ft.socket.addEventListener("close",()=>{var Ze;((Ze=g.current)==null?void 0:Ze.socket)===ft.socket&&(g.current=null)}),()=>{var X;const Ze=p.current;Ze&&ft.send({type:"shell.detach",shellId:ze,viewerId:Ze}),p.current=null,ft.socket.close(),((X=g.current)==null?void 0:X.socket)===ft.socket&&(g.current=null)}},[H,nt==null?void 0:nt.cwd,(Ln=$==null?void 0:$.shell)==null?void 0:Ln.id,q]);const er=T.useCallback(async()=>{_e(!0);try{const ye=f.current,ze=await U6(t,{...(ye==null?void 0:ye.cols)!==void 0?{cols:ye.cols}:{},...(ye==null?void 0:ye.rows)!==void 0?{rows:ye.rows}:{}});ne(ze),ce(tt=>tt+1),se(null)}catch(ye){se(ye instanceof Yt?ye.payload.message:"Unable to create shell.")}finally{_e(!1)}},[t]),ge=T.useCallback(async()=>{if(kt==="exited"||kt==="not_found"){await er();return}se(null),ce(ye=>ye+1)},[er,kt]),Ne=T.useCallback(async()=>{if($!=null&&$.shell){_e(!0);try{await H6($.shell.id),await Tt(),se(null)}catch(ye){se(ye instanceof Yt?ye.payload.message:"Unable to terminate shell.")}finally{_e(!1)}}},[Tt,$==null?void 0:$.shell]),Re=T.useCallback(()=>{var Me;const ye=g.current,ze=x.current,tt=p.current;!ye||!ze||(tt&&ye.send({type:"shell.detach",shellId:ze,viewerId:tt}),p.current=null,ye.socket.close(),((Me=g.current)==null?void 0:Me.socket)===ye.socket&&(g.current=null),se(null),ne(ft=>ft&&{...ft,state:"detached",shell:ft.shell?{...ft.shell,status:"detached",attachedViewerId:null}:ft.shell}))},[Ft]);T.useEffect(()=>{f.current&&(f.current.options.theme=j2(Ft))},[Ft]);const st=T.useCallback(async()=>{if(!(Q||W||kt==="creating"||kt==="workspace_missing")){if(kt==="attached"){Re();return}if(kt==="exited"||kt==="not_found"||!nt){await er();return}await ge()}},[Q,er,Re,ge,W,nt,kt]),xt=T.useCallback(async()=>{var ye,ze,tt,Me;try{const ft=((ze=(ye=f.current)==null?void 0:ye.getSelection())==null?void 0:ze.trim())||((Me=(tt=window.getSelection)==null?void 0:tt.call(window))==null?void 0:Me.toString().trim())||N0(N);return ft?(await navigator.clipboard.writeText(ft),at("done","Copied"),!0):(at("failed","Nothing to copy"),!1)}catch{return at("failed","Copy failed"),!1}},[N,at]);return T.useEffect(()=>{if(!(nt!=null&&nt.cwd)){we(null);return}we(ye=>ye??R0(A0(nt.cwd),null))},[nt==null?void 0:nt.cwd]),T.useEffect(()=>{l==null||l({status:kt,connectionButtonDisabled:Rt,connectionButtonLabel:cn,shellInputEnabled:on,isCommandRunning:Se,promptLabel:He,isMobileShell:A,hasShell:!!nt,busy:Q,loading:W,error:de})},[Q,Rt,cn,de,A,Se,W,l,He,nt,on,kt]),T.useImperativeHandle(o,()=>({async toggleConnection(){await st()},sendInput(ye){return gt(ye)},sendCommand(ye){const ze={command:ye,beforeSnapshot:C.current};if(S.current=ze,ye.trim()==="clear"){const ft=Kt();return!ft&&S.current===ze&&(S.current=null),ft}const tt=ye.endsWith(`
93
+ `)?ye:`${ye}
94
+ `,Me=gt(tt);return!Me&&S.current===ze&&(S.current=null),Me},sendControl(ye){return ye==="clear"?Kt():gt(t4(ye))},async copyLastCommandOutput(){const ye=w.current.trim()||N0(N);if(!ye)return at("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(ye),at("done","Copied"),!0}catch{return at("failed","Copy failed"),!1}},async terminate(){await Ne()},focus(){var ye;(ye=f.current)==null||ye.focus()},refreshLayout(ye){Ue(ye)}}),[st,Ne,Ue,Kt,gt,at,N]),d.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[r&&d.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),d.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:He??(nt==null?void 0:nt.cwd)??"Create a durable shell for this thread."})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("button",{type:"button","aria-label":cn,title:`${cn} (${WR(kt)})`,disabled:Rt,onClick:()=>void st(),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 ${un}`,children:d.jsx(e4,{connected:kt==="attached"})}),nt&&d.jsx("button",{type:"button",disabled:Q,onClick:()=>void Ne(),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"})]})]}),(de||W||($==null?void 0:$.workspacePathStatus)==="missing")&&d.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[W&&d.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!W&&($==null?void 0:$.workspacePathStatus)==="missing"&&d.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!W&&de&&d.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:de})]})]}),d.jsx("div",{className:"min-h-0 flex-1",children:kt==="not_created"||kt==="workspace_missing"?d.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:d.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[d.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),d.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under supervisor-managed tmux and survives browser disconnects. Create it explicitly when you want to inspect or take over the workspace."})]})}):d.jsx("div",{className:"h-full min-h-0 p-2 sm:p-3",children:d.jsxs("div",{className:"shell-terminal-frame relative h-full rounded-[1.4rem] border shadow-inner",children:[!r&&(de||W||($==null?void 0:$.workspacePathStatus)==="missing")&&d.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[W&&d.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!W&&($==null?void 0:$.workspacePathStatus)==="missing"&&d.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!W&&de&&d.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:de})]}),d.jsx("div",{ref:P,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${A?"mobile-shell-selectable":""}`,onMouseDown:()=>{var ye;(ye=f.current)==null||ye.focus()}}),i&&A&&d.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[et&&d.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${Vn}`,children:et.text}),ee&&d.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("button",{type:"button",onClick:()=>{at("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(B2,{}),d.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),d.jsx("button",{type:"button",onClick:()=>void xt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(B2,{}),d.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),d.jsx("button",{type:"button",disabled:!on,onClick:()=>{Kt()?at("done","Cleared"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"CLEAR",tone:"sky"})}),d.jsx("button",{type:"button",disabled:!on||!Se,onClick:()=>{gt("")?at("done","Sent Ctrl-C"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"CTRL-C",tone:"rose"})}),d.jsx("button",{type:"button",disabled:!on,onClick:()=>{gt("")?at("done","Sent Ctrl-D"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"CTRL-D",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!on,onClick:()=>{gt("\x1B")?at("done","Sent Esc"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"ESC",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!on,onClick:()=>{gt(" ")?at("done","Sent Tab"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"TAB",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!on,onClick:()=>{gt("\x1B[A")?at("done","Sent Up"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"UP",tone:"stone"})}),d.jsx("button",{type:"button",disabled:!on,onClick:()=>{gt("\x1B[B")?at("done","Sent Down"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:d.jsx(ql,{label:"DOWN",tone:"stone"})})]})}),d.jsx("button",{type:"button","aria-expanded":ee,"aria-label":ee?"Close shell tools":"Open shell tools",onClick:()=>D(ye=>!ye),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:d.jsx(JR,{})})]})]})})})]})});let Jn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function r4(e){return P1(e)}function P1(e){return Array.isArray(e)?a4(e):e instanceof RegExp?e:typeof e=="object"?s4(e):e}function a4(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=P1(e[n]);return t}function s4(e){let t={};for(let n in e)t[n]=P1(e[n]);return t}function gk(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function bk(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?bk(e.substring(0,e.length-1)):e.substr(~t+1)}var L0=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Rf=class{static hasCaptures(e){return e===null?!1:(L0.lastIndex=0,L0.test(e))}static replaceCaptures(e,t,n){return e.replace(L0,(r,i,l,o)=>{let c=n[parseInt(i||l,10)];if(c){let f=t.substring(c.start,c.end);for(;f[0]===".";)f=f.substring(1);switch(o){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return r})}};function xk(e,t){return e<t?-1:e>t?1:0}function yk(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=xk(e[i],t[i]);if(l!==0)return l}return 0}return n-r}function U2(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 Ek(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var _k=class{constructor(e){fe(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}},mh=class{constructor(e,t,n){fe(this,"_cachedMatchRoot",new _k(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(o4(e),t)}static createFromParsedTheme(e,t){return c4(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=>i4(e.parent,i.parentScopes));return r?new Tk(r.fontStyle,r.foreground,r.background):null}},I0=class sh{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new sh(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new sh(n,t[r]);return n}push(t){return new sh(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 i4(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&&!l4(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function l4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Tk=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function o4(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 p=o.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),c=p.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let f=-1;if(typeof o.settings.fontStyle=="string"){f=0;let p=o.settings.fontStyle.split(" ");for(let x=0,E=p.length;x<E;x++)switch(p[x]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let h=null;typeof o.settings.foreground=="string"&&U2(o.settings.foreground)&&(h=o.settings.foreground);let g=null;typeof o.settings.background=="string"&&U2(o.settings.background)&&(g=o.settings.background);for(let p=0,x=c.length;p<x;p++){let v=c[p].trim().split(" "),C=v[v.length-1],S=null;v.length>1&&(S=v.slice(0,v.length-1),S.reverse()),n[r++]=new u4(C,S,i,f,h,g)}}return n}var u4=class{constructor(e,t,n,r,i,l){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=l}},Nr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Nr||{});function c4(e,t){e.sort((f,h)=>{let g=xk(f.scope,h.scope);return g!==0||(g=yk(f.parentScopes,h.parentScopes),g!==0)?g:f.index-h.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(r=f.foreground),f.background!==null&&(i=f.background)}let l=new d4(t),o=new Tk(n,l.getId(r),l.getId(i)),c=new h4(new Ig(0,null,-1,0,0),[]);for(let f=0,h=e.length;f<h;f++){let g=e[f];c.insert(0,g.scope,g.parentScopes,g.fontStyle,l.getId(g.foreground),l.getId(g.background))}return new mh(l,o,c)}var d4=class{constructor(e){fe(this,"_isFrozen");fe(this,"_lastColorId");fe(this,"_id2color");fe(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)}},f4=Object.freeze([]),Ig=class vk{constructor(t,n,r,i,l){fe(this,"scopeDepth");fe(this,"parentScopes");fe(this,"fontStyle");fe(this,"foreground");fe(this,"background");this.scopeDepth=t,this.parentScopes=n||f4,this.fontStyle=r,this.foreground=i,this.background=l}clone(){return new vk(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)}},h4=class Og{constructor(t,n=[],r={}){fe(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(Og._cmpBySpecificity),n}insert(t,n,r,i,l,o){if(n===""){this._doInsertHere(t,r,i,l,o);return}let c=n.indexOf("."),f,h;c===-1?(f=n,h=""):(f=n.substring(0,c),h=n.substring(c+1));let g;this._children.hasOwnProperty(f)?g=this._children[f]:(g=new Og(this._mainRule.clone(),Ig.cloneArr(this._rulesWithParentScopes)),this._children[f]=g),g.insert(t+1,h,r,i,l,o)}_doInsertHere(t,n,r,i,l){if(n===null){this._mainRule.acceptOverwrite(t,r,i,l);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let f=this._rulesWithParentScopes[o];if(yk(f.parentScopes,n)===0){f.acceptOverwrite(t,r,i,l);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new Ig(t,n,r,i,l))}},mu=class ja{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ja.getLanguageId(t),r=ja.getTokenType(t),i=ja.getFontStyle(t),l=ja.getForeground(t),o=ja.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:l,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,l,o,c){let f=ja.getLanguageId(t),h=ja.getTokenType(t),g=ja.containsBalancedBrackets(t)?1:0,p=ja.getFontStyle(t),x=ja.getForeground(t),E=ja.getBackground(t);return n!==0&&(f=n),r!==8&&(h=r),i!==null&&(g=i?1:0),l!==-1&&(p=l),o!==0&&(x=o),c!==0&&(E=c),(f<<0|h<<8|g<<10|p<<11|x<<15|E<<24)>>>0}};function ph(e,t){const n=[],r=m4(e);let i=r.next();for(;i!==null;){let f=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let h=o();if(n.push({matcher:h,priority:f}),i!==",")break;i=r.next()}return n;function l(){if(i==="-"){i=r.next();const f=l();return h=>!!f&&!f(h)}if(i==="("){i=r.next();const f=c();return i===")"&&(i=r.next()),f}if(H2(i)){const f=[];do f.push(i),i=r.next();while(H2(i));return h=>t(f,h)}return null}function o(){const f=[];let h=l();for(;h;)f.push(h),h=l();return g=>f.every(p=>p(g))}function c(){const f=[];let h=o();for(;h&&(f.push(h),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");h=o()}return g=>f.some(p=>p(g))}}function H2(e){return!!e&&!!e.match(/[\w\.:]+/)}function m4(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 kk(e){typeof e.dispose=="function"&&e.dispose()}var Zc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},p4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},g4=class{constructor(){fe(this,"_references",[]);fe(this,"_seenReferenceKeys",new Set);fe(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))}},b4=class{constructor(e,t){fe(this,"seenFullScopeRequests",new Set);fe(this,"seenPartialScopeRequests",new Set);fe(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Zc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new g4;for(const n of e)x4(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Zc){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 x4(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 Zc?ih({baseGrammar:l,selfGrammar:i},r):Dg(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 Zc(c))}function Dg(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];gh([r],t,n)}}function ih(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&gh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&gh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function gh(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?gk({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&gh(r.patterns,{...t,repository:i},n);const l=r.include;if(!l)continue;const o=wk(l);switch(o.kind){case 0:ih({...t,selfGrammar:t.baseGrammar},n);break;case 1:ih(t,n);break;case 2:Dg(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const c=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const f={baseGrammar:t.baseGrammar,selfGrammar:c,repository:i};o.kind===4?Dg(o.ruleName,f,n):ih(f,n)}else o.kind===4?n.add(new p4(o.scopeName,o.ruleName)):n.add(new Zc(o.scopeName));break}}}var y4=class{constructor(){fe(this,"kind",0)}},E4=class{constructor(){fe(this,"kind",1)}},_4=class{constructor(e){fe(this,"kind",2);this.ruleName=e}},T4=class{constructor(e){fe(this,"kind",3);this.scopeName=e}},v4=class{constructor(e,t){fe(this,"kind",4);this.scopeName=e,this.ruleName=t}};function wk(e){if(e==="$base")return new y4;if(e==="$self")return new E4;const t=e.indexOf("#");if(t===-1)return new T4(e);if(t===0)return new _4(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new v4(n,r)}}var k4=/\\(\d+)/,F2=/\\(\d+)/g,w4=-1,Ck=-2;var dd=class{constructor(e,t,n,r){fe(this,"$location");fe(this,"id");fe(this,"_nameIsCapturing");fe(this,"_name");fe(this,"_contentNameIsCapturing");fe(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Rf.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Rf.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${bk(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:Rf.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Rf.replaceCaptures(this._contentName,e,t)}},C4=class extends dd{constructor(t,n,r,i,l){super(t,n,r,i);fe(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!")}},S4=class extends dd{constructor(t,n,r,i,l){super(t,n,r,null);fe(this,"_match");fe(this,"captures");fe(this,"_cachedCompiledPatterns");this._match=new Jc(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 ed,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},z2=class extends dd{constructor(t,n,r,i,l){super(t,n,r,i);fe(this,"hasMissingPatterns");fe(this,"patterns");fe(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 ed,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},jg=class extends dd{constructor(t,n,r,i,l,o,c,f,h,g){super(t,n,r,i);fe(this,"_begin");fe(this,"beginCaptures");fe(this,"_end");fe(this,"endHasBackReferences");fe(this,"endCaptures");fe(this,"applyEndPatternLast");fe(this,"hasMissingPatterns");fe(this,"patterns");fe(this,"_cachedCompiledPatterns");this._begin=new Jc(l,this.id),this.beginCaptures=o,this._end=new Jc(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=h||!1,this.patterns=g.patterns,this.hasMissingPatterns=g.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 ed;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}},bh=class extends dd{constructor(t,n,r,i,l,o,c,f,h){super(t,n,r,i);fe(this,"_begin");fe(this,"beginCaptures");fe(this,"whileCaptures");fe(this,"_while");fe(this,"whileHasBackReferences");fe(this,"hasMissingPatterns");fe(this,"patterns");fe(this,"_cachedCompiledPatterns");fe(this,"_cachedCompiledWhilePatterns");this._begin=new Jc(l,this.id),this.beginCaptures=o,this.whileCaptures=f,this._while=new Jc(c,Ck),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ed;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 ed,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},Sk=class Sr{static createCaptureRule(t,n,r,i,l){return t.registerRule(o=>new C4(n,o,r,i,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new S4(t.$vscodeTextmateLocation,t.id,t.name,t.match,Sr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=gk({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new z2(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Sr._compilePatterns(l,n,r))}return t.while?new bh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Sr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Sr._compileCaptures(t.whileCaptures||t.captures,n,r),Sr._compilePatterns(t.patterns,n,r)):new jg(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Sr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Sr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Sr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let l=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>l&&(l=c)}for(let o=0;o<=l;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let f=0;t[o].patterns&&(f=Sr.getCompiledRuleId(t[o],n,r)),i[c]=Sr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,f)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let l=0,o=t.length;l<o;l++){const c=t[l];let f=-1;if(c.include){const h=wk(c.include);switch(h.kind){case 0:case 1:f=Sr.getCompiledRuleId(r[c.include],n,r);break;case 2:let g=r[h.ruleName];g&&(f=Sr.getCompiledRuleId(g,n,r));break;case 3:case 4:const p=h.scopeName,x=h.kind===4?h.ruleName:null,E=n.getExternalGrammar(p,r);if(E)if(x){let v=E.repository[x];v&&(f=Sr.getCompiledRuleId(v,n,E.repository))}else f=Sr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else f=Sr.getCompiledRuleId(c,n,r);if(f!==-1){const h=n.getRule(f);let g=!1;if((h instanceof z2||h instanceof jg||h instanceof bh)&&h.hasMissingPatterns&&h.patterns.length===0&&(g=!0),g)continue;i.push(f)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Jc=class Nk{constructor(t,n){fe(this,"source");fe(this,"ruleId");fe(this,"hasAnchor");fe(this,"hasBackReferences");fe(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,l=[],o=!1;for(let c=0;c<r;c++)if(t.charAt(c)==="\\"&&c+1<r){const h=t.charAt(c+1);h==="z"?(l.push(t.substring(i,c)),l.push("$(?!\\n)(?<!\\n)"),i=c+2):(h==="A"||h==="G")&&(o=!0),c++}this.hasAnchor=o,i===0?this.source=t:(l.push(t.substring(i,r)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=k4.test(this.source):this.hasBackReferences=!1}clone(){return new Nk(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 F2.lastIndex=0,this.source.replace(F2,(i,l)=>Ek(r[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],l,o,c,f;for(l=0,o=this.source.length;l<o;l++)c=this.source.charAt(l),t[l]=c,n[l]=c,r[l]=c,i[l]=c,c==="\\"&&l+1<o&&(f=this.source.charAt(l+1),f==="A"?(t[l+1]="￿",n[l+1]="￿",r[l+1]="A",i[l+1]="A"):f==="G"?(t[l+1]="￿",n[l+1]="G",r[l+1]="￿",i[l+1]="G"):(t[l+1]=f,n[l+1]=f,r[l+1]=f,i[l+1]=f),l++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ed=class{constructor(){fe(this,"_items");fe(this,"_hasAnchors");fe(this,"_cached");fe(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 $2(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 $2(e,r,this._items.map(i=>i.ruleId))}},$2=class{constructor(e,t,n){fe(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(`
95
+ `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},O0=class{constructor(e,t){this.languageId=e,this.tokenType=t}},hi,N4=(hi=class{constructor(t,n){fe(this,"_defaultAttributes");fe(this,"_embeddedLanguagesMatcher");fe(this,"_getBasicScopeAttributes",new _k(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new O0(n,r)}));this._defaultAttributes=new O0(t,8),this._embeddedLanguagesMatcher=new A4(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?hi._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(hi.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!")}},fe(hi,"_NULL_SCOPE_METADATA",new O0(0,0)),fe(hi,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),hi),A4=class{constructor(e){fe(this,"values");fe(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Ek(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])}},V2=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ak(e,t,n,r,i,l,o,c){const f=t.content.length;let h=!1,g=-1;if(o){const E=R4(e,t,n,r,i,l);i=E.stack,r=E.linePos,n=E.isFirstLine,g=E.anchorPosition}const p=Date.now();for(;!h;){if(c!==0&&Date.now()-p>c)return new V2(i,!0);x()}return new V2(i,!1);function x(){const E=L4(e,t,n,r,i,g);if(!E){l.produce(i,f),h=!0;return}const v=E.captureIndices,C=E.matchedRuleId,S=v&&v.length>0?v[0].end>r:!1;if(C===w4){const w=i.getRule(e);l.produce(i,v[0].start),i=i.withContentNameScopesList(i.nameScopesList),Oc(e,t,n,i,l,w.endCaptures,v),l.produce(i,v[0].end);const O=i;if(i=i.parent,g=O.getAnchorPos(),!S&&O.getEnterPos()===r){i=O,l.produce(i,f),h=!0;return}}else{const w=e.getRule(C);l.produce(i,v[0].start);const O=i,R=w.getName(t.content,v),j=i.contentNameScopesList.pushAttributed(R,e);if(i=i.push(C,r,g,v[0].end===f,null,j,j),w instanceof jg){const G=w;Oc(e,t,n,i,l,G.beginCaptures,v),l.produce(i,v[0].end),g=v[0].end;const N=G.getContentName(t.content,v),P=j.pushAttributed(N,e);if(i=i.withContentNameScopesList(P),G.endHasBackReferences&&(i=i.withEndRule(G.getEndWithResolvedBackReferences(t.content,v))),!S&&O.hasSameRuleAs(i)){i=i.pop(),l.produce(i,f),h=!0;return}}else if(w instanceof bh){const G=w;Oc(e,t,n,i,l,G.beginCaptures,v),l.produce(i,v[0].end),g=v[0].end;const N=G.getContentName(t.content,v),P=j.pushAttributed(N,e);if(i=i.withContentNameScopesList(P),G.whileHasBackReferences&&(i=i.withEndRule(G.getWhileWithResolvedBackReferences(t.content,v))),!S&&O.hasSameRuleAs(i)){i=i.pop(),l.produce(i,f),h=!0;return}}else if(Oc(e,t,n,i,l,w.captures,v),l.produce(i,v[0].end),i=i.pop(),!S){i=i.safePop(),l.produce(i,f),h=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function R4(e,t,n,r,i,l){let o=i.beginRuleCapturedEOL?0:-1;const c=[];for(let f=i;f;f=f.pop()){const h=f.getRule(e);h instanceof bh&&c.push({rule:h,stack:f})}for(let f=c.pop();f;f=c.pop()){const{ruleScanner:h,findOptions:g}=D4(f.rule,e,f.stack.endRule,n,r===o),p=h.findNextMatchSync(t,r,g);if(p){if(p.ruleId!==Ck){i=f.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(l.produce(f.stack,p.captureIndices[0].start),Oc(e,t,n,f.stack,l,f.rule.whileCaptures,p.captureIndices),l.produce(f.stack,p.captureIndices[0].end),o=p.captureIndices[0].end,p.captureIndices[0].end>r&&(r=p.captureIndices[0].end,n=!1))}else{i=f.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function L4(e,t,n,r,i,l){const o=I4(e,t,n,r,i,l),c=e.getInjections();if(c.length===0)return o;const f=O4(c,e,t,n,r,i,l);if(!f)return o;if(!o)return f;const h=o.captureIndices[0].start,g=f.captureIndices[0].start;return g<h||f.priorityMatch&&g===h?f:o}function I4(e,t,n,r,i,l){const o=i.getRule(e),{ruleScanner:c,findOptions:f}=Rk(o,e,i.endRule,n,r===l),h=c.findNextMatchSync(t,r,f);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function O4(e,t,n,r,i,l,o){let c=Number.MAX_VALUE,f=null,h,g=0;const p=l.contentNameScopesList.getScopeNames();for(let x=0,E=e.length;x<E;x++){const v=e[x];if(!v.matcher(p))continue;const C=t.getRule(v.ruleId),{ruleScanner:S,findOptions:w}=Rk(C,t,null,r,i===o),O=S.findNextMatchSync(n,i,w);if(!O)continue;const R=O.captureIndices[0].start;if(!(R>=c)&&(c=R,f=O.captureIndices,h=O.ruleId,g=v.priority,c===i))break}return f?{priorityMatch:g===-1,captureIndices:f,matchedRuleId:h}:null}function Rk(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function D4(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Oc(e,t,n,r,i,l,o){if(l.length===0)return;const c=t.content,f=Math.min(l.length,o.length),h=[],g=o[0].end;for(let p=0;p<f;p++){const x=l[p];if(x===null)continue;const E=o[p];if(E.length===0)continue;if(E.start>g)break;for(;h.length>0&&h[h.length-1].endPos<=E.start;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?i.produceFromScopes(h[h.length-1].scopes,E.start):i.produce(r,E.start),x.retokenizeCapturedWithRuleId){const C=x.getName(c,o),S=r.contentNameScopesList.pushAttributed(C,e),w=x.getContentName(c,o),O=S.pushAttributed(w,e),R=r.push(x.retokenizeCapturedWithRuleId,E.start,-1,!1,null,S,O),j=e.createOnigString(c.substring(0,E.end));Ak(e,j,n&&E.start===0,E.start,R,i,!1,0),kk(j);continue}const v=x.getName(c,o);if(v!==null){const S=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);h.push(new j4(S,E.end))}}for(;h.length>0;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var j4=class{constructor(e,t){fe(this,"scopes");fe(this,"endPos");this.scopes=e,this.endPos=t}};function M4(e,t,n,r,i,l,o,c){return new B4(e,t,n,r,i,l,o,c)}function G2(e,t,n,r,i){const l=ph(t,xh),o=Sk.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 xh(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(P4(t[i],r))return n=i+1,!0;return!1})}function P4(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 B4=class{constructor(e,t,n,r,i,l,o,c){fe(this,"_rootId");fe(this,"_lastRuleId");fe(this,"_ruleId2desc");fe(this,"_includedGrammars");fe(this,"_grammarRepository");fe(this,"_grammar");fe(this,"_injections");fe(this,"_basicScopeAttributesProvider");fe(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=c,this._basicScopeAttributesProvider=new N4(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=q2(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const f of Object.keys(i)){const h=ph(f,xh);for(const g of h)this._tokenTypeMatchers.push({matcher:g.matcher,type:i[f]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)G2(t,o,i[o],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const f=c.injectionSelector;f&&G2(t,f,c,this,c)}})}return t.sort((i,l)=>i.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=q2(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=Sk.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Mg.NULL){i=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),g=this.themeProvider.getDefaults(),p=mu.set(0,h.languageId,h.tokenType,null,g.fontStyle,g.foregroundId,g.backgroundId),x=this.getRule(this._rootId).getName(null,null);let E;x?E=Uc.createRootAndLookUpScopeName(x,p,this):E=Uc.createRoot("unknown",p),t=new Mg(null,this._rootId,-1,-1,!1,null,E,E)}else i=!1,t.reset();e=e+`
96
+ `;const l=this.createOnigString(e),o=l.content.length,c=new H4(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=Ak(this,l,i,0,t,c,!0,r);return kk(l),{lineLength:o,lineTokens:c,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function q2(e,t){return e=r4(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 Uc=class bs{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=(t==null?void 0:t.scopePath)??null;for(const l of n)i=I0.push(i,l.scopeNames),r=new bs(r,i,l.encodedTokenAttributes);return r}static createRoot(t,n){return new bs(null,new I0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),l=new I0(null,t),o=r.themeProvider.themeMatch(l),c=bs.mergeAttributes(n,i,o);return new bs(null,l,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return bs.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,l=0,o=0;return r!==null&&(i=r.fontStyle,l=r.foregroundId,o=r.backgroundId),mu.set(t,n.languageId,n.tokenType,null,i,l,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return bs._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const l of r)i=bs._pushAttributed(i,l,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),l=t.scopePath.push(n),o=r.themeProvider.themeMatch(l),c=bs.mergeAttributes(t.tokenAttributes,i,o);return new bs(t,l,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var i;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},Ua,Mg=(Ua=class{constructor(t,n,r,i,l,o,c,f){fe(this,"_stackElementBrand");fe(this,"_enterPos");fe(this,"_anchorPos");fe(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:Ua._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Uc.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(){Ua._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,l,o,c){return new Ua(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 Ua(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=Uc.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Ua(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Uc.fromExtension(r,n.contentNameScopesList))}},fe(Ua,"NULL",new Ua(null,0,0,0,!1,null,null,null)),Ua),U4=class{constructor(e,t){fe(this,"balancedBracketScopes");fe(this,"unbalancedBracketScopes");fe(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ph(n,xh).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>ph(n,xh).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}},H4=class{constructor(e,t,n,r){fe(this,"_emitBinaryTokens");fe(this,"_lineText");fe(this,"_tokens");fe(this,"_binaryTokens");fe(this,"_lastTokenEndIndex");fe(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=mu.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(l=this.balancedBracketSelectors.match(o))}if(l&&(i=mu.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}},F4=class{constructor(e,t){fe(this,"_grammars",new Map);fe(this,"_rawGrammars",new Map);fe(this,"_injectionGrammars",new Map);fe(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,M4(e,l,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},z4=class{constructor(t){fe(this,"_options");fe(this,"_syncRegistry");fe(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new F4(mh.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(mh.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 U4(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,l){const o=new b4(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)}},Pg=Mg.NULL;const Lk=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class fd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}fd.prototype.normal={};fd.prototype.property={};fd.prototype.space=void 0;function Ik(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new fd(n,r,t)}function td(e){return e.toLowerCase()}class ra{constructor(t,n){this.attribute=n,this.property=t}}ra.prototype.attribute="";ra.prototype.booleanish=!1;ra.prototype.boolean=!1;ra.prototype.commaOrSpaceSeparated=!1;ra.prototype.commaSeparated=!1;ra.prototype.defined=!1;ra.prototype.mustUseProperty=!1;ra.prototype.number=!1;ra.prototype.overloadedBoolean=!1;ra.prototype.property="";ra.prototype.spaceSeparated=!1;ra.prototype.space=void 0;let $4=0;const St=ho(),Zn=ho(),Bg=ho(),Oe=ho(),Tn=ho(),cu=ho(),fa=ho();function ho(){return 2**++$4}const Ug=Object.freeze(Object.defineProperty({__proto__:null,boolean:St,booleanish:Zn,commaOrSpaceSeparated:fa,commaSeparated:cu,number:Oe,overloadedBoolean:Bg,spaceSeparated:Tn},Symbol.toStringTag,{value:"Module"})),D0=Object.keys(Ug);class B1 extends ra{constructor(t,n,r,i){let l=-1;if(super(t,n),Y2(this,"space",i),typeof r=="number")for(;++l<D0.length;){const o=D0[l];Y2(this,D0[l],(r&Ug[o])===Ug[o])}}}B1.prototype.defined=!0;function Y2(e,t,n){n&&(e[t]=n)}function Tu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new B1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[td(r)]=r,n[td(l.attribute)]=r}return new fd(t,n,e.space)}const Ok=Tu({properties:{ariaActiveDescendant:null,ariaAtomic:Zn,ariaAutoComplete:null,ariaBusy:Zn,ariaChecked:Zn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Tn,ariaCurrent:null,ariaDescribedBy:Tn,ariaDetails:null,ariaDisabled:Zn,ariaDropEffect:Tn,ariaErrorMessage:null,ariaExpanded:Zn,ariaFlowTo:Tn,ariaGrabbed:Zn,ariaHasPopup:null,ariaHidden:Zn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Tn,ariaLevel:Oe,ariaLive:null,ariaModal:Zn,ariaMultiLine:Zn,ariaMultiSelectable:Zn,ariaOrientation:null,ariaOwns:Tn,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Zn,ariaReadOnly:Zn,ariaRelevant:null,ariaRequired:Zn,ariaRoleDescription:Tn,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Zn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Dk(e,t){return t in e?e[t]:t}function jk(e,t){return Dk(e,t.toLowerCase())}const V4=Tu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:cu,acceptCharset:Tn,accessKey:Tn,action:null,allow:null,allowFullScreen:St,allowPaymentRequest:St,allowUserMedia:St,alt:null,as:null,async:St,autoCapitalize:null,autoComplete:Tn,autoFocus:St,autoPlay:St,blocking:Tn,capture:null,charSet:null,checked:St,cite:null,className:Tn,cols:Oe,colSpan:null,content:null,contentEditable:Zn,controls:St,controlsList:Tn,coords:Oe|cu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:St,defer:St,dir:null,dirName:null,disabled:St,download:Bg,draggable:Zn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:St,formTarget:null,headers:Tn,height:Oe,hidden:Bg,high:Oe,href:null,hrefLang:null,htmlFor:Tn,httpEquiv:Tn,id:null,imageSizes:null,imageSrcSet:null,inert:St,inputMode:null,integrity:null,is:null,isMap:St,itemId:null,itemProp:Tn,itemRef:Tn,itemScope:St,itemType:Tn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:St,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:St,muted:St,name:null,nonce:null,noModule:St,noValidate:St,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:St,optimum:Oe,pattern:null,ping:Tn,placeholder:null,playsInline:St,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:St,referrerPolicy:null,rel:Tn,required:St,reversed:St,rows:Oe,rowSpan:Oe,sandbox:Tn,scope:null,scoped:St,seamless:St,selected:St,shadowRootClonable:St,shadowRootDelegatesFocus:St,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Zn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:St,useMap:null,value:Zn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Tn,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:St,declare:St,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:St,noHref:St,noShade:St,noWrap:St,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Zn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:St,disableRemotePlayback:St,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:jk}),G4=Tu({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:fa,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Tn,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:St,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:cu,g2:cu,glyphName:cu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:fa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Tn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fa,rev:fa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fa,requiredFeatures:fa,requiredFonts:fa,requiredFormats:fa,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:fa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fa,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dk}),Mk=Tu({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()}}),Pk=Tu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jk}),Bk=Tu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),q4={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"},Y4=/[A-Z]/g,W2=/-[a-z]/g,W4=/^data[-\w.:]+$/i;function hd(e,t){const n=td(t);let r=t,i=ra;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&W4.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(W2,X4);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!W2.test(l)){let o=l.replace(Y4,Q4);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=B1}return new i(r,t)}function Q4(e){return"-"+e.toLowerCase()}function X4(e){return e.charAt(1).toUpperCase()}const vu=Ik([Ok,V4,Mk,Pk,Bk],"html"),ks=Ik([Ok,G4,Mk,Pk,Bk],"svg"),Q2={}.hasOwnProperty;function U1(e,t){const n=t||{};function r(i,...l){let o=r.invalid;const c=r.handlers;if(i&&Q2.call(i,e)){const f=String(i[e]);o=Q2.call(c,f)?c[f]:r.unknown}if(o)return o.call(this,i,...l)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const K4=/["&'<>`]/g,Z4=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,J4=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,eL=/[|\\{}()[\]^$+*?.]/g,X2=new WeakMap;function tL(e,t){if(e=e.replace(t.subset?nL(t.subset):K4,r),t.subset||t.escapeOnly)return e;return e.replace(Z4,n).replace(J4,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 nL(e){let t=X2.get(e);return t||(t=rL(e),X2.set(e,t)),t}function rL(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(eL,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const aL=/[\dA-Fa-f]/;function sL(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!aL.test(String.fromCharCode(t))?r:r+";"}const iL=/\d/;function lL(e,t,n){const r="&#"+String(e);return n&&t&&!iL.test(String.fromCharCode(t))?r:r+";"}const oL=["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"],j0={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:"€"},uL=["cent","copy","divide","gt","lt","not","para","times"],Uk={}.hasOwnProperty,Hg={};let Lf;for(Lf in j0)Uk.call(j0,Lf)&&(Hg[j0[Lf]]=Lf);const cL=/[^\dA-Za-z]/;function dL(e,t,n,r){const i=String.fromCharCode(e);if(Uk.call(Hg,i)){const l=Hg[i],o="&"+l;return n&&oL.includes(l)&&!uL.includes(l)&&(!r||t&&t!==61&&cL.test(String.fromCharCode(t)))?o:o+";"}return""}function fL(e,t,n){let r=sL(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=dL(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const l=lL(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function du(e,t){return tL(e,Object.assign({format:fL},t))}const hL=/^>|^->|<!--|-->|--!>|<!-$/g,mL=[">"],pL=["<",">"];function gL(e,t,n,r){return r.settings.bogusComments?"<?"+du(e.value,Object.assign({},r.settings.characterReferences,{subset:mL}))+">":"<!--"+e.value.replace(hL,i)+"-->";function i(l){return du(l,Object.assign({},r.settings.characterReferences,{subset:pL}))}}function bL(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function yh(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 K2(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 H1(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Z2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function F1(e){return e.join(" ").trim()}const xL=/[ \t\n\f\r]/g;function qh(e){return typeof e=="object"?e.type==="text"?J2(e.value):!1:J2(e)}function J2(e){return e.replace(xL,"")===""}const dr=Fk(1),Hk=Fk(-1),yL=[];function Fk(e){return t;function t(n,r,i){const l=n?n.children:yL;let o=(r||0)+e,c=l[o];if(!i)for(;c&&qh(c);)o+=e,c=l[o];return c}}const EL={}.hasOwnProperty;function zk(e){return t;function t(n,r,i){return EL.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const z1=zk({body:TL,caption:M0,colgroup:M0,dd:CL,dt:wL,head:M0,html:_L,li:kL,optgroup:SL,option:NL,p:vL,rp:e_,rt:e_,tbody:RL,td:t_,tfoot:LL,th:t_,thead:AL,tr:IL});function M0(e,t,n){const r=dr(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&qh(r.value.charAt(0)))}function _L(e,t,n){const r=dr(n,t);return!r||r.type!=="comment"}function TL(e,t,n){const r=dr(n,t);return!r||r.type!=="comment"}function vL(e,t,n){const r=dr(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 kL(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&r.tagName==="li"}function wL(e,t,n){const r=dr(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function CL(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function e_(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function SL(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function NL(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function AL(e,t,n){const r=dr(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function RL(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function LL(e,t,n){return!dr(n,t)}function IL(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function t_(e,t,n){const r=dr(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const OL=zk({body:ML,colgroup:PL,head:jL,html:DL,tbody:BL});function DL(e){const t=dr(e,-1);return!t||t.type!=="comment"}function jL(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 ML(e){const t=dr(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&qh(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function PL(e,t,n){const r=Hk(n,t),i=dr(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&z1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function BL(e,t,n){const r=Hk(n,t),i=dr(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&z1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const If={name:[[`
97
+ \f\r &/=>`.split(""),`
98
+ \f\r "&'/=>\``.split("")],[`\0
99
+ \f\r "&'/<=>`.split(""),`\0
100
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
101
+ \f\r &>`.split(""),`\0
102
+ \f\r "&'<=>\``.split("")],[`\0
103
+ \f\r "&'<=>\``.split(""),`\0
104
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function UL(e,t,n,r){const i=r.schema,l=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const c=[];let f;i.space==="html"&&e.tagName==="svg"&&(r.schema=ks);const h=HL(r,e.properties),g=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,g&&(o=!1),(h||!l||!OL(e,t,n))&&(c.push("<",e.tagName,h?" "+h:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(f=h.charAt(h.length-1),(!r.settings.tightSelfClosing||f==="/"||f&&f!=='"'&&f!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(g),!o&&(!l||!z1(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function HL(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=FL(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 FL(e,t,n){const r=hd(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let o=e.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const f=du(r.attribute,Object.assign({},e.settings.characterReferences,{subset:If.name[i][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?H1:F1)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(c=du(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:If.unquoted[i][l]}))),c!==n&&(e.settings.quoteSmart&&yh(n,o)>yh(n,e.alternative)&&(o=e.alternative),c=o+du(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?If.single:If.double)[i][l],attribute:!0}))+o),f+(c&&"="+c))}const zL=["<","&"];function $k(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:du(e.value,Object.assign({},r.settings.characterReferences,{subset:zL}))}function $L(e,t,n,r){return r.settings.allowDangerousHtml?e.value:$k(e,t,n,r)}function VL(e,t,n,r){return r.all(e)}const GL=U1("type",{invalid:qL,unknown:YL,handlers:{comment:gL,doctype:bL,element:UL,raw:$L,root:VL,text:$k}});function qL(e){throw new Error("Expected node, not `"+e+"`")}function YL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const WL={},QL={},XL=[];function KL(e,t){const n=t||WL,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ZL,all:JL,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||Lk,characterReferences:n.characterReferences||QL,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ks:vu,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ZL(e,t,n){return GL(e,t,n,this)}function JL(e){const t=[],n=e&&e.children||XL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function Eh(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 ul(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function eI(e){return Array.isArray(e)?e:[e]}async function Vk(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function $1(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Gk(e){return e==="ansi"||$1(e)}function V1(e){return e==="none"}function qk(e){return V1(e)}function Yk(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 Yh(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 tI(e){const t=Yh(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 G1="light-dark()",nI=["color","background-color"];function rI(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 aI(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?rI(i,l):i})):e}function sI(e,t,n,r,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(g=>_h(e.variants[g])),c=new Set(o.flatMap(g=>Object.keys(g))),f={},h=(g,p)=>{const x=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+t[g]+(p==="color"?"":x)};return o.forEach((g,p)=>{for(const x of c){const E=g[x]||"inherit";if(p===0&&r&&nI.includes(x))if(r===G1&&o.length>1){const v=t.findIndex(O=>O==="light"),C=t.findIndex(O=>O==="dark");if(v===-1||C===-1)throw new Jn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const S=o[v][x]||"inherit",w=o[C][x]||"inherit";f[x]=`light-dark(${S}, ${w})`,i==="css-vars"&&(f[h(p,x)]=E)}else f[x]=E;else i==="css-vars"&&(f[h(p,x)]=E)}}),l.htmlStyle=f,l}function _h(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Nr.Italic&&(t["font-style"]="italic"),e.fontStyle&Nr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Nr.Underline&&n.push("underline"),e.fontStyle&Nr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Fg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Wk=new WeakMap;function Wh(e,t){Wk.set(e,t)}function nd(e){return Wk.get(e)}class ku{constructor(...t){fe(this,"_stacks",{});fe(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 ku(Object.fromEntries(eI(n).map(r=>[r,Pg])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return iI(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function iI(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 lI(e,t){if(!(e instanceof ku))throw new Jn("Invalid grammar state");return e.getInternalStack(t)}function oI(){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 Jn(`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 Jn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let f=o.character;if(f<0&&(f=c.length+f),f<0||f>c.length)throw new Jn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:f,offset:i.posToIndex(o.line,f)}}};const i=tI(n.source),l=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));uI(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 aI(n,i)},code(n){var g;if(!((g=this.options.decorations)!=null&&g.length))return;const r=t(this),i=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==r.converter.lines.length)throw new Jn(`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(p,x,E,v){const C=i[p];let S="",w=-1,O=-1;if(x===0&&(w=0),E===0&&(O=0),E===Number.POSITIVE_INFINITY&&(O=C.children.length),w===-1||O===-1)for(let j=0;j<C.children.length;j++)S+=Qk(C.children[j]),w===-1&&S.length===x&&(w=j+1),O===-1&&S.length===E&&(O=j+1);if(w===-1)throw new Jn(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(O===-1)throw new Jn(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const R=C.children.slice(w,O);if(!v.alwaysWrap&&R.length===C.children.length)c(C,v,"line");else if(!v.alwaysWrap&&R.length===1&&R[0].type==="element")c(R[0],v,"token");else{const j={type:"element",tagName:"span",properties:{},children:R};c(j,v,"wrapper"),C.children.splice(w,R.length,j)}}function o(p,x){i[p]=c(i[p],x,"line")}function c(p,x,E){var S;const v=x.properties||{},C=x.transform||(w=>w);return p.tagName=x.tagName||"span",p.properties={...p.properties,...v,class:p.properties.class},(S=x.properties)!=null&&S.class&&Yk(p,x.properties.class),p=C(p,E)||p,p}const f=[],h=r.decorations.sort((p,x)=>x.start.offset-p.start.offset||p.end.offset-x.end.offset);for(const p of h){const{start:x,end:E}=p;if(x.line===E.line)l(x.line,x.character,E.character,p);else if(x.line<E.line){l(x.line,x.character,Number.POSITIVE_INFINITY,p);for(let v=x.line+1;v<E.line;v++)f.unshift(()=>o(v,p));l(E.line,0,E.character,p)}}f.forEach(p=>p())}}}function uI(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Jn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],l=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,c=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,f=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(l||o||c||f){if(l&&o||c&&f||c&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new Jn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function Qk(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Qk).join(""):""}const cI=[oI()];function Th(e){const t=dI(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...cI]}function dI(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 to=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],P0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function fI(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 n_(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 hI(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)P0[r]&&t.push({type:"setDecoration",value:P0[r]});else if(r<=29){const i=P0[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:to[r-30]}});else if(r===38){const i=n_(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:to[r-40]}});else if(r===48){const i=n_(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:to[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:to[r-100+8]}})}return t}function mI(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let l=0;do{const o=fI(r,l),c=o.sequence?r.substring(l,o.startPosition):r.substring(l);if(c.length>0&&i.push({value:c,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const f=hI(o.sequence);for(const h of f)h.type==="resetAll"?(e=null,t=null,n.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?t=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of f)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&n.add(h.value)}l=o.position}while(l<r.length);return i}}}var pI={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 gI(e=pI){function t(c){return e[c]}function n(c){return`#${c.map(f=>Math.max(0,Math.min(f,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let h=0;h<to.length;h++)r.push(t(to[h]));let c=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let g=0;g<6;g++)for(let p=0;p<6;p++)r.push(n([c[h],c[g],c[p]]));let f=8;for(let h=0;h<24;h++,f+=10)r.push(n([f,f,f]));return r}function l(c){return i()[c]}function o(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return l(c.index)}}return{value:o}}const bI={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 xI(e,t,n){const r=Eh(e,n),i=Yh(t),l=Object.fromEntries(to.map(f=>{var p;const h=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`,g=(p=e.colors)==null?void 0:p[h];return[f,g||bI[f]]})),o=gI(l),c=mI();return i.map(f=>c.parse(f[0]).map(h=>{let g,p;h.decorations.has("reverse")?(g=h.background?o.value(h.background):e.bg,p=h.foreground?o.value(h.foreground):e.fg):(g=h.foreground?o.value(h.foreground):e.fg,p=h.background?o.value(h.background):void 0),g=ul(g,r),p=ul(p,r),h.decorations.has("dim")&&(g=yI(g));let x=Nr.None;return h.decorations.has("bold")&&(x|=Nr.Bold),h.decorations.has("italic")&&(x|=Nr.Italic),h.decorations.has("underline")&&(x|=Nr.Underline),h.decorations.has("strikethrough")&&(x|=Nr.Strikethrough),{content:h.value,offset:f[1],color:g,bgColor:p,fontStyle:x}}))}function yI(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],l=r[1],o=r[2],c=r[3],f=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${l}${l}${o}${o}${f}`}else if(r.length===3){const i=r[0],l=r[1],o=r[2];return`#${i}${i}${l}${l}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function q1(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if($1(i)||V1(r))return Yh(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:l,colorMap:o}=e.setTheme(r);if(i==="ansi")return xI(l,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new Jn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(l.name))throw new Jn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return _I(t,c,l,o,n)}function EI(...e){if(e.length===2)return nd(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=r;if($1(i)||V1(l))throw new Jn("Plain language does not have grammar state");if(i==="ansi")throw new Jn("ANSI language does not have grammar state");const{theme:o,colorMap:c}=t.setTheme(l),f=t.getLanguage(i);return new ku(Y1(n,f,o,c,r).stateStack,f.name,o.name)}function _I(e,t,n,r,i){const l=Y1(e,t,n,r,i),o=new ku(l.stateStack,t.name,n.name);return Wh(l.tokens,o),l.tokens}function Y1(e,t,n,r,i){const l=Eh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500}=i,f=Yh(e);let h=i.grammarState?lI(i.grammarState,n.name)??Pg:i.grammarContextCode!=null?Y1(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Pg,g=[];const p=[];for(let x=0,E=f.length;x<E;x++){const[v,C]=f[x];if(v===""){g=[],p.push([]);continue}if(o>0&&v.length>=o){g=[],p.push([{content:v,offset:C,color:"",fontStyle:0}]);continue}let S,w,O;i.includeExplanation&&(S=t.tokenizeLine(v,h,c),w=S.tokens,O=0);const R=t.tokenizeLine2(v,h,c),j=R.tokens.length/2;for(let G=0;G<j;G++){const N=R.tokens[2*G],P=G+1<j?R.tokens[2*G+2]:v.length;if(N===P)continue;const $=R.tokens[2*G+1],ne=ul(r[mu.getForeground($)],l),W=mu.getFontStyle($),me={content:v.substring(N,P),offset:C+N,color:ne,fontStyle:W};if(i.includeExplanation){const Q=[];if(i.includeExplanation!=="scopeName")for(const de of n.settings){let se;switch(typeof de.scope){case"string":se=de.scope.split(/,/).map(H=>H.trim());break;case"object":se=de.scope;break;default:continue}Q.push({settings:de,selectors:se.map(H=>H.split(/ /))})}me.explanation=[];let _e=0;for(;N+_e<P;){const de=w[O],se=v.substring(de.startIndex,de.endIndex);_e+=se.length,me.explanation.push({content:se,scopes:i.includeExplanation==="scopeName"?TI(de.scopes):vI(Q,de.scopes)}),O+=1}}g.push(me)}p.push(g),g=[],h=R.ruleStack}return{tokens:p,stateStack:h}}function TI(e){return e.map(t=>({scopeName:t}))}function vI(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const l=t[r];n[r]={scopeName:l,themeMatches:wI(e,l,t.slice(0,r))}}return n}function r_(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function kI(e,t,n){if(!r_(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)r_(e[r],n[i])&&(r-=1),i-=1;return r===-1}function wI(e,t,n){const r=[];for(const{selectors:i,settings:l}of e)for(const o of i)if(kI(o,t,n)){r.push(l);break}return r}function Xk(e,t,n){const r=Object.entries(n.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),i=r.map(f=>{const h=q1(e,t,{...n,theme:f.theme}),g=nd(h),p=typeof f.theme=="string"?f.theme:f.theme.name;return{tokens:h,state:g,theme:p}}),l=CI(...i.map(f=>f.tokens)),o=l[0].map((f,h)=>f.map((g,p)=>{const x={content:g.content,variants:{},offset:g.offset};return"includeExplanation"in n&&n.includeExplanation&&(x.explanation=g.explanation),l.forEach((E,v)=>{const{content:C,explanation:S,offset:w,...O}=E[h][p];x.variants[r[v].color]=O}),x})),c=i[0].state?new ku(Object.fromEntries(i.map(f=>{var h;return[f.theme,(h=f.state)==null?void 0:h.getInternalStack(f.theme)]})),i[0].state.lang):void 0;return c&&Wh(o,c),o}function CI(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(f=>f[r]),l=t.map(()=>[]);t.forEach((f,h)=>f.push(l[h]));const o=i.map(()=>0),c=i.map(f=>f[0]);for(;c.every(f=>f);){const f=Math.min(...c.map(h=>h.content.length));for(let h=0;h<n;h++){const g=c[h];g.content.length===f?(l[h].push(g),o[h]+=1,c[h]=i[h][o[h]]):(l[h].push({...g,content:g.content.slice(0,f)}),c[h]={...g,content:g.content.slice(f),offset:g.offset+f})}}}return t}function vh(e,t,n){let r,i,l,o,c,f;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:g="--shiki-",colorsRendering:p="css-vars"}=n,x=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,O)=>w.color===h?-1:O.color===h?1:0);if(x.length===0)throw new Jn("`themes` option must not be empty");const E=Xk(e,t,n);if(f=nd(E),h&&G1!==h&&!x.find(w=>w.color===h))throw new Jn(`\`themes\` option must contain the defaultColor key \`${h}\``);const v=x.map(w=>e.getTheme(w.theme)),C=x.map(w=>w.color);l=E.map(w=>w.map(O=>sI(O,C,g,h,p))),f&&Wh(l,f);const S=x.map(w=>Eh(w.theme,n));i=a_(x,v,S,g,h,"fg",p),r=a_(x,v,S,g,h,"bg",p),o=`shiki-themes ${v.map(w=>w.name).join(" ")}`,c=h?void 0:[i,r].join(";")}else if("theme"in n){const h=Eh(n.theme,n);l=q1(e,t,n);const g=e.getTheme(n.theme);r=ul(g.bg,h),i=ul(g.fg,h),o=g.name,f=nd(l)}else throw new Jn("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:i,bg:r,themeName:o,rootStyle:c,grammarState:f}}function a_(e,t,n,r,i,l,o){return e.map((c,f)=>{const h=ul(t[f][l],n[f])||"inherit",g=`${r+c.color}${l==="bg"?"-bg":""}:${h}`;if(f===0&&i){if(i===G1&&e.length>1){const p=e.findIndex(C=>C.color==="light"),x=e.findIndex(C=>C.color==="dark");if(p===-1||x===-1)throw new Jn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=ul(t[p][l],n[p])||"inherit",v=ul(t[x][l],n[x])||"inherit";return`light-dark(${E}, ${v});${g}`}return h}return o==="css-vars"?g:null}).filter(c=>!!c).join(";")}function kh(e,t,n,r={meta:{},options:n,codeToHast:(i,l)=>kh(e,i,l),codeToTokens:(i,l)=>vh(e,i,l)}){var v,C;let i=t;for(const S of Th(n))i=((v=S.preprocess)==null?void 0:v.call(r,i,n))||i;let{tokens:l,fg:o,bg:c,themeName:f,rootStyle:h,grammarState:g}=vh(e,i,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:x=!1}=n;p===!0?l=NI(l):p==="never"&&(l=AI(l)),x&&(l=RI(l));const E={...r,get source(){return i}};for(const S of Th(n))l=((C=S.tokens)==null?void 0:C.call(E,l))||l;return SI(l,{...n,fg:o,bg:c,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??h},E,g)}function SI(e,t,n,r=nd(e)){var C,S,w,O;const i=Th(t),l=[],o={type:"root",children:[]},{structure:c="classic",tabindex:f="0"}=t,h={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?h.style=t.rootStyle:h.style=`background-color:${t.bg};color:${t.fg}`),f!==!1&&f!=null&&(h.tabindex=f.toString());for(const[R,j]of Object.entries(t.meta||{}))R.startsWith("_")||(h[R]=j);let g={type:"element",tagName:"pre",properties:h,children:[],data:t.data},p={type:"element",tagName:"code",properties:{},children:l};const x=[],E={...n,structure:c,addClassToHast:Yk,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return g},get code(){return p},get lines(){return x}};if(e.forEach((R,j)=>{var P,$;j&&(c==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&l.push({type:"text",value:`
105
+ `}));let G={type:"element",tagName:"span",properties:{class:"line"},children:[]},N=0;for(const ne of R){let W={type:"element",tagName:"span",properties:{...ne.htmlAttrs},children:[{type:"text",value:ne.content}]};const me=Fg(ne.htmlStyle||_h(ne));me&&(W.properties.style=me);for(const Q of i)W=((P=Q==null?void 0:Q.span)==null?void 0:P.call(E,W,j+1,N,G,ne))||W;c==="inline"?o.children.push(W):c==="classic"&&G.children.push(W),N+=ne.content.length}if(c==="classic"){for(const ne of i)G=(($=ne==null?void 0:ne.line)==null?void 0:$.call(E,G,j+1))||G;x.push(G),l.push(G)}else c==="inline"&&x.push(G)}),c==="classic"){for(const R of i)p=((C=R==null?void 0:R.code)==null?void 0:C.call(E,p))||p;g.children.push(p);for(const R of i)g=((S=R==null?void 0:R.pre)==null?void 0:S.call(E,g))||g;o.children.push(g)}else if(c==="inline"){const R=[];let j={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const P of o.children)P.type==="element"&&P.tagName==="br"?(R.push(j),j={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(P.type==="element"||P.type==="text")&&j.children.push(P);R.push(j);let N={type:"element",tagName:"code",properties:{},children:R};for(const P of i)N=((w=P==null?void 0:P.code)==null?void 0:w.call(E,N))||N;o.children=[];for(let P=0;P<N.children.length;P++){P>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const $=N.children[P];$.type==="element"&&o.children.push(...$.children)}}let v=o;for(const R of i)v=((O=R==null?void 0:R.root)==null?void 0:O.call(E,v))||v;return r&&Wh(v,r),v}function NI(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((l,o)=>{const f=!(l.fontStyle&&(l.fontStyle&Nr.Underline||l.fontStyle&Nr.Strikethrough));f&&l.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=l.offset),r+=l.content):r?(f?n.push({...l,offset:i,content:r+l.content}):n.push({content:r,offset:i},l),i=void 0,r=""):n.push(l)}),n})}function AI(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 RI(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=Fg(i.htmlStyle||_h(i)),o=Fg(r.htmlStyle||_h(r)),c=i.fontStyle&&(i.fontStyle&Nr.Underline||i.fontStyle&Nr.Strikethrough),f=r.fontStyle&&(r.fontStyle&Nr.Underline||r.fontStyle&Nr.Strikethrough);!c&&!f&&l===o?i.content+=r.content:n.push({...r})}return n})}const LI=KL;function II(e,t,n){var l;const r={meta:{},options:n,codeToHast:(o,c)=>kh(e,o,c),codeToTokens:(o,c)=>vh(e,o,c)};let i=LI(kh(e,t,n,r));for(const o of Th(n))i=((l=o.postprocess)==null?void 0:l.call(r,i,n))||i;return i}const s_={light:"#333333",dark:"#bbbbbb"},i_={light:"#fffffe",dark:"#1e1e1e"},l_="__shiki_resolved";function W1(e){var c,f,h,g,p;if(e!=null&&e[l_])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const x=t.settings?t.settings.find(E=>!E.name&&!E.scope):void 0;(c=x==null?void 0:x.settings)!=null&&c.foreground&&(r=x.settings.foreground),(f=x==null?void 0:x.settings)!=null&&f.background&&(n=x.settings.background),!r&&((h=t==null?void 0:t.colors)!=null&&h["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((g=t==null?void 0:t.colors)!=null&&g["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?s_.light:s_.dark),n||(n=t.type==="light"?i_.light:i_.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const l=new Map;function o(x){var v;if(l.has(x))return l.get(x);i+=1;const E=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(v=t.colorReplacements)!=null&&v[`#${E}`]?o(x):(l.set(x,E),E)}t.settings=t.settings.map(x=>{var S,w;const E=((S=x.settings)==null?void 0:S.foreground)&&!x.settings.foreground.startsWith("#"),v=((w=x.settings)==null?void 0:w.background)&&!x.settings.background.startsWith("#");if(!E&&!v)return x;const C={...x,settings:{...x.settings}};if(E){const O=o(x.settings.foreground);t.colorReplacements[O]=x.settings.foreground,C.settings.foreground=O}if(v){const O=o(x.settings.background);t.colorReplacements[O]=x.settings.background,C.settings.background=O}return C});for(const x of Object.keys(t.colors||{}))if((x==="editor.foreground"||x==="editor.background"||x.startsWith("terminal.ansi"))&&!((p=t.colors[x])!=null&&p.startsWith("#"))){const E=o(t.colors[x]);t.colorReplacements[E]=t.colors[x],t.colors[x]=E}return Object.defineProperty(t,l_,{enumerable:!1,writable:!1,value:!0}),t}async function Kk(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Gk(t)).map(async t=>await Vk(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Zk(e){return(await Promise.all(e.map(async n=>qk(n)?null:W1(await Vk(n))))).filter(n=>!!n)}let OI=3;function DI(e,t=3){t>OI||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let lu=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Jk(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 lu(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class jI extends z4{constructor(n,r,i,l={}){super(n);fe(this,"_resolvedThemes",new Map);fe(this,"_resolvedGrammars",new Map);fe(this,"_langMap",new Map);fe(this,"_langGraph",new Map);fe(this,"_textmateThemeCache",new WeakMap);fe(this,"_loadedThemesCache",null);fe(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=W1(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=mh.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=Jk(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var o,c,f,h;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(g=>{var p;return(p=g.embeddedLangsLazy)==null?void 0:p.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(g=>{this._alias[g]=n.name}),this._loadedLanguagesCache=null,r.size)for(const g of r)this._resolvedGrammars.delete(g.name),this._loadedLanguagesCache=null,(c=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||c.delete(g.scopeName),(h=(f=this._syncRegistry)==null?void 0:f._grammars)==null||h.delete(g.scopeName),this.loadLanguage(this._langMap.get(g.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const l of n)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),i=r.filter(([l,o])=>!o);if(i.length){const l=r.filter(([o,c])=>{if(!c)return!1;const f=c.embeddedLanguages||c.embeddedLangs;return f==null?void 0:f.some(h=>i.map(([g])=>g).includes(h))}).filter(o=>!i.includes(o));throw new lu(`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 MI{constructor(t,n){fe(this,"_langs",new Map);fe(this,"_scopeToLang",new Map);fe(this,"_injections",new Map);fe(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 Tc=0;function PI(e){Tc+=1,e.warnings!==!1&&Tc>=10&&Tc%10===0&&console.warn(`[Shiki] ${Tc} 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 lu("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(W1),i=new MI(e.engine,n),l=new jI(i,r,n,e.langAlias);let o;function c(R){return Jk(R,e.langAlias)}function f(R){w();const j=l.getGrammar(typeof R=="string"?R:R.name);if(!j)throw new lu(`Language \`${R}\` not found, you may need to load it first`);return j}function h(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const j=l.getTheme(R);if(!j)throw new lu(`Theme \`${R}\` not found, you may need to load it first`);return j}function g(R){w();const j=h(R);o!==R&&(l.setTheme(j),o=R);const G=l.getColorMap();return{theme:j,colorMap:G}}function p(){return w(),l.getLoadedThemes()}function x(){return w(),l.getLoadedLanguages()}function E(...R){w(),l.loadLanguages(R.flat(1))}async function v(...R){return E(await Kk(R))}function C(...R){w();for(const j of R.flat(1))l.loadTheme(j)}async function S(...R){return w(),C(await Zk(R))}function w(){if(t)throw new lu("Shiki instance has been disposed")}function O(){t||(t=!0,l.dispose(),Tc-=1)}return{setTheme:g,getTheme:h,getLanguage:f,getLoadedThemes:p,getLoadedLanguages:x,resolveLangAlias:c,loadLanguage:v,loadLanguageSync:E,loadTheme:S,loadThemeSync:C,dispose:O,[Symbol.dispose]:O}}async function BI(e){e.engine||DI("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Zk(e.themes||[]),Kk(e.langs||[]),e.engine]);return PI({...e,themes:t,langs:n,engine:r})}async function UI(e){const t=await BI(e);return{getLastGrammarState:(...n)=>EI(t,...n),codeToTokensBase:(n,r)=>q1(t,n,r),codeToTokensWithThemes:(n,r)=>Xk(t,n,r),codeToTokens:(n,r)=>vh(t,n,r),codeToHast:(n,r)=>kh(t,n,r),codeToHtml:(n,r)=>II(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function HI(e){const t=e.langs,n=e.themes,r=e.engine;async function i(l){function o(p){var x;if(typeof p=="string"){if(p=((x=l.langAlias)==null?void 0:x[p])||p,Gk(p))return[];const E=t[p];if(!E)throw new Jn(`Language \`${p}\` is not included in this bundle. You may want to load it from external source.`);return E}return p}function c(p){if(qk(p))return"none";if(typeof p=="string"){const x=n[p];if(!x)throw new Jn(`Theme \`${p}\` is not included in this bundle. You may want to load it from external source.`);return x}return p}const f=(l.themes??[]).map(p=>c(p)),h=(l.langs??[]).map(p=>o(p)),g=await UI({engine:l.engine??r(),...l,themes:f,langs:h});return{...g,loadLanguage(...p){return g.loadLanguage(...p.map(o))},loadTheme(...p){return g.loadTheme(...p.map(c))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const Q1=[{id:"abap",name:"ABAP",import:(()=>M(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>M(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>M(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>M(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>M(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>M(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>M(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>M(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>M(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>M(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>M(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>M(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>M(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>M(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>M(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>M(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>M(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>M(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>M(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>M(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>M(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>M(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>M(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>M(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>M(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>M(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>M(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>M(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>M(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>M(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>M(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>M(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>M(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>M(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>M(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>M(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>M(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>M(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>M(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>M(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>M(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>M(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>M(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>M(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>M(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>M(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>M(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>M(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>M(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>M(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>M(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>M(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>M(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>M(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>M(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>M(()=>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:(()=>M(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>M(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>M(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>M(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>M(()=>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:(()=>M(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>M(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>M(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>M(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>M(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>M(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>M(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>M(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>M(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>M(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>M(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>M(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>M(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>M(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>M(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>M(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>M(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>M(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>M(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>M(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>M(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>M(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>M(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>M(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>M(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>M(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>M(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>M(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>M(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>M(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>M(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>M(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>M(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>M(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>M(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>M(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>M(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>M(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>M(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>M(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>M(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>M(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>M(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>M(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>M(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>M(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>M(()=>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:(()=>M(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>M(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>M(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>M(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>M(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>M(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>M(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>M(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>M(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>M(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>M(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>M(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>M(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>M(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>M(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>M(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>M(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>M(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>M(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>M(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>M(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>M(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>M(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>M(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>M(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>M(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>M(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>M(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>M(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>M(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>M(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>M(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>M(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>M(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>M(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>M(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>M(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>M(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>M(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>M(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>M(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>M(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>M(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>M(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>M(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>M(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>M(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>M(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>M(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>M(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>M(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>M(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>M(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>M(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>M(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>M(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>M(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>M(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>M(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>M(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>M(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>M(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>M(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>M(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>M(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>M(()=>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:(()=>M(()=>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:(()=>M(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>M(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>M(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>M(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>M(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>M(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>M(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>M(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>M(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>M(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>M(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>M(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>M(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>M(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>M(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>M(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>M(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>M(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>M(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>M(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>M(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>M(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>M(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>M(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>M(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>M(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>M(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>M(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>M(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>M(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>M(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>M(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>M(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>M(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>M(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>M(()=>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:(()=>M(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>M(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>M(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>M(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>M(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>M(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>M(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>M(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>M(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>M(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>M(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>M(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>M(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>M(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>M(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>M(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>M(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>M(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>M(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>M(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>M(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>M(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>M(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>M(()=>import("./zig-VOosw3JB.js"),[]))}],FI=Object.fromEntries(Q1.map(e=>[e.id,e.import])),zI=Object.fromEntries(Q1.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),ew={...FI,...zI},$I=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>M(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>M(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>M(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>M(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>M(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>M(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>M(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>M(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>M(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>M(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>M(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>M(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>M(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>M(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>M(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>M(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>M(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>M(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>M(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>M(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>M(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>M(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>M(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>M(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>M(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>M(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>M(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>M(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>M(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>M(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>M(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>M(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>M(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>M(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>M(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>M(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>M(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>M(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>M(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>M(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>M(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>M(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>M(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>M(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>M(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>M(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>M(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>M(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>M(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>M(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>M(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>M(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>M(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>M(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>M(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>M(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>M(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>M(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>M(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>M(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>M(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>M(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>M(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>M(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>M(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],VI=Object.fromEntries($I.map(e=>[e.id,e.import]));class X1 extends Error{constructor(t){super(t),this.name="ShikiError"}}function GI(){return 2147483648}function qI(){return typeof performance<"u"?performance.now():Date.now()}const YI=(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,C){r.HEAPU8.copyWithin(E,v,v+C)}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 C=GI();if(E>C)return!1;for(let S=1;S<=4;S*=2){let w=v*(1+.2/S);w=Math.min(w,E+100663296);const O=Math.min(C,YI(Math.max(E,w),65536));if(o(O))return!0}return!1}const f=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(E,v,C=1024){const S=v+C;let w=v;for(;E[w]&&!(w>=S);)++w;if(w-v>16&&E.buffer&&f)return f.decode(E.subarray(v,w));let O="";for(;v<w;){let R=E[v++];if(!(R&128)){O+=String.fromCharCode(R);continue}const j=E[v++]&63;if((R&224)===192){O+=String.fromCharCode((R&31)<<6|j);continue}const G=E[v++]&63;if((R&240)===224?R=(R&15)<<12|j<<6|G:R=(R&7)<<18|j<<12|G<<6|E[v++]&63,R<65536)O+=String.fromCharCode(R);else{const N=R-65536;O+=String.fromCharCode(55296|N>>10,56320|N&1023)}}return O}function g(E,v){return E?h(r.HEAPU8,E,v):""}const p={emscripten_get_now:qI,emscripten_memcpy_big:l,emscripten_resize_heap:c,fd_write:()=>0};async function x(){const v=await e({env:p,wasi_snapshot_preview1:p});t=v.memory,i(t.buffer),Object.assign(r,v),r.UTF8ToString=g}return await x(),r}var QI=Object.defineProperty,XI=(e,t,n)=>t in e?QI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,or=(e,t,n)=>XI(e,typeof t!="symbol"?t+"":t,n);let pr=null;function KI(e){throw new X1(e.UTF8ToString(e.getLastOnigError()))}class Qh{constructor(t){or(this,"utf16Length"),or(this,"utf8Length"),or(this,"utf16Value"),or(this,"utf8Value"),or(this,"utf16OffsetToUtf8"),or(this,"utf8OffsetToUtf16");const n=t.length,r=Qh._utf8ByteLength(t),i=r!==n,l=i?new Uint32Array(n+1):null;i&&(l[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const c=new Uint8Array(r);let f=0;for(let h=0;h<n;h++){const g=t.charCodeAt(h);let p=g,x=!1;if(g>=55296&&g<=56319&&h+1<n){const E=t.charCodeAt(h+1);E>=56320&&E<=57343&&(p=(g-55296<<10)+65536|E-56320,x=!0)}i&&(l[h]=f,x&&(l[h+1]=f),p<=127?o[f+0]=h:p<=2047?(o[f+0]=h,o[f+1]=h):p<=65535?(o[f+0]=h,o[f+1]=h,o[f+2]=h):(o[f+0]=h,o[f+1]=h,o[f+2]=h,o[f+3]=h)),p<=127?c[f++]=p:p<=2047?(c[f++]=192|(p&1984)>>>6,c[f++]=128|(p&63)>>>0):p<=65535?(c[f++]=224|(p&61440)>>>12,c[f++]=128|(p&4032)>>>6,c[f++]=128|(p&63)>>>0):(c[f++]=240|(p&1835008)>>>18,c[f++]=128|(p&258048)>>>12,c[f++]=128|(p&4032)>>>6,c[f++]=128|(p&63)>>>0),x&&h++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=c,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const l=t.charCodeAt(r);let o=l,c=!1;if(l>=55296&&l<=56319&&r+1<i){const f=t.charCodeAt(r+1);f>=56320&&f<=57343&&(o=(l-55296<<10)+65536|f-56320,c=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,c&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Xh=class xs{constructor(t){if(or(this,"id",++xs.LAST_ID),or(this,"_onigBinding"),or(this,"content"),or(this,"utf16Length"),or(this,"utf8Length"),or(this,"utf16OffsetToUtf8"),or(this,"utf8OffsetToUtf16"),or(this,"ptr"),!pr)throw new X1("Must invoke loadWasm first.");this._onigBinding=pr,this.content=t;const n=new Qh(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!xs._sharedPtrInUse?(xs._sharedPtr||(xs._sharedPtr=pr.omalloc(1e4)),xs._sharedPtrInUse=!0,pr.HEAPU8.set(n.utf8Value,xs._sharedPtr),this.ptr=xs._sharedPtr):this.ptr=n.createString(pr)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===xs._sharedPtr?xs._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};or(Xh,"LAST_ID",0);or(Xh,"_sharedPtr",0);or(Xh,"_sharedPtrInUse",!1);let tw=Xh;class ZI{constructor(t){if(or(this,"_onigBinding"),or(this,"_ptr"),!pr)throw new X1("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,f=t.length;c<f;c++){const h=new Qh(t[c]);n[c]=h.createString(pr),r[c]=h.utf8Length}const i=pr.omalloc(4*t.length);pr.HEAPU32.set(n,i/4);const l=pr.omalloc(4*t.length);pr.HEAPU32.set(r,l/4);const o=pr.createOnigScanner(i,l,t.length);for(let c=0,f=t.length;c<f;c++)pr.ofree(n[c]);pr.ofree(l),pr.ofree(i),o===0&&KI(pr),this._onigBinding=pr,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 tw(t);const l=this._findNextMatchSync(t,n,!1,i);return t.dispose(),l}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const l=this._onigBinding,o=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const c=l.HEAPU32;let f=o/4;const h=c[f++],g=c[f++],p=[];for(let x=0;x<g;x++){const E=t.convertUtf8OffsetToUtf16(c[f++]),v=t.convertUtf8OffsetToUtf16(c[f++]);p[x]={start:E,end:v,length:v-E}}return{index:h,captureIndices:p}}}function JI(e){return typeof e.instantiator=="function"}function eO(e){return typeof e.default=="function"}function tO(e){return typeof e.data<"u"}function nO(e){return typeof Response<"u"&&e instanceof Response}function rO(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 Of;function aO(e){if(Of)return Of;async function t(){pr=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)),JI(r)?r=await r.instantiator(n):eO(r)?r=await r.default(n):(tO(r)&&(r=r.data),nO(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await sO(r)(n):r=await iO(r)(n):rO(r)?r=await B0(r)(n):r instanceof WebAssembly.Module?r=await B0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await B0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Of=t(),Of}function B0(e){return t=>WebAssembly.instantiate(e,t)}function sO(e){return t=>WebAssembly.instantiateStreaming(e,t)}function iO(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function lO(e){return e&&await aO(e),{createScanner(t){return new ZI(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new tw(t)}}}const oO=HI({langs:ew,themes:VI,engine:()=>lO(M(()=>import("./wasm-CG6Dc4jp.js"),[]))});function wu(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function uO(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const K1=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),gr=String.raw;function Cu(e,t){if(e==null)throw new Error(t??"Value expected");return e}const nw=gr`\[\^?`,rw=`c.? | C(?:-.?)?|${gr`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${gr`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${gr`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${gr`o\{[^\}]*\}?`}|${gr`\d{1,3}`}`,Z1=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Df=new RegExp(gr`
106
+ \\ (?:
107
+ ${rw}
108
+ | [gk]<[^>]*>?
109
+ | [gk]'[^']*'?
110
+ | .
111
+ )
112
+ | \( (?:
113
+ \? (?:
114
+ [:=!>({]
115
+ | <[=!]
116
+ | <[^>]*>
117
+ | '[^']*'
118
+ | ~\|?
119
+ | #(?:[^)\\]|\\.?)*
120
+ | [^:)]*[:)]
121
+ )?
122
+ | \*[^\)]*\)?
123
+ )?
124
+ | (?:${Z1.source})+
125
+ | ${nw}
126
+ | .
127
+ `.replace(/\s+/g,""),"gsu"),U0=new RegExp(gr`
128
+ \\ (?:
129
+ ${rw}
130
+ | .
131
+ )
132
+ | \[:(?:\^?\p{Alpha}+|\^):\]
133
+ | ${nw}
134
+ | &&
135
+ | .
136
+ `.replace(/\s+/g,""),"gsu");function cO(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=AO(n.flags),i=[r.extended],l={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(p){i.push(p)},replaceCurrentModX(p){i[i.length-1]=p},singleline:n.rules.singleline};let o=[],c;for(Df.lastIndex=0;c=Df.exec(e);){const p=dO(l,e,c[0],Df.lastIndex);p.tokens?o.push(...p.tokens):p.token&&o.push(p.token),p.lastIndex!==void 0&&(Df.lastIndex=p.lastIndex)}const f=[];let h=0;o.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++h:p.raw==="("&&f.push(p)}),h||f.forEach((p,x)=>{p.kind="capturing",p.number=x+1});const g=h||f.length;return{tokens:o.map(p=>p.type==="EscapedNumber"?LO(p,g):p).flat(),flags:r}}function dO(e,t,n,r){const[i,l]=n;if(n==="["||n==="[^"){const o=fO(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(l))return{token:o_(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:TO(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:sw(n)}}if(l==="K")return{token:iw("keep",n)};if(l==="N"||l==="R")return{token:no("newline",n,{negate:l==="N"})};if(l==="O")return{token:no("any",n)};if(l==="X")return{token:no("text_segment",n)};const o=aw(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(l==="*")return{token:CO(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:wO(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:au("group",n)};if(n==="(?>")return{token:au("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:au(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:au("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:au("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:yO(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
137
+ `,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:no("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":gr`\A`,$:gr`\Z`}[n]:n;return{token:o_(o,n)}}return n==="|"?{token:mO(n)}:Z1.test(n)?{tokens:IO(n)}:{token:mi(wu(n),n)}}function fO(e,t,n){const r=[u_(t[1]==="^",t)];let i=1,l;for(U0.lastIndex=n;l=U0.exec(e);){const o=l[0];if(o[0]==="["&&o[1]!==":")i++,r.push(u_(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(mi(93,o));else if(i--,r.push(pO(o)),!i)break}else{const c=hO(o);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:U0.lastIndex||e.length}}function hO(e){if(e[0]==="\\")return aw(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!K1.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return no("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?gO(e):e==="&&"?bO(e):mi(wu(e),e)}function aw(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return kO(e);if("dDhHsSwW".includes(n))return SO(e);if(e.startsWith(gr`\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 NO(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),l=new TextEncoder;return[...i].map(o=>{const c=[...l.encode(o)].map(f=>`\\x${f.toString(16)}`).join("");return mi(wu(o),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return mi(RO(e),e);if(c_.has(n))return mi(c_.get(n),e);if(/\d/.test(n))return xO(t,e);if(e==="\\")throw new Error(gr`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return mi(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function mO(e){return{type:"Alternator",raw:e}}function o_(e,t){return{type:"Assertion",kind:e,raw:t}}function sw(e){return{type:"Backreference",raw:e}}function mi(e,t){return{type:"Character",value:e,raw:t}}function pO(e){return{type:"CharacterClassClose",raw:e}}function gO(e){return{type:"CharacterClassHyphen",raw:e}}function bO(e){return{type:"CharacterClassIntersector",raw:e}}function u_(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function no(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function iw(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Cu(n.flags),raw:t}}function xO(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function yO(e){return{type:"GroupClose",raw:e}}function au(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function EO(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function _O(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function TO(e){return{type:"Subroutine",raw:e}}const vO=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),c_=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function kO(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 mi(wu(t.toUpperCase())-64,e)}function wO(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=f_(n),o=f_(r),c={};if(l&&(c.enable=l),o&&(c.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),iw("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,au("group",e,{...(l||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function CO(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const l=i?i.split(",").filter(g=>g!=="").map(g=>/^[+-]?\d+$/.test(g)?+g:g):[],[o,c,f]=l,h=vO.has(n)?n.toLowerCase():"custom";switch(h){case"fail":case"mismatch":case"skip":if(l.length>0)throw new Error(`Named callout arguments not allowed "${l}"`);break;case"error":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!l.length||l.length>2)throw new Error(`Named callout must have one or two arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(l.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(l.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(l.length!==3)throw new Error(`Named callout must have three arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${h}"`)}return EO(h,r??null,(i==null?void 0:i.split(","))??null,e)}function d_(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 _O(t,n,r,e)}function SO(e){const t=e[1].toLowerCase();return no({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function NO(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return no("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function f_(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 AO(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 RO(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 LO(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[sw(n)];const l=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const f=o[c];let h;if(c===0&&f!=="8"&&f!=="9"){if(h=parseInt(f,8),h>127)throw new Error(gr`Octal encoded byte above 177 unsupported "${n}"`)}else h=wu(f);l.push(mi(h,(c===0?"\\":"")+f))}return l}function IO(e){const t=[],n=new RegExp(Z1,"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(d_(i.slice(0,-1)));continue}}}t.push(d_(i))}return t}function lw(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 OO(e){return DO.has(e.type)}const DO=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function ow(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=cO(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(x,E)=>{const v=r.tokens[l.nextIndex];switch(l.parent=x,l.nextIndex++,v.type){case"Alternator":return lo();case"Assertion":return jO(v);case"Backreference":return MO(v,l);case"Character":return Kh(v.value,{useLastValid:!!E.isCheckingRangeEnd});case"CharacterClassHyphen":return PO(v,l,E);case"CharacterClassOpen":return BO(v,l,E);case"CharacterSet":return UO(v,l);case"Directive":return GO(v.kind,{flags:v.flags});case"GroupOpen":return HO(v,l,E);case"NamedCallout":return YO(v.kind,v.tag,v.arguments);case"Quantifier":return FO(v,l);case"Subroutine":return zO(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=QO(qO(r.flags));let c=o.body[0];for(;l.nextIndex<r.tokens.length;){const x=i(c,{});x.type==="Alternative"?(o.body.push(x),c=x):c.body.push(x)}const{capturingGroups:f,hasNumberedRef:h,namedGroupsByName:g,subroutines:p}=l;if(h&&g.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:x}of p)if(typeof x=="number"){if(x>f.length)throw new Error("Subroutine uses a group number that's not defined");x&&(f[x-1].isSubroutined=!0)}else if(g.has(x)){if(g.get(x).length>1)throw new Error(gr`Subroutine uses a duplicate group name "\g<${x}>"`);g.get(x)[0].isSubroutined=!0}else throw new Error(gr`Subroutine uses a group name that's not defined "\g<${x}>"`);return o}function jO({kind:e}){return zg(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===gr`\B`||e===gr`\Y`})}function MO({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(l,o=!1)=>{const c=t.capturingGroups.length;let f=!1;if(l>c)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,$g(o?c+1-l:l,{orphan:f})};if(n){const l=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(l)return i(+l.groups.num,!!l.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return $g(r)}return i(+r)}function PO(e,t,n){const{tokens:r,walk:i}=t,l=t.parent,o=l.body.at(-1),c=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const f=i(l,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&f.type==="Character")return l.body.pop(),VO(o,f);throw new Error("Invalid character class range")}return Kh(wu("-"))}function BO({negate:e},t,n){const{tokens:r,walk:i}=t,l=r[t.nextIndex],o=[lh()];let c=p_(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(lh()),t.nextIndex++;else{const h=o.at(-1);h.body.push(i(h,n))}c=p_(r[t.nextIndex],l)}const f=lh({negate:e});return o.length===1?f.body=o[0].body:(f.kind="intersection",f.body=o.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,f}function UO({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o}=r;if(e==="property"){const c=Zh(n);if(K1.has(c)&&!(o!=null&&o.has(c)))e="posix",n=c;else return su(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o})}return e==="posix"?WO(n,{negate:t}):Vg(e,{negate:t})}function HO(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:l,skipLookbehindValidation:o,walk:c}=t,f=XO(e),h=f.type==="AbsenceFunction",g=m_(f),p=g&&f.negate;if(f.type==="CapturingGroup"&&(i.push(f),f.name&&uO(l,f.name,[]).push(f)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let x=g_(r[t.nextIndex]);for(;x.type!=="GroupClose";){if(x.type==="Alternator")f.body.push(lo()),t.nextIndex++;else{const E=f.body.at(-1),v=c(E,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||g,isInNegLookbehind:n.isInNegLookbehind||p});if(E.body.push(v),(g||n.isInLookbehind)&&!o){const C="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(h_(v)||v.type==="CapturingGroup")throw new Error(C)}else if(h_(v)||m_(v)&&v.negate)throw new Error(C)}}x=g_(r[t.nextIndex])}return t.nextIndex++,f}function FO({kind:e,min:t,max:n},r){const i=r.parent,l=i.body.at(-1);if(!l||!OO(l))throw new Error("Quantifier requires a repeatable token");const o=cw(e,t,n,l);return i.body.pop(),o}function zO({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const l=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(l){const c=+l.groups.num,f=n.length;if(t.hasNumberedRef=!0,i={"":c,"+":f+c,"-":f+1-c}[l.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=dw(i);return r.push(o),o}function $O(e,t){return{type:"AbsenceFunction",kind:e,body:md(t==null?void 0:t.body)}}function lo(e){return{type:"Alternative",body:fw(e==null?void 0:e.body)}}function zg(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function $g(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function uw(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!KO(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:md(t==null?void 0:t.body)}}function Kh(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 lh(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:fw(e==null?void 0:e.body)}}function VO(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Vg(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 GO(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 qO(e){return{type:"Flags",...e}}function rs(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:md(e==null?void 0:e.body)}}function Zl(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:md(e==null?void 0:e.body)}}function YO(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function WO(e,t){const n=!!(t!=null&&t.negate);if(!K1.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function cw(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 QO(e,t){return{type:"Regex",body:md(t==null?void 0:t.body),flags:e}}function dw(e){return{type:"Subroutine",ref:e}}function su(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(Zh(e));if(!r){if(n.normalizeUnknownPropertyNames)r=ZO(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(gr`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function XO({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return $O("repeater");case"atomic":return rs({atomic:!0});case"capturing":return uw(i,{name:n});case"group":return rs({flags:e});case"lookahead":case"lookbehind":return Zl({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function md(e){if(e===void 0)e=[lo()];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 fw(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 h_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function m_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function KO(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function ZO(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 Zh(e){return e.replace(/[- _]+/g,"").toLowerCase()}function p_(e,t){return Cu(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function g_(e){return Cu(e,"Unclosed group")}function Hc(e,t,n=null){function r(l,o){for(let c=0;c<l.length;c++){const f=i(l[c],o,c,l);c=Math.max(-1,c+f)}}function i(l,o=null,c=null,f=null){var w,O;let h=0,g=!1;const p={node:l,parent:o,key:c,container:f,root:e,remove(){jf(f).splice(Math.max(0,Xo(c)+h),1),h--,g=!0},removeAllNextSiblings(){return jf(f).splice(Xo(c)+1)},removeAllPrevSiblings(){const R=Xo(c)+h;return h-=R,jf(f).splice(0,Math.max(0,R))},replaceWith(R,j={}){const G=!!j.traverse;f?f[Math.max(0,Xo(c)+h)]=R:Cu(o,"Can't replace root node")[c]=R,G&&i(R,o,c,f),g=!0},replaceWithMultiple(R,j={}){const G=!!j.traverse;if(jf(f).splice(Math.max(0,Xo(c)+h),1,...R),h+=R.length-1,G){let N=0;for(let P=0;P<R.length;P++)N+=i(R[P],o,Xo(c)+P+N,f)}g=!0},skip(){g=!0}},{type:x}=l,E=t["*"],v=t[x],C=typeof E=="function"?E:E==null?void 0:E.enter,S=typeof v=="function"?v:v==null?void 0:v.enter;if(C==null||C(p,n),S==null||S(p,n),!g)switch(x){case"AbsenceFunction":case"CapturingGroup":case"Group":r(l.body,l);break;case"Alternative":case"CharacterClass":r(l.body,l);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(l.min,l,"min"),i(l.max,l,"max");break;case"LookaroundAssertion":r(l.body,l);break;case"Quantifier":i(l.body,l,"body");break;case"Regex":r(l.body,l),i(l.flags,l,"flags");break;default:throw new Error(`Unexpected node type "${x}"`)}return(w=v==null?void 0:v.exit)==null||w.call(v,p,n),(O=E==null?void 0:E.exit)==null||O.call(E,p,n),h}return i(e),e}function jf(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Xo(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const JO=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function e8(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function t8(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Fa=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function J1(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let o=0,c="";for(const f of e.matchAll(i)){const{0:h,groups:{$skip:g}}=f;if(!g&&(!r||r===Fa.DEFAULT==!o)){n instanceof Function?c+=n(f,{context:o?Fa.CHAR_CLASS:Fa.DEFAULT,negated:l[l.length-1]}):c+=n;continue}h[0]==="["?(o++,l.push(h[1]==="^")):h==="]"&&o&&(o--,l.pop()),c+=h}return c}function hw(e,t,n,r){J1(e,t,n,r)}function n8(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let l=0,o;for(;o=i.exec(e);){const{0:c,groups:{$skip:f}}=o;if(!f&&(!r||r===Fa.DEFAULT==!l))return o;c==="["?l++:c==="]"&&l&&l--,i.lastIndex==o.index&&i.lastIndex++}return null}function Mf(e,t,n){return!!n8(e,t,0,n)}function r8(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 b_=new RegExp(String.raw`(?<noncapturingStart>${JO})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function a8(e,t){const n=(t==null?void 0:t.hiddenCaptures)??[];let r=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",l="(?:(?=(",o=[0],c=[];let f=0,h=0,g=NaN,p;do{p=!1;let x=0,E=0,v=!1,C;for(b_.lastIndex=Number.isNaN(g)?0:g+l.length;C=b_.exec(e);){const{0:S,index:w,groups:{capturingStart:O,noncapturingStart:R}}=C;if(S==="[")x++;else if(x)S==="]"&&x--;else if(S===i&&!v)g=w,v=!0;else if(v&&R)E++;else if(O)v?E++:(f++,o.push(f+h));else if(S===")"&&v){if(!E){h++;const j=f+h;if(e=`${e.slice(0,g)}${l}${e.slice(g+i.length,w)}))<$$${j}>)${e.slice(w+1)}`,p=!0,c.push(j),e8(n,j),r.size){const G=new Map;r.forEach((N,P)=>{G.set(P>=j?P+1:P,N.map($=>$>=j?$+1:$))}),r=G}break}E--}}}while(p);return n.push(...c),e=J1(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:x,groups:{backrefNum:E,wrappedBackrefNum:v}})=>{if(E){const C=+E;if(C>o.length-1)throw new Error(`Backref "${x}" greater than number of captures`);return`\\${o[C]}`}return`\\${v}`},Fa.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const mw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,H0=new RegExp(String.raw`
138
+ \\(?: \d+
139
+ | c[A-Za-z]
140
+ | [gk]<[^>]+>
141
+ | [pPu]\{[^\}]+\}
142
+ | u[A-Fa-f\d]{4}
143
+ | x[A-Fa-f\d]{2}
144
+ )
145
+ | \((?: \? (?: [:=!>]
146
+ | <(?:[=!]|[^>]+>)
147
+ | [A-Za-z\-]+:
148
+ | \(DEFINE\)
149
+ ))?
150
+ | (?<qBase>${mw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
151
+ | \\?.
152
+ `.replace(/\s+/g,""),"gsu");function s8(e){if(!new RegExp(`${mw}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",l=0,o;for(H0.lastIndex=0;o=H0.exec(e);){const{0:c,index:f,groups:{qBase:h,qMod:g,invalidQ:p}}=o;if(c==="[")l||(r=f),l++;else if(c==="]")l?l--:r=null;else if(!l)if(g==="+"&&i&&!i.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${c}"`);let x=-1;if(/^\{\d+\}$/.test(h))e=t8(e,f+h.length,g,"");else{if(i===")"||i==="]"){const E=i===")"?n:r;if(E===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,E)}(?>${e.slice(E,f)}${h})${e.slice(f+c.length)}`}else e=`${e.slice(0,f-i.length)}(?>${i}${h})${e.slice(f+c.length)}`;x+=4}H0.lastIndex+=x}else c[0]==="("?t.push(f):c===")"&&(n=t.length?t.pop():null);i=c}return{pattern:e}}const Ha=String.raw,i8=Ha`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Gg=Ha`\(\?R=(?<rDepth>[^\)]+)\)|${i8}`,Jh=Ha`\(\?<(?![=!])(?<captureName>[^>]+)>`,pw=Ha`${Jh}|(?<unnamed>\()(?!\?)`,Yl=new RegExp(Ha`${Jh}|${Gg}|\(\?|\\?.`,"gsu"),F0="Cannot use multiple overlapping recursions";function l8(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Gg,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Mf(e,Ha`\(\?\(DEFINE\)`,Fa.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],o=Mf(e,Ha`\\[1-9]`,Fa.DEFAULT),c=new Map,f=[];let h=!1,g=0,p=0,x;for(Yl.lastIndex=0;x=Yl.exec(e);){const{0:E,groups:{captureName:v,rDepth:C,gRNameOrNum:S,gRDepth:w}}=x;if(E==="[")g++;else if(g)E==="]"&&g--;else if(C){if(x_(C),h)throw new Error(F0);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const O=e.slice(0,x.index),R=e.slice(Yl.lastIndex);if(Mf(R,Gg,Fa.DEFAULT))throw new Error(F0);const j=+C-1;e=y_(O,R,j,!1,n,l,p),i=__(i,O,j,l.length,0,p);break}else if(S){x_(w);let O=!1;for(const Q of f)if(Q.name===S||Q.num===+S){if(O=!0,Q.hasRecursedWithin)throw new Error(F0);break}if(!O)throw new Error(Ha`Recursive \g cannot be used outside the referenced group "${r==="external"?S:Ha`\g<${S}&R=${w}>`}"`);const R=c.get(S),j=r8(e,R);if(o&&Mf(j,Ha`${Jh}|\((?!\?)`,Fa.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const G=e.slice(R,x.index),N=j.slice(G.length+E.length),P=l.length,$=+w-1,ne=y_(G,N,$,!0,n,l,p);i=__(i,G,$,l.length-P,P,p);const W=e.slice(0,R),me=e.slice(R+j.length);e=`${W}${ne}${me}`,Yl.lastIndex+=ne.length-E.length-G.length-N.length,f.forEach(Q=>Q.hasRecursedWithin=!0),h=!0}else if(v)p++,c.set(String(p),Yl.lastIndex),c.set(v,Yl.lastIndex),f.push({num:p,name:v});else if(E[0]==="("){const O=E==="(";O&&(p++,c.set(String(p),Yl.lastIndex)),f.push(O?{num:p}:{})}else E===")"&&f.pop()}return n.push(...l),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function x_(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 y_(e,t,n,r,i,l,o){const c=new Set;r&&hw(e+t,Jh,({groups:{captureName:h}})=>{c.add(h)},Fa.DEFAULT);const f=[n,r?c:null,i,l,o];return`${e}${E_(`(?:${e}`,"forward",...f)}(?:)${E_(`${t})`,"backward",...f)}${t}`}function E_(e,t,n,r,i,l,o){const f=g=>t==="forward"?g+2:n-g+2-1;let h="";for(let g=0;g<n;g++){const p=f(g);h+=J1(e,Ha`${pw}|\\k<(?<backref>[^>]+)>`,({0:x,groups:{captureName:E,unnamed:v,backref:C}})=>{if(C&&r&&!r.has(C))return x;const S=`_$${p}`;if(v||E){const w=o+l.length+1;return l.push(w),o8(i,w),v?x:`(?<${E}${S}>`}return Ha`\k<${C}${S}>`},Fa.DEFAULT)}return h}function o8(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function __(e,t,n,r,i,l){if(e.size&&r){let o=0;hw(t,pw,()=>o++,Fa.DEFAULT);const c=l-o+i,f=new Map;return e.forEach((h,g)=>{const p=(r-o*n)/n,x=o*n,E=g>c+o?g+r:g,v=[];for(const C of h)if(C<=c)v.push(C);else if(C>c+o+p)v.push(C+r);else if(C<=c+o)for(let S=0;S<=n;S++)v.push(C+o*S);else for(let S=0;S<=n;S++)v.push(C+x+p*S);f.set(E,v)}),f}return e}var ur=String.fromCodePoint,_t=String.raw,as={},em=globalThis.RegExp;as.flagGroups=(()=>{try{new em("(?i:)")}catch{return!1}return!0})();as.unicodeSets=(()=>{try{new em("[[]]","v")}catch{return!1}return!0})();as.bugFlagVLiteralHyphenIsRange=as.unicodeSets?(()=>{try{new em(_t`[\d\-a]`,"v")}catch{return!0}return!1})():!1;as.bugNestedClassIgnoresNegation=as.unicodeSets&&new em("[[^a]]","v").test("a");function wh(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 rd(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function qg(e,t){return T_[e]>=T_[t]}function u8(e,t){if(e==null)throw new Error(t??"Value expected");return e}var T_={ES2025:2025,ES2024:2024,ES2018:2018},c8={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function gw(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!c8[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=as.flagGroups?"ES2025":as.unicodeSets?"ES2024":"ES2018"),t}var d8="[ -\r ]",f8=new Set([ur(304),ur(305)]),li=_t`[\p{L}\p{M}\p{N}\p{Pc}]`;function bw(e){if(f8.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=p8.get(n),l=h8.get(n),o=m8.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 eb=new Map(`C Other
153
+ Cc Control cntrl
154
+ Cf Format
155
+ Cn Unassigned
156
+ Co Private_Use
157
+ Cs Surrogate
158
+ L Letter
159
+ LC Cased_Letter
160
+ Ll Lowercase_Letter
161
+ Lm Modifier_Letter
162
+ Lo Other_Letter
163
+ Lt Titlecase_Letter
164
+ Lu Uppercase_Letter
165
+ M Mark Combining_Mark
166
+ Mc Spacing_Mark
167
+ Me Enclosing_Mark
168
+ Mn Nonspacing_Mark
169
+ N Number
170
+ Nd Decimal_Number digit
171
+ Nl Letter_Number
172
+ No Other_Number
173
+ P Punctuation punct
174
+ Pc Connector_Punctuation
175
+ Pd Dash_Punctuation
176
+ Pe Close_Punctuation
177
+ Pf Final_Punctuation
178
+ Pi Initial_Punctuation
179
+ Po Other_Punctuation
180
+ Ps Open_Punctuation
181
+ S Symbol
182
+ Sc Currency_Symbol
183
+ Sk Modifier_Symbol
184
+ Sm Math_Symbol
185
+ So Other_Symbol
186
+ Z Separator
187
+ Zl Line_Separator
188
+ Zp Paragraph_Separator
189
+ Zs Space_Separator
190
+ ASCII
191
+ ASCII_Hex_Digit AHex
192
+ Alphabetic Alpha
193
+ Any
194
+ Assigned
195
+ Bidi_Control Bidi_C
196
+ Bidi_Mirrored Bidi_M
197
+ Case_Ignorable CI
198
+ Cased
199
+ Changes_When_Casefolded CWCF
200
+ Changes_When_Casemapped CWCM
201
+ Changes_When_Lowercased CWL
202
+ Changes_When_NFKC_Casefolded CWKCF
203
+ Changes_When_Titlecased CWT
204
+ Changes_When_Uppercased CWU
205
+ Dash
206
+ Default_Ignorable_Code_Point DI
207
+ Deprecated Dep
208
+ Diacritic Dia
209
+ Emoji
210
+ Emoji_Component EComp
211
+ Emoji_Modifier EMod
212
+ Emoji_Modifier_Base EBase
213
+ Emoji_Presentation EPres
214
+ Extended_Pictographic ExtPict
215
+ Extender Ext
216
+ Grapheme_Base Gr_Base
217
+ Grapheme_Extend Gr_Ext
218
+ Hex_Digit Hex
219
+ IDS_Binary_Operator IDSB
220
+ IDS_Trinary_Operator IDST
221
+ ID_Continue IDC
222
+ ID_Start IDS
223
+ Ideographic Ideo
224
+ Join_Control Join_C
225
+ Logical_Order_Exception LOE
226
+ Lowercase Lower
227
+ Math
228
+ Noncharacter_Code_Point NChar
229
+ Pattern_Syntax Pat_Syn
230
+ Pattern_White_Space Pat_WS
231
+ Quotation_Mark QMark
232
+ Radical
233
+ Regional_Indicator RI
234
+ Sentence_Terminal STerm
235
+ Soft_Dotted SD
236
+ Terminal_Punctuation Term
237
+ Unified_Ideograph UIdeo
238
+ Uppercase Upper
239
+ Variation_Selector VS
240
+ White_Space space
241
+ XID_Continue XIDC
242
+ XID_Start XIDS`.split(/\s/).map(e=>[Zh(e),e])),h8=new Map([["s",ur(383)],[ur(383),"s"]]),m8=new Map([[ur(223),ur(7838)],[ur(107),ur(8490)],[ur(229),ur(8491)],[ur(969),ur(8486)]]),p8=new Map([el(453),el(456),el(459),el(498),...z0(8072,8079),...z0(8088,8095),...z0(8104,8111),el(8124),el(8140),el(8188)]),g8=new Map([["alnum",_t`[\p{Alpha}\p{Nd}]`],["alpha",_t`\p{Alpha}`],["ascii",_t`\p{ASCII}`],["blank",_t`[\p{Zs}\t]`],["cntrl",_t`\p{Cc}`],["digit",_t`\p{Nd}`],["graph",_t`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_t`\p{Lower}`],["print",_t`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_t`[\p{P}\p{S}]`],["space",_t`\p{space}`],["upper",_t`\p{Upper}`],["word",_t`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_t`\p{AHex}`]]);function b8(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function el(e){const t=ur(e);return[t.toLowerCase(),t]}function z0(e,t){return b8(e,t).map(n=>el(n))}var xw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function x8(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};yw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:qg(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};Hc(e,y8,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};Hc(e,E8,l);const o={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return Hc(e,_8,o),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var y8={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const l=rs();l.body[0].body.push(Zl({negate:!0,body:r}),su("Any"));const o=rs();o.body[0].body.push(cw("greedy",0,1/0,l)),n(zn(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];rd(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=_w(t.get(e));if(r){const i=rs({flags:r});i.body[0].body=e.body,e.body=[zn(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:l,replaceWith:o},c){const{kind:f,negate:h}=e,{asciiWordBoundaries:g,avoidSubclass:p,supportedGNodes:x,wordIsAscii:E}=c;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${h?"Y":"y"}"`);if(f==="line_end")o(zn(Zl({body:[lo({body:[zg("string_end")]}),lo({body:[Kh(10)]})]}),t));else if(f==="line_start")o(zn(oi(_t`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(x.has(e))i.flags.sticky=!0,l();else{const v=r[n-1];if(v&&S8(v))o(zn(Zl({negate:!0}),t));else{if(p)throw new Error(_t`Uses "\G" in a way that requires a subclass`);o(tl(zg("string_start"),t)),c.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")o(zn(oi(_t`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!E&&!g){const v=`(?:(?<=${li})(?!${li})|(?<!${li})(?=${li}))`,C=`(?:(?<=${li})(?=${li})|(?<!${li})(?!${li}))`;o(zn(oi(h?C:v),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!V0(n)&&(n=$0(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!V0(r)&&(r=$0(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=lh({body:[e]});n(zn(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:l,spaceIsAscii:o,wordIsAscii:c}){const{kind:f,negate:h,value:g}=e;if(l&&(f==="digit"||g==="digit")){n(tl(Vg("digit",{negate:h}),t));return}if(o&&(f==="space"||g==="space")){n(zn(G0(oi(d8),h),t));return}if(c&&(f==="word"||g==="word")){n(tl(Vg("word",{negate:h}),t));return}if(f==="any")n(tl(su("Any"),t));else if(f==="digit")n(tl(su("Nd",{negate:h}),t));else if(f!=="dot")if(f==="text_segment"){if(r==="strict")throw new Error(_t`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",x=_t`\p{RI}{2}|${p}(?:\u200D${p})*`;n(zn(oi(_t`(?>\r\n|${i?_t`\p{RGI_Emoji}`:x}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(tl(su("AHex",{negate:h}),t));else if(f==="newline")n(zn(oi(h?`[^
243
+ ]`:`(?>\r
244
+ ?|[
245
+ \v\f…\u2028\u2029])`),t));else if(f==="posix")if(!i&&(g==="graph"||g==="print")){if(r==="strict")throw new Error(`POSIX class "${g}" requires min target ES2024 or non-strict accuracy`);let p={graph:"!-~",print:" -~"}[g];h&&(p=`\0-${ur(p.codePointAt(0)-1)}${ur(p.codePointAt(2)+1)}-􏿿`),n(zn(oi(`[${p}]`),t))}else n(zn(G0(oi(g8.get(g)),h),t));else if(f==="property")eb.has(Zh(g))||(e.key="sc");else if(f==="space")n(tl(su("space",{negate:h}),t));else if(f==="word")n(zn(G0(oi(li),h),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:l,removeAllNextSiblings:o}){const{kind:c,flags:f}=e;if(c==="flags")if(!f.enable&&!f.disable)r();else{const h=rs({flags:f});h.body[0].body=o(),i(zn(h,t),{traverse:!0})}else if(c==="keep"){const h=n.body[0],p=n.body.length===1&&lw(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(t.parent!==p||p.body.length>1)throw new Error(_t`Uses "\K" in a way that's unsupported`);const x=Zl({behind:!0});x.body[0].body=l(),i(zn(x,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(zn(Zl({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=rs();t.body[0].body.push(e.body),e.body=zn(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=vw(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(_t`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!V0(n)&&(n=$0(n,t),e.ref=n)}},E8={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:l})=>l)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:l,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:f}){const h=i.get(e);if(h&&c.has(e.number)){const p=tl(v_(e.number),t);f.set(p,c.get(e.number)),n(p);return}c.set(e.number,e),o.set(e.number,[]),e.name&&rd(o,e.name,[]);const g=o.get(e.name??e.number);for(let p=0;p<g.length;p++){const x=g[p];if(h===x.node||h&&h===x.origin||e===x.origin){g.splice(p,1);break}}if(o.get(e.number).push({node:e,origin:h}),e.name&&o.get(e.name).push({node:e,origin:h}),e.name){const p=rd(l,e.name,new Map);let x=!1;if(h)x=!0;else for(const E of p.values())if(!E.hasDuplicateNameToRemove){x=!0;break}l.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:x})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=wh(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 g=t;for(;(g=g.parent)&&!(g.type==="CapturingGroup"&&(g.name===l||g.number===l)););r.reffedNodesByReferencer.set(e,g);return}const o=r.subroutineRefMap.get(l),c=l===0,f=c?v_(0):Ew(o,r.groupOriginByCopy,null);let h=f;if(!c){const g=_w(k8(o,x=>x.type==="Group"&&!!x.flags)),p=g?wh(r.globalFlags,g):r.globalFlags;T8(p,r.currentFlags)||(h=rs({flags:w8(p)}),h.body[0].body.push(f))}n(zn(h,t),{traverse:!c})}},_8={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=>v8(o,e));if(!l.length)n(zn(Zl({negate:!0}),t));else if(l.length>1){const o=rs({atomic:!0,body:l.reverse().map(c=>lo({body:[$g(c.number)]}))});n(zn(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=uw();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function yw(e){Hc(e,{"*"({node:t,parent:n}){t.parent=n}})}function T8(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function v8(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Tw(n.parent);for(const i of r){if(i===n)break;if(i===e||kw(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Ew(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]=Ew(o,t,i,n):(l==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[l]=o);return i}function v_(e){const t=dw(e);return t.isRecursive=!0,t}function k8(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function $0(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 _w(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 w8({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 Tw(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function vw(e){const t=e.find(n=>n.kind==="search_start"||N8(n,{negate:!1})||!C8(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=vw(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function kw(e,t){const n=Tw(e)??[];for(const r of n)if(r===t||kw(r,t))return!0;return!1}function C8({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function S8(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function N8(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&lw(e.body[0],{type:"Assertion",kind:"search_start"})}function V0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function oi(e,t){const r=ow(e,{...t,unicodePropertyMap:eb}).body;return r.length>1||r[0].body.length>1?rs({body:r}):r[0].body[0]}function G0(e,t){return e.negate=t,e}function tl(e,t){return e.parent=t,e}function zn(e,t){return yw(e),e.parent=t,e}function A8(e,t){const n=gw(t),r=qg(n.target,"ES2024"),i=qg(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];Hc(e,R8,{getCurrentModI:()=>E.at(-1),popModI(){E.pop()},pushModI(v){E.push(v)},setHasCasedChar(){E.at(-1)?o=!0:c=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!c)};let h=e;const g={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:r,verbose:n.verbose};function p(E){return g.lastNode=h,h=E,u8(L8[E.type],`Unexpected node type "${E.type}"`)(E,g,p)}const x={pattern:e.body.map(p).join("|"),flags:p(e.flags),options:{...e.options}};return r||(delete x.options.force.v,x.options.disable.v=!0,x.options.unicodeSetsPlugin=null),x._captureTransfers=new Map,x._hiddenCaptures=[],g.captureMap.forEach((E,v)=>{E.hidden&&x._hiddenCaptures.push(v),E.transferTo&&rd(x._captureTransfers,E.transferTo,[]).push(v)}),x}var R8={"*":{enter({node:e},t){if(w_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?wh({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){w_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){tb(ur(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),ww(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&xw.has(e.value)&&t.setHasCasedChar()}},L8={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?_t`\B`:_t`\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=ur(e),r=Ko(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&tb(n)){const i=bw(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");as.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(C_)&&(o=[Kh(45),...o.filter(h=>!C_(h))]);const c=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||as.bugNestedClassIgnoresNegation)&&!i){const g=o.filter(p=>p.type==="CharacterClass"&&p.kind==="union"&&p.negate);if(g.length){const p=rs(),x=p.body[0];return p.parent=l,x.parent=p,o=o.filter(E=>!g.includes(E)),e.body=o,o.length?(e.parent=x,x.body.push(e)):p.body.pop(),g.forEach(E=>{const v=lo({body:[E]});E.parent=v,v.parent=p,p.body.push(v)}),n(p)}}t.inCharClass=!0;const h=c();return t.inCharClass=!1,h}const f=o[0];if(r==="union"&&!i&&f&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(as.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&o.length===1&&f.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&l.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},l=Ko(n,i),o=Ko(r,i),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=ww(e);M8(f).forEach(g=>{c.add(Array.isArray(g)?`${Ko(g[0],i)}-${Ko(g[1],i)}`:Ko(g,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?".":"[^]":_t`[^\n]`;if(e==="digit")return t?_t`\D`:_t`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&xw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_t`\P`:_t`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_t`\W`:_t`\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=wh(o,n));const c=t.map(l).join("|"),f=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?c:`(?${P8(e,n,i.useFlagMods)}${c})`;return i.currentFlags=o,f},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+B8(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})`:_t`\g<${t}&R=${r}>`}},I8=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),O8=new Set(["-","\\","]","^","["]),D8=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),k_=new Map([[9,_t`\t`],[10,_t`\n`],[11,_t`\v`],[12,_t`\f`],[13,_t`\r`],[8232,_t`\u2028`],[8233,_t`\u2029`],[65279,_t`\uFEFF`]]),j8=new RegExp("^\\p{Cased}$","u");function tb(e){return j8.test(e)}function ww(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=ur(o);if(!tb(c))continue;const f=bw(c).filter(h=>{const g=h.codePointAt(0);return g<r||g>i});if(f.length&&(l.push(...f),n))break}return l}function Ko(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(k_.has(e))return k_.get(e);if(e<32||e>126&&e<160||e>262143||t&&U8(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?D8:O8:I8,l=ur(e);return(i.has(l)?"\\":"")+l}function M8(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 P8(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 B8({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 w_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function U8(e){return e>47&&e<58}function C_({type:e,value:t}){return e==="Character"&&t===45}var il,di,ao,ll,so,od,Yg,cl,H8=(cl=class extends RegExp{constructor(n,r,i){var t=(...jW)=>(super(...jW),$l(this,od),$l(this,il,new Map),$l(this,di,null),$l(this,ao),$l(this,ll,null),$l(this,so,null),fe(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),ts(this,ao,o.source),o instanceof cl&&(ts(this,il,Hr(o,il)),ts(this,ll,Hr(o,ll)),ts(this,so,Hr(o,so)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(l?"":n,r),ts(this,ao,n),ts(this,il,z8(o.hiddenCaptures,o.transfers)),ts(this,so,o.strategy),this.rawOptions=i??{}}l||ts(this,di,this)}get source(){return Hr(this,ao)||"(?:)"}exec(n){if(!Hr(this,di)){const{lazyCompile:l,...o}=this.rawOptions;ts(this,di,new cl(Hr(this,ao),this.flags,o))}const r=this.global||this.sticky,i=this.lastIndex;if(Hr(this,so)==="clip_search"&&r&&i){this.lastIndex=0;const l=c0(this,od,Yg).call(this,n.slice(i));return l&&(F8(l,i,n,this.hasIndices),this.lastIndex+=i),l}return c0(this,od,Yg).call(this,n)}},il=new WeakMap,di=new WeakMap,ao=new WeakMap,ll=new WeakMap,so=new WeakMap,od=new WeakSet,Yg=function(n){Hr(this,di).lastIndex=this.lastIndex;const r=r2(cl.prototype,this,"exec").call(Hr(this,di),n);if(this.lastIndex=Hr(this,di).lastIndex,!r||!Hr(this,il).size)return r;const i=[...r];r.length=1;let l;this.hasIndices&&(l=[...r.indices],r.indices.length=1);const o=[0];for(let c=1;c<i.length;c++){const{hidden:f,transferTo:h}=Hr(this,il).get(c)??{};if(f?o.push(null):(o.push(r.length),r.push(i[c]),this.hasIndices&&r.indices.push(l[c])),h&&i[c]!==void 0){const g=o[h];if(!g)throw new Error(`Invalid capture transfer to "${g}"`);if(r[g]=i[c],this.hasIndices&&(r.indices[g]=l[c]),r.groups){Hr(this,ll)||ts(this,ll,$8(this.source));const p=Hr(this,ll).get(h);p&&(r.groups[p]=i[c],this.hasIndices&&(r.indices.groups[p]=l[c]))}}}return r},cl);function F8(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 z8(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)rd(n,l,{}).transferTo=r;return n}function $8(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,l;for(;l=t.exec(e);){const{0:o,groups:{capture:c,name:f}}=l;o==="["?r++:r?o==="]"&&r--:c&&(i++,f&&n.set(i,f))}return n}function V8(e,t){const n=G8(e,t);return n.options?new H8(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function G8(e,t){const n=gw(t),r=ow(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:eb}),i=x8(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=A8(i,n),o=l8(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),c=s8(o.pattern),f=a8(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),h={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${l.flags}${l.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const g=f.hiddenCaptures.sort((v,C)=>v-C),p=Array.from(f.captureTransfers),x=i._strategy,E=h.pattern.length>=n.lazyCompileLength;(g.length||p.length||x||E)&&(h.options={...g.length&&{hiddenCaptures:g},...p.length&&{transfers:p},...x&&{strategy:x},...E&&{lazyCompile:E}})}return h}const S_=4294967295;class q8{constructor(t,n={}){fe(this,"regexps");this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:l}=n;if(!l)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const c=i==null?void 0:i.get(o);if(c){if(c instanceof RegExp)return c;if(r)return null;throw c}try{const f=l(o);return i==null||i.set(o,f),f}catch(f){if(i==null||i.set(o,f),r)return null;throw f}})}findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,l=[];function o(c,f,h=0){return{index:c,captureIndices:f.indices.map(g=>g==null?{start:S_,end:S_,length:0}:{start:g[0]+h,end:g[1]+h,length:g[1]-g[0]})}}for(let c=0;c<this.regexps.length;c++){const f=this.regexps[c];if(f)try{f.lastIndex=n;const h=f.exec(i);if(!h)continue;if(h.index===n)return o(c,h,0);l.push([c,h,0])}catch(h){if(this.options.forgiving)continue;throw h}}if(l.length){const c=Math.min(...l.map(f=>f[1].index));for(const[f,h,g]of l)if(h.index===c)return o(f,h,g)}return null}}function Y8(e,t){return V8(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=>Y8(n,{target:t.target})),{createScanner(n){return new q8(n,t)},createString(n){return{content:n}}}}var Q8=W8({forgiving:!0}),X8=Object.fromEntries(Q1.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(n=>[n,e.id])})),oh=new Set(Object.keys(ew)),N_=e=>{let t=e.trim().toLowerCase();return X8[t]||(oh.has(t),t)},q0=new Map,Y0=new Map,Zo=new Map,Ch=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},K8=(e,t)=>`${e}-${Ch(t[0])}-${Ch(t[1])}`,Z8=(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}`},J8=(e,t)=>{let n=K8(e,t);if(q0.has(n))return q0.get(n);let r=oO({themes:t,langs:[e],engine:Q8});return q0.set(n,r),r};function eD(e={}){var t;let n=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(r){let i=N_(r);return oh.has(i)},getSupportedLanguages(){return Array.from(oh)},getThemes(){return n},highlight({code:r,language:i,themes:l},o){let c=N_(i),f=[Ch(l[0]),Ch(l[1])],h=Z8(r,c,f);if(Y0.has(h))return Y0.get(h);o&&(Zo.has(h)||Zo.set(h,new Set),Zo.get(h).add(o));let g=oh.has(c)?c:"text";return J8(g,l).then(p=>{let x=p.getLoadedLanguages().includes(c)?c:"text",E=p.codeToTokens(r,{lang:x,themes:{light:f[0],dark:f[1]}});Y0.set(h,E);let v=Zo.get(h);if(v){for(let C of v)C(E);Zo.delete(h)}}).catch(p=>{console.error("[Streamdown Code] Failed to highlight code:",p),Zo.delete(h)}),null}}}var tD=eD();const tm=(function(e){if(e==null)return sD;if(typeof e=="function")return nm(e);if(typeof e=="object")return Array.isArray(e)?nD(e):rD(e);if(typeof e=="string")return aD(e);throw new Error("Expected function, string, or object as test")});function nD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tm(e[n]);return nm(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function rD(e){const t=e;return nm(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function aD(e){return nm(t);function t(n){return n&&n.type===e}}function nm(e){return t;function t(n,r,i){return!!(iD(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sD(){return!0}function iD(e){return e!==null&&typeof e=="object"&&"type"in e}const Cw=[],Dc=!0,Wg=!1,ou="skip";function nb(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=tm(i),o=r?-1:1;c(e,void 0,[])();function c(f,h,g){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const E=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(E?"<"+E+">":""))+")"})}return x;function x(){let E=Cw,v,C,S;if((!t||l(f,h,g[g.length-1]||void 0))&&(E=lD(n(f,g)),E[0]===Wg))return E;if("children"in f&&f.children){const w=f;if(w.children&&E[0]!==ou)for(C=(r?w.children.length:-1)+o,S=g.concat(w);C>-1&&C<w.children.length;){const O=w.children[C];if(v=c(O,C,S)(),v[0]===Wg)return v;C=typeof v[1]=="number"?v[1]:C+o}}return E}}}function lD(e){return Array.isArray(e)?e:typeof e=="number"?[Dc,e]:e==null?Cw:[e]}function vs(e,t,n,r){let i,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,i=n):(l=t,o=n,i=r),nb(e,l,c,i);function c(f,h){const g=h[h.length-1],p=g?g.children.indexOf(f):void 0;return o(f,p,g)}}const pu={indicator:"indicator",textOnly:"text-only",remove:"remove"};function oD({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=pu.indicator,imageBlockPolicy:f=pu.indicator}){const h=t.length&&!t.every(p=>p==="*"),g=n.length&&!n.every(p=>p==="*");if(!e&&(h||g))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return p=>{const x=mD(e,t,n,r,i,l,o,c,f);Sw(p),vs(p,x)}}function A_(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 uD(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const cD=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),dD=new Set(["javascript:","data:","file:","vbscript:"]);function R_(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 g=e.substring(5);if(g&&g.length>0&&g!=="invalid")return e}}catch{return null}return null}const o=A_(e,n);if(!o||dD.has(o.protocol)||!(cD.has(o.protocol)||l.includes(o.protocol)||l.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const f=uD(e);return o&&t.some(h=>{const g=A_(h,n);return!g||g.origin!==o.origin?!1:o.href.startsWith(g.href)})?f?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:f?o.pathname+o.search+o.hash:o.href:null}function Sw(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)Sw(t)}}const W0=Symbol("node-seen");function fD(e,t,n){return t===pu.remove?{type:"remove"}:t===pu.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 hD(e,t,n){if(t===pu.remove)return{type:"remove"};if(t===pu.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 mD=(e,t,n,r,i,l,o,c,f)=>{const h=(g,p,x)=>{if(g.type!=="element"||g[W0])return Dc;if(g.tagName==="a"){const E=R_(g.properties.href,t,e,!1,!1,i);if(E===null){if(g[W0]=!0,vs(g,h),x&&typeof p=="number"){const v=fD(g,c,o);if(v.type==="remove")return x.children.splice(p,1),[ou,p];x.children[p]=v.element}return ou}else return g.properties.href=E,g.properties.target="_blank",g.properties.rel="noopener noreferrer",Dc}if(g.tagName==="img"){const E=R_(g.properties.src,n,e,r,!0,i);if(E===null){if(g[W0]=!0,vs(g,h),x&&typeof p=="number"){const v=hD(g,f,l);if(v.type==="remove")return x.children.splice(p,1),[ou,p];x.children[p]=v.element}return ou}else return g.properties.src=E,Dc}return Dc};return h},Nw=-1,rm=0,Fc=1,Sh=2,rb=3,ab=4,sb=5,ib=6,Aw=7,Rw=8,L_=typeof self=="object"?self:globalThis,pD=(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 rm:case Nw:return n(o,i);case Fc:{const c=n([],i);for(const f of o)c.push(r(f));return c}case Sh:{const c=n({},i);for(const[f,h]of o)c[r(f)]=r(h);return c}case rb:return n(new Date(o),i);case ab:{const{source:c,flags:f}=o;return n(new RegExp(c,f),i)}case sb:{const c=n(new Map,i);for(const[f,h]of o)c.set(r(f),r(h));return c}case ib:{const c=n(new Set,i);for(const f of o)c.add(r(f));return c}case Aw:{const{name:c,message:f}=o;return n(new L_[c](f),i)}case Rw: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 L_[l](o),i)};return r},I_=e=>pD(new Map,e)(0),Jo="",{toString:gD}={},{keys:bD}=Object,vc=e=>{const t=typeof e;if(t!=="object"||!e)return[rm,t];const n=gD.call(e).slice(8,-1);switch(n){case"Array":return[Fc,Jo];case"Object":return[Sh,Jo];case"Date":return[rb,Jo];case"RegExp":return[ab,Jo];case"Map":return[sb,Jo];case"Set":return[ib,Jo];case"DataView":return[Fc,n]}return n.includes("Array")?[Fc,n]:n.includes("Error")?[Aw,n]:[Sh,n]},Pf=([e,t])=>e===rm&&(t==="function"||t==="symbol"),xD=(e,t,n,r)=>{const i=(o,c)=>{const f=r.push(o)-1;return n.set(c,f),f},l=o=>{if(n.has(o))return n.get(o);let[c,f]=vc(o);switch(c){case rm:{let g=o;switch(f){case"bigint":c=Rw,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return i([Nw],o)}return i([c,g],o)}case Fc:{if(f){let x=o;return f==="DataView"?x=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(o)),i([f,[...x]],o)}const g=[],p=i([c,g],o);for(const x of o)g.push(l(x));return p}case Sh:{if(f)switch(f){case"BigInt":return i([f,o.toString()],o);case"Boolean":case"Number":case"String":return i([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const g=[],p=i([c,g],o);for(const x of bD(o))(e||!Pf(vc(o[x])))&&g.push([l(x),l(o[x])]);return p}case rb:return i([c,o.toISOString()],o);case ab:{const{source:g,flags:p}=o;return i([c,{source:g,flags:p}],o)}case sb:{const g=[],p=i([c,g],o);for(const[x,E]of o)(e||!(Pf(vc(x))||Pf(vc(E))))&&g.push([l(x),l(E)]);return p}case ib:{const g=[],p=i([c,g],o);for(const x of o)(e||!Pf(vc(x)))&&g.push(l(x));return p}}const{message:h}=o;return i([c,{name:f,message:h}],o)};return l},O_=(e,{json:t,lossy:n}={})=>{const r=[];return xD(!(t||n),!!t,new Map,r)(e),r},oo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?I_(O_(e,t)):structuredClone(e):(e,t)=>I_(O_(e,t));const D_=/[#.]/g;function yD(e,t){const n=e||"",r={};let i=0,l,o;for(;i<n.length;){D_.lastIndex=i;const c=D_.exec(n),f=n.slice(i,c?c.index:n.length);f&&(l?l==="#"?r.id=f:Array.isArray(r.className)?r.className.push(f):r.className=[f]:o=f,i+=f.length),c&&(l=c[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function Lw(e,t,n){const r=n?vD(n):void 0;function i(l,o,...c){let f;if(l==null){f={type:"root",children:[]};const h=o;c.unshift(h)}else{f=yD(l,t);const h=f.tagName.toLowerCase(),g=r?r.get(h):void 0;if(f.tagName=g||h,ED(o))c.unshift(o);else for(const[p,x]of Object.entries(o))_D(e,f.properties,p,x)}for(const h of c)Qg(f.children,h);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return i}function ED(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 _D(e,t,n,r){const i=hd(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=Z2(r):i.commaSeparated?l=K2(r):i.commaOrSpaceSeparated?l=Z2(K2(r).join(" ")):l=j_(i,i.property,r):Array.isArray(r)?l=[...r]:l=i.property==="style"?TD(r):String(r);if(Array.isArray(l)){const o=[];for(const c of l)o.push(j_(i,i.property,c));l=o}i.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[i.property]=l}}function Qg(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)Qg(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Qg(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function j_(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||td(n)===td(t)))return!0}return n}function TD(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function vD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const kD=["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"],wD=Lw(vu,"div"),CD=Lw(ks,"g",kD);function SD(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(l){if(typeof l=="number"&&l>-1&&l<=t.length){let o=0;for(;;){let c=n[o];if(c===void 0){const f=M_(t,n[o-1]);c=f===-1?t.length+1:f+1,n[o]=c}if(c>l)return{line:o+1,column:l-(o>0?n[o-1]:0)+1,offset:l};o++}}}function i(l){if(l&&typeof l.line=="number"&&typeof l.column=="number"&&!Number.isNaN(l.line)&&!Number.isNaN(l.column)){for(;n.length<l.line;){const c=n[n.length-1],f=M_(t,c),h=f===-1?t.length+1:f+1;if(c===h)break;n.push(h)}const o=(l.line>1?n[l.line-2]:0)+l.column-1;if(o<n[l.line-1])return o}}}function M_(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
246
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ro={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/"},Iw={}.hasOwnProperty,ND=Object.prototype;function AD(e,t){const n=t||{};return lb({file:n.file||void 0,location:!1,schema:n.space==="svg"?ks:vu,verbose:n.verbose||!1},e)}function lb(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},uh(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:Ow(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const l=String(e.file),o=SD(l),c=o.toPoint(0),f=o.toPoint(l.length);n.position={start:c,end:f}}return n}case"#documentType":{const r=t;return n={type:"doctype"},uh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},uh(e,r,n),n}default:return n=RD(e,t),n}}function Ow(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=lb(e,t[n]);r.push(i)}return r}function RD(e,t){const n=e.schema;e.schema=t.namespaceURI===ro.svg?ks:vu;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],f=(c.prefix?c.prefix+":":"")+c.name;Iw.call(ND,f)||(i[f]=c.value)}const o=(e.schema.space==="svg"?CD:wD)(t.tagName,i,Ow(e,t.childNodes));if(uh(e,t,o),o.tagName==="template"){const c=t,f=c.sourceCodeLocation,h=f&&f.startTag&&uu(f.startTag),g=f&&f.endTag&&uu(f.endTag),p=lb(e,c.content);h&&g&&e.file&&(p.position={start:h.end,end:g.start}),o.content=p}return e.schema=n,o}function uh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=LD(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function LD(e,t,n){const r=uu(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)Iw.call(n.attrs,o)&&(l[hd(e.schema,o).property]=uu(n.attrs[o]));n.startTag;const c=uu(n.startTag),f=n.endTag?uu(n.endTag):void 0,h={opening:c};f&&(h.closing=f),h.properties=l,t.data={position:h}}}return r}function uu(e){const t=P_({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=P_({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function P_(e){return e.line&&e.column?e:void 0}const ID={},OD={}.hasOwnProperty,Dw=U1("type",{handlers:{root:jD,element:HD,text:BD,comment:UD,doctype:PD}});function DD(e,t){const r=(t||ID).space;return Dw(e,r==="svg"?ks:vu)}function jD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=ob(e.children,n,t),Su(e,n),n}function MD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=ob(e.children,n,t),Su(e,n),n}function PD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Su(e,t),t}function BD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Su(e,t),t}function UD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Su(e,t),t}function HD(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ks);const i=[];let l;if(e.properties){for(l in e.properties)if(l!=="children"&&OD.call(e.properties,l)){const f=FD(r,l,e.properties[l]);f&&i.push(f)}}const o=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:ro[o],childNodes:[],parentNode:null};return c.childNodes=ob(e.children,c,r),Su(e,c),e.tagName==="template"&&e.content&&(c.content=MD(e.content,r)),c}function FD(e,t,n){const r=hd(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?H1(n):F1(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=ro[r.space]}return i}function ob(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const l=Dw(e[r],n);l.parentNode=t,i.push(l)}return i}function Su(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 zD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Cn="�";var B;(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"})(B||(B={}));const ea={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function jw(e){return e>=55296&&e<=57343}function $D(e){return e>=56320&&e<=57343}function VD(e,t){return(e-55296)*1024+9216+t}function Mw(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Pw(e){return e>=64976&&e<=65007||zD.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 GD=65536;class qD{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=GD,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($D(n))return this.pos++,this._addGap(),VD(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.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,B.EOF;const r=this.html.charCodeAt(n);return r===B.CARRIAGE_RETURN?B.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,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,jw(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Mw(t)?this._err(pe.controlCharacterInInputStream):Pw(t)&&this._err(pe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var It;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(It||(It={}));function Bw(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 YD=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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 QD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=WD.get(e))!==null&&t!==void 0?t:e}var br;(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"})(br||(br={}));const XD=32;var ol;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ol||(ol={}));function Xg(e){return e>=br.ZERO&&e<=br.NINE}function KD(e){return e>=br.UPPER_A&&e<=br.UPPER_F||e>=br.LOWER_A&&e<=br.LOWER_F}function ZD(e){return e>=br.UPPER_A&&e<=br.UPPER_Z||e>=br.LOWER_A&&e<=br.LOWER_Z||Xg(e)}function JD(e){return e===br.EQUALS||ZD(e)}var mr;(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"})(mr||(mr={}));var fi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(fi||(fi={}));class ej{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=mr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=fi.Strict}startEntity(t){this.decodeMode=t,this.state=mr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case mr.EntityStart:return t.charCodeAt(n)===br.NUM?(this.state=mr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=mr.NamedEntity,this.stateNamedEntity(t,n));case mr.NumericStart:return this.stateNumericStart(t,n);case mr.NumericDecimal:return this.stateNumericDecimal(t,n);case mr.NumericHex:return this.stateNumericHex(t,n);case mr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|XD)===br.LOWER_X?(this.state=mr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=mr.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(Xg(i)||KD(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(Xg(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===br.SEMI)this.consumed+=1;else if(this.decodeMode===fi.Strict)return 0;return this.emitCodePoint(QD(this.result),this.consumed),this.errors&&(t!==br.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&ol.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=tj(r,i,this.treeIndex+Math.max(1,l),o),this.treeIndex<0)return this.result===0||this.decodeMode===fi.Attribute&&(l===0||JD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],l=(i&ol.VALUE_LENGTH)>>14,l!==0){if(o===br.SEMI)return this.emitNamedEntityData(this.treeIndex,l,this.consumed+this.excess);this.decodeMode!==fi.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]&ol.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]&~ol.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case mr.NamedEntity:return this.result!==0&&(this.decodeMode!==fi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case mr.NumericDecimal:return this.emitNumericEntity(0,2);case mr.NumericHex:return this.emitNumericEntity(0,3);case mr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case mr.EntityStart:return 0}}}function tj(e,t,n,r){const i=(t&ol.BRANCH_LENGTH)>>7,l=t&ol.JUMP_TABLE;if(i===0)return l!==0&&r===l?n:-1;if(l){const f=r-l;return f<0||f>=i?-1:e[n+f]-1}let o=n,c=o+i-1;for(;o<=c;){const f=o+c>>>1,h=e[f];if(h<r)o=f+1;else if(h>r)c=f-1;else return e[f+i]}return-1}var 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 io;(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"})(io||(io={}));var Ma;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ma||(Ma={}));var ae;(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"})(ae||(ae={}));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 nj=new Map([[ae.A,_.A],[ae.ADDRESS,_.ADDRESS],[ae.ANNOTATION_XML,_.ANNOTATION_XML],[ae.APPLET,_.APPLET],[ae.AREA,_.AREA],[ae.ARTICLE,_.ARTICLE],[ae.ASIDE,_.ASIDE],[ae.B,_.B],[ae.BASE,_.BASE],[ae.BASEFONT,_.BASEFONT],[ae.BGSOUND,_.BGSOUND],[ae.BIG,_.BIG],[ae.BLOCKQUOTE,_.BLOCKQUOTE],[ae.BODY,_.BODY],[ae.BR,_.BR],[ae.BUTTON,_.BUTTON],[ae.CAPTION,_.CAPTION],[ae.CENTER,_.CENTER],[ae.CODE,_.CODE],[ae.COL,_.COL],[ae.COLGROUP,_.COLGROUP],[ae.DD,_.DD],[ae.DESC,_.DESC],[ae.DETAILS,_.DETAILS],[ae.DIALOG,_.DIALOG],[ae.DIR,_.DIR],[ae.DIV,_.DIV],[ae.DL,_.DL],[ae.DT,_.DT],[ae.EM,_.EM],[ae.EMBED,_.EMBED],[ae.FIELDSET,_.FIELDSET],[ae.FIGCAPTION,_.FIGCAPTION],[ae.FIGURE,_.FIGURE],[ae.FONT,_.FONT],[ae.FOOTER,_.FOOTER],[ae.FOREIGN_OBJECT,_.FOREIGN_OBJECT],[ae.FORM,_.FORM],[ae.FRAME,_.FRAME],[ae.FRAMESET,_.FRAMESET],[ae.H1,_.H1],[ae.H2,_.H2],[ae.H3,_.H3],[ae.H4,_.H4],[ae.H5,_.H5],[ae.H6,_.H6],[ae.HEAD,_.HEAD],[ae.HEADER,_.HEADER],[ae.HGROUP,_.HGROUP],[ae.HR,_.HR],[ae.HTML,_.HTML],[ae.I,_.I],[ae.IMG,_.IMG],[ae.IMAGE,_.IMAGE],[ae.INPUT,_.INPUT],[ae.IFRAME,_.IFRAME],[ae.KEYGEN,_.KEYGEN],[ae.LABEL,_.LABEL],[ae.LI,_.LI],[ae.LINK,_.LINK],[ae.LISTING,_.LISTING],[ae.MAIN,_.MAIN],[ae.MALIGNMARK,_.MALIGNMARK],[ae.MARQUEE,_.MARQUEE],[ae.MATH,_.MATH],[ae.MENU,_.MENU],[ae.META,_.META],[ae.MGLYPH,_.MGLYPH],[ae.MI,_.MI],[ae.MO,_.MO],[ae.MN,_.MN],[ae.MS,_.MS],[ae.MTEXT,_.MTEXT],[ae.NAV,_.NAV],[ae.NOBR,_.NOBR],[ae.NOFRAMES,_.NOFRAMES],[ae.NOEMBED,_.NOEMBED],[ae.NOSCRIPT,_.NOSCRIPT],[ae.OBJECT,_.OBJECT],[ae.OL,_.OL],[ae.OPTGROUP,_.OPTGROUP],[ae.OPTION,_.OPTION],[ae.P,_.P],[ae.PARAM,_.PARAM],[ae.PLAINTEXT,_.PLAINTEXT],[ae.PRE,_.PRE],[ae.RB,_.RB],[ae.RP,_.RP],[ae.RT,_.RT],[ae.RTC,_.RTC],[ae.RUBY,_.RUBY],[ae.S,_.S],[ae.SCRIPT,_.SCRIPT],[ae.SEARCH,_.SEARCH],[ae.SECTION,_.SECTION],[ae.SELECT,_.SELECT],[ae.SOURCE,_.SOURCE],[ae.SMALL,_.SMALL],[ae.SPAN,_.SPAN],[ae.STRIKE,_.STRIKE],[ae.STRONG,_.STRONG],[ae.STYLE,_.STYLE],[ae.SUB,_.SUB],[ae.SUMMARY,_.SUMMARY],[ae.SUP,_.SUP],[ae.TABLE,_.TABLE],[ae.TBODY,_.TBODY],[ae.TEMPLATE,_.TEMPLATE],[ae.TEXTAREA,_.TEXTAREA],[ae.TFOOT,_.TFOOT],[ae.TD,_.TD],[ae.TH,_.TH],[ae.THEAD,_.THEAD],[ae.TITLE,_.TITLE],[ae.TR,_.TR],[ae.TRACK,_.TRACK],[ae.TT,_.TT],[ae.U,_.U],[ae.UL,_.UL],[ae.SVG,_.SVG],[ae.VAR,_.VAR],[ae.WBR,_.WBR],[ae.XMP,_.XMP]]);function Nu(e){var t;return(t=nj.get(e))!==null&&t!==void 0?t:_.UNKNOWN}const Ae=_,rj={[Ce.HTML]:new Set([Ae.ADDRESS,Ae.APPLET,Ae.AREA,Ae.ARTICLE,Ae.ASIDE,Ae.BASE,Ae.BASEFONT,Ae.BGSOUND,Ae.BLOCKQUOTE,Ae.BODY,Ae.BR,Ae.BUTTON,Ae.CAPTION,Ae.CENTER,Ae.COL,Ae.COLGROUP,Ae.DD,Ae.DETAILS,Ae.DIR,Ae.DIV,Ae.DL,Ae.DT,Ae.EMBED,Ae.FIELDSET,Ae.FIGCAPTION,Ae.FIGURE,Ae.FOOTER,Ae.FORM,Ae.FRAME,Ae.FRAMESET,Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6,Ae.HEAD,Ae.HEADER,Ae.HGROUP,Ae.HR,Ae.HTML,Ae.IFRAME,Ae.IMG,Ae.INPUT,Ae.LI,Ae.LINK,Ae.LISTING,Ae.MAIN,Ae.MARQUEE,Ae.MENU,Ae.META,Ae.NAV,Ae.NOEMBED,Ae.NOFRAMES,Ae.NOSCRIPT,Ae.OBJECT,Ae.OL,Ae.P,Ae.PARAM,Ae.PLAINTEXT,Ae.PRE,Ae.SCRIPT,Ae.SECTION,Ae.SELECT,Ae.SOURCE,Ae.STYLE,Ae.SUMMARY,Ae.TABLE,Ae.TBODY,Ae.TD,Ae.TEMPLATE,Ae.TEXTAREA,Ae.TFOOT,Ae.TH,Ae.THEAD,Ae.TITLE,Ae.TR,Ae.TRACK,Ae.UL,Ae.WBR,Ae.XMP]),[Ce.MATHML]:new Set([Ae.MI,Ae.MO,Ae.MN,Ae.MS,Ae.MTEXT,Ae.ANNOTATION_XML]),[Ce.SVG]:new Set([Ae.TITLE,Ae.FOREIGN_OBJECT,Ae.DESC]),[Ce.XLINK]:new Set,[Ce.XML]:new Set,[Ce.XMLNS]:new Set},Kg=new Set([Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6]);ae.STYLE,ae.SCRIPT,ae.XMP,ae.IFRAME,ae.NOEMBED,ae.NOFRAMES,ae.PLAINTEXT;var F;(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"})(F||(F={}));const $n={DATA:F.DATA,RCDATA:F.RCDATA,RAWTEXT:F.RAWTEXT,SCRIPT_DATA:F.SCRIPT_DATA,PLAINTEXT:F.PLAINTEXT,CDATA_SECTION:F.CDATA_SECTION};function aj(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function jc(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function sj(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function nl(e){return sj(e)||jc(e)}function B_(e){return nl(e)||aj(e)}function Bf(e){return e+32}function Uw(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function U_(e){return Uw(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function ij(e){return e===B.NULL?pe.nullCharacterReference:e>1114111?pe.characterReferenceOutsideUnicodeRange:jw(e)?pe.surrogateCharacterReference:Pw(e)?pe.noncharacterCharacterReference:Mw(e)||e===B.CARRIAGE_RETURN?pe.controlCharacterReference:null}class lj{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=F.DATA,this.returnState=F.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new qD(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new ej(YD,(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=ij(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:It.START_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:It.END_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:It.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:It.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Bw(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=Nu(t.tagName),t.type===It.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(pe.endTagWithAttributes),t.selfClosing&&this._err(pe.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case It.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case It.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case It.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:It.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Uw(t)?It.WHITESPACE_CHARACTER:t===B.NULL?It.NULL_CHARACTER:It.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(It.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=F.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?fi.Attribute:fi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===F.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===F.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===F.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case F.DATA:{this._stateData(t);break}case F.RCDATA:{this._stateRcdata(t);break}case F.RAWTEXT:{this._stateRawtext(t);break}case F.SCRIPT_DATA:{this._stateScriptData(t);break}case F.PLAINTEXT:{this._statePlaintext(t);break}case F.TAG_OPEN:{this._stateTagOpen(t);break}case F.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case F.TAG_NAME:{this._stateTagName(t);break}case F.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case F.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case F.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case F.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case F.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case F.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case F.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case F.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case F.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case F.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case F.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case F.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case F.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case F.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case F.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case F.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case F.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case F.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case F.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case F.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case F.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case F.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case F.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case F.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case F.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case F.BOGUS_COMMENT:{this._stateBogusComment(t);break}case F.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case F.COMMENT_START:{this._stateCommentStart(t);break}case F.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case F.COMMENT:{this._stateComment(t);break}case F.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case F.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case F.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case F.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case F.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case F.COMMENT_END:{this._stateCommentEnd(t);break}case F.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case F.DOCTYPE:{this._stateDoctype(t);break}case F.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case F.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case F.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case F.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case F.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case F.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case F.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case F.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case F.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case F.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case F.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case F.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case F.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case F.CDATA_SECTION:{this._stateCdataSection(t);break}case F.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case F.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case F.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case F.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=F.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=F.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=F.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(nl(t))this._createStartTagToken(),this.state=F.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=F.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=F.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(pe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=F.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=F.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(nl(t))this._createEndTagToken(),this.state=F.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(pe.missingEndTagName),this.state=F.DATA;break}case B.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=F.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this.state=F.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.tagName+=Cn;break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(jc(t)?Bf(t):t)}}_stateRcdataLessThanSign(t){t===B.SOLIDUS?this.state=F.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=F.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){nl(t)?(this.state=F.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=F.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=F.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=F.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=F.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===B.SOLIDUS?this.state=F.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=F.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){nl(t)?(this.state=F.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=F.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case B.SOLIDUS:{this.state=F.SCRIPT_DATA_END_TAG_OPEN;break}case B.EXCLAMATION_MARK:{this.state=F.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=F.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){nl(t)?(this.state=F.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===B.HYPHEN_MINUS?(this.state=F.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===B.HYPHEN_MINUS?(this.state=F.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_ESCAPED,this._emitChars(Cn);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.GREATER_THAN_SIGN:{this.state=F.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_ESCAPED,this._emitChars(Cn);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=F.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:nl(t)?(this._emitChars("<"),this.state=F.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){nl(t)?(this.state=F.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(ea.SCRIPT,!1)&&U_(this.preprocessor.peek(ea.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<ea.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Cn);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Cn);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.GREATER_THAN_SIGN:{this.state=F.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Cn);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=F.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(ea.SCRIPT,!1)&&U_(this.preprocessor.peek(ea.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<ea.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=F.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this.state=F.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._err(pe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=F.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=F.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this._leaveAttrName(),this.state=F.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._leaveAttrName(),this.state=F.BEFORE_ATTRIBUTE_VALUE;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:{this._err(pe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.name+=Cn;break}default:this.currentAttr.name+=String.fromCodePoint(jc(t)?Bf(t):t)}}_stateAfterAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:{this.state=F.SELF_CLOSING_START_TAG;break}case B.EQUALS_SIGN:{this.state=F.BEFORE_ATTRIBUTE_VALUE;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=F.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{this.state=F.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this.state=F.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingAttributeValue),this.state=F.DATA,this.emitCurrentTagToken();break}default:this.state=F.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case B.QUOTATION_MARK:{this.state=F.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Cn;break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case B.APOSTROPHE:{this.state=F.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Cn;break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=F.BEFORE_ATTRIBUTE_NAME;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=F.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Cn;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:{this._err(pe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=F.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this._leaveAttrValue(),this.state=F.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=F.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBetweenAttributes),this.state=F.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case B.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=F.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.unexpectedSolidusInTag),this.state=F.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentComment(n);break}case B.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Cn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(ea.DASH_DASH,!0)?(this._createCommentToken(ea.DASH_DASH.length+1),this.state=F.COMMENT_START):this._consumeSequenceIfMatch(ea.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(ea.DOCTYPE.length+1),this.state=F.DOCTYPE):this._consumeSequenceIfMatch(ea.CDATA_START,!0)?this.inForeignNode?this.state=F.CDATA_SECTION:(this._err(pe.cdataInHtmlContent),this._createCommentToken(ea.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=F.BOGUS_COMMENT):this._ensureHibernation()||(this._err(pe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=F.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_START_DASH;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=F.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=F.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_END;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=F.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=F.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_END_DASH;break}case B.LESS_THAN_SIGN:{n.data+="<",this.state=F.COMMENT_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Cn;break}case B.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 B.EXCLAMATION_MARK:{n.data+="!",this.state=F.COMMENT_LESS_THAN_SIGN_BANG;break}case B.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=F.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===B.HYPHEN_MINUS?this.state=F.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=F.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===B.HYPHEN_MINUS?this.state=F.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=F.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==B.GREATER_THAN_SIGN&&t!==B.EOF&&this._err(pe.nestedComment),this.state=F.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_END;break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=F.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentComment(n);break}case B.EXCLAMATION_MARK:{this.state=F.COMMENT_END_BANG;break}case B.HYPHEN_MINUS:{n.data+="-";break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=F.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{n.data+="--!",this.state=F.COMMENT_END_DASH;break}case B.GREATER_THAN_SIGN:{this._err(pe.incorrectlyClosedComment),this.state=F.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=F.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=F.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case B.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=F.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(jc(t))this._createDoctypeToken(String.fromCharCode(Bf(t))),this.state=F.DOCTYPE_NAME;else switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:{this._err(pe.unexpectedNullCharacter),this._createDoctypeToken(Cn),this.state=F.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.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=F.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.AFTER_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.name+=Cn;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(jc(t)?Bf(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(ea.PUBLIC,!1)?this.state=F.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(ea.SYSTEM,!1)?this.state=F.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(pe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{n.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=F.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Cn;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.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 B.APOSTROPHE:{this.state=F.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Cn;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.QUOTATION_MARK:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.QUOTATION_MARK:{n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=F.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Cn;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.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 B.APOSTROPHE:{this.state=F.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Cn;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=F.DATA;break}case B.NULL:{this._err(pe.unexpectedNullCharacter);break}case B.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case B.RIGHT_SQUARE_BRACKET:{this.state=F.CDATA_SECTION_BRACKET;break}case B.EOF:{this._err(pe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===B.RIGHT_SQUARE_BRACKET?this.state=F.CDATA_SECTION_END:(this._emitChars("]"),this.state=F.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case B.GREATER_THAN_SIGN:{this.state=F.DATA;break}case B.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=F.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(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&B_(this.preprocessor.peek(1))?F.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){B_(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(pe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Hw=new Set([_.DD,_.DT,_.LI,_.OPTGROUP,_.OPTION,_.P,_.RB,_.RP,_.RT,_.RTC]),H_=new Set([...Hw,_.CAPTION,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]),Nh=new Set([_.APPLET,_.CAPTION,_.HTML,_.MARQUEE,_.OBJECT,_.TABLE,_.TD,_.TEMPLATE,_.TH]),oj=new Set([...Nh,_.OL,_.UL]),uj=new Set([...Nh,_.BUTTON]),F_=new Set([_.ANNOTATION_XML,_.MI,_.MN,_.MO,_.MS,_.MTEXT]),z_=new Set([_.DESC,_.FOREIGN_OBJECT,_.TITLE]),cj=new Set([_.TR,_.TEMPLATE,_.HTML]),dj=new Set([_.TBODY,_.TFOOT,_.THEAD,_.TEMPLATE,_.HTML]),fj=new Set([_.TABLE,_.TEMPLATE,_.HTML]),hj=new Set([_.TD,_.TH]);class mj{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(Kg,Ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(hj,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(fj,Ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(dj,Ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(cj,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(z_.has(i))return!1;break}case Ce.MATHML:{if(F_.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Nh)}hasInListItemScope(t){return this.hasInDynamicScope(t,oj)}hasInButtonScope(t){return this.hasInDynamicScope(t,uj)}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(Kg.has(n))return!0;if(Nh.has(n))return!1;break}case Ce.SVG:{if(z_.has(n))return!1;break}case Ce.MATHML:{if(F_.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&&Hw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&H_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&H_.has(this.currentTagId);)this.pop()}}const Q0=3;var _s;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(_s||(_s={}));const $_={type:_s.Marker};class pj{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,l=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const f=this.entries[c];if(f.type===_s.Marker)break;const{element:h}=f;if(this.treeAdapter.getTagName(h)===l&&this.treeAdapter.getNamespaceURI(h)===o){const g=this.treeAdapter.getAttrList(h);g.length===i&&r.push({idx:c,attrs:g})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Q0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Q0)return;const i=new Map(n.map(o=>[o.name,o.value]));let l=0;for(let o=0;o<r.length;o++){const c=r[o];c.attrs.every(f=>i.get(f.name)===f.value)&&(l+=1,l>=Q0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift($_)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:_s.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:_s.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf($_);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===_s.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===_s.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===_s.Element&&n.element===t)}}const rl={createDocument(){return{nodeName:"#document",mode:Ma.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};rl.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(rl.isTextNode(n)){n.value+=t;return}}rl.appendChild(e,rl.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&rl.isTextNode(r)?r.value+=t:rl.insertBefore(e,rl.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}}},Fw="html",gj="about:legacy-compat",bj="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",zw=["+//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//"],xj=[...zw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],yj=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),$w=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Ej=[...$w,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function V_(e,t){return t.some(n=>e.startsWith(n))}function _j(e){return e.name===Fw&&e.publicId===null&&(e.systemId===null||e.systemId===gj)}function Tj(e){if(e.name!==Fw)return Ma.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===bj)return Ma.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),yj.has(n))return Ma.QUIRKS;let r=t===null?xj:zw;if(V_(n,r))return Ma.QUIRKS;if(r=t===null?$w:Ej,V_(n,r))return Ma.LIMITED_QUIRKS}return Ma.NO_QUIRKS}const G_={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},vj="definitionurl",kj="definitionURL",wj=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Cj=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace: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}]]),Sj=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])),Nj=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 Aj(e){const t=e.tagID;return t===_.FONT&&e.attrs.some(({name:r})=>r===io.COLOR||r===io.SIZE||r===io.FACE)||Nj.has(t)}function Vw(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===vj){e.attrs[t].name=kj;break}}function Gw(e){for(let t=0;t<e.attrs.length;t++){const n=wj.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ub(e){for(let t=0;t<e.attrs.length;t++){const n=Cj.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Rj(e){const t=Sj.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Nu(e.tagName))}function Lj(e,t){return t===Ce.MATHML&&(e===_.MI||e===_.MO||e===_.MN||e===_.MS||e===_.MTEXT)}function Ij(e,t,n){if(t===Ce.MATHML&&e===_.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===io.ENCODING){const i=n[r].value.toLowerCase();return i===G_.TEXT_HTML||i===G_.APPLICATION_XML}}return t===Ce.SVG&&(e===_.FOREIGN_OBJECT||e===_.DESC||e===_.TITLE)}function Oj(e,t,n,r){return(!r||r===Ce.HTML)&&Ij(e,t,n)||(!r||r===Ce.MATHML)&&Lj(e,t)}const Dj="hidden",jj=8,Mj=3;var V;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(V||(V={}));const Pj={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},qw=new Set([_.TABLE,_.TBODY,_.TFOOT,_.THEAD,_.TR]),q_={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:rl,onParseError:null};class Y_{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=V.INITIAL,this.originalInsertionMode=V.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...q_,...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 lj(this.options,this),this.activeFormattingElements=new pj(this.treeAdapter),this.fragmentContextID=r?Nu(this.treeAdapter.getTagName(r)):_.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new mj(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={...q_,...n};t??(t=r.treeAdapter.createElement(ae.TEMPLATE,Ce.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ce.HTML,[]),l=new this(r,i,t);return l.fragmentContextID===_.TEMPLATE&&l.tmplInsertionModeStack.unshift(V.IN_TEMPLATE),l._initTokenizerForFragmentParsing(),l._insertFakeRootElement(),l._resetInsertionMode(),l._findFormInFragmentContext(),l}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const l=(i=t.location)!==null&&i!==void 0?i:Pj,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=V.TEXT}switchToPlaintextParsing(){this.insertionMode=V.TEXT,this.originalInsertionMode=V.IN_BODY,this.tokenizer.state=$n.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)===ae.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=$n.RCDATA;break}case _.STYLE:case _.XMP:case _.IFRAME:case _.NOEMBED:case _.NOFRAMES:case _.NOSCRIPT:{this.tokenizer.state=$n.RAWTEXT;break}case _.SCRIPT:{this.tokenizer.state=$n.SCRIPT_DATA;break}case _.PLAINTEXT:{this.tokenizer.state=$n.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(ae.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:f,endCol:h,endOffset:g}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:f,endCol:h,endOffset:g})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),l=n.type===It.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,l)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===_.SVG&&this.treeAdapter.getTagName(n)===ae.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 It.CHARACTER:{this.onCharacter(t);break}case It.NULL_CHARACTER:{this.onNullCharacter(t);break}case It.COMMENT:{this.onComment(t);break}case It.DOCTYPE:{this.onDoctype(t);break}case It.START_TAG:{this._processStartTag(t);break}case It.END_TAG:{this.onEndTag(t);break}case It.EOF:{this.onEof(t);break}case It.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),l=this.treeAdapter.getAttrList(n);return Oj(t,i,l,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===_s.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const l=this.activeFormattingElements.entries[i];this._insertElement(l.token,this.treeAdapter.getNamespaceURI(l.element)),l.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=V.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(_.P),this.openElements.popUntilTagNamePopped(_.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case _.TR:{this.insertionMode=V.IN_ROW;return}case _.TBODY:case _.THEAD:case _.TFOOT:{this.insertionMode=V.IN_TABLE_BODY;return}case _.CAPTION:{this.insertionMode=V.IN_CAPTION;return}case _.COLGROUP:{this.insertionMode=V.IN_COLUMN_GROUP;return}case _.TABLE:{this.insertionMode=V.IN_TABLE;return}case _.BODY:{this.insertionMode=V.IN_BODY;return}case _.FRAMESET:{this.insertionMode=V.IN_FRAMESET;return}case _.SELECT:{this._resetInsertionModeForSelect(t);return}case _.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case _.HTML:{this.insertionMode=this.headElement?V.AFTER_HEAD:V.BEFORE_HEAD;return}case _.TD:case _.TH:{if(t>0){this.insertionMode=V.IN_CELL;return}break}case _.HEAD:{if(t>0){this.insertionMode=V.IN_HEAD;return}break}}this.insertionMode=V.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===_.TEMPLATE)break;if(r===_.TABLE){this.insertionMode=V.IN_SELECT_IN_TABLE;return}}this.insertionMode=V.IN_SELECT}_isElementCausesFosterParenting(t){return qw.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 rj[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){hM(this,t);return}switch(this.insertionMode){case V.INITIAL:{kc(this,t);break}case V.BEFORE_HTML:{zc(this,t);break}case V.BEFORE_HEAD:{$c(this,t);break}case V.IN_HEAD:{Vc(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Gc(this,t);break}case V.AFTER_HEAD:{qc(this,t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:{Ww(this,t);break}case V.TEXT:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{X0(this,t);break}case V.IN_TABLE_TEXT:{e3(this,t);break}case V.IN_COLUMN_GROUP:{Ah(this,t);break}case V.AFTER_BODY:{Rh(this,t);break}case V.AFTER_AFTER_BODY:{ch(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){fM(this,t);return}switch(this.insertionMode){case V.INITIAL:{kc(this,t);break}case V.BEFORE_HTML:{zc(this,t);break}case V.BEFORE_HEAD:{$c(this,t);break}case V.IN_HEAD:{Vc(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Gc(this,t);break}case V.AFTER_HEAD:{qc(this,t);break}case V.TEXT:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{X0(this,t);break}case V.IN_COLUMN_GROUP:{Ah(this,t);break}case V.AFTER_BODY:{Rh(this,t);break}case V.AFTER_AFTER_BODY:{ch(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Zg(this,t);return}switch(this.insertionMode){case V.INITIAL:case V.BEFORE_HTML:case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_TEMPLATE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{Zg(this,t);break}case V.IN_TABLE_TEXT:{wc(this,t);break}case V.AFTER_BODY:{Vj(this,t);break}case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{Gj(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case V.INITIAL:{qj(this,t);break}case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:{this._err(t,pe.misplacedDoctype);break}case V.IN_TABLE_TEXT:{wc(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)?mM(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{kc(this,t);break}case V.BEFORE_HTML:{Yj(this,t);break}case V.BEFORE_HEAD:{Qj(this,t);break}case V.IN_HEAD:{ls(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Zj(this,t);break}case V.AFTER_HEAD:{e9(this,t);break}case V.IN_BODY:{Rr(this,t);break}case V.IN_TABLE:{gu(this,t);break}case V.IN_TABLE_TEXT:{wc(this,t);break}case V.IN_CAPTION:{X9(this,t);break}case V.IN_COLUMN_GROUP:{fb(this,t);break}case V.IN_TABLE_BODY:{im(this,t);break}case V.IN_ROW:{lm(this,t);break}case V.IN_CELL:{J9(this,t);break}case V.IN_SELECT:{r3(this,t);break}case V.IN_SELECT_IN_TABLE:{tM(this,t);break}case V.IN_TEMPLATE:{rM(this,t);break}case V.AFTER_BODY:{sM(this,t);break}case V.IN_FRAMESET:{iM(this,t);break}case V.AFTER_FRAMESET:{oM(this,t);break}case V.AFTER_AFTER_BODY:{cM(this,t);break}case V.AFTER_AFTER_FRAMESET:{dM(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?pM(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{kc(this,t);break}case V.BEFORE_HTML:{Wj(this,t);break}case V.BEFORE_HEAD:{Xj(this,t);break}case V.IN_HEAD:{Kj(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Jj(this,t);break}case V.AFTER_HEAD:{t9(this,t);break}case V.IN_BODY:{sm(this,t);break}case V.TEXT:{H9(this,t);break}case V.IN_TABLE:{ad(this,t);break}case V.IN_TABLE_TEXT:{wc(this,t);break}case V.IN_CAPTION:{K9(this,t);break}case V.IN_COLUMN_GROUP:{Z9(this,t);break}case V.IN_TABLE_BODY:{Jg(this,t);break}case V.IN_ROW:{n3(this,t);break}case V.IN_CELL:{eM(this,t);break}case V.IN_SELECT:{a3(this,t);break}case V.IN_SELECT_IN_TABLE:{nM(this,t);break}case V.IN_TEMPLATE:{aM(this,t);break}case V.AFTER_BODY:{i3(this,t);break}case V.IN_FRAMESET:{lM(this,t);break}case V.AFTER_FRAMESET:{uM(this,t);break}case V.AFTER_AFTER_BODY:{ch(this,t);break}}}onEof(t){switch(this.insertionMode){case V.INITIAL:{kc(this,t);break}case V.BEFORE_HTML:{zc(this,t);break}case V.BEFORE_HEAD:{$c(this,t);break}case V.IN_HEAD:{Vc(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Gc(this,t);break}case V.AFTER_HEAD:{qc(this,t);break}case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{Zw(this,t);break}case V.TEXT:{F9(this,t);break}case V.IN_TABLE_TEXT:{wc(this,t);break}case V.IN_TEMPLATE:{s3(this,t);break}case V.AFTER_BODY:case V.IN_FRAMESET:case V.AFTER_FRAMESET:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{db(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.TEXT:case V.IN_COLUMN_GROUP:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{this._insertCharacters(t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:case V.AFTER_BODY:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{Yw(this,t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{X0(this,t);break}case V.IN_TABLE_TEXT:{Jw(this,t);break}}}}function Bj(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):Kw(e,t),n}function Uj(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 Hj(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let l=0,o=i;o!==n;l++,o=i){i=e.openElements.getCommonAncestor(o);const c=e.activeFormattingElements.getElementEntry(o),f=c&&l>=Mj;!c||f?(f&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(o)):(o=Fj(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Fj(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 zj(e,t,n){const r=e.treeAdapter.getTagName(t),i=Nu(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 $j(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 cb(e,t){for(let n=0;n<jj;n++){const r=Bj(e,t);if(!r)break;const i=Uj(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const l=Hj(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(l),o&&zj(e,o,l),$j(e,i,r)}}function Zg(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Vj(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Gj(e,t){e._appendCommentNode(t,e.document)}function db(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 qj(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ma.QUIRKS:Tj(t);_j(t)||e._err(t,pe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=V.BEFORE_HTML}function kc(e,t){e._err(t,pe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ma.QUIRKS),e.insertionMode=V.BEFORE_HTML,e._processToken(t)}function Yj(e,t){t.tagID===_.HTML?(e._insertElement(t,Ce.HTML),e.insertionMode=V.BEFORE_HEAD):zc(e,t)}function Wj(e,t){const n=t.tagID;(n===_.HTML||n===_.HEAD||n===_.BODY||n===_.BR)&&zc(e,t)}function zc(e,t){e._insertFakeRootElement(),e.insertionMode=V.BEFORE_HEAD,e._processToken(t)}function Qj(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.HEAD:{e._insertElement(t,Ce.HTML),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD;break}default:$c(e,t)}}function Xj(e,t){const n=t.tagID;n===_.HEAD||n===_.BODY||n===_.HTML||n===_.BR?$c(e,t):e._err(t,pe.endTagWithoutMatchingOpenElement)}function $c(e,t){e._insertFakeElement(ae.HEAD,_.HEAD),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD,e._processToken(t)}function ls(e,t){switch(t.tagID){case _.HTML:{Rr(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,$n.RCDATA);break}case _.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$n.RAWTEXT):(e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_HEAD_NO_SCRIPT);break}case _.NOFRAMES:case _.STYLE:{e._switchToTextParsing(t,$n.RAWTEXT);break}case _.SCRIPT:{e._switchToTextParsing(t,$n.SCRIPT_DATA);break}case _.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=V.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(V.IN_TEMPLATE);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Vc(e,t)}}function Kj(e,t){switch(t.tagID){case _.HEAD:{e.openElements.pop(),e.insertionMode=V.AFTER_HEAD;break}case _.BODY:case _.BR:case _.HTML:{Vc(e,t);break}case _.TEMPLATE:{mo(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function mo(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 Vc(e,t){e.openElements.pop(),e.insertionMode=V.AFTER_HEAD,e._processToken(t)}function Zj(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.BASEFONT:case _.BGSOUND:case _.HEAD:case _.LINK:case _.META:case _.NOFRAMES:case _.STYLE:{ls(e,t);break}case _.NOSCRIPT:{e._err(t,pe.nestedNoscriptInHead);break}default:Gc(e,t)}}function Jj(e,t){switch(t.tagID){case _.NOSCRIPT:{e.openElements.pop(),e.insertionMode=V.IN_HEAD;break}case _.BR:{Gc(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Gc(e,t){const n=t.type===It.EOF?pe.openElementsLeftAfterEof:pe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=V.IN_HEAD,e._processToken(t)}function e9(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.BODY:{e._insertElement(t,Ce.HTML),e.framesetOk=!1,e.insertionMode=V.IN_BODY;break}case _.FRAMESET:{e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_FRAMESET;break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{e._err(t,pe.abandonedHeadElementChild),e.openElements.push(e.headElement,_.HEAD),ls(e,t),e.openElements.remove(e.headElement);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:qc(e,t)}}function t9(e,t){switch(t.tagID){case _.BODY:case _.HTML:case _.BR:{qc(e,t);break}case _.TEMPLATE:{mo(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function qc(e,t){e._insertFakeElement(ae.BODY,_.BODY),e.insertionMode=V.IN_BODY,am(e,t)}function am(e,t){switch(t.type){case It.CHARACTER:{Ww(e,t);break}case It.WHITESPACE_CHARACTER:{Yw(e,t);break}case It.COMMENT:{Zg(e,t);break}case It.START_TAG:{Rr(e,t);break}case It.END_TAG:{sm(e,t);break}case It.EOF:{Zw(e,t);break}}}function Yw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Ww(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function n9(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function r9(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function a9(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_FRAMESET)}function s9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML)}function i9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Kg.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ce.HTML)}function l9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function o9(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 u9(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 c9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),e.tokenizer.state=$n.PLAINTEXT}function d9(e,t){e.openElements.hasInScope(_.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.framesetOk=!1}function f9(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ae.A);n&&(cb(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 h9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function m9(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(_.NOBR)&&(cb(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function p9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function g9(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ma.QUIRKS&&e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Ce.HTML),e.framesetOk=!1,e.insertionMode=V.IN_TABLE}function Qw(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Xw(e){const t=Bw(e,io.TYPE);return t!=null&&t.toLowerCase()===Dj}function b9(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ce.HTML),Xw(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function x9(e,t){e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0}function y9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._appendElement(t,Ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function E9(e,t){t.tagName=ae.IMG,t.tagID=_.IMG,Qw(e,t)}function _9(e,t){e._insertElement(t,Ce.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$n.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=V.TEXT}function T9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$n.RAWTEXT)}function v9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$n.RAWTEXT)}function W_(e,t){e._switchToTextParsing(t,$n.RAWTEXT)}function k9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===V.IN_TABLE||e.insertionMode===V.IN_CAPTION||e.insertionMode===V.IN_TABLE_BODY||e.insertionMode===V.IN_ROW||e.insertionMode===V.IN_CELL?V.IN_SELECT_IN_TABLE:V.IN_SELECT}function w9(e,t){e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML)}function C9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ce.HTML)}function S9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(_.RTC),e._insertElement(t,Ce.HTML)}function N9(e,t){e._reconstructActiveFormattingElements(),Vw(t),ub(t),t.selfClosing?e._appendElement(t,Ce.MATHML):e._insertElement(t,Ce.MATHML),t.ackSelfClosing=!0}function A9(e,t){e._reconstructActiveFormattingElements(),Gw(t),ub(t),t.selfClosing?e._appendElement(t,Ce.SVG):e._insertElement(t,Ce.SVG),t.ackSelfClosing=!0}function Q_(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ce.HTML)}function Rr(e,t){switch(t.tagID){case _.I:case _.S:case _.B:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.SMALL:case _.STRIKE:case _.STRONG:{h9(e,t);break}case _.A:{f9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{i9(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:{s9(e,t);break}case _.LI:case _.DD:case _.DT:{u9(e,t);break}case _.BR:case _.IMG:case _.WBR:case _.AREA:case _.EMBED:case _.KEYGEN:{Qw(e,t);break}case _.HR:{y9(e,t);break}case _.RB:case _.RTC:{C9(e,t);break}case _.RT:case _.RP:{S9(e,t);break}case _.PRE:case _.LISTING:{l9(e,t);break}case _.XMP:{T9(e,t);break}case _.SVG:{A9(e,t);break}case _.HTML:{n9(e,t);break}case _.BASE:case _.LINK:case _.META:case _.STYLE:case _.TITLE:case _.SCRIPT:case _.BGSOUND:case _.BASEFONT:case _.TEMPLATE:{ls(e,t);break}case _.BODY:{r9(e,t);break}case _.FORM:{o9(e,t);break}case _.NOBR:{m9(e,t);break}case _.MATH:{N9(e,t);break}case _.TABLE:{g9(e,t);break}case _.INPUT:{b9(e,t);break}case _.PARAM:case _.TRACK:case _.SOURCE:{x9(e,t);break}case _.IMAGE:{E9(e,t);break}case _.BUTTON:{d9(e,t);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{p9(e,t);break}case _.IFRAME:{v9(e,t);break}case _.SELECT:{k9(e,t);break}case _.OPTION:case _.OPTGROUP:{w9(e,t);break}case _.NOEMBED:case _.NOFRAMES:{W_(e,t);break}case _.FRAMESET:{a9(e,t);break}case _.TEXTAREA:{_9(e,t);break}case _.NOSCRIPT:{e.options.scriptingEnabled?W_(e,t):Q_(e,t);break}case _.PLAINTEXT:{c9(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:Q_(e,t)}}function R9(e,t){if(e.openElements.hasInScope(_.BODY)&&(e.insertionMode=V.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function L9(e,t){e.openElements.hasInScope(_.BODY)&&(e.insertionMode=V.AFTER_BODY,i3(e,t))}function I9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function O9(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(ae.P,_.P),e._closePElement()}function j9(e){e.openElements.hasInListItemScope(_.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(_.LI),e.openElements.popUntilTagNamePopped(_.LI))}function M9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function P9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function B9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function U9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ae.BR,_.BR),e.openElements.pop(),e.framesetOk=!1}function Kw(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 sm(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:{cb(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:{I9(e,t);break}case _.LI:{j9(e);break}case _.DD:case _.DT:{M9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{P9(e);break}case _.BR:{U9(e);break}case _.BODY:{R9(e,t);break}case _.HTML:{L9(e,t);break}case _.FORM:{O9(e);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{B9(e,t);break}case _.TEMPLATE:{mo(e,t);break}default:Kw(e,t)}}function Zw(e,t){e.tmplInsertionModeStack.length>0?s3(e,t):db(e,t)}function H9(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 F9(e,t){e._err(t,pe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function X0(e,t){if(e.openElements.currentTagId!==void 0&&qw.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=V.IN_TABLE_TEXT,t.type){case It.CHARACTER:{e3(e,t);break}case It.WHITESPACE_CHARACTER:{Jw(e,t);break}}else pd(e,t)}function z9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_CAPTION}function $9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_COLUMN_GROUP}function V9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.COLGROUP,_.COLGROUP),e.insertionMode=V.IN_COLUMN_GROUP,fb(e,t)}function G9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_TABLE_BODY}function q9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.TBODY,_.TBODY),e.insertionMode=V.IN_TABLE_BODY,im(e,t)}function Y9(e,t){e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function W9(e,t){Xw(t)?e._appendElement(t,Ce.HTML):pd(e,t),t.ackSelfClosing=!0}function Q9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ce.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function gu(e,t){switch(t.tagID){case _.TD:case _.TH:case _.TR:{q9(e,t);break}case _.STYLE:case _.SCRIPT:case _.TEMPLATE:{ls(e,t);break}case _.COL:{V9(e,t);break}case _.FORM:{Q9(e,t);break}case _.TABLE:{Y9(e,t);break}case _.TBODY:case _.TFOOT:case _.THEAD:{G9(e,t);break}case _.INPUT:{W9(e,t);break}case _.CAPTION:{z9(e,t);break}case _.COLGROUP:{$9(e,t);break}default:pd(e,t)}}function ad(e,t){switch(t.tagID){case _.TABLE:{e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode());break}case _.TEMPLATE:{mo(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:pd(e,t)}}function pd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,am(e,t),e.fosterParentingEnabled=n}function Jw(e,t){e.pendingCharacterTokens.push(t)}function e3(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function wc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)pd(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const t3=new Set([_.CAPTION,_.COL,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]);function X9(e,t){const n=t.tagID;t3.has(n)?e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,gu(e,t)):Rr(e,t)}function K9(e,t){const n=t.tagID;switch(n){case _.CAPTION:case _.TABLE:{e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,n===_.TABLE&&ad(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:sm(e,t)}}function fb(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.COL:{e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0;break}case _.TEMPLATE:{ls(e,t);break}default:Ah(e,t)}}function Z9(e,t){switch(t.tagID){case _.COLGROUP:{e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case _.TEMPLATE:{mo(e,t);break}case _.COL:break;default:Ah(e,t)}}function Ah(e,t){e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE,e._processToken(t))}function im(e,t){switch(t.tagID){case _.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_ROW;break}case _.TH:case _.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ae.TR,_.TR),e.insertionMode=V.IN_ROW,lm(e,t);break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,gu(e,t));break}default:gu(e,t)}}function Jg(e,t){const n=t.tagID;switch(t.tagID){case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case _.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,ad(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:case _.TR:break;default:ad(e,t)}}function lm(e,t){switch(t.tagID){case _.TH:case _.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ce.HTML),e.insertionMode=V.IN_CELL,e.activeFormattingElements.insertMarker();break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,im(e,t));break}default:gu(e,t)}}function n3(e,t){switch(t.tagID){case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY);break}case _.TABLE:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,Jg(e,t));break}case _.TBODY:case _.TFOOT:case _.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(_.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,Jg(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:break;default:ad(e,t)}}function J9(e,t){const n=t.tagID;t3.has(n)?(e.openElements.hasInTableScope(_.TD)||e.openElements.hasInTableScope(_.TH))&&(e._closeTableCell(),lm(e,t)):Rr(e,t)}function eM(e,t){const n=t.tagID;switch(n){case _.TD:case _.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_ROW);break}case _.TABLE:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),n3(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:break;default:sm(e,t)}}function r3(e,t){switch(t.tagID){case _.HTML:{Rr(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:{ls(e,t);break}}}function a3(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:{mo(e,t);break}}}function tM(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)):r3(e,t)}function nM(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)):a3(e,t)}function rM(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:{ls(e,t);break}case _.CAPTION:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.tmplInsertionModeStack[0]=V.IN_TABLE,e.insertionMode=V.IN_TABLE,gu(e,t);break}case _.COL:{e.tmplInsertionModeStack[0]=V.IN_COLUMN_GROUP,e.insertionMode=V.IN_COLUMN_GROUP,fb(e,t);break}case _.TR:{e.tmplInsertionModeStack[0]=V.IN_TABLE_BODY,e.insertionMode=V.IN_TABLE_BODY,im(e,t);break}case _.TD:case _.TH:{e.tmplInsertionModeStack[0]=V.IN_ROW,e.insertionMode=V.IN_ROW,lm(e,t);break}default:e.tmplInsertionModeStack[0]=V.IN_BODY,e.insertionMode=V.IN_BODY,Rr(e,t)}}function aM(e,t){t.tagID===_.TEMPLATE&&mo(e,t)}function s3(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):db(e,t)}function sM(e,t){t.tagID===_.HTML?Rr(e,t):Rh(e,t)}function i3(e,t){var n;if(t.tagID===_.HTML){if(e.fragmentContext||(e.insertionMode=V.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===_.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Rh(e,t)}function Rh(e,t){e.insertionMode=V.IN_BODY,am(e,t)}function iM(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.FRAMESET:{e._insertElement(t,Ce.HTML);break}case _.FRAME:{e._appendElement(t,Ce.HTML),t.ackSelfClosing=!0;break}case _.NOFRAMES:{ls(e,t);break}}}function lM(e,t){t.tagID===_.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==_.FRAMESET&&(e.insertionMode=V.AFTER_FRAMESET))}function oM(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.NOFRAMES:{ls(e,t);break}}}function uM(e,t){t.tagID===_.HTML&&(e.insertionMode=V.AFTER_AFTER_FRAMESET)}function cM(e,t){t.tagID===_.HTML?Rr(e,t):ch(e,t)}function ch(e,t){e.insertionMode=V.IN_BODY,am(e,t)}function dM(e,t){switch(t.tagID){case _.HTML:{Rr(e,t);break}case _.NOFRAMES:{ls(e,t);break}}}function fM(e,t){t.chars=Cn,e._insertCharacters(t)}function hM(e,t){e._insertCharacters(t),e.framesetOk=!1}function l3(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 mM(e,t){if(Aj(t))l3(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ce.MATHML?Vw(t):r===Ce.SVG&&(Rj(t),Gw(t)),ub(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function pM(e,t){if(t.tagID===_.P||t.tagID===_.BR){l3(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}}}ae.AREA,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BR,ae.COL,ae.EMBED,ae.FRAME,ae.HR,ae.IMG,ae.INPUT,ae.KEYGEN,ae.LINK,ae.META,ae.PARAM,ae.SOURCE,ae.TRACK,ae.WBR;const om=o3("end"),ws=o3("start");function o3(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 u3(e){const t=ws(e),n=om(e);if(t&&n)return{start:t,end:n}}const gM=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,bM=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),X_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function c3(e,t){const n=SM(e),r=U1("type",{handlers:{root:xM,element:yM,text:EM,comment:f3,doctype:_M,raw:vM},unknown:kM}),i={parser:n?new Y_(X_):Y_.getFragmentParser(void 0,X_),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),Au(i,ws());const l=n?i.parser.document:i.parser.getFragment(),o=AD(l,{file:i.options.file});return i.stitches&&vs(o,"comment",function(c,f,h){const g=c;if(g.value.stitch&&h&&f!==void 0){const p=h.children;return p[f]=g.value.stitch,f}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function d3(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function xM(e,t){d3(e.children,t)}function yM(e,t){wM(e,t),d3(e.children,t),CM(e,t)}function EM(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:It.CHARACTER,chars:e.value,location:gd(e)};Au(t,ws(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _M(e,t){const n={type:It.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:gd(e)};Au(t,ws(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function TM(e,t){t.stitches=!0;const n=NM(e);if("children"in e&&"children"in n){const r=c3({type:"root",children:e.children},t.options);n.children=r.children}f3({type:"comment",value:{stitch:n}},t)}function f3(e,t){const n=e.value,r={type:It.COMMENT,data:n,location:gd(e)};Au(t,ws(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function vM(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,h3(t,ws(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(gM,"&lt;$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 kM(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))TM(n,t);else{let r="";throw bM.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 Au(e,t){h3(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=$n.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 h3(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 wM(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$n.PLAINTEXT)return;Au(t,ws(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ro.html;i===ro.html&&n==="svg"&&(i=ro.svg);const l=DD({...e,children:[]},{space:i===ro.svg?"svg":"html"}),o={type:It.START_TAG,tagName:n,tagID:Nu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in l?l.attrs:[],location:gd(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function CM(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Lk.includes(n)||t.parser.tokenizer.state===$n.PLAINTEXT)return;Au(t,om(e));const r={type:It.END_TAG,tagName:n,tagID:Nu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:gd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$n.RCDATA||t.parser.tokenizer.state===$n.RAWTEXT||t.parser.tokenizer.state===$n.SCRIPT_DATA)&&(t.parser.tokenizer.state=$n.DATA)}function SM(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function gd(e){const t=ws(e)||{line:void 0,column:void 0,offset:void 0},n=om(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 NM(e){return"children"in e?oo({...e,children:[]}):oo(e)}function e1(e){return function(t,n){return c3(t,{...e,file:n})}}const Wl=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Jl={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Wl,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Wl],h2:[["className","sr-only"]],img:[...Wl,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Wl,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Wl],table:[...Wl],ul:[...Wl,["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"]},al={}.hasOwnProperty;function AM(e,t){let n={type:"root",children:[]};const r={schema:t?{...Jl,...t}:Jl,stack:[]},i=m3(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function m3(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return RM(e,n);case"doctype":return LM(e,n);case"element":return IM(e,n);case"root":return OM(e,n);case"text":return DM(e,n)}}}function RM(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 bd(l,t),l}}function LM(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return bd(n,t),n}}function IM(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=p3(e,t.children),i=jM(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&&al.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let f=-1;for(l=!1;++f<c.length;)e.stack.includes(c[f])&&(l=!0)}if(!l)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return bd(o,t),o}function OM(e,t){const r={type:"root",children:p3(e,t.children)};return bd(r,t),r}function DM(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return bd(r,t),r}function p3(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const l=m3(e,r[i]);l&&(Array.isArray(l)?n.push(...l):n.push(l))}}return n}function jM(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,l=r&&al.call(r,n)?r[n]:void 0,o=r&&al.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},f={};let h;for(h in c)if(al.call(c,h)){const g=c[h];let p=K_(e,Z_(l,h),h,g);p==null&&(p=K_(e,Z_(o,h),h,g)),p!=null&&(f[h]=p)}if(i&&al.call(i,n)){const g=i[n];for(h in g)al.call(g,h)&&!al.call(f,h)&&(f[h]=g[h])}return f}function K_(e,t,n,r){return t?Array.isArray(r)?MM(e,t,n,r):g3(e,t,n,r):void 0}function MM(e,t,n,r){let i=-1;const l=[];for(;++i<r.length;){const o=g3(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&l.push(o)}return l}function g3(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&PM(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 PM(e,t,n){const r=e.schema.protocols&&al.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),l=i.indexOf(":"),o=i.indexOf("?"),c=i.indexOf("#"),f=i.indexOf("/");if(l<0||f>-1&&l>f||o>-1&&l>o||c>-1&&l>c)return!0;let h=-1;for(;++h<r.length;){const g=r[h];if(l===g.length&&i.slice(0,g.length)===g)return!0}return!1}function bd(e,t){const n=u3(t);t.data&&(e.data=oo(t.data)),n&&(e.position=n)}function Z_(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 b3(e){return function(t){return AM(t,e)}}const zr=ml(/[A-Za-z]/),Ar=ml(/[\dA-Za-z]/),BM=ml(/[#-'*+\--9=?A-Z^-~]/);function Lh(e){return e!==null&&(e<32||e===127)}const t1=ml(/\d/),UM=ml(/[\dA-Fa-f]/),HM=ml(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function En(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const um=ml(new RegExp("\\p{P}|\\p{S}","u")),uo=ml(/\s/);function ml(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function FM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function zM(e,t,n){const i=tm((n||{}).ignore||[]),l=$M(t);let o=-1;for(;++o<l.length;)nb(e,"text",c);function c(h,g){let p=-1,x;for(;++p<g.length;){const E=g[p],v=x?x.children:void 0;if(i(E,v?v.indexOf(E):void 0,x))return;x=E}if(x)return f(h,g)}function f(h,g){const p=g[g.length-1],x=l[o][0],E=l[o][1];let v=0;const S=p.children.indexOf(h);let w=!1,O=[];x.lastIndex=0;let R=x.exec(h.value);for(;R;){const j=R.index,G={index:R.index,input:R.input,stack:[...g,h]};let N=E(...R,G);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?x.lastIndex=j+1:(v!==j&&O.push({type:"text",value:h.value.slice(v,j)}),Array.isArray(N)?O.push(...N):N&&O.push(N),v=j+R[0].length,w=!0),!x.global)break;R=x.exec(h.value)}return w?(v<h.value.length&&O.push({type:"text",value:h.value.slice(v)}),p.children.splice(S,1,...O)):O=[h],S+O.length}}function $M(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([VM(i[0]),GM(i[1])])}return t}function VM(e){return typeof e=="string"?new RegExp(FM(e),"g"):e}function GM(e){return typeof e=="function"?e:function(){return e}}const K0="phrasing",Z0=["autolink","link","image","label"];function qM(){return{transforms:[JM],enter:{literalAutolink:WM,literalAutolinkEmail:J0,literalAutolinkHttp:J0,literalAutolinkWww:J0},exit:{literalAutolink:ZM,literalAutolinkEmail:KM,literalAutolinkHttp:QM,literalAutolinkWww:XM}}}function YM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:K0,notInConstruct:Z0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:K0,notInConstruct:Z0},{character:":",before:"[ps]",after:"\\/",inConstruct:K0,notInConstruct:Z0}]}}function WM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function J0(e){this.config.enter.autolinkProtocol.call(this,e)}function QM(e){this.config.exit.autolinkProtocol.call(this,e)}function XM(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 KM(e){this.config.exit.autolinkEmail.call(this,e)}function ZM(e){this.exit(e)}function JM(e){zM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,e7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),t7]],{ignore:["link","linkReference"]})}function e7(e,t,n,r,i){let l="";if(!x3(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!n7(n)))return!1;const o=r7(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 t7(e,t,n,r){return!x3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function n7(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 r7(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=yh(e,"(");let l=yh(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 x3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||uo(n)||um(n))&&(!t||n!==47)}function ss(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}y3.peek=f7;function a7(){this.buffer()}function s7(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function i7(){this.buffer()}function l7(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function o7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ss(this.sliceSerialize(e)).toLowerCase(),n.label=t}function u7(e){this.exit(e)}function c7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ss(this.sliceSerialize(e)).toLowerCase(),n.label=t}function d7(e){this.exit(e)}function f7(){return"["}function y3(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 h7(){return{enter:{gfmFootnoteCallString:a7,gfmFootnoteCall:s7,gfmFootnoteDefinitionLabelString:i7,gfmFootnoteDefinition:l7},exit:{gfmFootnoteCallString:o7,gfmFootnoteCall:u7,gfmFootnoteDefinitionLabelString:c7,gfmFootnoteDefinition:d7}}}function m7(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:y3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){const c=l.createTracker(o);let f=c.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return f+=c.move(l.safe(l.associationId(r),{before:f,after:"]"})),g(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
247
+ `:" ")+l.indentLines(l.containerFlow(r,c.current()),t?E3:p7))),h(),f}}function p7(e,t,n){return t===0?e:E3(e,t,n)}function E3(e,t,n){return(n?"":" ")+e}const g7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_3.peek=_7;function b7(){return{canContainEols:["delete"],enter:{strikethrough:y7},exit:{strikethrough:E7}}}function x7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:g7}],handlers:{delete:_3}}}function y7(e){this.enter({type:"delete",children:[]},e)}function E7(e){this.exit(e)}function _3(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 _7(){return"~"}function T7(e){return e.length}function v7(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||T7,l=[],o=[],c=[],f=[];let h=0,g=-1;for(;++g<e.length;){const C=[],S=[];let w=-1;for(e[g].length>h&&(h=e[g].length);++w<e[g].length;){const O=k7(e[g][w]);if(n.alignDelimiters!==!1){const R=i(O);S[w]=R,(f[w]===void 0||R>f[w])&&(f[w]=R)}C.push(O)}o[g]=C,c[g]=S}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)l[p]=J_(r[p]);else{const C=J_(r);for(;++p<h;)l[p]=C}p=-1;const x=[],E=[];for(;++p<h;){const C=l[p];let S="",w="";C===99?(S=":",w=":"):C===108?S=":":C===114&&(w=":");let O=n.alignDelimiters===!1?1:Math.max(1,f[p]-S.length-w.length);const R=S+"-".repeat(O)+w;n.alignDelimiters!==!1&&(O=S.length+O+w.length,O>f[p]&&(f[p]=O),E[p]=O),x[p]=R}o.splice(1,0,x),c.splice(1,0,E),g=-1;const v=[];for(;++g<o.length;){const C=o[g],S=c[g];p=-1;const w=[];for(;++p<h;){const O=C[p]||"";let R="",j="";if(n.alignDelimiters!==!1){const G=f[p]-(S[p]||0),N=l[p];N===114?R=" ".repeat(G):N===99?G%2?(R=" ".repeat(G/2+.5),j=" ".repeat(G/2-.5)):(R=" ".repeat(G/2),j=R):j=" ".repeat(G)}n.delimiterStart!==!1&&!p&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&O==="")&&(n.delimiterStart!==!1||p)&&w.push(" "),n.alignDelimiters!==!1&&w.push(R),w.push(O),n.alignDelimiters!==!1&&w.push(j),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&w.push("|")}v.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return v.join(`
248
+ `)}function k7(e){return e==null?"":String(e)}function J_(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 w7(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),C7);return i(),o}function C7(e,t,n){return">"+(n?"":" ")+e}function S7(e,t){return eT(e,t.inConstruct,!0)&&!eT(e,t.notInConstruct,!1)}function eT(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 tT(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
249
+ `&&S7(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
250
+ `}function N7(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 A7(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 R7(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 L7(e,t,n,r){const i=R7(n),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(A7(e,n)){const p=n.enter("codeIndented"),x=n.indentLines(l,I7);return p(),x}const c=n.createTracker(r),f=i.repeat(Math.max(N7(l,i)+1,3)),h=n.enter("codeFenced");let g=c.move(f);if(e.lang){const p=n.enter(`codeFencedLang${o}`);g+=c.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);g+=c.move(" "),g+=c.move(n.safe(e.meta,{before:g,after:`
251
+ `,encode:["`"],...c.current()})),p()}return g+=c.move(`
252
+ `),l&&(g+=c.move(l+`
253
+ `)),g+=c.move(f),h(),g}function I7(e,t,n){return(n?"":" ")+e}function hb(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 O7(e,t,n,r){const i=hb(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
254
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+i),h+=f.move(n.safe(e.title,{before:h,after:i,...f.current()})),h+=f.move(i),c()),o(),h}function 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 sd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bu(e){if(e===null||En(e)||uo(e))return 1;if(um(e))return 2}function Ih(e,t,n){const r=bu(e),i=bu(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}}T3.peek=j7;function T3(e,t,n,r){const i=D7(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(i);let f=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const h=f.charCodeAt(0),g=Ih(r.before.charCodeAt(r.before.length-1),h,i);g.inside&&(f=sd(h)+f.slice(1));const p=f.charCodeAt(f.length-1),x=Ih(r.after.charCodeAt(0),p,i);x.inside&&(f=f.slice(0,-1)+sd(p));const E=o.move(i);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+E}function j7(e,t,n){return n.options.emphasis||"*"}const M7={};function mb(e,t){const n=M7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return v3(e,r,i)}function v3(e,t,n){if(P7(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 nT(e.children,t,n)}return Array.isArray(e)?nT(e,t,n):""}function nT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=v3(e[i],t,n);return r.join("")}function P7(e){return!!(e&&typeof e=="object")}function B7(e,t){let n=!1;return vs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Wg}),!!((!e.depth||e.depth<3)&&mb(e)&&(t.options.setext||n))}function U7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(B7(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),x=n.containerPhrasing(e,{...l.current(),before:`
255
+ `,after:`
256
+ `});return p(),g(),x+`
257
+ `+(i===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
258
+ `))+1))}const o="#".repeat(i),c=n.enter("headingAtx"),f=n.enter("phrasing");l.move(o+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
259
+ `,...l.current()});return/^[\t ]/.test(h)&&(h=sd(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),f(),c(),h}k3.peek=H7;function k3(e){return e.value||""}function H7(){return"<"}w3.peek=F7;function w3(e,t,n,r){const i=hb(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+i),h+=f.move(n.safe(e.title,{before:h,after:i,...f.current()})),h+=f.move(i),c()),h+=f.move(")"),o(),h}function F7(){return"!"}C3.peek=z7;function C3(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const h=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=g,l(),i==="full"||!h||h!==p?f+=c.move(p+"]"):i==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function z7(){return"!"}S3.peek=$7;function S3(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let f;if(o.atBreak)for(;f=c.exec(r);){let h=f.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(f.index+1)}}return i+r+i}function $7(){return"`"}function N3(e,t){const n=mb(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))}A3.peek=V7;function A3(e,t,n,r){const i=hb(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,f;if(N3(e,n)){const g=n.stack;n.stack=[],c=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),c(),n.stack=g,p}c=n.enter("link"),f=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(f=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=o.move(" "+i),h+=o.move(n.safe(e.title,{before:h,after:i,...o.current()})),h+=o.move(i),f()),h+=o.move(")"),c(),h}function V7(e,t,n){return N3(e,n)?"<":"["}R3.peek=G7;function R3(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=g,l(),i==="full"||!h||h!==p?f+=c.move(p+"]"):i==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function G7(){return"["}function pb(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 q7(e){const t=pb(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 Y7(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 L3(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?Y7(n):pb(n);const c=e.ordered?o==="."?")":".":q7(n);let f=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),L3(n)===o&&g){let p=-1;for(;++p<e.children.length;){const x=e.children[p];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(o=c),n.bulletCurrent=o;const h=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),h}function Q7(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 X7(e,t,n,r){const i=Q7(n);let l=n.bulletCurrent||pb(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(r);c.move(l+" ".repeat(o-l.length)),c.shift(o);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),g);return f(),h;function g(p,x,E){return x?(E?"":" ".repeat(o))+p:(E?l:l+" ".repeat(o-l.length))+p}}function K7(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}const Z7=tm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function J7(e,t,n,r){return(e.children.some(function(o){return Z7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function eP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}I3.peek=tP;function I3(e,t,n,r){const i=eP(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(i+i);let f=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const h=f.charCodeAt(0),g=Ih(r.before.charCodeAt(r.before.length-1),h,i);g.inside&&(f=sd(h)+f.slice(1));const p=f.charCodeAt(f.length-1),x=Ih(r.after.charCodeAt(0),p,i);x.inside&&(f=f.slice(0,-1)+sd(p));const E=o.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+E}function tP(e,t,n){return n.options.strong||"*"}function nP(e,t,n,r){return n.safe(e.value,r)}function rP(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 aP(e,t,n){const r=(L3(n)+(n.options.ruleSpaces?" ":"")).repeat(rP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const O3={blockquote:w7,break:tT,code:L7,definition:O7,emphasis:T3,hardBreak:tT,heading:U7,html:k3,image:w3,imageReference:C3,inlineCode:S3,link:A3,linkReference:R3,list:W7,listItem:X7,paragraph:K7,root:J7,strong:I3,text:nP,thematicBreak:aP},rT=document.createElement("i");function gb(e){const t="&"+e+";";rT.innerHTML=t;const n=rT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function D3(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 sP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iP(e){return e.replace(sP,lP)}function lP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return D3(n.slice(l?2:1),l?16:10)}return gb(n)||e}function oP(){return{enter:{table:uP,tableData:aT,tableHeader:aT,tableRow:dP},exit:{codeText:fP,table:cP,tableData:eg,tableHeader:eg,tableRow:eg}}}function uP(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 cP(e){this.exit(e),this.data.inTable=void 0}function dP(e){this.enter({type:"tableRow",children:[]},e)}function eg(e){this.exit(e)}function aT(e){this.enter({type:"tableCell",children:[]},e)}function fP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function hP(e,t){return t==="|"?t:e}function mP(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
260
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:o,tableCell:f,tableRow:c}};function o(E,v,C,S){return h(g(E,C,S),E.align)}function c(E,v,C,S){const w=p(E,C,S),O=h([w]);return O.slice(0,O.indexOf(`
261
+ `))}function f(E,v,C,S){const w=C.enter("tableCell"),O=C.enter("phrasing"),R=C.containerPhrasing(E,{...S,before:l,after:l});return O(),w(),R}function h(E,v){return v7(E,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function g(E,v,C){const S=E.children;let w=-1;const O=[],R=v.enter("table");for(;++w<S.length;)O[w]=p(S[w],v,C);return R(),O}function p(E,v,C){const S=E.children;let w=-1;const O=[],R=v.enter("tableRow");for(;++w<S.length;)O[w]=f(S[w],E,v,C);return R(),O}function x(E,v,C){let S=O3.inlineCode(E,v,C);return C.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function pP(){return{exit:{taskListCheckValueChecked:sT,taskListCheckValueUnchecked:sT,paragraph:bP}}}function gP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xP}}}function sT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function bP(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 xP(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let f=O3.listItem(e,t,n,{...r,...c.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(g){return g+o}}function yP(){return[qM(),h7(),b7(),oP(),pP()]}function EP(e){return{extensions:[YM(),m7(e),x7(),mP(e),gP()]}}function ha(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 Pa(e,t){return e.length>0?(ha(e,e.length,0,t),e):t}const iT={}.hasOwnProperty;function j3(e){const t={};let n=-1;for(;++n<e.length;)_P(t,e[n]);return t}function _P(e,t){let n;for(n in t){const i=(iT.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){iT.call(i,o)||(i[o]=[]);const c=l[o];TP(i[o],Array.isArray(c)?c:c?[c]:[])}}}function TP(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ha(e,0,0,r)}const vP={tokenize:AP,partial:!0},M3={tokenize:RP,partial:!0},P3={tokenize:LP,partial:!0},B3={tokenize:IP,partial:!0},kP={tokenize:OP,partial:!0},U3={name:"wwwAutolink",tokenize:SP,previous:F3},H3={name:"protocolAutolink",tokenize:NP,previous:z3},bi={name:"emailAutolink",tokenize:CP,previous:$3},Cs={};function wP(){return{text:Cs}}let Ql=48;for(;Ql<123;)Cs[Ql]=bi,Ql++,Ql===58?Ql=65:Ql===91&&(Ql=97);Cs[43]=bi;Cs[45]=bi;Cs[46]=bi;Cs[95]=bi;Cs[72]=[bi,H3];Cs[104]=[bi,H3];Cs[87]=[bi,U3];Cs[119]=[bi,U3];function CP(e,t,n){const r=this;let i,l;return o;function o(p){return!n1(p)||!$3.call(r,r.previous)||bb(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return n1(p)?(e.consume(p),c):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(kP,g,h)(p):p===45||p===95||Ar(p)?(l=!0,e.consume(p),f):g(p)}function h(p){return e.consume(p),i=!0,f}function g(p){return l&&i&&zr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function SP(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!F3.call(r,r.previous)||bb(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vP,e.attempt(M3,e.attempt(P3,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function NP(e,t,n){const r=this;let i="",l=!1;return o;function o(p){return(p===72||p===104)&&z3.call(r,r.previous)&&!bb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(zr(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const x=i.toLowerCase();if(x==="http"||x==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),l?h:(l=!0,f)):n(p)}function h(p){return p===null||Lh(p)||En(p)||uo(p)||um(p)?n(p):e.attempt(M3,e.attempt(P3,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function AP(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 RP(e,t,n){let r,i,l;return o;function o(h){return h===46||h===95?e.check(B3,f,c)(h):h===null||En(h)||uo(h)||h!==45&&um(h)?f(h):(l=!0,e.consume(h),o)}function c(h){return h===95?r=!0:(i=r,r=void 0),e.consume(h),o}function f(h){return i||r||!l?n(h):t(h)}}function LP(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(B3,t,l)(o):o===null||En(o)||uo(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function IP(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||En(c)||uo(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||En(c)||uo(c)?t(c):r(c)}function l(c){return zr(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):zr(c)?(e.consume(c),o):n(c)}}function OP(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Ar(l)?n(l):t(l)}}function F3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||En(e)}function z3(e){return!zr(e)}function $3(e){return!(e===47||n1(e))}function n1(e){return e===43||e===45||e===46||e===95||Ar(e)}function bb(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 Ru(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Ar(e.charCodeAt(n+1))&&Ar(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function cm(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 r1={name:"attention",resolveAll:DP,tokenize:jP};function DP(e,t){let n=-1,r,i,l,o,c,f,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},x={...e[n][1].start};lT(p,-f),lT(x,f),o={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},l={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Pa(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Pa(h,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),h=Pa(h,cm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Pa(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Pa(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ha(e,r-1,n-r+3,h),n=r+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function jP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=bu(r);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===l)return e.consume(f),c;const h=e.exit("attentionSequence"),g=bu(f),p=!g||g===2&&i||n.includes(f),x=!i||i===2&&g||n.includes(r);return h._open=!!(l===42?p:p&&(i||!x)),h._close=!!(l===42?x:x&&(g||!p)),t(f)}}function lT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const MP={name:"autolink",tokenize:PP};function PP(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 zr(E)?(e.consume(E),o):E===64?n(E):h(E)}function o(E){return E===43||E===45||E===46||Ar(E)?(r=1,c(E)):h(E)}function c(E){return E===58?(e.consume(E),r=0,f):(E===43||E===45||E===46||Ar(E))&&r++<32?(e.consume(E),c):(r=0,h(E))}function f(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||Lh(E)?n(E):(e.consume(E),f)}function h(E){return E===64?(e.consume(E),g):BM(E)?(e.consume(E),h):n(E)}function g(E){return Ar(E)?p(E):n(E)}function p(E){return E===46?(e.consume(E),r=0,g):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):x(E)}function x(E){if((E===45||Ar(E))&&r++<63){const v=E===45?x:p;return e.consume(E),v}return n(E)}}function Wt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return Pt(f)?(e.enter(n),c(f)):t(f)}function c(f){return Pt(f)&&l++<i?(e.consume(f),c):(e.exit(n),t(f))}}const xd={partial:!0,tokenize:BP};function BP(e,t,n){return r;function r(l){return Pt(l)?Wt(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||lt(l)?t(l):n(l)}}const V3={continuation:{tokenize:HP},exit:FP,name:"blockQuote",tokenize:UP};function UP(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 Pt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function HP(e,t,n){const r=this;return i;function i(o){return Pt(o)?Wt(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(V3,t,n)(o)}}function FP(e){e.exit("blockQuote")}const G3={name:"characterEscape",tokenize:zP};function zP(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 HM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const q3={name:"characterReference",tokenize:$P};function $P(e,t,n){const r=this;let i=0,l,o;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,o=Ar,g(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=UM,g):(e.enter("characterReferenceValue"),l=7,o=t1,g(p))}function g(p){if(p===59&&i){const x=e.exit("characterReferenceValue");return o===Ar&&!gb(r.sliceSerialize(x))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&i++<l?(e.consume(p),g):n(p)}}const oT={partial:!0,tokenize:GP},uT={concrete:!0,name:"codeFenced",tokenize:VP};function VP(e,t,n){const r=this,i={partial:!0,tokenize:G};let l=0,o=0,c;return f;function f(N){return h(N)}function h(N){const P=r.events[r.events.length-1];return l=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(N)}function g(N){return N===c?(o++,e.consume(N),g):o<3?n(N):(e.exit("codeFencedFenceSequence"),Pt(N)?Wt(e,p,"whitespace")(N):p(N))}function p(N){return N===null||lt(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(oT,C,j)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(N)):Pt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Wt(e,E,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),x)}function E(N){return N===null||lt(N)?p(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===null||lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(N)):N===96&&N===c?n(N):(e.consume(N),v)}function C(N){return e.attempt(i,j,S)(N)}function S(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),w}function w(N){return l>0&&Pt(N)?Wt(e,O,"linePrefix",l+1)(N):O(N)}function O(N){return N===null||lt(N)?e.check(oT,C,j)(N):(e.enter("codeFlowValue"),R(N))}function R(N){return N===null||lt(N)?(e.exit("codeFlowValue"),O(N)):(e.consume(N),R)}function j(N){return e.exit("codeFenced"),t(N)}function G(N,P,$){let ne=0;return W;function W(se){return N.enter("lineEnding"),N.consume(se),N.exit("lineEnding"),me}function me(se){return N.enter("codeFencedFence"),Pt(se)?Wt(N,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):Q(se)}function Q(se){return se===c?(N.enter("codeFencedFenceSequence"),_e(se)):$(se)}function _e(se){return se===c?(ne++,N.consume(se),_e):ne>=o?(N.exit("codeFencedFenceSequence"),Pt(se)?Wt(N,de,"whitespace")(se):de(se)):$(se)}function de(se){return se===null||lt(se)?(N.exit("codeFencedFence"),P(se)):$(se)}}}function GP(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 tg={name:"codeIndented",tokenize:YP},qP={partial:!0,tokenize:WP};function YP(e,t,n){const r=this;return i;function i(h){return e.enter("codeIndented"),Wt(e,l,"linePrefix",5)(h)}function l(h){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?f(h):lt(h)?e.attempt(qP,o,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||lt(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}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):Wt(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 QP={name:"codeText",previous:KP,resolve:XP,tokenize:ZP};function XP(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 KP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZP(e,t,n){let r=0,i,l;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(l=e.enter("codeTextSequence"),i=0,g(p)):lt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||lt(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),h)}function g(p){return p===96?(e.consume(p),i++,g):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(l.type="codeTextData",h(p))}}class JP{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 Y3(e){const t={};let n=-1,r,i,l,o,c,f,h;const g=new JP(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,eB(g,n)),n=t[n],h=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(o=g.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(g.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={...g.get(i)[1].start},c=g.slice(i,n),c.unshift(r),g.splice(i,n-i+1,c))}}return ha(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function eB(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,f=[],h={};let g,p,x=-1,E=n,v=0,C=0;const S=[C];for(;E;){for(;e.get(++i)[1]!==E;);l.push(i),E._tokenizer||(g=r.sliceStream(E),E.next||g.push(null),p&&o.defineSkip(E.start),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=E,E=E.next}for(E=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(C=x+1,S.push(C),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):S.pop(),x=S.length;x--;){const w=c.slice(S[x],S[x+1]),O=l.pop();f.push([O,O+w.length-1]),e.splice(O,2,w)}for(f.reverse(),x=-1;++x<f.length;)h[v+f[x][0]]=v+f[x][1],v+=f[x][1]-f[x][0]-1;return h}const tB={resolve:rB,tokenize:aB},nB={partial:!0,tokenize:sB};function rB(e){return Y3(e),e}function aB(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(nB,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 sB(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Wt(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 W3(e,t,n,r,i,l,o,c,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return p;function p(w){return w===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(w),e.exit(l),x):w===null||w===32||w===41||Lh(w)?n(w):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(w))}function x(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(w))}function E(w){return w===62?(e.exit("chunkString"),e.exit(c),x(w)):w===null||w===60||lt(w)?n(w):(e.consume(w),w===92?v:E)}function v(w){return w===60||w===62||w===92?(e.consume(w),E):E(w)}function C(w){return!g&&(w===null||w===41||En(w))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(w)):g<h&&w===40?(e.consume(w),g++,C):w===41?(e.consume(w),g--,C):w===null||w===32||w===40||Lh(w)?n(w):(e.consume(w),w===92?S:C)}function S(w){return w===40||w===41||w===92?(e.consume(w),C):C(w)}}function Q3(e,t,n,r,i,l){const o=this;let c=0,f;return h;function h(E){return e.enter(r),e.enter(i),e.consume(E),e.exit(i),e.enter(l),g}function g(E){return c>999||E===null||E===91||E===93&&!f||E===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(E):E===93?(e.exit(l),e.enter(i),e.consume(E),e.exit(i),e.exit(r),t):lt(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||E===91||E===93||lt(E)||c++>999?(e.exit("chunkString"),g(E)):(e.consume(E),f||(f=!Pt(E)),E===92?x:p)}function x(E){return E===91||E===92||E===93?(e.consume(E),c++,p):p(E)}}function X3(e,t,n,r,i,l){let o;return c;function c(x){return x===34||x===39||x===40?(e.enter(r),e.enter(i),e.consume(x),e.exit(i),o=x===40?41:x,f):n(x)}function f(x){return x===o?(e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):(e.enter(l),h(x))}function h(x){return x===o?(e.exit(l),f(o)):x===null?n(x):lt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Wt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===o||x===null||lt(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?p:g)}function p(x){return x===o||x===92?(e.consume(x),g):g(x)}}function Yc(e,t){let n;return r;function r(i){return lt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?Wt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const iB={name:"definition",tokenize:oB},lB={partial:!0,tokenize:uB};function oB(e,t,n){const r=this;let i;return l;function l(E){return e.enter("definition"),o(E)}function o(E){return Q3.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return i=ss(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),f):n(E)}function f(E){return En(E)?Yc(e,h)(E):h(E)}function h(E){return W3(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function g(E){return e.attempt(lB,p,p)(E)}function p(E){return Pt(E)?Wt(e,x,"whitespace")(E):x(E)}function x(E){return E===null||lt(E)?(e.exit("definition"),r.parser.defined.push(i),t(E)):n(E)}}function uB(e,t,n){return r;function r(c){return En(c)?Yc(e,i)(c):n(c)}function i(c){return X3(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Pt(c)?Wt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||lt(c)?t(c):n(c)}}const cB={name:"hardBreakEscape",tokenize:dB};function dB(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 fB={name:"headingAtx",resolve:hB,tokenize:mB};function hB(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"},ha(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function mB(e,t,n){let r=0;return i;function i(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&r++<6?(e.consume(g),o):g===null||En(g)?(e.exit("atxHeadingSequence"),c(g)):n(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||lt(g)?(e.exit("atxHeading"),t(g)):Pt(g)?Wt(e,c,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),c(g))}function h(g){return g===null||g===35||En(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),h)}}const pB=["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"],cT=["pre","script","style","textarea"],gB={concrete:!0,name:"htmlFlow",resolveTo:yB,tokenize:EB},bB={partial:!0,tokenize:TB},xB={partial:!0,tokenize:_B};function yB(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 EB(e,t,n){const r=this;let i,l,o,c,f;return h;function h(D){return g(D)}function g(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),l=!0,C):D===63?(e.consume(D),i=3,r.interrupt?t:A):zr(D)?(e.consume(D),o=String.fromCharCode(D),S):n(D)}function x(D){return D===45?(e.consume(D),i=2,E):D===91?(e.consume(D),i=5,c=0,v):zr(D)?(e.consume(D),i=4,r.interrupt?t:A):n(D)}function E(D){return D===45?(e.consume(D),r.interrupt?t:A):n(D)}function v(D){const Te="CDATA[";return D===Te.charCodeAt(c++)?(e.consume(D),c===Te.length?r.interrupt?t:Q:v):n(D)}function C(D){return zr(D)?(e.consume(D),o=String.fromCharCode(D),S):n(D)}function S(D){if(D===null||D===47||D===62||En(D)){const Te=D===47,we=o.toLowerCase();return!Te&&!l&&cT.includes(we)?(i=1,r.interrupt?t(D):Q(D)):pB.includes(o.toLowerCase())?(i=6,Te?(e.consume(D),w):r.interrupt?t(D):Q(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):l?O(D):R(D))}return D===45||Ar(D)?(e.consume(D),o+=String.fromCharCode(D),S):n(D)}function w(D){return D===62?(e.consume(D),r.interrupt?t:Q):n(D)}function O(D){return Pt(D)?(e.consume(D),O):W(D)}function R(D){return D===47?(e.consume(D),W):D===58||D===95||zr(D)?(e.consume(D),j):Pt(D)?(e.consume(D),R):W(D)}function j(D){return D===45||D===46||D===58||D===95||Ar(D)?(e.consume(D),j):G(D)}function G(D){return D===61?(e.consume(D),N):Pt(D)?(e.consume(D),G):R(D)}function N(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),f=D,P):Pt(D)?(e.consume(D),N):$(D)}function P(D){return D===f?(e.consume(D),f=null,ne):D===null||lt(D)?n(D):(e.consume(D),P)}function $(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||En(D)?G(D):(e.consume(D),$)}function ne(D){return D===47||D===62||Pt(D)?R(D):n(D)}function W(D){return D===62?(e.consume(D),me):n(D)}function me(D){return D===null||lt(D)?Q(D):Pt(D)?(e.consume(D),me):n(D)}function Q(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),ce):D===62&&i===4?(e.consume(D),U):D===63&&i===3?(e.consume(D),A):D===93&&i===5?(e.consume(D),J):lt(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(bB,ee,_e)(D)):D===null||lt(D)?(e.exit("htmlFlowData"),_e(D)):(e.consume(D),Q)}function _e(D){return e.check(xB,de,ee)(D)}function de(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),se}function se(D){return D===null||lt(D)?_e(D):(e.enter("htmlFlowData"),Q(D))}function H(D){return D===45?(e.consume(D),A):Q(D)}function ce(D){return D===47?(e.consume(D),o="",q):Q(D)}function q(D){if(D===62){const Te=o.toLowerCase();return cT.includes(Te)?(e.consume(D),U):Q(D)}return zr(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),q):Q(D)}function J(D){return D===93?(e.consume(D),A):Q(D)}function A(D){return D===62?(e.consume(D),U):D===45&&i===2?(e.consume(D),A):Q(D)}function U(D){return D===null||lt(D)?(e.exit("htmlFlowData"),ee(D)):(e.consume(D),U)}function ee(D){return e.exit("htmlFlow"),t(D)}}function _B(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 TB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(xd,t,n)}}const vB={name:"htmlText",tokenize:kB};function kB(e,t,n){const r=this;let i,l,o;return c;function c(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),G):A===63?(e.consume(A),R):zr(A)?(e.consume(A),$):n(A)}function h(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),l=0,v):zr(A)?(e.consume(A),O):n(A)}function g(A){return A===45?(e.consume(A),E):n(A)}function p(A){return A===null?n(A):A===45?(e.consume(A),x):lt(A)?(o=p,ce(A)):(e.consume(A),p)}function x(A){return A===45?(e.consume(A),E):p(A)}function E(A){return A===62?H(A):A===45?x(A):p(A)}function v(A){const U="CDATA[";return A===U.charCodeAt(l++)?(e.consume(A),l===U.length?C:v):n(A)}function C(A){return A===null?n(A):A===93?(e.consume(A),S):lt(A)?(o=C,ce(A)):(e.consume(A),C)}function S(A){return A===93?(e.consume(A),w):C(A)}function w(A){return A===62?H(A):A===93?(e.consume(A),w):C(A)}function O(A){return A===null||A===62?H(A):lt(A)?(o=O,ce(A)):(e.consume(A),O)}function R(A){return A===null?n(A):A===63?(e.consume(A),j):lt(A)?(o=R,ce(A)):(e.consume(A),R)}function j(A){return A===62?H(A):R(A)}function G(A){return zr(A)?(e.consume(A),N):n(A)}function N(A){return A===45||Ar(A)?(e.consume(A),N):P(A)}function P(A){return lt(A)?(o=P,ce(A)):Pt(A)?(e.consume(A),P):H(A)}function $(A){return A===45||Ar(A)?(e.consume(A),$):A===47||A===62||En(A)?ne(A):n(A)}function ne(A){return A===47?(e.consume(A),H):A===58||A===95||zr(A)?(e.consume(A),W):lt(A)?(o=ne,ce(A)):Pt(A)?(e.consume(A),ne):H(A)}function W(A){return A===45||A===46||A===58||A===95||Ar(A)?(e.consume(A),W):me(A)}function me(A){return A===61?(e.consume(A),Q):lt(A)?(o=me,ce(A)):Pt(A)?(e.consume(A),me):ne(A)}function Q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,_e):lt(A)?(o=Q,ce(A)):Pt(A)?(e.consume(A),Q):(e.consume(A),de)}function _e(A){return A===i?(e.consume(A),i=void 0,se):A===null?n(A):lt(A)?(o=_e,ce(A)):(e.consume(A),_e)}function de(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||En(A)?ne(A):(e.consume(A),de)}function se(A){return A===47||A===62||En(A)?ne(A):n(A)}function H(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function ce(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),q}function q(A){return Pt(A)?Wt(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):J(A)}function J(A){return e.enter("htmlTextData"),o(A)}}const xb={name:"labelEnd",resolveAll:NB,resolveTo:AB,tokenize:RB},wB={tokenize:LB},CB={tokenize:IB},SB={tokenize:OB};function NB(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&&ha(e,0,e.length,n),e}function AB(e,t){let n=e.length,r=0,i,l,o,c;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},g={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",f,t],["enter",h,t]],c=Pa(c,e.slice(l+1,l+r+3)),c=Pa(c,[["enter",g,t]]),c=Pa(c,cm(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Pa(c,[["exit",g,t],e[o-2],e[o-1],["exit",h,t]]),c=Pa(c,e.slice(o+1)),c=Pa(c,[["exit",f,t]]),ha(e,l,e.length,c),e}function RB(e,t,n){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return c;function c(x){return l?l._inactive?p(x):(o=r.parser.defined.includes(ss(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f):n(x)}function f(x){return x===40?e.attempt(wB,g,o?g:p)(x):x===91?e.attempt(CB,g,o?h:p)(x):o?g(x):p(x)}function h(x){return e.attempt(SB,g,p)(x)}function g(x){return t(x)}function p(x){return l._balanced=!0,n(x)}}function LB(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return En(p)?Yc(e,l)(p):l(p)}function l(p){return p===41?g(p):W3(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return En(p)?Yc(e,f)(p):g(p)}function c(p){return n(p)}function f(p){return p===34||p===39||p===40?X3(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function h(p){return En(p)?Yc(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function IB(e,t,n){const r=this;return i;function i(c){return Q3.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(ss(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function OB(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:xb.resolveAll,tokenize:jB};function jB(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 MB={name:"labelStartLink",resolveAll:xb.resolveAll,tokenize:PB};function PB(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 ng={name:"lineEnding",tokenize:BB};function BB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Wt(e,t,"linePrefix")}}const dh={name:"thematicBreak",tokenize:UB};function UB(e,t,n){let r=0,i;return l;function l(h){return e.enter("thematicBreak"),o(h)}function o(h){return i=h,c(h)}function c(h){return h===i?(e.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||lt(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===i?(e.consume(h),r++,f):(e.exit("thematicBreakSequence"),Pt(h)?Wt(e,c,"whitespace")(h):c(h))}}const ta={continuation:{tokenize:$B},exit:GB,name:"list",tokenize:zB},HB={partial:!0,tokenize:qB},FB={partial:!0,tokenize:VB};function zB(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:t1(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(dh,n,h)(E):h(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(E)}return n(E)}function f(E){return t1(E)&&++o<10?(e.consume(E),f):(!r.interrupt||o<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),h(E)):n(E)}function h(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(xd,r.interrupt?n:g,e.attempt(HB,x,p))}function g(E){return r.containerState.initialBlankLine=!0,l++,x(E)}function p(E){return Pt(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),x):n(E)}function x(E){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function $B(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xd,i,l);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wt(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!Pt(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(FB,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wt(e,e.attempt(ta,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function VB(e,t,n){const r=this;return Wt(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 GB(e){e.exit(this.containerState.type)}function qB(e,t,n){const r=this;return Wt(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!Pt(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const dT={name:"setextUnderline",resolveTo:YB,tokenize:WB};function YB(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(h){let g=r.events.length,p;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){p=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===i?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Pt(h)?Wt(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||lt(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const QB={tokenize:rU,partial:!0};function XB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:eU,continuation:{tokenize:tU},exit:nU}},text:{91:{name:"gfmFootnoteCall",tokenize:JB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:KB,resolveTo:ZB}}}}function KB(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!o||!o._balanced)return n(f);const h=ss(r.sliceSerialize({start:o.end,end:r.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function ZB(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 JB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(l>999||p===93&&!o||p===null||p===91||En(p))return n(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return i.includes(ss(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return En(p)||(o=!0),l++,e.consume(p),p===92?g:h}function g(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function eU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return f;function f(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(v)}function g(v){if(o>999||v===93&&!c||v===null||v===91||En(v))return n(v);if(v===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=ss(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return En(v)||(c=!0),o++,e.consume(v),v===92?p:g}function p(v){return v===91||v===92||v===93?(e.consume(v),o++,g):g(v)}function x(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(l)||i.push(l),Wt(e,E,"gfmFootnoteDefinitionWhitespace")):n(v)}function E(v){return t(v)}}function tU(e,t,n){return e.check(xd,t,e.attempt(QB,t,n))}function nU(e){e.exit("gfmFootnoteDefinition")}function rU(e,t,n){const r=this;return Wt(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 aU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,c){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let h=f;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[f][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[f][1].end)},p={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[f][1].start)},x=[["enter",g,c],["enter",o[h][1],c],["exit",o[h][1],c],["enter",p,c]],E=c.parser.constructs.insideSpan.null;E&&ha(x,x.length,0,cm(E,o.slice(h+1,f),c)),ha(x,x.length,0,[["exit",p,c],["enter",o[f][1],c],["exit",o[f][1],c],["exit",g,c]]),ha(o,h-1,f-h+3,x),f=h+x.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,c,f){const h=this.previous,g=this.events;let p=0;return x;function x(v){return h===126&&g[g.length-1][1].type!=="characterEscape"?f(v):(o.enter("strikethroughSequenceTemporary"),E(v))}function E(v){const C=bu(h);if(v===126)return p>1?f(v):(o.consume(v),p++,E);if(p<2&&!n)return f(v);const S=o.exit("strikethroughSequenceTemporary"),w=bu(v);return S._open=!w||w===2&&!!C,S._close=!C||C===2&&!!w,c(v)}}}class sU{constructor(){this.map=[]}add(t,n,r){iU(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 iU(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 lU(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 oU(){return{flow:{null:{name:"table",tokenize:uU,resolveAll:cU}}}}function uU(e,t,n){const r=this;let i=0,l=0,o;return c;function c(W){let me=r.events.length-1;for(;me>-1;){const de=r.events[me][1].type;if(de==="lineEnding"||de==="linePrefix")me--;else break}const Q=me>-1?r.events[me][1].type:null,_e=Q==="tableHead"||Q==="tableRow"?N:f;return _e===N&&r.parser.lazy[r.now().line]?n(W):_e(W)}function f(W){return e.enter("tableHead"),e.enter("tableRow"),h(W)}function h(W){return W===124||(o=!0,l+=1),g(W)}function g(W){return W===null?n(W):lt(W)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),E):n(W):Pt(W)?Wt(e,g,"whitespace")(W):(l+=1,o&&(o=!1,i+=1),W===124?(e.enter("tableCellDivider"),e.consume(W),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(W)))}function p(W){return W===null||W===124||En(W)?(e.exit("data"),g(W)):(e.consume(W),W===92?x:p)}function x(W){return W===92||W===124?(e.consume(W),p):p(W)}function E(W){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(W):(e.enter("tableDelimiterRow"),o=!1,Pt(W)?Wt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):v(W))}function v(W){return W===45||W===58?S(W):W===124?(o=!0,e.enter("tableCellDivider"),e.consume(W),e.exit("tableCellDivider"),C):G(W)}function C(W){return Pt(W)?Wt(e,S,"whitespace")(W):S(W)}function S(W){return W===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(W),e.exit("tableDelimiterMarker"),w):W===45?(l+=1,w(W)):W===null||lt(W)?j(W):G(W)}function w(W){return W===45?(e.enter("tableDelimiterFiller"),O(W)):G(W)}function O(W){return W===45?(e.consume(W),O):W===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(W),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(W))}function R(W){return Pt(W)?Wt(e,j,"whitespace")(W):j(W)}function j(W){return W===124?v(W):W===null||lt(W)?!o||i!==l?G(W):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(W)):G(W)}function G(W){return n(W)}function N(W){return e.enter("tableRow"),P(W)}function P(W){return W===124?(e.enter("tableCellDivider"),e.consume(W),e.exit("tableCellDivider"),P):W===null||lt(W)?(e.exit("tableRow"),t(W)):Pt(W)?Wt(e,P,"whitespace")(W):(e.enter("data"),$(W))}function $(W){return W===null||W===124||En(W)?(e.exit("data"),P(W)):(e.consume(W),W===92?ne:$)}function ne(W){return W===92||W===124?(e.consume(W),$):$(W)}}function cU(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,f=0,h,g,p;const x=new sU;for(;++n<e.length;){const E=e[n],v=E[1];E[0]==="enter"?v.type==="tableHead"?(c=!1,f!==0&&(fT(x,t,f,h,g),g=void 0,f=0),h={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},x.add(n,0,[["enter",h,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,p=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,g={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},x.add(n,0,[["enter",g,t]])),i=v.type==="tableDelimiterRow"?2:g?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],p=Uf(x,t,l,i,void 0,p),l=[0,0,0,0]),o[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],p=Uf(x,t,l,i,void 0,p)),l=o,o=[l[1],n,0,0])):v.type==="tableHead"?(c=!0,f=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],p=Uf(x,t,l,i,n,p)):o[1]!==0&&(p=Uf(x,t,o,i,n,p)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&fT(x,t,f,h,g),x.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=lU(t.events,n))}return e}function Uf(e,t,n,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},iu(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=iu(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=iu(t.events,n[2]),g=iu(t.events,n[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const x=t.events[n[2]],E=t.events[n[3]];if(x[1].end=Object.assign({},E[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,C=n[3]-n[2]-1;e.add(v,C,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(l.end=Object.assign({},iu(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function fT(e,t,n,r,i){const l=[],o=iu(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 iu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const dU={name:"tasklistCheck",tokenize:hU};function fU(){return{text:{91:dU}}}function hU(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return En(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return lt(f)?t(f):Pt(f)?e.check({tokenize:mU},t,n)(f):n(f)}}function mU(e,t,n){return Wt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function pU(e){return j3([wP(),XB(),aU(e),oU(),fU()])}const gU={};function bU(e){const t=this,n=e||gU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(pU(n)),l.push(yP()),o.push(EP(n))}var xU=Object.defineProperty,yU=Object.defineProperties,EU=Object.getOwnPropertyDescriptors,hT=Object.getOwnPropertySymbols,_U=Object.prototype.hasOwnProperty,TU=Object.prototype.propertyIsEnumerable,mT=(e,t,n)=>t in e?xU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K3=(e,t)=>{for(var n in t||(t={}))_U.call(t,n)&&mT(e,n,t[n]);if(hT)for(var n of hT(t))TU.call(t,n)&&mT(e,n,t[n]);return e},Z3=(e,t)=>yU(e,EU(t)),Vr=(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},vU=(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},kU=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]==="`"&&!vU(e,n)&&(t+=1)}return t},fl=(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},wU=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,CU=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(wU,(t,n,r,i)=>Vr(e,i)?t:`${n}\\>${r}`),SU=/(\*\*)([^*]*\*?)$/,NU=/(__)([^_]*?)$/,AU=/(\*\*\*)([^*]*?)$/,RU=/(\*)([^*]*?)$/,LU=/(_)([^_]*?)$/,IU=/(`)([^`]*?)$/,OU=/(~~)([^~]*?)$/,po=/^[\s_~*`]*$/,J3=/^[\s]*[-*+][\s]+$/,DU=/[\p{L}\p{N}_]/u,jU=/^```[^`\n]*```?$/,MU=/^\*{4,}$/,PU=/(__)([^_]+)_$/,BU=/(~~)([^~]+)~$/,pT=/~~/g,hl=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)},UU=(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},eC=(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},dm=(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},HU=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
262
+ `)return!1}return!1},tC=(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]==="]"?HU(e,t):!1;if(e[n]===`
263
+ `)return!1}return!1},FU=(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]===`
264
+ `)return!1}return!1},yb=(e,t,n)=>{let r=0;for(let f=t-1;f>=0;f-=1)if(e[f]===`
265
+ `){r=f+1;break}let i=e.length;for(let f=t;f<e.length;f+=1)if(e[f]===`
266
+ `){i=f;break}let l=e.substring(r,i),o=0,c=!1;for(let f of l)if(f===n)o+=1;else if(f!==" "&&f!==" "){c=!0;break}return o>=3&&!c},zU=(e,t,n,r)=>n==="\\"||e.includes("$")&&dm(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&hl(n)&&hl(r)||(!n||n===" "||n===" "||n===`
267
+ `)&&(!r||r===" "||r===" "||r===`
268
+ `)),nC=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]:"";zU(e,i,l,o)||(t+=1)}return t},$U=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&dm(e,t)||tC(e,t)||FU(e,t)||n==="_"||r==="_"||n&&r&&hl(n)&&hl(r)),VU=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]:"";$U(e,i,l,o)||(t+=1)}return t},GU=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},Eb=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},gT=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},qU=(e,t,n)=>{if(!t||po.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
269
+ `),i=r===-1?0:r+1,l=e.substring(i,n);return J3.test(l)&&t.includes(`
270
+ `)?!0:yb(e,n,"*")},YU=e=>{let t=e.match(SU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Vr(e,r)||fl(e,r)||qU(e,n,r)?e:Eb(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},WU=(e,t,n)=>{if(!t||po.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
271
+ `),i=r===-1?0:r+1,l=e.substring(i,n);return J3.test(l)&&t.includes(`
272
+ `)?!0:yb(e,n,"_")},QU=e=>{let t=e.match(NU);if(!t){let i=e.match(PU);if(i){let l=e.lastIndexOf(i[1]);if(!(Vr(e,l)||fl(e,l))&&gT(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Vr(e,r)||fl(e,r)||WU(e,n,r)?e:gT(e)%2===1?`${e}__`:e},XU=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]!=="\\"&&!dm(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
273
+ `)&&(!i||i===" "||i===" "||i===`
274
+ `)||r&&i&&hl(r)&&hl(i))continue;return n}}return-1},KU=e=>{if(!e.match(RU))return e;let t=XU(e);if(t===-1||Vr(e,t)||fl(e,t))return e;let n=e.substring(t+1);return!n||po.test(n)?e:nC(e)%2===1?`${e}*`:e},rC=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]!=="\\"&&!dm(e,n)&&!tC(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&hl(r)&&hl(i))continue;return n}}return-1},ZU=e=>{let t=e.length;for(;t>0&&e[t-1]===`
275
+ `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},JU=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(Eb(t)%2!==1)return null;let n=t.indexOf("**"),r=rC(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},eH=e=>{if(!e.match(LU))return e;let t=rC(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||po.test(n)||Vr(e,t)||fl(e,t))return e;if(VU(e)%2===1){let r=JU(e);return r!==null?r:ZU(e)}return e},tH=e=>{let t=Eb(e),n=nC(e);return t%2===0&&n%2===0},nH=(e,t,n)=>!t||po.test(t)||Vr(e,n)||fl(e,n)?!0:yb(e,n,"*"),rH=e=>{if(MU.test(e))return e;let t=e.match(AU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return nH(e,n,r)?e:GU(e)%2===1?tH(e)?e:`${e}***`:e},aH=/<[a-zA-Z/][^>]*$/,sH=e=>{let t=e.match(aH);return!t||t.index===void 0||Vr(e,t.index)?e:e.substring(0,t.index).trimEnd()},iH=e=>!e.match(jU)||e.includes(`
276
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,lH=e=>(e.match(/```/g)||[]).length%2===1,oH=e=>{let t=iH(e);if(t!==null)return t;let n=e.match(IU);if(n&&!lH(e)){let r=n[2];if(!r||po.test(r))return e;if(kU(e)%2===1)return`${e}\``}return e},aC=(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)==="```",uH=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!aC(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},cH=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!aC(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},dH=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
277
+ `,t)!==-1&&!e.endsWith(`
278
+ `)?`${e}
279
+ $$`:`${e}$$`},fH=e=>uH(e)%2===0?e:dH(e),hH=e=>cH(e)%2===1?`${e}$`:e,mH=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=UU(e,t);if(r===-1||Vr(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)`},bT=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Vr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=eC(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},pH=(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=bT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(eC(e,t)===-1){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=bT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},sC=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Vr(e,n)){let r=mH(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Vr(e,r)){let i=pH(e,r,t);if(i!==null)return i}return e},gH=/^-{1,2}$/,bH=/^[\s]*-{1,2}[\s]+$/,xH=/^={1,2}$/,yH=/^[\s]*={1,2}[\s]+$/,EH=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
280
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(gH.test(i)&&!n.match(bH)){let l=r.split(`
281
+ `).at(-1);if(l&&l.trim().length>0)return`${e}​`}if(xH.test(i)&&!n.match(yH)){let l=r.split(`
282
+ `).at(-1);if(l&&l.trim().length>0)return`${e}​`}return e},_H=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),TH=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(_H,(t,n)=>Vr(e,n)?t:"\\~"),vH=e=>{var t,n;let r=e.match(OU);if(r){let i=r[2];if(!i||po.test(i))return e;let l=e.lastIndexOf(r[1]);if(Vr(e,l)||fl(e,l))return e;if(((t=e.match(pT))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(BU);if(i){let l=e.lastIndexOf(i[0].slice(0,2));if(Vr(e,l)||fl(e,l))return e;if(((n=e.match(pT))==null?void 0:n.length)%2===1)return`${e}~`}}return e},rg=e=>e!==!1,kH=e=>e===!0,Fr={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},wH=[{handler:{name:"singleTilde",handle:TH,priority:Fr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:CU,priority:Fr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:sH,priority:Fr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:EH,priority:Fr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:sC,priority:Fr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:rH,priority:Fr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:YU,priority:Fr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:QU,priority:Fr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:KU,priority:Fr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:eH,priority:Fr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:oH,priority:Fr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:vH,priority:Fr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:fH,priority:Fr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:hH,priority:Fr.INLINE_KATEX},optionKey:"inlineKatex"}],CH=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return wH.filter(({handler:r,optionKey:i})=>r.name==="links"?rg(e==null?void 0:e.links)||rg(e==null?void 0:e.images):r.name==="inlineKatex"?kH(e==null?void 0:e.inlineKatex):rg(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:Z3(K3({},r),{handle:l=>sC(l,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},SH=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=CH(t),l=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var f;return{handler:Z3(K3({},c),{priority:(f=c.priority)!=null?f:Fr.DEFAULT}),earlyReturn:void 0}}),o=[...i,...l].sort((c,f)=>{var h,g;return((h=c.handler.priority)!=null?h:0)-((g=f.handler.priority)!=null?g:0)});for(let{handler:c,earlyReturn:f}of o)if(r=c.handle(r),f!=null&&f(r))return r;return r},NH=SH;function iC(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=iC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lC(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=iC(e))&&(r&&(r+=" "),r+=t);return r}const AH=(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},RH=(e,t)=>({classGroupId:e,validator:t}),oC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Oh="-",xT=[],LH="arbitrary..",IH=e=>{const t=DH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return OH(o);const c=o.split(Oh),f=c[0]===""&&c.length>1?1:0;return uC(c,f,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const f=r[o],h=n[o];return f?h?AH(h,f):f:h||xT}return n[o]||xT}}},uC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const h=uC(e,t+1,l);if(h)return h}const o=n.validators;if(o===null)return;const c=t===0?e.join(Oh):e.slice(t).join(Oh),f=o.length;for(let h=0;h<f;h++){const g=o[h];if(g.validator(c))return g.classGroupId}},OH=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?LH+r:void 0})(),DH=e=>{const{theme:t,classGroups:n}=e;return jH(n,t)},jH=(e,t)=>{const n=oC();for(const r in e){const i=e[r];_b(i,n,r,t)}return n},_b=(e,t,n,r)=>{const i=e.length;for(let l=0;l<i;l++){const o=e[l];MH(o,t,n,r)}},MH=(e,t,n,r)=>{if(typeof e=="string"){PH(e,t,n);return}if(typeof e=="function"){BH(e,t,n,r);return}UH(e,t,n,r)},PH=(e,t,n)=>{const r=e===""?t:cC(t,e);r.classGroupId=n},BH=(e,t,n,r)=>{if(HH(e)){_b(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(RH(n,e))},UH=(e,t,n,r)=>{const i=Object.entries(e),l=i.length;for(let o=0;o<l;o++){const[c,f]=i[o];_b(f,cC(t,c),n,r)}},cC=(e,t)=>{let n=e;const r=t.split(Oh),i=r.length;for(let l=0;l<i;l++){const o=r[l];let c=n.nextPart.get(o);c||(c=oC(),n.nextPart.set(o,c)),n=c}return n},HH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,FH=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)}}},a1="!",yT=":",zH=[],ET=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),$H=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const l=[];let o=0,c=0,f=0,h;const g=i.length;for(let C=0;C<g;C++){const S=i[C];if(o===0&&c===0){if(S===yT){l.push(i.slice(f,C)),f=C+1;continue}if(S==="/"){h=C;continue}}S==="["?o++:S==="]"?o--:S==="("?c++:S===")"&&c--}const p=l.length===0?i:i.slice(f);let x=p,E=!1;p.endsWith(a1)?(x=p.slice(0,-1),E=!0):p.startsWith(a1)&&(x=p.slice(1),E=!0);const v=h&&h>f?h-f:void 0;return ET(l,E,x,v)};if(t){const i=t+yT,l=r;r=o=>o.startsWith(i)?l(o.slice(i.length)):ET(zH,!1,o,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},VH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let l=0;l<n.length;l++){const o=n[l],c=o[0]==="[",f=t.has(o);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},GH=e=>({cache:FH(e.cacheSize),parseClassName:$H(e),sortModifiers:VH(e),...IH(e)}),qH=/\s+/,YH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=t,o=[],c=e.trim().split(qH);let f="";for(let h=c.length-1;h>=0;h-=1){const g=c[h],{isExternal:p,modifiers:x,hasImportantModifier:E,baseClassName:v,maybePostfixModifierPosition:C}=n(g);if(p){f=g+(f.length>0?" "+f:f);continue}let S=!!C,w=r(S?v.substring(0,C):v);if(!w){if(!S){f=g+(f.length>0?" "+f:f);continue}if(w=r(v),!w){f=g+(f.length>0?" "+f:f);continue}S=!1}const O=x.length===0?"":x.length===1?x[0]:l(x).join(":"),R=E?O+a1:O,j=R+w;if(o.indexOf(j)>-1)continue;o.push(j);const G=i(w,S);for(let N=0;N<G.length;++N){const P=G[N];o.push(R+P)}f=g+(f.length>0?" "+f:f)}return f},WH=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=dC(n))&&(i&&(i+=" "),i+=r);return i},dC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=dC(e[r]))&&(n&&(n+=" "),n+=t);return n},QH=(e,...t)=>{let n,r,i,l;const o=f=>{const h=t.reduce((g,p)=>p(g),e());return n=GH(h),r=n.cache.get,i=n.cache.set,l=c,c(f)},c=f=>{const h=r(f);if(h)return h;const g=YH(f,n);return i(f,g),g};return l=o,(...f)=>l(WH(...f))},XH=[],lr=e=>{const t=n=>n[e]||XH;return t.isThemeGetter=!0,t},fC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ZH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JH=/\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$/,eF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ki=e=>KH.test(e),At=e=>!!e&&!Number.isNaN(Number(e)),Zi=e=>!!e&&Number.isInteger(Number(e)),ag=e=>e.endsWith("%")&&At(e.slice(0,-1)),ui=e=>ZH.test(e),mC=()=>!0,rF=e=>JH.test(e)&&!eF.test(e),Tb=()=>!1,aF=e=>tF.test(e),sF=e=>nF.test(e),iF=e=>!Ye(e)&&!We(e),lF=e=>pl(e,bC,Tb),Ye=e=>fC.test(e),Xl=e=>pl(e,xC,rF),_T=e=>pl(e,pF,At),oF=e=>pl(e,EC,mC),uF=e=>pl(e,yC,Tb),TT=e=>pl(e,pC,Tb),cF=e=>pl(e,gC,sF),Hf=e=>pl(e,_C,aF),We=e=>hC.test(e),Sc=e=>go(e,xC),dF=e=>go(e,yC),vT=e=>go(e,pC),fF=e=>go(e,bC),hF=e=>go(e,gC),Ff=e=>go(e,_C,!0),mF=e=>go(e,EC,!0),pl=(e,t,n)=>{const r=fC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},go=(e,t,n=!1)=>{const r=hC.exec(e);return r?r[1]?t(r[1]):n:!1},pC=e=>e==="position"||e==="percentage",gC=e=>e==="image"||e==="url",bC=e=>e==="length"||e==="size"||e==="bg-size",xC=e=>e==="length",pF=e=>e==="number",yC=e=>e==="family-name",EC=e=>e==="number"||e==="weight",_C=e=>e==="shadow",gF=()=>{const e=lr("color"),t=lr("font"),n=lr("text"),r=lr("font-weight"),i=lr("tracking"),l=lr("leading"),o=lr("breakpoint"),c=lr("container"),f=lr("spacing"),h=lr("radius"),g=lr("shadow"),p=lr("inset-shadow"),x=lr("text-shadow"),E=lr("drop-shadow"),v=lr("blur"),C=lr("perspective"),S=lr("aspect"),w=lr("ease"),O=lr("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...j(),We,Ye],N=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],$=()=>[We,Ye,f],ne=()=>[Ki,"full","auto",...$()],W=()=>[Zi,"none","subgrid",We,Ye],me=()=>["auto",{span:["full",Zi,We,Ye]},Zi,We,Ye],Q=()=>[Zi,"auto",We,Ye],_e=()=>["auto","min","max","fr",We,Ye],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...$()],ce=()=>[Ki,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],q=()=>[Ki,"screen","full","dvw","lvw","svw","min","max","fit",...$()],J=()=>[Ki,"screen","full","lh","dvh","lvh","svh","min","max","fit",...$()],A=()=>[e,We,Ye],U=()=>[...j(),vT,TT,{position:[We,Ye]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",fF,lF,{size:[We,Ye]}],Te=()=>[ag,Sc,Xl],we=()=>["","none","full",h,We,Ye],Se=()=>["",At,Sc,Xl],Ve=()=>["solid","dashed","dotted","double"],et=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Be=()=>[At,ag,vT,TT],Ft=()=>["","none",v,We,Ye],at=()=>["none",At,We,Ye],gt=()=>["none",At,We,Ye],Kt=()=>[At,We,Ye],Ue=()=>[Ki,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ui],breakpoint:[ui],color:[mC],container:[ui],"drop-shadow":[ui],ease:["in","out","in-out"],font:[iF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ui],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ui],shadow:[ui],spacing:["px",At],text:[ui],"text-shadow":[ui],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ki,Ye,We,S]}],container:["container"],columns:[{columns:[At,Ye,We,c]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:G()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:["visible","invisible","collapse"],z:[{z:[Zi,"auto",We,Ye]}],basis:[{basis:[Ki,"full","auto",c,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Ki,"auto","initial","none",Ye]}],grow:[{grow:["",At,We,Ye]}],shrink:[{shrink:["",At,We,Ye]}],order:[{order:[Zi,"first","last","none",We,Ye]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_e()}],"auto-rows":[{"auto-rows":_e()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pbs:[{pbs:$()}],pbe:[{pbe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],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":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:ce()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[c,"screen",...ce()]}],"min-w":[{"min-w":[c,"screen","none",...ce()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...ce()]}],h:[{h:["screen","lh",...ce()]}],"min-h":[{"min-h":["screen","lh","none",...ce()]}],"max-h":[{"max-h":["screen","lh",...ce()]}],"font-size":[{text:["base",n,Sc,Xl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,mF,oF]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ag,Ye]}],"font-family":[{font:[dF,uF,t]}],"font-features":[{"font-features":[Ye]}],"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,We,Ye]}],"line-clamp":[{"line-clamp":[At,"none",We,_T]}],leading:[{leading:[l,...$()]}],"list-image":[{"list-image":["none",We,Ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,Ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",We,Xl]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[At,"auto",We,Ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,Ye]}],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",We,Ye]}],"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:ee()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zi,We,Ye],radial:["",We,Ye],conic:[Zi,We,Ye]},hF,cF]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:Te()}],"gradient-via-pos":[{via:Te()}],"gradient-to-pos":[{to:Te()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:we()}],"rounded-s":[{"rounded-s":we()}],"rounded-e":[{"rounded-e":we()}],"rounded-t":[{"rounded-t":we()}],"rounded-r":[{"rounded-r":we()}],"rounded-b":[{"rounded-b":we()}],"rounded-l":[{"rounded-l":we()}],"rounded-ss":[{"rounded-ss":we()}],"rounded-se":[{"rounded-se":we()}],"rounded-ee":[{"rounded-ee":we()}],"rounded-es":[{"rounded-es":we()}],"rounded-tl":[{"rounded-tl":we()}],"rounded-tr":[{"rounded-tr":we()}],"rounded-br":[{"rounded-br":we()}],"rounded-bl":[{"rounded-bl":we()}],"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:[...Ve(),"hidden","none"]}],"divide-style":[{divide:[...Ve(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...Ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,We,Ye]}],"outline-w":[{outline:["",At,Sc,Xl]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,Ff,Hf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",p,Ff,Hf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[At,Xl]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",x,Ff,Hf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[At,We,Ye]}],"mix-blend":[{"mix-blend":[...et(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":et()}],"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":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":Be()}],"mask-image-linear-to-pos":[{"mask-linear-to":Be()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":Be()}],"mask-image-t-to-pos":[{"mask-t-to":Be()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":Be()}],"mask-image-r-to-pos":[{"mask-r-to":Be()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":Be()}],"mask-image-b-to-pos":[{"mask-b-to":Be()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":Be()}],"mask-image-l-to-pos":[{"mask-l-to":Be()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":Be()}],"mask-image-x-to-pos":[{"mask-x-to":Be()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":Be()}],"mask-image-y-to-pos":[{"mask-y-to":Be()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[We,Ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":Be()}],"mask-image-radial-to-pos":[{"mask-radial-to":Be()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":Be()}],"mask-image-conic-to-pos":[{"mask-conic-to":Be()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,Ye]}],filter:[{filter:["","none",We,Ye]}],blur:[{blur:Ft()}],brightness:[{brightness:[At,We,Ye]}],contrast:[{contrast:[At,We,Ye]}],"drop-shadow":[{"drop-shadow":["","none",E,Ff,Hf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",At,We,Ye]}],"hue-rotate":[{"hue-rotate":[At,We,Ye]}],invert:[{invert:["",At,We,Ye]}],saturate:[{saturate:[At,We,Ye]}],sepia:[{sepia:["",At,We,Ye]}],"backdrop-filter":[{"backdrop-filter":["","none",We,Ye]}],"backdrop-blur":[{"backdrop-blur":Ft()}],"backdrop-brightness":[{"backdrop-brightness":[At,We,Ye]}],"backdrop-contrast":[{"backdrop-contrast":[At,We,Ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,We,Ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,We,Ye]}],"backdrop-invert":[{"backdrop-invert":["",At,We,Ye]}],"backdrop-opacity":[{"backdrop-opacity":[At,We,Ye]}],"backdrop-saturate":[{"backdrop-saturate":[At,We,Ye]}],"backdrop-sepia":[{"backdrop-sepia":["",At,We,Ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,Ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",We,Ye]}],ease:[{ease:["linear","initial",w,We,Ye]}],delay:[{delay:[At,We,Ye]}],animate:[{animate:["none",O,We,Ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,We,Ye]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:at()}],"rotate-x":[{"rotate-x":at()}],"rotate-y":[{"rotate-y":at()}],"rotate-z":[{"rotate-z":at()}],scale:[{scale:gt()}],"scale-x":[{"scale-x":gt()}],"scale-y":[{"scale-y":gt()}],"scale-z":[{"scale-z":gt()}],"scale-3d":["scale-3d"],skew:[{skew:Kt()}],"skew-x":[{"skew-x":Kt()}],"skew-y":[{"skew-y":Kt()}],transform:[{transform:[We,Ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We,Ye]}],"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":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mbs":[{"scroll-mbs":$()}],"scroll-mbe":[{"scroll-mbe":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pbs":[{"scroll-pbs":$()}],"scroll-pbe":[{"scroll-pbe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",We,Ye]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[At,Sc,Xl,_T]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},TC=QH(gF),bF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yF={};function kT(e,t){return(yF.jsx?xF:bF).test(e)}var eu={},sg,wT;function EF(){if(wT)return sg;wT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
283
+ `,h="/",g="*",p="",x="comment",E="declaration";function v(S,w){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];w=w||{};var O=1,R=1;function j(de){var se=de.match(t);se&&(O+=se.length);var H=de.lastIndexOf(f);R=~H?de.length-H:R+de.length}function G(){var de={line:O,column:R};return function(se){return se.position=new N(de),ne(),se}}function N(de){this.start=de,this.end={line:O,column:R},this.source=w.source}N.prototype.content=S;function P(de){var se=new Error(w.source+":"+O+":"+R+": "+de);if(se.reason=de,se.filename=w.source,se.line=O,se.column=R,se.source=S,!w.silent)throw se}function $(de){var se=de.exec(S);if(se){var H=se[0];return j(H),S=S.slice(H.length),se}}function ne(){$(n)}function W(de){var se;for(de=de||[];se=me();)se!==!1&&de.push(se);return de}function me(){var de=G();if(!(h!=S.charAt(0)||g!=S.charAt(1))){for(var se=2;p!=S.charAt(se)&&(g!=S.charAt(se)||h!=S.charAt(se+1));)++se;if(se+=2,p===S.charAt(se-1))return P("End of comment missing");var H=S.slice(2,se-2);return R+=2,j(H),S=S.slice(se),R+=2,de({type:x,comment:H})}}function Q(){var de=G(),se=$(r);if(se){if(me(),!$(i))return P("property missing ':'");var H=$(l),ce=de({type:E,property:C(se[0].replace(e,p)),value:H?C(H[0].replace(e,p)):p});return $(o),ce}}function _e(){var de=[];W(de);for(var se;se=Q();)se!==!1&&(de.push(se),W(de));return de}return ne(),_e()}function C(S){return S?S.replace(c,p):p}return sg=v,sg}var CT;function _F(){if(CT)return eu;CT=1;var e=eu&&eu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(eu,"__esModule",{value:!0}),eu.default=n;const t=e(EF());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;c?i(h,g,f):g&&(l=l||{},l[h]=g)}),l}return eu}var Nc={},ST;function TF(){if(ST)return Nc;ST=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},o=function(h,g){return g.toUpperCase()},c=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(i,c):h=h.replace(r,c),h.replace(t,o))};return Nc.camelCase=f,Nc}var Ac,NT;function vF(){if(NT)return Ac;NT=1;var e=Ac&&Ac.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(_F()),n=TF();function r(i,l){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,f){c&&f&&(o[(0,n.camelCase)(c,l)]=f)}),o}return r.default=r,Ac=r,Ac}var kF=vF();const wF=zh(kF);function Wc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?AT(e.position):"start"in e||"end"in e?AT(e):"line"in e||"column"in e?s1(e):""}function s1(e){return RT(e&&e.line)+":"+RT(e&&e.column)}function AT(e){return s1(e&&e.start)+"-"+s1(e&&e.end)}function RT(e){return e&&typeof e=="number"?e:1}class Lr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?l.ruleId=r:(l.source=r.slice(0,f),l.ruleId=r.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Wc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Lr.prototype.file="";Lr.prototype.name="";Lr.prototype.reason="";Lr.prototype.message="";Lr.prototype.stack="";Lr.prototype.column=void 0;Lr.prototype.line=void 0;Lr.prototype.ancestors=void 0;Lr.prototype.cause=void 0;Lr.prototype.fatal=void 0;Lr.prototype.place=void 0;Lr.prototype.ruleId=void 0;Lr.prototype.source=void 0;const vb={}.hasOwnProperty,CF=new Map,SF=/[A-Z]/g,NF=new Set(["table","tbody","thead","tfoot","tr"]),AF=new Set(["td","th"]),vC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function RF(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=BF(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=PF(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ks:vu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=kC(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function kC(e,t,n){if(t.type==="element")return LF(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return IF(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return DF(e,t,n);if(t.type==="mdxjsEsm")return OF(e,t);if(t.type==="root")return jF(e,t,n);if(t.type==="text")return MF(e,t)}function LF(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ks,e.schema=i),e.ancestors.push(t);const l=CC(e,t.tagName,!1),o=UF(e,t);let c=wb(e,t);return NF.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!qh(f):!0})),wC(e,o,l,t),kb(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function IF(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)}id(e,t.position)}function OF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);id(e,t.position)}function DF(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ks,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:CC(e,t.name,!0),o=HF(e,t),c=wb(e,t);return wC(e,o,l,t),kb(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function jF(e,t,n){const r={};return kb(r,wb(e,t)),e.create(t,e.Fragment,r,n)}function MF(e,t){return t.value}function wC(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function PF(e,t,n){return r;function r(i,l,o,c){const h=Array.isArray(o.children)?n:t;return c?h(l,o,c):h(l,o)}}function BF(e,t){return n;function n(r,i,l,o){const c=Array.isArray(l.children),f=ws(r);return t(i,l,o,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function UF(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&vb.call(t.properties,i)){const l=FF(e,i,t.properties[i]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&AF.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 HF(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 id(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 id(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function wb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:CF;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const h=i.get(f)||0;o=f+"-"+h,i.set(f,h+1)}}const c=kC(e,l,o);c!==void 0&&n.push(c)}return n}function FF(e,t,n){const r=hd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?H1(n):F1(n)),r.property==="style"){let i=typeof n=="object"?n:zF(e,String(n));return e.stylePropertyNameCase==="css"&&(i=$F(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?q4[r.property]||r.property:r.attribute,n]}}function zF(e,t){try{return wF(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Lr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=vC+"#cannot-parse-style-attribute",i}}function CC(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=kT(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=kT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return vb.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);id(e)}function id(e,t){const n=new Lr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=vC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $F(e){const t={};let n;for(n in e)vb.call(e,n)&&(t[VF(n)]=e[n]);return t}function VF(e){let t=e.replace(SF,GF);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function GF(e){return"-"+e.toLowerCase()}const ig={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"]},qF={tokenize:YF};function YF(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"),Wt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),l(c)}function l(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return lt(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const WF={tokenize:QF},LT={tokenize:XF};function QF(e){const t=this,n=[];let r=0,i,l,o;return c;function c(R){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,f,h)(R)}return h(R)}function f(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&O();const j=t.events.length;let G=j,N;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){N=t.events[G][1].end;break}w(r);let P=j;for(;P<t.events.length;)t.events[P][1].end={...N},P++;return ha(t.events,G+1,0,t.events.slice(j)),t.events.length=P,h(R)}return c(R)}function h(R){if(r===n.length){if(!i)return x(R);if(i.currentConstruct&&i.currentConstruct.concrete)return v(R);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(LT,g,p)(R)}function g(R){return i&&O(),w(r),x(R)}function p(R){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(R)}function x(R){return t.containerState={},e.attempt(LT,E,v)(R)}function E(R){return r++,n.push([t.currentConstruct,t.containerState]),x(R)}function v(R){if(R===null){i&&O(),w(0),e.consume(R);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),C(R)}function C(R){if(R===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(R);return}return lt(R)?(e.consume(R),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(R),C)}function S(R,j){const G=t.sliceStream(R);if(j&&G.push(null),R.previous=l,l&&(l.next=R),l=R,i.defineSkip(R.start),i.write(G),t.parser.lazy[R.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<o&&(!i.events[N][1].end||i.events[N][1].end.offset>o))return;const P=t.events.length;let $=P,ne,W;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(ne){W=t.events[$][1].end;break}ne=!0}for(w(r),N=P;N<t.events.length;)t.events[N][1].end={...W},N++;ha(t.events,$+1,0,t.events.slice(P)),t.events.length=N}}function w(R){let j=n.length;for(;j-- >R;){const G=n[j];t.containerState=G[1],G[0].exit.call(t,e)}n.length=R}function O(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function XF(e,t,n){return Wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const KF={tokenize:ZF};function ZF(e){const t=this,n=e.attempt(xd,r,e.attempt(this.parser.constructs.flowInitial,i,Wt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tB,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 JF={resolveAll:NC()},ez=SC("string"),tz=SC("text");function SC(e){return{resolveAll:NC(e==="text"?nz: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(g){return h(g)?l(g):c(g)}function c(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return h(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function h(g){if(g===null)return!0;const p=i[g];let x=-1;if(p)for(;++x<p.length;){const E=p[x];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function NC(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 nz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,o=-1,c=0,f;for(;l--;){const h=i[l];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(h===-2)f=!0,c++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const rz={42:ta,43:ta,45:ta,48:ta,49:ta,50:ta,51:ta,52:ta,53:ta,54:ta,55:ta,56:ta,57:ta,62:V3},az={91:iB},sz={[-2]:tg,[-1]:tg,32:tg},iz={35:fB,42:dh,45:[dT,dh],60:gB,61:dT,95:dh,96:uT,126:uT},lz={38:q3,92:G3},oz={[-5]:ng,[-4]:ng,[-3]:ng,33:DB,38:q3,42:r1,60:[MP,vB],91:MB,92:[cB,G3],93:xb,95:r1,96:QP},uz={null:[r1,JF]},cz={null:[42,95]},dz={null:[]},fz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cz,contentInitial:az,disable:dz,document:rz,flow:iz,flowInitial:sz,insideSpan:uz,string:lz,text:oz},Symbol.toStringTag,{value:"Module"}));function hz(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let o=[],c=[];const f={attempt:P(G),check:P(N),consume:O,enter:R,exit:j,interrupt:P(N,{interrupt:!0})},h={code:null,containerState:{},defineSkip:C,events:[],now:v,parser:e,previous:null,sliceSerialize:x,sliceStream:E,write:p};let g=t.tokenize.call(h,f);return t.resolveAll&&l.push(t),h;function p(me){return o=Pa(o,me),S(),o[o.length-1]!==null?[]:($(t,0),h.events=cm(l,h.events,h),h.events)}function x(me,Q){return pz(E(me),Q)}function E(me){return mz(o,me)}function v(){const{_bufferIndex:me,_index:Q,line:_e,column:de,offset:se}=r;return{_bufferIndex:me,_index:Q,line:_e,column:de,offset:se}}function C(me){i[me.line]=me.column,W()}function S(){let me;for(;r._index<o.length;){const Q=o[r._index];if(typeof Q=="string")for(me=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===me&&r._bufferIndex<Q.length;)w(Q.charCodeAt(r._bufferIndex));else w(Q)}}function w(me){g=g(me)}function O(me){lt(me)?(r.line++,r.column=1,r.offset+=me===-3?2:1,W()):me!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=me}function R(me,Q){const _e=Q||{};return _e.type=me,_e.start=v(),h.events.push(["enter",_e,h]),c.push(_e),_e}function j(me){const Q=c.pop();return Q.end=v(),h.events.push(["exit",Q,h]),Q}function G(me,Q){$(me,Q.from)}function N(me,Q){Q.restore()}function P(me,Q){return _e;function _e(de,se,H){let ce,q,J,A;return Array.isArray(de)?ee(de):"tokenize"in de?ee([de]):U(de);function U(Se){return Ve;function Ve(et){const Be=et!==null&&Se[et],Ft=et!==null&&Se.null,at=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray(Ft)?Ft:Ft?[Ft]:[]];return ee(at)(et)}}function ee(Se){return ce=Se,q=0,Se.length===0?H:D(Se[q])}function D(Se){return Ve;function Ve(et){return A=ne(),J=Se,Se.partial||(h.currentConstruct=Se),Se.name&&h.parser.constructs.disable.null.includes(Se.name)?we():Se.tokenize.call(Q?Object.assign(Object.create(h),Q):h,f,Te,we)(et)}}function Te(Se){return me(J,A),se}function we(Se){return A.restore(),++q<ce.length?D(ce[q]):H}}}function $(me,Q){me.resolveAll&&!l.includes(me)&&l.push(me),me.resolve&&ha(h.events,Q,h.events.length-Q,me.resolve(h.events.slice(Q),h)),me.resolveTo&&(h.events=me.resolveTo(h.events,h))}function ne(){const me=v(),Q=h.previous,_e=h.currentConstruct,de=h.events.length,se=Array.from(c);return{from:de,restore:H};function H(){r=me,h.previous=Q,h.currentConstruct=_e,h.events.length=de,c=se,W()}}function W(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function mz(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 pz(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=`
284
+ `;break}case-3:{o=`\r
285
+ `;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 gz(e){const r={constructs:j3([fz,...(e||{}).extensions||[]]),content:i(qF),defined:[],document:i(WF),flow:i(KF),lazy:{},string:i(ez),text:i(tz)};return r;function i(l){return o;function o(c){return hz(r,l,c)}}}function bz(e){for(;!Y3(e););return e}const IT=/[\0\t\n\r]/g;function xz(){let e=1,t="",n=!0,r;return i;function i(l,o,c){const f=[];let h,g,p,x,E;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,t="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(IT.lastIndex=p,h=IT.exec(l),x=h&&h.index!==void 0?h.index:l.length,E=l.charCodeAt(x),!h){t=l.slice(p);break}if(E===10&&p===x&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<x&&(f.push(l.slice(p,x)),e+=x-p),E){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=x+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const AC={}.hasOwnProperty;function yz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ez(n)(bz(gz(n).document().write(xz()(e,t,!0))))}function Ez(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(He),autolinkProtocol:ne,autolinkEmail:ne,atxHeading:l(kt),blockQuote:l(Ft),characterEscape:ne,characterReference:ne,codeFenced:l(at),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(at,o),codeText:l(gt,o),codeTextData:ne,data:ne,codeFlowValue:ne,definition:l(Kt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ue),hardBreakEscape:l(nt),hardBreakTrailing:l(nt),htmlFlow:l(on,o),htmlFlowData:ne,htmlText:l(on,o),htmlTextData:ne,image:l($e),label:o,link:l(He),listItem:l(un),listItemValue:x,listOrdered:l(Rt,p),listUnordered:l(Rt),paragraph:l(cn),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(kt),strong:l(Vn),thematicBreak:l(er)},exit:{atxHeading:f(),atxHeadingSequence:G,autolink:f(),autolinkEmail:Be,autolinkProtocol:et,blockQuote:f(),characterEscapeValue:W,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:Se,characterReference:Ve,codeFenced:f(S),codeFencedFence:C,codeFencedFenceInfo:E,codeFencedFenceMeta:v,codeFlowValue:W,codeIndented:f(w),codeText:f(se),codeTextData:W,data:W,definition:f(),definitionDestinationString:j,definitionLabelString:O,definitionTitleString:R,emphasis:f(),hardBreakEscape:f(Q),hardBreakTrailing:f(Q),htmlFlow:f(_e),htmlFlowData:W,htmlText:f(de),htmlTextData:W,image:f(ce),label:J,labelText:q,lineEnding:me,link:f(H),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Te,resourceDestinationString:A,resourceTitleString:U,resource:ee,setextHeading:f($),setextHeadingLineSequence:P,setextHeadingText:N,strong:f(),thematicBreak:f()}};RC(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ge){let Ne={type:"root",children:[]};const Re={stack:[Ne],tokenStack:[],config:t,enter:c,exit:h,buffer:o,resume:g,data:n},st=[];let xt=-1;for(;++xt<ge.length;)if(ge[xt][1].type==="listOrdered"||ge[xt][1].type==="listUnordered")if(ge[xt][0]==="enter")st.push(xt);else{const dn=st.pop();xt=i(ge,dn,xt)}for(xt=-1;++xt<ge.length;){const dn=t[ge[xt][0]];AC.call(dn,ge[xt][1].type)&&dn[ge[xt][1].type].call(Object.assign({sliceSerialize:ge[xt][2].sliceSerialize},Re),ge[xt][1])}if(Re.tokenStack.length>0){const dn=Re.tokenStack[Re.tokenStack.length-1];(dn[1]||OT).call(Re,void 0,dn[0])}for(Ne.position={start:Ji(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:Ji(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},xt=-1;++xt<t.transforms.length;)Ne=t.transforms[xt](Ne)||Ne;return Ne}function i(ge,Ne,Re){let st=Ne-1,xt=-1,dn=!1,Ln,ye,ze,tt;for(;++st<=Re;){const Me=ge[st];switch(Me[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Me[0]==="enter"?xt++:xt--,tt=void 0;break}case"lineEndingBlank":{Me[0]==="enter"&&(Ln&&!tt&&!xt&&!ze&&(ze=st),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!xt&&Me[0]==="enter"&&Me[1].type==="listItemPrefix"||xt===-1&&Me[0]==="exit"&&(Me[1].type==="listUnordered"||Me[1].type==="listOrdered")){if(Ln){let ft=st;for(ye=void 0;ft--;){const Vt=ge[ft];if(Vt[1].type==="lineEnding"||Vt[1].type==="lineEndingBlank"){if(Vt[0]==="exit")continue;ye&&(ge[ye][1].type="lineEndingBlank",dn=!0),Vt[1].type="lineEnding",ye=ft}else if(!(Vt[1].type==="linePrefix"||Vt[1].type==="blockQuotePrefix"||Vt[1].type==="blockQuotePrefixWhitespace"||Vt[1].type==="blockQuoteMarker"||Vt[1].type==="listItemIndent"))break}ze&&(!ye||ze<ye)&&(Ln._spread=!0),Ln.end=Object.assign({},ye?ge[ye][1].start:Me[1].end),ge.splice(ye||st,0,["exit",Ln,Me[2]]),st++,Re++}if(Me[1].type==="listItemPrefix"){const ft={type:"listItem",_spread:!1,start:Object.assign({},Me[1].start),end:void 0};Ln=ft,ge.splice(st,0,["enter",ft,Me[2]]),st++,Re++,ze=void 0,tt=!0}}}return ge[Ne][1]._spread=dn,Re}function l(ge,Ne){return Re;function Re(st){c.call(this,ge(st),st),Ne&&Ne.call(this,st)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(ge,Ne,Re){this.stack[this.stack.length-1].children.push(ge),this.stack.push(ge),this.tokenStack.push([Ne,Re||void 0]),ge.position={start:Ji(Ne.start),end:void 0}}function f(ge){return Ne;function Ne(Re){ge&&ge.call(this,Re),h.call(this,Re)}}function h(ge,Ne){const Re=this.stack.pop(),st=this.tokenStack.pop();if(st)st[0].type!==ge.type&&(Ne?Ne.call(this,ge,st[0]):(st[1]||OT).call(this,ge,st[0]));else throw new Error("Cannot close `"+ge.type+"` ("+Wc({start:ge.start,end:ge.end})+"): it’s not open");Re.position.end=Ji(ge.end)}function g(){return mb(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function x(ge){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ge),10),this.data.expectingFirstListItemValue=void 0}}function E(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ge}function v(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ge}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ge.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ge.replace(/(\r?\n|\r)$/g,"")}function O(ge){const Ne=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Ne,Re.identifier=ss(this.sliceSerialize(ge)).toLowerCase()}function R(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ge}function j(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ge}function G(ge){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Re=this.sliceSerialize(ge).length;Ne.depth=Re}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function P(ge){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ge).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function ne(ge){const Re=this.stack[this.stack.length-1].children;let st=Re[Re.length-1];(!st||st.type!=="text")&&(st=Tt(),st.position={start:Ji(ge.start),end:void 0},Re.push(st)),this.stack.push(st)}function W(ge){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ge),Ne.position.end=Ji(ge.end)}function me(ge){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=Ne.children[Ne.children.length-1];Re.position.end=Ji(ge.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&(ne.call(this,ge),W.call(this,ge))}function Q(){this.data.atHardBreak=!0}function _e(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ge}function de(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ge}function se(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ge}function H(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Ne,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function ce(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Ne,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function q(ge){const Ne=this.sliceSerialize(ge),Re=this.stack[this.stack.length-2];Re.label=iP(Ne),Re.identifier=ss(Ne).toLowerCase()}function J(){const ge=this.stack[this.stack.length-1],Ne=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const st=ge.children;Re.children=st}else Re.alt=Ne}function A(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ge}function U(){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ge}function ee(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function Te(ge){const Ne=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Ne,Re.identifier=ss(this.sliceSerialize(ge)).toLowerCase(),this.data.referenceType="full"}function we(ge){this.data.characterReferenceType=ge.type}function Se(ge){const Ne=this.sliceSerialize(ge),Re=this.data.characterReferenceType;let st;Re?(st=D3(Ne,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):st=gb(Ne);const xt=this.stack[this.stack.length-1];xt.value+=st}function Ve(ge){const Ne=this.stack.pop();Ne.position.end=Ji(ge.end)}function et(ge){W.call(this,ge);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ge)}function Be(ge){W.call(this,ge);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ge)}function Ft(){return{type:"blockquote",children:[]}}function at(){return{type:"code",lang:null,meta:null,value:""}}function gt(){return{type:"inlineCode",value:""}}function Kt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ue(){return{type:"emphasis",children:[]}}function kt(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function on(){return{type:"html",value:""}}function $e(){return{type:"image",title:null,url:"",alt:null}}function He(){return{type:"link",title:null,url:"",children:[]}}function Rt(ge){return{type:"list",ordered:ge.type==="listOrdered",start:null,spread:ge._spread,children:[]}}function un(ge){return{type:"listItem",spread:ge._spread,checked:null,children:[]}}function cn(){return{type:"paragraph",children:[]}}function Vn(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function er(){return{type:"thematicBreak"}}}function Ji(e){return{line:e.line,column:e.column,offset:e.offset}}function RC(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?RC(e,r):_z(e,r)}}function _z(e,t){let n;for(n in t)if(AC.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 OT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wc({start:t.start,end:t.end})+") is still open")}function Tz(e){const t=this;t.parser=n;function n(r){return yz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function vz(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 kz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
286
+ `}]}function wz(e,t){const n=t.value?t.value+`
287
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function Cz(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sz(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nz(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ru(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function Az(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 Rz(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LC(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 Lz(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return LC(e,t);const i={src:Ru(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 Iz(e,t){const n={src:Ru(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 Oz(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 Dz(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return LC(e,t);const i={href:Ru(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 jz(e,t){const n={href:Ru(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 Mz(e,t,n){const r=e.all(t),i=n?Pz(n):IC(t),l={},o=[];if(typeof t.checked=="boolean"){const g=r[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.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 g=r[c];(i||c!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
288
+ `}),g.type==="element"&&g.tagName==="p"&&!i?o.push(...g.children):o.push(g)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
289
+ `});const h={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,h),e.applyData(t,h)}function Pz(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=IC(n[r])}return t}function IC(e){const t=e.spread;return t??e.children.length>1}function Bz(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 Uz(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hz(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fz(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zz(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=ws(t.children[1]),f=om(t.children[t.children.length-1]);c&&f&&(o.position={start:c,end:f}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function $z(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const p=t.children[f],x={},E=o?o[f]:void 0;E&&(x.align=E);let v={type:"element",tagName:l,properties:x,children:[]};p&&(v.children=e.all(p),e.patch(p,v),v=e.applyData(p,v)),h.push(v)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function Vz(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const DT=9,jT=32;function Gz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(MT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(MT(t.slice(i),i>0,!1)),l.join("")}function MT(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===DT||l===jT;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===DT||l===jT;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function qz(e,t){const n={type:"text",value:Gz(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Wz={blockquote:vz,break:kz,code:wz,delete:Cz,emphasis:Sz,footnoteReference:Nz,heading:Az,html:Rz,imageReference:Lz,image:Iz,inlineCode:Oz,linkReference:Dz,link:jz,listItem:Mz,list:Bz,paragraph:Uz,root:Hz,strong:Fz,table:zz,tableCell:Vz,tableRow:$z,text:qz,thematicBreak:Yz,toml:zf,yaml:zf,definition:zf,footnoteDefinition:zf};function zf(){}function Qz(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 Xz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Kz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Qz,r=e.options.footnoteBackLabel||Xz,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const g=e.all(h),p=String(h.identifier).toUpperCase(),x=Ru(p.toLowerCase());let E=0;const v=[],C=e.footnoteCounts.get(p);for(;C!==void 0&&++E<=C;){v.length>0&&v.push({type:"text",value:" "});let O=typeof n=="string"?n:n(f,E);typeof O=="string"&&(O={type:"text",value:O}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,E),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const S=g[g.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const O=S.children[S.children.length-1];O&&O.type==="text"?O.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...v)}else g.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...oo(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
290
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
291
+ `}]}}const i1={}.hasOwnProperty,Zz={};function Jz(e,t){const n=t||Zz,r=new Map,i=new Map,l=new Map,o={...Wz,...n.handlers},c={all:h,applyData:t$,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:e$,wrap:r$};return vs(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?r:i,x=String(g.identifier).toUpperCase();p.has(x)||p.set(x,g)}}),c;function f(g,p){const x=g.type,E=c.handlers[x];if(i1.call(c.handlers,x)&&E)return E(c,g,p);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in g){const{children:C,...S}=g,w=oo(S);return w.children=c.all(g),w}return oo(g)}return(c.options.unknownHandler||n$)(c,g,p)}function h(g){const p=[];if("children"in g){const x=g.children;let E=-1;for(;++E<x.length;){const v=c.one(x[E],g);if(v){if(E&&x[E-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=PT(v.value)),!Array.isArray(v)&&v.type==="element")){const C=v.children[0];C&&C.type==="text"&&(C.value=PT(C.value))}Array.isArray(v)?p.push(...v):p.push(v)}}}return p}}function e$(e,t){e.position&&(t.position=u3(e))}function t$(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,oo(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function n$(e,t){const n=t.data||{},r="value"in t&&!(i1.call(n,"hProperties")||i1.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 r$(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
292
+ `});++r<e.length;)r&&n.push({type:"text",value:`
293
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
294
+ `}),n}function PT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function BT(e,t){const n=Jz(e,t),r=n.one(e,void 0),i=Kz(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
295
+ `},i),l}function a$(e,t){return e&&"run"in e?async function(n,r){const i=BT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return BT(n,{file:r,...e||t})}}function UT(e){if(e)throw e}var lg,HT;function s$(){if(HT)return lg;HT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!p)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},o=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},c=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(r)return r(h,g).value}else return;return h[g]};return lg=function f(){var h,g,p,x,E,v,C=arguments[0],S=1,w=arguments.length,O=!1;for(typeof C=="boolean"&&(O=C,C=arguments[1]||{},S=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});S<w;++S)if(h=arguments[S],h!=null)for(g in h)p=c(C,g),x=c(h,g),C!==x&&(O&&x&&(l(x)||(E=i(x)))?(E?(E=!1,v=p&&i(p)?p:[]):v=p&&l(p)?p:{},o(C,{name:g,newValue:f(O,v,x)})):typeof x<"u"&&o(C,{name:g,newValue:x}));return C},lg}var i$=s$();const og=zh(i$);function l1(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 l$(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(f,...h){const g=e[++l];let p=-1;if(f){o(f);return}for(;++p<i.length;)(h[p]===null||h[p]===void 0)&&(h[p]=i[p]);i=h,g?o$(g,c)(...h):o(null,...h)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function o$(e,t){let n;return r;function r(...o){const c=e.length>o.length;let f;c&&o.push(i);try{f=e.apply(this,o)}catch(h){const g=h;if(c&&n)throw g;return i(g)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,i):f instanceof Error?i(f):l(f))}function i(o,...c){n||(n=!0,t(o,...c))}function l(o){i(null,o)}}const Es={basename:u$,dirname:c$,extname:d$,join:f$,sep:"/"};function u$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yd(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 c$(e){if(yd(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 d$(e){yd(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;)yd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":h$(n)}function h$(e){yd(e);const t=e.codePointAt(0)===47;let n=m$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function m$(e,t){let n="",r=0,i=-1,l=0,o=-1,c,f;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function yd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const p$={cwd:g$};function g$(){return"/"}function o1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function b$(e){if(typeof e=="string")e=new URL(e);else if(!o1(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 x$(e)}function x$(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 ug=["history","path","basename","stem","extname","dirname"];class y${constructor(t){let n;t?o1(t)?n={path:t}:typeof t=="string"||E$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":p$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ug.length;){const l=ug[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)ug.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Es.basename(this.path):void 0}set basename(t){dg(t,"basename"),cg(t,"basename"),this.path=Es.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Es.dirname(this.path):void 0}set dirname(t){FT(this.basename,"dirname"),this.path=Es.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Es.extname(this.path):void 0}set extname(t){if(cg(t,"extname"),FT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Es.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){o1(t)&&(t=b$(t)),dg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Es.basename(this.path,this.extname):void 0}set stem(t){dg(t,"stem"),cg(t,"stem"),this.path=Es.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Lr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function cg(e,t){if(e&&e.includes(Es.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Es.sep+"`")}function dg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function FT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function E$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _$=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),T$={}.hasOwnProperty;class Cb extends _${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=l$()}copy(){const t=new Cb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(og(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mg("data",this.frozen),this.namespace[t]=n,this):T$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mg("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=$f(t),r=this.parser||this.Parser;return fg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),fg("process",this.parser||this.Parser),hg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){const c=$f(t),f=r.parse(c);r.run(f,c,function(g,p,x){if(g||!p||!x)return h(g);const E=p,v=r.stringify(E,x);w$(v)?x.value=v:x.result=v,h(g,x)});function h(g,p){g||!p?o(g):l?l(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),fg("processSync",this.parser||this.Parser),hg("processSync",this.compiler||this.Compiler),this.process(t,i),$T("processSync","process",n),r;function i(l,o){n=!0,UT(l),r=o}}run(t,n,r){zT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const f=$f(n);i.run(t,f,h);function h(g,p,x){const E=p||t;g?c(g):o?o(E):r(void 0,E,x)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),$T("runSync","run",r),i;function l(o,c){UT(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=$f(n),i=this.compiler||this.Compiler;return hg("stringify",i),zT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(mg("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...p]=h;f(g,p)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(i.settings=og(!0,i.settings,h.settings))}function c(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const p=h[g];l(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,g){let p=-1,x=-1;for(;++p<r.length;)if(r[p][0]===h){x=p;break}if(x===-1)r.push([h,...g]);else if(g.length>0){let[E,...v]=g;const C=r[x][1];l1(C)&&l1(E)&&(E=og(!0,C,E)),r[x]=[h,E,...v]}}}}const v$=new Cb().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mg(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 zT(e){if(!l1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $T(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $f(e){return k$(e)?e:new y$(e)}function k$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function w$(e){return typeof e=="string"||C$(e)}function C$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Sb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bo=Sb();function OC(e){bo=e}var eo={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($r.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var S$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$r={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)}}>`)},N$=/^(?:[ \t]*(?:\n|$))+/,A$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,R$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ed=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,L$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,DC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jC=Qt(DC).replace(/bull/g,Nb).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(),I$=Qt(DC).replace(/bull/g,Nb).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(),Ab=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,O$=/^[^\n]+/,Rb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,D$=Qt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Rb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),j$=Qt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Nb).getRegex(),fm="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",Lb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,M$=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",Lb).replace("tag",fm).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),MC=Qt(Ab).replace("hr",Ed).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",fm).getRegex(),P$=Qt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",MC).getRegex(),Ib={blockquote:P$,code:A$,def:D$,fences:R$,heading:L$,hr:Ed,html:M$,lheading:jC,list:j$,newline:N$,paragraph:MC,table:eo,text:O$},VT=Qt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ed).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",fm).getRegex(),B$={...Ib,lheading:I$,table:VT,paragraph:Qt(Ab).replace("hr",Ed).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",VT).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",fm).getRegex()},U$={...Ib,html:Qt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Lb).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:eo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Qt(Ab).replace("hr",Ed).replace("heading",` *#{1,6} *[^
296
+ ]`).replace("lheading",jC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,F$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,PC=/^( {2,}|\\)\n(?!\s*$)/,z$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lu=/[\p{P}\p{S}]/u,hm=/[\s\p{P}\p{S}]/u,Ob=/[^\s\p{P}\p{S}]/u,$$=Qt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hm).getRegex(),BC=/(?!~)[\p{P}\p{S}]/u,V$=/(?!~)[\s\p{P}\p{S}]/u,G$=/(?:[^\s\p{P}\p{S}]|~)/u,q$=Qt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",S$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),UC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Y$=Qt(UC,"u").replace(/punct/g,Lu).getRegex(),W$=Qt(UC,"u").replace(/punct/g,BC).getRegex(),HC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Q$=Qt(HC,"gu").replace(/notPunctSpace/g,Ob).replace(/punctSpace/g,hm).replace(/punct/g,Lu).getRegex(),X$=Qt(HC,"gu").replace(/notPunctSpace/g,G$).replace(/punctSpace/g,V$).replace(/punct/g,BC).getRegex(),K$=Qt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ob).replace(/punctSpace/g,hm).replace(/punct/g,Lu).getRegex(),Z$=Qt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Lu).getRegex(),J$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",eV=Qt(J$,"gu").replace(/notPunctSpace/g,Ob).replace(/punctSpace/g,hm).replace(/punct/g,Lu).getRegex(),tV=Qt(/\\(punct)/,"gu").replace(/punct/g,Lu).getRegex(),nV=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(),rV=Qt(Lb).replace("(?:-->|$)","-->").getRegex(),aV=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",rV).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Dh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,sV=Qt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Dh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),FC=Qt(/^!?\[(label)\]\[(ref)\]/).replace("label",Dh).replace("ref",Rb).getRegex(),zC=Qt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Rb).getRegex(),iV=Qt("reflink|nolink(?!\\()","g").replace("reflink",FC).replace("nolink",zC).getRegex(),GT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Db={_backpedal:eo,anyPunctuation:tV,autolink:nV,blockSkip:q$,br:PC,code:F$,del:eo,delLDelim:eo,delRDelim:eo,emStrongLDelim:Y$,emStrongRDelimAst:Q$,emStrongRDelimUnd:K$,escape:H$,link:sV,nolink:zC,punctuation:$$,reflink:FC,reflinkSearch:iV,tag:aV,text:z$,url:eo},lV={...Db,link:Qt(/^!?\[(label)\]\((.*?)\)/).replace("label",Dh).getRegex(),reflink:Qt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dh).getRegex()},u1={...Db,emStrongRDelimAst:X$,emStrongLDelim:W$,delLDelim:Z$,delRDelim:eV,url:Qt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",GT).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",GT).getRegex()},oV={...u1,br:Qt(PC).replace("{2,}","*").getRegex(),text:Qt(u1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vf={normal:Ib,gfm:B$,pedantic:U$},Rc={normal:Db,gfm:u1,breaks:oV,pedantic:lV},uV={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qT=e=>uV[e];function ys(e,t){if(t){if($r.escapeTest.test(e))return e.replace($r.escapeReplace,qT)}else if($r.escapeTestNoEncode.test(e))return e.replace($r.escapeReplaceNoEncode,qT);return e}function YT(e){try{e=encodeURI(e).replace($r.percentDecode,"%")}catch{return null}return e}function WT(e,t){var l;let n=e.replace($r.findPipe,(o,c,f)=>{let h=!1,g=c;for(;--g>=0&&f[g]==="\\";)h=!h;return h?"|":" |"}),r=n.split($r.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($r.slashPipe,"|");return r}function Lc(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 cV(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 dV(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 QT(e,t,n,r,i){let l=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let f={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:o,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,f}function fV(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
297
+ `).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(`
298
+ `)}var jh=class{constructor(e){fe(this,"options");fe(this,"rules");fe(this,"lexer");this.options=e||bo}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:Lc(n,`
299
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=fV(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=Lc(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:Lc(t[0],`
300
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Lc(t[0],`
301
+ `).split(`
302
+ `),r="",i="",l=[];for(;n.length>0;){let o=!1,c=[],f;for(f=0;f<n.length;f++)if(this.rules.other.blockquoteStart.test(n[f]))c.push(n[f]),o=!0;else if(!o)c.push(n[f]);else break;n=n.slice(f);let h=c.join(`
303
+ `),g=h.replace(this.rules.other.blockquoteSetextReplace,`
304
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
305
+ ${h}`:h,i=i?`${i}
306
+ ${g}`:g;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,l,!0),this.lexer.state.top=p,n.length===0)break;let x=l.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){let E=x,v=E.raw+`
307
+ `+n.join(`
308
+ `),C=this.blockquote(v);l[l.length-1]=C,r=r.substring(0,r.length-E.raw.length)+C.raw,i=i.substring(0,i.length-E.text.length)+C.text;break}else if((x==null?void 0:x.type)==="list"){let E=x,v=E.raw+`
309
+ `+n.join(`
310
+ `),C=this.list(v);l[l.length-1]=C,r=r.substring(0,r.length-x.raw.length)+C.raw,i=i.substring(0,i.length-E.raw.length)+C.raw,n=v.substring(l.at(-1).raw.length).split(`
311
+ `);continue}}return{type:"blockquote",raw:r,tokens:l,text:i}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),l=i.length>1,o={type:"list",raw:"",ordered:l,start:l?+i.slice(0,-1):"",loose:!1,items:[]};i=l?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=l?i:"[*+-]");let c=this.rules.other.listItemRegex(i),f=!1;for(;e;){let g=!1,p="",x="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let E=dV(t[2].split(`
312
+ `,1)[0],t[1].length),v=e.split(`
313
+ `,1)[0],C=!E.trim(),S=0;if(this.options.pedantic?(S=2,x=E.trimStart()):C?S=t[1].length+1:(S=E.search(this.rules.other.nonSpaceChar),S=S>4?1:S,x=E.slice(S),S+=t[1].length),C&&this.rules.other.blankLine.test(v)&&(p+=v+`
314
+ `,e=e.substring(v.length+1),g=!0),!g){let w=this.rules.other.nextBulletRegex(S),O=this.rules.other.hrRegex(S),R=this.rules.other.fencesBeginRegex(S),j=this.rules.other.headingBeginRegex(S),G=this.rules.other.htmlBeginRegex(S),N=this.rules.other.blockquoteBeginRegex(S);for(;e;){let P=e.split(`
315
+ `,1)[0],$;if(v=P,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),$=v):$=v.replace(this.rules.other.tabCharGlobal," "),R.test(v)||j.test(v)||G.test(v)||N.test(v)||w.test(v)||O.test(v))break;if($.search(this.rules.other.nonSpaceChar)>=S||!v.trim())x+=`
316
+ `+$.slice(S);else{if(C||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(E)||j.test(E)||O.test(E))break;x+=`
317
+ `+v}C=!v.trim(),p+=P+`
318
+ `,e=e.substring(P.length+1),E=$.slice(S)}}o.loose||(f?o.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(f=!0)),o.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),o.raw+=p}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){if(this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]),g.task){if(g.text=g.text.replace(this.rules.other.listReplaceTask,""),((n=g.tokens[0])==null?void 0:n.type)==="text"||((r=g.tokens[0])==null?void 0:r.type)==="paragraph"){g.tokens[0].raw=g.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),g.tokens[0].text=g.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(g.raw);if(p){let x={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};g.checked=x.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=x.raw+g.tokens[0].raw,g.tokens[0].text=x.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(x)):g.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):g.tokens.unshift(x)}}if(!o.loose){let p=g.tokens.filter(E=>E.type==="space"),x=p.length>0&&p.some(E=>this.rules.other.anyLine.test(E.raw));o.loose=x}}if(o.loose)for(let g of o.items){g.loose=!0;for(let p of g.tokens)p.type==="text"&&(p.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=WT(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(`
319
+ `):[],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(WT(c,l.header.length).map((f,h)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:l.align[h]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
320
+ `?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=Lc(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=cV(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)),QT(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 QT(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,f=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+i);(r=h.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(o=[...l].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){f+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+f);let g=[...r[0]][0].length,p=e.slice(0,i+r.index+g+o);if(Math.min(i,o)%2){let E=p.slice(1,-1);return{type:"em",raw:p,text:E,tokens:this.lexer.inlineTokens(E)}}let x=p.slice(2,-2);return{type:"strong",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,f=this.rules.inline.delRDelim;for(f.lastIndex=0,t=t.slice(-1*e.length+i);(r=f.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l||(o=[...l].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let h=[...r[0]][0].length,g=e.slice(0,i+r.index+h+o),p=g.slice(i,-i);return{type:"del",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}}}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}}}},Ba=class c1{constructor(t){fe(this,"tokens");fe(this,"options");fe(this,"state");fe(this,"inlineQueue");fe(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||bo,this.options.tokenizer=this.options.tokenizer||new jh,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:$r,block:Vf.normal,inline:Rc.normal};this.options.pedantic?(n.block=Vf.pedantic,n.inline=Rc.pedantic):this.options.gfm&&(n.block=Vf.gfm,this.options.breaks?n.inline=Rc.breaks:n.inline=Rc.gfm),this.tokenizer.rules=n}static get rules(){return{block:Vf,inline:Rc}}static lex(t,n){return new c1(n).lex(t)}static lexInline(t,n){return new c1(n).inlineTokens(t)}lex(t){t=t.replace($r.carriageReturn,`
321
+ `),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($r.tabCharGlobal," ").replace($r.spaceLine,""));t;){let c;if((l=(i=this.options.extensions)==null?void 0:i.block)!=null&&l.some(h=>(c=h.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);let h=n.at(-1);c.raw.length===1&&h!==void 0?h.raw+=`
322
+ `:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
323
+ `)?"":`
324
+ `)+c.raw,h.text+=`
325
+ `+c.text,this.inlineQueue.at(-1).src=h.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
326
+ `)?"":`
327
+ `)+c.raw,h.text+=`
328
+ `+c.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let f=t;if((o=this.options.extensions)!=null&&o.startBlock){let h=1/0,g=t.slice(1),p;this.options.extensions.startBlock.forEach(x=>{p=x.call({lexer:this},g),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(this.state.top&&(c=this.tokenizer.paragraph(f))){let h=n.at(-1);r&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
329
+ `)?"":`
330
+ `)+c.raw,h.text+=`
331
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(c),r=f.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
332
+ `)?"":`
333
+ `)+c.raw,h.text+=`
334
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(c);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var f,h,g,p,x;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)E.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)l=i[2]?i[2].length:0,r=r.slice(0,i.index+l)+"["+"a".repeat(i[0].length-l-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((h=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:h.call({lexer:this},r))??r;let o=!1,c="";for(;t;){o||(c=""),o=!1;let E;if((p=(g=this.options.extensions)==null?void 0:g.inline)!=null&&p.some(C=>(E=C.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 C=n.at(-1);E.type==="text"&&(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(t)){t=t.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(t))){t=t.substring(E.raw.length),n.push(E);continue}let v=t;if((x=this.options.extensions)!=null&&x.startInline){let C=1/0,S=t.slice(1),w;this.options.extensions.startInline.forEach(O=>{w=O.call({lexer:this},S),typeof w=="number"&&w>=0&&(C=Math.min(C,w))}),C<1/0&&C>=0&&(v=t.substring(0,C+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 C=n.at(-1);(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);continue}if(t){let C="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(C);break}else throw new Error(C)}}return n}},Mh=class{constructor(t){fe(this,"options");fe(this,"parser");this.options=t||bo}space(t){return""}code({text:t,lang:n,escaped:r}){var o;let i=(o=(n||"").match($r.notSpaceStart))==null?void 0:o[0],l=t.replace($r.endingNewline,"")+`
335
+ `;return i?'<pre><code class="language-'+ys(i)+'">'+(r?l:ys(l,!0))+`</code></pre>
336
+ `:"<pre><code>"+(r?l:ys(l,!0))+`</code></pre>
337
+ `}blockquote({tokens:t}){return`<blockquote>
338
+ ${this.parser.parse(t)}</blockquote>
339
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
340
+ `}hr(t){return`<hr>
341
+ `}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let f=t.items[c];i+=this.listitem(f)}let l=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+l+o+`>
342
+ `+i+"</"+l+`>
343
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
344
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
345
+ `}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>
346
+ <thead>
347
+ `+n+`</thead>
348
+ `+i+`</table>
349
+ `}tablerow({text:t}){return`<tr>
350
+ ${t}</tr>
351
+ `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
352
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ys(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),l=YT(t);if(l===null)return i;t=l;let o='<a href="'+t+'"';return n&&(o+=' title="'+ys(n)+'"'),o+=">"+i+"</a>",o}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let l=YT(t);if(l===null)return ys(r);t=l;let o=`<img src="${t}" alt="${ys(r)}"`;return n&&(o+=` title="${ys(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ys(t.text)}},jb=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}},ns=class d1{constructor(t){fe(this,"options");fe(this,"renderer");fe(this,"textRenderer");this.options=t||bo,this.options.renderer=this.options.renderer||new Mh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jb}static parse(t,n){return new d1(n).parse(t)}static parseInline(t,n){return new d1(n).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let n="";for(let l=0;l<t.length;l++){let o=t[l];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let f=o,h=this.options.extensions.renderers[f.type].call({parser:this},f);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(f.type)){n+=h||"";continue}}let c=o;switch(c.type){case"space":{n+=this.renderer.space(c);break}case"hr":{n+=this.renderer.hr(c);break}case"heading":{n+=this.renderer.heading(c);break}case"code":{n+=this.renderer.code(c);break}case"table":{n+=this.renderer.table(c);break}case"blockquote":{n+=this.renderer.blockquote(c);break}case"list":{n+=this.renderer.list(c);break}case"checkbox":{n+=this.renderer.checkbox(c);break}case"html":{n+=this.renderer.html(c);break}case"def":{n+=this.renderer.def(c);break}case"paragraph":{n+=this.renderer.paragraph(c);break}case"text":{n+=this.renderer.text(c);break}default:{let f='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return n}parseInline(t,n=this.renderer){var i,l;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let c=t[o];if((l=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&l[c.type]){let h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=h||"";continue}}let f=c;switch(f.type){case"escape":{r+=n.text(f);break}case"html":{r+=n.html(f);break}case"link":{r+=n.link(f);break}case"image":{r+=n.image(f);break}case"checkbox":{r+=n.checkbox(f);break}case"strong":{r+=n.strong(f);break}case"em":{r+=n.em(f);break}case"codespan":{r+=n.codespan(f);break}case"br":{r+=n.br(f);break}case"del":{r+=n.del(f);break}case"text":{r+=n.text(f);break}default:{let h='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return r}},th,Mc=(th=class{constructor(e){fe(this,"options");fe(this,"block");this.options=e||bo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ba.lex:Ba.lexInline}provideParser(e=this.block){return e?ns.parse:ns.parseInline}},fe(th,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),fe(th,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),th),hV=class{constructor(...t){fe(this,"defaults",Sb());fe(this,"options",this.setOptions);fe(this,"parse",this.parseMarkdown(!0));fe(this,"parseInline",this.parseMarkdown(!1));fe(this,"Parser",ns);fe(this,"Renderer",Mh);fe(this,"TextRenderer",jb);fe(this,"Lexer",Ba);fe(this,"Tokenizer",jh);fe(this,"Hooks",Mc);this.use(...t)}walkTokens(t,n){var i,l;let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let f of c.header)r=r.concat(this.walkTokens(f.tokens,n));for(let f of c.rows)for(let h of f)r=r.concat(this.walkTokens(h.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;(l=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(f=>{let h=c[f].flat(1/0);r=r.concat(this.walkTokens(h,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let o=n.renderers[l.name];o?n.renderers[l.name]=function(...c){let f=l.renderer.apply(this,c);return f===!1&&(f=o.apply(this,c)),f}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[l.level];o?o.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),i.extensions=n),r.renderer){let l=this.defaults.renderer||new Mh(this.defaults);for(let o in r.renderer){if(!(o in l))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,f=r.renderer[c],h=l[c];l[c]=(...g)=>{let p=f.apply(l,g);return p===!1&&(p=h.apply(l,g)),p||""}}i.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new jh(this.defaults);for(let o in r.tokenizer){if(!(o in l))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,f=r.tokenizer[c],h=l[c];l[c]=(...g)=>{let p=f.apply(l,g);return p===!1&&(p=h.apply(l,g)),p}}i.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new Mc;for(let o in r.hooks){if(!(o in l))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,f=r.hooks[c],h=l[c];Mc.passThroughHooks.has(o)?l[c]=g=>{if(this.defaults.async&&Mc.passThroughHooksRespectAsync.has(o))return(async()=>{let x=await f.call(l,g);return h.call(l,x)})();let p=f.call(l,g);return h.call(l,p)}:l[c]=(...g)=>{if(this.defaults.async)return(async()=>{let x=await f.apply(l,g);return x===!1&&(x=await h.apply(l,g)),x})();let p=f.apply(l,g);return p===!1&&(p=h.apply(l,g)),p}}i.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(c){let f=[];return f.push(o.call(this,c)),l&&(f=f.concat(l.call(this,c))),f}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ba.lex(t,n??this.defaults)}parser(t,n){return ns.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},l={...this.defaults,...i},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(n):n,f=await(l.hooks?await l.hooks.provideLexer(t):t?Ba.lex:Ba.lexInline)(c,l),h=l.hooks?await l.hooks.processAllTokens(f):f;l.walkTokens&&await Promise.all(this.walkTokens(h,l.walkTokens));let g=await(l.hooks?await l.hooks.provideParser(t):t?ns.parse:ns.parseInline)(h,l);return l.hooks?await l.hooks.postprocess(g):g})().catch(o);try{l.hooks&&(n=l.hooks.preprocess(n));let c=(l.hooks?l.hooks.provideLexer(t):t?Ba.lex:Ba.lexInline)(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let f=(l.hooks?l.hooks.provideParser(t):t?ns.parse:ns.parseInline)(c,l);return l.hooks&&(f=l.hooks.postprocess(f)),f}catch(c){return o(c)}}}onError(t,n){return r=>{if(r.message+=`
353
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+ys(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},co=new hV;function gn(e,t){return co.parse(e,t)}gn.options=gn.setOptions=function(e){return co.setOptions(e),gn.defaults=co.defaults,OC(gn.defaults),gn};gn.getDefaults=Sb;gn.defaults=bo;gn.use=function(...e){return co.use(...e),gn.defaults=co.defaults,OC(gn.defaults),gn};gn.walkTokens=function(e,t){return co.walkTokens(e,t)};gn.parseInline=co.parseInline;gn.Parser=ns;gn.parser=ns.parse;gn.Renderer=Mh;gn.TextRenderer=jb;gn.Lexer=Ba;gn.lexer=Ba.lex;gn.Tokenizer=jh;gn.Hooks=Mc;gn.parse=gn;gn.options;gn.setOptions;gn.use;gn.walkTokens;gn.parseInline;ns.parse;Ba.lex;var mV=300,pV="300px",gV=500;function bV(e={}){let{immediate:t=!1,debounceDelay:n=mV,rootMargin:r=pV,idleTimeout:i=gV}=e,[l,o]=T.useState(!1),c=T.useRef(null),f=T.useRef(null),h=T.useRef(null),g=T.useMemo(()=>E=>{let v=Date.now();return window.setTimeout(()=>{E({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),p=T.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(E,v)=>window.requestIdleCallback(E,v):g,[g]),x=T.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?E=>window.cancelIdleCallback(E):E=>{clearTimeout(E)},[]);return T.useEffect(()=>{if(t){o(!0);return}let E=c.current;if(!E)return;f.current&&(clearTimeout(f.current),f.current=null),h.current&&(x(h.current),h.current=null);let v=()=>{f.current&&(clearTimeout(f.current),f.current=null),h.current&&(x(h.current),h.current=null)},C=R=>{h.current=p(j=>{j.timeRemaining()>0||j.didTimeout?(o(!0),R.disconnect()):h.current=p(()=>{o(!0),R.disconnect()},{timeout:i/2})},{timeout:i})},S=R=>{v(),f.current=window.setTimeout(()=>{var j,G;let N=R.takeRecords();(N.length===0||(G=(j=N.at(-1))==null?void 0:j.isIntersecting)!=null&&G)&&C(R)},n)},w=(R,j)=>{R.isIntersecting?S(j):v()},O=new IntersectionObserver(R=>{for(let j of R)w(j,O)},{rootMargin:r,threshold:0});return O.observe(E),()=>{f.current&&clearTimeout(f.current),h.current&&x(h.current),O.disconnect()}},[t,n,r,i,x,p]),{shouldRender:l,containerRef:c}}var $C=/\s/,xV=/^\s+$/,yV=new Set(["code","pre","svg","math","annotation"]),EV=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",_V=e=>e.some(t=>EV(t)&&yV.has(t.tagName)),TV=e=>{let t=[],n="",r=!1;for(let i of e){let l=$C.test(i);l!==r&&n&&(t.push(n),n=""),n+=i,r=l}return n&&t.push(n),t},vV=e=>{let t=[],n="";for(let r of e)$C.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},kV=(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}]}},wV=(e,t,n,r,i)=>{let l=t.at(-1);if(!(l&&"children"in l))return;if(_V(t))return ou;let o=l,c=o.children.indexOf(e);if(c===-1)return;let f=e.value;if(!f.trim()){i.count+=f.length;return}let h=n.sep==="char"?vV(f):TV(f),g=r.prevContentLength,p=h.map(x=>{let E=i.count;if(i.count+=x.length,xV.test(x))return{type:"text",value:x};let v=g>0&&E<g,C=v?0:i.newIndex++*n.stagger;return kV(x,n.animation,n.duration,n.easing,v,C)});return o.children.splice(c,1,...p),c+p.length},CV=0;function f1(e){var t,n,r,i,l;let o={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(i=e==null?void 0:e.sep)!=null?i:"word",stagger:(l=e==null?void 0:e.stagger)!=null?l:40},c={prevContentLength:0,lastRenderCharCount:0},f=CV++,h=()=>g=>{let p={count:0,newIndex:0};nb(g,"text",(x,E)=>wV(x,E,o,c,p)),c.lastRenderCharCount=p.count,c.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${f}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(g){c.prevContentLength=g},getLastRenderCharCount(){let g=c.lastRenderCharCount;return c.lastRenderCharCount=0,g}}}f1();var VC=T.createContext(!1),SV=()=>T.useContext(VC),Mb=(...e)=>TC(lC(e)),NV=(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(" ")},AV=e=>e?(...t)=>NV(e,TC(lC(t))):Mb,fu=(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)},h1=T.createContext(Mb),Ot=()=>T.useContext(h1),RV=Mb("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"),LV=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},IV=T.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:l=!0,...o})=>{let c=Ot(),f=T.useMemo(()=>c(RV),[c]),h=T.useMemo(()=>{let g={};return t.bg&&(g["--sdm-bg"]=t.bg),t.fg&&(g["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(g,LV(t.rootStyle)),g},[t.bg,t.fg,t.rootStyle]);return d.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...o,children:d.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:h,children:d.jsx("code",{className:l?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:l&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((g,p)=>d.jsx("span",{className:l?f:void 0,children:g.length===0||g.length===1&&g[0].content===""?`
354
+ `:g.map((x,E)=>{let v={},C=!!x.bgColor;if(x.color&&(v["--sdm-c"]=x.color),x.bgColor&&(v["--sdm-tbg"]=x.bgColor),x.htmlStyle)for(let[S,w]of Object.entries(x.htmlStyle))S==="color"?v["--sdm-c"]=w:S==="background-color"?(v["--sdm-tbg"]=w,C=!0):v[S]=w;return d.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",C&&"bg-[var(--sdm-tbg)]",C&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...x.htmlAttrs,children:x.content},E)})},p))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),OV=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let l=Ot();return d.jsx("div",{className:l("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},GC=T.createContext({code:""}),qC=()=>T.useContext(GC),DV=({language:e})=>{let t=Ot();return d.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:d.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},jV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
355
+ `;)t--;return e.slice(0,t)},MV=T.lazy(()=>M(()=>import("./highlighted-body-OFNGDK62-ChrwAL9u.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),PV=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:l,lineNumbers:o,...c})=>{let f=Ot(),h=T.useMemo(()=>jV(e),[e]),g=T.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:h.split(`
356
+ `).map(p=>[{content:p,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[h]);return d.jsx(GC.Provider,{value:{code:e},children:d.jsxs(OV,{isIncomplete:i,language:t,children:[d.jsx(DV,{language:t}),r?d.jsx("div",{className:f("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:d.jsx("div",{className:f("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,d.jsx(T.Suspense,{fallback:d.jsx(IV,{className:n,language:t,lineNumbers:o,result:g,startLine:l,...c}),children:d.jsx(MV,{className:n,code:h,language:t,lineNumbers:o,raw:g,startLine:l,...c})})]})})},BV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),UV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),HV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),FV=e=>d.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[d.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),zV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),$V=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),VV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"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"})}),GV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),qV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),YV=e=>d.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:d.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Pc={CheckIcon:BV,CopyIcon:UV,DownloadIcon:HV,ExternalLinkIcon:GV,Loader2Icon:FV,Maximize2Icon:zV,RotateCcwIcon:$V,XIcon:VV,ZoomInIcon:qV,ZoomOutIcon:YV},YC=T.createContext(Pc),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])},XT=({icons:e,children:t})=>{let n=T.useRef(e),r=T.useRef(e?{...Pc,...e}:Pc);WV(n.current,e)||(n.current=e,r.current=e?{...Pc,...e}:Pc);let i=r.current;return d.jsx(YC.Provider,{value:i,children:t})},os=()=>T.useContext(YC),WC={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"},m1=T.createContext(WC),xi=()=>T.useContext(m1),KT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:l,...o})=>{let c=Ot(),[f,h]=T.useState(!1),g=T.useRef(0),{code:p}=qC(),{isAnimating:x}=T.useContext(ma),E=xi(),v=l??p,C=async()=>{var O;if(typeof window>"u"||!((O=navigator==null?void 0:navigator.clipboard)!=null&&O.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{f||(await navigator.clipboard.writeText(v),h(!0),e==null||e(),g.current=window.setTimeout(()=>h(!1),n))}catch(R){t==null||t(R)}};T.useEffect(()=>()=>{window.clearTimeout(g.current)},[]);let S=os(),w=f?S.CheckIcon:S.CopyIcon;return d.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:x,onClick:C,title:E.copyCode,type:"button",...o,children:r??d.jsx(w,{size:14})})},ZT={"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"},QV=({onDownload:e,onError:t,language:n,children:r,className:i,code:l,...o})=>{let c=Ot(),{code:f}=qC(),{isAnimating:h}=T.useContext(ma),g=xi(),p=os(),x=l??f,E=`file.${n&&n in ZT?ZT[n]:"txt"}`,v="text/plain",C=()=>{try{fu(E,x,v),e==null||e()}catch(S){t==null||t(S)}};return d.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:h,onClick:C,title:g.downloadFile,type:"button",...o,children:r??d.jsx(p.DownloadIcon,{size:14})})},JT=()=>{let{Loader2Icon:e}=os(),t=Ot();return d.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[d.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),d.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:d.jsx(e,{className:t("size-4 animate-spin")})})]})},XV=/\.[^/.]+$/,KV=({node:e,className:t,src:n,alt:r,onLoad:i,onError:l,...o})=>{let{DownloadIcon:c}=os(),f=Ot(),h=T.useRef(null),[g,p]=T.useState(!1),[x,E]=T.useState(!1),v=xi(),C=o.width!=null||o.height!=null,S=(g||C)&&!x,w=x&&!C;T.useEffect(()=>{let G=h.current;if(G!=null&&G.complete){let N=G.naturalWidth>0;p(N),E(!N)}},[]);let O=T.useCallback(G=>{p(!0),E(!1),i==null||i(G)},[i]),R=T.useCallback(G=>{p(!1),E(!0),l==null||l(G)},[l]),j=async()=>{if(n)try{let G=await(await fetch(n)).blob(),N=new URL(n,window.location.origin).pathname.split("/").pop()||"",P=N.split(".").pop(),$=N.includes(".")&&P!==void 0&&P.length<=4,ne="";if($)ne=N;else{let W=G.type,me="png";W.includes("jpeg")||W.includes("jpg")?me="jpg":W.includes("png")?me="png":W.includes("svg")?me="svg":W.includes("gif")?me="gif":W.includes("webp")&&(me="webp"),ne=`${(r||N||"image").replace(XV,"")}.${me}`}fu(ne,G,G.type)}catch{window.open(n,"_blank")}};return n?d.jsxs("div",{className:f("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[d.jsx("img",{alt:r,className:f("max-w-full rounded-lg",w&&"hidden",t),"data-streamdown":"image",onError:R,onLoad:O,ref:h,src:n,...o}),w&&d.jsx("span",{className:f("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),d.jsx("div",{className:f("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),S&&d.jsx("button",{className:f("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:j,title:v.downloadImage,type:"button",children:d.jsx(c,{size:14})})]}):null},Qc=0,Pb=()=>{Qc+=1,Qc===1&&(document.body.style.overflow="hidden")},Bb=()=>{Qc=Math.max(0,Qc-1),Qc===0&&(document.body.style.overflow="")},ZV=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:l,ExternalLinkIcon:o,XIcon:c}=os(),f=Ot(),[h,g]=T.useState(!1),p=xi(),x=T.useCallback(async()=>{try{await navigator.clipboard.writeText(e),g(!0),setTimeout(()=>g(!1),2e3)}catch{}},[e]),E=T.useCallback(()=>{r(),n()},[r,n]);return T.useEffect(()=>{if(t){Pb();let v=C=>{C.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),Bb()}}},[t,n]),t?d.jsx("div",{className:f("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:d.jsxs("div",{className:f("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[d.jsx("button",{className:f("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:p.close,type:"button",children:d.jsx(c,{size:16})}),d.jsxs("div",{className:f("flex flex-col gap-2"),children:[d.jsxs("div",{className:f("flex items-center gap-2 font-semibold text-lg"),children:[d.jsx(o,{size:20}),d.jsx("span",{children:p.openExternalLink})]}),d.jsx("p",{className:f("text-muted-foreground text-sm"),children:p.externalLinkWarning})]}),d.jsx("div",{className:f("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),d.jsxs("div",{className:f("flex gap-2"),children:[d.jsx("button",{className:f("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:x,type:"button",children:h?d.jsxs(d.Fragment,{children:[d.jsx(i,{size:14}),d.jsx("span",{children:p.copied})]}):d.jsxs(d.Fragment,{children:[d.jsx(l,{size:14}),d.jsx("span",{children:p.copyLink})]})}),d.jsxs("button",{className:f("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:E,type:"button",children:[d.jsx(o,{size:14}),d.jsx("span",{children:p.openLink})]})]})]})}):null},p1=T.createContext(null),Ub=()=>T.useContext(p1),eW=()=>{var e;let t=Ub();return(e=t==null?void 0:t.code)!=null?e:null},Hb=()=>{var e;let t=Ub();return(e=t==null?void 0:t.mermaid)!=null?e:null},JV=e=>{var t;let n=Ub();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},eG=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,l)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let f=document.createElement("canvas"),h=c.width*r,g=c.height*r;f.width=h,f.height=g;let p=f.getContext("2d");if(!p){l(new Error("Failed to create 2D canvas context for PNG export"));return}p.drawImage(c,0,0,h,g),f.toBlob(x=>{if(!x){l(new Error("Failed to create PNG blob"));return}i(x)},"image/png")},c.onerror=()=>l(new Error("Failed to load SVG image")),c.src=o})},tG=({chart:e,children:t,className:n,onDownload:r,config:i,onError:l})=>{let o=Ot(),[c,f]=T.useState(!1),h=T.useRef(null),{isAnimating:g}=T.useContext(ma),p=os(),x=Hb(),E=xi(),v=async C=>{try{if(C==="mmd"){fu("diagram.mmd",e,"text/plain"),f(!1),r==null||r(C);return}if(!x){l==null||l(new Error("Mermaid plugin not available"));return}let S=x.getMermaid(i),w=e.split("").reduce((j,G)=>(j<<5)-j+G.charCodeAt(0)|0,0),O=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await S.render(O,e);if(!R){l==null||l(new Error("SVG not found. Please wait for the diagram to render."));return}if(C==="svg"){fu("diagram.svg",R,"image/svg+xml"),f(!1),r==null||r(C);return}if(C==="png"){let j=await eG(R);fu("diagram.png",j,"image/png"),r==null||r(C),f(!1);return}}catch(S){l==null||l(S)}};return T.useEffect(()=>{let C=S=>{let w=S.composedPath();h.current&&!w.includes(h.current)&&f(!1)};return document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}},[]),d.jsxs("div",{className:o("relative"),ref:h,children:[d.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:g,onClick:()=>f(!c),title:E.downloadDiagram,type:"button",children:t??d.jsx(p.DownloadIcon,{size:14})}),c?d.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[d.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:E.downloadDiagramAsSvg,type:"button",children:E.mermaidFormatSvg}),d.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:E.downloadDiagramAsPng,type:"button",children:E.mermaidFormatPng}),d.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:E.downloadDiagramAsMmd,type:"button",children:E.mermaidFormatMmd})]}):null]})},nG=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...l})=>{let{Maximize2Icon:o,XIcon:c}=os(),f=Ot(),[h,g]=T.useState(!1),{isAnimating:p,controls:x}=T.useContext(ma),E=xi(),v=(()=>{if(typeof x=="boolean")return x;let S=x.mermaid;return S===!1?!1:S===!0||S===void 0?!0:S.panZoom!==!1})(),C=()=>{g(!h)};return T.useEffect(()=>{if(h){Pb();let S=w=>{w.key==="Escape"&&g(!1)};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S),Bb()}}},[h]),T.useEffect(()=>{h?n==null||n():r&&r()},[h,n,r]),d.jsxs(d.Fragment,{children:[d.jsx("button",{className:f("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:p,onClick:C,title:E.viewFullscreen,type:"button",...l,children:d.jsx(o,{size:14})}),h?_u.createPortal(d.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:C,onKeyDown:S=>{S.key==="Escape"&&C()},role:"button",tabIndex:0,children:[d.jsx("button",{className:f("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:C,title:E.exitFullscreen,type:"button",children:d.jsx(c,{size:20})}),d.jsx("div",{className:f("flex size-full items-center justify-center p-4"),onClick:S=>S.stopPropagation(),onKeyDown:S=>S.stopPropagation(),role:"presentation",children:d.jsx(R5,{chart:e,className:f("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},QC=e=>{var t,n;let r=[],i=[],l=e.querySelectorAll("thead th");for(let c of l)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let c of o){let f=[],h=c.querySelectorAll("td");for(let g of h)f.push(((n=g.textContent)==null?void 0:n.trim())||"");i.push(f)}return{headers:r,rows:i}},XC=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1,h=!1;for(let g of c){if(g==='"'){f=!0,h=!0;break}(g===","||g===`
357
+ `)&&(f=!0)}return f?h?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(","),o+=1);for(let c of n)l[o]=c.map(r).join(","),o+=1;return l.join(`
358
+ `)},rG=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1;for(let g of c)if(g===" "||g===`
359
+ `||g==="\r"){f=!0;break}if(!f)return c;let h=[];for(let g of c)g===" "?h.push("\\t"):g===`
360
+ `?h.push("\\n"):g==="\r"?h.push("\\r"):h.push(g);return h.join("")},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(" "),o+=1);for(let c of n)l[o]=c.map(r).join(" "),o+=1;return l.join(`
361
+ `)},pg=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("")},g1=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=>pg(c));r[i]=`| ${l.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]="---";r[i]=`| ${o.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let f=new Array(t.length);for(let h=0;h<t.length;h+=1)f[h]=h<c.length?pg(c[h]):"";r[i]=`| ${f.join(" | ")} |`,i+=1}else{let f=c.map(h=>pg(h));r[i]=`| ${f.join(" | ")} |`,i+=1}return r.join(`
362
+ `)},KC=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let l=Ot(),[o,c]=T.useState(!1),[f,h]=T.useState(!1),g=T.useRef(null),p=T.useRef(0),{isAnimating:x}=T.useContext(ma),E=xi(),v=async w=>{var O,R;if(typeof window>"u"||!((O=navigator==null?void 0:navigator.clipboard)!=null&&O.write)){r==null||r(new Error("Clipboard API not available"));return}try{let j=(R=g.current)==null?void 0:R.closest('[data-streamdown="table-wrapper"]'),G=j==null?void 0:j.querySelector("table");if(!G){r==null||r(new Error("Table not found"));return}let N=QC(G),P=({csv:XC,tsv:rG,md:g1}[w]||g1)(N),$=new ClipboardItem({"text/plain":new Blob([P],{type:"text/plain"}),"text/html":new Blob([G.outerHTML],{type:"text/html"})});await navigator.clipboard.write([$]),h(!0),c(!1),n==null||n(w),p.current=window.setTimeout(()=>h(!1),i)}catch(j){r==null||r(j)}};T.useEffect(()=>{let w=O=>{let R=O.composedPath();g.current&&!R.includes(g.current)&&c(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w),window.clearTimeout(p.current)}},[]);let C=os(),S=f?C.CheckIcon:C.CopyIcon;return d.jsxs("div",{className:l("relative"),ref:g,children:[d.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:x,onClick:()=>c(!o),title:E.copyTable,type:"button",children:e??d.jsx(S,{height:14,width:14})}),o?d.jsxs("div",{className:l("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[d.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:E.copyTableAsMarkdown,type:"button",children:E.tableFormatMarkdown}),d.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:E.copyTableAsCsv,type:"button",children:E.tableFormatCsv}),d.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:E.copyTableAsTsv,type:"button",children:E.tableFormatTsv})]}):null]})},ZC=({children:e,className:t,onDownload:n,onError:r})=>{let i=Ot(),[l,o]=T.useState(!1),c=T.useRef(null),{isAnimating:f}=T.useContext(ma),h=xi(),g=os(),p=x=>{var E;try{let v=(E=c.current)==null?void 0:E.closest('[data-streamdown="table-wrapper"]'),C=v==null?void 0:v.querySelector("table");if(!C){r==null||r(new Error("Table not found"));return}let S=QC(C),w=x==="csv"?XC(S):g1(S);fu(`table.${x==="csv"?"csv":"md"}`,w,x==="csv"?"text/csv":"text/markdown"),o(!1),n==null||n(x)}catch(v){r==null||r(v)}};return T.useEffect(()=>{let x=E=>{let v=E.composedPath();c.current&&!v.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[]),d.jsxs("div",{className:i("relative"),ref:c,children:[d.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>o(!l),title:h.downloadTable,type:"button",children:e??d.jsx(g.DownloadIcon,{size:14})}),l?d.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[d.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:h.downloadTableAsCsv,type:"button",children:h.tableFormatCsv}),d.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:h.downloadTableAsMarkdown,type:"button",children:h.tableFormatMarkdown})]}):null]})},aG=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:l}=os(),o=Ot(),[c,f]=T.useState(!1),{isAnimating:h}=T.useContext(ma),g=xi(),p=()=>{f(!0)},x=()=>{f(!1)};return T.useEffect(()=>{if(c){Pb();let E=v=>{v.key==="Escape"&&f(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),Bb()}}},[c]),d.jsxs(d.Fragment,{children:[d.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:p,title:g.viewFullscreen,type:"button",children:d.jsx(i,{size:14})}),c?_u.createPortal(d.jsx("div",{"aria-label":g.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:x,onKeyDown:E=>{E.key==="Escape"&&x()},role:"dialog",children:d.jsxs("div",{className:o("flex h-full flex-col"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[d.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?d.jsx(KC,{}):null,r?d.jsx(ZC,{}):null,d.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:x,title:g.exitFullscreen,type:"button",children:d.jsx(l,{size:20})})]}),d.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:d.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},sG=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:l=!0,...o})=>{let c=Ot(),f=n&&r,h=n&&i,g=n&&l,p=f||h||g;return d.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[p?d.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[f?d.jsx(KC,{}):null,h?d.jsx(ZC,{}):null,g?d.jsx(aG,{showCopy:f,showDownload:h,children:e}):null]}):null,d.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:d.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},iG=/startLine=(\d+)/,lG=/\bnoLineNumbers\b/,oG=T.lazy(()=>M(()=>Promise.resolve().then(()=>YY),void 0).then(e=>({default:e.Mermaid}))),uG=/language-([^\s]+)/;function mm(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 Bn(e,t){return e.className===t.className&&mm(e.node,t.node)}var b1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,gg=(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},ev=(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},Gf=(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},Fb=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Bn(e,t));Fb.displayName="MarkdownOl";var JC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&mm(e.node,t.node));JC.displayName="MarkdownLi";var e5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Bn(e,t));e5.displayName="MarkdownUl";var t5=T.memo(({className:e,node:t,...n})=>{let r=Ot();return d.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Bn(e,t));t5.displayName="MarkdownHr";var n5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Bn(e,t));n5.displayName="MarkdownStrong";var cG=({children:e,className:t,href:n,node:r,...i})=>{let l=Ot(),{linkSafety:o}=T.useContext(ma),[c,f]=T.useState(!1),h=n==="streamdown:incomplete-link",g=T.useCallback(async v=>{if(!(!(o!=null&&o.enabled&&n)||h)){if(v.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}f(!0)}},[o,n,h]),p=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),x=T.useCallback(()=>{f(!1)},[]),E={url:n??"",isOpen:c,onClose:x,onConfirm:p};return o!=null&&o.enabled&&n?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:l("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",onClick:g,type:"button",children:e}),o.renderModal?o.renderModal(E):d.jsx(ZV,{...E})]}):d.jsx("a",{className:l("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},r5=T.memo(cG,(e,t)=>Bn(e,t)&&e.href===t.href);r5.displayName="MarkdownA";var a5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Bn(e,t));a5.displayName="MarkdownH1";var s5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Bn(e,t));s5.displayName="MarkdownH2";var i5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Bn(e,t));i5.displayName="MarkdownH3";var l5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Bn(e,t));l5.displayName="MarkdownH4";var o5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Bn(e,t));o5.displayName="MarkdownH5";var u5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Bn(e,t));u5.displayName="MarkdownH6";var c5=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(ma),l=b1(i,"table"),o=gg(i,"copy"),c=gg(i,"download"),f=gg(i,"fullscreen");return d.jsx(sG,{className:t,showControls:l,showCopy:o,showDownload:c,showFullscreen:f,...r,children:e})},(e,t)=>Bn(e,t));c5.displayName="MarkdownTable";var d5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Bn(e,t));d5.displayName="MarkdownThead";var f5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Bn(e,t));f5.displayName="MarkdownTbody";var h5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Bn(e,t));h5.displayName="MarkdownTr";var m5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Bn(e,t));m5.displayName="MarkdownTh";var p5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Bn(e,t));p5.displayName="MarkdownTd";var g5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Bn(e,t));g5.displayName="MarkdownBlockquote";var b5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Bn(e,t));b5.displayName="MarkdownSup";var x5=T.memo(({children:e,className:t,node:n,...r})=>{let i=Ot();return d.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Bn(e,t));x5.displayName="MarkdownSub";var y5=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var c,f;if(!T.isValidElement(o))return!1;let h=Array.isArray(o.props.children)?o.props.children:[o.props.children],g=!1,p=!1;for(let x of h)if(x){if(typeof x=="string")x.trim()!==""&&(g=!0);else if(T.isValidElement(x))if(((c=x.props)==null?void 0:c["data-footnote-backref"])!==void 0)p=!0;else{let E=Array.isArray(x.props.children)?x.props.children:[x.props.children];for(let v of E){if(typeof v=="string"&&v.trim()!==""){g=!0;break}if(T.isValidElement(v)&&((f=v.props)==null?void 0:f["data-footnote-backref"])===void 0){g=!0;break}}}}return p&&!g},l=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===Fb){let c=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(f=>!i(f));return c.length===0?null:{...o,props:{...o.props,children:c}}}return o}):e;return(Array.isArray(l)?l.some(o=>o!==null):l!==null)?d.jsx("section",{className:t,...r,children:l}):null}return d.jsx("section",{className:t,...r,children:e})},(e,t)=>Bn(e,t));y5.displayName="MarkdownSection";var dG=({node:e,className:t,children:n,...r})=>{var i,l;let o=Ot(),c=!("data-block"in r),{mermaid:f,controls:h,lineNumbers:g}=T.useContext(ma),p=Hb(),x=SV(),E=t==null?void 0:t.match(uG),v=(i=E==null?void 0:E.at(1))!=null?i:"",C=JV(v);if(c)return d.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let S=(l=e==null?void 0:e.properties)==null?void 0:l.metastring,w=S==null?void 0:S.match(iG),O=w?Number.parseInt(w[1],10):void 0,R=O!==void 0&&O>=1?O:void 0,j=!(S&&lG.test(S))&&g!==!1,G="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?G=n.props.children:typeof n=="string"&&(G=n),C){let ne=C.component;return d.jsx(T.Suspense,{fallback:d.jsx(JT,{}),children:d.jsx(ne,{code:G,isIncomplete:x,language:v,meta:S})})}if(v==="mermaid"&&p){let ne=b1(h,"mermaid"),W=Gf(h,"download"),me=Gf(h,"copy"),Q=Gf(h,"fullscreen"),_e=Gf(h,"panZoom"),de=ne&&(W||me||Q);return d.jsx(T.Suspense,{fallback:d.jsx(JT,{}),children:d.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[d.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:d.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),de?d.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:d.jsxs("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[W?d.jsx(tG,{chart:G,config:f==null?void 0:f.config}):null,me?d.jsx(KT,{code:G}):null,Q?d.jsx(nG,{chart:G,config:f==null?void 0:f.config}):null]})}):null,d.jsx("div",{className:o("rounded-md border border-border bg-background"),children:d.jsx(oG,{chart:G,config:f==null?void 0:f.config,showControls:_e})})]})})}let N=b1(h,"code"),P=ev(h,"download"),$=ev(h,"copy");return d.jsx(PV,{className:t,code:G,isIncomplete:x,language:v,lineNumbers:j,startLine:R,children:N?d.jsxs(d.Fragment,{children:[P?d.jsx(QV,{code:G,language:v}):null,$?d.jsx(KT,{}):null]}):null})},E5=T.memo(dG,(e,t)=>e.className===t.className&&mm(e.node,t.node));E5.displayName="MarkdownCode";var _5=T.memo(KV,(e,t)=>e.className===t.className&&mm(e.node,t.node));_5.displayName="MarkdownImg";var T5=T.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&T.isValidElement(r[0])){let i=r[0].props.node,l=i==null?void 0:i.tagName;if(l==="img")return d.jsx(d.Fragment,{children:e});if(l==="code"&&"data-block"in r[0].props)return d.jsx(d.Fragment,{children:e})}return d.jsx("p",{...n,children:e})},(e,t)=>Bn(e,t));T5.displayName="MarkdownParagraph";var fG={ol:Fb,li:JC,ul:e5,hr:t5,strong:n5,a:r5,h1:a5,h2:s5,h3:i5,h4:l5,h5:o5,h6:u5,table:c5,thead:d5,tbody:f5,tr:h5,th:m5,td:p5,blockquote:g5,code:E5,img:_5,pre:({children:e})=>T.isValidElement(e)?T.cloneElement(e,{"data-block":"true"}):e,sup:b5,sub:x5,p:T5,section:y5},hG=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,mG=new RegExp("\\p{L}","u");function tv(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(hG.test(n))return"rtl";if(mG.test(n))return"ltr"}return"ltr"}var pG=/^[ \t]{0,3}(`{3,}|~{3,})/,gG=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,nv=e=>{let t=e.split(`
363
+ `),n=null,r=0;for(let i of t){let l=pG.exec(i);if(n===null){if(l){let o=l[1];n=o[0],r=o.length}}else if(l){let o=l[1],c=o[0],f=o.length;c===n&&f>=r&&(n=null,r=0)}}return n!==null},bG=e=>{let t=e.split(`
364
+ `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&gG.test(r))return!0}return!1},xG=()=>e=>{vs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},rv=[],av={allowDangerousHtml:!0},qf=new WeakMap,yG=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 g="default";return this.keyCache.set(e,g),g}let l=g=>{if(!g||g.length===0)return"";let p="";for(let x=0;x<g.length;x+=1){let E=g[x];if(x>0&&(p+=","),Array.isArray(E)){let[v,C]=E;if(typeof v=="function"){let S=qf.get(v);S||(S=v.name,qf.set(v,S)),p+=S}else p+=String(v);p+=":",p+=JSON.stringify(C)}else if(typeof E=="function"){let v=qf.get(E);v||(v=E.name,qf.set(E,v)),p+=v}else p+=String(E)}return p},o=l(n),c=l(r),f=i?JSON.stringify(i):"",h=`${c}::${o}::${f}`;return this.keyCache.set(e,h),h}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},sv=new yG,v5=e=>{let t=EG(e),n=e.children||"",r=t.runSync(t.parse(n),n);return SG(r,e)},EG=e=>{let t=sv.get(e);if(t)return t;let n=TG(e);return sv.set(e,n),n},_G=e=>e.some(t=>Array.isArray(t)?t[0]===e1:t===e1),TG=e=>{let t=e.rehypePlugins||rv,n=e.remarkPlugins||rv,r=_G(t)?n:[...n,xG],i=e.remarkRehypeOptions?{...av,...e.remarkRehypeOptions}:av;return v$().use(Tz).use(r).use(a$,i).use(t)},vG=e=>e,kG=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},wG=(e,t)=>{var n;for(let r in ig)if(Object.hasOwn(ig,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],l=ig[r];(l===null||l.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},CG=(e,t,n,r,i,l)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&l&&typeof t=="number"&&(o=!l(e,t,n)),o},SG=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:l,unwrapDisallowed:o,urlTransform:c}=t;if(n||r||i||l||c){let f=c||vG;vs(e,(h,g,p)=>{if(h.type==="raw"&&p&&typeof g=="number")return kG(p,g,l,h.value),g;if(h.type==="element"&&(wG(h,f),CG(h,g,p,r,i,n)&&p&&typeof g=="number"))return o&&h.children?p.children.splice(g,1,...h.children):p.children.splice(g,1),g})}return RF(e,{Fragment:d.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0})},NG=/\[\^[\w-]{1,200}\](?!:)/,AG=/\[\^[\w-]{1,200}\]:/,RG=/<(\w+)[\s>]/,LG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),iv=new Map,lv=new Map,IG=e=>{let t=e.toLowerCase(),n=iv.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return iv.set(t,r),r},OG=e=>{let t=e.toLowerCase(),n=lv.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return lv.set(t,r),r},ov=(e,t)=>{if(LG.has(t.toLowerCase()))return 0;let n=e.match(IG(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},uv=(e,t)=>{let n=e.match(OG(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},jG=e=>{let t=NG.test(e),n=AG.test(e);if(t||n)return[e];let r=Ba.lex(e,{gfm:!0}),i=[],l=[],o=!1;for(let c of r){let f=c.raw,h=i.length;if(l.length>0){i[h-1]+=f;let g=l.at(-1),p=ov(f,g),x=uv(f,g);for(let E=0;E<p;E+=1)l.push(g);for(let E=0;E<x;E+=1)l.length>0&&l.at(-1)===g&&l.pop();continue}if(c.type==="html"&&c.block){let g=f.match(RG);if(g){let p=g[1],x=ov(f,p),E=uv(f,p);x>E&&l.push(p)}}if(h>0&&!o){let g=i[h-1];if(DG(g)%2===1){i[h-1]=g+f;continue}}i.push(f),c.type!=="space"&&(o=c.type==="code")}return i},MG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,f)=>{if(!c.includes(`
365
+
366
+ `))return o+c+f;let h=c.replace(/\n\n/g,`
367
+ <!---->
368
+ `),g=(h.startsWith(`
369
+ `)?"":`
370
+ `)+h+(h.endsWith(`
371
+ `)?"":`
372
+ `);return`${o}${g}${f}
373
+
374
+ `})}return n},PG=/([\\`*_~[\]|])/g,BG=e=>e.replace(PG,"\\$1"),UG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,f)=>{let h=BG(c).replace(/\n\n/g,"&#10;&#10;");return o+h+f})}return n},k5=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(k5).join(""):"",HG=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));vs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=k5(r);r.children=i?[{type:"text",value:i}]:[]}})},FG=()=>e=>{vs(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},zG=/^[ \t]*<[\w!/?-]/,$G=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,VG=e=>typeof e!="string"||e.length===0||!zG.test(e)?e:e.replace($G,"$1"),cv,dv,fv,hv,fh={...Jl,protocols:{...Jl.protocols,href:[...(dv=(cv=Jl.protocols)==null?void 0:cv.href)!=null?dv:[],"tel"]},attributes:{...Jl.attributes,code:[...(hv=(fv=Jl.attributes)==null?void 0:fv.code)!=null?hv:[],"metastring"]}},x1={raw:e1,sanitize:[b3,fh],harden:[oD,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},w5={gfm:[bU,{}],codeMeta:FG},mv=Object.values(x1),GG=Object.values(w5),qG={block:" ▋",circle:" ●"},C5=["github-light","github-dark"],S5={enabled:!0},YG={shikiTheme:C5,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:S5},ma=T.createContext(YG),N5=T.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:l,animatePlugin:o,...c})=>{if(o){let g=o.getLastRenderCharCount();o.setPrevContentLength(g)}let f=typeof e=="string"&&n?VG(e):e,h=d.jsx(v5,{...c,children:f});return d.jsx(VC.Provider,{value:i,children:l?d.jsx("div",{dir:l,style:{display:"contents"},children:h}):h})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var l,o;return((l=e.components)==null?void 0:l[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});N5.displayName="Block";var A5=T.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:l,rehypePlugins:o=mv,remarkPlugins:c=GG,className:f,shikiTheme:h=C5,mermaid:g,controls:p=!0,isAnimating:x=!1,animated:E,BlockComponent:v=N5,parseMarkdownIntoBlocksFn:C=jG,caret:S,plugins:w,remend:O,linkSafety:R=S5,lineNumbers:j=!0,allowedTags:G,literalTagContent:N,translations:P,icons:$,prefix:ne,onAnimationStart:W,onAnimationEnd:me,...Q})=>{let _e=T.useId(),[de,se]=T.useTransition(),H=T.useMemo(()=>AV(ne),[ne]),ce=T.useRef(null),q=T.useRef(W),J=T.useRef(me);q.current=W,J.current=me,T.useEffect(()=>{var $e,He,Rt;if(t==="static")return;let un=ce.current;if(ce.current=x,un===null){x&&(($e=q.current)==null||$e.call(q));return}x&&!un?(He=q.current)==null||He.call(q):!x&&un&&((Rt=J.current)==null||Rt.call(J))},[x,t]);let A=T.useMemo(()=>G?Object.keys(G):[],[G]),U=T.useMemo(()=>{if(typeof e!="string")return"";let $e=t==="streaming"&&r?NH(e,O):e;return N&&N.length>0&&($e=UG($e,N)),A.length>0&&($e=MG($e,A)),$e},[e,t,r,O,A,N]),ee=T.useMemo(()=>C(U),[U,C]),[D,Te]=T.useState(ee);T.useEffect(()=>{t==="streaming"&&!Be?se(()=>{Te(ee)}):Te(ee)},[ee,t]);let we=t==="streaming"?D:ee,Se=T.useMemo(()=>n==="auto"?we.map(tv):void 0,[we,n]),Ve=T.useMemo(()=>we.map(($e,He)=>`${_e}-${He}`),[we.length,_e]),et=T.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),Be=T.useMemo(()=>et?et==="true"?f1():f1(E):null,[et]),Ft=T.useMemo(()=>{var $e,He;return{shikiTheme:(He=($e=w==null?void 0:w.code)==null?void 0:$e.getThemes())!=null?He:h,controls:p,isAnimating:x,lineNumbers:j,mode:t,mermaid:g,linkSafety:R}},[h,p,x,j,t,g,R,w==null?void 0:w.code]),at=T.useMemo(()=>P?JSON.stringify(P):"",[P]),gt=T.useMemo(()=>({...WC,...P}),[at]),Kt=T.useMemo(()=>{let{inlineCode:$e,...He}=l??{},Rt={...fG,...He};if($e){let un=Rt.code;Rt.code=cn=>"data-block"in cn?un?T.createElement(un,cn):null:T.createElement($e,cn)}return Rt},[l]),Ue=T.useMemo(()=>{let $e=[];return w!=null&&w.cjk&&($e=[...$e,...w.cjk.remarkPluginsBefore]),$e=[...$e,...c],w!=null&&w.cjk&&($e=[...$e,...w.cjk.remarkPluginsAfter]),w!=null&&w.math&&($e=[...$e,w.math.remarkPlugin]),$e},[c,w==null?void 0:w.math,w==null?void 0:w.cjk]),kt=T.useMemo(()=>{var $e;let He=o;if(G&&Object.keys(G).length>0&&o===mv){let Rt={...fh,tagNames:[...($e=fh.tagNames)!=null?$e:[],...Object.keys(G)],attributes:{...fh.attributes,...G}};He=[x1.raw,[b3,Rt],x1.harden]}return N&&N.length>0&&(He=[...He,[HG,N]]),w!=null&&w.math&&(He=[...He,w.math.rehypePlugin]),Be&&x&&(He=[...He,Be.rehypePlugin]),He},[o,w==null?void 0:w.math,Be,x,G,N]),nt=T.useMemo(()=>{if(!x||we.length===0)return!1;let $e=we.at(-1);return nv($e)||bG($e)},[x,we]),on=T.useMemo(()=>S&&x&&!nt?{"--streamdown-caret":`"${qG[S]}"`}:void 0,[S,x,nt]);return t==="static"?d.jsx(m1.Provider,{value:gt,children:d.jsx(p1.Provider,{value:w??null,children:d.jsx(ma.Provider,{value:Ft,children:d.jsx(XT,{icons:$,children:d.jsx(h1.Provider,{value:H,children:d.jsx("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",f),dir:n==="auto"?tv(U):n,children:d.jsx(v5,{components:Kt,rehypePlugins:kt,remarkPlugins:Ue,...Q,children:U})})})})})})}):d.jsx(m1.Provider,{value:gt,children:d.jsx(p1.Provider,{value:w??null,children:d.jsx(ma.Provider,{value:Ft,children:d.jsx(XT,{icons:$,children:d.jsx(h1.Provider,{value:H,children:d.jsxs("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",S&&!nt?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,f),style:on,children:[we.length===0&&S&&x&&d.jsx("span",{}),we.map(($e,He)=>{var Rt;let un=He===we.length-1,cn=x&&un&&nv($e);return d.jsx(v,{animatePlugin:Be,components:Kt,content:$e,dir:(Rt=Se==null?void 0:Se[He])!=null?Rt:n!=="auto"?n:void 0,index:He,isIncomplete:cn,rehypePlugins:kt,remarkPlugins:Ue,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...Q},Ve[He])})]})})})})})})},(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);A5.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:f,ZoomInIcon:h,ZoomOutIcon:g}=os(),p=Ot(),x=T.useRef(null),E=T.useRef(null),[v,C]=T.useState(o),[S,w]=T.useState({x:0,y:0}),[O,R]=T.useState(!1),[j,G]=T.useState({x:0,y:0}),[N,P]=T.useState({x:0,y:0}),$=T.useCallback(H=>{C(ce=>Math.max(n,Math.min(r,ce+H)))},[n,r]),ne=T.useCallback(()=>{$(i)},[$,i]),W=T.useCallback(()=>{$(-i)},[$,i]),me=T.useCallback(()=>{C(o),w({x:0,y:0})},[o]),Q=T.useCallback(H=>{H.preventDefault();let ce=H.deltaY>0?-i:i;$(ce)},[$,i]),_e=T.useCallback(H=>{if(H.button!==0||H.isPrimary===!1)return;R(!0),G({x:H.clientX,y:H.clientY}),P(S);let ce=H.currentTarget;ce instanceof HTMLElement&&ce.setPointerCapture(H.pointerId)},[S]),de=T.useCallback(H=>{if(!O)return;H.preventDefault();let ce=H.clientX-j.x,q=H.clientY-j.y;w({x:N.x+ce,y:N.y+q})},[O,j,N]),se=T.useCallback(H=>{R(!1);let ce=H.currentTarget;ce instanceof HTMLElement&&ce.releasePointerCapture(H.pointerId)},[]);return T.useEffect(()=>{let H=x.current;if(H)return H.addEventListener("wheel",Q,{passive:!1}),()=>{H.removeEventListener("wheel",Q)}},[Q]),T.useEffect(()=>{let H=E.current;if(H&&O)return document.body.style.userSelect="none",H.addEventListener("pointermove",de,{passive:!1}),H.addEventListener("pointerup",se),H.addEventListener("pointercancel",se),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",de),H.removeEventListener("pointerup",se),H.removeEventListener("pointercancel",se)}},[O,de,se]),d.jsxs("div",{className:p("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:x,style:{cursor:O?"grabbing":"grab"},children:[l?d.jsxs("div",{className:p("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[d.jsx("button",{className:p("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:ne,title:"Zoom in",type:"button",children:d.jsx(h,{size:16})}),d.jsx("button",{className:p("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:W,title:"Zoom out",type:"button",children:d.jsx(g,{size:16})}),d.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:me,title:"Reset zoom and pan",type:"button",children:d.jsx(f,{size:16})})]}):null,d.jsx("div",{className:p("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:_e,ref:E,role:"application",style:{transform:`translate(${S.x}px, ${S.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},R5=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let l=Ot(),[o,c]=T.useState(null),[f,h]=T.useState(!1),[g,p]=T.useState(""),[x,E]=T.useState(""),[v,C]=T.useState(0),{mermaid:S}=T.useContext(ma),w=Hb(),O=S==null?void 0:S.errorComponent,{shouldRender:R,containerRef:j}=bV({immediate:r});if(T.useEffect(()=>{if(R){if(!w){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),h(!0);let N=w.getMermaid(n),P=e.split("").reduce((W,me)=>(W<<5)-W+me.charCodeAt(0)|0,0),$=`mermaid-${Math.abs(P)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:ne}=await N.render($,e);p(ne),E(ne)}catch(N){if(!(x||g)){let P=N instanceof Error?N.message:"Failed to render Mermaid chart";c(P)}}finally{h(!1)}})()}},[e,n,v,R,w]),!(R||g||x))return d.jsx("div",{className:l("my-4 min-h-[200px]",t),ref:j});if(f&&!g&&!x)return d.jsx("div",{className:l("my-4 flex justify-center p-4",t),ref:j,children:d.jsxs("div",{className:l("flex items-center space-x-2 text-muted-foreground"),children:[d.jsx("div",{className:l("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),d.jsx("span",{className:l("text-sm"),children:"Loading diagram..."})]})});if(o&&!g&&!x){let N=()=>C(P=>P+1);return O?d.jsx("div",{ref:j,children:d.jsx(O,{chart:e,error:o,retry:N})}):d.jsxs("div",{className:l("rounded-md bg-red-50 p-4",t),ref:j,children:[d.jsxs("p",{className:l("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),d.jsxs("details",{className:l("mt-2"),children:[d.jsx("summary",{className:l("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),d.jsx("pre",{className:l("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let G=g||x;return d.jsx("div",{className:l("size-full",t),"data-streamdown":"mermaid",ref:j,children:d.jsx(WG,{className:l(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:d.jsx("div",{"aria-label":"Mermaid chart",className:l("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:G},role:"img"})})})};function L5({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?_u.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close full text",onClick:r,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),d.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[d.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:t}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}const QG=[/^(?: {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],XG=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,KG=/!?\[[^\]\n]+\]\([^)]+\)/,ZG=/`[^`\n]+`/,JG=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,eq=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,tq=/~~[^~\n]+~~/;function nq(e){const t=e.trim();return t?QG.some(n=>n.test(t))||XG.test(t)?!0:/[`[\]*_~!]/.test(t)?KG.test(t)||ZG.test(t)||JG.test(t)||eq.test(t)||tq.test(t):!1:!1}function pm(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function hu(e){return e?new Date(e).toLocaleString():"Time unavailable"}function I5(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 rq(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 O5(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function ba(e){switch(e){case"userMessage":return"timeline-kind-user";case"agentMessage":return"timeline-kind-agent";case"image":return"timeline-kind-action";case"contextCompaction":return"timeline-kind-action";case"commandExecution":return"timeline-kind-command";case"webSearch":return"timeline-kind-search";case"fileRead":return"timeline-kind-file-read";case"reasoning":return"timeline-kind-reasoning";case"agentToolCall":return"timeline-kind-agent-tool";case"skillToolCall":return"timeline-kind-skill-tool";case"toolCall":return"timeline-kind-action";case"plan":return"timeline-kind-plan";case"fileChange":return"timeline-kind-file";case"hook":return"timeline-kind-action";case"other":return"ui-status-neutral"}}function D5(e){switch(e){case"userMessage":return"User";case"agentMessage":return"Agent";case"image":return"Image";case"contextCompaction":return"Context";case"commandExecution":return"Command";case"webSearch":return"Web Search";case"fileRead":return"File Read";case"reasoning":return"Reasoning";case"agentToolCall":return"Agent";case"skillToolCall":return"Skill";case"toolCall":return"Tool";case"plan":return"Plan";case"fileChange":return"File Change";case"hook":return"Hook";case"other":return"Other"}}function aq(e){return e==="commandExecution"||e==="reasoning"}const pv=10,sq=10,y1=80;function xa(e){switch(e){case"userMessage":return"timeline-user";case"agentMessage":return"timeline-agent";case"image":return"timeline-action";case"contextCompaction":return"timeline-action";case"commandExecution":return"timeline-command";case"webSearch":return"timeline-search";case"fileRead":return"timeline-file-read";case"reasoning":return"timeline-reasoning";case"agentToolCall":return"timeline-agent-tool";case"skillToolCall":return"timeline-skill-tool";case"toolCall":return"timeline-action";case"plan":return"timeline-plan";case"fileChange":return"timeline-file-change";case"hook":return"timeline-action";case"other":return"timeline-other"}}function wr(e){switch(e){case"user":return"timeline-overlay-badge timeline-overlay-badge-user";case"agent":return"timeline-overlay-badge timeline-overlay-badge-agent";case"command":return"timeline-overlay-badge timeline-overlay-badge-command";case"search":return"timeline-overlay-badge timeline-overlay-badge-search";case"fileRead":return"timeline-overlay-badge timeline-overlay-badge-file-read";case"agentTool":return"timeline-overlay-badge timeline-overlay-badge-agent-tool";case"skillTool":return"timeline-overlay-badge timeline-overlay-badge-skill-tool";case"action":return"timeline-overlay-badge timeline-overlay-badge-action"}}function gv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3.5 5.25h9"}),d.jsx("path",{d:"M5 8h6"}),d.jsx("path",{d:"M6.5 10.75h3"})]})}function iq(e){var n;const t=e.replace(/\r\n/g,`
375
+ `).split(`
376
+ `);for(;t.length>1&&((n=t.at(-1))==null?void 0:n.trim())==="";)t.pop();return t}function bv(e){return e.replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function Ss(e){const t=iq(e);return t.length===1?{firstLine:t[0]??"",showGap:!1,isTruncated:!1}:{firstLine:t[0]??"",showGap:!0,isTruncated:!0}}function E1(e){const t=e.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!t)return null;const n=t[1]?bv(t[1]):null,r=bv(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 xv(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function lq(e){var l;if(!e)return[];const t=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let r=0,i=0;for(const o of e.matchAll(t)){const c=o.index??0;c>r&&(n.push({type:"text",key:`text-${i}`,text:e.slice(r,c)}),i+=1);const f=o[1],h=((l=o[2])==null?void 0:l.trim())??"";f==="PHOTO"&&h?n.push({type:"photo",key:`photo-${i}`,path:h}):f==="FILE"&&h?n.push({type:"file",key:`file-${i}`,path:h}):n.push({type:"text",key:`text-${i}`,text:o[0]}),i+=1,r=c+o[0].length}return r<e.length&&n.push({type:"text",key:`text-${i}`,text:e.slice(r)}),n}function j5(e,t=42){const n=e.trim();if(!n)return"";const r=n.match(/(, \+\d+ more.*)$/),i=(r==null?void 0:r[1])??"",l=i?n.slice(0,-i.length):n;if(l.length<=t)return`${l}${i}`;const c=l.replace(/\\/g,"/").split("/").filter(Boolean);if(c.length>1){const f=[];let h=i.length+4;for(let g=c.length-1;g>=0;g-=1){const p=c[g],x=h+p.length+(f.length>0?1:0);if(f.length>0&&x>t)break;f.unshift(p),h=x}if(f.length>0)return`.../${f.join("/")}${i}`}return`...${l.slice(-(t-i.length-3))}${i}`}function oq(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 uq(e){return e==="userMessage"||e==="agentMessage"}function cq(e){return e==="commandExecution"||e==="webSearch"||e==="fileRead"||e==="fileChange"||e==="image"||e==="contextCompaction"}function dq(e){return e==="agentMessage"||e==="reasoning"||e==="agentToolCall"||e==="skillToolCall"||e==="toolCall"||e==="plan"}function fq(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&&cq(n[c].kind);)c+=1;if(c===l+1)continue;const[f]=n.splice(l,1);n.splice(c-1,0,f),l=c-1}let i=!1;return n.map((l,o)=>l.kind!=="userMessage"?l:i?n.slice(o+1).some(f=>dq(f.kind))?l:{...l,status:"Awaiting response"}:(i=!0,l))}function sl(e){return typeof e.sequence=="number"&&Number.isFinite(e.sequence)}function Yf(e){return sl(e)?e.sequence:Number.POSITIVE_INFINITY}function yv(e){var h;const t=[];let n=0;for(;n<e.length&&((h=e[n])==null?void 0:h.kind)==="userMessage"&&!sl(e[n]);)t.push(e[n]),n+=1;const r=e.slice(n);if(!r.some(sl))return e;const i=r.map(g=>Yf(g)).filter(Number.isFinite),l=i.length>0?Math.max(...i):0,o=[];let c=0;for(;c<r.length;){const g=r[c];if(sl(g)){o.push({item:g,index:c,order:Yf(g)}),c+=1;continue}const p=c;for(;c<r.length&&!sl(r[c]);)c+=1;const x=r.slice(p,c),E=[...r.slice(0,p)].reverse().find(sl),v=r.slice(c).find(sl),C=E?Yf(E):null,S=v?Yf(v):null;x.forEach((w,O)=>{let R;if(C===null&&S!==null)R=S-(x.length-O)/(x.length+1);else if(C!==null&&S!==null&&S>C){const j=S-C;R=C+(O+1)/(x.length+1)*j}else R=l+1+O/(x.length+1);o.push({item:w,index:p+O,order:R})})}const f=o.sort((g,p)=>{const x=g.order-p.order;return x===0?g.index-p.index:x}).map(g=>g.item);return[...t,...f]}function hq(e,t){if(!t||t.length===0)return yv(e);const n=new Map(t.map(l=>[l.id,l])),r=e.map(l=>{const o=n.get(l.id);if(!o)return l;n.delete(l.id);const c={...l,...o,text:o.text||l.text},f=o.detailText??l.detailText,h=o.previewText??l.previewText,g=o.status??l.status,p=o.sequence??l.sequence;return f!==void 0&&(c.detailText=f),h!==void 0&&(c.previewText=h),g!==void 0&&(c.status=g),p!==void 0&&(c.sequence=p),c}),i=[...n.values()];return i.length===0&&!r.some(sl)||(r.push(...i),!r.some(l=>typeof l.sequence=="number"&&Number.isFinite(l.sequence)))?r:yv(r)}function na(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("running")||t.includes("inprogress")||t.includes("in_progress")}function Ph(e){return e==="inProgress"||e==="sending"}function bg(e,t=y1){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function mq(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 pq(e){var o,c;const t=[];let n=0;const r=new Set,i=[];function l(){const f=i.splice(0);for(const h of f)t.push({kind:"item",key:h.id,item:h})}for(;n<e.length;){const f=e[n];if(!f)break;if(r.has(f.id)){n+=1;continue}if(f.kind==="reasoning"){let p=n;for(;p<e.length&&((o=e[p])==null?void 0:o.kind)==="reasoning";)i.push(e[p]),p+=1;n=p;continue}if(f.kind==="agentMessage"){const p=i.splice(0);for(const x of p)r.add(x.id);t.push({kind:"item",key:f.id,item:p.length>0?{...f,reasoningItems:p}:f}),n+=1;continue}if(f.kind!=="commandExecution"&&f.kind!=="fileChange"&&f.kind!=="webSearch"&&f.kind!=="fileRead"){t.push({kind:"item",key:f.id,item:f}),n+=1;continue}const h=[];for(;n<e.length&&((c=e[n])==null?void 0:c.kind)===f.kind;)h.push(e[n]),n+=1;if(h.length===1){t.push({kind:"item",key:h[0].id,item:h[0]});continue}const g=h.map(p=>p.id).join(":");if(f.kind==="commandExecution"){t.push({kind:"commandGroup",key:g,items:h});continue}if(f.kind==="fileChange"){t.push({kind:"fileChangeGroup",key:g,items:h});continue}if(f.kind==="fileRead"){t.push({kind:"fileReadGroup",key:g,items:h});continue}t.push({kind:"searchGroup",key:g,items:h})}return l(),t}function Ev({kind:e}){return e==="userMessage"?d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 8a2.75 2.75 0 1 0 0-5.5A2.75 2.75 0 0 0 8 8Z"}),d.jsx("path",{d:"M3.5 13.25a4.5 4.5 0 0 1 9 0"})]}):d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"7.5",rx:"2"}),d.jsx("path",{d:"M5.5 6.75h.01M10.5 6.75h.01M6.5 12.25h3"}),d.jsx("path",{d:"M6 10.5v1.75M10 10.5v1.75"})]})}function _v(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"m4 5 2 2-2 2"}),d.jsx("path",{d:"M7.75 9.5h4.25"})]})}function _1(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.25 4.25 3.5 7l2.75 2.75"}),d.jsx("path",{d:"M9.75 4.25 12.5 7 9.75 9.75"}),d.jsx("path",{d:"M8.9 3.5 7.1 10.5"}),d.jsx("path",{d:"M3 12.25h10"})]})}function Tv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"6.5",rx:"2"}),d.jsx("path",{d:"M5.5 6.25h.01M10.5 6.25h.01"}),d.jsx("path",{d:"M6.25 11.25h3.5"}),d.jsx("path",{d:"M6 13h4"}),d.jsx("path",{d:"M5.25 9.5v1.75M10.75 9.5v1.75"})]})}function vv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5 3.25h6a1.5 1.5 0 0 1 1.5 1.5v6.5a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 0 1-1.5-1.5v-6.5A1.5 1.5 0 0 1 5 3.25Z"}),d.jsx("path",{d:"M6.25 6.25h3.5"}),d.jsx("path",{d:"M6.25 8.25h2.25"}),d.jsx("path",{d:"M10.75 8.5v2.25"}),d.jsx("path",{d:"M9.62 9.62h2.26"})]})}function kv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.25 4.5v4.25a2.75 2.75 0 1 0 2.75 2.75V7.25"}),d.jsx("path",{d:"M9 7.25a2.75 2.75 0 1 0-2.75-2.75"})]})}function wv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),d.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),d.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),d.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),d.jsx("path",{d:"M7.9 5.5h1.7"}),d.jsx("path",{d:"m7.75 8 1 1-1 1"}),d.jsx("path",{d:"M9.4 9h1.7"})]})}function Cv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"7",cy:"7",r:"3.75"}),d.jsx("path",{d:"m10.25 10.25 3 3"})]})}function Sv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),d.jsx("path",{d:"m8 8 1.6 1.6"}),d.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),d.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),d.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),d.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function Nv(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2.75",y:"3",width:"10.5",height:"9.5",rx:"1.5"}),d.jsx("circle",{cx:"6.1",cy:"6.1",r:"1.1"}),d.jsx("path",{d:"m4.5 10 2.2-2.2 1.9 1.9 1.1-1.1 1.8 1.8"})]})}function Bh(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),d.jsx("path",{d:"M9 2.75v2h2"}),d.jsx("path",{d:"M6.2 8h3.6"}),d.jsx("path",{d:"M6.2 10h1.7"})]})}function Uh(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),d.jsx("path",{d:"M9 2.75v2h2"}),d.jsx("path",{d:"M6.15 7.25h3.7"}),d.jsx("path",{d:"M6.15 9.25h2.8"}),d.jsx("path",{d:"m10.4 10.7 1.2 1.2"}),d.jsx("circle",{cx:"9.25",cy:"9.55",r:"1.45"})]})}function gq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M4.25 4.75h7.5"}),d.jsx("path",{d:"M4.25 8h7.5"}),d.jsx("path",{d:"M4.25 11.25h4.5"}),d.jsx("path",{d:"M2.25 4.75h.01M2.25 8h.01M2.25 11.25h.01"})]})}function bq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.55 3.05a2.15 2.15 0 0 0-3.3 1.8 2.05 2.05 0 0 0 .28 1.03A2.25 2.25 0 0 0 3 9.77a2.2 2.2 0 0 0 2.14 2.73h1.41V3.05Z"}),d.jsx("path",{d:"M9.45 3.05a2.15 2.15 0 0 1 3.3 1.8 2.05 2.05 0 0 1-.28 1.03A2.25 2.25 0 0 1 13 9.77a2.2 2.2 0 0 1-2.14 2.73H9.45V3.05Z"}),d.jsx("path",{d:"M5.1 6.55h1.45"}),d.jsx("path",{d:"M9.45 6.55h1.45"}),d.jsx("path",{d:"M6.55 9.15H5.1"}),d.jsx("path",{d:"M9.45 9.15h1.45"})]})}function M5(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z"})})}function xq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"5.25",y:"3.25",width:"7.5",height:"9",rx:"1.5"}),d.jsx("path",{d:"M10.75 12.75H4.5a1.25 1.25 0 0 1-1.25-1.25V4.75A1.25 1.25 0 0 1 4.5 3.5h.75"})]})}function cr({tone:e="amber"}){const t=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return d.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>d.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${t}`,style:{animationDelay:`${n*180}ms`}},n))})}function T1(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 yq(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!na(e.status);default:return!1}}function Eq(e,t,n){if(!e||!Ph(n))return e;const r=e.plan.findIndex(c=>T1(c.status)==="in_progress");if(r<0)return e;const i=e.plan.findIndex((c,f)=>f>r&&T1(c.status)==="pending");if(i<0||!t.some(c=>yq(c)))return e;const o=e.plan.map((c,f)=>f===r?{...c,status:"completed"}:f===i?{...c,status:"in_progress"}:c);return{...e,plan:o}}function _q(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),d.jsx("path",{d:"M8 5.25v2.9l2.05 1.2"})]})}function Tq({status:e}){const t=T1(e),n=t==="completed"?"Plan step status: Completed":t==="in_progress"?"Plan step status: In progress":t==="pending"?"Plan step status: Pending":t==="failed"?"Plan step status: Failed":`Plan step status: ${e}`,r=t==="completed"?"ui-status-success":t==="in_progress"?"ui-status-info":t==="pending"?"border-stone-700/90 bg-stone-900/80 text-stone-300":t==="failed"?"border-rose-300/30 bg-rose-300/10 text-rose-100":"border-stone-700/90 bg-stone-900/80 text-stone-300";return d.jsx("span",{"aria-label":n,title:n.replace("Plan step status: ",""),className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border ${r}`,children:t==="completed"?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):t==="in_progress"?d.jsx(cr,{tone:"sky"}):t==="pending"?d.jsx(_q,{}):t==="failed"?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})}):d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function Av({status:e}){const t=O5(e);return e==="completed"?d.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?d.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?d.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):d.jsx("span",{"aria-label":t,title:t,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:d.jsx(cr,{tone:"emerald"})})}function Rv({turn:e,variant:t="header"}){const n=O5(e.status),r=Rq(e),i=Nq(e),l=B5(e),o=Ph(e.status),c=e.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":o?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(t==="footer")return d.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${c}`,children:[d.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Av,{status:e.status}),d.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:r})]}),e.startedAt&&d.jsx("time",{dateTime:e.startedAt,title:hu(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:pm(e.startedAt)})]}),(l||i.length>0)&&d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[l?d.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${l.className}`,title:l.title,children:l.label}):null,i.map(h=>d.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${h.className}`,title:h.title,children:[h.icon?d.jsx("span",{className:"mr-1",children:h.icon}):null,h.label]},h.id))]})]});const f=`${n} · ${r}`;return d.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${c}`,title:f,children:[d.jsx(Av,{status:e.status}),d.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:r})]})}function vq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 2.75v8"}),d.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function kq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 13.25v-8"}),d.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function wq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),d.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),d.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),d.jsx("path",{d:"M3.25 5.25v5.5"}),d.jsx("path",{d:"M12.75 5.25v5.5"})]})}function Cq(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),d.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),d.jsx("path",{d:"M8 5.5v4.75"}),d.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function Wf(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 Bc(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Qf(e,t,n){const r=e??null;return!Number.isFinite(r??NaN)||r===null||t<=0||n<=0?null:r*n/t}function P5(e){var c,f,h,g,p;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:Wf(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?Bc(e.priceEstimate.inputUsd):"--",usdRawValue:((f=e.priceEstimate)==null?void 0:f.inputUsd)??null,className:"token-badge-in",icon:d.jsx(vq,{})}:null,r>0?{id:"cache",label:"Cached input",tokenCompactValue:Wf(r),tokenRawValue:r,usdCompactValue:e.priceEstimate?Bc(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((h=e.priceEstimate)==null?void 0:h.cachedInputUsd)??null,className:"token-badge-cache",icon:d.jsx(wq,{})}:null,l>0?{id:"out",label:"Output",tokenCompactValue:Wf(l),tokenRawValue:l,usdCompactValue:e.priceEstimate?Bc(Qf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),l)??0):"--",usdRawValue:Qf((g=e.priceEstimate)==null?void 0:g.outputUsd,Math.max(t.outputTokens,0),l),className:"token-badge-out",icon:d.jsx(kq,{})}:null,i>0?{id:"reason",label:"Reasoning",tokenCompactValue:Wf(i),tokenRawValue:i,usdCompactValue:e.priceEstimate?Bc(Qf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),i)??0):"--",usdRawValue:Qf((p=e.priceEstimate)==null?void 0:p.outputUsd,Math.max(t.outputTokens,0),i),className:"token-badge-reason",icon:d.jsx(Cq,{})}:null].filter(x=>x!==null)}function Nq(e){return P5(e).map(t=>({id:t.id,label:t.tokenCompactValue,title:`${t.label}: ${t.tokenRawValue} tokens`,className:t.className,icon:t.icon}))}function B5(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: ${Bc(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}const xg="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 Aq({turn:e}){const t=P5(e),n=B5(e),[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,f]=T.useState(0),h=T.useRef(null),g=T.useRef(null),p=T.useRef(null);if(T.useLayoutEffect(()=>{if(!r||t.length===0){f(0);return}const E=()=>{const v=h.current,C=p.current;if(!v||!C)return;const S=v.getBoundingClientRect(),w=C.offsetWidth||C.getBoundingClientRect().width;if(w<=0)return;const O=window.innerWidth||document.documentElement.clientWidth,R=12,j=S.left+S.width/2-w/2,G=R,N=Math.max(G,O-R-w),P=Math.min(Math.max(j,G),N);f(Math.round(P-j))};return E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[t.length,r]),T.useEffect(()=>{if(!r&&!l)return;const E=v=>{v.target instanceof Node&&(h.current&&!h.current.contains(v.target)&&i(!1),g.current&&!g.current.contains(v.target)&&o(!1))};return document.addEventListener("pointerdown",E),()=>{document.removeEventListener("pointerdown",E)}},[l,r]),!n&&t.length===0)return null;const x=()=>d.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:d.jsx("div",{className:"space-y-1",children:t.map(E=>d.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${E.label}: ${E.tokenRawValue} tokens`,children:[d.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"inline-flex shrink-0",children:E.icon}),d.jsx("span",{className:"thread-token-popover-strong font-medium",children:E.usdCompactValue})]}),d.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:E.tokenCompactValue})]},E.id))})});return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?d.jsxs("div",{ref:g,className:"relative shrink-0",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[d.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":l,onFocus:()=>o(!0),onBlur:()=>o(!1),className:`${xg} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),l&&t.length>0?d.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:x()}):null]}):null,t.map(E=>d.jsxs("span",{className:`${xg} ${E.className}`,title:`${E.label}: ${E.usdCompactValue}, ${E.tokenRawValue} tokens`,children:[E.icon,d.jsx("span",{className:"font-medium text-stone-100",children:E.tokenCompactValue})]},E.id))]}),d.jsxs("div",{ref:h,className:"relative shrink-0 md:hidden",children:[n?d.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":r,onClick:()=>i(E=>!E),className:`${xg} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,r&&t.length>0?d.jsx("div",{ref:p,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${c}px) translateX(-50%)`},children:x()}):null]})]})}function Rq(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 Lq({text:e,className:t="agent-markdown"}){return d.jsx(A5,{mode:"static",plugins:{code:tD},controls:!1,lineNumbers:!1,remarkPlugins:Oq,className:t,children:e})}function Iq(){return e=>{U5(e)}}const Oq=[...Object.values(w5),Iq];function U5(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(`
377
+ `)){n.value.split(`
378
+ `).forEach((i,l)=>{l>0&&t.push({type:"break"}),i&&t.push({...n,value:i})});continue}U5(n),t.push(n)}e.children=t}const Dq=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,jq=/[),.;:!?]+$/;function Mq(e){return e.startsWith("www.")?`https://${e}`:e}function ld({text:e}){var r;const t=[];let n=0;for(const i of e.matchAll(Dq)){const l=i[0],o=i.index??0,c=((r=l.match(jq))==null?void 0:r[0])??"",f=c?l.slice(0,-c.length):l;f&&(o>n&&t.push(e.slice(n,o)),t.push(d.jsx("a",{href:Mq(f),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:f},`${o}-${f}`)),c&&t.push(c),n=o+l.length)}return n<e.length&&t.push(e.slice(n)),d.jsx(d.Fragment,{children:t.length>0?t:e})}function H5({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=nq(e),[f,h]=T.useState(n||typeof IntersectionObserver>"u");return T.useEffect(()=>{if(n||typeof IntersectionObserver>"u"){h(!0);return}if(f||!o.current)return;const g=new IntersectionObserver(p=>{for(const x of p)if(x.isIntersecting){h(!0),g.disconnect();break}},{root:t.current,threshold:0});return g.observe(o.current),()=>{g.disconnect()}},[f,t,n]),d.jsx("div",{ref:o,className:r,children:f&&c?d.jsx(Lq,{text:e,className:l}):d.jsx("p",{className:i,children:d.jsx(ld,{text:e})})})}function Pq({text:e,scrollRootRef:t,streaming:n=!1}){return d.jsx(H5,{text:e,scrollRootRef:t,streaming:n,containerClassName:"thread-message-prose"})}function Bq({threadId:e,text:t}){const n=T.useMemo(()=>lq(t),[t]);return d.jsx("div",{className:"thread-message-prose whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-300",children:n.map(r=>{if(r.type==="text")return d.jsx("span",{children:r.text},r.key);if(r.type==="photo"){const l=e?`/api/threads/${e}/assets/image?path=${encodeURIComponent(r.path)}`:null,o=xv(r.path)||"Attached image";return d.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:d.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[l?d.jsx("img",{src:l,alt:o,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):d.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),d.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:r.path,children:o})]})},r.key)}const i=xv(r.path)||"Attached file";return d.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:d.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:r.path,children:[d.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),d.jsx("span",{className:"min-w-0 truncate",children:i})]})},r.key)})})}function gm(e){return e==="completed"?"timeline-command-status-complete":"timeline-command-status-pending"}function bm({status:e}){return e==="completed"?d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):d.jsx(cr,{tone:"emerald"})}const Xc=T.memo(function({threadId:t,item:n,scrollRootRef:r,streaming:i=!1}){const[l,o]=T.useState("idle"),[c,f]=T.useState(!1),h=T.useRef(null),g=n.kind==="agentMessage"?n.reasoningItems??[]:[],p=g.map(S=>S.text.trim()).filter(Boolean).join(`
379
+
380
+ `),x=n.kind==="userMessage"?"thread-message-icon thread-message-icon-user":"thread-message-icon thread-message-icon-agent",E=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response"),v=n.status==="Steering"?"ui-status-warning":n.status==="Accepted"?"ui-status-success":"ui-status-info";T.useEffect(()=>()=>{h.current!==null&&window.clearTimeout(h.current)},[]);async function C(){try{await navigator.clipboard.writeText(n.text),o("copied"),h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>o("idle"),1200)}catch{o("failed"),h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>o("idle"),1600)}}return d.jsxs("div",{className:`timeline-item-frame ${n.kind==="agentMessage"?"timeline-has-corner-copy":""} relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(n.kind)} ${xa(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[E&&d.jsxs("span",{className:`absolute right-2.5 top-2.5 z-[1] inline-flex items-center gap-1 rounded-full border px-2 py-1 text-[10px] font-medium tracking-[0.12em] shadow-sm shadow-stone-950/20 ${v}`,children:[d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3.25 8A4.75 4.75 0 0 1 8 3.25h2.75"}),d.jsx("path",{d:"m9.5 1.75 1.75 1.5-1.75 1.5"}),d.jsx("path",{d:"M12.75 8A4.75 4.75 0 0 1 8 12.75H5.25"}),d.jsx("path",{d:"m6.5 14.25-1.75-1.5 1.75-1.5"})]}),d.jsx("span",{children:n.status})]}),d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${x}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Ev,{kind:n.kind})})}),d.jsxs("div",{className:"timeline-message-content timeline-mobile-bubble-content flex min-w-0 items-start gap-0 pt-2 sm:gap-2.5 sm:pt-0",children:[d.jsxs("div",{className:"hidden",children:[d.jsx("span",{className:`hidden h-6 w-6 items-center justify-center rounded-full border sm:inline-flex ${x}`,children:d.jsx(Ev,{kind:n.kind})}),i&&n.kind==="agentMessage"&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(cr,{tone:"emerald"})})]}),d.jsxs("div",{className:"min-w-0 flex-1",children:[n.kind==="agentMessage"?d.jsxs(d.Fragment,{children:[p?d.jsxs("div",{className:"timeline-attached-reasoning mb-2",children:[d.jsxs("button",{type:"button","aria-expanded":c,onClick:()=>f(S=>!S),className:"timeline-attached-reasoning-toggle",children:[d.jsx("span",{"aria-hidden":"true",className:"timeline-attached-reasoning-chevron inline-flex h-5 w-5 items-center justify-center rounded-full",children:d.jsx("svg",{viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-none stroke-current transition ${c?"rotate-90":""}`,strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m6 4.75 3.25 3.25L6 11.25"})})}),d.jsx("span",{"aria-hidden":"true",className:"timeline-attached-reasoning-icon inline-flex h-5 w-5 items-center justify-center rounded-full",children:d.jsx(bq,{})}),d.jsx("span",{className:"timeline-attached-reasoning-label",children:"Thinking"}),g.some(S=>na(S.status))?d.jsx(cr,{tone:"sky"}):null]}),c?d.jsx("pre",{className:"timeline-attached-reasoning-body mt-1.5 max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-[0.7rem] px-3 py-2 text-[12px] leading-5",children:d.jsx(ld,{text:p})}):null]}):null,d.jsx(Pq,{text:n.text,scrollRootRef:r,streaming:i})]}):d.jsx(Bq,{threadId:t,text:n.text}),n.status&&!E&&d.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]}),i&&n.kind==="agentMessage"&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(cr,{tone:"emerald"})}),n.kind==="agentMessage"&&d.jsx("button",{type:"button","aria-label":"Copy agent reply",title:l==="copied"?"Copied":l==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void C(),className:"timeline-corner-copy absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center transition",children:d.jsx("span",{className:`timeline-corner-copy-visual inline-flex items-center justify-center border shadow-sm shadow-stone-950/25 backdrop-blur transition ${l==="copied"?"ui-status-info":l==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:d.jsx(xq,{})})})]})}),Uq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.previewText??t.text);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("command")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(_v,{})})}),na(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(cr,{})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-amber-300/25 bg-amber-300/10 text-amber-200",children:d.jsx(_v,{})}),na(t.status)&&d.jsx(cr,{})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Command status: ${t.status}`:"Command status",title:t.status??"Command status",onClick:()=>n(t,"Command Output"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${gm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(bm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open full command",onClick:()=>n(t,"Command Output"),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Hq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(_1,{})})}),na(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(cr,{})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-100",children:d.jsx(_1,{})}),na(t.status)&&d.jsx(cr,{})]}),d.jsxs("div",{className:"timeline-item-inner relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Tool status: ${t.status}`:"Tool status",title:t.status??"Tool status",onClick:()=>n(t,"Tool Call Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${gm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(bm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open full tool call",onClick:()=>n(t,"Tool Call Details"),className:"block w-full text-left",children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Fq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("agentTool")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Tv,{})})}),na(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(cr,{tone:"emerald"})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:d.jsx(Tv,{})}),na(t.status)&&d.jsx(cr,{tone:"emerald"})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Agent status: ${t.status}`:"Agent status",title:t.status??"Agent status",onClick:()=>n(t,"Agent Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${gm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(bm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open agent details",onClick:()=>n(t,"Agent Details"),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),zq=T.memo(function({item:t,onOpen:n}){const r=Ss(t.text);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("skillTool")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(vv,{})})}),na(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(cr,{tone:"sky"})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:d.jsx(vv,{})}),na(t.status)&&d.jsx(cr,{tone:"sky"})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":t.status?`Skill status: ${t.status}`:"Skill status",title:t.status??"Skill status",onClick:()=>n(t,"Skill Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${gm(t.status)} hover:brightness-110`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(bm,{status:t.status})})}),d.jsx("button",{type:"button","aria-label":"Open skill details",onClick:()=>n(t,"Skill Details"),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),$q=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.filter(c=>na(c.status)).length,o=t.length===1?"1 command":`${t.length} commands`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-warning px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("command")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(wv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-amber-300/30 bg-amber-300/[0.14] text-amber-100 shadow-sm shadow-stone-950/20",children:[d.jsx(wv,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-amber-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-amber-100",children:t.length})]}),l>0&&d.jsx(cr,{})]}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} command entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:o}),l>0&&d.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:d.jsx(cr,{})})]})}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-amber-300/12 pt-3 sm:space-y-2",children:t.map((c,f)=>{const h=Ss(c.text);return d.jsxs("button",{type:"button","aria-label":`Open grouped command ${f+1}`,onClick:()=>i(c,`Command Output ${f+1}`),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",f+1]}),c.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:c.status})]}),d.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},c.id)})})]})]})]})}),Vq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 search":`${t.length} searches`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-info px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Sv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-sky-300/30 bg-sky-300/[0.14] text-sky-100 shadow-sm shadow-stone-950/20",children:[d.jsx(Sv,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-sky-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-sky-100",children:t.length})]})}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} web search entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-sky-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var p,x;const f=((p=o.previewText)==null?void 0:p.trim())||o.text||"Web search",h=Ss(f),g=((x=o.detailText)==null?void 0:x.trim())||o.text||"Web search";return d.jsxs("button",{type:"button","aria-label":`Open grouped web search ${c+1}`,onClick:()=>i(`Web Search ${c+1}`,g),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",c+1]}),o.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),d.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),Gq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 file read":`${t.length} file reads`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file-read relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-file-read px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("fileRead")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Uh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-cyan-300/30 bg-cyan-300/[0.14] text-cyan-100 shadow-sm shadow-stone-950/20",children:[d.jsx(Uh,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-cyan-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-cyan-100",children:t.length})]})}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file read entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-cyan-300/28 bg-cyan-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-cyan-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-cyan-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var p,x;const f=((p=o.previewText)==null?void 0:p.trim())||o.text||"File read",h=Ss(f),g=((x=o.detailText)==null?void 0:x.trim())||o.text||"File read";return d.jsxs("button",{type:"button","aria-label":`Open grouped file read ${c+1}`,onClick:()=>i(`File Read ${c+1}`,g),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-full border border-cyan-300/18 bg-cyan-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-cyan-100",children:["Read ",c+1]}),o.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),d.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),qq=T.memo(function({item:t,scrollRootRef:n}){return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(gq,{})})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("span",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:D5(t.kind)}),t.status&&d.jsx("span",{className:"timeline-meta-text text-xs",children:t.status})]}),d.jsx("div",{className:"mt-1.5",children:d.jsx(H5,{text:t.text,scrollRootRef:n,plainTextClassName:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-300",markdownClassName:"agent-markdown text-sm"})})]})}),Yq=T.memo(function({item:t}){const n=na(t.status)||t.text==="Compacting context",r=n?"Compacting context":"Context compacted",i=t.detailText&&t.detailText!==r?t.detailText:null;return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:"absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border border-teal-300/30 bg-teal-300/12 text-[10px] text-teal-100 shadow-sm shadow-stone-950/20 sm:hidden",children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(gv,{})})}),d.jsxs("div",{className:"flex min-w-0 items-center gap-2 pt-2 sm:pt-0",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:d.jsx(gv,{})})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("p",{className:"timeline-primary-text truncate text-[13px] font-medium sm:text-sm",children:r}),n?d.jsx(cr,{tone:"emerald"}):null]}),i?d.jsx("p",{className:"timeline-meta-text mt-0.5 truncate text-[11px] sm:text-xs",title:i,children:i}):null]})]})]})}),Wq=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"Web search",i=((c=t.detailText)==null?void 0:c.trim())||t.text||"Web search",l=Ss(r);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Cv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-sky-300/25 bg-sky-300/10 text-sky-100",children:d.jsx(Cv,{})})}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":"Expand web search",title:"Expand web search",onClick:()=>n("Web Search Details",i),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${wr("action")} hover:bg-stone-800`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(M5,{})})}),t.status&&d.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),d.jsx("button",{type:"button","aria-label":"Open full web search",onClick:()=>n("Web Search Details",i),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Qq=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"File read",i=((c=t.detailText)==null?void 0:c.trim())||t.text||"File read",l=Ss(r);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file-read relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("fileRead")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Uh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-cyan-300/25 bg-cyan-300/10 text-cyan-100",children:d.jsx(Uh,{})})}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsx("button",{type:"button","aria-label":"Expand file read",title:"Expand file read",onClick:()=>n("File Read Details",i),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${wr("action")} hover:bg-stone-800`,children:d.jsx("span",{className:"scale-[0.72] sm:scale-100",children:d.jsx(M5,{})})}),t.status&&d.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),d.jsx("button",{type:"button","aria-label":"Open full file read",onClick:()=>n("File Read Details",i),className:"block w-full text-left",children:d.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Xq=T.memo(function({threadId:t,item:n,onOpen:r}){const i=n.assetPath??n.detailText??null,l=t&&i?`/api/threads/${t}/assets/image?path=${encodeURIComponent(i)}`:null;return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(n.kind)} ${xa(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("search")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Nv,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:d.jsx(Nv,{})})}),d.jsxs("div",{className:"min-w-0 w-full flex-1",children:[l?d.jsx("button",{type:"button",onClick:()=>r("Image Path",i??n.text),className:"block w-full text-left",children:d.jsx("img",{src:l,alt:n.text||"Image preview",className:"max-h-[24rem] w-full rounded-xl border border-stone-700/80 bg-stone-950 object-contain",loading:"lazy"})}):d.jsx("div",{className:"timeline-item-inner rounded-xl border px-3 py-3 text-sm",children:n.text}),i&&d.jsx("button",{type:"button",onClick:()=>r("Image Path",i),className:"timeline-meta-text mt-2 block max-w-full truncate text-left text-xs hover:text-[var(--theme-fg)]",title:i,children:i}),n.status&&d.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]})]})}),Kq=T.memo(function({item:t,onOpen:n}){var f,h,g;const r=(f=t.previewText)!=null&&f.trim()&&t.text.trim()!==t.previewText.trim()?t.text.trim():null,i=((h=t.detailText)==null?void 0:h.trim())||null,l=j5(r??((g=t.previewText)==null?void 0:g.trim())??t.text,48),o=oq(t),c=i?"button":"div";return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Bh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-lime-300/25 bg-lime-300/10 text-lime-100",children:d.jsx(Bh,{})})}),d.jsx(c,{...i?{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",i)}:{},className:`timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2.5 py-2 text-left sm:rounded-xl sm:px-3 ${i?"transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]":""}`,children:d.jsxs("div",{className:"timeline-mobile-file-line flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:r??l,children:l}),o.length>0&&d.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:o.map(p=>d.jsx("span",{className:`timeline-delta-badge border ${p.startsWith("+")?"timeline-delta-badge-add text-emerald-300":p.startsWith("-")?"timeline-delta-badge-remove text-rose-300":"timeline-delta-badge-neutral"}`,children:p},p))})]})})]})]})}),Zq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.reduce((h,g)=>h+(g.changedFiles??0),0),o=t.reduce((h,g)=>h+(g.addedLines??0),0),c=t.reduce((h,g)=>h+(g.removedLines??0),0),f=t.length===1?"1 file change":`${t.length} file changes`;return d.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-success px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(Bh,{})})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:d.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-lime-300/30 bg-lime-300/[0.14] text-lime-100 shadow-sm shadow-stone-950/20",children:[d.jsx(Bh,{}),d.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-lime-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-lime-100",children:t.length})]})}),d.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file change entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[d.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[d.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),d.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:f}),l>0&&d.jsxs("span",{className:"timeline-meta-text text-xs",children:[l," files"]})]}),d.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[o>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",o]}),c>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",c]})]})]}),n&&d.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-lime-300/12 pt-3 sm:space-y-2",children:t.map((h,g)=>{var E,v,C,S;const p=((E=h.detailText)==null?void 0:E.trim())||((v=h.previewText)==null?void 0:v.trim())||h.text,x=(C=h.previewText)!=null&&C.trim()&&h.text.trim()!==h.previewText.trim()?h.text.trim():((S=h.previewText)==null?void 0:S.trim())||h.text;return d.jsx("button",{type:"button","aria-label":`Open grouped file change ${g+1}`,onClick:()=>i(`File Change ${g+1}`,p),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 text-sm leading-6",title:x,children:j5(x,34)}),d.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(h.addedLines??0)>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",h.addedLines]}),(h.removedLines??0)>0&&d.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",h.removedLines]})]})]})},h.id)})})]})]})]})}),Jq=T.memo(function({item:t}){return d.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(_1,{})})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[d.jsx("span",{className:"timeline-meta-text text-[10px] uppercase tracking-[0.16em]",children:D5(t.kind)}),t.status&&d.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),d.jsx("pre",{className:`timeline-soft-text mt-1 whitespace-pre-wrap break-words text-[13px] leading-5 ${aq(t.kind)?"max-h-56 overflow-auto":""}`,children:d.jsx(ld,{text:t.text})})]})}),eY=T.memo(function({item:t}){var f,h;const n=((f=t.hookOutputEntries)==null?void 0:f.map(g=>g.text.trim()).filter(Boolean).join(`
381
+ `).trim())??"",r=t.hookEventLabel?`${t.hookEventLabel} hook`:t.text,i=((h=t.hookStatusMessage)==null?void 0:h.trim())||(t.previewText&&t.previewText!==t.hookStatusMessage?t.previewText.trim():"")||t.text.trim(),o=Ss(n||(i&&i!==r?i:r)),c=!!(n&&o.showGap);return d.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${ba(t.kind)} ${xa(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[d.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${wr("action")}`,children:d.jsx("span",{className:"scale-[0.78]",children:d.jsx(kv,{})})}),na(t.status)&&d.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:d.jsx(cr,{})}),d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[d.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-200",children:d.jsx(kv,{})}),na(t.status)&&d.jsx(cr,{})]}),d.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[d.jsxs("span",{className:"timeline-meta-text min-w-0 truncate text-[10px] uppercase tracking-[0.16em]",children:["Hook · ",t.hookEventLabel??t.text]}),t.status&&d.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),d.jsxs("div",{className:"timeline-mobile-dense-line mt-1.5 flex min-w-0 items-center gap-2 text-sm leading-6",children:[d.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"timeline-meta-text mr-2 font-sans text-[11px] uppercase tracking-[0.12em]",children:r}),d.jsx(ld,{text:o.firstLine})]}):d.jsx(ld,{text:o.firstLine&&o.firstLine!==r?`${r} · ${o.firstLine}`:r})}),c?d.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]})]})]})}),Hh=T.memo(function({threadId:t,item:n,scrollRootRef:r,onOpenExpandedText:i,onOpenCommandDetail:l,onOpenToolCallDetail:o}){return uq(n.kind)?d.jsx(Xc,{threadId:t,item:n,scrollRootRef:r}):n.kind==="commandExecution"?d.jsx(Uq,{item:n,onOpen:l}):n.kind==="toolCall"?d.jsx(Hq,{item:n,onOpen:o}):n.kind==="agentToolCall"?d.jsx(Fq,{item:n,onOpen:o}):n.kind==="skillToolCall"?d.jsx(zq,{item:n,onOpen:o}):n.kind==="webSearch"?d.jsx(Wq,{item:n,onOpen:i}):n.kind==="fileRead"?d.jsx(Qq,{item:n,onOpen:i}):n.kind==="image"?d.jsx(Xq,{threadId:t,item:n,onOpen:i}):n.kind==="plan"?d.jsx(qq,{item:n,scrollRootRef:r}):n.kind==="fileChange"?d.jsx(Kq,{item:n,onOpen:i}):n.kind==="contextCompaction"?d.jsx(Yq,{item:n}):n.kind==="hook"?d.jsx(eY,{item:n}):d.jsx(Jq,{item:n})});function Xf({request:e,busy:t=!1,onRespond:n}){const[r,i]=T.useState({}),[l,o]=T.useState({}),[c,f]=T.useState(null),h=e.questions[0]??null,g="__other__",p=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function x(w){const O=/\s*\(recommended\)\s*$/i.test(w);return{rawLabel:w,displayLabel:w.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:O}}function E(w){h&&(f(w),n==null||n(e.id,{answers:{[h.id]:{answers:[w]}}}))}function v(w){const O=r[w.id]??"";return Array.isArray(O)?O.map(R=>R===g?(l[w.id]??"").trim():R.trim()).filter(Boolean).join(", "):O===g?(l[w.id]??"").trim():O.trim()}function C(w){const O=r[w.id]??"";if(Array.isArray(O))return O.map(j=>j===g?(l[w.id]??"").trim():j.trim()).filter(Boolean);if(O===g){const j=(l[w.id]??"").trim();return j?[j]:[]}const R=O.trim();return R?[R]:[]}function S(w,O){i(R=>{const j=R[w],G=Array.isArray(j)?j:[],N=G.includes(O)?G.filter(P=>P!==O):[...G,O];return{...R,[w]:N}})}return d.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[d.jsx("div",{className:"flex items-center justify-between gap-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:p}),e.kind!=="planDecision"&&e.description&&d.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),d.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(w=>d.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[d.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:w.header}),d.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:w.question}),e.kind==="planDecision"&&w.options&&w.options.length>0?d.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:w.options.map((O,R)=>{const j=x(O.label),G=j.displayLabel.toLowerCase()==="implement";return d.jsxs("button",{type:"button",disabled:t,onClick:()=>E(O.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${R===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:O.description,children:[j.recommended?d.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,t&&c===O.label?G?"Starting...":"Saving...":j.displayLabel]},O.label)})}):w.options&&w.options.length>0?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[w.options.map(O=>{const R=x(O.label),j=r[w.id];return d.jsxs("button",{type:"button",disabled:t,onClick:()=>w.multiSelect?S(w.id,O.label):i(G=>({...G,[w.id]:O.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${(w.multiSelect?Array.isArray(j)&&j.includes(O.label):j===O.label)?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:O.description,children:[R.recommended?d.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,R.displayLabel]},O.label)}),w.isOther&&(()=>{const O=r[w.id];return d.jsx("button",{type:"button",disabled:t,onClick:()=>w.multiSelect?S(w.id,g):i(R=>({...R,[w.id]:g})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${(w.multiSelect?Array.isArray(O)&&O.includes(g):O===g)?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})})()]}),w.isOther&&(()=>{const O=r[w.id];return(w.multiSelect?Array.isArray(O)&&O.includes(g):O===g)?d.jsx("input",{"aria-label":`${w.header} custom answer`,value:l[w.id]??"",onChange:j=>o(G=>({...G,[w.id]:j.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"}):null})()]}):d.jsx("input",{"aria-label":w.header,value:r[w.id]??"",onChange:O=>i(R=>({...R,[w.id]:O.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},w.id))}),e.kind!=="planDecision"&&d.jsx("div",{className:"mt-3 flex justify-end",children:d.jsx("button",{type:"button",disabled:t||e.questions.some(w=>!v(w)),onClick:()=>void(n==null?void 0:n(e.id,{answers:Object.fromEntries(e.questions.map(w=>[w.id,{answers:C(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 Kf({note:e}){return d.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[d.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),d.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((t,n)=>d.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",t]},`${e.id}-${n}`))})]})}function tu({note:e,onOpenThread:t}){const n=e.kind==="forkCreated"?"Fork":e.kind==="forkSource"?"Fork source":"System",r=e.kind==="forkCreated"?`Thread forked from Turn ${e.turnIndex??"?"}`:e.kind==="forkSource"?`Forked from ${e.linkedThreadTitle??"source thread"} at Turn ${e.turnIndex??"?"}`:e.text??"";return d.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:n}),d.jsx("time",{dateTime:e.createdAt,title:hu(e.createdAt),className:"timeline-meta-text text-[10px]",children:pm(e.createdAt)})]}),d.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:r}),e.linkedThreadId?d.jsx("button",{type:"button",onClick:()=>{if(t){t(e.linkedThreadId);return}typeof window<"u"&&window.location.assign(`/threads/${e.linkedThreadId}`)},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:e.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}const Lv=T.memo(function({threadId:t,turn:n,absoluteIndex:r,isCollapsed:i,livePlan:l,liveItems:o,liveOutput:c,onToggleCollapse:f,onOpenExpandedText:h,onOpenCommandDetail:g,onOpenToolCallDetail:p,scrollRootRef:x,articleRef:E}){const v=T.useMemo(()=>hq(n.items,o),[o,n.items]),C=T.useMemo(()=>Eq(l,v,n.status),[l,v,n.status]),S=T.useMemo(()=>fq(v,Ph(n.status)),[v,n.status]),w=T.useMemo(()=>pq(S),[S]),O=c,R=T.useMemo(()=>E1(O),[O]),[j,G]=T.useState({}),N=T.useCallback(P=>{G($=>({...$,[P]:!$[P]}))},[]);return d.jsxs("article",{ref:E,className:"px-2 py-1.5 sm:px-6 sm:py-2",children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[d.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[d.jsxs("span",{className:"timeline-meta-text rounded-[0.6rem] border border-stone-700 px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",r]}),d.jsx("time",{dateTime:n.startedAt??void 0,title:hu(n.startedAt),className:"timeline-meta-text shrink-0 text-[10px] sm:text-[11px]",children:pm(n.startedAt)}),d.jsx(Rv,{turn:n}),n.error&&d.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:n.error})]}),d.jsx(Aq,{turn:n})]}),d.jsx("button",{type:"button","aria-label":`${i?"Expand":"Collapse"} turn ${r}`,title:i?"Expand turn":"Collapse turn",onClick:()=>f(n.id),className:"timeline-compact-action timeline-meta-text inline-flex h-5 w-5 shrink-0 items-center justify-center transition hover:text-[var(--theme-fg)]",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:i?d.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):d.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),n.error&&d.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:n.error}),!i&&d.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[w.map(P=>P.kind==="commandGroup"?d.jsx($q,{items:P.items,expanded:j[P.key]??!1,onToggleExpanded:()=>N(P.key),onOpen:g},P.key):P.kind==="fileChangeGroup"?d.jsx(Zq,{items:P.items,expanded:j[P.key]??!1,onToggleExpanded:()=>N(P.key),onOpen:h},P.key):P.kind==="searchGroup"?d.jsx(Vq,{items:P.items,expanded:j[P.key]??!1,onToggleExpanded:()=>N(P.key),onOpen:h},P.key):P.kind==="fileReadGroup"?d.jsx(Gq,{items:P.items,expanded:j[P.key]??!1,onToggleExpanded:()=>N(P.key),onOpen:h},P.key):d.jsx(Hh,{threadId:t,item:P.item,scrollRootRef:x,onOpenExpandedText:h,onOpenCommandDetail:g,onOpenToolCallDetail:p},P.key)),C&&d.jsxs("div",{className:"timeline-live-plan-card rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem]",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:"Plan update"}),d.jsx("span",{className:"rounded-full border border-sky-300/40 px-2 py-1 text-[11px] uppercase tracking-[0.2em] text-sky-200",children:"Live"})]}),C.explanation&&d.jsx("p",{className:"timeline-soft-text mt-3 text-sm",children:C.explanation}),d.jsx("div",{className:"mt-3 space-y-2",children:C.plan.map((P,$)=>d.jsxs("div",{className:"timeline-live-plan-step flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-sm",children:[d.jsx("span",{className:"timeline-primary-text min-w-0 flex-1",children:P.step}),d.jsx(Tq,{status:P.status})]},`${C.turnId}-${$}`))})]}),R?d.jsx(Hh,{threadId:t,item:R,scrollRootRef:x,onOpenExpandedText:h,onOpenCommandDetail:g,onOpenToolCallDetail:p}):O?d.jsx(Xc,{item:{id:"live-agent-message",kind:"agentMessage",text:O},scrollRootRef:x,streaming:!0}):null,Ph(n.status)&&d.jsx(Rv,{turn:n,variant:"footer"})]})]})});function tY({threadId:e,turns:t,totalTurnCount:n,pendingRequests:r=[],pendingSteers:i=[],livePlan:l=null,liveItems:o=null,respondingRequestId:c=null,onRespondToRequest:f,liveOutput:h,scrollRequestKey:g=0,bottomSpacer:p=0,className:x="",onTailVisibilityChange:E,loadingEarlier:v=!1,onLoadEarlier:C,ephemeralUserNote:S=null,answeredRequestNotes:w=[],activityNotes:O=[],optimisticSteers:R=[],optimisticTurn:j=null,onLoadHistoryItemDetail:G,onOpenThread:N}){var ft,Vt,Ze;const P=T.useRef(null),$=T.useRef(null),ne=T.useRef(g),W=T.useRef(null),me=T.useRef(p),Q=T.useRef(0),_e=T.useRef(null),de=T.useRef(!0),se=T.useRef(!0),H=T.useRef(0),ce=T.useRef(new Map),[q,J]=T.useState(pv),[A,U]=T.useState(0),[ee,D]=T.useState(null),[Te,we]=T.useState({}),[Se,Ve]=T.useState(!0),et=T.useMemo(()=>JSON.stringify({turns:t.map(X=>({id:X.id,status:X.status,startedAt:X.startedAt,error:X.error,items:X.items.map(Le=>({id:Le.id,kind:Le.kind,status:Le.status,textLength:Le.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:R.map(X=>({id:X.id,turnId:X.turnId,prompt:X.prompt,status:X.status})),liveOutputLength:h.length,livePlan:l===null?null:{turnId:l.turnId,explanation:l.explanation,steps:l.plan.map(X=>`${X.status}:${X.step}`)},liveItems:o===null?null:{turnId:o.turnId,items:o.items.map(X=>({id:X.id,kind:X.kind,status:X.status,textLength:X.text.length}))},optimisticTurn:j===null?null:{id:j.id,status:j.status,error:j.error,items:j.items.map(X=>({id:X.id,kind:X.kind,textLength:X.text.length}))},answeredRequestNotes:w.map(X=>({id:X.id,turnId:X.turnId??null,title:X.title,createdAt:X.createdAt??"",summaryLines:X.summaryLines})),activityNotes:O.map(X=>({id:X.id,kind:X.kind,text:X.text,createdAt:X.createdAt})),ephemeralUserNote:S,bottomSpacer:p}),[O,w,p,S,h,o,l,R,j,i,r,t]),Be=typeof C=="function"||n!==void 0,Ft=T.useCallback(X=>{we(Le=>({...Le,[X]:!Le[X]}))},[]),at=T.useCallback((X,Le)=>{D({title:X,text:Le})},[]),gt=T.useCallback(async(X,Le)=>{var Lt;const Pe=((Lt=X.detailText)==null?void 0:Lt.trim())||X.text||"Command output";if(!X.hasDeferredDetail||!G){D({title:Le,text:Pe});return}const Xe=ce.current.get(X.id);if(Xe){D({title:Xe.title,text:Xe.text});return}const ut=H.current+1;H.current=ut,D({title:Le,text:"Loading full command output..."});try{const Gt=await G(X.id);if(ce.current.set(X.id,Gt),H.current!==ut)return;D({title:Gt.title,text:Gt.text})}catch(Gt){if(H.current!==ut)return;D({title:Le,text:Gt instanceof Error?Gt.message:"Unable to load full command output."})}},[G]),Kt=T.useCallback(async(X,Le)=>{var Lt;const Pe=((Lt=X.detailText)==null?void 0:Lt.trim())||X.text||"Tool call";if(!X.hasDeferredDetail||!G){D({title:Le,text:Pe});return}const Xe=ce.current.get(X.id);if(Xe){D({title:Xe.title,text:Xe.text});return}const ut=H.current+1;H.current=ut,D({title:Le,text:"Loading full tool call details..."});try{const Gt=await G(X.id);if(ce.current.set(X.id,Gt),H.current!==ut)return;D({title:Gt.title,text:Gt.text})}catch(Gt){if(H.current!==ut)return;D({title:Le,text:Gt instanceof Error?Gt.message:"Unable to load full tool call details."})}},[G]),Ue=T.useCallback(()=>{const X=P.current,Le=_e.current;if(!X)return;const Pe=Le?mq(X,Le):bg(X);de.current=Pe,Ve(Pe)},[]),kt=T.useCallback(()=>{const X=P.current;X&&(se.current=bg(X,y1)),Ue()},[Ue]),nt=T.useCallback(()=>{const X=P.current;X&&(X.scrollTop=X.scrollHeight,Q.current=X.scrollHeight,de.current=!0,Ve(!0),se.current=!0)},[]);T.useEffect(()=>{J(X=>X>=t.length-1?t.length:Math.max(X,pv))},[t.length]),T.useEffect(()=>{const X=P.current;X&&(Q.current=X.scrollHeight,se.current=bg(X,y1)),Ue()},[p,w,S,h,o,l,r.length,Ue,t.length,q]),T.useEffect(()=>{const X=g!==ne.current,Le=W.current!==et;if(W.current=et,!(X||Le&&(Se||se.current)))return;const Xe=window.requestAnimationFrame(()=>{nt()});return g!==ne.current&&(ne.current=g),()=>{window.cancelAnimationFrame(Xe)}},[et,Se,nt,g]),T.useEffect(()=>{const X=P.current,Le=$.current;if(!X||!Le||typeof ResizeObserver>"u")return;Q.current=X.scrollHeight;const Pe=new ResizeObserver(()=>{const Xe=X.scrollHeight,ut=Q.current;Q.current=Xe,!(Xe<=ut)&&(se.current||de.current)&&window.requestAnimationFrame(()=>{nt()})});return Pe.observe(Le),()=>{Pe.disconnect()}},[nt]),T.useEffect(()=>{if(!Se){me.current=p;return}if(p===me.current)return;me.current=p;const X=window.requestAnimationFrame(()=>{nt()});return()=>{window.cancelAnimationFrame(X)}},[p,Se,nt]),T.useEffect(()=>{E==null||E(Se)},[Se,E]);const on=n??t.length,$e=Math.max(0,t.length-q),He=Be?t:t.slice($e),Rt=Be?Math.max(0,on-t.length):$e,un=on+1,cn=Be?Math.max(0,on-t.length):t.length-He.length,Vn=!Be&&cn>0&&A>=2,Tt=j&&(o==null?void 0:o.turnId)===j.id?o.items:null,er=((o==null?void 0:o.items.length)??0)>0,ge=!!o&&(He.some(X=>X.id===o.turnId)||(j==null?void 0:j.id)===o.turnId),Ne=o&&!ge?o.items:null,Re=!!h&&!!j&&j.status!=="failed"&&!Tt,st=new Set(He.map(X=>X.id)),xt=w.reduce((X,Le)=>{if(!Le.turnId||!st.has(Le.turnId))return X;const Pe=X.get(Le.turnId)??[];return Pe.push(Le),X.set(Le.turnId,Pe),X},new Map),dn=r.reduce((X,Le)=>{if(!Le.turnId||!st.has(Le.turnId))return X;const Pe=X.get(Le.turnId)??[];return Pe.push(Le),X.set(Le.turnId,Pe),X},new Map),Ln=[...i.map(X=>({id:X.id,prompt:X.prompt,status:"Accepted",createdAt:X.createdAt})),...R.map(X=>({id:X.id,prompt:X.prompt,status:X.status==="steering"?"Steering":null,createdAt:X.createdAt}))].sort((X,Le)=>X.createdAt.localeCompare(Le.createdAt)),ye=w.filter(X=>!X.turnId||!st.has(X.turnId)),ze=r.filter(X=>!X.turnId||!st.has(X.turnId)),tt=T.useMemo(()=>{const X=[...He.map(ut=>({id:ut.id,startedAt:ut.startedAt??""})),...j?[{id:j.id,startedAt:j.startedAt??""}]:[]],Le=new Map,Pe=[],Xe=[...ye.map(ut=>({kind:"note",id:ut.id,createdAt:ut.createdAt??"",note:ut})),...ze.map(ut=>({kind:"request",id:ut.id,createdAt:ut.createdAt,request:ut}))].sort((ut,Lt)=>ut.createdAt.localeCompare(Lt.createdAt));for(const ut of Xe){const Lt=X.find(pt=>ut.createdAt&&pt.startedAt&&ut.createdAt.localeCompare(pt.startedAt)<=0);if(!Lt){Pe.push(ut);continue}const Gt=Le.get(Lt.id)??[];Gt.push(ut),Le.set(Lt.id,Gt)}return{beforeTurnId:Le,trailing:Pe}},[j,ye,ze,He]),Me=T.useMemo(()=>{const X=[...O].sort((it,Nn)=>it.createdAt.localeCompare(Nn.createdAt)),Le=[...He.map(it=>({id:it.id,startedAt:it.startedAt??""})),...j?[{id:j.id,startedAt:j.startedAt??""}]:[]],Pe=[],Xe=new Map,ut=new Map,Lt=[],pt=Le.map(it=>it.startedAt).filter(it=>!!it).sort().at(-1)??null;for(const it of X){if(it.anchorTurnId==="__leading__"){Pe.push(it);continue}if(it.anchorTurnId){if(Le.some(nn=>nn.id===it.anchorTurnId)){const nn=ut.get(it.anchorTurnId)??[];nn.push(it),ut.set(it.anchorTurnId,nn)}else Pe.push(it);continue}const Nn=Le.find(nn=>nn.startedAt&&it.createdAt.localeCompare(nn.startedAt)<=0);if(!Nn){!pt||it.createdAt.localeCompare(pt)<=0?Pe.push(it):Lt.push(it);continue}const Un=Xe.get(Nn.id)??[];Un.push(it),Xe.set(Nn.id,Un)}return{leading:Pe,beforeTurnId:Xe,afterTurnId:ut,trailing:Lt}},[O,j,He]);return d.jsxs(d.Fragment,{children:[d.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${x}`.trim(),children:d.jsx("div",{ref:P,"data-testid":"thread-scroll-container",onScroll:kt,className:"thread-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:p>0?{paddingBottom:p}:void 0,children:d.jsxs("div",{ref:$,children:[t.length>0&&d.jsx("div",{className:"px-2.5 pb-1 pt-2 sm:px-6 sm:pb-1.5 sm:pt-3",children:d.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[cn>0&&d.jsx("button",{type:"button",onClick:()=>{if(Be){C==null||C();return}J(X=>Math.min(t.length,X+sq)),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"}),Vn&&d.jsx("button",{type:"button",onClick:()=>J(t.length),className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),d.jsxs("p",{className:"timeline-meta-text",children:["Showing ",He.length," of ",on," turns",cn>0?` · ${cn} earlier hidden`:""]})]})}),t.length===0&&!h&&!j&&d.jsx("div",{className:"timeline-meta-text px-2.5 py-8 text-sm sm:px-6",children:"Send the first prompt to start the thread."}),(He.length>0||j||Me.leading.length>0||Me.trailing.length>0)&&d.jsxs("div",{className:"divide-y divide-stone-800/80",children:[Me.leading.length>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:Me.leading.map(X=>d.jsx(tu,{note:X,onOpenThread:N},X.id))}):null,He.map((X,Le)=>{var Pe,Xe,ut,Lt,Gt;return d.jsxs("div",{children:[(((Pe=Me.beforeTurnId.get(X.id))==null?void 0:Pe.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Me.beforeTurnId.get(X.id)??[]).map(pt=>d.jsx(tu,{note:pt,onOpenThread:N},pt.id))}):null,(((Xe=tt.beforeTurnId.get(X.id))==null?void 0:Xe.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(tt.beforeTurnId.get(X.id)??[]).map(pt=>pt.kind==="note"?d.jsx(Kf,{note:pt.note},pt.id):d.jsx(Xf,{request:pt.request,busy:c===pt.request.id,onRespond:f??void 0},pt.id))}):null,d.jsx(Lv,{threadId:e,turn:X,absoluteIndex:Rt+Le+1,isCollapsed:Te[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:"",onToggleCollapse:Ft,onOpenExpandedText:at,onOpenCommandDetail:gt,onOpenToolCallDetail:Kt,scrollRootRef:P,articleRef:void 0}),(((ut=Me.afterTurnId.get(X.id))==null?void 0:ut.length)??0)>0?d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Me.afterTurnId.get(X.id)??[]).map(pt=>d.jsx(tu,{note:pt},pt.id))}):null,(Lt=xt.get(X.id))!=null&&Lt.length||(Gt=dn.get(X.id))!=null&&Gt.length?d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...(xt.get(X.id)??[]).map(pt=>({kind:"note",id:pt.id,createdAt:pt.createdAt??"",note:pt})),...(dn.get(X.id)??[]).map(pt=>({kind:"request",id:pt.id,createdAt:pt.createdAt,request:pt}))].sort((pt,it)=>pt.createdAt.localeCompare(it.createdAt)).map(pt=>pt.kind==="note"?d.jsx(Kf,{note:pt.note},pt.id):d.jsx(Xf,{request:pt.request,busy:c===pt.request.id,onRespond:f??void 0},pt.id))}):null]},X.id)}),j&&He.every(X=>X.id!==j.id)&&d.jsxs(d.Fragment,{children:[(((ft=Me.beforeTurnId.get(j.id))==null?void 0:ft.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Me.beforeTurnId.get(j.id)??[]).map(X=>d.jsx(tu,{note:X,onOpenThread:N},X.id))}):null,(((Vt=tt.beforeTurnId.get(j.id))==null?void 0:Vt.length)??0)>0?d.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(tt.beforeTurnId.get(j.id)??[]).map(X=>X.kind==="note"?d.jsx(Kf,{note:X.note},X.id):d.jsx(Xf,{request:X.request,busy:c===X.request.id,onRespond:f??void 0},X.id))}):null,d.jsx(Lv,{threadId:e,turn:j,absoluteIndex:un,isCollapsed:Te[j.id]??!1,livePlan:null,liveItems:Tt,liveOutput:Re?h:"",onToggleCollapse:Ft,onOpenExpandedText:at,onOpenCommandDetail:gt,onOpenToolCallDetail:Kt,scrollRootRef:P}),(((Ze=Me.afterTurnId.get(j.id))==null?void 0:Ze.length)??0)>0?d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Me.afterTurnId.get(j.id)??[]).map(X=>d.jsx(tu,{note:X,onOpenThread:N},X.id))}):null]})]}),Ln.length>0&&d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:Ln.map(X=>d.jsx(Xc,{threadId:e,item:{id:X.id,kind:"userMessage",text:X.prompt,status:X.status},scrollRootRef:P},X.id))}),(tt.trailing.length>0||Me.trailing.length>0)&&d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...Me.trailing.map(X=>({kind:"activity",id:X.id,createdAt:X.createdAt,note:X})),...tt.trailing].sort((X,Le)=>X.createdAt.localeCompare(Le.createdAt)).map(X=>X.kind==="activity"?d.jsx(tu,{note:X.note,onOpenThread:N},X.id):X.kind==="note"?d.jsx(Kf,{note:X.note},X.id):d.jsx(Xf,{request:X.request,busy:c===X.request.id,onRespond:f??void 0},X.id))}),S&&d.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:d.jsx(Xc,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:S},scrollRootRef:P})}),Ne&&Ne.length>0&&d.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:Ne.map(X=>d.jsx(Hh,{threadId:e,item:X,scrollRootRef:P,onOpenExpandedText:at,onOpenCommandDetail:gt,onOpenToolCallDetail:Kt},X.id))}),h&&!Re&&!er&&d.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:E1(h)?d.jsx(Hh,{threadId:e,item:E1(h),scrollRootRef:P,onOpenExpandedText:at,onOpenCommandDetail:gt,onOpenToolCallDetail:Kt}):d.jsx(Xc,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:h},scrollRootRef:P,streaming:!0})}),d.jsx("div",{ref:_e,"aria-hidden":"true",className:"h-px w-full"})]})})}),d.jsx(L5,{open:ee!==null,title:(ee==null?void 0:ee.title)??"Full text",text:(ee==null?void 0:ee.text)??"",onClose:()=>{H.current+=1,D(null)}})]})}function zb({open:e,title:t,label:n,value:r,busy:i=!1,onChange:l,onCancel:o,onSubmit:c}){if(T.useEffect(()=>{if(!e)return;function h(g){g.key==="Escape"&&!i&&o()}return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[i,o,e]),!e)return null;function f(h){h.preventDefault(),c()}return _u.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[d.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:o,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),d.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":t,onSubmit:f,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),d.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),d.jsx("button",{type:"button","aria-label":"Close dialog",onClick:o,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:d.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),d.jsxs("div",{className:"mt-5",children:[d.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),d.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:r,onChange:h=>l(h.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),d.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),d.jsx("button",{type:"submit",disabled:i||!r.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function nY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",children:d.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function rY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function aY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:d.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Z"})})}function Iv({title:e,defaultOpen:t=!1,children:n}){const[r,i]=T.useState(t);return d.jsxs("section",{className:"border-t border-[var(--theme-border)] pt-4 first:border-t-0 first:pt-0",children:[d.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":r,className:"flex w-full items-center justify-between gap-3 text-left",children:[d.jsx("span",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:e}),d.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:r?"Hide":"Show"})]}),r&&d.jsx("div",{className:"mt-3",children:n})]})}function sY({thread:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,showDeleteButton:c=!1,showSessionCopyButton:f=!1}){const[h,g]=T.useState("idle"),p=T.useRef(null),x=r[e.workspaceId],E=t===e.id;T.useEffect(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);async function v(){const C=e.providerSessionId;if(C)try{await navigator.clipboard.writeText(C),g("copied"),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>g("idle"),1200)}catch{g("failed"),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>g("idle"),1600)}}return d.jsxs("div",{role:"link",tabIndex:0,onClick:()=>i(e.id),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),i(e.id))},className:`thread-sidebar-card relative block rounded-[1.2rem] border px-3 py-2.5 transition ${E?"thread-sidebar-card-active shadow-lg shadow-stone-950/12":""} ${f&&e.providerSessionId?"pb-4":""}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("p",{className:"min-w-0 w-fit max-w-[calc(100%-2rem)] truncate text-[13px] font-medium leading-5 text-[var(--theme-fg)]",title:e.title,children:e.title}),d.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),l(e)},"aria-label":`Rename thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition hover:text-[var(--theme-fg)]",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:d.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})}),c&&o&&d.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),o(e)},"aria-label":`Delete thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-rose-300/90 transition hover:text-rose-200",children:d.jsx(aY,{})})]}),x&&!n&&d.jsx("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:x})]}),d.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.18em] ${rq(e.status)}`,children:I5(e.status)})]}),d.jsxs("div",{className:`mt-2 flex items-center justify-between gap-3 text-[11px] text-[var(--theme-fg-muted)] ${f&&e.providerSessionId?"pr-9":""}`,children:[d.jsx("time",{dateTime:e.lastTurnStartedAt??e.updatedAt,children:pm(e.lastTurnStartedAt??e.updatedAt)}),d.jsx("span",{children:e.model??"No model"})]}),f&&e.providerSessionId&&d.jsx("button",{type:"button","aria-label":"Copy session ID",title:h==="copied"?"Copied":h==="failed"?"Copy failed":"Copy session ID",onClick:C=>{C.stopPropagation(),v()},className:`absolute bottom-2.5 right-2.5 inline-flex h-7 w-7 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${h==="copied"?"border-sky-300/40 bg-sky-300/16 text-sky-100":h==="failed"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg-soft)] hover:bg-[var(--theme-hover)]"}`,children:d.jsx(rY,{})})]})}function F5({threads:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,scrollable:c=!1,maxHeightClassName:f="max-h-full",showDeleteButton:h=!1,showSessionCopyButton:g=!1}){const p=c?`min-h-0 overflow-y-auto overscroll-contain pr-1 ${f}`:"";return d.jsx("div",{className:p,children:d.jsx("div",{className:"space-y-1.5",children:e.map(x=>d.jsx(sY,{thread:x,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r,onOpenThread:i,onBeginRenameThread:l,showDeleteButton:h,showSessionCopyButton:g,...o?{onDeleteThread:o}:{}},x.id))})})}function z5({threads:e,status:t,loading:n=!1,error:r,viewportConstrained:i=!1,showMobileAppMenu:l=!0,showMobileThreadNavToggle:o=!0,showMobileNewThreadShortcut:c=!0,mobileHeaderAction:f,currentThreadId:h,currentThreadLabel:g=null,currentWorkspaceId:p=null,currentWorkspaceLabel:x=null,workspaceLabels:E={},metaContent:v,settingsContent:C,onRenameThread:S,onDeleteThread:w,children:O}){const[R,j]=T.useState(!1),[G,N]=T.useState(!1),[P,$]=T.useState(null),[ne,W]=T.useState(""),[me,Q]=T.useState(null),_e=is(),de=fo(),se=T.useMemo(()=>[...p?e.filter(we=>we.workspaceId===p):e].sort((we,Se)=>{if(we.id===h)return-1;if(Se.id===h)return 1;const Ve=Date.parse(we.lastTurnStartedAt??we.updatedAt);return Date.parse(Se.lastTurnStartedAt??Se.updatedAt)-Ve}),[h,p,e]),H=x??(p?"Current workspace":"All threads"),ce=g&&g.trim()?`${H} / ${g.trim()}`:H,q=p?`/threads/new?workspaceId=${encodeURIComponent(p)}`:"/threads/new";async function J(Te){if(!S)return;const we=ne.trim();if(we){Q(Te);try{await S(Te,we),$(null),W("")}finally{Q(null)}}}function A(Te){$(Te.id),W(Te.title)}function U(){$(null),W("")}function ee(Te){_e(`/threads/${Te}`),j(!1),de==null||de.closeNav()}function D(){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("section",{children:[d.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:"Thread List"}),d.jsxs("div",{className:"flex items-center gap-2",children:[n&&d.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}),d.jsx(gi,{to:q,onClick:()=>{j(!1),de==null||de.closeNav()},className:"inline-flex h-7 items-center rounded-full bg-[var(--theme-accent-solid)] px-2.5 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"New Thread"})]})]}),r&&d.jsx("div",{className:"rounded-2xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-100",children:r}),!r&&se.length===0&&!n&&d.jsx("div",{className:"rounded-2xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}),se.length>0&&d.jsx(F5,{threads:se,currentThreadId:h,currentWorkspaceId:p,workspaceLabels:E,onOpenThread:ee,onBeginRenameThread:A,showDeleteButton:!!w,...w?{onDeleteThread:w}:{}})]}),d.jsx(Iv,{title:"Thread Meta",defaultOpen:!0,children:v??d.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"Select a thread to inspect metadata."})}),d.jsx(Iv,{title:"Settings",children:C??d.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"No thread settings available."})})]})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:i?`flex h-full max-h-full min-h-0 flex-col gap-2 overflow-hidden overscroll-none sm:gap-4 lg:grid ${G?"lg:grid-cols-[0_minmax(0,1fr)]":"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 ${G?"lg:grid-cols-[0_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]"}`,children:[d.jsx("div",{className:"lg:hidden",children:d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:`thread-topbar-surface grid h-10 items-center gap-1.5 border-b px-2.5 backdrop-blur ${l&&(c||f)?"grid-cols-[2.5rem_minmax(0,1fr)_auto]":l?"grid-cols-[2.5rem_minmax(0,1fr)]":"grid-cols-[minmax(0,1fr)]"}`,children:[l&&d.jsx(D1,{}),o?d.jsxs("button",{type:"button",onClick:()=>j(Te=>!Te),"aria-expanded":R,"aria-label":R?"Collapse thread navigation":"Expand thread navigation",className:"inline-flex min-w-0 items-center justify-center gap-1 px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:ce,children:[d.jsx("span",{className:"min-w-0 truncate",children:ce}),d.jsx("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition ${R?"rotate-180":""}`,children:d.jsx("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m4.5 6.25 3.5 3.5 3.5-3.5"})})})]}):d.jsx("p",{className:"min-w-0 truncate px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:ce,children:ce}),l&&(f||(c?d.jsxs(gi,{to:q,onClick:()=>{de==null||de.closeNav(),j(!1)},"aria-label":"New Thread",className:"inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-1 rounded-full bg-[var(--theme-accent-solid)] px-2 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:[d.jsx(nY,{}),d.jsx("span",{className:"hidden sm:inline",children:"New"})]}):null))]}),l&&d.jsx(j1,{className:"absolute left-2 top-[calc(100%+0.45rem)] z-20 w-[min(18rem,calc(100vw-1rem))]"}),o&&R&&d.jsx("aside",{className:"thread-sidebar-surface absolute inset-x-2 top-[calc(100%+0.35rem)] z-50 max-h-[min(70dvh,34rem)] overflow-y-auto overscroll-contain rounded-[1.35rem] border p-4 shadow-2xl shadow-stone-950/18 backdrop-blur",children:D()})]})}),d.jsxs("aside",{className:`relative hidden min-h-0 lg:block ${G?"pointer-events-none overflow-visible":""}`,children:[d.jsx("button",{type:"button",onClick:()=>N(Te=>!Te),"aria-label":G?"Expand thread list":"Collapse thread list",title:G?"Expand thread list":"Collapse thread list",className:`pointer-events-auto absolute top-3 z-20 inline-flex h-8 w-8 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg-soft)] shadow-lg shadow-stone-950/20 transition hover:bg-[var(--theme-hover)] ${G?"left-2":"right-[-0.9rem]"}`,children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:`h-4 w-4 fill-none stroke-current transition ${G?"rotate-180":""}`,strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"m9.75 4.25-3.5 3.75 3.5 3.75"})})}),d.jsx("div",{"aria-hidden":G,className:`thread-sidebar-surface sticky top-4 rounded-[2rem] border p-4 shadow-2xl shadow-stone-950/12 backdrop-blur transition-opacity ${i?"h-full max-h-full overflow-y-auto":""} ${G?"pointer-events-none opacity-0":"opacity-100"}`,children:D()})]}),d.jsx("section",{className:i?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":"min-w-0",children:O})]}),d.jsx(zb,{open:P!==null,title:"Rename Thread",label:"Thread Title",value:ne,busy:me!==null,onChange:W,onCancel:U,onSubmit:()=>P?J(P):void 0})]})}const iY=3,yg=10,lY=1e3,oY=2e3,Eg=5500,uY=3e3,_g=0,nu=1,Zf=3,cY=["read-only","workspace-write","danger-full-access"];function dY(e){return e.sandboxMode??(e.approvalMode==="guarded"?"workspace-write":"danger-full-access")}function fY(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function Ov(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function Kl(e,t){const n=new Set(t.map(r=>r.id));return[...e.filter(r=>!n.has(r.id)),...t]}function hY(e,t){return{...e,pendingRequests:[...e.pendingRequests.filter(n=>n.id!==t.id),t]}}function mY(e,t){const n=e.pendingRequests.filter(r=>r.id!==t);return n.length===e.pendingRequests.length?e:{...e,pendingRequests:n}}function Dv(e,t,n){const r=t.filter(c=>!n.has(c.id)),i=e.filter(c=>!n.has(c.id));if(i.length===0)return r;const l=new Map(r.map(c=>[c.id,c]));return[...i.map(c=>l.get(c.id)??c),...r.filter(c=>!i.some(f=>f.id===c.id))].sort((c,f)=>c.createdAt.localeCompare(f.createdAt))}function pY(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&(t.kind==="requestUserInput"||t.kind==="planDecision")&&typeof t.title=="string"&&typeof t.createdAt=="string"&&Array.isArray(t.questions)}function gY(e,t){var i,l;if(!e||e.kind!==t.kind)return t;if(e.kind==="agentMessage"&&t.kind==="agentMessage")return e.text.length>t.text.length?{...t,text:e.text,sequence:t.sequence??e.sequence??null}:t;const n=((i=e.detailText)==null?void 0:i.trim())||e.text.trim(),r=((l=t.detailText)==null?void 0:l.trim())||t.text.trim();return n.length>r.length?e:t}function bY(e,t,n){if(!e||t&&t.turnId!==e.turnId)return t;const r=n.find(p=>p.id===e.turnId),i=new Map((r==null?void 0:r.items.map(p=>[p.id,p]))??[]),l=(r==null?void 0:r.items.filter(p=>p.kind==="agentMessage").map(p=>p.text.trim()).filter(Boolean))??[],o=p=>p.kind==="agentMessage"&&p.text.trim().length>0&&l.some(x=>x.includes(p.text.trim()));if(!t){const p=e.items.filter(x=>{const E=i.get(x.id);return E?E.kind!==x.kind:!o(x)});return p.length===0?null:{...e,items:p}}const c=new Map(e.items.map(p=>[p.id,p])),f=new Map(t.items.map(p=>[p.id,p])),g=[...e.items.map(p=>p.id),...t.items.map(p=>p.id).filter(p=>!c.has(p))].map(p=>{const x=f.get(p),E=c.get(p);if(!x){const v=i.get(p);return!v&&E&&o(E)||(v==null?void 0:v.kind)===(E==null?void 0:E.kind)?null:E??null}return gY(E,x)}).filter(p=>!!p);return g.length===0?null:{turnId:t.turnId,items:g,updatedAt:t.updatedAt.localeCompare(e.updatedAt)>=0?t.updatedAt:e.updatedAt}}function Ic(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}function $5(e){return`${e.threadId}:${e.objective}:${e.createdAt}`}function xY(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 V5(e){const t=new Map;for(const n of e){const r=$5(n),i=t.get(r);t.set(r,i?xY(i,n):n)}return[...t.values()].sort((n,r)=>Date.parse(r.updatedAt)-Date.parse(n.updatedAt))}function Jf(e,t){return V5([t,...e])}function yY(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 EY(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 jv(e,t){if(!t)return null;const n=e.find(r=>r.model===t);return n?n.supportedReasoningEfforts.length>1:null}function _Y(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`client-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function v1(e,t){return(e==null?void 0:e.items.some(n=>n.kind==="userMessage"&&n.text.trim()===t))??!1}function Mv(e){return e.replace(/\s*\[PHOTO\s+[^\]]+\]\s*/g," ").replace(/\s+/g," ").trim()}function G5(e,t){const n=Mv(t);return n?(e==null?void 0:e.items.some(r=>r.kind==="userMessage"&&Mv(r.text)===n))??!1:!1}function TY(e){return(e==null?void 0:e.items.some(t=>t.kind==="userMessage"&&/\[PHOTO\s+\.\/\.temp\/threads\/[^\]]+\]/.test(t.text)))??!1}function vY(e,t){return e.find(n=>v1(n,t))??(t.includes("[PHOTO ")?e.find(n=>G5(n,t))??null:null)}function kY(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 wY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function CY(){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M4.25 2.25h5.2l2.3 2.3v9.2h-7.5a2 2 0 0 1-2-2v-7.5a2 2 0 0 1 2-2Z"}),d.jsx("path",{d:"M9.25 2.5v2.25h2.25"}),d.jsx("path",{d:"M7 6.75v4"}),d.jsx("path",{d:"m5.45 9.35 1.55 1.55 1.55-1.55"})]})}function eh({status:e}){return d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M2.5 6.75A8.22 8.22 0 0 1 8 4.5c2.14 0 4.1.8 5.5 2.25"}),d.jsx("path",{d:"M4.75 9a4.95 4.95 0 0 1 6.5 0"}),d.jsx("path",{d:"M6.9 11.3a1.9 1.9 0 0 1 2.2 0"}),e==="connected"?d.jsx("path",{d:"m6.7 13.2.9.9 1.7-2"}):e==="offline"?d.jsx("path",{d:"M3 3l10 10"}):e==="detached"?null:d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M11.8 11.1a2.2 2.2 0 0 1-1.8 2.7"}),d.jsx("path",{d:"m10.7 11.35 1.3-.55-.55-1.3"})]})]})}function SY(e,t){if(!e)return"Thread disconnected";switch(t.status){case"connected":return"Realtime updates connected";case"reconnecting":return"Realtime updates reconnecting";case"offline":return"Browser offline";case"checking":return"Checking realtime connection"}}function NY(){var Cl;const{id:e=""}=xA(),t=is(),n=T.useRef(""),r=T.useRef(null),i=T.useRef(null),l=T.useRef(null),o=T.useRef(!1),c=T.useRef(null),f=T.useRef(null),h=T.useRef(typeof navigator>"u"?!0:navigator.onLine),g=T.useRef(!1),p=T.useRef(null),x=T.useRef(null),E=T.useRef(0),v=T.useRef(0),C=T.useRef(null),S=T.useRef(null),w=T.useRef(null),O=T.useRef(!1),R=T.useRef(null),j=T.useRef(null),G=T.useRef(new Set),[N,P]=T.useState(null),[$,ne]=T.useState([]),[W,me]=T.useState([]),[Q,_e]=T.useState(null),[de,se]=T.useState(null),[H,ce]=T.useState(null),[q,J]=T.useState(""),[A,U]=T.useState(null),[ee,D]=T.useState(null),[Te,we]=T.useState(!0),[Se,Ve]=T.useState(0),[et,Be]=T.useState(!0),[Ft,at]=T.useState(!1),[gt,Kt]=T.useState(!1),[Ue,kt]=T.useState("chat"),[nt,on]=T.useState({prompt:"",attachments:[]}),[$e,He]=T.useState(!1),[Rt,un]=T.useState(0),[cn,Vn]=T.useState(0),[Tt,er]=T.useState(0),[ge,Ne]=T.useState(!1),[Re,st]=T.useState(null),[xt,dn]=T.useState(!1),[Ln,ye]=T.useState(!1),[ze,tt]=T.useState(!1),[Me,ft]=T.useState(null),[Vt,Ze]=T.useState("idle"),[X,Le]=T.useState({status:h.current?"checking":"offline",browserOnline:h.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null}),[Pe,Xe]=T.useState(null),[ut,Lt]=T.useState([]),[Gt,pt]=T.useState({status:"idle",data:null,error:null}),[it,Nn]=T.useState({status:"idle",data:null,error:null}),[Un,nn]=T.useState({status:"idle",data:null,error:null}),[yi,us]=T.useState({status:"idle",data:null,error:null}),[ya,In]=T.useState({status:"idle",data:null,error:null}),[gl,bl]=T.useState(!1),[Ir,bn]=T.useState(!1),[An,Va]=T.useState(()=>new Set),[tr,Ns]=T.useState(!1),[Gr,cs]=T.useState(!1),[Ga,Or]=T.useState({status:"idle",data:null,error:null}),[On,Gn]=T.useState(null),[Ea,_a]=T.useState(!1),[_n,zt]=T.useState(null),qr=((Cl=H==null?void 0:H.hostConfigFiles.find(z=>{var K;return(K=z.roles)==null?void 0:K.includes("mcp")}))==null?void 0:Cl.name)??null,aa=T.useCallback(()=>{const z=n.current;n.current="",r.current=null,z&&J(K=>K+z)},[]),xr=T.useCallback(z=>{n.current+=z,r.current===null&&(r.current=window.requestAnimationFrame(()=>{aa()}))},[aa]),xl=T.useCallback((z,K)=>{D(re=>{const je=[...((re==null?void 0:re.turnId)===z?re.items:[]).filter(Je=>Je.id!==K.id),K];return{turnId:z,items:je,updatedAt:new Date().toISOString()}})},[]),As=T.useCallback((z,K,re,Ie)=>{D(je=>{const Je=(je==null?void 0:je.turnId)===z?je.items:[],Et=Je.find(De=>De.id===K),jn=(Et==null?void 0:Et.kind)==="agentMessage"?{...Et,text:`${Et.text}${re}`,sequence:Ie??Et.sequence??null}:{id:K,kind:"agentMessage",text:re,sequence:Ie};return{turnId:z,items:[...Je.filter(De=>De.id!==K),jn],updatedAt:new Date().toISOString()}})},[]),Dr=T.useCallback(()=>{n.current="",r.current!==null&&(window.cancelAnimationFrame(r.current),r.current=null)},[]);T.useEffect(()=>{pt({status:"idle",data:null,error:null}),Nn({status:"idle",data:null,error:null}),nn({status:"idle",data:null,error:null}),us({status:"idle",data:null,error:null}),In({status:"idle",data:null,error:null}),Ns(!1),Or({status:"idle",data:null,error:null})},[e]);const Ta=T.useCallback(async()=>{if(e){Or(z=>({status:"loading",data:z.data,error:null}));try{const z=await O6(e);Or({status:"ready",data:z,error:null})}catch(z){const K=z instanceof Yt?z.payload.message:"Unable to load export turns.";Or(re=>({status:"failed",data:re.data,error:K}))}}},[e]);async function Rs(z){if(e){zt(null),cs(!0);try{const{blob:K,filename:re}=await j6(e,z),Ie=URL.createObjectURL(K),je=document.createElement("a");je.href=Ie,je.download=re,document.body.append(je),je.click(),je.remove(),window.setTimeout(()=>URL.revokeObjectURL(Ie),3e4),Ns(!1)}catch(K){const re=K instanceof Yt?K.payload.message:"Unable to export transcript.";zt(re)}finally{cs(!1)}}}async function qa(){if(e){In(z=>{var K;return{status:"loading",data:z.data??((K=R.current)==null?void 0:K.goal)??null,error:null}});try{const z=await G6(e);In({status:"ready",data:z.goal,error:null}),P(K=>K&&(z.goal?{...K,goal:z.goal,goalHistory:Jf(K.goalHistory??[],z.goal)}:{...K,goal:z.goal}))}catch(z){In(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load goal."}))}}}async function qn(z){if(e){In(K=>{var re;return{status:"loading",data:K.data??((re=R.current)==null?void 0:re.goal)??null,error:null}});try{const K=await q6(e,z);In({status:"ready",data:K.goal,error:null}),P(re=>re&&(K.goal?{...re,goal:K.goal,goalHistory:Jf(re.goalHistory??[],K.goal)}:{...re,goal:K.goal}))}catch(K){throw In(re=>({status:"failed",data:re.data,error:K instanceof Yt?K.payload.message:"Unable to update goal."})),K}}}async function nr(){if(e){In(z=>{var K;return{status:"loading",data:z.data??((K=R.current)==null?void 0:K.goal)??null,error:null}});try{const z=await Y6(e);In({status:"ready",data:null,error:null}),P(K=>K&&(z.goalHistory?{...K,goal:null,goalHistory:z.goalHistory}:{...K,goal:null}))}catch(z){throw In(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to clear goal."})),z}}}async function fr(z){bn(!0);try{await qn({status:z})}finally{bn(!1)}}async function ds(){bn(!0);try{await nr()}finally{bn(!1)}}async function Ls(){if(e){pt(z=>({status:"loading",data:z.data,error:null}));try{const z=await Q6(e);pt({status:"ready",data:z,error:null})}catch(z){pt(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load skills."}))}}}async function Ei(){if(e){Nn(z=>({status:"loading",data:z.data,error:null}));try{const z=await X6(e);Nn({status:"ready",data:z,error:null})}catch(z){Nn(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load MCP servers."}))}}}async function Zt(){if(e){nn(z=>({status:"loading",data:z.data,error:null}));try{const z=await K6(e);nn({status:"ready",data:z,error:null})}catch(z){nn(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load hooks."}))}}}async function yl(z){if(e){nn(K=>({status:"loading",data:K.data,error:null}));try{const K=await Z6(e,z);nn({status:"ready",data:K,error:null})}catch(K){throw nn(re=>({status:"failed",data:re.data,error:K instanceof Yt?K.payload.message:"Unable to create hook."})),K}}}async function rr(z){if(e){nn(K=>({status:"loading",data:K.data,error:null}));try{const K=await J6(e,z);nn({status:"ready",data:K,error:null})}catch(K){throw nn(re=>({status:"failed",data:re.data,error:K instanceof Yt?K.payload.message:"Unable to update hook."})),K}}}async function Ya(z){if(e){nn(K=>({status:"loading",data:K.data,error:null}));try{const K=await eR(e,z);nn({status:"ready",data:K,error:null})}catch(K){throw nn(re=>({status:"failed",data:re.data,error:K instanceof Yt?K.payload.message:"Unable to trust hook."})),K}}}async function _i(z){if(e){nn(K=>({status:"loading",data:K.data,error:null}));try{const K=await tR(e,z);nn({status:"ready",data:K,error:null})}catch(K){throw nn(re=>({status:"failed",data:re.data,error:K instanceof Yt?K.payload.message:"Unable to untrust hook."})),K}}}async function Ti(){if(e){us(z=>({status:"loading",data:z.data,error:null}));try{const z=await W6(e);us({status:"ready",data:z,error:null})}catch(z){us(K=>({status:"failed",data:K.data,error:z instanceof Yt?z.payload.message:"Unable to load turns for forking."}))}}}async function jr(){if(!e)return;const z=await k2(e,{mode:"latest"});ne(K=>Ic(K,z.thread.thread)),t(`/threads/${z.thread.thread.id}`)}async function Is(z){if(!e)return;const K=await k2(e,{mode:"turn",turnId:z});ne(re=>Ic(re,K.thread.thread)),t(`/threads/${K.thread.thread.id}`)}const El=T.useCallback(z=>{const K=j.current,re=K&&Object.keys(K).length>0?{...z,thread:{...z.thread,...K}}:z,Ie=R.current;R.current=re,U(re.livePlan??null);const je=Ie?Kl(Ie.turns,re.turns):re.turns;D(De=>bY(De,re.liveItems??null,je)),In(De=>De.status==="idle"?De:{...De,data:re.goal??null});const Je=re.thread.activeTurnId===null&&re.thread.status!=="running";P(De=>De&&!re.goalHistory?{...re,turns:Kl(De.turns,re.turns),pendingRequests:Dv(De.pendingRequests,re.pendingRequests,G.current),...De.goalHistory?{goalHistory:De.goalHistory}:{}}:De?{...re,turns:Kl(De.turns,re.turns),pendingRequests:Dv(De.pendingRequests,re.pendingRequests,G.current)}:re),ne(De=>Ic(De,re.thread));const Et=new Map(re.turns.map(De=>[De.id,De])),jn=new Set((re.pendingSteers??[]).map(De=>De.clientRequestId).filter(De=>!!De));Lt(De=>De.filter(Rn=>{if(jn.has(Rn.clientRequestId))return!1;const ar=Et.get(Rn.turnId);return!(!ar||v1(ar,Rn.prompt)||re.thread.activeTurnId!==Rn.turnId&&ar.status!=="inProgress")})),Xe(De=>{if(!De)return De;const Rn=De.serverTurnId??De.id,ar=re.turns.some(Fe=>Fe.id===Rn),Bt=Et.get(Rn)??null,Nt=vY(re.turns,De.prompt),ke=!!Nt;if(Nt&&!De.serverTurnId)return{...De,id:Nt.id,serverTurnId:Nt.id,status:De.status==="failed"?De.status:Nt.status==="inProgress"?"inProgress":De.status};if(Bt&&De.serverTurnId)return Bt.status==="inProgress"?{...De,id:Bt.id,serverTurnId:Bt.id,status:De.status==="failed"?De.status:"inProgress"}:null;if(!De.serverTurnId&&De.prompt.includes("[PHOTO ")&&re.thread.activeTurnId&&re.thread.status==="running"){const Fe=Et.get(re.thread.activeTurnId);if(Fe&&TY(Fe))return{...De,id:Fe.id,serverTurnId:Fe.id,status:De.status==="failed"?De.status:"inProgress"}}return ar||Je&&ke?null:De}),(Je||S.current&&re.turns.some(De=>De.id===S.current))&&(S.current=null,Dr(),J(""),U(null),D(null))},[Dr]);T.useEffect(()=>{R.current=N},[N]);const Mr=T.useCallback(async({seedThread:z}={})=>{var Et;const K=v.current+1;v.current=K;const re=(z==null?void 0:z.provider)??((Et=R.current)==null?void 0:Et.thread.provider)??"codex",[Ie,je,Je]=await Promise.allSettled([uk(),ok(re),wg(re)]);v.current===K&&(Ie.status==="fulfilled"?ne(z?Ic(Ie.value,z):Ie.value):z&&ne(jn=>Ic(jn,z)),je.status==="fulfilled"&&(C.current=re,_e(je.value.status),se(je.value.capabilities),ce(je.value.managementSchema)),Je.status==="fulfilled"&&(C.current=re,me(Je.value)))},[]),Xt=T.useCallback(async({showLoading:z=!0,clearError:K=!0,reportError:re=!0,limit:Ie=yg}={})=>{const je=E.current+1;E.current=je,z&&Be(!0),K&&zt(null);try{const Je=await E0(e,{limit:Ie});if(E.current!==je)return;El(Je),C.current!==Je.thread.provider&&Mr({seedThread:Je.thread})}catch(Je){if(E.current!==je||!re)return;zt(Je instanceof Error?Je.message:"Unable to load thread detail.")}finally{E.current===je&&Be(!1)}},[El,e,Mr]),xn=T.useCallback(()=>{var jn;const z=((jn=i.current)==null?void 0:jn.readyState)??Zf,K=z===nu,re=h.current,Ie=Date.now(),je=c.current!==null&&Ie-Date.parse(c.current)<=Eg,Je=f.current!==null&&Ie-f.current<=Eg;let Et;re?K&&Je?Et="connected":z===_g||l.current!==null||je||Je||o.current?Et="reconnecting":Et="checking":Et="offline",Le(De=>De.status===Et&&De.browserOnline===re&&De.healthOk===je&&De.socketOpen===K&&De.lastHealthyAt===c.current?De:{status:Et,browserOnline:re,healthOk:je,socketOpen:K,lastHealthyAt:c.current})},[]);T.useEffect(()=>{E.current+=1,v.current+=1,P(null),on({prompt:"",attachments:[]}),at(!1),Ze("idle"),Xe(null),Lt([]),D(null),w.current=null,O.current=!1,j.current=null,S.current=null,G.current=new Set,c.current=null,f.current=null,g.current=!1,h.current=typeof navigator>"u"?!0:navigator.onLine,Le({status:h.current?"checking":"offline",browserOnline:h.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null})},[e]),T.useEffect(()=>{if(Vt==="idle")return;const z=window.setTimeout(()=>{Ze("idle")},Vt==="copied"?1200:1600);return()=>{window.clearTimeout(z)}},[Vt]),T.useEffect(()=>{if(typeof document>"u")return;const{documentElement:z,body:K}=document;return z.classList.add("thread-detail-scroll-locked"),K.classList.add("thread-detail-scroll-locked"),()=>{z.classList.remove("thread-detail-scroll-locked"),K.classList.remove("thread-detail-scroll-locked")}},[]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const z=window.matchMedia("(max-width: 639px)"),K=()=>He(z.matches);return K(),z.addEventListener("change",K),()=>{z.removeEventListener("change",K)}},[]),T.useEffect(()=>{var K,re;if(typeof window>"u")return;const z=()=>{const Ie=window.visualViewport,je=Ie?Math.max(0,Math.round(window.innerHeight-Ie.height-Ie.offsetTop)):0;er(je),document.documentElement.style.setProperty("--thread-detail-keyboard-inset",`${je}px`)};return z(),(K=window.visualViewport)==null||K.addEventListener("resize",z),(re=window.visualViewport)==null||re.addEventListener("scroll",z),window.addEventListener("resize",z),()=>{var Ie,je;(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",z),(je=window.visualViewport)==null||je.removeEventListener("scroll",z),window.removeEventListener("resize",z),document.documentElement.style.removeProperty("--thread-detail-keyboard-inset")}},[]),T.useEffect(()=>{if(typeof document>"u")return;const z=()=>{const K=document.activeElement,re=x.current,Ie=re==null?void 0:re.querySelector('[aria-label="Prompt"]');Ne(!!(K&&Ie&&(K===Ie||Ie.contains(K))))};return z(),document.addEventListener("focusin",z),document.addEventListener("focusout",z),()=>{document.removeEventListener("focusin",z),document.removeEventListener("focusout",z)}},[Ue,N==null?void 0:N.thread.id,$e]),T.useEffect(()=>{const z=x.current;if(!z||typeof ResizeObserver>"u")return;const K=z.querySelector("form")??z,re=()=>{un(Math.max(z.getBoundingClientRect().height,K.getBoundingClientRect().height))};re();const Ie=new ResizeObserver(()=>{re()});return Ie.observe(K),()=>{Ie.disconnect()}},[Ue,$e]),T.useEffect(()=>{var Ie,je;const z=x.current;if(!z||!$e||Ue!=="chat"){Vn(0);return}const K=()=>{const Je=z.getBoundingClientRect();Vn(Math.max(0,Math.ceil(window.innerHeight-Je.top)))};K(),window.addEventListener("resize",K),(Ie=window.visualViewport)==null||Ie.addEventListener("resize",K),(je=window.visualViewport)==null||je.addEventListener("scroll",K);let re=null;return typeof ResizeObserver<"u"&&(re=new ResizeObserver(K),re.observe(z)),()=>{var Je,Et;window.removeEventListener("resize",K),(Je=window.visualViewport)==null||Je.removeEventListener("resize",K),(Et=window.visualViewport)==null||Et.removeEventListener("scroll",K),re==null||re.disconnect()}},[Ue,N==null?void 0:N.thread.id,$e,Tt,ge]),T.useEffect(()=>{Xt({showLoading:!0,limit:iY}),Mr()},[Mr,Xt]),T.useEffect(()=>{var Et;if(!N||N.turns.length===0||Ft||O.current)return;const z=N.totalTurnCount??N.turns.length;if(N.turns.length>=z){w.current=null;return}const K=(Et=N.turns[0])==null?void 0:Et.id;if(!K)return;const re={threadId:N.thread.id,beforeTurnId:K},Ie=w.current;if((Ie==null?void 0:Ie.threadId)===re.threadId&&Ie.beforeTurnId===re.beforeTurnId)return;w.current=re;let je=!1;const Je=window.setTimeout(()=>{(async()=>{var jn;O.current=!0;try{const De=await E0(e,{limit:yg,beforeTurnId:K});if(je)return;P(Rn=>Rn?{...De,turns:Ov(Rn.turns,De.turns)}:De),ne(Rn=>Rn.map(ar=>ar.id===De.thread.id?De.thread:ar))}catch{}finally{((jn=w.current)==null?void 0:jn.threadId)===re.threadId&&(O.current=!1)}})()},120);return()=>{je=!0,window.clearTimeout(Je)}},[N==null?void 0:N.totalTurnCount,N==null?void 0:N.turns,e,Ft]),T.useEffect(()=>{let z=!1,K=null;const re=()=>{Xt({showLoading:!1,clearError:!1,reportError:!1})},Ie=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},je=()=>{z||!h.current||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,!z&&De()},lY),xn())},Je=()=>{const ke=i.current;if(i.current=null,ke)try{ke.close()}catch{}},Et=ke=>{if(ke.threadId===e){if(ke.type==="thread.output.delta"&&typeof ke.payload.delta=="string"){const Fe=typeof ke.payload.turnId=="string"?ke.payload.turnId:null,ht=typeof ke.payload.itemId=="string"?ke.payload.itemId:null,fn=typeof ke.payload.sequence=="number"&&Number.isFinite(ke.payload.sequence)?ke.payload.sequence:null;Fe&&ht?As(Fe,ht,ke.payload.delta,fn):xr(ke.payload.delta),Fe&&Xe(bt=>bt&&(bt.serverTurnId===null||bt.serverTurnId===Fe)?{...bt,serverTurnId:Fe,id:Fe,status:bt.status==="failed"?bt.status:"inProgress",tokenUsage:bt.tokenUsage}:bt)}if(ke.type==="thread.context.updated"){const Fe=ke.payload.contextUsage&&typeof ke.payload.contextUsage=="object"?ke.payload.contextUsage:null;if(Fe){const ht=Fe;P(fn=>fn&&{...fn,thread:{...fn.thread,contextUsage:ht}}),ne(fn=>fn.map(bt=>bt.id===e?{...bt,contextUsage:ht}:bt))}}if(ke.type==="thread.turn.token.updated"&&typeof ke.payload.turnId=="string"&&ke.payload.tokenUsage&&typeof ke.payload.tokenUsage=="object"){const Fe=ke.payload.turnId,ht=ke.payload.tokenUsage,fn=ke.payload.priceEstimate&&typeof ke.payload.priceEstimate=="object"?ke.payload.priceEstimate:null;P(bt=>{if(!bt)return bt;const an=kY(bt.turns,Fe,ht,fn);return an===bt.turns?bt:{...bt,turns:an}}),Xe(bt=>bt&&(bt.serverTurnId===Fe||bt.id===Fe)?{...bt,tokenUsage:ht,priceEstimate:fn}:bt)}if(ke.type==="thread.turn.started"||ke.type==="thread.turn.completed"||ke.type==="thread.turn.failed"||ke.type==="thread.updated"||ke.type==="thread.goal.updated"||ke.type==="thread.goal.cleared"||ke.type==="thread.request.created"||ke.type==="thread.request.resolved"){if(ke.type==="thread.goal.updated"){const Fe=ke.payload.goal&&typeof ke.payload.goal=="object"?ke.payload.goal:null,ht=Array.isArray(ke.payload.goalHistory)?ke.payload.goalHistory:null;In({status:"ready",data:Fe,error:null}),P(fn=>fn&&(ht?{...fn,goal:Fe,goalHistory:ht}:Fe?{...fn,goal:Fe,goalHistory:Jf(fn.goalHistory??[],Fe)}:{...fn,goal:Fe}))}if(ke.type==="thread.goal.cleared"){const Fe=Array.isArray(ke.payload.goalHistory)?ke.payload.goalHistory:null;In({status:"ready",data:null,error:null}),P(ht=>ht&&(Fe?{...ht,goal:null,goalHistory:Fe}:{...ht,goal:null}))}if(re(),ke.type==="thread.turn.started"){Dr(),J(""),D(null),S.current=null;const Fe=typeof ke.payload.turnId=="string"?ke.payload.turnId:null;Fe&&Xe(ht=>ht&&{...ht,serverTurnId:Fe,id:Fe,status:ht.status==="failed"?ht.status:"inProgress",error:null,tokenUsage:ht.tokenUsage})}if(ke.type==="thread.turn.completed"||ke.type==="thread.turn.failed"){Dr(),J("");const Fe=typeof ke.payload.turnId=="string"?ke.payload.turnId:null;Fe&&(S.current=Fe,ke.type==="thread.turn.failed"&&Xe(ht=>ht&&(ht.serverTurnId===Fe||ht.id===Fe)?{...ht,status:"failed",error:typeof ke.payload.error=="string"?ke.payload.error:"Unable to complete the turn.",tokenUsage:ht.tokenUsage}:ht))}}if(ke.type==="thread.request.created"&&pY(ke.payload.request)&&(G.current.delete(ke.payload.request.id),P(Fe=>Fe&&hY(Fe,ke.payload.request))),ke.type==="thread.request.resolved"&&typeof ke.payload.requestId=="string"){const Fe=ke.payload.requestId;G.current.add(Fe),P(ht=>ht&&mY(ht,Fe))}if((ke.type==="thread.item.started"||ke.type==="thread.item.completed")&&ke.payload.item&&typeof ke.payload.item=="object"&&typeof ke.payload.turnId=="string"){const Fe=ke.payload.turnId,ht=ke.payload.item;typeof ht.id=="string"&&typeof ht.text=="string"&&xl(Fe,ht)}ke.type==="thread.plan.updated"&&Array.isArray(ke.payload.plan)&&U({turnId:String(ke.payload.turnId??""),explanation:typeof ke.payload.explanation=="string"?ke.payload.explanation:null,plan:ke.payload.plan})}},jn=()=>{const ke=i.current;if(!(!ke||ke.readyState!==nu))try{ke.send(JSON.stringify({type:"supervisor.ping",timestamp:new Date().toISOString()}))}catch{g.current=!0,Je(),je(),xn()}},De=()=>{var ht;if(z||!h.current){xn();return}const ke=((ht=i.current)==null?void 0:ht.readyState)??Zf;if(ke===_g||ke===nu){xn();return}const Fe=fk(Et);i.current=Fe,xn(),Fe.addEventListener("message",fn=>{if(i.current===Fe)try{const bt=JSON.parse(fn.data);(bt.type==="supervisor.connected"||bt.type==="supervisor.pong")&&(f.current=Date.now(),xn())}catch{}}),Fe.addEventListener("open",()=>{i.current===Fe&&(g.current=!0,re(),jn(),xn())}),Fe.addEventListener("close",()=>{i.current===Fe&&(i.current=null),g.current=!0,je(),xn()}),Fe.addEventListener("error",()=>{i.current===Fe&&(i.current=null),g.current=!0,je(),xn()})},Rn=async()=>{var ke;if(!(z||!h.current||o.current)){o.current=!0,xn();try{await L6();const Fe=g.current;c.current=new Date().toISOString(),Fe&&(g.current=!1,re()),(((ke=i.current)==null?void 0:ke.readyState)??Zf)!==nu&&De()}catch{c.current=null,g.current=!0,je()}finally{o.current=!1,xn()}}},ar=()=>{h.current=!0,g.current=!0,xn(),De(),Rn()},Bt=()=>{h.current=!1,c.current=null,f.current=null,g.current=!0,Ie(),Je(),xn()},Nt=()=>{var ht;if(z||!h.current){xn();return}const ke=((ht=i.current)==null?void 0:ht.readyState)??Zf,Fe=f.current===null?null:Date.now()-f.current;ke===nu&&Fe!==null&&Fe>Eg?(g.current=!0,Je(),je()):ke===nu?jn():ke!==_g&&De(),Rn(),xn()};return window.addEventListener("online",ar),window.addEventListener("offline",Bt),De(),Rn(),K=window.setInterval(Nt,oY),()=>{z=!0,window.removeEventListener("online",ar),window.removeEventListener("offline",Bt),Ie(),K!==null&&window.clearInterval(K),Dr(),Je()}},[As,Dr,e,Xt,xr,xn,xl]),T.useEffect(()=>{if(!((N==null?void 0:N.thread.activeTurnId)!==null||(N==null?void 0:N.thread.status)==="running"||Pe!==null||ut.length>0||q.length>0||A!==null||ee!==null))return;const K=window.setInterval(()=>{Xt({showLoading:!1,clearError:!1,reportError:!1})},uY);return()=>{window.clearInterval(K)}},[N==null?void 0:N.thread.activeTurnId,N==null?void 0:N.thread.status,q.length,ee,A,Xt,ut.length,Pe]);async function vi(){var z;if(!(!N||N.turns.length===0||Ft)){at(!0),zt(null);try{const K=(z=N.turns[0])==null?void 0:z.id,re=await E0(e,{limit:yg,...K?{beforeTurnId:K}:{}});P(Ie=>Ie?{...re,turns:Ov(Ie.turns,re.turns)}:re),ne(Ie=>Ie.map(je=>je.id===re.thread.id?re.thread:je))}catch(K){zt(K instanceof Error?K.message:"Unable to load earlier turns.")}finally{at(!1)}}}async function Pr(z){var Rn,ar;if(Ue==="shell"){if((N==null?void 0:N.thread.isLoaded)===!1){await _l({attachShell:!0});return}const Bt=((Rn=p.current)==null?void 0:Rn.sendCommand(z.prompt))??!1;zt(Bt?null:"Connect the shell before sending commands.");return}Kt(!0),zt(null),Ve(Bt=>Bt+1);const K=R.current,re=K?{...K.thread,...j.current??{}}:null,Ie=(re==null?void 0:re.model)??null,je=(re==null?void 0:re.reasoningEffort)??null,Je=_Y(),Et=`optimistic-${Date.now()}`,jn=`optimistic-steer-${Je}`,De=new Date().toISOString();try{let Bt=R.current;if(Bt&&!Bt.thread.isLoaded){const an={...Bt.thread,...j.current??{}},Er=await T2(e,{...Bt.thread.model?{model:Bt.thread.model}:{},...Bt.thread.sandboxMode?{sandboxMode:Bt.thread.sandboxMode}:{}}),sr={...Er,thread:{...Er.thread,model:an.model??Er.thread.model,reasoningEffort:an.reasoningEffort??Er.thread.reasoningEffort,collaborationMode:an.collaborationMode??Er.thread.collaborationMode,sandboxMode:an.sandboxMode??Er.thread.sandboxMode??null}};Bt=sr,R.current=sr,P($s=>$s?{...sr,turns:Kl($s.turns,sr.turns)}:sr),ne($s=>$s.map(Vs=>Vs.id===sr.thread.id?sr.thread:Vs))}const Nt=Bt?{...Bt.thread,...j.current??{}}:null,ke=(Nt==null?void 0:Nt.status)==="running"?Nt.activeTurnId:null,Fe=Ue==="chat"&&!!ke;Fe&&ke?Lt(an=>[...an,{id:jn,clientRequestId:Je,turnId:ke,prompt:z.prompt,createdAt:De,status:"steering"}]):(Dr(),J(""),Xe({id:Et,serverTurnId:null,startedAt:De,status:"sending",error:null,prompt:z.prompt,model:Ie,reasoningEffort:je,reasoningEffortAvailable:jv(W,Ie),tokenUsage:null,priceEstimate:null}));const ht={prompt:z.prompt,clientRequestId:Je,...Nt!=null&&Nt.model?{model:Nt.model}:{},...Nt!=null&&Nt.reasoningEffort?{reasoningEffort:Nt.reasoningEffort}:{},...Nt!=null&&Nt.collaborationMode?{collaborationMode:Nt.collaborationMode}:{},...Nt!=null&&Nt.sandboxMode?{sandboxMode:Nt.sandboxMode}:{},...(ar=z.attachments)!=null&&ar.length?{attachments:z.attachments}:{}},fn=await z6(e,ht),bt=j.current&&Object.keys(j.current).length>0?{...fn,...j.current}:fn;P(an=>an&&{...an,thread:bt}),ne(an=>an.map(Er=>Er.id===bt.id?bt:Er)),Fe&&ke?bt.activeTurnId!==null&&bt.activeTurnId!==ke&&bt.lastTurnStartedAt!==(Nt==null?void 0:Nt.lastTurnStartedAt)?(Dr(),J(""),U(null),Lt(Er=>Er.filter(sr=>sr.id!==jn)),Xe({id:Et,serverTurnId:bt.activeTurnId,startedAt:bt.lastTurnStartedAt??De,status:"inProgress",error:null,prompt:z.prompt,model:Ie,reasoningEffort:je,reasoningEffortAvailable:jv(W,Ie),tokenUsage:null,priceEstimate:null})):Lt(Er=>Er.map(sr=>sr.id===jn?{...sr,turnId:bt.activeTurnId??sr.turnId,status:"accepted"}:sr)):(Xe(an=>an&&an.id===Et?{...an,id:bt.activeTurnId??an.id,serverTurnId:bt.activeTurnId??an.serverTurnId,status:"inProgress",error:null,tokenUsage:an.tokenUsage,priceEstimate:an.priceEstimate}:an),U(null)),on({prompt:"",attachments:[]})}catch(Bt){const Nt=Bt instanceof Yt?Bt.payload.message:Bt instanceof Error?Bt.message:"Unable to send prompt.";Bt instanceof Yt?zt(Bt.payload.message):zt(Nt),Lt(ke=>ke.filter(Fe=>Fe.clientRequestId!==Je)),Xe(ke=>ke&&ke.id===Et?{...ke,status:"failed",error:Nt}:ke)}finally{Kt(!1)}}async function Iu(){const z=N==null?void 0:N.thread.providerSessionId;if(z)try{await navigator.clipboard.writeText(z),Ze("copied")}catch{Ze("failed")}}async function _l(z){if(N){Kt(!0),zt(null),Dr(),J("");try{if(N.thread.isLoaded){const re=await F6(e);P(Ie=>Ie?{...re,turns:Kl(Ie.turns,re.turns)}:re),st(null),ne(Ie=>Ie.map(je=>je.id===re.thread.id?re.thread:je)),dn(!1);return}const K=await T2(e,{...N.thread.model?{model:N.thread.model}:{},...N.thread.sandboxMode?{sandboxMode:N.thread.sandboxMode}:{}});P(re=>re?{...K,turns:Kl(re.turns,K.turns)}:K),ne(re=>re.map(Ie=>Ie.id===K.thread.id?K.thread:Ie)),z!=null&&z.attachShell&&Ue==="shell"&&dn(!0)}catch(K){zt(K instanceof Error?K.message:"Unable to change connection state.")}finally{Kt(!1)}}}async function fs(){var z;if(Ue==="shell"){const K=((z=p.current)==null?void 0:z.sendControl("ctrl_c"))??!1;zt(K?null:"Connect the shell before sending Ctrl-C.");return}Kt(!0),zt(null);try{const K=N!=null&&N.thread.activeTurnId?await v2(e,{turnId:N.thread.activeTurnId}):await v2(e);P(re=>re&&{...re,thread:K}),ne(re=>re.map(Ie=>Ie.id===K.id?K:Ie)),Dr(),J("")}catch(K){zt(K instanceof Error?K.message:"Unable to interrupt turn.")}finally{Kt(!1)}}async function Br(z){if(!N)return;const K=N,re={...j.current??{},...z.model!==void 0?{model:z.model}:{},...z.reasoningEffort!==void 0?{reasoningEffort:z.reasoningEffort}:{},...z.fastMode!==void 0?{fastMode:z.fastMode}:{},...z.collaborationMode!==void 0?{collaborationMode:z.collaborationMode}:{},...z.sandboxMode!==void 0?{sandboxMode:z.sandboxMode}:{}},Ie={...N.thread,...re};ye(!0),j.current=re,R.current={...N,thread:Ie},P(je=>je&&{...je,thread:Ie}),ne(je=>je.map(Je=>Je.id===Ie.id?{...Je,...Ie}:Je));try{const je=await $6(e,{...z.model!==void 0?{model:z.model}:{},...z.reasoningEffort!==void 0?{reasoningEffort:z.reasoningEffort}:{},...z.fastMode!==void 0?{fastMode:z.fastMode}:{},...z.collaborationMode!==void 0?{collaborationMode:z.collaborationMode}:{},...z.sandboxMode!==void 0?{sandboxMode:z.sandboxMode}:{}});j.current=null,R.current=K?{...K,thread:je}:null,P(Je=>Je&&{...Je,thread:je}),ne(Je=>Je.map(Et=>Et.id===je.id?je:Et))}catch(je){j.current=null,R.current=K,P(K),ne(Je=>Je.map(Et=>Et.id===K.thread.id?K.thread:Et)),zt(je instanceof Error?je.message:"Unable to update thread settings.")}finally{ye(!1)}}async function Tl(z,K){ft(z),zt(null);try{const re=await nR(e,z,K);P(Ie=>Ie?{...re,turns:Kl(Ie.turns,re.turns)}:re),U(re.livePlan??null),D(re.liveItems??null)}catch(re){zt(re instanceof Error?re.message:"Unable to answer this request.")}finally{ft(null)}}async function ki(){if(N){tt(!0),zt(null);try{const z=await V6(e);P(K=>K&&{...K,thread:z}),ne(K=>K.map(re=>re.id===z.id?z:re))}catch(z){zt(z instanceof Error?z.message:"Unable to compact this thread context.")}finally{tt(!1)}}}async function Wa(z,K){try{const re=await ck(z,{title:K});ne(Ie=>Ie.map(je=>je.id===re.id?{...je,title:re.title,updatedAt:re.updatedAt}:je)),P(Ie=>Ie&&Ie.thread.id===re.id?{...Ie,thread:{...Ie.thread,title:re.title,updatedAt:re.updatedAt}}:Ie)}catch(re){throw zt(re instanceof Error?re.message:"Unable to rename thread."),re}}async function va(){if(On){_a(!0),zt(null);try{await dk(On.id),ne(K=>K.filter(re=>re.id!==On.id));const z=On.id===(N==null?void 0:N.thread.id);if(Gn(null),z){const K=$.find(re=>re.id!==On.id&&re.workspaceId===(N==null?void 0:N.thread.workspaceId))??$.find(re=>re.id!==On.id);t(K?`/threads/${K.id}`:"/threads")}}catch(z){zt(z instanceof Error?z.message:"Unable to delete thread.")}finally{_a(!1)}}}function Os(){kt(z=>z==="chat"?(N!=null&&N.thread.isLoaded&&dn(!0),"shell"):"chat")}async function Qa(){var K;const z=await((K=p.current)==null?void 0:K.copyLastCommandOutput());zt(z?null:"Unable to copy the last shell command output.")}function Ds(z){var re,Ie;const K=z==="clear"?((re=p.current)==null?void 0:re.sendCommand("clear"))??!1:((Ie=p.current)==null?void 0:Ie.sendControl(z))??!1;zt(K?null:"Connect the shell before sending control input.")}T.useEffect(()=>{if(!(!xt||Ue!=="shell"||!p.current||(N==null?void 0:N.thread.isLoaded)===!1||(Re==null?void 0:Re.loading)!==!1)){if((Re==null?void 0:Re.status)==="attached"){dn(!1);return}dn(!1),p.current.toggleConnection()}},[Ue,N==null?void 0:N.thread.isLoaded,xt,Re==null?void 0:Re.loading,Re==null?void 0:Re.status]),T.useEffect(()=>{if(Ue!=="shell")return;const z=window.requestAnimationFrame(()=>{var K;(K=p.current)==null||K.refreshLayout({focus:!0})});return()=>{window.cancelAnimationFrame(z)}},[Ue]);const Yr=N&&N.workspacePathStatus==="missing"?"Restore this workspace path on the current machine before continuing.":null,yr=$e&&Ue==="chat",js=yr&&ge?Tt:0,Ms=Math.max(Rt,144),ka=Math.max(cn,Ms+js),vl=yr?ka+12:0,wi=N?d.jsxs("dl",{className:"space-y-4 text-sm",children:[d.jsxs("div",{className:"relative pr-9",children:[d.jsx("dt",{className:"text-stone-500",children:"Session ID"}),d.jsx("dd",{className:"mt-1 break-all text-stone-100",children:N.thread.providerSessionId??"Unavailable"}),N.thread.providerSessionId&&d.jsx("button",{type:"button","aria-label":"Copy session ID",title:Vt==="copied"?"Copied":Vt==="failed"?"Copy failed":"Copy session ID",onClick:()=>void Iu(),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 ${Vt==="copied"?"ui-status-info":Vt==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:d.jsx("span",{className:"scale-[0.72]",children:d.jsx(wY,{})})})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Source"}),d.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`})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Status"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:I5(N.thread.status)})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Created"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:hu(N.thread.createdAt)})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Workspace"}),d.jsx("dd",{className:"mt-1 break-words text-stone-100",children:N.workspace.absPath})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Workspace path"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:N.workspacePathStatus==="present"?"Present":"Missing on this machine"})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-stone-500",children:"Active turn"}),d.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.activeTurnId??"None"})]})]}):null,xo=N&&(de!=null&&de.controls.sandboxMode)?d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-stone-500",children:"Sandbox Mode"}),d.jsx("div",{className:"mt-2 space-y-1.5",children:cY.map(z=>{const K=dY(N.thread)===z;return d.jsx("button",{type:"button",disabled:Ln,onClick:()=>void Br({sandboxMode:z}),className:`block w-full rounded-xl border px-3 py-2 text-left text-sm transition ${K?"ui-status-warning":"border-stone-800 bg-stone-950/40 text-stone-300 hover:bg-stone-800/80"} disabled:cursor-not-allowed disabled:opacity-60`,children:z},z)})})]})}):null,Ps=(Pe==null?void 0:Pe.serverTurnId)??null,Ci=Pe&&N?N.turns.find(z=>Ps&&z.id===Ps||z.id===Pe.id||v1(z,Pe.prompt)||Pe.prompt.includes("[PHOTO ")&&G5(z,Pe.prompt))??null:null,yo=Pe&&!Ci?{id:Pe.id,startedAt:Pe.startedAt,status:Pe.status,error:Pe.error,model:Pe.model,reasoningEffort:Pe.reasoningEffort,reasoningEffortAvailable:Pe.reasoningEffortAvailable,tokenUsage:Pe.tokenUsage,priceEstimate:Pe.priceEstimate,items:[{id:`${Pe.id}-user-message`,kind:"userMessage",text:Pe.prompt}]}:null,Dn=(N==null?void 0:N.thread.isLoaded)??!1,Wr=Dn?X.status==="connected"?"ui-action-success shadow-lg shadow-stone-950/20":X.status==="reconnecting"?"thread-live-connection-reconnecting ui-status-success shadow-lg shadow-stone-950/20":X.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",Bs=SY(Dn,X),wa=[Bs,Dn?null:"Tap to connect this thread",X.lastHealthyAt?`Last healthy ${hu(X.lastHealthyAt)}`:null].filter(Boolean).join(" · "),Xa=Dn?d.jsx("div",{role:"status","aria-live":"polite","aria-label":Bs,title:wa,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${Wr}`,children:d.jsx(eh,{status:X.status})}):d.jsx("button",{type:"button",onClick:()=>void _l(),disabled:gt||!N,"aria-label":gt?"Connecting thread":"Connect thread",title:gt?"Connecting thread":wa,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${Wr}`,children:d.jsx(eh,{status:"detached"})}),Si=Dn?d.jsx("div",{title:wa,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${Wr}`,children:d.jsx(eh,{status:X.status})}):d.jsx("button",{type:"button",onClick:()=>void _l(),disabled:gt||!N,title:gt?"Connecting thread":wa,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${Wr}`,children:d.jsx(eh,{status:"detached"})}),Us=ya.data??(N==null?void 0:N.goal)??null,Ka=(N==null?void 0:N.goalHistory)??[],Hs=Us?Jf(Ka,Us):V5(Ka),Fs=(de==null?void 0:de.controls.goals)??!1,Eo=d.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),d.jsx("circle",{cx:"8",cy:"8",r:"2"}),d.jsx("path",{d:"M8 1.7v2M8 12.3v2M1.7 8h2M12.3 8h2"})]}),kl=gl&&Fs?d.jsxs("div",{className:"w-96 max-w-[calc(100vw-1.5rem)] rounded-3xl border border-stone-700/80 bg-stone-950/92 p-3 text-left text-stone-100 shadow-2xl shadow-stone-950/35 backdrop-blur-xl",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold",children:"Goal monitor"}),d.jsx("p",{className:"text-xs text-stone-500",children:"Current thread only"})]}),d.jsx("button",{type:"button",onClick:()=>bl(!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"})]}),ya.error?d.jsx("p",{className:"mt-3 rounded-2xl border border-rose-400/30 bg-rose-400/10 px-3 py-2 text-xs text-rose-100",children:ya.error}):null,d.jsx("div",{className:"mt-3 max-h-[28rem] space-y-2 overflow-auto pr-1",children:Hs.length===0?d.jsx("p",{className:"rounded-2xl border border-stone-800 bg-stone-900/60 px-3 py-3 text-sm text-stone-400",children:"No goals in this thread yet."}):Hs.map(z=>{const K=$5(z),re=An.has(K),Ie=["active","paused","budgetLimited"].includes(z.status);return d.jsxs("div",{className:`rounded-2xl border px-3 py-3 ${Ie?"ui-status-info":"border-stone-800 bg-stone-900/60"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsx("button",{type:"button",onClick:()=>Va(je=>{const Je=new Set(je);return Je.has(K)?Je.delete(K):Je.add(K),Je}),className:"min-w-0 flex-1 text-left",children:d.jsx("p",{className:`text-sm font-medium leading-5 ${re?"":"line-clamp-2"}`,children:z.objective})}),d.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:z.status})]}),d.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] text-stone-400",children:[d.jsx("span",{children:EY(z.timeUsedSeconds)}),d.jsx("span",{children:yY(z)}),d.jsxs("span",{title:hu(z.updatedAt),children:["Updated ",new Date(z.updatedAt).toLocaleTimeString()]})]}),Ie?d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d.jsx("button",{type:"button",disabled:Ir||z.status==="active",onClick:()=>void fr("active"),className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-50",children:"Continue"}),d.jsx("button",{type:"button",disabled:Ir||z.status==="paused",onClick:()=>void fr("paused"),className:"rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50",children:"Pause"}),d.jsx("button",{type:"button",disabled:Ir,onClick:()=>void ds(),className:"rounded-full border border-rose-400/35 px-3 py-1.5 text-xs text-rose-100 transition hover:bg-rose-400/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Terminate"})]}):null]},K)})})]}):null,wl=Fs?d.jsx("button",{type:"button","aria-label":"Open goal monitor",title:"Open goal monitor",onClick:()=>{bl(z=>!z),qa()},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:Eo}):null,zs=d.jsx("button",{type:"button","aria-label":"Export transcript",title:"Export transcript",onClick:()=>Ns(!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:d.jsx(CY,{})}),_o=d.jsxs("div",{className:"relative flex items-center justify-end gap-1.5",children:[zs,wl,Xa]});return d.jsx(z5,{threads:$,status:Q,loading:et,error:et?null:_n,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:wi,settingsContent:xo,showMobileNewThreadShortcut:!1,mobileHeaderAction:_o,onRenameThread:Wa,onDeleteThread:Gn,children:d.jsxs("div",{className:"thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded-none border-y shadow-2xl shadow-stone-950/20 sm:flex-none sm:rounded-[2rem] sm:border",children:[d.jsx("div",{className:"pointer-events-none absolute right-4 top-4 z-30 hidden lg:block",children:d.jsx("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[zs,wl,Si]})})}),kl?d.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:top-16 lg:right-4",children:kl}):null,_n&&!et&&d.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:_n}),et?d.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Loading thread detail..."}):N?d.jsxs(d.Fragment,{children:[N.workspacePathStatus==="missing"&&d.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[d.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),d.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:N.workspace.absPath})]}),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Ue==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:[d.jsx(tY,{threadId:N.thread.id,turns:N.turns,totalTurnCount:N.totalTurnCount??N.turns.length,pendingRequests:N.pendingRequests,livePlan:A,liveItems:ee,respondingRequestId:Me,onRespondToRequest:Tl,liveOutput:q,scrollRequestKey:Se,bottomSpacer:vl,className:"thread-timeline-surface min-h-0 flex-1",onTailVisibilityChange:we,loadingEarlier:Ft,onLoadEarlier:vi,onLoadHistoryItemDetail:z=>I6(N.thread.id,z),answeredRequestNotes:N.answeredRequestNotes??[],activityNotes:N.activityNotes??[],pendingSteers:N.pendingSteers??[],optimisticSteers:ut,optimisticTurn:yo}),yr?d.jsx("div",{ref:x,className:"fixed inset-x-0 bottom-0 z-40 max-h-[min(58dvh,24rem)] overflow-y-auto overscroll-contain sm:hidden",style:{bottom:`${js}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:d.jsx(S0,{activeView:Ue,edgeToEdgeMobile:!0,busy:Ue==="chat"?gt:!1,settingsBusy:Ln,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:W,contextUsage:N.thread.contextUsage,capabilities:de,toolboxItems:(H==null?void 0:H.toolboxItems)??[],hookCommandTemplates:(H==null?void 0:H.hookCommandTemplates)??[],mcpConfigFormat:(H==null?void 0:H.mcpConfigFormat)??"none",followTail:Te,threadConnected:N.thread.isLoaded,disabled:!!Yr,disabledPlaceholder:Yr??void 0,shellControlState:Re,draftPrompt:nt.prompt,draftAttachments:nt.attachments,onDraftChange:on,canInterrupt:!!N.thread.activeTurnId,onSubmit:Pr,onInterrupt:fs,onCompact:ki,onOpenForkTurns:Ti,onForkLatest:jr,onForkTurn:Is,onOpenSkills:Ls,onOpenMcp:Ei,onOpenHooks:Zt,onCreateHook:yl,onUpdateHook:rr,onTrustHook:Ya,onUntrustHook:_i,goalState:ya,onOpenGoal:qa,onUpdateGoal:qn,onReadProviderConfig:qr?()=>Cg(N.thread.provider,qr):void 0,onWriteProviderConfig:qr?z=>Sg(N.thread.provider,qr,{content:z}):void 0,onToggleFollow:()=>Ve(z=>z+1),onUpdateSettings:Br,onToggleView:Os,onShellCopy:Qa,onShellControl:Ds,compactBusy:ze,skillsState:Gt,mcpState:it,hooksState:Un,forkTurnOptionsState:yi})}):d.jsx("div",{ref:x,children:d.jsx(S0,{activeView:Ue,busy:Ue==="chat"?gt:!1,settingsBusy:Ln,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:W,contextUsage:N.thread.contextUsage,capabilities:de,toolboxItems:(H==null?void 0:H.toolboxItems)??[],hookCommandTemplates:(H==null?void 0:H.hookCommandTemplates)??[],mcpConfigFormat:(H==null?void 0:H.mcpConfigFormat)??"none",followTail:Te,threadConnected:N.thread.isLoaded,disabled:!!Yr,disabledPlaceholder:Yr??void 0,shellControlState:Re,draftPrompt:nt.prompt,draftAttachments:nt.attachments,onDraftChange:on,canInterrupt:!!N.thread.activeTurnId,onSubmit:Pr,onInterrupt:fs,onCompact:ki,onOpenForkTurns:Ti,onForkLatest:jr,onForkTurn:Is,onOpenSkills:Ls,onOpenMcp:Ei,onOpenHooks:Zt,onCreateHook:yl,onUpdateHook:rr,onTrustHook:Ya,onUntrustHook:_i,goalState:ya,onOpenGoal:qa,onUpdateGoal:qn,onReadProviderConfig:qr?()=>Cg(N.thread.provider,qr):void 0,onWriteProviderConfig:qr?z=>Sg(N.thread.provider,qr,{content:z}):void 0,onToggleFollow:()=>Ve(z=>z+1),onUpdateSettings:Br,onToggleView:Os,onShellCopy:Qa,onShellControl:Ds,compactBusy:ze,skillsState:Gt,mcpState:it,hooksState:Un,forkTurnOptionsState:yi})})]}),d.jsxs("div",{className:Ue==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[N.thread.isLoaded&&d.jsx(n4,{ref:p,threadId:N.thread.id,isVisible:Ue==="shell",showHeader:!1,showFloatingToolbox:!1,onStateChange:st}),Ue==="shell"&&!N.thread.isLoaded&&d.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:d.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[d.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),d.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})}),Ue==="shell"&&d.jsx(S0,{activeView:Ue,busy:gt,settingsBusy:!1,error:N.thread.isLoaded?(Re==null?void 0:Re.error)??null:null,followTail:!1,capabilities:de,toolboxItems:(H==null?void 0:H.toolboxItems)??[],hookCommandTemplates:(H==null?void 0:H.hookCommandTemplates)??[],mcpConfigFormat:(H==null?void 0:H.mcpConfigFormat)??"none",threadConnected:N.thread.isLoaded,shellControlState:Re,canInterrupt:!!(N.thread.isLoaded&&(Re!=null&&Re.isCommandRunning)),onSubmit:Pr,onInterrupt:fs,onToggleView:Os,onShellCopy:Qa,onShellControl:Ds})]})]})]}):d.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Unable to resolve this thread."}),d.jsx(_R,{open:tr,busy:Gr,turnsState:Ga,onCancel:()=>{Gr||Ns(!1)},onLoadTurns:Ta,onExport:Rs}),d.jsx(M1,{open:On!==null,title:"Delete Thread",description:On?`Delete ${fY(On.title)} from supervisor. The backend session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:Ea,onCancel:()=>{Ea||Gn(null)},onConfirm:()=>void va()})]})})}function AY(){const e=is(),[t,n]=T.useState(""),[r,i]=T.useState(!1),[l,o]=T.useState(null);async function c(f){f.preventDefault();const h=t.trim();if(!h){o("Session ID is required.");return}i(!0),o(null);try{const g=await B6(h);e(`/threads/${g.thread.id}`)}catch(g){g instanceof Yt?o(g.payload.message):o(g instanceof Error?g.message:"Unable to import session.")}finally{i(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Import Session"}),d.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Bring in a local Codex session"}),d.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-stone-400",children:"Paste a session ID from this machine. Supervisor will recover the workspace path, reuse an existing workspace when possible, or create one with the last folder name as the default label."}),d.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-stone-500",children:"Imported history appears immediately, but sending a new prompt still requires a manual Resume / Connect."})]}),d.jsxs("form",{onSubmit:c,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"session-id",className:"text-sm font-medium text-stone-200",children:"Local session ID"}),d.jsx("input",{id:"session-id",value:t,onChange:f=>n(f.target.value),placeholder:"019d6fb7-7033-7a30-a2c7-74d0919e87d4",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),l&&d.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l}),d.jsx("div",{className:"flex flex-wrap items-center gap-3",children:d.jsx("button",{type:"submit",disabled:r,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:r?"Importing...":"Import Session"})})]})]})}function Fh(e){return e.enabled&&e.capabilities.sessions.resume&&e.capabilities.turns.start}function RY(e,t){var r;const n=e.find(i=>i.provider===t);return n&&Fh(n)?n.provider:((r=e.find(Fh))==null?void 0:r.provider)??dl}function LY(){const e=is(),t=fo(),[n]=rk(),[r,i]=T.useState([]),[l,o]=T.useState([]),[c,f]=T.useState([]),[h,g]=T.useState((t==null?void 0:t.defaultBackend)??dl),[p,x]=T.useState(""),[E,v]=T.useState(""),[C,S]=T.useState(""),[w,O]=T.useState("yolo"),[R,j]=T.useState(!0),[G,N]=T.useState(!1),[P,$]=T.useState(null),ne=n.get("workspaceId");T.useEffect(()=>{let Q=!1;return Promise.all([O1(),lk()]).then(async([_e,de])=>{var q,J,A;if(Q)return;const se=RY(de,(t==null?void 0:t.defaultBackend)??dl);g(se),o(de);const H=await wg(se);if(Q)return;i(_e),f(H);const ce=_e.some(U=>U.id===ne)?ne:((q=_e[0])==null?void 0:q.id)??"";x(ce),v(((J=H.find(U=>U.isDefault))==null?void 0:J.model)??((A=H[0])==null?void 0:A.model)??"")}).catch(_e=>{Q||$(_e instanceof Error?_e.message:"Unable to load creation form data.")}).finally(()=>{Q||j(!1)}),()=>{Q=!0}},[ne]),T.useEffect(()=>{if(!h)return;let Q=!1;return f([]),v(""),$(null),wg(h).then(_e=>{var de,se;Q||(f(_e),v(((de=_e.find(H=>H.isDefault))==null?void 0:de.model)??((se=_e[0])==null?void 0:se.model)??""))}).catch(_e=>{Q||(f([]),v(""),$(_e instanceof Error?_e.message:"Unable to load backend models."))}),()=>{Q=!0}},[h]);function W(){if(window.history.length>1){e(-1);return}if(ne){e(`/threads?workspaceId=${encodeURIComponent(ne)}`);return}e("/workspaces")}async function me(Q){Q.preventDefault(),N(!0),$(null);try{const _e=await P6(C.trim()?{workspaceId:p,provider:h,model:E,approvalMode:w,title:C.trim()}:{workspaceId:p,provider:h,model:E,approvalMode:w});e(`/threads/${_e.id}`)}catch(_e){_e instanceof Yt?$(_e.payload.message):$(_e instanceof Error?_e.message:"Unable to create thread.")}finally{N(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"New Thread"}),d.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Start a backend session"}),d.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Choose the workspace, model, and approval mode that should back the new thread."})]}),R?d.jsx("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 px-6 py-12 text-center text-stone-400",children:"Loading creation form..."}):d.jsxs("form",{onSubmit:me,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-backend",children:"Backend"}),d.jsx("select",{id:"thread-backend",value:h,onChange:Q=>{const _e=Q.target.value;g(_e)},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(Q=>d.jsxs("option",{value:Q.provider,disabled:!Fh(Q),children:[Q.displayName,Fh(Q)?"":" (not available)"]},Q.provider))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-workspace",children:"Workspace"}),d.jsx("select",{id:"thread-workspace",value:p,onChange:Q=>x(Q.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(Q=>d.jsxs("option",{value:Q.id,children:[Q.label," · ",Q.absPath]},Q.id))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-model",children:"Model"}),d.jsxs("select",{id:"thread-model",value:E,onChange:Q=>v(Q.target.value),disabled:c.length===0,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.length===0?d.jsx("option",{value:"",children:"No models available"}):null,c.map(Q=>d.jsxs("option",{value:Q.model,children:[Q.displayName," · ",Q.model]},Q.id))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-title",children:"Title"}),d.jsx("input",{id:"thread-title",value:C,onChange:Q=>S(Q.target.value),placeholder:"Optional. Falls back to first prompt.",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-approval-mode",children:"Approval mode"}),d.jsxs("select",{id:"thread-approval-mode",value:w,onChange:Q=>O(Q.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:[d.jsx("option",{value:"yolo",children:"yolo"}),d.jsx("option",{value:"guarded",children:"guarded"})]})]}),P&&d.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:P}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[d.jsx("button",{type:"submit",disabled:G||!p||!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:G?"Creating...":"Create Thread"}),d.jsx("button",{type:"button",onClick:W,disabled:G,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 IY(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function OY(){const[e]=rk(),t=is(),n=fo(),r=e.get("workspaceId"),[i,l]=T.useState([]),[o,c]=T.useState([]),[f,h]=T.useState(null),[g,p]=T.useState(!0),[x,E]=T.useState(null),[v,C]=T.useState(null),[S,w]=T.useState(""),[O,R]=T.useState(null),[j,G]=T.useState(null),[N,P]=T.useState(!1);async function $(){p(!0),E(null);try{const[q,J,A]=await Promise.all([ok((n==null?void 0:n.defaultBackend)??dl).then(U=>U.status),uk(),O1()]);h(q),l(J),c(A)}catch(q){E(q instanceof Error?q.message:"Unable to load threads.")}finally{p(!1)}}T.useEffect(()=>{if(r===null)return;$();const q=fk(J=>{l(A=>A.map(U=>U.id===J.threadId?{...U,status:J.type==="thread.updated"&&typeof J.payload.status=="string"?J.payload.status:U.status,lastError:(J.type==="thread.turn.failed"||J.type==="thread.turn.completed")&&typeof J.payload.error=="string"?J.payload.error:U.lastError,title:J.type==="thread.updated"&&typeof J.payload.title=="string"?J.payload.title:U.title}:U))});return()=>{q.close()}},[r,n==null?void 0:n.defaultBackend]);const ne=Object.fromEntries(o.map(q=>[q.id,q.label])),W=o.find(q=>q.id===r)??null,me=T.useMemo(()=>r?i.filter(q=>q.workspaceId===r):[],[r,i]),Q=me.filter(q=>q.status==="running").length,_e=r?`/threads/new?workspaceId=${encodeURIComponent(r)}`:"/threads/new";if(r===null)return d.jsx(IA,{to:"/workspaces",replace:!0});function de(){switch(f==null?void 0:f.state){case"ready":return"bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.14)]";case"starting":return"bg-amber-300 shadow-[0_0_0_3px_rgba(252,211,77,0.12)]";case"degraded":case"failed":return"bg-rose-400 shadow-[0_0_0_3px_rgba(251,113,133,0.14)]";default:return"bg-stone-500 shadow-[0_0_0_3px_rgba(120,113,108,0.14)]"}}async function se(q,J){try{const A=await ck(q,{title:J});l(U=>U.map(ee=>ee.id===A.id?{...ee,title:A.title,updatedAt:A.updatedAt}:ee))}catch(A){throw E(A instanceof Error?A.message:"Unable to rename thread."),A}}async function H(){if(!v)return;const q=S.trim();if(q){R(v);try{await se(v,q),C(null),w("")}finally{R(null)}}}async function ce(){if(j){P(!0);try{await dk(j.id),l(q=>q.filter(J=>J.id!==j.id)),G(null)}catch(q){E(q instanceof Error?q.message:"Unable to delete thread.")}finally{P(!1)}}}return d.jsx(z5,{threads:i,workspaceLabels:ne,status:f,loading:g,error:x,viewportConstrained:r!==null,showMobileAppMenu:!0,showMobileThreadNavToggle:!1,showMobileNewThreadShortcut:!1,currentWorkspaceId:r,currentWorkspaceLabel:(W==null?void 0:W.label)??null,onRenameThread:se,onDeleteThread:G,children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[2rem] border border-stone-800 bg-stone-900/85 shadow-2xl shadow-stone-950/20",children:[d.jsx("div",{className:"border-b border-stone-800 px-4 py-3 sm:px-6 sm:py-4",children:d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("h2",{className:"min-w-0 truncate text-base font-semibold text-stone-100 sm:text-lg",title:W?`${W.label} threads`:"All threads",children:W?W.label:"All Threads"}),d.jsx(gi,{to:_e,className:"inline-flex h-9 shrink-0 items-center rounded-full bg-amber-300 px-3.5 text-xs font-medium uppercase tracking-[0.18em] text-stone-950 transition hover:bg-amber-200",children:"New Thread"})]})}),d.jsx("div",{className:"px-4 py-3 sm:px-6 sm:py-4",children:d.jsxs("article",{className:"inline-flex min-w-[12rem] max-w-full items-center gap-3 rounded-[1.25rem] border border-stone-800 bg-stone-950/70 px-3.5 py-2.5",children:[d.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 shrink-0 rounded-full ${de()}`}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.22em] text-stone-500",children:"Supervisor"}),d.jsx("p",{className:"truncate text-sm text-stone-200",children:(f==null?void 0:f.lastError)??((f==null?void 0:f.state)==="ready"?"Ready":(f==null?void 0:f.state)??"Checking")})]})]})}),!g&&!x&&me.length>0&&d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-stone-800 px-4 py-4 sm:px-6 sm:py-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-stone-500",children:"Recent Threads"}),d.jsxs("span",{className:"rounded-full border border-amber-300/30 bg-amber-300/10 px-2 py-0.5 text-[11px] font-medium uppercase tracking-[0.18em] text-amber-200",children:[me.length," total"]}),Q>0&&d.jsxs("span",{className:"text-xs text-stone-500",children:["· ",Q," running"]})]}),d.jsx("div",{className:"mt-3 min-h-0 flex-1",children:d.jsx(F5,{threads:me,currentWorkspaceId:r,workspaceLabels:ne,onOpenThread:q=>t(`/threads/${q}`),onBeginRenameThread:q=>{C(q.id),w(q.title)},onDeleteThread:q=>G(q),scrollable:!0,maxHeightClassName:"max-h-full",showDeleteButton:!0,showSessionCopyButton:!0})})]}),!g&&!x&&me.length===0&&d.jsx("div",{className:"border-t border-stone-800 px-4 py-6 text-sm text-stone-500 sm:px-6",children:"No threads available in this workspace."})]}),d.jsx(zb,{open:v!==null,title:"Rename Thread",label:"Thread Title",value:S,busy:O!==null,onChange:w,onCancel:()=>{C(null),w("")},onSubmit:()=>void H()}),d.jsx(M1,{open:j!==null,title:"Delete Thread",description:j?`Delete ${IY(j.title)} from supervisor. The backend session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:N,onCancel:()=>{N||G(null)},onConfirm:()=>void ce()})]})})}function Pv(e){const t=e.trim(),n=t.replace(/[\\/]+$/,"");if(!n)return"";if(q5(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 q5(e){const t=e.trim();return/^https?:\/\/.+/i.test(t)||/^ssh:\/\/.+/i.test(t)||/^git@[^:]+:.+/.test(t)}function DY({initialPath:e="",initialLabel:t="",submitLabel:n="Save Workspace",error:r,busy:i=!1,onSubmit:l}){const o=Pv(e),[c,f]=T.useState(e),[h,g]=T.useState(t||o),[p,x]=T.useState(null),E=T.useRef(o);T.useEffect(()=>{const C=Pv(c);g(S=>!S.trim()||S===E.current?C:S),E.current=C},[c]);async function v(C){C.preventDefault();const S=c.trim();if(!S){x("Workspace path or Git URL is required.");return}x(null);const w=h.trim(),O=q5(S)?"gitUrl":"absPath";await l(w?{[O]:S,label:w}:{[O]:S})}return d.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"workspace-path",className:"text-sm font-medium text-stone-200",children:"Path or Git URL"}),d.jsx("input",{id:"workspace-path",name:"absPath",value:c,onChange:C=>f(C.target.value),placeholder:"/Users/name/project or https://github.com/owner/repo.git",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),d.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Absolute paths register local directories. Git URLs clone into the configured dev home."})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"workspace-label",className:"text-sm font-medium text-stone-200",children:"Display label"}),d.jsx("input",{id:"workspace-label",name:"label",value:h,onChange:C=>g(C.target.value),placeholder:"Optional override",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),d.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Defaults to the last folder name. You can override it."})]}),(p||r)&&d.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:p??r}),d.jsx("button",{type:"submit",disabled:i,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:i?"Saving...":n})]})}function jY(){const e=is(),[t,n]=T.useState(null),[r,i]=T.useState(!1);async function l(o){i(!0),n(null);try{const c=await rR(o);e(`/threads?workspaceId=${encodeURIComponent(c.id)}`)}catch(c){c instanceof Yt?n(c.payload.message):n(c instanceof Error?c.message:"Unable to create workspace.")}finally{i(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Add Workspace"}),d.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Create a workspace"}),d.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Register an existing local directory, create one missing child directory under dev home, or clone a Git repository into dev home."})]}),d.jsx(DY,{busy:r,error:t,submitLabel:"Create Workspace",onSubmit:l})]})}function Bv(e){return Date.parse(e.lastOpenedAt??e.createdAt)}function MY(e,t){return e.isFavorite!==t.isFavorite?e.isFavorite?-1:1:Bv(t)-Bv(e)}function PY(e){return e?new Date(e).toLocaleString():"Never opened"}function BY(e,t=28){return e.length<=t?e:`...${e.slice(-(t-3))}`}function UY({active:e}){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-current ${e?"rotate-[18deg]":"rotate-[8deg]"}`,children:d.jsx("path",{d:"M10.7 1.75c.34 0 .62.28.62.63v1.24l1.43 1.42c.24.24.24.62 0 .86l-1.1 1.1v2.02c0 .17-.07.33-.19.45l-1.5 1.5v2.28c0 .28-.18.53-.44.6a.62.62 0 0 1-.69-.24L7.2 12.4l-2.83 2.83a.625.625 0 1 1-.88-.88l2.83-2.83-2.2-1.62a.62.62 0 0 1-.24-.69c.08-.26.32-.44.6-.44h2.28l1.5-1.5a.64.64 0 0 1 .45-.18h2.02l1.1-1.11-1.42-1.42H9.07a.63.63 0 0 1-.62-.63c0-.34.28-.62.62-.62h1.63Z"})})}function HY(){return d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:d.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Zm1.53 1.32c.35 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Zm2.82 0c.34 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Z"})})}function FY(){const e=is(),[t,n]=T.useState([]),[r,i]=T.useState(!0),[l,o]=T.useState(null),[c,f]=T.useState(null),[h,g]=T.useState(""),[p,x]=T.useState(null),[E,v]=T.useState(null),[C,S]=T.useState(null),[w,O]=T.useState(!1);async function R(){i(!0),o(null);try{n(await O1())}catch(Q){o(Q instanceof Error?Q.message:"Unable to load workspaces.")}finally{i(!1)}}T.useEffect(()=>{R()},[]);async function j(Q){const _e={...Q,isFavorite:!Q.isFavorite};n(de=>de.map(se=>se.id===Q.id?_e:se));try{const de=await iR(Q.id,{isFavorite:!Q.isFavorite});n(se=>se.map(H=>H.id===de.id?de:H))}catch(de){n(se=>se.map(H=>H.id===Q.id?Q:H)),o(de instanceof Error?de.message:"Unable to update workspace.")}}async function G(Q){const _e=h.trim();if(_e){x(Q);try{const de=await aR(Q,{label:_e});n(se=>se.map(H=>H.id===de.id?de:H)),f(null),g("")}catch(de){o(de instanceof Error?de.message:"Unable to rename workspace.")}finally{x(null)}}}function N(Q){f(Q.id),g(Q.label)}function P(){f(null),g("")}function $(Q){e(`/threads?workspaceId=${encodeURIComponent(Q)}`)}async function ne(){if(C){O(!0);try{await sR(C.id),n(Q=>Q.filter(_e=>_e.id!==C.id)),S(null)}catch(Q){o(Q instanceof Error?Q.message:"Unable to delete workspace.")}finally{O(!1)}}}function W(Q,_e){(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),$(_e))}const me=T.useMemo(()=>[...t].sort(MY),[t]);return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"sticky top-[env(safe-area-inset-top)] z-20 -mx-4 border-b border-stone-800/90 bg-stone-950/96 px-2.5 py-2 backdrop-blur sm:mx-0 sm:rounded-[1.4rem] sm:border sm:px-4",children:d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-2",children:[d.jsx(D1,{}),d.jsx(gi,{to:"/threads/import",className:"inline-flex h-8 shrink-0 items-center rounded-full border border-sky-400/30 bg-sky-400/10 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-sky-100 transition hover:border-sky-300/45 hover:bg-sky-400/16 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Import"}),d.jsx(gi,{to:"/workspaces/new",className:"inline-flex h-8 shrink-0 items-center rounded-full bg-amber-300 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-stone-950 transition hover:bg-amber-200 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Create"}),d.jsx("div",{className:"min-w-0 flex-1 text-right",children:d.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.24em] text-stone-500",children:"Workspaces"})})]}),d.jsx(j1,{className:"absolute left-0 top-[calc(100%+0.5rem)] z-30 w-[min(22rem,calc(100vw-1rem))]"})]})}),r&&d.jsx("div",{className:"rounded-[1.6rem] border border-stone-800 bg-stone-900/85 px-6 py-12 text-center text-stone-400",children:"Loading workspace registry..."}),l&&d.jsx("div",{className:"rounded-[1.4rem] border border-rose-500/30 bg-rose-500/10 px-4 py-4 text-rose-100",children:l}),!r&&!l&&t.length===0&&d.jsxs("div",{className:"rounded-[1.6rem] border border-dashed border-stone-700 bg-stone-900/80 px-6 py-12 text-center",children:[d.jsx("p",{className:"text-lg font-medium text-stone-100",children:"No workspaces yet"}),d.jsx("p",{className:"mt-2 text-sm text-stone-500",children:"Add a local directory inside the configured workspace root to start building the registry."})]}),!r&&me.length>0&&d.jsx("div",{className:"space-y-2 overflow-x-hidden",children:me.map(Q=>d.jsxs("article",{role:"link",tabIndex:0,onClick:()=>$(Q.id),onKeyDown:_e=>W(_e,Q.id),className:"relative overflow-hidden rounded-[1.35rem] border border-stone-800 bg-stone-900/88 px-4 py-3 shadow-lg shadow-stone-950/10 transition hover:border-stone-700 hover:bg-stone-900",children:[d.jsxs("div",{className:"absolute right-2.5 top-2.5 flex items-center gap-1.5",children:[d.jsx("button",{type:"button","aria-label":`Delete workspace ${Q.label}`,title:"Delete workspace",onClick:_e=>{_e.stopPropagation(),S(Q)},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-rose-400/20 bg-rose-400/10 text-rose-200 transition hover:bg-rose-400/18",children:d.jsx(HY,{})}),d.jsx("button",{type:"button","aria-label":Q.isFavorite?`Unpin workspace ${Q.label}`:`Pin workspace ${Q.label}`,title:Q.isFavorite?"Unpin workspace":"Pin workspace",onClick:_e=>{_e.stopPropagation(),j(Q)},className:`inline-flex h-7 w-7 items-center justify-center rounded-full border transition ${Q.isFavorite?"border-amber-300/40 bg-amber-300/15 text-amber-200":"border-stone-700 bg-stone-900/72 text-stone-500 hover:text-stone-200"}`,children:d.jsx(UY,{active:Q.isFavorite})})]}),d.jsx("div",{className:"flex min-w-0 items-start gap-3 pr-[4.6rem]",children:d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[d.jsx("p",{className:"min-w-0 max-w-full truncate text-base font-semibold text-stone-100 sm:text-lg",title:Q.label,children:Q.label}),d.jsx("button",{type:"button",onClick:_e=>{_e.stopPropagation(),N(Q)},"aria-label":`Rename workspace ${Q.label}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-stone-500 transition hover:text-stone-100",children:d.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:d.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})})]}),d.jsx("button",{type:"button","aria-label":Q.absPath,title:Q.absPath,onClick:_e=>{_e.stopPropagation(),v(Q.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:BY(Q.absPath)}),d.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-stone-500",children:d.jsxs("span",{className:"min-w-0 truncate",children:["Last opened: ",PY(Q.lastOpenedAt)]})})]})})]},Q.id))}),d.jsx(zb,{open:c!==null,title:"Rename Workspace",label:"Workspace Label",value:h,busy:p!==null,onChange:g,onCancel:P,onSubmit:()=>c?G(c):void 0}),d.jsx(L5,{open:E!==null,title:"Workspace Path",text:E??"",onClose:()=>v(null)}),d.jsx(M1,{open:C!==null,title:"Delete Workspace",description:C?`Delete ${C.label} from supervisor. This also removes its threads and local supervisor metadata.`:"",confirmLabel:"Delete Workspace",busy:w,onCancel:()=>{w||S(null)},onConfirm:()=>void ne()})]})}const Y5="remote-codex-theme-mode",W5="remote-codex-default-backend";function zY(){if(typeof window>"u")return"system";const e=window.localStorage.getItem(Y5);return e==="light"||e==="dark"||e==="system"?e:"system"}function $Y(){if(typeof window>"u")return dl;const e=window.localStorage.getItem(W5);return b6(e)??dl}function VY(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function GY({themeMode:e,setThemeMode:t,effectiveTheme:n}){const[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,f]=T.useState($Y),h=ga(),g=/^\/threads\/[^/]+$/.test(h.pathname),p=h.pathname==="/threads",x=g||p,E=p||g,v=h.pathname==="/workspaces",C=v||p;T.useEffect(()=>{i(!1)},[h.pathname,h.search]);function S(w){f(w),window.localStorage.setItem(W5,w)}return d.jsxs(ik.Provider,{value:{navOpen:r,openNav:()=>i(!0),toggleNav:()=>i(w=>!w),closeNav:()=>i(!1),settingsOpen:l,openSettings:()=>{i(!1),o(!0)},closeSettings:()=>o(!1),themeMode:e,setThemeMode:t,effectiveTheme:n,defaultBackend:c,setDefaultBackend:S},children:[d.jsxs("div",{className:`bg-[var(--app-bg)] text-[var(--app-fg)] ${x?"fixed inset-0 overflow-hidden overscroll-none":"min-h-screen"}`,children:[!C&&d.jsxs("div",{className:`fixed left-4 top-4 z-50 ${g?"hidden sm:block":""}`,children:[d.jsx(D1,{}),d.jsx(j1,{className:"mt-3 w-[min(22rem,calc(100vw-2rem))]"})]}),d.jsx("main",{className:`mx-auto w-full max-w-[1600px] ${x?"absolute inset-0 pb-0 sm:pb-4":"pb-4"} ${E?g||p?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-[calc(env(safe-area-inset-top)+4rem)] sm:pt-4":v?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-4"} ${x?"overflow-hidden overscroll-none px-0 sm:px-6":"px-4 sm:px-6"}`,children:d.jsx("section",{className:`min-w-0 ${x?g?"h-full min-h-0 overflow-hidden overscroll-none":"h-full overflow-hidden overscroll-none":""}`,children:d.jsx(OA,{})})})]}),d.jsx(bR,{})]})}function qY(){const[e,t]=T.useState(()=>zY()),[n,r]=T.useState(()=>VY()),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(Y5,e)},[e]),T.useEffect(()=>{const l=document.documentElement;l.dataset.themeMode=e,l.dataset.themeEffective=i,l.style.colorScheme=i},[i,e]),d.jsx("div",{className:"theme-shell theme-scrollbar",children:d.jsx(i6,{children:d.jsxs(jA,{children:[d.jsx(ci,{path:"/",element:d.jsx(xR,{})}),d.jsxs(ci,{element:d.jsx(GY,{themeMode:e,setThemeMode:t,effectiveTheme:i}),children:[d.jsx(ci,{path:"/workspaces",element:d.jsx(FY,{})}),d.jsx(ci,{path:"/workspaces/new",element:d.jsx(jY,{})}),d.jsx(ci,{path:"/threads",element:d.jsx(OY,{})}),d.jsx(ci,{path:"/threads/import",element:d.jsx(AY,{})}),d.jsx(ci,{path:"/threads/new",element:d.jsx(LY,{})}),d.jsx(ci,{path:"/threads/:id",element:d.jsx(NY,{})})]})]})})})}ON.createRoot(document.getElementById("root")).render(d.jsx(CN.StrictMode,{children:d.jsx(qY,{})}));const YY=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:R5},Symbol.toStringTag,{value:"Module"}));export{IV as A,eW as L,ma as R,zh as g,d as j,T as r};